Search is not available for this dataset
query
stringlengths
7
355k
document
stringlengths
9
341k
metadata
dict
negatives
listlengths
0
101
negative_scores
listlengths
0
101
document_score
stringlengths
3
10
document_rank
stringclasses
102 values
Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file distributed with this work for additional information regarding copyright ownership. The ASF licenses this file to you under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
function _default(dom, ecModel) { var ariaModel = ecModel.getModel('aria'); if (!ariaModel.get('show')) { return; } else if (ariaModel.get('description')) { dom.setAttribute('aria-label', ariaModel.get('description')); return; } var seriesCnt = 0; ecModel.eachSeries(function (seriesModel, idx) { ++seriesCnt; }, this); var maxDataCnt = ariaModel.get('data.maxCount') || 10; var maxSeriesCnt = ariaModel.get('series.maxCount') || 10; var displaySeriesCnt = Math.min(seriesCnt, maxSeriesCnt); var ariaLabel; if (seriesCnt < 1) { // No series, no aria label return; } else { var title = getTitle(); if (title) { ariaLabel = replace(getConfig('general.withTitle'), { title: title }); } else { ariaLabel = getConfig('general.withoutTitle'); } var seriesLabels = []; var prefix = seriesCnt > 1 ? 'series.multiple.prefix' : 'series.single.prefix'; ariaLabel += replace(getConfig(prefix), { seriesCount: seriesCnt }); ecModel.eachSeries(function (seriesModel, idx) { if (idx < displaySeriesCnt) { var seriesLabel; var seriesName = seriesModel.get('name'); var seriesTpl = 'series.' + (seriesCnt > 1 ? 'multiple' : 'single') + '.'; seriesLabel = getConfig(seriesName ? seriesTpl + 'withName' : seriesTpl + 'withoutName'); seriesLabel = replace(seriesLabel, { seriesId: seriesModel.seriesIndex, seriesName: seriesModel.get('name'), seriesType: getSeriesTypeName(seriesModel.subType) }); var data = seriesModel.getData(); window.data = data; if (data.count() > maxDataCnt) { // Show part of data seriesLabel += replace(getConfig('data.partialData'), { displayCnt: maxDataCnt }); } else { seriesLabel += getConfig('data.allData'); } var dataLabels = []; for (var i = 0; i < data.count(); i++) { if (i < maxDataCnt) { var name = data.getName(i); var value = retrieveRawValue(data, i); dataLabels.push(replace(name ? getConfig('data.withName') : getConfig('data.withoutName'), { name: name, value: value })); } } seriesLabel += dataLabels.join(getConfig('data.separator.middle')) + getConfig('data.separator.end'); seriesLabels.push(seriesLabel); } }); ariaLabel += seriesLabels.join(getConfig('series.multiple.separator.middle')) + getConfig('series.multiple.separator.end'); dom.setAttribute('aria-label', ariaLabel); } function replace(str, keyValues) { if (typeof str !== 'string') { return str; } var result = str; zrUtil.each(keyValues, function (value, key) { result = result.replace(new RegExp('\\{\\s*' + key + '\\s*\\}', 'g'), value); }); return result; } function getConfig(path) { var userConfig = ariaModel.get(path); if (userConfig == null) { var pathArr = path.split('.'); var result = lang.aria; for (var i = 0; i < pathArr.length; ++i) { result = result[pathArr[i]]; } return result; } else { return userConfig; } } function getTitle() { var title = ecModel.getModel('title').option; if (title && title.length) { title = title[0]; } return title && title.text; } function getSeriesTypeName(type) { return lang.series.typeNames[type] || '自定义图'; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "get Android() {}", "function SBRecordsetPHP_analyzePlatformSpecific()\r\n{\r\n\r\n\r\n}", "onChildAppStart () {\n\n }", "private internal function m248() {}", "private public function m246() {}", "onMessageStart() { }", "createStream () {\n\n }", "_playbackCompatibility() {\n // Detect audio playback capabilities.\n\n // Detect HTML5 Audio playback.\n // http://caniuse.com/#feat=audio\n this.canUseAudio = Boolean(new Audio());\n console.log('Native HTML5 Audio playback capability: ' +\n this.canUseAudio);\n\n // Detect Cordova Media Playback\n // It allows playing audio using the native bridge inside WebView Apps.\n // https://github.com/apache/cordova-plugin-media/blob/master/doc/index.md\n this.canUseCordovaMedia = Boolean(window.Media);\n console.log('Cordova Media playback capability: ' +\n this.canUseCordovaMedia);\n\n if (!(this.canUseAudio || this.canUseCordovaMedia)) {\n throw new Error(\n 'Some form of audio playback capability is required');\n }\n\n var _audio = new Audio();\n if (_audio.canPlayType === 'function') {\n throw new Error(\n 'Unable to detect audio playback capabilities');\n }\n\n var canPlayOggVorbis = _audio.canPlayType(\n 'audio/ogg; codecs=\"vorbis\"') !== '';\n var canPlayOggOpus = _audio.canPlayType(\n 'audio/ogg; codecs=\"opus\"') !== '';\n var canPlayWave = _audio.canPlayType('audio/wav') !== '';\n var canPlayMP3 = _audio.canPlayType('audio/mpeg; codecs=\"mp3\"') !== '';\n var canPlayAAC = _audio.canPlayType(\n 'audio/mp4; codecs=\"mp4a.40.2\"') !== '';\n var canPlay3GPP = _audio.canPlayType(\n 'audio/3gpp; codecs=\"samr\"') !== '';\n\n console.log('Native Vorbis audio in Ogg container playback capability: ' +\n canPlayOggVorbis);\n console.log('Native Opus audio in Ogg container playback capability: ' +\n canPlayOggOpus);\n console.log('Native PCM audio in Waveform Audio File Format (WAVE) ' +\n 'playback capability: ' + canPlayWave);\n console.log('Native MPEG Audio Layer 3 (MP3) playback capability: ' +\n canPlayMP3);\n console.log('Native Low-Complexity AAC audio in MP4 container playback ' +\n 'capability: ' + canPlayAAC);\n console.log('Native AMR audio in 3GPP container playback capability: ' +\n canPlay3GPP);\n\n if (!(canPlayWave || canPlayMP3)) {\n throw new Error(\n 'Native Wave or MP3 playback is required');\n }\n }", "constructor() {\n\t}", "constructor() {\n\t}", "constructor() {\n\n\t}", "onComponentMount() {\n\n }", "constructor() {\n throw new Error('Not implemented');\n }", "supportsPlatform() {\n return true;\n }", "function _____SHARED_functions_____(){}", "constructor() {\n }", "constructor() {\n\t\t// ...\n\t}", "static get tag(){return\"hal-9000\"}", "static getDeviceModel() {\n return \"zhimi.fan.za4\";\n }", "requestContainerInfo() {}", "constructor () { super() }", "function BaseDeviceProfile() {\n \n this.audioNeedsTranscodingCodecs = []; // fill these with audio codecs that the implemented device can handle natively\n this.videoNeedsTranscodingCodecs = []; // fill these with video codecs that the implemented device can handle natively\n this.validFormats = []; // fill these with video formats that the implemented device can handle natively\n\n this.transcodeOptions = {\n rescaleVideo : false, // BaseDeviceProfile.prototype.rescale\n subtitle : false, // BaseDeviceProfile.prototype.hardCodeSubtitle\n audioShiftCorrect : false // BaseDeviceProfile.prototype.correctAudioOffset\n };\n\n /**\n * @todo: whutz this?\n * @param {[type]} probeData [description]\n * @return {[type]} [description]\n */\n this.canPlayContainer = function (probeData) {\n throw new Error(\"canPlayContainer : Not Implemented\");\n };\n\n /**\n * Implement this method to return device specific ffmpeg flags for a probed media\n * @param {object} probeData ffmpeg probe data\n * @param {[type]} forceTranscode force transcode even if native format?\n * @return {Promise} [description]\n */\n this.getFFmpegFlags = function (probeData, forceTranscode) {\n throw new Error(\"getFFmpegFlags : Not Implemented!\");\n };\n\n}", "static get STATUS() {\n return 0;\n }", "static create () {}", "get() {}", "didMount() {\n }", "_onMessage() {\n throw new Error(\"not implemented\");\n }", "onReady() {}", "native() {\n throw new Error('NOT_IMPLEMENTED_EXCEPTION: you must override this method in order to use it')\n }", "function sdk(){\n}", "constructor () {\r\n\t\t\r\n\t}", "transient private protected internal function m182() {}", "function version(){ return \"0.13.0\" }", "static getDeviceModel() {\n return \"zhimi.fan.za5\";\n }", "started () {}", "function getVersion(){return _VERSION}", "transient private internal function m185() {}", "constructor() {\r\n }", "started() { }", "InitVsaEngine() {\n\n }", "started() {\r\n\r\n\t}", "function SigV4Utils() { }", "static get NOT_READY () {return 0}", "started () {\n\n }", "started () {\n\n }", "started () {\n\n }", "initialize() {\n\n }", "onMessageReceive() {}", "initialize()\n {\n }", "_get () {\n throw new Error('_get not implemented')\n }", "get () {\n }", "constructor() { }", "constructor() { }", "constructor() { }", "constructor() { }", "constructor() { }", "constructor() { }", "constructor() { }", "constructor() { }", "constructor() { }", "constructor() { }", "constructor() { }", "function getImplementation( cb ){\n\n }", "started() {}", "started() {}", "started() {}", "started() {}", "started() {}", "started() {}", "started() {}", "started() {}", "started() {}", "started() {}", "heartbeat () {\n }", "constructor() {\n \n }", "constructor() {\n \n }", "constructor() {\n \n }", "constructor() {\n \n }", "constructor() {\n \n }", "constructor() {\n \n }", "constructor() {\n \n }", "constructor() {\n \n }", "constructor() {\n \n }", "constructor() {\n \n }", "constructor() {\n \n }", "constructor() {\n \n }", "constructor() {\n \n }", "constructor() {\n \n }", "constructor() {\n \n }", "constructor() {\n \n }", "constructor() {\n \n }", "constructor() {\n \n }", "constructor() {\n \n }", "constructor() {\n \n }", "initleancloud() {\n AV.init({\n appId: keys.appId,\n appKey: keys.appKey\n })\n this.globalData.AV = AV\n }", "static final private internal function m106() {}", "getStreamPosition() {\n return Native.getStreamPosition();\n }", "onMessage() {}", "onMessage() {}", "constructor() {\n super();\n this._logger = new pip_services3_components_node_3.CompositeLogger();\n this._connectionResolver = new connect_1.AwsConnectionResolver();\n this._connectTimeout = 30000;\n this._client = null; //AmazonCloudWatchClient\n this._opened = false;\n }", "get WSAPlayerX64() {}" ]
[ "0.5349978", "0.48933455", "0.48501366", "0.48083982", "0.4772584", "0.474481", "0.47349635", "0.47027457", "0.46929818", "0.46929818", "0.4673667", "0.4644517", "0.46389893", "0.46253318", "0.4618249", "0.4582536", "0.45813942", "0.45742747", "0.45687214", "0.45623618", "0.45563498", "0.45493752", "0.45489514", "0.45457798", "0.4538844", "0.45218396", "0.45187637", "0.4498104", "0.44946006", "0.44832855", "0.44729492", "0.44691566", "0.44642788", "0.44588575", "0.44554883", "0.4453296", "0.44531393", "0.4443642", "0.44374335", "0.44267404", "0.44238108", "0.44228086", "0.4407407", "0.44043022", "0.44043022", "0.44043022", "0.44035548", "0.4393825", "0.43761918", "0.43697277", "0.4364149", "0.43530616", "0.43530616", "0.43530616", "0.43530616", "0.43530616", "0.43530616", "0.43530616", "0.43530616", "0.43530616", "0.43530616", "0.43530616", "0.43517888", "0.43511248", "0.43511248", "0.43511248", "0.43511248", "0.43511248", "0.43511248", "0.43511248", "0.43511248", "0.43511248", "0.43511248", "0.43502304", "0.43493763", "0.43493763", "0.43493763", "0.43493763", "0.43493763", "0.43493763", "0.43493763", "0.43493763", "0.43493763", "0.43493763", "0.43493763", "0.43493763", "0.43493763", "0.43493763", "0.43493763", "0.43493763", "0.43493763", "0.43493763", "0.43493763", "0.43493763", "0.43440503", "0.43416435", "0.43375877", "0.43357816", "0.43357816", "0.43336093", "0.43330038" ]
0.0
-1
Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file distributed with this work for additional information regarding copyright ownership. The ASF licenses this file to you under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
function Scheduler(ecInstance, api, dataProcessorHandlers, visualHandlers) { this.ecInstance = ecInstance; this.api = api; this.unfinished; // Fix current processors in case that in some rear cases that // processors might be registered after echarts instance created. // Register processors incrementally for a echarts instance is // not supported by this stream architecture. var dataProcessorHandlers = this._dataProcessorHandlers = dataProcessorHandlers.slice(); var visualHandlers = this._visualHandlers = visualHandlers.slice(); this._allHandlers = dataProcessorHandlers.concat(visualHandlers); /** * @private * @type { * [handlerUID: string]: { * seriesTaskMap?: { * [seriesUID: string]: Task * }, * overallTask?: Task * } * } */ this._stageTaskMap = createHashMap(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "get Android() {}", "function SBRecordsetPHP_analyzePlatformSpecific()\r\n{\r\n\r\n\r\n}", "onChildAppStart () {\n\n }", "private internal function m248() {}", "private public function m246() {}", "onMessageStart() { }", "createStream () {\n\n }", "_playbackCompatibility() {\n // Detect audio playback capabilities.\n\n // Detect HTML5 Audio playback.\n // http://caniuse.com/#feat=audio\n this.canUseAudio = Boolean(new Audio());\n console.log('Native HTML5 Audio playback capability: ' +\n this.canUseAudio);\n\n // Detect Cordova Media Playback\n // It allows playing audio using the native bridge inside WebView Apps.\n // https://github.com/apache/cordova-plugin-media/blob/master/doc/index.md\n this.canUseCordovaMedia = Boolean(window.Media);\n console.log('Cordova Media playback capability: ' +\n this.canUseCordovaMedia);\n\n if (!(this.canUseAudio || this.canUseCordovaMedia)) {\n throw new Error(\n 'Some form of audio playback capability is required');\n }\n\n var _audio = new Audio();\n if (_audio.canPlayType === 'function') {\n throw new Error(\n 'Unable to detect audio playback capabilities');\n }\n\n var canPlayOggVorbis = _audio.canPlayType(\n 'audio/ogg; codecs=\"vorbis\"') !== '';\n var canPlayOggOpus = _audio.canPlayType(\n 'audio/ogg; codecs=\"opus\"') !== '';\n var canPlayWave = _audio.canPlayType('audio/wav') !== '';\n var canPlayMP3 = _audio.canPlayType('audio/mpeg; codecs=\"mp3\"') !== '';\n var canPlayAAC = _audio.canPlayType(\n 'audio/mp4; codecs=\"mp4a.40.2\"') !== '';\n var canPlay3GPP = _audio.canPlayType(\n 'audio/3gpp; codecs=\"samr\"') !== '';\n\n console.log('Native Vorbis audio in Ogg container playback capability: ' +\n canPlayOggVorbis);\n console.log('Native Opus audio in Ogg container playback capability: ' +\n canPlayOggOpus);\n console.log('Native PCM audio in Waveform Audio File Format (WAVE) ' +\n 'playback capability: ' + canPlayWave);\n console.log('Native MPEG Audio Layer 3 (MP3) playback capability: ' +\n canPlayMP3);\n console.log('Native Low-Complexity AAC audio in MP4 container playback ' +\n 'capability: ' + canPlayAAC);\n console.log('Native AMR audio in 3GPP container playback capability: ' +\n canPlay3GPP);\n\n if (!(canPlayWave || canPlayMP3)) {\n throw new Error(\n 'Native Wave or MP3 playback is required');\n }\n }", "constructor() {\n\t}", "constructor() {\n\t}", "constructor() {\n\n\t}", "onComponentMount() {\n\n }", "constructor() {\n throw new Error('Not implemented');\n }", "supportsPlatform() {\n return true;\n }", "function _____SHARED_functions_____(){}", "constructor() {\n }", "constructor() {\n\t\t// ...\n\t}", "static get tag(){return\"hal-9000\"}", "static getDeviceModel() {\n return \"zhimi.fan.za4\";\n }", "requestContainerInfo() {}", "constructor () { super() }", "function BaseDeviceProfile() {\n \n this.audioNeedsTranscodingCodecs = []; // fill these with audio codecs that the implemented device can handle natively\n this.videoNeedsTranscodingCodecs = []; // fill these with video codecs that the implemented device can handle natively\n this.validFormats = []; // fill these with video formats that the implemented device can handle natively\n\n this.transcodeOptions = {\n rescaleVideo : false, // BaseDeviceProfile.prototype.rescale\n subtitle : false, // BaseDeviceProfile.prototype.hardCodeSubtitle\n audioShiftCorrect : false // BaseDeviceProfile.prototype.correctAudioOffset\n };\n\n /**\n * @todo: whutz this?\n * @param {[type]} probeData [description]\n * @return {[type]} [description]\n */\n this.canPlayContainer = function (probeData) {\n throw new Error(\"canPlayContainer : Not Implemented\");\n };\n\n /**\n * Implement this method to return device specific ffmpeg flags for a probed media\n * @param {object} probeData ffmpeg probe data\n * @param {[type]} forceTranscode force transcode even if native format?\n * @return {Promise} [description]\n */\n this.getFFmpegFlags = function (probeData, forceTranscode) {\n throw new Error(\"getFFmpegFlags : Not Implemented!\");\n };\n\n}", "static get STATUS() {\n return 0;\n }", "static create () {}", "get() {}", "didMount() {\n }", "_onMessage() {\n throw new Error(\"not implemented\");\n }", "onReady() {}", "native() {\n throw new Error('NOT_IMPLEMENTED_EXCEPTION: you must override this method in order to use it')\n }", "function sdk(){\n}", "constructor () {\r\n\t\t\r\n\t}", "transient private protected internal function m182() {}", "function version(){ return \"0.13.0\" }", "static getDeviceModel() {\n return \"zhimi.fan.za5\";\n }", "started () {}", "function getVersion(){return _VERSION}", "transient private internal function m185() {}", "constructor() {\r\n }", "started() { }", "InitVsaEngine() {\n\n }", "started() {\r\n\r\n\t}", "function SigV4Utils() { }", "static get NOT_READY () {return 0}", "started () {\n\n }", "started () {\n\n }", "started () {\n\n }", "initialize() {\n\n }", "onMessageReceive() {}", "initialize()\n {\n }", "_get () {\n throw new Error('_get not implemented')\n }", "get () {\n }", "constructor() { }", "constructor() { }", "constructor() { }", "constructor() { }", "constructor() { }", "constructor() { }", "constructor() { }", "constructor() { }", "constructor() { }", "constructor() { }", "constructor() { }", "started() {}", "started() {}", "started() {}", "started() {}", "started() {}", "started() {}", "started() {}", "started() {}", "started() {}", "started() {}", "heartbeat () {\n }", "function getImplementation( cb ){\n\n }", "constructor() {\n \n }", "constructor() {\n \n }", "constructor() {\n \n }", "constructor() {\n \n }", "constructor() {\n \n }", "constructor() {\n \n }", "constructor() {\n \n }", "constructor() {\n \n }", "constructor() {\n \n }", "constructor() {\n \n }", "constructor() {\n \n }", "constructor() {\n \n }", "constructor() {\n \n }", "constructor() {\n \n }", "constructor() {\n \n }", "constructor() {\n \n }", "constructor() {\n \n }", "constructor() {\n \n }", "constructor() {\n \n }", "constructor() {\n \n }", "initleancloud() {\n AV.init({\n appId: keys.appId,\n appKey: keys.appKey\n })\n this.globalData.AV = AV\n }", "static final private internal function m106() {}", "getStreamPosition() {\n return Native.getStreamPosition();\n }", "onMessage() {}", "onMessage() {}", "constructor() {\n super();\n this._logger = new pip_services3_components_node_3.CompositeLogger();\n this._connectionResolver = new connect_1.AwsConnectionResolver();\n this._connectTimeout = 30000;\n this._client = null; //AmazonCloudWatchClient\n this._opened = false;\n }", "get WSAPlayerX64() {}" ]
[ "0.53485686", "0.48948148", "0.485071", "0.48078835", "0.4771538", "0.4744391", "0.47347194", "0.47043997", "0.46918696", "0.46918696", "0.46722504", "0.4643159", "0.46377665", "0.46263066", "0.4617044", "0.45812133", "0.45800942", "0.4572664", "0.4568672", "0.4561345", "0.45550427", "0.45506856", "0.45487913", "0.45443627", "0.45359328", "0.45206392", "0.45171604", "0.44963515", "0.44938648", "0.44823992", "0.44715983", "0.44681743", "0.44645038", "0.44587672", "0.44556332", "0.44525576", "0.44520926", "0.4442707", "0.44377562", "0.44267556", "0.4424001", "0.4422522", "0.4407004", "0.4404617", "0.4404617", "0.4404617", "0.44027838", "0.4392654", "0.43752563", "0.43675107", "0.4362618", "0.4352252", "0.4352252", "0.4352252", "0.4352252", "0.4352252", "0.4352252", "0.4352252", "0.4352252", "0.4352252", "0.4352252", "0.4352252", "0.435136", "0.435136", "0.435136", "0.435136", "0.435136", "0.435136", "0.435136", "0.435136", "0.435136", "0.435136", "0.43502438", "0.4349698", "0.43483686", "0.43483686", "0.43483686", "0.43483686", "0.43483686", "0.43483686", "0.43483686", "0.43483686", "0.43483686", "0.43483686", "0.43483686", "0.43483686", "0.43483686", "0.43483686", "0.43483686", "0.43483686", "0.43483686", "0.43483686", "0.43483686", "0.43483686", "0.43443006", "0.43404052", "0.4338547", "0.43343374", "0.43343374", "0.43337205", "0.43325585" ]
0.0
-1
Only some legacy stage handlers (usually in echarts extensions) are pure function. To ensure that they can work normally, they should work in block mode, that is, they should not be started util the previous tasks finished. So they cause the progressive rendering disabled. We try to detect the series type, to narrow down the block range to only the series type they concern, but not all series.
function detectSeriseType(legacyFunc) { seriesType = null; try { // Assume there is no async when calling `eachSeriesByType`. legacyFunc(ecModelMock, apiMock); } catch (e) {} return seriesType; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function _default(seriesType) {\n return {\n seriesType: seriesType,\n plan: createRenderPlanner(),\n reset: function (seriesModel) {\n var data = seriesModel.getData();\n var coordSys = seriesModel.coordinateSystem;\n var pipelineContext = seriesModel.pipelineContext;\n var isLargeRender = pipelineContext.large;\n\n if (!coordSys) {\n return;\n }\n\n var dims = map(coordSys.dimensions, function (dim) {\n return data.mapDimension(dim);\n }).slice(0, 2);\n var dimLen = dims.length;\n var stackResultDim = data.getCalculationInfo('stackResultDimension');\n\n if (isDimensionStacked(data, dims[0]\n /*, dims[1]*/\n )) {\n dims[0] = stackResultDim;\n }\n\n if (isDimensionStacked(data, dims[1]\n /*, dims[0]*/\n )) {\n dims[1] = stackResultDim;\n }\n\n function progress(params, data) {\n var segCount = params.end - params.start;\n var points = isLargeRender && new Float32Array(segCount * dimLen);\n\n for (var i = params.start, offset = 0, tmpIn = [], tmpOut = []; i < params.end; i++) {\n var point;\n\n if (dimLen === 1) {\n var x = data.get(dims[0], i);\n point = !isNaN(x) && coordSys.dataToPoint(x, null, tmpOut);\n } else {\n var x = tmpIn[0] = data.get(dims[0], i);\n var y = tmpIn[1] = data.get(dims[1], i); // Also {Array.<number>}, not undefined to avoid if...else... statement\n\n point = !isNaN(x) && !isNaN(y) && coordSys.dataToPoint(tmpIn, null, tmpOut);\n }\n\n if (isLargeRender) {\n points[offset++] = point ? point[0] : NaN;\n points[offset++] = point ? point[1] : NaN;\n } else {\n data.setItemLayout(i, point && point.slice() || [NaN, NaN]);\n }\n }\n\n isLargeRender && data.setLayout('symbolPoints', points);\n }\n\n return dimLen && {\n progress: progress\n };\n }\n };\n}", "function _default(seriesType) {\n return {\n seriesType: seriesType,\n plan: createRenderPlanner(),\n reset: function (seriesModel) {\n var data = seriesModel.getData();\n var coordSys = seriesModel.coordinateSystem;\n var pipelineContext = seriesModel.pipelineContext;\n var isLargeRender = pipelineContext.large;\n\n if (!coordSys) {\n return;\n }\n\n var dims = map(coordSys.dimensions, function (dim) {\n return data.mapDimension(dim);\n }).slice(0, 2);\n var dimLen = dims.length;\n var stackResultDim = data.getCalculationInfo('stackResultDimension');\n\n if (isDimensionStacked(data, dims[0]\n /*, dims[1]*/\n )) {\n dims[0] = stackResultDim;\n }\n\n if (isDimensionStacked(data, dims[1]\n /*, dims[0]*/\n )) {\n dims[1] = stackResultDim;\n }\n\n function progress(params, data) {\n var segCount = params.end - params.start;\n var points = isLargeRender && new Float32Array(segCount * dimLen);\n\n for (var i = params.start, offset = 0, tmpIn = [], tmpOut = []; i < params.end; i++) {\n var point;\n\n if (dimLen === 1) {\n var x = data.get(dims[0], i);\n point = !isNaN(x) && coordSys.dataToPoint(x, null, tmpOut);\n } else {\n var x = tmpIn[0] = data.get(dims[0], i);\n var y = tmpIn[1] = data.get(dims[1], i); // Also {Array.<number>}, not undefined to avoid if...else... statement\n\n point = !isNaN(x) && !isNaN(y) && coordSys.dataToPoint(tmpIn, null, tmpOut);\n }\n\n if (isLargeRender) {\n points[offset++] = point ? point[0] : NaN;\n points[offset++] = point ? point[1] : NaN;\n } else {\n data.setItemLayout(i, point && point.slice() || [NaN, NaN]);\n }\n }\n\n isLargeRender && data.setLayout('symbolPoints', points);\n }\n\n return dimLen && {\n progress: progress\n };\n }\n };\n}", "function _default(seriesType) {\n return {\n seriesType: seriesType,\n plan: createRenderPlanner(),\n reset: function (seriesModel) {\n var data = seriesModel.getData();\n var coordSys = seriesModel.coordinateSystem;\n var pipelineContext = seriesModel.pipelineContext;\n var isLargeRender = pipelineContext.large;\n\n if (!coordSys) {\n return;\n }\n\n var dims = map(coordSys.dimensions, function (dim) {\n return data.mapDimension(dim);\n }).slice(0, 2);\n var dimLen = dims.length;\n var stackResultDim = data.getCalculationInfo('stackResultDimension');\n\n if (isDimensionStacked(data, dims[0]\n /*, dims[1]*/\n )) {\n dims[0] = stackResultDim;\n }\n\n if (isDimensionStacked(data, dims[1]\n /*, dims[0]*/\n )) {\n dims[1] = stackResultDim;\n }\n\n function progress(params, data) {\n var segCount = params.end - params.start;\n var points = isLargeRender && new Float32Array(segCount * dimLen);\n\n for (var i = params.start, offset = 0, tmpIn = [], tmpOut = []; i < params.end; i++) {\n var point;\n\n if (dimLen === 1) {\n var x = data.get(dims[0], i);\n point = !isNaN(x) && coordSys.dataToPoint(x, null, tmpOut);\n } else {\n var x = tmpIn[0] = data.get(dims[0], i);\n var y = tmpIn[1] = data.get(dims[1], i); // Also {Array.<number>}, not undefined to avoid if...else... statement\n\n point = !isNaN(x) && !isNaN(y) && coordSys.dataToPoint(tmpIn, null, tmpOut);\n }\n\n if (isLargeRender) {\n points[offset++] = point ? point[0] : NaN;\n points[offset++] = point ? point[1] : NaN;\n } else {\n data.setItemLayout(i, point && point.slice() || [NaN, NaN]);\n }\n }\n\n isLargeRender && data.setLayout('symbolPoints', points);\n }\n\n return dimLen && {\n progress: progress\n };\n }\n };\n}", "function _default(seriesType) {\n return {\n seriesType: seriesType,\n plan: createRenderPlanner(),\n reset: function (seriesModel) {\n var data = seriesModel.getData();\n var coordSys = seriesModel.coordinateSystem;\n var pipelineContext = seriesModel.pipelineContext;\n var isLargeRender = pipelineContext.large;\n\n if (!coordSys) {\n return;\n }\n\n var dims = map(coordSys.dimensions, function (dim) {\n return data.mapDimension(dim);\n }).slice(0, 2);\n var dimLen = dims.length;\n var stackResultDim = data.getCalculationInfo('stackResultDimension');\n\n if (isDimensionStacked(data, dims[0]\n /*, dims[1]*/\n )) {\n dims[0] = stackResultDim;\n }\n\n if (isDimensionStacked(data, dims[1]\n /*, dims[0]*/\n )) {\n dims[1] = stackResultDim;\n }\n\n function progress(params, data) {\n var segCount = params.end - params.start;\n var points = isLargeRender && new Float32Array(segCount * dimLen);\n\n for (var i = params.start, offset = 0, tmpIn = [], tmpOut = []; i < params.end; i++) {\n var point;\n\n if (dimLen === 1) {\n var x = data.get(dims[0], i);\n point = !isNaN(x) && coordSys.dataToPoint(x, null, tmpOut);\n } else {\n var x = tmpIn[0] = data.get(dims[0], i);\n var y = tmpIn[1] = data.get(dims[1], i); // Also {Array.<number>}, not undefined to avoid if...else... statement\n\n point = !isNaN(x) && !isNaN(y) && coordSys.dataToPoint(tmpIn, null, tmpOut);\n }\n\n if (isLargeRender) {\n points[offset++] = point ? point[0] : NaN;\n points[offset++] = point ? point[1] : NaN;\n } else {\n data.setItemLayout(i, point && point.slice() || [NaN, NaN]);\n }\n }\n\n isLargeRender && data.setLayout('symbolPoints', points);\n }\n\n return dimLen && {\n progress: progress\n };\n }\n };\n}", "function _default(seriesType) {\n return {\n seriesType: seriesType,\n plan: createRenderPlanner(),\n reset: function (seriesModel) {\n var data = seriesModel.getData();\n var coordSys = seriesModel.coordinateSystem;\n var pipelineContext = seriesModel.pipelineContext;\n var isLargeRender = pipelineContext.large;\n\n if (!coordSys) {\n return;\n }\n\n var dims = map(coordSys.dimensions, function (dim) {\n return data.mapDimension(dim);\n }).slice(0, 2);\n var dimLen = dims.length;\n var stackResultDim = data.getCalculationInfo('stackResultDimension');\n\n if (isDimensionStacked(data, dims[0]\n /*, dims[1]*/\n )) {\n dims[0] = stackResultDim;\n }\n\n if (isDimensionStacked(data, dims[1]\n /*, dims[0]*/\n )) {\n dims[1] = stackResultDim;\n }\n\n function progress(params, data) {\n var segCount = params.end - params.start;\n var points = isLargeRender && new Float32Array(segCount * dimLen);\n\n for (var i = params.start, offset = 0, tmpIn = [], tmpOut = []; i < params.end; i++) {\n var point;\n\n if (dimLen === 1) {\n var x = data.get(dims[0], i);\n point = !isNaN(x) && coordSys.dataToPoint(x, null, tmpOut);\n } else {\n var x = tmpIn[0] = data.get(dims[0], i);\n var y = tmpIn[1] = data.get(dims[1], i); // Also {Array.<number>}, not undefined to avoid if...else... statement\n\n point = !isNaN(x) && !isNaN(y) && coordSys.dataToPoint(tmpIn, null, tmpOut);\n }\n\n if (isLargeRender) {\n points[offset++] = point ? point[0] : NaN;\n points[offset++] = point ? point[1] : NaN;\n } else {\n data.setItemLayout(i, point && point.slice() || [NaN, NaN]);\n }\n }\n\n isLargeRender && data.setLayout('symbolPoints', points);\n }\n\n return dimLen && {\n progress: progress\n };\n }\n };\n}", "function _default(seriesType) {\n return {\n seriesType: seriesType,\n plan: createRenderPlanner(),\n reset: function (seriesModel) {\n var data = seriesModel.getData();\n var coordSys = seriesModel.coordinateSystem;\n var pipelineContext = seriesModel.pipelineContext;\n var isLargeRender = pipelineContext.large;\n\n if (!coordSys) {\n return;\n }\n\n var dims = map(coordSys.dimensions, function (dim) {\n return data.mapDimension(dim);\n }).slice(0, 2);\n var dimLen = dims.length;\n var stackResultDim = data.getCalculationInfo('stackResultDimension');\n\n if (isDimensionStacked(data, dims[0]\n /*, dims[1]*/\n )) {\n dims[0] = stackResultDim;\n }\n\n if (isDimensionStacked(data, dims[1]\n /*, dims[0]*/\n )) {\n dims[1] = stackResultDim;\n }\n\n function progress(params, data) {\n var segCount = params.end - params.start;\n var points = isLargeRender && new Float32Array(segCount * dimLen);\n\n for (var i = params.start, offset = 0, tmpIn = [], tmpOut = []; i < params.end; i++) {\n var point;\n\n if (dimLen === 1) {\n var x = data.get(dims[0], i);\n point = !isNaN(x) && coordSys.dataToPoint(x, null, tmpOut);\n } else {\n var x = tmpIn[0] = data.get(dims[0], i);\n var y = tmpIn[1] = data.get(dims[1], i); // Also {Array.<number>}, not undefined to avoid if...else... statement\n\n point = !isNaN(x) && !isNaN(y) && coordSys.dataToPoint(tmpIn, null, tmpOut);\n }\n\n if (isLargeRender) {\n points[offset++] = point ? point[0] : NaN;\n points[offset++] = point ? point[1] : NaN;\n } else {\n data.setItemLayout(i, point && point.slice() || [NaN, NaN]);\n }\n }\n\n isLargeRender && data.setLayout('symbolPoints', points);\n }\n\n return dimLen && {\n progress: progress\n };\n }\n };\n}", "function isSupportedBlockEl( e ) {\n\n return $.inArray( getTN( e ), blockEls ) !== -1;\n\n }", "function detectSeriseType(legacyFunc) {\n\t seriesType = null;\n\t\n\t try {\n\t // Assume there is no async when calling `eachSeriesByType`.\n\t legacyFunc(ecModelMock, apiMock);\n\t } catch (e) {}\n\t\n\t return seriesType;\n\t }", "function finishAssignment(type, min, max) {\n $('.calendarDesc').css('opacity','0');\n if (blockType == 'actFull') {\n setTimeout(function(){\n $('.calendarDesc').html('<div class=\"z-depth-2 assignDrag center-align\"><p class=\"fixrange range-field\"> <input type=\"range\" id=\"calendaradd\" min=\"'+min+'\" max=\"'+max+'\" /> </p></div>');\n $('#calendarsbmt').html('Submit '+type+' score.<i class=\"material-icons right\">send</i>')\n },200);\n setTimeout(function(){\n $('.calendarDesc').css('opacity','');\n },300);\n stage = stage + 1;\n }\n else if (blockType == 'actEnglish') {\n \n }\n else if (blockType == 'actMath') {\n \n }\n else if (blockType == 'actScience') {\n \n }\n else if (blockType == 'actReading') {\n \n }\n else {\n console.log(\"no support for SAT yet\");\n }\n}", "function inclusionHandler(e, color) {\n const index = parseInt(e.target.getAttribute('parent-chart'));\n const chart = chartData[index];\n\n // Cloning canvas and preparing values for animation of main chart\n const c = document.getElementById(`chart-block--${index}`);\n const params = generateParamsForAnimation(c, index);\n\n // Cloning canvas and preparing values for animation of Small secondary chart\n const smallCanvas = document.getElementById(`secondary-chart-block--${index}`);\n const smallChartParams = generateParamsForAnimation(smallCanvas, index);\n\n e.target.classList.toggle('off');\n if (e.target.classList.contains('off')) {\n e.target.style.backgroundColor = '#fff';\n chart.included.splice(chart.included.indexOf(e.target.getAttribute('name')), 1);\n } else {\n e.target.style.backgroundColor = color;\n chart.included.push(e.target.getAttribute('name'));\n }\n\n const infoBoxContainer = e.target.closest('.chart-block').getElementsByClassName('info-box-container')[0];\n infoBoxContainer.classList.remove('shown');\n\n\n let maxAmongAllLines = defineMaxAmongAllLines(index, chart.leftBorderIndex, chart.rightBorderIndex);\n\n const mainBlockId = params.oldMax === maxAmongAllLines ? `chart-block--${index}` : `virtual-1`;\n const lowBlockId = params.oldMax === maxAmongAllLines ? `secondary-chart-block--${index}` : `virtual-2`;\n\n if (params.oldMax === maxAmongAllLines) {\n drawChart(`chart-block--${index}`, chart, canvasWidth, canvasHeight, true, chart.leftBorderIndex, chart.rightBorderIndex);\n drawChart(`secondary-chart-block--${index}`, chart, canvasWidth, secondaryChartCanvasHeight);\n } else {\n drawChart(`virtual-1`, chart, canvasWidth, canvasHeight, false, chart.leftBorderIndex, chart.rightBorderIndex);\n drawChart(`virtual-2`, chart, canvasWidth, secondaryChartCanvasHeight, false);\n }\n\n // Animation of changing chart\n const blockToAppend = document.getElementsByClassName(`chart-block--${index}`)[0];\n const newC = document.getElementById(mainBlockId);\n params.blockToAppend = blockToAppend;\n params.canvas = newC;\n params.canvasHeight = canvasHeight;\n runAnimationForCanvas(params);\n\n // Animation of changing small secondary chart\n const smallBlockToAppend = document.getElementsByClassName(`secondary-chart-block--${index}`)[0];\n const smallNewC = document.getElementById(lowBlockId);\n smallChartParams.blockToAppend = smallBlockToAppend;\n smallChartParams.canvas = smallNewC;\n smallChartParams.canvasHeight = secondaryChartCanvasHeight;\n runAnimationForCanvas(smallChartParams);\n}", "function detectSeriseType(legacyFunc) {\n Scheduler_seriesType = null;\n\n try {\n // Assume there is no async when calling `eachSeriesByType`.\n legacyFunc(ecModelMock, apiMock);\n } catch (e) {}\n\n return Scheduler_seriesType;\n}", "async function blockSlotRange(recurrence) {\n setIsTempModeOn(true)\n let time1 = UtilsService.changeTimeForDisplay(props.slotToBlock.start, 0)\n let time2 = UtilsService.changeTimeForDisplay(props.slotToBlock.end, 0)\n let startTime = `${props.slotToBlock.date}T${time1}:00Z`\n let endTime = `${props.slotToBlock.date}T${time2}:00Z`\n let tempEvent = {\n id: UtilsService.idGen(),\n name: 'block - block',\n start: startTime,\n end: endTime,\n isTemp: true\n }\n let eventsToDisplayCopy = JSON.parse(JSON.stringify(await eventsToDisplay));\n eventsToDisplayCopy[props.treatment.dailyIdx].push(tempEvent)\n \n let startTimeTs = tempEvent.start.slice(11,16) \n let startTimeTsIdx = timeSlots.findIndex(ts => ts === startTimeTs)\n let endTimeTs = tempEvent.end.slice(11,16)\n let endTimeTsIdx = timeSlots.findIndex(ts => ts === endTimeTs)\n \n for (var i=1; i<props.recurrence.count && props.recurrence.freq === 'DAILY'; i++){\n tempEvent = {...tempEvent}\n startTime = new Date (new Date(startTime).getTime() + (1000 * 60 * 60 * 24))\n startTime = startTime.toISOString()\n endTime = new Date (new Date(endTime).getTime() + (1000 * 60 * 60 * 24))\n endTime = endTime.toISOString()\n tempEvent.id = UtilsService.idGen()\n tempEvent.start = startTime\n tempEvent.end = endTime\n // dailyIdx+i for the next day -- the j is for the ts (where exactly in the next day) => making sure there is not already an event there before pushing temp\n let isCellOccupied = false\n for (var j=startTimeTsIdx; j<endTimeTsIdx; j++) { \n if (!props.tableModel[j][props.treatment.dailyIdx+i]){\n isCellOccupied = true\n console.log(timeSlots[j], 'is not availble at', props.treatment.dailyIdx+i)\n }\n }\n if (!isCellOccupied) { eventsToDisplayCopy[props.treatment.dailyIdx+i].push(tempEvent)}\n }\n let prevEvents = [... await eventsToDisplay]\n setEventsToDisplay(eventsToDisplayCopy)\n const confirmedBlockOrOccDates = await CalendarService.blockSlotRange(props.slotToBlock, 'block', recurrence, props.owner) \n\n if (Array.isArray(confirmedBlockOrOccDates)) {\n setModalSubJect('occupied')\n setOccupiedDates (confirmedBlockOrOccDates)\n setPrevEventsToDisplay (prevEvents)\n setIsTempModeOn(false)\n setOpen(true)\n return\n } \n console.log('confirmed eventId',confirmedBlockOrOccDates.id)\n setEventsToDisplay(async () => {\n return await getWeeklyEvents(selectedDate)\n })\n }", "onBlockSelect(e) {\n const $blockSlide = this.$slideshow.find(`[data-block-id=\"${e.detail.blockId}\"]`);\n\n if ($blockSlide.length === 0) {\n return;\n }\n\n this.swiper.slideToLoop($blockSlide.first().data('swiper-slide-index'));\n this.swiper.autoplay.stop();\n }", "function normalStageBlock(currentId, stage) {\n return require('./templates/normal-stage-block.hbs')({\n currentId: currentId,\n stage: stage,\n stepListing: stepListing(currentId, stage.steps)\n });\n}", "function createStages() {\n stages = [\n [\n [\n {\n relevantWidgets: [],\n isSatisfied: function() {\n return true;\n },\n description: \"\",\n resultFunction: async function() {\n await timeout(2000);\n },\n }\n ]\n ],\n\n [\n [\n {\n relevantWidgets: [stbtButton],\n isSatisfied: function() {\n return isGlowing(stbtButton);\n },\n description: \"Turn on the seatbelt sign, labelled 'STBT'.\",\n resultFunction: function() {\n markInstructionComplete();\n },\n },\n ],\n [\n {\n relevantWidgets: [autoPilotOnButton],\n isSatisfied: function() {\n return !isGlowing(autoPilotOnButton);\n },\n description: \"Turn off the autopilot.\",\n resultFunction: function() {\n toggleGlow(autoPilotNavButton);\n toggleGlow(autoPilotFd2Button);\n markInstructionComplete();\n },\n },\n ]\n ],\n\n [\n [\n {\n relevantWidgets: [vhf1Button],\n isSatisfied: function() {\n return isGlowing(vhf1Button);\n },\n description: \"Change the communications to 'VHF1'.\",\n resultFunction: function() {\n toggleGlow(vhf2Button);\n markInstructionComplete();\n },\n },\n {\n relevantWidgets: [commsSwitchButton],\n activeInit: commsValue1.textContent.trim(),\n stbyCrsInit: commsValue2.textContent.trim(),\n isSatisfied: function() {\n return commsValue1.textContent === this.stbyCrsInit && commsValue2.textContent === this.activeInit;\n },\n description: \"Transfer standby and active communication frequencies.\",\n resultFunction: function () {\n markInstructionComplete();\n },\n },\n ],\n ],\n\n [\n [\n {\n relevantWidgets: [],\n isSatisfied: function() {\n return true;\n },\n description: \"\",\n resultFunction: async function() {\n await timeout(1000);\n toggleGlow(eng2WarningLight);\n await timeout(800);\n toggleGlow(eng1WarningLight);\n await timeout(300);\n },\n },\n {\n relevantWidgets: [deIceButton],\n isSatisfied: function() {\n return isGlowing(deIceButton);\n },\n description: \"The engines are icing up! Turn on 'DE-ICE'.\",\n resultFunction: function() {\n markInstructionComplete();\n setTimeout(function() {\n toggleGlow(eng1WarningLight);\n toggleGlow(eng2WarningLight);\n }, 5000);\n },\n },\n ],\n\n [\n {\n relevantWidgets: [ventButton],\n isSatisfied: function() {\n return !isGlowing(ventButton);\n },\n description: \"Turn off the vents, with the 'VNT' button.\",\n resultFunction: function () {\n markInstructionComplete();\n },\n }\n ]\n ],\n\n [\n [\n {\n relevantWidgets: [],\n isSatisfied: function() {\n return true;\n },\n description: \"\",\n resultFunction: function() {\n flashACP(attButton);\n },\n },\n {\n relevantWidgets: [attButton],\n isSatisfied: function() {\n return isGlowing(attButton);\n },\n description: \"A flight attendant wants to talk to you. Push the 'ATT' button.\",\n resultFunction: async function () {\n markInstructionComplete();\n await timeout(1000);\n },\n },\n {\n relevantWidgets: [],\n isSatisfied: function() {\n return true;\n },\n description: \"The flight attendant says a passenger is having a medical emergency.\",\n resultFunction: async function () {\n await timeout(3000);\n },\n },\n {\n relevantWidgets: [\n transponderValuePos1Add,\n transponderValuePos2Add, transponderValuePos3Add,\n transponderValuePos4Add, transponderValuePos1Subtract, transponderValuePos2Subtract,\n transponderValuePos3Subtract, transponderValuePos4Subtract\n ],\n isSatisfied: function() {\n return transponderNumber.textContent === \"7700\";\n },\n description: \"We should ask for priority landing. Set the transponder to 7700.\",\n resultFunction: function() {\n markAllInstructionsComplete();\n svg.style.setProperty('--severity', \"3\");\n },\n }\n ]\n ]\n ]\n\n for (let i = 0; i < stages.length; i++) {\n shuffleArray(stages[i]);\n }\n\n addWeatherInstruction(0, {}, 0.5);\n addWeatherInstruction(1, {}, 1);\n addWeatherInstruction(2, {[stage2Cloud1.id]: 2, [stage2Cloud2.id]: 2, [stage2Cloud3.id]: 5}, 2);\n addWeatherInstruction(3, {[stage3Cloud1.id]: 2, [stage3Cloud2.id]: 2, [stage3Cloud3.id]: 5}, 3, true);\n addWeatherInstruction(4, {}, 3.5);\n}", "function _default(seriesType) {\n return {\n getTargetSeries: function (ecModel) {\n // Pie and funnel may use diferrent scope\n var paletteScope = {};\n var seiresModelMap = createHashMap();\n ecModel.eachSeriesByType(seriesType, function (seriesModel) {\n seriesModel.__paletteScope = paletteScope;\n seiresModelMap.set(seriesModel.uid, seriesModel);\n });\n return seiresModelMap;\n },\n reset: function (seriesModel, ecModel) {\n var dataAll = seriesModel.getRawData();\n var idxMap = {};\n var data = seriesModel.getData();\n data.each(function (idx) {\n var rawIdx = data.getRawIndex(idx);\n idxMap[rawIdx] = idx;\n });\n dataAll.each(function (rawIdx) {\n var filteredIdx = idxMap[rawIdx]; // If series.itemStyle.normal.color is a function. itemVisual may be encoded\n\n var singleDataColor = filteredIdx != null && data.getItemVisual(filteredIdx, 'color', true);\n var singleDataBorderColor = filteredIdx != null && data.getItemVisual(filteredIdx, 'borderColor', true);\n var itemModel;\n\n if (!singleDataColor || !singleDataBorderColor) {\n // FIXME Performance\n itemModel = dataAll.getItemModel(rawIdx);\n }\n\n if (!singleDataColor) {\n var color = itemModel.get('itemStyle.color') || seriesModel.getColorFromPalette(dataAll.getName(rawIdx) || rawIdx + '', seriesModel.__paletteScope, dataAll.count()); // Legend may use the visual info in data before processed\n\n dataAll.setItemVisual(rawIdx, 'color', color); // Data is not filtered\n\n if (filteredIdx != null) {\n data.setItemVisual(filteredIdx, 'color', color);\n }\n } else {\n // Set data all color for legend\n dataAll.setItemVisual(rawIdx, 'color', singleDataColor);\n }\n\n if (!singleDataBorderColor) {\n var borderColor = itemModel.get('itemStyle.borderColor'); // Legend may use the visual info in data before processed\n\n dataAll.setItemVisual(rawIdx, 'borderColor', borderColor); // Data is not filtered\n\n if (filteredIdx != null) {\n data.setItemVisual(filteredIdx, 'borderColor', borderColor);\n }\n } else {\n // Set data all borderColor for legend\n dataAll.setItemVisual(rawIdx, 'borderColor', singleDataBorderColor);\n }\n });\n }\n };\n}", "function newStageBlock() {\n return require('./templates/stage-block.hbs')();\n}", "handleSelGridToPresetType(toType){\n\tconst rIndex = this.props.UI.selectedRowIndex;\n\tconst Grid_i = this.props.PGTobjArray[rIndex];\n\tconst response = Grid_util.GeneratePresetTypeFromGrid(Grid_i, toType, this.props.UI.lockAngles);\n\n\tthis.props.fn.handleModifySelPGTobj({\n\t line_sets: response.$LSupd\n\t});\n\n\tif(response.changedLockAngles !== undefined){\n\t this.props.fn.handleUIStateChange(\"lockAngles\", response.changedLockAngles);\n\t}\n }", "function onLevel2SeriesClick(e) {\n EnableDisableChartView(true);\n\n if (groupbyChapter) {\n LevelIdentifier = 3;\n $('#divtoplevel2').css(\"display\", \"none\");\n $('#divtoplevel3').css(\"display\", \"block\");\n $('#divlevel3chart').css(\"display\", \"block\");\n $('#divlevel3data').css(\"display\", \"none\");\n $('#divlevel3details').css(\"display\", \"none\");\n Level3Load(e.dataItem.ProgramID, e.dataItem.ProgramName, e.dataItem.ChapterID, e.dataItem.Label);\n }\n else {\n LevelIdentifier = 4;\n $('#divtoplevel2').css(\"display\", \"none\");\n $('#divtoplevel4').css(\"display\", \"block\");\n $('#divlevel4chart').css(\"display\", \"block\");\n $('#divlevel4data').css(\"display\", \"none\");\n Level4Load(e.dataItem.StandardID, e.dataItem.Label);\n }\n}", "processStages(issue) {\n console.log();\n console.log(`Processing stages for ${issue.html_url}`);\n // card events should be in order chronologically\n let currentStage;\n let currentColumn;\n let doneTime;\n let addedTime;\n const tempLabels = {};\n if (issue.events) {\n for (const event of issue.events) {\n let eventDateTime;\n if (event.created_at) {\n eventDateTime = event.created_at;\n }\n //\n // Process Project Stages\n //\n let toStage;\n let toLevel;\n let fromStage;\n let fromLevel = 0;\n if (event.project_card && event.project_card.column_name) {\n if (!addedTime) {\n addedTime = eventDateTime;\n }\n if (issue.project_stage !== 'None' && !event.project_card.stage_name) {\n throw new Error(`stage_name should have been set already for ${event.project_card.column_name}`);\n }\n toStage = event.project_card.stage_name;\n toLevel = stageLevel[toStage];\n currentStage = toStage;\n currentColumn = event.project_card.column_name;\n }\n if (issue.project_stage !== 'None' && event.project_card && event.project_card.previous_column_name) {\n if (!event.project_card.previous_stage_name) {\n throw new Error(`previous_stage_name should have been set already for ${event.project_card.previous_column_name}`);\n }\n fromStage = event.project_card.previous_stage_name;\n fromLevel = stageLevel[fromStage];\n }\n // last occurence of moving to a stage from a lesser stage\n // example: if an item is not blocked but put on hold for 6 months,\n // then the in-progress date will be when it went back in progress\n // moving forward\n if (fromLevel < toLevel) {\n issue[this.stageAtNames[toLevel]] = eventDateTime;\n }\n //moving back, clear the stage at dates up to fromLevel\n else if (fromLevel > toLevel) {\n for (let i = toLevel + 1; i <= fromLevel; i++) {\n delete issue[this.stageAtNames[i]];\n }\n }\n }\n if (addedTime) {\n issue.project_added_at = addedTime;\n console.log(`project_added_at: ${issue.project_added_at}`);\n }\n // current board processing does by column so we already know these\n // asof replays events and it's possible to have the same time and therefore can be out of order.\n // only take that fragility during narrow asof cases.\n // asof clears these\n if (!issue.project_column) {\n issue.project_column = currentColumn;\n }\n if (!issue.project_stage) {\n issue.project_stage = currentStage;\n }\n console.log(`project_stage: ${issue.project_stage}`);\n console.log(`project_column: ${issue.project_column}`);\n }\n }", "function _default(seriesType) {\n return {\n getTargetSeries: function (ecModel) {\n // Pie and funnel may use diferrent scope\n var paletteScope = {};\n var seiresModelMap = createHashMap();\n ecModel.eachSeriesByType(seriesType, function (seriesModel) {\n seriesModel.__paletteScope = paletteScope;\n seiresModelMap.set(seriesModel.uid, seriesModel);\n });\n return seiresModelMap;\n },\n reset: function (seriesModel, ecModel) {\n var dataAll = seriesModel.getRawData();\n var idxMap = {};\n var data = seriesModel.getData();\n data.each(function (idx) {\n var rawIdx = data.getRawIndex(idx);\n idxMap[rawIdx] = idx;\n });\n dataAll.each(function (rawIdx) {\n var filteredIdx = idxMap[rawIdx]; // If series.itemStyle.normal.color is a function. itemVisual may be encoded\n\n var singleDataColor = filteredIdx != null && data.getItemVisual(filteredIdx, 'color', true);\n var singleDataBorderColor = filteredIdx != null && data.getItemVisual(filteredIdx, 'borderColor', true);\n var itemModel;\n\n if (!singleDataColor || !singleDataBorderColor) {\n // FIXME Performance\n itemModel = dataAll.getItemModel(rawIdx);\n }\n\n if (!singleDataColor) {\n var color = itemModel.get('itemStyle.color') || seriesModel.getColorFromPalette(dataAll.getName(rawIdx) || rawIdx + '', seriesModel.__paletteScope, dataAll.count()); // Data is not filtered\n\n if (filteredIdx != null) {\n data.setItemVisual(filteredIdx, 'color', color);\n }\n }\n\n if (!singleDataBorderColor) {\n var borderColor = itemModel.get('itemStyle.borderColor'); // Data is not filtered\n\n if (filteredIdx != null) {\n data.setItemVisual(filteredIdx, 'borderColor', borderColor);\n }\n }\n });\n }\n };\n}", "function _default(seriesType) {\n return {\n getTargetSeries: function (ecModel) {\n // Pie and funnel may use diferrent scope\n var paletteScope = {};\n var seiresModelMap = createHashMap();\n ecModel.eachSeriesByType(seriesType, function (seriesModel) {\n seriesModel.__paletteScope = paletteScope;\n seiresModelMap.set(seriesModel.uid, seriesModel);\n });\n return seiresModelMap;\n },\n reset: function (seriesModel, ecModel) {\n var dataAll = seriesModel.getRawData();\n var idxMap = {};\n var data = seriesModel.getData();\n data.each(function (idx) {\n var rawIdx = data.getRawIndex(idx);\n idxMap[rawIdx] = idx;\n });\n dataAll.each(function (rawIdx) {\n var filteredIdx = idxMap[rawIdx]; // If series.itemStyle.normal.color is a function. itemVisual may be encoded\n\n var singleDataColor = filteredIdx != null && data.getItemVisual(filteredIdx, 'color', true);\n var singleDataBorderColor = filteredIdx != null && data.getItemVisual(filteredIdx, 'borderColor', true);\n var itemModel;\n\n if (!singleDataColor || !singleDataBorderColor) {\n // FIXME Performance\n itemModel = dataAll.getItemModel(rawIdx);\n }\n\n if (!singleDataColor) {\n var color = itemModel.get('itemStyle.color') || seriesModel.getColorFromPalette(dataAll.getName(rawIdx) || rawIdx + '', seriesModel.__paletteScope, dataAll.count()); // Data is not filtered\n\n if (filteredIdx != null) {\n data.setItemVisual(filteredIdx, 'color', color);\n }\n }\n\n if (!singleDataBorderColor) {\n var borderColor = itemModel.get('itemStyle.borderColor'); // Data is not filtered\n\n if (filteredIdx != null) {\n data.setItemVisual(filteredIdx, 'borderColor', borderColor);\n }\n }\n });\n }\n };\n}", "function notBlockUseCase() { console.log('Not an block use case');}", "function _default(seriesType) {\n return {\n getTargetSeries: function (ecModel) {\n // Pie and funnel may use diferrent scope\n var paletteScope = {};\n var seiresModelMap = createHashMap();\n ecModel.eachSeriesByType(seriesType, function (seriesModel) {\n seriesModel.__paletteScope = paletteScope;\n seiresModelMap.set(seriesModel.uid, seriesModel);\n });\n return seiresModelMap;\n },\n reset: function (seriesModel, ecModel) {\n var dataAll = seriesModel.getRawData();\n var idxMap = {};\n var data = seriesModel.getData();\n data.each(function (idx) {\n var rawIdx = data.getRawIndex(idx);\n idxMap[rawIdx] = idx;\n });\n dataAll.each(function (rawIdx) {\n var filteredIdx = idxMap[rawIdx]; // If series.itemStyle.normal.color is a function. itemVisual may be encoded\n\n var singleDataColor = filteredIdx != null && data.getItemVisual(filteredIdx, 'color', true);\n\n if (!singleDataColor) {\n // FIXME Performance\n var itemModel = dataAll.getItemModel(rawIdx);\n var color = itemModel.get('itemStyle.color') || seriesModel.getColorFromPalette(dataAll.getName(rawIdx) || rawIdx + '', seriesModel.__paletteScope, dataAll.count()); // Legend may use the visual info in data before processed\n\n dataAll.setItemVisual(rawIdx, 'color', color); // Data is not filtered\n\n if (filteredIdx != null) {\n data.setItemVisual(filteredIdx, 'color', color);\n }\n } else {\n // Set data all color for legend\n dataAll.setItemVisual(rawIdx, 'color', singleDataColor);\n }\n });\n }\n };\n}", "function _default(seriesType) {\n return {\n getTargetSeries: function (ecModel) {\n // Pie and funnel may use diferrent scope\n var paletteScope = {};\n var seiresModelMap = createHashMap();\n ecModel.eachSeriesByType(seriesType, function (seriesModel) {\n seriesModel.__paletteScope = paletteScope;\n seiresModelMap.set(seriesModel.uid, seriesModel);\n });\n return seiresModelMap;\n },\n reset: function (seriesModel, ecModel) {\n var dataAll = seriesModel.getRawData();\n var idxMap = {};\n var data = seriesModel.getData();\n data.each(function (idx) {\n var rawIdx = data.getRawIndex(idx);\n idxMap[rawIdx] = idx;\n });\n dataAll.each(function (rawIdx) {\n var filteredIdx = idxMap[rawIdx]; // If series.itemStyle.normal.color is a function. itemVisual may be encoded\n\n var singleDataColor = filteredIdx != null && data.getItemVisual(filteredIdx, 'color', true);\n\n if (!singleDataColor) {\n // FIXME Performance\n var itemModel = dataAll.getItemModel(rawIdx);\n var color = itemModel.get('itemStyle.color') || seriesModel.getColorFromPalette(dataAll.getName(rawIdx) || rawIdx + '', seriesModel.__paletteScope, dataAll.count()); // Legend may use the visual info in data before processed\n\n dataAll.setItemVisual(rawIdx, 'color', color); // Data is not filtered\n\n if (filteredIdx != null) {\n data.setItemVisual(filteredIdx, 'color', color);\n }\n } else {\n // Set data all color for legend\n dataAll.setItemVisual(rawIdx, 'color', singleDataColor);\n }\n });\n }\n };\n}", "function _default(seriesType) {\n return {\n getTargetSeries: function (ecModel) {\n // Pie and funnel may use diferrent scope\n var paletteScope = {};\n var seiresModelMap = createHashMap();\n ecModel.eachSeriesByType(seriesType, function (seriesModel) {\n seriesModel.__paletteScope = paletteScope;\n seiresModelMap.set(seriesModel.uid, seriesModel);\n });\n return seiresModelMap;\n },\n reset: function (seriesModel, ecModel) {\n var dataAll = seriesModel.getRawData();\n var idxMap = {};\n var data = seriesModel.getData();\n data.each(function (idx) {\n var rawIdx = data.getRawIndex(idx);\n idxMap[rawIdx] = idx;\n });\n dataAll.each(function (rawIdx) {\n var filteredIdx = idxMap[rawIdx]; // If series.itemStyle.normal.color is a function. itemVisual may be encoded\n\n var singleDataColor = filteredIdx != null && data.getItemVisual(filteredIdx, 'color', true);\n\n if (!singleDataColor) {\n // FIXME Performance\n var itemModel = dataAll.getItemModel(rawIdx);\n var color = itemModel.get('itemStyle.color') || seriesModel.getColorFromPalette(dataAll.getName(rawIdx) || rawIdx + '', seriesModel.__paletteScope, dataAll.count()); // Legend may use the visual info in data before processed\n\n dataAll.setItemVisual(rawIdx, 'color', color); // Data is not filtered\n\n if (filteredIdx != null) {\n data.setItemVisual(filteredIdx, 'color', color);\n }\n } else {\n // Set data all color for legend\n dataAll.setItemVisual(rawIdx, 'color', singleDataColor);\n }\n });\n }\n };\n}", "function _default(seriesType) {\n return {\n seriesType: seriesType,\n reset: function (seriesModel, ecModel) {\n var legendModels = ecModel.findComponents({\n mainType: 'legend'\n });\n\n if (!legendModels || !legendModels.length) {\n return;\n }\n\n var data = seriesModel.getData();\n data.filterSelf(function (idx) {\n var name = data.getName(idx); // If in any legend component the status is not selected.\n\n for (var i = 0; i < legendModels.length; i++) {\n if (!legendModels[i].isSelected(name)) {\n return false;\n }\n }\n\n return true;\n });\n }\n };\n}", "function _default(seriesType) {\n return {\n seriesType: seriesType,\n reset: function (seriesModel, ecModel) {\n var legendModels = ecModel.findComponents({\n mainType: 'legend'\n });\n\n if (!legendModels || !legendModels.length) {\n return;\n }\n\n var data = seriesModel.getData();\n data.filterSelf(function (idx) {\n var name = data.getName(idx); // If in any legend component the status is not selected.\n\n for (var i = 0; i < legendModels.length; i++) {\n if (!legendModels[i].isSelected(name)) {\n return false;\n }\n }\n\n return true;\n });\n }\n };\n}", "function _default(seriesType) {\n return {\n seriesType: seriesType,\n reset: function (seriesModel, ecModel) {\n var legendModels = ecModel.findComponents({\n mainType: 'legend'\n });\n\n if (!legendModels || !legendModels.length) {\n return;\n }\n\n var data = seriesModel.getData();\n data.filterSelf(function (idx) {\n var name = data.getName(idx); // If in any legend component the status is not selected.\n\n for (var i = 0; i < legendModels.length; i++) {\n if (!legendModels[i].isSelected(name)) {\n return false;\n }\n }\n\n return true;\n });\n }\n };\n}", "function _default(seriesType) {\n return {\n seriesType: seriesType,\n reset: function (seriesModel, ecModel) {\n var legendModels = ecModel.findComponents({\n mainType: 'legend'\n });\n\n if (!legendModels || !legendModels.length) {\n return;\n }\n\n var data = seriesModel.getData();\n data.filterSelf(function (idx) {\n var name = data.getName(idx); // If in any legend component the status is not selected.\n\n for (var i = 0; i < legendModels.length; i++) {\n if (!legendModels[i].isSelected(name)) {\n return false;\n }\n }\n\n return true;\n });\n }\n };\n}", "function _default(seriesType) {\n return {\n seriesType: seriesType,\n reset: function (seriesModel, ecModel) {\n var legendModels = ecModel.findComponents({\n mainType: 'legend'\n });\n\n if (!legendModels || !legendModels.length) {\n return;\n }\n\n var data = seriesModel.getData();\n data.filterSelf(function (idx) {\n var name = data.getName(idx); // If in any legend component the status is not selected.\n\n for (var i = 0; i < legendModels.length; i++) {\n if (!legendModels[i].isSelected(name)) {\n return false;\n }\n }\n\n return true;\n });\n }\n };\n}", "isStartableStage(stage) {\n if (this.inFinalStage(stage)) {\n return false;\n }\n let stageOrder = this.process.stages.map(s => s.outgoing_stage);\n let viewedIncomingStageIndex = stageOrder.indexOf(stage.incoming_stage);\n let viewedOutgoingStageIndex = stageOrder.indexOf(stage.outgoing_stage);\n let featureStageIndex = stageOrder.indexOf(this.feature.intent_stage_int);\n return (viewedIncomingStageIndex <= featureStageIndex &&\n viewedOutgoingStageIndex > featureStageIndex);\n }", "function block_fn() {\n setVisibility(\"block\");\n inputType = \"Block\";\n}", "onBlockSelect() {\n // Do something when a section block is selected\n }", "onBlockSelect() {\n // Do something when a section block is selected\n }", "async handleBlocks() {\n await this.api.rpc.chain.subscribeNewHeads(async (header) => {\n if (header.number % 100 == 0) {\n console.log(`Chain is at block: #${header.number}`);\n\n // Unconditionally recalculate validators every 10 minutes\n this.createValidatorList(); // do not await\n\n } else {\n const blockHash = await this.api.rpc.chain.getBlockHash(header.number);\n const block = await this.api.rpc.chain.getBlock(blockHash);\n \n const extrinsics = block['block']['extrinsics'];\n for (let i=0; i<extrinsics.length; i++) {\n const callIndex = extrinsics[i]._raw['method']['callIndex'];\n const c = await this.api.findCall(callIndex);\n //console.log(\"Module called: \", c.section);\n if (c.section == STAKING) {\n console.log(`A ${STAKING} transaction was called`);\n this.createValidatorList(); // do not await\n }\n }\n }\n\n });\n }", "function _default(seriesType, ecModel) {\n // Pie and funnel may use diferrent scope\n var paletteScope = {};\n ecModel.eachRawSeriesByType(seriesType, function (seriesModel) {\n var dataAll = seriesModel.getRawData();\n var idxMap = {};\n\n if (!ecModel.isSeriesFiltered(seriesModel)) {\n var data = seriesModel.getData();\n data.each(function (idx) {\n var rawIdx = data.getRawIndex(idx);\n idxMap[rawIdx] = idx;\n });\n dataAll.each(function (rawIdx) {\n var filteredIdx = idxMap[rawIdx]; // If series.itemStyle.normal.color is a function. itemVisual may be encoded\n\n var singleDataColor = filteredIdx != null && data.getItemVisual(filteredIdx, 'color', true);\n\n if (!singleDataColor) {\n // FIXME Performance\n var itemModel = dataAll.getItemModel(rawIdx);\n var color = itemModel.get('itemStyle.normal.color') || seriesModel.getColorFromPalette(dataAll.getName(rawIdx), paletteScope); // Legend may use the visual info in data before processed\n\n dataAll.setItemVisual(rawIdx, 'color', color); // Data is not filtered\n\n if (filteredIdx != null) {\n data.setItemVisual(filteredIdx, 'color', color);\n }\n } else {\n // Set data all color for legend\n dataAll.setItemVisual(rawIdx, 'color', singleDataColor);\n }\n });\n }\n });\n}", "function _default(seriesType, ecModel) {\n // Pie and funnel may use diferrent scope\n var paletteScope = {};\n ecModel.eachRawSeriesByType(seriesType, function (seriesModel) {\n var dataAll = seriesModel.getRawData();\n var idxMap = {};\n\n if (!ecModel.isSeriesFiltered(seriesModel)) {\n var data = seriesModel.getData();\n data.each(function (idx) {\n var rawIdx = data.getRawIndex(idx);\n idxMap[rawIdx] = idx;\n });\n dataAll.each(function (rawIdx) {\n var filteredIdx = idxMap[rawIdx]; // If series.itemStyle.normal.color is a function. itemVisual may be encoded\n\n var singleDataColor = filteredIdx != null && data.getItemVisual(filteredIdx, 'color', true);\n\n if (!singleDataColor) {\n // FIXME Performance\n var itemModel = dataAll.getItemModel(rawIdx);\n var color = itemModel.get('itemStyle.normal.color') || seriesModel.getColorFromPalette(dataAll.getName(rawIdx), paletteScope); // Legend may use the visual info in data before processed\n\n dataAll.setItemVisual(rawIdx, 'color', color); // Data is not filtered\n\n if (filteredIdx != null) {\n data.setItemVisual(filteredIdx, 'color', color);\n }\n } else {\n // Set data all color for legend\n dataAll.setItemVisual(rawIdx, 'color', singleDataColor);\n }\n });\n }\n });\n}", "function _default(seriesType, ecModel) {\n // Pie and funnel may use diferrent scope\n var paletteScope = {};\n ecModel.eachRawSeriesByType(seriesType, function (seriesModel) {\n var dataAll = seriesModel.getRawData();\n var idxMap = {};\n\n if (!ecModel.isSeriesFiltered(seriesModel)) {\n var data = seriesModel.getData();\n data.each(function (idx) {\n var rawIdx = data.getRawIndex(idx);\n idxMap[rawIdx] = idx;\n });\n dataAll.each(function (rawIdx) {\n var filteredIdx = idxMap[rawIdx]; // If series.itemStyle.normal.color is a function. itemVisual may be encoded\n\n var singleDataColor = filteredIdx != null && data.getItemVisual(filteredIdx, 'color', true);\n\n if (!singleDataColor) {\n // FIXME Performance\n var itemModel = dataAll.getItemModel(rawIdx);\n var color = itemModel.get('itemStyle.normal.color') || seriesModel.getColorFromPalette(dataAll.getName(rawIdx), paletteScope); // Legend may use the visual info in data before processed\n\n dataAll.setItemVisual(rawIdx, 'color', color); // Data is not filtered\n\n if (filteredIdx != null) {\n data.setItemVisual(filteredIdx, 'color', color);\n }\n } else {\n // Set data all color for legend\n dataAll.setItemVisual(rawIdx, 'color', singleDataColor);\n }\n });\n }\n });\n}", "addEnergyChunkSlices() {\n assert && assert( false, 'subtypes should implement their chunk slice creation' );\n }", "onEventDataGenerated(renderData) {\n const me = this,\n record = renderData.event || renderData.eventRecord; // Differs by mode\n\n if (record.isResourceTimeRange) {\n if (me.scheduler.isVertical) {\n renderData.width = me.scheduler.resourceColumnWidth;\n } else {\n renderData.top = 0;\n // Avoid colliding ids by using a prefix\n renderData.id = `${me.scheduler.id}-${me.idPrefix}-${record.id}`;\n }\n\n // Flag that we should fill entire row/col\n renderData.fillSize = true;\n // Needed for caching\n renderData.eventId = `${me.idPrefix}-${record.id}`;\n // Add our own cls\n renderData.wrapperCls[me.rangeCls] = 1;\n renderData.wrapperCls[`b-sch-color-${record.timeRangeColor}`] = record.timeRangeColor;\n // Add label\n renderData.body = document.createDocumentFragment();\n renderData.body.textContent = record.name;\n }\n }", "function handleStageStatus() {\n\tconst status = document.getElementById(\"StageStatus\").value;\n\tvar node = canvas.getPrimarySelection();\n\tif (node instanceof WorkflowStage) {\n\t\tnode.updateUserData({published: status});\n\t}\n}", "function setNonProgressDimensionRage(fieldset) {\n var highDiv = fieldset.find('.dim-range-high').parent();\n var lowDiv = fieldset.find('.dim-range-low').parent();\n highDiv.show();\n lowDiv.show();\n fieldset.find('#progress-buttons-container').hide();\n}", "function OnPipeline_Change( e )\r\n{\r\n try\r\n {\r\n current_offset_feature_type = Alloy.Globals.replaceCharAt( 4 , current_offset_feature_type , $.widgetAppCheckBoxBAEAModeFormsFaultRuptureOffsetFeatureTypePipeline.get_value() ) ;\r\n\r\n Ti.App.fireEvent( 'baea_mode_fault_rupture:offset_feature_type_changed' , { value: current_offset_feature_type } ) ;\r\n }\r\n catch( exception )\r\n {\r\n Alloy.Globals.AlertUserAndLogAsync( L( 'generic_exception_msg' ) + exception.message ) ;\r\n }\r\n}", "function pointsLayout(seriesType, forceStoreInTypedArray) {\n return {\n seriesType: seriesType,\n plan: Object(createRenderPlanner[\"a\" /* default */])(),\n reset: function (seriesModel) {\n var data = seriesModel.getData();\n var coordSys = seriesModel.coordinateSystem;\n var pipelineContext = seriesModel.pipelineContext;\n var useTypedArray = forceStoreInTypedArray || pipelineContext.large;\n\n if (!coordSys) {\n return;\n }\n\n var dims = Object(util[\"H\" /* map */])(coordSys.dimensions, function (dim) {\n return data.mapDimension(dim);\n }).slice(0, 2);\n var dimLen = dims.length;\n var stackResultDim = data.getCalculationInfo('stackResultDimension');\n\n if (isDimensionStacked(data, dims[0]\n /*, dims[1]*/\n )) {\n dims[0] = stackResultDim;\n }\n\n if (isDimensionStacked(data, dims[1]\n /*, dims[0]*/\n )) {\n dims[1] = stackResultDim;\n }\n\n var dimInfo0 = data.getDimensionInfo(dims[0]);\n var dimInfo1 = data.getDimensionInfo(dims[1]);\n var dimIdx0 = dimInfo0 && dimInfo0.index;\n var dimIdx1 = dimInfo1 && dimInfo1.index;\n return dimLen && {\n progress: function (params, data) {\n var segCount = params.end - params.start;\n var points = useTypedArray && createFloat32Array(segCount * dimLen);\n var tmpIn = [];\n var tmpOut = [];\n\n for (var i = params.start, offset = 0; i < params.end; i++) {\n var point = void 0;\n\n if (dimLen === 1) {\n var x = data.getByDimIdx(dimIdx0, i); // NOTE: Make sure the second parameter is null to use default strategy.\n\n point = coordSys.dataToPoint(x, null, tmpOut);\n } else {\n tmpIn[0] = data.getByDimIdx(dimIdx0, i);\n tmpIn[1] = data.getByDimIdx(dimIdx1, i); // Let coordinate system to handle the NaN data.\n\n point = coordSys.dataToPoint(tmpIn, null, tmpOut);\n }\n\n if (useTypedArray) {\n points[offset++] = point[0];\n points[offset++] = point[1];\n } else {\n data.setItemLayout(i, point.slice());\n }\n }\n\n useTypedArray && data.setLayout('points', points);\n }\n };\n }\n };\n}", "function onSeriesPointClick(point, event) {\n if (isDefined(point)) {\n setTimeout(function () {\n\n var _series = point.series.options;\n var highchart = point.series.chart;\n var chart = _series.ChartProvider;\n var specter = chart.Parent;\n chart = specter.getChart(chart.Name);\n\n // when is the chart object updated? after this function finshes?\n var selectedPoints = highchart.getSelectedPoints();\n chart.Selected = [];\n\n if (selectedPoints.length == 0)\n _series.Clear();\n\n $.each(selectedPoints, function (i, p) {\n var item = {};\n //get Series fields values\n $.each(p.series.options.Fields, function (i, field) {\n item[field] = _series[field] + '';\n });\n //get the point fields values\n $.each(p.Fields, function (i, field) {\n item[field] = p[field] + '';\n });\n\n item[\"$seriesname\"] = p.series.name;\n item[\"$series\"] = p.series.options;\n item[\"$data\"] = $.extend(true, {}, p);\n item[\"Value\"] = p.name;\n chart.Selected.push(item);\n\n //chart.Selected.push({\n // data: $.extend(true,{},p),\n // series: p.series.name//.options//.name\n //});\n });\n //Log(chart.Selected);\n //onClick event is from chart json\n if (isDefined(_series.onClick)) {\n _series.onClick(event);\n }\n event.Source = chart;\n event.Selected = chart.Selected;\n //Log(chart.Selected);\n //charts filter selection for specter\n var filterItem = {\n Name: chart.Name,\n Type: CHART,\n Contents: chart.Selected,\n Source: _series\n };\n\n if (isDefined(_series.DrillItem)) {\n filterItem.DrillItem = _series.DrillItem;\n processDrillItem(_series.DrillItem, event);\n }\n\n var linkedItems = _series.LinkedItems;\n if (isDefined(linkedItems)) {\n $.each(linkedItems, function (i, item) {\n processLinkedItem(item, event);\n });\n }\n\n specter.UpdateFilter(filterItem);\n\n }, 50);\n\n //if (point.state == \"select\")\n //{\n // findAndRemove(chart.Selected, \"Name\", point.name);\n //}\n //else\n //{\n // else { \n // chart.Selected.push({\n // Name: point.name,\n // Point: point//.name\n // });\n // }\n //}\n ////event.Specter = _series.Parent;\n }\n}", "function loadNextStage() {\n if (firstStage) {\n // add a sneaky extra circle in the off chance they find all of the hidden circles :P\n // withheld data is also a bias after all\n createCircle(startColour);\n // so the grey fades in\n $('#circles-area').addClass('fade-bg-colour');\n $('#circles-area').removeClass(startColour);\n $('#circles-area').addClass('grey');\n $('#instruction-text').html(MISSED_CIRCLES_TEXT);\n firstStage = false;\n } else {\n createSlider();\n bgColourSlider[0].noUiSlider.on('update', updateSlider);\n $('#instruction-text').html(SLIDER_TEXT);\n $('.circle').removeClass('glow');\n $('#circles-area').removeClass('grey fade-bg-colour');\n $('#circles-area').addClass(startColour);\n $('#next-stage').addClass('d-none');\n $('#start-again').removeClass('d-none');\n $('#background-colour-slider-container').removeClass('d-none');\n }\n}", "function e(e) {\n return e && \"function\" == typeof e.render;\n }", "myBlockStyleFn(contentBlock) {\n const type = contentBlock.getType();\n if(type === 'code-block') {\n return 'editorCodeBlock';\n }\n if(type === 'blockquote') {\n return 'editorBlockquote';\n }\n }", "drawPoints() {\n var series = this, //state = series.state,\n points = series.points,\n options = series.options,\n chart = series.chart,\n renderer = chart.renderer,\n xPlot,\n yPlot,\n leftPlot,\n rightPlot,\n highPlot,\n lowPlot,\n xWhiskerLow,\n xWhiskerHigh,\n yWhiskerLeft,\n yWhiskerRight,\n whiskerLength = series.options.whiskerLength,\n format = series.options.format;\n\n\n each(points, function(point) {\n\n var graphic = point.graphic,\n verb = graphic ? 'animate' : 'attr';\n\n\n var stemAttr = {},\n whiskersAttr = {},\n color = point.color || series.color;\n\n if (point.plotY !== undefined) {\n\n xPlot = Math.floor(point.xPlot);\n yPlot = Math.floor(point.yPlot);\n leftPlot = Math.floor(point.leftPlot);\n rightPlot = Math.floor(point.rightPlot);\n\n highPlot = Math.floor(point.highPlot);\n lowPlot = Math.floor(point.lowPlot);\n\n xWhiskerLow = Math.floor(yPlot - whiskerLength);\n xWhiskerHigh = Math.floor(yPlot + whiskerLength);\n\n yWhiskerLeft = Math.floor(xPlot - whiskerLength);\n yWhiskerRight = Math.floor(xPlot + whiskerLength);\n\n if (!graphic) {\n point.graphic = graphic = renderer.g('point')\n .add(series.group);\n\n point.stem = renderer.path()\n .addClass('highcharts-boxplot-stem')\n .add(graphic);\n\n if (whiskerLength) {\n point.whiskers = renderer.path()\n .addClass('highcharts-boxplot-whisker')\n .add(graphic);\n }\n\n // Stem attributes\n stemAttr.stroke = point.stemColor || options.stemColor || color;\n stemAttr['stroke-width'] = pick(point.stemWidth, options.stemWidth, options.lineWidth);\n stemAttr.dashstyle = point.stemDashStyle || options.stemDashStyle;\n point.stem.attr(stemAttr);\n\n // Whiskers attributes\n if (whiskerLength) {\n whiskersAttr.stroke = point.whiskerColor || options.whiskerColor || color;\n whiskersAttr['stroke-width'] = pick(point.whiskerWidth, options.whiskerWidth, options.lineWidth);\n point.whiskers.attr(whiskersAttr);\n }\n }\n\n switch (format) {\n case 'x':\n point.stem[verb]({\n d: [\n 'M',\n leftPlot, yPlot,\n 'L',\n rightPlot, yPlot,\n 'z'\n ]});\n\n if (whiskerLength) {\n point.whiskers[verb]({\n d: [\n 'M',\n leftPlot, xWhiskerLow,\n 'L',\n leftPlot, xWhiskerHigh,\n\n 'M',\n rightPlot, xWhiskerLow,\n 'L',\n rightPlot, xWhiskerHigh,\n\n 'z'\n ]\n });\n }\n break;\n\n case 'y':\n point.stem[verb]({\n d: [\n 'M',\n xPlot, lowPlot,\n 'L',\n xPlot, highPlot,\n 'z'\n ]});\n\n if (whiskerLength) {\n point.whiskers[verb]({\n d: [\n 'M',\n yWhiskerLeft, lowPlot,\n 'L',\n yWhiskerRight, lowPlot,\n\n 'M',\n yWhiskerLeft, highPlot,\n 'L',\n yWhiskerRight, highPlot,\n\n 'z'\n ]\n });\n }\n break;\n\n case 'xy':\n default:\n point.stem[verb]({\n d: [\n 'M',\n leftPlot, yPlot,\n 'L',\n rightPlot, yPlot,\n 'M',\n xPlot, lowPlot,\n 'L',\n xPlot, highPlot,\n 'z'\n ]});\n\n if (whiskerLength) {\n point.whiskers[verb]({\n d: [\n 'M',\n leftPlot, xWhiskerLow,\n 'L',\n leftPlot, xWhiskerHigh,\n\n 'M',\n rightPlot, xWhiskerLow,\n 'L',\n rightPlot, xWhiskerHigh,\n\n 'M',\n yWhiskerLeft, lowPlot,\n 'L',\n yWhiskerRight, lowPlot,\n\n 'M',\n yWhiskerLeft, highPlot,\n 'L',\n yWhiskerRight, highPlot,\n\n 'z'\n ]\n });\n }\n break;\n }\n }\n });\n\n }", "isBlock() {\n const parentNode = this.parentNode\n return (parentNode && parentNode.isContainer())\n }", "onInternalEventStoreChange(params) {\n const me = this;\n\n // Too early, bail out\n if (!me._mode) {\n return;\n }\n\n if (me.isVertical) {\n me.currentOrientation.onEventStoreChange(params);\n } else {\n // TODO: Move this to horizontal\n\n const layout = me.currentOrientation,\n // ResourceTimeRanges also calls this fn, using its store as source. It is \"compatible\" with eventStore\n eventStore = params.source,\n { rowManager, resourceStore } = me,\n { action, changes, isCollapse } = params,\n events = params.records || (params.record ? [params.record] : null),\n resources = [];\n\n let rows = new Set(),\n useTransition = false,\n len,\n i;\n\n if (!me.rendered) {\n return;\n }\n\n // Ignore update caused by collapse or removing associated resource, will be handled by resource removal code\n if (isCollapse || (action === 'update' && events.length && events[0].meta.removingResource)) {\n return;\n }\n\n // resource timeranges feature embeds into regular events drawing procedure\n // which means in some cases we should repaint all rows\n const skipRows = action === 'filter' && me.hasFeature('resourceTimeRanges');\n\n // If events were changed\n if (!skipRows && checkResources[action] && events) {\n // For event resource change, the \"from\" resource is part of the changed resource set.\n if (changes && 'resourceId' in changes && changes.resourceId.oldValue != null) {\n const prevResource = resourceStore.getById(changes.resourceId.oldValue),\n prevRow = prevResource && rowManager.getRowFor(prevResource);\n\n // Old resource might not exist in store, https://app.assembla.com/spaces/bryntum/tickets/7070.\n // Happens for example when dropping from another scheduler.\n if (prevRow) {\n resources.push(prevResource);\n rows.add(prevRow);\n }\n }\n\n // We are only interested in associated resources which exist in the store and are in the rendered block.\n for (i = 0, len = events.length; i < len; i++) {\n resources.push(\n ...eventStore.getResourcesForEvent(events[i]).filter((resource) => {\n if (resource) {\n const row = rowManager.getRowFor(resource);\n if (row) {\n rows.add(row);\n return true;\n }\n }\n return false;\n })\n );\n }\n\n if (resources.length) {\n // Sort rows if more than one\n if (rows.size > 1) {\n rows = new Set([...rows].sort((a, b) => a.dataIndex - b.dataIndex));\n }\n // If all affected rows are outside of the rendered range, do nothing\n else if (!rows.size) {\n return;\n }\n }\n // No resources in the rendered block were visible (or all events filtered out, in which case a full redraw\n // is performed). Nothing to update in the UI, but the dataset height might have changed.\n else if (!(action === 'filter' && !events.length)) {\n rowManager.estimateTotalHeight();\n return;\n }\n params.resources = resources;\n }\n\n switch (action) {\n case 'dataset':\n layout.onEventDataset();\n break;\n case 'add':\n layout.onEventAdd(params);\n useTransition = true;\n break;\n case 'update':\n layout.onEventUpdate(params);\n useTransition = true;\n break;\n case 'remove':\n layout.onEventRemove(params);\n useTransition = true;\n break;\n case 'removeall':\n layout.onEventRemoveAll();\n break;\n case 'filter':\n layout.onEventFilter(params);\n break;\n case 'clearchanges':\n layout.onEventClearChanges(params);\n break;\n }\n\n me.runWithTransition(() => {\n if (rows.size) {\n // Render the affected rows.\n rowManager.renderRows(rows);\n }\n // No specific rows affected, for example a dataset. Draw all\n else {\n // TODO: change to refresh() when merged to master\n rowManager.renderFromRow();\n }\n }, useTransition);\n }\n }", "function look_ruby_block_hw_slider() {\r\n var block_hw_slider = $('.ruby-slider-hw');\r\n if (block_hw_slider.length > 0) {\r\n block_hw_slider.each(function() {\r\n\r\n var block_hw_slider_el = $(this);\r\n var block_hw_slider_nav_el = $(this).next('.ruby-slider-hw-nav');\r\n\r\n block_hw_slider_el.on('init', function() {\r\n block_hw_slider_el.imagesLoaded(function() {\r\n block_hw_slider_el.prev('.slider-loading').fadeOut(200, function() {\r\n $(this).remove();\r\n block_hw_slider_el.removeClass('slider-init');\r\n });\r\n });\r\n });\r\n\r\n block_hw_slider_nav_el.on('init', function() {\r\n block_hw_slider_nav_el.imagesLoaded(function() {\r\n block_hw_slider_nav_el.removeClass('slider-init');\r\n });\r\n });\r\n\r\n\r\n block_hw_slider_el.slick({\r\n dots: true,\r\n infinite: true,\r\n autoplay: look_ruby.auto_play,\r\n autoplaySpeed: look_ruby.auto_play_speed,\r\n speed: look_ruby.play_speed,\r\n adaptiveHeight: false,\r\n arrows: true,\r\n asNavFor: block_hw_slider_nav_el,\r\n prevArrow: look_ruby.prev_arrow,\r\n nextArrow: look_ruby.next_arrow\r\n });\r\n\r\n block_hw_slider_nav_el.slick({\r\n slidesToShow: 4,\r\n slidesToScroll: 1,\r\n arrows: false,\r\n dots: false,\r\n asNavFor: block_hw_slider_el,\r\n centerMode: false,\r\n focusOnSelect: true\r\n });\r\n });\r\n }\r\n }", "function timelineType() {\r\n $('#wholeBusy').show();\r\n $('#container').html('');\r\n if ((dg) && (dg.file_)) dg.destroy();\r\n if ($('#main_multi').prop('checked')) {\r\n $('.singleStaOnly').hide();\r\n $('.multiStasOnly').show();\r\n $('#sub_multi').show();\r\n if (flagsArr.indexOf(attr) > -1) {\r\n $(\".onlyQC\").show();\r\n } else {\r\n $(\".onlyQC\").hide();\r\n }\r\n// console.log(getStationsUrl('.json'));\r\n getJsonData(getStationsUrl('.json'), \"allStations\");\r\n } else if ($('#main_single').prop('checked')) {\r\n attrCharts = {};\r\n console.log('Single Station');\r\n $('#sub_multi').hide();\r\n $('.singleStaOnly').show();\r\n $('.multiStasOnly').hide();\r\n $(\".onlyQC\").show();\r\n // sensor = $('#staSel > .btn.active > input').val();\r\n console.log(\"#staSel active:\", $('#staSel > .btn.active > input').val());\r\n setStation();\r\n } else { ///Hide everything\r\n $('.singleStaOnly').hide();\r\n $('.multiStasOnly').hide();\r\n $('.show-hide').hide();\r\n $('#sub_multi').hide();\r\n hideBusy();\r\n }\r\n// $('#wholeBusy').hide();\r\n}", "function drawBlockSeparations() {\n\n // remove all block separations\n svg.selectAll('.' + config.blockSeparatorClass).remove();\n\n console.log(scope.priorityMarkup)\n // terminate if the grouping is not by priority\n if (grouping != 'priority' || !scope.priorityMarkup) {\n return null;\n }\n\n // get coordinates\n var blockXCoordinates = [0,0,0,0,0,0];\n var xTicks = svg.selectAll(\".x.axis .tick\");\n xTicks.forEach(function(d, i) {\n d.forEach(function(e, j) {\n var x = d3.select(e).attr('transform')\n .split('(')[1].split(',')[0];\n var f = e['__data__'];\n for(var i = 6; i > 0; i--) {\n var g = scope.$parent.$parent.priorityPerBlock[i];\n if (f == '' || f <= g) {\n if (f == g) {\n blockXCoordinates[6-i] = x;\n } else {\n blockXCoordinates[6-i] = x-column_width/2;\n }\n }\n }\n });\n });\n // draw blocks\n var tmp = 0;\n blockXCoordinates.forEach(function(d, i) {\n if (parseInt(d,10) > parseInt(tmp,10)) {\n var w = d;\n svg.append('g')\n .attr('class', config.blockSeparatorClass)\n .attr('transform', 'translate(' + w + ',0)')\n .append('line')\n .attr('x2', 0)\n .attr('y2', height)\n .attr('opacity', config.blockSeparatorOpacity)\n .style('stroke', config.blockSeparatorColor)\n .style('stroke-dasharray', ('3, 6'))\n .style('stroke-width', config.blockSeparatorWidth)\n .append('title')\n .text(function(){return \"B\"+(6-i)});\n tmp = d;\n }\n });\n }", "function changeGraphType(event) {\n var startIndex = event.startIndex;\n var endIndex = event.endIndex;\n\n if (endIndex - startIndex > maxCandlesticks) {\n // change graph type\n if (graph.type != \"line\") {\n graph.type = \"line\";\n graph.fillAlphas = 0;\n chart.validateNow();\n }\n } else {\n // change graph type\n if (graph.type != graphType) {\n graph.type = graphType;\n graph.fillAlphas = 1;\n chart.validateNow();\n }\n }\n }", "isFutureStage(stage) {\n if (this.inFinalStage(stage)) {\n return false;\n }\n let stageOrder = this.process.stages.map(s => s.outgoing_stage);\n let viewedIncomingStageIndex = stageOrder.indexOf(stage.incoming_stage);\n let featureStageIndex = stageOrder.indexOf(this.feature.intent_stage_int);\n return (viewedIncomingStageIndex > featureStageIndex);\n }", "function blk() {\n prev = -1;\n flag3 = 0;\n type = 4; // For block type is equal to four\n}", "setBlockRange(nextRange) {\n if (nextRange) {\n if (nextRange.length > 1) {\n if (nextRange[0] === nextRange[1]) {\n throw Error('cannot set block range of equivalent heights');\n }\n }\n }\n // if a block range should be evaluated on disk report it to the controller\n if (this._blockRangeUpperBound && this._blockRangeLowerBound && this._blockRangeUpperBound.hash && this._blockRangeLowerBound.hash) {\n // LDL\n debug(`setting block range upper hash ${this._blockRangeUpperBound.hash} lower hash ${this._blockRangeLowerBound.hash}`);\n this.emit('roverBlockRange', {\n roverName: 'eth',\n highestHeight: this._blockRangeUpperBound.height,\n lowestHeight: this._blockRangeLowerBound.height,\n highestHash: this._blockRangeUpperBound.hash,\n lowestHash: this._blockRangeLowerBound.hash\n });\n // unsset the bounds allowing the bounds to be changed\n this._blockRangeUpperBound = undefined;\n this._blockRangeLowerBound = undefined;\n // else if the block heights have not been found and nothing is pending their to resume the search, put the heights into their own segment\n } else if (this._blockRangeUpperBound && this.BlockRangeLowerBound && this._blocksToFetch.length < 1 && this._rangeToFetch.length < 1 && !this._seekingBlockSegment) {\n if (!this._blockRangeUpperBound.hash || !this._blockRangeLowerBound.hash) {\n const highest = this._blockRangeUpperBound.height;\n const lowest = this._blockRangeLowerBound.height;\n this._blockRangeUpperBound.height = highest;\n this._blockRangeLowerBound.height = lowest;\n this._blockRangeUpperBound.hash = undefined;\n this._blockRangeLowerBound.hash = undefined;\n this._blocksToFetch.push([highest, lowest]);\n }\n }\n // only set block range if there are no requests waiting to be fetched\n if (nextRange && nextRange.length > 1 && this._rangeToFetch.length < 1) {\n this._blockRangeUpperBound = { height: nextRange[0], hash: false };\n this._blockRangeLowerBound = { height: nextRange[1], hash: false };\n } else if (!this._blockRangeUpperBound && this._rangeToFetch.length > 0) {\n this._logger.info(`block range upper bound not defined and range to fetch has a length greater than 0`);\n const r = this._rangeToFetch.pop();\n this._blockRangeUpperBound = { height: r[0], hash: false };\n this._blockRangeLowerBound = { height: r[1], hash: false };\n }\n }", "getBlockRegion(block, globalPoint) {\n // substract window scrolling from global point to get viewport coordinates\n const vpt = globalPoint.sub(new Vector2D(window.scrollX, window.scrollY));\n // compare against viewport bounds of node representing the block\n const box = this.layout.nodeFromElement(block).el.getBoundingClientRect();\n // compare to bounds\n if (vpt.x < box.left || vpt.x > box.right || vpt.y < box.top || vpt.y > box.bottom) {\n return 'none';\n }\n // context menu area?\n if (vpt.x >= box.right - kT.contextDotsW) {\n return 'dots';\n }\n // in block but nowhere special\n return 'main';\n }", "function showChart(type){\n\t\t\n\t\tswitch ( type ) {\n\t\n\t\t\tcase \"dealStagePie\" :\n\t\t\t\tchart = new Highcharts.Chart({\n\t\t\t chart: {\n\t\t\t\t\t\t\t\t\trenderTo: 'deal_stage',\n\t\t\t\t\t\t\t\t\tplotBackgroundColor: null,\n\t\t\t\t\t\t\t\t\tplotBorderWidth: null,\n\t\t\t\t\t\t\t\t\tplotShadow: true\n\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\ttitle: {\n\t\t\t\t\t\t\t\t\ttext: ucwords(Joomla.JText._('COBALT_DEALS_BY_STAGE'))\n\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\ttooltip: {\n\t\t\t\t\t\t\t\t\tformatter: function() {\n\t\t\t\t\t\t\t\t\t\treturn '<b>'+ this.point.name +'</b>: '+ this.percentage.toFixed(2) +' %';\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\tplotOptions: {\n\t\t\t\t\t\t\t\t\tpie: {\n\t\t\t\t\t\t\t\t\t\tallowPointSelect: true,\n\t\t\t\t\t\t\t\t\t\tcursor: 'pointer',\n\t\t\t\t\t\t\t\t\t\tdataLabels: {\n\t\t\t\t\t\t\t\t\t\t\tenabled: true,\n\t\t\t\t\t\t\t\t\t\t\tcolor: '#000000',\n\t\t\t\t\t\t\t\t\t\t\tconnectorColor: '#000000',\n\t\t\t\t\t\t\t\t\t\t\tformatter: function() {\n\t\t\t\t\t\t\t\t\t\t\t\treturn '<b>'+ this.point.name +'</b>: '+ this.percentage.toFixed(2) +' %';\n\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t},\n\t\t\t\t series: [{\n\t\t\t\t \ttype: 'pie',\n\t\t\t\t\t\t\t\t\tname: ucwords(Joomla.JText._('COBALT_DEALS_BY_STAGE')),\n\t\t\t\t\t\t\t\t\tdata: graphData.deal_stage\n\t\t\t\t }]\n\t\t \t});\n\t \tbreak;\n\n\t\t\tcase 'dealStageBar' :\n\t\t\t \tchart = new Highcharts.Chart({\n\t\t\t \t\t\t\tchart: {\n\t\t\t\t\t\t\t\t\trenderTo: 'deal_stage',\n\t\t\t\t\t\t\t\t\tdefaultSeriesType: 'column'\n\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\ttitle: {\n\t\t\t\t\t\t\t\t\ttext: ucwords(Joomla.JText._('COBALT_DEALS_BY_STAGE'))\n\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\txAxis: {\n\t\t\t\t\t\t\t\t\tcategories:graphData.stage_names\n\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\tyAxis: {\n\t\t\t\t\t\t\t\t\tmin: 0,\n\t\t\t\t\t\t\t\t\ttitle: {\n\t\t\t\t\t\t\t\t\t\ttext: ucwords(Joomla.JText._('COBALT_TOTAL'))\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\tlegend: {\n\t\t\t\t\t\t\t\t\tenabled:false\n\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\ttooltip: {\n\t\t\t\t\t\t\t\t\tformatter: function() {\n\t\t\t\t\t\t\t\t\t\treturn ''+\n\t\t\t\t\t\t\t\t\t\t\tthis.x +': '+ this.y;\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\tplotOptions: {\n\t\t\t\t\t\t\t\t\tcolumn: {\n\t\t\t\t\t\t\t\t\t\tpointPadding: 0.2,\n\t\t\t\t\t\t\t\t\t\tborderWidth: 0\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t series: [{\n\t\t\t\t\t\t\t \tname:ucwords(Joomla.JText._('COBALT_DEALS_BY_STAGE')),\n\t\t\t\t\t\t\t \tdata: graphData.deal_stage\n\t\t\t\t\t\t\t }]\n\t\t\t\t\t});\n\t\t\t\tbreak;\n\t\t\t\t\n\t\t\tcase 'dealStatusPie' :\n\t\t\t\tchart = new Highcharts.Chart({\n\t\t\t chart: {\n\t\t\t\t\t\t\t\t\trenderTo: 'deal_status',\n\t\t\t\t\t\t\t\t\tplotBackgroundColor: null,\n\t\t\t\t\t\t\t\t\tplotBorderWidth: null,\n\t\t\t\t\t\t\t\t\tplotShadow: true\n\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\ttitle: {\n\t\t\t\t\t\t\t\t\ttext: ucwords(Joomla.JText._('COBALT_DEALS_BY_STATUS'))\n\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\ttooltip: {\n\t\t\t\t\t\t\t\t\tformatter: function() {\n\t\t\t\t\t\t\t\t\t\treturn '<b>'+ this.point.name +'</b>: '+ this.percentage.toFixed(2) +' %';\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\tplotOptions: {\n\t\t\t\t\t\t\t\t\tpie: {\n\t\t\t\t\t\t\t\t\t\tallowPointSelect: true,\n\t\t\t\t\t\t\t\t\t\tcursor: 'pointer',\n\t\t\t\t\t\t\t\t\t\tdataLabels: {\n\t\t\t\t\t\t\t\t\t\t\tenabled: true,\n\t\t\t\t\t\t\t\t\t\t\tcolor: '#000000',\n\t\t\t\t\t\t\t\t\t\t\tconnectorColor: '#000000',\n\t\t\t\t\t\t\t\t\t\t\tformatter: function() {\n\t\t\t\t\t\t\t\t\t\t\t\treturn '<b>'+ this.point.name +'</b>: '+ this.percentage.toFixed(2) +' %';\n\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t},\n\t\t\t\t series: [{\n\t\t\t\t \ttype: 'pie',\n\t\t\t\t\t\t\t\t\tname: ucwords(Joomla.JText._('COBALT_DEALS_BY_STATUS')),\n\t\t\t\t\t\t\t\t\tdata: graphData.deal_status\n\t\t\t\t }]\n\t\t \t});\n\t\t\tbreak;\n\t\t\t\n\t\t\tcase 'dealStatusBar' :\n\t\t\t\tchart = new Highcharts.Chart({\n\t\t\t \t\t\t\tchart: {\n\t\t\t\t\t\t\t\t\trenderTo: 'deal_status',\n\t\t\t\t\t\t\t\t\tdefaultSeriesType: 'column'\n\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\ttitle: {\n\t\t\t\t\t\t\t\t\ttext: ucwords(Joomla.JText._('COBALT_DEALS_BY_STATUS'))\n\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\txAxis: {\n\t\t\t\t\t\t\t\t\tcategories:graphData.status_names\n\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\tyAxis: {\n\t\t\t\t\t\t\t\t\tmin: 0,\n\t\t\t\t\t\t\t\t\ttitle: {\n\t\t\t\t\t\t\t\t\t\ttext: ucwords(Joomla.JText._('COBALT_TOTAL'))\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\tlegend: {\n\t\t\t\t\t\t\t\t\tenabled:false\n\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\ttooltip: {\n\t\t\t\t\t\t\t\t\tformatter: function() {\n\t\t\t\t\t\t\t\t\t\treturn ''+\n\t\t\t\t\t\t\t\t\t\t\tthis.x +': '+ this.y;\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\tplotOptions: {\n\t\t\t\t\t\t\t\t\tcolumn: {\n\t\t\t\t\t\t\t\t\t\tpointPadding: 0.2,\n\t\t\t\t\t\t\t\t\t\tborderWidth: 0\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t series: [{\n\t\t\t\t\t\t\t \tname:ucwords(Joomla.JText._('COBALT_DEALS_BY_STATUS')),\n\t\t\t\t\t\t\t \tdata: graphData.deal_status\n\t\t\t\t\t\t\t }]\n\t\t\t\t\t});\n\t\t\tbreak;\n\t\t\t\n\t\t\tcase 'leadRevenue' :\n\t\t\t\tchart = new Highcharts.Chart({\n\t\t\t chart: {\n\t\t\t\t\t\t\t\t\trenderTo: 'lead_revenue',\n\t\t\t\t\t\t\t\t\tplotBackgroundColor: null,\n\t\t\t\t\t\t\t\t\tplotBorderWidth: null,\n\t\t\t\t\t\t\t\t\tplotShadow: true\n\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\ttitle: {\n\t\t\t\t\t\t\t\t\ttext: ucwords(Joomla.JText._('COBALT_REVENUE_FROM_LEAD_SOURCES'))\n\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\ttooltip: {\n\t\t\t\t\t\t\t\t\tformatter: function() {\n\t\t\t\t\t\t\t\t\t\treturn '<b>'+ this.point.name +'</b>: '+Joomla.JText._('COBALT_CURRENCY')+this.point.data;\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\tplotOptions: {\n\t\t\t\t\t\t\t\t\tpie: {\n\t\t\t\t\t\t\t\t\t\tallowPointSelect: true,\n\t\t\t\t\t\t\t\t\t\tcursor: 'pointer',\n\t\t\t\t\t\t\t\t\t\tdataLabels: {\n\t\t\t\t\t\t\t\t\t\t\tenabled: true,\n\t\t\t\t\t\t\t\t\t\t\tcolor: '#000000',\n\t\t\t\t\t\t\t\t\t\t\tconnectorColor: '#000000',\n\t\t\t\t\t\t\t\t\t\t\tformatter: function() {\n\t\t\t\t\t\t\t\t\t\t\t\treturn '<b>'+ this.point.name +'</b>: '+Joomla.JText._('COBALT_CURRENCY')+this.point.data;\n\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t},\n\t\t\t\t series: [{\n\t\t\t\t \ttype: 'pie',\n\t\t\t\t\t\t\t\t\tname: ucwords(Joomla.JText._('COBALT_REVENUE_FROM_LEAD_SOURCES')),\n\t\t\t\t\t\t\t\t\tdata: graphData.lead_sources\n\t\t\t\t }]\n\t\t \t});\n\t\t \t\n\t\t\tbreak;\n\t\t\t\n\t\t\t//TODO\n\t\t\tcase 'leadCloseTime' :\n\t\t\t\t\n\t\t\t\t\n\t\t\tbreak;\n\t\t\t\n\t\t\tcase 'yearlyCommissions' :\n\t\t\tchart = new Highcharts.Chart({\n\t\t\t \t\t\t\tchart: {\n\t\t\t\t\t\t\t\t\trenderTo: 'yearly_commissions',\n\t\t\t\t\t\t\t\t\tdefaultSeriesType: 'column'\n\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\ttitle: {\n\t\t\t\t\t\t\t\t\ttext: ucwords(Joomla.JText._('COBALT_YEARLY_COMMISSIONS'))\n\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\txAxis: {\n\t\t\t\t\t\t\t\t\tcategories:graphData.months\n\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\tyAxis: {\n\t\t\t\t\t\t\t\t\tmin: 0,\n\t\t\t\t\t\t\t\t\ttitle: {\n\t\t\t\t\t\t\t\t\t\ttext: Joomla.JText._('COBALT_TOTAL')\n\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\tlabels:{formatter:function(){\n\t\t\t\t\t\t\t\t\t\treturn Joomla.JText._('COBALT_CURRENCY')+this.value;\n\t\t\t\t\t\t\t\t\t}}\n\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\tlegend: {\n\t\t\t\t\t\t\t\t\tenabled:false\n\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\ttooltip: {\n\t\t\t\t\t\t\t\t\tformatter: function() {\n\t\t\t\t\t\t\t\t\t\treturn ''+\n\t\t\t\t\t\t\t\t\t\t\tthis.x +': '+Joomla.JText._('COBALT_CURRENCY')+ this.y;\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\tplotOptions: {\n\t\t\t\t\t\t\t\t\tcolumn: {\n\t\t\t\t\t\t\t\t\t\tpointPadding: 0.2,\n\t\t\t\t\t\t\t\t\t\tborderWidth: 0\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t series: [{\n\t\t\t\t\t\t\t \tname:ucwords(Joomla.JText._('COBALT_YEARLY_COMMISSIONS')),\n\t\t\t\t\t\t\t \tdata: graphData.yearly_commissions\n\t\t\t\t\t\t\t }]\n\t\t\t\t\t});\n\t\t\tbreak;\n\t\t\t\n\t\t\tcase 'monthlyCommissions' :\n\t\t\tchart = new Highcharts.Chart({\n\t\t\t \t\t\t\tchart: {\n\t\t\t\t\t\t\t\t\trenderTo: 'monthly_commissions',\n\t\t\t\t\t\t\t\t\tdefaultSeriesType: 'column'\n\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\ttitle: {\n\t\t\t\t\t\t\t\t\ttext: ucwords(Joomla.JText._('COBALT_MONTHLY_COMMISSIONS'))\n\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\txAxis: {\n\t\t\t\t\t\t\t\t\tcategories:graphData.weeks\n\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\tyAxis: {\n\t\t\t\t\t\t\t\t\tmin: 0,\n\t\t\t\t\t\t\t\t\ttitle: {\n\t\t\t\t\t\t\t\t\t\ttext: Joomla.JText._('COBALT_TOTAL')\n\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\tlabels:{formatter:function(){\n\t\t\t\t\t\t\t\t\t\treturn Joomla.JText._('COBALT_CURRENCY')+this.value;\n\t\t\t\t\t\t\t\t\t}}\n\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\tlegend: {\n\t\t\t\t\t\t\t\t\tenabled:false\n\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\ttooltip: {\n\t\t\t\t\t\t\t\t\tformatter: function() {\n\t\t\t\t\t\t\t\t\t\treturn ''+\n\t\t\t\t\t\t\t\t\t\t\tthis.x +': '+Joomla.JText._('COBALT_CURRENCY')+ this.y;\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\tplotOptions: {\n\t\t\t\t\t\t\t\t\tcolumn: {\n\t\t\t\t\t\t\t\t\t\tpointPadding: 0.2,\n\t\t\t\t\t\t\t\t\t\tborderWidth: 0\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t series: [{\n\t\t\t\t\t\t\t \tname: ucwords(Joomla.JText._('COBALT_MONTHLY_COMMISSIONS')),\n\t\t\t\t\t\t\t \tdata: graphData.monthly_commissions\n\t\t\t\t\t\t\t }]\n\t\t\t\t\t});\n\t\t\tbreak;\n\t\t\t\n\t\t\tcase 'yearlyRevenue' :\n\t\t\t chart = new Highcharts.Chart({\n\t\t\t \t\t\t\tchart: {\n\t\t\t\t\t\t\t\t\trenderTo: 'yearly_revenue',\n\t\t\t\t\t\t\t\t\tdefaultSeriesType: 'column'\n\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\ttitle: {\n\t\t\t\t\t\t\t\t\ttext: ucwords(Joomla.JText._('COBALT_YEARLY_REVENUE'))\n\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\txAxis: {\n\t\t\t\t\t\t\t\t\tcategories:graphData.months\n\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\tyAxis: {\n\t\t\t\t\t\t\t\t\tmin: 0,\n\t\t\t\t\t\t\t\t\ttitle: {\n\t\t\t\t\t\t\t\t\t\ttext: Joomla.JText._('COBALT_TOTAL')\n\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\tlabels:{formatter:function(){\n\t\t\t\t\t\t\t\t\t\treturn Joomla.JText._('COBALT_CURRENCY')+this.value;\n\t\t\t\t\t\t\t\t\t}}\n\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\tlegend: {\n\t\t\t\t\t\t\t\t\tenabled:false\n\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\ttooltip: {\n\t\t\t\t\t\t\t\t\tformatter: function() {\n\t\t\t\t\t\t\t\t\t\treturn ''+\n\t\t\t\t\t\t\t\t\t\t\tthis.x +': '+Joomla.JText._('COBALT_CURRENCY')+ this.y;\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\tplotOptions: {\n\t\t\t\t\t\t\t\t\tcolumn: {\n\t\t\t\t\t\t\t\t\t\tpointPadding: 0.2,\n\t\t\t\t\t\t\t\t\t\tborderWidth: 0\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t series: [{\n\t\t\t\t\t\t\t \tname: ucwords(Joomla.JText._('COBALT_YEARLY_REVENUE')),\n\t\t\t\t\t\t\t \tdata: graphData.yearly_revenue\n\t\t\t\t\t\t\t }]\n\t\t\t\t\t});\n\t\t\tbreak;\n\t\t\t\n\t\t\tcase 'monthlyRevenue' :\n\t\t\tchart = new Highcharts.Chart({\n\t\t\t \t\t\t\tchart: {\n\t\t\t\t\t\t\t\t\trenderTo: 'monthly_revenue',\n\t\t\t\t\t\t\t\t\tdefaultSeriesType: 'column'\n\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\ttitle: {\n\t\t\t\t\t\t\t\t\ttext: ucwords(Joomla.JText._('COBALT_MONTHLY_REVENUE'))\n\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\txAxis: {\n\t\t\t\t\t\t\t\t\tcategories:graphData.weeks\n\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\tyAxis: {\n\t\t\t\t\t\t\t\t\tmin: 0,\n\t\t\t\t\t\t\t\t\ttitle: {\n\t\t\t\t\t\t\t\t\t\ttext: Joomla.JText._('COBALT_TOTAL')\n\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\tlabels:{formatter:function(){\n\t\t\t\t\t\t\t\t\t\treturn Joomla.JText._('COBALT_CURRENCY')+this.value;\n\t\t\t\t\t\t\t\t\t}}\n\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\tlegend: {\n\t\t\t\t\t\t\t\t\tenabled:false\n\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\ttooltip: {\n\t\t\t\t\t\t\t\t\tformatter: function() {\n\t\t\t\t\t\t\t\t\t\treturn ''+\n\t\t\t\t\t\t\t\t\t\t\tJoomla.JText._('COBALT_WEEK')+' '+this.x +': '+Joomla.JText._('COBALT_CURRENCY')+ this.y;\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\tplotOptions: {\n\t\t\t\t\t\t\t\t\tcolumn: {\n\t\t\t\t\t\t\t\t\t\tpointPadding: 0.2,\n\t\t\t\t\t\t\t\t\t\tborderWidth: 0\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t series: [{\n\t\t\t\t\t\t\t \tname: ucwords(Joomla.JText._('COBALT_MONTHLY_REVENUE')),\n\t\t\t\t\t\t\t \tdata: graphData.monthly_revenue\n\t\t\t\t\t\t\t }]\n\t\t\t\t\t});\n\t\t\tbreak;\n\t\t\t\n\t\t\t}\n}", "function sliderBlockWidth(content){\n let eventParentWidth = $(content).find(\".carusel_block\").width();\n eventParentWidth = parseFloat(eventParentWidth);\n\n let eventBlockWidthSum;\n eventBlockWidthSum = (eventParentWidth / 3) -8.5;\n eventBlockWidthSum = parseInt(eventBlockWidthSum) +3;\n\n // blocks width for mobile\n if($(window).width() < 1024){\n eventBlockWidthSum = 100;\n }\n $(content +' > .carusel_block > .list_block > div').css({width: eventBlockWidthSum + 'px'});\n }", "function block(base, stateless) {\n\n var target = base.data('target');\n\n if (!target.hasClass(clsList[14])) {\n\n // The visual effects should not always be applied.\n if (!stateless) {\n target.addClass(clsList[15]);\n setTimeout(function () {\n target.removeClass(clsList[15]);\n }, 450);\n }\n\n target.addClass(clsList[14]);\n call(base.data('options').block, target);\n }\n }", "async function doBlockingSend(action) {\n await null;\n // blockManagerConsole.warn(\n // 'FIGME: blockHeight',\n // action.blockHeight,\n // 'received',\n // action.type,\n // );\n switch (action.type) {\n case ActionType.AG_COSMOS_INIT: {\n const { isBootstrap, upgradePlan, blockTime } = action;\n // This only runs for the very first block on the chain.\n if (isBootstrap) {\n verboseBlocks && blockManagerConsole.info('block bootstrap');\n savedHeight === 0 ||\n Fail`Cannot run a bootstrap block at height ${savedHeight}`;\n const blockHeight = 0;\n const runNum = 0;\n controller.writeSlogObject({\n type: 'cosmic-swingset-bootstrap-block-start',\n blockTime,\n });\n controller.writeSlogObject({\n type: 'cosmic-swingset-run-start',\n blockHeight,\n runNum,\n });\n await processAction(action.type, async () =>\n bootstrapBlock(blockHeight, blockTime),\n );\n controller.writeSlogObject({\n type: 'cosmic-swingset-run-finish',\n blockHeight,\n runNum,\n });\n controller.writeSlogObject({\n type: 'cosmic-swingset-bootstrap-block-finish',\n blockTime,\n });\n }\n if (upgradePlan) {\n const blockHeight = upgradePlan.height;\n if (blockNeedsExecution(blockHeight)) {\n controller.writeSlogObject({\n type: 'cosmic-swingset-upgrade-start',\n blockHeight,\n blockTime,\n upgradePlan,\n });\n // Process upgrade plan\n const upgradedAction = {\n type: ActionType.ENACTED_UPGRADE,\n upgradePlan,\n blockHeight,\n blockTime,\n };\n await doBlockingSend(upgradedAction);\n controller.writeSlogObject({\n type: 'cosmic-swingset-upgrade-finish',\n blockHeight,\n blockTime,\n });\n }\n }\n return true;\n }\n\n case ActionType.ENACTED_UPGRADE: {\n // Install and execute new core proposals.\n const {\n upgradePlan: { info: upgradeInfoJson = null } = {},\n blockHeight,\n blockTime,\n } = action;\n const upgradePlanInfo =\n upgradeInfoJson &&\n parseLocatedJson(upgradeInfoJson, 'ENACTED_UPGRADE upgradePlan.info');\n\n // Handle the planned core proposals as just another action.\n const { coreProposals = [] } = upgradePlanInfo || {};\n\n if (!coreProposals.length) {\n // Nothing to do.\n return undefined;\n }\n\n // Find scripts relative to our location.\n const myFilename = fileURLToPath(import.meta.url);\n const { bundles, code: coreEvalCode } =\n await extractCoreProposalBundles(coreProposals, myFilename, {\n handleToBundleSpec: async (handle, source, _sequence, _piece) => {\n const bundle = await bundleSource(source);\n const { endoZipBase64Sha512: hash } = bundle;\n const bundleID = `b1-${hash}`;\n handle.bundleID = bundleID;\n harden(handle);\n return harden([`${bundleID}: ${source}`, bundle]);\n },\n });\n\n for (const [meta, bundle] of Object.entries(bundles)) {\n await controller\n .validateAndInstallBundle(bundle)\n .catch(e => Fail`Cannot validate and install ${meta}: ${e}`);\n }\n\n // Now queue the code for evaluation.\n //\n // TODO: Once SwingSet sprouts some tools for preemption, we should use\n // them to help the upgrade process finish promptly.\n const coreEvalAction = {\n type: ActionType.CORE_EVAL,\n blockHeight,\n blockTime,\n evals: [\n {\n json_permits: 'true',\n js_code: coreEvalCode,\n },\n ],\n };\n highPriorityQueue.push({\n context: {\n blockHeight,\n txHash: 'x/upgrade',\n msgIdx: 0,\n },\n action: coreEvalAction,\n });\n\n return undefined;\n }\n\n case ActionType.COMMIT_BLOCK: {\n const { blockHeight, blockTime } = action;\n verboseBlocks &&\n blockManagerConsole.info('block', blockHeight, 'commit');\n if (blockHeight !== savedHeight) {\n throw Error(\n `Committed height ${blockHeight} does not match saved height ${savedHeight}`,\n );\n }\n\n controller.writeSlogObject({\n type: 'cosmic-swingset-commit-block-start',\n blockHeight,\n blockTime,\n });\n\n // Save the kernel's computed state just before the chain commits.\n const start2 = Date.now();\n await saveOutsideState(savedHeight);\n saveTime = Date.now() - start2;\n\n blockParams = undefined;\n\n blockManagerConsole.debug(\n `wrote SwingSet checkpoint [run=${runTime}ms, chainSave=${chainTime}ms, kernelSave=${saveTime}ms]`,\n );\n\n return undefined;\n }\n\n case ActionType.AFTER_COMMIT_BLOCK: {\n const { blockHeight, blockTime } = action;\n\n const fullSaveTime = Date.now() - endBlockFinish;\n\n controller.writeSlogObject({\n type: 'cosmic-swingset-commit-block-finish',\n blockHeight,\n blockTime,\n saveTime: saveTime / 1000,\n chainTime: chainTime / 1000,\n fullSaveTime: fullSaveTime / 1000,\n });\n\n afterCommitWorkDone = afterCommit(blockHeight, blockTime);\n\n return undefined;\n }\n\n case ActionType.BEGIN_BLOCK: {\n const { blockHeight, blockTime, params } = action;\n blockParams = parseParams(params);\n verboseBlocks &&\n blockManagerConsole.info('block', blockHeight, 'begin');\n runTime = 0;\n\n controller.writeSlogObject({\n type: 'cosmic-swingset-begin-block',\n blockHeight,\n blockTime,\n inboundQueueStats: inboundQueueMetrics.getStats(),\n });\n\n return undefined;\n }\n\n case ActionType.END_BLOCK: {\n const { blockHeight, blockTime } = action;\n controller.writeSlogObject({\n type: 'cosmic-swingset-end-block-start',\n blockHeight,\n blockTime,\n });\n\n blockParams || Fail`blockParams missing`;\n\n if (!blockNeedsExecution(blockHeight)) {\n // We are reevaluating, so do not do any work, and send exactly the\n // same downcalls to the chain.\n //\n // This is necessary only after a restart when Tendermint is reevaluating the\n // block that was interrupted and not committed.\n //\n // We assert that the return values are identical, which allows us to silently\n // clear the queue.\n try {\n replayChainSends();\n } catch (e) {\n // Very bad!\n decohered = e;\n throw e;\n }\n } else {\n // And now we actually process the queued actions down here, during\n // END_BLOCK, but still reentrancy-protected.\n\n provideInstallationPublisher();\n\n await processAction(action.type, async () =>\n endBlock(blockHeight, blockTime, blockParams),\n );\n\n // We write out our on-chain state as a number of chainSends.\n const start = Date.now();\n await saveChainState();\n chainTime = Date.now() - start;\n\n // Advance our saved state variables.\n savedHeight = blockHeight;\n }\n controller.writeSlogObject({\n type: 'cosmic-swingset-end-block-finish',\n blockHeight,\n blockTime,\n inboundQueueStats: inboundQueueMetrics.getStats(),\n });\n\n endBlockFinish = Date.now();\n\n return undefined;\n }\n\n default: {\n throw Fail`Unrecognized action ${action}; are you sure you didn't mean to queue it?`;\n }\n }\n }", "async function formatPage(state, currentFlowValue, heightValue, safeRange, heightRange, siteGeoLocation, siteName, unitSet, siteID, relaxPeriod, baseFlow) {\n// This object contains the information to determine the formatting of each global style\nvar formatChoices = {\n 'yes': {\n background_color: '#2E933C',\n text_color: '#261C15',\n stroke_color: '#261C15'\n },\n 'maybe': {\n background_color: '#FF7F11',\n text_color: '#E4E6C3',\n stroke_color: '#E4E6C3'\n },\n 'no': {\n background_color: '#C41E3D',\n text_color: '#EAC435',\n stroke_color: '#EAC435'\n }\n}\n\n// Swap favicons\nswapFavicon(state);\n\n// Fill in the border edge content\n$('#low-range').text(safeRange.min);\n$('#high-range').text(safeRange.max);\n// Set the range scale and position the low, high, and indicator\nif(currentFlowValue > safeRange.max) {\n var maxScale = currentFlowValue*1.25;\n} else {\n var maxScale = safeRange.max*1.25;\n}\nvar lowLeft = (safeRange.min*100)/maxScale;\nvar highLeft = (safeRange.max*100)/maxScale;\nvar indicatorLeft = (currentFlowValue*100)/maxScale;\n$('#low-range').css('left', lowLeft + '%');\n$('#high-range').css('left', highLeft + '%');\n$('#range-indicator').css('left', indicatorLeft + '%');\n\n// Height content\n$('#low-height').text(heightRange.min);\n$('#high-height').text(heightRange.max);\n\n// Set the height scale and position the low, high, and indicator\nvar heightRangeSize = heightRange.max - heightRange.min;\nif(heightValue > heightRange.max) {\n var maxHeightScale = heightValue + (heightRangeSize*.25);\n var minHeightScale = 0;\n} else {\n var maxHeightScale = heightRange.max + (heightRangeSize*.25);\n var minHeightScale = 0;\n}\nvar lowHeightLeft = remapNumber(heightRange.min, minHeightScale, maxHeightScale, 0, 100);\nvar highHeightLeft = remapNumber(heightRange.max, minHeightScale, maxHeightScale, 0, 100);\nvar indicatorHeightLeft = remapNumber(heightValue, minHeightScale, maxHeightScale, 0, 100);\n$('#low-height').css('left', lowHeightLeft + '%');\n$('#high-height').css('left', highHeightLeft + '%');\n$('#height-indicator').css('left', indicatorHeightLeft + '%');\ngsap.to('#background-wave', {duration: 2.5, delay: 1.25, ease: 'power2.inOut', attr:{'data-height': indicatorHeightLeft}})\n\n// Set the display option to default\n$('#icon-translation').css('transform', 'translate(3.2779px, 0px)');\n$('#icon-sun').css('opacity', '0');\n$('#icon-i').css('opacity', '0');\n\n// Set the wave mask to the correct size\n$('#background-wave > mask').attr('width', $(window).width()).attr('height', $(window).height());\n$('#background-wave > mask > g > rect').attr('width', $(window).width()).attr('height', $(window).height());\n\n// Add loading spinner state to graph area\nlet loaderClass = 'graph-load-state-' + state;\ndocument.querySelector('.graph-load-state').classList.add(loaderClass)\n\n// Call a weather display update\nweatherUpdate(siteGeoLocation, siteName, unitSet, formatChoices[state].stroke_color);\n\n// Call a local business update\nlocalBusinessPopulate(siteGeoLocation, document.getElementById('local-outfitters'), siteName, state);\n\n// Begin the transition to the final state\ngsap.timeline()\n .delay(.25)\n .call(createAnswer, [state, currentFlowValue])\n .set('.border-content', {zIndex: 100})\n .set('.border-text', {color: formatChoices[state].text_color})\n .set('#answer > .container', {y: '150%', color: formatChoices[state].text_color})\n .set('#current-flow > .container', {y: '150%', color: formatChoices[state].text_color})\n .set('.measurement-number', {color: formatChoices[state].text_color})\n .set('.border-text > .container', {color: formatChoices[state].text_color})\n .set('.border-text', {background: formatChoices[state].background_color})\n .set('.date-content', {skewX: 0, skewY: 0, rotation: '-90', scaleX: 0, scaleY: 1})\n .set('.date-mask > .container', {color: formatChoices[state].text_color})\n .set('.date-mask', {background: formatChoices[state].background_color})\n .set('.settings-text', {color: formatChoices[state].text_color})\n .set('.unit-item', {color: formatChoices[state].text_color})\n .set('.unit-seperator', {color: formatChoices[state].text_color})\n .set('svg .svg-stroke-style', {stroke: formatChoices[state].stroke_color})\n .set('svg .svg-fill-style', {fill: formatChoices[state].stroke_color})\n .set('.point-indicator > svg > path', {fill: formatChoices[state].stroke_color})\n .set('.tooltip-item', {color: formatChoices[state].background_color, background: formatChoices[state].text_color})\n .set('.forecast-item', {borderColor: formatChoices[state].stroke_color})\n .set('#weather-forecast', {borderColor: formatChoices[state].stroke_color, color: formatChoices[state].text_color})\n .set('.line-rule', {background: formatChoices[state].stroke_color})\n .set('.information-display', {borderColor: formatChoices[state].stroke_color, color: formatChoices[state].text_color})\n .set('#graph-timeline > .container', {height: 'auto'})\n .to('body', {duration: 1, background: formatChoices[state].background_color})\n .to('.border-content', {duration: .75, ease: 'power2.inOut', height: $(window).height()-150, opacity: 1}, '-=.25')\n .to('#background-wave > path', {duration: .75, ease: 'power2.inOut', fill: formatChoices[state].text_color}, '-=.75')\n .to('.footer-text', {duration: .75, ease: 'power2.inOut', color: formatChoices[state].text_color}, '-=.75')\n .to('#fill-title', {duration: .75, ease: 'power2.inOut', top: 75, x: '-50%', y: '-25%', color: formatChoices[state].text_color}, '-=.75')\n .to('#stroke-title', {duration: .75, ease: 'power2.inOut', top: 75, x: '-50%', y: '-25%', textStrokeColor: formatChoices[state].stroke_color}, '-=.75')\n .to('.subtitle', {duration: .75, ease: 'power2.inOut', top: (75 - (($('#fill-title').height()*2.25)*.25)/2), color: formatChoices[state].text_color}, '-=.75')\n .to('.border-content', {duration: .75, borderColor: formatChoices[state].stroke_color}, '-=.75')\n .to('#answer > .container', {duration: .75, ease: 'power2.inOut', y: '0%'}, '-=.75')\n .to('#current-flow > .container', {duration: .5, ease: 'power2.inOut', y: '0%'}, '-=.375')\n .to('.date-content', {duration: .5, ease: 'power2.inOut', scaleX: 1, scaleY: 1, rotation: '-90', skewX: 0, skewY: 0}, '-=.375')\n .to('.date-mask > .container', {duration: .5, ease: 'power2.inOut', x: '0%'}, '-=.375')\n .to('.range-content > .container > .border-text', {duration: .375, ease: 'power2.inOut', scaleX: 1}, '-=.25')\n .to('#range-label > .container', {duration: .375, ease: 'power2.inOut', y: '0%'}, '-=.25')\n .to('.range-wrapper > .container > .measurement-number', {duration: .375, ease: 'power2.inOut', y: '0%'}, '-=.25')\n .to('#range-indicator', {duration: .375, ease: 'power2.inOut', y: '0%'}, \"-=.25\")\n .to('#range-unit > .container', {duration: .375, ease: 'power2.inOut', y: '0%'}, \"-=.25\")\n .set('.height-content', {width: (($(window).height()-150)*.9)})\n .to('.height-content > .container > .border-text', {duration: .375, ease: 'power2.inOut', scaleX: 1}, \"-=.25\")\n .to('#height-label > .container', {duration: .375, ease: 'power2.inOut', y: '0%'}, '-=.25')\n .to('.height-wrapper > .container > .measurement-number', {duration: .375, ease: 'power2.inOut', y: '0%'}, '-=.25')\n .to('#height-indicator', {duration: .375, ease: 'power2.inOut', y: '0%'}, \"-=.25\")\n .to('#height-unit > .container', {duration: .375, ease: 'power2.inOut', y: '0%'}, \"-=.25\")\n .from('#settings-cog', {duration: 1.25, ease: 'power2.inOut', rotation: -720}, \"-=.375\")\n .to('#settings-cog', {duration: .375, ease: 'linear', opacity: 1}, \"-=1\")\n .to('#current-conditions-box', {duration: .5, ease: 'power2.inOut', opacity: 1}, \"-=2.25\")\n .to('#current-conditions-box', {duration: 1, ease: 'power2.inOut', scale: 1}, \"-=2.5\")\n .to('#the-download-box', {duration: .5, ease: 'power2.inOut', opacity: 1}, \"-=2\")\n .to('#the-download-box', {duration: 1, ease: 'power2.inOut', scale: 1}, \"-=2.5\")\n .set('#range-tooltip', {pointerEvents: 'all'});\n\n // Update the units of measure\n measureUpdate(getCookie('canitube_Settings_Unit Measure'));\n\n // Test for 4D flow data, if present pass into raw data, else, run call to USGS\n let flowGraphRawData = '';\n if(checkLocalStorage('canitube_' + siteName + '_Period Data') == false) {\n // Call USGS for 4 day data\n flowGraphRawData = await fetchPeriodData(siteID, ['00060'], '4D');\n // Store the raw data in local storage\n writeLocalStorage('canitube_' + siteName + '_Period Data', JSON.stringify(flowGraphRawData), ['hourstil', 2], 'River');\n } else {\n flowGraphRawData = JSON.parse(readLocalStorage('canitube_' + siteName + '_Period Data').value);\n }\n\n // Call a graph update to display the returned 4-day data\n generateGraph(flowGraphRawData, safeRange.max, relaxPeriod, baseFlow, 16, formatChoices[state].stroke_color);\n}", "function pointType(player, callback) {\n const dist = utilityVector.distance(player.pos, player.job.currentPoint.position);\n if (dist > player.job.currentPoint.range) {\n return callback(false);\n }\n return callback(true);\n}", "function renderBlocks() {\n const $mainContainer = $(\"#main-container\");\n STATE.sdg.blocks.forEach((block, index) => {\n const blockId = `sdg-block-${index}`;\n // Render block\n $mainContainer.append(\n TEMPLATES.block({\n title: block.name,\n id: blockId,\n })\n );\n\n // Render charts\n const $chartContainer = $(`#${blockId}`);\n block.charts.forEach((chart) => {\n renderChart($chartContainer, chart);\n });\n });\n}", "function doorStyle(type, wallNumber) {\n\n //Get value of door style drop down\n var doorStyleDDL = document.getElementById('MainContent_ddlDoorStyle' + wallNumber + type).options[document.getElementById('MainContent_ddlDoorStyle' + wallNumber + type).selectedIndex].value;\n\n //If drop down value is v4TCabana, perform block\n if (doorStyleDDL == 'Vertical Four Track') {\n //Change door vinyl tint row display style to inherit\n document.getElementById('MainContent_rowDoorVinylTint' + wallNumber + type).style.display = 'inherit';\n //Change door number of vents row display style to inherit\n document.getElementById('MainContent_rowDoorNumberOfVents' + wallNumber + type).style.display = 'inherit';\n //Change door screen options row display style to none\n document.getElementById('MainContent_rowDoorScreenOptions' + wallNumber + type).style.display = 'none';\n }\n else if (doorStyleDDL == 'Full Screen' || doorStyleDDL == 'Screen' || doorStyleDDL == 'Aluminum Storm Screen')\n {\n //Change door screen options row display style to inherit\n document.getElementById('MainContent_rowDoorScreenOptions' + wallNumber + type).style.display = 'inherit';\n //Change door vinyl tint row display style to none\n document.getElementById('MainContent_rowDoorVinylTint' + wallNumber + type).style.display = 'none';\n //Change door number of vents row display style to inherit\n document.getElementById('MainContent_rowDoorNumberOfVents' + wallNumber + type).style.display = 'none';\n }\n //else, perform block\n else {\n //Change door vinyl tint row display style to none\n document.getElementById('MainContent_rowDoorVinylTint' + wallNumber + type).style.display = 'none';\n //Change door number of vents row display style to inherit\n document.getElementById('MainContent_rowDoorNumberOfVents' + wallNumber + type).style.display = 'none';\n //Change door screen options row display style to none\n document.getElementById('MainContent_rowDoorScreenOptions' + wallNumber + type).style.display = 'none';\n }\n}", "function functionName(data){\n\tvar maxRange = 1000 * 3600 * 24 * 14;\n\tvar chartOptions = {\n\t\tchart: { renderTo: 'container' },\n\t\tloading: {\n\t\t\tstyle: { opacity: 0.8 },\n\t\t\tlabelStyle: { fontSize: '300%' }\n\t\t},\n\t\txAxis: {\n\t\t\ttype: 'datetime',\n\t\t\tordinal: false,\n\t\t\tlabels : {\n\t\t\t\tformat: '{value:%m-%d %H:%M}',\n\t\t\t\trotation: 20\n\t\t\t}\n\t\t},\n\t yAxis: {\n\t \tlabels: { format: \"\" },\n\t \ttitle: {text: \"\" }\n\t },\n\t rangeSelector: {\n\t buttons: [{ type : 'hour', count : 6, text : '6h'\n\t }, { type : 'hour', count : 12, text : '12h'\n\t }, { type: 'day', count: 1, text: '1d'\n\t }, { type: 'day', count: 3, text: '3d'\n\t }, { type: 'week', count: 1, text: '1w'\n\t //}, { type: 'month', count: 1, text: '1m'\n\t // }, { type: 'month', count: 6, text: '6m'\n\t // }, { type: 'year', count: 1, text: '1y'\n\t // }, { type: 'all', text: 'All'\n\t }],\n\t selected: 4,\n\t inputEnabled: false\n\t },\n// navigator: { enabled: false },\n\t scrollbar: { enabled: false\n // , liveRedraw:false\n },\n\t // title : { text : 'Title' },\n\t plotOptions: {\n line: {\n pointInterval: 60 * 1000,\n gapSize: 30\n },\n\t\t\tseries: {\n\n lineWidth: 1,\n marker: {\n enabled: true,\n radius: 2\n },\n\n\t\t\t\t// dataGrouping: false, //Not needed here? Only in (root) series?\n\t\t\t\ttooltip: {\n // xDateFormat: '%A %m-%d-%Y %H:%M'\n headerFormat: ''\n\t\t\t\t\t// pointFormatter: tooltipFlags\n\t\t\t\t},\n\t\t\t \tturboThreshold: 0 //CRUCIAL for more than 1000 points!!!!\n\t\t\t}\n\t },\n\t series : [{\n\t \tdataGrouping: {enabled: false} //NEEDED or dataGrouping doesn't pass custom attributes/properties\n//\t\t, lineWidth: 0\n\t \t// , events : {\n\t \t\t// afterAnimate : function () {\n\t \t\t\t// console.log('HIDE loading');\n\t \t\t// }\n\t \t// }\n\t \t// , point: {\n\t \t\t// events: {\n\t \t\t\t// mouseOver: function () {\n\t \t\t\t\t// console.log(this);\n\t \t\t\t// }\n\t \t\t// }\n\t \t// }\n\t }]\n\t};\n\t// console.log(data.table.rows.length); //same as data[\"table\"][\"rows\"].length\n dataDict = [];\n min = data[\"table\"][\"rows\"][0][2];\n max = data[\"table\"][\"rows\"][0][2];\n $.each(data[\"table\"][\"rows\"], function (i, item) { //preference if bringing multiple columns\n \t// item[0] = new Date(item[0]).getTime();\n \t/// get min and max from data to be used to set yAxis range\n \tif (item[2] < min) { min = item[2] }\n \tif (item[2] > max) { max = item[2] }\n \trow = {\n \t\tx: new Date(item[1]).getTime(),\n \t\ty: item[2],\n unit: data[\"table\"]['columnUnits'][2]\n \t\t// flag1: item[3],\n \t\t// flag2: item[4]\n \t\t};\n ///\"store\" flag data to be used for the tooltip\n \tif ((!$(\"#onlyQC\").prop('checked')) && (flagsArr.indexOf(attr) > -1)) {\n \t\trow.flag1 = item[3]\n \t\trow.flag2 = item[4]\n \t\tif (row.flag1 != 1) { row.color = '#FF0000'}\n \t}\n \tdataDict.push(row);\n });\n // console.log(data[\"table\"][\"rows\"][0]);\n // console.log(dataDict.length, min, max);\n if (chart) chart.destroy();\n chartOptions.series[0].data = dataDict;\n chartOptions.series[0].name = attr; // data[\"table\"][\"columnNames\"][2];\n chartOptions.yAxis.title.text = attr+' ('+data[\"table\"][\"columnUnits\"][2]+')'; //data[\"table\"][\"columnNames\"][2];\n //chartOptions.yAxis.labels.format = '{value} '+data[\"table\"][\"columnUnits\"][2];\n chartOptions.yAxis.labels.format = '{value}';\n\n if ((!$(\"#onlyQC\").prop('checked')) && (flagsArr.indexOf(attr) > -1)) {\n \tchartOptions.plotOptions.series.tooltip.pointFormatter = tooltipFlags;\n } else {\n \tchartOptions.plotOptions.series.tooltip.pointFormatter = tooltipNoFlags;\n }\n // $('#container').highcharts('StockChart', chartOptions);\n chart = new Highcharts.StockChart(chartOptions);\n chart.yAxis[0].setExtremes(min, max);\n // chart.series[0].dataGrouping.enabled = false;\n}", "function t(e){return!!r(e)||\"block\"===s.dom.getStyle(\"display\").from(e)}", "function isValidElementType(type){if(typeof type==='string'||typeof type==='function'){return true;}// Note: typeof might be other than 'symbol' or 'number' (e.g. if it's a polyfill).\nif(type===exports.Fragment||type===exports.Profiler||type===REACT_DEBUG_TRACING_MODE_TYPE||type===exports.StrictMode||type===exports.Suspense||type===REACT_SUSPENSE_LIST_TYPE||type===REACT_LEGACY_HIDDEN_TYPE||enableScopeAPI){return true;}if(typeof type==='object'&&type!==null){if(type.$$typeof===REACT_LAZY_TYPE||type.$$typeof===REACT_MEMO_TYPE||type.$$typeof===REACT_PROVIDER_TYPE||type.$$typeof===REACT_CONTEXT_TYPE||type.$$typeof===REACT_FORWARD_REF_TYPE||type.$$typeof===REACT_FUNDAMENTAL_TYPE||type.$$typeof===REACT_BLOCK_TYPE||type[0]===REACT_SERVER_BLOCK_TYPE){return true;}}return false;}", "function renderBlocks(saveData,target){\n\t\t/**\n\t\t*init variables and reuse typeString later\n\t\t*/\t\n\t\tvar blockTypes = ['g_block_c2','g_block_c3','g_block_c4','g_block_c5','g_block_c6','g_block_c7','g_block_c8','g_block_c9','g_block_c12'];\n\t\n\t\t//var blockBox= $(\"#g_page \"+target+\" div.\"+blockTypes.join(\",#g_page div.\")),l,typeIs,i,ref,type,arrtest,assign=tdc.Grd.Templates.getByID('blockBox');\n\t\t\n\t\t// We use the following line until all block markup have been \"wrapped\"\n\t\tvar blockBox= $(\"#g_page \"+target+\" .g_block_content.\"+blockTypes.join(\",#g_page .g_block_content.\")),l,typeIs,i,ref,type,arrtest,assign=tdc.Grd.Templates.getByID('blockBox');\n\t\tvar data;\n\t\n\t\tif(blockBox.length){\n\t\t\tvar blength=blockBox.length;\n\t\n\t\t\tfor (i=0;i<blength; i++) {\n\t\t\t\tref=$(blockBox[i]);\n\t\t\t\tarrtest=ref.attr('class').split(' ');\n\t\t\t\tl = arrtest.length;\n\t\t\t\tfor (var j=0;j<l; j++) {\n\t\t\t\t\ttypeIs = blockTypes.indexOf(arrtest[j]);\n\t\t\t\t\tif(typeIs!=-1){\n\t\t\t\t\t\t/**\n\t\t\t\t\t\t*if data is needed AGAIN\n\t\t\t\t\t\t*/\n\t\t\t\t\t\tif(saveData){\n\t\t\t\t\t\t\t$(this).data('blockType',blockTypes[typeIs]);\n\t\t\t\t\t\t}\n\t\t\n\t\t\t\t\t\tvar blockType=blockTypes[typeIs];\n\t\t\t\t\t\t\n\t\t\t\t\t\tdata = { //data object used in template rendering engine\n\t\t\t\t\t\t\ttype:blockType, //set type\n\t\t\t\t\t\t\tref:ref.removeClass(blockType).outerHTML() //cleanup the markup the class on the ref is not needed longer\n\t\t\t\t\t\t};\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tref.fasterReplace($.renderTemplate(assign,data));\n\t\t\t\t//ref.replaceWith($.renderTemplate(assign,data)); this is alot slower, the new Custom function is 20-30% faster\n\t\t\t}\n\t\t} else {\n\t\t\treturn;\n\t\t}\n\t}", "function onStageSelected() {\n\n alert(\"On stage Selected event\");\n //retrieveActiveProcess();\n //getSelectedStage();\n}", "function handleStepEnter(response) {\n \n // response = { element, direction, index }\n\n // get the data step attribute which has our \"stacked, grouped, or percent value\"\n var chartType = response.element.getAttribute(\"data-step\")\n changeChart(chartType)\n\n}", "function optionBlocksForPanelType(panelType) {\n switch (panelType) {\n case PanelType.HARDWARE:\n default:\n return HARDWARE_OPTION_BLOCKS;\n case PanelType.VIEW:\n return VIEW_OPTION_BLOCKS;\n }\n}", "function handleBlock(startArr,startOffsetM,startOffsetNextM,destArr,destOffsetM,destOffsetNextM,undefined$1){// slice out the block we need\nvar startArrTemp=startArr.slice(startOffsetM,startOffsetNextM||undefined$1),destArrTemp=destArr.slice(destOffsetM,destOffsetNextM||undefined$1);var i=0,posStart={pos:[0,0],start:[0,0]},posDest={pos:[0,0],start:[0,0]};do{// convert shorthand types to long form\nstartArrTemp[i]=simplyfy.call(posStart,startArrTemp[i]);destArrTemp[i]=simplyfy.call(posDest,destArrTemp[i]);// check if both shape types match\n// 2 elliptical arc curve commands ('A'), are considered different if the\n// flags (large-arc-flag, sweep-flag) don't match\nif(startArrTemp[i][0]!=destArrTemp[i][0]||startArrTemp[i][0]=='M'||startArrTemp[i][0]=='A'&&(startArrTemp[i][4]!=destArrTemp[i][4]||startArrTemp[i][5]!=destArrTemp[i][5])){// if not, convert shapes to beziere\nArray.prototype.splice.apply(startArrTemp,[i,1].concat(toBeziere.call(posStart,startArrTemp[i])));Array.prototype.splice.apply(destArrTemp,[i,1].concat(toBeziere.call(posDest,destArrTemp[i])));}else{// only update positions otherwise\nstartArrTemp[i]=setPosAndReflection.call(posStart,startArrTemp[i]);destArrTemp[i]=setPosAndReflection.call(posDest,destArrTemp[i]);}// we are at the end at both arrays. stop here\nif(++i==startArrTemp.length&&i==destArrTemp.length)break;// destArray is longer. Add one element\nif(i==startArrTemp.length){startArrTemp.push(['C',posStart.pos[0],posStart.pos[1],posStart.pos[0],posStart.pos[1],posStart.pos[0],posStart.pos[1]]);}// startArr is longer. Add one element\nif(i==destArrTemp.length){destArrTemp.push(['C',posDest.pos[0],posDest.pos[1],posDest.pos[0],posDest.pos[1],posDest.pos[0],posDest.pos[1]]);}}while(true);// return the updated block\nreturn{start:startArrTemp,dest:destArrTemp};}// converts shorthand types to long form", "processWhatIsReady(graph) {\n let status = graph.getCurrentStatus();\n logger_1.default.system.debug(\"bootEngine processWhatIsReady\", status, graph);\n console.log(\"processWhatIsReady\", status);\n // this condition should never happen, but would prevent bad bootEngine handlers from getting in an infinite loop\n if (++this.processStatusCounter > PROCESS_STATUS_COUNTER_MAX) {\n logger_1.default.system.error(\"bootEngine.processWhatIsReady is in infinite loop -- breaking out\", this.processStatusCounter);\n }\n else {\n switch (status.graphState) {\n case \"error\": {\n this.stageRejecter(status.errorDiag);\n break;\n }\n case \"notFinished\": {\n this.processReadyList(status.readyToStartList);\n break;\n }\n case \"finished\": {\n this.stageResolver();\n break;\n }\n }\n }\n }", "get isBlock() {\n return this.type.isBlock;\n }", "function block_viewport_for_render_spots_plan() {\n\tcurrentProgressForRenderSpotsPlan = 0;\n\txval=getBusyOverlay('viewport',{color:'blue',opacity:0.25, text:'loading', style:'text-decoration:blink;font-weight:bold;font-size:12px;color:white'},{color:'#fff', size:128, type:'o'});\n\tif(xval) {\n\t\txval.ntime=window.setInterval(\"show_fake_progress_for_render_spots_plan()\",200);\n\t}\n}", "function renderSeries(ecIns, ecModel, api, payload, dirtyMap) {\n // Render all charts\n var scheduler = ecIns._scheduler;\n var unfinished;\n ecModel.eachSeries(function (seriesModel) {\n var chartView = ecIns._chartsMap[seriesModel.__viewId];\n chartView.__alive = true;\n var renderTask = chartView.renderTask;\n scheduler.updatePayload(renderTask, payload);\n\n if (dirtyMap && dirtyMap.get(seriesModel.uid)) {\n renderTask.dirty();\n }\n\n unfinished |= renderTask.perform(scheduler.getPerformArgs(renderTask));\n chartView.group.silent = !!seriesModel.get('silent');\n updateZ(seriesModel, chartView);\n updateBlend(seriesModel, chartView);\n });\n scheduler.unfinished |= unfinished; // If use hover layer\n\n updateHoverLayerStatus(ecIns, ecModel); // Add aria\n\n aria(ecIns._zr.dom, ecModel);\n}", "function renderSeries(ecIns, ecModel, api, payload, dirtyMap) {\n // Render all charts\n var scheduler = ecIns._scheduler;\n var unfinished;\n ecModel.eachSeries(function (seriesModel) {\n var chartView = ecIns._chartsMap[seriesModel.__viewId];\n chartView.__alive = true;\n var renderTask = chartView.renderTask;\n scheduler.updatePayload(renderTask, payload);\n\n if (dirtyMap && dirtyMap.get(seriesModel.uid)) {\n renderTask.dirty();\n }\n\n unfinished |= renderTask.perform(scheduler.getPerformArgs(renderTask));\n chartView.group.silent = !!seriesModel.get('silent');\n updateZ(seriesModel, chartView);\n updateBlend(seriesModel, chartView);\n });\n scheduler.unfinished |= unfinished; // If use hover layer\n\n updateHoverLayerStatus(ecIns, ecModel); // Add aria\n\n aria(ecIns._zr.dom, ecModel);\n}", "function renderSeries(ecIns, ecModel, api, payload, dirtyMap) {\n // Render all charts\n var scheduler = ecIns._scheduler;\n var unfinished;\n ecModel.eachSeries(function (seriesModel) {\n var chartView = ecIns._chartsMap[seriesModel.__viewId];\n chartView.__alive = true;\n var renderTask = chartView.renderTask;\n scheduler.updatePayload(renderTask, payload);\n\n if (dirtyMap && dirtyMap.get(seriesModel.uid)) {\n renderTask.dirty();\n }\n\n unfinished |= renderTask.perform(scheduler.getPerformArgs(renderTask));\n chartView.group.silent = !!seriesModel.get('silent');\n updateZ(seriesModel, chartView);\n updateBlend(seriesModel, chartView);\n });\n scheduler.unfinished |= unfinished; // If use hover layer\n\n updateHoverLayerStatus(ecIns._zr, ecModel); // Add aria\n\n aria(ecIns._zr.dom, ecModel);\n}", "function renderSeries(ecIns, ecModel, api, payload, dirtyMap) {\n // Render all charts\n var scheduler = ecIns._scheduler;\n var unfinished;\n ecModel.eachSeries(function (seriesModel) {\n var chartView = ecIns._chartsMap[seriesModel.__viewId];\n chartView.__alive = true;\n var renderTask = chartView.renderTask;\n scheduler.updatePayload(renderTask, payload);\n\n if (dirtyMap && dirtyMap.get(seriesModel.uid)) {\n renderTask.dirty();\n }\n\n unfinished |= renderTask.perform(scheduler.getPerformArgs(renderTask));\n chartView.group.silent = !!seriesModel.get('silent');\n updateZ(seriesModel, chartView);\n updateBlend(seriesModel, chartView);\n });\n scheduler.unfinished |= unfinished; // If use hover layer\n\n updateHoverLayerStatus(ecIns._zr, ecModel); // Add aria\n\n aria(ecIns._zr.dom, ecModel);\n}", "function renderSeries(ecIns, ecModel, api, payload, dirtyMap) {\n // Render all charts\n var scheduler = ecIns._scheduler;\n var unfinished;\n ecModel.eachSeries(function (seriesModel) {\n var chartView = ecIns._chartsMap[seriesModel.__viewId];\n chartView.__alive = true;\n var renderTask = chartView.renderTask;\n scheduler.updatePayload(renderTask, payload);\n\n if (dirtyMap && dirtyMap.get(seriesModel.uid)) {\n renderTask.dirty();\n }\n\n unfinished |= renderTask.perform(scheduler.getPerformArgs(renderTask));\n chartView.group.silent = !!seriesModel.get('silent');\n updateZ(seriesModel, chartView);\n updateBlend(seriesModel, chartView);\n });\n scheduler.unfinished |= unfinished; // If use hover layer\n\n updateHoverLayerStatus(ecIns._zr, ecModel); // Add aria\n\n aria(ecIns._zr.dom, ecModel);\n}", "function handleBlock(startArr,startOffsetM,startOffsetNextM,destArr,destOffsetM,destOffsetNextM,undefined){// slice out the block we need\nvar startArrTemp=startArr.slice(startOffsetM,startOffsetNextM||undefined),destArrTemp=destArr.slice(destOffsetM,destOffsetNextM||undefined);var i=0,posStart={pos:[0,0],start:[0,0]},posDest={pos:[0,0],start:[0,0]};do{// convert shorthand types to long form\nstartArrTemp[i]=simplyfy.call(posStart,startArrTemp[i]);destArrTemp[i]=simplyfy.call(posDest,destArrTemp[i]);// check if both shape types match\n// 2 elliptical arc curve commands ('A'), are considered different if the\n// flags (large-arc-flag, sweep-flag) don't match\nif(startArrTemp[i][0]!=destArrTemp[i][0]||startArrTemp[i][0]=='M'||startArrTemp[i][0]=='A'&&(startArrTemp[i][4]!=destArrTemp[i][4]||startArrTemp[i][5]!=destArrTemp[i][5])){// if not, convert shapes to beziere\nArray.prototype.splice.apply(startArrTemp,[i,1].concat(toBeziere.call(posStart,startArrTemp[i])));Array.prototype.splice.apply(destArrTemp,[i,1].concat(toBeziere.call(posDest,destArrTemp[i])));}else{// only update positions otherwise\nstartArrTemp[i]=setPosAndReflection.call(posStart,startArrTemp[i]);destArrTemp[i]=setPosAndReflection.call(posDest,destArrTemp[i]);}// we are at the end at both arrays. stop here\nif(++i==startArrTemp.length&&i==destArrTemp.length)break;// destArray is longer. Add one element\nif(i==startArrTemp.length){startArrTemp.push(['C',posStart.pos[0],posStart.pos[1],posStart.pos[0],posStart.pos[1],posStart.pos[0],posStart.pos[1]]);}// startArr is longer. Add one element\nif(i==destArrTemp.length){destArrTemp.push(['C',posDest.pos[0],posDest.pos[1],posDest.pos[0],posDest.pos[1],posDest.pos[0],posDest.pos[1]]);}}while(true);// return the updated block\nreturn{start:startArrTemp,dest:destArrTemp};}// converts shorthand types to long form", "function changedDisplayTimeRadio() {\r\n if ((typeof chart != 'undefined') && (chart.series[0].data.length > 0)) {\r\n if (document.getElementById(\"localGraph\").checked) {\r\n var seriesData = adjustDataToTZO(utcData);\r\n chart.options.series[0].data = seriesData;\r\n } else {\r\n chart.options.series[0].data = utcData;\r\n }\r\n chartBusyProc();\r\n chart = new Highcharts.Chart(chart.options);\r\n setChartSize();\r\n }\r\n}", "function handler(e) {\n/* 564 */ \t\t\t// allow tab navigation (conditionally)\n/* 565 */ \t\t\tif (e.type === 'keydown' && e.keyCode && e.keyCode == 9) {\n/* 566 */ \t\t\t\tif (pageBlock && e.data.constrainTabKey) {\n/* 567 */ \t\t\t\t\tvar els = pageBlockEls;\n/* 568 */ \t\t\t\t\tvar fwd = !e.shiftKey && e.target === els[els.length-1];\n/* 569 */ \t\t\t\t\tvar back = e.shiftKey && e.target === els[0];\n/* 570 */ \t\t\t\t\tif (fwd || back) {\n/* 571 */ \t\t\t\t\t\tsetTimeout(function(){focus(back);},10);\n/* 572 */ \t\t\t\t\t\treturn false;\n/* 573 */ \t\t\t\t\t}\n/* 574 */ \t\t\t\t}\n/* 575 */ \t\t\t}\n/* 576 */ \t\t\tvar opts = e.data;\n/* 577 */ \t\t\tvar target = $(e.target);\n/* 578 */ \t\t\tif (target.hasClass('blockOverlay') && opts.onOverlayClick)\n/* 579 */ \t\t\t\topts.onOverlayClick(e);\n/* 580 */ \n/* 581 */ \t\t\t// allow events within the message content\n/* 582 */ \t\t\tif (target.parents('div.' + opts.blockMsgClass).length > 0)\n/* 583 */ \t\t\t\treturn true;\n/* 584 */ \n/* 585 */ \t\t\t// allow events for content that is not being blocked\n/* 586 */ \t\t\treturn target.parents().children().filter('div.blockUI').length === 0;\n/* 587 */ \t\t}", "get type() {\n return this.startSide < this.endSide ? exports.BlockType.WidgetRange\n : this.startSide <= 0 ? exports.BlockType.WidgetBefore : exports.BlockType.WidgetAfter;\n }", "function dataFilter(seriesType) {\n\t return {\n\t seriesType: seriesType,\n\t reset: function (seriesModel, ecModel) {\n\t var legendModels = ecModel.findComponents({\n\t mainType: 'legend'\n\t });\n\t\n\t if (!legendModels || !legendModels.length) {\n\t return;\n\t }\n\t\n\t var data = seriesModel.getData();\n\t data.filterSelf(function (idx) {\n\t var name = data.getName(idx); // If in any legend component the status is not selected.\n\t\n\t for (var i = 0; i < legendModels.length; i++) {\n\t // @ts-ignore FIXME: LegendModel\n\t if (!legendModels[i].isSelected(name)) {\n\t return false;\n\t }\n\t }\n\t\n\t return true;\n\t });\n\t }\n\t };\n\t }", "onEventDataGenerated(renderData) {\n const me = this,\n {\n eventRecord\n } = renderData;\n\n if (me.shouldInclude(eventRecord)) {\n if (me.scheduler.isVertical) {\n renderData.width = me.scheduler.resourceColumnWidth;\n } else {\n renderData.top = 0;\n } // Flag that we should fill entire row/col\n\n renderData.fillSize = true; // Add our own cls\n\n renderData.wrapperCls[me.rangeCls] = 1;\n renderData.wrapperCls[`b-sch-color-${eventRecord.timeRangeColor}`] = eventRecord.timeRangeColor; // Add label\n\n renderData.children.push(eventRecord.name); // Event data for DOMSync comparison\n\n renderData.eventId = `${me.idPrefix}-${eventRecord.id}`;\n }\n }", "dispatchMultiSeriesDrill() {\n var pie = this._comp.pieChart;\n if (pie && pie.otherSlice) {\n this._comp.getEventManager().processDrillEvent(pie.otherSlice);\n }\n }", "function checkSeries(){\r\n\r\n\tif (stimuliCurrentInfo.seriesNumber>12){\r\n\t\tif (paramNumber===1){stimuliCurrentInfo.seriesNumber=2;}\r\n\t\telse{stimuliCurrentInfo.seriesNumber=1;}\r\n\t\t\r\n\t\tstimuliCurrentInfo.seriesLetter = String.fromCharCode(stimuliCurrentInfo.seriesLetter.charCodeAt(0)+1);\r\n\t}\r\n\r\n}", "function isValueOrExtentDragStart(type) {\n return type == goog.ui.SliderBase.EventType.DRAG_VALUE_START ||\n type == goog.ui.SliderBase.EventType.DRAG_EXTENT_START;\n }", "function chartRenderCharts() {\r\n if(!document.getElementById(\"apex_line2_chart\")) return ;\r\n\r\n // create charts for chart page\r\n if (!chartLaptime) {\r\n chartLaptime = new CustomApexChart(\"#apex_line2_chart\", \"line\");\r\n chartLaptime.setOptions({\r\n 'title' : 'laptime(seconds)/lap',\r\n 'height' : 396,\r\n 'xAxisTitle' : 'LAP',\r\n 'yAxisTitle' : 'Laptime',\r\n });\r\n chartLaptime.render();\r\n }\r\n if (!chartSector1) {\r\n chartSector1 = new CustomApexChart(\"#basic-column-sector1\", \"bar\");\r\n chartSector1.setOptions({\r\n 'height' : 385,\r\n 'xAxisTitle' : 'LAP',\r\n 'yAxisTitle' : 'sector1',\r\n });\r\n chartSector1.render();\r\n }\r\n if (!chartSector2) {\r\n chartSector2 = new CustomApexChart(\"#basic-column-sector2\", \"bar\");\r\n chartSector2.setOptions({\r\n 'height' : 385,\r\n 'xAxisTitle' : 'LAP',\r\n 'yAxisTitle' : 'sector2',\r\n });\r\n chartSector2.render();\r\n }\r\n if (!chartSector3) {\r\n chartSector3 = new CustomApexChart(\"#basic-column-sector3\", \"bar\");\r\n chartSector3.setOptions({\r\n 'height' : 385,\r\n 'xAxisTitle' : 'LAP',\r\n 'yAxisTitle' : 'sector3',\r\n });\r\n chartSector3.render();\r\n }\r\n\r\n chartPageCheckDrivers();\r\n\r\n getCheckedChartDrivers();\r\n\r\n var currentSeries = {};\r\n\r\n checkedChartDrivers.forEach(driverId => {\r\n // chart series name\r\n currentSeries[driverId] = \"\";\r\n if ($(\"#customCheck\"+driverId).length) currentSeries[driverId] = $(\"#customCheck\"+driverId).attr('data-title');\r\n\r\n // chart series data\r\n });\r\n\r\n getDatasCharts(function() {\r\n if (!gameChartsLapsValues || !gameChartsLapsValues.length) return;\r\n console.log(\"[chartRenderCharts] after getDatasCharts\", gameChartsLapsValues, currentSeries, gameChartsData, gameChartsSector1Data, gameChartsSector2Data, gameChartsSector3Data);\r\n\r\n if (chartLaptime) {\r\n chartLaptime.setSeries(currentSeries);\r\n chartLaptime.setXAxis(gameChartsLapsValues);\r\n chartLaptime.setData(gameChartsData);\r\n\r\n if(sliderLaptime){\r\n let tempMin = CustomApexChart.calcYAxisMin(chartLaptime.yValueMin);\r\n let tempMax = CustomApexChart.calcYAxisMax(chartLaptime.yValueMax);\r\n sliderLaptime.update({\r\n from: tempMin,\r\n to: tempMax,\r\n min: tempMin,\r\n max: tempMax\r\n });\r\n }\r\n }\r\n if (chartSector1) {\r\n chartSector1.setSeries(currentSeries);\r\n chartSector1.setXAxis(gameChartsLapsValues);\r\n chartSector1.setData(gameChartsSector1Data);\r\n\r\n if(sliderSector1){\r\n let tempMin = CustomApexChart.calcYAxisMin(chartSector1.yValueMin);\r\n let tempMax = CustomApexChart.calcYAxisMax(chartSector1.yValueMax);\r\n sliderSector1.update({\r\n from: tempMin,\r\n to: tempMax,\r\n min: tempMin,\r\n max: tempMax\r\n });\r\n }\r\n }\r\n if (chartSector2) {\r\n chartSector2.setSeries(currentSeries);\r\n chartSector2.setXAxis(gameChartsLapsValues);\r\n chartSector2.setData(gameChartsSector1Data);\r\n\r\n if(sliderSector2){\r\n let tempMin = CustomApexChart.calcYAxisMin(chartSector2.yValueMin);\r\n let tempMax = CustomApexChart.calcYAxisMax(chartSector2.yValueMax);\r\n sliderSector2.update({\r\n from: tempMin,\r\n to: tempMax,\r\n min: tempMin,\r\n max: tempMax\r\n });\r\n }\r\n }\r\n if (chartSector3) {\r\n chartSector3.setSeries(currentSeries);\r\n chartSector3.setXAxis(gameChartsLapsValues);\r\n chartSector3.setData(gameChartsSector1Data);\r\n\r\n if(sliderSector3){\r\n let tempMin = CustomApexChart.calcYAxisMin(chartSector3.yValueMin);\r\n let tempMax = CustomApexChart.calcYAxisMax(chartSector3.yValueMax);\r\n sliderSector3.update({\r\n from: tempMin,\r\n to: tempMax,\r\n min: tempMin,\r\n max: tempMax\r\n });\r\n }\r\n }\r\n });\r\n\r\n }", "isPriorStage(stage) {\n // if (this.inFinalStage(stage)) {\n // return true;\n // }\n let stageOrder = this.process.stages.map(s => s.outgoing_stage);\n let viewedOutgoingStageIndex = stageOrder.indexOf(stage.outgoing_stage);\n let featureStageIndex = stageOrder.indexOf(this.feature.intent_stage_int);\n return (viewedOutgoingStageIndex < featureStageIndex);\n }", "function _fixBlockSizes() {\n\t\t\tvar timeBlockSize = $el.css('padding-top').replace('px', '') * 0.8;\n\t\t\t$el.find('.' + options.className + '-timeline').css('width', ''+ (children.length * timeBlockSize) +'px');\n\t\t\t$el.find('.' + options.className + '-timeliny-timeblock').css('width', '' + timeBlockSize + 'px');\n\t\t}" ]
[ "0.5554196", "0.5554196", "0.5554196", "0.5554196", "0.5554196", "0.5554196", "0.5188415", "0.509293", "0.5009413", "0.49099848", "0.4895842", "0.47876376", "0.4774481", "0.47356772", "0.46883628", "0.46254632", "0.46091437", "0.4607717", "0.45879784", "0.45827132", "0.45686355", "0.45686355", "0.45458257", "0.45429876", "0.45429876", "0.45429876", "0.4522485", "0.4522485", "0.4522485", "0.4522485", "0.4522485", "0.4512288", "0.4500673", "0.4496626", "0.4496626", "0.44902048", "0.44824186", "0.44824186", "0.44824186", "0.44680032", "0.44439515", "0.44334576", "0.44257122", "0.44253668", "0.44006053", "0.43700272", "0.43599617", "0.43481603", "0.43435794", "0.43389565", "0.43372226", "0.4334963", "0.43170998", "0.43098357", "0.4304633", "0.42980683", "0.4296086", "0.42898658", "0.4288818", "0.42739922", "0.42691678", "0.42597476", "0.42560375", "0.42527238", "0.42500895", "0.42490324", "0.42468208", "0.4244638", "0.42438862", "0.4243312", "0.42356232", "0.4231217", "0.42286798", "0.4226685", "0.4225906", "0.42229185", "0.42139196", "0.420531", "0.41956356", "0.41874555", "0.41874555", "0.41838643", "0.41838643", "0.41838643", "0.41837406", "0.41812587", "0.4180233", "0.4177341", "0.41768932", "0.41734722", "0.41630536", "0.4154557", "0.4150427", "0.41439423", "0.4141267", "0.41408157" ]
0.49045154
14
Mixin common methods to axis model, Inlcude methods `getFormattedLabels() => Array.` `getCategories() => Array.` `getMin(origin: boolean) => number` `getMax(origin: boolean) => number` `getNeedCrossZero() => boolean` `setRange(start: number, end: number)` `resetRange()`
function mixinAxisModelCommonMethods(Model) { zrUtil.mixin(Model, axisModelCommonMixin); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function Axis(min, max) {\n this.Min = min;\n this.Max = max;\n }", "function mixinAxisModelCommonMethods(Model) {\n\t mixin(Model, AxisModelCommonMixin);\n\t }", "function _default() {\n\n\tfunction axisX(selection, x) {\n\t\tselection.attr(\"transform\", function (d) {\n\t\t\treturn \"translate(\" + Math.ceil(x(d) + tickOffset) + \", 0)\";\n\t\t});\n\t}\n\n\tfunction axisY(selection, y) {\n\t\tselection.attr(\"transform\", function (d) {\n\t\t\treturn \"translate(0,\" + Math.ceil(y(d)) + \")\";\n\t\t});\n\t}\n\n\tfunction scaleExtent(domain) {\n\t\tvar start = domain[0],\n\t\t stop = domain[domain.length - 1];\n\n\n\t\treturn start < stop ? [start, stop] : [stop, start];\n\t}\n\n\tfunction generateTicks(scale) {\n\t\tvar ticks = [];\n\n\t\tif (scale.ticks) return scale.ticks.apply(scale, tickArguments ? (0, _util.toArray)(tickArguments) : []).map(function (v) {\n\t\t\t\treturn (\n\t\t\t\t\t// round the tick value if is number\n\t\t\t\t\t/(string|number)/.test(typeof v === \"undefined\" ? \"undefined\" : (0, _typeof3.default)(v)) && !isNaN(v) ? Math.round(v * 10) / 10 : v\n\t\t\t\t);\n\t\t\t});\n\n\t\tfor (var domain = scale.domain(), i = Math.ceil(domain[0]); i < domain[1]; i++) ticks.push(i);\n\n\t\treturn ticks.length > 0 && ticks[0] > 0 && ticks.unshift(ticks[0] - (ticks[1] - ticks[0])), ticks;\n\t}\n\n\tfunction copyScale() {\n\t\tvar newScale = scale.copy();\n\n\t\tif (params.isCategory || !newScale.domain().length) {\n\t\t\tvar domain = scale.domain();\n\n\t\t\tnewScale.domain([domain[0], domain[1] - 1]);\n\t\t}\n\n\t\treturn newScale;\n\t}\n\n\tfunction textFormatted(v) {\n\t\t// to round float numbers from 'binary floating point'\n\t\t// https://en.wikipedia.org/wiki/Double-precision_floating-point_format\n\t\t// https://stackoverflow.com/questions/17849101/laymans-explanation-for-why-javascript-has-weird-floating-math-ieee-754-stand\n\t\tvar value = /\\d+\\.\\d+0{5,}\\d$/.test(v) ? +(v + \"\").replace(/0+\\d$/, \"\") : v,\n\t\t formatted = tickFormat ? tickFormat(value) : value;\n\n\n\t\treturn (0, _util.isDefined)(formatted) ? formatted : \"\";\n\t}\n\n\tfunction transitionise(selection) {\n\t\treturn params.withoutTransition ? selection.interrupt() : selection.transition(transition);\n\t}\n\n\tfunction axis(g) {\n\t\tg.each(function () {\n\n\t\t\t// this should be called only when category axis\n\t\t\tfunction splitTickText(d, maxWidthValue) {\n\n\t\t\t\tfunction split(splitted, text) {\n\t\t\t\t\tspaceIndex = undefined;\n\n\t\t\t\t\tfor (var i = 1; i < text.length; i++)\n\n\t\t\t\t\t// if text width gets over tick width, split by space index or current index\n\t\t\t\t\tif (text.charAt(i) === \" \" && (spaceIndex = i), subtext = text.substr(0, i + 1), textWidth = sizeFor1Char.w * subtext.length, maxWidth < textWidth) return split(splitted.concat(text.substr(0, spaceIndex || i)), text.slice(spaceIndex ? spaceIndex + 1 : i));\n\n\t\t\t\t\treturn splitted.concat(text);\n\t\t\t\t}\n\n\t\t\t\tvar tickText = textFormatted(d),\n\t\t\t\t maxWidth = maxWidthValue,\n\t\t\t\t subtext = void 0,\n\t\t\t\t spaceIndex = void 0,\n\t\t\t\t textWidth = void 0;\n\t\t\t\treturn Object.prototype.toString.call(tickText) === \"[object Array]\" ? tickText : ((!maxWidth || maxWidth <= 0) && (maxWidth = isVertical ? 95 : params.isCategory ? Math.ceil(scale1(ticks[1]) - scale1(ticks[0])) - 12 : 110), split([], tickText + \"\"));\n\t\t\t}\n\n\t\t\tfunction tspanDy(d, i) {\n\t\t\t\tvar dy = sizeFor1Char.h;\n\n\t\t\t\treturn i === 0 && (dy = orient === \"left\" || orient === \"right\" ? -((counts[d.index] - 1) * (sizeFor1Char.h / 2) - 3) : \".71em\"), dy;\n\t\t\t}\n\n\t\t\tfunction tickSize(d) {\n\t\t\t\tvar tickPosition = scale(d) + (tickCentered ? 0 : tickOffset);\n\n\t\t\t\treturn range[0] < tickPosition && tickPosition < range[1] ? 6 : 0;\n\t\t\t}\n\n\t\t\tvar g = (0, _d3Selection.select)(this);\n\n\t\t\taxis.g = g;\n\n\n\t\t\tvar scale0 = this.__chart__ || scale,\n\t\t\t scale1 = copyScale();\n\t\t\tthis.__chart__ = scale1;\n\n\n\t\t\t// count of tick data in array\n\t\t\tvar ticks = tickValues || generateTicks(scale1),\n\t\t\t tick = g.selectAll(\".tick\").data(ticks, scale1),\n\t\t\t tickEnter = tick.enter().insert(\"g\", \".domain\").attr(\"class\", \"tick\").style(\"opacity\", \"1\"),\n\t\t\t tickExit = tick.exit().remove();\n\n\t\t\t// update selection\n\n\n\t\t\t// enter selection\n\n\n\t\t\t// MEMO: No exit transition. The reason is this transition affects max tick width calculation because old tick will be included in the ticks.\n\t\t\ttick = tickEnter.merge(tick);\n\n\n\t\t\tvar tickUpdate = transitionise(tick).style(\"opacity\", \"1\"),\n\t\t\t tickTransform = void 0,\n\t\t\t tickX = void 0,\n\t\t\t tickY = void 0,\n\t\t\t range = scale.rangeExtent ? scale.rangeExtent() : scaleExtent((params.orgXScale || scale).range()),\n\t\t\t path = g.selectAll(\".domain\").data([0]),\n\t\t\t pathUpdate = path.enter().append(\"path\").attr(\"class\", \"domain\").merge(transitionise(path));\n\n\t\t\t// update selection - data join\n\n\n\t\t\t// enter + update selection\n\t\t\ttickEnter.append(\"line\"), tickEnter.append(\"text\");\n\n\n\t\t\tvar lineEnter = tickEnter.select(\"line\"),\n\t\t\t lineUpdate = tickUpdate.select(\"line\"),\n\t\t\t textEnter = tickEnter.select(\"text\"),\n\t\t\t textUpdate = tickUpdate.select(\"text\");\n\t\t\tparams.isCategory ? (tickOffset = Math.ceil((scale1(1) - scale1(0)) / 2), tickX = tickCentered ? 0 : tickOffset, tickY = tickCentered ? tickOffset : 0) : (tickX = 0, tickOffset = tickX);\n\n\n\t\t\tvar tspan = void 0,\n\t\t\t sizeFor1Char = _getSizeFor1Char(g.select(\".tick\")),\n\t\t\t counts = [],\n\t\t\t tickLength = Math.max(6, 0) + 3,\n\t\t\t isVertical = orient === \"left\" || orient === \"right\",\n\t\t\t text = tick.select(\"text\");tspan = text.selectAll(\"tspan\").data(function (d, index) {\n\t\t\t\tvar split = params.tickMultiline ? splitTickText(d, params.tickWidth) : (0, _util.isArray)(textFormatted(d)) ? textFormatted(d).concat() : [textFormatted(d)];\n\n\t\t\t\treturn counts[index] = split.length, split.map(function (splitted) {\n\t\t\t\t\treturn {\n\t\t\t\t\t\tindex: index,\n\t\t\t\t\t\tsplitted: splitted\n\t\t\t\t\t};\n\t\t\t\t});\n\t\t\t}), tspan.exit().remove(), tspan = tspan.enter().append(\"tspan\").merge(tspan).text(function (d) {\n\t\t\t\treturn d.splitted;\n\t\t\t});\n\n\n\t\t\tvar rotate = params.tickTextRotate;\n\n\t\t\tif (orient === \"bottom\" ? (tickTransform = axisX, lineEnter.attr(\"y2\", 6), textEnter.attr(\"y\", 9), lineUpdate.attr(\"x1\", tickX).attr(\"x2\", tickX).attr(\"y2\", tickSize), textUpdate.attr(\"x\", 0).attr(\"y\", function (r) {\n\t\t\t\treturn r ? 11.5 - 2.5 * (r / 15) * (r > 0 ? 1 : -1) : 9;\n\t\t\t}(rotate)).style(\"text-anchor\", function (r) {\n\t\t\t\treturn r ? r > 0 ? \"start\" : \"end\" : \"middle\";\n\t\t\t}(rotate)).attr(\"transform\", function (r) {\n\t\t\t\treturn r ? \"rotate(\" + r + \")\" : \"\";\n\t\t\t}(rotate)), tspan.attr(\"x\", 0).attr(\"dy\", tspanDy).attr(\"dx\", function (r) {\n\t\t\t\treturn r ? 8 * Math.sin(Math.PI * (r / 180)) : 0;\n\t\t\t}(rotate)), pathUpdate.attr(\"d\", \"M\" + range[0] + \",\" + outerTickSize + \"V0H\" + range[1] + \"V\" + outerTickSize)) : orient === \"top\" ? (tickTransform = axisX, lineEnter.attr(\"y2\", -6), textEnter.attr(\"y\", -9), lineUpdate.attr(\"x2\", 0).attr(\"y2\", -6), textUpdate.attr(\"x\", 0).attr(\"y\", -9), text.style(\"text-anchor\", \"middle\"), tspan.attr(\"x\", 0).attr(\"dy\", \"0em\"), pathUpdate.attr(\"d\", \"M\" + range[0] + \",\" + -outerTickSize + \"V0H\" + range[1] + \"V\" + -outerTickSize)) : orient === \"left\" ? (tickTransform = axisY, lineEnter.attr(\"x2\", -6), textEnter.attr(\"x\", -9), lineUpdate.attr(\"x2\", -6).attr(\"y1\", tickY).attr(\"y2\", tickY), textUpdate.attr(\"x\", -9).attr(\"y\", tickOffset), text.style(\"text-anchor\", \"end\"), tspan.attr(\"x\", -9).attr(\"dy\", tspanDy), pathUpdate.attr(\"d\", \"M\" + -outerTickSize + \",\" + range[0] + \"H0V\" + range[1] + \"H\" + -outerTickSize)) : orient === \"right\" ? (tickTransform = axisY, lineEnter.attr(\"x2\", 6), textEnter.attr(\"x\", 9), lineUpdate.attr(\"x2\", 6).attr(\"y2\", 0), textUpdate.attr(\"x\", 9).attr(\"y\", 0), text.style(\"text-anchor\", \"start\"), tspan.attr(\"x\", 9).attr(\"dy\", tspanDy), pathUpdate.attr(\"d\", \"M\" + outerTickSize + \",\" + range[0] + \"H0V\" + range[1] + \"H\" + outerTickSize)) : void 0, params.tickTitle && textUpdate.append && textUpdate.append(\"title\").each(function (index) {\n\t\t\t\t(0, _d3Selection.select)(this).text(params.tickTitle[index]);\n\t\t\t}), scale1.bandwidth) {\n\t\t\t\tvar x = scale1,\n\t\t\t\t dx = x.bandwidth() / 2;\n\t\t\t\tscale0 = function (d) {\n\t\t\t\t\treturn x(d) + dx;\n\t\t\t\t}, scale1 = scale0;\n\t\t\t} else scale0.bandwidth ? scale0 = scale1 : tickExit.call(tickTransform, scale1);\n\n\t\t\ttickEnter.call(tickTransform, scale0), tickUpdate.call(tickTransform, scale1);\n\t\t});\n\t}\n\n\tvar params = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},\n\t scale = (0, _d3Scale.scaleLinear)(),\n\t orient = \"bottom\",\n\t outerTickSize = params.withOuterTick ? 6 : 0,\n\t tickValues = null,\n\t tickFormat = void 0,\n\t tickArguments = void 0,\n\t tickOffset = 0,\n\t tickCulling = !0,\n\t tickCentered = void 0,\n\t transition = void 0,\n\t _getSizeFor1Char = function getSizeFor1Char(tick) {\n\t\t// default size for one character\n\t\tvar size = {\n\t\t\th: 11.5,\n\t\t\tw: 5.5\n\t\t};\n\n\t\treturn tick.empty() || tick.select(\"text\").text(\"0\").call(function (el) {\n\t\t\tvar box = el.node().getBBox(),\n\t\t\t h = box.height,\n\t\t\t w = box.width;\n\t\t\th && w && (size.h = h, size.w = w), el.text(\"\");\n\t\t}), _getSizeFor1Char = function getSizeFor1Char() {\n\t\t\treturn size;\n\t\t}, size;\n\t};\n\n\treturn axis.scale = function (x) {\n\t\treturn arguments.length ? (scale = x, axis) : scale;\n\t}, axis.orient = function (x) {\n\t\treturn arguments.length ? (orient = x in {\n\t\t\ttop: 1,\n\t\t\tright: 1,\n\t\t\tbottom: 1,\n\t\t\tleft: 1\n\t\t} ? x + \"\" : \"bottom\", axis) : orient;\n\t}, axis.tickFormat = function (format) {\n\t\treturn arguments.length ? (tickFormat = format, axis) : tickFormat;\n\t}, axis.tickCentered = function (isCentered) {\n\t\treturn arguments.length ? (tickCentered = isCentered, axis) : tickCentered;\n\t}, axis.tickOffset = function () {\n\t\treturn tickOffset;\n\t}, axis.tickInterval = function (size) {\n\t\tvar interval = void 0;\n\n\t\tif (params.isCategory) interval = tickOffset * 2;else {\n\t\t\tvar length = axis.g.select(\"path.domain\").node().getTotalLength() - outerTickSize * 2;\n\n\t\t\tinterval = length / (size || axis.g.selectAll(\"line\").size());\n\t\t}\n\n\t\treturn interval === Infinity ? 0 : interval;\n\t}, axis.ticks = function () {\n\t\tfor (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) args[_key] = arguments[_key];\n\n\t\treturn args.length ? (tickArguments = (0, _util.toArray)(args), axis) : tickArguments;\n\t}, axis.tickCulling = function (culling) {\n\t\treturn arguments.length ? (tickCulling = culling, axis) : tickCulling;\n\t}, axis.tickValues = function (x) {\n\t\tif ((0, _util.isFunction)(x)) tickValues = function () {\n\t\t\t\treturn x(scale.domain());\n\t\t\t};else {\n\t\t\tif (!arguments.length) return tickValues;\n\n\t\t\ttickValues = x;\n\t\t}\n\n\t\treturn this;\n\t}, axis.setTransition = function (t) {\n\t\treturn transition = t, this;\n\t}, axis;\n}", "function Axis(min, max, majorUnit, minorUnit,title){\r\n\tthis.displayMajor=null;\r\n\tthis.displayMinor=null;\r\n\r\n\t//Called by descendents\r\n\tthis.init = function(min, max, majorUnit, minorUnit,title)\r\n\t{\r\n\t\tthis.min=min;\r\n\t\tthis.max=max;\r\n\t\tthis.minorUnit=minorUnit;\r\n\t\tthis.majorUnit=majorUnit;\r\n\t\tthis.title=title;\r\n\t}\r\n\r\n\t//Display options for each axis unit, possible values: guides, marks, none\r\n\tthis.setDisplayOptions = function(major, minor)\r\n\t{\r\n\t\tthis.displayMajor = major;\r\n\t\tthis.displayMinor = minor;\r\n\t}\r\n}", "function axis$1 () {\n\n var decorate = noop,\n orient = 'bottom',\n tickFormat = null,\n outerTickSize = 6,\n innerTickSize = 6,\n tickPadding = 3,\n svgDomainLine = d3.svg.line(),\n ticks = _ticks();\n\n var dataJoin$$ = dataJoin().selector('g.tick').element('g').key(identity).attr('class', 'tick');\n\n var domainPathDataJoin = dataJoin().selector('path.domain').element('path').attr('class', 'domain');\n\n // returns a function that creates a translation based on\n // the bound data\n function containerTranslate(s, trans) {\n return function (d) {\n return trans(s(d), 0);\n };\n }\n\n function translate(x, y) {\n if (isVertical()) {\n return 'translate(' + y + ', ' + x + ')';\n } else {\n return 'translate(' + x + ', ' + y + ')';\n }\n }\n\n function pathTranspose(arr) {\n if (isVertical()) {\n return arr.map(function (d) {\n return [d[1], d[0]];\n });\n } else {\n return arr;\n }\n }\n\n function isVertical() {\n return orient === 'left' || orient === 'right';\n }\n\n function tryApply(fn, defaultVal) {\n var scale = ticks.scale();\n return scale[fn] ? scale[fn].apply(scale, ticks.ticks()) : defaultVal;\n }\n\n var axis = function axis(selection) {\n\n selection.each(function (data, index) {\n\n var scale = ticks.scale();\n\n // Stash a snapshot of the new scale, and retrieve the old snapshot.\n var scaleOld = this.__chart__ || scale;\n this.__chart__ = scale.copy();\n\n var ticksArray = ticks();\n var tickFormatter = tickFormat == null ? tryApply('tickFormat', identity) : tickFormat;\n var sign = orient === 'bottom' || orient === 'right' ? 1 : -1;\n var container = d3.select(this);\n\n // add the domain line\n var range$$ = range(scale);\n var domainPathData = pathTranspose([[range$$[0], sign * outerTickSize], [range$$[0], 0], [range$$[1], 0], [range$$[1], sign * outerTickSize]]);\n\n var domainLine = domainPathDataJoin(container, [data]);\n domainLine.attr('d', svgDomainLine(domainPathData));\n\n // datajoin and construct the ticks / label\n dataJoin$$.attr({\n // set the initial tick position based on the previous scale\n // in order to get the correct enter transition - however, for ordinal\n // scales the tick will not exist on the old scale, so use the current position\n 'transform': containerTranslate(isOrdinal(scale) ? scale : scaleOld, translate)\n });\n\n var g = dataJoin$$(container, ticksArray);\n\n // enter\n g.enter().append('path');\n\n var labelOffset = sign * (innerTickSize + tickPadding);\n g.enter().append('text').attr('transform', translate(0, labelOffset));\n\n // update\n g.attr('class', 'tick orient-' + orient);\n\n g.attr('transform', containerTranslate(scale, translate));\n\n g.select('path').attr('d', function (d) {\n return svgDomainLine(pathTranspose([[0, 0], [0, sign * innerTickSize]]));\n });\n\n g.select('text').attr('transform', translate(0, labelOffset)).attr('dy', function () {\n var offset = '0em';\n if (isVertical()) {\n offset = '0.32em';\n } else if (orient === 'bottom') {\n offset = '0.71em';\n }\n return offset;\n }).text(tickFormatter);\n\n // exit - for non ordinal scales, exit by animating the tick to its new location\n if (!isOrdinal(scale)) {\n g.exit().attr('transform', containerTranslate(scale, translate));\n }\n\n decorate(g, data, index);\n });\n };\n\n axis.tickFormat = function (x) {\n if (!arguments.length) {\n return tickFormat;\n }\n tickFormat = x;\n return axis;\n };\n\n axis.tickSize = function (x) {\n var n = arguments.length;\n if (!n) {\n return innerTickSize;\n }\n innerTickSize = Number(x);\n outerTickSize = Number(arguments[n - 1]);\n return axis;\n };\n\n axis.innerTickSize = function (x) {\n if (!arguments.length) {\n return innerTickSize;\n }\n innerTickSize = Number(x);\n return axis;\n };\n\n axis.outerTickSize = function (x) {\n if (!arguments.length) {\n return outerTickSize;\n }\n outerTickSize = Number(x);\n return axis;\n };\n\n axis.tickPadding = function (x) {\n if (!arguments.length) {\n return tickPadding;\n }\n tickPadding = x;\n return axis;\n };\n\n axis.orient = function (x) {\n if (!arguments.length) {\n return orient;\n }\n orient = x;\n return axis;\n };\n\n axis.decorate = function (x) {\n if (!arguments.length) {\n return decorate;\n }\n decorate = x;\n return axis;\n };\n\n rebindAll(axis, ticks);\n\n return axis;\n }", "function axis () {\n\n var axis = axis$1(),\n baseline = d3.functor(0),\n decorate = noop,\n xScale = d3.time.scale(),\n yScale = d3.scale.linear();\n\n var dataJoin$$ = dataJoin().selector('g.axis-adapter').element('g').attr({ 'class': 'axis axis-adapter' });\n\n var axisAdapter = function axisAdapter(selection) {\n\n selection.each(function (data, index) {\n\n var g = dataJoin$$(this, [data]);\n\n var translation;\n switch (axisAdapter.orient()) {\n case 'top':\n case 'bottom':\n translation = 'translate(0,' + yScale(baseline(data)) + ')';\n axis.scale(xScale);\n break;\n\n case 'left':\n case 'right':\n translation = 'translate(' + xScale(baseline(data)) + ',0)';\n axis.scale(yScale);\n break;\n\n default:\n throw new Error('Invalid orientation');\n }\n\n g.enter().attr('transform', translation);\n g.attr('transform', translation);\n\n g.call(axis);\n\n decorate(g, data, index);\n });\n };\n\n axisAdapter.baseline = function (x) {\n if (!arguments.length) {\n return baseline;\n }\n baseline = d3.functor(x);\n return axisAdapter;\n };\n axisAdapter.decorate = function (x) {\n if (!arguments.length) {\n return decorate;\n }\n decorate = x;\n return axisAdapter;\n };\n axisAdapter.xScale = function (x) {\n if (!arguments.length) {\n return xScale;\n }\n xScale = x;\n return axisAdapter;\n };\n axisAdapter.yScale = function (x) {\n if (!arguments.length) {\n return yScale;\n }\n yScale = x;\n return axisAdapter;\n };\n\n return d3.rebind(axisAdapter, axis, 'orient', 'ticks', 'tickValues', 'tickSize', 'innerTickSize', 'outerTickSize', 'tickPadding', 'tickFormat');\n }", "get Axis() {\n throw new Error('axis must be implemented in derived classes');\n }", "function componentCircularAxis () {\n\n /* Default Properties */\n var width = 300;\n var height = 300;\n var dispatch = d3.dispatch(\"customValueMouseOver\", \"customValueMouseOut\", \"customValueClick\", \"customSeriesMouseOver\", \"customSeriesMouseOut\", \"customSeriesClick\");\n var radius = void 0;\n var radialScale = void 0;\n var ringScale = void 0;\n\n /**\n * Constructor\n *\n * @constructor\n * @alias circularAxis\n * @param {d3.selection} selection - The chart holder D3 selection.\n */\n function my(selection) {\n if (typeof radius === \"undefined\") {\n radius = Math.min(width, height) / 2;\n }\n\n // Create axis group\n var axisSelect = selection.selectAll(\".axis\").data([0]);\n\n var axis = axisSelect.enter().append(\"g\").classed(\"axis\", true).on(\"click\", function (d) {\n dispatch.call(\"customClick\", this, d);\n }).merge(axisSelect);\n\n // Outer circle\n var outerCircle = axis.selectAll(\".outerCircle\").data([radius]).enter().append(\"circle\").classed(\"outerCircle\", true).attr(\"r\", function (d) {\n return d;\n }).style(\"fill\", \"none\").attr(\"stroke-width\", 2).attr(\"stroke\", \"#ddd\");\n\n // Tick Data Generator\n var tickData = function tickData() {\n var tickArray = void 0,\n tickPadding = void 0;\n if (typeof ringScale.ticks === \"function\") {\n // scaleLinear\n tickArray = ringScale.ticks();\n tickPadding = 0;\n } else {\n // scaleBand\n tickArray = ringScale.domain();\n tickPadding = ringScale.bandwidth() / 2;\n }\n\n return tickArray.map(function (d) {\n return {\n value: d,\n radius: ringScale(d),\n padding: tickPadding\n };\n });\n };\n\n var tickCirclesGroupSelect = axis.selectAll(\".tickCircles\").data(function () {\n return [tickData()];\n });\n\n var tickCirclesGroup = tickCirclesGroupSelect.enter().append(\"g\").classed(\"tickCircles\", true).merge(tickCirclesGroupSelect);\n\n var tickCircles = tickCirclesGroup.selectAll(\"circle\").data(function (d) {\n return d;\n });\n\n tickCircles.enter().append(\"circle\").style(\"fill\", \"none\").attr(\"stroke-width\", 1).attr(\"stroke\", \"#ddd\").merge(tickCircles).transition().attr(\"r\", function (d) {\n return d.radius + d.padding;\n });\n\n tickCircles.exit().remove();\n\n // Spoke Data Generator\n var spokeData = function spokeData() {\n var spokeArray = [];\n var spokeCount = 0;\n if (typeof radialScale.ticks === \"function\") {\n // scaleLinear\n var min = d3.min(radialScale.domain());\n var max = d3.max(radialScale.domain());\n spokeCount = radialScale.ticks().length;\n var spokeIncrement = (max - min) / spokeCount;\n for (var i = 0; i <= spokeCount; i++) {\n spokeArray[i] = (spokeIncrement * i).toFixed(0);\n }\n } else {\n // scaleBand\n spokeArray = radialScale.domain();\n spokeCount = spokeArray.length;\n spokeArray.push(\"\");\n }\n\n var spokeScale = d3.scaleLinear().domain([0, spokeCount]).range(radialScale.range());\n\n return spokeArray.map(function (d, i) {\n return {\n value: d,\n rotate: spokeScale(i)\n };\n });\n };\n\n var spokesGroupSelect = axis.selectAll(\".spokes\").data(function () {\n return [spokeData()];\n });\n\n var spokesGroup = spokesGroupSelect.enter().append(\"g\").classed(\"spokes\", true).merge(spokesGroupSelect);\n\n var spokes = spokesGroup.selectAll(\"line\").data(function (d) {\n return d;\n });\n\n spokes.enter().append(\"line\").attr(\"id\", function (d) {\n return d.value;\n }).attr(\"y2\", -radius).merge(spokes).attr(\"transform\", function (d) {\n return \"rotate(\" + d.rotate + \")\";\n });\n\n spokes.exit().remove();\n }\n\n /**\n * Width Getter / Setter\n *\n * @param {number} _v - Width in px.\n * @returns {*}\n */\n my.height = function (_v) {\n if (!arguments.length) return height;\n height = _v;\n return this;\n };\n\n /**\n * Height Getter / Setter\n *\n * @param {number} _v - Height in px.\n * @returns {*}\n */\n my.width = function (_v) {\n if (!arguments.length) return width;\n width = _v;\n return this;\n };\n\n /**\n * Radius Getter / Setter\n *\n * @param {number} _v - Radius in px.\n * @returns {*}\n */\n my.radius = function (_v) {\n if (!arguments.length) return radius;\n radius = _v;\n return this;\n };\n\n /**\n * Radial Scale Getter / Setter\n *\n * @param {d3.scale} _v - D3 scale.\n * @returns {*}\n */\n my.radialScale = function (_v) {\n if (!arguments.length) return radialScale;\n radialScale = _v;\n return my;\n };\n\n /**\n * Ring Scale Getter / Setter\n *\n * @param {d3.scale} _v - D3 scale.\n * @returns {*}\n */\n my.ringScale = function (_v) {\n if (!arguments.length) return ringScale;\n ringScale = _v;\n return my;\n };\n\n return my;\n }", "get Axis() {\n let sampleData = this.chart.data[0];\n let size = sampleData.length;\n\n return d3.svg\n .axis()\n .scale(this.chart.xScale)\n .orient('bottom')\n .tickFormat(getDate().long)\n .tickValues(getBestTickValues(sampleData));\n }", "function AxisFormat()\n{\n\t/**\n\t * The type of axis defines its scale.\n\t * <ul>\n\t * <li> \"linear\" - ...\n\t * <li> \"log\" - ...\n\t * <li> \"ordinal\" - The values along the axis are determined by a\n\t * discrete itemized list, calculated from the graphed data.\n\t * <li> \"time\" - the values are a series of dates/times\n\t * <li> \"double positive\" - axis that always counts up from zero,\n\t * regardless of the sign of the data\n\t * </ul>\n\t * @type {string}\n\t */\n\tthis.type = \"linear\";\n\n\t/**\n\t * The number of \"ticks\" to display along the axis including those\n\t * at the ends of the axis. Should be a positive integer or zero and\n\t * will be coerced to a valid value in an undefined way if not.\n\t * Or if the type of axis is \"ordinal\" then ticks may be an array\n\t * to be displayed evenly distributed along the axis.\n\t * @type {number|Array.<*>}\n\t */\n\tthis.ticks = 5;\n\n\t/**\n\t * The minimum and maximum data values expected for the axis in an\n\t * array with the minimum as element 0 and the maximum as element 1.\n\t * If undefined, will default to [0, 1], or the [min, max] of the ticks\n\t * array if it is an array.\n\t * @type {Array.<number>|undefined}\n\t * TODO: find out why current behavior defaults a vertical axis to [0,1] and a horizontal axis to [1e-10,1] -mjl\n\t */\n\tthis.extent = [0, 1];\n\n\t/**\n\t * There are 2 sets of orientation values, one for a horizontal (x) axis\n\t * and one for a vertical (y) axis.\n\t * <ul>\n\t * <li> Horizontal (x) axis values\n\t * <ul>\n\t * <li> \"top\" - The axis should be displayed at the top of the display area\n\t * <li> \"bottom\" - The axis should be displayed at the bottom of the display area\n\t * </ul>\n\t * <li> Vertical (y) axis values\n\t * <ul>\n\t * <li> \"left\" - The axis should be displayed at the left of the display area\n\t * <li> \"right\" - The axis should be displayed at the right of the display area\n\t * </ul>\n\t * </ul>\n\t * @type {string}\n\t */\n\tthis.orientation = \"right\";\n\n\t/**\n\t * The label to display along the axis. It must be valid to be converted to\n\t * html as the inner html of a span element. This allow the use of text\n\t * markup and character entities in the label. Optional.\n\t * @type {string|undefined}\n\t */\n\tthis.label = \"Labels can have extended chars (&mu;m)\";\n}", "function updateAxis(){\n\t\tchangeAxisX();\n\t\tchangeAxisY();\n\t\tupdateMaxMinForAxis();\n\n\t\t/*Init helpers*/\n\t\tvar width = getWidth();\n\t\tvar height = getHeight();\n\t\t//horisontal xAxis\n\t\txAxisLine\n\t\t\t.attr(\"x1\", 0)\n\t\t\t.attr(\"y1\", height/2)\n\t\t\t.attr(\"x2\", width)\n\t\t\t.attr(\"y2\", height/2)\n\t\t\t.attr(\"class\", \"axisLine\")\n\t\t\t.attr(\"stroke-width\", 2)\n\t\t\t.attr(\"stroke\", \"black\");\n\t\txAxisLabelRight\n\t\t\t.attr(\"x\", width)\n\t\t\t.attr(\"y\", height/2)\n\t\t\t.attr(\"class\", \"axisExplanation\")\n\t\t\t.attr(\"transform\", \"rotate(90 \"+width+\" \"+height/2+\") translate(0, 35)\")\n\t\t\t.text(xAxisValue);\n\t\txAxisLabelLeft\n\t\t\t.attr(\"x\", 0)\n\t\t\t.attr(\"y\", height/2)\n\t\t\t.attr(\"class\", \"axisExplanation\")\n\t\t\t.attr(\"transform\", \"rotate(270 \"+0+\" \"+height/2+\") translate(0, 35)\")\n\t\t\t.text(axisValueOpposites[axisValues.indexOf(xAxisValue)]);\n\t\t//vertical yAxis\n\t\tyAxisLine\n\t\t\t.attr(\"x1\", width/2)\n\t\t\t.attr(\"y1\", 0)\n\t\t\t.attr(\"x2\", width/2)\n\t\t\t.attr(\"y2\", height)\n\t\t\t.attr(\"class\", \"axisLine\")\n\t\t\t.attr(\"stroke-width\", 2)\n\t\t\t.attr(\"stroke\", \"black\");\n\t\tyAxisLabelTop\n\t\t\t.attr(\"x\", width/2)\n\t\t\t.attr(\"y\", 30)\n\t\t\t.attr(\"class\", \"axisExplanation\")\n\t\t\t.attr(\"transform\", \"translate(0, 5)\")\n\t\t\t.text(yAxisValue);\n\t\tyAxisLabelBottom\n\t\t\t.attr(\"x\", width/2)\n\t\t\t.attr(\"y\", height)\n\t\t\t.attr(\"transform\", \"translate(0, -5)\")\n\t\t\t.attr(\"class\", \"axisExplanation\")\n\t\t\t.text(axisValueOpposites[axisValues.indexOf(yAxisValue)]);\n\t}", "function FunctionNumberLineAxis(options) {\n let axis,\n axisDefinition,\n axisLocation,\n axisType,\n coordinates,\n parent,\n tickCount;\n\n axis = this;\n\n init(options);\n\n return axis;\n\n /* INITIALIZER */\n function init(options) {\n\n _required(options);\n _defaults(options);\n\n axis.group = addGroup();\n axisDefinition = defineAxis();\n\n applyAxisToGroup();\n }\n\n\n /* PRIVATE METHODS */\n function _required(options) {\n\n parent = options.parent;\n axisLocation = options.axisLocation;\n axisType = switchAxisType();\n coordinates = switchAxisCoordinates();\n\n }\n\n function _defaults(options) {\n\n tickCount = options.tickCount ? options.tickCount : 1;\n\n }\n\n\n function addGroup() {\n let group;\n\n group = explorableGroup({\n \"where\":parent.layers.axes\n });\n\n return group;\n }\n\n function applyAxisToGroup() {\n\n axis.group\n .call(axisDefinition)\n .attr(\"transform\",\"translate(\"+coordinates.x+\",\"+coordinates.y+\")\")\n .attr(\"font-size\",\"14pt\");\n\n }\n\n function defineAxis() {\n let axisDefinition;\n\n\n axisDefinition = axisType(parent.scale)\n .ticks(tickCount);\n\n return axisDefinition;\n }\n\n function switchAxisCoordinates() {\n switch(axisLocation) {\n case \"top\":\n return {\n \"x\":parent.scale.range()[0],\n \"y\":parent.inputY\n };\n case \"bottom\":\n return {\n \"x\":parent.scale.range()[0],\n \"y\":parent.outputY\n };\n }\n }\n\n function switchAxisType() {\n switch(axisLocation) {\n case \"top\":\n return d3.axisTop;\n case \"bottom\":\n return d3.axisBottom;\n }\n }\n\n\n\n\n}", "function axisModelCreator(registers, axisName, BaseAxisModelClass, extraDefaultOption) {\n Object(util[\"k\" /* each */])(AXIS_TYPES, function (v, axisType) {\n var defaultOption = Object(util[\"I\" /* merge */])(Object(util[\"I\" /* merge */])({}, axisDefault[axisType], true), extraDefaultOption, true);\n\n var AxisModel =\n /** @class */\n function (_super) {\n Object(tslib_tslib_es6[\"b\" /* __extends */])(AxisModel, _super);\n\n function AxisModel() {\n var args = [];\n\n for (var _i = 0; _i < arguments.length; _i++) {\n args[_i] = arguments[_i];\n }\n\n var _this = _super.apply(this, args) || this;\n\n _this.type = axisName + 'Axis.' + axisType;\n return _this;\n }\n\n AxisModel.prototype.mergeDefaultAndTheme = function (option, ecModel) {\n var layoutMode = Object(util_layout[\"d\" /* fetchLayoutMode */])(this);\n var inputPositionParams = layoutMode ? Object(util_layout[\"f\" /* getLayoutParams */])(option) : {};\n var themeModel = ecModel.getTheme();\n Object(util[\"I\" /* merge */])(option, themeModel.get(axisType + 'Axis'));\n Object(util[\"I\" /* merge */])(option, this.getDefaultOption());\n option.type = getAxisType(option);\n\n if (layoutMode) {\n Object(util_layout[\"h\" /* mergeLayoutParam */])(option, inputPositionParams, layoutMode);\n }\n };\n\n AxisModel.prototype.optionUpdated = function () {\n var thisOption = this.option;\n\n if (thisOption.type === 'category') {\n this.__ordinalMeta = data_OrdinalMeta.createByAxisModel(this);\n }\n };\n /**\n * Should not be called before all of 'getInitailData' finished.\n * Because categories are collected during initializing data.\n */\n\n\n AxisModel.prototype.getCategories = function (rawData) {\n var option = this.option; // FIXME\n // warning if called before all of 'getInitailData' finished.\n\n if (option.type === 'category') {\n if (rawData) {\n return option.data;\n }\n\n return this.__ordinalMeta.categories;\n }\n };\n\n AxisModel.prototype.getOrdinalMeta = function () {\n return this.__ordinalMeta;\n };\n\n AxisModel.type = axisName + 'Axis.' + axisType;\n AxisModel.defaultOption = defaultOption;\n return AxisModel;\n }(BaseAxisModelClass);\n\n registers.registerComponentModel(AxisModel);\n });\n registers.registerSubTypeDefaulter(axisName + 'Axis', getAxisType);\n}", "addGaugeCustomTicks() {\n const numericProcessor = this,\n that = numericProcessor.context,\n distance = that._distance,\n majorTickWidth = that._measurements.radius - distance.majorTickDistance;\n let drawTick, drawLabel;\n\n if (that.ticksVisibility !== 'none' && that._plotTicks !== false) {\n drawTick = function (angle) {\n that._drawTick(angle, majorTickWidth, 'major');\n };\n }\n else {\n drawTick = function () { };\n }\n\n if (that.labelsVisibility !== 'none' && that._plotLabels !== false) {\n drawLabel = function (angle, currentLabel, middle) {\n that._drawLabel(angle, currentLabel, distance.labelDistance, middle);\n };\n }\n else {\n drawLabel = function () { };\n }\n\n function createTickAndLabel(i) {\n const currentLabel = that.customTicks[i],\n value = numericProcessor.createDescriptor(currentLabel),\n angle = numericProcessor.getAngleByValue(value, true),\n middle = i > 0 && i < that.customTicks.length - 1;\n\n drawTick(angle);\n drawLabel(angle, currentLabel, middle);\n }\n\n for (let i = that.customTicks.length - 1; i >= 0; i--) {\n createTickAndLabel(i);\n }\n }", "_setTicksAndInterval() {\n const that = this;\n\n if (!that._isVisible() || that._renderingSuspended) {\n that._renderingSuspended = true;\n return;\n }\n\n //Set the New Format here\n let minLabel = that._formatLabel(that.min),\n maxLabel = that._formatLabel(that.max);\n\n //gets the range with the new min/max\n that._getRange();\n\n //creates a new tickIntervalHandler instance\n that._tickIntervalHandler = new JQX.Utilities.TickIntervalHandler(that, minLabel, maxLabel, 'jqx-label', that._settings.size, that.scaleType === 'integer', that.logarithmicScale);\n\n //re-arranges the layout\n that._layout();\n\n if (!that.customInterval) {\n // calculates the tickInterval\n that._calculateTickInterval();\n\n if (that._dateInterval) {\n that._intervalHasChanged = true;\n that._numericProcessor.addCustomTicks();\n }\n else {\n // Add the ticks and labels\n that._numericProcessor.addTicksAndLabels();\n }\n }\n else {\n if (that.mode === 'date') {\n that._calculateTickInterval()\n }\n\n // custom ticks\n that._intervalHasChanged = true;\n that._numericProcessor.addCustomTicks();\n }\n }", "function calculateRange(axis, axisOptions){\n\t\t\tvar min = axisOptions.min != null ? axisOptions.min : axis.datamin;\n\t\t\tvar max = axisOptions.max != null ? axisOptions.max : axis.datamax;\t\n\t\t\tif(max - min == 0.0){\n\t\t\t\tvar widen = (max == 0.0) ? 1.0 : 0.01;\n\t\t\t\tmin -= widen;\n\t\t\t\tmax += widen;\n\t\t\t}\t\t\t\n\t\t\taxis.tickSize = getTickSize(axisOptions.noTicks, min, max, axisOptions.tickDecimals);\n\t\t\t\t\n\t\t\t/**\n\t\t\t * Autoscaling.\n\t\t\t */\n\t\t\tvar margin;\n\t\t\tif(axisOptions.min == null){\n\t\t\t\t\n\t\t\t\t/**\n\t\t\t\t * Add a margin.\n\t\t\t\t */\n\t\t\t\tmargin = axisOptions.autoscaleMargin;\n\t\t\t\tif(margin != 0){\n\t\t\t\t\tmin -= axis.tickSize * margin;\t\t\t\t\n\t\t\t\t\t/**\n\t\t\t\t\t * Make sure we don't go below zero if all values are positive.\n\t\t\t\t\t */\n\t\t\t\t\tif(min < 0 && axis.datamin >= 0) min = 0;\t\t\t\t\n\t\t\t\t\tmin = axis.tickSize * Math.floor(min / axis.tickSize);\n\t\t\t\t}\n\t\t\t}\n\t\t\tif(axisOptions.max == null){\n\t\t\t\tmargin = axisOptions.autoscaleMargin;\n\t\t\t\tif(margin != 0){\n\t\t\t\t\tmax += axis.tickSize * margin;\n\t\t\t\t\tif(max > 0 && axis.datamax <= 0) max = 0;\t\t\t\t\n\t\t\t\t\tmax = axis.tickSize * Math.ceil(max / axis.tickSize);\n\t\t\t\t}\n\t\t\t}\n\t\t\taxis.min = min;\n\t\t\taxis.max = max;\n\t\t}", "addTicksAndLabels() {\n const that = this.context,\n trackLength = that._measurements.trackLength,\n normalLayout = that._normalLayout,\n ticksFrequency = that._majorTicksInterval,\n tickscount = Math.round(that._range / parseFloat((ticksFrequency.toString()))),\n ticksDistance = trackLength / tickscount,\n min = parseFloat(that._drawMin),\n max = parseFloat(that._drawMax);\n\n let first, second, distanceModifier, last, firstLabelValue, firstLabelSize, lastLabelValue, lastLabelSize, currentTickAndLabel, ticks = '', labels = '';\n\n that._tickValues = [];\n this._longestLabelSize = 0;\n\n if (normalLayout) {\n first = min;\n\n //handling specific case\n if (that.logarithmicScale && min < 0 && min !== -1) {\n second = parseFloat(first - this.getPreciseModulo(first, ticksFrequency));\n }\n else {\n second = parseFloat(first - this.getPreciseModulo(first, ticksFrequency) + parseFloat(ticksFrequency));\n }\n\n distanceModifier = second - first;\n firstLabelValue = that._formatLabel(min);\n firstLabelSize = that._tickIntervalHandler.labelsSize.minLabelSize;\n last = max;\n lastLabelValue = that._formatLabel(max);\n lastLabelSize = that._tickIntervalHandler.labelsSize.maxLabelSize;\n }\n else {\n first = max;\n second = parseFloat(first - this.getPreciseModulo(first, ticksFrequency));\n distanceModifier = first - second;\n firstLabelValue = that._formatLabel(max);\n firstLabelSize = that._tickIntervalHandler.labelsSize.maxLabelSize;\n last = min;\n lastLabelValue = that._formatLabel(min);\n lastLabelSize = that._tickIntervalHandler.labelsSize.minLabelSize;\n }\n\n that._labelDummy = this._createMeasureLabel();\n\n currentTickAndLabel = this._addMajorTickAndLabel(firstLabelValue, firstLabelSize, true, first); // first tick and label\n ticks += currentTickAndLabel.tick;\n labels += currentTickAndLabel.label;\n\n // special case for second tick and label\n const distanceFromFirstToSecond = distanceModifier / ticksFrequency * ticksDistance;\n\n if (second.toString() !== that._drawMax.toString() && distanceFromFirstToSecond < trackLength) {\n // second item rendering\n const secondItemHtmlValue = that._formatLabel(second.toString()),\n plotSecond = firstLabelSize < distanceFromFirstToSecond;\n\n currentTickAndLabel = this._addMajorTickAndLabel(secondItemHtmlValue, undefined, plotSecond, second, true);\n ticks += currentTickAndLabel.tick;\n labels += currentTickAndLabel.label;\n }\n\n currentTickAndLabel = this.addMiddleMajorTicks(tickscount, ticksDistance, distanceFromFirstToSecond, distanceModifier, normalLayout, ticksFrequency);\n ticks += currentTickAndLabel.tick;\n labels += currentTickAndLabel.label;\n currentTickAndLabel = this._addMajorTickAndLabel(lastLabelValue, lastLabelSize, true, last); // last tick and label\n ticks += currentTickAndLabel.tick;\n labels += currentTickAndLabel.label;\n ticks += this.addMinorTicks(normalLayout);\n\n that._measureLabelScale.removeChild(that._labelDummy);\n delete that._labelDummy;\n delete that._measureLabelScale;\n\n if (that.nodeName.toLowerCase() === 'jqx-tank') {\n that._updateScaleWidth(this._longestLabelSize);\n }\n\n that._appendTicksAndLabelsToScales(ticks, labels);\n }", "renderAxis() {\n const axis = d3.svg.axis()\n .scale(this.props.scale)\n .orient(this.props.orientation)\n .tickFormat(this.props.tickFormat)\n .innerTickSize(this.props.innerTickSize)\n .outerTickSize(this.props.outerTickSize)\n .tickPadding(this.props.tickPadding);\n\n d3.select(this.node).call(axis);\n }", "function axisProvider(){\n\t/*\n\t * setAxisContainer(svg);\n\t * setXScale(makeLinearScale([0,width],[0,d3.max(data, function(d) { return d.x; })]));\n\t * setYScale(makeLinearScale([height,0],[0,d3.max(data, function(d) { return d.y; })]));\n\t * draw()\n\t * */\n\tvar axisProviderImpl = {\n\t\t\theight \t: 0,\n\t\t\twidth\t: 0,\n\t\t\tsvg\t\t: null,\n\t\t\txScale\t: null,\n\t\t\tyScale\t: null,\n\t\t\txAxis\t: null,\n\t\t\txGrid\t: null,\n\t\t\tyAxis\t: null,\n\t\t\tyGrid\t: null,\n\t\t\tdrawXGrid: true,\n\t\t\tdrawYGrid: true,\n\t\t\tdrawGrid: true,\n\t\t\txScaleOrient : \"bottom\",\n\t\t\tyScaleOrient : \"left\",\n\t\t\txTitle:\"\",\n\t\t\tyTitle:\"\",\n\t\t\ttitle:\"\",\n\t\t\tticks\t: 10,\n\t\t\tgridTicks : 10,\n\t\t\ttickFormat:\",r\",\n\t\t\tsetAxisContainer: function(svg){\n\t\t\t\tif(!isDefined(svg) || isNull(svg)){\n\t\t\t\t\treturn ;\n\t\t\t\t}\n\t\t\t\tthis.height = svg.attr(\"height\");\n\t\t\t\tthis.width = svg.attr(\"width\");\n\t\t\t\tthis.svg\t= svg;\n\t\t\t},\n\t\t\tmakeLinearScale : function(range,domain){\n\t\t\t\treturn d3.scale.linear().range(range).domain(domain).nice();\n\t\t\t},\n\t\t\tsetXScale\t: function(xScale){\n\t\t\t\tthis.xScale = xScale;\n\t\t\t\tthis.xAxis = d3.svg.axis().scale(xScale).orient(this.xScaleOrient).ticks(this.ticks, this.tickFormat);\n\t\t\t this.xGrid = d3.svg.axis().scale(xScale).orient(this.xScaleOrient).tickSize(-this.height, 0, 0).ticks(this.gridTicks).tickFormat(\"\");\n\t\t\t},\n\t\t\tsetYScale\t:function(yScale){\n\t\t\t\tthis.yScale = yScale;\n\t\t\t\tthis.yAxis = d3.svg.axis().scale(yScale).orient(this.yScaleOrient).ticks(this.ticks, this.tickFormat);\n\t\t\t this.yGrid = d3.svg.axis().scale(yScale).orient(this.yScaleOrient).tickSize(-this.width, 0, 0).ticks(this.gridTicks).tickFormat(\"\");\n\t\t\t},\n\t\t\tdraw\t: function(){\n\t\t\t\tconsole.log(\"Drawing Axis.\");\n\t\t\t\tthis.clear();\n\t\t\t\tif(this.drawGrid && this.drawYGrid){\n\t\t\t\t\tthis.svg.insert(\"g\",\":first-child\").attr(\"class\", \"grid\").call(this.yGrid);\n\t\t\t\t}\n\t\t\t\tthis.svg.insert(\"g\",\":first-child\").attr(\"class\",\"axis\").call(this.yAxis);\n\t\t\t\t//Y axis title\n\t\t\t\tthis.svg.append(\"g\")\n\t\t\t\t.attr(\"class\",\"axisLabel\")\n\t\t\t .append(\"text\")\n\t\t\t .attr(\"class\",\"axisLabel\")\n\t\t\t .attr(\"transform\", \"rotate(-90)\")\n\t\t\t .text(this.yTitle)\n\t\t\t .attr(\"text-anchor\",\"middle\")\n\t\t\t .attr(\"x\",-((this.height/2)))\n\t\t\t .attr(\"y\",-30);\n\t\t\t\t\n\t\t\t\tif(this.drawGrid && this.drawXGrid){\n\t\t\t\t\tthis.svg.insert(\"g\",\":first-child\").attr(\"class\", \"grid\").attr(\"transform\", \"translate(0,\" + this.height + \")\").call(this.xGrid);\n\t\t\t\t}\n\t\t\t\tthis.svg.insert(\"g\",\":first-child\").attr(\"class\",\"axis\").attr(\"transform\", \"translate(0,\" + this.height + \")\").call(this.xAxis);\n\t\t\t\t//X axis title\n\t\t\t this.svg.append(\"g\")\n\t\t\t .attr(\"class\",\"axisLabel\")\n\t\t\t .append(\"text\")\n\t\t\t .attr(\"transform\", \"translate(0,\" + this.height + \")\")\n\t\t\t .attr(\"class\",\"axisLabel\")\n\t\t\t .attr(\"text-anchor\",\"middle\")\n\t\t\t .text(this.xTitle)\n\t\t\t .attr(\"x\",(this.width/2))\n\t\t\t .attr(\"y\",30);\n\t\t\t //chart Title\n\t\t\t this.svg.append(\"g\")\n\t\t\t .attr(\"class\",\"axisLabel\")\n\t\t\t .append(\"text\")\n\t\t\t .attr(\"class\",\"chartTitle\")\n\t\t\t .text(this.title)\n\t\t\t .attr(\"text-anchor\",\"middle\")\n\t\t\t .attr(\"x\",(this.width/2))\n\t\t\t .attr(\"y\",0);\n\t\t\t},\n\t\t\tclear : function(){\n\t\t\t\tthis.svg.selectAll(\".grid\").remove();\n\t\t\t\tthis.svg.selectAll(\".axis\").remove();\n\t\t\t\tthis.svg.selectAll(\".axisLabel\").remove();\n\t\t\t}\n\t};\n\t\n\tthis.$get = function(){\n\t\treturn axisProviderImpl;\n\t};\n}", "constructor(options) {\n let that = this;\n that.options = {\n data: null,\n margin: 40,\n height: 500,\n width: 960,\n containerselect: null,\n chartheader: '',\n xaxis: 'number',\n xrange: [0, 100],\n xdirection: 'asc',\n lastseq: 0,\n yaxislabel: '',\n ytickincrement: 100,\n statstable: null,\n };\n that.options = Object.assign(that.options, options);\n\n // first empty containers of any elements we may have placed prior to this\n d3.selectAll(`${that.options.containerselect} .chart-element`).remove();\n if (that.options.statstable) {\n d3.selectAll(`#${that.options.statstable.containerid} .chart-element`).remove();\n }\n\n // default show all labels\n that.showlabels = [];\n\n that.xascending = that.options.xdirection == 'asc';\n if (that.options.xaxis == 'number') {\n that.xscale = d3.scaleLinear;\n // note since https://github.com/d3/d3-array/commit/22cdb3f2b1b98593a08907d17c12756404411b1d d must be scalar, not object\n // see https://github.com/d3/d3-array/issues/249\n that.bisectX = d3.bisector(function (d, x) {\n if (that.xascending) {\n return d - x;\n } else {\n return x - d;\n }\n }).left;\n\n // incr is 1 when ascending, -1 when descending\n that.lowx = that.options.xrange[0];\n that.highx = that.options.xrange[1];\n that.incr = (that.xascending) ? 1 : -1;\n that.xrange = _.range(that.lowx, that.highx + that.incr, that.incr);\n that.tickformat = function(dx) { return dx };\n that.parsex = function(x) { return x; }\n that.atlastseq = function(lastseq, thisx) {\n return (lastseq > 0 && ((that.xascending && thisx >= lastseq) || (!that.xascending && thisx <= lastseq)))\n }\n\n that.focustext = function(d) {return d.x + \" \" + d.value}\n that.formatxfortable = function(d) {return d}\n\n } else if (that.options.xaxis == 'date') {\n // see https://bl.ocks.org/gordlea/27370d1eea8464b04538e6d8ced39e89\n that.xscale = d3.scaleTime;\n // TODO: take xdirection option into account\n that.bisectX = d3.bisector(function(d) { return d; }).left;\n let parseDate = d3.timeParse(\"%m-%d\");\n that.lowx = parseDate(that.options.xrange[0]);\n that.highx = parseDate(that.options.xrange[1]);\n that.xrange = [];\n for (let thisdate=new Date(that.lowx); thisdate<=that.highx; thisdate = new Date(thisdate.setDate(thisdate.getDate()+1))) {\n that.xrange.push(thisdate);\n }\n\n // see https://bl.ocks.org/d3noob/0e276dc70bb9184727ee47d6dd06e915\n that.tickformat = d3.timeFormat(\"%m/%d\");\n\n that.parsex = function(x) {\n // translate date - maybe remove year first\n let datesplit = x.split('-');\n // check if year is present\n // TODO: needs to be special processing if previous year\n if (datesplit.length == 3) {\n x = datesplit.slice(1).join('-');\n }\n return parseDate(x);\n }\n\n that.atlastseq = function(lastseq, thisx) {\n return (lastseq != '' && moment(thisx).format('MM-DD') >= lastseq)\n }\n\n let formatDate = d3.timeFormat(\"%m/%d\");\n that.focustext = function(d) {return formatDate(d.x) + \" \" + d.value}\n that.formatxfortable = function(d) {return `${formatDate(d)}`}\n\n } else {\n throw 'ERROR: unknown xaxis option value: ' + that.options.xaxis;\n }\n\n // convert margin if necessary\n if (typeof that.options.margin == 'number') {\n that.options.margin = {\n top: that.options.margin,\n right: that.options.margin,\n bottom: that.options.margin,\n left: that.options.margin\n };\n }\n }", "function FunctionPlotterAxis(options) {\n let axis,\n axisType,\n fontSize,\n fontWeight,\n position,\n tickCount,\n where;\n\n axis = this;\n\n init(options);\n\n return axis;\n\n function init(options) {\n _required(options);\n _defaults(options);\n\n position = definePosition();\n\n axis.group = addGroup();\n axis.axisDefinition = defineAxis();\n\n applyAxisToGroup();\n\n }\n\n function _defaults(options) {\n\n fontSize = options.fontSize ? options.fontSize : \"14pt\";\n fontWeight = options.fontWeight ? options.fontWeight : \"normal\";\n tickCount = options.tickCount ? options.tickCount : 1;\n\n }\n\n function _required(options) {\n\n\n axis.scales = options.scales;\n axisType = options.axisType;\n where = options.where;\n\n }\n\n\n function addGroup() {\n let group;\n\n group = explorableGroup({\n \"where\":where\n });\n\n return group;\n\n }\n\n function applyAxisToGroup() {\n\n axis.group\n .call(axis.axisDefinition.ticks(tickCount))\n .attr(\"transform\",\"translate(\"+position.x+\",\"+position.y+\")\")\n .attr(\"font-size\",fontSize)\n .attr(\"font-weight\",fontWeight);\n\n }\n\n\n function defineAxis() {\n let axisDefinition;\n\n\n switch(axisType) {\n case \"left\":\n axisDefinition = d3.axisLeft(axis.scales.y);\n break;\n case \"bottom\":\n axisDefinition = d3.axisBottom(axis.scales.x);\n break;\n }\n\n return axisDefinition;\n }\n\n function definePosition() {\n let position;\n\n switch(axisType) {\n case \"left\":\n position = {\n \"x\":axis.scales.x(0),\n \"y\":0\n };\n break;\n case \"bottom\":\n position = {\n \"x\":0,\n \"y\":axis.scales.y(0)\n };\n break;\n }\n\n return position;\n }\n\n\n}", "function axis() {\n obj.extend(_.config, _.defaults);\n _.d3axis = d3.svg.axis();\n axis.rebind(\n _.d3axis,\n 'scale',\n 'orient',\n 'ticks',\n 'tickValues',\n 'tickSubdivide',\n 'tickSize',\n 'tickPadding',\n 'tickFormat');\n return axis;\n }", "labelTextAxis(xAxis, yAxis){\n this.xAxis = xAxis;\n this.yAxis = yAxis;\n }", "get axis() {\n return {\n index: this.$index,\n columns: this.$columns\n };\n }", "function domain_extender(self, axis, ordinal) {\n var scalename = axis + 'scale',\n zero = axis + '0',\n zero_val = axis + '0_value';\n if (ordinal) return function () {\n var scale_prop = self[scalename],\n scale = scale_prop(),\n domain = self.data().map(self[axis]());\n if (scale_prop._has_domain) {\n var old_domain = scale.domain(),\n add_values = domain.filter(function (val) {\n return old_domain.indexOf(val) < 0;\n });\n scale.domain(old_domain.concat(add_values));\n } else {\n scale.domain(domain);\n scale_prop._has_domain = true;\n }\n return scale;\n };else return function () {\n var scale_prop = self[scalename],\n scale = scale_prop(),\n domain = d3.extent(self.data(), self[axis]());\n\n // Incorporate the zero value\n var z = self[zero]();\n if (typeof z != 'undefined') {\n if (domain[0] > z) domain[0] = z;\n if (domain[1] < z) domain[1] = z;\n } else {\n z = domain[0];\n }\n self[zero_val] = z;\n\n // Extend the domain\n if (scale_prop._has_domain) scale.domain(d3.extent([].concat(_toConsumableArray(scale.domain()), _toConsumableArray(domain))));else {\n scale.domain(domain);\n scale_prop._has_domain = true;\n }\n return scale;\n };\n}", "_initDerivedProperties() {\n let drawLabelWidth = (this.drawXAxis ? LABELWIDTH : 0);\n let drawLabelHeight = (this.drawYAxis ? LABELHEIGHT : 0);\n\n //the area, in canvas coords, of the main region (that is, the area\n //bounded in graph coords by this.range)\n this.main = {\n left: this.gutter.left,\n right: this.width - this.gutter.right - AXIS_ARROW_LENGTH - drawLabelWidth,\n top: this.gutter.top + AXIS_ARROW_LENGTH + drawLabelHeight,\n bottom: this.height - this.gutter.bottom\n }\n this.main.width = this.main.right - this.main.left;\n this.main.height = this.main.bottom - this.main.top;\n\n //the center positions relative to the graph range\n let relativeCentreX = (0 - this.range.x.min) / this.range.x.size;\n let relativeCentreY = (0 - this.range.y.min) / this.range.y.size;\n //the center of the graph in canvas coords\n this.center = {\n x: this.main.left + relativeCentreX * this.main.width,\n y: this.main.bottom - relativeCentreY * this.main.height\n }\n\n //the size in pixels of a step of 1 in either axis\n this.unitSize = {\n x: this.main.width / this.range.x.size,\n y: this.main.height / this.range.y.size\n }\n\n //if steps weren't defined, calculate them now\n this.stepX = this.stepX || this._getStepSize('x');\n this.stepY = this.stepY || this._getStepSize('y');\n\n //the size of each gutter in graph coords\n let gutterLeft = this.gutter.left / this.unitSize.x;\n let gutterRight = this.gutter.right / this.unitSize.x;\n let gutterTop = this.gutter.top / this.unitSize.y;\n let gutterBottom = this.gutter.bottom / this.unitSize.y;\n\n let arrowWidth = AXIS_ARROW_LENGTH / this.unitSize.x;\n let arrowHeight = AXIS_ARROW_LENGTH / this.unitSize.y;\n\n //the area that needs to be plotted (main and gutters) in graph coords\n this.drawRegion = {\n left: this.range.x.min - gutterLeft,\n right: this.range.x.max + gutterRight,\n top: this.range.y.max + gutterTop,\n bottom: this.range.y.min - gutterBottom\n }\n this.drawRegion.width = this.drawRegion.right - this.drawRegion.left;\n this.drawRegion.height = this.drawRegion.top - this.drawRegion.bottom;\n\n //one unit of graph units, in canvas coords (pixels)\n this.scale = {\n x: (this.width - drawLabelWidth - AXIS_ARROW_LENGTH) / this.drawRegion.width,\n y: -(this.height - drawLabelHeight - AXIS_ARROW_LENGTH) / this.drawRegion.height\n }\n }", "function axisModelCreator(registers, axisName, BaseAxisModelClass, extraDefaultOption) {\n\t each(AXIS_TYPES, function (v, axisType) {\n\t var defaultOption = merge(merge({}, axisDefault[axisType], true), extraDefaultOption, true);\n\t\n\t var AxisModel =\n\t /** @class */\n\t function (_super) {\n\t __extends(AxisModel, _super);\n\t\n\t function AxisModel() {\n\t var args = [];\n\t\n\t for (var _i = 0; _i < arguments.length; _i++) {\n\t args[_i] = arguments[_i];\n\t }\n\t\n\t var _this = _super.apply(this, args) || this;\n\t\n\t _this.type = axisName + 'Axis.' + axisType;\n\t return _this;\n\t }\n\t\n\t AxisModel.prototype.mergeDefaultAndTheme = function (option, ecModel) {\n\t var layoutMode = fetchLayoutMode(this);\n\t var inputPositionParams = layoutMode ? getLayoutParams(option) : {};\n\t var themeModel = ecModel.getTheme();\n\t merge(option, themeModel.get(axisType + 'Axis'));\n\t merge(option, this.getDefaultOption());\n\t option.type = getAxisType(option);\n\t\n\t if (layoutMode) {\n\t mergeLayoutParam(option, inputPositionParams, layoutMode);\n\t }\n\t };\n\t\n\t AxisModel.prototype.optionUpdated = function () {\n\t var thisOption = this.option;\n\t\n\t if (thisOption.type === 'category') {\n\t this.__ordinalMeta = OrdinalMeta.createByAxisModel(this);\n\t }\n\t };\n\t /**\n\t * Should not be called before all of 'getInitailData' finished.\n\t * Because categories are collected during initializing data.\n\t */\n\t\n\t\n\t AxisModel.prototype.getCategories = function (rawData) {\n\t var option = this.option; // FIXME\n\t // warning if called before all of 'getInitailData' finished.\n\t\n\t if (option.type === 'category') {\n\t if (rawData) {\n\t return option.data;\n\t }\n\t\n\t return this.__ordinalMeta.categories;\n\t }\n\t };\n\t\n\t AxisModel.prototype.getOrdinalMeta = function () {\n\t return this.__ordinalMeta;\n\t };\n\t\n\t AxisModel.type = axisName + 'Axis.' + axisType;\n\t AxisModel.defaultOption = defaultOption;\n\t return AxisModel;\n\t }(BaseAxisModelClass);\n\t\n\t registers.registerComponentModel(AxisModel);\n\t });\n\t registers.registerSubTypeDefaulter(axisName + 'Axis', getAxisType);\n\t }", "function ticksAndAnnotations() {\n var activeAxIds = [];\n var i;\n function pushActiveAxIds(axList) {\n for (i = 0; i < axList.length; i++) {\n if (!axList[i].fixedrange) activeAxIds.push(axList[i]._id);\n }\n }\n function pushActiveAxIdsSynced(axList, axisType) {\n for (i = 0; i < axList.length; i++) {\n var axListI = axList[i];\n var axListIType = axListI[axisType];\n if (!axListI.fixedrange && axListIType.tickmode === 'sync') activeAxIds.push(axListIType._id);\n }\n }\n if (editX) {\n pushActiveAxIds(xaxes);\n pushActiveAxIds(links.xaxes);\n pushActiveAxIds(matches.xaxes);\n pushActiveAxIdsSynced(plotinfo.overlays, 'xaxis');\n }\n if (editY) {\n pushActiveAxIds(yaxes);\n pushActiveAxIds(links.yaxes);\n pushActiveAxIds(matches.yaxes);\n pushActiveAxIdsSynced(plotinfo.overlays, 'yaxis');\n }\n updates = {};\n for (i = 0; i < activeAxIds.length; i++) {\n var axId = activeAxIds[i];\n var ax = getFromId(gd, axId);\n Axes.drawOne(gd, ax, {\n skipTitle: true\n });\n updates[ax._name + '.range[0]'] = ax.range[0];\n updates[ax._name + '.range[1]'] = ax.range[1];\n }\n Axes.redrawComponents(gd, activeAxIds);\n }", "createScales(){\n let dv = this;\n\n // set scales\n dv.x = d3.scaleTime().range([0, dv.width]);\n dv.y = d3.scaleLinear().range([dv.height, 0]);\n\n // Update scales\n dv.x.domain(d3.extent(dv.data[0].values, d => {\n return (d.date); }));// this needs to be dynamic dv.date!!\n \n // for the y domain to track negative numbers \n const minValue = d3.min(dv.data, d => {\n return d3.min(d.values, d => { return d[dv.value]; });\n });\n\n // Set Y axis scales 0 if positive number else use minValue\n dv.y.domain([ minValue >=0 ? 0 : minValue,\n d3.max(dv.data, d => { \n return d3.max(d.values, d => { return d[dv.value]; });\n })\n ]);\n\n dv.xLabel.text(dv.titleX);\n dv.yLabel.text(dv.titleY);\n\n dv.drawGridLines();\n // dv.tickNumber = 0 ; //= dv.data[0].values.length;\n\n // Update axes\n dv.tickNumber !== \"undefined\" ? dv.xAxisCall.scale(dv.x).ticks(dv.tickNumber) : dv.xAxisCall.scale(dv.x);\n\n // // Update axes - what about ticks for smaller devices??\n // dv.xAxisCall.scale(dv.x).ticks(d3.timeYear.filter((d) => {\n // return d = parseYear(\"2016\");\n // }));\n // dv.xAxisCall.scale(dv.x).ticks(dv.tickNumber).tickFormat( (d,i) => {\n // return i < dv.tickNumber ? dv.data[0].values[i].label : \"\";\n // });\n \n // .tickFormat(dv.formatQuarter);\n dv.xAxis.transition(dv.t()).call(dv.xAxisCall);\n \n //ticks(dv.tickNumberY)\n dv.yScaleFormat !== \"undefined\" ? dv.yAxisCall.scale(dv.y).tickFormat(dv.yScaleFormat ) : dv.yAxisCall.scale(dv.y);\n dv.yAxis.transition(dv.t()).call(dv.yAxisCall);\n\n // Update x-axis label based on selector\n // dv.xLabel.text(dv.variable);\n\n // Update y-axis label based on selector\n // var selectorKey = dv.keys.findIndex( d => { return d === dv.variable; });\n // var newYLabel =[selectorKey];\n // dv.yLabel.text(newYLabel);\n\n dv.update();\n }", "numericalMapping(axis) {\n const solver = this.solver;\n const state = this.plotSegment.state;\n const props = this.plotSegment.object.properties;\n const attrs = state.attributes;\n const dataIndices = state.dataRowIndices;\n const table = this.getTableContext();\n switch (axis) {\n case \"x\":\n {\n const data = props.xData;\n if (data.type == \"numerical\") {\n const [x1, x2] = solver.attrs(attrs, [this.x1Name, this.x2Name]);\n const expr = this.getExpression(data.expression);\n const interp = axis_1.getNumericalInterpolate(data);\n for (const [index, markState] of state.glyphs.entries()) {\n const rowContext = table.getGroupedContext(dataIndices[index]);\n const value = expr.getNumberValue(rowContext);\n const t = interp(value);\n solver.addLinear(solver_1.ConstraintStrength.HARD, (1 - t) * props.marginX1 - t * props.marginX2, [[1 - t, x1], [t, x2]], [[1, solver.attr(markState.attributes, \"x\")]]);\n }\n }\n if (data.type == \"categorical\") {\n const [x1, x2, gapX] = solver.attrs(attrs, [\n this.x1Name,\n this.x2Name,\n \"gapX\"\n ]);\n const expr = this.getExpression(data.expression);\n for (const [index, markState] of state.glyphs.entries()) {\n const rowContext = table.getGroupedContext(dataIndices[index]);\n const value = expr.getStringValue(rowContext);\n this.gapX(data.categories.length, data.gapRatio);\n const i = data.categories.indexOf(value);\n solver.addLinear(solver_1.ConstraintStrength.HARD, (data.categories.length - i - 0.5) * props.marginX1 -\n (i + 0.5) * props.marginX2, [\n [i + 0.5, x2],\n [data.categories.length - i - 0.5, x1],\n [-data.categories.length / 2 + i + 0.5, gapX]\n ], [\n [\n data.categories.length,\n solver.attr(markState.attributes, \"x\")\n ]\n ]);\n }\n }\n // solver.addEquals(ConstraintWeight.HARD, x, x1);\n }\n break;\n case \"y\": {\n const data = props.yData;\n if (data.type == \"numerical\") {\n const [y1, y2] = solver.attrs(attrs, [this.y1Name, this.y2Name]);\n const expr = this.getExpression(data.expression);\n const interp = axis_1.getNumericalInterpolate(data);\n for (const [index, markState] of state.glyphs.entries()) {\n const rowContext = table.getGroupedContext(dataIndices[index]);\n const value = expr.getNumberValue(rowContext);\n const t = interp(value);\n solver.addLinear(solver_1.ConstraintStrength.HARD, (t - 1) * props.marginY2 + t * props.marginY1, [[1 - t, y1], [t, y2]], [[1, solver.attr(markState.attributes, \"y\")]]);\n }\n }\n if (data.type == \"categorical\") {\n const [y1, y2, gapY] = solver.attrs(attrs, [\n this.y1Name,\n this.y2Name,\n \"gapY\"\n ]);\n const expr = this.getExpression(data.expression);\n for (const [index, markState] of state.glyphs.entries()) {\n const rowContext = table.getGroupedContext(dataIndices[index]);\n const value = expr.getStringValue(rowContext);\n this.gapY(data.categories.length, data.gapRatio);\n const i = data.categories.indexOf(value);\n solver.addLinear(solver_1.ConstraintStrength.HARD, (data.categories.length - i - 0.5) * props.marginY1 -\n (i + 0.5) * props.marginY2, [\n [i + 0.5, y2],\n [data.categories.length - i - 0.5, y1],\n [-data.categories.length / 2 + i + 0.5, gapY]\n ], [[data.categories.length, solver.attr(markState.attributes, \"y\")]]);\n }\n }\n // solver.addEquals(ConstraintWeight.HARD, y, y2);\n }\n }\n }", "addTicksAndLabels() {\n const ignored = JQX.Utilities.BigNumber.ignoreBigIntNativeSupport;\n\n JQX.Utilities.BigNumber.ignoreBigIntNativeSupport = true;\n\n const that = this.context,\n trackLength = that._measurements.trackLength,\n normalLayout = that._normalLayout,\n ticksFrequency = that._majorTicksInterval,\n tickscount = this.round(new JQX.Utilities.BigNumber(that._range).divide(ticksFrequency)),\n ticksDistance = trackLength / tickscount,\n min = new JQX.Utilities.BigNumber(that._drawMin),\n max = new JQX.Utilities.BigNumber(that._drawMax);\n\n\n let first, second, distanceModifier, last, firstLabelValue, firstLabelSize, lastLabelValue, lastLabelSize, currentTickAndLabel, ticks = '', labels = '';\n\n that._tickValues = [];\n this._longestLabelSize = 0;\n\n if (normalLayout) {\n first = min;\n second = ticksFrequency.add(first.subtract(first.mod(ticksFrequency)));\n distanceModifier = second.subtract(first);\n firstLabelValue = that._formatLabel(min);\n firstLabelSize = that._tickIntervalHandler.labelsSize.minLabelSize;\n last = max;\n lastLabelValue = that._formatLabel(max);\n lastLabelSize = that._tickIntervalHandler.labelsSize.maxLabelSize;\n }\n else {\n first = max;\n second = first.subtract(first.mod(ticksFrequency));\n distanceModifier = first.subtract(second);\n firstLabelValue = that._formatLabel(max);\n firstLabelSize = that._tickIntervalHandler.labelsSize.maxLabelSize;\n last = min;\n lastLabelValue = that._formatLabel(min);\n lastLabelSize = that._tickIntervalHandler.labelsSize.minLabelSize;\n }\n\n that._labelDummy = this._createMeasureLabel();\n\n currentTickAndLabel = this._addMajorTickAndLabel(firstLabelValue, firstLabelSize, true, first); // first tick and label\n ticks += currentTickAndLabel.tick;\n labels += currentTickAndLabel.label;\n\n // special case for second tick and label\n const distanceFromFirstToSecond = distanceModifier.divide(ticksFrequency).multiply(ticksDistance);\n\n if (second.compare(that.max) !== 0 && distanceFromFirstToSecond.compare(trackLength) < 0) {\n // second item rendering\n const secondItemHtmlValue = that._formatLabel(second.toString()),\n plotSecond = distanceFromFirstToSecond.compare(firstLabelSize) > 0;\n\n currentTickAndLabel = this._addMajorTickAndLabel(secondItemHtmlValue, undefined, plotSecond, second, true);\n ticks += currentTickAndLabel.tick;\n labels += currentTickAndLabel.label;\n }\n currentTickAndLabel = this.addMiddleMajorTicks(tickscount, ticksDistance, distanceFromFirstToSecond, distanceModifier, normalLayout, ticksFrequency);\n ticks += currentTickAndLabel.tick;\n labels += currentTickAndLabel.label;\n currentTickAndLabel = this._addMajorTickAndLabel(lastLabelValue, lastLabelSize, true, last); // last tick and label\n ticks += currentTickAndLabel.tick;\n labels += currentTickAndLabel.label;\n\n if (that.mode !== 'date') {\n ticks += this.addMinorTicks(normalLayout);\n }\n\n that._measureLabelScale.removeChild(that._labelDummy);\n delete that._labelDummy;\n delete that._measureLabelScale;\n\n if (that.nodeName.toLowerCase() === 'jqx-tank') {\n that._updateScaleWidth(this._longestLabelSize);\n }\n\n that._appendTicksAndLabelsToScales(ticks, labels);\n JQX.Utilities.BigNumber.ignoreBigIntNativeSupport = ignored;\n }", "niceScale (yMin, yMax, ticks = 10) {\n if ((yMin === Number.MIN_VALUE && yMax === 0) || (!Utils.isNumber(yMin) && !Utils.isNumber(yMax))) {\n // when all values are 0\n yMin = 0\n yMax = 1\n ticks = 1\n let justRange = this.justRange(yMin, yMax, ticks)\n return justRange\n }\n\n // Calculate Min amd Max graphical labels and graph\n // increments. The number of ticks defaults to\n // 10 which is the SUGGESTED value. Any tick value\n // entered is used as a suggested value which is\n // adjusted to be a 'pretty' value.\n //\n // Output will be an array of the Y axis values that\n // encompass the Y values.\n let result = []\n // If yMin and yMax are identical, then\n // adjust the yMin and yMax values to actually\n // make a graph. Also avoids division by zero errors.\n if (yMin === yMax) {\n yMin = yMin - 10 // some small value\n yMax = yMax + 10 // some small value\n }\n // Determine Range\n let range = yMax - yMin\n let tiks = ticks + 1\n // Adjust ticks if needed\n if (tiks < 2) {\n tiks = 2\n } else if (tiks > 2) {\n tiks -= 2\n }\n\n // Get raw step value\n let tempStep = range / tiks\n // Calculate pretty step value\n\n let mag = Math.floor(this.log10(tempStep))\n let magPow = Math.pow(10, mag)\n let magMsd = parseInt(tempStep / magPow)\n let stepSize = magMsd * magPow\n\n // build Y label array.\n // Lower and upper bounds calculations\n let lb = stepSize * Math.floor(yMin / stepSize)\n let ub = stepSize * Math.ceil((yMax / stepSize))\n // Build array\n let val = lb\n while (1) {\n result.push(val)\n val += stepSize\n if (val > ub) { break }\n }\n\n // TODO: need to remove this condition below which makes this function tightly coupled with w.\n if (this.w.config.yaxis[0].max === undefined &&\n this.w.config.yaxis[0].min === undefined) {\n return {\n result,\n niceMin: result[0],\n niceMax: result[result.length - 1]\n }\n } else {\n result = []\n let v = yMin\n result.push(v)\n let valuesDivider = Math.abs(yMax - yMin) / ticks\n for (let i = 0; i <= ticks - 1; i++) {\n v = v + valuesDivider\n result.push(v)\n }\n\n return {\n result,\n niceMin: result[0],\n niceMax: result[result.length - 1]\n }\n }\n }", "function Axis(name) {\n $.jqplot.ElemContainer.call(this);\n // Group: Properties\n //\n // Axes options are specified within an axes object at the top level of the \n // plot options like so:\n // > {\n // > axes: {\n // > xaxis: {min: 5},\n // > yaxis: {min: 2, max: 8, numberTicks:4},\n // > x2axis: {pad: 1.5},\n // > y2axis: {ticks:[22, 44, 66, 88]}\n // > }\n // > }\n // There are 2 x axes, 'xaxis' and 'x2axis', and \n // 9 yaxes, 'yaxis', 'y2axis'. 'y3axis', ... Any or all of which may be specified.\n this.name = name;\n this._series = [];\n // prop: show\n // Wether to display the axis on the graph.\n this.show = false;\n // prop: tickRenderer\n // A class of a rendering engine for creating the ticks labels displayed on the plot, \n // See <$.jqplot.AxisTickRenderer>.\n this.tickRenderer = $.jqplot.AxisTickRenderer;\n // prop: tickOptions\n // Options that will be passed to the tickRenderer, see <$.jqplot.AxisTickRenderer> options.\n this.tickOptions = {};\n // prop: labelRenderer\n // A class of a rendering engine for creating an axis label.\n this.labelRenderer = $.jqplot.AxisLabelRenderer;\n // prop: labelOptions\n // Options passed to the label renderer.\n this.labelOptions = {};\n // prop: label\n // Label for the axis\n this.label = null;\n // prop: showLabel\n // true to show the axis label.\n this.showLabel = true;\n // prop: min\n // minimum value of the axis (in data units, not pixels).\n this.min = null;\n // prop: max\n // maximum value of the axis (in data units, not pixels).\n this.max = null;\n // prop: autoscale\n // DEPRECATED\n // the default scaling algorithm produces superior results.\n this.autoscale = false;\n // prop: pad\n // Padding to extend the range above and below the data bounds.\n // The data range is multiplied by this factor to determine minimum and maximum axis bounds.\n // A value of 0 will be interpreted to mean no padding, and pad will be set to 1.0.\n this.pad = 1.2;\n // prop: padMax\n // Padding to extend the range above data bounds.\n // The top of the data range is multiplied by this factor to determine maximum axis bounds.\n // A value of 0 will be interpreted to mean no padding, and padMax will be set to 1.0.\n this.padMax = null;\n // prop: padMin\n // Padding to extend the range below data bounds.\n // The bottom of the data range is multiplied by this factor to determine minimum axis bounds.\n // A value of 0 will be interpreted to mean no padding, and padMin will be set to 1.0.\n this.padMin = null;\n // prop: ticks\n // 1D [val, val, ...] or 2D [[val, label], [val, label], ...] array of ticks for the axis.\n // If no label is specified, the value is formatted into an appropriate label.\n this.ticks = [];\n // prop: numberTicks\n // Desired number of ticks. Default is to compute automatically.\n this.numberTicks;\n // prop: tickInterval\n // number of units between ticks. Mutually exclusive with numberTicks.\n this.tickInterval;\n // prop: renderer\n // A class of a rendering engine that handles tick generation, \n // scaling input data to pixel grid units and drawing the axis element.\n this.renderer = $.jqplot.LinearAxisRenderer;\n // prop: rendererOptions\n // renderer specific options. See <$.jqplot.LinearAxisRenderer> for options.\n this.rendererOptions = {};\n // prop: showTicks\n // Wether to show the ticks (both marks and labels) or not.\n // Will not override showMark and showLabel options if specified on the ticks themselves.\n this.showTicks = true;\n // prop: showTickMarks\n // Wether to show the tick marks (line crossing grid) or not.\n // Overridden by showTicks and showMark option of tick itself.\n this.showTickMarks = true;\n // prop: showMinorTicks\n // Wether or not to show minor ticks. This is renderer dependent.\n this.showMinorTicks = true;\n // prop: drawMajorGridlines\n // True to draw gridlines for major axis ticks.\n this.drawMajorGridlines = true;\n // prop: drawMinorGridlines\n // True to draw gridlines for minor ticks.\n this.drawMinorGridlines = false;\n // prop: drawMajorTickMarks\n // True to draw tick marks for major axis ticks.\n this.drawMajorTickMarks = true;\n // prop: drawMinorTickMarks\n // True to draw tick marks for minor ticks. This is renderer dependent.\n this.drawMinorTickMarks = true;\n // prop: useSeriesColor\n // Use the color of the first series associated with this axis for the\n // tick marks and line bordering this axis.\n this.useSeriesColor = false;\n // prop: borderWidth\n // width of line stroked at the border of the axis. Defaults\n // to the width of the grid boarder.\n this.borderWidth = null;\n // prop: borderColor\n // color of the border adjacent to the axis. Defaults to grid border color.\n this.borderColor = null;\n // prop: scaleToHiddenSeries\n // True to include hidden series when computing axes bounds and scaling.\n this.scaleToHiddenSeries = false;\n // minimum and maximum values on the axis.\n this._dataBounds = {min:null, max:null};\n // statistics (min, max, mean) as well as actual data intervals for each series attached to axis.\n // holds collection of {intervals:[], min:, max:, mean: } objects for each series on axis.\n this._intervalStats = [];\n // pixel position from the top left of the min value and max value on the axis.\n this._offsets = {min:null, max:null};\n this._ticks=[];\n this._label = null;\n // prop: syncTicks\n // true to try and synchronize tick spacing across multiple axes so that ticks and\n // grid lines line up. This has an impact on autoscaling algorithm, however.\n // In general, autoscaling an individual axis will work better if it does not\n // have to sync ticks.\n this.syncTicks = null;\n // prop: tickSpacing\n // Approximate pixel spacing between ticks on graph. Used during autoscaling.\n // This number will be an upper bound, actual spacing will be less.\n this.tickSpacing = 75;\n // Properties to hold the original values for min, max, ticks, tickInterval and numberTicks\n // so they can be restored if altered by plugins.\n this._min = null;\n this._max = null;\n this._tickInterval = null;\n this._numberTicks = null;\n this.__ticks = null;\n // hold original user options.\n this._options = {};\n }", "function getYaxisOptions(){\n scale = new Array();\n\n if(generate_param_1){\n y1_scale = {\n type: \"linear\",\n\n display: show_scale_1,\n position: \"left\",\n id: \"y-axis-1\",\n scaleLabel: {\n display: true,\n labelString: label_1,\n },\n };\n\n if(same_scale) {\n y1_scale[\"ticks\"] = {\n min: min_scale_value,\n max: max_scale_value\n }\n }\n\n scale.push(y1_scale);\n }\n\n\n if(generate_param_2){\n y2_scale = {\n type: \"linear\",\n display: show_scale_2,\n position: \"right\",\n id: \"y-axis-2\",\n scaleLabel: {\n display: true,\n labelString: label_2,\n },\n gridLines: {\n drawOnChartArea: false,\n }\n };\n\n if(same_scale) {\n y2_scale[\"ticks\"] = {\n min: min_scale_value,\n max: max_scale_value\n }\n }\n\n scale.push(y2_scale);\n }\n\n if(generate_param_3){\n y3_scale = {\n type: \"linear\",\n display: show_scale_3,\n position: \"right\",\n id: \"y-axis-3\",\n scaleLabel: {\n display: true,\n labelString: label_3\n },\n gridLines: {\n drawOnChartArea: false,\n }\n };\n scale.push(y3_scale);\n }\n\n\n\n return scale;\n}", "addGaugeTicksAndLabels() {\n const ignored = JQX.Utilities.BigNumber.ignoreBigIntNativeSupport;\n\n JQX.Utilities.BigNumber.ignoreBigIntNativeSupport = true;\n\n const that = this.context,\n numericProcessor = this,\n maxLabelHeight = Math.max(that._tickIntervalHandler.labelsSize.minLabelSize, that._tickIntervalHandler.labelsSize.maxLabelSize),\n majorStep = that._majorTicksInterval,\n minorStep = that._minorTicksInterval,\n majorTickValues = {},\n distance = that._distance,\n radius = that._measurements.radius,\n majorTickWidth = radius - distance.majorTickDistance,\n minorTickWidth = radius - distance.minorTickDistance,\n bigDrawMin = new JQX.Utilities.BigNumber(that._drawMin),\n bigDrawMax = new JQX.Utilities.BigNumber(that._drawMax);\n let drawMajor, drawMinor, addLabel, currentAngle, angleAtMin, angleAtMax;\n\n if (that.ticksVisibility !== 'none' && that._plotTicks !== false) {\n drawMajor = function (angle) {\n that._drawTick(angle, majorTickWidth, 'major');\n };\n\n drawMinor = function (value) {\n that._drawTick(numericProcessor.getAngleByValue(value, true), minorTickWidth, 'minor');\n };\n }\n else {\n drawMajor = function () { };\n drawMinor = function () { };\n }\n\n if (that.labelsVisibility !== 'none' && that._plotLabels !== false) {\n addLabel = function (angle, currentLabel, middle) {\n that._drawLabel(angle, currentLabel, distance.labelDistance, middle);\n };\n }\n else {\n addLabel = function () { };\n }\n\n if (!that.inverted) {\n angleAtMin = that.endAngle;\n angleAtMax = that.startAngle;\n }\n else {\n angleAtMin = that.startAngle;\n angleAtMax = that.endAngle;\n }\n\n // first major tick and label\n currentAngle = numericProcessor.getAngleByValue(bigDrawMin, false);\n drawMajor(currentAngle);\n majorTickValues[that._drawMin.toString()] = true;\n addLabel(currentAngle, that.min, false);\n\n let second = bigDrawMin.subtract(bigDrawMin.mod(majorStep)),\n firstMinTick;\n\n if (bigDrawMin.compare(0) !== -1) {\n second = second.add(majorStep);\n }\n\n // determines the value at the first minor tick\n for (let i = new JQX.Utilities.BigNumber(second); i.compare(bigDrawMin) !== -1; i = i.subtract(minorStep)) {\n firstMinTick = i;\n }\n\n // second major tick and label\n currentAngle = numericProcessor.getAngleByValue(second, false);\n drawMajor(currentAngle);\n majorTickValues[second.toString()] = true;\n if (2 * Math.PI * that._measurements.innerRadius * (this._getAngleDifference(angleAtMin, numericProcessor.getAngleByValue(second, false, true)) / 360) > maxLabelHeight) {\n addLabel(currentAngle, this.getActualValue(second), second.compare(bigDrawMax) === -1);\n }\n\n let i;\n // middle major ticks and labels\n for (i = second.add(majorStep); i.compare(bigDrawMax.subtract(majorStep)) === -1; i = i.add(majorStep)) {\n currentAngle = numericProcessor.getAngleByValue(i, false);\n drawMajor(currentAngle);\n majorTickValues[i.toString()] = true;\n addLabel(currentAngle, this.getActualValue(i), true);\n }\n\n if (majorTickValues[i.toString()] === undefined && i.compare(bigDrawMax) !== 1) {\n // second-to-last major tick and label\n currentAngle = numericProcessor.getAngleByValue(i, false);\n drawMajor(currentAngle);\n majorTickValues[i.toString()] = true;\n if (2 * Math.PI * that._measurements.innerRadius * (this._getAngleDifference(angleAtMax, numericProcessor.getAngleByValue(i, false, true)) / 360) >= maxLabelHeight) {\n addLabel(currentAngle, this.getActualValue(i), true);\n }\n\n if (that._normalizedStartAngle !== that.endAngle) {\n // last major tick and label\n currentAngle = numericProcessor.getAngleByValue(bigDrawMax, false);\n drawMajor(currentAngle);\n if (2 * Math.PI * that._measurements.innerRadius * (this._getAngleDifference(angleAtMax, angleAtMin) / 360) >= maxLabelHeight) {\n addLabel(currentAngle, that.max, false);\n }\n }\n }\n\n if (that.mode === 'date') {\n JQX.Utilities.BigNumber.ignoreBigIntNativeSupport = ignored;\n return;\n }\n\n // minor ticks\n if (!that.logarithmicScale) {\n for (let j = firstMinTick; j.compare(bigDrawMax) === -1; j = j.add(minorStep)) {\n if (majorTickValues[j.toString()]) {\n continue; // does not plot minor ticks over major ones\n }\n drawMinor(j);\n }\n }\n else {\n this.drawGaugeLogarithmicScaleMinorTicks(majorTickValues, majorStep, drawMinor);\n }\n\n JQX.Utilities.BigNumber.ignoreBigIntNativeSupport = ignored;\n }", "function SVGGraphAxis(graph, title, min, max, major, minor, type) {\r\n\tthis._graph = graph; // The owning graph\r\n\tthis._title = title || ''; // Title of this axis\r\n\tthis._titleFormat = {}; // Formatting settings for the title\r\n\tthis._titleOffset = 0; // The offset for positioning the title\r\n\tthis._labels = null; // List of labels for this axis - one per possible value across all series\r\n\tthis._labelFormat = {}; // Formatting settings for the labels\r\n\tthis._lineFormat = {stroke: 'black', strokeWidth: 1}; // Formatting settings for the axis lines\r\n\tthis._ticks = {major: major || 10, minor: minor || 0, size: 10, position: 'out'}; // Tick mark options\r\n\tthis._scale = {min: min || 0, max: max || 100, type: type || 'linear' }; // Axis scale settings\r\n\tthis._crossAt = 0; // Where this axis crosses the other one\r\n }", "_updateIndicators() {\n const _this = this;\n this.duration = this.model.time.delayAnimations;\n this.yScale = this.model.marker.axis_y.getScale();\n this.xScale = this.model.marker.axis_x.getScale();\n this.yAxis.tickFormat(_this.model.marker.axis_y.getTickFormatter());\n this.xAxis.tickFormat(_this.model.marker.axis_x.getTickFormatter());\n this.xAxisLeft.tickFormat(_this.model.marker.axis_x.getTickFormatter());\n\n const sideDim = this.SIDEDIM;\n const stackDim = this.STACKDIM;\n\n const stacks = this.model.marker.getKeys(stackDim);\n let stackKeys = [];\n stackKeys = stacks.map(m => m[stackDim]);\n this.stackKeys = stackKeys;\n\n const sideItems = this.model.marker.label_side.getItems();\n //var sideKeys = Object.keys(sideItems);\n let sideKeys = [];\n if (!utils.isEmpty(sideItems)) {\n const sideFiltered = !!this.model.marker.side.getEntity().show[sideDim];\n const sides = this.model.marker.getKeys(sideDim)\n .filter(f => !sideFiltered || this.model.marker.side.getEntity().isShown(f));\n sideKeys = sides.map(m => m[sideDim]);\n\n if (sideKeys.length > 2) sideKeys.length = 2;\n if (sideKeys.length > 1) {\n const sortFunc = this.ui.chart.flipSides ? d3.ascending : d3.descending;\n sideKeys.sort(sortFunc);\n }\n }\n if (!sideKeys.length) sideKeys.push(\"undefined\");\n this.sideKeys = sideKeys;\n\n this.twoSided = this.sideKeys.length > 1;\n this.titleRight.classed(\"vzb-hidden\", !this.twoSided);\n if (this.twoSided) {\n this.xScaleLeft = this.xScale.copy();\n this.title.text(sideItems[this.sideKeys[1]]);\n this.titleRight.text(sideItems[this.sideKeys[0]]);\n } else {\n const title = this.sideKeys.length && sideItems[this.sideKeys[0]] ? sideItems[this.sideKeys[0]] : \"\";\n this.title.text(title);\n }\n\n this.cScale = this.model.marker.color.getScale();\n }", "function SVGPlotAxis(plot, title, min, max, major, minor) {\r\n\tthis._plot = plot; // The owning plot\r\n\tthis._title = title || ''; // The plot's title\r\n\tthis._titleFormat = { textAnchor: 'middle' }; // Formatting settings for the title\r\n\tthis._titleOffset = 0; // The offset for positioning the title\r\n\tthis._labelFormat = { }; // Formatting settings for the labels\r\n\tthis._lineFormat = {stroke: 'black', strokeWidth: 1}; // Formatting settings for the axis lines\r\n\tthis._ticks = {major: major || 10, minor: minor || 0, size: 10, position: 'both'}; // Tick mark options\r\n\tthis._scale = {min: min || 0, max: max || 100}; // Axis scale settings\r\n\tthis._crossAt = 0; // Where this axis crosses the other one. */\r\n }", "createAxes () {\n }", "drawAxis() {\n let svgSelect = d3.select(\"#vis-8-svg\");\n svgSelect.append(\"g\")\n .attr(\"class\", \"year-axis\")\n .attr(\"transform\", `translate(0,${this.vizHeight - 50})`)\n .call(this.xAxis);\n svgSelect.append(\"text\")\n .attr(\"class\", \"axis-label\")\n .attr(\"transform\", `translate(${this.vizWidth / 2},${this.vizHeight - 20})`)\n .text(\"Years\")\n\n let axisTotalAcres = d3.axisLeft(this.scaleTotalAcres);\n svgSelect.append(\"g\")\n .attr(\"class\", \"y-axis\")\n .attr(\"transform\", `translate(${this.vizMinWidth},0)`)\n .call(axisTotalAcres);\n svgSelect.append(\"text\")\n .attr(\"class\", \"axis-label\")\n .attr(\"transform\", `translate(20,${this.vizHeight / 2 + 50}) rotate(-90)`)\n .text(\"Total Acres Burned\")\n\n\n let axisNumFires = d3.axisRight(this.scaleNumFires);\n svgSelect.append(\"g\")\n .attr(\"class\", \"y-axis\")\n .attr(\"transform\", `translate(${this.vizWidth - this.vizMaxWidth},0)`)\n .call(axisNumFires);\n svgSelect.append(\"text\")\n .attr(\"class\", \"axis-label\")\n .attr(\"transform\", `translate(${this.vizWidth - 20},${this.vizHeight / 2 - 50}) rotate(90)`)\n .text(\"Number of Fires\")\n }", "function ExplorableNumberlineAxis(options) {\n let axis,\n axisDefinition,\n axisType,\n color,\n coordinates,\n fontFamily,\n fontSize,\n fontWeight,\n scale,\n tickOffset,\n tickSize,\n where;\n\n axis = this;\n\n init(options);\n\n return axis;\n\n function init(options) {\n\n _required(options);\n _defaults(options);\n\n axisDefinition = defineAxis();\n axis.group = addGroup();\n\n }\n\n function _defaults(options) {\n\n axisType = options.axisType ? options.axisType : d3.axisBottom;\n color = options.color ? options.color : \"black\";\n coordinates = options.coordinates ? options.coordinates : {\"x\":0,\"y\":0};\n fontSize = options.fontSize ? options.fontSize : \"14pt\";\n fontWeight = options.fontWeight ? options.fontWeight : \"normal\";\n fontFamily = options.fontFamily ? options.fontFamily : \"\";\n tickOffset = options.tickOffset ? options.tickOffset : 0;\n tickSize = options.tickSize ? options.tickSize : 5;\n\n }\n\n function _required(options) {\n scale = options.scale;\n where = options.where;\n }\n\n function addGroup() {\n let group;\n\n group = where.append(\"g\")\n .call(axisDefinition)\n .attr(\"transform\",\"translate(\"+coordinates.x+\",\"+coordinates.y+\")\");\n\n group.selectAll(\"text\")\n .attr(\"font-family\",fontFamily)\n .attr(\"font-weight\",fontWeight)\n .attr(\"font-size\",fontSize)\n .attr(\"dy\",tickOffset);\n\n return group;\n }\n\n function defineAxis() {\n let axisDefinition;\n\n axisDefinition = axisType()\n .scale(scale)\n .tickSize(tickSize);\n\n return axisDefinition;\n }\n\n}", "function getXscaleOptions(){\n x_options = {\n type: x_type,\n position: 'bottom',\n scaleLabel: {\n display: true,\n labelString: x_label\n },\n };\n\n if(x_time){\n x_options[\"time\"] = getTimeOptions(x_type);\n }else{\n x_options[\"ticks\"] = {\n beginAtZero: true\n }\n }\n\n if(same_scale){\n x_options[\"ticks\"] = {\n min: min_scale_value,\n max: max_scale_value\n }\n }\n\n return x_options;\n}", "function ApacheChartModel(seriesLabels, groupLabels, yValues, xValues, seriesColors)\n{\n // An array representing series labels\n this._seriesLabels = seriesLabels;\n // An array representing Group labels\n this._groupLabels = groupLabels;\n // A 2D array representing values for Y axis\n this._yValues = yValues;\n // A 2D array representing values for X axis.\n // The x axis values are used only for scatter plots/XYline \n this._xValues = xValues;\n // The array of strings with colors. Used for display of the series\n this._seriesColors = seriesColors;\n \n // the maximum value used to display the y-axis. \n // Default is 120% of maximum of the yValues\n //this._maxYValue = undefined;\n \n // the minimum value used to display the y-axis. Default is 80% of minimum of values\n //this._minYValue = undefined;\n\n // the maximum value used to display the X-axis. \n // Default is 120% of maximum of the xValues\n //this._maxXValue = undefined;\n \n // the minimum value used to display the y-axis. Default is 80% of minimum of values \n //this._minXValue = undefined;\n \n // The title for the graph\n //this._title = undefined;\n \n // The sub-title for the graph\n //this._subTitle = undefined;\n \n // The foot node for the graph\n //this._footNote = undefined;\n}", "addAxes () {\n }", "function AxisFieldRenderer(parent){this.parent=parent;}", "get axes() {\n if (this._axes === null) {\n let coll = new IgrAxisCollection();\n let inner = coll._innerColl;\n inner.addListener((sender, e) => {\n switch (e.action) {\n case NotifyCollectionChangedAction.Add:\n this._axesAdapter.insertManualItem(e.newStartingIndex, e.newItems.item(0));\n break;\n case NotifyCollectionChangedAction.Remove:\n this._axesAdapter.removeManualItemAt(e.oldStartingIndex);\n break;\n case NotifyCollectionChangedAction.Replace:\n this._axesAdapter.removeManualItemAt(e.oldStartingIndex);\n this._axesAdapter.insertManualItem(e.newStartingIndex, e.newItems.item(0));\n break;\n case NotifyCollectionChangedAction.Reset:\n this._axesAdapter.clearManualItems();\n break;\n }\n });\n this._axes = coll;\n }\n return this._axes;\n }", "function Axis( name, title ){\n this.name = name;\n this.title = title;\n\n this.fNdivisions;\n this.fAxisColor;\n this.fLabelColor;\n this.fLabelFont;\n this.fLabelOffset;\n this.fLabelOffset;\n this.fLabelSize;\n this.fTitleOffset;\n this.d3Axis = d3.svg.axis();\n\n }", "addGaugeTicksAndLabels() {\n const that = this.context,\n numericProcessor = this,\n maxLabelHeight = Math.max(that._tickIntervalHandler.labelsSize.minLabelSize, that._tickIntervalHandler.labelsSize.maxLabelSize),\n majorStep = that._majorTicksInterval,\n minorStep = that._minorTicksInterval,\n majorTickValues = {},\n distance = that._distance,\n radius = that._measurements.radius,\n majorTickWidth = radius - distance.majorTickDistance,\n minorTickWidth = radius - distance.minorTickDistance;\n let drawMajor, drawMinor, addLabel, currentAngle, angleAtMin, angleAtMax;\n\n if (that.ticksVisibility !== 'none' && that._plotTicks !== false) {\n drawMajor = function (angle) {\n that._drawTick(angle, majorTickWidth, 'major');\n };\n\n drawMinor = function (value) {\n that._drawTick(numericProcessor.getAngleByValue(value, true), minorTickWidth, 'minor');\n };\n }\n else {\n drawMajor = function () { };\n drawMinor = function () { };\n }\n\n if (that.labelsVisibility !== 'none' && that._plotLabels !== false) {\n addLabel = function (angle, currentLabel, middle) {\n that._drawLabel(angle, currentLabel, distance.labelDistance, middle);\n };\n }\n else {\n addLabel = function () { };\n }\n\n if (!that.inverted) {\n angleAtMin = that.endAngle;\n angleAtMax = that.startAngle;\n }\n else {\n angleAtMin = that.startAngle;\n angleAtMax = that.endAngle;\n }\n\n // first major tick and label\n currentAngle = numericProcessor.getAngleByValue(that._drawMin, false);\n drawMajor(currentAngle);\n majorTickValues[that._drawMin] = true;\n addLabel(currentAngle, that.min, false);\n\n let second = that._drawMin - numericProcessor.getPreciseModulo(that._drawMin, majorStep),\n firstMinTick;\n\n if (that._drawMin >= 0) {\n second += majorStep;\n }\n\n // determines the value at the first minor tick\n for (let i = second; i >= that._drawMin; i = i - minorStep) {\n firstMinTick = i;\n }\n\n // second major tick and label\n currentAngle = numericProcessor.getAngleByValue(second, false);\n drawMajor(currentAngle);\n majorTickValues[second] = true;\n if (2 * Math.PI * that._measurements.innerRadius * (this._getAngleDifference(angleAtMin, numericProcessor.getAngleByValue(second, false, true)) / 360) > maxLabelHeight) {\n addLabel(currentAngle, this.getActualValue(second), second < that._drawMax);\n }\n\n let i;\n // middle major ticks and labels\n for (i = second + majorStep; i < that._drawMax - majorStep; i += majorStep) {\n currentAngle = numericProcessor.getAngleByValue(i, false);\n drawMajor(currentAngle);\n majorTickValues[i] = true;\n addLabel(currentAngle, this.getActualValue(i), true);\n }\n\n if (majorTickValues[i] === undefined && i <= that._drawMax) {\n // second-to-last major tick and label\n currentAngle = numericProcessor.getAngleByValue(i, false);\n drawMajor(currentAngle);\n majorTickValues[i] = true;\n if (2 * Math.PI * that._measurements.innerRadius * (this._getAngleDifference(angleAtMax, numericProcessor.getAngleByValue(i, false, true)) / 360) >= maxLabelHeight) {\n addLabel(currentAngle, this.getActualValue(i), true);\n }\n\n if (that._normalizedStartAngle !== that.endAngle) {\n // last major tick and label\n currentAngle = numericProcessor.getAngleByValue(that._drawMax, false);\n drawMajor(currentAngle);\n majorTickValues[that._drawMax] = true;\n if (2 * Math.PI * that._measurements.innerRadius * (this._getAngleDifference(angleAtMax, angleAtMin) / 360) >= maxLabelHeight) {\n addLabel(currentAngle, that.max, false);\n }\n }\n }\n\n // minor ticks\n if (!that.logarithmicScale) {\n for (let j = firstMinTick; j < that._drawMax; j += minorStep) {\n if (majorTickValues[j]) {\n continue; // does not plot minor ticks over major ones\n }\n drawMinor(j);\n }\n }\n else {\n this.drawGaugeLogarithmicScaleMinorTicks(majorTickValues, majorStep, drawMinor);\n }\n }", "createAxis()\n {\n // já que vamos atualizar os dados do gráficos o eixo deve sempre atualizar esse xAxis, yAxis a cada update!\n // já que esses são \"intervalos\" escalados de acordo com os dados ! (dados(extent(min,max)) -> pixels(min,max))\n \n/* \n let xAxis = d3.axisBottom(this.xScale).ticks(15);\n let yAxis = d3.axisLeft(this.yScale).ticks(15); // eixos com 15 marcas\n\n this.margins\n .append(\"g\") // criar grupo que vai conter os elementos que fazem parte do eixo (que na verdade são os dados são valores da margem!)\n .attr(\"transform\",`translate(0,${this.config.height})`) // transladar na altura da área de desenho (os eixos usam os valores (dados) da escala mas eles não se submetem a ela! (nesse caso))\n .call(xAxis); // a função xAxis vai ser chamada e o argumento dela vai ser o grupo g que foi criado!\n\n this.margins\n .append(\"g\")\n .call(yAxis); \n*/\n // vamos por enquanto só criar os grupos dos eixos x e y \n\n let xAxis = d3.axisBottom(this.xScale).ticks(this.ticks);\n\n let yAxis = d3.axisLeft(this.yScale).ticks(this.ticks)\n\n this.margins\n .append(\"g\") \n .attr('class','ei-x')\n .attr(\"transform\",`translate(0,${this.config.height})`)\n .call(xAxis); \n \n this.margins\n .append(\"g\")\n .attr('class','ei-y')\n .call(yAxis); \n \n\n }", "function buildAxis() {\n xAxis = d3Axis.axisBottom(xScale)\n .ticks(xTicks, numberFormat)\n .tickSizeInner([-chartHeight]);\n\n yAxis = d3Axis.axisLeft(yScale);\n }", "function BasicLinechartComponent(renderer) {\n this.renderer = renderer;\n /**\n * Input width of the component\n * Default value : 900\n */\n this.width = 900;\n /**\n * Input height of the compenent\n * Default value : 200\n */\n this.height = 200;\n /**\n * Input data array that the component display\n * Default value : []\n */\n this.data = [];\n /**\n * Input domain of the Axis Y\n * Works only for continuous values\n * Default value : [0,0]\n */\n this.domain = [0, 0];\n /**\n * Input speed of zoom between 0 and 1\n * Default value : 0.2\n */\n this.speedZoom = 0.2;\n /**\n * Input range of timestamp\n * Default value : [0,0]\n */\n this.range = [0, 0];\n /**\n * Output rangeChange that emit range\n */\n this.rangeChange = new i0.EventEmitter();\n /**\n * Input currentTime\n * Default value : 0\n */\n this.currentTime = 0;\n /**\n * Output currentTimeChange that emit currentTime\n */\n this.currentTimeChange = new i0.EventEmitter();\n /**\n * Title of the component\n */\n this.title = 'Timeline : ';\n /**\n * Margin of the component\n */\n this.margin = { top: 20, right: 20, bottom: 20, left: 50 }; //marge interne au svg \n /**\n * dataZoom is a copy of data with the range specify\n */\n this.dataZoom = [];\n /**\n * idZoom is the number of wheel notch\n */\n this.idZoom = 0;\n /**\n * It's the smallest timestamp of data\n */\n this.minTime = 0;\n /**\n * It's the biggest timestamp of data\n */\n this.maxTime = 0;\n /**\n * It's the difference between the smallest and the biggest\n */\n this.lengthTime = 0;\n /**\n * Width of the svg\n */\n this.svgWidth = 0;\n /**\n * Height of the svg\n */\n this.svgHeight = 0;\n /**\n * Scale of the X axis\n */\n this.scaleX = d3__namespace.scaleTime();\n /**\n * Scale of the Y axis\n */\n this.scaleY = d3__namespace.scaleLinear();\n /**\n * Array of area definition\n */\n this.area = [];\n /**\n * Array of line definition\n */\n this.line = [];\n /**\n * data length before the new change\n */\n this.lastDatalength = 0;\n /**\n * Mode of the tooltip\n */\n this.modeToolTips = \"normal\";\n /**\n * true if the currentTimeline is selected\n */\n this.currentTimeSelected = false;\n /**\n * true if the scrollbar is selected\n */\n this.scrollbarSelected = false;\n /**\n * Last position of the mouse\n */\n this.lastPos = 0;\n /**\n * true if the CTRL Key of keyBoard is push\n */\n this.zoomSelected = false;\n }", "draw_axis(){\n //Y-axis and horizontal grid\n let axis_left = d3.axisLeft(this.y)\n .ticks(this.TICKS)\n .tickFormat(d => d)\n\n this.svg.append('g')\n .attr('transform', `translate(${this.X0}, 0)`)\n .style('font', '14px times')\n .attr('class', 'axis_y')\n .call(axis_left)\n\n let h_grid = d3.axisLeft(this.y)\n .tickSize(-this.W + this.X0)\n .tickFormat('')\n .ticks(this.TICKS)\n\n\n\n this.svg.append('g')\n .attr('transform', `translate(${this.X0}, 0)`)\n .attr('class', 'h_grid')\n .call(h_grid)\n\n\n //X-axis and vertical grid\n this.axis_bottom = d3.axisBottom(this.x)\n .ticks(10)\n .tickFormat(d => 2018 - d)\n\n this.axis_x = this.svg.append('g')\n .style('font', '14px times')\n .attr('transform', `translate(0, ${this.AXIS_HEIGHT})`)\n .attr('class', 'axis_x')\n .call(this.axis_bottom)\n\n\n\n }", "preDraw() {\n super.preDraw();\n // Prior to drawing we are adjusting config based elements here\n this.base.classed(\"chart-theme-\" + this.config(\"theme\"), true);\n\n this.scale.x.range([0, (this.config(\"width\") - this.config(\"margin-right\") - this.config(\"margin-left\"))]);\n this.scale.y.range([(this.config(\"height\") - this.config(\"margin-top\") - this.config(\"margin-bottom\")), 0]);\n\n this.containers.axis.x.attr(\"width\", this.config(\"width\")).attr(\"height\", this.config(\"margin-\" + this.config(\"orient-x\")));\n\n this.axis.x.orient(this.config(\"orient-x\")).ticks(this.config(\"ticks-x\"));\n this.axis.y.orient(this.config(\"orient-y\")).ticks(this.config(\"ticks-y\"));\n }", "get axis() {\n\t\treturn this.__axis;\n\t}", "function setScatterAxisData(data, axis, _vars) {\r\n //declare vars\r\n var axisData = [],\r\n chartData = data.chartData,\r\n scatterLabel = data.dataTable[axis],\r\n min = scatterLabel ? chartData[0][scatterLabel] : 0,\r\n max = scatterLabel ? chartData[0][scatterLabel] : 0,\r\n dataType;\r\n \r\n for (var j = 0; j < data.dataTableKeys.length; j++) {\r\n if (data.dataTableKeys[j].vizType === axis) {\r\n dataType = data.dataTableKeys[j].type;\r\n break;\r\n }\r\n }\r\n //loop over data to find max and min\r\n //also determines the y axis total if the data is stacked\r\n for (var i = 1; i < chartData.length; i++) {\r\n if (chartData[i].hasOwnProperty(scatterLabel)) {\r\n var num = chartData[i][scatterLabel];\r\n if (!isNaN(num)) {\r\n num = parseFloat(num);\r\n if (num > max) {\r\n max = num;\r\n } else if (num < min) {\r\n min = num;\r\n }\r\n }\r\n }\r\n }\r\n if (axis !== 'z') {\r\n min *= 0.9;\r\n max *= 1.1;\r\n }\r\n\r\n if (_vars.yMin && !isNaN(_vars.yMin) && axis === 'y') {\r\n min = _vars.yMin;\r\n }\r\n if (_vars.yMax && !isNaN(_vars.yMax) && axis === 'y') {\r\n max = _vars.yMax;\r\n }\r\n if (_vars.xMin && !isNaN(_vars.xMin) && axis === 'x') {\r\n min = _vars.xMin;\r\n }\r\n if (_vars.xMax && !isNaN(_vars.xMax) && axis === 'x') {\r\n max = _vars.xMax;\r\n }\r\n\r\n axisData.push(min);\r\n axisData.push(max);\r\n return {\r\n 'label': scatterLabel,\r\n 'values': axisData,\r\n 'dataType': 'NUMBER',\r\n 'min': min,\r\n 'max': max\r\n };\r\n}", "function setAxis(axis, axisModel) {\n\t axis.type = axisModel.get('type');\n\t axis.scale = createScaleByModel(axisModel);\n\t axis.onBand = axisModel.get('boundaryGap') && axis.type === 'category';\n\t axis.inverse = axisModel.get('inverse');\n\t\n\t if (isAngleAxisModel(axisModel)) {\n\t axis.inverse = axis.inverse !== axisModel.get('clockwise');\n\t var startAngle = axisModel.get('startAngle');\n\t axis.setExtent(startAngle, startAngle + (axis.inverse ? -360 : 360));\n\t } // Inject axis instance\n\t\n\t\n\t axisModel.axis = axis;\n\t axis.model = axisModel;\n\t }", "function XTimeAxis(min, max, majorUnit, minorUnit,title){\r\n\tthis.init(min, max, majorUnit, minorUnit,title);\r\n}", "drawAxes() {\n this.context.fillStyle = DEFAULT_PLOT_PARAMETERS.color;\n\n if(this.drawYAxis) {\n assert(this.range.x.min <= 0 && this.range.y.max >= 0,\n 'Cannot draw the y axis as it is out of range.')\n\n let labelWidth = this.context.measureText('y').width;\n\n //has to be fudged to look right\n let labelPosY = 0;\n let labelPosX = this.center.x - (labelWidth / 2);\n this.context.fillText('y', labelPosX, labelPosY);\n\n this._drawLine(this.center.x, LABELHEIGHT + AXIS_ARROW_LENGTH, this.center.x,\n this.height, 2);\n\n this.context.beginPath();\n this.context.lineWidth = 1;\n this.context.moveTo(this.center.x, LABELHEIGHT);\n this.context.lineTo(this.center.x + 5, LABELHEIGHT + AXIS_ARROW_LENGTH);\n this.context.lineTo(this.center.x - 5, LABELHEIGHT + AXIS_ARROW_LENGTH);\n this.context.fill();\n\n if(this.drawYUnits) {\n let stepSize = this.stepY;\n let i = stepSize.times(Math.ceil(this.drawRegion.bottom / stepSize.approx));\n for(; i.lessThan(this.drawRegion.top); i = i.plus(stepSize)) {\n if(!(i.equal(0))) {\n let yPos = this.center.y - i.approx * this.unitSize.y;\n\n this._drawLine(this.center.x, yPos, this.center.x + 6, yPos, 2);\n i.draw(this.context, {top: yPos, right: this.center.x});\n\n if(this.drawGrid) {\n this._drawLine(0, yPos, this.width - LABELWIDTH, yPos, 1,\n [5, 5]);\n }\n }\n }\n }\n }\n\n if(this.drawXAxis) {\n assert(this.range.y.min <= 0 && this.range.y.max >= 0,\n 'Cannot draw the x axis as it is out of range.')\n\n let labelWidth = this.context.measureText('x').width;\n\n //has to be fudged to look right\n let labelPosY = this.center.y - FONTSIZE / 2;\n let labelPosX = this.width - (LABELWIDTH / 2) - (labelWidth / 2);\n this.context.fillText('x', labelPosX, labelPosY);\n\n this._drawLine(0, this.center.y, this.width - LABELWIDTH - AXIS_ARROW_LENGTH, this.center.y, 2);\n\n this.context.beginPath();\n this.context.lineWidth = 1;\n this.context.moveTo(this.width - LABELWIDTH, this.center.y);\n this.context.lineTo(this.width - LABELWIDTH - AXIS_ARROW_LENGTH, this.center.y + 5);\n this.context.lineTo(this.width - LABELWIDTH - AXIS_ARROW_LENGTH, this.center.y - 5);\n this.context.fill();\n\n if(this.drawXUnits) {\n let stepSize = this.stepX;\n let xMin = this.range.x.min\n let i = stepSize.times(Math.ceil(this.drawRegion.left / stepSize.approx));\n for(; i.lessThan(this.drawRegion.right); i = i.plus(stepSize)) {\n if(!(i.equal(0))) {\n let xPos = this.center.x + i.approx * this.unitSize.x;\n\n //are any of the labels fractions? if step is an integer,\n //or an integral multiple of pi, then no.\n if(stepSize.approx === parseInt(stepSize.approx)) {\n var areFractions = false;\n } else {\n let stepSizeDivPi = stepSize.divide(new Rational(\"pi\"));\n\n if(stepSizeDivPi.approx === parseInt(stepSizeDivPi.approx)) {\n var areFractions = false;\n } else {\n var areFractions = true;\n }\n }\n\n this._drawLine(xPos, this.center.y, xPos, this.center.y - 6, 2);\n\n let labelYPos = this.center.y + MARKING_PADDING_TOP;\n if(i.greaterThan(0)) {\n i.draw(this.context, {top: labelYPos, left: xPos}, areFractions);\n } else if(i.lessThan(0)) {\n i.draw(this.context, {top: labelYPos, right: xPos}, areFractions);\n }\n\n if(this.drawGrid) {\n this._drawLine(xPos, LABELHEIGHT, xPos, this.height, 1,\n [5, 5]);\n }\n }\n }\n }\n }\n\n //draw origin\n if(this.drawOrigin) {\n let origin = new Rational(0);\n origin.draw(this.context, {top: this.center.y, right: this.center.x});\n }\n }", "function axisBox() {\n return { x: { min: 0, max: 1 }, y: { min: 0, max: 1 } };\n}", "function axisBox() {\n return { x: { min: 0, max: 1 }, y: { min: 0, max: 1 } };\n}", "function axisBox() {\n return { x: { min: 0, max: 1 }, y: { min: 0, max: 1 } };\n}", "function axisBox() {\n return { x: { min: 0, max: 1 }, y: { min: 0, max: 1 } };\n}", "function calculateBase(groupItem){var extent;var baseAxis=groupItem.axis;var seriesModels=groupItem.seriesModels;var seriesCount=seriesModels.length;var boxWidthList=groupItem.boxWidthList = [];var boxOffsetList=groupItem.boxOffsetList = [];var boundList=[];var bandWidth;if(baseAxis.type === 'category'){bandWidth = baseAxis.getBandWidth();}else {var maxDataCount=0;each(seriesModels,function(seriesModel){maxDataCount = Math.max(maxDataCount,seriesModel.getData().count());});extent = baseAxis.getExtent(),Math.abs(extent[1] - extent[0]) / maxDataCount;}each(seriesModels,function(seriesModel){var boxWidthBound=seriesModel.get('boxWidth');if(!zrUtil.isArray(boxWidthBound)){boxWidthBound = [boxWidthBound,boxWidthBound];}boundList.push([parsePercent(boxWidthBound[0],bandWidth) || 0,parsePercent(boxWidthBound[1],bandWidth) || 0]);});var availableWidth=bandWidth * 0.8 - 2;var boxGap=availableWidth / seriesCount * 0.3;var boxWidth=(availableWidth - boxGap * (seriesCount - 1)) / seriesCount;var base=boxWidth / 2 - availableWidth / 2;each(seriesModels,function(seriesModel,idx){boxOffsetList.push(base);base += boxGap + boxWidth;boxWidthList.push(Math.min(Math.max(boxWidth,boundList[idx][0]),boundList[idx][1]));});}", "function calculateTicks(axis, axisOptions){\n\t\t\taxis.ticks = [];\t\n\t\t\tif(axisOptions.ticks){\n\t\t\t\tvar ticks = axisOptions.ticks;\n\t\n\t\t\t\tif(Object.isFunction(ticks)){\n\t\t\t\t\tticks = ticks({ min: axis.min, max: axis.max });\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t/**\n\t\t\t\t * Clean up the user-supplied ticks, copy them over.\n\t\t\t\t */\n\t\t\t\tfor(var i = 0, v, label; i < ticks.length; ++i){\n\t\t\t\t\tvar t = ticks[i];\n\t\t\t\t\tif(typeof(t) == 'object'){\n\t\t\t\t\t\tv = t[0];\n\t\t\t\t\t\tlabel = (t.length > 1) ? t[1] : axisOptions.tickFormatter(v);\n\t\t\t\t\t}else{\n\t\t\t\t\t\tv = t;\n\t\t\t\t\t\tlabel = axisOptions.tickFormatter(v);\n\t\t\t\t\t}\n\t\t\t\t\taxis.ticks[i] = { v: v, label: label };\n\t\t\t\t}\n\t\t\t}else{\n\t\t\t\t/**\n\t\t\t\t * Round to nearest multiple of tick size.\n\t\t\t\t */\n\t\t\t\tvar start = axis.tickSize * Math.ceil(axis.min / axis.tickSize);\n\t\t\t\t/**\n\t\t\t\t * Then spew out all possible ticks.\n\t\t\t\t */\n\t\t\t\tfor(i = 0; start + i * axis.tickSize <= axis.max; ++i){\n\t\t\t\t\tv = start + i * axis.tickSize;\n\t\t\t\t\t\n\t\t\t\t\t/**\n\t\t\t\t\t * Round (this is always needed to fix numerical instability).\n\t\t\t\t\t */\n\t\t\t\t\tvar decimals = axisOptions.tickDecimals;\n\t\t\t\t\tif(decimals == null) decimals = 1 - Math.floor(Math.log(axis.tickSize) / Math.LN10);\n\t\t\t\t\tif(decimals < 0) decimals = 0;\n\t\t\t\t\t\n\t\t\t\t\tv = v.toFixed(decimals);\n\t\t\t\t\taxis.ticks.push({ v: v, label: axisOptions.tickFormatter(v) });\n\t\t\t\t}\n\t\t\t}\n\t\t}", "resetRange() {\n this._initAxisTags(true);\n this.draw();\n }", "function AbstractChartPainter() {\n\n}", "function AxisHelper () {\n this.radius = 1;\n this.high = 10;\n var N = 10; \n this.c1 = new Cilinder(N, N, this.radius, this.high);\n this.c2 = new Cilinder(N, N, this.radius, this.high);\n this.c3 = new Cilinder(N, N, this.radius, this.high);\n this.c1.setColor(1,0,0); // x = R\n this.c2.setColor(0,1,0); // y = G\n this.c3.setColor(0,0,1); // z = B\n\n}", "rescale(min, max) {\n if(min === 0){\n min = min + \"\";\n }\n if(max === 0){\n max = max + \"\";\n }\n this.x.domain([min || 30, max || 80]);\n\n this.xAxisElement\n .transition().duration(1500).ease(easeSinInOut) // https://github.com/mbostock/d3/wiki/Transitions#wiki-d3_ease\n .call(this.xAxis);\n\n for (let k in this.data) {\n // Add the valueline path.\n this.lineSvg.select(\".MECU\"+k)\n .transition().duration(1500).ease(easeSinInOut)\n .attr(\"d\", this.valueline(this.data[k].r));\n }\n }", "function setAxis(axis, axisModel) {\n axis.type = axisModel.get('type');\n axis.scale = createScaleByModel(axisModel);\n axis.onBand = axisModel.get('boundaryGap') && axis.type === 'category';\n axis.inverse = axisModel.get('inverse');\n\n if (isAngleAxisModel(axisModel)) {\n axis.inverse = axis.inverse !== axisModel.get('clockwise');\n var startAngle = axisModel.get('startAngle');\n axis.setExtent(startAngle, startAngle + (axis.inverse ? -360 : 360));\n } // Inject axis instance\n\n\n axisModel.axis = axis;\n axis.model = axisModel;\n}", "function appendAxes() {\n graphImg\n .append(\"g\")\n .call(xAxis)\n .attr(\"class\", \"xAxis\")\n .attr(\n \"transform\",\n \"translate(0,\" + (displayHeight - margin - labelArea) + \")\"\n );\n graphImg\n .append(\"g\")\n .call(yAxis)\n .attr(\"class\", \"yAxis\")\n .attr(\"transform\", \"translate(\" + (margin + labelArea) + \", 0)\");\n }", "function getYaxisOptions(opts, unit, min, max){\r\n\topts.axes.yaxis = {\r\n min: min,\r\n max: max,\r\n numberTicks: 5,\r\n autoscale: true,\r\n label: unit,\r\n tickOptions: {\r\n          angle: 0\r\n },\r\n tickInterval: null\r\n };\r\n opts.seriesDefaults.shadow = true;\r\n opts.seriesDefaults.pointLabels = {show: true};\r\n opts.seriesDefaults.markerOptions.color = 'darkblue';\r\n opts.highlighter.sizeAdjust = 4; \r\n\r\n return opts;\r\n}", "function componentCandleSticks () {\n\n /* Default Properties */\n var width = 400;\n var height = 400;\n var colors = [\"green\", \"red\"];\n var dispatch = d3.dispatch(\"customValueMouseOver\", \"customValueMouseOut\", \"customValueClick\", \"customSeriesMouseOver\", \"customSeriesMouseOut\", \"customSeriesClick\");\n var xScale = void 0;\n var yScale = void 0;\n var colorScale = d3.scaleOrdinal().range(colors).domain([true, false]);\n var candleWidth = 3;\n var classed = \"candleSticks\";\n\n /**\n * Initialise Data and Scales\n *\n * @private\n * @param {Array} data - Chart data.\n */\n function init(data) {\n // TODO: Use dataTransform() to calculate date domains?\n var maxDate = d3.max(data.values, function (d) {\n return d.date;\n });\n var minDate = d3.min(data.values, function (d) {\n return d.date;\n });\n\n var ONE_DAY_IN_MILLISECONDS = 86400000;\n var dateDomain = [new Date(minDate - ONE_DAY_IN_MILLISECONDS), new Date(maxDate + ONE_DAY_IN_MILLISECONDS)];\n\n // TODO: Use dataTransform() to calculate candle min/max?\n var yDomain = [d3.min(data.values, function (d) {\n return d.low;\n }), d3.max(data.values, function (d) {\n return d.high;\n })];\n\n if (typeof colorScale === \"undefined\") {\n colorScale = d3.scaleOrdinal().domain([true, false]).range(colors);\n }\n\n if (typeof xScale === \"undefined\") {\n xScale = d3.scaleTime().domain(dateDomain).range([0, width]);\n }\n\n if (typeof yScale === \"undefined\") {\n yScale = d3.scaleLinear().domain(yDomain).range([height, 0]).nice();\n }\n }\n\n /**\n * Constructor\n *\n * @constructor\n * @alias candleSticks\n * @param {d3.selection} selection - The chart holder D3 selection.\n */\n function my(selection) {\n init(selection.data()[0]);\n selection.each(function () {\n\n // Is Up Day\n var isUpDay = function isUpDay(d) {\n return d.close > d.open;\n };\n\n // Line Function\n var line = d3.line().x(function (d) {\n return d.x;\n }).y(function (d) {\n return d.y;\n });\n\n // High Low Lines\n var highLowLines = function highLowLines(bars) {\n var paths = bars.selectAll(\".high-low-line\").data(function (d) {\n return [d];\n });\n\n paths.enter().append(\"path\").classed(\"high-low-line\", true).attr(\"d\", function (d) {\n return line([{ x: xScale(d.date), y: yScale(d.high) }, { x: xScale(d.date), y: yScale(d.low) }]);\n });\n };\n\n // Open Close Bars\n var openCloseBars = function openCloseBars(bars) {\n var rect = bars.selectAll(\".open-close-bar\").data(function (d) {\n return [d];\n });\n\n rect.enter().append(\"rect\").classed(\"open-close-bar\", true).attr(\"x\", function (d) {\n return xScale(d.date) - candleWidth;\n }).attr(\"y\", function (d) {\n return isUpDay(d) ? yScale(d.close) : yScale(d.open);\n }).attr(\"width\", candleWidth * 2).attr(\"height\", function (d) {\n return isUpDay(d) ? yScale(d.open) - yScale(d.close) : yScale(d.close) - yScale(d.open);\n });\n };\n\n // Update series group\n var seriesGroup = d3.select(this);\n seriesGroup.classed(classed, true).attr(\"id\", function (d) {\n return d.key;\n }).on(\"mouseover\", function (d) {\n dispatch.call(\"customSeriesMouseOver\", this, d);\n }).on(\"click\", function (d) {\n dispatch.call(\"customSeriesClick\", this, d);\n });\n\n // Add candles to series\n var candlesSelect = seriesGroup.selectAll(\".candle\").data(function (d) {\n return d.values;\n });\n\n var candles = candlesSelect.enter().append(\"g\").classed(\"candle\", true).attr(\"fill\", function (d) {\n return colorScale(isUpDay(d));\n }).attr(\"stroke\", function (d) {\n return colorScale(isUpDay(d));\n }).on(\"mouseover\", function (d) {\n dispatch.call(\"customValueMouseOver\", this, d);\n }).on(\"click\", function (d) {\n dispatch.call(\"customValueClick\", this, d);\n }).merge(candlesSelect);\n\n highLowLines(candles);\n openCloseBars(candles);\n // openCloseTicks(candles);\n\n candles.exit().remove();\n });\n }\n\n /**\n * Width Getter / Setter\n *\n * @param {number} _v - Width in px.\n * @returns {*}\n */\n my.width = function (_v) {\n if (!arguments.length) return width;\n width = _v;\n return this;\n };\n\n /**\n * Height Getter / Setter\n *\n * @param {number} _v - Height in px.\n * @returns {*}\n */\n my.height = function (_v) {\n if (!arguments.length) return height;\n height = _v;\n return this;\n };\n\n /**\n * Color Scale Getter / Setter\n *\n * @param {d3.scale} _v - D3 color scale.\n * @returns {*}\n */\n my.colorScale = function (_v) {\n if (!arguments.length) return colorScale;\n colorScale = _v;\n return my;\n };\n\n /**\n * Colors Getter / Setter\n *\n * @param {Array} _v - Array of colours used by color scale.\n * @returns {*}\n */\n my.colors = function (_v) {\n if (!arguments.length) return colors;\n colors = _v;\n return my;\n };\n\n /**\n * X Scale Getter / Setter\n *\n * @param {d3.scale} _v - D3 scale.\n * @returns {*}\n */\n my.xScale = function (_v) {\n if (!arguments.length) return xScale;\n xScale = _v;\n return my;\n };\n\n /**\n * Y Scale Getter / Setter\n *\n * @param {d3.scale} _v - D3 scale.\n * @returns {*}\n */\n my.yScale = function (_v) {\n if (!arguments.length) return yScale;\n yScale = _v;\n return my;\n };\n\n /**\n * Candle Width Getter / Setter\n *\n * @param {number} _v - Width in px.\n * @returns {*}\n */\n my.candleWidth = function (_v) {\n if (!arguments.length) return candleWidth;\n candleWidth = _v;\n return my;\n };\n\n /**\n * Dispatch Getter / Setter\n *\n * @param {d3.dispatch} _v - Dispatch event handler.\n * @returns {*}\n */\n my.dispatch = function (_v) {\n if (!arguments.length) return dispatch();\n dispatch = _v;\n return this;\n };\n\n /**\n * Dispatch On Getter\n *\n * @returns {*}\n */\n my.on = function () {\n var value = dispatch.on.apply(dispatch, arguments);\n return value === dispatch ? my : value;\n };\n\n return my;\n }", "function getXaxisCustomRangeReport(dateFrom,dateTo){\n\n var db = getDatabase();\n var rs = \"\";\n\n //console.log(\"Global Report loading X chart data for custom report, from: \"+dateFrom+\" to: \"+dateTo);\n\n db.transaction(function(tx) {\n\n /* note:the 'in' clusole is necessary to don't load the category with NO expense in the range. Otherwise X and Y dataset have different size */\n rs = tx.executeSql(\"select cat_name,id from category where id in (select e.id_category from expense e where date(e.date) <= date('\"+dateTo+\"') and date(e.date) >= date('\"+dateFrom+\"') group by id_category)\");\n\n }\n );\n\n /* build the X values array */\n var categoryNames = [];\n for(var i =0;i < rs.rows.length;i++) {\n categoryNames.push(rs.rows.item(i).cat_name);\n //console.log('Category name: '+rs.rows.item(i).cat_name);\n }\n\n return categoryNames;\n }", "function cartesianAxisHelper_layout(gridModel, axisModel, opt) {\n opt = opt || {};\n var grid = gridModel.coordinateSystem;\n var axis = axisModel.axis;\n var layout = {};\n var otherAxisOnZeroOf = axis.getAxesOnZeroOf()[0];\n var rawAxisPosition = axis.position;\n var axisPosition = otherAxisOnZeroOf ? 'onZero' : rawAxisPosition;\n var axisDim = axis.dim;\n var rect = grid.getRect();\n var rectBound = [rect.x, rect.x + rect.width, rect.y, rect.y + rect.height];\n var idx = {\n left: 0,\n right: 1,\n top: 0,\n bottom: 1,\n onZero: 2\n };\n var axisOffset = axisModel.get('offset') || 0;\n var posBound = axisDim === 'x' ? [rectBound[2] - axisOffset, rectBound[3] + axisOffset] : [rectBound[0] - axisOffset, rectBound[1] + axisOffset];\n\n if (otherAxisOnZeroOf) {\n var onZeroCoord = otherAxisOnZeroOf.toGlobalCoord(otherAxisOnZeroOf.dataToCoord(0));\n posBound[idx.onZero] = Math.max(Math.min(onZeroCoord, posBound[1]), posBound[0]);\n } // Axis position\n\n\n layout.position = [axisDim === 'y' ? posBound[idx[axisPosition]] : rectBound[0], axisDim === 'x' ? posBound[idx[axisPosition]] : rectBound[3]]; // Axis rotation\n\n layout.rotation = Math.PI / 2 * (axisDim === 'x' ? 0 : 1); // Tick and label direction, x y is axisDim\n\n var dirMap = {\n top: -1,\n bottom: 1,\n left: -1,\n right: 1\n };\n layout.labelDirection = layout.tickDirection = layout.nameDirection = dirMap[rawAxisPosition];\n layout.labelOffset = otherAxisOnZeroOf ? posBound[idx[rawAxisPosition]] - posBound[idx.onZero] : 0;\n\n if (axisModel.get(['axisTick', 'inside'])) {\n layout.tickDirection = -layout.tickDirection;\n }\n\n if (util[\"O\" /* retrieve */](opt.labelInside, axisModel.get(['axisLabel', 'inside']))) {\n layout.labelDirection = -layout.labelDirection;\n } // Special label rotation\n\n\n var labelRotate = axisModel.get(['axisLabel', 'rotate']);\n layout.labelRotate = axisPosition === 'top' ? -labelRotate : labelRotate; // Over splitLine and splitArea\n\n layout.z2 = 1;\n return layout;\n}", "function axis() {\n stroke(100);\n strokeWeight(1);\n push();\n\n // define positions\n var xaxis = height*4/5\n var yaxis = width/2\n\n // draw x axis\n translate(0,xaxis);\n line(0,0,width,0);\n pop();\n push();\n\n // draw y axis\n translate(width/2,0);\n line(0,0,0,height);\n pop();\n push();\n\n // get user input for range\n range = rangeSlider.value();\n\n // shorten displayed digits and add '$'\n if(range >= 1000 & range <= 1000000){\n range_half = \"$\" + range / 2000 + \"K\";\n range = \"$\" + range / 1000 + \"K\";\n }\n\n if(range >= 1000000){\n range_half = \"$\" + range / 2000000 + \"M\";\n range = \"$\" + range / 1000000 + \"M\";\n }\n\n // x-axis labels\n text(\"-\" + range, 0 , xaxis + 10)\n text(\"-\" + range_half, width/4, xaxis + 10)\n text(range_half, 3*width/4 - 30, xaxis + 10)\n text(range, width - 30, height*4/5 + 10)\n\n\n // y-axis labels\n text(1, yaxis - 15, 10)\n text(0.5, yaxis - 20, xaxis/2)\n text(0.25, yaxis - 25, xaxis*3/4)\n text(0.75, yaxis - 25, xaxis/4)\n\n // origin\n text(0, yaxis - 3, xaxis + 10)\n\n }", "function LineChartApi(p_element, p_settings, p_data) {\n\tthis.base = SeriesChartApi;\n\tthis.base(p_element, p_settings, p_data);\n\tvar me = this;\n\n\t// Helper function for DrawChart()\n\tfunction DrawPoint(p_series) {\n\t\tvar TotalData = me.GetFilteredData(p_series);\n\t\tif (TotalData[0] == undefined || TotalData[0] == null) {\n\t\t\treturn false;\n\t\t}\n\n\t\t// ### Variables ###\n\t\tvar categories = TotalData[0];\n\t\tvar data = TotalData[1]\n\t\tvar isVariableXAxis = TotalData[2];\n\t\tvar isDate = TotalData[3];\n\n\t\tvar colorNumber = p_series - 1;\n\t\t// Derived values\n\t\tvar incrementX = me.g_chartArea.maxX / (data.length - 1);\n\t\tvar valueX = isDate ? categories[0].valueOf() : categories[0];\n\t\tvar nextY = 1 - ((data[0] - me.minY) / (me.maxY - me.minY));\n\n\t\tvar pointBorder = me.g_chartArea.pointBorder == null\n\t\t\t|| me.g_chartArea.pointBorder[colorNumber] == null\n\t\t\t? me.g_chartArea.color[colorNumber] : me.g_chartArea.pointBorder[colorNumber];\n\n\t\tfor (var i = 0; i < (data.length - 1) ; i++) {\n\t\t\t// Get X\n\t\t\tvar x1;\n\t\t\tvar x2;\n\n\t\t\tif (isVariableXAxis) {\n\t\t\t\tvar nextX = (valueX - me.minX) / (me.maxX - me.minX);\n\t\t\t\tvar x1 = (nextX * me.g_chartArea.maxX) + me.g_chartArea.minX;\n\n\t\t\t\tvalueX = isDate ? categories[i + 1].valueOf() : categories[i + 1];\n\n\t\t\t\tvar nextX = (valueX - me.minX) / (me.maxX - me.minX);\n\t\t\t\tvar x2 = (nextX * me.g_chartArea.maxX) + me.g_chartArea.minX;\n\t\t\t} else {\n\t\t\t\tx1 = me.g_chartArea.minX + (i * incrementX);\n\t\t\t\tx2 = me.g_chartArea.minX + ((i + 1) * incrementX);\n\t\t\t}\n\t\t\t// Get Y\n\t\t\tvar y1 = (nextY * me.g_chartArea.maxY) + me.g_chartArea.minY;\n\t\t\tnextY = 1 - ((data[i + 1] - me.minY) / (me.maxY - me.minY));\n\n\t\t\tvar y2 = (nextY * me.g_chartArea.maxY) + me.g_chartArea.minY;\n\t\t\t// Check if a point is missing\n\t\t\tif (isNaN(y1) || isNaN(y2)) {\n\n\t\t\t\tif (!isNaN(y1)) {\n\t\t\t\t\t// if this point exists, draw it out\n\t\t\t\t\tvar category = isDate ? me.FormatDate(categories[i], me.g_xAxis.dateFormat) : categories[i];\n\n\t\t\t\t\tvar Circle = me.Circle(me.g_chartArea.reference, x1, y1, 0.75, me.g_chartArea.color[colorNumber], pointBorder);\n\n\t\t\t\t\tme.Event(Circle,\n\t\t\t\t\t\t\"mouseover\",\n\t\t\t\t\t\tme.HoverText,\n\t\t\t\t\t\tdata[i] + ', ' + category);\n\n\t\t\t\t\tme.Event(Circle,\n\t\t\t\t\t\t\"mouseout\",\n\t\t\t\t\t\tme.EndHoverText);\n\t\t\t\t}\n\n\t\t\t\tif (!isNaN(y2)) {\n\t\t\t\t\t// if this point exists, draw it out\n\t\t\t\t\tvar category = isDate ? me.FormatDate(categories[i + 1], me.g_xAxis.dateFormat) : categories[i + 1];\n\n\t\t\t\t\tvar Circle = me.Circle(me.g_chartArea.reference, x2, y2, 0.75, me.g_chartArea.color[colorNumber], pointBorder);\n\n\t\t\t\t\tme.Event(Circle,\n\t\t\t\t\t\t\"mouseover\",\n\t\t\t\t\t\tme.HoverText,\n\t\t\t\t\t\tdata[i + 1] + ', ' + category);\n\n\t\t\t\t\tme.Event(Circle,\n\t\t\t\t\t\t\"mouseout\",\n\t\t\t\t\t\tme.EndHoverText);\n\t\t\t\t}\n\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\t// Draw the line\n\t\t\tme.Line(me.g_chartArea.reference, x1, y1, x2, y2, me.g_chartArea.color[colorNumber]);\n\n\t\t\t// Draw the point\n\t\t\tvar category = isDate ? me.FormatDate(categories[i], me.g_xAxis.dateFormat) : categories[i];\n\n\t\t\tvar Circle = me.Circle(me.g_chartArea.reference, x1, y1, 0.75, me.g_chartArea.color[colorNumber], pointBorder);\n\n\t\t\tme.Event(Circle,\n\t\t\t\t\"mouseover\",\n\t\t\t\tme.HoverText,\n\t\t\t\tdata[i] + ', ' + category);\n\n\t\t\tme.Event(Circle,\n\t\t\t\t\"mouseout\",\n\t\t\t\tme.EndHoverText);\n\n\t\t\tif (i == (data.length - 2)) {\n\t\t\t\t// this is the last point\n\t\t\t\tvar category = isDate ? me.FormatDate(categories[i + 1], me.g_xAxis.dateFormat) : categories[i + 1];\n\n\t\t\t\tvar Circle = me.Circle(me.g_chartArea.reference, x2, y2, 0.75, me.g_chartArea.color[colorNumber], pointBorder);\n\n\t\t\t\tme.Event(Circle,\n\t\t\t\t\t\"mouseover\",\n\t\t\t\t\tme.HoverText,\n\t\t\t\t\tdata[i + 1] + ', ' + category);\n\n\t\t\t\tme.Event(Circle,\n\t\t\t\t\t\"mouseout\",\n\t\t\t\t\tme.EndHoverText);\n\t\t\t}\n\t\t}\n\n\t\treturn true;\n\t};\n\n\n\t// #### User Interfaces ####\n\n\n\tthis.DrawChart = function () {\n\t\tif (me.drawSeries == -1) {\n\t\t\tfor (var i = 1; i < this.g_data.length; i++) {\n\t\t\t\tDrawPoint(i);\n\t\t\t}\n\t\t}\n\t\telse DrawPoint(me.drawSeries);\n\t};\n}", "function drawYAxis() {\n // draw tick marks and labels\n var domain = y1Domain,\n styles = vis.__styles,\n ticks = vis.getYTicks(scales.y, c.h, extendRange, useLogScale);\n\n if (!extendRange && ticks[ticks.length-1] != domain[1]) ticks.push(domain[1]);\n\n if ($('body').hasClass('fullscreen')) {\n theme.horizontalGrid['stroke-width'] = 2;\n }\n\n _.each(ticks, function(val, t) {\n var y = scales.y(val), x = c.lpad;\n if (val >= domain[0] && val <= domain[1] || extendRange) {\n // c.paper.text(x, y, val).attr(styles.labels).attr({ 'text-anchor': 'end' });\n\n // axis label\n vis.label(x+2, y-10, formatter.y1(val, t == ticks.length-1), { align: 'left', cl: 'axis' });\n // axis ticks\n if (theme.yTicks) {\n vis.path([['M', c.lpad-25, y], ['L', c.lpad-20,y]], 'tick');\n }\n // grid line\n if (theme.horizontalGrid) {\n vis.path([['M', c.lpad, y], ['L', c.w - c.rpad,y]], 'grid')\n .attr(theme.horizontalGrid);\n }\n }\n });\n\n // draw axis line\n if (domain[0] <= 0 && domain[1] >= 0) {\n y = scales.y(0);\n vis.path([['M', c.lpad, y], ['L', c.w - c.rpad,y]], 'axis')\n .attr(theme.xAxis);\n }\n }", "function rawChart() {\r\n\tvar chart_title = \"VLMO\";\r\n\t$('#container').highcharts(\r\n\t\t\t{\r\n\t\t\t\tchart : {\r\n\t\t\t\t\tzoomType : 'xy'\r\n\t\t\t\t},\r\n\t\t\t\ttitle : {\r\n\t\t\t\t\ttext : chart_title\r\n\t\t\t\t},\r\n\t\t\t\tsubtitle : {\r\n\t\t\t\t\ttext : 'From ' + selectStartDate.format('yyyy-mm-dd')\r\n\t\t\t\t\t\t\t+ ' To ' + selectEndDate.format('yyyy-mm-dd')\r\n\t\t\t\t},\r\n\t\t\t\tcredits : {\r\n\t\t\t\t\thref : 'http://www.vervemobile.com',\r\n\t\t\t\t\ttext : 'vervemobile.com'\r\n\t\t\t\t},\r\n\t\t\t\txAxis : [ {\r\n\t\t\t\t\tcategories : categories,\r\n\t\t\t\t\t// tickmarkPlacement: 'on',\r\n\t\t\t\t\ttitle : {\r\n\t\t\t\t\t\tenabled : false\r\n\t\t\t\t\t},\r\n\t\t\t\t\t// gridLineWidth: 1,\r\n\t\t\t\t\tlabels : {\r\n\t\t\t\t\t\trotation : -45,\r\n\t\t\t\t\t\tformatter : function() {\r\n\t\t\t\t\t\t\tvar value = this.value;\r\n\t\t\t\t\t\t\tvar now = new Date(value);\r\n\t\t\t\t\t\t\treturn now.format(\"mmm dd\");\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t} ],\r\n\t\t\t\tyAxis : [ { // Primary\r\n\t\t\t\t\tlabels : {\r\n\t\t\t\t\t\tformatter : function() {\r\n\t\t\t\t\t\t\treturn accounting.formatNumber(this.value);\r\n\t\t\t\t\t\t},\r\n\t\t\t\t\t\tstyle : {\r\n\t\t\t\t\t\t\tcolor : '#01A9DB '\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t},\r\n\t\t\t\t\ttitle : {\r\n\t\t\t\t\t\ttext : 'Clicks',\r\n\t\t\t\t\t\tstyle : {\r\n\t\t\t\t\t\t\tcolor : '#01A9DB'\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t},\r\n\t\t\t\t\topposite : true\r\n\r\n\t\t\t\t}, { // Tertiary\r\n\t\t\t\t\tlabels : {\r\n\t\t\t\t\t\tformatter : function() {\r\n\t\t\t\t\t\t\treturn accounting.formatNumber(this.value);\r\n\t\t\t\t\t\t},\r\n\t\t\t\t\t\tstyle : {\r\n\t\t\t\t\t\t\tcolor : '#DBA901'\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t},\r\n\t\t\t\t\ttitle : {\r\n\t\t\t\t\t\ttext : 'Impressions',\r\n\t\t\t\t\t\tstyle : {\r\n\t\t\t\t\t\t\tcolor : '#DBA901'\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t\t\r\n\t\t\t\t} ],\r\n\t\t\t\ttooltip : {\r\n\t\t\t\t\tshared : true,\r\n\t\t\t\t\tformatter : function() {\r\n\t\t\t\t\t\tvar date_Value = new Date(this.x);\r\n\t\t\t\t\t\tvar s = '<b>' + date_Value.format('mmm d, yyyy')\r\n\t\t\t\t\t\t\t\t+ '</b>';\r\n\t\t\t\t\t\t$.each(this.points, function(i, point) {\r\n\t\t\t\t\t\t\tif (point.series.name == 'Impressions') {\r\n\t\t\t\t\t\t\t\ts += '<br/><font style=\"color: #DBA901;\">'\r\n\t\t\t\t\t\t\t\t\t\t+ point.series.name + ': '\r\n\t\t\t\t\t\t\t\t\t\t+ accounting.formatNumber(point.y)\r\n\t\t\t\t\t\t\t\t\t\t+ '</font>';\r\n\t\t\t\t\t\t\t} else if (point.series.name == 'Clicks') {\r\n\t\t\t\t\t\t\t\ts += '<br/><font style=\"color: #01A9DB;\">'\r\n\t\t\t\t\t\t\t\t\t\t+ point.series.name + ': '\r\n\t\t\t\t\t\t\t\t\t\t+ accounting.formatNumber(point.y)\r\n\t\t\t\t\t\t\t\t\t\t+ '</font>';\r\n\t\t\t\t\t\t\t} else if (point.series.name == 'Cta any') {\r\n\t\t\t\t\t\t\t\ts += '<br/><font style=\"color: #80FF00;\">'\r\n\t\t\t\t\t\t\t\t\t\t+ point.series.name + ': '\r\n\t\t\t\t\t\t\t\t\t\t+ accounting.formatNumber(point.y)\r\n\t\t\t\t\t\t\t\t\t\t+ '</font>';\r\n\t\t\t\t\t\t\t} else {\r\n\t\t\t\t\t\t\t\ts += '<br/>' + point.series.name + ': '\r\n\t\t\t\t\t\t\t\t\t\t+ accounting.formatMoney(point.y);\r\n\t\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\t});\r\n\t\t\t\t\t\treturn s;\r\n\t\t\t\t\t}\r\n\t\t\t\t},\r\n\t\t\t\tlegend : {\r\n\t\t\t\t\t// layout: 'vertical',\r\n\t\t\t\t\t// align: 'left',\r\n\t\t\t\t\t// x: 100,\r\n\t\t\t\t\t// verticalAlign: 'top',\r\n\t\t\t\t\t// y: 0,\r\n\t\t\t\t\t// floating: true,\r\n\t\t\t\t\tbackgroundColor : '#FFFFFF'\r\n\t\t\t\t},\r\n\t\t\t\tseries : [ {\r\n\t\t\t\t\tname : 'Clicks',\r\n\t\t\t\t\tcolor : '#01A9DB',\r\n\t\t\t\t\ttype : 'areaspline',\r\n\t\t\t\t\tyAxis : 1,\r\n\t\t\t\t\tdata : secondData\r\n\t\t\t\t}, {\r\n\t\t\t\t\tname : 'Impressions',\r\n\t\t\t\t\tcolor : '#DBA901',\r\n\t\t\t\t\ttype : 'column',\t\t\t\t\t\r\n\t\t\t\t\tdata : firstData\r\n\t\t\t\t} ]\r\n\t\t\t});\r\n\tchart = $('#container').highcharts();\r\n}", "function formatAxis() {\n var zeroTick, zeroTickLabel;\n // remove boldness from default axis path\n _.root.selectAll('path')\n .attr({\n 'fill': 'none'\n });\n\n // update fonts\n _.root.selectAll('text')\n .attr({\n 'stroke': 'none',\n 'fill': _.config.color\n });\n\n //Apply padding to the first tick on Y axis\n if (_.config.axisType === 'y') {\n zeroTick = _.root.select('g');\n\n if (zeroTick.node()) {\n zeroTickLabel = zeroTick.text() +\n (_.config.unit ? ' ' + _.config.unit : '');\n zeroTick.select('text').text(zeroTickLabel);\n setZeroTickTranslate(zeroTick);\n }\n }\n\n // apply text background for greater readability.\n _.root.selectAll('.gl-axis text').each(function() {\n\n var textBg = this.cloneNode(true);\n d3.select(textBg).attr({\n stroke: _.config.textBgColor,\n 'stroke-width': _.config.textBgSize\n });\n this.parentNode.insertBefore(textBg, this);\n });\n\n // remove axis line\n _.root.selectAll('.domain')\n .attr({\n 'stroke': 'none'\n });\n }", "function resetAxis(axis, originAxis) {\n axis.min = originAxis.min;\n axis.max = originAxis.max;\n}", "function resetAxis(axis, originAxis) {\n axis.min = originAxis.min;\n axis.max = originAxis.max;\n}", "function resetAxis(axis, originAxis) {\n axis.min = originAxis.min;\n axis.max = originAxis.max;\n}", "function resetAxis(axis, originAxis) {\n axis.min = originAxis.min;\n axis.max = originAxis.max;\n}", "draw_axes () {\n let canvas = this.layers.get(CONST.CHART_LAYER_AXES);\n\n // Draw axes\n let ctx = canvas.getContext('2d');\n ctx.clearRect(0, 0, canvas.width, canvas.height);\n\n ctx.strokeStyle = CONST.WHITE;\n ctx.lineWidth = 3;\n\n ctx.beginPath();\n ctx.moveTo(0, canvas.height-this.chart_padding_x_axis);\n ctx.lineTo(canvas.width - this.chart_padding_y_axis, canvas.height-this.chart_padding_x_axis);\n ctx.lineTo(canvas.width - this.chart_padding_y_axis, 0);\n ctx.stroke();\n\n this.draw_axes_labels();\n }", "_validateMinMax(validatedProperty, initialValidation, oldValue) {\n const that = this;\n\n let validateMin = validatedProperty === 'min' || validatedProperty === 'both',\n validateMax = validatedProperty === 'max' || validatedProperty === 'both';\n\n if (typeof (initialValidation) === undefined) {\n initialValidation = false;\n }\n\n if (validatedProperty === 'both') {\n validator('min', oldValue);\n validator('max', oldValue);\n }\n else {\n validator(validatedProperty, oldValue);\n }\n\n function validator(param, oldValue) {\n that._numericProcessor.validateMinMax(param === 'min' || initialValidation, param === 'max' || initialValidation);\n const value = that['_' + param + 'Object'];\n let validateCondition = param === 'min' ? that._numericProcessor.compare(that.max, value, true) <= 0 :\n that._numericProcessor.compare(that.min, value, true) > 0;\n\n if (validateCondition) {\n if (oldValue) {\n that._numberRenderer = new JQX.Utilities.NumberRenderer(oldValue);\n param === 'min' ? validateMin = false : validateMax = false;\n that[param] = oldValue;\n that['_' + param + 'Object'] = oldValue;\n }\n else {\n that.error(that.localize('invalidMinOrMax', { elementType: that.nodeName.toLowerCase(), property: param }));\n }\n }\n else {\n that._numberRenderer = new JQX.Utilities.NumberRenderer(value);\n that[param] = that['_' + param + 'Object'];\n }\n }\n\n if (that.logarithmicScale) {\n that._validateOnLogarithmicScale(validateMin, validateMax, oldValue);\n }\n else {\n that._drawMin = that.min;\n that._drawMax = that.max;\n }\n\n that.min = that.min.toString();\n that.max = that.max.toString();\n\n that._minObject = that._numericProcessor.createDescriptor(that.min);\n that._maxObject = that._numericProcessor.createDescriptor(that.max);\n\n if (that.mode === 'date') {\n that._minDate = JQX.Utilities.DateTime.fromFullTimeStamp(that.min);\n that._maxDate = JQX.Utilities.DateTime.fromFullTimeStamp(that.max);\n }\n\n //Validates the Interval\n that._numericProcessor.validateInterval(that.interval);\n\n if (that.customInterval) {\n that._numericProcessor.validateCustomTicks();\n }\n }", "niceScale(yMin, yMax, diff, index = 0, ticks = 10) {\n const w = this.w\n const NO_MIN_MAX_PROVIDED =\n (this.w.config.yaxis[index].max === undefined &&\n this.w.config.yaxis[index].min === undefined) ||\n this.w.config.yaxis[index].forceNiceScale\n if (\n (yMin === Number.MIN_VALUE && yMax === 0) ||\n (!Utils.isNumber(yMin) && !Utils.isNumber(yMax)) ||\n (yMin === Number.MIN_VALUE && yMax === -Number.MAX_VALUE)\n ) {\n // when all values are 0\n yMin = 0\n yMax = ticks\n let linearScale = this.linearScale(yMin, yMax, ticks)\n return linearScale\n }\n\n if (yMin > yMax) {\n // if somehow due to some wrong config, user sent max less than min,\n // adjust the min/max again\n console.warn('yaxis.min cannot be greater than yaxis.max')\n yMax = yMin + 0.1\n } else if (yMin === yMax) {\n // If yMin and yMax are identical, then\n // adjust the yMin and yMax values to actually\n // make a graph. Also avoids division by zero errors.\n yMin = yMin === 0 ? 0 : yMin - 0.5 // some small value\n yMax = yMax === 0 ? 2 : yMax + 0.5 // some small value\n }\n\n // Calculate Min amd Max graphical labels and graph\n // increments. The number of ticks defaults to\n // 10 which is the SUGGESTED value. Any tick value\n // entered is used as a suggested value which is\n // adjusted to be a 'pretty' value.\n //\n // Output will be an array of the Y axis values that\n // encompass the Y values.\n let result = []\n\n // Determine Range\n let range = Math.abs(yMax - yMin)\n\n if (\n range < 1 &&\n NO_MIN_MAX_PROVIDED &&\n (w.config.chart.type === 'candlestick' ||\n w.config.series[index].type === 'candlestick' ||\n w.globals.isRangeData)\n ) {\n /* fix https://github.com/apexcharts/apexcharts.js/issues/430 */\n yMax = yMax * 1.01\n }\n\n let tiks = ticks + 1\n // Adjust ticks if needed\n if (tiks < 2) {\n tiks = 2\n } else if (tiks > 2) {\n tiks -= 2\n }\n\n // Get raw step value\n let tempStep = range / tiks\n // Calculate pretty step value\n\n let mag = Math.floor(Utils.log10(tempStep))\n let magPow = Math.pow(10, mag)\n let magMsd = parseInt(tempStep / magPow)\n let stepSize = magMsd * magPow\n\n // build Y label array.\n // Lower and upper bounds calculations\n let lb = stepSize * Math.floor(yMin / stepSize)\n let ub = stepSize * Math.ceil(yMax / stepSize)\n // Build array\n let val = lb\n\n if (NO_MIN_MAX_PROVIDED && diff > 6) {\n while (1) {\n result.push(val)\n val += stepSize\n if (val > ub) {\n break\n }\n }\n\n return {\n result,\n niceMin: result[0],\n niceMax: result[result.length - 1]\n }\n } else {\n result = []\n let v = yMin\n result.push(v)\n let valuesDivider = Math.abs(yMax - yMin) / ticks\n for (let i = 0; i <= ticks; i++) {\n v = v + valuesDivider\n result.push(v)\n }\n\n if (result[result.length - 2] >= yMax) {\n result.pop()\n }\n\n return {\n result,\n niceMin: result[0],\n niceMax: result[result.length - 1]\n }\n }\n }", "constructor(config) {\n // Constants\n this.MIN_Y_AXIS_RANGE = 1;\n this.ZOOM_Y_PERCENTAGE = 0.1; // Zoom 10% of Y axis\n this.MOVE_Y_PERCENTAGE = 0.2; // Move 20% of Y axis\n this.UPDATE_Y_USE_ALL_DATA = true; // update y axis using all the data or just the incoming\n this.Y_PADDING = 0.05; // 5% of air up and down when updating the axis\n\n // Assure that the config object is correct\n if(!this._validateConstructorParams(config)) return;\n\n this.data = null;\n this.isReady = false;\n\n this.legendContainer = config.legendContainer;\n this.secondsIndicator = config.secondsIndicator;\n this.yMin = config.yMin;\n this.yMax = config.yMax;\n this.yMinHome = config.yMin;\n this.yMaxHome = config.yMax;\n\n this._initEmptyTimeChart(config.container, config.width, config.height, config.xTicks, config.yTicks);\n this._initAxisDeltas(config.dxZoom);\n this._initEmptyLegend();\n this._initEmptyTitle();\n this._addEventsXAxis(config.xZoomBtn[0], config.xZoomBtn[1]);\n this._addEventsYAxis(config.yZoomBtn, config.yMoveBtn, config.yHomeBtn);\n this._updateXAxis(config.secondsInScreen);\n\n this.htmlIds = {\n yAutoUpdate: config.yAutoUpdate,\n };\n\n // Select recalculateYAxisFunction\n this.recalculateYAxisFunction = (this.UPDATE_Y_USE_ALL_DATA) ?\n this._recalculateYAxisFull : this._recalculateYAxisIncoming;\n // NOTE: assigning functions like this is dangerous without bind,\n // although in this case should work\n }", "function axis_attribute_change(self){\n if($(self).hasClass('x-gene-attribute-select')){\n x_attribute_change(self);\n } else if($(self).hasClass('y-gene-attribute-select')){\n y_attribute_change(self);\n }\n }", "function axisBeforePadding() {\n var _this = this;\n var axisLength = this.len,\n chart = this.chart,\n isXAxis = this.isXAxis,\n dataKey = isXAxis ? 'xData' : 'yData',\n min = this.min,\n range = this.max - min;\n var pxMin = 0,\n pxMax = axisLength,\n transA = axisLength / range,\n hasActiveSeries;\n // Handle padding on the second pass, or on redraw\n this.series.forEach(function (series) {\n if (series.bubblePadding &&\n (series.visible || !chart.options.chart.ignoreHiddenSeries)) {\n // Correction for #1673\n _this.allowZoomOutside = true;\n hasActiveSeries = true;\n var data = series[dataKey];\n if (isXAxis) {\n (series.onPoint || series).getRadii(0, 0, series);\n if (series.onPoint) {\n series.radii = series.onPoint.radii;\n }\n }\n if (range > 0) {\n var i = data.length;\n while (i--) {\n if (isNumber(data[i]) &&\n _this.dataMin <= data[i] &&\n data[i] <= _this.max) {\n var radius = series.radii && series.radii[i] || 0;\n pxMin = Math.min(((data[i] - min) * transA) - radius, pxMin);\n pxMax = Math.max(((data[i] - min) * transA) + radius, pxMax);\n }\n }\n }\n }\n });\n // Apply the padding to the min and max properties\n if (hasActiveSeries && range > 0 && !this.logarithmic) {\n pxMax -= axisLength;\n transA *= (axisLength +\n Math.max(0, pxMin) - // #8901\n Math.min(pxMax, axisLength)) / axisLength;\n [\n ['min', 'userMin', pxMin],\n ['max', 'userMax', pxMax]\n ].forEach(function (keys) {\n if (typeof pick(_this.options[keys[0]], _this[keys[1]]) === 'undefined') {\n _this[keys[0]] += keys[2] / transA;\n }\n });\n }\n }", "function calculateScales(keepAxis) {\n //get min and max values\n maxTaskLength = d3.max(diagram.data, function (d) { return d[currentSerie.sourceField].toString().length; });\n tasks = e.getUniqueValues(diagram.data, currentSerie.sourceField);\n groups = e.getUniqueValues(diagram.data, currentSerie.groupField);\n\n //set domain info\n timeDomainStart = d3.min(diagram.data, function (d) { return new Date(d[startDateField]); });\n timeDomainEnd = d3.max(diagram.data, function (d) { return new Date(d[endDateField]); });\n dateDiff = timeDomainEnd.diff(timeDomainStart);\n\n //set axis formatting via date diff\n if (dateDiff > 365) {\n //set axis formatting\n axisFormatting = d3.utcFormat('%e-%b-%Y');\n } else {\n if (dateDiff < 1) {\n //set axis formatting\n axisFormatting = d3.utcFormat('%X');\n } else {\n //set axis formatting\n axisFormatting = d3.utcFormat('%b-%e');\n }\n }\n\n //calculate margins\n autoMargin = ((diagram.yAxis.labelFontSize / 2) * (maxTaskLength + 1)) + diagram.yAxis.labelFontSize;\n margin.left = diagram.margin.left + autoMargin;\n margin.right = diagram.margin.right;\n margin.top = diagram.margin.top;\n margin.bottom = diagram.margin.bottom;\n\n //set dimension\n width = diagram.plot.width - diagram.plot.left - diagram.plot.right - margin.left - margin.right;\n height = diagram.plot.height - diagram.plot.top - diagram.plot.bottom - margin.top - margin.bottom;\n\n //caclulate tick count\n maxAxisLength = axisFormatting(timeDomainEnd).length;\n singleAxisWidth = (((diagram.xAxis.labelFontSize / 2) * (maxAxisLength)) + diagram.xAxis.labelFontSize);\n autoTickCount = Math.floor(width / singleAxisWidth);\n\n //create scales\n xScale = d3.scaleUtc().domain([timeDomainStart, timeDomainEnd]).range([0, width]).clamp(true);\n yScale = d3.scaleBand().domain(tasks).range([height - margin.top - margin.bottom, 0]).padding(0.1);\n\n //create axes\n xAxis = d3.axisBottom().scale(xScale).ticks(autoTickCount / 2).tickFormat(axisFormatting);\n yAxis = d3.axisLeft().scale(yScale).tickSize(0);\n\n if (currentSerie.labelFontSize === 'auto')\n currentSerie.labelFontSize = 11;\n }", "getXScale(width) {\n let domainValues = _.map(this.props.data, (d) => d[this.props.x]);\n let sortedVals = _.sortBy(domainValues, [(d) => {\n let rank = this.props.xRank[d];\n return (rank) ? rank : 8;\n \n }]);\n\n return scaleBand()\n .padding(this.props.padding)\n .domain(sortedVals)\n .range([this.props.margins.left, width - this.props.margins.left]);\n }", "function objectBuildAxisX(colorGrid, colorTick) {\n var axisX = {\n gridColor : colorGrid,\n tickColor : colorTick,\n labelFormatter : function(e) {\n return e.value;\n },\n margin : 20,\n interlacedColor : \"#E1FCFF\"\n };\n return axisX;\n}" ]
[ "0.6456995", "0.64222115", "0.64139944", "0.6311109", "0.62709725", "0.62081957", "0.60227144", "0.59888047", "0.5952998", "0.592759", "0.59203583", "0.58894354", "0.5867283", "0.5856101", "0.580715", "0.5805064", "0.5797678", "0.57902026", "0.57778424", "0.5771716", "0.57472956", "0.57457954", "0.57226694", "0.5714124", "0.57015246", "0.5694004", "0.56926525", "0.5658473", "0.56522", "0.5642823", "0.56213397", "0.5605622", "0.560466", "0.56007284", "0.559681", "0.5577563", "0.5545552", "0.5542944", "0.5541432", "0.5527665", "0.5498711", "0.54937637", "0.5484266", "0.54807955", "0.54771096", "0.546965", "0.5467219", "0.5421156", "0.54195446", "0.539098", "0.5390805", "0.5390703", "0.5383924", "0.5381139", "0.5374413", "0.53736824", "0.53713065", "0.5345948", "0.534148", "0.534148", "0.534148", "0.534148", "0.5340589", "0.53264946", "0.53232414", "0.53121686", "0.5310726", "0.5266824", "0.5260838", "0.52492744", "0.5247334", "0.52464", "0.52411896", "0.52331465", "0.5223024", "0.52144563", "0.52127993", "0.520862", "0.52067715", "0.51901865", "0.51901865", "0.51901865", "0.51901865", "0.51786715", "0.5176384", "0.516708", "0.51642376", "0.5153927", "0.5153683", "0.515244", "0.51443934", "0.5141978" ]
0.6458842
5
Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file distributed with this work for additional information regarding copyright ownership. The ASF licenses this file to you under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. Parse and decode geo json
function decode(json) { if (!json.UTF8Encoding) { return json; } var encodeScale = json.UTF8Scale; if (encodeScale == null) { encodeScale = 1024; } var features = json.features; for (var f = 0; f < features.length; f++) { var feature = features[f]; var geometry = feature.geometry; var coordinates = geometry.coordinates; var encodeOffsets = geometry.encodeOffsets; for (var c = 0; c < coordinates.length; c++) { var coordinate = coordinates[c]; if (geometry.type === 'Polygon') { coordinates[c] = decodePolygon(coordinate, encodeOffsets[c], encodeScale); } else if (geometry.type === 'MultiPolygon') { for (var c2 = 0; c2 < coordinate.length; c2++) { var polygon = coordinate[c2]; coordinate[c2] = decodePolygon(polygon, encodeOffsets[c][c2], encodeScale); } } } } // Has been decoded json.UTF8Encoding = false; return json; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getGeoJson() {\n return {\n \"type\": \"FeatureCollection\",\n \"features\": [\n {\n \"type\": \"Feature\",\n \"properties\": {},\n \"geometry\": {\n \"type\": \"LineString\",\n \"coordinates\": [\n [\n 13.25441561846926,\n 38.162839676288336\n ],\n [\n 13.269521819641135,\n 38.150961340209484\n ],\n [\n 13.250982390930197,\n 38.150961340209484\n ],\n ]\n }\n },\n {\n \"type\": \"Feature\",\n \"properties\": {},\n \"geometry\": {\n \"type\": \"Polygon\",\n \"coordinates\": [\n [\n [\n 13.250982390930197,\n 38.150961340209484\n ],\n [\n 13.269521819641135,\n 38.150961340209484\n ],\n [\n 13.25441561846926,\n 38.162839676288336\n ],\n [\n 13.24342929034426,\n 38.150691355539586\n ]\n ]\n ]\n }\n },\n {\n \"type\": \"Feature\",\n \"properties\": {},\n \"geometry\": {\n \"type\": \"Polygon\",\n \"coordinates\": [\n [\n [\n 13.277074920227072,\n 38.18335224460118\n\n ],\n [\n 13.30660067706301,\n 38.18389197106355\n\n ],\n [\n 13.278104888488791,\n 38.165808957979515\n\n ]\n ]\n ]\n }\n },\n {\n \"type\": \"Feature\",\n \"properties\": {},\n \"geometry\": {\n \"type\": \"Polygon\",\n \"coordinates\": [\n [\n [\n 13.309476005126974,\n 38.13233005362,\n ],\n [\n\n 13.337628470947287,\n 38.135030534863766\n ],\n [\n 13.31805907397463,\n 38.11153300139878\n ]\n ]\n ]\n }\n }\n ]\n }\n}", "function parseJson(entry){\n\t\t\t\t\t\t\t\t\t\t\tvar polygon=entry[\"cap:polygon\"],\n\t\t\t\t\t\t\t\t\t\t\t\tfeature=null;\n\n\t\t\t\t\t\t\t\t\t\t\t//polygon exists\n\t\t\t\t\t\t\t\t\t\t\tif(polygon&&polygon!=\"\"&&!(polygon instanceof Object)){\n\t\t\t\t\t\t\t\t\t\t\t\tpolygon=polygon.split(\" \");\n\t\t\t\t\t\t\t\t\t\t\t\tvar coordinates=[polygon.map(function(coords){coords=coords.split(\",\"); return [parseFloat(coords[1]), parseFloat(coords[0])]})];\n\n\t\t\t\t\t\t\t\t\t\t\t\tfeature={\n\t\t\t\t\t\t\t\t\t\t\t\t\ttype:\"Feature\",\n\t\t\t\t\t\t\t\t\t\t\t\t\tgeometry:{\n\t\t\t\t\t\t\t\t\t\t\t\t\t\ttype:\"Polygon\",\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tcoordinates: coordinates\n\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\tproperties:(function(){\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tvar out={}, feed=json.feed;\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tfor(var k in feed){\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tif(k!='entry'){out[k]=feed[k]}\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tfor(var k in entry){\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tout['entry-'+k]=entry[k]\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t\t\treturn out\n\t\t\t\t\t\t\t\t\t\t\t\t\t})()\n\t\t\t\t\t\t\t\t\t\t\t\t};\n\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\treturn feature\n\t\t\t\t\t\t\t\t\t\t}", "static get_geo( json, bin, m_names=null ){\n\t\t\treturn this.load_geo( json, bin, m_names );\n\t\t}", "function geoParse(config){\n var geoData = geoJSON.parse(combinedData, {Point: ['lat', 'long']});\n // console.log(\"geoParse\");\n // console.log(geoData);\n // geoData.sort(sortByNAME);\n geoWrite(config, geoData); //----------------------- next function\n}", "function parseJSONP(data) {\n\t\t//we call the function to turn it into geoJSON and write a callback to add it to the geojson object\n\t\ttoGeoJSON(data,\n\t\t\tfunction(georesponse) {\n\t\t\t\tif (georesponse.features.length > 0) {\n\t\t\t\t\tvar selected = new L.geoJson(georesponse);\n\t\t\t\t\tvar selectedbounds = selected.getBounds();\n\t\t\t\t\tmap.fitBounds(selectedbounds);\n\t\t\t\t}\n\t\t\t}\n\t\t);\n\t}", "function getGeolocation() {\n // console.log(this.responseText);\n var data = JSON.parse(this.responseText);\n var results = data.results;\n results.forEach(function (element) {\n console.log(element.geometry.location);\n var ubication = {\n lat: element.geometry.location.lat,\n lng: element.geometry.location.lng\n };\n });\n }", "function parseGeoserverJson(response) {\n function parseId(idStr) {\n return idStr.match(/\\d*$/)[0] // ex: \"layergroup.24\" -> \"24\"\n }\n\n var features = Ext.util.JSON.decode(response.responseText).features\n return _(features).map(function(feature) {\n return _(feature.properties).defaults({\n id : parseId(feature.id)\n })\n })\n }", "decodeResponse(encoded, precision, srsOrigin) {\n\n let len = encoded.length,\n index = 0,\n lat = 0,\n lng = 0,\n array = [];\n\n precision = Math.pow(10, -precision);\n\n while (index < len) {\n let b, shift = 0,\n result = 0;\n do {\n b = encoded.charCodeAt(index++) - 63;\n result |= (b & 0x1f) << shift;\n shift += 5;\n } while (b >= 0x20);\n var dlat = ((result & 1) ? ~(result >> 1) : (result >> 1));\n lat += dlat;\n shift = 0;\n result = 0;\n do {\n b = encoded.charCodeAt(index++) - 63;\n result |= (b & 0x1f) << shift;\n shift += 5;\n } while (b >= 0x20);\n let dlng = ((result & 1) ? ~(result >> 1) : (result >> 1));\n lng += dlng;\n // array.push( {lat: lat * precision, lng: lng * precision}\n // );\n array.push([lat * precision, lng * precision]);\n }\n //return array;\n let arrayProjectionOrigin = [];\n\n for (let a = 0; a < array.length; a = a + 1) {\n\n //Tenemos que cambiar posición de x e y\n let point = new ol.geom.Point(ol.proj.transform([array[a][1], array[a][0]], 'EPSG:4326', srsOrigin));\n let arrayAux = [point.getCoordinates()[0], point.getCoordinates()[1]];\n arrayProjectionOrigin.push(arrayAux);\n }\n return arrayProjectionOrigin;\n }", "function readJSONFromFile(){\n console.log(\"--> OPEN file\");\n fs.readFile('output.geojson', 'utf8', function (err, data) {\n if (err) throw err;\n console.log(data);\n obj = JSON.parse(data);\n console.log(obj.features[0].properties[\"Latest measurement\"]);\n });\n}", "static locationInfoFromJSON (inFilename) {\n let data = fs.readFileSync(inFilename, 'utf8')\n let tmpLocationInfo = JSON.parse(data)\n return tmpLocationInfo\n }", "function convertJson() {\n\tvar jsonstring = document.getElementById(\"geojson\").textContent;\n\tif (jsonstring == '') {\n\t\tjsonstring = document.getElementById(\"geojson_uf\").textContent;\n\t}\n\ttry {\n\t\tvar geojson = JSON.parse(jsonstring);\n\t\t// check for full GeoJSON (if copied directly from http://geojson.io/)\n\t\tif (geojson[\"type\"] == \"FeatureCollection\" && geojson[\"features\"] != undefined) {\n\t\t\t// geojson is formatted correctly already\n\t\t\t// so we don't need to do anything\n\t\t} else if (geojson[\"type\"] == \"Feature\" && geojson[\"geometry\"] != undefined) {\n\t\t\tgeojson = {\n\t\t\t\t\"type\": \"FeatureCollection\",\n\t\t\t\t\"features\": [\n\t\t\t\t\tgeojson\n\t\t\t\t]\n\t\t\t}\n\t\t} else if (geojson[\"type\"] == \"Polygon\" && geojson[\"coordinates\"] != undefined) {\n\t\t\tgeojson = {\n\t\t\t\t\"type\": \"FeatureCollection\",\n\t\t\t\t\"features\": [{\n\t\t\t\t\t\"type\": \"Feature\",\n\t\t\t\t\t\"properties\": {},\n\t\t\t\t\t\"geometry\": geojson\n\t\t\t\t}]\n\t\t\t}\n\t\t} else {\n\t\t\talert(\"Warning: GeoJSON is not formatted correctly.\")\n\t\t}\n\t\t// check switch toggle for input coordinate system\n\t\t// and convert if necessary\n\t\tif (document.getElementById('EPSG4326').checked != true) {\n\t\t\tgeojson = convertEPSG3857to4326(geojson);\n\t\t}\n\t\tgeoJsonToOutput(geojson);\n\t} catch(error) {\n\t\talert(\"Warning: GeoJSON is not formatted correctly. \\n\" + error);\n\t}\n}", "async function geoJSON(config) {\n let geoJSON = await d3.json(\"countries.geo.json\")\n let path = d3.geoPath(\n d3.geoMercator()\n .scale(180)\n .translate([config.center.x/1.5, config.center.y/1.5])\n )\n let dictFeatures = geoJSON.features.reduce((result, d) => {\n if (d.properties.name == \"United States of America\") {\n let maxLength = Math.max(...d.geometry.coordinates.map(d => d.length))\n d.geometry.coordinates = d.geometry.coordinates.filter(d => d.length == maxLength)\n result[\"United States\"] = d\n } else if (d.properties.name == \"South Korea\") {\n result[\"Korea\"] = d\n } else if (d.properties.name == \"Slovakia\") {\n result[\"Slovak Republic\"] = d\n } else {\n result[d.properties.name] = d\n }\n\n return result\n }, {})\n\n return {\n \"features\": dictFeatures,\n \"path\": path,\n \"centroids\": (() => {\n let centroidsDict = {}\n for (let arr of Object.entries(dictFeatures)) {\n let key = arr[0]\n let val = arr[1]\n let centroid = path.centroid(val)\n centroidsDict[key] = {\n \"x\": centroid[0],\n \"y\": centroid[1]\n }\n }\n return centroidsDict\n })()\n }\n}", "function parseObjects_native(reader, offset, cb) {\n var obj = JSON.parse(reader.toString());\n var arr = obj.features || obj.geometries || [obj];\n arr.forEach(o => cb(o));\n }", "getJsonFromServer() {\n fetch(`${servername}/getjson`)\n .then(res => res.json())\n .then(data=>{\n if(data != null) {\n for(let element of data) {\n if(element.jsonstring.df != null) {\n if(element.jsonstring.df.lob != null) {\n // Parse the json points to receive json data.\n let stringConverter = element.jsonstring.df.lob\n let floatStringArray = stringConverter.split(',')\n let latitude = parseFloat(floatStringArray[0])\n let longitude = parseFloat(floatStringArray[1])\n \n // Create a new feature on OpenLayers\n if(!this.doesFeatureExist(latitude, longitude)) {\n let longLat = fromLonLat([longitude, latitude])\n let newFeature = new Feature({\n geometry: new Point(longLat),\n information: element.jsonstring\n })\n this.vectorAlerts.addFeature(newFeature)\n }\n }\n else console.log('lob was null. JSON must be broken:', element)\n }\n else console.log(\"data.df was empty. Consider fixing json string?\", element)\n }\n console.log('Features were updated', this.vectorAlertLayer.getSource().getFeatures())\n }\n else console.log(\"data had returned null\")\n })\n }", "function convertGeoJsonCoordinates(coords)\n{\n\treturn new L.LatLng(-coords[1], coords[0], coords[2]);\n}", "function parseCoordinates(mapId) {\n var coordsField = $('#map-coords-field-' + mapId).val(); // read values from mak\n var coordsFormat = $('#map-coords-format-' + mapId).val();\n\n // Regex inspiration by: http://www.nearby.org.uk/tests/geotools2.js\n\n // It seems to be necessary to escape the values. Otherwise, the degree\n // symbol (°) is not recognized.\n var str = escape(coordsField);\n // However, we do need to replace the spaces again do prevent regex error.\n str = str.replace(/%20/g, ' ');\n\n var pattern, matches;\n var latsign, longsign, d1, m1, s1, d2, m2, s2;\n var latitude, longitude, latlong;\n\n if (coordsFormat === '1') {\n // 46° 57.1578 N 7° 26.1102 E\n pattern = /(\\d+)[%B0\\s]+(\\d+\\.\\d+)\\s*([NS])[%2C\\s]+(\\d+)[%B0\\s]+(\\d+\\.\\d+)\\s*([WE])/i;\n matches = str.match(pattern);\n if (matches) {\n latsign = (matches[3] === 'S') ? -1 : 1;\n longsign = (matches[6] === 'W') ? -1 : 1;\n d1 = parseFloat(matches[1]);\n m1 = parseFloat(matches[2]);\n d2 = parseFloat(matches[4]);\n m2 = parseFloat(matches[5]);\n latitude = latsign * (d1 + (m1 / 60.0));\n longitude = longsign * (d2 + (m2 / 60.0));\n latlong = [latitude, longitude];\n }\n } else if (coordsFormat === '2') {\n // 46° 57' 9.468\" N 7° 26' 6.612\" E\n pattern = /(\\d+)[%B0\\s]+(\\d+)[%27\\s]+(\\d+\\.\\d+)[%22\\s]+([NS])[%2C\\s]+(\\d+)[%B0\\s]+(\\d+)[%27\\s]+(\\d+\\.\\d+)[%22\\s]+([WE])/i;\n matches = str.match(pattern);\n if (matches) {\n latsign = (matches[4] === 'S') ? -1 : 1;\n longsign = (matches[8] === 'W') ? -1 : 1;\n d1 = parseFloat(matches[1]);\n m1 = parseFloat(matches[2]);\n s1 = parseFloat(matches[3]);\n d2 = parseFloat(matches[5]);\n m2 = parseFloat(matches[6]);\n s2 = parseFloat(matches[7]);\n latitude = latsign * (d1 + (m1 / 60.0) + (s1 / (60.0 * 60.0)));\n longitude = longsign * (d2 + (m2 / 60.0) + (s2 / (60.0 * 60.0)));\n latlong = [latitude, longitude];\n }\n } else if (coordsFormat === '3') {\n // N 46° 57.1578 E 7° 26.1102\n pattern = /([NS])\\s*(\\d+)[%B0\\s]+(\\d+\\.\\d+)[%2C\\s]+([WE])\\s*(\\d+)[%B0\\s]+(\\d+\\.\\d+)/i;\n matches = str.match(pattern);\n if (matches) {\n latsign = (matches[1] === 'S') ? -1 : 1;\n longsign = (matches[4] === 'W') ? -1 : 1;\n d1 = parseFloat(matches[2]);\n m1 = parseFloat(matches[3]);\n d2 = parseFloat(matches[5]);\n m2 = parseFloat(matches[6]);\n latitude = latsign * (d1 + (m1 / 60.0));\n longitude = longsign * (d2 + (m2 / 60.0));\n latlong = [latitude, longitude];\n }\n } else if (coordsFormat === '4') {\n // N 46° 57' 9.468\" E 7° 26' 6.612\"\n pattern = /([NS])\\s*(\\d+)[%B0\\s]+(\\d+)[%27\\s]+(\\d+\\.\\d+)[%22%2C\\s]+([WE])\\s*(\\d+)[%B0\\s]+(\\d+)[%27\\s]+(\\d+\\.\\d+)/i;\n matches = str.match(pattern);\n if (matches) {\n latsign = (matches[1] === 'S') ? -1 : 1;\n longsign = (matches[5] === 'W') ? -1 : 1;\n d1 = parseFloat(matches[2]);\n m1 = parseFloat(matches[3]);\n s1 = parseFloat(matches[4]);\n d2 = parseFloat(matches[6]);\n m2 = parseFloat(matches[7]);\n s2 = parseFloat(matches[8]);\n latitude = latsign * (d1 + (m1 / 60.0) + (s1 / (60.0 * 60.0)));\n longitude = longsign * (d2 + (m2 / 60.0) + (s2 / (60.0 * 60.0)));\n latlong = [latitude, longitude];\n }\n } else if (coordsFormat === '5') {\n // 46.95263, 7.43517\n pattern = /(\\d+\\.\\d+)[%2C\\s]+(\\d+\\.\\d+)/i;\n matches = str.match(pattern);\n if (matches) {\n latlong = [matches[1], matches[2]];\n }\n }\n\n if (latlong != null) {\n var mapOptions = getMapOptionsById(mapId);\n zoomAddSearchMarker(mapOptions, L.latLng(latlong), true);\n showParseFeedback(mapId, 'Coordinates successfully parsed.', 'success');\n } else {\n showParseFeedback(mapId, tForInvalidFormat, 'error');\n }\n return false;\n}", "loadFromLocalFile (file) {\n let deferred = this.$q.defer();\n let ext = GeoUtils.getFileExtension(file.name);\n let reader = new FileReader();\n //\n if ((ext === 'kmz') || (ext === 'jpeg') || (ext === 'jpg')){\n reader.readAsArrayBuffer(file);\n } else {\n reader.readAsText(file);\n }\n reader.onload = () => {\n let p = null;\n switch (ext) {\n case 'kml':\n p = this._fromKml(reader.result);\n break;\n case 'json':\n p = this._fromJson(JSON.parse(reader.result));\n break;\n case 'geojson':\n p = this._fromJson(JSON.parse(reader.result));\n break;\n case 'kmz':\n p = this._fromKmz(reader.result);\n break;\n case 'gpx':\n p = this._fromGpx(reader.result);\n break;\n case 'jpeg':\n p = this._fromImage(reader, file.name);\n break;\n case 'jpg':\n p = this._fromImage(reader, file.name);\n break;\n case 'dsmap':\n p = this._fromDsmap(JSON.parse(reader.result));\n break;\n default:\n p = this._fromJson(JSON.parse(reader.result));\n }\n p.then( (data)=> { return deferred.resolve(data);});\n // deffered.resolve(p)\n };\n return deferred.promise;\n }", "function GeoJSONReader(reader) {\n\n // Read objects synchronously, with callback\n this.readObjects = function(onObject) {\n // Search first x bytes of file for features|geometries key\n // 300 bytes not enough... GeoJSON files can have additional non-standard properties, e.g. 'metadata'\n // var bytesToSearch = 300;\n var bytesToSearch = 5000;\n var start = reader.findString('\"features\"', bytesToSearch) ||\n reader.findString('\"geometries\"', bytesToSearch);\n // Assume single Feature or geometry if collection not found\n // (this works for ndjson files too)\n var offset = start ? start.offset : 0;\n T$1.start();\n parseObjects(reader, offset, onObject);\n // parseObjects_native(reader, offset, onObject);\n debug('Parse GeoJSON', T$1.stop());\n };\n }", "function refreshDataFromGeoJson() {\n var newData = new google.maps.Data({\n map: map,\n style: map.data.getStyle(),\n controls: ['Point', 'LineString', 'Polygon']\n });\n try {\n var userObject = JSON.parse(geoJsonInput.value);\n var newFeatures = newData.addGeoJson(userObject);\n } catch (error) {\n newData.setMap(null);\n if (geoJsonInput.value !== \"\") {\n setGeoJsonValidity(false);\n } else {\n setGeoJsonValidity(true);\n }\n return;\n }\n // No error means GeoJSON was valid!\n map.data.setMap(null);\n map.data = newData;\n bindDataLayerListeners(newData);\n setGeoJsonValidity(true);\n}", "function ConvertirGeometriaAJson(CadenaGeometria) {\n var ArregloPuntosGeometrias = [];\n if (CadenaGeometria.indexOf('GEOMETRYCOLLECTION') != -1) {\n CadenaGeometria = CadenaGeometria.replace(\"GEOMETRYCOLLECTION (\", '');\n CadenaGeometria = CadenaGeometria.split(')))').join('))');\n var poligonos = CadenaGeometria.split('),');\n\n CadenaGeometria = '';\n for (var i = 0; i < poligonos.length; i++) {\n var CadenaResultado = poligonos[i] + \")\";\n if (poligonos[i].indexOf(\"MULTIPOLYGON\") != -1) {\n CadenaResultado = CadenaResultado.replace(\" MULTIPOLYGON ((\", 'MULTIPOLYGON ((');\n CadenaResultado = CadenaResultado.replace(\"MULTIPOLYGON ((\", '');\n CadenaResultado = CadenaResultado.split(\", \").join(',');\n CadenaResultado = CadenaResultado.split(\"), \").join(\"@\");\n CadenaResultado = CadenaResultado.split(\"(\").join('');\n CadenaResultado = CadenaResultado.split(\")\").join('');\n CadenaResultado = CadenaResultado.split(' ').join('');\n if (i < (poligonos.length - 1)) {\n CadenaGeometria += CadenaResultado + \"@\";\n }\n else {\n CadenaGeometria += CadenaResultado;\n }\n }\n else if (poligonos[i].indexOf(\"POLYGON\") != -1) {\n CadenaResultado = CadenaResultado.replace(' POLYGON', 'POLYGON');\n CadenaResultado = CadenaResultado.replace(\"POLYGON (\", '');\n CadenaResultado = CadenaResultado.split(\", \").join(',');\n CadenaResultado = CadenaResultado.split(\"(\").join('');\n CadenaResultado = CadenaResultado.split(\")\").join('');\n if (i < (poligonos.length - 1)) {\n CadenaGeometria += CadenaResultado + \"@\";\n }\n else {\n CadenaGeometria += CadenaResultado;\n }\n }\n }\n }\n else if (CadenaGeometria.indexOf('MULTIPOLYGON') != -1) {\n CadenaGeometria = CadenaGeometria.replace(\" MULTIPOLYGON ((\", 'MULTIPOLYGON ((');\n CadenaGeometria = CadenaGeometria.replace(\"MULTIPOLYGON ((\", '');\n CadenaGeometria = CadenaGeometria.split(\", \").join(',');\n CadenaGeometria = CadenaGeometria.split(\"), \").join(\"@\");\n CadenaGeometria = CadenaGeometria.split(\"(\").join('');\n CadenaGeometria = CadenaGeometria.split(\")\").join('');\n CadenaGeometria = CadenaGeometria.split(' ').join('');\n }\n else if (CadenaGeometria.indexOf('POLYGON') != -1) {\n CadenaGeometria = CadenaGeometria.replace(' POLYGON', 'POLYGON');\n CadenaGeometria = CadenaGeometria.replace(\"POLYGON (\", '');\n CadenaGeometria = CadenaGeometria.split(\", \").join(',');\n CadenaGeometria = CadenaGeometria.split(\"(\").join('');\n CadenaGeometria = CadenaGeometria.split(\")\").join('');\n }\n else if (CadenaGeometria.indexOf('POINT') != -1) {\n\n CadenaGeometria = CadenaGeometria.split(\"POINT (\").join('');\n CadenaGeometria = CadenaGeometria.split(\")\").join('');\n }\n else if (CadenaGeometria.indexOf('LINESTRING') != -1) {\n CadenaGeometria = CadenaGeometria.split(\"LINESTRING (\").join('');\n CadenaGeometria = CadenaGeometria.split(\", \").join(',');\n CadenaGeometria = CadenaGeometria.split(\")\").join('');\n }\n var Geometrias = CadenaGeometria.split('@');\n for (var i = 0; i < Geometrias.length; i++) {\n var arregloPuntos = [];\n var puntos = Geometrias[i].split(',');\n for (var j = 0; j < puntos.length; j++) {\n var cadenaPunto = puntos[j].split(' ');\n arregloPuntos.push({ x: cadenaPunto[0], y: cadenaPunto[1] });\n }\n ArregloPuntosGeometrias.push(arregloPuntos);\n }\n\n return ArregloPuntosGeometrias;\n\n}", "function GeoJSON(config) {\n Resource.call(this, config);\n this._geojson = null;\n}", "function deserialize() {\n var features = formats['in'][informaType].read(element);\n if(features) {\n\t\t\t\tmap.addLayer(vectorLayer);\n vectorLayer.addFeatures(features);\n } else {\n\t\t alert('Bad Input my friend, revisa tu geometria');\n }\n }", "function CKtoGeoJSON(CKjson){\n //Create an empty GeoJSON object to be filled with data and returned\n var geoJson={\n type: \"Feature\",\n geometry: {},\n properties:{}\n };\n \n //If the CKobject is already a valid GeoJSON object, simply use it.\n if(isValidGeoJson(CKjson)==true){\n geoJson = CKjson;\n }\n //if the CK object has a shape or geometry field, use this as the geometry of the GeoJSON object\n else if(CKjson.shape || CKjson.geometry){\n geoJson.geometry = CKjson.shape||CKjson.geometry;\n //All fields not in shape/geometry go into the properties of the GeoJSON object\n for(property in CKjson){\n if(Object.prototype.hasOwnProperty.call(CKjson, property)){\n if(property != \"shape\" && property != \"geometry\"){\n geoJson.properties[property]=CKjson[property];\n }\n }\n }\n }\n //If there is no shape but there is data, look through data for Lat/Long fields.\n else if(CKjson.data){\n geoJson.geometry[\"type\"]=\"Point\";\n geoJson.geometry[\"coordinates\"] = findLonLat(CKjson.data);\n //Then add all fields to properties\n for(property in CKjson){\n if(Object.prototype.hasOwnProperty.call(CKjson, property)){\n if(property != \"shape\" && property != \"geometry\"){\n geoJson.properties[property]=CKjson[property];\n }\n }\n }\n }\n //If there is no shape and no data, look through the object for Lat/Long fields.\n else{\n geoJson.geometry[\"type\"]=\"Point\";\n geoJson.geometry[\"coordinates\"] = findLonLat(CKjson);\n //Then add all fields to properties\n for(property in CKjson){\n if(Object.prototype.hasOwnProperty.call(CKjson, property)){\n if(property != \"shape\" && property != \"geometry\"){\n geoJson.properties[property]=CKjson[property];\n }\n }\n }\n }\n \n //attach visibility flags which are used by the filter to show/hide specific layers\n geoJson.visible = true;\n geoJson.visible_changed = false;\n \n return geoJson;\n}", "function getGeoData() {\n\n //determine if the handset has client side geo location capabilities\n if(geo_position_js.init()){\n\tgeo_position_js.getCurrentPosition(\n\t\t\t\t\t function(data){\n\t\t\t\t\t \n\t\t\t\t\t LATITUDE = data.coords.latitude;\n\t\t\t\t\t LONGITUDE = data.coords.longitude;\n\n\t\t\t\t\t },\n\n\t\t\t\t\t function(data){\n\t\t\t\t\t alert('could not retrieve geo data');\n\t\t\t\t\t }\n\t\t\t\t\t );\n }\n else{\n\talert(\"Functionality not available\");\n }\n\n\n\n}", "function convertBigQuery() {\n\tvar bqstring = document.getElementById(\"bigquery\").textContent;\n\t// get rid of the unimportant BigQuery syntax parts\n\tbqstring = bqstring.replace('POLYGON','').replace('((','').replace('))','');\n\tvar points = bqstring.split(',');\n\tvar coords = [];\n\tfor (var i=0; i < points.length; i++) {\n\t\tvar pair = points[i];\n\t\t// trim any trailing whitespace\n\t\tpair = pair.trim();\n\t\t// separate lon and lat via regexp\n\t\t// split on one (or more) space characters\n\t\tpair = pair.split(/\\s+/);\n\t\tconsole.log()\n\t\tvar lon = parseFloat(pair[0]);\n\t\tvar lat = parseFloat(pair[1]);\n\t\tconsole.log(lon, lat)\n\t\tcoords.push([lon,lat]);\n\t}\n\tvar geojson = {\n\t\t\"type\": \"FeatureCollection\",\n\t\t\"features\": [\n\t\t {\n\t\t\t\t\"type\": \"Feature\",\n\t\t\t\t\"properties\": {},\n\t\t\t\t\"geometry\": {\n\t\t\t\t\t\"type\": \"Polygon\",\n\t\t\t\t\t\"coordinates\": [ coords ]\n\t\t\t\t}\n\t\t }\n\t\t]\n\t};\n\tgeoJsonToOutput(geojson);\n}", "function GeometryParser() {}", "function geojson_callback(geojson_text) {\n features = JSON.parse(geojson_text);\n if(layer) layer.remove();\n layer = L.geoJSON(null,options).addTo(map);\n layer.addData(features);\n}", "function ufoToGeoJson(ufo) {\n return {\n type: 'Feature',\n geometry: {\n type: 'Point',\n coordinates: [\n ufo.fields.location.lon,\n ufo.fields.location.lat\n ]\n },\n properties: {\n title: ufo.fields.locationName,\n ufo: ufo\n }\n };\n}", "function decodeGeoFirestoreObject(geoFirestoreObj) {\r\n if (validateGeoFirestoreObject(geoFirestoreObj, true)) {\r\n return geoFirestoreObj.d;\r\n }\r\n else {\r\n throw new Error('Unexpected location object encountered: ' + JSON.stringify(geoFirestoreObj));\r\n }\r\n}", "function parseGeoLoc(s) {\n var pts = new String(s).split(\",\");\n return new google.maps.LatLng(parseFloat(pts[0]), parseFloat(pts[1]));\n}", "parseGeoLocation(position){\n window.FranklyAdsGeoLocation = {};\n window.FranklyAdsGeoLocation.latitude = position.coords.latitude;\n window.FranklyAdsGeoLocation.longitude = position.coords.longitude;\n FranklyAdsGeoLocation.retrieved = true;\n console.log(\"FranklyAds.parseGeoLocation \", window.FranklyAdsGeoLocation.latitude, window.FranklyAdsGeoLocation.longitude);\n return position;\n }", "function getJSON(input) {\n if (typeof input === 'string') {\n var re = /^[\\+\\-]?[0-9\\.]+,[ ]*\\ ?[\\+\\-]?[0-9\\.]+$/; // lat,lng\n if (input.match(re)) {\n input = '[' + input + ']';\n }\n return JSON.parse(jsonize(input));\n }\n else {\n return input;\n }\n}", "function getData(userLocation) {\n userLocation = userLocation !== \"\" ? userLocation : \"Philadelphia, PA\";\n const endPointURL = `https://api.mapbox.com/geocoding/v5/mapbox.places/${userLocation}.json`;\n const params = {\n limit: 1,\n fuzzyMatch: true,\n bbox:\n \"-76.23327974765701, 39.290566999999996, -74.389708, 40.608579999999996\",\n access_token: MAPBOX_API_KEY,\n };\n let badRequest = false;\n\n const queryString = formatQueryParams(params);\n const url = endPointURL + \"?\" + queryString;\n\n fetch(url)\n .then((response) => {\n if (response.status >= 200 && response.status < 400) {\n return response.json();\n }\n return {features: [] }\n })\n .then((data) => {\n let lat, lng;\n // If the Mapbox geolocation does not find a location, then provide a default (Philadelphia)\n if (data.features.length === 0) {\n lat = 40.010854;\n lng = -75.126666;\n badRequest=true;\n } else {\n lat = data.features[0].center[1];\n lng = data.features[0].center[0]; \n }\n // Retrieve Census FIPS codes for the given coordinates\n\n return fetch(\n `https://tigerweb.geo.census.gov/arcgis/rest/services/TIGERweb/tigerWMS_ACS2019/Mapserver/8/query?geometry=${lng},${lat}&geometryType=esriGeometryPoint&inSR=4269&spatialRel=esriSpatialRelIntersects&returnGeometry=false&f=pjson&outFields=STATE,COUNTY,TRACT`\n )\n .then((response) => {\n if (response.ok) {\n return response.json();\n } else {\n throw new Error(response.statusText);\n }\n })\n .then((responseJson) => {\n const fipsCodes = responseJson.features[0].attributes;\n let geoTags = {\n lat,\n lng,\n fipsCodes,\n stateGeoid: fipsCodes[\"STATE\"],\n countyGeoid: fipsCodes[\"COUNTY\"],\n tractGeoid: fipsCodes[\"TRACT\"],\n combinedGeoid:\n fipsCodes[\"STATE\"] + fipsCodes[\"COUNTY\"] + fipsCodes[\"TRACT\"],\n };\n return geoTags;\n });\n })\n .then((geoTags) => {\n const acsVars = [\n \"DP05_0001E\",\n \"DP03_0027PE\",\n \"DP03_0028PE\",\n \"DP03_0029PE\",\n \"DP03_0030PE\",\n \"DP03_0031PE\",\n \"DP03_0033PE\",\n \"DP03_0034PE\",\n \"DP03_0035PE\",\n \"DP03_0036PE\",\n \"DP03_0037PE\",\n \"DP03_0038PE\",\n \"DP03_0039PE\",\n \"DP03_0040PE\",\n \"DP03_0041PE\",\n \"DP03_0042PE\",\n \"DP03_0043PE\",\n \"DP03_0044PE\",\n \"DP03_0045PE\",\n \"DP03_0062E\",\n \"DP04_0134E\",\n \"DP04_0089E\",\n \"DP05_0018E\",\n \"DP05_0039PE\",\n \"DP05_0044PE\",\n \"DP05_0038PE\",\n \"DP05_0052PE\",\n \"DP05_0057PE\",\n \"DP05_0058PE\",\n \"DP05_0037PE\",\n \"DP03_0009PE\",\n \"DP04_0005E\",\n ];\n\n const countyAcsArgs = {\n sourcePath: [\"acs\", \"acs5\", \"profile\"],\n vintage: 2019,\n values: acsVars,\n geoHierarchy: {\n state: geoTags.stateGeoid,\n county: geoTags.countyGeoid,\n },\n geoResolution: \"20m\",\n statsKey: CENSUS_API_KEY,\n };\n\n const tractAcsArgs = {\n sourcePath: [\"acs\", \"acs5\", \"profile\"],\n vintage: 2019,\n values: acsVars,\n geoHierarchy: {\n state: geoTags.stateGeoid,\n county: geoTags.countyGeoid,\n tract: geoTags.tractGeoid,\n },\n geoResolution: \"500k\",\n statsKey: CENSUS_API_KEY,\n };\n\n const countyPepArgs = {\n sourcePath: [\"pep\", \"population\"],\n vintage: 2019,\n values: [\"DATE_CODE\", \"DATE_DESC\", \"POP\"],\n geoHierarchy: {\n state: geoTags.stateGeoid,\n county: geoTags.countyGeoid,\n },\n statsKey: CENSUS_API_KEY,\n };\n\n function censusGeoids() {\n return new Promise((resolve, reject) => {\n resolve(geoTags);\n });\n }\n\n function countyAcs(args = countyAcsArgs) {\n return new Promise((resolve, reject) => {\n census(args, (err, json) => {\n if (!err) {\n resolve(json);\n } else {\n reject(err);\n }\n });\n });\n }\n\n function countyPep(args = countyPepArgs) {\n return new Promise((resolve, reject) => {\n census(args, (err, json) => {\n if (!err) {\n resolve(json);\n } else {\n reject(err);\n }\n });\n });\n }\n\n function ctAcsPromise(args = tractAcsArgs) {\n return new Promise((resolve, reject) => {\n census(args, (err, json) => {\n if (!err) {\n resolve(json);\n } else {\n reject(err);\n }\n });\n });\n }\n\n Promise.all([countyAcs(), censusGeoids(), ctAcsPromise(), countyPep()])\n .then((values) => {\n const msaLocations = {\n states: [\"10\", \"24\", \"34\", \"42\"],\n counties: [\n \"003\",\n \"005\",\n \"007\",\n \"015\",\n \"017\",\n \"029\",\n \"033\",\n \"045\",\n \"091\",\n \"101\",\n ],\n };\n const { states, counties } = msaLocations;\n const isInMSA =\n states.includes(values[1].fipsCodes[\"STATE\"]) &&\n counties.includes(values[1].fipsCodes[\"COUNTY\"]);\n\n // If the request falls outside of MSA\n let searchLocation = `${values[1].lng},${values[1].lat}`;\n\n // Check if searched location is in MSA; if not replace with default\n // location / stats; set badRequest to true\n if (!isInMSA) {\n values[0] = defaultCounty;\n values[2] = defaultTract;\n searchLocation = `-75.126666,40.010854`;\n badRequest = true;\n }\n\n const statistics = {\n msa: phillyMSAGeoJson.features[0].properties,\n county: values[0].features[0].properties,\n countyPep: values[3],\n tract: values[2].features[0].properties,\n };\n\n SearchService.getProperties(knex(req), searchLocation).then(\n (properties) => {\n const allProperties = properties.rows;\n\n return res.json({\n badRequest,\n apiStatistics: transformStats(statistics),\n properties: allProperties,\n msa: phillyMSAGeoJson,\n county: values[0],\n tract: values[2],\n });\n }\n );\n })\n .catch((error) => {\n throw new Error(error);\n });\n })\n .catch((error) => {\n logger.error(error);\n console.error(error);\n });\n }", "function addGeoJSON() {\r\n $.ajax({\r\n url: \"https://potdrive.herokuapp.com/api/map_mobile_data\",\r\n type: \"GET\",\r\n success: function(data) {\r\n window.locations_data = data\r\n console.log(data)\r\n //create markers from data\r\n addMarkers();\r\n //redraw markers whenever map moves\r\n map.on(plugin.google.maps.event.MAP_DRAG_END, addMarkers);\r\n setTimeout(function(){\r\n map.setAllGesturesEnabled(true);\r\n $.mobile.loading('hide');\r\n }, 300);\r\n },\r\n error: function(e) {\r\n console.log(e)\r\n alert('Request for locations failed.')\r\n }\r\n }) \r\n }", "function refreshDataFromGeoJson() {\n deselectLastFeature();\n\n var newData = new google.maps.Data({\n map: map,\n style: map.data.getStyle(),\n controls: ['Point', 'LineString', 'Polygon']\n });\n try {\n var userObject = JSON.parse(geoJsonInput.value);\n var newFeatures = newData.addGeoJson(userObject);\n } catch (error) {\n newData.setMap(null);\n if (geoJsonInput.value !== \"\") {\n setGeoJsonValidity(false);\n } else {\n setGeoJsonValidity(true);\n }\n return;\n }\n // No error means GeoJSON was valid!\n map.data.setMap(null);\n map.data = newData;\n\n bindDataLayerListeners(newData);\n setGeoJsonValidity(true);\n\n setTimeout(fitMapToAllFeatures, 17);\n\n}", "function parseGoogleGeocodes(response) {\n // the result has a results property that is an array\n // there may be more than one result when the address is ambiguous\n // for pragmatic reasons, only use the first result\n // if the result does not have a zip code, then assume the user\n // did not provide a valid address\n\n var result = response.results[0]\n , zipComponent = findAddressComponent(result.address_components, 'postal_code')\n , simple = {}\n ;\n\n simple.zip5 = zipComponent ? zipComponent.short_name : null;\n simple.address = result.formatted_address.replace(/,\\s*USA/, '');\n simple.localAddress = getLocalAddress(result) || simple.address;\n simple.location = result.geometry.location;\n return simple;\n}", "function jsonTransform() {\n\tconsole.log(\"in json function\");\n\t$.getJSON(\"ajax/WagPregeo.json\",function(data) {\n\t\t$.each(data,function(key, val) {\t\n\t\t\taddressArray.push({id: val.id, name: val.name,addresseng: val.addresseng, addresscn: val.addresscn});\n\t\t});\n\t\tinitializeGeo();\t\n\t});\n}", "static async getGeoData() {\n try {\n const response = await fetch(`https://api.openweathermap.org/data/2.5/weather?q=${city}&appid=${APIKey}`);\n const data = await response.json();\n return (data.coord);\n } catch(err) {\n alert(err);\n }\n }", "function GeoJSONWrapper (features) {\n\t this.features = features\n\t this.length = features.length\n\t}", "function GeoJSONWrapper (features) {\n\t this.features = features\n\t this.length = features.length\n\t}", "static parseJSON(jstr) {\nif (typeof lggr.trace === \"function\") {\nlggr.trace(`JSON.parse for \\\"${jstr}\\\"`);\n}\nif ((jstr != null) && jstr.length > 0) {\nreturn JSON.parse(jstr);\n} else {\nlggr.warn(`JSON.parse failed for \\\"${jstr}\\\"`);\nreturn null;\n}\n}", "function fetchGeoData(){\n $.ajax({\n dataType: \"json\",\n url: \"data/map.geojson\",\n success: function(data) {\n $(data.features).each(function(key, data) {\n geoDataLocations.push(data);\n });\n startMap();\n },\n error: function(error){\n console.log(error);\n return error;\n }\n });\n }", "function isValidGeoJson(jsonObj){\n if(jsonObj.type){\n if(jsonObj.type==\"FeatureCollection\"){\n if(jsonObj.hasOwnProperty(\"features\")){\n for(var i=0;i<jsonObj.features.length;i++){\n if(!isValidGeoJson(jsonObj.features[i])){\n return false;\n }\n }\n return true;\n }\n }\n else if(jsonObj.type == \"Feature\"){\n if(jsonObj.hasOwnProperty(\"geometry\")&&jsonObj.hasOwnProperty(\"properties\")){\n if(!isValidGeoJsonGeometry(jsonObj.geometry)){\n return false;\n }\n return true;\n }\n }\n else{\n return isValidGeoJsonGeometry(jsonObj)\n }\n }\n return false;\n}", "function Geography(user) {\n return $http.get('http://prod1.groupz.in:7000/Authenticator?request=' + JSON.stringify(user)).then(handleSuccess, handleError('Error Login'));\n }", "function getGEO(input){\n // grab 2018 cencus data\n d3.json(`/sqlsearch/${input}`).then(function(data){\n\n var info2 = data\n // get lat and lon out of Json and then group for Weather api\n globalLat = info2.lat[0]\n globalLon = info2.lng[0]\n var both = globalLat+\",\"+ globalLon\n // send to weather api\n getWeather(both)\n })\n}", "function GeoCallback ( in_geocode_response\t///< The JSON object.\n\t\t\t\t\t\t\t)\n\t{\n\t\tif ( in_geocode_response && in_geocode_response[0] && in_geocode_response[0].geometry && in_geocode_response[0].geometry.location )\n\t\t\t{\n\t\t\tWhereAmI_CallBack ( {'coords':{'latitude':in_geocode_response[0].geometry.location.lat(),'longitude':in_geocode_response[0].geometry.location.lng()}} );\n\t\t\t}\n\t\telse\n\t\t\t{\n\t\t\talert ( c_g_address_lookup_fail );\n\t\t\twindow.history.back();\n\t\t\t};\n\t}", "function simplifyGeojson(geo, n){\n\n}", "function GeoJSONWrapper (features) {\n this.features = features\n this.length = features.length\n}", "function GeoJSONWrapper (features) {\n this.features = features\n this.length = features.length\n}", "function Location(jsonObject){\n this.formatted_query = jsonObject[0].display_name;\n this.latitude = jsonObject[0].lat;\n this.longitude = jsonObject[0].lon;\n\n}", "processGeocodeData(results, status) {\n let first = 0;\n if (status === \"OK\") {\n const location = results[first].geometry.location;\n let position = {\n 'lat': location.lat(),\n 'lng': location.lng(),\n }\n this.setNewPanorama(position);\n } else {\n console.error(\"GeoCoding information not found for this location.\");\n }\n }", "function retrieve_map_data(lat_lon_json) {\n let xmlhttprequest = new XMLHttpRequest();\n xmlhttprequest.open(\"GET\", '../cgi-bin/get_map_info.py?n_per_comuna=True');\n xmlhttprequest.timeout = 1000;\n xmlhttprequest.onload = async function () {\n let json_data = JSON.parse(\n JSON.parse(\n JSON.stringify(\n JSON.parse(xmlhttprequest.responseText)\n )\n ).replace(/'/g, '\"')\n );\n\n add_markers(json_data, lat_lon_json);\n }\n xmlhttprequest.onerror = function (pe) {\n console.log(\"FAILED to retrieve the data\");\n }\n xmlhttprequest.send(null);\n}", "getGC() {\n return this.$http.get(PATH + \"gc_polygon.topo.json\", {cache: true})\n .then(function(data, status) {\n return topojson.feature(data.data, data.data.objects['dc_polygon.geo']);\n });\n }", "function parseMetadata(d){\n\treturn {\n\t\tiso_a3: d.ISO_A3,\n\t\tiso_num: d.ISO_num,\n\t\tdeveloped_or_developing: d.developed_or_developing,\n\t\tregion: d.region,\n\t\tsubregion: d.subregion,\n\t\tname_formal: d.name_formal,\n\t\tname_display: d.name_display,\n\t\tlngLat: [+d.lng, +d.lat]\n\t}\n}", "function parseMetadata(d){\n\treturn {\n\t\tiso_a3: d.ISO_A3,\n\t\tiso_num: d.ISO_num,\n\t\tdeveloped_or_developing: d.developed_or_developing,\n\t\tregion: d.region,\n\t\tsubregion: d.subregion,\n\t\tname_formal: d.name_formal,\n\t\tname_display: d.name_display,\n\t\tlngLat: [+d.lng, +d.lat]\n\t}\n}", "function parseMetadata(d){\n\treturn {\n\t\tiso_a3: d.ISO_A3,\n\t\tiso_num: d.ISO_num,\n\t\tdeveloped_or_developing: d.developed_or_developing,\n\t\tregion: d.region,\n\t\tsubregion: d.subregion,\n\t\tname_formal: d.name_formal,\n\t\tname_display: d.name_display,\n\t\tlngLat: [+d.lng, +d.lat]\n\t}\n}", "function getLocation(json, url){\n \n var validTweets = json.filter(function (obj) {return obj.geo != null;});\n return validTweets.map(\n\tfunction(obj){ \n\t var coord = obj.geo.coordinates;\n\t return {url: \"https://maps.google.ca/maps?q=\" + coord[0] + \",\" + coord[1],\n\t\t user_id: obj.user.id,\n\t\t profile_image_url: obj.user.profile_image_url,\n\t\t screen_name: obj.user.screen_name};\n\t});\n\n}", "function jsonParsing(jsonData, jsonLegData) {\r\n completePolyline = [];\r\n legInfo = [];\r\n time = {\r\n walkingTime : jsonData.itineraries[0].walkTime,\r\n transitTime : jsonData.itineraries[0].transitTime,\r\n waitingTime : jsonData.itineraries[0].waitingTime,\r\n start : jsonData.itineraries[0].startTime,\r\n end : jsonData.itineraries[0].endTime,\r\n transfers : jsonData.itineraries[0].transfers,\r\n transitModes : getTransitModes(jsonLegData)\r\n };\r\n for (j=0; j < jsonLegData.length; j++) {\r\n legInfo.push({ currentLeg:j + 1,\r\n transitMode:jsonLegData[j].mode, \r\n legDuration : (jsonLegData[j].endTime - jsonLegData[j].startTime) / 1000,\r\n route : jsonLegData[j].route,\r\n routeName: jsonLegData[j].routeLongName,\r\n routeID : jsonLegData[j].routeId,\r\n routeColor : jsonLegData[j].routeColor,\r\n departurePlace : jsonLegData[j].from.name,\r\n departureTime : jsonLegData[j].from.departure,\r\n arrivalPlace : jsonLegData[j].to.name,\r\n arrivalTime : jsonLegData[j].to.arrival,\r\n legPolyline : decodeGeometry(jsonLegData[j].legGeometry.points)});\r\n completePolyline.push(decodeGeometry(jsonLegData[j].legGeometry.points));\r\n }\r\n return {time, completePolyline, legInfo};\r\n}", "function parseData(d){\n\n\treturn {\n\t\tlngLat: [+d.Lng,+d.Lat],\n\t\tprice: d.price,\n\t\tdistrict: d.district\n\t}\n}", "function GeoJSONWrapper(features) {\n this.features = features;\n this.length = features.length;\n this.extent = EXTENT;\n}", "function unpackJSON(feed, sortAttr){\n // Converts the USGS's geojson feed into an array of quake objects and optionally sorts them \n // based on the specified attribute name (if present)\n //\n // Each object in the list contains the following attributes:\n // longitude, latitude, depth, mag, place, time, updated, tz, url, \n // detail, felt, cdi, mmi, alert, status, tsunami, sig, net, code, \n // ids, sources, types, nst, dmin, rms, gap, magType, type,\n // \n // See the ComCat documentation page for details on what each attribute encodes:\n // https://earthquake.usgs.gov/data/comcat/data-eventterms.php\n // \n quakes = _.map(feed.features, item => {\n let [longitude, latitude, depth] = item.geometry.coordinates\n return _.extend({longitude, latitude, depth}, item.properties)\n })\n\n return sortAttr ? sortQuakes(quakes, sortAttr) : quakes\n}", "function init(){\n synchronizeMap();\n\n // Zoom in once\n if(count == 0){\n map.setLevel(15);\n count = 1;\n }\n\n AdvancedGeolocation.start(function(data){\n\n try{\n\n // Don't draw anything if graphics layer suspended\n if(!map.graphics.suspended){\n\n var jsonObject = JSON.parse(data);\n\n switch(jsonObject.provider){\n case \"gps\":\n if(jsonObject.latitude != \"0.0\"){\n addLocationData(\"GPS\", jsonObject);\n console.log(\"GPS location detected - lat:\" +\n jsonObject.latitude + \", lon: \" + jsonObject.longitude +\n \", accuracy: \" + jsonObject.accuracy);\n var point = new Point(jsonObject.longitude, jsonObject.latitude);\n map.centerAt(point);\n addGraphic( greenGPSSymbol, point);\n }\n break;\n\n case \"network\":\n if(jsonObject.latitude != \"0.0\"){\n addLocationData(\"Network\", jsonObject);\n console.log(\"Network location detected - lat:\" +\n jsonObject.latitude + \", lon: \" + jsonObject.longitude +\n \", accuracy: \" + jsonObject.accuracy);\n var point = new Point(jsonObject.longitude, jsonObject.latitude);\n map.centerAt(point);\n addGraphic( blueNetworkSymbol, point);\n }\n break;\n\n case \"satellite\":\n console.log(\"Satellites detected \" + (Object.keys(jsonObject).length - 1));\n console.log(\"Satellite meta-data: \" + data);\n addSatelliteData(jsonObject);\n break;\n\n case \"cell_info\":\n console.log(\"cell_info JSON: \" + data);\n break;\n\n case \"cell_location\":\n console.log(\"cell_location JSON: \" + data);\n break;\n\n case \"signal_strength\":\n console.log(\"Signal strength JSON: \" + data);\n break;\n }\n }\n }\n catch(exc){\n console.log(\"Invalid JSON: \" + exc);\n }\n },\n function(error){\n console.log(\"Error JSON: \" + JSON.stringify(error));\n var e = JSON.parse(error);\n console.log(\"Error no.: \" + e.error + \", Message: \" + e.msg + \", Provider: \" + e.provider);\n },\n /////////////////////////////////////////\n //\n // These are the required plugin options!\n // README has API details\n //\n /////////////////////////////////////////\n {\n \"minTime\":0,\n \"minDistance\":0,\n \"noWarn\":false,\n \"providers\":\"all\",\n \"useCache\":true,\n \"satelliteData\":true,\n \"buffer\":true,\n \"bufferSize\":10,\n \"signalStrength\":false\n });\n }", "function deserialize() {\n var element = document.getElementById('text');\n var type = document.getElementById(\"formatType\").value;\n var features = formats['in'][type].read(element.value);\n var bounds;\n if(features) {\n if(features.constructor != Array) {\n features = [features];\n }\n for(var i=0; i<features.length; ++i) {\n if (!bounds) {\n bounds = features[i].geometry.getBounds();\n } else {\n bounds.extend(features[i].geometry.getBounds());\n }\n\n }\n vectors.addFeatures(features);\n map.zoomToExtent(bounds);\n var plural = (features.length > 1) ? 's' : '';\n element.value = features.length + ' feature' + plural + ' aggiunte'\n } else {\n element.value = 'Nessun input ' + type;\n }\n}", "function topo2geo(topology, objectName) {\n // Decode first object/feature as default\n if (!objectName) {\n objectName = Object.keys(topology.objects)[0];\n }\n var object = topology.objects[objectName];\n // Already decoded => return cache\n if (object['hc-decoded-geojson']) {\n return object['hc-decoded-geojson'];\n }\n // Do the initial transform\n var arcsArray = topology.arcs;\n if (topology.transform) {\n var _a = topology.transform,\n scale_1 = _a.scale,\n translate_1 = _a.translate;\n arcsArray = topology.arcs.map(function (arc) {\n var x = 0,\n y = 0;\n return arc.map(function (position) {\n position = position.slice();\n position[0] = (x += position[0]) * scale_1[0] + translate_1[0];\n position[1] = (y += position[1]) * scale_1[1] + translate_1[1];\n return position;\n });\n });\n }\n // Recurse down any depth of multi-dimentional arrays of arcs and insert\n // the coordinates\n var arcsToCoordinates = function (arcs) {\n if (typeof arcs[0] === 'number') {\n return arcs.reduce(function (coordinates,\n arcNo,\n i) {\n var arc = arcNo < 0 ? arcsArray[~arcNo] : arcsArray[arcNo];\n // The first point of an arc is always identical to the last\n // point of the previes arc, so slice it off to save further\n // processing.\n if (arcNo < 0) {\n arc = arc.slice(0, i === 0 ? arc.length : arc.length - 1);\n arc.reverse();\n }\n else if (i) {\n arc = arc.slice(1);\n }\n return coordinates.concat(arc);\n }, []);\n }\n return arcs.map(arcsToCoordinates);\n };\n var features = object.geometries\n .map(function (geometry) { return ({\n type: 'Feature',\n properties: geometry.properties,\n geometry: {\n type: geometry.type,\n coordinates: geometry.coordinates ||\n arcsToCoordinates(geometry.arcs)\n }\n }); });\n var geojson = {\n type: 'FeatureCollection',\n copyright: topology.copyright,\n copyrightShort: topology.copyrightShort,\n copyrightUrl: topology.copyrightUrl,\n features: features,\n 'hc-recommended-mapview': object['hc-recommended-mapview'],\n bbox: topology.bbox,\n title: topology.title\n };\n object['hc-decoded-geojson'] = geojson;\n return geojson;\n }", "function getLngFromStr(geo) {\n\treturn geo.split(\",\")[1].replace(/\\)/, \"\").replace(/ /, \"\");\n}", "function reverseGeocode(coords) {\n const templateStr = `https://nominatim.openstreetmap.org/reverse?lat=${coords.lat}&lon=${coords.lon}&format=geojson`;\n //console.log(templateStr);\n return axios.get(templateStr)\n .then(res => res.data)\n .catch(err => { throw err; })\n}", "parse() {\n /**\n * The first two bytes are a bitmask which states which features are present in the mapFile\n * The second two bytes are.. something?\n */\n const featureFlags = this.take(2, \"featureFlags\").readUInt16LE(0);\n this.take(2, \"unknown01\");\n if (featureFlags & 0b000000000000001) {\n this.robotStatus = this.take(0x2C, \"robot status\");\n }\n\n\n if (featureFlags & 0b000000000000010) {\n this.mapHead = this.take(0x28, \"map head\");\n this.parseImg();\n }\n if (featureFlags & 0b000000000000100) {\n let head = asInts(this.take(12, \"history\"));\n this.history = [];\n for (let i = 0; i < head[2]; i++) {\n // Convert from ±meters to mm. UI assumes center is at 20m\n let position = this.readFloatPosition(this.buf, this.offset + 1);\n // first byte may be angle or whether robot is in taxi mode/cleaning\n //position.push(this.buf.readUInt8(this.offset)); //TODO\n this.history.push(position[0], position[1]);\n this.offset += 9;\n }\n }\n if (featureFlags & 0b000000000001000) {\n // TODO: Figure out charge station location from this.\n let chargeStation = this.take(16, \"charge station\");\n this.chargeStation = {\n position: this.readFloatPosition(chargeStation, 4),\n orientation: chargeStation.readFloatLE(12)\n };\n }\n if (featureFlags & 0b000000000010000) {\n let head = asInts(this.take(12, \"virtual wall\"));\n\n this.virtual_wall = [];\n this.no_go_area = [];\n\n let wall_num = head[2];\n\n for (let i = 0; i < wall_num; i++) {\n this.take(12, \"virtual wall prefix\");\n let body = asFloat(this.take(32, \"Virtual walls coords\"));\n\n if (body[0] === body[2] && body[1] === body[3] && body[4] === body[6] && body[5] === body[7]) {\n //is wall\n let x1 = Math.round(ViomiMapParser.convertFloat(body[0]));\n let y1 = Math.round(ViomiMapParser.MAX_MAP_HEIGHT - ViomiMapParser.convertFloat(body[1]));\n let x2 = Math.round(ViomiMapParser.convertFloat(body[4]));\n let y2 = Math.round(ViomiMapParser.MAX_MAP_HEIGHT - ViomiMapParser.convertFloat(body[5]));\n\n this.virtual_wall.push([x1, y1, x2, y2]);\n } else {\n //is zone\n let x1 = Math.round(ViomiMapParser.convertFloat(body[0]));\n let y1 = Math.round(ViomiMapParser.MAX_MAP_HEIGHT - ViomiMapParser.convertFloat(body[1]));\n let x2 = Math.round(ViomiMapParser.convertFloat(body[2]));\n let y2 = Math.round(ViomiMapParser.MAX_MAP_HEIGHT - ViomiMapParser.convertFloat(body[3]));\n let x3 = Math.round(ViomiMapParser.convertFloat(body[4]));\n let y3 = Math.round(ViomiMapParser.MAX_MAP_HEIGHT - ViomiMapParser.convertFloat(body[5]));\n let x4 = Math.round(ViomiMapParser.convertFloat(body[6]));\n let y4 = Math.round(ViomiMapParser.MAX_MAP_HEIGHT - ViomiMapParser.convertFloat(body[7]));\n\n this.no_go_area.push([x1, y1, x2, y2, x3, y3, x4, y4]);\n }\n\n this.take(48, \"unknown48\");\n }\n }\n if (featureFlags & 0b000000000100000) {\n let head = asInts(this.take(12, \"area head\"));\n let area_num = head[2];\n\n this.clean_area = [];\n\n for (let i = 0; i < area_num; i++) {\n this.take(12, \"area prefix\");\n let body = asFloat(this.take(32, \"area coords\"));\n\n let x1 = Math.round(ViomiMapParser.convertFloat(body[0]));\n let y1 = Math.round(ViomiMapParser.MAX_MAP_HEIGHT - ViomiMapParser.convertFloat(body[1]));\n let x2 = Math.round(ViomiMapParser.convertFloat(body[2]));\n let y2 = Math.round(ViomiMapParser.MAX_MAP_HEIGHT - ViomiMapParser.convertFloat(body[3]));\n let x3 = Math.round(ViomiMapParser.convertFloat(body[4]));\n let y3 = Math.round(ViomiMapParser.MAX_MAP_HEIGHT - ViomiMapParser.convertFloat(body[5]));\n let x4 = Math.round(ViomiMapParser.convertFloat(body[6]));\n let y4 = Math.round(ViomiMapParser.MAX_MAP_HEIGHT - ViomiMapParser.convertFloat(body[7]));\n\n this.clean_area.push([x1, y1, x2, y2, x3, y3, x4, y4]);\n\n this.take(48, \"unknown48\");\n }\n }\n if (featureFlags & 0b000000001000000) {\n let navigateTarget = this.take(20, \"navigate\");\n this.navigateTarget = {position: this.readFloatPosition(navigateTarget, 8)};\n }\n if (featureFlags & 0b000000010000000) {\n let realtimePose = this.take(21, \"realtime\");\n this.realtimePose = {position: this.readFloatPosition(realtimePose, 9)};\n }\n\n if (featureFlags & 0b000100000000000) {\n //v6 example: 5b590f5f00000001\n //v7 example: e35a185e00000001\n this.take(8, \"unknown8\");\n this.parseRooms();\n // more stuff i don't understand\n this.take(50, \"unknown50\");\n this.take(5, \"unknown5\");\n this.points = [];\n try {\n this.parsePose();\n } catch (e) {\n Logger.warn(\"Unable to parse Pose\", e); //TODO\n }\n }\n this.take(this.buf.length - this.offset, \"trailing\");\n\n // TODO: one of them is just the room outline, not actual past navigation logic\n return this.convertToValetudoMap({\n image: this.img,\n zones: this.rooms,\n //TODO: at least according to all my sample files, this.points is never the path\n //Why is this here?\n //path: {points: this.points.length ? this.points : this.history},\n path: {points: this.history},\n goto_target: this.navigateTarget && this.navigateTarget.position,\n robot: this.realtimePose && this.realtimePose.position,\n charger: this.chargeStation && this.chargeStation.position,\n virtual_wall: this.virtual_wall,\n no_go_area: this.no_go_area,\n clean_area: this.clean_area\n });\n }", "function Location(jsonObject){\n console.log(jsonObject);\n\n this.formatted_query = jsonObject[0].display_name;\n this.latitude = jsonObject[0].lat;\n this.longitude = jsonObject[0].lon;\n\n}", "function getMapData(data) {\n\n\tfor (var i = 0; i < data.length; i++) {\n loc[i] = data[i].loc;\n locX[i] = data[i].locx;\n locY[i] = data[i].locy;\n }\n\n//console.log(data[1]);\n}", "function zipToGeoJson(binZip,options) {\n\tvar manifestZip = xdmp.zipManifest(binZip);\n\tvar items = [];\n\tfor (prop in manifestZip) {\n\t items.push(manifestZip[prop])\n\t}\n\tvar projection = items.filter(function(item) {\n\t return item.path.match(/\\.prj/gi);\n\t}).map(function(item,index) {\n\t return xdmp.zipGet(binZip,item.path,{\"format\":\"text\"});\n\t})[0];\n\tvar objOut = {};\n\titems\n\t .filter(function(item) {\n\t return item.path.match(/\\.shp$/) || item.path.match(/\\.dbf/);\n\t })\n\t .map(function(item) {\n\t var builder = new NodeBuilder();\n\t var tbuilder = new NodeBuilder();\n\n\t //Build a binaryNode \n\t var entry = xdmp.zipGet(binZip,item.path,{\"format\":\"binary\"});\n\t for(e of entry) {\n\t builder.addNode(e);\n\t }\n\t var bin = builder.toNode();\n\t var path = item.path;\n\t var buffer = BinToBuffer(bin);\n\t //Iterate matched items and process file types\n\t switch(true) {\n\t case /\\.dbf$/gi.test(path) :\n\t type = \"dbf\"; \n\t //We need to extract dbf text before we parse dbf\n\t var text = Utf8ArrayToStr(buffer); \n\t objOut.dbf = DBFParser.parse(buffer.buffer,path,text,\"utf-8\");\n\t break;\n\t case /\\.shp$/gi.test(path) : \n\t objOut.shp = SHPParser.parse(buffer.buffer);\n\t break;\n\t default: throw(\"WHY:\" + path)\n\t }\n\t });\n\treturn toGeoJson(objOut);\n}", "convertFromGoogle(llobjs) {\n llobjs.forEach( function(llo) {\n if (typeof(llo.lat) != \"undefined\" && typeof(llo.lng) != \"undefined\") {\n llo.latitude = llo.lat();\n llo.longitude = llo.lng();\n }\n });\n }", "function convertToGeoJson(data) {\n var lat = data.coord.lat;\n var lon = data.coord.lon;\n var pm10Value = getPM10Value(pm10Measures,lat,lon);\n\n var pm10Index = getPM10Index(pm10Value);\n var windIndex = getWindIndex(data.wind.speed * 3.6);\n var grasslandIndex = getGrasslandIndex(lat, lon);\n var weatherIndex = getWeatherIndex(data.weather[0].id);\n\n //new season index\n var seasonIndex = getSeasonIndex();\n\n var score = pm10Index + windIndex + grasslandIndex + weatherIndex + seasonIndex;\n var riskRating = getRiskRating(score).rating;\n var feature = {\n type: \"Feature\",\n properties: {\n city: data.name,\n temp: data.main.temp,\n weather: data.weather[0].main,\n windSpeed: data.wind.speed * 3.6,\n pm10: pm10Value,\n riskScore: score,\n riskRating: riskRating,\n icon: mapMarkers[riskRating],\n coordinates: [lon, lat]\n },\n geometry: {\n type: \"Point\",\n coordinates: [lon, lat]\n }\n };\n // Set the custom marker icon\n map.data.setStyle(function(feature) {\n return {\n icon: {\n url: feature.getProperty('icon'),\n anchor: new google.maps.Point(25, 25),\n scaledSize: new google.maps.Size(30,30)\n }\n };\n });\n // returns object\n return feature;\n}", "function eqfeed_callback(data) {\n map.data.addGeoJson(data);\n }", "function parseGeometry(FBXTree, relationships, geoNode, deformers) {\n switch (geoNode.attrType) {\n case 'Mesh':\n return parseMeshGeometry(FBXTree, relationships, geoNode, deformers);\n //break;\n case 'NurbsCurve':\n return parseNurbsGeometry(geoNode);\n }\n}", "function createFeatures(UFOPlots) {\nconsole.log(\"-----------\");\nconsole.log(UFOPlots.features[20][\"geometry\"].properties.index);\ncurindx =UFOPlots.features[20][\"geometry\"].properties.index \nurlcall =\"/api_getUFOText_v1.1 <\" + curindx + \">\"\nconsole.log(getText(urlcall))\nconsole.log(UFOPlots.features[20][\"geometry\"].properties.Date_Time);\n console.log(UFOPlots.features[20][\"geometry\"].properties.Shape);\n console.log(UFOPlots.features[20][\"geometry\"].properties.Duration); \nconsole.log(UFOPlots.features[20][\"geometry\"].coordinates[0]);\nconsole.log(UFOPlots.features[20][\"geometry\"].coordinates[1]);\n\nlet plot = [];\nlet plot2 =[];\nvar test=[]; \n// let features = UFOPlots.features;\n// features.forEach(f => {\n// coords = f.geometry.coordinates;\n// plot.push([coords[1]['latitude'], coords[0]['longitude']])\n// });\n\n let features = UFOPlots[\"features\"];\n console.log(\"Point 20:\",features[20]['geometry'].coordinates[0] ,features[20]['geometry'].coordinates[1] );\nfor (let i = 0; i < UFOPlots[\"features\"].length; i++){\n let test = [features[i]['geometry'].coordinates[0] , features[i]['geometry'].coordinates[1]] \n let lng =features[i]['geometry'].coordinates[0]//['longitude']\n let lat =features[i]['geometry'].coordinates[1]//['latitude']\n plot.push([lng,lat])\n plot2.push([lat,lng])\n //plot.push(test);\n} \nconsole.log(\"here\");\n// console.log(plot);\n\nvar MiB2 = L.geoJson(plot,{\n pointToLayer: function (features, plot) {\n return L.circleMarker(plot, geojsonMarkerOptions_MiB)\n .bindPopup(\"<h3>\" + \"Base: \" + features.properties[2] +\n \"</h3><hr><p>\" + \"Military Branch: \" + features.properties[2] + \"<br>\" +\n \"State: \" + features.properties[2] + \"</p>\");\n }\n});\n // createMap(MiB,true);\n //if you used the heat map with the for loop above, this will work \nvar MiB2 = L.heatLayer(plot, {\n radius: 10,\n blur: 1\n}); \nconsole.log(\"here after\");\n// Sending our UFO layer to the createMap function\ncreateMap(MiB2,true);\n}", "addFeature(pid, json) {\n let self = this;\n let options = Object.assign({\n \"map\": \"default\",\n \"layer\": \"default\",\n \"values\": {}\n }, json);\n let map = self.maps[options.map].object;\n let layer = self.maps[options.map].layers[options.layer];\n let view = map.getView();\n let source = layer.getSource();\n console.log(layer);\n let projection = \"EPSG:\" + options.geometry.match(/SRID=(.*?);/)[1];\n let wkt = options.geometry.replace(/SRID=(.*?);/, '');\n let format = new ol_format_WKT__WEBPACK_IMPORTED_MODULE_10__[\"default\"]();\n let feature = format.readFeature(wkt);\n options.values.geometry = feature.getGeometry().transform(projection, view.getProjection().getCode());\n source.addFeature(new ol__WEBPACK_IMPORTED_MODULE_1__[\"Feature\"](options.values));\n self.finished(pid, self.queue.DEFINE.FIN_OK);\n }", "function d(r$1){return r$1.features.map((o=>{const t=k.fromJSON(r$1.spatialReference),s=n.fromJSON(o);return r(s.geometry)&&(s.geometry.spatialReference=t),s}))}", "function GeoJSONWrapper(features) {\n\t this.features = features;\n\t this.length = features.length;\n\t this.extent = EXTENT;\n\t}", "function GeoJSONWrapper(features) {\n\t this.features = features;\n\t this.length = features.length;\n\t this.extent = EXTENT;\n\t}", "function jsonResponse(feed) {\r\n\r\n if (feed && feed.value && feed.value.items && feed.value.items.length > 0) {\r\n\r\n // here we shall generate geo (or adr) uFormat\r\n\r\n var locationName = document.getElementById('insertGeoLocation').value;\r\n\r\n var geoUFormat = '';\r\n\r\n var lat = feed.value.items[0].lat;\r\n\r\n var lon = feed.value.items[0].lon;\r\n\r\n if (lat != null && lon != null) {\r\n\r\n insertAtCursor(\r\n\r\n document.getElementById('textarea'), \r\n\r\n createGeoMicroformat(locationName, lat, lon));\r\n\r\n }\r\n\r\n }\r\n\r\n $(WAIT_ELEM_ID).style.display = 'none';\r\n\r\n document.getElementsByTagName('body')[0].style.cursor = body_cursor_bak;\r\n\r\n insertGeoFormCancel();\r\n\r\n}", "function parseJson(json) {\n\t\t let obj = JSON.parse(json)\n\t\t return obj\n\t}", "function geojsonToVectorLayer(geojson, projection) {\n // textStyle is a function because each point has a different text associated\n function textStyle(text) {\n return new ol.style.Text({\n 'font': '12px Calibri,sans-serif',\n 'text': text,\n 'fill': new ol.style.Fill({\n 'color': '#000'\n }),\n 'stroke': new ol.style.Stroke({\n 'color': '#fff',\n 'width': 3\n })\n });\n }\n\n function textStylePoint(text, rotation) {\n return new ol.style.Text({\n 'font': '12px Calibri,sans-serif',\n 'text': ' ' + text, // we pad with spaces due to rotational offset\n 'textAlign': 'center',\n 'fill': new ol.style.Fill({\n 'color': '#000'\n }),\n 'stroke': new ol.style.Stroke({\n 'color': '#fff',\n 'width': 3\n })\n });\n }\n\n function getStrokeStyle(feature) {\n var color = '#663300';\n var width = 2;\n var lineDash = [1, 0];\n\n if (feature.get('trace')) {\n var trace = feature.get('trace');\n\n // Set line color and weight\n if (trace.trace_type && trace.trace_type === 'geologic_struc') {\n color = '#FF0000';\n if (trace.geologic_structure_type\n && (trace.geologic_structure_type === 'fault' || trace.geologic_structure_type === 'shear_zone')) {\n width = 4;\n }\n }\n else if (trace.trace_type && trace.trace_type === 'contact') {\n color = '#000000';\n if (trace.contact_type && trace.contact_type === 'intrusive'\n && trace.intrusive_contact_type && trace.intrusive_contact_type === 'dike') {\n width = 4;\n }\n }\n else if (trace.trace_type && trace.trace_type === 'geomorphic_fea') {\n width = 4;\n color = '#0000FF';\n }\n else if (trace.trace_type && trace.trace_type === 'anthropenic_fe') {\n width = 4;\n color = '#800080';\n }\n\n // Set line pattern\n lineDash = [.01, 10];\n if (trace.trace_quality && trace.trace_quality === 'known') lineDash = [1, 0];\n else if (trace.trace_quality && trace.trace_quality === 'approximate'\n || trace.trace_quality === 'questionable') lineDash = [20, 15];\n else if (trace.trace_quality && trace.trace_quality === 'other') lineDash = [20, 15, 0, 15];\n }\n\n return new ol.style.Stroke({\n 'color': color,\n 'width': width,\n 'lineDash': lineDash\n });\n }\n\n function getIconForFeature(feature) {\n var feature_type = 'none';\n var rotation = 0;\n var symbol_orientation = 0;\n var facing = undefined;\n var orientation_type = 'none';\n var orientation = feature.get('orientation');\n if (orientation) {\n rotation = orientation.strike || (orientation.dip_direction - 90) % 360 || orientation.trend || rotation;\n symbol_orientation = orientation.dip || orientation.plunge || symbol_orientation;\n feature_type = orientation.feature_type || feature_type;\n orientation_type = orientation.type || orientation_type;\n facing = orientation.facing;\n }\n\n return new ol.style.Icon({\n 'anchorXUnits': 'fraction',\n 'anchorYUnits': 'fraction',\n 'opacity': 1,\n 'rotation': HelpersFactory.toRadians(rotation),\n 'src': SymbologyFactory.getSymbolPath(feature_type, symbol_orientation, orientation_type, facing),\n 'scale': 0.05\n });\n }\n\n function getPolyFill(feature) {\n var color = 'rgba(0, 0, 255, 0.4)'; // blue\n var colorApplied = false;\n var tags = ProjectFactory.getTagsBySpotId(feature.get('id'));\n if (tags.length > 0) {\n _.each(tags, function (tag) {\n if (tag.type === 'geologic_unit' && tag.color && !_.isEmpty(tag.color) && !colorApplied) {\n var rgbColor = HelpersFactory.hexToRgb(tag.color);\n color = 'rgba(' + rgbColor.r + ', ' + rgbColor.g + ', ' + rgbColor.b + ', 0.4)';\n colorApplied = true;\n }\n });\n }\n if (feature.get('surface_feature') && !colorApplied) {\n var surfaceFeature = feature.get('surface_feature');\n switch (surfaceFeature.surface_feature_type) {\n case 'rock_unit':\n color = 'rgba(0, 255, 255, 0.4)'; // light blue\n break;\n case 'contiguous_outcrop':\n color = 'rgba(240, 128, 128, 0.4)'; // pink\n break;\n case 'geologic_structure':\n color = 'rgba(0, 255, 255, 0.4)'; // light blue\n break;\n case 'geomorphic_feature':\n color = 'rgba(0, 128, 0, 0.4)'; // green\n break;\n case 'anthropogenic_feature':\n color = 'rgba(128, 0, 128, 0.4)'; // purple\n break;\n case 'extent_of_mapping':\n color = 'rgba(128, 0, 128, 0)'; // no fill\n break;\n case 'extent_of_biological_marker': // green\n color = 'rgba(0, 128, 0, 0.4)';\n break;\n case 'subjected_to_similar_process':\n color = 'rgba(255, 165, 0,0.4)'; // orange\n break;\n case 'gradients':\n color = 'rgba(255, 165, 0,0.4)'; // orange\n break;\n }\n }\n return new ol.style.Fill({\n 'color': color\n });\n }\n\n // Set styles for points, lines and polygon and groups\n function styleFunction(feature, resolution) {\n var rotation = 0;\n var pointText = feature.get('name');\n var orientation = feature.get('orientation');\n if (orientation) {\n rotation = orientation.strike || orientation.trend || rotation;\n pointText = orientation.dip || orientation.plunge || pointText;\n }\n\n var pointStyle = [\n new ol.style.Style({\n 'image': getIconForFeature(feature),\n 'text': textStylePoint(pointText.toString(), rotation)\n })\n ];\n var lineStyle = [\n new ol.style.Style({\n 'stroke': getStrokeStyle(feature),\n 'text': textStyle(feature.get('name'))\n })\n ];\n var polyText = feature.get('name');\n var polyStyle = [\n new ol.style.Style({\n 'stroke': new ol.style.Stroke({\n 'color': '#000000',\n 'width': 0.5\n }),\n 'fill': getPolyFill(feature),\n 'text': textStyle(polyText)\n })\n ];\n var styles = [];\n styles.Point = pointStyle;\n styles.MultiPoint = pointStyle;\n styles.LineString = lineStyle;\n styles.MultiLineString = lineStyle;\n styles.Polygon = polyStyle;\n styles.MultiPolygon = polyStyle;\n\n return styles[feature.getGeometry().getType()];\n }\n\n var features;\n if (projection.getUnits() === 'pixels') {\n features = (new ol.format.GeoJSON()).readFeatures(geojson);\n }\n else {\n features = (new ol.format.GeoJSON()).readFeatures(geojson, {\n 'featureProjection': projection\n });\n }\n\n return new ol.layer.Vector({\n 'source': new ol.source.Vector({\n 'features': features\n }),\n 'title': geojson.properties.name,\n 'style': styleFunction,\n 'visible': typeVisibility[geojson.properties.name.split(' (')[0]]\n });\n }", "function callback(response) \n {\n \n // get boundaries\n console.log( response.results[0] );\n console.log( \"got \" + response.results[0].attributes.CTYUA13NM);\n //console.log( response.results[0].attributes.CTYUA13NM );\n /// console.log( response.results[0].attributes.CTYUA13NM+\": \" + parseInt( response.results[0].attributes[\"Shape.STArea()\"],10)/1000000 );\n //capture area\n areaMeasures[response.results[0].attributes.CTYUA13NM] = parseInt(response.results[0].attributes[\"Shape.STArea()\"],10)/1000000;\n\n areaObj[response.results[0].attributes.CTYUA13NM].area = parseInt(response.results[0].attributes[\"Shape.STArea()\"],10)/1000000;\n\n\n if (response.results.length > 0) \n {\n // document.getElementById(\"foundward\").value = response.results[0].attributes.WD11NM;\n\n var ens = new Array();\n //alert(response.results[0].geometry.rings.length);\n for (var k = 0; k < response.results[0].geometry.rings.length; k++) {\n ens[k] = response.results[0].geometry.rings[k];\n }\n\n // approximate datum correction, good enough for this demo\n \n var latmeters = 50;\n var lonmeters = -100;\n\n var minlat = 360.0;\n var maxlat = -360.0;\n var minlon = 360.0;\n var maxlon = -360.0;\n\n // create array of points converted to lat/lon (from easting/northing) and capture mins and maxes\n for (var j = 0; j < ens.length; j++) {\n //alert('j = ' + j);\n latlons[j] = new Array();\n for (var i = 0; i < ens[j].length; i++) {\n var testpoint = ens[j][i];\n var grid = new OsGridRef(testpoint[0] + lonmeters, testpoint[1] + latmeters);\n var latlon = OsGridRef.osGridToLatLong(grid);\n if (latlon.lon < minlon) {\n minlon = latlon.lon;\n }\n if (latlon.lon > maxlon) {\n maxlon = latlon.lon;\n }\n if (latlon.lat < minlat) {\n minlat = latlon.lat;\n }\n if (latlon.lat > maxlat) {\n maxlat = latlon.lat;\n }\n latlons[j][i] = latlon;\n }\n }\n\n // calculate zoom level\n var zoomLevel = getZoom(minlon, maxlon, minlat, maxlat, 512, 512);\n\n // calculate centroid\n var centroid = getCentroid(minlon, maxlon, minlat, maxlat);\n //initialize(centroid.lat, centroid.lon, zoomLevel, latlons);\n drawArea(latlons, response.results[0].value);\n } else {\n alert(\"No matching ward found\");\n }\n }", "function m(e, r) {\n var n = e.geometry,\n o = e.toJSON(),\n s = o;\n\n if (Object(_core_maybe_js__WEBPACK_IMPORTED_MODULE_0__[\"isSome\"])(n) && (s.geometry = JSON.stringify(n), s.geometryType = Object(_geometry_support_jsonUtils_js__WEBPACK_IMPORTED_MODULE_3__[\"getJsonType\"])(n), s.inSR = n.spatialReference.wkid || JSON.stringify(n.spatialReference)), o.groupByFieldsForStatistics && (s.groupByFieldsForStatistics = o.groupByFieldsForStatistics.join(\",\")), o.objectIds && (s.objectIds = o.objectIds.join(\",\")), o.orderByFields && (s.orderByFields = o.orderByFields.join(\",\")), !o.outFields || !o.returnDistinctValues && (null != r && r.returnCountOnly || null != r && r.returnExtentOnly || null != r && r.returnIdsOnly) ? delete s.outFields : -1 !== o.outFields.indexOf(\"*\") ? s.outFields = \"*\" : s.outFields = o.outFields.join(\",\"), o.outSR ? s.outSR = o.outSR.wkid || JSON.stringify(o.outSR) : n && (o.returnGeometry || o.returnCentroid) && (s.outSR = s.inSR), o.returnGeometry && delete o.returnGeometry, o.outStatistics && (s.outStatistics = JSON.stringify(o.outStatistics)), o.pixelSize && (s.pixelSize = JSON.stringify(o.pixelSize)), o.quantizationParameters && (s.quantizationParameters = JSON.stringify(o.quantizationParameters)), o.parameterValues && (s.parameterValues = JSON.stringify(o.parameterValues)), o.rangeValues && (s.rangeValues = JSON.stringify(o.rangeValues)), o.dynamicDataSource && (s.layer = JSON.stringify({\n source: o.dynamicDataSource\n }), delete o.dynamicDataSource), o.timeExtent) {\n var _t131 = o.timeExtent,\n _e134 = _t131.start,\n _r60 = _t131.end;\n null == _e134 && null == _r60 || (s.time = _e134 === _r60 ? _e134 : \"\".concat(null == _e134 ? \"null\" : _e134, \",\").concat(null == _r60 ? \"null\" : _r60)), delete o.timeExtent;\n }\n\n return s;\n }", "function getCoordData(coordinates) {\n let url = MAPS_API_URL + \"geocode/json?address=\" + coordinates;\n return new Promise(function(resolve, reject) {\n return request.get(url, function(err, response, body) {\n let json = (isJson(body) ? JSON.parse(body) : body);\n if(!json || json == undefined || !json.results || !json.results[0]) return resolve('unparsable data: ' + body);\n let row = json.results[0];\n if(!row) return resolve(false);\n let output = {\n city: row.formatted_address, \n latitude: row.geometry.location.lat,\n longitude: row.geometry.location.lng,\n };\n resolve(output);\n });\n });\n}", "function _zoneGotoAddr(addr, ct) \n{\n\n /* get the latitude/longitude for the zip */\n //var url = \"http://ws.geonames.org/postalCodeSearch?postalcode=\"+zip+\"&country=\"+ct+\"&style=long&maxRows=5\";\n var url = \"./Track?page=\" + PAGE_ZONEGEOCODE + \"&addr=\" + addr + \"&country=\" + ct + \"&_uniq=\" + Math.random();\n //alert(\"URL \" + url);\n try {\n var req = jsmGetXMLHttpRequest();\n if (req) {\n req.open(\"GET\", url, true);\n //req.setRequestHeader(\"CACHE-CONTROL\", \"NO-CACHE\");\n //req.setRequestHeader(\"PRAGMA\", \"NO-CACHE\");\n //req.setRequestHeader(\"If-Modified-Since\", \"Sat, 1 Jan 2000 00:00:00 GMT\");\n req.onreadystatechange = function() {\n if (req.readyState == 4) {\n var lat = 0.0;\n var lon = 0.0;\n for (;;) {\n\n /* get xml */\n var xmlStr = req.responseText;\n if (!xmlStr || (xmlStr == \"\")) {\n break;\n }\n \n /* get XML doc */\n var xmlDoc = createXMLDocument(xmlStr);\n if (xmlDoc == null) {\n break;\n }\n\n /* try parsing as \"geocode\" encaspulated XML */\n var geocode = xmlDoc.getElementsByTagName(TAG_geocode);\n if ((geocode != null) && (geocode.length > 0)) {\n //alert(\"geocode: \" + xmlStr);\n var geocodeElem = geocode[0];\n if (geocodeElem != null) {\n var latn = geocodeElem.getElementsByTagName(TAG_lat);\n var lonn = geocodeElem.getElementsByTagName(TAG_lng);\n if (!lonn || (lonn.length == 0)) { lonn = geocodeElem.getElementsByTagName(TAG_lon); }\n if ((latn.length > 0) && (lonn.length > 0)) {\n lat = numParseFloat(latn[0].childNodes[0].nodeValue,0.0);\n lon = numParseFloat(lonn[0].childNodes[0].nodeValue,0.0);\n break;\n }\n }\n break;\n }\n\n /* try parsing as forwarded XML from Geonames */\n var geonames = xmlDoc.getElementsByTagName(TAG_geonames);\n if ((geonames != null) && (geonames.length > 0)) {\n //alert(\"geonames: \" + xmlStr);\n // returned XML was forwarded as-is from Geonames\n var geonamesElem = geonames[0];\n var codeList = null;\n if (geonamesElem != null) {\n codeList = geonamesElem.getElementsByTagName(TAG_code);\n if (!codeList || (codeList.length == 0)) {\n codeList = geonamesElem.getElementsByTagName(TAG_geoname);\n }\n }\n if (codeList != null) {\n for (var i = 0; i < codeList.length; i++) {\n var code = codeList[i];\n var latn = code.getElementsByTagName(TAG_lat);\n var lonn = code.getElementsByTagName(TAG_lng);\n if ((latn.length > 0) && (lonn.length > 0)) {\n lat = numParseFloat(latn[0].childNodes[0].nodeValue,0.0);\n lon = numParseFloat(lonn[0].childNodes[0].nodeValue,0.0);\n break;\n }\n }\n }\n break;\n }\n\n /* break */\n //alert(\"unknown: \" + xmlStr);\n break;\n\n }\n\n /* set lat/lon */\n if ((lat == 0.0) && (lon == 0.0)) {\n // skip\n } else {\n var radiusM = MAX_ZONE_RADIUS_M / 10;\n jsvZoneIndex = 0;\n //_jsmSetPointZoneValue(0, lat, lon, radiusM);\n //for (var z = 1; z < jsvZoneCount; z++) {\n // _jsmSetPointZoneValue(z, 0.0, 0.0, radiusM);\n //}\n\n // first non-zero point\n var firstPT = null;\n for (var x = 0; x < jsvZoneList.length; x++) {\n var pt = jsvZoneList[x]; // JSMapPoint\n if ((pt.lat != 0.0) || (pt.lon != 0.0)) {\n firstPT = pt;\n break;\n }\n }\n\n if (firstPT == null) {\n // no valid points - create default geofence\n if (jsvZoneType == ZONE_POINT_RADIUS) {\n // single point at location\n var radiusM = zoneMapGetRadius(true);\n _jsmSetPointZoneValue(0, lat, lon, radiusM);\n } else\n if (jsvZoneType == ZONE_SWEPT_POINT_RADIUS) {\n // single point at location\n var radiusM = zoneMapGetRadius(true);\n _jsmSetPointZoneValue(0, lat, lon, radiusM);\n } else {\n var radiusM = 450;\n var crLat = geoRadians(lat); // radians\n var crLon = geoRadians(lon); // radians\n for (x = 0; x < jsvZoneList.length; x++) {\n var deg = x * (360.0 / jsvZoneList.length);\n var radM = radiusM / EARTH_RADIUS_METERS;\n if ((deg == 0.0) || ((deg > 170.0) && (deg < 190.0))) { radM *= 0.8; }\n var xrad = geoRadians(deg); // radians\n var rrLat = Math.asin(Math.sin(crLat) * Math.cos(radM) + Math.cos(crLat) * Math.sin(radM) * Math.cos(xrad));\n var rrLon = crLon + Math.atan2(Math.sin(xrad) * Math.sin(radM) * Math.cos(crLat), Math.cos(radM)-Math.sin(crLat) * Math.sin(rrLat));\n _jsmSetPointZoneValue(x, geoDegrees(rrLat), geoDegrees(rrLon), radiusM);\n }\n }\n } else {\n // move all points relative to first point\n var radiusM = zoneMapGetRadius(true);\n var deltaLat = lat - firstPT.lat;\n var deltaLon = lon - firstPT.lon;\n for (var x = 0; x < jsvZoneList.length; x++) {\n var pt = jsvZoneList[x];\n if ((pt.lat != 0.0) || (pt.lon != 0.0)) {\n _jsmSetPointZoneValue(x, (pt.lat + deltaLat), (pt.lon + deltaLon), radiusM);\n }\n }\n }\n\n // reset\n _zoneReset();\n\n }\n\n } else\n if (req.readyState == 1) {\n // alert('Loading GeoNames from URL: [' + req.readyState + ']\\n' + url);\n } else {\n // alert('Problem loading URL? [' + req.readyState + ']\\n' + url);\n }\n }\n req.send(null);\n } else {\n alert(\"Error [_zoneCenterOnZip]:\\n\" + url);\n }\n } catch (e) {\n alert(\"Error [_zoneCenterOnZip]:\\n\" + e);\n }\n\n}", "async importPointCloud(uri, options) {\n const basePath = uri.substring(0, uri.lastIndexOf('/')) + '/'; // location of model file as basePath\n const defaultOptions = _misc_DataUtil__WEBPACK_IMPORTED_MODULE_0__[\"default\"].createDefaultGltfOptions();\n if (options && options.files) {\n for (let fileName in options.files) {\n const fileExtension = _misc_DataUtil__WEBPACK_IMPORTED_MODULE_0__[\"default\"].getExtension(fileName);\n if (fileExtension === 'drc') {\n return await this.__decodeDraco(options.files[fileName], defaultOptions, basePath, options).catch((err) => {\n console.log('this.__decodeDraco error', err);\n });\n }\n }\n }\n const arrayBuffer = await _misc_DataUtil__WEBPACK_IMPORTED_MODULE_0__[\"default\"].fetchArrayBuffer(uri);\n return await this.__decodeDraco(arrayBuffer, defaultOptions, basePath, options).catch((err) => {\n console.log('this.__decodeDraco error', err);\n });\n }", "function csvToGeoJSON(){ //csv = reader.result\r\n\t\t\tvar lines=csv.split(/[\\r\\n]+/); // split for windows and mac csv (newline or carriage return)\r\n\t\t\tdelete window.csv; // reader.result from drag&drop not needed anymore\r\n\t\t\tvar headers=lines[0].split(\",\"); //not needed?\r\n\t\t\tvar matchID = document.getElementById(\"coordIDSelect\").value;\r\n\t\t\tvar xColumn = document.getElementById(\"xSelect\").value;\r\n\t\t\tvar yColumn = document.getElementById(\"ySelect\").value;\r\n\r\n\t\t\t// get the positions of the seleted columns in the header\r\n\t\t\tvar positionMatchID = headers.indexOf(matchID);\r\n\t\t\tvar positionX = headers.indexOf(xColumn);\r\n\t\t\tvar positionY = headers.indexOf(yColumn);\r\n\r\n\t\t\tvar obj_array = []\r\n\t\t\tfor(var i=1;i<lines.length-1;i++){\r\n\t\t\t\tvar json_obj = {\"type\": \"Feature\"};\r\n\t\t\t\tvar currentline=lines[i].split(\",\");\r\n\t\t\t\t//for(var j=0;j<headers.length;j++){\r\n\t\t\t\t\tjson_obj[\"geometry\"] = {\r\n\t\t\t\t\t\t\t\"type\" : \"Point\",\r\n\t\t\t\t\t\t\t\"coordinates\" : [parseFloat(currentline[positionX]), parseFloat(currentline[positionY])]\r\n\t\t\t\t\t};\r\n\t\t\t\t\tjson_obj[\"properties\"] = {};\r\n\t\t\t\t\tjson_obj[\"properties\"][matchID] = currentline[positionMatchID]; // get the name of zaehlstellen variable\r\n\t\t\t\t\tobj_array.push(json_obj);\r\n\t\t\t};\r\n\r\n\t\tvar complete_geojson = {\"type\":\"FeatureCollection\",\r\n\t\t\t\t\t\t\t\t\"features\": obj_array // all objects of the csv\r\n\t\t\t\t\t\t\t\t}\r\n\t//\talert(complete_geojson);\r\n\t\treturn complete_geojson; //return geoJSON\r\n\t}", "function getGeometry(post) {\n var street = post.data.street.replace(/ /g, \"+\");\n var country = \"Australia\";\n var state = \"NSW\";\n var api_key = \"AIzaSyCzS2PFKgSqc_Uz6R4--UM72xaRjKAcPZU\";\n var url = \"http://maps.googleapis.com/maps/api/geocode/json?address=\" + street + \"+\" + post.data.suburb + \"+\" + state + \"+\" + country + \"=\" + api_key;\n //post\n $.ajax({\n type: \"get\",\n url: url,\n dataType: \"json\",\n success: function (data) {\n var geometry = data.results[0].geometry.location;\n post.data.longitude = geometry.lng;\n post.data.latitude = geometry.lat;\n $.ajax(post);\n },\n error: function (data) {\n }\n });\n}", "function geoJSONCompare(testGeo, expectedGeo){\n strictEqual(testGeo.type, expectedGeo.type, \"Types match\");\n QUnit.push(coordsCompare(testGeo.coordinates, expectedGeo.coordinates), testGeo.coordinates, expectedGeo.coordinates, \"Comparing coordinates\");\n}", "async function fetchGeoCoordinatesData(destination) {\n const api_url = `http://api.geonames.org/searchJSON?q=${destination}&maxRows=1&username=${GEONAMES_API_KEY}`;\n const fetchResponse = await fetch(api_url);\n const json = await fetchResponse.json();\n let coordinatesData = {\n lat: json.geonames[0].lat,\n lng: json.geonames[0].lng,\n countryCode: json.geonames[0].countryCode,\n };\n\n return coordinatesData;\n}", "function projectGeoJsonPolygon(geometry){\n if (!geometry || geometry.type != 'Polygon' || !geometry.coordinates || !geometry.coordinates[0]) {\n return null;\n } else {\n return _.map(geometry.coordinates[0], function(p){\n return merc.forward(p)\n });\n }\n}", "function validateGeoJSON(myGeoJSON){\n if (myGeoJSON.length==0)\n {\n JL(\"mylogger\").fatal(\"Empty GeoJSON!\");\n return false;\n }\n try {\n var myObj=JSON.parse(myGeoJSON);\n if(propertiesCheck(myObj.features[0].properties)&&geometryCheck(myObj.features[0].geometry)){\n JL(\"mylogger\").info(\"Valid!\");\n return true;\n }\n else{\n return false;\n }\n } catch (e) {\n JL(\"mylogger\").fatal(\"Invalid GeoJSON!\");\n return false;\n }\n}" ]
[ "0.6401467", "0.6251229", "0.6087593", "0.5867118", "0.5793363", "0.5769249", "0.57245433", "0.5660727", "0.5587197", "0.5554582", "0.5480767", "0.5463705", "0.54294145", "0.53844434", "0.53714746", "0.5360499", "0.5350253", "0.5340355", "0.5337533", "0.5335312", "0.53113735", "0.5301105", "0.52703923", "0.5258741", "0.52336437", "0.5171153", "0.51682967", "0.5168261", "0.5158631", "0.5150322", "0.5144581", "0.5137567", "0.51308763", "0.51162595", "0.5115221", "0.51007473", "0.5087186", "0.50814915", "0.5077755", "0.5077755", "0.50653505", "0.5054925", "0.5051776", "0.50489885", "0.50465333", "0.50413746", "0.5040791", "0.50139683", "0.50139683", "0.5002297", "0.49928322", "0.498267", "0.49780366", "0.49774686", "0.49774686", "0.49774686", "0.49751887", "0.4954799", "0.4946008", "0.49393463", "0.4936088", "0.4929754", "0.49291238", "0.49282232", "0.4926342", "0.49026775", "0.48983714", "0.48933527", "0.4888798", "0.48849064", "0.4883862", "0.48818874", "0.48810062", "0.48789755", "0.4877809", "0.48766628", "0.48679838", "0.48621133", "0.48621133", "0.48478267", "0.48478073", "0.48473942", "0.48366302", "0.48121747", "0.48076433", "0.48073772", "0.48069316", "0.48039603", "0.4797115", "0.47958526", "0.47876963", "0.4785958", "0.4779476" ]
0.6084094
8
probably be fetched by multiple times. So we cache the result. axis is created each time during a ec process, so we do not need to clear cache.
function getListCache(axis, prop) { // Because key can be funciton, and cache size always be small, we use array cache. return inner(axis)[prop] || (inner(axis)[prop] = []); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function axis_old_camera(result)\n{\n console.log(\"axis_old_camera\")\n console.log(result);\n}", "get axes() {\n if (this._axes === null) {\n let coll = new IgrAxisCollection();\n let inner = coll._innerColl;\n inner.addListener((sender, e) => {\n switch (e.action) {\n case NotifyCollectionChangedAction.Add:\n this._axesAdapter.insertManualItem(e.newStartingIndex, e.newItems.item(0));\n break;\n case NotifyCollectionChangedAction.Remove:\n this._axesAdapter.removeManualItemAt(e.oldStartingIndex);\n break;\n case NotifyCollectionChangedAction.Replace:\n this._axesAdapter.removeManualItemAt(e.oldStartingIndex);\n this._axesAdapter.insertManualItem(e.newStartingIndex, e.newItems.item(0));\n break;\n case NotifyCollectionChangedAction.Reset:\n this._axesAdapter.clearManualItems();\n break;\n }\n });\n this._axes = coll;\n }\n return this._axes;\n }", "searchAxisByJuncEnv () {\n let got = false;\n while (!got) {\n this.generateAxis(false);\n got = this.searchJunctionEnvelopes();\n }\n }", "get axis() {\n return {\n index: this.$index,\n columns: this.$columns\n };\n }", "get axis() {\n\t\treturn this.__axis;\n\t}", "function processOneAxisValue(feed)\r\n {\r\n var dataset = [];\r\n var i, j, k;\r\n var measureData;\r\n if (feed.values.length <= 0){\r\n return dataset;\r\n }\r\n if (hasMND && !bMNDOnColor)\r\n {\r\n for(j = 0; j < feed.values[0].rows.length; ++j)\r\n { \r\n measureData = new Array(feed.values.length * feed.values[0].rows[0].length);\r\n for(k = 0; k < feed.values[0].rows[0].length; ++k)\r\n {\r\n for(i = 0 ; i < feed.values.length; ++i)\r\n {\r\n var dataPoint = {};\r\n dataPoint.val = feed.values[i].rows[j][k].val;\r\n dataPoint.ctx = feed.values[i].rows[j][k].ctx;\r\n dataPoint.info = feed.values[i].rows[j][k].info;\r\n if(bMNDInner){\r\n measureData[k * feed.values.length + i] = dataPoint;\r\n } else {\r\n measureData[i * feed.values[0].rows[0].length + k] = dataPoint; \r\n }\r\n }\r\n }\r\n dataset.push(measureData);\r\n } \r\n }\r\n else // MND on Region color or no MND\r\n {\r\n dataset = new Array(feed.values.length * feed.values[0].rows.length);\r\n\r\n for(i = 0 ; i < feed.values.length; ++i)\r\n {\r\n for(j = 0; j < feed.values[0].rows.length; ++j)\r\n { \r\n measureData = feed.values[i].rows[j];\r\n if(!hasMND || !bMNDInner){\r\n dataset[i * feed.values[0].rows.length + j] = measureData;\r\n } else {\r\n dataset[j * feed.values.length + i] = measureData;\r\n }\r\n }\r\n }\r\n }\r\n\r\n return dataset;\r\n }", "function SAPAxis() {\n\n this.numElements = 0;\n this.bufferSize = 256;\n this.elements = [];\n this.elements.length = this.bufferSize;\n this.stack = new Float32Array(64);\n}", "setAxisDataMap() {\n this.axisDataMap = this._createAxesData();\n }", "get Axis() {\n let sampleData = this.chart.data[0];\n let size = sampleData.length;\n\n return d3.svg\n .axis()\n .scale(this.chart.xScale)\n .orient('bottom')\n .tickFormat(getDate().long)\n .tickValues(getBestTickValues(sampleData));\n }", "function getResult(){\r\n\t\r\n\td3.select(\"svg\").remove();\r\n\tif (processDone) {\r\n //return some variables\r\n\t\t \r\n\t\t for(var key in Obj_Fetch)\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\tvar temp_var={};\r\n\t\t\t\t\t\ttemp_var.cancertype=key;\r\n\t\t\t\t\t\ttemp_var.male=Obj_Fetch[key].MALE;\r\n\t\t\t\t\t\ttemp_var.female=Obj_Fetch[key].FEMALE;\r\n\t\t\t\t\t\tfetch_data_array.push(temp_var);\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\taddScatterPlot(fetch_data_array);\r\n\t\t\t\t\t\tconsole.log(fetch_data_array);\r\n\r\n } else {\r\n setTimeout(getResult, 250);\r\n }\r\n }", "function onChartAfterGetAxes() {\n var _this = this;\n var options = this.options;\n this.colorAxis = [];\n if (options.colorAxis) {\n options.colorAxis = splat(options.colorAxis);\n options.colorAxis.forEach(function (axisOptions, i) {\n axisOptions.index = i;\n new ColorAxisClass(_this, axisOptions); // eslint-disable-line no-new\n });\n }\n }", "renderAxis() {\n const axis = d3.svg.axis()\n .scale(this.props.scale)\n .orient(this.props.orientation)\n .tickFormat(this.props.tickFormat)\n .innerTickSize(this.props.innerTickSize)\n .outerTickSize(this.props.outerTickSize)\n .tickPadding(this.props.tickPadding);\n\n d3.select(this.node).call(axis);\n }", "get Axis() {\n throw new Error('axis must be implemented in derived classes');\n }", "constructor() {\n this.entities = [];\n this.objectsAxisX = [];\n this.objectsAxisY = [];\n this.objectsAxisZ = [];\n }", "function collect(ecModel, api) {\n\t var result = {\n\t /**\n\t * key: makeKey(axis.model)\n\t * value: {\n\t * axis,\n\t * coordSys,\n\t * axisPointerModel,\n\t * triggerTooltip,\n\t * involveSeries,\n\t * snap,\n\t * seriesModels,\n\t * seriesDataCount\n\t * }\n\t */\n\t axesInfo: {},\n\t seriesInvolved: false,\n\t\n\t /**\n\t * key: makeKey(coordSys.model)\n\t * value: Object: key makeKey(axis.model), value: axisInfo\n\t */\n\t coordSysAxesInfo: {},\n\t coordSysMap: {}\n\t };\n\t collectAxesInfo(result, ecModel, api); // Check seriesInvolved for performance, in case too many series in some chart.\n\t\n\t result.seriesInvolved && collectSeriesInfo(result, ecModel);\n\t return result;\n\t }", "function xTicksval()\r\n{\r\n\tvar arrxTicks = new Array();\r\n\tcurrentGraphXval = new graphXObject(\"\" , 0);\t\t\t\t\t\t\r\n\tarrxTicks.push(currentGraphXval);\r\n\t\r\n\tfor (var i = 1; i<= intTurnNO ; i++ )\r\n\t{\r\n\t\tcurrentGraphXval = new graphXObject(objSystemDate[i-1] , i);\t\t\t\t\t\t\r\n\t\tarrxTicks.push(currentGraphXval);\r\n\t}\r\n\treturn arrxTicks;\r\n}", "render() {\n var chartDataSet = [],\n newData = {labels: this.props.xAxis};\n \n if(this.props.data.length > 0) {\n\n let rawData = this.props.data;\n\n for(let i = 0 ; i < rawData.length; i++) {\n const stock = getChartDataSet(\n rawData[i].symbol, \n getStockTypeArr(rawData[i].data, this.props.stockType), \n rawData[i].info.color)\n chartDataSet.push(stock)\n }\n newData.datasets = chartDataSet;\n }\n \n return (\n <div id=\"stockchart\" className=\"left\">\n <Line data={newData} options={chartOption.op1}/>\n </div>\n )\n \n }", "function updateXAxis() {\n\t if(showXAxis) {\n\t g.select('.nv-focus .nv-x.nv-axis')\n\t .attr('transform', 'translate(0,' + availableHeight + ')')\n\t .transition()\n\t .duration(duration)\n\t .call(xAxis)\n\t ;\n\t }\n\t }", "function CacheEl() {\n \n }", "function initResult() {\n var series = [],\n i = 0\n while (i < NUMBER_OF_SERIES) {\n series.push({\n codingType: 0,\n codingTable: 0,\n resolution: null,\n uncompressSamples: []\n })\n i += 1\n }\n return {\n batch_counter: 0,\n batch_relative_timestamp: 0,\n series: series\n }\n}", "getAxisMotionValue(axis) {\n const dragKey = \"_drag\" + axis.toUpperCase();\n const props = this.visualElement.getProps();\n const externalMotionValue = props[dragKey];\n return externalMotionValue\n ? externalMotionValue\n : this.visualElement.getValue(axis, (props.initial ? props.initial[axis] : undefined) || 0);\n }", "fetchData() {\n axios.get(`${URL_BASE}/${this.symbol}/batch?types=quote,news,chart&last=5&range=1m&token=${API_TOKEN}`)\n .then((response) => {\n const symbol = this.symbol.toUpperCase();\n const dataToStore = {\n chart: {\n [this.interval]: response.data.chart\n },\n news: response.data.news,\n quote: response.data.quote,\n time: Date.now()\n };\n store.set(symbol, dataToStore);\n })\n .catch((error) => {\n console.log(error);\n })\n .finally(() => {\n new ChartBox('#singlestock-chart-container', this.symbol);\n new KeyStats('#singlestock-keystats-container', this.symbol);\n new News('#singlestock-news-container', [this.symbol], this.symbol);\n })\n }", "function updateXAxis() {\n if(showXAxis) {\n g.select('.nv-focus .nv-x.nv-axis')\n .attr('transform', 'translate(0,' + availableHeight + ')')\n .transition()\n .duration(duration)\n .call(xAxis)\n ;\n }\n }", "function updateXAxis() {\n if(showXAxis) {\n g.select('.nv-focus .nv-x.nv-axis')\n .attr('transform', 'translate(0,' + availableHeight + ')')\n .transition()\n .duration(duration)\n .call(xAxis)\n ;\n }\n }", "generateAxis (ini=false) {\n if (this.givenAxis) {\n return;\n }\n // clear\n if (this.axis) {\n this.axis.dispose();\n }\n this.axisPoints2D = [];\n this.axisPoints = [];\n\n if (this.axisClosed) {\n this.axis = this.buildClosedAxis(ini);\n } else {\n this.axis = this.buildOpenAxis(ini);\n }\n this.sculpture.axis = this.axis;\n }", "changeAxis() {\n this.showAxis = !this.showAxis;\n }", "function groupSeriesByAxis(ecModel){var result=[];var axisList=[];ecModel.eachSeriesByType('boxplot',function(seriesModel){var baseAxis=seriesModel.getBaseAxis();var idx=zrUtil.indexOf(axisList,baseAxis);if(idx < 0){idx = axisList.length;axisList[idx] = baseAxis;result[idx] = {axis:baseAxis,seriesModels:[]};}result[idx].seriesModels.push(seriesModel);});return result;}", "function createAxis() {\n\n function Axis() {}\n\n const privateStorageBlueprint = {\n enumerable: false,\n value: { x: 0, y: 0, z: 0 },\n };\n\n Object.defineProperties(Axis.prototype, {\n x: {\n enumerable: true,\n get: function () { return this._.x; },\n set: function (newValue) {\n this._.x = newValue;\n updateCssTransformProp();\n },\n },\n\n y: {\n enumerable: true,\n get: function () { return this._.y; },\n set: function (newValue) {\n this._.y = newValue;\n updateCssTransformProp();\n },\n },\n\n z: {\n enumerable: true,\n get: function () { return this._.z; },\n set: function (newValue) {\n this._.z = newValue;\n updateCssTransformProp();\n },\n }\n });\n\n return Object.defineProperty(new Axis(), '_', privateStorageBlueprint);\n }", "function getAllResult(){\r\n\t\r\n\tif (processDone) {\r\n for(var key in Obj_Fetch)\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\tvar temp_var={};\r\n\t\t\t\t\t\ttemp_var.cancertype=key;\r\n\t\t\t\t\t\ttemp_var.male=Obj_Fetch[key].MALE;\r\n\t\t\t\t\t\ttemp_var.female=Obj_Fetch[key].FEMALE;\r\n\t\t\t\t\t\tfetch_data_array.push(temp_var);\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\taddAllScatterPlot(fetch_data_array);\r\n\t\t\t\t\t\t\r\n } else {\r\n setTimeout(getResult, 250);\r\n }\r\n }", "function onAxisAfterRender() {\n let axis = this, resizer = axis.resizer, resizerOptions = axis.options.resize, enabled;\n if (resizerOptions) {\n enabled = resizerOptions.enabled !== false;\n if (resizer) {\n // Resizer present and enabled\n if (enabled) {\n // Update options\n resizer.init(axis, true);\n // Resizer present, but disabled\n }\n else {\n // Destroy the resizer\n resizer.destroy();\n }\n }\n else {\n // Resizer not present and enabled\n if (enabled) {\n // Add new resizer\n axis.resizer = new AxisResizer(axis);\n }\n // Resizer not present and disabled, so do nothing\n }\n }\n}", "function XY( key, axis ){\n\t\tvar AX = 0;\n\t\tvar obj =$('#'+divId+' .'+key)[0];\n\t\t\t\t\n\t\tif( obj.offsetParent ){\n\t\t\twhile( obj.offsetParent ){\n\t\t\t\tif( axis==\"x\" ) \n\t\t\t\t\tAX += obj.offsetLeft;\n\t\t\t\telse\n\t\t\t\t\tAX += obj.offsetTop;\n\t\t\t\tobj = obj.offsetParent;\n\t\t\t}\n\t\t}\n\t\telse if( obj.x ){\n\t\t\tif( axis==\"x\" ) \t\n\t\t\t\tAX += obj.x;\n\t\t\telse\n\t\t\t\tAX += obj.y;\n\t\t}\n\n\t\treturn AX;\n\t}", "_invalidateCache() {\n this._cxPackedKey = [];\n this._cxPacked = [];\n }", "function drawAxis(self) {\r\n ////DRAW MAIN AXIS\r\n //Draw grid lines\r\n geometry = new THREE.Geometry();\r\n let material = new THREE.LineBasicMaterial( { color: '#'+self.data.graphColor } );\r\n let scale = self.el.getAttribute('plot').scale;\r\n geometry.vertices.push(new THREE.Vector3( 0, 0, scale[2]) );\r\n geometry.vertices.push(new THREE.Vector3( 0, 0, 0) );\r\n geometry.vertices.push(new THREE.Vector3( 0, scale[1], 0) );\r\n geometry.vertices.push(new THREE.Vector3( 0, 0, 0) );\r\n geometry.vertices.push(new THREE.Vector3( scale[0], 0, 0) );\r\n var grid = new THREE.Line(geometry, material);\r\n //add axis lines to sceneEl\r\n let el = self.el;\r\n el.setObject3D('axis', grid);\r\n el.getObject3D('axis').visible = self.data.enableAxis;\r\n}", "function reset_axis() {\n\n svg.transition().duration(500)\n .select(\".x.axis\")\n .call(phy_xAxis);\n\n d3.selectAll(\".emotion_dot\").classed(\"filtered\",false);\n d3.selectAll(\".list_item\").classed(\"filtered\",false);\n list_filteredIds =[];\n\n filter_f();\n\n}", "function createAxis() {\n for (var i = 0; i < picArray.length; i++) {\n titleArray.push(picArray[i].title);\n clickArray.push(picArray[i].clicked);\n viewArray.push(picArray[i].viewed);\n }\n}", "function interpretAxis(axis, dim) {\n while (axis < 0) {\n axis += dim;\n }\n return axis;\n}", "function interpretAxis(axis, dim) {\n while (axis < 0) {\n axis += dim;\n }\n return axis;\n}", "getData(mainIdx) {\n this.setState({ fetchInProgress: true });\n let mainCompanyVal = this.props.state.mainShares[mainIdx].value;\n let companies = `codes=${mainCompanyVal}`;\n let peers = this.props.state.paramAnalysis.peers\n ? this.props.state.paramAnalysis.peers\n : [];\n for (let i = 0; i < peers.length; i++) {\n let peerVal = peers[i].value;\n companies += `&codes=${peerVal}`;\n }\n console.log(companies);\n //axios.get(`${BI_API_ROOT_URL}/api/das/${companies}`).then(response => {\n axios\n .get(`${BI_API_ROOT_URL}${this.props.dataApi}/${companies}`)\n .then(response => {\n console.log(\"ChartContainer -> get data from service: \");\n console.log(response.data);\n let data;\n if (this.props.qtrType) {\n data = this.props.prepData(response.data, this.props.qtrType);\n } else {\n data = this.props.prepData(response.data);\n }\n console.log(\"ChartContainer -> converted data: \");\n console.log(data);\n this.setState({ fetchInProgress: false, data });\n });\n }", "transform() {\n let xaxis = [];\n const xaxisIndex = 0;\n for (let row of this.raw) {\n xaxis.push(row[xaxisIndex]);\n }\n xaxis.shift();\n console.log(`Horizontal axis: ${xaxis}`);\n \n let series = [];\n /* series is an array storing the data series to be rendered.\n * Each element of an array is an object: { seriesName: 'SERIES NAME', data: [ numbers of the series ] }\n */\n let seriesIndex = [];\n \n // Find indices from series name, store them into seriesIndex[]\n if (Array.isArray(this.selected))\n this.selected.map( (seriesName) => seriesIndex.push(this.header.indexOf(seriesName) + 1));\n // +1? this.header has the first element stripped. As we will use this index to retrieve the data in this.raw, we need to add back 1.\n else\n seriesIndex.push(this.header.indexOf(this.selected) + 1);\n \n // Extract data from raw, store them into series[]\n seriesIndex.map ( (seriesI) => {\n series.push({ seriesName: this.header[seriesI - 1], data: [] }); // -1 to retrieve series name from this.header\n if (!this.activeChartDefinition.scatterTransform) {\n // Extract data for general charts\n this.raw.map( (row) => {\n series[series.length - 1].data.push(row[seriesI]);\n })\n }\n else {\n // Extract data for scatter charts\n this.raw.map( (row, i) => {\n series[series.length - 1].data.push({ x: xaxis[i - 1], y: row[seriesI] })\n })\n }\n series[series.length - 1].data.shift();\n } );\n \n console.log(series);\n \n return { xaxis, series };\n }", "function getData(axis){\n // import data and reshape for presentation \n return new Promise(function(resolve, reject){\n d3.csv(axis.dataPath, function(data) {\n var returnData = [];\n console.log('>> returnData.length 1: '+returnData.length); \n console.log('>> importing data from '+axis.dataPath);\n data.forEach(function(d) {\n d[axis.y] = +d[axis.y];\n d[axis.x] = axis.parseTime(d[axis.x]); // time\n returnData.push(d); \n });\n console.log('>> returnData.length 2: '+returnData.length);\n console.log(data[0]); \n console.log(data); \n if(returnData.length>0){\n resolve(returnData);\n } else {\n reject(\"ERROR! Promise failed.\");\n }\n }); \n }); \n}", "noFeatureElementsInAxis() {}", "noFeatureElementsInAxis() {}", "function groupSeriesByAxis(ecModel) {\n\t var result = [];\n\t var axisList = [];\n\t ecModel.eachSeriesByType('boxplot', function (seriesModel) {\n\t var baseAxis = seriesModel.getBaseAxis();\n\t var idx = indexOf(axisList, baseAxis);\n\t\n\t if (idx < 0) {\n\t idx = axisList.length;\n\t axisList[idx] = baseAxis;\n\t result[idx] = {\n\t axis: baseAxis,\n\t seriesModels: []\n\t };\n\t }\n\t\n\t result[idx].seriesModels.push(seriesModel);\n\t });\n\t return result;\n\t }", "numericalMapping(axis) {\n const solver = this.solver;\n const state = this.plotSegment.state;\n const props = this.plotSegment.object.properties;\n const attrs = state.attributes;\n const dataIndices = state.dataRowIndices;\n const table = this.getTableContext();\n switch (axis) {\n case \"x\":\n {\n const data = props.xData;\n if (data.type == \"numerical\") {\n const [x1, x2] = solver.attrs(attrs, [this.x1Name, this.x2Name]);\n const expr = this.getExpression(data.expression);\n const interp = axis_1.getNumericalInterpolate(data);\n for (const [index, markState] of state.glyphs.entries()) {\n const rowContext = table.getGroupedContext(dataIndices[index]);\n const value = expr.getNumberValue(rowContext);\n const t = interp(value);\n solver.addLinear(solver_1.ConstraintStrength.HARD, (1 - t) * props.marginX1 - t * props.marginX2, [[1 - t, x1], [t, x2]], [[1, solver.attr(markState.attributes, \"x\")]]);\n }\n }\n if (data.type == \"categorical\") {\n const [x1, x2, gapX] = solver.attrs(attrs, [\n this.x1Name,\n this.x2Name,\n \"gapX\"\n ]);\n const expr = this.getExpression(data.expression);\n for (const [index, markState] of state.glyphs.entries()) {\n const rowContext = table.getGroupedContext(dataIndices[index]);\n const value = expr.getStringValue(rowContext);\n this.gapX(data.categories.length, data.gapRatio);\n const i = data.categories.indexOf(value);\n solver.addLinear(solver_1.ConstraintStrength.HARD, (data.categories.length - i - 0.5) * props.marginX1 -\n (i + 0.5) * props.marginX2, [\n [i + 0.5, x2],\n [data.categories.length - i - 0.5, x1],\n [-data.categories.length / 2 + i + 0.5, gapX]\n ], [\n [\n data.categories.length,\n solver.attr(markState.attributes, \"x\")\n ]\n ]);\n }\n }\n // solver.addEquals(ConstraintWeight.HARD, x, x1);\n }\n break;\n case \"y\": {\n const data = props.yData;\n if (data.type == \"numerical\") {\n const [y1, y2] = solver.attrs(attrs, [this.y1Name, this.y2Name]);\n const expr = this.getExpression(data.expression);\n const interp = axis_1.getNumericalInterpolate(data);\n for (const [index, markState] of state.glyphs.entries()) {\n const rowContext = table.getGroupedContext(dataIndices[index]);\n const value = expr.getNumberValue(rowContext);\n const t = interp(value);\n solver.addLinear(solver_1.ConstraintStrength.HARD, (t - 1) * props.marginY2 + t * props.marginY1, [[1 - t, y1], [t, y2]], [[1, solver.attr(markState.attributes, \"y\")]]);\n }\n }\n if (data.type == \"categorical\") {\n const [y1, y2, gapY] = solver.attrs(attrs, [\n this.y1Name,\n this.y2Name,\n \"gapY\"\n ]);\n const expr = this.getExpression(data.expression);\n for (const [index, markState] of state.glyphs.entries()) {\n const rowContext = table.getGroupedContext(dataIndices[index]);\n const value = expr.getStringValue(rowContext);\n this.gapY(data.categories.length, data.gapRatio);\n const i = data.categories.indexOf(value);\n solver.addLinear(solver_1.ConstraintStrength.HARD, (data.categories.length - i - 0.5) * props.marginY1 -\n (i + 0.5) * props.marginY2, [\n [i + 0.5, y2],\n [data.categories.length - i - 0.5, y1],\n [-data.categories.length / 2 + i + 0.5, gapY]\n ], [[data.categories.length, solver.attr(markState.attributes, \"y\")]]);\n }\n }\n // solver.addEquals(ConstraintWeight.HARD, y, y2);\n }\n }\n }", "createAxes () {\n }", "function getAxis(axis){\n\t\treturn d3.svg.axis()\n\t\t \t\t.scale(axis)\n\t\t \t\t.tickPadding(3)\n\t\t \t\t.ticks(d3.time.years, year_apart);\n\t}", "function sharingAxis() {\n\n\n angular.forEach(dqFactory.completeness.variables, function (variable) {\n if(variable.state.selected) {\n\n //console.log(\"sharingAxis: \", xWidth);\n\n //historical bar chart, sharing x\n var optionSharingX = {\n chart: {\n type: 'historicalBarChart',\n height: 150,\n width: xWidth,\n margin: {\n //top: 20,\n right: 20,\n bottom: 65,\n left: 75\n },\n x: function (d) {\n return d[0];\n },\n y: function (d) {\n //return d[1] / 100000;\n return d[1]\n },\n showValues: true,\n valueFormat: function (d) {\n return d3.format(',.0f')(d);\n },\n duration: 100,\n\n useInteractiveGuideline: false,\n tooltip: {\n contentGenerator: function (e) {\n var series = e.series[0];\n\n var rows =\n \"<tr>\" +\n \"<td class='key'>\" + $scope.nameX + \"</td>\" +\n \"<td class='x-value'>\" + series.key + \"</td>\" +\n \"</tr>\" +\n \"<tr>\" +\n \"<td class='key'>Missing: </td>\" +\n \"<td class='x-value'><strong>\" + d3.format(',.0f')(series.value) + \"</strong></td>\" +\n \"</tr>\";\n\n var header =\n \"<thead>\" +\n \"<tr>\" +\n \"<td class='legend-color-guide'><div style='background-color: \" + series.color + \";'></div></td>\" +\n \"<td class='key'><strong>\" + variable.name + \"</strong></td>\" +\n \"</tr>\" +\n \"</thead>\";\n\n return \"<table>\" +\n header +\n \"<tbody>\" +\n rows +\n \"</tbody>\" +\n \"</table>\";\n }\n },\n\n\n\n\n //xAxis: {\n // axisLabel: $rootScope.gv.stpX,\n // tickFormat: function (d) {\n // return d3.format('.0f')(d);\n // //return d3.time.format('%x')(new Date(d))\n // },\n // ticks: 8,\n // rotateLabels: 30,\n // showMaxMin: true\n //},\n xDomain: $scope.optionPlot.chart.xDomain,\n xAxis: $scope.optionPlot.chart.xAxis,\n yAxis: {\n axisLabel: variable.name,\n axisLabelDistance: -10,\n tickFormat: function (d) {\n return d3.format(',.0f')(d);\n }\n },\n multibar: {\n height: 1\n },\n // useInteractiveGuideline: true,\n // tooltip: {\n // keyFormatter: function (d) {\n // //$log.debug(d);\n // return \"(\".concat(variable.name).concat(\", # missing): \").concat(d);\n // //return d3.time.format('%x')(new Date(d));\n // }\n // },\n zoom: {\n enabled: false,\n scaleExtent: [1, 10],\n useFixedDomain: false,\n useNiceScale: false,\n horizontalOff: false,\n verticalOff: false,\n unzoomEventType: 'dblclick.zoom'\n }\n }\n };\n //console.log(\"xDomain: \", $scope.optionPlot.chart.xDomain);\n //optionSharingX.chart.xDomain = $scope.optionPlot.chart.xDomain;\n //optionSharingX.chart.width = xWidth;\n //console.log(variable.name, \" width: \", optionSharingX.chart.width);\n\n //optionSharingX.chart.width = document.getElementById(\"onlyMainPlotAndBottom\").offsetWidth;//$scope.optionPlot.chart.width;\n\n //optionSharingX.chart.yDomain = $scope.optionPlot.chart.yDomain;\n //console.log(\"plot width: \", $scope.optionPlot.chart.width);\n //optionSharingX.chart.width = $scope.optionPlot.chart.width;\n\n //horizontal bar chart, sharing y\n var optionSharingY = {\n chart: {\n type: 'multiBarHorizontalChart',\n height: $scope.optionPlot.chart.height,\n width: 80,\n margin: {\n left: 0\n },\n x: function (d) {\n return d.label;\n },\n y: function (d) {\n return d.value;\n },\n showControls: false,\n showValues: false,\n showLegend: false,\n showXAxis: false,\n duration: 500,\n xAxis: {showMaxMin: false},\n yAxis: {\n //axisLabel: 'Values',\n tickFormat: function (d) {\n return d3.format(',.0f')(d);\n }\n },\n useInteractiveGuideline: false,\n tooltip: {\n contentGenerator: function (e) {\n var series = e.series[0];\n\n var rows =\n \"<tr>\" +\n \"<td class='key'>\" + $scope.nameY + \"</td>\" +\n \"<td class='x-value'>\" + e.value + \"</td>\" +\n \"</tr>\" +\n \"<tr>\" +\n \"<td class='key'>Missing: </td>\" +\n \"<td class='x-value'><strong>\" + d3.format(',.0f')(series.value) + \"</strong></td>\" +\n \"</tr>\";\n\n var header =\n \"<thead>\" +\n \"<tr>\" +\n \"<td class='legend-color-guide'><div style='background-color: \" + series.color + \";'></div></td>\" +\n \"<td class='key'><strong>\" + variable.name + \"</strong></td>\" +\n \"</tr>\" +\n \"</thead>\";\n\n return \"<table>\" +\n header +\n \"<tbody>\" +\n rows +\n \"</tbody>\" +\n \"</table>\";\n }\n },\n multibar: {\n stacked: false\n }\n },\n title: {\n enable: true,\n text: variable.name,\n className: \"h5\"\n },\n subtitle: {\n enable: true,\n text: \"#missing\",\n class: {\n textAlign: \"center\"\n }\n }\n };\n\n var optionCategorical = {\n chart: {\n type: 'scatterChart',\n height: $scope.optionPlot.chart.height,\n color: dqFactory.completeness.colorRange.present, //d3.scale.category10().range(), //TODO\n scatter: {\n onlyCircles: false\n },\n showDistX: false,\n showDistY: false,\n showLegend: true,\n\n useInteractiveGuideline: false,\n tooltip: {\n contentGenerator: function (e) {\n var series = e.series[0];\n\n var rows =\n \"<tr>\" +\n \"<td class='key'>\" + $scope.nameX + \"</td>\" +\n \"<td class='x-value'>\" + e.value + \"</td>\" +\n \"</tr>\" +\n \"<tr>\" +\n \"<td class='key'>\" + $scope.nameY + \"</td>\" +\n \"<td class='x-value'><strong>\" + d3.format(',.2f')(series.value) + \"</strong></td>\" +\n \"</tr>\";\n\n var header =\n \"<thead>\" +\n \"<tr>\" +\n \"<td class='legend-color-guide'><div style='background-color: \" + series.color + \";'></div></td>\" +\n \"<td class='key'><strong>\" + series.key + \"</strong></td>\" +\n \"</tr>\" +\n \"</thead>\";\n\n return \"<table>\" +\n header +\n \"<tbody>\" +\n rows +\n \"</tbody>\" +\n \"</table>\";\n }\n\n },\n\n xAxis: {\n axisLabel: $scope.nameX,\n tickFormat: function (d) {\n return d3.format('.0f')(d);\n },\n ticks: 8\n },\n yAxis: {\n axisLabel: $scope.nameY,\n tickFormat: function (d) {\n return d3.format(',.2f')(d);\n },\n axisLabelDistance: -5\n },\n zoom: {\n //NOTE: All attributes below are optional\n enabled: false,\n scaleExtent: [1, 10],\n useFixedDomain: false,\n useNiceScale: false,\n horizontalOff: false,\n verticalOff: false\n //unzoomEventType: 'dblclick.zoom'\n }\n },\n title: {\n enable: true,\n text: variable.name,\n className: \"h5\"\n },\n subtitle: {\n enable: true,\n text: \"Categories for the \"\n .concat(variable.name)\n .concat(\" variable, related to the \")\n .concat(dqFactory.completeness.numericalPlot.nameX)\n .concat(\" vs \")\n .concat(dqFactory.completeness.numericalPlot.nameY)\n .concat(\" plot\"),\n class: {\n textAlign: \"left\"\n },\n className: \"h5\"\n }\n };\n optionCategorical.chart.xDomain = $scope.optionPlot.chart.xDomain;\n //console.log(\"categorical range: \", optionCategorical.chart.xDomain);\n optionCategorical.chart.yDomain = $scope.optionPlot.chart.yDomain;\n\n\n var dataSharingX = completenessOfVariableRespectX(variable.name, $scope.nameX);\n var dataSharingY = completenessOfVariableRespectY(variable.name, $scope.nameY);\n\n //var dataCategorical = [];\n //if(variable.state.isCategorical)\n var dataCategorical = completenessCategorical(variable.name);\n\n variable.optionSharingX = optionSharingX;\n variable.dataSharingX = dataSharingX;\n\n variable.optionSharingY = optionSharingY;\n variable.dataSharingY = dataSharingY;\n\n variable.optionCategorical = optionCategorical;\n variable.dataCategorical = dataCategorical;\n\n }\n });\n\n\n }", "function eachAxis(handler) {\n return [handler(\"x\"), handler(\"y\")];\n}", "function eachAxis(handler) {\n return [handler(\"x\"), handler(\"y\")];\n}", "function eachAxis(handler) {\n return [handler(\"x\"), handler(\"y\")];\n}", "function eachAxis(handler) {\n return [handler(\"x\"), handler(\"y\")];\n}", "getOptions() {\n let grids = []\n let xAxies = []\n let yAxies = []\n let series = []\n \n let sampleRate = store.getState().sampleRate\n let keysArray = Object.keys(this.state.eegData)\n // Remove deleted keys\n keysArray = keysArray.filter((key) => {\n return !this.removedAxies.includes(key);\n });\n\n // Layout configuration\n function generateGridTops(grid_height, num_grids) {\n // Returns an array of the top value for each\n // grid to be represented by keysArray\n let padding = 4\n let render_limits = [0+padding, 100-padding]\n let jump_width = (100 - 2*padding) / num_grids\n var list = [];\n for (var i = render_limits[0]; i <= render_limits[1]; i += jump_width) {\n let adjusted_top = i - (grid_height / 2) \n list.push(Math.ceil(adjusted_top));\n }\n return list\n }\n let height = 40\n let topsList = generateGridTops(height, keysArray.length)\n\n keysArray.forEach((key) => {\n let i = keysArray.indexOf(key)\n let grid_top = topsList[i] + \"%\"\n\n grids.push({\n id: key,\n left: '10%',\n right: '2%',\n top: grid_top,\n height: height + \"%\",\n show: true,\n name: key,\n tooltip: {\n show: false,\n trigger: 'axis',\n showDelay: 25\n },\n containLabel: false, // Help grids aligned by axis\n borderWidth: 0\n })\n\n xAxies.push({\n id: key,\n name: key,\n // Index of data as categories, for now\n data: [...Array(this.state.eegData[key].length).keys()],\n type: 'category',\n gridIndex: i,\n showGrid: false,\n axisTick: {\n show: false,\n },\n axisLabel: {\n show: (i == keysArray.length - 1), // Only show on last grid\n interval: sampleRate - 1,\n formatter: (value, index) => {\n return (this.bufferStartIndex + parseInt(value)) / sampleRate\n }\n },\n axisLine: {\n show: false,\n },\n splitLine: {\n show: true,\n interval: sampleRate - 1,\n },\n // Trigger event means you can click on name to register event\n triggerEvent: true,\n nameLocation: 'start',\n })\n\n // let scaleMax = new MyMaths().roundToNextDigit(Math.max(...this.state.eegData[key]))\n let scaleMax = 1\n let scaleMin = -scaleMax\n\n yAxies.push({\n id: key,\n type: 'value',\n gridIndex: i,\n axisLabel: {\n show: false,\n },\n axisLine: {\n show: false,\n },\n splitLine: {\n show: false,\n },\n showGrid: false,\n // Programatically scale min/max\n min: scaleMin,\n max: scaleMax\n })\n\n // Add a line config to series object\n series.push({\n name: key,\n type: 'line',\n symbol: 'none',\n lineStyle: {\n width: 0.5,\n color: 'black',\n },\n gridIndex: i,\n yAxisIndex: i,\n xAxisIndex: i,\n smooth: false,\n sampling: 'lttb',\n\n data: this.state.eegData[key],\n })\n })\n\n /**\n * Configure backsplash grid for highlights and such\n * Adds a grid at backsplashGridIndex that takes full height\n * Adds an xAxis identical to the others\n * Adds a series of 0s meant to be undisplayed,\n * just for markAreas to be applied to\n */\n let timestampFormatter = (value) => {\n let secs = ((value + this.bufferStartIndex) / sampleRate) + this.time_adjustment_secs\n var date = new Date(0);\n date.setSeconds(secs);\n return date.toISOString().substr(11, 8);\n }\n\n this.backsplashGridIndex = keysArray.length\n let backsplashGridIndex = this.backsplashGridIndex\n let configureBacksplashGrid = () => {\n if (backsplashGridIndex == 0) {\n // Catch before data loads in\n return\n }\n let arbitraryKey = keysArray[0]\n\n grids.push({\n left: '10%',\n right: '4%',\n top: '0%',\n bottom: '4%',\n show: false,\n containLabel: false, // Help grids aligned by axis\n })\n yAxies.push({\n type: 'value',\n gridIndex: backsplashGridIndex,\n axisLabel: {\n show: false,\n },\n axisLine: {\n show: false,\n },\n splitLine: {\n show: false,\n },\n showGrid: false,\n min: -1e-3,\n max: 1e-3,\n })\n xAxies.push({\n // Index of data as categories, for now\n data: [...Array(this.state.eegData[arbitraryKey].length).keys()],\n type: 'category',\n gridIndex: backsplashGridIndex,\n showGrid: false,\n axisTick: {\n show: false,\n },\n axisLabel: {\n show: true,\n interval: sampleRate - 1,\n formatter: (value, index) => {\n return timestampFormatter(value)\n }\n },\n axisLine: {\n show: false,\n },\n })\n series.push({\n type: 'line',\n symbol: 'none',\n lineStyle: {\n width: 0,\n color: '#00000000',\n },\n gridIndex: backsplashGridIndex,\n yAxisIndex: backsplashGridIndex,\n xAxisIndex: backsplashGridIndex,\n sampling: 'lttb',\n \n name: 'backSplashSeries',\n \n data: new Array(this.state.eegData[arbitraryKey].length).fill(0),\n })\n }\n configureBacksplashGrid()\n\n /**\n * \n * The actual configuration for the chart\n * Loads in all of the previously filled grids, xAxies, yAxies, and series\n * \n */\n let options = {\n // Use the values configured above\n grid: grids,\n xAxis: xAxies,\n yAxis: yAxies,\n series: series,\n\n // Other Configuration options\n animation: false,\n\n tooltip: {\n show: false,\n },\n\n // toolbox hidden\n toolbox: {\n orient: 'vertical',\n show: false,\n },\n\n // Brush allows for selection that gets turned into markAreas\n brush: {\n toolbox: ['lineX', 'keep'],\n xAxisIndex: backsplashGridIndex\n },\n\n dataZoom: [\n {\n show: false,\n xAxisIndex: Object.keys(series),\n type: 'slider',\n bottom: '2%',\n startValue: this.dz_start,\n endValue: this.dz_end,\n preventDefaultMouseMove: true,\n\n zoomOnMouseWheel: false,\n moveOnMouseWheel: false,\n moveOnMouseMove: false,\n },\n {\n yAxisIndex: Object.keys(series),\n type: 'slider',\n top: '45%',\n filterMode: 'none',\n show: false,\n\n zoomOnMouseWheel: false,\n moveOnMouseWheel: false,\n moveOnMouseMove: false,\n\n id: 'eegGain',\n start: 50 - this.yZoom,\n end: 50 + this.yZoom,\n },{\n type: 'inside',\n yAxisIndex: Object.keys(series),\n\n zoomOnMouseWheel: false,\n moveOnMouseWheel: false,\n moveOnMouseMove: false,\n }\n ],\n }\n\n return options\n }", "function onAxisDestroy(e) {\n if (!e.keepEvents && this.resizer) {\n this.resizer.destroy();\n }\n}", "function updateXAxis() {\n\t if(showXAxis) {\n\t g.select('.nv-focus .nv-x.nv-axis')\n\t .transition()\n\t .duration(duration)\n\t .call(xAxis)\n\t ;\n\t }\n\t }", "function axisProvider(){\n\t/*\n\t * setAxisContainer(svg);\n\t * setXScale(makeLinearScale([0,width],[0,d3.max(data, function(d) { return d.x; })]));\n\t * setYScale(makeLinearScale([height,0],[0,d3.max(data, function(d) { return d.y; })]));\n\t * draw()\n\t * */\n\tvar axisProviderImpl = {\n\t\t\theight \t: 0,\n\t\t\twidth\t: 0,\n\t\t\tsvg\t\t: null,\n\t\t\txScale\t: null,\n\t\t\tyScale\t: null,\n\t\t\txAxis\t: null,\n\t\t\txGrid\t: null,\n\t\t\tyAxis\t: null,\n\t\t\tyGrid\t: null,\n\t\t\tdrawXGrid: true,\n\t\t\tdrawYGrid: true,\n\t\t\tdrawGrid: true,\n\t\t\txScaleOrient : \"bottom\",\n\t\t\tyScaleOrient : \"left\",\n\t\t\txTitle:\"\",\n\t\t\tyTitle:\"\",\n\t\t\ttitle:\"\",\n\t\t\tticks\t: 10,\n\t\t\tgridTicks : 10,\n\t\t\ttickFormat:\",r\",\n\t\t\tsetAxisContainer: function(svg){\n\t\t\t\tif(!isDefined(svg) || isNull(svg)){\n\t\t\t\t\treturn ;\n\t\t\t\t}\n\t\t\t\tthis.height = svg.attr(\"height\");\n\t\t\t\tthis.width = svg.attr(\"width\");\n\t\t\t\tthis.svg\t= svg;\n\t\t\t},\n\t\t\tmakeLinearScale : function(range,domain){\n\t\t\t\treturn d3.scale.linear().range(range).domain(domain).nice();\n\t\t\t},\n\t\t\tsetXScale\t: function(xScale){\n\t\t\t\tthis.xScale = xScale;\n\t\t\t\tthis.xAxis = d3.svg.axis().scale(xScale).orient(this.xScaleOrient).ticks(this.ticks, this.tickFormat);\n\t\t\t this.xGrid = d3.svg.axis().scale(xScale).orient(this.xScaleOrient).tickSize(-this.height, 0, 0).ticks(this.gridTicks).tickFormat(\"\");\n\t\t\t},\n\t\t\tsetYScale\t:function(yScale){\n\t\t\t\tthis.yScale = yScale;\n\t\t\t\tthis.yAxis = d3.svg.axis().scale(yScale).orient(this.yScaleOrient).ticks(this.ticks, this.tickFormat);\n\t\t\t this.yGrid = d3.svg.axis().scale(yScale).orient(this.yScaleOrient).tickSize(-this.width, 0, 0).ticks(this.gridTicks).tickFormat(\"\");\n\t\t\t},\n\t\t\tdraw\t: function(){\n\t\t\t\tconsole.log(\"Drawing Axis.\");\n\t\t\t\tthis.clear();\n\t\t\t\tif(this.drawGrid && this.drawYGrid){\n\t\t\t\t\tthis.svg.insert(\"g\",\":first-child\").attr(\"class\", \"grid\").call(this.yGrid);\n\t\t\t\t}\n\t\t\t\tthis.svg.insert(\"g\",\":first-child\").attr(\"class\",\"axis\").call(this.yAxis);\n\t\t\t\t//Y axis title\n\t\t\t\tthis.svg.append(\"g\")\n\t\t\t\t.attr(\"class\",\"axisLabel\")\n\t\t\t .append(\"text\")\n\t\t\t .attr(\"class\",\"axisLabel\")\n\t\t\t .attr(\"transform\", \"rotate(-90)\")\n\t\t\t .text(this.yTitle)\n\t\t\t .attr(\"text-anchor\",\"middle\")\n\t\t\t .attr(\"x\",-((this.height/2)))\n\t\t\t .attr(\"y\",-30);\n\t\t\t\t\n\t\t\t\tif(this.drawGrid && this.drawXGrid){\n\t\t\t\t\tthis.svg.insert(\"g\",\":first-child\").attr(\"class\", \"grid\").attr(\"transform\", \"translate(0,\" + this.height + \")\").call(this.xGrid);\n\t\t\t\t}\n\t\t\t\tthis.svg.insert(\"g\",\":first-child\").attr(\"class\",\"axis\").attr(\"transform\", \"translate(0,\" + this.height + \")\").call(this.xAxis);\n\t\t\t\t//X axis title\n\t\t\t this.svg.append(\"g\")\n\t\t\t .attr(\"class\",\"axisLabel\")\n\t\t\t .append(\"text\")\n\t\t\t .attr(\"transform\", \"translate(0,\" + this.height + \")\")\n\t\t\t .attr(\"class\",\"axisLabel\")\n\t\t\t .attr(\"text-anchor\",\"middle\")\n\t\t\t .text(this.xTitle)\n\t\t\t .attr(\"x\",(this.width/2))\n\t\t\t .attr(\"y\",30);\n\t\t\t //chart Title\n\t\t\t this.svg.append(\"g\")\n\t\t\t .attr(\"class\",\"axisLabel\")\n\t\t\t .append(\"text\")\n\t\t\t .attr(\"class\",\"chartTitle\")\n\t\t\t .text(this.title)\n\t\t\t .attr(\"text-anchor\",\"middle\")\n\t\t\t .attr(\"x\",(this.width/2))\n\t\t\t .attr(\"y\",0);\n\t\t\t},\n\t\t\tclear : function(){\n\t\t\t\tthis.svg.selectAll(\".grid\").remove();\n\t\t\t\tthis.svg.selectAll(\".axis\").remove();\n\t\t\t\tthis.svg.selectAll(\".axisLabel\").remove();\n\t\t\t}\n\t};\n\t\n\tthis.$get = function(){\n\t\treturn axisProviderImpl;\n\t};\n}", "function configureOneAxe(axisName, inputChartDef, c3Axes) {\r\n var axisMap = inputChartDef.axisMap;\r\n if (!axisMap) {\r\n return;\r\n }\r\n var series = axisMap[axisName];\r\n if (!series) {\r\n return;\r\n }\r\n for (var _i = 0, series_1 = series; _i < series_1.length; _i++) {\r\n var seriesConfig = series_1[_i];\r\n c3Axes[seriesConfig.series] = axisName;\r\n }\r\n}", "function updateXAxis() {\n if(showXAxis) {\n g.select('.nv-focus .nv-x.nv-axis')\n .transition()\n .duration(duration)\n .call(xAxis)\n ;\n }\n }", "function updateXAxis() {\n if(showXAxis) {\n g.select('.nv-focus .nv-x.nv-axis')\n .transition()\n .duration(duration)\n .call(xAxis)\n ;\n }\n }", "function getOrCreateTickCache(element, context) {\n\t\tvar cache = element.data('alphaSynthTickCache');\n if(!cache) {\n playerTickUpdateCache(element, context);\n cache = element.data('alphaSynthTickCache');\n }\n\t\treturn cache;\t\t\n\t}", "function getAxisTimes() {\n var endUTC = 0;\n var startUTC = 0;\n $('div#charts > div').each(function() {\n\t var s_id = $(this).attr('data-sensorid');\n\t var chartIndex = $(\"#\"+s_id+\"-chart\").data('highchartsChart');\n\t //\t console.log('chartindex is' + chartIndex);\n\t if (typeof chartIndex === 'number') {\n\t\t// This is a real chart\n\t\tvar thisChart = Highcharts.charts[chartIndex];\n\t\tvar thisXAxis = thisChart.xAxis[0].getExtremes();\n\t\tstartUTC = thisXAxis.min;\n\t\tendUTC = thisXAxis.max;\n\t\t// We found one, quit out of the loop\n\t\treturn false;\n\t }\n\t});\n // console.log('endUTC = ' + endUTC);\n\n // If this is still 0, there were no charts to get data from.\n // Use the time range button selection on the graphs web page\n if (endUTC < 1) {\n\tvar graph_limits = getDataTimes();\n\tstartUTC = makeDate(graph_limits.starttime).getTime();\n\tendUTC = makeDate(graph_limits.endtime).getTime();\n }\n return {starttime: startUTC, endtime: endUTC};\n}", "function getXPixelAxis(val) {\n\t\treturn (getGraphWidth() / size * val) + ((width - xOffset) / size) / 2 + xOffset;\n\t}", "update_axis(){\n this.x.domain([this.parent.year0, this.parent.year0 - this.parent.window])\n this.axis_x.transition()\n .ease(d3.easeLinear)\n .duration(this.parent.speed)\n .call(this.axis_bottom)\n }", "function calculateScales(keepAxis) {\n //get min and max values\n maxTaskLength = d3.max(diagram.data, function (d) { return d[currentSerie.sourceField].toString().length; });\n tasks = e.getUniqueValues(diagram.data, currentSerie.sourceField);\n groups = e.getUniqueValues(diagram.data, currentSerie.groupField);\n\n //set domain info\n timeDomainStart = d3.min(diagram.data, function (d) { return new Date(d[startDateField]); });\n timeDomainEnd = d3.max(diagram.data, function (d) { return new Date(d[endDateField]); });\n dateDiff = timeDomainEnd.diff(timeDomainStart);\n\n //set axis formatting via date diff\n if (dateDiff > 365) {\n //set axis formatting\n axisFormatting = d3.utcFormat('%e-%b-%Y');\n } else {\n if (dateDiff < 1) {\n //set axis formatting\n axisFormatting = d3.utcFormat('%X');\n } else {\n //set axis formatting\n axisFormatting = d3.utcFormat('%b-%e');\n }\n }\n\n //calculate margins\n autoMargin = ((diagram.yAxis.labelFontSize / 2) * (maxTaskLength + 1)) + diagram.yAxis.labelFontSize;\n margin.left = diagram.margin.left + autoMargin;\n margin.right = diagram.margin.right;\n margin.top = diagram.margin.top;\n margin.bottom = diagram.margin.bottom;\n\n //set dimension\n width = diagram.plot.width - diagram.plot.left - diagram.plot.right - margin.left - margin.right;\n height = diagram.plot.height - diagram.plot.top - diagram.plot.bottom - margin.top - margin.bottom;\n\n //caclulate tick count\n maxAxisLength = axisFormatting(timeDomainEnd).length;\n singleAxisWidth = (((diagram.xAxis.labelFontSize / 2) * (maxAxisLength)) + diagram.xAxis.labelFontSize);\n autoTickCount = Math.floor(width / singleAxisWidth);\n\n //create scales\n xScale = d3.scaleUtc().domain([timeDomainStart, timeDomainEnd]).range([0, width]).clamp(true);\n yScale = d3.scaleBand().domain(tasks).range([height - margin.top - margin.bottom, 0]).padding(0.1);\n\n //create axes\n xAxis = d3.axisBottom().scale(xScale).ticks(autoTickCount / 2).tickFormat(axisFormatting);\n yAxis = d3.axisLeft().scale(yScale).tickSize(0);\n\n if (currentSerie.labelFontSize === 'auto')\n currentSerie.labelFontSize = 11;\n }", "updateChart() {\r\n this.alpaca.getAccount().then((resp) => {\r\n this.chart.data.datasets[0].data.push({\r\n t: new Date(),\r\n y: resp.equity\r\n });\r\n this.chart.update();\r\n });\r\n this.updateOrders(); // Updates positions and orders in case any changed were made\r\n this.updatePositions();\r\n }", "function resetAxis(axis, originAxis) {\n axis.min = originAxis.min;\n axis.max = originAxis.max;\n}", "function resetAxis(axis, originAxis) {\n axis.min = originAxis.min;\n axis.max = originAxis.max;\n}", "function resetAxis(axis, originAxis) {\n axis.min = originAxis.min;\n axis.max = originAxis.max;\n}", "function resetAxis(axis, originAxis) {\n axis.min = originAxis.min;\n axis.max = originAxis.max;\n}", "function grabTableData2() {\n var cache1 = CacheService.getDocumentCache();\n var dataForChart = (cache1.get('rankData'));\n// var testValue = JSON.parse(dataForChart);\n// Logger.log('return:' + testValue);\n return dataForChart;\n }// grabTableData2() function end", "function autoSetAxis(ctx, axis) {\n\t/* get the user specified axis range */\n\tlet xLeftValue = idName('x-left-value').value;\n\tlet xRightValue = idName('x-right-value').value;\n\tlet yLeftValue = idName('y-left-value').value;\n\tlet yRightValue = idName('y-right-value').value;\n\n\tsetAxis(ctx, axis, canvasWidth, canvasHeight, xLeftValue,\n\t\txRightValue, yLeftValue, yRightValue);\n}", "function makeSeriesEncodeForAxisCoordSys(coordDimensions, seriesModel, source) {\n\t var encode = {};\n\t var datasetModel = querySeriesUpstreamDatasetModel(seriesModel); // Currently only make default when using dataset, util more reqirements occur.\n\t\n\t if (!datasetModel || !coordDimensions) {\n\t return encode;\n\t }\n\t\n\t var encodeItemName = [];\n\t var encodeSeriesName = [];\n\t var ecModel = seriesModel.ecModel;\n\t var datasetMap = innerGlobalModel(ecModel).datasetMap;\n\t var key = datasetModel.uid + '_' + source.seriesLayoutBy;\n\t var baseCategoryDimIndex;\n\t var categoryWayValueDimStart;\n\t coordDimensions = coordDimensions.slice();\n\t each(coordDimensions, function (coordDimInfoLoose, coordDimIdx) {\n\t var coordDimInfo = isObject(coordDimInfoLoose) ? coordDimInfoLoose : coordDimensions[coordDimIdx] = {\n\t name: coordDimInfoLoose\n\t };\n\t\n\t if (coordDimInfo.type === 'ordinal' && baseCategoryDimIndex == null) {\n\t baseCategoryDimIndex = coordDimIdx;\n\t categoryWayValueDimStart = getDataDimCountOnCoordDim(coordDimInfo);\n\t }\n\t\n\t encode[coordDimInfo.name] = [];\n\t });\n\t var datasetRecord = datasetMap.get(key) || datasetMap.set(key, {\n\t categoryWayDim: categoryWayValueDimStart,\n\t valueWayDim: 0\n\t }); // TODO\n\t // Auto detect first time axis and do arrangement.\n\t\n\t each(coordDimensions, function (coordDimInfo, coordDimIdx) {\n\t var coordDimName = coordDimInfo.name;\n\t var count = getDataDimCountOnCoordDim(coordDimInfo); // In value way.\n\t\n\t if (baseCategoryDimIndex == null) {\n\t var start = datasetRecord.valueWayDim;\n\t pushDim(encode[coordDimName], start, count);\n\t pushDim(encodeSeriesName, start, count);\n\t datasetRecord.valueWayDim += count; // ??? TODO give a better default series name rule?\n\t // especially when encode x y specified.\n\t // consider: when mutiple series share one dimension\n\t // category axis, series name should better use\n\t // the other dimsion name. On the other hand, use\n\t // both dimensions name.\n\t } // In category way, the first category axis.\n\t else if (baseCategoryDimIndex === coordDimIdx) {\n\t pushDim(encode[coordDimName], 0, count);\n\t pushDim(encodeItemName, 0, count);\n\t } // In category way, the other axis.\n\t else {\n\t var start = datasetRecord.categoryWayDim;\n\t pushDim(encode[coordDimName], start, count);\n\t pushDim(encodeSeriesName, start, count);\n\t datasetRecord.categoryWayDim += count;\n\t }\n\t });\n\t\n\t function pushDim(dimIdxArr, idxFrom, idxCount) {\n\t for (var i = 0; i < idxCount; i++) {\n\t dimIdxArr.push(idxFrom + i);\n\t }\n\t }\n\t\n\t function getDataDimCountOnCoordDim(coordDimInfo) {\n\t var dimsDef = coordDimInfo.dimsDef;\n\t return dimsDef ? dimsDef.length : 1;\n\t }\n\t\n\t encodeItemName.length && (encode.itemName = encodeItemName);\n\t encodeSeriesName.length && (encode.seriesName = encodeSeriesName);\n\t return encode;\n\t }", "function chart() {\n\n var _data = _models.epos.dims.dummy.top(Infinity);\n \n function render() {\n chtBasic = new CHART.EposBasic(_uid + '-charts-basic', _data);\n }\n \n function update() {\n chtBasic.reload(_data);\n }\n \n return { render : render, update : update };\n }", "function cbfunc(yqlResult) {\n\t\t\t\tvar count = yqlResult.query.count;\n\t\t\t\tif (count > 0) {\n\t\t\t\t\tenableStreaming = false;\n\t\t\t\t\tvar quotes = yqlResult.query.results.quote;\n\t\t\t\t\tquotes.reverse();\n\t\t\t\t\tconvertYahooResults(quotes);\n\t\t\t\t\tstxx.newChart($$(\"symbol\").value, quotes);\n\t\t\t\t}\n\t\t\t}", "function getYaxisInstantReport(){\n\n var db = getDatabase();\n var rs = \"\";\n db.transaction(function(tx) {\n rs = tx.executeSql('select r.current_amount from category c left join category_report_current r where r.id_category = c.id');\n }\n );\n\n var expenses = [];\n for(var i =0;i < rs.rows.length;i++) {\n expenses.push(rs.rows.item(i).current_amount);\n }\n\n return expenses;\n }", "function collect(ecModel, api) {\n var result = {\n /**\n * key: makeKey(axis.model)\n * value: {\n * axis,\n * coordSys,\n * axisPointerModel,\n * triggerTooltip,\n * involveSeries,\n * snap,\n * seriesModels,\n * seriesDataCount\n * }\n */\n axesInfo: {},\n seriesInvolved: false,\n\n /**\n * key: makeKey(coordSys.model)\n * value: Object: key makeKey(axis.model), value: axisInfo\n */\n coordSysAxesInfo: {},\n coordSysMap: {}\n };\n collectAxesInfo(result, ecModel, api); // Check seriesInvolved for performance, in case too many series in some chart.\n\n result.seriesInvolved && collectSeriesInfo(result, ecModel);\n return result;\n}", "function collect(ecModel, api) {\n var result = {\n /**\n * key: makeKey(axis.model)\n * value: {\n * axis,\n * coordSys,\n * axisPointerModel,\n * triggerTooltip,\n * involveSeries,\n * snap,\n * seriesModels,\n * seriesDataCount\n * }\n */\n axesInfo: {},\n seriesInvolved: false,\n\n /**\n * key: makeKey(coordSys.model)\n * value: Object: key makeKey(axis.model), value: axisInfo\n */\n coordSysAxesInfo: {},\n coordSysMap: {}\n };\n collectAxesInfo(result, ecModel, api); // Check seriesInvolved for performance, in case too many series in some chart.\n\n result.seriesInvolved && collectSeriesInfo(result, ecModel);\n return result;\n}", "function collect(ecModel, api) {\n var result = {\n /**\n * key: makeKey(axis.model)\n * value: {\n * axis,\n * coordSys,\n * axisPointerModel,\n * triggerTooltip,\n * involveSeries,\n * snap,\n * seriesModels,\n * seriesDataCount\n * }\n */\n axesInfo: {},\n seriesInvolved: false,\n\n /**\n * key: makeKey(coordSys.model)\n * value: Object: key makeKey(axis.model), value: axisInfo\n */\n coordSysAxesInfo: {},\n coordSysMap: {}\n };\n collectAxesInfo(result, ecModel, api); // Check seriesInvolved for performance, in case too many series in some chart.\n\n result.seriesInvolved && collectSeriesInfo(result, ecModel);\n return result;\n}", "function collect(ecModel, api) {\n var result = {\n /**\n * key: makeKey(axis.model)\n * value: {\n * axis,\n * coordSys,\n * axisPointerModel,\n * triggerTooltip,\n * involveSeries,\n * snap,\n * seriesModels,\n * seriesDataCount\n * }\n */\n axesInfo: {},\n seriesInvolved: false,\n\n /**\n * key: makeKey(coordSys.model)\n * value: Object: key makeKey(axis.model), value: axisInfo\n */\n coordSysAxesInfo: {},\n coordSysMap: {}\n };\n collectAxesInfo(result, ecModel, api); // Check seriesInvolved for performance, in case too many series in some chart.\n\n result.seriesInvolved && collectSeriesInfo(result, ecModel);\n return result;\n}", "function collect(ecModel, api) {\n var result = {\n /**\n * key: makeKey(axis.model)\n * value: {\n * axis,\n * coordSys,\n * axisPointerModel,\n * triggerTooltip,\n * involveSeries,\n * snap,\n * seriesModels,\n * seriesDataCount\n * }\n */\n axesInfo: {},\n seriesInvolved: false,\n\n /**\n * key: makeKey(coordSys.model)\n * value: Object: key makeKey(axis.model), value: axisInfo\n */\n coordSysAxesInfo: {},\n coordSysMap: {}\n };\n collectAxesInfo(result, ecModel, api); // Check seriesInvolved for performance, in case too many series in some chart.\n\n result.seriesInvolved && collectSeriesInfo(result, ecModel);\n return result;\n}", "function collect(ecModel, api) {\n var result = {\n /**\n * key: makeKey(axis.model)\n * value: {\n * axis,\n * coordSys,\n * axisPointerModel,\n * triggerTooltip,\n * involveSeries,\n * snap,\n * seriesModels,\n * seriesDataCount\n * }\n */\n axesInfo: {},\n seriesInvolved: false,\n\n /**\n * key: makeKey(coordSys.model)\n * value: Object: key makeKey(axis.model), value: axisInfo\n */\n coordSysAxesInfo: {},\n coordSysMap: {}\n };\n collectAxesInfo(result, ecModel, api); // Check seriesInvolved for performance, in case too many series in some chart.\n\n result.seriesInvolved && collectSeriesInfo(result, ecModel);\n return result;\n}", "function collect(ecModel, api) {\n var result = {\n /**\n * key: makeKey(axis.model)\n * value: {\n * axis,\n * coordSys,\n * axisPointerModel,\n * triggerTooltip,\n * involveSeries,\n * snap,\n * seriesModels,\n * seriesDataCount\n * }\n */\n axesInfo: {},\n seriesInvolved: false,\n\n /**\n * key: makeKey(coordSys.model)\n * value: Object: key makeKey(axis.model), value: axisInfo\n */\n coordSysAxesInfo: {},\n coordSysMap: {}\n };\n collectAxesInfo(result, ecModel, api); // Check seriesInvolved for performance, in case too many series in some chart.\n\n result.seriesInvolved && collectSeriesInfo(result, ecModel);\n return result;\n}", "function collect(ecModel, api) {\n var result = {\n /**\n * key: makeKey(axis.model)\n * value: {\n * axis,\n * coordSys,\n * axisPointerModel,\n * triggerTooltip,\n * involveSeries,\n * snap,\n * seriesModels,\n * seriesDataCount\n * }\n */\n axesInfo: {},\n seriesInvolved: false,\n\n /**\n * key: makeKey(coordSys.model)\n * value: Object: key makeKey(axis.model), value: axisInfo\n */\n coordSysAxesInfo: {},\n coordSysMap: {}\n };\n collectAxesInfo(result, ecModel, api); // Check seriesInvolved for performance, in case too many series in some chart.\n\n result.seriesInvolved && collectSeriesInfo(result, ecModel);\n return result;\n}", "function collect(ecModel, api) {\n var result = {\n /**\n * key: makeKey(axis.model)\n * value: {\n * axis,\n * coordSys,\n * axisPointerModel,\n * triggerTooltip,\n * involveSeries,\n * snap,\n * seriesModels,\n * seriesDataCount\n * }\n */\n axesInfo: {},\n seriesInvolved: false,\n\n /**\n * key: makeKey(coordSys.model)\n * value: Object: key makeKey(axis.model), value: axisInfo\n */\n coordSysAxesInfo: {},\n coordSysMap: {}\n };\n collectAxesInfo(result, ecModel, api); // Check seriesInvolved for performance, in case too many series in some chart.\n\n result.seriesInvolved && collectSeriesInfo(result, ecModel);\n return result;\n}", "update(elementCache, viewport, data) {\n\n let width = viewport.clientWidth;\n let height = 150;\n this.setViewPortSVGSize(elementCache.svg, width, height);\n\n let { axis: xAxis, scale: xScale } = this.createXAxis(data, width); \n this.formatAxis(elementCache.axisG, height, xAxis, xScale);\n\n this.renderElements(this.data, xScale, elementCache.chartG);\n }", "function getResultDetailed(){\r\n\t\r\n\tif (processDone) {\r\n \r\n\t\t for(var key in Obj_Fetch)\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\tvar temp_var={};\r\n\t\t\t\t\t\ttemp_var.cancertypedetailed=key;\r\n\t\t\t\t\t\ttemp_var.male=Obj_Fetch[key].MALE;\r\n\t\t\t\t\t\ttemp_var.female=Obj_Fetch[key].FEMALE;\r\n\t\t\t\t\t\tfetch_data_array.push(temp_var);\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\taddScatterPlotDetailed(fetch_data_array);\r\n\t\t\t\t\t\tconsole.log(fetch_data_array);\r\n\r\n } else {\r\n setTimeout(getResult, 250);\r\n }\r\n }", "function configureOneAxis(axisName, inputChartDef, c3Axis) {\r\n var axisMap = inputChartDef.axisMap;\r\n if (!axisMap) {\r\n return;\r\n }\r\n c3Axis[axisName] = { show: false };\r\n var axisDef = inputChartDef.plotConfig[axisName];\r\n var c3AxisDef = c3Axis[axisName];\r\n var series = axisMap[axisName];\r\n if (!series) {\r\n return;\r\n }\r\n if (Array.isArray(series)) {\r\n series.forEach(function (seriesConfig) {\r\n configureOneSeries(seriesConfig, inputChartDef, axisDef, c3AxisDef);\r\n });\r\n }\r\n else {\r\n configureOneSeries(series, inputChartDef, axisDef, c3AxisDef);\r\n }\r\n}", "function extractXS(axisName, inputChartDef, xs) {\r\n var axisMap = inputChartDef.axisMap;\r\n if (!axisMap) {\r\n return;\r\n }\r\n var series = axisMap[axisName];\r\n if (!series) {\r\n return;\r\n }\r\n for (var _i = 0, series_2 = series; _i < series_2.length; _i++) {\r\n var seriesConfig = series_2[_i];\r\n var ySeriesName = seriesConfig.series;\r\n if (xs[ySeriesName]) {\r\n return; // Already set.\r\n }\r\n if (seriesConfig.x) {\r\n xs[ySeriesName] = seriesConfig.x.series; // X explicitly associated with Y.\r\n }\r\n else if (inputChartDef.axisMap && inputChartDef.axisMap.x) {\r\n xs[ySeriesName] = inputChartDef.axisMap.x.series; // Default X.\r\n }\r\n }\r\n}", "function update_axis(newScale){\n chart.select(\".vertical.axis\").\n transition()\n .call(vertical_axis.scale(newScale));\n }", "function makeSeriesEncodeForAxisCoordSys(coordDimensions, seriesModel, source) {\n var encode = {};\n var datasetModel = querySeriesUpstreamDatasetModel(seriesModel); // Currently only make default when using dataset, util more reqirements occur.\n\n if (!datasetModel || !coordDimensions) {\n return encode;\n }\n\n var encodeItemName = [];\n var encodeSeriesName = [];\n var ecModel = seriesModel.ecModel;\n var datasetMap = innerGlobalModel(ecModel).datasetMap;\n var key = datasetModel.uid + '_' + source.seriesLayoutBy;\n var baseCategoryDimIndex;\n var categoryWayValueDimStart;\n coordDimensions = coordDimensions.slice();\n Object(zrender_lib_core_util__WEBPACK_IMPORTED_MODULE_1__[/* each */ \"k\"])(coordDimensions, function (coordDimInfoLoose, coordDimIdx) {\n var coordDimInfo = Object(zrender_lib_core_util__WEBPACK_IMPORTED_MODULE_1__[/* isObject */ \"z\"])(coordDimInfoLoose) ? coordDimInfoLoose : coordDimensions[coordDimIdx] = {\n name: coordDimInfoLoose\n };\n\n if (coordDimInfo.type === 'ordinal' && baseCategoryDimIndex == null) {\n baseCategoryDimIndex = coordDimIdx;\n categoryWayValueDimStart = getDataDimCountOnCoordDim(coordDimInfo);\n }\n\n encode[coordDimInfo.name] = [];\n });\n var datasetRecord = datasetMap.get(key) || datasetMap.set(key, {\n categoryWayDim: categoryWayValueDimStart,\n valueWayDim: 0\n }); // TODO\n // Auto detect first time axis and do arrangement.\n\n Object(zrender_lib_core_util__WEBPACK_IMPORTED_MODULE_1__[/* each */ \"k\"])(coordDimensions, function (coordDimInfo, coordDimIdx) {\n var coordDimName = coordDimInfo.name;\n var count = getDataDimCountOnCoordDim(coordDimInfo); // In value way.\n\n if (baseCategoryDimIndex == null) {\n var start = datasetRecord.valueWayDim;\n pushDim(encode[coordDimName], start, count);\n pushDim(encodeSeriesName, start, count);\n datasetRecord.valueWayDim += count; // ??? TODO give a better default series name rule?\n // especially when encode x y specified.\n // consider: when mutiple series share one dimension\n // category axis, series name should better use\n // the other dimsion name. On the other hand, use\n // both dimensions name.\n } // In category way, the first category axis.\n else if (baseCategoryDimIndex === coordDimIdx) {\n pushDim(encode[coordDimName], 0, count);\n pushDim(encodeItemName, 0, count);\n } // In category way, the other axis.\n else {\n var start = datasetRecord.categoryWayDim;\n pushDim(encode[coordDimName], start, count);\n pushDim(encodeSeriesName, start, count);\n datasetRecord.categoryWayDim += count;\n }\n });\n\n function pushDim(dimIdxArr, idxFrom, idxCount) {\n for (var i = 0; i < idxCount; i++) {\n dimIdxArr.push(idxFrom + i);\n }\n }\n\n function getDataDimCountOnCoordDim(coordDimInfo) {\n var dimsDef = coordDimInfo.dimsDef;\n return dimsDef ? dimsDef.length : 1;\n }\n\n encodeItemName.length && (encode.itemName = encodeItemName);\n encodeSeriesName.length && (encode.seriesName = encodeSeriesName);\n return encode;\n}", "_notifyUpdate(object) {\n\n if ( this.cache ) {\n\n // Iterate over every dimension - if caching is enabled then run through dimension key and add to the cache\n _.forEach(this.dimensions, (dimension) => {\n\n if ( dimension._framefetch_config.cache ) {\n\n let dimensionKey = dimension._framefetch_config.dimensionKey(object)\n\n dimension.clear(dimensionKey).prime(dimensionKey, object)\n\n }\n\n })\n\n }\n\n }", "function getChartValues(cord){\r\n\taxisType = $(\"#\"+cord+\"AxisList\").val();\r\n\r\n\tif(axisType == \"time\"){\r\n\t\ttimeSelection = $('#time'+cord+'AxisList').val();\r\n\t\t\r\n\t\tif(timeSelection == \"Years\"){\r\n\t\t\ttimeSelectionId = 1; \t\t\t\t// for Years\r\n\t\t}\r\n\t\telse if(timeSelection == \"Seasons\"){\r\n\t\t\ttimeSelectionId = 2; \t\t\t\t// for Seasons\r\n\t\t}\r\n\t\telse if(timeSelection == \"Months\"){\r\n\t\t\ttimeSelectionId = 3; \t\t\t\t// for Months\r\n\t\t}\r\n\t\telse if(timeSelection == \"Weeks\"){\r\n\t\t\ttimeSelectionId = 4; \t\t\t\t// for Weeks\r\n\t\t}\r\n\t\telse if(timeSelection == \"Days\"){\r\n\t\t\ttimeSelectionId = 5; \t\t\t\t// for Days\r\n\t\t}\r\n\t}else if(axisType == \"space\"){\r\n\t\tspaceSelection = $('#space'+cord+'AxisList').val();\r\n\t\t\r\n\t\tif(spaceSelection == \"Latitude/Longitude\"){\r\n\t\t\tspaceSelectionId = 1; \t\t\t\t// for Latitude/Longitude\r\n\t\t}\r\n\t\telse if(spaceSelection == \"Districts\"){\r\n\t\t\tspaceSelectionId = 2; \t\t\t\t// for Seasons\r\n\t\t}\r\n\t}else if(axisType == \"noOfEvents\"){\r\n\t\tnoOfEventsCat = $('#noOfEventsCat'+cord+'AxisList').val();\r\n\t\tnoOfEventsSubCat = $('#noOfEventsSubCat'+cord+'AxisList').val();\r\n\t}\r\n\telse if(axisType == \"noOfPart\"){\r\n\t\tnoOfPartCat = $('#noOfPartCat'+cord+'AxisList').val();\r\n\t\tnoOfPartSubCat = $('#noOfPartSubCat'+cord+'AxisList').val();\r\n\t}\r\n\telse if(axisType == \"catSubCat\"){\r\n\t\tcatSubCatCat = $('#catSubCatCat'+cord+'AxisList').val();\r\n\t\tcatSubCatSubCat = $('#catSubCatSubCat'+cord+'AxisList').val();\r\n\t}\r\n}", "function toggleAxis(axis){\n\n }", "function toggleAxis(axis){\n\n }", "function create$2(ecModel, api) {\n\t var singles = [];\n\t ecModel.eachComponent('singleAxis', function (axisModel, idx) {\n\t var single = new Single(axisModel, ecModel, api);\n\t single.name = 'single_' + idx;\n\t single.resize(axisModel, api);\n\t axisModel.coordinateSystem = single;\n\t singles.push(single);\n\t });\n\t ecModel.eachSeries(function (seriesModel) {\n\t if (seriesModel.get('coordinateSystem') === 'singleAxis') {\n\t var singleAxisModel = seriesModel.getReferringComponents('singleAxis', SINGLE_REFERRING).models[0];\n\t seriesModel.coordinateSystem = singleAxisModel && singleAxisModel.coordinateSystem;\n\t }\n\t });\n\t return singles;\n\t }", "getColumnMetrics() {\n const swapAxes = () => {\n for (const series of this.chart.series) {\n const xAxis = series.xAxis;\n series.xAxis = series.yAxis;\n series.yAxis = xAxis;\n }\n };\n swapAxes();\n const metrics = super.getColumnMetrics();\n swapAxes();\n return metrics;\n }", "function getXaxisInstantReport(){\n\n var db = getDatabase();\n var rs = \"\";\n\n db.transaction(function(tx) {\n rs = tx.executeSql('SELECT cat_name FROM category');\n }\n );\n /* build the array */\n var categoryNames = [];\n for(var i =0;i < rs.rows.length;i++) {\n categoryNames.push(rs.rows.item(i).cat_name);\n }\n\n return categoryNames;\n }" ]
[ "0.55371356", "0.5492951", "0.53215224", "0.52449566", "0.52361447", "0.5234773", "0.51528275", "0.51246065", "0.5050779", "0.50349826", "0.49853832", "0.4976081", "0.4951008", "0.49115002", "0.490346", "0.49022877", "0.4896473", "0.48926905", "0.48906308", "0.4885324", "0.48808053", "0.48678258", "0.48495317", "0.48495317", "0.48464423", "0.48357296", "0.48355842", "0.48248646", "0.48185018", "0.48068503", "0.4797335", "0.47969982", "0.47965512", "0.47894195", "0.4773162", "0.477193", "0.477193", "0.47502002", "0.47476667", "0.47473794", "0.47372615", "0.47372615", "0.47367087", "0.4733875", "0.47218317", "0.47206536", "0.47180796", "0.47148272", "0.47148272", "0.47148272", "0.47148272", "0.4709539", "0.4706701", "0.4699739", "0.46849173", "0.46821833", "0.4671795", "0.4671795", "0.46693492", "0.46344742", "0.46317446", "0.46293458", "0.46189544", "0.4610214", "0.460075", "0.460075", "0.460075", "0.460075", "0.4589781", "0.45790938", "0.45778355", "0.4576768", "0.45631474", "0.4562387", "0.45600265", "0.45600265", "0.45600265", "0.45600265", "0.45600265", "0.45600265", "0.45600265", "0.45600265", "0.45600265", "0.4547702", "0.45440558", "0.4541882", "0.45293078", "0.4522067", "0.45132607", "0.4512707", "0.4511308", "0.4507205", "0.4507205", "0.45024583", "0.44918996", "0.4491507" ]
0.44935584
98
Calculate interval for category axis ticks and labels. To get precise result, at least one of `getRotate` and `isHorizontal` should be implemented in axis.
function calculateCategoryInterval(axis) { var params = fetchAutoCategoryIntervalCalculationParams(axis); var labelFormatter = makeLabelFormatter(axis); var rotation = (params.axisRotate - params.labelRotate) / 180 * Math.PI; var ordinalScale = axis.scale; var ordinalExtent = ordinalScale.getExtent(); // Providing this method is for optimization: // avoid generating a long array by `getTicks` // in large category data case. var tickCount = ordinalScale.count(); if (ordinalExtent[1] - ordinalExtent[0] < 1) { return 0; } var step = 1; // Simple optimization. Empirical value: tick count should less than 40. if (tickCount > 40) { step = Math.max(1, Math.floor(tickCount / 40)); } var tickValue = ordinalExtent[0]; var unitSpan = axis.dataToCoord(tickValue + 1) - axis.dataToCoord(tickValue); var unitW = Math.abs(unitSpan * Math.cos(rotation)); var unitH = Math.abs(unitSpan * Math.sin(rotation)); var maxW = 0; var maxH = 0; // Caution: Performance sensitive for large category data. // Consider dataZoom, we should make appropriate step to avoid O(n) loop. for (; tickValue <= ordinalExtent[1]; tickValue += step) { var width = 0; var height = 0; // Not precise, do not consider align and vertical align // and each distance from axis line yet. var rect = textContain.getBoundingRect(labelFormatter(tickValue), params.font, 'center', 'top'); // Magic number width = rect.width * 1.3; height = rect.height * 1.3; // Min size, void long loop. maxW = Math.max(maxW, width, 7); maxH = Math.max(maxH, height, 7); } var dw = maxW / unitW; var dh = maxH / unitH; // 0/0 is NaN, 1/0 is Infinity. isNaN(dw) && (dw = Infinity); isNaN(dh) && (dh = Infinity); var interval = Math.max(0, Math.floor(Math.min(dw, dh))); var cache = inner(axis.model); var lastAutoInterval = cache.lastAutoInterval; var lastTickCount = cache.lastTickCount; // Use cache to keep interval stable while moving zoom window, // otherwise the calculated interval might jitter when the zoom // window size is close to the interval-changing size. if (lastAutoInterval != null && lastTickCount != null && Math.abs(lastAutoInterval - interval) <= 1 && Math.abs(lastTickCount - tickCount) <= 1 // Always choose the bigger one, otherwise the critical // point is not the same when zooming in or zooming out. && lastAutoInterval > interval) { interval = lastAutoInterval; } // Only update cache if cache not used, otherwise the // changing of interval is too insensitive. else { cache.lastTickCount = tickCount; cache.lastAutoInterval = interval; } return interval; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function calculateCategoryInterval(axis) {\n var params = fetchAutoCategoryIntervalCalculationParams(axis);\n var labelFormatter = makeLabelFormatter(axis);\n var rotation = (params.axisRotate - params.labelRotate) / 180 * Math.PI;\n var ordinalScale = axis.scale;\n var ordinalExtent = ordinalScale.getExtent(); // Providing this method is for optimization:\n // avoid generating a long array by `getTicks`\n // in large category data case.\n\n var tickCount = ordinalScale.count();\n\n if (ordinalExtent[1] - ordinalExtent[0] < 1) {\n return 0;\n }\n\n var step = 1; // Simple optimization. Empirical value: tick count should less than 40.\n\n if (tickCount > 40) {\n step = Math.max(1, Math.floor(tickCount / 40));\n }\n\n var tickValue = ordinalExtent[0];\n var unitSpan = axis.dataToCoord(tickValue + 1) - axis.dataToCoord(tickValue);\n var unitW = Math.abs(unitSpan * Math.cos(rotation));\n var unitH = Math.abs(unitSpan * Math.sin(rotation));\n var maxW = 0;\n var maxH = 0; // Caution: Performance sensitive for large category data.\n // Consider dataZoom, we should make appropriate step to avoid O(n) loop.\n\n for (; tickValue <= ordinalExtent[1]; tickValue += step) {\n var width = 0;\n var height = 0; // Not precise, do not consider align and vertical align\n // and each distance from axis line yet.\n\n var rect = textContain.getBoundingRect(labelFormatter(tickValue), params.font, 'center', 'top'); // Magic number\n\n width = rect.width * 1.3;\n height = rect.height * 1.3; // Min size, void long loop.\n\n maxW = Math.max(maxW, width, 7);\n maxH = Math.max(maxH, height, 7);\n }\n\n var dw = maxW / unitW;\n var dh = maxH / unitH; // 0/0 is NaN, 1/0 is Infinity.\n\n isNaN(dw) && (dw = Infinity);\n isNaN(dh) && (dh = Infinity);\n var interval = Math.max(0, Math.floor(Math.min(dw, dh)));\n var cache = inner(axis.model);\n var axisExtent = axis.getExtent();\n var lastAutoInterval = cache.lastAutoInterval;\n var lastTickCount = cache.lastTickCount; // Use cache to keep interval stable while moving zoom window,\n // otherwise the calculated interval might jitter when the zoom\n // window size is close to the interval-changing size.\n // For example, if all of the axis labels are `a, b, c, d, e, f, g`.\n // The jitter will cause that sometimes the displayed labels are\n // `a, d, g` (interval: 2) sometimes `a, c, e`(interval: 1).\n\n if (lastAutoInterval != null && lastTickCount != null && Math.abs(lastAutoInterval - interval) <= 1 && Math.abs(lastTickCount - tickCount) <= 1 // Always choose the bigger one, otherwise the critical\n // point is not the same when zooming in or zooming out.\n && lastAutoInterval > interval // If the axis change is caused by chart resize, the cache should not\n // be used. Otherwise some hiden labels might not be shown again.\n && cache.axisExtend0 === axisExtent[0] && cache.axisExtend1 === axisExtent[1]) {\n interval = lastAutoInterval;\n } // Only update cache if cache not used, otherwise the\n // changing of interval is too insensitive.\n else {\n cache.lastTickCount = tickCount;\n cache.lastAutoInterval = interval;\n cache.axisExtend0 = axisExtent[0];\n cache.axisExtend1 = axisExtent[1];\n }\n\n return interval;\n}", "function calculateCategoryInterval(axis) {\n var params = fetchAutoCategoryIntervalCalculationParams(axis);\n var labelFormatter = makeLabelFormatter(axis);\n var rotation = (params.axisRotate - params.labelRotate) / 180 * Math.PI;\n var ordinalScale = axis.scale;\n var ordinalExtent = ordinalScale.getExtent(); // Providing this method is for optimization:\n // avoid generating a long array by `getTicks`\n // in large category data case.\n\n var tickCount = ordinalScale.count();\n\n if (ordinalExtent[1] - ordinalExtent[0] < 1) {\n return 0;\n }\n\n var step = 1; // Simple optimization. Empirical value: tick count should less than 40.\n\n if (tickCount > 40) {\n step = Math.max(1, Math.floor(tickCount / 40));\n }\n\n var tickValue = ordinalExtent[0];\n var unitSpan = axis.dataToCoord(tickValue + 1) - axis.dataToCoord(tickValue);\n var unitW = Math.abs(unitSpan * Math.cos(rotation));\n var unitH = Math.abs(unitSpan * Math.sin(rotation));\n var maxW = 0;\n var maxH = 0; // Caution: Performance sensitive for large category data.\n // Consider dataZoom, we should make appropriate step to avoid O(n) loop.\n\n for (; tickValue <= ordinalExtent[1]; tickValue += step) {\n var width = 0;\n var height = 0; // Not precise, do not consider align and vertical align\n // and each distance from axis line yet.\n\n var rect = textContain.getBoundingRect(labelFormatter(tickValue), params.font, 'center', 'top'); // Magic number\n\n width = rect.width * 1.3;\n height = rect.height * 1.3; // Min size, void long loop.\n\n maxW = Math.max(maxW, width, 7);\n maxH = Math.max(maxH, height, 7);\n }\n\n var dw = maxW / unitW;\n var dh = maxH / unitH; // 0/0 is NaN, 1/0 is Infinity.\n\n isNaN(dw) && (dw = Infinity);\n isNaN(dh) && (dh = Infinity);\n var interval = Math.max(0, Math.floor(Math.min(dw, dh)));\n var cache = inner(axis.model);\n var axisExtent = axis.getExtent();\n var lastAutoInterval = cache.lastAutoInterval;\n var lastTickCount = cache.lastTickCount; // Use cache to keep interval stable while moving zoom window,\n // otherwise the calculated interval might jitter when the zoom\n // window size is close to the interval-changing size.\n // For example, if all of the axis labels are `a, b, c, d, e, f, g`.\n // The jitter will cause that sometimes the displayed labels are\n // `a, d, g` (interval: 2) sometimes `a, c, e`(interval: 1).\n\n if (lastAutoInterval != null && lastTickCount != null && Math.abs(lastAutoInterval - interval) <= 1 && Math.abs(lastTickCount - tickCount) <= 1 // Always choose the bigger one, otherwise the critical\n // point is not the same when zooming in or zooming out.\n && lastAutoInterval > interval // If the axis change is caused by chart resize, the cache should not\n // be used. Otherwise some hiden labels might not be shown again.\n && cache.axisExtend0 === axisExtent[0] && cache.axisExtend1 === axisExtent[1]) {\n interval = lastAutoInterval;\n } // Only update cache if cache not used, otherwise the\n // changing of interval is too insensitive.\n else {\n cache.lastTickCount = tickCount;\n cache.lastAutoInterval = interval;\n cache.axisExtend0 = axisExtent[0];\n cache.axisExtend1 = axisExtent[1];\n }\n\n return interval;\n}", "function calculateCategoryInterval(axis) {\n\t var params = fetchAutoCategoryIntervalCalculationParams(axis);\n\t var labelFormatter = makeLabelFormatter(axis);\n\t var rotation = (params.axisRotate - params.labelRotate) / 180 * Math.PI;\n\t var ordinalScale = axis.scale;\n\t var ordinalExtent = ordinalScale.getExtent(); // Providing this method is for optimization:\n\t // avoid generating a long array by `getTicks`\n\t // in large category data case.\n\t\n\t var tickCount = ordinalScale.count();\n\t\n\t if (ordinalExtent[1] - ordinalExtent[0] < 1) {\n\t return 0;\n\t }\n\t\n\t var step = 1; // Simple optimization. Empirical value: tick count should less than 40.\n\t\n\t if (tickCount > 40) {\n\t step = Math.max(1, Math.floor(tickCount / 40));\n\t }\n\t\n\t var tickValue = ordinalExtent[0];\n\t var unitSpan = axis.dataToCoord(tickValue + 1) - axis.dataToCoord(tickValue);\n\t var unitW = Math.abs(unitSpan * Math.cos(rotation));\n\t var unitH = Math.abs(unitSpan * Math.sin(rotation));\n\t var maxW = 0;\n\t var maxH = 0; // Caution: Performance sensitive for large category data.\n\t // Consider dataZoom, we should make appropriate step to avoid O(n) loop.\n\t\n\t for (; tickValue <= ordinalExtent[1]; tickValue += step) {\n\t var width = 0;\n\t var height = 0; // Not precise, do not consider align and vertical align\n\t // and each distance from axis line yet.\n\t\n\t var rect = getBoundingRect(labelFormatter({\n\t value: tickValue\n\t }), params.font, 'center', 'top'); // Magic number\n\t\n\t width = rect.width * 1.3;\n\t height = rect.height * 1.3; // Min size, void long loop.\n\t\n\t maxW = Math.max(maxW, width, 7);\n\t maxH = Math.max(maxH, height, 7);\n\t }\n\t\n\t var dw = maxW / unitW;\n\t var dh = maxH / unitH; // 0/0 is NaN, 1/0 is Infinity.\n\t\n\t isNaN(dw) && (dw = Infinity);\n\t isNaN(dh) && (dh = Infinity);\n\t var interval = Math.max(0, Math.floor(Math.min(dw, dh)));\n\t var cache = inner$4(axis.model);\n\t var axisExtent = axis.getExtent();\n\t var lastAutoInterval = cache.lastAutoInterval;\n\t var lastTickCount = cache.lastTickCount; // Use cache to keep interval stable while moving zoom window,\n\t // otherwise the calculated interval might jitter when the zoom\n\t // window size is close to the interval-changing size.\n\t // For example, if all of the axis labels are `a, b, c, d, e, f, g`.\n\t // The jitter will cause that sometimes the displayed labels are\n\t // `a, d, g` (interval: 2) sometimes `a, c, e`(interval: 1).\n\t\n\t if (lastAutoInterval != null && lastTickCount != null && Math.abs(lastAutoInterval - interval) <= 1 && Math.abs(lastTickCount - tickCount) <= 1 // Always choose the bigger one, otherwise the critical\n\t // point is not the same when zooming in or zooming out.\n\t && lastAutoInterval > interval // If the axis change is caused by chart resize, the cache should not\n\t // be used. Otherwise some hiden labels might not be shown again.\n\t && cache.axisExtent0 === axisExtent[0] && cache.axisExtent1 === axisExtent[1]) {\n\t interval = lastAutoInterval;\n\t } // Only update cache if cache not used, otherwise the\n\t // changing of interval is too insensitive.\n\t else {\n\t cache.lastTickCount = tickCount;\n\t cache.lastAutoInterval = interval;\n\t cache.axisExtent0 = axisExtent[0];\n\t cache.axisExtent1 = axisExtent[1];\n\t }\n\t\n\t return interval;\n\t }", "function calculateCategoryInterval(axis) {\n var params = fetchAutoCategoryIntervalCalculationParams(axis);\n var labelFormatter = makeLabelFormatter(axis);\n var rotation = (params.axisRotate - params.labelRotate) / 180 * Math.PI;\n var ordinalScale = axis.scale;\n var ordinalExtent = ordinalScale.getExtent(); // Providing this method is for optimization:\n // avoid generating a long array by `getTicks`\n // in large category data case.\n\n var tickCount = ordinalScale.count();\n\n if (ordinalExtent[1] - ordinalExtent[0] < 1) {\n return 0;\n }\n\n var step = 1; // Simple optimization. Empirical value: tick count should less than 40.\n\n if (tickCount > 40) {\n step = Math.max(1, Math.floor(tickCount / 40));\n }\n\n var tickValue = ordinalExtent[0];\n var unitSpan = axis.dataToCoord(tickValue + 1) - axis.dataToCoord(tickValue);\n var unitW = Math.abs(unitSpan * Math.cos(rotation));\n var unitH = Math.abs(unitSpan * Math.sin(rotation));\n var maxW = 0;\n var maxH = 0; // Caution: Performance sensitive for large category data.\n // Consider dataZoom, we should make appropriate step to avoid O(n) loop.\n\n for (; tickValue <= ordinalExtent[1]; tickValue += step) {\n var width = 0;\n var height = 0; // Not precise, do not consider align and vertical align\n // and each distance from axis line yet.\n\n var rect = contain_text[\"e\" /* getBoundingRect */](labelFormatter({\n value: tickValue\n }), params.font, 'center', 'top'); // Magic number\n\n width = rect.width * 1.3;\n height = rect.height * 1.3; // Min size, void long loop.\n\n maxW = Math.max(maxW, width, 7);\n maxH = Math.max(maxH, height, 7);\n }\n\n var dw = maxW / unitW;\n var dh = maxH / unitH; // 0/0 is NaN, 1/0 is Infinity.\n\n isNaN(dw) && (dw = Infinity);\n isNaN(dh) && (dh = Infinity);\n var interval = Math.max(0, Math.floor(Math.min(dw, dh)));\n var cache = inner(axis.model);\n var axisExtent = axis.getExtent();\n var lastAutoInterval = cache.lastAutoInterval;\n var lastTickCount = cache.lastTickCount; // Use cache to keep interval stable while moving zoom window,\n // otherwise the calculated interval might jitter when the zoom\n // window size is close to the interval-changing size.\n // For example, if all of the axis labels are `a, b, c, d, e, f, g`.\n // The jitter will cause that sometimes the displayed labels are\n // `a, d, g` (interval: 2) sometimes `a, c, e`(interval: 1).\n\n if (lastAutoInterval != null && lastTickCount != null && Math.abs(lastAutoInterval - interval) <= 1 && Math.abs(lastTickCount - tickCount) <= 1 // Always choose the bigger one, otherwise the critical\n // point is not the same when zooming in or zooming out.\n && lastAutoInterval > interval // If the axis change is caused by chart resize, the cache should not\n // be used. Otherwise some hiden labels might not be shown again.\n && cache.axisExtent0 === axisExtent[0] && cache.axisExtent1 === axisExtent[1]) {\n interval = lastAutoInterval;\n } // Only update cache if cache not used, otherwise the\n // changing of interval is too insensitive.\n else {\n cache.lastTickCount = tickCount;\n cache.lastAutoInterval = interval;\n cache.axisExtent0 = axisExtent[0];\n cache.axisExtent1 = axisExtent[1];\n }\n\n return interval;\n}", "function calculateCategoryInterval(axis) {\n var params = fetchAutoCategoryIntervalCalculationParams(axis);\n var labelFormatter = makeLabelFormatter(axis);\n var rotation = (params.axisRotate - params.labelRotate) / 180 * Math.PI;\n var ordinalScale = axis.scale;\n var ordinalExtent = ordinalScale.getExtent(); // Providing this method is for optimization:\n // avoid generating a long array by `getTicks`\n // in large category data case.\n\n var tickCount = ordinalScale.count();\n\n if (ordinalExtent[1] - ordinalExtent[0] < 1) {\n return 0;\n }\n\n var step = 1; // Simple optimization. Empirical value: tick count should less than 40.\n\n if (tickCount > 40) {\n step = Math.max(1, Math.floor(tickCount / 40));\n }\n\n var tickValue = ordinalExtent[0];\n var unitSpan = axis.dataToCoord(tickValue + 1) - axis.dataToCoord(tickValue);\n var unitW = Math.abs(unitSpan * Math.cos(rotation));\n var unitH = Math.abs(unitSpan * Math.sin(rotation));\n var maxW = 0;\n var maxH = 0; // Caution: Performance sensitive for large category data.\n // Consider dataZoom, we should make appropriate step to avoid O(n) loop.\n\n for (; tickValue <= ordinalExtent[1]; tickValue += step) {\n var width = 0;\n var height = 0; // Polar is also calculated in assumptive linear layout here.\n // Not precise, do not consider align and vertical align\n // and each distance from axis line yet.\n\n var rect = textContain.getBoundingRect(labelFormatter(tickValue), params.font, 'center', 'top'); // Magic number\n\n width = rect.width * 1.3;\n height = rect.height * 1.3; // Min size, void long loop.\n\n maxW = Math.max(maxW, width, 7);\n maxH = Math.max(maxH, height, 7);\n }\n\n var dw = maxW / unitW;\n var dh = maxH / unitH; // 0/0 is NaN, 1/0 is Infinity.\n\n isNaN(dw) && (dw = Infinity);\n isNaN(dh) && (dh = Infinity);\n var interval = Math.max(0, Math.floor(Math.min(dw, dh)));\n var cache = inner(axis.model);\n var lastAutoInterval = cache.lastAutoInterval;\n var lastTickCount = cache.lastTickCount; // Use cache to keep interval stable while moving zoom window,\n // otherwise the calculated interval might jitter when the zoom\n // window size is close to the interval-changing size.\n\n if (lastAutoInterval != null && lastTickCount != null && Math.abs(lastAutoInterval - interval) <= 1 && Math.abs(lastTickCount - tickCount) <= 1 // Always choose the bigger one, otherwise the critical\n // point is not the same when zooming in or zooming out.\n && lastAutoInterval > interval) {\n interval = lastAutoInterval;\n } // Only update cache if cache not used, otherwise the\n // changing of interval is too insensitive.\n else {\n cache.lastTickCount = tickCount;\n cache.lastAutoInterval = interval;\n }\n\n return interval;\n}", "function makeLabelsByCustomizedCategoryInterval(axis, categoryInterval, onlyTick) {\n var ordinalScale = axis.scale;\n var labelFormatter = makeLabelFormatter(axis);\n var result = [];\n zrUtil.each(ordinalScale.getTicks(), function (tickValue) {\n var rawLabel = ordinalScale.getLabel(tickValue);\n\n if (categoryInterval(tickValue, rawLabel)) {\n result.push(onlyTick ? tickValue : {\n formattedLabel: labelFormatter(tickValue),\n rawLabel: rawLabel,\n tickValue: tickValue\n });\n }\n });\n return result;\n} // Can be null|'auto'|number|function", "function makeLabelsByCustomizedCategoryInterval(axis, categoryInterval, onlyTick) {\n var ordinalScale = axis.scale;\n var labelFormatter = makeLabelFormatter(axis);\n var result = [];\n zrUtil.each(ordinalScale.getTicks(), function (tickValue) {\n var rawLabel = ordinalScale.getLabel(tickValue);\n\n if (categoryInterval(tickValue, rawLabel)) {\n result.push(onlyTick ? tickValue : {\n formattedLabel: labelFormatter(tickValue),\n rawLabel: rawLabel,\n tickValue: tickValue\n });\n }\n });\n return result;\n}", "function makeLabelsByCustomizedCategoryInterval(axis, categoryInterval, onlyTick) {\n var ordinalScale = axis.scale;\n var labelFormatter = makeLabelFormatter(axis);\n var result = [];\n zrUtil.each(ordinalScale.getTicks(), function (tickValue) {\n var rawLabel = ordinalScale.getLabel(tickValue);\n\n if (categoryInterval(tickValue, rawLabel)) {\n result.push(onlyTick ? tickValue : {\n formattedLabel: labelFormatter(tickValue),\n rawLabel: rawLabel,\n tickValue: tickValue\n });\n }\n });\n return result;\n}", "function makeLabelsByCustomizedCategoryInterval(axis, categoryInterval, onlyTick) {\n var ordinalScale = axis.scale;\n var labelFormatter = makeLabelFormatter(axis);\n var result = [];\n zrUtil.each(ordinalScale.getTicks(), function (tickValue) {\n var rawLabel = ordinalScale.getLabel(tickValue);\n\n if (categoryInterval(tickValue, rawLabel)) {\n result.push(onlyTick ? tickValue : {\n formattedLabel: labelFormatter(tickValue),\n rawLabel: rawLabel,\n tickValue: tickValue\n });\n }\n });\n return result;\n}", "function makeLabelsByCustomizedCategoryInterval(axis, categoryInterval, onlyTick) {\n var ordinalScale = axis.scale;\n var labelFormatter = makeLabelFormatter(axis);\n var result = [];\n zrUtil.each(ordinalScale.getTicks(), function (tickValue) {\n var rawLabel = ordinalScale.getLabel(tickValue);\n\n if (categoryInterval(tickValue, rawLabel)) {\n result.push(onlyTick ? tickValue : {\n formattedLabel: labelFormatter(tickValue),\n rawLabel: rawLabel,\n tickValue: tickValue\n });\n }\n });\n return result;\n}", "addTicksAndLabels() {\n const that = this.context,\n trackLength = that._measurements.trackLength,\n normalLayout = that._normalLayout,\n ticksFrequency = that._majorTicksInterval,\n tickscount = Math.round(that._range / parseFloat((ticksFrequency.toString()))),\n ticksDistance = trackLength / tickscount,\n min = parseFloat(that._drawMin),\n max = parseFloat(that._drawMax);\n\n let first, second, distanceModifier, last, firstLabelValue, firstLabelSize, lastLabelValue, lastLabelSize, currentTickAndLabel, ticks = '', labels = '';\n\n that._tickValues = [];\n this._longestLabelSize = 0;\n\n if (normalLayout) {\n first = min;\n\n //handling specific case\n if (that.logarithmicScale && min < 0 && min !== -1) {\n second = parseFloat(first - this.getPreciseModulo(first, ticksFrequency));\n }\n else {\n second = parseFloat(first - this.getPreciseModulo(first, ticksFrequency) + parseFloat(ticksFrequency));\n }\n\n distanceModifier = second - first;\n firstLabelValue = that._formatLabel(min);\n firstLabelSize = that._tickIntervalHandler.labelsSize.minLabelSize;\n last = max;\n lastLabelValue = that._formatLabel(max);\n lastLabelSize = that._tickIntervalHandler.labelsSize.maxLabelSize;\n }\n else {\n first = max;\n second = parseFloat(first - this.getPreciseModulo(first, ticksFrequency));\n distanceModifier = first - second;\n firstLabelValue = that._formatLabel(max);\n firstLabelSize = that._tickIntervalHandler.labelsSize.maxLabelSize;\n last = min;\n lastLabelValue = that._formatLabel(min);\n lastLabelSize = that._tickIntervalHandler.labelsSize.minLabelSize;\n }\n\n that._labelDummy = this._createMeasureLabel();\n\n currentTickAndLabel = this._addMajorTickAndLabel(firstLabelValue, firstLabelSize, true, first); // first tick and label\n ticks += currentTickAndLabel.tick;\n labels += currentTickAndLabel.label;\n\n // special case for second tick and label\n const distanceFromFirstToSecond = distanceModifier / ticksFrequency * ticksDistance;\n\n if (second.toString() !== that._drawMax.toString() && distanceFromFirstToSecond < trackLength) {\n // second item rendering\n const secondItemHtmlValue = that._formatLabel(second.toString()),\n plotSecond = firstLabelSize < distanceFromFirstToSecond;\n\n currentTickAndLabel = this._addMajorTickAndLabel(secondItemHtmlValue, undefined, plotSecond, second, true);\n ticks += currentTickAndLabel.tick;\n labels += currentTickAndLabel.label;\n }\n\n currentTickAndLabel = this.addMiddleMajorTicks(tickscount, ticksDistance, distanceFromFirstToSecond, distanceModifier, normalLayout, ticksFrequency);\n ticks += currentTickAndLabel.tick;\n labels += currentTickAndLabel.label;\n currentTickAndLabel = this._addMajorTickAndLabel(lastLabelValue, lastLabelSize, true, last); // last tick and label\n ticks += currentTickAndLabel.tick;\n labels += currentTickAndLabel.label;\n ticks += this.addMinorTicks(normalLayout);\n\n that._measureLabelScale.removeChild(that._labelDummy);\n delete that._labelDummy;\n delete that._measureLabelScale;\n\n if (that.nodeName.toLowerCase() === 'jqx-tank') {\n that._updateScaleWidth(this._longestLabelSize);\n }\n\n that._appendTicksAndLabelsToScales(ticks, labels);\n }", "addGaugeTicksAndLabels() {\n const that = this.context,\n numericProcessor = this,\n maxLabelHeight = Math.max(that._tickIntervalHandler.labelsSize.minLabelSize, that._tickIntervalHandler.labelsSize.maxLabelSize),\n majorStep = that._majorTicksInterval,\n minorStep = that._minorTicksInterval,\n majorTickValues = {},\n distance = that._distance,\n radius = that._measurements.radius,\n majorTickWidth = radius - distance.majorTickDistance,\n minorTickWidth = radius - distance.minorTickDistance;\n let drawMajor, drawMinor, addLabel, currentAngle, angleAtMin, angleAtMax;\n\n if (that.ticksVisibility !== 'none' && that._plotTicks !== false) {\n drawMajor = function (angle) {\n that._drawTick(angle, majorTickWidth, 'major');\n };\n\n drawMinor = function (value) {\n that._drawTick(numericProcessor.getAngleByValue(value, true), minorTickWidth, 'minor');\n };\n }\n else {\n drawMajor = function () { };\n drawMinor = function () { };\n }\n\n if (that.labelsVisibility !== 'none' && that._plotLabels !== false) {\n addLabel = function (angle, currentLabel, middle) {\n that._drawLabel(angle, currentLabel, distance.labelDistance, middle);\n };\n }\n else {\n addLabel = function () { };\n }\n\n if (!that.inverted) {\n angleAtMin = that.endAngle;\n angleAtMax = that.startAngle;\n }\n else {\n angleAtMin = that.startAngle;\n angleAtMax = that.endAngle;\n }\n\n // first major tick and label\n currentAngle = numericProcessor.getAngleByValue(that._drawMin, false);\n drawMajor(currentAngle);\n majorTickValues[that._drawMin] = true;\n addLabel(currentAngle, that.min, false);\n\n let second = that._drawMin - numericProcessor.getPreciseModulo(that._drawMin, majorStep),\n firstMinTick;\n\n if (that._drawMin >= 0) {\n second += majorStep;\n }\n\n // determines the value at the first minor tick\n for (let i = second; i >= that._drawMin; i = i - minorStep) {\n firstMinTick = i;\n }\n\n // second major tick and label\n currentAngle = numericProcessor.getAngleByValue(second, false);\n drawMajor(currentAngle);\n majorTickValues[second] = true;\n if (2 * Math.PI * that._measurements.innerRadius * (this._getAngleDifference(angleAtMin, numericProcessor.getAngleByValue(second, false, true)) / 360) > maxLabelHeight) {\n addLabel(currentAngle, this.getActualValue(second), second < that._drawMax);\n }\n\n let i;\n // middle major ticks and labels\n for (i = second + majorStep; i < that._drawMax - majorStep; i += majorStep) {\n currentAngle = numericProcessor.getAngleByValue(i, false);\n drawMajor(currentAngle);\n majorTickValues[i] = true;\n addLabel(currentAngle, this.getActualValue(i), true);\n }\n\n if (majorTickValues[i] === undefined && i <= that._drawMax) {\n // second-to-last major tick and label\n currentAngle = numericProcessor.getAngleByValue(i, false);\n drawMajor(currentAngle);\n majorTickValues[i] = true;\n if (2 * Math.PI * that._measurements.innerRadius * (this._getAngleDifference(angleAtMax, numericProcessor.getAngleByValue(i, false, true)) / 360) >= maxLabelHeight) {\n addLabel(currentAngle, this.getActualValue(i), true);\n }\n\n if (that._normalizedStartAngle !== that.endAngle) {\n // last major tick and label\n currentAngle = numericProcessor.getAngleByValue(that._drawMax, false);\n drawMajor(currentAngle);\n majorTickValues[that._drawMax] = true;\n if (2 * Math.PI * that._measurements.innerRadius * (this._getAngleDifference(angleAtMax, angleAtMin) / 360) >= maxLabelHeight) {\n addLabel(currentAngle, that.max, false);\n }\n }\n }\n\n // minor ticks\n if (!that.logarithmicScale) {\n for (let j = firstMinTick; j < that._drawMax; j += minorStep) {\n if (majorTickValues[j]) {\n continue; // does not plot minor ticks over major ones\n }\n drawMinor(j);\n }\n }\n else {\n this.drawGaugeLogarithmicScaleMinorTicks(majorTickValues, majorStep, drawMinor);\n }\n }", "_calculateTickAndLabelDistance() {\n const that = this,\n measurements = that._measurements;\n\n if (that.scalePosition === 'none') {\n that._plotLabels = false;\n that._plotTicks = false;\n\n measurements.innerRadius = measurements.radius;\n\n return { majorTickDistance: 0, minorTickDistance: 0, labelDistance: 0, needleDistance: 0, trackDistance: 0 };\n }\n\n const labelsSize = that._tickIntervalHandler.labelsSize,\n labelSizeCoefficient = that._largestLabelSize || Math.max(labelsSize.minLabelSize, labelsSize.minLabelOtherSize, labelsSize.maxLabelSize, labelsSize.maxLabelOtherSize);\n let majorTickDistance = 1,\n minorTickDistance,\n labelDistance,\n needleDistance,\n trackDistance = 0;\n\n that._largestLabelSize = labelSizeCoefficient;\n\n if (that.scalePosition === 'outside') {\n majorTickDistance = labelSizeCoefficient;\n minorTickDistance = majorTickDistance + measurements.majorTickSize - measurements.minorTickSize;\n labelDistance = 0;\n }\n\n if (that.analogDisplayType === 'needle') {\n if (that.scalePosition === 'outside') {\n needleDistance = majorTickDistance + measurements.majorTickSize;\n }\n else {\n needleDistance = majorTickDistance + measurements.majorTickSize + labelSizeCoefficient;\n }\n\n if (that.ticksVisibility === 'none') {\n labelDistance = 0;\n needleDistance -= measurements.majorTickSize;\n }\n if (that.labelsVisibility === 'none') {\n needleDistance -= labelSizeCoefficient;\n if (that.scalePosition === 'outside') {\n majorTickDistance -= labelSizeCoefficient;\n minorTickDistance -= labelSizeCoefficient;\n }\n }\n }\n else {\n if (that.labelsVisibility === 'none' && that.ticksVisibility === 'none') {\n trackDistance = 0;\n }\n else {\n if (that.scalePosition === 'outside') {\n if (that.ticksPosition === 'scale') {\n if (that.labelsVisibility === 'none') {\n majorTickDistance = 1;\n minorTickDistance = 1 + measurements.majorTickSize - measurements.minorTickSize;\n }\n if (that.ticksVisibility !== 'none') {\n trackDistance = majorTickDistance + measurements.majorTickSize + 2;\n }\n else {\n trackDistance = labelSizeCoefficient;\n }\n }\n else {\n if (that.labelsVisibility !== 'none') {\n minorTickDistance = minorTickDistance - (measurements.trackWidth + measurements.trackBorderWidth) / 4;\n trackDistance = majorTickDistance - 1;\n }\n else {\n majorTickDistance = 1;\n minorTickDistance = (measurements.trackWidth + measurements.trackBorderWidth) / 4 + 1;\n trackDistance = 0;\n }\n }\n }\n else {\n if (that.ticksPosition === 'scale') {\n majorTickDistance = measurements.trackWidth + 1.5 * measurements.trackBorderWidth + 2;\n if (that.ticksVisibility === 'none') {\n labelDistance = majorTickDistance;\n }\n }\n else {\n minorTickDistance = (measurements.trackWidth + measurements.trackBorderWidth) / 4 + 1;\n }\n }\n }\n }\n\n if (minorTickDistance === undefined) {\n minorTickDistance = majorTickDistance;\n }\n\n if (labelDistance === undefined) {\n labelDistance = majorTickDistance + measurements.majorTickSize;\n }\n\n measurements.innerRadius = measurements.radius - labelDistance;\n\n delete that._plotLabels;\n delete that._plotTicks;\n delete that._equalToHalfRadius;\n if (that.scalePosition === 'inside') {\n if (measurements.innerRadius < labelSizeCoefficient) {\n that._plotLabels = false;\n\n if (that.ticksPosition === 'scale') {\n if (that.analogDisplayType !== 'needle' && measurements.innerRadius < measurements.majorTickSize) {\n that._plotTicks = false;\n }\n }\n else {\n that._equalToHalfRadius = true;\n measurements.innerRadius = measurements.radius / 2;\n }\n }\n }\n else if (measurements.radius - trackDistance - measurements.trackBorderWidth < measurements.trackWidth) {\n measurements.trackWidth = measurements.radius - trackDistance - measurements.trackBorderWidth;\n measurements.lineSize = measurements.trackWidth + measurements.trackBorderWidth;\n if (that.ticksPosition === 'track') {\n measurements.majorTickSize = measurements.lineSize;\n measurements.minorTickSize = measurements.majorTickSize / 2;\n minorTickDistance = majorTickDistance + (measurements.majorTickSize - measurements.minorTickSize) / 2;\n }\n }\n\n return { majorTickDistance: majorTickDistance, minorTickDistance: minorTickDistance, labelDistance: labelDistance, needleDistance: needleDistance, trackDistance: trackDistance };\n }", "_calculateTickInterval() {\n const that = this,\n intervals = that._tickIntervalHandler.getInterval('radial', that._drawMin, that._drawMax, that.$.container, that.logarithmicScale);\n\n if (intervals.major !== that._majorTicksInterval) {\n that._intervalHasChanged = true;\n that._majorTicksInterval = intervals.major;\n }\n else {\n that._intervalHasChanged = true;\n }\n\n that._minorTicksInterval = intervals.minor;\n\n if (that.mode === 'date') {\n that._calculateDateInterval(intervals.major);\n }\n }", "_calculateTickInterval() {\n const that = this;\n let intervals = that._tickIntervalHandler.getInterval('linear', that._drawMin, that._drawMax, that.$.track, that.logarithmicScale);\n\n if (intervals.major !== that._majorTicksInterval) {\n that._intervalHasChanged = true;\n that._majorTicksInterval = intervals.major;\n }\n else {\n that._intervalHasChanged = true;\n }\n\n that._minorTicksInterval = intervals.minor;\n\n if (that.mode === 'date') {\n that._calculateDateInterval(intervals.major);\n }\n }", "addGaugeTicksAndLabels() {\n const ignored = JQX.Utilities.BigNumber.ignoreBigIntNativeSupport;\n\n JQX.Utilities.BigNumber.ignoreBigIntNativeSupport = true;\n\n const that = this.context,\n numericProcessor = this,\n maxLabelHeight = Math.max(that._tickIntervalHandler.labelsSize.minLabelSize, that._tickIntervalHandler.labelsSize.maxLabelSize),\n majorStep = that._majorTicksInterval,\n minorStep = that._minorTicksInterval,\n majorTickValues = {},\n distance = that._distance,\n radius = that._measurements.radius,\n majorTickWidth = radius - distance.majorTickDistance,\n minorTickWidth = radius - distance.minorTickDistance,\n bigDrawMin = new JQX.Utilities.BigNumber(that._drawMin),\n bigDrawMax = new JQX.Utilities.BigNumber(that._drawMax);\n let drawMajor, drawMinor, addLabel, currentAngle, angleAtMin, angleAtMax;\n\n if (that.ticksVisibility !== 'none' && that._plotTicks !== false) {\n drawMajor = function (angle) {\n that._drawTick(angle, majorTickWidth, 'major');\n };\n\n drawMinor = function (value) {\n that._drawTick(numericProcessor.getAngleByValue(value, true), minorTickWidth, 'minor');\n };\n }\n else {\n drawMajor = function () { };\n drawMinor = function () { };\n }\n\n if (that.labelsVisibility !== 'none' && that._plotLabels !== false) {\n addLabel = function (angle, currentLabel, middle) {\n that._drawLabel(angle, currentLabel, distance.labelDistance, middle);\n };\n }\n else {\n addLabel = function () { };\n }\n\n if (!that.inverted) {\n angleAtMin = that.endAngle;\n angleAtMax = that.startAngle;\n }\n else {\n angleAtMin = that.startAngle;\n angleAtMax = that.endAngle;\n }\n\n // first major tick and label\n currentAngle = numericProcessor.getAngleByValue(bigDrawMin, false);\n drawMajor(currentAngle);\n majorTickValues[that._drawMin.toString()] = true;\n addLabel(currentAngle, that.min, false);\n\n let second = bigDrawMin.subtract(bigDrawMin.mod(majorStep)),\n firstMinTick;\n\n if (bigDrawMin.compare(0) !== -1) {\n second = second.add(majorStep);\n }\n\n // determines the value at the first minor tick\n for (let i = new JQX.Utilities.BigNumber(second); i.compare(bigDrawMin) !== -1; i = i.subtract(minorStep)) {\n firstMinTick = i;\n }\n\n // second major tick and label\n currentAngle = numericProcessor.getAngleByValue(second, false);\n drawMajor(currentAngle);\n majorTickValues[second.toString()] = true;\n if (2 * Math.PI * that._measurements.innerRadius * (this._getAngleDifference(angleAtMin, numericProcessor.getAngleByValue(second, false, true)) / 360) > maxLabelHeight) {\n addLabel(currentAngle, this.getActualValue(second), second.compare(bigDrawMax) === -1);\n }\n\n let i;\n // middle major ticks and labels\n for (i = second.add(majorStep); i.compare(bigDrawMax.subtract(majorStep)) === -1; i = i.add(majorStep)) {\n currentAngle = numericProcessor.getAngleByValue(i, false);\n drawMajor(currentAngle);\n majorTickValues[i.toString()] = true;\n addLabel(currentAngle, this.getActualValue(i), true);\n }\n\n if (majorTickValues[i.toString()] === undefined && i.compare(bigDrawMax) !== 1) {\n // second-to-last major tick and label\n currentAngle = numericProcessor.getAngleByValue(i, false);\n drawMajor(currentAngle);\n majorTickValues[i.toString()] = true;\n if (2 * Math.PI * that._measurements.innerRadius * (this._getAngleDifference(angleAtMax, numericProcessor.getAngleByValue(i, false, true)) / 360) >= maxLabelHeight) {\n addLabel(currentAngle, this.getActualValue(i), true);\n }\n\n if (that._normalizedStartAngle !== that.endAngle) {\n // last major tick and label\n currentAngle = numericProcessor.getAngleByValue(bigDrawMax, false);\n drawMajor(currentAngle);\n if (2 * Math.PI * that._measurements.innerRadius * (this._getAngleDifference(angleAtMax, angleAtMin) / 360) >= maxLabelHeight) {\n addLabel(currentAngle, that.max, false);\n }\n }\n }\n\n if (that.mode === 'date') {\n JQX.Utilities.BigNumber.ignoreBigIntNativeSupport = ignored;\n return;\n }\n\n // minor ticks\n if (!that.logarithmicScale) {\n for (let j = firstMinTick; j.compare(bigDrawMax) === -1; j = j.add(minorStep)) {\n if (majorTickValues[j.toString()]) {\n continue; // does not plot minor ticks over major ones\n }\n drawMinor(j);\n }\n }\n else {\n this.drawGaugeLogarithmicScaleMinorTicks(majorTickValues, majorStep, drawMinor);\n }\n\n JQX.Utilities.BigNumber.ignoreBigIntNativeSupport = ignored;\n }", "addTicksAndLabels() {\n const ignored = JQX.Utilities.BigNumber.ignoreBigIntNativeSupport;\n\n JQX.Utilities.BigNumber.ignoreBigIntNativeSupport = true;\n\n const that = this.context,\n trackLength = that._measurements.trackLength,\n normalLayout = that._normalLayout,\n ticksFrequency = that._majorTicksInterval,\n tickscount = this.round(new JQX.Utilities.BigNumber(that._range).divide(ticksFrequency)),\n ticksDistance = trackLength / tickscount,\n min = new JQX.Utilities.BigNumber(that._drawMin),\n max = new JQX.Utilities.BigNumber(that._drawMax);\n\n\n let first, second, distanceModifier, last, firstLabelValue, firstLabelSize, lastLabelValue, lastLabelSize, currentTickAndLabel, ticks = '', labels = '';\n\n that._tickValues = [];\n this._longestLabelSize = 0;\n\n if (normalLayout) {\n first = min;\n second = ticksFrequency.add(first.subtract(first.mod(ticksFrequency)));\n distanceModifier = second.subtract(first);\n firstLabelValue = that._formatLabel(min);\n firstLabelSize = that._tickIntervalHandler.labelsSize.minLabelSize;\n last = max;\n lastLabelValue = that._formatLabel(max);\n lastLabelSize = that._tickIntervalHandler.labelsSize.maxLabelSize;\n }\n else {\n first = max;\n second = first.subtract(first.mod(ticksFrequency));\n distanceModifier = first.subtract(second);\n firstLabelValue = that._formatLabel(max);\n firstLabelSize = that._tickIntervalHandler.labelsSize.maxLabelSize;\n last = min;\n lastLabelValue = that._formatLabel(min);\n lastLabelSize = that._tickIntervalHandler.labelsSize.minLabelSize;\n }\n\n that._labelDummy = this._createMeasureLabel();\n\n currentTickAndLabel = this._addMajorTickAndLabel(firstLabelValue, firstLabelSize, true, first); // first tick and label\n ticks += currentTickAndLabel.tick;\n labels += currentTickAndLabel.label;\n\n // special case for second tick and label\n const distanceFromFirstToSecond = distanceModifier.divide(ticksFrequency).multiply(ticksDistance);\n\n if (second.compare(that.max) !== 0 && distanceFromFirstToSecond.compare(trackLength) < 0) {\n // second item rendering\n const secondItemHtmlValue = that._formatLabel(second.toString()),\n plotSecond = distanceFromFirstToSecond.compare(firstLabelSize) > 0;\n\n currentTickAndLabel = this._addMajorTickAndLabel(secondItemHtmlValue, undefined, plotSecond, second, true);\n ticks += currentTickAndLabel.tick;\n labels += currentTickAndLabel.label;\n }\n currentTickAndLabel = this.addMiddleMajorTicks(tickscount, ticksDistance, distanceFromFirstToSecond, distanceModifier, normalLayout, ticksFrequency);\n ticks += currentTickAndLabel.tick;\n labels += currentTickAndLabel.label;\n currentTickAndLabel = this._addMajorTickAndLabel(lastLabelValue, lastLabelSize, true, last); // last tick and label\n ticks += currentTickAndLabel.tick;\n labels += currentTickAndLabel.label;\n\n if (that.mode !== 'date') {\n ticks += this.addMinorTicks(normalLayout);\n }\n\n that._measureLabelScale.removeChild(that._labelDummy);\n delete that._labelDummy;\n delete that._measureLabelScale;\n\n if (that.nodeName.toLowerCase() === 'jqx-tank') {\n that._updateScaleWidth(this._longestLabelSize);\n }\n\n that._appendTicksAndLabelsToScales(ticks, labels);\n JQX.Utilities.BigNumber.ignoreBigIntNativeSupport = ignored;\n }", "_setTicksAndInterval() {\n const that = this;\n\n if (!that._isVisible() || that._renderingSuspended) {\n that._renderingSuspended = true;\n return;\n }\n\n //Set the New Format here\n let minLabel = that._formatLabel(that.min),\n maxLabel = that._formatLabel(that.max);\n\n //gets the range with the new min/max\n that._getRange();\n\n //creates a new tickIntervalHandler instance\n that._tickIntervalHandler = new JQX.Utilities.TickIntervalHandler(that, minLabel, maxLabel, 'jqx-label', that._settings.size, that.scaleType === 'integer', that.logarithmicScale);\n\n //re-arranges the layout\n that._layout();\n\n if (!that.customInterval) {\n // calculates the tickInterval\n that._calculateTickInterval();\n\n if (that._dateInterval) {\n that._intervalHasChanged = true;\n that._numericProcessor.addCustomTicks();\n }\n else {\n // Add the ticks and labels\n that._numericProcessor.addTicksAndLabels();\n }\n }\n else {\n if (that.mode === 'date') {\n that._calculateTickInterval()\n }\n\n // custom ticks\n that._intervalHasChanged = true;\n that._numericProcessor.addCustomTicks();\n }\n }", "niceScale (yMin, yMax, ticks = 10) {\n if ((yMin === Number.MIN_VALUE && yMax === 0) || (!Utils.isNumber(yMin) && !Utils.isNumber(yMax))) {\n // when all values are 0\n yMin = 0\n yMax = 1\n ticks = 1\n let justRange = this.justRange(yMin, yMax, ticks)\n return justRange\n }\n\n // Calculate Min amd Max graphical labels and graph\n // increments. The number of ticks defaults to\n // 10 which is the SUGGESTED value. Any tick value\n // entered is used as a suggested value which is\n // adjusted to be a 'pretty' value.\n //\n // Output will be an array of the Y axis values that\n // encompass the Y values.\n let result = []\n // If yMin and yMax are identical, then\n // adjust the yMin and yMax values to actually\n // make a graph. Also avoids division by zero errors.\n if (yMin === yMax) {\n yMin = yMin - 10 // some small value\n yMax = yMax + 10 // some small value\n }\n // Determine Range\n let range = yMax - yMin\n let tiks = ticks + 1\n // Adjust ticks if needed\n if (tiks < 2) {\n tiks = 2\n } else if (tiks > 2) {\n tiks -= 2\n }\n\n // Get raw step value\n let tempStep = range / tiks\n // Calculate pretty step value\n\n let mag = Math.floor(this.log10(tempStep))\n let magPow = Math.pow(10, mag)\n let magMsd = parseInt(tempStep / magPow)\n let stepSize = magMsd * magPow\n\n // build Y label array.\n // Lower and upper bounds calculations\n let lb = stepSize * Math.floor(yMin / stepSize)\n let ub = stepSize * Math.ceil((yMax / stepSize))\n // Build array\n let val = lb\n while (1) {\n result.push(val)\n val += stepSize\n if (val > ub) { break }\n }\n\n // TODO: need to remove this condition below which makes this function tightly coupled with w.\n if (this.w.config.yaxis[0].max === undefined &&\n this.w.config.yaxis[0].min === undefined) {\n return {\n result,\n niceMin: result[0],\n niceMax: result[result.length - 1]\n }\n } else {\n result = []\n let v = yMin\n result.push(v)\n let valuesDivider = Math.abs(yMax - yMin) / ticks\n for (let i = 0; i <= ticks - 1; i++) {\n v = v + valuesDivider\n result.push(v)\n }\n\n return {\n result,\n niceMin: result[0],\n niceMax: result[result.length - 1]\n }\n }\n }", "function calculateTicks(axis, axisOptions){\n\t\t\taxis.ticks = [];\t\n\t\t\tif(axisOptions.ticks){\n\t\t\t\tvar ticks = axisOptions.ticks;\n\t\n\t\t\t\tif(Object.isFunction(ticks)){\n\t\t\t\t\tticks = ticks({ min: axis.min, max: axis.max });\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t/**\n\t\t\t\t * Clean up the user-supplied ticks, copy them over.\n\t\t\t\t */\n\t\t\t\tfor(var i = 0, v, label; i < ticks.length; ++i){\n\t\t\t\t\tvar t = ticks[i];\n\t\t\t\t\tif(typeof(t) == 'object'){\n\t\t\t\t\t\tv = t[0];\n\t\t\t\t\t\tlabel = (t.length > 1) ? t[1] : axisOptions.tickFormatter(v);\n\t\t\t\t\t}else{\n\t\t\t\t\t\tv = t;\n\t\t\t\t\t\tlabel = axisOptions.tickFormatter(v);\n\t\t\t\t\t}\n\t\t\t\t\taxis.ticks[i] = { v: v, label: label };\n\t\t\t\t}\n\t\t\t}else{\n\t\t\t\t/**\n\t\t\t\t * Round to nearest multiple of tick size.\n\t\t\t\t */\n\t\t\t\tvar start = axis.tickSize * Math.ceil(axis.min / axis.tickSize);\n\t\t\t\t/**\n\t\t\t\t * Then spew out all possible ticks.\n\t\t\t\t */\n\t\t\t\tfor(i = 0; start + i * axis.tickSize <= axis.max; ++i){\n\t\t\t\t\tv = start + i * axis.tickSize;\n\t\t\t\t\t\n\t\t\t\t\t/**\n\t\t\t\t\t * Round (this is always needed to fix numerical instability).\n\t\t\t\t\t */\n\t\t\t\t\tvar decimals = axisOptions.tickDecimals;\n\t\t\t\t\tif(decimals == null) decimals = 1 - Math.floor(Math.log(axis.tickSize) / Math.LN10);\n\t\t\t\t\tif(decimals < 0) decimals = 0;\n\t\t\t\t\t\n\t\t\t\t\tv = v.toFixed(decimals);\n\t\t\t\t\taxis.ticks.push({ v: v, label: axisOptions.tickFormatter(v) });\n\t\t\t\t}\n\t\t\t}\n\t\t}", "_calcLabelTicks(startDate, endDate, groups) {\n let offset = -Math.ceil((new Date().getTimezoneOffset()) / 60);\n // Calculated intervall length\n let unitTime = this._calcBiggestTimeUnitDifference(startDate, endDate);\n let interval = Math.ceil(unitTime.difference / groups);\n let labels = [];\n\n for (let n = 0; n < groups - 1; n++) {\n labels.push(this._formatDate(new Date(unitTime.startDate.getTime() + interval * n), offset) + \"\\n - \\n\" + this._formatDate(new Date(unitTime.startDate.getTime() + interval * (n + 1)), offset));\n }\n labels.push(this._formatDate(new Date(unitTime.startDate.getTime() + interval * (groups - 1)), offset) + \"\\n - \\n\" + this._formatDate(new Date(unitTime.endDate.getTime()), offset));\n\n return {label: labels, interval: interval, startDate: unitTime.startDate, endDate: unitTime.endDate};\n }", "function tickCount() {\n if (width <= 530) {\n xAxis.ticks(5);\n yAxis.ticks(5);\n }\n else {\n xAxis.ticks(10);\n yAxis.ticks(10);\n } \n }", "addGaugeCustomTicks() {\n const numericProcessor = this,\n that = numericProcessor.context,\n distance = that._distance,\n majorTickWidth = that._measurements.radius - distance.majorTickDistance;\n let drawTick, drawLabel;\n\n if (that.ticksVisibility !== 'none' && that._plotTicks !== false) {\n drawTick = function (angle) {\n that._drawTick(angle, majorTickWidth, 'major');\n };\n }\n else {\n drawTick = function () { };\n }\n\n if (that.labelsVisibility !== 'none' && that._plotLabels !== false) {\n drawLabel = function (angle, currentLabel, middle) {\n that._drawLabel(angle, currentLabel, distance.labelDistance, middle);\n };\n }\n else {\n drawLabel = function () { };\n }\n\n function createTickAndLabel(i) {\n const currentLabel = that.customTicks[i],\n value = numericProcessor.createDescriptor(currentLabel),\n angle = numericProcessor.getAngleByValue(value, true),\n middle = i > 0 && i < that.customTicks.length - 1;\n\n drawTick(angle);\n drawLabel(angle, currentLabel, middle);\n }\n\n for (let i = that.customTicks.length - 1; i >= 0; i--) {\n createTickAndLabel(i);\n }\n }", "_calcLabelTicks(startDate, endDate, groups) {\n let offset = -Math.ceil((new Date().getTimezoneOffset()) / 60);\n // Calculated intervall length\n let unitTime = this._calcBiggestTimeUnitDifference(startDate, endDate);\n let interval = Math.ceil(unitTime.difference / groups);\n let labels = [];\n\n // Create labels for each group\n for (let n = 0; n < groups - 1; n++) {\n labels.push([\n this._formatDate(new Date(unitTime.startDate.getTime() + interval * n), offset),\n new Date(unitTime.startDate.getTime() + interval * n).toUTCString()\n ]);\n }\n // Add end date as last lable\n labels.push([\n this._formatDate(new Date(unitTime.endDate.getTime()), offset),\n new Date(unitTime.endDate.getTime()).toUTCString()\n ]);\n\n // Return object\n return {label: labels, interval: interval, startDate: unitTime.startDate, endDate: unitTime.endDate};\n }", "function m_cantTicksPosibles() {\n var width = +d3.select('#' + chart.element.id + \" svg .c3-zoom-rect\").attr(\"width\");\n width = +width.toFixed();\n\n var dateWidth = 85; // 85 es aproximadamente por exceso el ancho que toma una fecha\n // c3-axis c3-axis-x tener estas clases en cuanta para tomar el tamano de la fecha generico\n\n var cant_ticks = width / dateWidth;\n return +cant_ticks.toFixed();\n}", "function ticks({startAngle, endAngle, value}) {\n const k = (endAngle - startAngle) / value;\n return d3.range(0, value, tickStep).map(value => {\n return {value, angle: value * k + startAngle};\n });\n }", "niceScale(yMin, yMax, diff, index = 0, ticks = 10) {\n const w = this.w\n const NO_MIN_MAX_PROVIDED =\n (this.w.config.yaxis[index].max === undefined &&\n this.w.config.yaxis[index].min === undefined) ||\n this.w.config.yaxis[index].forceNiceScale\n if (\n (yMin === Number.MIN_VALUE && yMax === 0) ||\n (!Utils.isNumber(yMin) && !Utils.isNumber(yMax)) ||\n (yMin === Number.MIN_VALUE && yMax === -Number.MAX_VALUE)\n ) {\n // when all values are 0\n yMin = 0\n yMax = ticks\n let linearScale = this.linearScale(yMin, yMax, ticks)\n return linearScale\n }\n\n if (yMin > yMax) {\n // if somehow due to some wrong config, user sent max less than min,\n // adjust the min/max again\n console.warn('yaxis.min cannot be greater than yaxis.max')\n yMax = yMin + 0.1\n } else if (yMin === yMax) {\n // If yMin and yMax are identical, then\n // adjust the yMin and yMax values to actually\n // make a graph. Also avoids division by zero errors.\n yMin = yMin === 0 ? 0 : yMin - 0.5 // some small value\n yMax = yMax === 0 ? 2 : yMax + 0.5 // some small value\n }\n\n // Calculate Min amd Max graphical labels and graph\n // increments. The number of ticks defaults to\n // 10 which is the SUGGESTED value. Any tick value\n // entered is used as a suggested value which is\n // adjusted to be a 'pretty' value.\n //\n // Output will be an array of the Y axis values that\n // encompass the Y values.\n let result = []\n\n // Determine Range\n let range = Math.abs(yMax - yMin)\n\n if (\n range < 1 &&\n NO_MIN_MAX_PROVIDED &&\n (w.config.chart.type === 'candlestick' ||\n w.config.series[index].type === 'candlestick' ||\n w.globals.isRangeData)\n ) {\n /* fix https://github.com/apexcharts/apexcharts.js/issues/430 */\n yMax = yMax * 1.01\n }\n\n let tiks = ticks + 1\n // Adjust ticks if needed\n if (tiks < 2) {\n tiks = 2\n } else if (tiks > 2) {\n tiks -= 2\n }\n\n // Get raw step value\n let tempStep = range / tiks\n // Calculate pretty step value\n\n let mag = Math.floor(Utils.log10(tempStep))\n let magPow = Math.pow(10, mag)\n let magMsd = parseInt(tempStep / magPow)\n let stepSize = magMsd * magPow\n\n // build Y label array.\n // Lower and upper bounds calculations\n let lb = stepSize * Math.floor(yMin / stepSize)\n let ub = stepSize * Math.ceil(yMax / stepSize)\n // Build array\n let val = lb\n\n if (NO_MIN_MAX_PROVIDED && diff > 6) {\n while (1) {\n result.push(val)\n val += stepSize\n if (val > ub) {\n break\n }\n }\n\n return {\n result,\n niceMin: result[0],\n niceMax: result[result.length - 1]\n }\n } else {\n result = []\n let v = yMin\n result.push(v)\n let valuesDivider = Math.abs(yMax - yMin) / ticks\n for (let i = 0; i <= ticks; i++) {\n v = v + valuesDivider\n result.push(v)\n }\n\n if (result[result.length - 2] >= yMax) {\n result.pop()\n }\n\n return {\n result,\n niceMin: result[0],\n niceMax: result[result.length - 1]\n }\n }\n }", "addMiddleMajorTicks(tickscount, ticksDistance, distanceFromFirstToSecond, distanceModifier, normalLayout, ticksFrequency) {\n const that = this.context;\n\n let majorTicks = '', majorLabels = '', valuePlusExponent;\n\n for (let i = 1; i < tickscount; i++) {\n let number = distanceFromFirstToSecond.add(i * ticksDistance), value;\n\n if (normalLayout) {\n value = ticksFrequency.multiply(i).add(distanceModifier.add(new JQX.Utilities.BigNumber(that._drawMin)));\n }\n else {\n value = new JQX.Utilities.BigNumber(that._drawMax).subtract(distanceModifier).subtract(ticksFrequency.multiply(i));\n\n // if the value of the penultimate is 0 we add the exponent to accurately calculate its size\n if (i === tickscount - 1 && value.compare(0) === 0) {\n that._numberRenderer.numericValue = that._tickIntervalHandler.nearestPowerOfTen;\n valuePlusExponent = that._numberRenderer.bigNumberToExponent(1);\n }\n }\n if (value.compare(that._drawMax) !== 0) {\n let htmlValue = that._formatLabel(value.toString()),\n plot = true;\n\n that._labelDummy.innerHTML = valuePlusExponent ? valuePlusExponent : htmlValue;\n let dimensionValue = that._labelDummy[that._settings.size];\n\n if (number.add(dimensionValue).compare(tickscount * ticksDistance) >= 0) { // + 5 is an experimental value\n plot = false; // does not plot the second to last label if it intersects with the last one\n }\n\n const currentTickAndLabel = this._addMajorTickAndLabel(htmlValue, undefined, plot, value, true);\n\n majorTicks += currentTickAndLabel.tick;\n majorLabels += currentTickAndLabel.label;\n }\n }\n return { tick: majorTicks, label: majorLabels };\n }", "function tickCount() {\n if (width <= 500) {\n xAxis.ticks(5);\n yAxis.ticks(5);\n }\n else {\n xAxis.ticks(10);\n yAxis.ticks(10);\n }\n }", "function fixOnBandTicksCoords(axis, ticksCoords, tickCategoryInterval, alignWithLabel, clamp) {\n var ticksLen = ticksCoords.length;\n\n if (!axis.onBand || alignWithLabel || !ticksLen) {\n return;\n }\n\n var axisExtent = axis.getExtent();\n var last;\n\n if (ticksLen === 1) {\n ticksCoords[0].coord = axisExtent[0];\n last = ticksCoords[1] = {\n coord: axisExtent[0]\n };\n } else {\n var shift = ticksCoords[1].coord - ticksCoords[0].coord;\n each(ticksCoords, function (ticksItem) {\n ticksItem.coord -= shift / 2;\n var tickCategoryInterval = tickCategoryInterval || 0; // Avoid split a single data item when odd interval.\n\n if (tickCategoryInterval % 2 > 0) {\n ticksItem.coord -= shift / ((tickCategoryInterval + 1) * 2);\n }\n });\n last = {\n coord: ticksCoords[ticksLen - 1].coord + shift\n };\n ticksCoords.push(last);\n }\n\n var inverse = axisExtent[0] > axisExtent[1];\n\n if (littleThan(ticksCoords[0].coord, axisExtent[0])) {\n clamp ? ticksCoords[0].coord = axisExtent[0] : ticksCoords.shift();\n }\n\n if (clamp && littleThan(axisExtent[0], ticksCoords[0].coord)) {\n ticksCoords.unshift({\n coord: axisExtent[0]\n });\n }\n\n if (littleThan(axisExtent[1], last.coord)) {\n clamp ? last.coord = axisExtent[1] : ticksCoords.pop();\n }\n\n if (clamp && littleThan(last.coord, axisExtent[1])) {\n ticksCoords.push({\n coord: axisExtent[1]\n });\n }\n\n function littleThan(a, b) {\n return inverse ? a > b : a < b;\n }\n}", "function fixOnBandTicksCoords(axis, ticksCoords, tickCategoryInterval, alignWithLabel, clamp) {\n var ticksLen = ticksCoords.length;\n\n if (!axis.onBand || alignWithLabel || !ticksLen) {\n return;\n }\n\n var axisExtent = axis.getExtent();\n var last;\n\n if (ticksLen === 1) {\n ticksCoords[0].coord = axisExtent[0];\n last = ticksCoords[1] = {\n coord: axisExtent[0]\n };\n } else {\n var shift = ticksCoords[1].coord - ticksCoords[0].coord;\n each(ticksCoords, function (ticksItem) {\n ticksItem.coord -= shift / 2;\n var tickCategoryInterval = tickCategoryInterval || 0; // Avoid split a single data item when odd interval.\n\n if (tickCategoryInterval % 2 > 0) {\n ticksItem.coord -= shift / ((tickCategoryInterval + 1) * 2);\n }\n });\n last = {\n coord: ticksCoords[ticksLen - 1].coord + shift\n };\n ticksCoords.push(last);\n }\n\n var inverse = axisExtent[0] > axisExtent[1];\n\n if (littleThan(ticksCoords[0].coord, axisExtent[0])) {\n clamp ? ticksCoords[0].coord = axisExtent[0] : ticksCoords.shift();\n }\n\n if (clamp && littleThan(axisExtent[0], ticksCoords[0].coord)) {\n ticksCoords.unshift({\n coord: axisExtent[0]\n });\n }\n\n if (littleThan(axisExtent[1], last.coord)) {\n clamp ? last.coord = axisExtent[1] : ticksCoords.pop();\n }\n\n if (clamp && littleThan(last.coord, axisExtent[1])) {\n ticksCoords.push({\n coord: axisExtent[1]\n });\n }\n\n function littleThan(a, b) {\n return inverse ? a > b : a < b;\n }\n}", "function fixOnBandTicksCoords(axis, ticksCoords, tickCategoryInterval, alignWithLabel, clamp) {\n var ticksLen = ticksCoords.length;\n\n if (!axis.onBand || alignWithLabel || !ticksLen) {\n return;\n }\n\n var axisExtent = axis.getExtent();\n var last;\n\n if (ticksLen === 1) {\n ticksCoords[0].coord = axisExtent[0];\n last = ticksCoords[1] = {\n coord: axisExtent[0]\n };\n } else {\n var shift = ticksCoords[1].coord - ticksCoords[0].coord;\n each(ticksCoords, function (ticksItem) {\n ticksItem.coord -= shift / 2;\n var tickCategoryInterval = tickCategoryInterval || 0; // Avoid split a single data item when odd interval.\n\n if (tickCategoryInterval % 2 > 0) {\n ticksItem.coord -= shift / ((tickCategoryInterval + 1) * 2);\n }\n });\n last = {\n coord: ticksCoords[ticksLen - 1].coord + shift\n };\n ticksCoords.push(last);\n }\n\n var inverse = axisExtent[0] > axisExtent[1];\n\n if (littleThan(ticksCoords[0].coord, axisExtent[0])) {\n clamp ? ticksCoords[0].coord = axisExtent[0] : ticksCoords.shift();\n }\n\n if (clamp && littleThan(axisExtent[0], ticksCoords[0].coord)) {\n ticksCoords.unshift({\n coord: axisExtent[0]\n });\n }\n\n if (littleThan(axisExtent[1], last.coord)) {\n clamp ? last.coord = axisExtent[1] : ticksCoords.pop();\n }\n\n if (clamp && littleThan(last.coord, axisExtent[1])) {\n ticksCoords.push({\n coord: axisExtent[1]\n });\n }\n\n function littleThan(a, b) {\n return inverse ? a > b : a < b;\n }\n}", "function tickCount() {\n if (displayWidth <= 500) {\n xAxis.ticks(5);\n yAxis.ticks(5);\n } else {\n xAxis.ticks(10);\n yAxis.ticks(10);\n }\n }", "_addMajorTickAndLabel(htmlValue, labelSize, plot, value, middle) {\n const that = this.context,\n leftOrTop = that._settings.leftOrTop,\n offset = this.valueToPx(value);\n\n let currentTick = '',\n currentLabel = '';\n\n if (parseInt(offset) > parseInt(that._measurements.trackLength)) {\n return { tick: currentTick, label: currentLabel };\n }\n\n if (that.logarithmicScale) {\n htmlValue = that._formatLabel(Math.pow(10, value));\n }\n\n if (that.nodeName.toLowerCase() === 'jqx-tank' || that._intervalHasChanged) {\n let tickIntervalLabelSize = that._tickIntervalHandler.labelsSize;\n\n if (middle) {\n that._labelDummy.innerHTML = htmlValue;\n\n let tickPosition = this.valueToPx(value),\n maxPosition = this.valueToPx(that._drawMax),\n minPosition = this.valueToPx(that._drawMin),\n labelSize = that._labelDummy[that._settings.size],\n labelOtherSize = that.orientation === 'vertical' ? that._labelDummy.offsetWidth : that._labelDummy.offsetHeight,\n distanceToMin = (labelSize + tickIntervalLabelSize.minLabelSize) / 2,\n distanceToMax = (labelSize + tickIntervalLabelSize.maxLabelSize) / 2;\n\n that._normalLayout ?\n plot = (tickPosition + distanceToMax < maxPosition) && (tickPosition - distanceToMin > minPosition) :\n plot = (tickPosition - distanceToMax > maxPosition) && (tickPosition + distanceToMin < minPosition);\n\n if (labelOtherSize > this._longestLabelSize) {\n this._longestLabelSize = labelOtherSize;\n }\n\n }\n else {\n this._longestLabelSize = Math.max(tickIntervalLabelSize.minLabelOtherSize, tickIntervalLabelSize.maxLabelOtherSize, this._longestLabelSize);\n }\n }\n\n that._tickValues.push(value);\n\n currentTick = '<div style=\"' + leftOrTop + ': ' + offset + 'px;\" class=\"jqx-tick\"></div>';\n\n if (plot !== false) {\n if (labelSize === undefined) {\n that._labelDummy.innerHTML = htmlValue;\n labelSize = that._labelDummy[that._settings.size];\n }\n const labelOffset = offset - labelSize / 2;\n\n currentLabel += '<div class=\"jqx-label' + (middle ? ' jqx-label-middle' : '') + '\" style=\"' + leftOrTop + ': ' + labelOffset + 'px;\">' + htmlValue + '</div>';\n }\n\n return { tick: currentTick, label: currentLabel };\n }", "function getYAxisTickCount(areaWidth) {\n //set tick count to 10\n let tickCount = 10,\n maxValueRatio = getMaxYValue();\n\n //set max value ratio\n if (diagram.maxMeasureValue)\n maxValueRatio = diagram.maxMeasureValue;\n\n //attach text\n tempTextSVG = diagramG.append('text')\n .style('font-size', diagram.yAxis.labelFontSize + 'px')\n .style('color', diagram.yAxis.labelFontColor)\n .style('font-family', diagram.yAxis.labelFontFamily + ', Arial, Helvetica, Ubuntu')\n .style('font-style', diagram.yAxis.labelFontStyle == 'bold' ? 'normal' : diagram.yAxis.labelFontStyle)\n .style('font-weight', diagram.yAxis.labelFontStyle == 'bold' ? 'bold' : 'normal')\n .text(e.formatNumber(maxValueRatio, diagram.yAxis.labelFormat));\n\n //get offset for x axis value\n tempXAxisSVGOffset = tempTextSVG.node().getBoundingClientRect();\n\n //remove svg text for x axis\n tempTextSVG.remove();\n\n //check whether the axis tick count is auto\n if (diagram.yAxis.tickCount === 'auto') {\n //set tick count\n tickCount = Math.ceil(areaWidth / tempXAxisSVGOffset.width) - 1;\n } else {\n //set manuel tick count\n tickCount = parseInt(diagram.yAxis.tickCount);\n }\n\n if (tickCount > 10)\n tickCount = 10;\n\n //return updated tick count\n return 5;//e.closestPower(Math.ceil(tickCount));\n }", "function primaryLabelInterval(pxPerSec) {\n var retval = 1;\n /*\n if (pxPerSec >= 25 * 100) {\n retval = 100;\n } else if (pxPerSec >= 25 * 40) {\n retval = 40;\n } else if (pxPerSec >= 25 * 10) {\n retval = 100;\n } else if (pxPerSec >= 25 * 4) {\n retval = 40;\n } else if (pxPerSec >= 25) {\n retval = 1;\n } else if (pxPerSec * 5 >= 25) {\n retval = 5;\n } else if (pxPerSec * 15 >= 25) {\n retval = 15;\n } else {\n retval = Math.ceil(0.5 / pxPerSec) * 60;\n } */\n if (pxPerSec >= 600) {\n retval = 5;\n }\n else if (pxPerSec >= 500) {\n retval = 7;\n }\n else if (pxPerSec >= 400) {\n retval = 8;\n }\n else if (pxPerSec >= 300) {\n retval = 10;\n }\n return retval;\n}", "addMiddleMajorTicks(tickscount, ticksDistance, distanceFromFirstToSecond, distanceModifier, normalLayout, ticksFrequency) {\n const that = this.context;\n\n let majorTicks = '', majorLabels = '';\n\n for (let i = 1; i < tickscount; i++) {\n let number = i * ticksDistance + distanceFromFirstToSecond,\n value;\n\n if (normalLayout) {\n value = parseFloat(that._drawMin) + ticksFrequency * i + distanceModifier;\n }\n else {\n value = parseFloat(that._drawMax) - ticksFrequency * i - distanceModifier;\n }\n if (value.toString() !== that._drawMax.toString()) {\n let htmlValue = that._formatLabel(value.toString()),\n plot = true;\n\n that._labelDummy.innerHTML = htmlValue;\n let dimensionValue = that._labelDummy[that._settings.size];\n\n if (number + dimensionValue >= tickscount * ticksDistance) { // + 32 is an Experimental value\n plot = false;\n }\n const currentTickAndLabel = this._addMajorTickAndLabel(htmlValue, undefined, plot, value, true);\n\n majorTicks += currentTickAndLabel.tick;\n majorLabels += currentTickAndLabel.label;\n }\n }\n return { tick: majorTicks, label: majorLabels };\n }", "function getSmartTicks(val) {\n // Base step between nearby two ticks\n var step = Math.pow(10, Math.trunc(val).toString().length - 1);\n\n // Modify steps either: 1, 2, 5, 10, 20, 50, 100, 200, 500, 1000, 2000...\n if (val / step < 2) {\n step = step / 5;\n } else if (val / step < 5) {\n step = step / 2;\n }\n\n // Add one more step if the last tick value is the same as the max value\n // If you don't want to add, remove \"+1\"\n var slicesCount = Math.ceil((val + 1) / step);\n\n return {\n endPoint: slicesCount * step,\n count: Math.min(10, slicesCount), //show max 10 ticks\n };\n }", "function updateXTickCount() {\n // console.log(\"data -> \" + JSON.stringify(data));\n // console.log(\"data.length -> \" + data.length);\n // console.log(\"(.77 * window.innerWidth - 280) / 15 -> \" + (.77 * window.innerWidth - 280) / 15);\n // console.log((Math.floor(data.length / ((.77 * window.innerWidth - 280) / 15))) - 1);\n setXTickInterval((Math.floor(data.length / ((.77 * window.innerWidth - 280) / 15))) - 1);\n }", "ticks (count = 7) {\n const domain = this.getDomain()\n\n return ticks(domain[0], domain[domain.length - 1], count)\n }", "function calculateRange(axis, axisOptions){\n\t\t\tvar min = axisOptions.min != null ? axisOptions.min : axis.datamin;\n\t\t\tvar max = axisOptions.max != null ? axisOptions.max : axis.datamax;\t\n\t\t\tif(max - min == 0.0){\n\t\t\t\tvar widen = (max == 0.0) ? 1.0 : 0.01;\n\t\t\t\tmin -= widen;\n\t\t\t\tmax += widen;\n\t\t\t}\t\t\t\n\t\t\taxis.tickSize = getTickSize(axisOptions.noTicks, min, max, axisOptions.tickDecimals);\n\t\t\t\t\n\t\t\t/**\n\t\t\t * Autoscaling.\n\t\t\t */\n\t\t\tvar margin;\n\t\t\tif(axisOptions.min == null){\n\t\t\t\t\n\t\t\t\t/**\n\t\t\t\t * Add a margin.\n\t\t\t\t */\n\t\t\t\tmargin = axisOptions.autoscaleMargin;\n\t\t\t\tif(margin != 0){\n\t\t\t\t\tmin -= axis.tickSize * margin;\t\t\t\t\n\t\t\t\t\t/**\n\t\t\t\t\t * Make sure we don't go below zero if all values are positive.\n\t\t\t\t\t */\n\t\t\t\t\tif(min < 0 && axis.datamin >= 0) min = 0;\t\t\t\t\n\t\t\t\t\tmin = axis.tickSize * Math.floor(min / axis.tickSize);\n\t\t\t\t}\n\t\t\t}\n\t\t\tif(axisOptions.max == null){\n\t\t\t\tmargin = axisOptions.autoscaleMargin;\n\t\t\t\tif(margin != 0){\n\t\t\t\t\tmax += axis.tickSize * margin;\n\t\t\t\t\tif(max > 0 && axis.datamax <= 0) max = 0;\t\t\t\t\n\t\t\t\t\tmax = axis.tickSize * Math.ceil(max / axis.tickSize);\n\t\t\t\t}\n\t\t\t}\n\t\t\taxis.min = min;\n\t\t\taxis.max = max;\n\t\t}", "function computeLabelInterval(slotDuration) {\n var i;\n var labelInterval;\n var slotsPerLabel;\n // find the smallest stock label interval that results in more than one slots-per-label\n for (i = STOCK_SUB_DURATIONS.length - 1; i >= 0; i -= 1) {\n labelInterval = createDuration(STOCK_SUB_DURATIONS[i]);\n slotsPerLabel = wholeDivideDurations(labelInterval, slotDuration);\n if (slotsPerLabel !== null && slotsPerLabel > 1) {\n return labelInterval;\n }\n }\n return slotDuration; // fall back\n }", "get intervals()\n\t{\n\t\treturn {\n\t\t\tpx: \t\t\t\t1.00,\n\t\t\tem: \t\t\t\t0.01,\n\t\t\trem: \t\t\t\t0.01,\n\t\t\tdefault: \t\t0.00\n\t\t}\n\t}", "function primaryLabelInterval(pxPerSec) {\n\tvar retval = 1;\n\tif (pxPerSec >= 25 * 100) {\n\t\tretval = 10;\n\t} else if (pxPerSec >= 25 * 40) {\n\t\tretval = 4;\n\t} else if (pxPerSec >= 25 * 10) {\n\t\tretval = 10;\n\t} else if (pxPerSec >= 25 * 4) {\n\t\tretval = 4;\n\t} else if (pxPerSec >= 25) {\n\t\tretval = 1;\n\t} else if (pxPerSec * 5 >= 25) {\n\t\tretval = 5;\n\t} else if (pxPerSec * 15 >= 25) {\n\t\tretval = 15;\n\t} else {\n\t\tretval = Math.ceil(0.5 / pxPerSec) * 60;\n\t}\n\treturn retval;\n}", "getCoercedValue(value, useDrawVariables, logarithmicGauge) {\n const that = this.context;\n\n if (!that.coerce) {\n return value;\n }\n\n let normalScale = !that.logarithmicScale,\n minValue, maxValue;\n\n if (that.customInterval) {\n const customTicks = that.customTicks;\n\n if (customTicks.length === 0) {\n return value;\n }\n\n normalScale = normalScale || logarithmicGauge;\n\n if (useDrawVariables !== false) {\n minValue = parseFloat(that._drawMin);\n }\n else {\n minValue = that._minObject;\n }\n\n let difference = Math.abs(minValue - value),\n closestValue = minValue;\n\n for (let i = 0; i < customTicks.length; i++) {\n const currentTickObject = this.createDescriptor(customTicks[i]),\n currentTickValue = normalScale ? currentTickObject : Math.log10(currentTickObject),\n currentDifference = Math.abs(currentTickValue - value);\n\n if (currentDifference < difference) {\n difference = currentDifference;\n closestValue = currentTickValue;\n }\n }\n\n return closestValue;\n }\n\n if (useDrawVariables !== false) {\n minValue = parseFloat(that._drawMin);\n maxValue = parseFloat(that._drawMax);\n }\n else {\n minValue = parseFloat(that.min);\n maxValue = parseFloat(that.max);\n }\n\n let noMin = value - minValue,\n remainder = this.getPreciseModulo(noMin, parseFloat(that.interval)),\n coef = this.roundCoefficient;\n\n if (remainder === 0) {\n return value;\n }\n\n if (this.roundCoefficient === 0) {\n coef = 12;\n }\n\n let lowerValue = parseFloat((noMin - remainder).toFixed(coef)),\n greaterValue = lowerValue + parseFloat(that.interval);\n\n if (((that.max - that.min) <= parseFloat(that.interval)) && normalScale) {\n let min = minValue,\n max = maxValue;\n\n return value >= min + (max - min) / 2 ? max : min;\n }\n\n if (Math.abs(noMin - lowerValue) < Math.abs(noMin - greaterValue)) {\n return lowerValue + minValue;\n }\n else {\n const biggerValue = greaterValue + minValue;\n\n return biggerValue > maxValue ? lowerValue + minValue : biggerValue;\n }\n }", "function renderTickNumbers() {\n var labelSpacing = largeTickSpacing * renderAttrs.tickSpacing.largeIntervalsPerText,\n tickCoord, labelIndex, minLabelIndex, maxLabelIndex,\n labelValue, tickNumber,\n labelOffset = renderAttrs.majorTickLength + 3;\n\n // Determine range of x and y values to render (cf. CoordSysKind_RenderProc())\n // Use ~~ to efficiently truncate to integer\n // (cf. http://stackoverflow.com/questions/4055633/what-does-do-in-javascript)\n /*jslint bitwise:true */\n minLabelIndex = ~~((renderMin - originAlongAxisCoord) / labelSpacing) - 1;\n maxLabelIndex = ~~((renderMax - originAlongAxisCoord) / labelSpacing) + 1;\n // Note that we render one additional label on each end just in case.\n // Desktop GSP heuristically determines the maximum label size and then\n // only renders an additional label if it's within half the maximum extent.\n // We bypass that level of optimization until it is deemed worthwhile.\n \n ctx.font = defaultFontSpec;\n ctx.textAlign = 'left';\n\n for (labelIndex = minLabelIndex; labelIndex <= maxLabelIndex; ++labelIndex) {\n if( labelIndex !== 0) {\n var largeTickIndex = labelIndex * renderAttrs.tickSpacing.largeIntervalsPerText;\n tickCoord = originAlongAxisCoord + labelIndex * labelSpacing;\n labelValue = labelIndex * labelSpacing / renderAttrs.unitPixels;\n \n // Polar coordinates, vertical axis can affect sign\n if( renderAttrs.isPolar) {\n largeTickIndex = Math.abs( largeTickIndex);\n labelValue = Math.abs( labelValue);\n }\n else if( renderAttrs.orientation === 'vertical') {\n largeTickIndex = -largeTickIndex;\n labelValue = -labelValue;\n }\n \n // Format the tick number/label appropriately\n tickNumber = formatTickNumber( largeTickIndex, labelValue);\n \n // Render the tick number/label next to its associated tick\n renderTickNumber( tickNumber, tickCoord, labelOffset);\n }\n }\n }", "_initTickIntervalHandler() {\n const that = this;\n\n if (!that._isVisible() || that._renderingSuspended) {\n that._renderingSuspended = true;\n return;\n }\n\n const minLabel = that._formatLabel(that.min, false),\n maxLabel = that._formatLabel(that.max, false);\n\n that._tickIntervalHandler = new JQX.Utilities.TickIntervalHandler(that, minLabel, maxLabel, 'jqx-label', that._settings.size, that.scaleType === 'integer', that.logarithmicScale);\n }", "elapsed_days(){\n return this.ticks / TICKS_PER_DAY; \n }", "function axisBeforePadding() {\n var _this = this;\n var axisLength = this.len,\n chart = this.chart,\n isXAxis = this.isXAxis,\n dataKey = isXAxis ? 'xData' : 'yData',\n min = this.min,\n range = this.max - min;\n var pxMin = 0,\n pxMax = axisLength,\n transA = axisLength / range,\n hasActiveSeries;\n // Handle padding on the second pass, or on redraw\n this.series.forEach(function (series) {\n if (series.bubblePadding &&\n (series.visible || !chart.options.chart.ignoreHiddenSeries)) {\n // Correction for #1673\n _this.allowZoomOutside = true;\n hasActiveSeries = true;\n var data = series[dataKey];\n if (isXAxis) {\n (series.onPoint || series).getRadii(0, 0, series);\n if (series.onPoint) {\n series.radii = series.onPoint.radii;\n }\n }\n if (range > 0) {\n var i = data.length;\n while (i--) {\n if (isNumber(data[i]) &&\n _this.dataMin <= data[i] &&\n data[i] <= _this.max) {\n var radius = series.radii && series.radii[i] || 0;\n pxMin = Math.min(((data[i] - min) * transA) - radius, pxMin);\n pxMax = Math.max(((data[i] - min) * transA) + radius, pxMax);\n }\n }\n }\n }\n });\n // Apply the padding to the min and max properties\n if (hasActiveSeries && range > 0 && !this.logarithmic) {\n pxMax -= axisLength;\n transA *= (axisLength +\n Math.max(0, pxMin) - // #8901\n Math.min(pxMax, axisLength)) / axisLength;\n [\n ['min', 'userMin', pxMin],\n ['max', 'userMax', pxMax]\n ].forEach(function (keys) {\n if (typeof pick(_this.options[keys[0]], _this[keys[1]]) === 'undefined') {\n _this[keys[0]] += keys[2] / transA;\n }\n });\n }\n }", "function getTicks() {\n\t\tconst Data = getData();\n\t\tif (Data.length <= 5) {\n\t\t\treturn Data.length;\n\t\t}\n\t\treturn parseInt(Data.length / 5, 10);\n\t}", "get ticks() {\n return this._clock.ticks;\n }", "getIntervalCount(){\n return this.root ? this.root.getIntervalCount() : 0;\n }", "_calculateDateInterval(majorTicksInterval) {\n const that = this,\n timeParts = {\n month: '2628000000000000000000000000000',\n day: '86400000000000000000000000000',\n hour: '3600000000000000000000000000',\n minute: '60000000000000000000000000',\n second: '1000000000000000000000000'\n };\n let part = 'year',\n bigNumberTimePart = new JQX.Utilities.BigNumber('31536000000000000000000000000000'),\n difference = bigNumberTimePart.subtract(majorTicksInterval).abs(),\n range = new JQX.Utilities.BigNumber(that.min).subtract(that.max).abs(),\n projectedNumberOfTicks = range.divide(majorTicksInterval).toString();\n\n if (projectedNumberOfTicks < 2) {\n majorTicksInterval = range.divide(3);\n }\n\n for (let timePart in timeParts) {\n if (timeParts.hasOwnProperty(timePart)) {\n const currentBigNumberTimePart = new JQX.Utilities.BigNumber(timeParts[timePart]),\n currentDifference = currentBigNumberTimePart.subtract(majorTicksInterval).abs();\n\n if (currentDifference.compare(difference) === -1) {\n part = timePart;\n bigNumberTimePart = currentBigNumberTimePart;\n difference = currentDifference;\n }\n else {\n break;\n }\n }\n }\n\n if (part === 'second') {\n that._numberRenderer.numericValue = parseFloat(majorTicksInterval);\n\n if (that._numberRenderer.numericValue < 1000) {\n that._dateIncrementMethod = 'addYoctoseconds';\n that._dateIntervalNumber = 1;\n return;\n }\n\n let scientificPrefix = that._numberRenderer.toScientific(10);\n\n scientificPrefix = scientificPrefix.charAt(scientificPrefix.length - 1);\n\n that._dateIncrementMethod = that._unitToMethod[scientificPrefix];\n that._dateIntervalNumber = Math.pow(10, that._numericProcessor.prefixesToPowers[scientificPrefix]);\n return;\n }\n\n that._dateInterval = true;\n\n const calculatedInterval = !that.customInterval;\n let customTicks, numberOfTimeParts, toAdd;\n\n if (calculatedInterval) {\n customTicks = [new JQX.Utilities.BigNumber(that.min)];\n numberOfTimeParts = range.divide(bigNumberTimePart).toString();\n toAdd = Math.max(1, Math.floor(numberOfTimeParts / projectedNumberOfTicks));\n }\n\n switch (part) {\n case 'year':\n if (calculatedInterval) {\n for (let i = that._minDate.year() + toAdd; i < that._maxDate.year(); i += toAdd) {\n customTicks.push(new JQX.Utilities.BigNumber(new JQX.Utilities.DateTime(i, 1, 1).getTimeStamp()));\n }\n }\n\n that._dateIncrementMethod = 'addYears';\n break;\n case 'month':\n if (calculatedInterval) {\n for (let i = new JQX.Utilities.DateTime(that._minDate.year(), that._minDate.month() + toAdd, 1);\n i.compare(that._maxDate) === -1; i.addMonths(toAdd, false)) {\n customTicks.push(new JQX.Utilities.BigNumber(i.getTimeStamp()));\n }\n }\n\n that._dateIncrementMethod = 'addMonths';\n break;\n case 'day':\n if (calculatedInterval) {\n for (let i = new JQX.Utilities.DateTime(that._minDate.year(), that._minDate.month(), that._minDate.day() + toAdd);\n i.compare(that._maxDate) === -1; i.addDays(toAdd, false)) {\n customTicks.push(new JQX.Utilities.BigNumber(i.getTimeStamp()));\n }\n }\n\n that._dateIncrementMethod = 'addDays';\n that._dateIntervalNumber = 86400000000000000000000000000;\n break;\n case 'hour':\n if (calculatedInterval) {\n for (let i = new JQX.Utilities.DateTime(that._minDate.year(), that._minDate.month(), that._minDate.day(), that._minDate.hour() + toAdd);\n i.compare(that._maxDate) === -1; i.addHours(toAdd, false)) {\n customTicks.push(new JQX.Utilities.BigNumber(i.getTimeStamp()));\n }\n }\n\n that._dateIncrementMethod = 'addHours';\n that._dateIntervalNumber = 3600000000000000000000000000;\n break;\n case 'minute':\n if (calculatedInterval) {\n for (let i = new JQX.Utilities.DateTime(that._minDate.year(), that._minDate.month(), that._minDate.day(), that._minDate.hour(), that._minDate.minute() + toAdd);\n i.compare(that._maxDate) === -1; i.addMinutes(toAdd, false)) {\n customTicks.push(new JQX.Utilities.BigNumber(i.getTimeStamp()));\n }\n }\n\n that._dateIncrementMethod = 'addMinutes';\n that._dateIntervalNumber = 60000000000000000000000000;\n break;\n }\n\n if (calculatedInterval) {\n if (customTicks[customTicks.length - 1].compare(that.max) === -1) {\n customTicks.push(new JQX.Utilities.BigNumber(that.max));\n }\n\n that.customTicks = customTicks;\n }\n }", "function determineUnitForFormatting(scale, ticks, minUnit, min, max) {\n var ilen = UNITS.length;\n var i, unit;\n\n for (i = ilen - 1; i >= UNITS.indexOf(minUnit); i--) {\n unit = UNITS[i];\n\n if (INTERVALS[unit].common && scale._adapter.diff(max, min, unit) >= ticks.length) {\n return unit;\n }\n }\n\n return UNITS[minUnit ? UNITS.indexOf(minUnit) : 0];\n }", "function addTicks(parent, config, data) {\n var ticks = parent.selectAll('g.ticks')\n .data(config.x.ticks(config.ticks))\n .enter()\n .append('svg:g')\n .attr('transform', function (d, i) { return formatString('translate({0}, 0)', config.left + config.x(d)); });\n ticks.append('svg:line')\n .attr('class', 'tick')\n .attr('y1', config.top)\n .attr('y2', config.bottom);\n ticks.append('svg:text')\n .attr('class', 'tickval')\n .attr('y', config.top)\n .attr('dy', -5)\n .text(config.x.tickFormat(config.ticks));\n\n return ticks;\n }", "_getMeasurements() {\n const that = this,\n measurements = that._measurements,\n measureLabel = document.createElement('div');\n let minLabel, maxLabel, minLabelWidth, maxLabelWidth, minLabelHeight, maxLabelHeight;\n\n measureLabel.className = 'jqx-label';\n measureLabel.style.position = 'absolute';\n measureLabel.style.visibility = 'hidden';\n that.$.svgContainer.appendChild(measureLabel);\n\n if (that.selection === 'hour') {\n minLabel = '1';\n maxLabel = '23';\n\n that.max = 12;\n that._drawMax = '12';\n that._range = 12;\n }\n else {\n minLabel = '00';\n maxLabel = '55';\n\n that.max = 60;\n that._drawMax = '60';\n that._range = 60;\n }\n\n measureLabel.innerHTML = minLabel;\n minLabelWidth = measureLabel.offsetWidth;\n minLabelHeight = measureLabel.offsetHeight;\n measureLabel.innerHTML = maxLabel;\n maxLabelWidth = measureLabel.offsetWidth;\n maxLabelHeight = measureLabel.offsetHeight;\n\n that._largestLabelSize = Math.max(minLabelWidth, minLabelHeight, maxLabelWidth, maxLabelHeight);\n that._tickIntervalHandler.labelsSize.minLabelSize = minLabelHeight;\n that._tickIntervalHandler.labelsSize.maxLabelSize = maxLabelHeight;\n\n const measureElementStyle = window.getComputedStyle(measureLabel);\n\n measurements.fontSize = measureElementStyle.fontSize;\n measurements.fontFamily = measureElementStyle.fontFamily;\n measurements.fontWeight = measureElementStyle.fontWeight;\n measurements.fontStyle = measureElementStyle.fontStyle;\n that.$.svgContainer.removeChild(measureLabel);\n }", "function determineUnitForFormatting(scale, ticks, minUnit, min, max) {\n\tvar ilen = UNITS.length;\n\tvar i, unit;\n\n\tfor (i = ilen - 1; i >= UNITS.indexOf(minUnit); i--) {\n\t\tunit = UNITS[i];\n\t\tif (INTERVALS[unit].common && scale._adapter.diff(max, min, unit) >= ticks.length) {\n\t\t\treturn unit;\n\t\t}\n\t}\n\n\treturn UNITS[minUnit ? UNITS.indexOf(minUnit) : 0];\n}", "function determineUnitForFormatting(scale, ticks, minUnit, min, max) {\n\tvar ilen = UNITS.length;\n\tvar i, unit;\n\n\tfor (i = ilen - 1; i >= UNITS.indexOf(minUnit); i--) {\n\t\tunit = UNITS[i];\n\t\tif (INTERVALS[unit].common && scale._adapter.diff(max, min, unit) >= ticks.length) {\n\t\t\treturn unit;\n\t\t}\n\t}\n\n\treturn UNITS[minUnit ? UNITS.indexOf(minUnit) : 0];\n}", "function determineUnitForFormatting(scale, ticks, minUnit, min, max) {\n\tvar ilen = UNITS.length;\n\tvar i, unit;\n\n\tfor (i = ilen - 1; i >= UNITS.indexOf(minUnit); i--) {\n\t\tunit = UNITS[i];\n\t\tif (INTERVALS[unit].common && scale._adapter.diff(max, min, unit) >= ticks.length) {\n\t\t\treturn unit;\n\t\t}\n\t}\n\n\treturn UNITS[minUnit ? UNITS.indexOf(minUnit) : 0];\n}", "function determineUnitForFormatting(scale, ticks, minUnit, min, max) {\n\tvar ilen = UNITS.length;\n\tvar i, unit;\n\n\tfor (i = ilen - 1; i >= UNITS.indexOf(minUnit); i--) {\n\t\tunit = UNITS[i];\n\t\tif (INTERVALS[unit].common && scale._adapter.diff(max, min, unit) >= ticks.length) {\n\t\t\treturn unit;\n\t\t}\n\t}\n\n\treturn UNITS[minUnit ? UNITS.indexOf(minUnit) : 0];\n}", "function determineUnitForFormatting(scale, ticks, minUnit, min, max) {\n\tvar ilen = UNITS.length;\n\tvar i, unit;\n\n\tfor (i = ilen - 1; i >= UNITS.indexOf(minUnit); i--) {\n\t\tunit = UNITS[i];\n\t\tif (INTERVALS[unit].common && scale._adapter.diff(max, min, unit) >= ticks.length) {\n\t\t\treturn unit;\n\t\t}\n\t}\n\n\treturn UNITS[minUnit ? UNITS.indexOf(minUnit) : 0];\n}", "function determineUnitForFormatting(scale, ticks, minUnit, min, max) {\n\tvar ilen = UNITS.length;\n\tvar i, unit;\n\n\tfor (i = ilen - 1; i >= UNITS.indexOf(minUnit); i--) {\n\t\tunit = UNITS[i];\n\t\tif (INTERVALS[unit].common && scale._adapter.diff(max, min, unit) >= ticks.length) {\n\t\t\treturn unit;\n\t\t}\n\t}\n\n\treturn UNITS[minUnit ? UNITS.indexOf(minUnit) : 0];\n}", "function getTickLabelUV(ax) {\n var ticklabelposition = ax.ticklabelposition || '';\n var has = function (str) {\n return ticklabelposition.indexOf(str) !== -1;\n };\n var isTop = has('top');\n var isLeft = has('left');\n var isRight = has('right');\n var isBottom = has('bottom');\n var isInside = has('inside');\n var isAligned = isBottom || isLeft || isTop || isRight;\n\n // early return\n if (!isAligned && !isInside) return [0, 0];\n var side = ax.side;\n var u = isAligned ? (ax.tickwidth || 0) / 2 : 0;\n var v = TEXTPAD;\n var fontSize = ax.tickfont ? ax.tickfont.size : 12;\n if (isBottom || isTop) {\n u += fontSize * CAP_SHIFT;\n v += (ax.linewidth || 0) / 2;\n }\n if (isLeft || isRight) {\n u += (ax.linewidth || 0) / 2;\n v += TEXTPAD;\n }\n if (isInside && side === 'top') {\n v -= fontSize * (1 - CAP_SHIFT);\n }\n if (isLeft || isTop) u = -u;\n if (side === 'bottom' || side === 'right') v = -v;\n return [isAligned ? u : 0, isInside ? v : 0];\n}", "_ticksToUnits(ticks) {\n return ftom(super._ticksToUnits(ticks));\n }", "function labelXcalc(d,i){\n var tickAngle = d + 90;\n var tickAngleRad = dToR(tickAngle);\n var absXCorr = opt.labelFontSize * (tickLabelText[i].length - minLabelLength) / 2;\n var xCorr = opt.outerTicks ? absXCorr : - absXCorr;\n var x1 = originX + labelStart * Math.cos(tickAngleRad)+xCorr;\n return x1\n }", "function _default() {\n\n\tfunction axisX(selection, x) {\n\t\tselection.attr(\"transform\", function (d) {\n\t\t\treturn \"translate(\" + Math.ceil(x(d) + tickOffset) + \", 0)\";\n\t\t});\n\t}\n\n\tfunction axisY(selection, y) {\n\t\tselection.attr(\"transform\", function (d) {\n\t\t\treturn \"translate(0,\" + Math.ceil(y(d)) + \")\";\n\t\t});\n\t}\n\n\tfunction scaleExtent(domain) {\n\t\tvar start = domain[0],\n\t\t stop = domain[domain.length - 1];\n\n\n\t\treturn start < stop ? [start, stop] : [stop, start];\n\t}\n\n\tfunction generateTicks(scale) {\n\t\tvar ticks = [];\n\n\t\tif (scale.ticks) return scale.ticks.apply(scale, tickArguments ? (0, _util.toArray)(tickArguments) : []).map(function (v) {\n\t\t\t\treturn (\n\t\t\t\t\t// round the tick value if is number\n\t\t\t\t\t/(string|number)/.test(typeof v === \"undefined\" ? \"undefined\" : (0, _typeof3.default)(v)) && !isNaN(v) ? Math.round(v * 10) / 10 : v\n\t\t\t\t);\n\t\t\t});\n\n\t\tfor (var domain = scale.domain(), i = Math.ceil(domain[0]); i < domain[1]; i++) ticks.push(i);\n\n\t\treturn ticks.length > 0 && ticks[0] > 0 && ticks.unshift(ticks[0] - (ticks[1] - ticks[0])), ticks;\n\t}\n\n\tfunction copyScale() {\n\t\tvar newScale = scale.copy();\n\n\t\tif (params.isCategory || !newScale.domain().length) {\n\t\t\tvar domain = scale.domain();\n\n\t\t\tnewScale.domain([domain[0], domain[1] - 1]);\n\t\t}\n\n\t\treturn newScale;\n\t}\n\n\tfunction textFormatted(v) {\n\t\t// to round float numbers from 'binary floating point'\n\t\t// https://en.wikipedia.org/wiki/Double-precision_floating-point_format\n\t\t// https://stackoverflow.com/questions/17849101/laymans-explanation-for-why-javascript-has-weird-floating-math-ieee-754-stand\n\t\tvar value = /\\d+\\.\\d+0{5,}\\d$/.test(v) ? +(v + \"\").replace(/0+\\d$/, \"\") : v,\n\t\t formatted = tickFormat ? tickFormat(value) : value;\n\n\n\t\treturn (0, _util.isDefined)(formatted) ? formatted : \"\";\n\t}\n\n\tfunction transitionise(selection) {\n\t\treturn params.withoutTransition ? selection.interrupt() : selection.transition(transition);\n\t}\n\n\tfunction axis(g) {\n\t\tg.each(function () {\n\n\t\t\t// this should be called only when category axis\n\t\t\tfunction splitTickText(d, maxWidthValue) {\n\n\t\t\t\tfunction split(splitted, text) {\n\t\t\t\t\tspaceIndex = undefined;\n\n\t\t\t\t\tfor (var i = 1; i < text.length; i++)\n\n\t\t\t\t\t// if text width gets over tick width, split by space index or current index\n\t\t\t\t\tif (text.charAt(i) === \" \" && (spaceIndex = i), subtext = text.substr(0, i + 1), textWidth = sizeFor1Char.w * subtext.length, maxWidth < textWidth) return split(splitted.concat(text.substr(0, spaceIndex || i)), text.slice(spaceIndex ? spaceIndex + 1 : i));\n\n\t\t\t\t\treturn splitted.concat(text);\n\t\t\t\t}\n\n\t\t\t\tvar tickText = textFormatted(d),\n\t\t\t\t maxWidth = maxWidthValue,\n\t\t\t\t subtext = void 0,\n\t\t\t\t spaceIndex = void 0,\n\t\t\t\t textWidth = void 0;\n\t\t\t\treturn Object.prototype.toString.call(tickText) === \"[object Array]\" ? tickText : ((!maxWidth || maxWidth <= 0) && (maxWidth = isVertical ? 95 : params.isCategory ? Math.ceil(scale1(ticks[1]) - scale1(ticks[0])) - 12 : 110), split([], tickText + \"\"));\n\t\t\t}\n\n\t\t\tfunction tspanDy(d, i) {\n\t\t\t\tvar dy = sizeFor1Char.h;\n\n\t\t\t\treturn i === 0 && (dy = orient === \"left\" || orient === \"right\" ? -((counts[d.index] - 1) * (sizeFor1Char.h / 2) - 3) : \".71em\"), dy;\n\t\t\t}\n\n\t\t\tfunction tickSize(d) {\n\t\t\t\tvar tickPosition = scale(d) + (tickCentered ? 0 : tickOffset);\n\n\t\t\t\treturn range[0] < tickPosition && tickPosition < range[1] ? 6 : 0;\n\t\t\t}\n\n\t\t\tvar g = (0, _d3Selection.select)(this);\n\n\t\t\taxis.g = g;\n\n\n\t\t\tvar scale0 = this.__chart__ || scale,\n\t\t\t scale1 = copyScale();\n\t\t\tthis.__chart__ = scale1;\n\n\n\t\t\t// count of tick data in array\n\t\t\tvar ticks = tickValues || generateTicks(scale1),\n\t\t\t tick = g.selectAll(\".tick\").data(ticks, scale1),\n\t\t\t tickEnter = tick.enter().insert(\"g\", \".domain\").attr(\"class\", \"tick\").style(\"opacity\", \"1\"),\n\t\t\t tickExit = tick.exit().remove();\n\n\t\t\t// update selection\n\n\n\t\t\t// enter selection\n\n\n\t\t\t// MEMO: No exit transition. The reason is this transition affects max tick width calculation because old tick will be included in the ticks.\n\t\t\ttick = tickEnter.merge(tick);\n\n\n\t\t\tvar tickUpdate = transitionise(tick).style(\"opacity\", \"1\"),\n\t\t\t tickTransform = void 0,\n\t\t\t tickX = void 0,\n\t\t\t tickY = void 0,\n\t\t\t range = scale.rangeExtent ? scale.rangeExtent() : scaleExtent((params.orgXScale || scale).range()),\n\t\t\t path = g.selectAll(\".domain\").data([0]),\n\t\t\t pathUpdate = path.enter().append(\"path\").attr(\"class\", \"domain\").merge(transitionise(path));\n\n\t\t\t// update selection - data join\n\n\n\t\t\t// enter + update selection\n\t\t\ttickEnter.append(\"line\"), tickEnter.append(\"text\");\n\n\n\t\t\tvar lineEnter = tickEnter.select(\"line\"),\n\t\t\t lineUpdate = tickUpdate.select(\"line\"),\n\t\t\t textEnter = tickEnter.select(\"text\"),\n\t\t\t textUpdate = tickUpdate.select(\"text\");\n\t\t\tparams.isCategory ? (tickOffset = Math.ceil((scale1(1) - scale1(0)) / 2), tickX = tickCentered ? 0 : tickOffset, tickY = tickCentered ? tickOffset : 0) : (tickX = 0, tickOffset = tickX);\n\n\n\t\t\tvar tspan = void 0,\n\t\t\t sizeFor1Char = _getSizeFor1Char(g.select(\".tick\")),\n\t\t\t counts = [],\n\t\t\t tickLength = Math.max(6, 0) + 3,\n\t\t\t isVertical = orient === \"left\" || orient === \"right\",\n\t\t\t text = tick.select(\"text\");tspan = text.selectAll(\"tspan\").data(function (d, index) {\n\t\t\t\tvar split = params.tickMultiline ? splitTickText(d, params.tickWidth) : (0, _util.isArray)(textFormatted(d)) ? textFormatted(d).concat() : [textFormatted(d)];\n\n\t\t\t\treturn counts[index] = split.length, split.map(function (splitted) {\n\t\t\t\t\treturn {\n\t\t\t\t\t\tindex: index,\n\t\t\t\t\t\tsplitted: splitted\n\t\t\t\t\t};\n\t\t\t\t});\n\t\t\t}), tspan.exit().remove(), tspan = tspan.enter().append(\"tspan\").merge(tspan).text(function (d) {\n\t\t\t\treturn d.splitted;\n\t\t\t});\n\n\n\t\t\tvar rotate = params.tickTextRotate;\n\n\t\t\tif (orient === \"bottom\" ? (tickTransform = axisX, lineEnter.attr(\"y2\", 6), textEnter.attr(\"y\", 9), lineUpdate.attr(\"x1\", tickX).attr(\"x2\", tickX).attr(\"y2\", tickSize), textUpdate.attr(\"x\", 0).attr(\"y\", function (r) {\n\t\t\t\treturn r ? 11.5 - 2.5 * (r / 15) * (r > 0 ? 1 : -1) : 9;\n\t\t\t}(rotate)).style(\"text-anchor\", function (r) {\n\t\t\t\treturn r ? r > 0 ? \"start\" : \"end\" : \"middle\";\n\t\t\t}(rotate)).attr(\"transform\", function (r) {\n\t\t\t\treturn r ? \"rotate(\" + r + \")\" : \"\";\n\t\t\t}(rotate)), tspan.attr(\"x\", 0).attr(\"dy\", tspanDy).attr(\"dx\", function (r) {\n\t\t\t\treturn r ? 8 * Math.sin(Math.PI * (r / 180)) : 0;\n\t\t\t}(rotate)), pathUpdate.attr(\"d\", \"M\" + range[0] + \",\" + outerTickSize + \"V0H\" + range[1] + \"V\" + outerTickSize)) : orient === \"top\" ? (tickTransform = axisX, lineEnter.attr(\"y2\", -6), textEnter.attr(\"y\", -9), lineUpdate.attr(\"x2\", 0).attr(\"y2\", -6), textUpdate.attr(\"x\", 0).attr(\"y\", -9), text.style(\"text-anchor\", \"middle\"), tspan.attr(\"x\", 0).attr(\"dy\", \"0em\"), pathUpdate.attr(\"d\", \"M\" + range[0] + \",\" + -outerTickSize + \"V0H\" + range[1] + \"V\" + -outerTickSize)) : orient === \"left\" ? (tickTransform = axisY, lineEnter.attr(\"x2\", -6), textEnter.attr(\"x\", -9), lineUpdate.attr(\"x2\", -6).attr(\"y1\", tickY).attr(\"y2\", tickY), textUpdate.attr(\"x\", -9).attr(\"y\", tickOffset), text.style(\"text-anchor\", \"end\"), tspan.attr(\"x\", -9).attr(\"dy\", tspanDy), pathUpdate.attr(\"d\", \"M\" + -outerTickSize + \",\" + range[0] + \"H0V\" + range[1] + \"H\" + -outerTickSize)) : orient === \"right\" ? (tickTransform = axisY, lineEnter.attr(\"x2\", 6), textEnter.attr(\"x\", 9), lineUpdate.attr(\"x2\", 6).attr(\"y2\", 0), textUpdate.attr(\"x\", 9).attr(\"y\", 0), text.style(\"text-anchor\", \"start\"), tspan.attr(\"x\", 9).attr(\"dy\", tspanDy), pathUpdate.attr(\"d\", \"M\" + outerTickSize + \",\" + range[0] + \"H0V\" + range[1] + \"H\" + outerTickSize)) : void 0, params.tickTitle && textUpdate.append && textUpdate.append(\"title\").each(function (index) {\n\t\t\t\t(0, _d3Selection.select)(this).text(params.tickTitle[index]);\n\t\t\t}), scale1.bandwidth) {\n\t\t\t\tvar x = scale1,\n\t\t\t\t dx = x.bandwidth() / 2;\n\t\t\t\tscale0 = function (d) {\n\t\t\t\t\treturn x(d) + dx;\n\t\t\t\t}, scale1 = scale0;\n\t\t\t} else scale0.bandwidth ? scale0 = scale1 : tickExit.call(tickTransform, scale1);\n\n\t\t\ttickEnter.call(tickTransform, scale0), tickUpdate.call(tickTransform, scale1);\n\t\t});\n\t}\n\n\tvar params = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},\n\t scale = (0, _d3Scale.scaleLinear)(),\n\t orient = \"bottom\",\n\t outerTickSize = params.withOuterTick ? 6 : 0,\n\t tickValues = null,\n\t tickFormat = void 0,\n\t tickArguments = void 0,\n\t tickOffset = 0,\n\t tickCulling = !0,\n\t tickCentered = void 0,\n\t transition = void 0,\n\t _getSizeFor1Char = function getSizeFor1Char(tick) {\n\t\t// default size for one character\n\t\tvar size = {\n\t\t\th: 11.5,\n\t\t\tw: 5.5\n\t\t};\n\n\t\treturn tick.empty() || tick.select(\"text\").text(\"0\").call(function (el) {\n\t\t\tvar box = el.node().getBBox(),\n\t\t\t h = box.height,\n\t\t\t w = box.width;\n\t\t\th && w && (size.h = h, size.w = w), el.text(\"\");\n\t\t}), _getSizeFor1Char = function getSizeFor1Char() {\n\t\t\treturn size;\n\t\t}, size;\n\t};\n\n\treturn axis.scale = function (x) {\n\t\treturn arguments.length ? (scale = x, axis) : scale;\n\t}, axis.orient = function (x) {\n\t\treturn arguments.length ? (orient = x in {\n\t\t\ttop: 1,\n\t\t\tright: 1,\n\t\t\tbottom: 1,\n\t\t\tleft: 1\n\t\t} ? x + \"\" : \"bottom\", axis) : orient;\n\t}, axis.tickFormat = function (format) {\n\t\treturn arguments.length ? (tickFormat = format, axis) : tickFormat;\n\t}, axis.tickCentered = function (isCentered) {\n\t\treturn arguments.length ? (tickCentered = isCentered, axis) : tickCentered;\n\t}, axis.tickOffset = function () {\n\t\treturn tickOffset;\n\t}, axis.tickInterval = function (size) {\n\t\tvar interval = void 0;\n\n\t\tif (params.isCategory) interval = tickOffset * 2;else {\n\t\t\tvar length = axis.g.select(\"path.domain\").node().getTotalLength() - outerTickSize * 2;\n\n\t\t\tinterval = length / (size || axis.g.selectAll(\"line\").size());\n\t\t}\n\n\t\treturn interval === Infinity ? 0 : interval;\n\t}, axis.ticks = function () {\n\t\tfor (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) args[_key] = arguments[_key];\n\n\t\treturn args.length ? (tickArguments = (0, _util.toArray)(args), axis) : tickArguments;\n\t}, axis.tickCulling = function (culling) {\n\t\treturn arguments.length ? (tickCulling = culling, axis) : tickCulling;\n\t}, axis.tickValues = function (x) {\n\t\tif ((0, _util.isFunction)(x)) tickValues = function () {\n\t\t\t\treturn x(scale.domain());\n\t\t\t};else {\n\t\t\tif (!arguments.length) return tickValues;\n\n\t\t\ttickValues = x;\n\t\t}\n\n\t\treturn this;\n\t}, axis.setTransition = function (t) {\n\t\treturn transition = t, this;\n\t}, axis;\n}", "function determineUnitForFormatting(ticks, minUnit, min, max) {\n var duration = moment.duration(moment(max).diff(moment(min)));\n var ilen = UNITS.length;\n var i, unit;\n\n for (i = ilen - 1; i >= UNITS.indexOf(minUnit); i--) {\n unit = UNITS[i];\n if (INTERVALS[unit].common && duration.as(unit) >= ticks.length) {\n return unit;\n }\n }\n\n return UNITS[minUnit ? UNITS.indexOf(minUnit) : 0];\n }", "function groupTicks(d) {\n var k = (d.endAngle - d.startAngle) / d.value;\n return d3.range(0, d.value, 1000).map(function(v, i) {\n return {\n angle: v * k + d.startAngle,\n label: d.value\n };\n });\n }", "get colliderWidth () {\n\t\tlet leftMostX = this.isSignMagnitude ? this.signLabel.x : ZERO;\n\t\tlet rightMostX = this.textLabel.x + this.textLabel.width;\n\t\treturn rightMostX - leftMostX;\n\t}", "function groupTicks(d) {\n var k = (d.endAngle - d.startAngle) / d.value;\n return d3.range(0, d.value, 1000).map(function(v, i) {\n return {\n angle: v * k + d.startAngle,\n label: i % 5 ? null : v / 1000 + \"k\"\n };\n });\n}", "function groupTicks(d) {\n var k = (d.endAngle - d.startAngle) / d.value;\n return d3.range(0, d.value, 1000).map(function(v, i) {\n return {\n angle: v * k + d.startAngle,\n label: i % 5 ? null : v / 1000 + \"k\"\n };\n });\n}", "function groupTicks(d) {\n var k = (d.endAngle - d.startAngle)/ (d.value );\n return d3.range(0, d.value, 1).map(function(v, i) {\n return {\n angle: v * k + d.startAngle,\n label: i % 1 ? null : v \n };\n });\n}", "dpi () {\n return this.chart.width / this.interval.width * this.zoom.value;\n }", "get swingSubdivision() {\n return new TicksClass(this.context, this._swingTicks).toNotation();\n }", "function groupTicks(d) {\n var k = (d.endAngle - d.startAngle) / d.value;\n return d3.range(0, d.value, 1000).map(function(v, i) {\n return {\n angle: v * k + d.startAngle,\n label: labels[d.index]\n };\n });\n }", "function groupTicks(d) {\n var k = (d.endAngle - d.startAngle) / d.value;\n return d3.range(0, d.value, 10).map(function(v, i) {\n return {\n angle: v * k + d.startAngle,\n label: i % 5 ? null : v\n };\n });\n}//groupTicks", "function niceAxisNumbering(amin, amax, ntick) {\n var nfrac; // number of fractional digits to show\n var d; // tick mark spacing\n var graphmin, graphmax;\n var range, x;\n var axisValues = [];\n\n if (amin>0 && amin/amax < 0.5) amin = 0; // My fudge, to show origin when appropriate.\n\n range = niceNum(amax-amin, false);\n d = niceNum(range/(ntick-1), true);\n graphmin = Math.floor(amin/d)*d;\n graphmax = Math.ceil(amax/d)*d;\n nfrac = Math.max(-Math.floor(log10(d)),0);\n \n \n for (x=graphmin; x<=graphmax+0.5*d; x+=d) {\n axisValues.push(x);\n }\n return axisValues;\n}", "function decorateInterval(interval) {\n\t var esInterval = calcEsInterval(interval);\n\t interval.esValue = esInterval.value;\n\t interval.esUnit = esInterval.unit;\n\t interval.expression = esInterval.expression;\n\t interval.overflow = duration > interval ? moment.duration(interval - duration) : false;\n\n\t var prettyUnits = moment.normalizeUnits(esInterval.unit);\n\t if (esInterval.value === 1) {\n\t interval.description = prettyUnits;\n\t } else {\n\t interval.description = esInterval.value + ' ' + prettyUnits + 's';\n\t }\n\n\t return interval;\n\t }", "function groupTicks(d) {\n var k = (d.endAngle - d.startAngle) / d.value;\n return d3.range(0, d.value, 1).map(function(v, i) {\n return {\n angle: v * k + d.startAngle,\n label: i % 5 ? null : v + \"%\"\n };\n });\n}", "function getLinearTickPositions(arr,$maxPart,$cfg) {\n \tvar scale = $cfg && $cfg.scale ? parseFloat($cfg.scale) :1\n\n\t\tif(isNaN(scale)){\n\t\t\tscale = 1\n\t\t}\n // var max = arrayMax(arr);\n var max = Math.max.apply(null,arr)\n var initMax = max\n max *= scale\n // var min = arrayMin(arr);\n var min = Math.min.apply(null,arr) \n\n if(min==max){\n \tif(max>=0){\n \t\tmin= 0\n \t\t// min= Math.round(max/2);\n \t}\n \telse{\n \t\tmin=max*2;\n \t}\n }\n\n var length = max - min;\n if (length) {\n \tvar tempmin = min //保证min>0的时候不会出现负数\n \tmin -= length * 0.05;\n // S.log(min +\":\"+ tempmin)\n if(min<0 && tempmin>=0){\n \tmin=0\n }\n max += length * 0.05;\n }\n \n var tickInterval = (max - min) * 72 / 365;\n var magnitude = Math.pow(10, Math.floor(Math.log(tickInterval) / Math.LN10));\n\n tickInterval = normalizeTickInterval(tickInterval, magnitude);\n\n var pos,\n lastPos,\n roundedMin = correctFloat(Math.floor(min / tickInterval) * tickInterval),\n roundedMax = correctFloat(Math.ceil(max / tickInterval) * tickInterval),\n tickPositions = [];\n\n // Populate the intermediate values\n pos = roundedMin;\n while (pos <= roundedMax) {\n\n // Place the tick on the rounded value\n tickPositions.push(pos);\n\n // Always add the raw tickInterval, not the corrected one.\n pos = correctFloat(pos + tickInterval) \n\n // If the interval is not big enough in the current min - max range to actually increase\n // the loop variable, we need to break out to prevent endless loop. Issue #619\n if (pos === lastPos) {\n break;\n }\n\n // Record the last value\n lastPos = pos;\n }\n if(tickPositions.length >= 3){\n \tif(tickPositions[tickPositions.length - 2] >= initMax){\n\t\t\t\ttickPositions.pop()\n\t\t\t}\n }\n return tickPositions;\n }", "function determineUnitForFormatting(ticks, minUnit, min, max) {\n\tvar duration = moment.duration(moment(max).diff(moment(min)));\n\tvar ilen = UNITS.length;\n\tvar i, unit;\n\n\tfor (i = ilen - 1; i >= UNITS.indexOf(minUnit); i--) {\n\t\tunit = UNITS[i];\n\t\tif (INTERVALS[unit].common && duration.as(unit) >= ticks.length) {\n\t\t\treturn unit;\n\t\t}\n\t}\n\n\treturn UNITS[minUnit ? UNITS.indexOf(minUnit) : 0];\n}", "function determineUnitForFormatting(ticks, minUnit, min, max) {\n\tvar duration = moment.duration(moment(max).diff(moment(min)));\n\tvar ilen = UNITS.length;\n\tvar i, unit;\n\n\tfor (i = ilen - 1; i >= UNITS.indexOf(minUnit); i--) {\n\t\tunit = UNITS[i];\n\t\tif (INTERVALS[unit].common && duration.as(unit) >= ticks.length) {\n\t\t\treturn unit;\n\t\t}\n\t}\n\n\treturn UNITS[minUnit ? UNITS.indexOf(minUnit) : 0];\n}", "function determineUnitForFormatting(ticks, minUnit, min, max) {\n\tvar duration = moment.duration(moment(max).diff(moment(min)));\n\tvar ilen = UNITS.length;\n\tvar i, unit;\n\n\tfor (i = ilen - 1; i >= UNITS.indexOf(minUnit); i--) {\n\t\tunit = UNITS[i];\n\t\tif (INTERVALS[unit].common && duration.as(unit) >= ticks.length) {\n\t\t\treturn unit;\n\t\t}\n\t}\n\n\treturn UNITS[minUnit ? UNITS.indexOf(minUnit) : 0];\n}", "function determineUnitForFormatting(ticks, minUnit, min, max) {\n\tvar duration = moment.duration(moment(max).diff(moment(min)));\n\tvar ilen = UNITS.length;\n\tvar i, unit;\n\n\tfor (i = ilen - 1; i >= UNITS.indexOf(minUnit); i--) {\n\t\tunit = UNITS[i];\n\t\tif (INTERVALS[unit].common && duration.as(unit) >= ticks.length) {\n\t\t\treturn unit;\n\t\t}\n\t}\n\n\treturn UNITS[minUnit ? UNITS.indexOf(minUnit) : 0];\n}", "function determineUnitForFormatting(ticks, minUnit, min, max) {\n\tvar duration = moment.duration(moment(max).diff(moment(min)));\n\tvar ilen = UNITS.length;\n\tvar i, unit;\n\n\tfor (i = ilen - 1; i >= UNITS.indexOf(minUnit); i--) {\n\t\tunit = UNITS[i];\n\t\tif (INTERVALS[unit].common && duration.as(unit) >= ticks.length) {\n\t\t\treturn unit;\n\t\t}\n\t}\n\n\treturn UNITS[minUnit ? UNITS.indexOf(minUnit) : 0];\n}", "function determineUnitForFormatting(ticks, minUnit, min, max) {\n\tvar duration = moment.duration(moment(max).diff(moment(min)));\n\tvar ilen = UNITS.length;\n\tvar i, unit;\n\n\tfor (i = ilen - 1; i >= UNITS.indexOf(minUnit); i--) {\n\t\tunit = UNITS[i];\n\t\tif (INTERVALS[unit].common && duration.as(unit) >= ticks.length) {\n\t\t\treturn unit;\n\t\t}\n\t}\n\n\treturn UNITS[minUnit ? UNITS.indexOf(minUnit) : 0];\n}", "function determineUnitForFormatting(ticks, minUnit, min, max) {\n\tvar duration = moment.duration(moment(max).diff(moment(min)));\n\tvar ilen = UNITS.length;\n\tvar i, unit;\n\n\tfor (i = ilen - 1; i >= UNITS.indexOf(minUnit); i--) {\n\t\tunit = UNITS[i];\n\t\tif (INTERVALS[unit].common && duration.as(unit) >= ticks.length) {\n\t\t\treturn unit;\n\t\t}\n\t}\n\n\treturn UNITS[minUnit ? UNITS.indexOf(minUnit) : 0];\n}", "function determineUnitForFormatting(ticks, minUnit, min, max) {\n\tvar duration = moment.duration(moment(max).diff(moment(min)));\n\tvar ilen = UNITS.length;\n\tvar i, unit;\n\n\tfor (i = ilen - 1; i >= UNITS.indexOf(minUnit); i--) {\n\t\tunit = UNITS[i];\n\t\tif (INTERVALS[unit].common && duration.as(unit) >= ticks.length) {\n\t\t\treturn unit;\n\t\t}\n\t}\n\n\treturn UNITS[minUnit ? UNITS.indexOf(minUnit) : 0];\n}", "function determineUnitForFormatting(ticks, minUnit, min, max) {\n\tvar duration = moment.duration(moment(max).diff(moment(min)));\n\tvar ilen = UNITS.length;\n\tvar i, unit;\n\n\tfor (i = ilen - 1; i >= UNITS.indexOf(minUnit); i--) {\n\t\tunit = UNITS[i];\n\t\tif (INTERVALS[unit].common && duration.as(unit) >= ticks.length) {\n\t\t\treturn unit;\n\t\t}\n\t}\n\n\treturn UNITS[minUnit ? UNITS.indexOf(minUnit) : 0];\n}", "function determineUnitForFormatting(ticks, minUnit, min, max) {\n\tvar duration = moment.duration(moment(max).diff(moment(min)));\n\tvar ilen = UNITS.length;\n\tvar i, unit;\n\n\tfor (i = ilen - 1; i >= UNITS.indexOf(minUnit); i--) {\n\t\tunit = UNITS[i];\n\t\tif (INTERVALS[unit].common && duration.as(unit) >= ticks.length) {\n\t\t\treturn unit;\n\t\t}\n\t}\n\n\treturn UNITS[minUnit ? UNITS.indexOf(minUnit) : 0];\n}", "function determineUnitForFormatting(ticks, minUnit, min, max) {\n\tvar duration = moment.duration(moment(max).diff(moment(min)));\n\tvar ilen = UNITS.length;\n\tvar i, unit;\n\n\tfor (i = ilen - 1; i >= UNITS.indexOf(minUnit); i--) {\n\t\tunit = UNITS[i];\n\t\tif (INTERVALS[unit].common && duration.as(unit) >= ticks.length) {\n\t\t\treturn unit;\n\t\t}\n\t}\n\n\treturn UNITS[minUnit ? UNITS.indexOf(minUnit) : 0];\n}", "function determineUnitForFormatting(ticks, minUnit, min, max) {\n\tvar duration = moment.duration(moment(max).diff(moment(min)));\n\tvar ilen = UNITS.length;\n\tvar i, unit;\n\n\tfor (i = ilen - 1; i >= UNITS.indexOf(minUnit); i--) {\n\t\tunit = UNITS[i];\n\t\tif (INTERVALS[unit].common && duration.as(unit) >= ticks.length) {\n\t\t\treturn unit;\n\t\t}\n\t}\n\n\treturn UNITS[minUnit ? UNITS.indexOf(minUnit) : 0];\n}", "function determineUnitForFormatting(ticks, minUnit, min, max) {\n\tvar duration = moment.duration(moment(max).diff(moment(min)));\n\tvar ilen = UNITS.length;\n\tvar i, unit;\n\n\tfor (i = ilen - 1; i >= UNITS.indexOf(minUnit); i--) {\n\t\tunit = UNITS[i];\n\t\tif (INTERVALS[unit].common && duration.as(unit) >= ticks.length) {\n\t\t\treturn unit;\n\t\t}\n\t}\n\n\treturn UNITS[minUnit ? UNITS.indexOf(minUnit) : 0];\n}", "function determineUnitForFormatting(ticks, minUnit, min, max) {\n\tvar duration = moment.duration(moment(max).diff(moment(min)));\n\tvar ilen = UNITS.length;\n\tvar i, unit;\n\n\tfor (i = ilen - 1; i >= UNITS.indexOf(minUnit); i--) {\n\t\tunit = UNITS[i];\n\t\tif (INTERVALS[unit].common && duration.as(unit) >= ticks.length) {\n\t\t\treturn unit;\n\t\t}\n\t}\n\n\treturn UNITS[minUnit ? UNITS.indexOf(minUnit) : 0];\n}", "function determineUnitForFormatting(ticks, minUnit, min, max) {\n\tvar duration = moment.duration(moment(max).diff(moment(min)));\n\tvar ilen = UNITS.length;\n\tvar i, unit;\n\n\tfor (i = ilen - 1; i >= UNITS.indexOf(minUnit); i--) {\n\t\tunit = UNITS[i];\n\t\tif (INTERVALS[unit].common && duration.as(unit) >= ticks.length) {\n\t\t\treturn unit;\n\t\t}\n\t}\n\n\treturn UNITS[minUnit ? UNITS.indexOf(minUnit) : 0];\n}", "function determineUnitForFormatting(ticks, minUnit, min, max) {\n\tvar duration = moment.duration(moment(max).diff(moment(min)));\n\tvar ilen = UNITS.length;\n\tvar i, unit;\n\n\tfor (i = ilen - 1; i >= UNITS.indexOf(minUnit); i--) {\n\t\tunit = UNITS[i];\n\t\tif (INTERVALS[unit].common && duration.as(unit) >= ticks.length) {\n\t\t\treturn unit;\n\t\t}\n\t}\n\n\treturn UNITS[minUnit ? UNITS.indexOf(minUnit) : 0];\n}", "function determineUnitForFormatting(ticks, minUnit, min, max) {\n\tvar duration = moment.duration(moment(max).diff(moment(min)));\n\tvar ilen = UNITS.length;\n\tvar i, unit;\n\n\tfor (i = ilen - 1; i >= UNITS.indexOf(minUnit); i--) {\n\t\tunit = UNITS[i];\n\t\tif (INTERVALS[unit].common && duration.as(unit) >= ticks.length) {\n\t\t\treturn unit;\n\t\t}\n\t}\n\n\treturn UNITS[minUnit ? UNITS.indexOf(minUnit) : 0];\n}", "function determineUnitForFormatting(ticks, minUnit, min, max) {\n\tvar duration = moment.duration(moment(max).diff(moment(min)));\n\tvar ilen = UNITS.length;\n\tvar i, unit;\n\n\tfor (i = ilen - 1; i >= UNITS.indexOf(minUnit); i--) {\n\t\tunit = UNITS[i];\n\t\tif (INTERVALS[unit].common && duration.as(unit) >= ticks.length) {\n\t\t\treturn unit;\n\t\t}\n\t}\n\n\treturn UNITS[minUnit ? UNITS.indexOf(minUnit) : 0];\n}", "function determineUnitForFormatting(ticks, minUnit, min, max) {\n\tvar duration = moment.duration(moment(max).diff(moment(min)));\n\tvar ilen = UNITS.length;\n\tvar i, unit;\n\n\tfor (i = ilen - 1; i >= UNITS.indexOf(minUnit); i--) {\n\t\tunit = UNITS[i];\n\t\tif (INTERVALS[unit].common && duration.as(unit) >= ticks.length) {\n\t\t\treturn unit;\n\t\t}\n\t}\n\n\treturn UNITS[minUnit ? UNITS.indexOf(minUnit) : 0];\n}" ]
[ "0.7746507", "0.7746507", "0.7739931", "0.7715091", "0.77078474", "0.6546765", "0.64099866", "0.64099866", "0.64099866", "0.64099866", "0.62500155", "0.5976774", "0.58163536", "0.5799666", "0.57894534", "0.57893443", "0.56676996", "0.55825084", "0.5572562", "0.555126", "0.5525152", "0.5475056", "0.54395187", "0.5420106", "0.53805655", "0.530576", "0.529554", "0.52385783", "0.52189463", "0.5160026", "0.5160026", "0.5160026", "0.51391476", "0.50866294", "0.50680345", "0.50366825", "0.5032012", "0.50230044", "0.49987614", "0.49577957", "0.49555194", "0.49300587", "0.48956224", "0.4858534", "0.4855173", "0.48480904", "0.48393494", "0.48390913", "0.48270002", "0.48023283", "0.4800383", "0.47845885", "0.4784056", "0.47703835", "0.47573704", "0.47540265", "0.47503036", "0.47503036", "0.47503036", "0.47503036", "0.47503036", "0.47503036", "0.4741712", "0.47274622", "0.47044012", "0.46709943", "0.46532947", "0.46513158", "0.46448785", "0.464346", "0.464346", "0.46342868", "0.4633869", "0.4631378", "0.46297", "0.46286544", "0.46215808", "0.46080396", "0.45917144", "0.45831177", "0.45827055", "0.45827055", "0.45827055", "0.45827055", "0.45827055", "0.45827055", "0.45827055", "0.45827055", "0.45827055", "0.45827055", "0.45827055", "0.45827055", "0.45827055", "0.45827055", "0.45827055", "0.45827055", "0.45827055", "0.45827055", "0.45827055" ]
0.7746507
3
It is time consuming for large category data.
function makeLabelsByCustomizedCategoryInterval(axis, categoryInterval, onlyTick) { var ordinalScale = axis.scale; var labelFormatter = makeLabelFormatter(axis); var result = []; zrUtil.each(ordinalScale.getTicks(), function (tickValue) { var rawLabel = ordinalScale.getLabel(tickValue); if (categoryInterval(tickValue, rawLabel)) { result.push(onlyTick ? tickValue : { formattedLabel: labelFormatter(tickValue), rawLabel: rawLabel, tickValue: tickValue }); } }); return result; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function disneyCategories(){\n //fetch get index for attractions\n \n byCategory()\n}", "parseUniqueCategories(dataSet) {\n return dataSet.businesses.reduce((accum, business) => {\n business.categories.forEach((item) => {\n if (!(accum.findIndex(ele => ele.displayTitle === item[0]) + 1)) {\n const newObject = {\n displayTitle: item[0],\n imageUrl: business.image_url,\n };\n accum.push(newObject);\n }\n });\n return accum;\n }, []);\n }", "get categoryMapping() {\n let categoryMapping = {};\n this.domain.forEach(d => {\n this.currentCategories.forEach(f => {\n if (f.categories.includes(d.toString())) {\n categoryMapping[d] = f.name;\n }\n });\n });\n return categoryMapping;\n }", "categ(state,data)\n {\n return state.category=data\n }", "function prepareCategories(data) {\n const newCategory = {\n 'parent_id': parseInt(data['Parent ID']) || 0,\n 'name': data['Category Name'],\n 'description': data['Category Description'],\n 'sort_order': parseInt(data['Sort Order']) || 0,\n 'page_title': data['Page Title'],\n 'meta_keywords': [data['Meta Keywords']],\n 'meta_description': data['Meta Description'],\n 'image_url': data['Category Image URL'],\n 'is_visible': yesNoToBoolean(data['Category Visible']) || true,\n 'search_keywords': data['Search Keywords'],\n 'default_product_sort': data['Default Product Sort'] || 'use_store_settings'\n };\n if (data['Category URL'] && data['Custom URL']) {\n newCategory['custom_url'] = {\n 'url': data['Category URL'],\n 'is_customized': yesNoToBoolean(data['Custom URL'])\n };\n }\n \n return categoryArray.push(newCategory);\n }", "getData(category){\n let data = [];\n let subcategories = [];\n let count = this.getCount(category);\n let types = this.getAllPossible(category);\n \n types.forEach((type) => {\n subcategories.push(type.value);\n });\n\n data.push(subcategories);\n data.push(count);\n\n return data;\n }", "fetchCategory(category) {\n\t\t\t\tthis.reset();\n\n\t\t\t\tfor (let i = 1; i <= 10; i++) {\n\t\t\t\t\tthis.add({\n\t\t\t\t\t\tnumber: i,\n\t\t\t\t\t\tcategory: category ? category : 'sports',\n\t\t\t\t\t\tisHidden: i !== 1\n\t\t\t\t\t});\n\t\t\t\t}\n\t\t\t}", "transformCategoriesData(categories) {\n let categoriesTransformed = categories.map(category => { \n return category.categories\n })\n\n return categoriesTransformed\n}", "get categoryValues() {\n let mapped = {};\n\n for (id of this.__document.categoryValues) {\n mapped[id] = (__document.categoryValues[id] || []).map(\n entry => new CategoryValue(entry)\n );\n }\n\n return mapped;\n }", "function countCategoryTweets(data) {\n data.forEach( function(item) {\n switch(item.category){\n case 'democratic presidential candidates': return Data.categories[0].count++\n case 'republican presidential candidates': return Data.categories[1].count++\n case 'journalists and other media figures': return Data.categories[2].count++\n case 'television shows': return Data.categories[3].count++\n case 'republican politicians': return Data.categories[4].count++\n case 'places': return Data.categories[5].count++\n case 'other people': return Data.categories[6].count++\n case 'other': return Data.categories[7].count++\n case 'media organizations': return Data.categories[8].count++\n case 'groups and political organizations': return Data.categories[9].count++\n case 'democratic politicians': return Data.categories[10].count++\n case 'celebrities': return Data.categories[11].count++\n }\n })\n sortingFunction()\n}", "function _dex_getCategories(){ // Step 1 of 2 – Gets top-level categories\n var t=new Date().getTime(),out={},ar=LibraryjsUtil.getHtmlData(\"http://www.dexknows.com/browse-directory\",/\\\"http:\\/\\/www\\.dexknows\\.com\\/local\\/(\\w+\\/\\\">.+)<\\/a>/gm)//return ar;\n ,i=ar.length;while(i--){ar[i]=ar[i].split('/\">');ar[i][1]=ar[i][1].replace(/&amp;/g,\"&\");out[ar[i][0]]={\"displayName\":ar[i][1]}}\n LibraryjsUtil.write2fb(\"torrid-heat-2303\",\"dex/categories/\",\"put\",out)}//function test(){/*print2doc*/Logger.log(_dex_getCategories())}", "async getAllActiveCategories() {\n\n const token = localStorage.getItem('token');\n \n await axios.get(`http://${config.host}:${config.port}/university/`, {\n headers:\n {\n token: token\n \n }\n }).then(res => {\n this.setState({\n \n categoryArray: res.data.data\n\n\n \n })\n\n for (let index = 0; index < this.state.categoryArray.length; index++) {\n \n this.state.labels.push(this.state.categoryArray[index].name);\n LabelArray[index]=(this.state.categoryArray[index].name).toString();\n \n \n \n\n }\n \n\n this.getProductsCountByCategory();\n \n \n }).catch(err => {\n console.log(err);\n \n \n })\n \n }", "function loadCategoryStatsData(data) {\n category_stats = data;\n}", "function success_getAllCategories(r) {\n productBO.cacheAllCategories=r;\n }", "getUniqueCategory() {\n //itereate over list of entries using map\n //callback function makes array of unique tags based on the tag array\n //return newly created array\n\n var data = this.data;\n\n\n //parse out all tags\n var uniqueTags = data.reduce(function(prev, curr) {\n console.log(\"prev vs curr\", prev, curr);\n return [...prev, ...curr.photo_tags];\n }, ''); \n\n console.log(\"unique tags:\", uniqueTags);\n //remove duplicates\n var dedupedTags = uniqueTags.filter(function(item, pos, self) {\n //console.log(\"item vs pos\", item, pos);\n return self.indexOf(item) == pos;\n });\n\n //covert all entries to lower case \n dedupedTags = dedupedTags.map(function(x){ console.log(\"while deduping:\",x.title); return x.title.toLowerCase() });\n\n //return sorted array\n this.sortedTags = dedupedTags.sort();\n\n }", "function readCategories(filePath)\r\n{\r\n let categories = {};\r\n let srcCategories = fs.readFileSync(filePath, 'utf-8');\r\n srcCategories = srcCategories.toString().split('|||||');\r\n\r\n // Re-index subcategories by their main category\r\n srcCategories.forEach(function(category, index) {\r\n if (category) {\r\n category = JSON.parse(category);\r\n if (/no/i.test(category.name)) {\r\n categories.nmg = category;\r\n } else {\r\n categories.mg = category;\r\n }\r\n }\r\n });\r\n\r\n return categories;\r\n}", "componentDidMount(){\n BooksAPI.getAll().then(data =>{\n this.setState({books : data, category : Utils.categoryTitle(data)})\n // const categories = data.map(data => data.shelf);\n // const getCategories = categories.filter((item,index)=> categories.indexOf(item) === index)\n\n })\n \n }", "function getCategories() {\n const apicall = 'http://localhost:3010/api/events/categories';\n fetch(apicall, {\n method: 'GET',\n }).then((response) => {\n if (!response.ok) {\n if (response.status === 401) {\n throw response;\n }\n }\n return response.json();\n }).then((json) => {\n setCategoryList(json);\n json.map((category1) =>\n // attach to category state\n setCategories({...categories, [category1.category]: false}),\n );\n })\n .catch((error) => {\n console.log(error);\n });\n }", "async getCategories(_, __, context) {\n try {\n let categories = await Category.find().sort({ createdAt: -1 });\n return categories;\n\n // newArr = [];\n\n // for (let cat of categories) {\n // newArr.push({ category: cat });\n // }\n // return newArr;\n\n // return [ {category} ];\n } catch (err) {\n throw new Error(err);\n }\n }", "async getCategories() {\n //get categories from API\n const res = await axios.get('https://jservice.io/api/categories?count=100')\n\n //categories to be returned.\n let result = []\n\n //keeps track of which categories have already been selected to avoid duplicated.\n let categoriesTracker = []\n \n //Select 6 random categories\n let numberOfElementsSelected = 0\n while (numberOfElementsSelected < 6) {\n let randomNumber = Math.floor(Math.random() * res.data.length)\n if (!categoriesTracker.includes(randomNumber)) {\n // get id of random category picked\n let catId = res.data[randomNumber].id\n\n //get category data and check if if has more than at least 6 Q&A for 6 rows.\n let cluesCount = await axios.get(`https://jservice.io/api/category?id=${catId}`)\n\n //if Category has at least 6 Q and A then add to categories to be returned.\n if (cluesCount.data.clues.length > 5) {\n categoriesTracker.push(randomNumber)\n let temp = res.data.slice(randomNumber, randomNumber+1)\n result.push(temp[0])\n numberOfElementsSelected++\n }\n \n }\n }\n \n return result;\n }", "function loadCategories() {\n\t\tlet categories = new wp.api.collections.Categories()\n\n\t\tcategories.fetch().done( () => {\n\t\t\tconsole.log(categories);\n\t\t\t\t//clearCategories();\n\t\t\t\tcategories.each( category => loadCategory( category.attributes ) );\n\t\t});\n\t}", "function loadCategories() {\n\tjQuery.post(\n\t\tgetConnectorURL(),\n\t\t{\n\t\t\taction: 'get_categories'\n\t\t},\n\t\tfunction(result) {\n\t\t\tcategories = result.categories;\n\n\t\t\tdb.transaction(\n\t\t\t\tfunction (tx) {\n\t\t\t\t\ttx.executeSql(\"DROP TABLE IF EXISTS categories\");\n\t\t\t\t\ttx.executeSql(\"CREATE TABLE IF NOT EXISTS categories(categoryid INTEGER, category TEXT)\");\n\n\t\t\t\t\tfor (i in categories) {\n\t\t\t\t\t\tconsole.log(categories[i].category);\n\t\t\t\t\t\ttx.executeSql(\"INSERT INTO categories(category) VALUES ('\"+dbEscape(categories[i]['category'])+\"')\");\n\t\t\t\t\t}\n\t\t\t\t},\n\t\t\t\tdbError,\n\t\t\t\tdbSuccess\n\t\t\t)\n\t\t},\n\t\t'jsonp'\n\t)\t\n}", "constructor() {\n\t\tthis.categories = [];\n\t}", "function categories() {\n // assign categories object to a variable\n var categories = memory.categories;\n // loop through categories\n for (category in categories) {\n // call categories render method\n memory.categories[category].render();\n //console.log(memory);\n }\n }", "function createGameCategories(){\n\tGameCategories = new Set();\n\tGames.map(game => game.categories).flat().forEach(function(subcategory){\n\t\tGameCategories.add(subcategory);\n\t});\n\tGameCategories = Array.from(GameCategories); //turn the set into an array\n}", "function getCategoryFilterItems(){\n var tempFilterArray = [];\n for(i=0; i<blog.rawData.length; i++){\n tempFilterArray.push(blog.rawData[i].category);\n }\n // console.log(tempFilterArray);\n return tempFilterArray;\n }", "static async getAllCategoriesAndQuestions() {\n categories = [];\n let categoryIds = await Category.getCategoryIds();\n for ( let categoryId of categoryIds ) {\n let fullCategory = await Category.getCategory(categoryId);\n categories.push(fullCategory);\n }\n return categories;\n }", "function CategoryMultiLevel(category, count) {\n if (category.idParentCategory == null || category.idParentCategory == \"\") {\n $scope.categoryDocuments.push(category);\n } else {\n if ($scope.categoryDocuments.indexOf(category) == -1) {\n count++;\n for (i = 1; i <= count; i++) {\n category.title = \"– \" + category.title;\n }\n $scope.categoryDocuments.push(category);\n angular.forEach($scope.tempCategoryDocuments, function (value, index) {\n if (value.idParentCategory == category.id) {\n CategoryMultiLevel(value, count);\n }\n });\n }\n }\n }", "async function getcategaries() {\n const response = await fetch(\"http://localhost:8000/api/categaries\");\n const body = await response.json();\n console.log(\"response from api : \", body);\n setCategories(\n body.plantCategories.map(({ category, id }) => ({\n label: category,\n value: id,\n }))\n );\n }", "function getCategory(c){\n return getCategoryObject(c.definition); \n}", "function fetchCategoriesForSelect() {\n fetchOperations.fetchCategories().then(forEachCategory);\n }", "function initCategories(axList) {\n for(var i = 0; i < axList.length; i++) {\n axList[i]._categories = axList[i]._initialCategories.slice();\n\n // Build the lookup map for initialized categories\n axList[i]._categoriesMap = {};\n for(var j = 0; j < axList[i]._categories.length; j++) {\n axList[i]._categoriesMap[axList[i]._categories[j]] = j;\n }\n }\n}", "function initCategories(axList) {\n for(var i = 0; i < axList.length; i++) {\n axList[i]._categories = axList[i]._initialCategories.slice();\n\n // Build the lookup map for initialized categories\n axList[i]._categoriesMap = {};\n for(var j = 0; j < axList[i]._categories.length; j++) {\n axList[i]._categoriesMap[axList[i]._categories[j]] = j;\n }\n }\n}", "async function getCategory(catId) {\n let categoryObjResponse= await axios.get(`http://jservice.io/api/category`, {params: {id: catId}})\n categoryObj = {\n title: categoryObjResponse.data.title,\n clues: categoryObjResponse.data.clues,\n showing: null\n };\n return categoryObj;\n}", "get categories() {\n return this.data.categories ? getCategories(this.data.categories) : [];\n }", "function GetCategory(categoryId) {\n const [category, setCategory] = useState('');\n const url = \"/api/categories/\"+categoryId;\n useEffect(() => {\n const requestCategory = async () => {\n const response = await fetch(url);\n const { data } = await response.json();\n const att = await data.attributes;\n const cat = await att.category;\n setCategory(cat);\n };\n requestCategory();\n }, []);\n\n return category;\n}", "function fetchCategories(){\n return fetch(catURL)\n .then(resp => resp.json())\n .then(categories=>{\n categoryData = categories\n displayCategories(categories)\n })\n}", "async function getCategoryIds() {\n let listOfCategories= await axios.get(`http://jservice.io/api/categories`, {params: {count: 100}})\n for(let category of listOfCategories.data){\n categories.push(category.id);\n }\n arrayShuffle(categories);\n categories.splice(6);\n return categories;\n}", "function getDocCategories() {\n if (utils.isEmptyObj(masterData.getMasterData())) {\n var request = masterData.fetchMasterData();\n $q.all([request]).then(function (values) {\n self.documentCategories = values[0].documents_cat;\n self.docModel.category = values[0].documents_cat[0];\n })\n } else {\n self.documentCategories = masterData.getMasterData().documents_cat;\n self.docModel.category = masterData.getMasterData().documents_cat[0];\n }\n }", "getCategories3() {\n this.config.getWithUrl(this.config.url + '/wp-json/wp/v2/categories/19').then((data) => {\n if (this.page2 == 1) {\n this.categories = [];\n }\n this.categories = data;\n // console.log(data.data.length);\n if (data.length == 0) { // if we get less than 10 products then infinite scroll will de disabled\n //this.shared.toast(\"All Categories Loaded!\");\n this.getRandomImage();\n }\n else\n this.getCategories3();\n }, function (response) {\n // console.log(\"Error while loading categories from the server\");\n // console.log(response);\n });\n }", "@computed get getAllCategories() {\n return this.categoryIds.map((categoryId) => this.categoryData.byId[categoryId]);\n }", "makeEmptyCategory() {\n return {\n parent_id: 1,\n is_visible: false,\n name: '',\n description: '',\n picture_filename: '',\n ordering: 0,\n };\n }", "getPChartData(){\n const categoryData = [];\n this.state.categories.map((category) => {\n categoryData.push(category.category);\n return categoryData;\n })\n\n const expenseData = {\n 'Rent': 0,\n 'Mortgage': 0,\n 'Loans': 0,\n 'Utilities': 0,\n 'Restaurants': 0,\n 'Groceries': 0,\n 'Entertainment': 0,\n 'Travel': 0,\n 'Vacation': 0,\n 'Miscellaneous': 0\n };\n\n // const expenseData = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0]\n\n //changed date to to months with its year so we can separate the information between years.\n this.state.expenses.map((expense) => {\n const currDate = this.state.currentYear + this.state.currentMonth;\n const dbDate = expense.expense_date.slice(0,7).split('-');\n\n //combinedDB adds month and year together creating total month and year. and if total month and year is the same as expense year and date then we push.\n const combineDb = dbDate[0] + dbDate[1] + '';\n\n if (currDate === combineDb && expense.category_id === 1) {\n expenseData.Rent += expense.amount\n }\n if (currDate === combineDb && expense.category_id === 2) {\n expenseData.Mortgage += expense.amount\n }\n if (currDate === combineDb && expense.category_id === 3) {\n expenseData.Loans += expense.amount\n }\n if (currDate === combineDb && expense.category_id === 4) {\n expenseData.Utilities += expense.amount\n }\n if (currDate === combineDb && expense.category_id === 5) {\n expenseData.Restaurants += expense.amount\n }\n if (currDate === combineDb && expense.category_id === 6) {\n expenseData.Groceries += expense.amount\n }\n if (currDate === combineDb && expense.category_id === 7) {\n expenseData.Entertainment += expense.amount\n }\n if (currDate === combineDb && expense.category_id === 8) {\n expenseData.Travel += expense.amount\n }\n if (currDate === combineDb && expense.category_id === 9) {\n expenseData.Vacation += expense.amount\n }\n if (currDate === combineDb && expense.category_id === 10) {\n expenseData.Miscellaneous += expense.amount\n }\n return expenseData;\n })\n\n this.setState({\n pieChartData:{\n labels: categoryData,\n datasets:[\n {\n label:'Category',\n data: [\n expenseData.Rent,\n expenseData.Mortgage,\n expenseData.Loans,\n expenseData.Utilities,\n expenseData.Restaurants,\n expenseData.Grociers,\n expenseData.Entertainment,\n expenseData.Travel,\n expenseData.Vacation,\n expenseData.Miscellaneous\n ],\n backgroundColor:[\n 'rgba(255, 99, 132, 0.6)',\n 'rgba(54, 162, 235, 0.6)',\n 'rgba(255, 206, 86, 0.6)',\n 'rgba(75, 192, 192, 0.6)',\n 'rgba(153, 102, 255, 0.6)',\n 'rgba(255, 159, 64, 0.6)',\n 'green',\n 'blue',\n 'orange',\n 'grey',\n ]\n }\n ]\n }\n });\n }", "function formatData(data, searchTerm) {\n const keywords = countNouns(data, dictionary, searchTerm);\n const nodes = [];\n const links = [];\n \n let categoryId = data.length + 2;\n\n data.forEach((datum, idx) => {\n let category = categorize(datum, keywords)//return the category name \n //find if the category already exists\n let categoryExists\n nodes.forEach(item => {\n if (category && item && item.name === category.name) {\n categoryExists = item \n }});\n\n //decide if a new categry needs to be made \n if(categoryExists){\n // debugger\n links.push({\n source: categoryExists.id,\n target: idx + 2,\n })\n\n } else if (category){\n category.id = categoryId && categoryId++\n\n nodes.push(category)\n\n links.push({\n source: 1,\n target: category.id\n } , {\n source: category.id,\n target: idx + 2,\n })\n } else {\n links.push({\n source: 1,\n target:idx + 2\n })\n }\n\n \n nodes.push({\n id: idx + 2,\n type: 'information',\n name: datum.title,\n link: datum.link,\n snippet: datum.snippet\n })\n \n \n \n \n });\n// links between central node and categories\n\n// links between categories and children\n\n//nodes for the categories\n\n\n nodes.unshift({\n id: 1,\n name: searchTerm,\n type: 'root',\n\n // link: '',\n })\n\n // const links = data.map((datum, idx) => {\n // return {\n \n // }\n // });\n\n return {\n nodes,\n links,\n }\n}", "async _fetchOrCreateCategory() {\n const categoryUuid = CategoryImportJobParams.getCategoryUuid(this.params)\n if (categoryUuid) {\n return CategoryManager.fetchCategoryAndLevelsByUuid(\n {\n surveyId: this.surveyId,\n categoryUuid,\n draft: true,\n includeValidation: false,\n },\n this.tx\n )\n }\n\n const category = Category.newCategory({\n [Category.keysProps.name]: CategoryImportJobParams.getCategoryName(this.params),\n })\n return CategoryManager.insertCategory({ user: this.user, surveyId: this.surveyId, category, system: true }, this.tx)\n }", "getAllCategories() {\n axios\n .get('/api/categories')\n .then(res =>\n this.setState({\n categoriesList: res.data,\n }))\n .then(() => {\n this.getCategoryInfo(this.state.categoriesList[1]._id);\n })\n .then(() => {})\n .catch(err => console.log(err));\n }", "function prepareCategories() {\n var categories = {},\n page,\n pagesData;\n\n // iterator to build categories\n for (page in pages) {\n pagesData = pages[page].data;\n\n if (pages.hasOwnProperty(page) && pagesData.title !== undefined) {\n // check if already defined with category or not\n if(categories[pagesData.category] === undefined){\n categories[pagesData.category] = { list: [] };\n }\n\n // build pages list for each category\n listItemsforCategory(categories[pagesData.category], pagesData);\n }\n }\n\n // return the categories\n return categories;\n }", "extractCategoriesFromItems(allItems) {\n let categories = [];\n let unique = {};\n\n for (let prop in allItems) {\n // Check the \"category\" first.\n if (typeof(unique[allItems[prop].category]) == \"undefined\" && \n allItems[prop].category) {\n categories.push(allItems[prop].category);\n }\n unique[allItems[prop].category] = 0;\n } \n // 'All' category is always present as the first.\n categories.unshift(PlaceList.all);\n return categories;\n }", "async readCategories() {\n let response = await fetch(url + 'get/categories');\n let data = await response.json();\n return data\n }", "function loadCategory() {\n $.ajax({\n url: 'allCategory',\n type: 'GET',\n success: function(data) {\n $('#dataTableExample1').html(data);\n }\n });\n }", "function getCategory(){\n var deferred = $q.defer();\n\n $http({\n url: API_ENDPOINT + APIPATH.category,\n method: 'GET'\n })\n .then(function (data) {\n deferred.resolve(data);\n },function(data){\n deferred.resolve(data);\n $mdToast.show(\n $mdToast.simple()\n .textContent('Sorry! Unable to show categories')\n .position('top')\n .hideDelay(5000)\n );\n })\n\n return deferred.promise;\n }", "async getCategories (offset) {\n const response = await fetch(`http://jservice.io/api/categories?count=100&offset=${offset}`)\n const json = response.json()\n return json\n }", "function categoryArray(data, value, array) {\r\n for (var i = 0, iLen=data.length; i<iLen; i++) {\r\n if(data[i].category === value) {\r\n array.push(data[i]);\r\n }\r\n }\r\n }", "function nCategory(t){this.category=new category(t),this.built=!1,this.build=null}", "updateCategory(state, data) {\n const ind = findIndex(state.categories, (r) => {\n return r.id === data.id\n })\n\n const category = state.categories[ind]\n\n for (const prop in data) {\n category[prop] = data[prop]\n }\n }", "function getCategory()\n{\n\tvar category = new Array([111,'server'], [222,'switcher'], [333,'storage'], [444,'workstation']);\n\treturn category;\n}", "function getCategory(count) {\n\t \tlet category = links[count].category;\n\n\t\t\taxios.get(links[count].link)\n\t\t\t.then(function(response) {\n\n\t\t\t\tvar $ = cheerio.load(response.data);\n\n\t\t\t\tgetClasses($, count).then(function(response){\n\n\t\t\t\t\tlet classes = response;\n\n\t\t\t\t\tfor (var i = 0; i < classes.length; i++) {\n\t\t\t\t\t\tclasses[i].category = category;\n\t\t\t\t\t};\n\n\t\t\t\t\t// console.log(classes);\n\n\t\t\t\t\tdb.Class.create(classes)\n\t\t\t \t.then(function(dbArticle) {\n\t\t\t \t// View the added result in the console\n\t\t\t \tconsole.log(dbArticle);\n\t\t\t \t})\n\t\t\t \t.catch(function(err) {\n\t\t\t \t\tconsole.log(\"------------------------------------------------------------------------------\");\n\t\t\t \t\tconsole.log(err);\n\t\t\t \t});\n\t\t\t\t\n\t\t\t\t\t//if there are items left, do it again, otherwise send the data\n\t\t\t\t\t\n\t\t\t\t});\n\n\t\t\t\tcount++;\n\t\t\t\tif (count < links.length) {\n\t\t\t\t\tgetCategory(count);\n\t\t\t\t} else {\n\t\t\t\t\tres.json(links);\n\t\t\t\t}\n\n\n\t \t})\n\t \t.catch(function(err) {\n\t \t\tconsole.log(err);\n\t \t\tres.json(err);\n\t \t})\n\t }", "getCategories() {\n return this.$node.attr('data-category').split(/\\s*,\\s*/g);\n }", "get Categories() {\n const { categories, handleCategoryClick } = this.props;\n return categories.map((category, index) => (\n <TouchableOpacity\n style={styles.InnerWrapper}\n key={`category-item-${index}`}\n onPress={() => handleCategoryClick(category)}\n >\n <View style={styles.innerCard}>\n <Image\n source={category.photo}\n resizeMode=\"contain\"\n source={{ uri: `${BASE_API_URL}${category.icon}` }}\n style={styles.image}\n />\n <Text style={styles.listingType}>{category.name}</Text>\n </View>\n </TouchableOpacity>\n ));\n }", "[consts.CATEGORY_ADD](state, catObj) {\n let insCategoryObj = {\n id: catObj[\"id\"],\n pid: catObj[\"pid\"],\n dt: catObj[\"dt\"],\n idleaf: catObj[\"idleaf\"],\n kwrds: catObj[\"keyWords\"][\"keyWords\"],\n kwrdson: catObj[\"keyWords\"][\"keyWordsSelfOn\"],\n orderby: catObj[\"order\"][\"orderby\"],\n auto_numerate: catObj[\"order\"][\"autoNumerate\"],\n user_fields_on: catObj[\"userFields\"][\"userFieldsOn\"],\n uflds: catObj[\"uflds\"],\n num: parseInt(catObj[\"num\"]),\n chkd: false\n };\n for (let itm in catObj[\"names\"])\n insCategoryObj[\"name_\" + itm] = catObj[\"names\"][itm].name;\n\n //Categories add 1\n state.itemsCount++;\n\n //Set leaf id if it is root category\n if (catObj[\"pid\"] == -1) state.idLeaf = catObj[\"idleaf\"];\n\n Vue.set(state.list, state.list.length, insCategoryObj);\n }", "retrieveCategories() {\n return call(`${this.__url__}/categories`, {\n headers: {\n 'Content-Type': 'application/json'\n },\n timeout: this.__timeout__\n })\n }", "getCategories() {\n return ['Snacks', 'MainDishes', 'Desserts', 'SideDishes', 'Smoothies', 'Pickles', 'Dhal', 'General']\n }", "async getAllCategories() {\n const data = await this.get('jokes/categories');\n return data;\n }", "mapUserCategories(category) {\n let rating;\n switch (category.score) {\n case PRODUCTIVITY_SCORES.unrated:\n rating = 'Unrated';\n break;\n case PRODUCTIVITY_SCORES.unproductive:\n rating = 'Unproductive';\n break;\n case PRODUCTIVITY_SCORES.neutral:\n rating = 'Neutral';\n break;\n default:\n rating = 'Productive';\n }\n\n return {\n name: category.name,\n rating,\n total: humanizeDuration(category.total),\n entity: category.entity === 2 ? 'app' : 'web',\n };\n }", "componentDidMount() {\n axios.get(\"http://localhost:5000/prodCategories\").then((response) => {\n if (response.data.length > 0) {\n this.setState({\n categories: response.data.map((catg) => catg.category),\n category: response.data[0].category\n });\n }\n });\n }", "function createCategoryMap(postCategories) {\n var categoriesMap = {};\n postCategories.map((c) => (categoriesMap[c.id] = c));\n return categoriesMap;\n}", "async function getCategoryIds() {\n let response = await axios.get(`https://jservice.io/api/categories`, {\n params: {\n count: 100\n }\n });\n let catIds = response.data.map((result) => result.id);\n return _.sampleSize(catIds, Cat_count);\n}", "static async getCategoryIds() {\n let response = await axios.get(`${BASE_URL}/categories`, {\n params: {\n count: \"100\",\n offset: Math.floor(Math.random() * (500 - 1) + 1) // RNG to vary offset between each request\n }\n });\n\n // Lodash selects 6 random categories\n let randomCategories = _.sampleSize(response.data, CATEGORY_COUNT)\n\n // make new array with only the category IDs\n let categoryIds = randomCategories.map((catObj) => {\n return catObj.id;\n });\n\n return categoryIds;\n }", "function processData() {\n\tif (this.status == 200) { // 200 stands for we received a file\n\t\tcurrJSON = JSON.parse(this.responseText);\n\t\t// add vector for all category names (before filtering)\n \n var category_list = d3.set();\n for (var i=0; i<currJSON.length; i++) {\n\t\t\t category_list.add(currJSON[i].category);\n\t\t}\n \n \tif(dimension == \"class\"){\n\t\t\tcategory_domain = ['other','Non-Matriculated', 'Grad', '5th year', 'Senior', 'Junior', 'Sophomore', 'Freshman'];\n\t\t\tconsole.log(category_domain);\n \t\tcolor.domain(category_domain);\n \t}\n\t\telse if (dimension == \"spcl_prog_text\"){\n\t\t\tcategory_domain = [\"None\", \"ADM SAI\", \"ATHLETICS\", \"ATHLETICS-EOP\", \"EOP\", \"EOP Special Programs\", \"INTL/RES.TUIT.ELIG\", \"RESTRICTED ELIGIBLTY\", \"SP ATHLETICS\", \"STAFF/FAC EXEMPT\", \"UNDERGRAD EXCHANGE\", \"UNIV EXT\", \"WA ST CLASS EMPT\", \"WWAMI\"];\n\t\t\tcolor.domain(category_domain);\n\t\t}\n else if (dimension==\"subject\"){\n \t// hacky sort to intelligently group categories together\n \t// category_domain = category_list.values().sort();\n \tvar languages = [];\n \tvar stem = [];\n \tvar other = [];\n \tfor (var i = 0; i < category_list.values().length; i++) {\n \t\tvar category = category_list.values()[i];\n \t\n \t\n\n \t\t//Languages\n\n \t\tif ( category == \"Arabic\" \n \t\t\t|| category == \"Chinese\" \n \t\t\t|| category == \"French\"\n \t\t\t|| category == \"Japanese\"\n \t\t\t|| category == \"Korean\"\n \t\t\t|| category == \"Spanish\"\n \t\t\t|| category == \"Swedish\") {\n \t\t\t\n \t\t\tlanguages.push(category);\n \t\t}\n\n \t\t//STEM\n \t\telse if(category == \"Bio\" \n \t\t\t|| category == \"CSE\" \n \t\t\t|| category == \"Chem\"\n \t\t\t|| category == \"Math\"\n \t\t\t|| category == \"Physics\"\n \t\t\t|| category == \"Stats\") {\n \t\t\tstem.push(category);\n \t\t}\n\n \t\t//other\n \t\telse {\n \t\t\tother.push(category);\n \t\t\t//alert(other);\n \t\t}\n \t};\n \t// category_domain = [];\n \t// category_domain = category_domain.concat(languages.sort());\n \t// category_domain = category_domain.concat(stem.sort());\n \t// category_domain = category_domain.concat(other.sort());\n \t// console.log(category_domain);\n\t\t\tcategory_domain = [\"Arabic\", \"French\", \"Spanish\",\n\t\t\t\t\t\t \t \"Chinese\", \"Korean\", \"Japanese\", \n\t\t\t\t\t\t \t \"Bio\", \"Chem\", \"Physics\", \n\t\t\t\t\t\t \t \"CSE\", \"Math\", \"Stats\", \"ECON\"].reverse();\n \t// manually control the colors\n \tcolor = d3.scale.ordinal()\n\t\t\t\t\t\t .domain([\"Arabic\", \"French\", \"Spanish\",\n\t\t\t\t\t\t \t \"Chinese\", \"Korean\", \"Japanese\",\n\t\t\t\t\t\t \t \"Bio\", \"Chem\", \"Physics\", \n\t\t\t\t\t\t \t \"CSE\", \"Math\", \"Stats\", \"ECON\"])\n\t\t\t\t\t\t .range(['#3182bd', '#6baed6', '#9ecae1', \n\t\t\t\t\t\t \t '#756bb1', '#9e9ac8', '#bcbddc',\n\t\t\t\t\t\t \t '#31a354', '#74c476', '#a1d99b', \n\t\t\t\t\t\t \t '#e6550d', '#fd8d3c', '#fdae6b','#fdd0a2']);\n \t\n }\n else {\n \t // handle the numerical category\n\t // if(dimension == 'class'){\n\t\t\t\t// category_domain = category_list.values().sort(\n\t\t\t\t// \tfunction(a, b) {\n\t\t\t\t// \t return b - a;\n\t\t\t\t// \t});\n\t // }else{\n\t \tcategory_domain = category_list.values().sort();\n\t // }\n \tcolor.domain(category_domain);\n }\n \n \n\t}\n\t// handle redrawing of existing bar chart\n\tif (document.getElementById(\"barplot_svg\")) {\n\t\t//TODO is this actually doing anything? - kd\n\t\tbarplot.init();\n\t\tlineplot.init(7);\n\t}\n}", "function getFormattedData(data) {\n let result = {\n children: []\n }\n\n for (let category in data) {\n\n let temp = {\"Name\": category, \"Count\": data[category]};\n result.children.push(temp);\n }\n\n result.children = result.children.filter(function (e) {\n return valid_categories.indexOf(e.Name) > -1;\n });\n\n return result;\n}", "ngOnInit() {\n this.allCategories = [];\n this.DBCategories = [];\n this.categoryService.getAllCategories().subscribe(c => {\n this.DBCategories = c;\n this.setCategories(c);\n });\n }", "function addCategory(category) {\n categories[category] = []\n originals[category] = []\n}", "async getCategories () {\n this.setState({categories: await CategoryService.getAll()})\n }", "async getCategoryIds() {\n try {\n if (this.totalCategories.length === 0) {\n const promises = []\n for (let x = 0; x < 5; x++) {\n promises.push(axios.get(`https://jservice.io/api/categories?count=100&offset=${x}00`));\n }\n const fulfilled = await Promise.all(promises);\n for (let response of fulfilled) {\n for (let item of response.data) {\n this.totalCategories.push(item);\n }\n }\n \n }\n\n for (let x = 0; x < this.width; x++) {\n const ranId = Math.floor(Math.random() * (this.totalCategories.length - 1))\n if (this.idList.indexOf(this.totalCategories[ranId].id) === -1){\n this.idList.push(this.totalCategories[ranId].id);\n }\n }\n } catch (e) {\n alert('Failed to get IDs!')\n } \n }", "getCategoryData(categoryType) {\n let clause = '';\n clause = this.valuesObj.channelValue;\n clause += '_' + this.valuesObj.caseType;\n clause += '_' + this.valuesObj.businessArea;\n if (this.valuesObj.caseStage) {\n clause += '_' + this.valuesObj.caseStage\n }\n if (categoryType === 'Primary') {\n clause += '_' + 'Primary';\n } else if (categoryType === 'Secondary') {\n clause += '_' + 'Secondary' + '_' + this.valuesObj.primaryCategoryValue;\n } else if (categoryType === 'Tertiary') {\n clause += '_' + 'Tertiary' + '_' + this.valuesObj.primaryCategoryValue + '_' + this.valuesObj.secondaryCategoryValue;\n }\n fetchCategoryData({\n queryFilter: clause\n }).then(result => {\n // This part is covered to fetch and display the Picklist values for Service type\n if (categoryType === 'Primary') {\n this.primaryCategoryOptions = [];\n if (result && result.length > 0) {\n this.primcategoryData = result;\n this.emptyCategory();\n this.primaryCategoryOptions.push({\n label: '-- None --',\n value: ''\n });\n this.isSecondaryCategoryDisabled = true;\n for (let i = 0; i < result.length; i++) {\n if (result[i].Type__c === 'Primary') {\n this.isPrimaryCategoryDisabled = false;\n this.primaryCategoryOptions.push({\n label: result[i].Name,\n value: result[i].Id\n });\n }\n if (this.sourceCmp === 'EW Calculator' && result[i].Name === 'EW') {\n this.valuesObj.primaryCategoryValue = result[i].Id;\n this.valuesObj.primaryCategoryName = result[i].Name;\n } else if (this.sourceCmp === 'MCP Calculator' && result[i].Name === 'MCP') {\n this.valuesObj.primaryCategoryValue = result[i].Id;\n this.valuesObj.primaryCategoryName = result[i].Name;\n }\n }\n\n this.isSpinnerShow = false;\n } else {\n this.isSpinnerShow = false;\n }\n } else if (categoryType === 'Secondary') {\n this.secondaryCategoryOptions = [];\n if (result && result.length > 0) {\n this.valuesObj.secondaryCategoryValue = '';\n this.valuesObj.secondaryCategoryName = '';\n this.seconcategoryData = result;\n this.secondaryCategoryOptions.push({\n label: '-- None --',\n value: ''\n });\n for (let i = 0; i < result.length; i++) {\n if (result[i].Type__c === 'Secondary') {\n this.isSecondaryCategoryDisabled = false;\n this.secondaryCategoryOptions.push({\n label: result[i].Name,\n value: result[i].Id\n });\n }\n }\n } else {\n this.isSecondaryCategoryDisabled = true;\n this.isTertiaryCategoryDisabled = true;\n this.valuesObj.secondaryCategoryValue = '';\n this.valuesObj.secondaryCategoryName = '';\n this.valuesObj.tertiaryCategoryValue = '';\n this.valuesObj.tertiaryCategoryName = '';\n }\n } else if (categoryType === 'Tertiary') {\n this.tertiaryCategoryOptions = [];\n if (result && result.length > 0) {\n this.valuesObj.tertiaryCategoryValue = '';\n this.valuesObj.tertiaryCategoryName = '';\n this.tertiarycategoryData = result;\n this.tertiaryCategoryOptions.push({\n label: '-- None --',\n value: ''\n });\n for (let i = 0; i < result.length; i++) {\n if (result[i].Type__c === 'Tertiary') {\n this.isTertiaryCategoryDisabled = false;\n this.tertiaryCategoryOptions.push({\n label: result[i].Name,\n value: result[i].Id\n });\n }\n }\n } else {\n this.isTertiaryCategoryDisabled = true;\n this.valuesObj.tertiaryCategoryValue = '';\n this.valuesObj.tertiaryCategoryName = '';\n }\n }\n this.isSpinnerShow = false;\n }).catch(error => {\n this.error = error;\n this.isSpinnerShow = false;\n });\n }", "constructor() {\n /**\n * Array of subcategories. Can be empty.\n * @member {Array.<module:models/Category>} categories\n */\n this.categories = undefined\n\n /**\n * The localized description of the category.\n * @member {String} description\n */\n this.description = undefined\n\n /**\n * The id of the category.\n * @member {String} id\n */\n this.id = undefined\n\n /**\n * The URL to the category image.\n * @member {String} image\n */\n this.image = undefined\n\n /**\n * The localized name of the category.\n * @member {String} name\n */\n this.name = undefined\n\n /**\n * The localized page description of the category.\n * @member {String} page_description\n */\n this.page_description = undefined\n\n /**\n * The localized page keywords of the category.\n * @member {String} page_keywords\n */\n this.page_keywords = undefined\n\n /**\n * The localized page title of the category.\n * @member {String} page_title\n */\n this.page_title = undefined\n\n /**\n * The id of the parent category.\n * @member {String} parent_category_id\n */\n this.parent_category_id = undefined\n\n /**\n * The URL to the category thumbnail.\n * @member {String} thumbnail\n */\n this.thumbnail = undefined\n }", "findCanonicalsAndCategories(viralTweets) {\n let headCanonicals = ['-- TOTS --', '-- AMB CANÒNIC --', '-- GENÈRICS --']\n let headCategories = ['-- TOTS --', '-- AMB CATEGORIA --', '-- GENÈRICS --']\n let foundCanonicals = []\n let foundCategories = []\n viralTweets.forEach((tweet) => {\n if (!isInArray(foundCategories, tweet.category)) {\n if (tweet.category !== 'genèric') {\n foundCategories.push(tweet.category)\n }\n }\n if (tweet.canonical_name !== 'genèric') {\n let canonical_entry = tweet.canonical_name + ' (' + tweet.category + ')'\n if (!isInArray(foundCanonicals, canonical_entry)) {\n foundCanonicals.push(canonical_entry)\n }\n }\n })\n\n foundCanonicals.sort()\n foundCategories.sort()\n this.setState({\n canonicalNamesFound: headCanonicals.concat(foundCanonicals),\n dictionaryCategoriesFound: headCategories.concat(foundCategories)\n })\n }", "emptyCategory() {\n this.valuesObj.primaryCategoryValue = '';\n this.valuesObj.primaryCategoryName = '';\n this.valuesObj.secondaryCategoryValue = '';\n this.valuesObj.secondaryCategoryName = '';\n this.valuesObj.tertiaryCategoryValue = '';\n this.valuesObj.tertiaryCategoryName = '';\n this.secondaryCategoryOptions = [];\n this.primaryCategoryOptions = [];\n this.tertiaryCategoryOptions = [];\n this.isSecondaryCategoryDisabled = true;\n this.isPrimaryCategoryDisabled = true;\n this.isTertiaryCategoryDisabled = true;\n this.isSpinnerShow = false;\n }", "function categoryTable() { }", "componentDidMount() {\n /** if the categoryData is already set then we don't need to fetch.*/ \n if(this.props.categoryData.length === 0) {\n fetch('http://jservice.io/api/categories?count=20')\n .then(response => response.json())\n .then(json => {\n this.props.setCategories(json);\n this.fetchData();\n });\n } \n }", "static category(req, dynamoDb, callback) {\n const params = {\n TableName: process.env.POSTS_TABLE,\n FilterExpression: 'category = :val',\n ExpressionAttributeValues: {\n ':val': req.query.category\n }\n };\n dynamoDb.scan(params, function (err, data) {\n if (err) {\n console.error(err);\n callback('render', 'error', {error: err});\n } else {\n let posts = data.Items.filter(p => !p.staging);\n posts.map(p => {\n p.content = markdown.render(p.content);\n p.title = markdown.renderInline(p.title);\n });\n posts.sort((a, b) => {\n return new Date(b.published_on) - new Date(a.published_on);\n });\n let left = posts.slice(0, data.Count / 2);\n let center = posts.slice(data.Count / 2);\n callback('render', 'posts/subindex', {heading: req.query.category,\n left: left, center: center});\n }\n });\n }", "function addProductCategory(){\r\n\t var categoryId = 0;\r\n\t var categoryName,categoryOptions ;\r\n\r\n\t productCategoriesArray.push(new ProductCategory(categoryId,categoryName,categoryOptions));\r\n iterateProductCategoriesArray();\r\n }", "loadFacetInfo() {\n const helper = algoliasearchHelper(client, indexName, {\n facets: [\"food_type\"]\n });\n\n helper.on(\"result\", content => {\n this.setState({\n categories: content.getFacetValues(\"food_type\", {\n sortBy: [\"count:desc\"]\n })\n });\n });\n helper.setQueryParameter(\"hitsPerPage\", 5000).search();\n }", "async function fetchData() {\n const result = await fetch('/pets/categories');\n setPetCategories(result);\n setIsLoaded(true);\n }", "function fetchAllCategorisedColumnSet() {\n\tlet categorisedColumnsSet = new Set();\n\tvar json = fetchParsedJson();\n\tfor(var i = 0 ; i < json.length; i++){\n\t\tfor (var key in json[i]) {\n\t\t\tvar columnName = key;\n\t\t\tvar columnValue = json[i][key];\n\t\t\tif((columnName != null && columnName != '') && isNaN(columnValue)){\n\t\t\t\tcategorisedColumnsSet.add(columnName);\n\t\t\t} else if(categorisedColumnsSet.size == json[i].length){\n\t\t\t\treturn categorisedColumnsSet;\n\t\t\t}\n\t\t}\t\n\t}\t\t\n\treturn categorisedColumnsSet;\n}", "setCategories(cat) {\n for (let c of cat) {\n this.allCategories.push({\n id: c.id,\n title: c.title,\n toggle: false\n });\n }\n }", "async categoryselected(pos, value) { \n var acceestoken=await commons.get_token();\n var s3config = require(\"./config/AWSConfig.json\"); \n this.setState({ loading: true });\n this.refs.loaderRef.show();\n if (value == Strings.discover_category_home) {\n this.mixpanelTrack(\"Store Home Page\");\n var cats = this.state.categories;\n var catsLanguage=this.state.categoriesLanguage;\n var cur_staxdata = [];\n var count=0;\n for (var i = 0; i < cats.length; i++) { \n if (cats[i] == Strings.discover_category_favorite||cats[i]==Strings.discover_category_home||cats[i]==Strings.discover_category_new)\n continue;\n var aws_data = require(\"./config/AWSConfig.json\");\n var aws_lamda = require(\"./config/AWSLamdaConfig.json\");\n var urlName=\"\";\n if (this.state.username == null || this.state.username == commons.guestuserkey()) { \n urlName=aws_lamda.commenapis;\n }\n else\n {\n urlName=aws_lamda.contentmanagement;\n } \n await fetch('' + aws_data.path + aws_data.stage + urlName, {\n method: 'POST',\n headers: {\n Accept: 'application/json',\n 'Content-Type': 'application/json',\n 'Authorization':acceestoken\n },\n body: JSON.stringify({\n \"operation\":\"getContentList\",// \"getSingleCategoryList\",\n \"category\": catsLanguage[i],\n \"widgetname\": \"\"+this.state.searchquery,\n \"userid\": this.state.username,\n \"LastEvaluatedKey\": {}\n }),\n }).then((response) => response.json())\n .then(async (responseJson) => { \n var catstax_obj = {}; \n catstax_obj[\"category\"] = cats[i];\n catstax_obj[\"key\"] = count;\n catstax_obj[\"staxdata\"] = responseJson.data;\n for (var j = 0; j < catstax_obj[\"staxdata\"].length; j++) {\n catstax_obj[\"staxdata\"][j].staxpreview = s3config.s3path + \"/\" + s3config.s3bucketname + \"/\" + s3config.s3storefolder + \"/Thumbnail_\" + catstax_obj[\"staxdata\"][j].staxid + \".jpg\" + \"?time=\" + catstax_obj[\"staxdata\"][j].createtime;\n }\n if(catstax_obj[\"staxdata\"].length>0)\n cur_staxdata.push(catstax_obj);\n var last_val_map = this.state.last_key_val_mapping;\n if (responseJson.hasOwnProperty(\"LastEvaluatedKey\"))\n last_val_map[cats[i]] = responseJson.LastEvaluatedKey;\n this.setState({\n catgorychoosen: Strings.discover_category_home,\n staxdata: cur_staxdata,\n staxdata_categorized: [],\n last_key_val_mapping: last_val_map,\n loading: false\n });\n count++;\n this.refs.loaderRef.hide();\n })\n .catch((error) => {\n console.error(error);\n });\n }\n }\n else {\n var aws_data = require(\"./config/AWSConfig.json\");\n var aws_lamda = require(\"./config/AWSLamdaConfig.json\");\n var operation =\"getContentList\"// \"getSingleCategoryList\"\n this.mixpanelTrack(value);\n if (value == Strings.discover_category_new)\n {\n var urlName=\"\";\n if (this.state.username == null || this.state.username == commons.guestuserkey()) { \n urlName=aws_lamda.commenapis;\n }\n else\n {\n urlName=aws_lamda.contentmanagement;\n } \n await fetch('' + aws_data.path + aws_data.stage +urlName, {\n method: 'POST',\n headers: {\n Accept: 'application/json',\n 'Content-Type': 'application/json',\n 'Authorization':acceestoken\n },\n body: JSON.stringify({\n \"operation\": \"getLatestStax\"\n }),\n }).then((response) => response.json())\n .then(async (responseJson) => {\n var resp = [];\n resp = responseJson;\n for (var j = 0; j < resp.length; j++) {\n resp[j].key=responseJson[j].contentid;\n resp[j].staxpreview = s3config.s3path + \"/\" + s3config.s3bucketname + \"/\" + s3config.s3storefolder + \"/Thumbnail_\" + responseJson[j].contentid + \".jpg\" + \"?time=\" + resp[j].createtime;\n }\n this.setState({\n loading: false,\n staxdata_categorized: resp,\n catgorychoosen: value\n });\n this.refs.loaderRef.hide();\n })\n .catch((error) => {\n console.error(error);\n }); \n }\n else{\n if (value == Strings.discover_category_favorite)\n {\n operation = \"getfavouriteContentList\";\n }\n var cats=this.state.categories;\n var catsLanguage=this.state.categoriesLanguage;\n var valueDisplay=\"\"\n for(var i=0;i<catsLanguage.length;i++)\n {\n if (value ==cats[i])\n {\n valueDisplay=value;\n value=catsLanguage[i];\n break;\n }\n }\n var urlName=\"\";\n if (this.state.username == null || this.state.username == commons.guestuserkey()) { \n urlName=aws_lamda.commenapis;\n }\n else\n {\n urlName=aws_lamda.contentmanagement;\n } \n await fetch('' + aws_data.path + aws_data.stage + urlName, {\n method: 'POST',\n headers: {\n Accept: 'application/json',\n 'Content-Type': 'application/json',\n 'Authorization':acceestoken\n },\n body: JSON.stringify({\n \"operation\": operation,\n \"category\": value,\n \"widgetname\": \"\"+this.state.searchquery,\n \"userid\": this.state.username,\n \"LastEvaluatedKey\": {}\n }),\n }).then((response) => response.json())\n .then(async (responseJson) => {\n var last_val_map = this.state.last_key_val_mapping;\n if (responseJson.hasOwnProperty(\"LastEvaluatedKey\"))\n last_val_map[value] = responseJson.LastEvaluatedKey;\n else\n delete last_val_map[value];\n var resp = [];\n\n if (value == Strings.discover_category_favorite)\n resp = responseJson;\n else\n resp = responseJson.data;\n for (var j = 0; j < resp.length; j++) {\n resp[j].staxpreview = s3config.s3path + \"/\" + s3config.s3bucketname + \"/\" + s3config.s3storefolder + \"/Thumbnail_\" + resp[j].staxid + \".jpg\" + \"?time=\" + resp[j].createtime;\n }\n this.setState({\n loading: false,\n staxdata_categorized: resp,\n catgorychoosen: valueDisplay\n });\n this.refs.loaderRef.hide(); \n })\n .catch((error) => {\n this.setState({ loading: false });\n this.refs.loaderRef.hide();\n console.error(error);\n });\n }\n }\n }", "function getCategoryAffinity(ideaData)\n{\n //Find all categories and ideaKeys present in data\n var metaData = getMetaData(ideaData)\n var ideaKeys = metaData.ideaKeys;\n var categories = metaData.categories;\n\n //Create raw empty matrix\n var rawEmptyMatrix = createEmptyMatrix(ideaKeys.length, categories.length);\n\n // Create Category Weight Matrix\n var categoryWeightMatrix = createCategoryMatrix(ideaKeys, categories, rawEmptyMatrix);\n\n // Populate Category Weight Matrix\n categoryWeightMatrix = populateCategoryMatrix(ideaData, categoryWeightMatrix);\n \n //Normalize Category Weight Matrix\n var normalizedCategoryWeightMatrix = normalizeMatrix(categoryWeightMatrix, categoryWeightMatrix.categories.length);\n\n //Create pair-wise afinity matrix for category membership\n var rawAffinityMatrix = populatePairwiseAffinityMatrix(categoryWeightMatrix, normalizedCategoryWeightMatrix);\n\n var categoryAffinityMatrix = createCategoryAffinityMatrix(ideaKeys, rawAffinityMatrix);\n return categoryAffinityMatrix;\n}", "function GetDBCategories(){\n\tif (!window.openDatabase) { \n \t\talert('Databases are not supported in this browser.'); \n \t\treturn; \n \t} \n\n\t$('.category').html('');\n\t\n\tdb.transaction(function(tx) {\n\t\tvar innerJoin = '';\n\t\tvar where = '';\n\t\t\n\t\tif (loggedInUser != 1){\n\t\t\tinnerJoin = ' LEFT JOIN UserLessons ON Lesson.LessonId = UserLessons.lesson_id';\n\t\t\twhere = ' WHERE UserLessons.user_id ='+loggedInUser + ' OR Category.OwnerId = '+loggedInUser;\n\t\t}\n\t\t\n\t\tdoQuery(tx, 'SELECT * FROM Category LEFT JOIN Lesson ON Category.CategoryId = Lesson.CategoryId'+ innerJoin + where +' GROUP BY Category.CategoryName;', [],function(tx,result){\n\t\t\tif (result != null && result.rows != null) {\n\t\t\t\tif (result.rows.length != 0){\n\t\t\t\t for (var i = 0; i < result.rows.length; i++) {\n\t\t \t\t\tvar row = result.rows.item(i);\n\t\t \t\t\tvar catId = row.CategoryId;\n\t\t \t\t\t$('.category').append('<li class=\"cat\" id=\"cat_'+ catId +'\"><span class=\"cat-title\">' + row.CategoryName + '</span></li>');\n\t\t \t\t\t$('.category li#cat_' + catId).append('<img class=\"renameCategoryIcon pointer\" src=\"'+ PATH_IMG +'rename-w.png\" /><img class=\"deleteCategoryIcon pointer\" src=\"'+ PATH_IMG +'delete-w.png\" />');\n\t\t\t\t\t\t\t\t \t\t\t\n\t\t \t\t\tGetDBLessons(catId, setHtmlForLessons); \n\t\t \t\t\tinitBinding();\n\t\t \t}\n\t\t }\n\t\t else {\n\t\t \t$('.category').append('<p class=\"info\">Für dich stehen momentan noch keine Fächer zur Verfügung. Lege ein eigenes Fach an oder bitte den Administrator darum, dir Lektionen zuzuweisen.</p>');\n\t\t }\n\t \t}\n\t\t});\n\t},errorCB,nullHandler);\n\n\treturn;\n}", "function Category(category_data) {\r\n $.extend(this, category_data);\r\n }", "async function getCategoryIds() {\n const url = `https://jservice.io//api/random?count=${NUM_CATEGORIES*3}`\n let results = await axios.get(url,{timeout:4000}).catch((err)=>console.log(err));\n let totalIds=results.data.map((clue)=>clue.category_id)\n let ids=[]\n while(true){\n if(ids.length===NUM_CATEGORIES)break;\n let id = totalIds[Math.floor(Math.random()*(totalIds.length+1))];\n if(!ids.includes(id) && id){\n ids.push(id);\n }\n }\n return ids;\n}", "function getCategories() {\n\tvar categories = getCatDisponibility() + \" \" + getCatCategory() + \" \" + getCatCountries();\n\t\n\treturn categories;\n}", "function categorify(cat) {\n var ret;\n if(typeof cat == \"string\")\n ret = cat\n ;\n else ret = d3.entries(cat) // Overview pseudo-phase\n .filter(function(e) { return e.value === \"Yes\"; })\n .map(function(k) { return k.key.trim(); })\n [0]\n ;\n return ret || \"Not Applicable\";\n } // categorify()", "function createPatternCategories(){\n\tPatternCategories = new Set();\n\tPatterns.map(pattern => pattern.Categories).flat().forEach(function(subcategory){\n\t\tPatternCategories.add(subcategory);\n\t});\n\tPatternCategories = Array.from(PatternCategories);\n}", "function getCategories(){\n return _categoryProducts;\n}", "function crearObjetoCategorias(xml){\n \n //array con las categorias\n var arrCategory=[];\n //coger los datos del xml que nos interesan (name e id)\n var categoria=xml.getElementsByTagName(\"category\");\n //variables \n var nombre;\n \n for(var i=0; i<categoria.length; i++){ //se recorren las categorias\n\n nombre=categoria[i].getElementsByTagName(\"name\")[0].childNodes[0].nodeValue; //se coga el nombre de la categoria\n \n var objetoCategoria = new datosCategorias(nombre);\n arrCategory.push(objetoCategoria);\n } \n return arrCategory; //array nombre categoria\n}", "function categoryExists(category) {\n return originals[category] != null\n}", "function category(a) {\n\t // test at most 1000 points\n\t var inc = Math.max(1, (a.length - 1) / 1000),\n\t curvenums = 0,\n\t curvecats = 0,\n\t ai;\n\t\n\t for(var i = 0; i < a.length; i += inc) {\n\t ai = cleanDatum(a[Math.round(i)]);\n\t if(isNumeric(ai)) curvenums++;\n\t else if(typeof ai === 'string' && ai !== '' && ai !== 'None') curvecats++;\n\t }\n\t\n\t return curvecats > curvenums * 2;\n\t}", "function buildCategories() {\n const selectCategories = {};\n\n for (let i = 0; i < skills.length; i++) {\n const category = skills[i].category;\n // Make array for each category\n if (!selectCategories[category]) {\n selectCategories[category] = [];\n }\n\n let skill = skills[i];\n if (skill.comp === 1) {\n selectCategories[category].push({\n 'value': i,\n 'label': skill.name,\n // Custom attrs on Select Options\n 'tariff': skill.tariff.toFixed(1),\n 'startPosition': skill.startPosition,\n 'endPosition': skill.endPosition,\n 'makeDim': false\n });\n }\n }\n return selectCategories;\n}", "getCategory(_parameters) {\n\t\treturn new Category(_parameters);\n\t}", "function createCatCities(newCatIndex){\n //Done with all new Categories\n if(newCatIndex>=data.NewCategories.length){\n console.log(\"---------\"+data.Manufacturer+\"-----DONE with all new categories\");\n callback();\n return;\n }\n executeView(\"SELECT RAW records from records where docType=$1 and Manufacturer=$2 and ProductCategory=$3\",[\"MfrProCat\",data.Manufacturer,data.NewCategories[newCatIndex]],function(mfrProCatSearchRes){\n if(mfrProCatSearchRes.error || mfrProCatSearchRes.length == 0){\n if(mfrProCatSearchRes.error){\n console.log(mfrProCatSearchRes);\n }else{\n console.log(data.Manufacturer+\" ****NOT RELATED**** \"+data.NewCategories[newCatIndex]);\n };\n //if Not processing next record\n createCatCities(newCatIndex+1);\n return;\n }\n mfrCatRecord=mfrProCatSearchRes[0];\n //Getting the new category record\n executeView(\"SELECT RAW records from records use keys $1\",[data.NewCategories[newCatIndex]],function(catRecord){\n if (catRecord.error) {\n console.log(catRecord.error);\n createCatCities(newCatIndex+1);\n return;\n }\n catRecord = catRecord[0];\n //Creating MfrProCatCity\n var mfrProCatCityRecord = {\n \"$status\": \"published\",\n \"@identifier\": \"mfrprocatcity\",\n \"@uniqueUserName\": mfrRecord.name.trim().replace(/\\W+/g, \"-\").toLowerCase() + \"-\" + catRecord.categoryName.trim().replace(/\\W+/g, \"-\").toLowerCase() + \"-\" + cityRecord.cityName.trim().replace(/\\W+/g, \"-\").toLowerCase(),\n \"City\": data.City,\n \"Manufacturer\": data.Manufacturer,\n \"ProductCategory\": data.NewCategories[newCatIndex],\n \"author\": \"administrator\",\n \"cityName\": cityRecord.cityName,\n \"cloudPointHostId\": \"cloudseed\",\n \"dateCreated\": global.getDate(),\n \"dateModified\": global.getDate(),\n \"docType\": \"MfrProCatCity\",\n \"editor\": \"administrator\",\n \"flag\": \"created with script\",\n \"manufacturerName\": mfrRecord.name,\n \"metaDescription\": \"Find all \" + catRecord.categoryName + \" manufactured by \" + mfrRecord.name + \"in\" + cityRecord.cityName +\". Also locate and chat with stores and dealers near you.\",\n \"metaTitle\": mfrRecord.name + \" \" + catRecord.categoryName + \"in\" + cityRecord.cityName +\" | cloudseed.com\",\n \"mfrProCat\": mfrCatRecord.recordId,\n \"mfrprocatcity\": mfrRecord.name + \" \" + catRecord.categoryName + \" \" + cityRecord.cityName,\n \"org\": \"public\",\n \"productCategoryName\": catRecord.categoryName,\n \"recordId\": \"MfrProCatCity\" + global.guid(),\n \"relationDesc\": [\n \"mfrProCat-availableIn-City\",\n \"City-hasMfrProCat-mfrProCat\"\n ],\n \"revision\": 1\n }\n\n createRecordInDataBase(mfrProCatCityRecord,function(crr){\n mfrProCatCityRecord=crr;\n console.log(\"mfrProCatCityRecord----\",mfrProCatCityRecord.recordId);\n createCatCitySupplier(0);\n });\n function createCatCitySupplier(supplierIndex){\n if(supplierIndex>=data.Suppliers.length){\n //createCatCitySupplier();\n createCatCities(newCatIndex+1);\n return;\n }\n\n executeView(\"SELECT RAW records from records use keys $1\",[data.Suppliers[supplierIndex]],function(supRecordRes){\n if (supRecordRes.error) {\n console.log(supRecordRes.error);\n createCatCitySupplier(supplierIndex+1);\n return;\n }\n supRecord = supRecordRes[0];\n var mfrProCatCitySupRecord = {\n \"$status\": \"published\",\n \"@identifier\": \"recordId\",\n \"City\": data.City,\n \"Manufacturer\": data.Manufacturer,\n \"ProductCategory\": data.NewCategories[newCatIndex],\n \"MfrProCatCity\": mfrProCatCityRecord.recordId,\n \"Supplier\": data.Suppliers[supplierIndex],\n \"author\": \"administrator\",\n \"cloudPointHostId\": \"cloudseed\",\n \"dateCreated\": global.getDate(),\n \"dateModified\": global.getDate(),\n \"docType\": \"MfrProCatCitySupplier\",\n \"editor\": \"administrator\",\n \"flag\": \"created with script\",\n \"org\": \"public\",\n \"recordId\": \"MfrProCatCitySupplier\"+ global.guid(),\n \"relationDesc\": [\n \"MfrProCatCity-hasSupplier-Supplier\",\n \"Supplier-hasMfrProCatCity-MfrProCatCity\"\n ],\n \"revision\": 1\n }\n\n createRecordInDataBase(mfrProCatCitySupRecord,function(crr2){\n mfrProCatCitySupRecord=crr2;\n console.log(\"mfrProCatCitySupRecord----\",mfrProCatCitySupRecord.recordId);\n createCatCitySupplier(supplierIndex+1);\n });\n })\n\n }\n\n })\n });\n }" ]
[ "0.65933365", "0.6431569", "0.63838863", "0.6295054", "0.62482774", "0.61676735", "0.60887426", "0.6032884", "0.6030886", "0.60207045", "0.59903777", "0.5935371", "0.5903373", "0.5855015", "0.5827368", "0.58258593", "0.5816537", "0.5806314", "0.5792421", "0.57911104", "0.57847834", "0.57812154", "0.5776669", "0.575526", "0.57490647", "0.5742246", "0.5715359", "0.57085824", "0.5708425", "0.5701536", "0.5697337", "0.5687202", "0.5687202", "0.56862885", "0.5685251", "0.56802297", "0.5667985", "0.5663439", "0.56632197", "0.56612045", "0.5654717", "0.56529886", "0.5636447", "0.56352043", "0.56274736", "0.5610237", "0.5607627", "0.56070316", "0.5606171", "0.55884635", "0.55866617", "0.558605", "0.55847883", "0.5584383", "0.5581653", "0.55801076", "0.5571752", "0.5559467", "0.5557932", "0.55567706", "0.5548673", "0.5543215", "0.5542674", "0.55394465", "0.5534616", "0.553431", "0.55266345", "0.55257416", "0.5522549", "0.552207", "0.5522065", "0.55215466", "0.5520648", "0.552003", "0.5515161", "0.5512502", "0.55018705", "0.54932046", "0.5484697", "0.54820293", "0.547082", "0.54690427", "0.54678047", "0.5452139", "0.5449065", "0.5444998", "0.5443679", "0.5437539", "0.5435428", "0.54242706", "0.5423267", "0.5419914", "0.5418182", "0.5414488", "0.5413781", "0.54134434", "0.5410139", "0.5405402", "0.54042304", "0.5403788", "0.54020894" ]
0.0
-1
Hover to change label and labelLine
function onEmphasis() { polyline.ignore = polyline.hoverIgnore; text.ignore = text.hoverIgnore; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function labelMouseOver(tag) {\n d3.selectAll('marker#' + tag)\n .select('path')\n .classed('hovered', true);\n\n d3.selectAll('.' + tag)\n .selectAll('path, text')\n .classed('hovered', true);\n }", "mouseover() {\n this.label.value = \"Reset\";\n this.label.innerHTML = \"Reset\";\n }", "mouseout() {\n this.label.value = \"Steps:\";\n this.label.innerHTML = \"Steps:\";\n }", "function onEmphasis(){labelLine.ignore = labelLine.hoverIgnore;text.ignore = text.hoverIgnore;}", "function HoverLabel(chart, options) {\n this.id = options.id\n this.chart = chart\n\n // HTML elements.\n this.circle = makeLabel(\"hover-circle\")\n this.valLabel = makeLabel(\"hover-label hover-value-label\")\n this.dateLabel = makeLabel(\"hover-label hover-date-label\", chart.tpadding)\n this.vLine = new HoverLine(chart)\n this.vLineBack = new HoverLine(chart)\n this.onResize()\n\n sail(this.chart.container)\n .append(this.dateLabel)\n .append(this.valLabel)\n .append(this.circle)\n\n this.isVisible = HIDE\n this.isValVisible = HIDE\n this.markerType = null // null or String (e.g. \"heat\")\n // requestAnimationFrame info.\n this.hasAnimReq = false\n this.animEv = null\n\n var _this = this\n d3.select(chart.canvas)\n .on(\"mousemove.label\", function() { _this.onMouseMove(d3.event) })\n d3.select(chart.container)\n .on(\"mouseout.label\", function() { _this.onMouseOut(d3.mouse(this), d3.event) })\n\n var _this = this\n this.chart.xInterval.on(\"hover:x\", this._onHoverX = function(x, ts) {\n _this.vLine.moveTo(x)\n _this.vLineBack.moveTo(x === null ? x : backLineDelta(chart, ts))\n })\n}", "function hover(event, pos, item) {\n if (item) {\n $(\"#label\").css(\"display\", \"block\");\n $(\"#label\").css(\"position\", \"absolute\");\n // Offset the label so it's not covered by the cursor\n $(\"#label\").css(\"left\", (item.pageX + 10) + \"px\");\n $(\"#label\").css(\"top\", (item.pageY - 20) + \"px\");\n $(\"#label\").text(item.datapoint[1]);\n }\n else {\n $(\"#label\").css(\"display\", \"none\");\n }\n}", "function addLabelToLine(lineData, label, className) {\n\tvar delay = (label == \"Weekly Average\") ? 0 : 1000;\n\tsvgLine.append(\"text\")\n\t \t\t.attr(\"class\", className)\n\t \t\t.attr(\"transform\", function(d, i) {\n\t \t\t\treturn \"translate(\" + xScale(lineData.length -1 + 15) + \",\"\n\t\t\t\t\t\t\t\t\t+ yScale(lineData[lineData.length-1]) + \")\";\n\t\t\t})\n\t\t\t.attr(\"x\", 6)\n\t \t\t.attr(\"dy\", \"0.3em\")\n\t \t\t.text(label)\n\t \t\t.attr(\"visibility\", \"hidden\")\n\t\t\t.transition()\n\t\t\t.delay(delay)\n\t \t\t.attr(\"visibility\", \"visible\");\n}", "function updateMouseHoverLine() {\r\n for (var i=0; i<lineSegments.length; ++i) {\r\n ls = lineSegments[i];\r\n //determine if cursor position is on or very near a line\r\n var TOLERANCE = CELL_SIZE/2;\r\n var mousePos = {x:mouseX,y:mouseY};\r\n var closestPoint = Geometry.getClosestPointOnLineSegment(ls.p1, ls.p2, mousePos, TOLERANCE)\r\n if (closestPoint != false) {\r\n ls.hover = true;\r\n if (debug && currentTool == \"select-line\" || currentTool == \"delete-line\") {\r\n //draw dot for p2\r\n ctx.beginPath();\r\n ctx.arc(closestPoint.x, closestPoint.y, 2, 0, Math.PI*2, true); \r\n ctx.closePath();\r\n ctx.fillStyle = \"purple\";\r\n ctx.fill();\r\n }\r\n } else {\r\n ls.hover = false;\r\n }\r\n }\r\n}", "function labelMouseEnter(linkData, direction) {\n var inverse = direction === 'from';\n\n d3.selectAll('marker#' + getMarkerId(linkData, inverse))\n .select('path')\n .classed('hovered', true);\n\n d3.selectAll('.' + getMarkerId(linkData, inverse))\n .selectAll('path, text')\n .classed('hovered', true);\n\n svg.selectAll('.label').sort(function(a, b) {\n // select the parent and sort the path's\n if (a.id === linkData.id && b.id !== linkData.id) {\n return 1; // a is hovered\n } else if (a.id !== linkData.id && b.id === linkData.id) {\n return -1; // b is hovered\n } else {\n // workaround to make sorting in chrome for these elements stable\n return a.id - b.id; // compare unique values\n }\n });\n }", "function addDriverLabels(vis, laps, cssClass, x, textAnchor) {\n\n return vis.selectAll('text.label.' + cssClass)\n .data(laps)\n .enter()\n .append('svg:text')\n .attr('class', 'label ' + cssClass)\n .attr('x', x)\n .attr('dy', '0.35em')\n .attr('text-anchor', textAnchor)\n .text(function(d) {\n\n\n var var4= [d.name,d.placing.slice(1, 6)];\n //var qna = var4.split(',');\n //var res = qna.join(\" <br> \");\n\n return var4[0] ;//+ var4[1];\n })\n .style('fill', function(d) {\n\n return SCALES.clr(d.placing[0]);\n })\n .on('mouseover', function(d) {\n\n highlight(vis, d.name);\n })\n .on('mouseout', function() {\n\n unhighlight(vis);\n });\n\n}", "function create_line_label(p, label, color){\n\t var pr=new Promise(function(ok, fail){\n\t\tvar le_tpl={\n\t\t \n\t\t ui_opts : {\n\t\t //render_name : false,\n\t\t\tlabel : true,\n\t\t\troot_classes : [\"inline\"],\n\t\t\tchild_classes : [\"panel panel-default btn-xs horizontal_margin inline\"]\n\t\t },\n\t\t elements : {\n\t\t\tenable : {\n\t\t\t name : label,\n\t\t\t type : \"bool\",\n\t\t\t value : true,\n\t\t\t ui_opts : {\n\t\t\t\ttype: \"edit\", label : true, root_classes : [\"inline\"],\n\t\t\t }\n\t\t\t\n\t\t\t},\n\t\t\tline_color : {\n\t\t\t type : \"color\",\n\t\t\t ui_opts : {\n\t\t\t\troot_classes : [\"inline\"],\n\t\t\t\ttype : 'edit',\n\t\t\t },\n\t\t\t value : color\n\t\t\t \n\t\t\t},\n\t\t }\n\t\t};\n\t\t\n\t\tcreate_widget(le_tpl, lines).then(function(le){\n\t\t \n\t\t lines.add_child(le,label);\n\t\t le.elements.enable.listen(\"change\", function () { vec.config_range();} );\n\t\t le.elements.line_color.listen(\"change\", function (c) {\n\t\t\tp.stroke=this.value; vec.config_range(false,false);\n\t\t });\n\t\t \n\t\t //le.elements.enable.trigger(\"change\");\n\t\t p.le=le;\n\t\t ok(le);\n\t\t}).catch(fail);\n\t });\n\n\t return pr;\n\t}", "function renderLabel(inputObject, inputLine) {\n\n var leadingLabelTag = \"<a class=\\\"mLabel\\\" data-toggle=\\\"tooltip\\\" data-placement=\\\"top\\\" title=\\\"Line Label\\\">\";\n var trailingTag = \"</a>\";\n\n if (inputObject.lineLabel) {\n inputLine = inputLine + leadingLabelTag + inputObject.lineLabel + trailingTag;\n }\n if (inputObject.lineLeadSpace) {\n inputLine = inputLine + inputObject.lineLeadSpace;\n }\n return inputLine;\n}", "function redrawLabels() {\n labels\n .transition()\n .duration(1500)\n .attr(\"x\", d => d.x)\n .attr(\"y\", d => d.y);\n\n links\n .transition()\n .duration(1500)\n .attr(\"x2\", d => d.x)\n .attr(\"y2\", d => d.y);\n }", "function lineMouseOver(l, i) {\n var major = getMajorAsClass(l[0].major);\n\n changeElementOpacityForDifferentMajors(\"vis2-line\", major, '.1');\n changeElementOpacityForDifferentMajors(\"vis2-dot\", major, '.1');\n\n // this makes the tooltip visible\n div.transition()\n .duration(50)\n .style(\"opacity\", .9);\n\n var string = \"Women majoring in <i>\" + l[0]['major'] + '</i>';\n\n // this sets the location and content of the tooltip to the point's location/coordinates\n div.html(string)\n .style(\"left\", (d3.event.pageX) + \"px\")\n .style(\"top\", (d3.event.pageY - 28) + \"px\");\n}", "function updateLabel() {\n\t\tlabelVal.text( slider._getLabelValCallback( brush.extent()[0] ) );\n\t\tlabelLabel.attr(\"transform\", \"translate(\" + (+sliderWidth + \n \t\t\t\t\t\t \t +labelVal[0][0].offsetWidth + \n \t\t\t\t\t\t \t +margin.labelSpace) + \n \t \",\" + sliderHeight/2 + \")\");\n\t}", "function showLabelsOnHover(transitive) {\n each(transitive.stops, function (k, stop) {\n if (!stop.svgGroup) return;\n stop.svgGroup.selectAll('.transitive-stop-circle')\n .on('mouseenter', function (data) {\n stop.svgGroup.select('#transitive-stop-label-' + data.stop.getId())\n .style('visibility', 'visible');\n })\n .on('mouseleave', function (data) {\n if (transitive.display.zoom.scale() < 0.75) {\n stop.svgGroup.select('#transitive-stop-label-' + data.stop.getId())\n .style('visibility', 'hidden');\n }\n });\n });\n}", "function setLabelLineStyle(targetEl, statesModels, defaultStyle) {\n\t var labelLine = targetEl.getTextGuideLine();\n\t var label = targetEl.getTextContent();\n\t\n\t if (!label) {\n\t // Not show label line if there is no label.\n\t if (labelLine) {\n\t targetEl.removeTextGuideLine();\n\t }\n\t\n\t return;\n\t }\n\t\n\t var normalModel = statesModels.normal;\n\t var showNormal = normalModel.get('show');\n\t var labelIgnoreNormal = label.ignore;\n\t\n\t for (var i = 0; i < DISPLAY_STATES.length; i++) {\n\t var stateName = DISPLAY_STATES[i];\n\t var stateModel = statesModels[stateName];\n\t var isNormal = stateName === 'normal';\n\t\n\t if (stateModel) {\n\t var stateShow = stateModel.get('show');\n\t var isLabelIgnored = isNormal ? labelIgnoreNormal : retrieve2(label.states[stateName] && label.states[stateName].ignore, labelIgnoreNormal);\n\t\n\t if (isLabelIgnored // Not show when label is not shown in this state.\n\t || !retrieve2(stateShow, showNormal) // Use normal state by default if not set.\n\t ) {\n\t var stateObj = isNormal ? labelLine : labelLine && labelLine.states.normal;\n\t\n\t if (stateObj) {\n\t stateObj.ignore = true;\n\t }\n\t\n\t continue;\n\t } // Create labelLine if not exists\n\t\n\t\n\t if (!labelLine) {\n\t labelLine = new Polyline();\n\t targetEl.setTextGuideLine(labelLine); // Reset state of normal because it's new created.\n\t // NOTE: NORMAL should always been the first!\n\t\n\t if (!isNormal && (labelIgnoreNormal || !showNormal)) {\n\t setLabelLineState(labelLine, true, 'normal', statesModels.normal);\n\t } // Use same state proxy.\n\t\n\t\n\t if (targetEl.stateProxy) {\n\t labelLine.stateProxy = targetEl.stateProxy;\n\t }\n\t }\n\t\n\t setLabelLineState(labelLine, false, stateName, stateModel);\n\t }\n\t }\n\t\n\t if (labelLine) {\n\t defaults(labelLine.style, defaultStyle); // Not fill.\n\t\n\t labelLine.style.fill = null;\n\t var showAbove = normalModel.get('showAbove');\n\t var labelLineConfig = targetEl.textGuideLineConfig = targetEl.textGuideLineConfig || {};\n\t labelLineConfig.showAbove = showAbove || false; // Custom the buildPath.\n\t\n\t labelLine.buildPath = buildLabelLinePath;\n\t }\n\t }", "function _labelHoverEnter() {\r\n\tvar menuItem = Utils.getObjForId(this);\t// this.view ;\r\n\tif( !menuItem || !menuItem.isSelectable() || !menuItem.isEnabled() ) return;\r\n\r\n\tmenuItem.fTopRowOuter.style.background = LookAndFeel.url(\"highlight.png\") + ' repeat';\r\n\tmenuItem.fTopRow.style.background = LookAndFeel.url(\"highlight_tr.png\") + ' no-repeat top right';\r\n\tmenuItem.fTopRowImage.style.display = \"block\";\r\n\r\n\tmenuItem.fBotRowOuter.style.background = LookAndFeel.url(\"highlight.png\") + ' repeat';\r\n\tmenuItem.fBotRow.style.background = LookAndFeel.url(\"highlight_br.png\") + ' no-repeat top right';\r\n\tmenuItem.fBotRowImage.style.display = \"block\";\r\n\r\n\tmenuItem.fMidRowOuter.style.background = LookAndFeel.url(\"highlight.png\") + ' repeat';\r\n\tmenuItem.fMidRow.style.background = LookAndFeel.url(\"highlight.png\") + ' repeat';\r\n\t// setting row content a must for IE\r\n\tif( menuItem.fMidRowContent.style )\r\n\t menuItem.fMidRowContent.style.background = LookAndFeel.url(\"highlight.png\") + ' repeat';\r\n\tmenuItem.fMidRowOuter.style.color = \"#EEEEEE\";\r\n\tif( menuItem.fSelectListener && menuItem.fSelectListener.onItemHover )\r\n\t menuItem.fSelectListener.onItemHover(menuItem, menuItem.fSelectListener);\r\n }", "function setLabel(props){\n //label content\n var labelAttribute = \"<h2>\" + props[expressed] +\n \"</h2>\";\n\n //create info label div\n var infolabel = d3.select(\"body\")\n .append(\"div\")\n .attr(\"class\", \"infolabel\")\n .attr(\"id\", props.name + \"_label\")\n .html(labelAttribute);\n\n var regionName = infolabel.append(\"div\")\n .attr(\"class\", \"labelname\")\n .html(props.name);\n}", "function highlightLabel(highlight) {\n d3.selectAll('.labels').transition().style('opacity', 0.2)\n .style('font-size', \"9.5px\").style('fill', '#B8CBED');\n\n highlight.forEach(function(d) {\n d3.selectAll('.lab-'+d).transition().style('opacity', 1)\n .style('font-size', \"13px\")\n .style('fill', '#5B6D8F')\n })\n }", "function logMouseEnter() {\n log('hover:scatterlegend', { numLabels })\n }", "function setLabel(props){\n //label content\n var labelAttribute = \"<h1>\" + props[expressed] +\n \"</h1>\" + expressed + \"</b>\";\n\n //create info label div\n var infolabel = d3.select(\"body\")\n .append(\"div\")\n .attr(\"class\", \"infolabel\")\n .attr(\"id\", props.adm1_code + \"_label\")\n .html(labelAttribute)\n\n var regionName = infolabel.append(\"div\")\n .attr(\"class\", \"labelname\")\n .html((props.NAME_1 + \" Region\").bold());\n }", "function moveLabel() {\n //Determine width of label\n var labelWidth = d3.select('.infolabel')\n //Use node() to get the first element in this selection\n .node()\n //Return an object containing the sie of the label\n .getBoundingClientRect()\n //Examine width to determine how much to shift the mouse over\n .width;\n\n //Use coordinates of mousemove event to set label coordinates with offsets from wherever event is\n var x1 = d3.event.pageX - labelWidth/2,\n y1 = d3.event.pageY - 55;\n //Select the infolabel currently mousing over\n d3.select(\".infolabel\")\n .style(\"left\", x1 + \"px\")\n .style(\"top\", y1 + \"px\");\n}", "function mouseoverTrainLine() {\n var lineID = d3.select(this).attr(\"id\");\n d3.select(this).attr(\"style\", \"cursor:pointer\");\n\n var circleID = lineID.replace(\"line\", \"circle\");\n var circle = d3.select(\"#\" + circleID);\n\n if ((popupOpen && circleID != currentCircleID) || editting)\n return;\n\n currentCircleID = circleID;\n currentCircle = circle;\n\n // currentCircle\n // .transition().duration(200)\n // .attr(\"style\", \"cursor:pointer\")\n // .attr(\"r\", 5);\n\n defineChangesFromLine(circleID);\n\n popupOpen = true;\n\n // updatePopupCircleSize(currentCircle);\n // updatePopupCircleContent();\n}", "function Label_MouseOver(event)\n{\n\t//block the event\n\tBrowser_BlockEvent(event);\n\t//get the html\n\tvar theHTML = Get_HTMLObject(Browser_GetEventSourceElement(event));\n\t//valid?\n\tif (theHTML)\n\t{\n\t\tif (theHTML.InterpreterObject.UltraGrid)\n\t\t{\n\t\t\t//ignore everything and just forward to ultragrid\n\t\t\tUltraGrid_OnMouseOverEvent(event);\n\t\t}\n\t\telse \n\t\t{\n\t\t\t//update creation point\n\t\t\tPopupMenu_UpdateCreationPoint(event);\n\t\t\t//trigger an event\n\t\t\tvar result = __SIMULATOR.ProcessEvent(new Event_Event(theHTML.InterpreterObject, __NEMESIS_EVENT_MOUSEOVER, theHTML.InterpreterObject.GetData()));\n\t\t\t//no match nor block?\n\t\t\tif (!result.Match && !result.Blocked)\n\t\t\t{\n\t\t\t\t//has html parent?\n\t\t\t\tif (theHTML.InterpreterObject.Parent && theHTML.InterpreterObject.Parent.HTML)\n\t\t\t\t{\n\t\t\t\t\t//switch on its class\n\t\t\t\t\tswitch (theHTML.InterpreterObject.Parent.DataObject.Class)\n\t\t\t\t\t{\n\t\t\t\t\t\tcase __NEMESIS_CLASS_LABEL:\n\t\t\t\t\t\tcase __NEMESIS_CLASS_LINK:\n\t\t\t\t\t\tcase __NEMESIS_CLASS_UNKNOWN:\n\t\t\t\t\t\t\t//trigger on the parent\n\t\t\t\t\t\t\tBrowser_FireEvent(theHTML.InterpreterObject.Parent.HTML, __BROWSER_EVENT_MOUSEOVER);\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\t\t\t\t\n\t\t}\n\t}\n}", "function drawHover(context, data, settings) {\n var size = settings.labelSize,\n font = settings.labelFont,\n weight = settings.labelWeight;\n context.font = \"\".concat(weight, \" \").concat(size, \"px \").concat(font); // Then we draw the label background\n\n context.beginPath();\n context.fillStyle = '#fff';\n context.shadowOffsetX = 0;\n context.shadowOffsetY = 0;\n context.shadowBlur = 8;\n context.shadowColor = '#000';\n var textWidth = context.measureText(data.label).width;\n var x = Math.round(data.x - size / 2 - 2),\n y = Math.round(data.y - size / 2 - 2),\n w = Math.round(textWidth + size / 2 + data.size + 9),\n h = Math.round(size + 4),\n e = Math.round(size / 2 + 2);\n context.moveTo(x, y + e);\n context.moveTo(x, y + e);\n context.arcTo(x, y, x + e, y, e);\n context.lineTo(x + w, y);\n context.lineTo(x + w, y + h);\n context.lineTo(x + e, y + h);\n context.arcTo(x, y + h, x, y + h - e, e);\n context.lineTo(x, y + e);\n context.closePath();\n context.fill();\n context.shadowOffsetX = 0;\n context.shadowOffsetY = 0;\n context.shadowBlur = 0; // Then we need to draw the node\n\n (0, _node.default)(context, data); // And finally we draw the label\n\n (0, _label.default)(context, data, settings);\n}", "function _mouse_over_handler(ev, d, i)\n {\n g.append('svg:text')\n .attr('id', \"t\" + parent_name + d.rssi + \"-\" + i)\n .attr('x', function(){ return xScale(d.time); })\n .attr('y', function(){ return yScale(d.rssi) - 8; })\n .attr('text-anchor', 'middle')\n .text(function(){ return `${d.rssi}(${date_scale_format(d.time)})`; });\n }", "function labelMouseLeave(linkData, direction) {\n var inverse = direction === 'from';\n d3.selectAll('marker#' + getMarkerId(linkData, inverse))\n .select('path')\n .classed('hovered', false);\n\n d3.selectAll('.' + getMarkerId(linkData, inverse))\n .selectAll('path, text')\n .classed('hovered', false);\n }", "function handleMouseOver (d,i){\n d3.select(this).attr('stroke', 'yellow');\n\n // Specify where to put label of text\n Svg.append(\"text\")\n .attr('id', \"t\" + i)\n .attr(\"x\", x(d.x) )\n .attr('y', y(d.y) )\n .text(d.id)\n .style('fill', 'white');\n }", "function showPreviewButtonLabel() {\n addClass(\"preview-button-label\",\" label-hover\");\n}", "handleLabelChange(event) {\n this.ruleLabel = event.detail;\n this.fireEventWithRule();\n }", "highlightLabel(label) {\n // set text to display according to mode\n // debugger\n let text;\n if (this.state.mode === EVALUATION) {\n text = label.student_answer || DEFAULT_EVALUATION_LABEL_MESSAGE;\n } else {\n text = label.text || DEFAULT_LABEL_MESSAGE;\n }\n // set style to label\n this.setLabelStyle(label, { text, worldReferenceSize: this._.meshDiameter,\n style: this._.highlightedLabelStyle });\n }", "function onEmphasis() {\n labelLine.ignore = labelLine.hoverIgnore;\n text.ignore = text.hoverIgnore;\n }", "function addTimeLineMark(instant){\n\t$(\".timeLineGradLabel\").eq(instant).addClass(\"withEvent\");\n}", "function mouseOverHandler2(d) {\n\t\tsetItsHover(!itsHover);\n\t\tsetToolTip({\n\t\t\tisShow: true,\n\t\t\tx: +d.target.attributes.cx.value,\n\t\t\ty: +d.target.attributes.cy.value,\n\t\t\tvalue: d.target.attributes.val.value,\n\t\t\tcolor: d.target.attributes.fill.value\n\t\t});\n\n\t\tsetRad(d.target.attributes.circleId.value);\n\n\t\tconsole.log('hover', d.target.attributes.circleId.value);\n\t}", "function onEmphasis() {\n\t labelLine.ignore = labelLine.hoverIgnore;\n\t text.ignore = text.hoverIgnore;\n\t }", "function setMouseOver (polyline, streetname) {\n polyline.on('mouseover', function (e) {\n let layer = e.target;\n layer.setStyle({ color: '#000', opacity: 1});\n layer.bindTooltip('<strong>Activate ' + streetname + '</strong>');\n });\n return;\n}", "function handleMouseOver(d, i) { // Add interactivity\n\n // Specify where to put label of text\n svg.append(\"text\")\n .attr(\"id\", \"t\" + d.date.getTime() + \"-\" + d.time + \"-\" + i)\n .attr(\"x\", function() { return x(d.date) + left; })\n .attr(\"y\", function() { return y(d.time) + top - 5; })\n .attr(\"font-size\", \"12px\")\n .text(function() {\n var month = d.date.getMonth() + 1;\n var day = d.date.getDate();\n var year = d.date.getFullYear();\n var toPrintDate = month + \"/\" + day + \"/\" + year;\n return d.name + \": \" + toPrintDate + \", \" + ticks(d.time); // Value of the text\n });\n }", "function setLabel(props){\n //label content\n var labelAttribute = \"<h1>\" + props[expressed] + \"%\" +\n \"</h1><b>\" + \"Percent \" + expressed + \"</b>\";\n\n //create info label div\n var infolabel = d3.select(\"body\")\n .append(\"div\")\n .attr(\"class\", \"infolabel\")\n .attr(\"id\", props.NAME_1 + \"_label\")\n .html(labelAttribute);\n\n var stateName = infolabel.append(\"div\")\n .attr(\"class\", \"labelname\")\n .html(props.NAME_1);\n}", "hover(x, y){\n var self = this;\n self.startX = x || self.startX;\n self.startY = y || self.startY;\n self.draw(self.selected ? self.line.keyboard.keySelectedHoverBorderColor : self.line.keyboard.keyHoverBorderColor, true);\n }", "function onEmphasis() {\n labelLine.ignore = labelLine.hoverIgnore;\n text.ignore = text.hoverIgnore;\n }", "function onEmphasis() {\n labelLine.ignore = labelLine.hoverIgnore;\n text.ignore = text.hoverIgnore;\n }", "function onEmphasis() {\n labelLine.ignore = labelLine.hoverIgnore;\n text.ignore = text.hoverIgnore;\n }", "function onEmphasis() {\n labelLine.ignore = labelLine.hoverIgnore;\n text.ignore = text.hoverIgnore;\n }", "function handleMouseOver(d, i) { // Add interactivity\n // Use D3 to select element, change color and size\n d3.select(this).attr(\"fill\", \"orange\");\n\n // Specify where to put label of text\n svg.append(\"text\").attr({\n id: \"t\" + d.x + \"-\" + d.y + \"-\" + i, // Create an id for text so we can select it later for removing on mouseout\n x: function() {\n return xScale(d.x) - 30;\n },\n y: function() {\n return yScale(d.y) - 15;\n }\n })\n}", "function handlePointHoverEnter (e) {\n var point = $(this).data(\"point\");\n point.style = pointStyleHover;\n point.redraw();\n }", "function handlePointHoverEnter (e) {\n var point = $(this).data(\"point\");\n point.style = pointStyleHover;\n point.redraw();\n }", "function labelChange(axis, clickedText) {\n // Switch the currently active to inactive.\n d3.selectAll(\".aText\")\n .filter(\".\" + axis)\n .filter(\".active\")\n .classed(\"active\", false)\n .classed(\"inactive\", true);\n\n // Switch the text just clicked to active.\n clickedText.classed(\"inactive\", false).classed(\"active\", true);\n }", "function setLabel(props){\r\n \r\n if (expressed == attrArray[0]){\r\n var label = REM_2012;\r\n } else if (expressed == attrArray[1]){\r\n var label = REM_2013;\r\n } else if (expressed == attrArray[2]){\r\n var label = REM_2014;\r\n } else if (expressed == attrArray[3]){\r\n var label = REM_2015;\r\n } else if (expressed == attrArray[4]){\r\n var label = REM_2016;\r\n };\r\n \r\n //label content\r\n var labelAttribute = \"<h1>\" + props[expressed] +\r\n \"</h1><br><b>\" + label + \"</b>\";\r\n\r\n //create info label div\r\n var infolabel = d3.select(\"body\")\r\n .append(\"div\")\r\n .attr(\"class\", \"infolabel\")\r\n .attr(\"id\", props.CODE + \"_label\")\r\n .html(labelAttribute);\r\n\r\n var regionName = infolabel.append(\"div\")\r\n .attr(\"class\", \"labelname\")\r\n .html(props.Name);\r\n}", "function node_mouseover(d) {\r\n if (drawing_line && d !== selected_node) {\r\n // highlight and select target node\r\n selected_target_node = d;\r\n }\r\n}", "function updateLabelLinePoints(target, labelLineModel) {\n\t if (!target) {\n\t return;\n\t }\n\t\n\t var labelLine = target.getTextGuideLine();\n\t var label = target.getTextContent(); // Needs to create text guide in each charts.\n\t\n\t if (!(label && labelLine)) {\n\t return;\n\t }\n\t\n\t var labelGuideConfig = target.textGuideLineConfig || {};\n\t var points = [[0, 0], [0, 0], [0, 0]];\n\t var searchSpace = labelGuideConfig.candidates || DEFAULT_SEARCH_SPACE;\n\t var labelRect = label.getBoundingRect().clone();\n\t labelRect.applyTransform(label.getComputedTransform());\n\t var minDist = Infinity;\n\t var anchorPoint = labelGuideConfig.anchor;\n\t var targetTransform = target.getComputedTransform();\n\t var targetInversedTransform = targetTransform && invert([], targetTransform);\n\t var len = labelLineModel.get('length2') || 0;\n\t\n\t if (anchorPoint) {\n\t pt2.copy(anchorPoint);\n\t }\n\t\n\t for (var i = 0; i < searchSpace.length; i++) {\n\t var candidate = searchSpace[i];\n\t getCandidateAnchor(candidate, 0, labelRect, pt0, dir);\n\t Point.scaleAndAdd(pt1, pt0, dir, len); // Transform to target coord space.\n\t\n\t pt1.transform(targetInversedTransform); // Note: getBoundingRect will ensure the `path` being created.\n\t\n\t var boundingRect = target.getBoundingRect();\n\t var dist = anchorPoint ? anchorPoint.distance(pt1) : target instanceof Path ? nearestPointOnPath(pt1, target.path, pt2) : nearestPointOnRect(pt1, boundingRect, pt2); // TODO pt2 is in the path\n\t\n\t if (dist < minDist) {\n\t minDist = dist; // Transform back to global space.\n\t\n\t pt1.transform(targetTransform);\n\t pt2.transform(targetTransform);\n\t pt2.toArray(points[0]);\n\t pt1.toArray(points[1]);\n\t pt0.toArray(points[2]);\n\t }\n\t }\n\t\n\t limitTurnAngle(points, labelLineModel.get('minTurnAngle'));\n\t labelLine.setShape({\n\t points: points\n\t });\n\t } // Temporal variable for the limitTurnAngle function", "function mouseOverFunction() {\n // Highlight circle\n var circle = d3.select(this);\n circle\n .style(\"fill\", \"#B3F29D\")\n .style(\"fill-opacity\", 0.5);\n\n // Find links which have circle as source and highlight\n svg.selectAll(\".link\")\n .filter(function(d) {\n return d.source.name === circle[0][0].__data__.name;\n })\n .style(\"stroke\", \"#B3F29D\");\n\n // Find labels which have circle as source and highlight\n svg.selectAll(\".label\")\n .filter(function(d) {\n if (d.name) {\n return d.name === circle[0][0].__data__.name;\n } else {\n return d.source.name === circle[0][0].__data__.name;\n }\n })\n .style(\"fill\",\"#B3F29D\");\n }", "function labelUpdate(axis, clickText) {\n // Switch old choice off\n d3.selectAll(\".aText\")\n .filter(\".\" + axis)\n .filter(\".active\")\n .classed(\"active\", false)\n .classed(\"inactive\", true);\n \n // switches new choice on\n clickText.classed(\"inactive\", false).classed(\"active\", true);\n }", "function labelChange(axis, clickedText) {\n // Switch the currently active to inactive.\n d3\n .selectAll(\".aText\")\n .filter(\".\" + axis)\n .filter(\".active\")\n .classed(\"active\", false)\n .classed(\"inactive\", true);\n\n // Switch the text just clicked to active.\n clickedText.classed(\"inactive\", false).classed(\"active\", true);\n }", "function setLabelLineStyle(targetEl, statesModels, defaultStyle) {\n var labelLine = targetEl.getTextGuideLine();\n var label = targetEl.getTextContent();\n\n if (!label) {\n // Not show label line if there is no label.\n if (labelLine) {\n targetEl.removeTextGuideLine();\n }\n\n return;\n }\n\n var normalModel = statesModels.normal;\n var showNormal = normalModel.get('show');\n var labelIgnoreNormal = label.ignore;\n\n for (var i = 0; i < _util_states__WEBPACK_IMPORTED_MODULE_9__[/* DISPLAY_STATES */ \"a\"].length; i++) {\n var stateName = _util_states__WEBPACK_IMPORTED_MODULE_9__[/* DISPLAY_STATES */ \"a\"][i];\n var stateModel = statesModels[stateName];\n var isNormal = stateName === 'normal';\n\n if (stateModel) {\n var stateShow = stateModel.get('show');\n var isLabelIgnored = isNormal ? labelIgnoreNormal : Object(zrender_lib_core_util__WEBPACK_IMPORTED_MODULE_6__[/* retrieve2 */ \"P\"])(label.states[stateName] && label.states[stateName].ignore, labelIgnoreNormal);\n\n if (isLabelIgnored // Not show when label is not shown in this state.\n || !Object(zrender_lib_core_util__WEBPACK_IMPORTED_MODULE_6__[/* retrieve2 */ \"P\"])(stateShow, showNormal) // Use normal state by default if not set.\n ) {\n var stateObj = isNormal ? labelLine : labelLine && labelLine.states.normal;\n\n if (stateObj) {\n stateObj.ignore = true;\n }\n\n continue;\n } // Create labelLine if not exists\n\n\n if (!labelLine) {\n labelLine = new _util_graphic__WEBPACK_IMPORTED_MODULE_2__[/* default */ \"a\"]();\n targetEl.setTextGuideLine(labelLine); // Reset state of normal because it's new created.\n // NOTE: NORMAL should always been the first!\n\n if (!isNormal && (labelIgnoreNormal || !showNormal)) {\n setLabelLineState(labelLine, true, 'normal', statesModels.normal);\n } // Use same state proxy.\n\n\n if (targetEl.stateProxy) {\n labelLine.stateProxy = targetEl.stateProxy;\n }\n }\n\n setLabelLineState(labelLine, false, stateName, stateModel);\n }\n }\n\n if (labelLine) {\n Object(zrender_lib_core_util__WEBPACK_IMPORTED_MODULE_6__[/* defaults */ \"j\"])(labelLine.style, defaultStyle); // Not fill.\n\n labelLine.style.fill = null;\n var showAbove = normalModel.get('showAbove');\n var labelLineConfig = targetEl.textGuideLineConfig = targetEl.textGuideLineConfig || {};\n labelLineConfig.showAbove = showAbove || false; // Custom the buildPath.\n\n labelLine.buildPath = buildLabelLinePath;\n }\n}", "function moveLabel(){\n //use coordinates of mousemove event to set label coordinates\n //var x = d3.event.clientX + 10,\n // y = d3.event.clientY - 75;\n //get width of label\n var labelWidth = d3.select(\".infolabel\")\n .node()\n .getBoundingClientRect()\n .width;\n\n //use coordinates of mousemove event to set label coordinates\n var x1 = d3.event.clientX + 10,\n y1 = d3.event.clientY - 75,\n x2 = d3.event.clientX - labelWidth - 10,\n y2 = d3.event.clientY + 25;\n\n //horizontal label coordinate, testing for overflow\n var x = d3.event.clientX > window.innerWidth - labelWidth - 20 ? x2 : x1;\n //vertical label coordinate, testing for overflow\n var y = d3.event.clientY < 75 ? y2 : y1;\n\n d3.select(\".infolabel\")\n .style(\"left\", x + \"px\")\n .style(\"top\", y + \"px\");\n}", "function mouseOver(d) {\n setLabel(d);\n\n // Only highlight segments that are ancestors of the current segment.\n paths\n .interrupt()\n .style('opacity', 0.5)\n .filter(function(node) {\n // check if d.account starts with node.account\n return (d.account.lastIndexOf(node.account, 0) === 0);\n })\n .style('opacity', 1);\n }", "function createPacLabel (x,y,l) {\n\n var g = viz.selection().selectAll(\".vz-halo-arc-plot\").append(\"g\")\n .attr(\"class\",\"vz-halo-label\")\n .style(\"pointer-events\",\"none\")\n .style(\"opacity\",0);\n\n g.append(\"text\")\n .style(\"font-size\",\"11px\")\n .style(\"fill\",theme.skin().labelColor)\n .style(\"fill-opacity\",.75)\n .attr(\"text-anchor\",\"middle\")\n .attr(\"x\", x)\n .attr(\"y\", y)\n .text(l);\n\n var rect = g[0][0].getBoundingClientRect();\n g.insert(\"rect\",\"text\")\n .style(\"shape-rendering\",\"auto\")\n .style(\"fill\",theme.skin().labelFill)\n .style(\"opacity\",.45)\n .attr(\"width\",rect.width+12)\n .attr(\"height\",rect.height+12)\n .attr(\"rx\",3)\n .attr(\"ry\",3)\n .attr(\"x\", x-5 - rect.width/2)\n .attr(\"y\", y - rect.height-3);\n\n g.transition().style(\"opacity\",1);\n}", "function createPacLabel (x,y,l) {\n\n var g = viz.selection().selectAll(\".vz-halo-arc-plot\").append(\"g\")\n .attr(\"class\",\"vz-halo-label\")\n .style(\"pointer-events\",\"none\")\n .style(\"opacity\",0);\n\n g.append(\"text\")\n .style(\"font-size\",\"11px\")\n .style(\"fill\",theme.skin().labelColor)\n .style(\"fill-opacity\",.75)\n .attr(\"text-anchor\",\"middle\")\n .attr(\"x\", x)\n .attr(\"y\", y)\n .text(l);\n\n var rect = g[0][0].getBoundingClientRect();\n g.insert(\"rect\",\"text\")\n .style(\"shape-rendering\",\"auto\")\n .style(\"fill\",theme.skin().labelFill)\n .style(\"opacity\",.45)\n .attr(\"width\",rect.width+12)\n .attr(\"height\",rect.height+12)\n .attr(\"rx\",3)\n .attr(\"ry\",3)\n .attr(\"x\", x-5 - rect.width/2)\n .attr(\"y\", y - rect.height-3);\n\n g.transition().style(\"opacity\",1);\n}", "addLabeltoEdge(label, font_family, font_size, color) {\n // Add the Label to the DOM\n const rotatelabel = this.getRotateLabel()\n d3.select(this.html.node().parentElement).append(\"text\")\n .attr(\"x\", (this.x2+this.x1)/ 2 - 5*label.length)\n .attr(\"y\", (this.y2+this.y1 )/2 - this.stroke_width)\n .attr(\"transform\", rotatelabel)\n .style(\"font-family\", font_family)\n .style(\"font-size\", font_size)\n .attr(\"fill\", color)\n .text(label)\n }", "function moveLabel(){\n //get width of label\n var labelWidth = d3.select(\".infolabel\")\n .node()\n .getBoundingClientRect()\n .width;\n\n //use coordinates of mousemove event to set label coordinates\n var x1 = d3.event.clientX + 10,\n y1 = d3.event.clientY - 75,\n x2 = d3.event.clientX - labelWidth - 10,\n y2 = d3.event.clientY + 25;\n\n //horizontal label coordinate, testing for overflow\n var x = d3.event.clientX > window.innerWidth - labelWidth - 20 ? x2 : x1; \n //vertical label coordinate, testing for overflow\n var y = d3.event.clientY < 75 ? y2 : y1; \n\n d3.select(\".infolabel\")\n .style({\n \"left\": x + \"px\",\n \"top\": y + \"px\"\n });\n }", "function setLabel(props){\n\t\t//Label content\n\t\tlet labelAttribute = \"<h1>\" + props[expressed] +\n\t\t\t\"</h1><b>\" + expressed + \"</b>\";\n\n\t\t//Create info label div\n\t\tlet infoLabel = d3.select(\"body\")\n\t\t\t.append(\"div\")\n\t\t\t.attr(\"class\", \"infoLabel\")\n\t\t\t.attr(\"id\", props.name + \"_label\")\n\t\t\t.html(labelAttribute);\n\n\t\tlet countryName = infoLabel.append(\"div\")\n\t\t\t.attr(\"class\", \"labelname\")\n\t\t\t.html(props.name);\n\t}", "function circleMouseIn() {\n var text = d3.select(this.parentNode).moveToFront().select('.MST.label')\n .transition()\n .duration(250)\n .style('font-size', '18px')\n }", "function _mouse_over_handler(ev, d)\n {\n const i = g.selectAll(\".dot\").nodes().indexOf(this);\n g.append('svg:text')\n .attr('id', \"t\" + d + \"-\" + i)\n .attr('x', function() { return xScale(i); })\n .attr('y', function() { return yScale(d) -5; })\n .text(function(){ return d; });\n }", "function draw_label(step, c, label) {\n\tvar t = svg.append('text')\n\t\t.attr('x', get_text_x(step))\n\t\t.attr('y', get_text_y(c))\n\t\t.attr('font-family', 'sans-serif')\n\t\t.attr('font-size', '18')\n\t\t.attr('id', 't'+get_text_x(step)+'label'+get_text_y(c))\n\t\t.attr('text-anchor', 'middle');\n\tfor (i in label.split('\\n')) {\n\t\tt.append('tspan')\n\t\t\t.text(label.split('\\n')[i])\n\t\t\t.attr('dy', i * 20)\n\t\t\t.attr('x', get_text_x(step));\n\t}\n}", "configureLabels() {\n this.label\n .attr(\"class\", \"lgv-label\")\n .attr(\"data-node-label\", d => this.extractLabel(d))\n .attr(\"data-node-depth\", d => d.depth)\n .attr(\"data-node-children\", d => d.children ? true : false)\n .attr(\"x\", d => d.x)\n .attr(\"y\", d => d.children ? (d.y - (d.r * 0.9)) : d.y)\n .text(d => this.extractLabel(d));\n }", "updateEdgeLabel() {\n const rotatelabel = this.getRotateLabel()\n d3.select(this.html.node().parentElement).select(\"text\")\n .attr(\"x\", (this.x2+this.x1)/ 2 - 5*this.label.length)\n .attr(\"y\", (this.y2+this.y1 - this.stroke_width)/2)\n .attr(\"transform\", rotatelabel)\n }", "function moveLabel()\n {\n //get width of label\n var labelWidth = d3.select(\".infolabel\")\n .node()\n .getBoundingClientRect()\n .width;\n\n //use coordinates of mousemove event to set label coordinates\n var x1 = d3.event.clientX + 10,\n y1 = d3.event.clientY - 75,\n x2 = d3.event.clientX - labelWidth - 10,\n y2 = d3.event.clientY + 25;\n\n //horizontal label coordinate, testing for overflow\n var x = d3.event.clientX > window.innerWidth - labelWidth - 20 ? x2 : x1; \n\n //vertical label coordinate, testing for overflow\n var y = d3.event.clientY < 75 ? y2 : y1; \n\n d3.select(\".infolabel\")\n .style\n ({\n \"left\": x + \"px\",\n \"top\": y + \"px\"\n });\n }", "function moveLabel(){\n\n var labelWidth = d3.select(\".infolabel\")\n .node()\n .getBoundingClientRect()\n .width;\n //use coordinates of mousemove event to set label coordinates\n var x1 = d3.event.clientX + 10,\n y1 = d3.event.clientY + 800,\n x2 = d3.event.clientX - labelWidth - 10,\n y2 = d3.event.clientY + 500;\n\n //horizontal label coordinate, testing for overflow\n var x = d3.event.clientX > window.innerWidth - labelWidth - 20 ? x2 : x1;\n //vertical label coordinate, testing for overflow\n var y = d3.event.clientY < 75 ? y2 : y1;\n\n\n d3.select(\".infolabel\")\n .style(\"left\", x + \"px\")\n .style(\"top\", y + \"px\");\n\n }", "function moveLabel(){\n //get width of label\n var labelWidth = d3.select(\".infolabel\")\n .node()\n .getBoundingClientRect()\n .width;\n \n //use coordinates of mousemove event to set label coordinates\n var x1 = d3.event.clientX + 10,\n y1 = d3.event.clientY - 75,\n x2 = d3.event.clientX - labelWidth - 10,\n y2 = d3.event.clientY + 25;\n \n //horizontal label coordinate, testing for overflow\n var x = d3.event.clientX > window.innerWidth - labelWidth - 20 ? x2 : x1; \n //vertical label coordinate, testing for overflow\n var y = d3.event.clientY < 75 ? y2 : y1; \n\n d3.select(\".infolabel\")\n .style(\"left\", x + \"px\")\n .style(\"top\", y + \"px\");\n }", "function mouseover() {\n tooltip\n .style('opacity', 1)\n d3.select(this)\n .style('stroke', 'black')\n .style('opacity', 1)\n }", "function updateLabelLinePoints(target, labelLineModel) {\n if (!target) {\n return;\n }\n\n var labelLine = target.getTextGuideLine();\n var label = target.getTextContent(); // Needs to create text guide in each charts.\n\n if (!(label && labelLine)) {\n return;\n }\n\n var labelGuideConfig = target.textGuideLineConfig || {};\n var points = [[0, 0], [0, 0], [0, 0]];\n var searchSpace = labelGuideConfig.candidates || DEFAULT_SEARCH_SPACE;\n var labelRect = label.getBoundingRect().clone();\n labelRect.applyTransform(label.getComputedTransform());\n var minDist = Infinity;\n var anchorPoint = labelGuideConfig.anchor;\n var targetTransform = target.getComputedTransform();\n var targetInversedTransform = targetTransform && Object(zrender_lib_core_matrix__WEBPACK_IMPORTED_MODULE_7__[/* invert */ \"e\"])([], targetTransform);\n var len = labelLineModel.get('length2') || 0;\n\n if (anchorPoint) {\n pt2.copy(anchorPoint);\n }\n\n for (var i = 0; i < searchSpace.length; i++) {\n var candidate = searchSpace[i];\n getCandidateAnchor(candidate, 0, labelRect, pt0, dir);\n _util_graphic__WEBPACK_IMPORTED_MODULE_0__[/* default */ \"a\"].scaleAndAdd(pt1, pt0, dir, len); // Transform to target coord space.\n\n pt1.transform(targetInversedTransform); // Note: getBoundingRect will ensure the `path` being created.\n\n var boundingRect = target.getBoundingRect();\n var dist = anchorPoint ? anchorPoint.distance(pt1) : target instanceof _util_graphic__WEBPACK_IMPORTED_MODULE_1__[/* default */ \"b\"] ? nearestPointOnPath(pt1, target.path, pt2) : nearestPointOnRect(pt1, boundingRect, pt2); // TODO pt2 is in the path\n\n if (dist < minDist) {\n minDist = dist; // Transform back to global space.\n\n pt1.transform(targetTransform);\n pt2.transform(targetTransform);\n pt2.toArray(points[0]);\n pt1.toArray(points[1]);\n pt0.toArray(points[2]);\n }\n }\n\n limitTurnAngle(points, labelLineModel.get('minTurnAngle'));\n labelLine.setShape({\n points: points\n });\n} // Temporal variable for the limitTurnAngle function", "function moveLabel(){\n //get width of label\n var labelWidth = d3.select(\".infolabel\")\n .node()\n .getBoundingClientRect()\n .width;\n //use coordinates of mousemove event to set label coordinates\n var x1 = event.clientX + 10,\n y1 = event.clientY - 75,\n x2 = event.clientX - labelWidth - 10,\n y2 = event.clientY + 25;\n\n //horizontal label coordinate, testing for overflow\n var x = event.clientX > window.innerWidth - labelWidth - 20 ? x2 : x1; \n //vertical label coordinate, testing for overflow\n var y = event.clientY < 75 ? y2 : y1; \n\n d3.select(\".infolabel\")\n .style(\"left\", x + \"px\")\n .style(\"top\", y + \"px\");\n}", "draw_label(){\n this.svg.append('rect')\n .attr(\"class\", \"timeline-label\")\n .attr(\"x\", \"0\")\n .attr(\"y\", \"0\")\n .attr(\"width\", `${this.WIDTH}`)\n .attr(\"height\", `${this.label_height}`)\n\n this.svg.append('text')\n .attr('x', `${this.X0 - 30}`)\n .attr('text-anchor', 'left')\n .attr('y', this.label_height - 15)\n .attr('class','roll_label')\n .text(`Mean per year of ${this.y_attribute.toLowerCase()} of ${this.type} in ${this.unit}`)\n\n }", "function highlight(props){\n //change stroke\n var selected = d3.selectAll(\".\" + props.iso_a3) //or iso_a3?\n .style(\"stroke\", \"blue\")\n .style(\"stroke-width\", \"2\");\n //console.log(\"hello\", \".\" + props.iso_a3);\n // add dynamic label on mouseover\n setLabel(props);\n}", "function moveLabel(){\r\n //get width of label\r\n var labelWidth = d3.select(\".infolabel\")\r\n .node()\r\n .getBoundingClientRect()\r\n .width;\r\n \r\n //use coordinates of mousemove event to set label coordinates\r\n var x1 = d3.event.clientX + 10,\r\n y1 = d3.event.clientY - 75,\r\n x2 = d3.event.clientX - labelWidth - 10,\r\n y2 = d3.event.clientY + 25;\r\n\r\n //horizontal label coordinate, testing for overflow\r\n var x = d3.event.clientX > window.innerWidth - labelWidth - 20 ? x2 : x1; \r\n //vertical label coordinate, testing for overflow\r\n var y = d3.event.clientY < 75 ? y2 : y1; \r\n\r\n d3.select(\".infolabel\")\r\n .style(\"left\", x + \"px\")\r\n .style(\"top\", y + \"px\");\r\n}", "function borderMouseover(d, i, paths) {\n var element = svgElement.getElementById(this.id);\n element.classList.add(\"hovered\");\n updateTooltip(d);\n}", "function mouseOverPath(path) {\n\n if (network.selectedNode === null) return;\n if (network.selectedNode !== path.edge.i &&\n network.selectedNode !== path.edge.j) return;\n\n var label = path.edge.i.name + \" - \" + \n path.edge.j.name + \"<br>\";\n for (var i = 0; i < path.edge.weights.length; i++) {\n label = label + network.matrixLabels[i] + \": \" \n + path.edge.weights[i] + \"<br>\";\n }\n\n edgeLabelElem\n .html(label)\n .style(\"left\", (d3.event.pageX) + \"px\")\n .style(\"top\", (d3.event.pageY) + \"px\")\n .transition()\n .duration(50)\n .style(\"opacity\", 0.7)\n }", "function addlbl() {\n}", "editLabel(id, event) {\n event.preventDefault();\n if (event.target.label.value !== \"\") {\n const link = this.props.node.ports.bottom.links[id];\n link.addLabel(event.target.label.value);\n this.props.node.display = false;\n this.props.node.selectedLinkId = null;\n this.props.node.app.forceUpdate();\n }\n }", "function handleInstructionsMouseOver(event) {\n if (event.type == \"mouseover\") {\n createjs.Tween.get(questionMark, { loop: false }).to({ scaleX: 1.0625, scaleY: 1.0625 }, 50);\n }\n else {\n createjs.Tween.get(questionMark, { loop: false }).to({ scaleX: 1.0, scaleY: 1.0 }, 50);\n }\n }", "function tooltipOn(x, y, d) {\n // change tooltip information depending on which line is hovered over\n var percent_change;\n var information = \"\";\n for(var n=0; n < state.keys.length-1; n++){\n percent_change = state.keys[n]+\": \" + formatPercent((d[state.keys[n+1]] - d[state.keys[n]])/d[state.keys[n]]);\n // append information for multiple years\n information += (percent_change + \"<br/>\");\n }\n\n tooltip.transition()\n .duration(100)\n .style(\"opacity\", 0.9);\n tooltip.html(d.country + \"<br/>\" + information)\n .style(\"left\", (x+5) + \"px\")\n .style(\"top\", (y-45) + \"px\");\n }", "function circleMouseOut() {\n var text = d3.select(this.parentNode).moveToBack().select('.MST.label')\n .transition()\n .duration(250)\n .style('font-size', '10px')\n }", "static getLabelDragAndDrop (plot, showTrendLine = false) {\n const dragStart = () => plot.svg.selectAll('.link').remove()\n\n const dragMove = function () {\n d3.select(this)\n .attr('x', d3.event.x)\n .attr('y', d3.event.y)\n\n // Save the new location of text so links can be redrawn\n const id = d3.select(this).attr('id')\n const label = _.find(plot.data.lab, l => l.id === Number(id))\n if ($(this).prop('tagName') === 'image') {\n label.x = d3.event.x + (label.width / 2)\n label.y = d3.event.y + label.height\n } else {\n label.x = d3.event.x\n label.y = d3.event.y\n }\n }\n\n const dragEnd = function () {\n // If label is dragged out of viewBox, remove the lab and add to legend\n const id = Number(d3.select(this).attr('id'))\n const lab = _.find(plot.data.lab, l => l.id === id)\n const anc = _.find(plot.data.pts, a => a.id === id)\n\n const notBubblePlot = !Utils.isArrOfNums(this.Z)\n const labIsNotLogo = lab.url !== ''\n const labOnTopOfPoint = (lab.x - (lab.width / 2) < anc.x && anc.x < lab.x + (lab.width / 2)) && (lab.y > anc.y && anc.y > lab.y - lab.height)\n\n if (plot.data.isOutsideViewBox(lab) && !showTrendLine) {\n // Element dragged off plot\n plot.data.addElemToLegend(id)\n plot.state.pushLegendPt(id)\n plot.resetPlotAfterDragEvent()\n } else if (labIsNotLogo && notBubblePlot && labOnTopOfPoint) {\n // For logo labels and not bubbles, if the logo is directly on top of the point, do not draw point\n plot.svg.select(`#anc-${id}`).attr('fill-opacity', 0)\n } else {\n plot.state.pushUserPositionedLabel(id, lab.x, lab.y, plot.vb)\n plot.svg.select(`#anc-${id}`).attr('fill-opacity', d => d.fillOpacity)\n if (!showTrendLine) {\n plot.drawLinks()\n }\n }\n }\n\n return d3.behavior.drag()\n .origin(function () {\n return {\n x: d3.select(this).attr('x'),\n y: d3.select(this).attr('y'),\n }\n })\n .on('dragstart', dragStart)\n .on('drag', dragMove)\n .on('dragend', dragEnd)\n }", "function handleMouseOver(d, i) { // Add interactivity\n // Use D3 to select element, change color and size\n d3.select(this).style(\"fill\",\"orange\")\n .attr(\"r\", radius*2)\n\n // Specify where to put label of text\n svg.append(\"text\").attr(\"id\", \"t1337\")\n .attr(\"x\", x(d.x) - 30)\n .attr(\"y\", y(d.y) - 15)\n .text([d.x, d.y]);\n}", "function node_mouseover(d) {\n d3.select(this).transition()\n .duration(150)\n .attr(\"r\", 10);\n //update the target node\n if (drawing_line && d !== selected_node) {\n // highlight and select target node\n selected_target_node = d;\n }\n}", "function setSmallLabelsProperties(label, text){\n label.style.backgroundColor = \"#4EA1E6\";\n label.style.overflow = \"hidden\";\n label.style.position = \"relative\";\n label.style.top = \"0px\";\n label.style.fontSize = \"9px\";\n label.appendChild(document.createTextNode(translateFromTypeToName(text)));\n label.style.textAlign = \"left\";\n}", "function handleMouseOver(d, i) {\n\nd3.selectAll(\".visualCircle\").transition()\n .duration(200)\n .style(\"opacity\", 1)\n .attr(\"fill\", \"rgba(255,255,255,0.8)\")\n .attr(\"r\", circleRBefore);\n\nd3.selectAll(\".visualLabel\").transition()\n .duration(200)\n .style(\"opacity\", 0);\n\nd3.select(\"#circle_\" + this.id).transition()\n .duration(200)\n .style(\"opacity\", 0.2)\n .attr(\"fill\", \"rgba(255,255,255,0)\")\n .attr(\"r\", circleRAfter);\n\nd3.select(\"#text_\" + this.id).transition()\n .duration(200)\n .style(\"opacity\", 1);\n \ndocument.getElementById(\"type680target\").innerHTML = \"<h4>\" + itemTitles[this.id] + \"</h4><hr class='light' style='margin-left: 0px;'><p class='text-justify'>\" + itemDescriptions[this.id] + \"</p>\";\n\n}", "function handleMouseover(e){\n\t\t\t\tlet code = e.currentTarget.getAttribute(\"data-code\"),\n\t\t\t\t\tcountryData = csvData.filter(c => c.Country_Code === code)[0],\n\t\t\t\t\tcountryName = countryData.Name,\n countryIndex = countryData[dataset];\n\t\t\t\toutput.innerHTML = countryName + \"<br /> \" + countryIndex;\n\t\t\t\tdocument.querySelectorAll(`[data-code=${code}]`).forEach(el => {\n\t\t\t\t\tel.setAttribute(\"stroke\", \"red\");\n\t\t\t\t\tel.setAttribute(\"stroke-width\", 2.75);\n\t\t\t\t});\n\t\t\t}", "function toolTipLine(){\n var mouseG = svgTs.append(\"g\")\n .attr(\"class\", \"mouse-over-effects\");\n\n mouseG.append(\"path\") // this is the black vertical line to follow mouse\n .attr(\"class\", \"mouse-line\")\n .style(\"stroke\", \"black\")\n .style(\"stroke-width\", \"1px\")\n .style(\"opacity\", \"0\");\n\n var lines = document.getElementsByClassName('line');\n\n var mousePerLine = mouseG.selectAll('.mouse-per-line')\n .data(dataset)\n .enter()\n .append(\"g\")\n .attr(\"class\", \"mouse-per-line\");\n\n // mousePerLine.append(\"circle\")\n // .attr(\"r\", 4)\n // .style(\"stroke\", function(d) {\n // return getColorTs(d.key);\n // })\n // .style(\"fill\", \"none\")\n // .style(\"stroke-width\", \"1px\")\n // .style(\"opacity\", \"0\");\n //\n // mousePerLine.append(\"text\")\n // .attr(\"transform\", \"translate(10,3)\")\n\n mouseG.append('svg:rect') // append a rect to catch mouse movements on canvas\n .attr('width', tsWidth) // can't catch mouse events on a g element\n .attr('height', tsHeight)\n .attr('fill', 'none')\n .attr('pointer-events', 'all')\n .on('mouseout', function() { // on mouse out hide line, circles and text\n d3.select(\".mouse-line\")\n .style(\"opacity\", \"0\");\n // d3.selectAll(\".mouse-per-line circle\")\n // .style(\"opacity\", \"0\");\n // d3.selectAll(\".mouse-per-line text\")\n // .style(\"opacity\", \"0\");\n })\n .on('mouseover', function() { // on mouse in show line, circles and text\n d3.select(\".mouse-line\")\n .style(\"opacity\", \"1\");\n // d3.selectAll(\".mouse-per-line circle\")\n // .style(\"opacity\", \"1\");\n // d3.selectAll(\".mouse-per-line text\")\n // .style(\"opacity\", \"1\");\n })\n .on('mousemove', function() { // mouse moving over canvas\n var mouse = d3.mouse(this);\n d3.select(\".mouse-line\")\n .attr(\"d\", function() {\n var d = \"M\" + mouse[0] + \",\" + tsHeight;\n d += \" \" + mouse[0] + \",\" + 0;\n return d;\n });\n\n\n d3.selectAll(\".mouse-per-line\")\n .attr(\"transform\", function(d, i) {\n console.log(tsWidth/mouse[0])\n\n var xDate = tsxScale.invert(mouse[0]);\n var x1 = d3.timeMinute.every(5).round(xDate),\n\n idx = bisectDate(d.values, x1);\ndebugger\n var beginning = 0,\n end = lines[i].getTotalLength(),\n target = null;\n\n while (true){\n target = Math.floor((beginning + end) / 2);\n pos = lines[i].getPointAtLength(target);\n if ((target === end || target === beginning) && pos.x !== mouse[0]) {\n break;\n }\n if (pos.x > mouse[0]) end = target;\n else if (pos.x < mouse[0]) beginning = target;\n else break; //position found\n }\n\n d3.select(this).select('text')\n .text(tsyScale.invert(pos.y))\n .attr(\"font-size\",\"11px\");\n // \"#dot-\" + d.key + \"-\" + idx.style(\"fill\",\"white\").style(\"opacity\",1);\n let xPos = d3.select(\"#dot-\" + d.key + \"-\" + idx).attr(\"cx\");\n\n let yPos = d3.select(\"#dot-\" + d.key + \"-\" + idx).attr(\"cy\");\ndebugger\n d3.select(\"#carIcon-\" + d.key )\n .transition()\n .duration(2000)\n // .attrTween(\"transform\", translateAlong(tsRoutes.node()))\n .ease(d3.easeLinear)\n .attr(\"x\", xPos-5)\n .attr(\"y\", yPos-5);\n // .attr(\"transform\", (d,i)=> {\n // return \"translate(\" + [projectionTs([d.values[i].Long,d.values[i].Lat])[0]-5,projectionTs([d.values[i].Long,d.values[i].Lat])[1]-5] + \")\";\n // });\n// debugger\n return \"translate(\" + mouse[0] + \",\" + pos.y +\")\";\n });\n });\n }", "function mouseover( d ) {\n\t\t// set x and y location\n\t\tvar dotX = iepX( parseYear( d.data.year ) ),\n\t\t\tdotY = iepY( d.data.value ),\n\t\t\tdotBtu = d3.format( \".2f\" )( d.data.value ),\n\t\t\tdotYear = d.data.year,\n\t\t\tdotSource = d.data.name;\n\n\t\t// console.log( \"SOURCE:\", dotSource, index( lineColors( dotSource ) ) );\n\n\t\t// add content to tooltip text element\n\t\t/*tooltip.select( \".tooltip_text\" )\n\t\t\t.style( \"border-color\", lineColors( [ dotSource ] - 2 ) );*/\n\n\t\ttooltip.select( \".tooltip_title\" )\n\t\t\t.text( dotYear )\n\t\t/*.style( \"color\", lineColors( dotSource ) )*/\n\t\t;\n\n\t\ttooltip.select( \".tooltip_data\" )\n\t\t\t.text( dotBtu + \" \" + yUnitsAbbr );\n\n\t\ttooltip.select( \".tooltip_marker\" )\n\t\t\t.text( \"▼\" )\n\t\t/*.style( \"color\", lineColors( dotSource ) )*/\n\t\t;\n\n\t\t//Change position of tooltip and text of tooltip\n\t\ttooltip.style( \"visibility\", \"visible\" )\n\t\t\t.style( \"left\", dotX + ( chart_margins.left / 2 ) + \"px\" )\n\t\t\t.style( \"top\", dotY + ( chart_margins.top / 2 ) + \"px\" );\n\t} //mouseover", "tooltipShow(event, d, vis) {\n moveTimeSliderLayerDown();\n vis.lineData = vis.linegroups.get(d.properties.name);\n if (vis.lineData === undefined) {\n d3.select('#mapchart-tooltip').style('display', 'none');\n return null;\n }\n\n // Update Domain\n vis.xScale.domain(vis.years);\n vis.yScale.domain(vis.consumption.get(d.properties.name));\n\n // Redraw Lines\n let tooltip = d3.select('#mapchart-tooltip');\n let tooltipLines = tooltip\n .style('display', 'block')\n .selectAll('.line')\n .data(vis.lineData)\n .join('path');\n tooltipLines\n .attr('class', 'line')\n .attr('fill', 'none')\n .attr('stroke', d => vis.colorScale(d[0]))\n .attr('stroke-width', 3)\n .attr('d', d => d3.line()\n .defined(d => d.Consumption != 0)\n .x(d => vis.xScale(d.Year))\n .y(d => vis.yScale(d.Consumption))\n (d[1]));\n\n // Update Piechart\n let data = Array.from(vis.groups.get(d.properties.name).values());\n let tooltipPie = tooltip\n .selectAll('.test')\n .data(d3.sum(data) == 0 ? pie(0) : pie(data))\n .join('path');\n tooltipPie\n .attr('transform', 'translate(25, 20)')\n .attr('class', 'test')\n .attr('fill', d => {\n return vis.indexColorScale(d.index);\n })\n .attr('d', arc)\n .attr('stroke', 'black')\n .attr('stroke-width', '1px');\n\n // Update Line Chart Title, Call Axes\n vis.tooltipTitle.text(`Energy Consumption of\n ${d.properties.name} between ${vis.years[0]} - ${vis.years[1]} `);\n vis.xAxisG.call(vis.xAxis);\n vis.yAxisG.call(vis.yAxis);\n }", "function drawSlopeLabel() {\n let label = document.getElementById(\"slopeLabel\");\n // display when points are pinned. do not redraw if nothing changed\n if (pt1.pinned && pt2.pinned && m != label.innerHTML.substring(2)\n && isFinite(m) && m != 0 && !riseRunDisplay) {\n // find midpoint of line, put the label there\n midpoint = calcMidpoint(pt1.x, pt1.y, pt2.x, pt2.y);\n screenPos = planeCoordToAbsScreenPosition(midpoint.x, midpoint.y, 0, 0);\n label.hidden = false;\n label.innerHTML = \"m=\" + m.toFixed(2);\n label.style.left = screenPos.x + \"px\";\n label.style.top = screenPos.y + \"px\";\n }\n}", "function mouseLeave(d) {\n paths\n .transition()\n .duration(1000)\n .style('opacity', 1)\n setLabel(root);\n }", "function setLabel(props){\n //label content\n if (isNaN(props[expressed])) {\n var displayNumber = \"No Medals\";\n } else {\n var displayNumber = (props[expressed]).toFixed(2);\n };\n if (isNaN(props.tot_tot)){\n var totalMedals = 0\n } else {\n var totalMedals = props.tot_tot.toLocaleString()\n }\n var whichOlympics = dropdownText(expressed);\n var whichGDP = String(\"gdp_\" + whichOlympics[0].slice(-4));\n if (isNaN(props[whichGDP])) {\n var GDPval = 'Undefined';\n } else {\n var GDPval = \"$\" + props[whichGDP].toLocaleString();\n }\n\n var labelAttribute = \"<h1>\" + displayNumber +\n \"</h1><b>\" + whichOlympics[0] + \" \" + whichOlympics[1] + \"</b>\";\n \n var olympicHistoryText = \"<p><b>\" + props.ADMIN + \"<br><p>PP GDP:</b> \" + GDPval + \"<br>\" + \"<b>All-time Combined Medal Total:</b> \" + totalMedals;\n\n //create info label div\n var infolabel = d3.select(\"body\")\n .append(\"div\")\n .attr(\"class\", \"infolabel\")\n .attr(\"id\", props.geoid + \"_label\")\n .html(labelAttribute);\n \n var olympicHistory = infolabel.append(\"div\")\n .attr(\"class\", \"labelname\")\n .html(olympicHistoryText);\n }", "function setLabel(props){\n var formatName = props.name.replace(new RegExp(\"_\", \"g\"),\" \");\n \n var labelAttribute = \"<h1>\" + props[expressed] + \"</h1><b>\" + formatName + \"</b>\";\n \n var infoLabel = d3.select(\"body\")\n .append(\"div\")\n .attr(\"class\", \"infoLabel\")\n .attr(\"id\", props.name + \"_label\")\n .html(labelAttribute);\n }", "function drawLine(startPoint, endPoint, label) {\n // first I am going to create the links\n var newElement = document.createElementNS(\"http://www.w3.org/2000/svg\", 'path');\n var pathString = \"M \" + startPoint[0].toString() + \", \" + startPoint[1].toString() + \" L \" + endPoint[0].toString() + \", \" + endPoint[1].toString();\n\n newElement.setAttribute(\"d\", pathString);\n newElement.style.stroke = \"black\";\n newElement.style.strokeWidth = \"2\";\n newElement.setAttribute(\"id\", label);\n svg.appendChild(newElement);\n // Now to add the text labels\n var textElement = document.createElementNS(\"http://www.w3.org/2000/svg\", 'text');\n textElement.setAttribute(\"dy\", \"-12\");\n textElement.setAttribute(\"style\", \"text-anchor:middle; font-size:23px;\");\n var textPath = document.createElementNS(\"http://www.w3.org/2000/svg\", 'textPath');\n textPath.setAttributeNS(\"http://www.w3.org/1999/xlink\", \"xlink:href\", \"#\"+label);\n textPath.setAttribute(\"startOffset\", \"50%\");\n textPath.textContent = label;\n textElement.appendChild(textPath);\n svg.appendChild(textElement);\n}", "function mouseover(d) {\n\t\tchart.append(\"text\")\n\t\t\t.attr(\"id\", \"interactivity\")\n\t\t\t.attr(\"y\", y(d.value) - 15)\n\t\t\t.attr(\"x\", x(d.year) + 23)\n\t\t\t.style(\"text-anchor\", \"start\")\n\t\t\t.style(\"font\", \"10px sans-serif\")\n\t\t\t.text(d.value);\n\n\t\td3.select(this)\n\t\t\t.style(\"fill\", \"darkblue\");\n\t}", "function updateLabels() {\n label = label.data(data.topics, function(d) {\n return d.name;\n });\n\n label.exit().remove();\n\n var labelEnter = label.enter().append(\"a\")\n .attr(\"class\", \"g-label\")\n .attr(\"id\", function(d) {\n return encodeURIComponent(d.name);\n })\n .call(force.drag)\n .call(linkTopic);\n\n labelEnter.append(\"div\")\n .attr(\"class\", \"g-name\")\n .text(function(d) {\n return d.name;\n });\n\n labelEnter.append(\"div\")\n .attr(\"class\", \"g-value\");\n\n label\n .style(\"font-size\", function(d) {\n return Math.max(8, r(d.count) / 2.2) + \"px\";\n })\n .style(\"width\", function(d) {\n return r(d.count) * 2.5 + \"px\";\n });\n\n // Create a temporary span to compute the true text width.\n label.append(\"span\")\n .text(function(d) {\n return d.name;\n })\n .each(function(d) { d.dx = Math.max(2.5 * r(d.count), this.getBoundingClientRect().width); })\n .remove();\n\n label\n .style(\"width\", function(d) {\n return d.dx + \"px\";\n })\n .select(\".g-value\")\n .text(function(d) {\n return d.count + (d.r > 60 ? \" mentions\" : \"\");\n });\n\n // Compute the height of labels when wrapped.\n label.each(function(d) { d.dy = this.getBoundingClientRect().height; });\n }", "getHoverLabel() {\n if (this._source && this._parent && this._parent._source) {\n return this._source.raw.path || this._source.raw.name;\n }\n let label = this.getLabel(false);\n const parent = this.getParent();\n if (parent) {\n const hover = parent.getHoverLabel();\n if (hover) {\n return `${hover}/${label}`;\n }\n }\n return label;\n }", "addToLabel(label, font_family, font_size, color) {\n const rotatelabel = this.getRotateLabel()\n d3.select(this.html.node().parentElement).select(\"text\")\n .attr(\"x\", (this.x2+edge.x1)/ 2 - 5*label.length)\n .attr(\"y\", (this.y2+edge.y1 - this.stroke_width)/2)\n .attr(\"transform\", rotatelabel)\n .style(\"font-family\", font_family)\n .style(\"font-size\", font_size)\n .attr(\"fill\", color)\n .text(label)\n }" ]
[ "0.7160445", "0.6749156", "0.6671658", "0.6635125", "0.66347754", "0.6629498", "0.655893", "0.6482963", "0.6458986", "0.64368105", "0.6426821", "0.63938105", "0.63766766", "0.63610965", "0.6343155", "0.63140905", "0.6271357", "0.6249969", "0.6235974", "0.62019086", "0.6192681", "0.6189637", "0.61123174", "0.60820425", "0.6072926", "0.6064654", "0.6062174", "0.60592926", "0.6057063", "0.6052467", "0.5986434", "0.59778553", "0.59736824", "0.5970161", "0.5968279", "0.5945081", "0.5944528", "0.59428483", "0.59400845", "0.59357285", "0.5915749", "0.5915749", "0.5915749", "0.5915749", "0.5904564", "0.5888428", "0.5888428", "0.5885303", "0.5879135", "0.58786505", "0.58711207", "0.58697814", "0.5864544", "0.58603275", "0.58597547", "0.5859607", "0.5856951", "0.5854193", "0.5854193", "0.5853343", "0.5848151", "0.58421654", "0.5838989", "0.58354473", "0.58292586", "0.58242214", "0.5821075", "0.5818977", "0.58143693", "0.58105826", "0.5810045", "0.5791633", "0.5789685", "0.57817", "0.5774931", "0.57748884", "0.57720953", "0.57643217", "0.5759105", "0.5757087", "0.57504743", "0.57482886", "0.57455087", "0.57440174", "0.5737313", "0.5733603", "0.57301444", "0.5728332", "0.5725048", "0.57225966", "0.572043", "0.57149416", "0.5709948", "0.57056457", "0.57052016", "0.57039124", "0.5701891", "0.5695123", "0.5694554", "0.5693353", "0.5690709" ]
0.0
-1
Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file distributed with this work for additional information regarding copyright ownership. The ASF licenses this file to you under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
function _default(seriesType, actionInfos) { zrUtil.each(actionInfos, function (actionInfo) { actionInfo.update = 'updateView'; /** * @payload * @property {string} seriesName * @property {string} name */ echarts.registerAction(actionInfo, function (payload, ecModel) { var selected = {}; ecModel.eachComponent({ mainType: 'series', subType: seriesType, query: payload }, function (seriesModel) { if (seriesModel[actionInfo.method]) { seriesModel[actionInfo.method](payload.name, payload.dataIndex); } var data = seriesModel.getData(); // Create selected map data.each(function (idx) { var name = data.getName(idx); selected[name] = seriesModel.isSelected(name) || false; }); }); return { name: payload.name, selected: selected }; }); }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "get Android() {}", "function SBRecordsetPHP_analyzePlatformSpecific()\r\n{\r\n\r\n\r\n}", "onChildAppStart () {\n\n }", "private internal function m248() {}", "private public function m246() {}", "onMessageStart() { }", "createStream () {\n\n }", "_playbackCompatibility() {\n // Detect audio playback capabilities.\n\n // Detect HTML5 Audio playback.\n // http://caniuse.com/#feat=audio\n this.canUseAudio = Boolean(new Audio());\n console.log('Native HTML5 Audio playback capability: ' +\n this.canUseAudio);\n\n // Detect Cordova Media Playback\n // It allows playing audio using the native bridge inside WebView Apps.\n // https://github.com/apache/cordova-plugin-media/blob/master/doc/index.md\n this.canUseCordovaMedia = Boolean(window.Media);\n console.log('Cordova Media playback capability: ' +\n this.canUseCordovaMedia);\n\n if (!(this.canUseAudio || this.canUseCordovaMedia)) {\n throw new Error(\n 'Some form of audio playback capability is required');\n }\n\n var _audio = new Audio();\n if (_audio.canPlayType === 'function') {\n throw new Error(\n 'Unable to detect audio playback capabilities');\n }\n\n var canPlayOggVorbis = _audio.canPlayType(\n 'audio/ogg; codecs=\"vorbis\"') !== '';\n var canPlayOggOpus = _audio.canPlayType(\n 'audio/ogg; codecs=\"opus\"') !== '';\n var canPlayWave = _audio.canPlayType('audio/wav') !== '';\n var canPlayMP3 = _audio.canPlayType('audio/mpeg; codecs=\"mp3\"') !== '';\n var canPlayAAC = _audio.canPlayType(\n 'audio/mp4; codecs=\"mp4a.40.2\"') !== '';\n var canPlay3GPP = _audio.canPlayType(\n 'audio/3gpp; codecs=\"samr\"') !== '';\n\n console.log('Native Vorbis audio in Ogg container playback capability: ' +\n canPlayOggVorbis);\n console.log('Native Opus audio in Ogg container playback capability: ' +\n canPlayOggOpus);\n console.log('Native PCM audio in Waveform Audio File Format (WAVE) ' +\n 'playback capability: ' + canPlayWave);\n console.log('Native MPEG Audio Layer 3 (MP3) playback capability: ' +\n canPlayMP3);\n console.log('Native Low-Complexity AAC audio in MP4 container playback ' +\n 'capability: ' + canPlayAAC);\n console.log('Native AMR audio in 3GPP container playback capability: ' +\n canPlay3GPP);\n\n if (!(canPlayWave || canPlayMP3)) {\n throw new Error(\n 'Native Wave or MP3 playback is required');\n }\n }", "constructor() {\n\t}", "constructor() {\n\t}", "constructor() {\n\n\t}", "onComponentMount() {\n\n }", "constructor() {\n throw new Error('Not implemented');\n }", "supportsPlatform() {\n return true;\n }", "function _____SHARED_functions_____(){}", "constructor() {\n }", "constructor() {\n\t\t// ...\n\t}", "static get tag(){return\"hal-9000\"}", "static getDeviceModel() {\n return \"zhimi.fan.za4\";\n }", "requestContainerInfo() {}", "constructor () { super() }", "function BaseDeviceProfile() {\n \n this.audioNeedsTranscodingCodecs = []; // fill these with audio codecs that the implemented device can handle natively\n this.videoNeedsTranscodingCodecs = []; // fill these with video codecs that the implemented device can handle natively\n this.validFormats = []; // fill these with video formats that the implemented device can handle natively\n\n this.transcodeOptions = {\n rescaleVideo : false, // BaseDeviceProfile.prototype.rescale\n subtitle : false, // BaseDeviceProfile.prototype.hardCodeSubtitle\n audioShiftCorrect : false // BaseDeviceProfile.prototype.correctAudioOffset\n };\n\n /**\n * @todo: whutz this?\n * @param {[type]} probeData [description]\n * @return {[type]} [description]\n */\n this.canPlayContainer = function (probeData) {\n throw new Error(\"canPlayContainer : Not Implemented\");\n };\n\n /**\n * Implement this method to return device specific ffmpeg flags for a probed media\n * @param {object} probeData ffmpeg probe data\n * @param {[type]} forceTranscode force transcode even if native format?\n * @return {Promise} [description]\n */\n this.getFFmpegFlags = function (probeData, forceTranscode) {\n throw new Error(\"getFFmpegFlags : Not Implemented!\");\n };\n\n}", "static get STATUS() {\n return 0;\n }", "static create () {}", "get() {}", "didMount() {\n }", "_onMessage() {\n throw new Error(\"not implemented\");\n }", "onReady() {}", "native() {\n throw new Error('NOT_IMPLEMENTED_EXCEPTION: you must override this method in order to use it')\n }", "function sdk(){\n}", "constructor () {\r\n\t\t\r\n\t}", "transient private protected internal function m182() {}", "function version(){ return \"0.13.0\" }", "static getDeviceModel() {\n return \"zhimi.fan.za5\";\n }", "started () {}", "function getVersion(){return _VERSION}", "transient private internal function m185() {}", "constructor() {\r\n }", "started() { }", "InitVsaEngine() {\n\n }", "started() {\r\n\r\n\t}", "function SigV4Utils() { }", "static get NOT_READY () {return 0}", "started () {\n\n }", "started () {\n\n }", "started () {\n\n }", "initialize() {\n\n }", "onMessageReceive() {}", "initialize()\n {\n }", "_get () {\n throw new Error('_get not implemented')\n }", "get () {\n }", "constructor() { }", "constructor() { }", "constructor() { }", "constructor() { }", "constructor() { }", "constructor() { }", "constructor() { }", "constructor() { }", "constructor() { }", "constructor() { }", "constructor() { }", "started() {}", "started() {}", "started() {}", "started() {}", "started() {}", "started() {}", "started() {}", "started() {}", "started() {}", "started() {}", "heartbeat () {\n }", "function getImplementation( cb ){\n\n }", "constructor() {\n \n }", "constructor() {\n \n }", "constructor() {\n \n }", "constructor() {\n \n }", "constructor() {\n \n }", "constructor() {\n \n }", "constructor() {\n \n }", "constructor() {\n \n }", "constructor() {\n \n }", "constructor() {\n \n }", "constructor() {\n \n }", "constructor() {\n \n }", "constructor() {\n \n }", "constructor() {\n \n }", "constructor() {\n \n }", "constructor() {\n \n }", "constructor() {\n \n }", "constructor() {\n \n }", "constructor() {\n \n }", "constructor() {\n \n }", "initleancloud() {\n AV.init({\n appId: keys.appId,\n appKey: keys.appKey\n })\n this.globalData.AV = AV\n }", "static final private internal function m106() {}", "getStreamPosition() {\n return Native.getStreamPosition();\n }", "onMessage() {}", "onMessage() {}", "constructor() {\n super();\n this._logger = new pip_services3_components_node_3.CompositeLogger();\n this._connectionResolver = new connect_1.AwsConnectionResolver();\n this._connectTimeout = 30000;\n this._client = null; //AmazonCloudWatchClient\n this._opened = false;\n }", "get WSAPlayerX64() {}" ]
[ "0.53485686", "0.48948148", "0.485071", "0.48078835", "0.4771538", "0.4744391", "0.47347194", "0.47043997", "0.46918696", "0.46918696", "0.46722504", "0.4643159", "0.46377665", "0.46263066", "0.4617044", "0.45812133", "0.45800942", "0.4572664", "0.4568672", "0.4561345", "0.45550427", "0.45506856", "0.45487913", "0.45443627", "0.45359328", "0.45206392", "0.45171604", "0.44963515", "0.44938648", "0.44823992", "0.44715983", "0.44681743", "0.44645038", "0.44587672", "0.44556332", "0.44525576", "0.44520926", "0.4442707", "0.44377562", "0.44267556", "0.4424001", "0.4422522", "0.4407004", "0.4404617", "0.4404617", "0.4404617", "0.44027838", "0.4392654", "0.43752563", "0.43675107", "0.4362618", "0.4352252", "0.4352252", "0.4352252", "0.4352252", "0.4352252", "0.4352252", "0.4352252", "0.4352252", "0.4352252", "0.4352252", "0.4352252", "0.435136", "0.435136", "0.435136", "0.435136", "0.435136", "0.435136", "0.435136", "0.435136", "0.435136", "0.435136", "0.43502438", "0.4349698", "0.43483686", "0.43483686", "0.43483686", "0.43483686", "0.43483686", "0.43483686", "0.43483686", "0.43483686", "0.43483686", "0.43483686", "0.43483686", "0.43483686", "0.43483686", "0.43483686", "0.43483686", "0.43483686", "0.43483686", "0.43483686", "0.43483686", "0.43483686", "0.43443006", "0.43404052", "0.4338547", "0.43343374", "0.43343374", "0.43337205", "0.43325585" ]
0.0
-1
Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file distributed with this work for additional information regarding copyright ownership. The ASF licenses this file to you under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. Pick color from palette for each data item. Applicable for charts that require applying color palette in data level (like pie, funnel, chord).
function _default(seriesType) { return { getTargetSeries: function (ecModel) { // Pie and funnel may use diferrent scope var paletteScope = {}; var seiresModelMap = createHashMap(); ecModel.eachSeriesByType(seriesType, function (seriesModel) { seriesModel.__paletteScope = paletteScope; seiresModelMap.set(seriesModel.uid, seriesModel); }); return seiresModelMap; }, reset: function (seriesModel, ecModel) { var dataAll = seriesModel.getRawData(); var idxMap = {}; var data = seriesModel.getData(); data.each(function (idx) { var rawIdx = data.getRawIndex(idx); idxMap[rawIdx] = idx; }); dataAll.each(function (rawIdx) { var filteredIdx = idxMap[rawIdx]; // If series.itemStyle.normal.color is a function. itemVisual may be encoded var singleDataColor = filteredIdx != null && data.getItemVisual(filteredIdx, 'color', true); if (!singleDataColor) { // FIXME Performance var itemModel = dataAll.getItemModel(rawIdx); var color = itemModel.get('itemStyle.color') || seriesModel.getColorFromPalette(dataAll.getName(rawIdx) || rawIdx + '', seriesModel.__paletteScope, dataAll.count()); // Legend may use the visual info in data before processed dataAll.setItemVisual(rawIdx, 'color', color); // Data is not filtered if (filteredIdx != null) { data.setItemVisual(filteredIdx, 'color', color); } } else { // Set data all color for legend dataAll.setItemVisual(rawIdx, 'color', singleDataColor); } }); } }; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function pickColor(d, data, colorIds) {\n var candidateId;\n for (var i=0; i<colorIds.length; i++) {\n candidateId = colorIds[i];\n if (isAvailableColor(d, data, candidateId)) {\n return candidateId;\n }\n }\n return -1; // no colors are available\n }", "function randomColorFromPalette() { return palette[Math.floor(Math.random() * palette.length)][2]; }", "function interpolateColor(d) {\n\t\t\t\t\t\treturn d['mtd3-color'] ? d['mtd3-color'] : colorPalette(d);\n\t\t\t\t\t}", "function pickColorFromPalette(index) {\n const color = currentPalette[index];\n if (color === undefined) {\n console.log(\n `Color is undefined. You are currently using this palette:\\n${currentPalette}`\n );\n throw `color undefined`;\n return \"#FF55FF\";\n } else {\n return color;\n }\n}", "function getItemColor(d) {\n if (!(d.labels[0] in itemColorMap))\n itemColorMap[d.labels[0]] = colorScale(d.labels[0]);\n return itemColorMap[d.labels[0]];\n }", "function chartcolors (type) {\n\tswitch (type) {\n\t\tcase qojl_data:\n\t\t\treturn '#d66761';\n\t\t\tbreak;\n\t\tcase qutip_data:\n\t\t\treturn '#a87db6';\n\t\t\tbreak;\n\t\tcase qutipcython_data:\n\t\t\treturn '#666666';\n\t\t\tbreak;\n\t\tcase toolbox_data:\n\t\t\treturn '#6cac5b';\n\t\t\tbreak;\n\t}\n}", "function getPalette(data) {\n const rgbData = data.filter((_, i) => (i + 1) % 4 !== 0)\n const colors = palette(rgbData)\n const result = rgbToNum(colors)\n return result\n}", "function highcharts_color_set (base) {\n var colors = [];\n colors.push(Highcharts.Color(base).get());\n for (var i = 0; i < 9; i ++) {\n colors.push(Highcharts.Color(base).brighten((i - 3) / 14).get());\n }\n return colors;\n }", "colors(data) {\n let uniqueTypeNames = this.getUniqueNames(data)\n let colors = []\n\n for (var i = 0; i < uniqueTypeNames.length; i++) {\n let toTrim = uniqueTypeNames[i]\n let trimmedType = toTrim.replace(/\\s+/g, '')\n\n let color = this.props.data[0].styles[trimmedType][0].backgroundColor\n colors.push(color)\n }\n return colors\n }", "function getColor(d) {\n return d == 1 ? '#fec44f' :\n d == 2 ? '#41ab5d' :\n d == 3 ? '#e7298a' :\n d == 4 ? '#636363' :\n '#F2F0F7' ;\n }", "function getColor(d) {\n return barColor;\n }", "function getColor(d) {\n return d.length>1? \"#ffffff\" : \n d[0]==1 ? \"#FECE00\":\n d[0]==2 ? \"#0065AE\" :\n d[0]==\"3B\" ? \"#99D4DE\":\n d[0]==3 ? \"#9F971A\":\n d[0]==4 ?\"#BE418D\":\n d[0]==5 ? \"#F19043\":\n d[0]==6 ? \"#84C28E\":\n d[0]==7 ?\"#F2A4B7\":\n d[0]==\"7B\" ? \"#84C28E\":\n d[0]==8?\"#CDACCF\":\n d[0]==9? \"#D5C900\":\n d[0]==10?\"#E4B327\":\n d[0]==11?\"#8C5E24\" :\n d[0]==12?\"#007E49\":\n d[0]==13?\"#99D4DE\":\n d[0]==14?\"#622280\":\n '#FC4E2A';\n}", "function getColorsCreatePalette(){\n cp.$container.html(\" \");\n $.getJSON('/static/coloring/vendors/material/material-colors.json', function(colors){\n var keys = Object.keys(colors);\n for (var i = keys.length - 1; i >= 0; i--) {\n cp.options.push(colors[keys[i]][500]);\n }\n createColorPalette(cp.options);\n });\n }", "getColor(state) {\n return this.palette[state];\n }", "function mapColor(id,type) {\n var arrColors = guiData.colorPalette;\n var resColor = \"hsl(195, 100%, 35%)\";\n //console.log(emailDomains);\n //console.log(id);\n if (id != -1) {\n if (id < arrColors.length - 1) {\n resColor = arrColors[id];\n }else{\n resColor = arrColors[arrColors.length - 1];\n }\n }else{\n switch (type) {\n case 'node': resColor = arrColors[0]; break;\n case 'edge': resColor = arrColors[0];\n //\"rgba(0, 134, 179,0.5)\";\n //\"rgba(59, 124, 171, 0.42)\";\n break;\n }\n }\n return resColor;\n }", "function getColor(d){\n\n\t\t\tif(colCounter < data.length-1){\n\t\t\t\tcolCounter++;\n\t\t\t\treturn colDict[colIndex];\n\t\t\t}else{\n\t\t\t\tcolCounter = 0;\n\t\t\t\tcolIndex = colIndex + 1;\n\t\t\t\treturn colDict[colIndex-1];\n\t\t\t}\n\t\t}", "GetPalette(color) {\n const baseLight = tinyColor$2('#ffffff');\n const baseDark = this.utilsService.Multiply(tinyColor$2(color).toRgb(), tinyColor$2(color).toRgb());\n const [, , , baseTriad] = tinyColor$2(color).tetrad();\n const primary = Object.keys(ThemeBuilderConstants.MIX_AMOUNTS_PRIMARY)\n .map(k => {\n const [light, amount] = ThemeBuilderConstants.MIX_AMOUNTS_PRIMARY[k];\n return [k, tinyColor$2.mix(light ? baseLight : baseDark, tinyColor$2(color), amount)];\n });\n const accent = Object.keys(ThemeBuilderConstants.MIX_AMOUNTS_SECONDARY)\n .map(k => {\n const [amount, sat, light] = ThemeBuilderConstants.MIX_AMOUNTS_SECONDARY[k];\n return [k, tinyColor$2.mix(baseDark, baseTriad, amount)\n .saturate(sat).lighten(light)];\n });\n return [...primary, ...accent].reduce((acc, [k, c]) => {\n acc[k] = c.toHexString();\n return acc;\n }, {});\n }", "function mapColors(data) {\n let strValue = [];\n for (let i = 0; i < data.length; i ++){\n strValue.push(String(JSON.stringify(data[i]))); // particolare tipo di hashing \n }\n oScale.domain(strValue);\n}", "color(data) {\n\t\treturn d3\n\t\t\t.scaleLinear()\n\t\t\t.domain([0, Math.round(data.length / 2), data.length])\n\t\t\t.range(['#BBE4A0', '#52A8AF', '#00305C'])\n\t}", "function thisColor(i) { \n colors = ['#001f3f', '#0074D9', '#B10DC9', '#AAAAAA', '#39CCCC', '#FFDC00', '#FF851B', \n '#01FF70', '#F012BE', '#7FDBFF', '#3D9970', '#85144b', '#2ECC40', '##FF4136', '#F012BE', \n \"#3366cc\", \"#dc3912\", \"#ff9900\"];\n\n cc = d3.scaleLinear()\n .domain([-2, 17])\n .range([1, 0]);\n\n return d3.interpolateSpectral(cc(i));\n}", "colorsPie() {\n this.colorArray=[\"#CA6A63\", \"#A4C2C5\", \"#CE808E\", \"#C8D3A8\", \"#200E62\", \"#469343\", \"#6C1EE1\", \"#5de35e\", \"#ec9576\", \"#fa173a\", \"#6c7160\", \"#bc0d79\", \"#8fbab4\", \"#1d61d6\", \"#656234\", \"#2d04df\", \"#d16881\", \"#f9b799\", \"#595875\", \"#35644e\"];\n }", "getColors() {\n const d = this.items\n return Object.keys(d)\n .map(function (index) {\n if (\n (d[index].style && d[index].style.color !== undefined) ||\n (d[index].style && d[index].style.backgroundColor !== undefined)\n )\n return d[index].style.color || d[index].style.backgroundColor\n })\n .filter((notUndefined) => notUndefined !== undefined)\n }", "function mapColorToPalette(red,green,blue){\n var color,diffR,diffG,diffB,diffDistance,mappedColor;\n var distance=250000;\n for(var i=0;i<palette.length;i++){\n color=palette[i];\n diffR=( color.r - red );\n diffG=( color.g - green );\n diffB=( color.b - blue );\n diffDistance = diffR*diffR + diffG*diffG + diffB*diffB;\n if( diffDistance < distance ){\n distance=diffDistance;\n mappedColor=palette[i];\n };\n }\n return(mappedColor);\n }", "@autobind\n processColors(data) {\n var self = this;\n var colorsetindex = 0;\n var colorindex = 0;\n\n for (var i=0; i<data.colors.length; i++) {\n this.colors[i] = new Array();\n for (var a=0; a<4; a++) {\n this.colors[i][a] = new Array();\n }\n }\n\n data.colors.forEach(function(colset) {\n colorindex = 0;\n colset.colors.forEach(function(col){\n switch (col.label) {\n case \"red\":\n colorindex = 1;\n break;\n case \"green\":\n colorindex = 3;\n break;\n case \"blue\":\n colorindex = 0;\n break;\n case \"yellow\":\n colorindex = 2;\n break;\n }\n col.colors.forEach(function(color) {\n self.colors[colorsetindex][colorindex].push(self.hexToRgb(color));\n });\n });\n\n colorsetindex++;\n });\n }", "function getColor(d) {\r\n\t\t\treturn d > 611142 ? '#8A4E8A' :\r\n\t\t\t d > 509285 ? '#A05AA0' :\r\n\t\t\t d > 407428 ? '#B379B3' :\r\n\t\t\t d > 305571 ? '#C08FC0' :\r\n\t\t\t d > 203714 ? '#CCA5CC' :\r\n\t\t\t d > 101857 ? '#D8BBD8' :\r\n\t\t\t d > 0 ? '#F1E6F1' :\r\n\t\t\t '#FFFFFF';\r\n\t\t}", "function getColor(d) {\n\t\t\t\treturn d > 5515000 ? '#3B0B0B' :\n\t\t\t\t\t d > 5515000 ? '#3B0B0B' :\n\t\t\t\t\t d > 5515000 ? '#3B0B0B' :\n\t\t\t\t\t d > 5515000 ? '#3B0B0B' :\n\t\t\t\t\t d > 5515000 ? '#3B0B0B' :\n\t\t\t\t\t d > 5514999 ? '#2E64FE' :\n\t\t\t\t\t d > 5564048 ? '#3B0B0B' :\n\t\t\t\t\t\t\t\t '#3B0B0B';\n\t\t\t}", "get color(){\n return this.getPalette(this.currentColor);\n }", "function getColor(d){\n return d > 5 ? \"#a54500\":\n d > 4 ? \"#FF0000\":\n d > 3 ? \"#ff6f08\":\n d > 2 ? \"#ff9143\":\n d > 1 ? \"#ffb37e\":\n \"#ffcca5\";\n }", "function getColor(d) {\n return d >= legend5 ? color_map[5] :\n d >= legend4 ? color_map[4] :\n d >= legend3 ? color_map[3] :\n d >= legend2 ? color_map[2] :\n d >= legend1 ? color_map[1] :\n d >= legend0 ? color_map[0] :\n 'grey';\n }", "function colors() {\n \n\tmap.getLayer('countylayer').style('fill', function(data) {\n\t\tvar ddi = parseFloat(data.ddi);\n\t\tif (ddi <= 38.12357875) { //1st quartile\n\t\t\treturn \"#fef0d9\";\n\t\t} else if (ddi <= 50.8602104) {\n\t\t\treturn \"#fdcc8a\";\n\t\t} else if (ddi <= 64.03133336 ) {\n\t\t\treturn \"#fc8d59\";\n\t\t} else { //4th quartile\n\t\t\treturn \"#d7301f\";\n\t\t}\n\t});\n}", "generateColors(palette, allColorsFilterBy){\n let shades=[];\n let allColors = palette.colors;\n for(let key in allColors){\n shades = shades.concat(\n allColors[key].filter(colors =>(\n colors.id ===allColorsFilterBy\n ))\n )\n }\n //return all shades of given colors \n return shades.slice(1); \n }", "changeColor(color){\n this.panel.data[0].color = color;\n this.panel.hData[0].color = color;\n this.panel.dataPlus[0].color = color;\n this.panel.pieData[0].color = color;\n this.panel.options.series.gauges.threshold.values.forEach(function(value){\n value.color = color;\n })\n this.render();\n }", "get color() {\n return this._color ||\n (this.datepickerInput ? this.datepickerInput.getThemePalette() : undefined);\n }", "function setBarColors (d,i) {\n var colors = ['#64b5f6','#4dd0e1','#4fc3f7','#4db6ac','#0283AF','#7EBC89','#00187B'];\n return colors[i];\n}", "function getColor(d){\n if (d <= 1){return '#addd8e';}\n else if (d <= 2) {return '#fee391';}\n else if (d <= 3) {return '#feb24c';}\n else if (d <= 4) {return '#fd8d3c';}\n else if (d <= 5) {return '#f03b20';}\n else {return '#bd0026';}\n}", "get color() {\n return this._color ||\n (this._datepickerInput ? this._datepickerInput.getThemePalette() : undefined);\n }", "function getColorScheme(dropDownValue, largestValueInDataSet) {\n var colorMap = {\n \"AVG_CURRENT_AR_DELTA_MO\": getGreenAndRedColors(largestValueInDataSet),\n \"AVG_CURRENT_AR_DELTA_WK\": getGreenAndRedColors(largestValueInDataSet),\n \"AVG_CURRENT_AR\": getGreenColors(largestValueInDataSet),\n \"AVG_DBT\": getRedColors(largestValueInDataSet),\n \"AVG_CPR\": getRedColors(largestValueInDataSet),\n \"AVG_PCT_LATE\": getRedColors(largestValueInDataSet),\n \"INITIAL_CLAIMS\": getBlueColors(largestValueInDataSet),\n \"INSURED_UNEMPLOYMENT_RATE\": getBlueColors(largestValueInDataSet)\n };\n return colorMap[dropDownValue];\n}", "getDefaultColor() {\n return [0.69921875, 0.69921875, 0.69921875];\n }", "configColors(data) {\n const colors = {\n deaths: { \".3\": \"yellow\", \".4\": \"orange\", \"1\": \"red\" },\n kills: { \".3\": \"white\", \".4\": \"aqua\", \"1\": \"blue\" }\n };\n\n return colors[data];\n }", "function _getColors() {\n return [\n '#000000',\n '#AA0000',\n '#BB5500',\n '#DDDD00',\n '#00AA00'\n ];\n }", "function getColor(d) {\n\n return d < 1 ? 'rgb(85,255,51)' :\n\n d < 2 ? 'rgb(221,255,153)' :\n\n d < 3 ? 'rgb(255,230,102)' :\n\n d < 4 ? 'rgb(255,213,0)' :\n\n d < 5 ? 'rgb(255,179,25)' :\n\n d < 6 ? 'rgb(255,140,25)' :\n 'rgb(255,77,77)';\n}", "function getColor(d) {\n/*\t\t\treturn d > 600 ? '#d98472' :\n\t\t\t\t d > 304 ? '#e4b76e' :\n\t\t\t '#bcc64d';*/\n\t\t\treturn d > 600 ? '#ca6554' :\n\t\t\t\t d > 304 ? '#d6877a' :\n\t\t\t '#e7bab3';\n\t\t}", "function ColorIntensityPalette() {\n this.positive = [255, 0, 0];\n this.neutral = [200, 200, 200];\n this.negative = [0, 93, 144];\n\n this.rgb = function(color) {\n rgb = \"rgb(\" + \n color[0] + \",\" +\n color[1] + \",\" +\n color[2] + \")\";\n return rgb;\n }\n\n this.str = function(intensity) {\n if (intensity > 0) {\n var top_color = this.positive;\n } else {\n var top_color = this.negative;\n intensity = -intensity;\n }\n\n s = \"rgb(\";\n for (var i=0; i<3; i++) {\n diff = top_color[i] - this.neutral[i];\n s += Math.floor(this.neutral[i] + diff*intensity);\n if (i < 2) {\n s += \",\"\n }\n }\n s += \")\"\n return s;\n }\n}", "function getColor(d) {\n return d >= 15 ? '#9932cc' :\n d >= 14 ? '#cb2e8f' :\n d >= 13 ? '#e03d6a' :\n d >= 12 ? '#ed5052' :\n d >= 11 ? '#f5653f' :\n d >= 10 ? '#fa7930' :\n d >= 9 ? '#fe8c22' :\n d >= 8 ? '#ffa015' :\n d >= 7 ? '#ffb307' :\n d >= 6 ? '#ffc500' :\n d >= 5 ? '#ffd700' :\n \"#90ee90\";\n }", "function _default(seriesType, ecModel) {\n // Pie and funnel may use diferrent scope\n var paletteScope = {};\n ecModel.eachRawSeriesByType(seriesType, function (seriesModel) {\n var dataAll = seriesModel.getRawData();\n var idxMap = {};\n\n if (!ecModel.isSeriesFiltered(seriesModel)) {\n var data = seriesModel.getData();\n data.each(function (idx) {\n var rawIdx = data.getRawIndex(idx);\n idxMap[rawIdx] = idx;\n });\n dataAll.each(function (rawIdx) {\n var filteredIdx = idxMap[rawIdx]; // If series.itemStyle.normal.color is a function. itemVisual may be encoded\n\n var singleDataColor = filteredIdx != null && data.getItemVisual(filteredIdx, 'color', true);\n\n if (!singleDataColor) {\n // FIXME Performance\n var itemModel = dataAll.getItemModel(rawIdx);\n var color = itemModel.get('itemStyle.normal.color') || seriesModel.getColorFromPalette(dataAll.getName(rawIdx), paletteScope); // Legend may use the visual info in data before processed\n\n dataAll.setItemVisual(rawIdx, 'color', color); // Data is not filtered\n\n if (filteredIdx != null) {\n data.setItemVisual(filteredIdx, 'color', color);\n }\n } else {\n // Set data all color for legend\n dataAll.setItemVisual(rawIdx, 'color', singleDataColor);\n }\n });\n }\n });\n}", "function _default(seriesType, ecModel) {\n // Pie and funnel may use diferrent scope\n var paletteScope = {};\n ecModel.eachRawSeriesByType(seriesType, function (seriesModel) {\n var dataAll = seriesModel.getRawData();\n var idxMap = {};\n\n if (!ecModel.isSeriesFiltered(seriesModel)) {\n var data = seriesModel.getData();\n data.each(function (idx) {\n var rawIdx = data.getRawIndex(idx);\n idxMap[rawIdx] = idx;\n });\n dataAll.each(function (rawIdx) {\n var filteredIdx = idxMap[rawIdx]; // If series.itemStyle.normal.color is a function. itemVisual may be encoded\n\n var singleDataColor = filteredIdx != null && data.getItemVisual(filteredIdx, 'color', true);\n\n if (!singleDataColor) {\n // FIXME Performance\n var itemModel = dataAll.getItemModel(rawIdx);\n var color = itemModel.get('itemStyle.normal.color') || seriesModel.getColorFromPalette(dataAll.getName(rawIdx), paletteScope); // Legend may use the visual info in data before processed\n\n dataAll.setItemVisual(rawIdx, 'color', color); // Data is not filtered\n\n if (filteredIdx != null) {\n data.setItemVisual(filteredIdx, 'color', color);\n }\n } else {\n // Set data all color for legend\n dataAll.setItemVisual(rawIdx, 'color', singleDataColor);\n }\n });\n }\n });\n}", "function _default(seriesType, ecModel) {\n // Pie and funnel may use diferrent scope\n var paletteScope = {};\n ecModel.eachRawSeriesByType(seriesType, function (seriesModel) {\n var dataAll = seriesModel.getRawData();\n var idxMap = {};\n\n if (!ecModel.isSeriesFiltered(seriesModel)) {\n var data = seriesModel.getData();\n data.each(function (idx) {\n var rawIdx = data.getRawIndex(idx);\n idxMap[rawIdx] = idx;\n });\n dataAll.each(function (rawIdx) {\n var filteredIdx = idxMap[rawIdx]; // If series.itemStyle.normal.color is a function. itemVisual may be encoded\n\n var singleDataColor = filteredIdx != null && data.getItemVisual(filteredIdx, 'color', true);\n\n if (!singleDataColor) {\n // FIXME Performance\n var itemModel = dataAll.getItemModel(rawIdx);\n var color = itemModel.get('itemStyle.normal.color') || seriesModel.getColorFromPalette(dataAll.getName(rawIdx), paletteScope); // Legend may use the visual info in data before processed\n\n dataAll.setItemVisual(rawIdx, 'color', color); // Data is not filtered\n\n if (filteredIdx != null) {\n data.setItemVisual(filteredIdx, 'color', color);\n }\n } else {\n // Set data all color for legend\n dataAll.setItemVisual(rawIdx, 'color', singleDataColor);\n }\n });\n }\n });\n}", "function GetColorList() {\n // return ['#4e73df', '#1cc88a', '#36b9cc', '#e74a3b', '#e67e22', '#f6c23e', '#9b59b6', '#1abc9c', '#2ecc71', '#3498db'];\n return ['#1abc9c', '#2ecc71', '#3498db', '#9b59b6', '#34495e', '#16a085', '#27ae60', '#2980b9', '#8e44ad', '#2c3e50'];\n}", "function getColor(d) {\n return d >= 15 ? '#9932cc' :\n d >= 14 ? '#cb2e8f' :\n d >= 13 ? '#e03d6a' :\n d >= 12 ? '#ed5052' :\n d >= 11 ? '#f5653f' :\n d >= 10 ? '#fa7930' :\n d >= 9 ? '#fe8c22' :\n d >= 8 ? '#ffa015' :\n d >= 7 ? '#ffb307' :\n d >= 6 ? '#ffc500' :\n d >= 5 ? '#ffd700' :\n \"#90ee90\";\n }", "setColors() {\n this.colors = new _swimlane_ngx_charts__WEBPACK_IMPORTED_MODULE_2__[\"ColorHelper\"](this.scheme, 'ordinal', this.seriesDomain, this.customColors);\n }", "function getGreenAndRedColors(largestValueInDataSet) {\n var colorDomain = [\n -1*largestValueInDataSet,\n -.9*largestValueInDataSet,\n -.8*largestValueInDataSet,\n -.7*largestValueInDataSet,\n -.6*largestValueInDataSet,\n -.5*largestValueInDataSet,\n -.4*largestValueInDataSet,\n -.3*largestValueInDataSet,\n -.2*largestValueInDataSet, \n -.1*largestValueInDataSet, \n .0*largestValueInDataSet, \n .1*largestValueInDataSet, \n .2*largestValueInDataSet, \n .3*largestValueInDataSet, \n .4*largestValueInDataSet, \n .5*largestValueInDataSet, \n .6*largestValueInDataSet, \n .7*largestValueInDataSet, \n .8*largestValueInDataSet, \n .9*largestValueInDataSet, \n 1*largestValueInDataSet\n ]\n var colorRange = [\n \"#fcfcfc\",\n \"#ff1919\",\n \"#ff3232\",\n \"#ff4c4c\",\n \"#ff6666\",\n \"#ff7f7f\",\n \"#ff9999\",\n \"#ffb2b2\",\n \"#ffcccc\",\n \"#ffe5e5\",\n \"#d0d6cd\",\n \"#bdc9be\",\n \"#aabdaf\",\n \"#97b0a0\",\n \"#84a491\",\n \"#719782\",\n \"#5e8b73\",\n \"#4b7e64\",\n \"#387255\",\n \"#256546\",\n \"#125937\",\n \"#004d28\",\n \"#004524\"\n ];\n return [colorDomain, colorRange];\n}", "function getColorsCreatePalette(){\n\t\tcp.$container.html(\" \");\n\t\t$.getJSON('/static/coloring/colors.json', function(colors){\n\t\t\tvar keys = Object.keys(colors);\n\t\t\tfor (var i = keys.length - 1; i >= 0; i--) {\n\t\t\t\tcp.options.push(colors[keys[i]]);\n\t\t\t}\n\t\t\tcreateColorPalette(cp.options);\n\t\t});\n\t}", "function getColor(colorId) {\n return service.colors[colorId % service.colors.length];\n }", "function color(d) {\n return '#2960b5'\n }", "function assign_Random_Color(layers) {\r\n let res = Palettes.slice(0)\r\n if (layers.length < res.length) {\r\n res = d3.shuffle(res).slice(0, layers.length)\r\n } else {\r\n while (res.length < layers.length) {\r\n res = res.concat(d3.shuffle(Palettes))\r\n }\r\n res = d3.shuffle(res.slice(0, layers.length))\r\n }\r\n layers = layers.map((d, i) => {\r\n d.fillcolor = res[i]\r\n return d\r\n })\r\n return layers\r\n}", "function onGetPNGPalette() {\r\n \r\n}", "function getColor(d) {\n\n\t\tswitch (valueType) {\n\t\tcase \"percent\":\n\t\t\treturn d > 500 ? colours[6] :\n\t\t\td > 200 ? colours[5] :\n\t\t\td > 100 ? colours[4] :\n\t\t\td > 50 ? colours[3] :\n\t\t\td > 25 ? colours[2] :\n\t\t\td > 0 ? colours[1] :\n\t\t\t colours[0];\n\t\t\tbreak;\n\t\tcase \"difference\":\n\t\t zoomDiff = 11 - zoomLevel;\n\t\t if (zoomDiff > 0) {\n d = d / Math.pow(4, zoomDiff)\n\t\t }\n\n\t\t\treturn d > 500 ? colours[6] :\n\t\t\td > 200 ? colours[5] :\n\t\t\td > 100 ? colours[4] :\n\t\t\td > 50 ? colours[3] :\n\t\t\td > 25 ? colours[2] :\n\t\t\td > 0 ? colours[1] :\n\t\t\t colours[0];\n\t\t\tbreak;\n\t\tdefault:\n\t\t\treturn d > 500 ? colours[6] :\n\t\t\td > 200 ? colours[5] :\n\t\t\td > 100 ? colours[4] :\n\t\t\td > 50 ? colours[3] :\n\t\t\td > 25 ? colours[2] :\n\t\t\td > 0 ? colours[1] :\n\t\t\t colours[0];\n\t\t}\n\t}", "function getColor(name) {\n\td = {\"Conservative\": \"#00F\", \"Labour\": \"#F00\", \"Liberal Democrat\": \"#FC0\", \"UKIP\": \"#B3009D\", \"Green Party\": \"#0F0\", \"Scottish National Party\": \"#FF0\", \"Plaid Cymru\": \"#6C3\", \"Democratic Unionist Party\": \"#C30\", \"Ulster Unionist Party\": \"#99F\", \"Sinn Fein\": \"#060;\", \"Social Democratic & Labour Party\": \"#3C3\"};\n\tif (name in d) {\n\t\treturn d[name];\n\t} else {\n\t\treturn \"#C0C0C0\";\n\t}\n}", "function generateColors() {\n var colors = defaultColors.slice();\n var customColors = Fliplet.Themes && Fliplet.Themes.Current.getSettingsForWidgetInstance(chartUuid);\n\n if (!Fliplet.Themes) {\n return colors;\n }\n\n colors.forEach(function(defaultColor, index) {\n var colorKey = 'chartColor' + (index + 1);\n var newColor = customColors\n ? customColors.values[colorKey]\n : Fliplet.Themes.Current.get(colorKey);\n\n if (themeValues && !customColors) {\n newColor = themeValues[colorKey];\n }\n\n if (newColor) {\n colors[index] = newColor;\n inheritColor1 = colorKey !== 'chartColor1';\n inheritColor2 = colorKey !== 'chartColor2';\n } else if (Fliplet.Themes.Current.get(colorKey)) {\n colors[index] = Fliplet.Themes.Current.get(colorKey);\n }\n\n if (colorKey === 'chartColor1' && inheritColor1) {\n colors[index] = getThemeColor('highlightColor', newColor, index, colorKey);\n } else if (colorKey === 'chartColor2' && inheritColor2) {\n colors[index] = getThemeColor('secondaryColor', newColor, index, colorKey);\n }\n });\n\n return colors;\n }", "function getColor(d) {\n\treturn d >= 5 ? \"rgb(240, 107, 107)\" :\n\t\t\t\t\td >= 4 ? \"rgb(240, 167, 107)\" :\n\t\t\t\t\td >= 3 ? \"rgb(243, 186, 77)\" :\n\t\t\t\t\td >= 2 ? \"rgb(243, 219, 77)\" :\n\t\t\t\t\td >= 1 ? \"rgb(225, 243, 77)\" :\n\t\t\t\t\t\t\t\t\t\t\"rgb(183, 243, 77)\";\n}", "function mix_colors(d) {\n var value = d.target.value;\n var sum = d3.sum(value);\n var col = d3.rgb(0, 0, 0);\n value.forEach(function(val, i) {\n var label_color = d3.rgb(color_map(i));\n var mix_coef = val / sum;\n col.r += mix_coef * label_color.r;\n col.g += mix_coef * label_color.g;\n col.b += mix_coef * label_color.b;\n });\n return col;\n}", "function genColor(seed) {\n const CHART_COLOURS = [\n 'rgba(255,0,0,0.66)',\n 'rgba(255,128,0,0.66)',\n 'rgba(255,255,0,0.62)',\n 'rgba(128,255,0,0.6)',\n 'rgba(0,255,255,0.47)',\n 'rgba(0,64,255,0.5)',\n 'rgba(191,0,255,0.53)'];\n if (seed < CHART_COLOURS.length) {\n return CHART_COLOURS[seed];\n } else {\n return '#000000';\n }\n}", "function getColor31(d){\n return d> 3000 ? '#355C7D':\n d> 535 ? '#6C5B7B':\n d> 103 ? '#C06C84':\n d> 22 ? '#F67280':\n '#F8B195';\n\n}", "function getColor(d) {\n\n\t\t\t //example logic to get color based on number\n\t\t\t return d > .25 ? colors.red :\n\t\t\t \t\td > .20 ? colors.tangerine :\n\t\t\t \t\td > .15 ? colors.orange :\n\t\t\t \t\td > .125 ? colors.yellow :\n\t\t\t\t\td > 0 ? colors.dkgreen :\n\t\t\t\t \tcolors.brown;\n\n\t\t\t\t\t \n\t\t\t\t\t // example logic to get color based on string\n\t\t\t\t\t // (d == 'dropped' ? colors.green :\n\t\t\t\t\t // d == 'new' ? colors.red :\n\t\t\t\t\t // colors.maroon)\n\t\t\t\t\t\t \n\t\t\t\t\t }", "getColor() {\n if (this.type == 'home' || this.type == 'goal') {\n return ['#B5FEB4', '#B5FEB4'];\n }\n\n else if (this.type == 'board') {\n return ['#F7F7FF', '#E6E6FF'];\n }\n\n else if (this.type == 'back'){\n return ['#B4B5FE', '#B4B5FE'];\n }\n }", "colors() {\n return ['#B1BCBC', '#3ACF80', '#70F2F2', '#B3F2C9', '#528C18', '#C3F25C']\n }", "function getColor(d) {\n\n return d > 0.9 ? colours[9]:\n d > 0.8 ? colours[8]:\n d > 0.7 ? colours[7]:\n d > 0.6 ? colours[6]:\n d > 0.5 ? colours[5]:\n d > 0.4 ? colours[4]:\n d > 0.3 ? colours[3]:\n d > 0.2 ? colours[2]:\n d > 0.1 ? colours[1]:\n colours[0];\n}", "function getColor(){\n //var colors = [ \"rgba(237, 106, 90, 1)\", \"rgba(247, 244, 205, 1)\", \"rgba(155, 193, 188, 1)\", \"rgba(92, 164, 169, 1)\", \"rgba(230, 235, 224, 1)\"];\n var colors = cscheme;\n\n //generates random n to select a color from the array above\n //if new color (colors[n]) is equal to last color selected, it loops again to not repeat colors\n do{\n n = Math.floor(Math.random() * colors.length);\n }while( colors[n] === color );\n\n return colors[n];\n }", "paintFill(prop) {\r\n let fillColorArray = [\r\n 'step',\r\n ['get', prop.key]\r\n ];\r\n\r\n prop.colorScale.map((color, index) => {\r\n if (index > 0) {\r\n fillColorArray.push(prop.step[index]) \r\n }\r\n\r\n fillColorArray.push(color);\r\n })\r\n\r\n return fillColorArray;\r\n }", "decideColors() {\n return ([\n // team colors\n DeepSpaceGame.colorCombinations.get(this.gameVars.setupData.teams.length).sample().shuffle(),\n\n // light shading\n LIGHT.randomDraw()\n ]);\n }", "function fittsColors() {\n let colors;\n\n colors = d3.schemeSet1;\n\n colors.target = colors[5];\n colors.distance = colors[1];\n colors.width = colors[0];\n colors.indexOfDifficulty = colors[4];\n colors.logarithm = colors[2];\n colors.hotspot = colors[4];\n colors.pointer = colors[7];\n colors.ratio = colors[3];\n colors.design = colors[8];\n\n return colors;\n}", "function getBlueColors(largestValueInDataSet) {\n var colorDomain = [\n .0*largestValueInDataSet, \n .1*largestValueInDataSet, \n .2*largestValueInDataSet, \n .3*largestValueInDataSet, \n .4*largestValueInDataSet, \n .5*largestValueInDataSet, \n .6*largestValueInDataSet, \n .7*largestValueInDataSet, \n .8*largestValueInDataSet, \n .9*largestValueInDataSet, \n 1*largestValueInDataSet\n ]\n var colorRange = [\n \"#fcfcfc\",\n \"#ebecf3\",\n \"#d8d9e7\",\n \"#c4c6dc\",\n \"#b1b4d0\",\n \"#9ea1c5\",\n \"#8a8eb9\",\n \"#777cad\",\n \"#6369a2\",\n \"#505696\",\n \"#484d87\",\n \"#404579\"\n ];\n return [colorDomain, colorRange];\n}", "getColor(i) {\n switch(i) {\n case 1:\n return 'blue';\n case 2:\n return 'red';\n case 3:\n return 'yellow';\n default:\n return 'grey';\n }\n }", "function getColor(d) {\n return d < 1 ? '#fef0d9' :\n d < 2 ? '#fdcc8a' :\n d < 3 ? '#fc8d59' :\n d < 4 ? '#e34a33' :\n d < 5 ? '#b30000' :\n '#800026';\n}", "function getColor() {\n let hue = Math.floor(Math.random() * amountOfColors) * (360 / amountOfColors);\n return `hsl(${hue}, 90%, 50%)`;\n }", "_mapDataToColors() {\n // switch rendering destination to our framebuffer\n twgl.bindFramebufferInfo(this._gl, this._framebuffers.gridded);\n\n glDraw(this._gl, this._programs.colormap, this._buffers.colormap, {\n u_data: this._textures.data,\n u_colormap: this._textures.colormap,\n u_colormapN: this._colormap.lut.length,\n u_domain: this._domain,\n u_scale: this._scale === 'log' ? 1 : 0,\n u_baseColor: this._baseColor.map((v, i) => i === 3 ? v : v / 255),\n });\n\n // switch rendering destination back to canvas\n twgl.bindFramebufferInfo(this._gl, null);\n }", "function _default(ecModel) {\n var paletteScope = {};\n ecModel.eachSeriesByType('graph', function (seriesModel) {\n var categoriesData = seriesModel.getCategoriesData();\n var data = seriesModel.getData();\n var categoryNameIdxMap = {};\n categoriesData.each(function (idx) {\n var name = categoriesData.getName(idx); // Add prefix to avoid conflict with Object.prototype.\n\n categoryNameIdxMap['ec-' + name] = idx;\n var itemModel = categoriesData.getItemModel(idx);\n var color = itemModel.get('itemStyle.color') || seriesModel.getColorFromPalette(name, paletteScope);\n categoriesData.setItemVisual(idx, 'color', color);\n }); // Assign category color to visual\n\n if (categoriesData.count()) {\n data.each(function (idx) {\n var model = data.getItemModel(idx);\n var category = model.getShallow('category');\n\n if (category != null) {\n if (typeof category === 'string') {\n category = categoryNameIdxMap['ec-' + category];\n }\n\n if (!data.getItemVisual(idx, 'color', true)) {\n data.setItemVisual(idx, 'color', categoriesData.getItemVisual(category, 'color'));\n }\n }\n });\n }\n });\n}", "function getColor1(d){\n return d> 200 ? '#355C7D':\n d> 120 ? '#6C5B7B':\n d> 80 ? '#C06C84':\n d> 40 ? '#F67280':\n '#F8B195';\n }", "function getColor(d) {\n return d > 5 ? 'rgb(240,107,107)' :\n d > 4 ? 'rgb(240,167,107)' :\n d > 3 ? 'rgb(243,186,77)' :\n d > 2 ? 'rgb(243,219,77)' :\n d > 1 ? 'rgb(225,243,77)' :\n 'rgb(183,243,77)';\n}", "generateColors(itemCount) {\r\n let colors = [];\r\n let number = Math.round(360 / itemCount);\r\n //this loop splits the colour spectrum evenly and gives each\r\n //div a colour so that when in order, they resemble the colour spectrum\r\n for (let i = 0; i < itemCount; i++) {\r\n let color = chroma(\"#ff0000\");\r\n colors.push(color.set(\"hsl.h\", i * number));\r\n }\r\n return colors;\r\n }", "function getColor(d) {\n return d > 5 ? '#f45f42' :\n d > 4 ? '#f48641' :\n d > 3 ? '#f49a41' :\n d > 2 ? '#f4cd41' :\n d > 1 ? '#f4f141' :\n '#97f441';\n}", "function chooseColor() {\n const colorPalette = [\n \"#ffb25d\",\n \"#21f3c5\",\n \"#217bf3\",\n \"#ecf321\",\n \"#f32192\",\n \"#a621f3\",\n ];\n\n let index = Math.floor(Math.random() * 6);\n let color = colorPalette[index];\n return color;\n }", "styler(d) {\n const stroke = (d.id === this.state.selected) ? 'red' : 'white';\n return {\n fill: this.colorScale(this.valueAccessor(d)),\n stroke: stroke\n };\n }", "function getColor(d) {\n\t\treturn d > 5550000 ? '#800026' :\n\t\t\t d > 5555000 ? '#BD0026' :\n\t\t\t d > 5560000 ? '#E31A1C' :\n\t\t\t d > 5556500 ? '#FC4E2A' :\n\t\t\t d > 5570000 ? '#FD8D3C' :\n\t\t\t d > 5575000 ? '#FEB24C' :\n\t\t\t d > 5580000 ? '#FED976' :\n\t\t\t\t\t\t\t '#FFEDA0';\n\t}", "function loadPalette(palette_name) {\n if (palette_name == 'violent_red') {\n palette = violent_red\n } else if (palette_name == 'garden_green') {\n palette = garden_green\n } else if (palette_name == 'whites') {\n palette = whites\n } else if (palette_name == 'red_white') {\n palette = red_white\n } else if (palette_name == 'bella_pink') {\n palette = bella_pink\n }\n\n return palette\n}", "function colorOptions (dificuldade) {\n\tfor (var i = 0 ; i<dificuldade;i++){\n\t\tcolorPick = colorGeneration();\n\t\tcolors[i].style.background = \"rgb(\"+colorPick[0]+\", \"+colorPick[1]+\", \"+colorPick[2]+\")\";\n\t}\n\tfor (var j = dificuldade; j< colors.length; j++){\n\t\tcolors[j].style.background = \"#232323\";\n\t}\n}", "set color(value) {}", "function assignColor(dataArray) {\n\n dict = {};\n\n for (var i = 0; i < dataArray.length; i++) {\n dict[dataArray[i]] = getRandomColor();\n }\n\n return dict;\n}", "function getColor(color)\n{\n\tcolorCode = color.selectedIndex;\n}", "_setItemColor() {\n const that = this,\n label = that.querySelector('.jqx-content-label'),\n color = /(^#[0-9A-F]{3}$)|(^#[0-9A-F]{6}$)|(^#[0-9A-F]{8}$)/i.test(that.color) ? that.color : ''; //HEX check\n\n label.style.backgroundColor = color;\n label.style.color = that._getContrastColor(color);\n }", "function colorOf(idx) {\n return colors[idx] || \"#000\";\n }", "function Palette(name, colors) {\n this.name = name;\n this.colors = colors;\n }", "getColor() {\n const result = ColorPicker.colors[this.index];\n this.index++;\n this.index %= ColorPicker.colors.length;\n return result;\n }", "function getRedColors(largestValueInDataSet) {\n var colorDomain = [\n .0*largestValueInDataSet, \n .1*largestValueInDataSet, \n .2*largestValueInDataSet, \n .3*largestValueInDataSet, \n .4*largestValueInDataSet, \n .5*largestValueInDataSet, \n .6*largestValueInDataSet, \n .7*largestValueInDataSet, \n .8*largestValueInDataSet, \n .9*largestValueInDataSet, \n 1*largestValueInDataSet\n ]\n var colorRange = [\n \"#fcfcfc\",\n \"#ffe5e5\",\n \"#ffcccc\",\n \"#ffb2b2\",\n \"#ff9999\",\n \"#ff7f7f\",\n \"#ff6666\",\n \"#ff4c4c\",\n \"#ff3232\",\n \"#ff1919\",\n \"#e51616\",\n \"#ce1313\"\n ];\n return [colorDomain, colorRange];\n}", "function getColor(d) {\n \n if (d > 800000.00) {\n return 'seagreen';\n } else if ( d > 700000.00 ){\n return 'orange';\n } else if (d > 600000.00) {\n return 'red' ;\n } else if (d > 500000.00) {\n return 'brown' ;\n } else if (d > 400000.00) {\n return 'lavender'; \n } else if (d > 300000.00) {\n return 'yellow'; \n } else if (d > 150000.00) {\n return 'pink';\n } else if (d > 100000.00) {\n return 'aqua';\n } else if (d > 50000.00) {\n return 'coral';\n } else {\n return 'slategrey';\n } \n}", "function sanitizePalette(palette,name){var defaultContrast=palette.contrastDefaultColor;var lightColors=palette.contrastLightColors||[];var strongLightColors=palette.contrastStrongLightColors||[];var darkColors=palette.contrastDarkColors||[];// These colors are provided as space-separated lists\n\tif(typeof lightColors==='string')lightColors=lightColors.split(' ');if(typeof strongLightColors==='string')strongLightColors=strongLightColors.split(' ');if(typeof darkColors==='string')darkColors=darkColors.split(' ');// Cleanup after ourselves\n\tdelete palette.contrastDefaultColor;delete palette.contrastLightColors;delete palette.contrastStrongLightColors;delete palette.contrastDarkColors;// Change { 'A100': '#fffeee' } to { 'A100': { value: '#fffeee', contrast:DARK_CONTRAST_COLOR }\n\tangular.forEach(palette,function(hueValue,hueName){if(angular.isObject(hueValue))return;// Already converted\n\t// Map everything to rgb colors\n\tvar rgbValue=colorToRgbaArray(hueValue);if(!rgbValue){throw new Error(\"Color %1, in palette %2's hue %3, is invalid. Hex or rgb(a) color expected.\".replace('%1',hueValue).replace('%2',palette.name).replace('%3',hueName));}palette[hueName]={hex:palette[hueName],value:rgbValue,contrast:getContrastColor()};function getContrastColor(){if(defaultContrast==='light'){if(darkColors.indexOf(hueName)>-1){return DARK_CONTRAST_COLOR;}else{return strongLightColors.indexOf(hueName)>-1?STRONG_LIGHT_CONTRAST_COLOR:LIGHT_CONTRAST_COLOR;}}else{if(lightColors.indexOf(hueName)>-1){return strongLightColors.indexOf(hueName)>-1?STRONG_LIGHT_CONTRAST_COLOR:LIGHT_CONTRAST_COLOR;}else{return DARK_CONTRAST_COLOR;}}}});}", "function _default(seriesType) {\n return {\n getTargetSeries: function (ecModel) {\n // Pie and funnel may use diferrent scope\n var paletteScope = {};\n var seiresModelMap = createHashMap();\n ecModel.eachSeriesByType(seriesType, function (seriesModel) {\n seriesModel.__paletteScope = paletteScope;\n seiresModelMap.set(seriesModel.uid, seriesModel);\n });\n return seiresModelMap;\n },\n reset: function (seriesModel, ecModel) {\n var dataAll = seriesModel.getRawData();\n var idxMap = {};\n var data = seriesModel.getData();\n data.each(function (idx) {\n var rawIdx = data.getRawIndex(idx);\n idxMap[rawIdx] = idx;\n });\n dataAll.each(function (rawIdx) {\n var filteredIdx = idxMap[rawIdx]; // If series.itemStyle.normal.color is a function. itemVisual may be encoded\n\n var singleDataColor = filteredIdx != null && data.getItemVisual(filteredIdx, 'color', true);\n var singleDataBorderColor = filteredIdx != null && data.getItemVisual(filteredIdx, 'borderColor', true);\n var itemModel;\n\n if (!singleDataColor || !singleDataBorderColor) {\n // FIXME Performance\n itemModel = dataAll.getItemModel(rawIdx);\n }\n\n if (!singleDataColor) {\n var color = itemModel.get('itemStyle.color') || seriesModel.getColorFromPalette(dataAll.getName(rawIdx) || rawIdx + '', seriesModel.__paletteScope, dataAll.count()); // Data is not filtered\n\n if (filteredIdx != null) {\n data.setItemVisual(filteredIdx, 'color', color);\n }\n }\n\n if (!singleDataBorderColor) {\n var borderColor = itemModel.get('itemStyle.borderColor'); // Data is not filtered\n\n if (filteredIdx != null) {\n data.setItemVisual(filteredIdx, 'borderColor', borderColor);\n }\n }\n });\n }\n };\n}", "function _default(seriesType) {\n return {\n getTargetSeries: function (ecModel) {\n // Pie and funnel may use diferrent scope\n var paletteScope = {};\n var seiresModelMap = createHashMap();\n ecModel.eachSeriesByType(seriesType, function (seriesModel) {\n seriesModel.__paletteScope = paletteScope;\n seiresModelMap.set(seriesModel.uid, seriesModel);\n });\n return seiresModelMap;\n },\n reset: function (seriesModel, ecModel) {\n var dataAll = seriesModel.getRawData();\n var idxMap = {};\n var data = seriesModel.getData();\n data.each(function (idx) {\n var rawIdx = data.getRawIndex(idx);\n idxMap[rawIdx] = idx;\n });\n dataAll.each(function (rawIdx) {\n var filteredIdx = idxMap[rawIdx]; // If series.itemStyle.normal.color is a function. itemVisual may be encoded\n\n var singleDataColor = filteredIdx != null && data.getItemVisual(filteredIdx, 'color', true);\n var singleDataBorderColor = filteredIdx != null && data.getItemVisual(filteredIdx, 'borderColor', true);\n var itemModel;\n\n if (!singleDataColor || !singleDataBorderColor) {\n // FIXME Performance\n itemModel = dataAll.getItemModel(rawIdx);\n }\n\n if (!singleDataColor) {\n var color = itemModel.get('itemStyle.color') || seriesModel.getColorFromPalette(dataAll.getName(rawIdx) || rawIdx + '', seriesModel.__paletteScope, dataAll.count()); // Data is not filtered\n\n if (filteredIdx != null) {\n data.setItemVisual(filteredIdx, 'color', color);\n }\n }\n\n if (!singleDataBorderColor) {\n var borderColor = itemModel.get('itemStyle.borderColor'); // Data is not filtered\n\n if (filteredIdx != null) {\n data.setItemVisual(filteredIdx, 'borderColor', borderColor);\n }\n }\n });\n }\n };\n}", "function getColor(d){\n return d > 5 ? \"darkred\":\n d > 4 ? \"darkorange\":\n d > 3 ? \"orange\":\n d > 2 ? \"yellow\":\n d > 1 ? \"yellowgreen\":\n \"green\";\n }", "function getColor(d) {\n return d > 5 ? '#ff0000' :\n d > 4 ? '#ff5900' :\n d > 3 ? '#ee9c00' :\n d > 2 ? '#eecc00' :\n d > 1 ? '#d4ee00' :\n '#98ee00';\n }", "function getColor(d){\n if(d<10){\n return \"#ffffb2\"\n } else if (d > 10 && d < 20 ){\n return \"#fed976\"\n } else if (d > 20 && d < 50){\n return \"#feb24c\"\n } else if (d > 50 && d < 100){\n return \"#fd8d3c\"\n } else if (d > 100 && d < 200){\n return \"#fc4e2a\"\n } else if (d > 200 && d < 300){\n return \"#e31a1c\"\n } else if (d > 300 && d < 450){\n return \"#b10026\"\n } else {\n return \"blue\"\n };\n}" ]
[ "0.643499", "0.642668", "0.63656324", "0.63511217", "0.6295097", "0.61797124", "0.6169629", "0.6081259", "0.60623425", "0.6044933", "0.6036062", "0.60214996", "0.602073", "0.60085523", "0.60078835", "0.5987677", "0.5984509", "0.5982623", "0.5945424", "0.5917955", "0.59073406", "0.5903804", "0.58821726", "0.58509463", "0.5848118", "0.58468795", "0.58450246", "0.5840537", "0.5833304", "0.5829874", "0.5825343", "0.58213985", "0.58179224", "0.5817673", "0.58175987", "0.57860875", "0.5780742", "0.5776679", "0.577215", "0.5761621", "0.57538915", "0.574581", "0.5744908", "0.5743797", "0.57422894", "0.57422894", "0.57422894", "0.57324445", "0.5731821", "0.57252663", "0.57115906", "0.5708208", "0.5705208", "0.57026035", "0.56994766", "0.5691467", "0.56860584", "0.5684029", "0.56763875", "0.5666556", "0.5663081", "0.5659885", "0.56326807", "0.5627704", "0.5627674", "0.56257766", "0.56251144", "0.5624507", "0.5617796", "0.56144357", "0.5611526", "0.560609", "0.56043935", "0.5600287", "0.5598629", "0.5597501", "0.5596833", "0.5596378", "0.5588168", "0.55852276", "0.55786806", "0.55714476", "0.55667996", "0.55618656", "0.55576545", "0.5554298", "0.5554014", "0.5543748", "0.55428356", "0.5534627", "0.5531909", "0.5530115", "0.55227196", "0.55214596", "0.5520007", "0.55177695", "0.5517494", "0.5517494", "0.5511141", "0.55087155", "0.5508404" ]
0.0
-1
Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file distributed with this work for additional information regarding copyright ownership. The ASF licenses this file to you under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. FIXME emphasis label position is not same with normal label position
function adjustSingleSide(list, cx, cy, r, dir, viewWidth, viewHeight) { list.sort(function (a, b) { return a.y - b.y; }); function shiftDown(start, end, delta, dir) { for (var j = start; j < end; j++) { list[j].y += delta; if (j > start && j + 1 < end && list[j + 1].y > list[j].y + list[j].height) { shiftUp(j, delta / 2); return; } } shiftUp(end - 1, delta / 2); } function shiftUp(end, delta) { for (var j = end; j >= 0; j--) { list[j].y -= delta; if (j > 0 && list[j].y > list[j - 1].y + list[j - 1].height) { break; } } } function changeX(list, isDownList, cx, cy, r, dir) { var lastDeltaX = dir > 0 ? isDownList // right-side ? Number.MAX_VALUE // down : 0 // up : isDownList // left-side ? Number.MAX_VALUE // down : 0; // up for (var i = 0, l = list.length; i < l; i++) { var deltaY = Math.abs(list[i].y - cy); var length = list[i].len; var length2 = list[i].len2; var deltaX = deltaY < r + length ? Math.sqrt((r + length + length2) * (r + length + length2) - deltaY * deltaY) : Math.abs(list[i].x - cx); if (isDownList && deltaX >= lastDeltaX) { // right-down, left-down deltaX = lastDeltaX - 10; } if (!isDownList && deltaX <= lastDeltaX) { // right-up, left-up deltaX = lastDeltaX + 10; } list[i].x = cx + deltaX * dir; lastDeltaX = deltaX; } } var lastY = 0; var delta; var len = list.length; var upList = []; var downList = []; for (var i = 0; i < len; i++) { delta = list[i].y - lastY; if (delta < 0) { shiftDown(i, len, -delta, dir); } lastY = list[i].y + list[i].height; } if (viewHeight - lastY < 0) { shiftUp(len - 1, lastY - viewHeight); } for (var i = 0; i < len; i++) { if (list[i].y >= cy) { downList.push(list[i]); } else { upList.push(list[i]); } } changeX(upList, false, cx, cy, r, dir); changeX(downList, true, cx, cy, r, dir); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "get labelPosition() {\n return this.getLabelPosition();\n }", "get labelPosition() {\n return this._labelPosition;\n }", "svgLabelAlign(text, wrapBound, childNodes) {\n let bounds = new Size(wrapBound.width, childNodes.length * (text.fontSize * 1.2));\n let pos = { x: 0, y: 0 };\n let x = 0;\n let y = 1.2;\n let offsetX = text.width * 0.5;\n let offsety = text.height * 0.5;\n let pointX = offsetX;\n let pointY = offsety;\n if (text.textAlign === 'left') {\n pointX = 0;\n }\n else if (text.textAlign === 'center') {\n if (wrapBound.width > text.width && (text.textOverflow === 'Ellipsis' || text.textOverflow === 'Clip')) {\n pointX = 0;\n }\n else {\n pointX = text.width * 0.5;\n }\n }\n else if (text.textAlign === 'right') {\n pointX = (text.width * 1);\n }\n pos.x = x + pointX + (wrapBound ? wrapBound.x : 0);\n pos.y = y + pointY - bounds.height / 2;\n return pos;\n }", "function getTextPositionInLabel(text) {\r\n\t\ttext = text + \"\";\r\n\t\treturn 15 - (text.length * 2.2); \r\n\t}", "function setLabelAnchor(d) {\r\n if (d.target.x >= (d.source.x + 20)) return \"start\";\r\n if (d.target.x <= (d.source.x - 20)) return \"end\";\r\n return \"middle\";\r\n }", "get labelPosition() {\n return this._labelPosition || (this.radioGroup && this.radioGroup.labelPosition) || 'after';\n }", "function setLabelPositions(){\n labelPosition = {\n x: margin.top + height + (3 * margin.bottom / 4),\n y: margin.left / 4\n }; \n}", "getXoffset() {\n return labelWidth + this.getFullwidth() + barHeight * 2 + 19\n }", "function setLabelAnchor(d) {\n return d.angle > Math.PI ? 'end' : null;\n }", "function setupLabel(selection, l) {\n const setup = selection.attr('text-anchor', 'middle')\n .style('font', '12px sans-serif')\n .text(l);\n return setup;\n }", "function labelPosition(ctx, v) {\n\tctx.font=\"300 14px Open Sans, sans-serif\";\n\tvar l = new Object();\n\tl.x = [0,0,0];\n\tl.y = [];\n\tfor(var i=0, len=v.length; i<len; i++) {\n\t\tvar radPos = 0;\n\t\tif (i == 0) {\n\t\t\tradPos = 2-(v[0]/2);\n\t\t} else {\n\t\t\tradPos = 2-(v[i]/2+v[i-1]/2);\n\t\t}\n\t\tl.x[i] = (graphWidth/2+Math.cos(radPos*Math.PI)*70);\n\t\tl.x[i] -= ctx.measureText(yearCreated).width/2;\n\t\tl.y[i] = (graphWidth/2+Math.sin(radPos*Math.PI)*70);\n\t\tl.y[i] += 7; // Font height offset\n\n\t\tvar radPosTemp = 0;\n\t\t// Label offset\n\t\tl.x[i] += Math.cos(radPos*Math.PI) * 23;\n\t\tl.y[i] += Math.sin(radPos*Math.PI) * 23;\n\t}\n\treturn l;\n}", "function addTextLabel(root,node){var domNode=root.append(\"text\");var lines=processEscapeSequences(node.label).split(\"\\n\");for(var i=0;i<lines.length;i++){domNode.append(\"tspan\").attr(\"xml:space\",\"preserve\").attr(\"dy\",\"1em\").attr(\"x\",\"1\").text(lines[i])}util.applyStyle(domNode,node.labelStyle);return domNode}", "function onEmphasis(){labelLine.ignore = labelLine.hoverIgnore;text.ignore = text.hoverIgnore;}", "adjustLabelsToCameraPosition() {\n if (!this.areLabelsShown || !this.settings.labelsConfig.areSpritesUsed) return;\n this.labelsGroup.children.forEach((label) => {\n const { atomPosition, atomName: element } = label.userData;\n const offsetVector = this.getLabelOffsetVector(atomPosition, element);\n label.position.addVectors(atomPosition, offsetVector);\n label.visible = this.areLabelsShown;\n label.lookAt(this.camera.position);\n });\n }", "function position() {\n var w = attrs.w || me.labelWidth(attrs.txt, attrs.cl, attrs.size),\n h = attrs.h || lbl.height(),\n x = attrs.x,\n y = attrs.y,\n rot_w = 100;\n var css = attrs.rotate == -90 ? {\n // rotated\n left: x - rot_w * 0.5,\n top: attrs.valign == 'top' ? y + rot_w * 0.5 : y - rot_w * 0.5,\n width: rot_w,\n height: 20,\n 'text-align': attrs.valign == 'top' ? 'right' : 'left'\n } : {\n // not rotated\n left: attrs.align == 'left' ? x : attrs.align == 'center' ? x - w * 0.5 : x - w,\n top: y - h * (attrs.valign == 'top' ? 0 : attrs.valign == 'middle' ? 0.5 : 1),\n width: w,\n height: h\n };\n if (attrs.size) {\n css['font-size'] = attrs.size;\n }\n return css;\n }", "updateEdgeLabel() {\n const rotatelabel = this.getRotateLabel()\n d3.select(this.html.node().parentElement).select(\"text\")\n .attr(\"x\", (this.x2+this.x1)/ 2 - 5*this.label.length)\n .attr(\"y\", (this.y2+this.y1 - this.stroke_width)/2)\n .attr(\"transform\", rotatelabel)\n }", "function setLabel(props){\n //label content\n var labelAttribute = \"<h1>\" + props[expressed] +\n \"</h1>\" + expressed + \"</b>\";\n\n //create info label div\n var infolabel = d3.select(\"body\")\n .append(\"div\")\n .attr(\"class\", \"infolabel\")\n .attr(\"id\", props.adm1_code + \"_label\")\n .html(labelAttribute)\n\n var regionName = infolabel.append(\"div\")\n .attr(\"class\", \"labelname\")\n .html((props.NAME_1 + \" Region\").bold());\n }", "function Label(text,point_posision) {\n this.tag =\"Label\";\n this.emptyContext = new Object();\n\n\n}", "label() {\n if(this.props.columnType === Constants.getIn(['columnTypes', 'SIDEBAR'])) {\n return null\n }\n\n let labelLines = this.labelLines()\n\n // Clip long names, and append an ellipsis\n if (labelLines.length > 3) {\n labelLines = [labelLines[0], labelLines[1], labelLines[2]]\n labelLines[2] += '…'\n }\n\n const labelLengthExceed = labelLines.length * Constants.get('singleLineCategoryLabelHeight') > this.props.height\n\n let labelClassName = 'inactiveCategoryLabels'\n\n if(labelLengthExceed === true && this.checkHoverState() === false && this.filterboxActive() === false) {\n return null\n }\n\n if(this.checkHoverState() === true) {\n labelClassName = 'activeCategoryLabels'\n }\n\n let currentY = (this.props.height/2)\n let lineCount = 0\n currentY += (1 - (labelLines.length/2)) * \n Constants.get('singleLineCategoryLabelHeight')\n\n // Decrement just before it's increcemented inside the map.\n currentY -= Constants.get('singleLineCategoryLabelHeight')\n\n return <g>\n <text\n >\n {labelLines.map((line) => {\n currentY += Constants.get('singleLineCategoryLabelHeight')\n lineCount += 1\n return <tspan fill={this.fill} className={labelClassName} \n key={this.props.categoryName + 'CategoryLabelLine' + lineCount}\n y={currentY}\n x={this.props.width + Constants.get('categoryLabelOffset')}>\n {line}\n </tspan>\n })}\n </text>\n { this.filterbox(currentY) }\n </g>\n }", "addLabeltoEdge(label, font_family, font_size, color) {\n // Add the Label to the DOM\n const rotatelabel = this.getRotateLabel()\n d3.select(this.html.node().parentElement).append(\"text\")\n .attr(\"x\", (this.x2+this.x1)/ 2 - 5*label.length)\n .attr(\"y\", (this.y2+this.y1 )/2 - this.stroke_width)\n .attr(\"transform\", rotatelabel)\n .style(\"font-family\", font_family)\n .style(\"font-size\", font_size)\n .attr(\"fill\", color)\n .text(label)\n }", "addLabel(component) {\nthis\n.addInfoToComponent(component, formEditorConstants.COMPONENT_TYPE_LABEL)\n.addProperty(component, 'name', this._componentList.findComponentText(component.type, 'name', 'Label'))\n.addProperty(component, 'zIndex', 0)\n.addProperty(component, 'fontSize', 16)\n.addProperty(component, 'text', component.text || component.name)\n.addProperty(component, 'hAlign', 'left');\nreturn component;\n}", "addToLabel(label, font_family, font_size, color) {\n const rotatelabel = this.getRotateLabel()\n d3.select(this.html.node().parentElement).select(\"text\")\n .attr(\"x\", (this.x2+edge.x1)/ 2 - 5*label.length)\n .attr(\"y\", (this.y2+edge.y1 - this.stroke_width)/2)\n .attr(\"transform\", rotatelabel)\n .style(\"font-family\", font_family)\n .style(\"font-size\", font_size)\n .attr(\"fill\", color)\n .text(label)\n }", "get yAxisAnnotationPaddingLeft() {\r\n return this.i.nm;\r\n }", "updateLabelOffsets() {\n const camera = MapContainer.getInstance().getWebGLCamera();\n if (this.csContext && camera) {\n // Find the z-index step from the camera altitude\n const cameraDistance = camera.getDistanceToCenter();\n const zIndexStep = Math.round(cameraDistance / (this.zIndexMax_ * 10));\n const newOffset = -(this.zIndex_ * zIndexStep);\n this.csContext.setLabelEyeOffset(new Cesium.Cartesian3(0.0, 0.0, newOffset));\n }\n }", "function labelY() {\n const l = d3.select(this.parentNode).select('line');\n return parseInt(l.attr('y1')) - 20;\n}", "function getAnnotLabelLayout(annot, ideo) {\n var annotDom, annotRect, ideoRect, width, height, top, bottom, left, right,\n config = ideo.config;\n\n annotDom = document.querySelector('#' + annot.domId);\n\n // Handles cases when annotation is not yet in DOM\n if (annotDom === null) return null;\n\n annotRect = annotDom.getBoundingClientRect();\n\n ideoRect =\n document.querySelector('#_ideogram').getBoundingClientRect();\n\n const textSize = getTextSize(annot.name, ideo);\n width = textSize.width;\n\n // `pad` is a heuristic that accounts for:\n // 1px left pad, 1px right pad, 1px right border, 1px left border\n // as set in renderLabel\n const pad = (config.fontFamily) ? 9 : 7;\n width += pad;\n\n const labelSize = config.annotLabelSize ? config.annotLabelSize : 13;\n // console.log('height, labelSize', height, labelSize);\n\n // Accounts for 1px top border, 1px bottom border as set in renderLabel\n height = labelSize;\n\n top = annotRect.top - ideoRect.top + height - 1;\n bottom = top + height;\n left = annotRect.left - ideoRect.left - width;\n right = left + width;\n\n return {top, bottom, right, left, width, height};\n}", "draw_label(){\n this.svg.append('rect')\n .attr(\"class\", \"timeline-label\")\n .attr(\"x\", \"0\")\n .attr(\"y\", \"0\")\n .attr(\"width\", `${this.WIDTH}`)\n .attr(\"height\", `${this.label_height}`)\n\n this.svg.append('text')\n .attr('x', `${this.X0 - 30}`)\n .attr('text-anchor', 'left')\n .attr('y', this.label_height - 15)\n .attr('class','roll_label')\n .text(`Mean per year of ${this.y_attribute.toLowerCase()} of ${this.type} in ${this.unit}`)\n\n }", "refreshLabelPosition(label) {\n const labelDiv = this.refs[getLabelRef(label.id, this._.componentId)];\n const canvas = this.refs.labelCanvas;\n const cwidth = canvas.offsetWidth;\n const cheight = canvas.offsetHeight;\n const w = labelDiv.offsetWidth;\n const h = labelDiv.offsetHeight;\n // left\n let left = label.x * cwidth - w * 0.5;\n if (left <= 0) left = 1;\n else if (left + w >= cwidth) left = cwidth - w - 1;\n labelDiv.style.left = `${left}px`;\n // top\n let top = label.y * cheight - h * 0.5;\n if (top <= 0) top = 1;\n else if (top + h >= cheight) top = cheight - h - 1;\n labelDiv.style.top = `${top}px`;\n // reset label's coords\n label.x = (left + 0.5 * w) / cwidth;\n label.y = (top + 0.5 * h) / cheight;\n }", "get text(){ return this.__label.text; }", "function newAnchorLabel() {\n count = ++that.anchor_count;\n anchor_label = strval((count + 1)); //generating footnote number starting at 1 instead of 0\n /* yil original letter generating label code\n anchor_label = '';\n do {\n anchor_label = chr(ord('a') + (count % 26)) + anchor_label;\n count = (int) floor(count / 26);\n } while (count > 0);*/\n return anchor_label;\n }", "get label() {\n return this.getLabel();\n }", "function setLabelYshift(d) {\r\n // set y shift to either 5 for left and right\r\n if ((d.target.x >= (d.source.x + 20)) || (d.target.x <= (d.source.x - 20))) { return (0.5 * 0.85 / 2)\r\n + \"em\"; }\r\n // 30 if below\r\n if (d.target.y > d.source.y) { return \"2.5em\"; }\r\n // if above\r\n return \"-1.5em\";\r\n }", "function labelTransform(d) {\n const x = (d.x0 + d.x1) / 2 * 180 / Math.PI;\n const y = (d.y0 + d.y1) / 2 * radius;\n return `rotate(${x - 90}) translate(${y},0) rotate(${x < 180 ? 0 : 180})`;\n }", "alignText(alignment) {\n this.context.textAlign = alignment;\n }", "function AnimatedLabel(id, val, center)\r\n{\r\n\tthis.centering = center;\r\n\tthis.label = val;\r\n\tthis.highlighted = false;\r\n\tthis.objectID = id;\r\n\tthis.alpha = 1.0;\r\n\tthis.addedToScene = true;\r\n\tthis.labelColor = \"#000000\";\r\n\tthis.textWidth = 0;\r\n}", "function labelAlign(angle) {\n // to keep angle in [0, 360)\n angle = ((angle % 360) + 360) % 360;\n if ((angle + 90) % 180 === 0) { // for 90 and 270\n return {}; // default center\n }\n else if (angle < 90 || 270 < angle) {\n return { align: { value: 'right' } };\n }\n else if (135 <= angle && angle < 225) {\n return { align: { value: 'left' } };\n }\n return {};\n }", "function updateLabel() {\n\t\tlabelVal.text( slider._getLabelValCallback( brush.extent()[0] ) );\n\t\tlabelLabel.attr(\"transform\", \"translate(\" + (+sliderWidth + \n \t\t\t\t\t\t \t +labelVal[0][0].offsetWidth + \n \t\t\t\t\t\t \t +margin.labelSpace) + \n \t \",\" + sliderHeight/2 + \")\");\n\t}", "function autoAlignLabel() {\n\t\t\t// Auto-align label, depending on it's position\n\t\t\tif (!settings.hasOwnProperty(\"label\") || (settings.hasOwnProperty(\"label\") && !settings.label.hasOwnProperty(\"align\"))) {\n\t\t\t\tswitch(options.label.position) {\n\t\t\t\tcase \"left\":\n\t\t\t\t\toptions.label.align = \"right\";\n\t\t\t\t\tbreak;\n\t\t\t\tcase \"right\":\n\t\t\t\t\toptions.label.align = \"left\";\n\t\t\t\t\tbreak;\n\t\t\t\tdefault:\n\t\t\t\t\toptions.label.align = \"center\";\n\t\t\t\t}\n\n\t\t\t\tif (options.label.rotate === \"left\") {\n\t\t\t\t\toptions.label.align = \"right\";\n\t\t\t\t} else if (options.label.rotate === \"right\") {\n\t\t\t\t\toptions.label.align = \"left\";\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif (!settings.hasOwnProperty(\"label\") || (settings.hasOwnProperty(\"label\") && !settings.label.hasOwnProperty(\"offset\"))) {\n\t\t\t\tif (options.label.position === \"left\" || options.label.position === \"right\") {\n\t\t\t\t\toptions.label.offset = {\n\t\t\t\t\t\tx: 10,\n\t\t\t\t\t\ty: 15\n\t\t\t\t\t};\n\t\t\t\t}\n\t\t\t}\n\t\t}", "function autoAlignLabel() {\n\t\t\t// Auto-align label, depending on it's position\n\t\t\tif (!settings.hasOwnProperty(\"label\") || (settings.hasOwnProperty(\"label\") && !settings.label.hasOwnProperty(\"align\"))) {\n\t\t\t\tswitch(options.label.position) {\n\t\t\t\tcase \"left\":\n\t\t\t\t\toptions.label.align = \"right\";\n\t\t\t\t\tbreak;\n\t\t\t\tcase \"right\":\n\t\t\t\t\toptions.label.align = \"left\";\n\t\t\t\t\tbreak;\n\t\t\t\tdefault:\n\t\t\t\t\toptions.label.align = \"center\";\n\t\t\t\t}\n\n\t\t\t\tif (options.label.rotate === \"left\") {\n\t\t\t\t\toptions.label.align = \"right\";\n\t\t\t\t} else if (options.label.rotate === \"right\") {\n\t\t\t\t\toptions.label.align = \"left\";\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif (!settings.hasOwnProperty(\"label\") || (settings.hasOwnProperty(\"label\") && !settings.label.hasOwnProperty(\"offset\"))) {\n\t\t\t\tif (options.label.position === \"left\" || options.label.position === \"right\") {\n\t\t\t\t\toptions.label.offset = {\n\t\t\t\t\t\tx: 10,\n\t\t\t\t\t\ty: 15\n\t\t\t\t\t};\n\t\t\t\t}\n\t\t\t}\n\t\t}", "function setLabel(props){\n //label content\n var labelAttribute = \"<h2>\" + props[expressed] +\n \"</h2>\";\n\n //create info label div\n var infolabel = d3.select(\"body\")\n .append(\"div\")\n .attr(\"class\", \"infolabel\")\n .attr(\"id\", props.name + \"_label\")\n .html(labelAttribute);\n\n var regionName = infolabel.append(\"div\")\n .attr(\"class\", \"labelname\")\n .html(props.name);\n}", "function createPacLabel (x,y,l) {\n\n var g = viz.selection().selectAll(\".vz-halo-arc-plot\").append(\"g\")\n .attr(\"class\",\"vz-halo-label\")\n .style(\"pointer-events\",\"none\")\n .style(\"opacity\",0);\n\n g.append(\"text\")\n .style(\"font-size\",\"11px\")\n .style(\"fill\",theme.skin().labelColor)\n .style(\"fill-opacity\",.75)\n .attr(\"text-anchor\",\"middle\")\n .attr(\"x\", x)\n .attr(\"y\", y)\n .text(l);\n\n var rect = g[0][0].getBoundingClientRect();\n g.insert(\"rect\",\"text\")\n .style(\"shape-rendering\",\"auto\")\n .style(\"fill\",theme.skin().labelFill)\n .style(\"opacity\",.45)\n .attr(\"width\",rect.width+12)\n .attr(\"height\",rect.height+12)\n .attr(\"rx\",3)\n .attr(\"ry\",3)\n .attr(\"x\", x-5 - rect.width/2)\n .attr(\"y\", y - rect.height-3);\n\n g.transition().style(\"opacity\",1);\n}", "function createPacLabel (x,y,l) {\n\n var g = viz.selection().selectAll(\".vz-halo-arc-plot\").append(\"g\")\n .attr(\"class\",\"vz-halo-label\")\n .style(\"pointer-events\",\"none\")\n .style(\"opacity\",0);\n\n g.append(\"text\")\n .style(\"font-size\",\"11px\")\n .style(\"fill\",theme.skin().labelColor)\n .style(\"fill-opacity\",.75)\n .attr(\"text-anchor\",\"middle\")\n .attr(\"x\", x)\n .attr(\"y\", y)\n .text(l);\n\n var rect = g[0][0].getBoundingClientRect();\n g.insert(\"rect\",\"text\")\n .style(\"shape-rendering\",\"auto\")\n .style(\"fill\",theme.skin().labelFill)\n .style(\"opacity\",.45)\n .attr(\"width\",rect.width+12)\n .attr(\"height\",rect.height+12)\n .attr(\"rx\",3)\n .attr(\"ry\",3)\n .attr(\"x\", x-5 - rect.width/2)\n .attr(\"y\", y - rect.height-3);\n\n g.transition().style(\"opacity\",1);\n}", "labelTransform(data, labelKey) {\n if (this.labelNodes[labelKey]) {\n const { width, height } = this.labelNodes[labelKey].getBBox();\n const [cX, cY] = this.arc.centroid(data);\n\n return `translate(${[cX -width/2, cY + height/2]})`\n } else {\n return `translate(${this.arc.centroid(data)})`\n }\n }", "function makeLabels(svgContainer, msm, title, x, y) {\r\n svgContainer.append('text')\r\n .attr('x', (msm.width - 2 * msm.marginAll) / 2 - 90)\r\n .attr('y', msm.marginAll / 2 + 10)\r\n .style('font-size', '10pt')\r\n .text(title);\r\n\r\n svgContainer.append('text')\r\n .attr('x', (msm.width - 2 * msm.marginAll) / 2 - 30)\r\n .attr('y', msm.height - 10)\r\n .style('font-size', '10pt')\r\n .text(x);\r\n\r\n svgContainer.append('text')\r\n .attr('transform', 'translate( 15,' + (msm.height / 2 + 30) + ') rotate(-90)')\r\n .style('font-size', '10pt')\r\n .text(y);\r\n}", "function updateLabelLinePoints(target, labelLineModel) {\n\t if (!target) {\n\t return;\n\t }\n\t\n\t var labelLine = target.getTextGuideLine();\n\t var label = target.getTextContent(); // Needs to create text guide in each charts.\n\t\n\t if (!(label && labelLine)) {\n\t return;\n\t }\n\t\n\t var labelGuideConfig = target.textGuideLineConfig || {};\n\t var points = [[0, 0], [0, 0], [0, 0]];\n\t var searchSpace = labelGuideConfig.candidates || DEFAULT_SEARCH_SPACE;\n\t var labelRect = label.getBoundingRect().clone();\n\t labelRect.applyTransform(label.getComputedTransform());\n\t var minDist = Infinity;\n\t var anchorPoint = labelGuideConfig.anchor;\n\t var targetTransform = target.getComputedTransform();\n\t var targetInversedTransform = targetTransform && invert([], targetTransform);\n\t var len = labelLineModel.get('length2') || 0;\n\t\n\t if (anchorPoint) {\n\t pt2.copy(anchorPoint);\n\t }\n\t\n\t for (var i = 0; i < searchSpace.length; i++) {\n\t var candidate = searchSpace[i];\n\t getCandidateAnchor(candidate, 0, labelRect, pt0, dir);\n\t Point.scaleAndAdd(pt1, pt0, dir, len); // Transform to target coord space.\n\t\n\t pt1.transform(targetInversedTransform); // Note: getBoundingRect will ensure the `path` being created.\n\t\n\t var boundingRect = target.getBoundingRect();\n\t var dist = anchorPoint ? anchorPoint.distance(pt1) : target instanceof Path ? nearestPointOnPath(pt1, target.path, pt2) : nearestPointOnRect(pt1, boundingRect, pt2); // TODO pt2 is in the path\n\t\n\t if (dist < minDist) {\n\t minDist = dist; // Transform back to global space.\n\t\n\t pt1.transform(targetTransform);\n\t pt2.transform(targetTransform);\n\t pt2.toArray(points[0]);\n\t pt1.toArray(points[1]);\n\t pt0.toArray(points[2]);\n\t }\n\t }\n\t\n\t limitTurnAngle(points, labelLineModel.get('minTurnAngle'));\n\t labelLine.setShape({\n\t points: points\n\t });\n\t } // Temporal variable for the limitTurnAngle function", "function moveLabel() {\n var labelWidth = d3.select(\".infoLabel\")\n .node()\n .getBoundingClientRect();\n \n var x1 = d3.event.clientX + 10,\n y1 = d3.event.clientY - 50,\n x2 = d3.event.clientX - labelWidth.width - 10,\n y2 = d3.event.clientY + 25;\n \n var x = d3.event.clientX > window.innerWidth - labelWidth.width - 20 ? x2 : x1;\n \n var y = d3.event.clientY < 50 ? y2 : y1;\n \n d3.select(\".infoLabel\")\n .style(\"left\", x + \"px\")\n .style(\"top\", y + \"px\");\n }", "function MarkerLabel(opt_options) {\n this.setValues(opt_options);\n var span = this.span_ = document.createElement('span');\n span.style.cssText = 'position: relative; font-size: 10px; left: -50%; top: -42px; z-index:900; white-space: nowrap; padding: 2px; color: white;';\n var div = this.div_ = document.createElement('div');\n div.appendChild(span);\n div.style.cssText = 'position: absolute; display: none;';\n}", "function setLabel(props){\n //label content\n var labelAttribute = \"<h1>\" + props[expressed] + \"%\" +\n \"</h1><b>\" + \"Percent \" + expressed + \"</b>\";\n\n //create info label div\n var infolabel = d3.select(\"body\")\n .append(\"div\")\n .attr(\"class\", \"infolabel\")\n .attr(\"id\", props.NAME_1 + \"_label\")\n .html(labelAttribute);\n\n var stateName = infolabel.append(\"div\")\n .attr(\"class\", \"labelname\")\n .html(props.NAME_1);\n}", "function lblForName(text){\n\t\trandom = random+1;\n\t\tvar lblBasicConf1 = { id:\"lblForNm\"+random,text :text,isVisible:true,skin: \"lblBlackBold\"};\n\t\tvar lbllayoutConf1 = {containerWeight:40,hExpand:true,margin:[0,0,0,0],widgetAlignment:constants.WIDGET_ALIGN_MIDDLE_LEFT,contentAlignment :constants.CONTENT_ALIGN_MIDDLE_LEFT,padding:[2,0,0,0],vExpand: false,hExpand: true};//,percent:true\n\t\treturn new kony.ui.Label(lblBasicConf1, lbllayoutConf1, {});\t\n\t}", "function _positionCurrentLabelIcon() {\n const currLabelProps = currLabel.getProperties();\n const labelCanvasXY = currLabelProps.currCanvasXY;\n const scaledX = (labelCanvasXY.x * $gsvLayer.width()) / panoWidth;\n const scaledY = (labelCanvasXY.y * $gsvLayer.height()) / panoHeight;\n\n $('.common-mistakes-current-label-icon', $commonMistakesCurrentLabelImage).css({\n 'left': scaledX,\n 'top': scaledY,\n });\n }", "getLabel() {\n return this.canvas.getLabel().length > 0\n ? this.canvas.getLabel().getValue()\n : String(this.canvas.index + 1);\n }", "function setLabelTransformation(d) {\n return 'rotate(' + (d.angle * 180 / Math.PI - 90) + ')translate(' + (r0 + 20) + ')' + (d.angle > Math.PI ? 'rotate(180)' : '');\n }", "function fillLabel(opt) {\n Object(util_model[\"f\" /* defaultEmphasis */])(opt, 'label', ['show']);\n} // { [componentType]: MarkerModel }", "function setSmallLabelsProperties(label, text){\n label.style.backgroundColor = \"#4EA1E6\";\n label.style.overflow = \"hidden\";\n label.style.position = \"relative\";\n label.style.top = \"0px\";\n label.style.fontSize = \"9px\";\n label.appendChild(document.createTextNode(translateFromTypeToName(text)));\n label.style.textAlign = \"left\";\n}", "function setAnnotationPosition(//it is in dedicated line here.\n annotation, offsetX, offsetY, vAlignment, hAlignment, target) {\n annotation.offset.x = offsetX;\n annotation.offset.y = offsetY;\n annotation.verticalAlignment = vAlignment;\n annotation.horizontalAlignment = hAlignment;\n if (vAlignment === \"Top\" && hAlignment === \"Left\") {\n annotation.margin = { left: 3, top: 3 };\n }\n else if (vAlignment === \"Top\" && hAlignment === \"Right\") {\n annotation.margin = { right: 3, top: 3 };\n }\n else if (vAlignment === \"Bottom\" && hAlignment === \"Left\") {\n annotation.margin = { left: 3, bottom: 3 };\n }\n else if (vAlignment === \"Bottom\" && hAlignment === \"Right\") {\n annotation.margin = { right: 3, bottom: 3 };\n }\n target.classList.add(\"e-selected-style\");\n}", "function FunctionNumberLineAxisLabel(options) {\n let alignmentBaseline,\n backgroundColor,\n color,\n coordinates,\n fontFamily,\n fontSize,\n fontWeight,\n label,\n location,\n parent,\n string,\n text,\n where;\n\n label = this;\n\n init(options);\n\n return label;\n\n /* INITIALIZER */\n function init(options) {\n\n _required(options);\n _defaults(options);\n\n text = addText();\n\n }\n\n /* PRIVATE METHODS */\n function _defaults(options) {\n\n color = options.color ? options.color : \"black\";\n backgroundColor = options.backgroundColor ? options.backgroundColor : \"white\";\n fontSize = options.fontSize ? options.fontSize : \"12pt\";\n fontWeight = options.fontWeight ? options.fontWeight : \"bold\";\n fontFamily = options.fontFamily ? options.fontFamily : \"\";\n string = options.string ? options.string : \"\";\n\n }\n\n function _required(options) {\n\n where = options.where;\n parent = options.parent;\n location = options.location;\n alignmentBaseline = switchAlignmentBaseline();\n coordinates = switchCoordinates();\n }\n\n function addText() {\n let text;\n\n text = new ExplorableHintedText({\n \"where\":parent.group,\n \"coordinates\":coordinates,\n \"alignmentBaseline\":alignmentBaseline,\n \"foregroundColor\":color,\n \"fontSize\":fontSize,\n \"fontWeight\":fontWeight,\n \"fontFamily\":fontFamily,\n \"backgroundColor\":backgroundColor\n })\n .update(string);\n\n }\n\n function switchAlignmentBaseline() {\n\n switch(location) {\n case \"top\":\n return \"text-after-edge\";\n case \"bottom\":\n return \"text-before-edge\";\n }\n\n }\n\n function switchCoordinates() {\n\n switch(location) {\n case \"top\":\n return {\n \"x\":parent.width / 2,\n \"y\":0\n };\n case \"bottom\":\n return {\n \"x\":parent.width / 2,\n \"y\":parent.height\n };\n }\n\n }\n}", "function setBigLabelsProperties(label, text){\n label.style.backgroundColor = \"#4EA1E6\";\n label.style.overflow = \"hidden\";\n label.style.position = \"relative\";\n label.style.top = \"0px\";\n label.style.fontSize = \"13px\";\n label.appendChild(document.createTextNode(translateFromTypeToName(text)));\n label.style.textAlign = \"left\";\t\n}", "function labelAxes(svg, coords, attributes) {\n if ('x-label' in attributes) {\n svg.append('text')\n .attr('x', coords['x'] + coords['width'] / 2) \n .attr('y', coords['y'] + coords['height'])\n .attr('text-anchor', 'middle')\n .style('font-family', style('axisFont'))\n .style('font-size', style('axisFontSize'))\n .text(attributes['x-label']);\n }\n\n if ('y-label' in attributes) {\n svg.append('text')\n .attr('x', coords['x'] - coords['height'] / 2 - coords['axisPadding'])\n .attr('y', coords['y'])\n .attr('transform', 'rotate(-90)')\n .attr('text-anchor', 'middle')\n .style('font-family', style('axisFont'))\n .style('font-size', style('axisFontSize'))\n .text(attributes['y-label']);\n }\n}", "function rightLabels() {\n let labels = ['0.1', '0.2', '0.3', '0.4', '0.5', '0.6', '0.7', '0.8', '0.9'];\n // Solvent labels\n push();\n fill(128, 0, 128);\n textSize(18);\n for (let i = 0; i < labels.length; i++) {\n text(labels[i], 90 + 40 * (i + 1), 475);\n if (i == labels.length - 1) {\n textSize(22);\n text('solvent', 510, 460);\n }\n }\n pop();\n // Solute labels\n push();\n fill(0, 0, 255);\n textSize(18);\n for (let i = 0; i < labels.length; i++) {\n text(labels[i], 70, 450 - 40 * (i + 1));\n if (i == labels.length - 1) {\n textSize(22);\n noStroke();\n text('solute', 70, 40);\n }\n }\n pop();\n push();\n textSize(22);\n fill(255, 100, 0);\n noStroke();\n text('carrier', 35, 470)\n pop();\n push();\n textSize(22);\n text('solvent mass fraction', 200, 520);\n let angle1 = radians(270);\n translate(35, 350);\n rotate(angle1);\n text('solute mass fraction', 0, 0);\n pop();\n}", "function textBaseline(str = 'left') {\n\tif(str === 'center') str = 'middle';\n\tctx.textBaseline = str;\n}", "function updateLabelLinePoints(target, labelLineModel) {\n if (!target) {\n return;\n }\n\n var labelLine = target.getTextGuideLine();\n var label = target.getTextContent(); // Needs to create text guide in each charts.\n\n if (!(label && labelLine)) {\n return;\n }\n\n var labelGuideConfig = target.textGuideLineConfig || {};\n var points = [[0, 0], [0, 0], [0, 0]];\n var searchSpace = labelGuideConfig.candidates || DEFAULT_SEARCH_SPACE;\n var labelRect = label.getBoundingRect().clone();\n labelRect.applyTransform(label.getComputedTransform());\n var minDist = Infinity;\n var anchorPoint = labelGuideConfig.anchor;\n var targetTransform = target.getComputedTransform();\n var targetInversedTransform = targetTransform && Object(zrender_lib_core_matrix__WEBPACK_IMPORTED_MODULE_7__[/* invert */ \"e\"])([], targetTransform);\n var len = labelLineModel.get('length2') || 0;\n\n if (anchorPoint) {\n pt2.copy(anchorPoint);\n }\n\n for (var i = 0; i < searchSpace.length; i++) {\n var candidate = searchSpace[i];\n getCandidateAnchor(candidate, 0, labelRect, pt0, dir);\n _util_graphic__WEBPACK_IMPORTED_MODULE_0__[/* default */ \"a\"].scaleAndAdd(pt1, pt0, dir, len); // Transform to target coord space.\n\n pt1.transform(targetInversedTransform); // Note: getBoundingRect will ensure the `path` being created.\n\n var boundingRect = target.getBoundingRect();\n var dist = anchorPoint ? anchorPoint.distance(pt1) : target instanceof _util_graphic__WEBPACK_IMPORTED_MODULE_1__[/* default */ \"b\"] ? nearestPointOnPath(pt1, target.path, pt2) : nearestPointOnRect(pt1, boundingRect, pt2); // TODO pt2 is in the path\n\n if (dist < minDist) {\n minDist = dist; // Transform back to global space.\n\n pt1.transform(targetTransform);\n pt2.transform(targetTransform);\n pt2.toArray(points[0]);\n pt1.toArray(points[1]);\n pt0.toArray(points[2]);\n }\n }\n\n limitTurnAngle(points, labelLineModel.get('minTurnAngle'));\n labelLine.setShape({\n points: points\n });\n} // Temporal variable for the limitTurnAngle function", "function getTextAnnotationPosition(source, element) {\n var sourceTrbl = Object(diagram_js_lib_layout_LayoutUtil__WEBPACK_IMPORTED_MODULE_1__[\"asTRBL\"])(source);\n var position = {\n x: sourceTrbl.right + element.width / 2,\n y: sourceTrbl.top - 50 - element.height / 2\n };\n var escapeDirection = {\n y: {\n margin: -30,\n rowSize: 20\n }\n };\n return deconflictPosition(source, element, position, escapeDirection);\n}", "function drawLabel() {\n p.push();\n p.textFont('Courier New');\n p.textStyle(p.BOLD);\n p.textAlign(p.LEFT);\n p.textSize(15);\n p.fill('black');\n p.noStroke();\n p.text(`Trials: ${p.props.playedGames}/${p.props.countOfGames}`, 20, p.wrapper.offsetHeight - 20);\n p.pop();\n }", "createLabels() {\n return this.props.pie(this.props.data).map((data, idx) => {\n // Don't label the really small wedges.\n if (data.endAngle - data.startAngle < 0.1) return null;\n let labelKey = data.data[this.props.labelKey]\n\n // Note the ref being placed on each label element for easy reference\n // and subsequently easy access to the height/width for repositioning.\n return (\n <text transform={this.labelTransform(data, labelKey)}\n ref={ (node) => this.labelNodes[labelKey] = node }\n key={labelKey}>\n { this.props.formatLabel(data.value) }\n </text>\n );\n });\n }", "get label(){ return this.__label; }", "function draw_label(text, v1, v2){\n let dx = parseInt(v2[0] - v1[0]);\n let dy = parseInt(v2[1] - v1[1]-10); \n console.log(dx, dy);\n\n let p=v1;\n let pad = parseFloat(1/2);\n let padding = dx/4;\n \n pad = padding / Math.sqrt(dx*dx+dy*dy);\n \n ctx.save();\n ctx.textAlign = \"left\";\n ctx.translate(parseFloat(p[0] + dx*pad), parseFloat(p[1] + dy*pad));\n // ctx.rotate(Math.atan2(dy,dx));\n if(dx<0){\n ctx.rotate(Math.atan2(dy,dx) - Math.PI); //to avoid label upside down\n }\n else{\n ctx.rotate(Math.atan2(dy,dx));\n }\n ctx.font = '28px arial';\n ctx.fillStyle = \"black\"\n ctx.fillText(text, 0, 0);\n\n ctx.restore();\n}", "function textAlign(str = 'left') {\n\tctx.textAlign = str;\n}", "function onEmphasis() {\n\t labelLine.ignore = labelLine.hoverIgnore;\n\t text.ignore = text.hoverIgnore;\n\t }", "function setLabel(props){\r\n \r\n if (expressed == attrArray[0]){\r\n var label = REM_2012;\r\n } else if (expressed == attrArray[1]){\r\n var label = REM_2013;\r\n } else if (expressed == attrArray[2]){\r\n var label = REM_2014;\r\n } else if (expressed == attrArray[3]){\r\n var label = REM_2015;\r\n } else if (expressed == attrArray[4]){\r\n var label = REM_2016;\r\n };\r\n \r\n //label content\r\n var labelAttribute = \"<h1>\" + props[expressed] +\r\n \"</h1><br><b>\" + label + \"</b>\";\r\n\r\n //create info label div\r\n var infolabel = d3.select(\"body\")\r\n .append(\"div\")\r\n .attr(\"class\", \"infolabel\")\r\n .attr(\"id\", props.CODE + \"_label\")\r\n .html(labelAttribute);\r\n\r\n var regionName = infolabel.append(\"div\")\r\n .attr(\"class\", \"labelname\")\r\n .html(props.Name);\r\n}", "labelTextAxis(xAxis, yAxis){\n this.xAxis = xAxis;\n this.yAxis = yAxis;\n }", "function labeled_point(ctx,x_p,y_p,x_l,y_l,pointsize, l_text){\r\n ctx.moveTo(x_p,y_p)\r\n if(pointsize>0){\r\n ctx.arc(x_p, y_p, pointsize, 0, 2 * Math.PI, false);\r\n }\r\n ctx.fillText(l_text, x_p+x_l, y_p+y_l)\r\n}", "function labeled_point(ctx,x_p,y_p,x_l,y_l,pointsize, l_text){\r\n ctx.moveTo(x_p,y_p)\r\n if(pointsize>0){\r\n ctx.arc(x_p, y_p, pointsize, 0, 2 * Math.PI, false);\r\n }\r\n ctx.fillText(l_text, x_p+x_l, y_p+y_l)\r\n}", "get label() {\n\t\treturn this.nativeElement ? this.nativeElement.label : undefined;\n\t}", "annotateMarker(annoLoc) {\n this.context2d.fillText('' + (this.calculateAnnoConversion(annoLoc)), annoLoc, 140);\n }", "function setLabel(props){\n var formatName = props.name.replace(new RegExp(\"_\", \"g\"),\" \");\n \n var labelAttribute = \"<h1>\" + props[expressed] + \"</h1><b>\" + formatName + \"</b>\";\n \n var infoLabel = d3.select(\"body\")\n .append(\"div\")\n .attr(\"class\", \"infoLabel\")\n .attr(\"id\", props.name + \"_label\")\n .html(labelAttribute);\n }", "function getLabel(t) {\n //console.log(t)\n\n var _label = t.data.label || null;\n\n return _label\n }", "function Label() {\n Shape.call(this);\n /**\n * The labeled element\n *\n * @name Label#labelTarget\n * @type Base\n */\n labelRefs.bind(this, 'labelTarget');\n}", "function Label() {\n Shape.call(this);\n /**\n * The labeled element\n *\n * @name Label#labelTarget\n * @type Base\n */\n labelRefs.bind(this, 'labelTarget');\n}", "function beginLabel(TokenConstructor) {\n\tvar token = new TokenConstructor('html_inline', '', 0);\n\ttoken.content = '<label>';\n\treturn token;\n}", "function beginLabel(TokenConstructor) {\n\tvar token = new TokenConstructor('html_inline', '', 0);\n\ttoken.content = '<label>';\n\treturn token;\n}", "function addDriverLabels(vis, laps, cssClass, x, textAnchor) {\n\n return vis.selectAll('text.label.' + cssClass)\n .data(laps)\n .enter()\n .append('svg:text')\n .attr('class', 'label ' + cssClass)\n .attr('x', x)\n .attr('dy', '0.35em')\n .attr('text-anchor', textAnchor)\n .text(function(d) {\n\n\n var var4= [d.name,d.placing.slice(1, 6)];\n //var qna = var4.split(',');\n //var res = qna.join(\" <br> \");\n\n return var4[0] ;//+ var4[1];\n })\n .style('fill', function(d) {\n\n return SCALES.clr(d.placing[0]);\n })\n .on('mouseover', function(d) {\n\n highlight(vis, d.name);\n })\n .on('mouseout', function() {\n\n unhighlight(vis);\n });\n\n}", "addLabel() {\n this.scope_['value']['value']['label_names'].push(\n {type: 'unicode', value: this.defaultLabel_});\n }", "_measureLabel() {\r\n let drawContext = canvas._canvas.getContext(\"2d\");\r\n \r\n drawContext.save();\r\n this._setupText(drawContext);\r\n let measurements = drawContext.measureText(this._text);\r\n drawContext.restore();\r\n \r\n let numLines = 1 + (this._text.match(new RegExp(\"\\n\", \"g\")) || []).length;\r\n \r\n this._textWidth = measurements.width;\r\n this._textHeight = this._fontHeight * numLines;\r\n }", "get completeLabel() {\n\t\treturn this.nativeElement ? this.nativeElement.completeLabel : undefined;\n\t}", "get labelStyle() {\n return !!this.icon && this.icon !== \"\" && this.showTextLabel === false ? \"offscreen\" : null;\n }", "function Label() {\n Shape.call(this);\n\n /**\n * The labeled element\n *\n * @name Label#labelTarget\n * @type Base\n */\n labelRefs.bind(this, 'labelTarget');\n}", "function Label() {\n Shape.call(this);\n\n /**\n * The labeled element\n *\n * @name Label#labelTarget\n * @type Base\n */\n labelRefs.bind(this, 'labelTarget');\n}", "getLabelId() {\n return this._hasFloatingLabel() ? this._labelId : null;\n }", "function addLabelToAlgorithmBar(t){var e=document.createTextNode(t),i=document.createElement(\"td\");i.appendChild(e);var n=document.getElementById(\"AlgorithmSpecificControls\");return n.appendChild(i),e}", "alignCenter() {\n this.setAnchor(0.5);\n this.setStyle({ textAlign: 'center' });\n }", "static get TextAlign() { return {\n Left: \"left\",\n Center: \"center\",\n Right: \"right\",\n }}", "function onEmphasis() {\n labelLine.ignore = labelLine.hoverIgnore;\n text.ignore = text.hoverIgnore;\n }", "@autobind\n updateLabelPositions() {\n var pos;\n var tot = 0;\n for (var i=0; i<10; i++) {\n\n pos = new THREE.Vector3(0,0,0);\n tot += this.percentages[i].percent * 0.5;\n pos.x = Math.sin((Math.PI*2) * tot) * 1.02;\n pos.z = Math.cos((Math.PI*2) * tot) * 1.02;\n\n pos.y = 0.1;\n\n this.labelVectorPositions[i] = pos;\n\n this.labelPositions[i] = this.toScreenPosition(pos);\n\n pos.x = Math.sin((Math.PI*2) * tot);\n pos.z = Math.cos((Math.PI*2) * tot);\n pos.y = 0;\n\n this.labelAnchorPositions[i] = this.toScreenPosition(pos);\n\n tot += this.percentages[i].percent * 0.5;\n }\n\n this.drawLabels();\n }", "function setLabel(props){\n\t\t//Label content\n\t\tlet labelAttribute = \"<h1>\" + props[expressed] +\n\t\t\t\"</h1><b>\" + expressed + \"</b>\";\n\n\t\t//Create info label div\n\t\tlet infoLabel = d3.select(\"body\")\n\t\t\t.append(\"div\")\n\t\t\t.attr(\"class\", \"infoLabel\")\n\t\t\t.attr(\"id\", props.name + \"_label\")\n\t\t\t.html(labelAttribute);\n\n\t\tlet countryName = infoLabel.append(\"div\")\n\t\t\t.attr(\"class\", \"labelname\")\n\t\t\t.html(props.name);\n\t}", "update_label_transformation(ui, angle = this.angle(ui)) {\n const label = this.element.querySelector(\".label:not(.buffer)\");\n\n // Bound an `angle` to [0, π/2).\n const bound_angle = (angle) => {\n return Math.PI / 2 - Math.abs(Math.PI / 2 - ((angle % Math.PI) + Math.PI) % Math.PI);\n };\n\n // How much to offset the label from the edge.\n const LABEL_OFFSET = 16;\n let label_offset;\n switch (this.options.label_alignment) {\n case \"left\":\n label_offset = -1;\n break;\n case \"centre\":\n case \"over\":\n label_offset = 0;\n break;\n case \"right\":\n label_offset = 1;\n break;\n }\n\n // Expand or shrink the label to fit the available space.\n ui.resize_label(this, label);\n\n // Reverse the rotation for the label, so that it always displays upright and offset it\n // so that it is aligned correctly.\n label.style.transform = `\n translate(-50%, -50%)\n translateY(${\n (Math.sin(bound_angle(angle)) * label.offsetWidth / 2 + LABEL_OFFSET) * label_offset\n }px)\n rotate(${-angle}rad)\n `;\n\n // Make sure the buffer is formatted identically to the label.\n this.element.querySelector(\".label.buffer\").style.transform = label.style.transform;\n\n // Get the length of a line through the centre of the bounds rectangle at an `angle`.\n const angle_length = (angle) => {\n // Cut a rectangle out of the edge to leave room for the label text.\n // How much padding around the label to give (cut out of the edge).\n const CLEAR_PADDING = 4;\n\n return (Math.min(\n label.offsetWidth / (2 * Math.cos(bound_angle(angle))),\n label.offsetHeight / (2 * Math.sin(bound_angle(angle))),\n ) + CLEAR_PADDING) * 2;\n };\n\n const [width, height]\n = label.offsetWidth > 0 && label.offsetHeight > 0 ?\n [angle_length(angle), angle_length(angle + Math.PI / 2)]\n : [0, 0];\n\n new DOM.SVGElement(this.element.querySelector(\"svg mask .clear\"), {\n x: label.offsetLeft - width / 2,\n y: label.offsetTop - height / 2,\n width,\n height,\n });\n }", "drawlabels() {\n \n if (this.internal.volume===null)\n return;\n \n var context=this.internal.layoutcontroller.context;\n var dw=context.canvas.width;\n var dh=context.canvas.height;\n context.clearRect(Math.floor(this.cleararea[0]*dw),0,Math.floor(this.cleararea[1]*dw),dh);\n let cdim=$(context.canvas).css(['width','height','left','top' ]);\n \n // Add R&L s\n var labels = [ [ 'A','P', 'S','I' ] ,\n [ 'R','L', 'S','I' ] ,\n [ 'R','L', 'A','P' ] ];\n var names = [ 'Sagittal','Coronal','Axial'];\n var axes = [ '-jk','-ik','-ij' ];\n \n var fnsize=0;\n if (this.internal.simplemode)\n fnsize=Math.round(2*webutil.getfontsize(context.canvas)/3);\n else\n fnsize=Math.round(webutil.getfontsize(context.canvas)*this.cleararea[1]);\n\n context.font=fnsize+\"px Arial\";\n\n if (this.internal.simplemode)\n context.fillStyle = \"#884400\";\n else\n context.fillStyle = \"#cc6600\";\n\n\n let arrowsize=this.createarrowbuttons($(context.canvas).parent().parent(),fnsize);\n this.createmidline(context.canvas,dw,dh);\n\n if (this.internal.showdecorations===false) {\n this.hidearrowbuttons();\n return;\n }\n \n var invorientaxis = this.internal.volume.getOrientation().invaxis;\n var orientaxis = this.internal.volume.getOrientation().axis;\n let maxpl=2;\n if (this.internal.subviewers[3])\n maxpl=3;\n\n \n for (var pl=0;pl<=maxpl;pl++) {\n var trueplane=invorientaxis[pl];\n var lab=labels[trueplane];\n var vp =this.internal.subviewers[pl].getNormViewport();\n \n //console.log('Lab=',lab,(vp.x1-vp.x0)*dw,this.minLabelWidth);\n \n if ((vp.x1-vp.x0)*dw>this.minLabelWidth) {\n if (pl<=2) {\n \n let dx=0.25*vp.shiftx*dw;\n if (dx>120)\n dx=120;\n \n let dy=0.25*vp.shifty*dh;\n if (dy>50)\n dy=50;\n \n let xshift=[ -(2+dx),dx-(arrowsize+1)];\n let xshift0=[-(2+dx),(dx+2)];\n \n let ymid=Math.round( dh*(1.0-0.5*(vp.y0+vp.y1))+6);\n let xmin=vp.x0*dw+xshift0[0];\n if (xmin<2)\n xmin=2;\n let xmax=vp.x1*dw+xshift0[1];\n if (xmax>(dw-2))\n xmax=dw-2;\n \n context.textBaseline=\"middle\";\n context.textAlign=\"start\"; context.fillText(lab[0],xmin,ymid);\n context.textAlign=\"end\"; context.fillText(lab[1],xmax,ymid);\n \n let xmid=Math.round( dw*0.5*(0.5*vp.x0+1.5*vp.x1)-6);\n let ymin=Math.round((1.0-vp.y1)*dh)-dy;\n if (ymin<(fnsize+2))\n ymin=(fnsize+2);\n let ymax=Math.round((1.0-vp.y0)*dh)+dy;\n if (ymax>0.9*dh)\n ymax=0.9*dh;\n \n if (!this.internal.simplemode) {\n context.textAlign=\"center\";\n context.textBaseline=\"top\";\n context.fillText(lab[2],xmid,ymin);\n context.textBaseline=\"alphabetic\";\n context.fillText(lab[3],xmid,ymax);\n } else {\n context.textBaseline=\"alphabetic\";\n }\n \n let name=names[trueplane]+axes[orientaxis[trueplane]];\n context.textAlign=\"start\";\n context.fillText(name,xmin,ymin);\n \n if (!this.internal.simplemode) {\n let wd=Math.round(parseInt(cdim['width']));\n let lf=Math.round(parseInt(cdim['left']));\n let left=this.internal.layoutcontroller.getviewerleft();\n let l= [ Math.round(vp.x0*wd+lf+xshift[0]+left),\n Math.round(vp.x1*wd+lf+xshift[1])+left];\n if (l[0]<0)\n l[0]=0;\n \n \n \n let h=Math.round((1-(0.75*vp.y1+0.25*vp.y0))*parseInt(cdim['height']))+parseInt(cdim['top']);\n \n for (let k=0;k<=1;k++) {\n this.internal.arrowbuttons[pl*2+k].css({ 'left' : `${l[k]}px`,\n 'top' : `${h}px`,\n 'visibility' : 'visible'});\n }\n }\n }\n if (!this.internal.layoutcontroller.isCanvasDark())\n context.strokeStyle = \"#dddddd\";\n else\n context.strokeStyle = \"#222222\";\n \n \n \n context.lineWidth=1;\n context.beginPath();\n \n if (pl===3)\n vp=this.internal.subviewers[pl].getNormViewport().old;\n \n \n context.moveTo(vp.x0*dw,(1-vp.y0)*dh);\n context.lineTo(vp.x0*dw,(1-vp.y1)*dh);\n context.lineTo(vp.x1*dw,(1-vp.y1)*dh);\n context.lineTo(vp.x1*dw,(1-vp.y0)*dh);\n context.lineTo(vp.x0*dw,(1-vp.y0)*dh);\n context.stroke();\n } else if (pl<3) {\n for (let ia=0;ia<=1;ia++)\n if (this.internal.arrowbuttons[pl*2+ia])\n this.internal.arrowbuttons[pl*2+ia].css({'visibility':'hidden'});\n }\n }\n \n\n\n // Movie Stuff\n if (!this.internal.simplemode) {\n\n //console.log(\"Checking on arrows\",this.internal.maxnumframes);\n if (this.internal.maxnumframes<2 || dw<500) {\n \n for (let ia=6;ia<=11;ia++)\n if (this.internal.arrowbuttons[ia])\n this.internal.arrowbuttons[ia].css({'visibility':'hidden'});\n \n } else {\n \n let lh=this.internal.layoutcontroller.getviewerheight();\n let left=this.internal.layoutcontroller.getviewerleft();\n let y0=0.92*lh+parseInt(cdim['top']);\n for (let k=0;k<=5;k++) {\n let extra=0;\n if (k>3)\n extra=20;\n this.internal.arrowbuttons[6+k].css({ 'left' : `${50+40*k+left+extra}px`,\n 'top' : `${y0}px`,\n 'visibility' : 'visible'});\n }\n }\n }\n \n }", "function makeLabels() {\n svgContainer.append('text')\n .attr('x', 100)\n .attr('y', 40)\n .style('font-size', '14pt')\n .text(\"Fertility vs Life Expectancy (1980)\");\n\n svgContainer.append('text')\n .attr('x', 130)\n .attr('y', 490)\n .style('font-size', '10pt')\n .text('Fertility Rates (Avg Children per Woman)');\n\n svgContainer.append('text')\n .attr('transform', 'translate(15, 300)rotate(-90)')\n .style('font-size', '10pt')\n .text('Life Expectancy (years)');\n }", "function onEmphasis() {\n labelLine.ignore = labelLine.hoverIgnore;\n text.ignore = text.hoverIgnore;\n }", "function onEmphasis() {\n labelLine.ignore = labelLine.hoverIgnore;\n text.ignore = text.hoverIgnore;\n }", "function onEmphasis() {\n labelLine.ignore = labelLine.hoverIgnore;\n text.ignore = text.hoverIgnore;\n }", "function onEmphasis() {\n labelLine.ignore = labelLine.hoverIgnore;\n text.ignore = text.hoverIgnore;\n }" ]
[ "0.6931916", "0.665873", "0.6405361", "0.62561005", "0.6243183", "0.6194407", "0.6140204", "0.6122073", "0.6120772", "0.60901755", "0.60614437", "0.58918643", "0.58845127", "0.5879064", "0.58707356", "0.58377695", "0.5821333", "0.5810859", "0.57923913", "0.5784863", "0.5765213", "0.5763163", "0.5750442", "0.5728426", "0.57269824", "0.57030106", "0.5687735", "0.5685197", "0.56770366", "0.5675705", "0.5659888", "0.5659635", "0.5657117", "0.56426513", "0.56399095", "0.56369543", "0.5634929", "0.56345433", "0.56345433", "0.56226724", "0.56221217", "0.56221217", "0.56124115", "0.5606967", "0.5604614", "0.5604437", "0.5591025", "0.5580939", "0.55586123", "0.5545979", "0.5538643", "0.551578", "0.5515208", "0.5507732", "0.550375", "0.5496159", "0.5488066", "0.5477525", "0.54765064", "0.5473008", "0.54717517", "0.54715425", "0.5466621", "0.5464193", "0.5449477", "0.544727", "0.5438401", "0.5432823", "0.5429199", "0.54262143", "0.5423757", "0.5423757", "0.5417305", "0.54135346", "0.5400801", "0.5400442", "0.5393319", "0.5393319", "0.53922975", "0.53922975", "0.5387189", "0.538232", "0.5381693", "0.5378209", "0.53770316", "0.53714186", "0.53714186", "0.53659904", "0.53644454", "0.53626686", "0.53619766", "0.53586483", "0.53582233", "0.53558785", "0.5353734", "0.5352316", "0.53478384", "0.5346999", "0.5346999", "0.5346999", "0.5346999" ]
0.0
-1
Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file distributed with this work for additional information regarding copyright ownership. The ASF licenses this file to you under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. / Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file distributed with this work for additional information regarding copyright ownership. The ASF licenses this file to you under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
function _default(seriesType) { return { seriesType: seriesType, reset: function (seriesModel, ecModel) { var legendModels = ecModel.findComponents({ mainType: 'legend' }); if (!legendModels || !legendModels.length) { return; } var data = seriesModel.getData(); data.filterSelf(function (idx) { var name = data.getName(idx); // If in any legend component the status is not selected. for (var i = 0; i < legendModels.length; i++) { if (!legendModels[i].isSelected(name)) { return false; } } return true; }); } }; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "onChildAppStart () {\n\n }", "get Android() {}", "onMessageStart() { }", "_playbackCompatibility() {\n // Detect audio playback capabilities.\n\n // Detect HTML5 Audio playback.\n // http://caniuse.com/#feat=audio\n this.canUseAudio = Boolean(new Audio());\n console.log('Native HTML5 Audio playback capability: ' +\n this.canUseAudio);\n\n // Detect Cordova Media Playback\n // It allows playing audio using the native bridge inside WebView Apps.\n // https://github.com/apache/cordova-plugin-media/blob/master/doc/index.md\n this.canUseCordovaMedia = Boolean(window.Media);\n console.log('Cordova Media playback capability: ' +\n this.canUseCordovaMedia);\n\n if (!(this.canUseAudio || this.canUseCordovaMedia)) {\n throw new Error(\n 'Some form of audio playback capability is required');\n }\n\n var _audio = new Audio();\n if (_audio.canPlayType === 'function') {\n throw new Error(\n 'Unable to detect audio playback capabilities');\n }\n\n var canPlayOggVorbis = _audio.canPlayType(\n 'audio/ogg; codecs=\"vorbis\"') !== '';\n var canPlayOggOpus = _audio.canPlayType(\n 'audio/ogg; codecs=\"opus\"') !== '';\n var canPlayWave = _audio.canPlayType('audio/wav') !== '';\n var canPlayMP3 = _audio.canPlayType('audio/mpeg; codecs=\"mp3\"') !== '';\n var canPlayAAC = _audio.canPlayType(\n 'audio/mp4; codecs=\"mp4a.40.2\"') !== '';\n var canPlay3GPP = _audio.canPlayType(\n 'audio/3gpp; codecs=\"samr\"') !== '';\n\n console.log('Native Vorbis audio in Ogg container playback capability: ' +\n canPlayOggVorbis);\n console.log('Native Opus audio in Ogg container playback capability: ' +\n canPlayOggOpus);\n console.log('Native PCM audio in Waveform Audio File Format (WAVE) ' +\n 'playback capability: ' + canPlayWave);\n console.log('Native MPEG Audio Layer 3 (MP3) playback capability: ' +\n canPlayMP3);\n console.log('Native Low-Complexity AAC audio in MP4 container playback ' +\n 'capability: ' + canPlayAAC);\n console.log('Native AMR audio in 3GPP container playback capability: ' +\n canPlay3GPP);\n\n if (!(canPlayWave || canPlayMP3)) {\n throw new Error(\n 'Native Wave or MP3 playback is required');\n }\n }", "createStream () {\n\n }", "onComponentMount() {\n\n }", "function BaseDeviceProfile() {\n \n this.audioNeedsTranscodingCodecs = []; // fill these with audio codecs that the implemented device can handle natively\n this.videoNeedsTranscodingCodecs = []; // fill these with video codecs that the implemented device can handle natively\n this.validFormats = []; // fill these with video formats that the implemented device can handle natively\n\n this.transcodeOptions = {\n rescaleVideo : false, // BaseDeviceProfile.prototype.rescale\n subtitle : false, // BaseDeviceProfile.prototype.hardCodeSubtitle\n audioShiftCorrect : false // BaseDeviceProfile.prototype.correctAudioOffset\n };\n\n /**\n * @todo: whutz this?\n * @param {[type]} probeData [description]\n * @return {[type]} [description]\n */\n this.canPlayContainer = function (probeData) {\n throw new Error(\"canPlayContainer : Not Implemented\");\n };\n\n /**\n * Implement this method to return device specific ffmpeg flags for a probed media\n * @param {object} probeData ffmpeg probe data\n * @param {[type]} forceTranscode force transcode even if native format?\n * @return {Promise} [description]\n */\n this.getFFmpegFlags = function (probeData, forceTranscode) {\n throw new Error(\"getFFmpegFlags : Not Implemented!\");\n };\n\n}", "didMount() {\n }", "requestContainerInfo() {}", "function SBRecordsetPHP_analyzePlatformSpecific()\r\n{\r\n\r\n\r\n}", "function bridgeAndroidAndIOS() {\r\n\r\n //ios\r\n function setupWebViewJavascriptBridge(callback) {\r\n if (window.WebViewJavascriptBridge) {\r\n return callback(WebViewJavascriptBridge);\r\n }\r\n if (window.WVJBCallbacks) {\r\n return window.WVJBCallbacks.push(callback);\r\n }\r\n window.WVJBCallbacks = [callback];\r\n var WVJBIframe = document.createElement('iframe');\r\n WVJBIframe.style.display = 'none';\r\n WVJBIframe.src = 'https://__bridge_loaded__';\r\n document.documentElement.appendChild(WVJBIframe);\r\n setTimeout(function() {\r\n document.documentElement.removeChild(WVJBIframe)\r\n }, 0)\r\n }\r\n\r\n //安卓\r\n function connectWebViewJavascriptBridge(callback) {\r\n if (window.WebViewJavascriptBridge) {\r\n callback(WebViewJavascriptBridge)\r\n } else {\r\n document.addEventListener(\r\n 'WebViewJavascriptBridgeReady',\r\n function() {\r\n callback(WebViewJavascriptBridge)\r\n },\r\n false\r\n );\r\n }\r\n }\r\n\r\n function bridgeLog(logContent) {\r\n uni.showModal({\r\n title: \"原始数据\",\r\n content: logContent,\r\n })\r\n }\r\n\r\n switch (uni.getSystemInfoSync().platform) {\r\n case 'android':\r\n connectWebViewJavascriptBridge(function(bridge) {\r\n bridge.init();\r\n bridge.registerHandler(\"GetUser\", function(data, responseCallback) {\r\n if(JSON.parse(data).guid != \"null\"){\r\n uni.setStorageSync('userInfo', {\r\n guid: JSON.parse(data).guid,\r\n token: JSON.parse(data).token\r\n })\r\n }\r\n uni.setStorageSync('parameter', {\r\n activityID: JSON.parse(data).activityID,\r\n AppCode: JSON.parse(data).AppCode\r\n })\r\n // 初始传入token和guid\r\n Vue.config.configDic = {\r\n Authorization: JSON.parse(data).Authorization,\r\n statusBarHeight: Number.parseInt(JSON.parse(data).statusBarHeight),\r\n };\r\n });\r\n\r\n })\r\n break;\r\n case 'ios':\r\n setupWebViewJavascriptBridge(function(bridge) {\r\n bridge.registerHandler('GetUser', function(data, responseCallback) {\r\n if(data.guid != \"null\"){\r\n uni.setStorageSync('userInfo', {\r\n guid: data.guid,\r\n token: data.token\r\n })\r\n }\r\n uni.setStorageSync('parameter', {\r\n activityID: data.activityID,\r\n AppCode: data.AppCode\r\n })\r\n // 初始传入token和guid\r\n Vue.config.configDic = {\r\n Authorization: data.Authorization,\r\n productID: data.productID,\r\n statusBarHeight: data.statusBarHeight,\r\n };\r\n })\r\n })\r\n break;\r\n default:\r\n console.log('运行在开发者工具上')\r\n break;\r\n }\r\n\r\n}", "constructor() {\n super();\n this._logger = new pip_services3_components_node_3.CompositeLogger();\n this._connectionResolver = new connect_1.AwsConnectionResolver();\n this._connectTimeout = 30000;\n this._client = null; //AmazonCloudWatchClient\n this._opened = false;\n }", "static getDeviceModel() {\n return \"zhimi.fan.za4\";\n }", "constructor(speechCallback, clientId, streamId) {\n console.log(\"in gcloud\");\n const useOpus = false;\n this.clientId = clientId;\n this.streamId = streamId;\n this.isOpen = true;\n\n // Note: \n // 1) The client side detects silence and does a startStream, and endStream\n // The streamId is incremented everytime this happens, \n // so a combination of clientId + streamId can uniquely identify a stream.\n // The server will be transcribing each client's stream in parallel.\n //\n // 2) The streaming API has a limit of 5 minutes. So just before 5 minutes are up\n // there will timer that will close and reopen the stream. Any non final results will\n // we sent again to be re-transcribed,\n // The restartCounter will be incremented every time the stream is restarted. However\n // the streamId will remain the same.\n //\n // 3) Every stream will have set of results. Some results will be final and some won't be\n // After a result is final, that portion of the audio will not be transcribed again by the API\n // each final result will have resultEndTime, - this is time in seconds (and nanoseconds) \n // from the time the stream was started/restarted.\n // Results don'd have a startTime, it is implicit that the startTime is resultEndTime\n // of the last final stream, or 0 if there was no final stream before this\n // We augment the result to add this startTime\n //\n // We also keep a cumulative restartTime, which is the difference betwen the beginning of \n // stream start and begining of the most recent stream restart. And add this to \n // the startTime and endTime. This way the client is completely unaware of the internal restarts\n // \n \n // Have we started/restarted a new stream ?\n this.newStream = true;\n\n // number of times the stream has been restarted\n this.restartCounter = 0;\n\n // audio Input is any array of chunks (buffer)\n this.audioInput = [];\n this.audioInputSize = 0; // total size of all the buffers\n\n // the end time (in seconds) of the last result. \n // the End time is calculated from the beginning of start/restart stream\n this.resultEndTime = 0;\n\n // the end time of the last final result.\n this.finalEndTime = 0;\n\n // the start time (in seconds) of the current result. \n // It is calculated fom beginning of start/restart stream\n this.startTime = 0;\n \n // the time between the of beginning of start stream and the beginning of the most current restart stream.\n this.restartTime = 0;\n\n\n this.lastTranscriptWasFinal = false;\n\n this.restartTimer = null;\n\n this.config = {\n encoding: useOpus ? 'OGG_OPUS' : 'LINEAR16',\n sampleRateHertz: useOpus ? 48000 : 16000,\n languageCode: 'en_us',\n enableAutomaticPunctuation: true,\n speechContexts: [{ phrases: phrases}],\n };\n\n this.request = {\n config : this.config,\n interimResults: true,\n };\n\n this.startStreamInternal();\n }", "constructor() {\n }", "constructor(info) {\n super();\n\n _defineProperty(this, \"_peerConnectionId\", void 0);\n\n _defineProperty(this, \"_reactTag\", void 0);\n\n _defineProperty(this, \"_id\", void 0);\n\n _defineProperty(this, \"_label\", void 0);\n\n _defineProperty(this, \"_maxPacketLifeTime\", void 0);\n\n _defineProperty(this, \"_maxRetransmits\", void 0);\n\n _defineProperty(this, \"_negotiated\", void 0);\n\n _defineProperty(this, \"_ordered\", void 0);\n\n _defineProperty(this, \"_protocol\", void 0);\n\n _defineProperty(this, \"_readyState\", void 0);\n\n _defineProperty(this, \"_subscriptions\", []);\n\n _defineProperty(this, \"binaryType\", 'arraybuffer');\n\n _defineProperty(this, \"bufferedAmount\", 0);\n\n _defineProperty(this, \"bufferedAmountLowThreshold\", 0);\n\n this._peerConnectionId = info.peerConnectionId;\n this._reactTag = info.reactTag;\n this._label = info.label;\n this._id = info.id === -1 ? null : info.id; // null until negotiated.\n\n this._ordered = Boolean(info.ordered);\n this._maxPacketLifeTime = info.maxPacketLifeTime;\n this._maxRetransmits = info.maxRetransmits;\n this._protocol = info.protocol || '';\n this._negotiated = Boolean(info.negotiated);\n this._readyState = info.readyState;\n\n this._registerEvents();\n }", "_onMessage() {\n throw new Error(\"not implemented\");\n }", "getStreamPosition() {\n return Native.getStreamPosition();\n }", "onChildAppSourceChangeRestart () {\n\n }", "constructor() {\n\n\t}", "async componentDidUpdate() {\n console.log(this.props.directory);\n //this needs to be replaced with environment variable\n const beginingUrl = \"http://10.34.1.30:8080/songs/\";\n const songLoc = this.props.directory + \"/outputlist.m3u8\";\n var hlsUrl = beginingUrl + songLoc;\n var audio = this.player;\n\n //Should this logic be loacated here??This looks hacky,\n const token = await getToken();\n let bearerTokenString = \"Bearer \" + token;\n\n if (Hls.isSupported()) {\n var hls = new Hls({\n // This configuration is required to insure that only the\n // viewer can access the content by sending a session cookie\n // to api.video service\n xhrSetup: function (xhr, url) {\n xhr.setRequestHeader(\"Authorization\", bearerTokenString);\n },\n });\n hls.loadSource(hlsUrl);\n hls.attachMedia(audio);\n hls.on(Hls.Events.MANIFEST_PARSED, function () {\n audio.play();\n });\n } else if (audio.canPlayType(\"application/vnd.apple.mpegurl\")) {\n console.log(\"Nigga we here!!\");\n audio.src = hlsUrl;\n audio.addEventListener(\"loadedmetadata\", function () {\n audio.play();\n });\n }\n }", "onMessageReceive() {}", "constructor() {\n\t}", "constructor() {\n\t}", "componentWillMount() {\n //CodePush.disallowRestart();\n //Alert.alert(\"mounted cool vite OK OK MAINTENANT CA MARCHE !!!!!\");\n/*CodePush.sync(\n{\ndeploymentKey: 'giMb817KrtTFkIuOg4i5ohnEUDyoBJvD1i-VN',\nupdateDialog: true,\ninstallMode: CodePush.InstallMode.IMMEDIATE,\n},\nthis.CodePushStatusDidChange.bind(this),\nthis.CodePushDownloadDidProgress.bind(this)\n);*/\n /* Animated.loop(\n Animated.sequence([\n Animated.timing(this.animatedValue, { toValue: 1, duration: 3000, easing: Easing.ease, useNativeDriver: true }),\n Animated.timing(this.animatedValue, { toValue: 0, duration: 3000, easing: Easing.ease, useNativeDriver: true }),\n ])).start();*/\n //this.toggleLike(); \n //CodePush.notifyApplicationReady();\n this._onLoadStart();\n }", "function version(){ return \"0.13.0\" }", "get supportStreaming() { return exists && has(WA.instantiateStreaming); }", "static getDeviceModel() {\n return \"zhimi.fan.za5\";\n }", "onChildAppRestart (/* reason */) {\n\n }", "_init(config) {\n this.name = config.name;\n this.appId = config.appid || config.appId;\n this.serverUrl = config.server_url + '/sync_xcx';\n this.autoTrackProperties = {};\n // cache commands.\n this._queue = [];\n\n if (config.isChildInstance) {\n this._state = {};\n } else {\n logger.enabled = config.enableLog;\n this.instances = []; // 子实例名称\n this._state = {\n getSystemInfo: false,\n initComplete: false,\n };\n systemInfo.getSystemInfo(() => {\n this._updateState({\n getSystemInfo: true,\n });\n });\n\n if (config.autoTrack) {\n this.autoTrack = PlatformAPI.initAutoTrackInstance(this, config);\n } else {\n var launchOptions = PlatformAPI.getAppOptions((options) => {\n if (options && options.scene) {\n this._setAutoTrackProperties({\n '#scene': options.scene,\n });\n }\n\n });\n if (launchOptions.scene) {\n this._setAutoTrackProperties({\n '#scene': launchOptions.scene,\n });\n }\n }\n }\n\n this.store = new ThinkingDataPersistence(config, () => {\n if (this.config.asyncPersistence && _.isFunction(this.config.persistenceComplete)) {\n this.config.persistenceComplete(this);\n }\n this._updateState();\n });\n }", "_addHMRClientCode(data) {\n// If we have it, grab supporting code...\n let prependage = fs.readFileSync('./lib/hmr/clientSocket.js'),\n appendage = fs.readFileSync('./lib/hmr/hmr.js')\n\n// Prepend clientSocket.js to bundle.... Append hmr runtime to bundle\n return `${prependage}${data}${appendage}`\n }", "componentDidMount() {\n this.setState({\n configuration: {\n flow: {\n name: \"sample1\",\n id: \"01\",\n components: [\n {\n type: \"http-listener\",\n id: \"http-list-01\",\n properties: {\n method: \"get\",\n port: 8000,\n path: \"http://localhost\"\n }\n },\n {\n type: \"logger\",\n id: \"logger-01\",\n properties: {\n level: \"info\"\n }\n },\n {\n type: \"file-writer\",\n id: \"file-write-01\",\n properties: {\n location: \"xx\",\n username: \"sachith\",\n password: \"\",\n filename: \"hello.txt\"\n }\n }\n ]\n }\n }\n\n });\n }", "componentWillUnmount(){\n Streaming.disconnect();\n }", "pushStart() {\n Cordova.exec(\n () => {},\n () => {},\n 'SparkProxy',\n 'pushStart',\n []);\n }", "async onReady() {\n // Initialize your adapter here\n // Subsribe to all state changes\n this.subscribeStates('*');\n this.axiosInstance = axios_1.default.create({\n baseURL: `http://${this.config.host}/api/v1/`,\n timeout: 1000\n });\n // try to ping volumio\n const connectionSuccess = await this.pingVolumio();\n if (this.config.checkConnection) {\n let interval = this.config.checkConnectionInterval;\n if (!interval || !isNumber(interval)) {\n this.log.error(`Invalid connection check interval setting. Will be set to 30s`);\n interval = 30;\n }\n this.checkConnectionInterval = setInterval(this.checkConnection, interval * 1000, this);\n }\n // get system infos\n if (connectionSuccess) {\n this.apiGet('getSystemInfo').then(sysInfo => {\n this.setStateAsync('info.id', sysInfo.id, true);\n this.setStateAsync('info.host', sysInfo.host, true);\n this.setStateAsync('info.name', sysInfo.name, true);\n this.setStateAsync('info.type', sysInfo.type, true);\n this.setStateAsync('info.serviceName', sysInfo.serviceName, true);\n this.setStateAsync('info.systemversion', sysInfo.systemversion, true);\n this.setStateAsync('info.builddate', sysInfo.builddate, true);\n this.setStateAsync('info.variant', sysInfo.variant, true);\n this.setStateAsync('info.hardware', sysInfo.hardware, true);\n });\n // get inital player state\n this.updatePlayerState();\n }\n if (this.config.subscribeToStateChanges && this.config.subscriptionPort && connectionSuccess) {\n this.log.debug('Subscription mode is activated');\n try {\n this.httpServerInstance = this.httpServer.listen(this.config.subscriptionPort);\n this.log.debug(`Server is listening on ${ip_1.default.address()}:${this.config.subscriptionPort}`);\n this.subscribeToVolumioNotifications();\n }\n catch (error) {\n this.log.error(`Starting server on ${this.config.subscriptionPort} for subscription mode failed: ${error.message}`);\n }\n }\n else if (this.config.subscribeToStateChanges && !this.config.subscriptionPort) {\n this.log.error('Subscription mode is activated, but port is not configured.');\n }\n else if (!this.config.subscribeToStateChanges && connectionSuccess) {\n this.unsubscribeFromVolumioNotifications();\n }\n this.httpServer.post('/volumiostatus', (req, res) => {\n this.onVolumioStateChange(req.body);\n res.sendStatus(200);\n });\n }", "function IbtRealTimeSJ(){/***********************************************************\n\t * @attributes\n\t ***********************************************************/var appKey;// application key\n\tvar authToken;// authentication token\n\tvar clusterUrl;// cluster URL to connect\n\tvar waitingClusterResponse;// indicates whether is waiting for a cluster response\n\tvar connectionTimeout;// connection timeout in milliseconds\n\tvar messageMaxSize;// message maximum size in bytes\n\tvar channelMaxSize;// channel maximum size in bytes\n\tvar channelsMaxSize;// maximum of channels for batchSend\n\tvar messagesBuffer;// buffer to hold the message parts\n\tvar id;// object identifier\n\tvar isConnected;// indicates whether the client object is connected\n\tvar isConnecting;// indicates whether the client object is connecting\n\tvar alreadyConnectedFirstTime;// indicates whether the client already connected for the first time\n\tvar stopReconnecting;// indicates whether the user disconnected (stop the reconnecting proccess)\n\tvar ortc;// represents the object itself\n\tvar sockjs;// socket connected to\n\tvar url;// URL to connect\n\tvar userPerms;// user permissions\n\tvar connectionMetadata;// connection metadata used to identify the client\n\tvar announcementSubChannel;// announcement subchannel\n\tvar subscribedChannels;// subscribed/subscribing channels\n\tvar lastKeepAlive;// holds the time of the last keep alive received\n\tvar invalidConnection;// indicates whether the connection is valid\n\tvar reconnectIntervalId;// id used for the reconnect interval\n\tvar reconnectStartedAt;// the time which the reconnect started\n\tvar validatedTimeoutId;// id used for the validated timeout\n\tvar validatedArrived;// indicates whether the validated message arrived\n\tvar retryingWithSsl;// indicates whether the connection is being retried with SSL\n\tvar protocol;// protocol to use\n\tvar sslSessionCookieName;// the SSL session cookie name\n\tvar sessionCookieName;// the session cookie name\n\tvar sessionId;// the session ID\n\tvar registrationId;// browser device token for push notifications\n\tvar pushPlatform;// push notifications platform\n\t/***********************************************************\n\t * @attributes initialization\n\t ***********************************************************/sslSessionCookieName=\"ortcssl\";sessionCookieName=\"ortcsession-\";connectionTimeout=5000;messageMaxSize=800;channelMaxSize=100;connectionMetadataMaxSize=256;channelsMaxSize=50;// Time in seconds\n\tvar heartbeatDefaultTime=15;// Heartbeat default interval time\n\tvar heartbeatDefaultFails=3;// Heartbeat default max fails\n\tvar heartbeatMaxTime=60;var heartbeatMinTime=10;var heartbeatMaxFails=6;var heartbeatMinFails=1;var heartbeatTime=heartbeatDefaultTime;// Heartbeat interval time\n\tvar heartbeatFails=heartbeatDefaultFails;// Heartbeat max fails\n\tvar heartbeatInterval=null;// Heartbeat interval\n\tvar heartbeatActive=false;messagesBuffer={};subscribedChannels={};isConnected=false;isConnecting=false;alreadyConnectedFirstTime=false;invalidConnection=false;waitingClusterResponse=false;validatedArrived=false;retryingWithSsl=false;ortc=this;lastKeepAlive=null;userPerms=null;reconnectStartedAt=null;protocol=undefined;pushPlatform=\"GCM\";var delegateExceptionCallback=function(ortcArg,event){if(ortcArg!==null&&ortcArg.onException!==null){ortcArg.onException(ortcArg,event);}};/***********************************************************\n\t * @properties\n\t ***********************************************************/this.getId=function(){return id;};this.setId=function(newId){id=newId;};this.getUrl=function(){return url;};this.setUrl=function(newUrl){url=newUrl;clusterUrl=null;};this.getClusterUrl=function(){return clusterUrl;};this.setClusterUrl=function(newUrl){clusterUrl=newUrl;url=null;};this.getConnectionTimeout=function(){return connectionTimeout;};this.setConnectionTimeout=function(newTimeout){connectionTimeout=newTimeout;};this.getIsConnected=function(){return isConnected&&ortc.sockjs!==null;};this.getConnectionMetadata=function(){return connectionMetadata;};this.setConnectionMetadata=function(newConnectionMetadata){connectionMetadata=newConnectionMetadata;};this.getAnnouncementSubChannel=function(){return announcementSubChannel;};this.setAnnouncementSubChannel=function(newAnnouncementSubChannel){announcementSubChannel=newAnnouncementSubChannel;};this.getProtocol=function(){return protocol;};this.setProtocol=function(newProtocol){protocol=newProtocol;};this.getSessionId=function(){return sessionId;};/*\n\t * Get heartbeat interval.\n\t */this.getHeartbeatTime=function(){return heartbeatTime;};/*\n\t * Set heartbeat interval.\n\t */this.setHeartbeatTime=function(newHeartbeatTime){if(newHeartbeatTime&&!isNaN(newHeartbeatTime)){if(newHeartbeatTime>heartbeatMaxTime||newHeartbeatTime<heartbeatMinTime){delegateExceptionCallback(ortc,`Heartbeat time is out of limits - Min: ${heartbeatMinTime} | Max: ${heartbeatMaxTime}`);}else{heartbeatTime=newHeartbeatTime;}}else{delegateExceptionCallback(ortc,`Invalid heartbeat time ${newHeartbeatTime}`);}};/*\n\t * Get how many times can the client fail the heartbeat.\n\t */this.getHeartbeatFails=function(){return heartbeatFails;};/*\n\t * Set heartbeat fails. Defines how many times can the client fail the heartbeat.\n\t */this.setHeartbeatFails=function(newHeartbeatFails){if(newHeartbeatFails&&!isNaN(newHeartbeatFails)){if(newHeartbeatFails>heartbeatMaxFails||newHeartbeatFails<heartbeatMinFails){delegateExceptionCallback(ortc,`Heartbeat fails is out of limits - Min: ${heartbeatMinFails} | Max: ${heartbeatMaxFails}`);}else{heartbeatFails=newHeartbeatFails;}}else{delegateExceptionCallback(ortc,`Invalid heartbeat fails ${newHeartbeatFails}`);}};/*\n\t * Get heart beat active.\n\t */this.getHeartbeatActive=function(){return heartbeatActive;};/*\n\t * Set heart beat active. Heart beat provides better accuracy for presence data.\n\t */this.setHeartbeatActive=function(active){heartbeatActive=active;};/***********************************************************\n\t * @events\n\t ***********************************************************/this.onConnected=null;this.onDisconnected=null;this.onSubscribed=null;this.onUnsubscribed=null;this.onException=null;this.onReconnecting=null;this.onReconnected=null;/***********************************************************\n\t * @public methods\n\t ***********************************************************//*\n\t * Connects to the gateway with the application key and authentication token.\n\t */this.connect=function(appKey,authToken){/*\n\t Sanity Checks\n\t */if(isConnected){delegateExceptionCallback(ortc,\"Already connected\");}else if(!url&&!clusterUrl){delegateExceptionCallback(ortc,\"URL and Cluster URL are null or empty\");}else if(!appKey){delegateExceptionCallback(ortc,\"Application Key is null or empty\");}else if(!authToken){delegateExceptionCallback(ortc,\"Authentication Token is null or empty\");}else if(url&&!ortcIsValidUrl(url)){delegateExceptionCallback(ortc,\"Invalid URL\");}else if(clusterUrl&&!ortcIsValidUrl(clusterUrl)){delegateExceptionCallback(ortc,\"Invalid Cluster URL\");}else if(!ortcIsValidInput(appKey)){delegateExceptionCallback(ortc,\"Application Key has invalid characters\");}else if(!ortcIsValidInput(authToken)){delegateExceptionCallback(ortc,\"Authentication Token has invalid characters\");}else if(!ortcIsValidInput(announcementSubChannel)){delegateExceptionCallback(ortc,\"Announcement Subchannel has invalid characters\");}else if(connectionMetadata&&connectionMetadata.length>connectionMetadataMaxSize){delegateExceptionCallback(ortc,\"Connection metadata size exceeds the limit of \"+connectionMetadataMaxSize+\" characters\");}else{ortc.appKey=appKey;ortc.authToken=authToken;isConnecting=true;stopReconnecting=false;validatedArrived=false;clearValidatedTimeout(self);// Read SSL session cookie\n\t//var sslConn = readCookie(sslSessionCookieName);\n\tvar sslConn=false;if(sslConn){changeUrlSsl();}if(clusterUrl&&clusterUrl!=null){clusterUrl=clusterUrl.ortcTreatUrl();clusterConnection();}else{url=url.ortcTreatUrl();ortc.sockjs=createSocketConnection(url);}//If ssl connection increase connection timeout\n\tif(clusterUrl&&clusterUrl!=null&&clusterUrl.indexOf(\"/ssl\")>=0||url&&url.indexOf(\"https\")>=0){if(!retryingWithSsl){ortc.setConnectionTimeout(30*1000);}else{if(ortc.getConnectionTimeout()<300*1000){if(ortc.getConnectionTimeout()<30*1000){ortc.setConnectionTimeout(30*1000);}else{ortc.setConnectionTimeout((ortc.getConnectionTimeout()+10)*1000);}}else{stopReconnecting=true;clearReconnectInterval();}}}if(!ortc.reconnectIntervalId&&!stopReconnecting){// Interval to reconnect\n\tortc.reconnectIntervalId=setInterval(function(){if(stopReconnecting){clearReconnectInterval();}else{var currentDateTime=new Date();if(ortc.sockjs==null&&!waitingClusterResponse){reconnectSocket();}// 35 seconds\n\tif(lastKeepAlive!=null&&lastKeepAlive+35000<new Date().getTime()){lastKeepAlive=null;// Server went down\n\tif(isConnected){disconnectSocket();}}}},ortc.getConnectionTimeout());}}};this.setNotificationConfig=function(config){config.cmd=\"config\";this.sendMessageToServiceWorker(config);};this.showNotification=function(notification){notification.cmd=\"notification\";this.sendMessageToServiceWorker(notification);};this.sendMessageToServiceWorker=function(message){return new Promise(function(resolve,reject){var messageChannel=new MessageChannel();messageChannel.port1.onmessage=function(event){if(event.data.error){reject(event.data.error);}else{resolve(event.data);}};navigator.serviceWorker.controller.postMessage(message,[messageChannel.port2]);});};/*\n\t * Subscribes to the channel so the client object can receive all messages sent to it by other clients with Notifications.\n\t */this.subscribeWithNotifications=function(channel,subscribeOnReconnected,regId,onMessageCallback){ortc.registrationId=regId;this._subscribe(channel,subscribeOnReconnected,regId,null,onMessageCallback);};/*\n\t * Subscribes to the channel so the client object can receive all messages sent that are valid according to the given filter\n\t */this.subscribeWithFilter=function(channel,subscribeOnReconnected,filter,onMessageCallback){this._subscribe(channel,subscribeOnReconnected,null,filter,onMessageCallback);};/*\n\t * Subscribes to the channel so the client object can receive all messages sent to it by other clients.\n\t */this.subscribe=function(channel,subscribeOnReconnected,onMessageCallback){this._subscribe(channel,subscribeOnReconnected,null,null,onMessageCallback);};this._subscribe=function(channel,subscribeOnReconnected,regId,filter,onMessageCallback){/*\n\t Sanity Checks\n\t */if(!isConnected){delegateExceptionCallback(ortc,\"Not connected\");}else if(!channel){delegateExceptionCallback(ortc,\"Channel is null or empty\");}else if(!ortcIsValidInput(channel)){delegateExceptionCallback(ortc,\"Channel has invalid characters\");}else if(subscribedChannels[channel]&&subscribedChannels[channel].isSubscribing){delegateExceptionCallback(ortc,\"Already subscribing to the channel \\\"\"+channel+\"\\\"\");}else if(subscribedChannels[channel]&&subscribedChannels[channel].isSubscribed){delegateExceptionCallback(ortc,\"Already subscribed to the channel \\\"\"+channel+\"\\\"\");}else if(channel.length>channelMaxSize){delegateExceptionCallback(ortc,\"Channel size exceeds the limit of \"+channelMaxSize+\" characters\");}else if(!ortcIsValidBoolean(subscribeOnReconnected)){delegateExceptionCallback(ortc,\"The argument \\\"subscribeOnReconnected\\\" must be a boolean\");}else if(!ortcIsFunction(onMessageCallback)){delegateExceptionCallback(ortc,\"The argument \\\"onMessageCallback\\\" must be a function\");}else{if(ortc.sockjs!=null){var domainChannelCharacterIndex=channel.indexOf(\":\");var channelToValidate=channel;var hashPerm=null;if(domainChannelCharacterIndex>0){channelToValidate=channel.substring(0,domainChannelCharacterIndex+1)+\"*\";}if(userPerms&&userPerms!=null){hashPerm=userPerms[channelToValidate]?userPerms[channelToValidate]:userPerms[channel];}if(userPerms&&userPerms!=null&&!hashPerm){delegateExceptionCallback(ortc,\"No permission found to subscribe to the channel \\\"\"+channel+\"\\\"\");}else{if(subscribedChannels[channel]){subscribedChannels[channel].isSubscribing=true;subscribedChannels[channel].isSubscribed=false;subscribedChannels[channel].subscribeOnReconnected=subscribeOnReconnected;subscribedChannels[channel].onMessageCallback=onMessageCallback;subscribedChannels[channel].filter=filter;}else{subscribedChannels[channel]={\"isSubscribing\":true,\"isSubscribed\":false,\"subscribeOnReconnected\":subscribeOnReconnected,\"onMessageCallback\":onMessageCallback,\"filter\":filter};}if(regId){subscribedChannels[channel].withNotifications=true;ortc.sockjs.send(\"subscribe;\"+ortc.appKey+\";\"+ortc.authToken+\";\"+channel+\";\"+hashPerm+\";\"+regId+\";\"+pushPlatform);}else{subscribedChannels[channel].withNotifications=false;if(filter){ortc.sockjs.send(\"subscribefilter;\"+ortc.appKey+\";\"+ortc.authToken+\";\"+channel+\";\"+hashPerm+\";\"+filter);}else{ortc.sockjs.send(\"subscribe;\"+ortc.appKey+\";\"+ortc.authToken+\";\"+channel+\";\"+hashPerm);}}}}}};/*\n\t * Unsubscribes from the channel so the client object stops receiving messages sent to it.\n\t */this.unsubscribe=function(channel){/*\n\t Sanity Checks\n\t */if(!isConnected){delegateExceptionCallback(ortc,\"Not connected\");}else if(!channel){delegateExceptionCallback(ortc,\"Channel is null or empty\");}else if(!ortcIsValidInput(channel)){delegateExceptionCallback(ortc,\"Channel has invalid characters\");}else if(!subscribedChannels[channel]||subscribedChannels[channel]&&!subscribedChannels[channel].isSubscribed){delegateExceptionCallback(ortc,\"Not subscribed to the channel \"+channel);}else if(channel.length>channelMaxSize){delegateExceptionCallback(ortc,\"Channel size exceeds the limit of \"+channelMaxSize+\" characters\");}else{if(ortc.sockjs!=null){if(subscribedChannels[channel].withNotifications==true){ortc.sockjs.send(\"unsubscribe;\"+ortc.appKey+\";\"+channel+\";\"+ortc.registrationId+\";\"+pushPlatform);}else{ortc.sockjs.send(\"unsubscribe;\"+ortc.appKey+\";\"+channel);}}}};/*\n\t * Sends the message to the channel.\n\t */this.send=function(channel,message){/*\n\t Sanity Checks\n\t */if(!isConnected||ortc.sockjs==null){delegateExceptionCallback(ortc,\"Not connected\");}else if(!channel){delegateExceptionCallback(ortc,\"Channel is null or empty\");}else if(!ortcIsValidInput(channel)){delegateExceptionCallback(ortc,\"Channel has invalid characters\");}else if(!message){delegateExceptionCallback(ortc,\"Message is null or empty\");}else if(!ortcIsString(message)){delegateExceptionCallback(ortc,\"Message must be a string\");}else if(channel.length>channelMaxSize){delegateExceptionCallback(ortc,\"Channel size exceeds the limit of \"+channelMaxSize+\" characters\");}else{var domainChannelCharacterIndex=channel.indexOf(\":\");var channelToValidate=channel;var hashPerm=null;if(domainChannelCharacterIndex>0){channelToValidate=channel.substring(0,domainChannelCharacterIndex+1)+\"*\";}if(userPerms&&userPerms!=null){hashPerm=userPerms[channelToValidate]?userPerms[channelToValidate]:userPerms[channel];}if(userPerms&&userPerms!=null&&!hashPerm){delegateExceptionCallback(ortc,\"No permission found to send to the channel \\\"\"+channel+\"\\\"\");}else{// Multi part\n\tvar messageParts=[];var messageId=generateId(8);var i;var allowedMaxSize=messageMaxSize-channel.length;for(i=0;i<message.length;i=i+allowedMaxSize){// Just one part\n\tif(message.length<=allowedMaxSize){messageParts.push(message);break;}if(message.substring(i,i+allowedMaxSize)){messageParts.push(message.substring(i,i+allowedMaxSize));}}for(var j=1;j<=messageParts.length;j++){ortc.sockjs.send(\"send;\"+ortc.appKey+\";\"+ortc.authToken+\";\"+channel+\";\"+hashPerm+\";\"+messageId+\"_\"+j+\"-\"+messageParts.length+\"_\"+messageParts[j-1]);}}}};/*\n\t * Sends the message to multiple channels.\n\t */this.batchSend=function(channels,message){/*\n\t Sanity Checks\n\t */channels=ortcStrToArray(channels);if(!isConnected||ortc.sockjs==null){delegateExceptionCallback(ortc,\"Not connected\");}else if(!ortcIsArray(channels)){delegateExceptionCallback(ortc,\"Channels must be a array\");}else if(!message){delegateExceptionCallback(ortc,\"Message is null or empty\");}else if(!ortcIsString(message)){delegateExceptionCallback(ortc,\"Message must be a string\");}else if(channels.length<=0){delegateExceptionCallback(ortc,\"Channels must be an array at least with one channel\");}else if(channels.length>channelsMaxSize){channels=[];delegateExceptionCallback(ortc,\"The channel maximum was reached (>\"+channelsMaxSize+\")\");}for(i=0;i<channels.length;i++){var channel=channels[i];if(channel.length>channelMaxSize){channels.splice(i,1);delegateExceptionCallback(ortc,\"Channel \"+channel+\" size exceeds the limit of \"+channelMaxSize+\" characters\");}}if(channels.length>0){var arrayHashPerm=[];for(i=0;i<channels.length;i++){var channel=channels[i];var domainChannelCharacterIndex=channel.indexOf(\":\");var channelToValidate=channel;var hashPerm=null;if(domainChannelCharacterIndex>0){channelToValidate=channel.substring(0,domainChannelCharacterIndex+1)+\"*\";}if(userPerms&&userPerms!=null){hashPerm=userPerms[channelToValidate]?userPerms[channelToValidate]:userPerms[channel];}if(userPerms&&userPerms!=null&&!hashPerm){channels.splice(i,1);delegateExceptionCallback(ortc,\"No permission found to send to the channel \\\"\"+channel+\"\\\"\");}else{arrayHashPerm.push(hashPerm);}}if(channels.length>0){var messageParts=[];var messageId=generateId(8);var allowedMaxSize=messageMaxSize-channels.toString().length;for(i=0;i<message.length;i=i+allowedMaxSize){// Just one part\n\tif(message.length<=allowedMaxSize){messageParts.push(message);break;}if(message.substring(i,i+allowedMaxSize)){messageParts.push(message.substring(i,i+allowedMaxSize));}}for(j=1;j<=messageParts.length;j++){ortc.sockjs.send(\"batchSend;\"+ortc.appKey+\";\"+ortc.authToken+\";\"+JSON.stringify(channels)+\";\"+JSON.stringify(arrayHashPerm)+\";\"+messageId+\"_\"+j+\"-\"+messageParts.length+\"_\"+messageParts[j-1]);}}}};/*\n\t * Disconnects from the gateway.\n\t */this.disconnect=function(){clearReconnectInterval();stopReconnectProcess();// Clear subscribed channels\n\tsubscribedChannels={};/*\n\t Sanity Checks\n\t */if(!isConnected&&!invalidConnection){delegateExceptionCallback(ortc,\"Not connected\");}else{disconnectSocket();}};/*\n\t * Gets a value indicating whether this client object is subscribed to the channel.\n\t */this.isSubscribed=function(channel){/*\n\t Sanity Checks\n\t */if(!isConnected){delegateExceptionCallback(ortc,\"Not connected\");}else if(!channel){delegateExceptionCallback(ortc,\"Channel is null or empty\");}else if(!ortcIsValidInput(channel)){delegateExceptionCallback(ortc,\"Channel has invalid characters\");}else{if(subscribedChannels[channel]&&subscribedChannels[channel].isSubscribed){return subscribedChannels[channel].isSubscribed;}else{return false;}}};/*\n\t * Gets a json indicating the subscriptions in a channel.\n\t */this.presence=function(parameters,callback){try{var requestUrl=null,isCluster=false,appKey=ortc.appKey,authToken=ortc.authToken;if(parameters.url){requestUrl=parameters.url.ortcTreatUrl();isCluster=parameters.isCluster;appKey=parameters.applicationKey;authToken=parameters.authenticationToken;}else{if(clusterUrl&&clusterUrl!=null){requestUrl=clusterUrl;isCluster=true;}else{requestUrl=url.ortcTreatUrl();;}}getServerUrl({requestUrl:requestUrl,isCluster:isCluster,appKey:appKey},function(error,serverUrl){if(error){callback(error,null);}else{jsonp(serverUrl+\"/presence/\"+appKey+\"/\"+authToken+\"/\"+parameters.channel,callback);}});}catch(e){callback(\"Unable to get presence data\",null);}};var getServerUrl=function(parameters,callback){if(parameters.requestUrl&&parameters.isCluster){var guid=generateGuid();var queryString=\"guid=\"+generateGuid();queryString=parameters.appKey?queryString+\"&appkey=\"+parameters.appKey:queryString;loadClusterServerScript(parameters.requestUrl+\"/?\"+queryString,guid,function(clusterServerResolved,scriptGuid){if(clusterServerResolved){var resultUrl=SOCKET_SERVER;callback(null,resultUrl);}else{callback(null,\"Unable to get server from cluster\");}try{clearScripts(scriptGuid);}catch(loadError){}});}else{var resultUrl=parameters.requestUrl.ortcTreatUrl();callback(null,resultUrl);}};/*\n\t * Adds the Webspectator bootstrap script for the outmost frame on the same domain.\n\t */this.setMonetizerId=function(publicId){var tempWin;var win=tempWin=window;while(tempWin!=window.top){try{if(tempWin.frameElement){win=tempWin.parent;}}catch(e){}tempWin=tempWin.parent;}if(!win._WS_BOOT){var s=document.createElement(\"SCRIPT\");s.src=\"//wfpscripts.webspectator.com/bootstrap/ws-\"+publicId+\".js\";document.getElementsByTagName(\"head\")[0].appendChild(s);}};/***********************************************************\n\t * @private methods\n\t ***********************************************************//*\n\t * Change the current URL to use SSL\n\t */var changeUrlSsl=function(){if(!(\"ActiveXObject\"in window)){if(clusterUrl&&clusterUrl!=null){//clusterUrl = clusterUrl.replace(\"http://\", \"https://\");\n\tif(clusterUrl.indexOf(\"ssl/\")<0){var slashAtTheEnd=clusterUrl.search(/\\/([\\d.]*)\\/$/);if(slashAtTheEnd>-1){clusterUrl=clusterUrl.substring(0,slashAtTheEnd+1)+\"ssl/\"+clusterUrl.substring(slashAtTheEnd+1,clusterUrl.length);}else{clusterUrl=clusterUrl.substring(0,clusterUrl.lastIndexOf(\"/\")+1)+\"ssl/\"+clusterUrl.substring(clusterUrl.lastIndexOf(\"/\")+1);}}}else{url=url.replace(\"http://\",\"https://\");}}// Create session cookie\n\t//createSessionCookie(sslSessionCookieName, 1);\n\t};/*\n\t * Clear the reconnecting interval\n\t */var clearReconnectInterval=function(){if(ortc.reconnectIntervalId){clearInterval(ortc.reconnectIntervalId);ortc.reconnectIntervalId=null;}};/*\n\t * Clear the validated timeout\n\t */var clearValidatedTimeout=function(self){if(self.validatedTimeoutId){clearTimeout(self.validatedTimeoutId);self.validatedTimeoutId=null;}};/*\n\t * Stop the reconnecting process\n\t */var stopReconnectProcess=function(){stopReconnecting=true;alreadyConnectedFirstTime=false;};var startHeartBeatInterval=function(self){if(!self.heartbeatInterval&&heartbeatActive){self.sockjs.send(\"b\");self.heartbeatInterval=setInterval(function(){if(!heartbeatActive){stopHeartBeatInterval(self);}else{self.sockjs.send(\"b\");}},heartbeatTime*1000);}};var stopHeartBeatInterval=function(self){if(self.heartbeatInterval){clearInterval(self.heartbeatInterval);self.heartbeatInterval=null;}};/*\n\t * Creates a cookie with expiration time.\n\t */var createExpireCookie=function(name,value,minutes){var expires=\"\";if(minutes){var date=new Date();date.setTime(date.getTime()+minutes*60*1000);expires=\"; expires=\"+date.toGMTString();}document.cookie=name+\"=\"+value+expires+\"; path=/\";};/*\n\t * Creates a session cookie.\n\t */var createSessionCookie=function(name,value){document.cookie=name+\"=\"+value+\"; path=/\";};/*\n\t * Reads a cookie.\n\t */var readCookie=function(name){var nameEQ=name+\"=\";var ca=document.cookie.split(\";\");var result=null;for(var i=0;i<ca.length;i++){var c=ca[i];while(c.charAt(0)==\" \"){c=c.substring(1,c.length);}if(c.indexOf(nameEQ)==0){result=c.substring(nameEQ.length,c.length);break;}}return result;};/*\n\t * Generates an ID.\n\t */var generateId=function(size){var result=\"\";var S4=function(){return((1+Math.random())*0x10000|0).toString(16).substring(1);};for(var i=0;i<size/4;i++){result+=S4();}return result;};/*\n\t * Disconnects the socket.\n\t */var disconnectSocket=function(){stopHeartBeatInterval(ortc);reconnectStartedAt=null;isConnected=false;isConnecting=false;validatedArrived=false;retryingWithSsl=false;clearValidatedTimeout(self);if(ortc.sockjs!=null){ortc.sockjs.close();ortc.sockjs=null;}};/*\n\t * Reconnects the socket.\n\t */var reconnectSocket=function(){stopHeartBeatInterval(ortc);if(isConnecting){delegateExceptionCallback(ortc,\"Unable to connect\");}isConnecting=true;delegateReconnectingCallback(ortc);reconnectStartedAt=new Date().getTime();if(clusterUrl&&clusterUrl!=null){clusterConnection();}else{ortc.sockjs=createSocketConnection(url);}};/*\n\t * Tries a connection through the cluster gateway with the application key and authentication token.\n\t */var clusterConnection=function(){var guid=generateGuid();var queryString=\"guid=\"+generateGuid();queryString=ortc.appKey?queryString+\"&appkey=\"+ortc.appKey:queryString;loadClusterServerScript(clusterUrl+\"/?\"+queryString,guid,function(clusterServerResolved,scriptGuid){if(clusterServerResolved){url=SOCKET_SERVER;sockjs=createSocketConnection(ortc.getUrl());}try{clearScripts(scriptGuid);}catch(loadError){}});};/*\n\t * Clears the javascript scripts previously loaded into the page.\n\t */var clearScripts=function(guid){var headChildren=document.getElementsByTagName(\"head\")[0].children;var childrenToRemove=[];for(var i=0;i<headChildren.length;i++){if(headChildren[i].attributes!=null&&headChildren[i].attributes[\"ortcScriptId\"]&&headChildren[i].attributes[\"ortcScriptId\"].value==guid){childrenToRemove.push(i);}}for(var child in childrenToRemove){document.getElementsByTagName(\"head\")[0].removeChild(headChildren[childrenToRemove[child]]);}};/*\n\t * Loads the cluster server javascript script into the page.\n\t */var loadClusterServerScript=function(scriptUrl,guid,callback){var script=document.createElement(\"script\");script.type=\"text/javascript\";script.setAttribute(\"ortcScriptId\",guid);waitingClusterResponse=true;if(script.readyState){// IE\n\tscript.onreadystatechange=function(){if(script.readyState==\"loaded\"||script.readyState==\"complete\"){waitingClusterResponse=false;script.onreadystatechange=null;if(typeof SOCKET_SERVER!=\"undefined\"&&SOCKET_SERVER.indexOf(\"undefined\")<0&&SOCKET_SERVER.indexOf(\"unknown_server\")<0){callback(true,guid);}else{callback(false,guid);}}};}else{// Others\n\tscript.onload=function(){waitingClusterResponse=false;if(typeof SOCKET_SERVER!=\"undefined\"&&SOCKET_SERVER.indexOf(\"undefined\")<0&&SOCKET_SERVER.indexOf(\"unknown_server\")<0){callback(true,guid);}else{callback(false,guid);}};}script.onerror=function(){waitingClusterResponse=false;};script.src=scriptUrl;document.getElementsByTagName(\"head\")[0].appendChild(script);};/*\n\t * Generates a GUID.\n\t */var generateGuid=function(){var S4=function(){return((1+Math.random())*0x10000|0).toString(16).substring(1);};return S4()+S4()+\"-\"+S4()+\"-\"+S4()+\"-\"+S4()+\"-\"+S4()+S4()+S4();};/*\n\t * Count the dictionary keys.\n\t */var countKeys=function(dic){var count=0;for(var i in dic){count++;}return count;};/*\n\t * Creates a socket connection.\n\t */var createSocketConnection=function(connectionUrl){var self=ortc;if(self.sockjs==null){if(navigator&&navigator.userAgent&&navigator.userAgent.indexOf(\"PlayStation Vita\")>=0){protocol=\"jsonp-polling\";}self.sockjs=new SockJS(connectionUrl+\"/broadcast\",protocol);// Timeout to receive the validated message\n\tif(!self.sslFallback){var validateTimeoutTime=5000;self.validatedTimeoutId=setTimeout(function(){self.sslFallback=true;stopReconnectProcess();disconnectSocket();invalidConnection=true;retryingWithSsl=true;if(connectionUrl.indexOf(\"https://\")>=0){// We are already using SSL, try streaming\n\tprotocol=\"xhr-streaming\";}else{protocol=undefined;}changeUrlSsl();},validateTimeoutTime);}else if(!self.xhrStreamingFallback){// The SSL fallback failed. Try xhr-streaming\n\tvar validateSslTimeoutTime=5000;self.validatedTimeoutId=setTimeout(function(){self.xhrStreamingFallback=true;stopReconnectProcess();disconnectSocket();invalidConnection=true;retryingWithSsl=true;protocol=\"xhr-streaming\";},validateSslTimeoutTime);}// Connect handler\n\tself.sockjs.onopen=function(){protocol=self.sockjs.protocol;// Update last keep alive time\n\tlastKeepAlive=new Date().getTime();// If is a reconnect do not count session\n\tif(alreadyConnectedFirstTime){sessionId=\"\";}else{// Read session cookie\n\tsessionId=readCookie(sessionCookieName+self.appKey+\"-s\");if(!sessionId){// Read expiration cookie\n\tsessionId=readCookie(sessionCookieName+self.appKey);if(!sessionId){sessionId=generateId(16);}// Create session cookie\n\tcreateSessionCookie(sessionCookieName+self.appKey+\"-s\",sessionId);// Check if session cookie was created\n\tif(!readCookie(sessionCookieName+self.appKey+\"-s\")){sessionId=\"\";}}}var heartbeatDetails=heartbeatActive?\";\"+self.getHeartbeatTime()+\";\"+self.getHeartbeatFails()+\";\":\"\";self.sockjs.send(\"validate;\"+self.appKey+\";\"+self.authToken+\";\"+(announcementSubChannel?announcementSubChannel:\"\")+\";\"+sessionId+\";\"+connectionMetadata+heartbeatDetails);};// Disconnect handler\n\tself.sockjs.onclose=function(e){// e.code=1000 - e.reason=Normal closure\n\t// e.code=1006 - e.reason=WebSocket connection broken\n\t// e.code=2000 - e.reason=All transports failed\n\tstopHeartBeatInterval(ortc);if(ortc.sockjs!=null){ortc.sockjs.close();ortc.sockjs=null;}// Clear user permissions\n\tuserPerms=null;if(e.code!=1000){if(isConnected){isConnected=false;isConnecting=false;protocol=undefined;delegateDisconnectedCallback(self);}if(!stopReconnecting){if(!reconnectStartedAt||reconnectStartedAt+connectionTimeout<new Date().getTime()){reconnectSocket();}}}else{if(!invalidConnection){isConnected=false;isConnecting=false;protocol=undefined;delegateDisconnectedCallback(self);}}if(retryingWithSsl){self.connect(self.appKey,self.authToken);retryingWithSsl=false;}invalidConnection=false;};// Receive handler\n\tself.sockjs.onmessage=function(e){// Update last keep alive time\n\tlastKeepAlive=new Date().getTime();var data=e.data;var channel=data.ch;var message=data.m;var filtered=data.f;// Multi part\n\tvar regexPattern=/^(\\w[^_]*)_{1}(\\d*)-{1}(\\d*)_{1}([\\s\\S.]*)$/;var match=regexPattern.exec(message);var messageId=null;var messageCurrentPart=1;var messageTotalPart=1;var lastPart=false;if(match&&match.length>0){if(match[1]){messageId=match[1];}if(match[2]){messageCurrentPart=match[2];}if(match[3]){messageTotalPart=match[3];}if(match[4]){message=match[4];}}if(messageId){if(!messagesBuffer[messageId]){messagesBuffer[messageId]={};}messagesBuffer[messageId][messageCurrentPart]=message;if(countKeys(messagesBuffer[messageId])==messageTotalPart){lastPart=true;}}else{lastPart=true;}if(lastPart){if(messageId){message=\"\";for(var i=1;i<=messageTotalPart;i++){message+=messagesBuffer[messageId][i];delete messagesBuffer[messageId][i];}delete messagesBuffer[messageId];}delegateMessagesCallback(self,channel,filtered,message);}};self.sockjs.onortcsubscribed=function(e){lastKeepAlive=new Date().getTime();var channel=e.data;if(subscribedChannels[channel]){subscribedChannels[channel].isSubscribing=false;subscribedChannels[channel].isSubscribed=true;}delegateSubscribedCallback(self,channel);};self.sockjs.onortcunsubscribed=function(e){lastKeepAlive=new Date().getTime();var channel=e.data;if(subscribedChannels[channel]){subscribedChannels[channel].isSubscribed=false;}delegateUnsubscribedCallback(self,channel);};self.sockjs.onheartbeat=function(){lastKeepAlive=new Date().getTime();};self.sockjs.onortcvalidated=function(e){var sessionExpirationTime=30;if(e.data){userPerms=e.data;}if(e.set){sessionExpirationTime=e.set;}clearValidatedTimeout(self);validatedArrived=true;retryingWithSsl=false;isConnecting=false;isConnected=true;reconnectStartedAt=null;if(sessionId){if(!readCookie(sessionCookieName+self.appKey+\"-s\")){createSessionCookie(sessionCookieName+self.appKey+\"-s\",sessionId);}if(!readCookie(sessionCookieName+self.appKey)){createExpireCookie(sessionCookieName+self.appKey,sessionId,sessionExpirationTime);}}if(alreadyConnectedFirstTime){var channelsToRemove={};// Subscribe to the previously subscribed channels\n\tfor(var key in subscribedChannels){// Subscribe again\n\tif(subscribedChannels[key].subscribeOnReconnected==true&&(subscribedChannels[key].isSubscribing||subscribedChannels[key].isSubscribed)){subscribedChannels[key].isSubscribing=true;subscribedChannels[key].isSubscribed=false;var domainChannelCharacterIndex=key.indexOf(\":\");var channelToValidate=key;var hashPerm=null;if(domainChannelCharacterIndex>0){channelToValidate=key.substring(0,domainChannelCharacterIndex+1)+\"*\";}if(userPerms&&userPerms!=null){hashPerm=userPerms[channelToValidate]?userPerms[channelToValidate]:userPerms[key];}if(subscribedChannels[key].filter){self.sockjs.send(\"subscribefilter;\"+self.appKey+\";\"+self.authToken+\";\"+key+\";\"+hashPerm+\";\"+subscribedChannels[key].filter);}else{self.sockjs.send(\"subscribe;\"+self.appKey+\";\"+self.authToken+\";\"+key+\";\"+hashPerm);}}else{channelsToRemove[key]=key;}}for(var keyToRemove in channelsToRemove){delete subscribedChannels[keyToRemove];}messagesBuffer={};delegateReconnectedCallback(self);}else{alreadyConnectedFirstTime=true;delegateConnectedCallback(self);}};self.sockjs.onortcerror=function(e){lastKeepAlive=new Date().getTime();var data=e.data;var operation=data.op;var channel=data.ch;var error=data.ex?data.ex:data;delegateExceptionCallback(self,error);switch(operation){case\"validate\":if(error.indexOf(\"busy\")<0){invalidConnection=true;clearValidatedTimeout(self);retryingWithSsl=false;stopReconnectProcess();}else{clearValidatedTimeout(self);retryingWithSsl=false;}break;case\"subscribe\":if(channel&&subscribedChannels[channel]){subscribedChannels[channel].isSubscribing=false;}break;case\"subscribe_maxsize\":case\"unsubscribe_maxsize\":case\"shutdown\":clearValidatedTimeout(self);retryingWithSsl=false;break;case\"send_maxsize\":if(channel&&subscribedChannels[channel]){subscribedChannels[channel].isSubscribing=false;}stopReconnectProcess();break;default:break;}};}return self.sockjs;};var jsonp=function(url,callback){var head=document.head?document.head:document.getElementsByTagName(\"head\")[0];var script=document.createElement(\"script\");var guid=\"ortcJsonp\"+ +new Date();var jsonpCallTimeout=setTimeout(function(){try{callback(\"Unable to get data\",null);window[guid]=undefined;delete window[guid];head.removeChild(script);}catch(e){}},15*1000);window[guid]=function(data){clearTimeout(jsonpCallTimeout);if(data.error){callback(data.error,null);}else{callback(null,data.content);}try{window[guid]=undefined;delete window[guid];head.removeChild(script);}catch(e){}};script.setAttribute(\"src\",url+\"?callback=\"+guid);head.appendChild(script);};var delegateConnectedCallback=function(ortc){if(ortc!=null&&ortc.onConnected!=null){startHeartBeatInterval(ortc);ortc.onConnected(ortc);}};var delegateDisconnectedCallback=function(ortc){if(ortc!=null&&ortc.onDisconnected!=null){ortc.onDisconnected(ortc);}};var delegateSubscribedCallback=function(ortc,channel){if(ortc!=null&&ortc.onSubscribed!=null&&channel!=null){ortc.onSubscribed(ortc,channel);}};var delegateUnsubscribedCallback=function(ortc,channel){if(ortc!=null&&ortc.onUnsubscribed!=null&&channel!=null){ortc.onUnsubscribed(ortc,channel);}};var delegateMessagesCallback=function(ortc,channel,filtered,message){if(ortc!=null&&subscribedChannels[channel]&&subscribedChannels[channel].isSubscribed&&subscribedChannels[channel].onMessageCallback!=null){if(filtered==null){// regular subscription\n\tsubscribedChannels[channel].onMessageCallback(ortc,channel,message);}else{// filtered subscription\n\tsubscribedChannels[channel].onMessageCallback(ortc,channel,filtered,message);}}};var delegateExceptionCallback=function(ortc,event){if(ortc!=null&&ortc.onException!=null){ortc.onException(ortc,event);}};var delegateReconnectingCallback=function(ortc){if(ortc!=null&&ortc.onReconnecting!=null){ortc.onReconnecting(ortc);}};var delegateReconnectedCallback=function(ortc){if(ortc!=null&&ortc.onReconnected!=null){startHeartBeatInterval(ortc);ortc.onReconnected(ortc);}};}", "componentDidMount() {\n //setLocalNotification();\n }", "function AppMeasurement_Module_Media(s){var m=this;m.s=s;s=window;if(!s.s_c_in)s.s_c_il=[],s.s_c_in=0;m._il=s.s_c_il;m._in=s.s_c_in;m._il[m._in]=m;s.s_c_in++;m._c=\"s_m\";m.list=[];m.open=function(w,b,c,h){var d={},a=new Date,g=\"\",e;b||(b=-1);if(w&&c){if(!m.list)m.list={};m.list[w]&&m.close(w);if(h&&h.id)g=h.id;if(g)for(e in m.list)!Object.prototype[e]&&m.list[e]&&m.list[e].S==g&&m.close(m.list[e].name);d.name=w;d.length=b;d.u=0;d.c=0;d.playerName=m.playerName?m.playerName:c;d.S=g;d.L=0;d.f=0;d.timestamp=\r\n\t\tMath.floor(a.getTime()/1E3);d.j=0;d.r=d.timestamp;d.a=-1;d.B=\"\";d.k=-1;d.C=0;d.H={};d.F=0;d.m=0;d.e=\"\";d.A=0;d.K=0;d.z=0;d.D=0;d.l=!1;d.v=\"\";d.I=\"\";d.J=0;d.q=!1;d.G=\"\";d.complete=0;d.Q=0;d.o=0;d.p=0;m.list[w]=d}};m.openAd=function(w,b,c,h,d,a,g,e){var f={};m.open(w,b,c,e);if(f=m.list[w])f.l=!0,f.v=h,f.I=d,f.J=a,f.G=g};m.M=function(w){var b=m.list[w];m.list[w]=0;b&&b.monitor&&clearTimeout(b.monitor.R)};m.close=function(w){m.g(w,0,-1)};m.play=function(w,b,c,h){var d=m.g(w,1,b,c,h);if(d&&!d.monitor)d.monitor=\r\n\t\t{},d.monitor.update=function(){d.j==1&&m.g(d.name,3,-1);d.monitor.R=setTimeout(d.monitor.update,1E3)},d.monitor.update()};m.click=function(w,b){m.g(w,7,b)};m.complete=function(w,b){m.g(w,5,b)};m.stop=function(w,b){m.g(w,2,b)};m.track=function(w){m.g(w,4,-1)};m.P=function(w,b){var c=\"a.media.\",h=w.linkTrackVars,d=w.linkTrackEvents,a=\"m_i\",g,e=w.contextData,f;if(b.l){c+=\"ad.\";if(b.v)e[\"a.media.name\"]=b.v,e[c+\"pod\"]=b.I,e[c+\"podPosition\"]=b.J;if(!b.F)e[c+\"CPM\"]=b.G}if(b.q)e[c+\"clicked\"]=!0,b.q=!1;e[\"a.contentType\"]=\r\n\t\t\"video\"+(b.l?\"Ad\":\"\");e[\"a.media.channel\"]=m.channel;e[c+\"name\"]=b.name;e[c+\"playerName\"]=b.playerName;if(b.length>0)e[c+\"length\"]=b.length;e[c+\"timePlayed\"]=Math.floor(b.f);Math.floor(b.f)>0&&(e[c+\"timePlayed\"]=Math.floor(b.f));if(!b.F)e[c+\"view\"]=!0,a=\"m_s\",b.F=1;if(b.e){e[c+\"segmentNum\"]=b.m;e[c+\"segment\"]=b.e;if(b.A>0)e[c+\"segmentLength\"]=b.A;b.z&&b.f>0&&(e[c+\"segmentView\"]=!0)}if(!b.Q&&b.complete)e[c+\"complete\"]=!0,b.T=1;if(b.o>0)e[c+\"milestone\"]=b.o;if(b.p>0)e[c+\"offsetMilestone\"]=b.p;if(h)for(f in e)Object.prototype[f]||\r\n\t\t(h+=\",contextData.\"+f);g=e[\"a.contentType\"];w.pe=a;w.pev3=g;var s,n;if(m.contextDataMapping){if(!w.events2)w.events2=\"\";h&&(h+=\",events\");for(f in m.contextDataMapping)if(!Object.prototype[f]){a=f.length>c.length&&f.substring(0,c.length)==c?f.substring(c.length):\"\";g=m.contextDataMapping[f];if(typeof g==\"string\"){s=g.split(\",\");for(n=0;n<s.length;n++)g=s[n],f==\"a.contentType\"?(h&&(h+=\",\"+g),w[g]=e[f]):a==\"view\"||a==\"segmentView\"||a==\"clicked\"||a==\"complete\"||a==\"timePlayed\"||a==\"CPM\"?(d&&(d+=\",\"+\r\n\t\tg),a==\"timePlayed\"||a==\"CPM\"?e[f]&&(w.events2+=(w.events2?\",\":\"\")+g+\"=\"+e[f]):e[f]&&(w.events2+=(w.events2?\",\":\"\")+g)):a==\"segment\"&&e[f+\"Num\"]?(h&&(h+=\",\"+g),w[g]=e[f+\"Num\"]+\":\"+e[f]):(h&&(h+=\",\"+g),w[g]=e[f])}else if(a==\"milestones\"||a==\"offsetMilestones\")f=f.substring(0,f.length-1),e[f]&&m.contextDataMapping[f+\"s\"][e[f]]&&(d&&(d+=\",\"+m.contextDataMapping[f+\"s\"][e[f]]),w.events2+=(w.events2?\",\":\"\")+m.contextDataMapping[f+\"s\"][e[f]]);e[f]&&(e[f]=0);a==\"segment\"&&e[f+\"Num\"]&&(e[f+\"Num\"]=0)}}w.linkTrackVars=\r\n\t\th;w.linkTrackEvents=d};m.g=function(w,b,c,h,d){var a={},g=(new Date).getTime()/1E3,e,f,s=m.trackVars,n=m.trackEvents,o=m.trackSeconds,p=m.trackMilestones,q=m.trackOffsetMilestones,r=m.segmentByMilestones,t=m.segmentByOffsetMilestones,k,j,l=1,i={},u;if(!m.channel)m.channel=m.s.w.location.hostname;if(a=w&&m.list&&m.list[w]?m.list[w]:0){if(a.l)o=m.adTrackSeconds,p=m.adTrackMilestones,q=m.adTrackOffsetMilestones,r=m.adSegmentByMilestones,t=m.adSegmentByOffsetMilestones;c<0&&(c=a.j==1&&a.r>0?g-a.r+a.a:\r\n\t\ta.a);a.length>0&&(c=c<a.length?c:a.length);c<0&&(c=0);a.u=c;if(a.length>0)a.c=a.u/a.length*100,a.c=a.c>100?100:a.c;if(a.a<0)a.a=c;u=a.C;i.name=w;i.ad=a.l;i.length=a.length;i.openTime=new Date;i.openTime.setTime(a.timestamp*1E3);i.offset=a.u;i.percent=a.c;i.playerName=a.playerName;i.mediaEvent=a.k<0?\"OPEN\":b==1?\"PLAY\":b==2?\"STOP\":b==3?\"MONITOR\":b==4?\"TRACK\":b==5?\"COMPLETE\":b==7?\"CLICK\":\"CLOSE\";if(b>2||b!=a.j&&(b!=2||a.j==1)){if(!d)h=a.m,d=a.e;if(b){if(b==1)a.a=c;if((b<=3||b>=5)&&a.k>=0)if(l=!1,s=n=\r\n\t\t\"None\",a.k!=c){f=a.k;if(f>c)f=a.a,f>c&&(f=c);k=p?p.split(\",\"):0;if(a.length>0&&k&&c>=f)for(j=0;j<k.length;j++)if((e=k[j]?parseFloat(\"\"+k[j]):0)&&f/a.length*100<e&&a.c>=e)l=!0,j=k.length,i.mediaEvent=\"MILESTONE\",a.o=i.milestone=e;if((k=q?q.split(\",\"):0)&&c>=f)for(j=0;j<k.length;j++)if((e=k[j]?parseFloat(\"\"+k[j]):0)&&f<e&&c>=e)l=!0,j=k.length,i.mediaEvent=\"OFFSET_MILESTONE\",a.p=i.offsetMilestone=e}if(a.K||!d){if(r&&p&&a.length>0){if(k=p.split(\",\")){k.push(\"100\");for(j=f=0;j<k.length;j++)if(e=k[j]?parseFloat(\"\"+\r\n\t\tk[j]):0){if(a.c<e)h=j+1,d=\"M:\"+f+\"-\"+e,j=k.length;f=e}}}else if(t&&q&&(k=q.split(\",\"))){k.push(\"\"+(a.length>0?a.length:\"E\"));for(j=f=0;j<k.length;j++)if((e=k[j]?parseFloat(\"\"+k[j]):0)||k[j]==\"E\"){if(c<e||k[j]==\"E\")h=j+1,d=\"O:\"+f+\"-\"+e,j=k.length;f=e}}if(d)a.K=!0}if((d||a.e)&&d!=a.e){a.D=!0;if(!a.e)a.m=h,a.e=d;a.k>=0&&(l=!0)}if((b>=2||a.c>=100)&&a.a<c)a.L+=c-a.a,a.f+=c-a.a;if(b<=2||b==3&&!a.j)a.B+=(b==1||b==3?\"S\":\"E\")+Math.floor(c),a.j=b==3?1:b;if(!l&&a.k>=0&&b<=3&&(o=o?o:0)&&a.f>=o)l=!0,i.mediaEvent=\r\n\t\t\"SECONDS\";a.r=g;a.a=c}if(!b||b<=3&&a.c>=100)a.j!=2&&(a.B+=\"E\"+Math.floor(c)),b=0,s=n=\"None\",i.mediaEvent=\"CLOSE\";if(b==7)l=i.clicked=a.q=!0;if(b==5||m.completeByCloseOffset&&(!b||a.c>=100)&&a.length>0&&c>=a.length-m.completeCloseOffsetThreshold)l=i.complete=a.complete=!0;g=i.mediaEvent;g==\"MILESTONE\"?g+=\"_\"+i.milestone:g==\"OFFSET_MILESTONE\"&&(g+=\"_\"+i.offsetMilestone);a.H[g]?i.eventFirstTime=!1:(i.eventFirstTime=!0,a.H[g]=1);i.event=i.mediaEvent;i.timePlayed=a.L;i.segmentNum=a.m;i.segment=a.e;i.segmentLength=\r\n\t\ta.A;m.monitor&&b!=4&&m.monitor(m.s,i);b==0&&m.M(w);if(l&&a.C==u){w={};w.contextData={};w.linkTrackVars=s;w.linkTrackEvents=n;if(!w.linkTrackVars)w.linkTrackVars=\"\";if(!w.linkTrackEvents)w.linkTrackEvents=\"\";m.P(w,a);w.linkTrackVars||(w[\"!linkTrackVars\"]=1);w.linkTrackEvents||(w[\"!linkTrackEvents\"]=1);m.s.track(w);if(a.D)a.m=h,a.e=d,a.z=!0,a.D=!1;else if(a.f>0)a.z=!1;a.B=\"\";a.o=a.p=0;a.f-=Math.floor(a.f);a.k=c;a.C++}}}return a};m.O=function(w,b,c,h,d){var a=0;if(w&&(!m.autoTrackMediaLengthRequired||\r\n\t\tb&&b>0)){if(!m.list||!m.list[w]){if(c==1||c==3)m.open(w,b,\"HTML5 Video\",d),a=1}else a=1;a&&m.g(w,c,h,-1,0)}};m.attach=function(w){var b,c,h;if(w&&w.tagName&&w.tagName.toUpperCase()==\"VIDEO\"){if(!m.n)m.n=function(b,a,w){var c,f;if(m.autoTrack){c=b.currentSrc;(f=b.duration)||(f=-1);if(w<0)w=b.currentTime;m.O(c,f,a,w,b)}};b=function(){m.n(w,1,-1)};c=function(){m.n(w,1,-1)};m.i(w,\"play\",b);m.i(w,\"pause\",c);m.i(w,\"seeking\",c);m.i(w,\"seeked\",b);m.i(w,\"ended\",function(){m.n(w,0,-1)});m.i(w,\"timeupdate\",\r\n\t\tb);h=function(){!w.paused&&!w.ended&&!w.seeking&&m.n(w,3,-1);setTimeout(h,1E3)};h()}};m.i=function(m,b,c){m.attachEvent?m.attachEvent(\"on\"+b,c):m.addEventListener&&m.addEventListener(b,c,!1)};if(m.completeByCloseOffset==void 0)m.completeByCloseOffset=1;if(m.completeCloseOffsetThreshold==void 0)m.completeCloseOffsetThreshold=1;m.N=function(){var w,b;if(m.autoTrack&&(w=m.s.d.getElementsByTagName(\"VIDEO\")))for(b=0;b<w.length;b++)m.attach(w[b])};m.i(s,\"load\",m.N)}", "constructor(httpClient) {\n this.httpClient = httpClient;\n //public url_base = \"http://localhost:8080\";\n this.url_base = \"https://yaoyuan333.wm.r.appspot.com\";\n }", "function AppMeasurement_Module_Media(s){var m=this;m.s=s;s=window;if(!s.s_c_in)s.s_c_il=[],s.s_c_in=0;m._il=s.s_c_il;m._in=s.s_c_in;m._il[m._in]=m;s.s_c_in++;m._c=\"s_m\";m.list=[];m.open=function(w,b,c,h){var d={},a=new Date,g=\"\",e;b||(b=-1);if(w&&c){if(!m.list)m.list={};m.list[w]&&m.close(w);if(h&&h.id)g=h.id;if(g)for(e in m.list)!Object.prototype[e]&&m.list[e]&&m.list[e].S==g&&m.close(m.list[e].name);d.name=w;d.length=b;d.u=0;d.c=0;d.playerName=m.playerName?m.playerName:c;d.S=g;d.L=0;d.f=0;d.timestamp=\r\nMath.floor(a.getTime()/1E3);d.j=0;d.r=d.timestamp;d.a=-1;d.B=\"\";d.k=-1;d.C=0;d.H={};d.F=0;d.m=0;d.e=\"\";d.A=0;d.K=0;d.z=0;d.D=0;d.l=!1;d.v=\"\";d.I=\"\";d.J=0;d.q=!1;d.G=\"\";d.complete=0;d.Q=0;d.o=0;d.p=0;m.list[w]=d}};m.openAd=function(w,b,c,h,d,a,g,e){var f={};m.open(w,b,c,e);if(f=m.list[w])f.l=!0,f.v=h,f.I=d,f.J=a,f.G=g};m.M=function(w){var b=m.list[w];m.list[w]=0;b&&b.monitor&&clearTimeout(b.monitor.R)};m.close=function(w){m.g(w,0,-1)};m.play=function(w,b,c,h){var d=m.g(w,1,b,c,h);if(d&&!d.monitor)d.monitor=\r\n{},d.monitor.update=function(){d.j==1&&m.g(d.name,3,-1);d.monitor.R=setTimeout(d.monitor.update,1E3)},d.monitor.update()};m.click=function(w,b){m.g(w,7,b)};m.complete=function(w,b){m.g(w,5,b)};m.stop=function(w,b){m.g(w,2,b)};m.track=function(w){m.g(w,4,-1)};m.P=function(w,b){var c=\"a.media.\",h=w.linkTrackVars,d=w.linkTrackEvents,a=\"m_i\",g,e=w.contextData,f;if(b.l){c+=\"ad.\";if(b.v)e[\"a.media.name\"]=b.v,e[c+\"pod\"]=b.I,e[c+\"podPosition\"]=b.J;if(!b.F)e[c+\"CPM\"]=b.G}if(b.q)e[c+\"clicked\"]=!0,b.q=!1;e[\"a.contentType\"]=\r\n\"video\"+(b.l?\"Ad\":\"\");e[\"a.media.channel\"]=m.channel;e[c+\"name\"]=b.name;e[c+\"playerName\"]=b.playerName;if(b.length>0)e[c+\"length\"]=b.length;e[c+\"timePlayed\"]=Math.floor(b.f);Math.floor(b.f)>0&&(e[c+\"timePlayed\"]=Math.floor(b.f));if(!b.F)e[c+\"view\"]=!0,a=\"m_s\",b.F=1;if(b.e){e[c+\"segmentNum\"]=b.m;e[c+\"segment\"]=b.e;if(b.A>0)e[c+\"segmentLength\"]=b.A;b.z&&b.f>0&&(e[c+\"segmentView\"]=!0)}if(!b.Q&&b.complete)e[c+\"complete\"]=!0,b.T=1;if(b.o>0)e[c+\"milestone\"]=b.o;if(b.p>0)e[c+\"offsetMilestone\"]=b.p;if(h)for(f in e)Object.prototype[f]||\r\n(h+=\",contextData.\"+f);g=e[\"a.contentType\"];w.pe=a;w.pev3=g;var s,n;if(m.contextDataMapping){if(!w.events2)w.events2=\"\";h&&(h+=\",events\");for(f in m.contextDataMapping)if(!Object.prototype[f]){a=f.length>c.length&&f.substring(0,c.length)==c?f.substring(c.length):\"\";g=m.contextDataMapping[f];if(typeof g==\"string\"){s=g.split(\",\");for(n=0;n<s.length;n++)g=s[n],f==\"a.contentType\"?(h&&(h+=\",\"+g),w[g]=e[f]):a==\"view\"||a==\"segmentView\"||a==\"clicked\"||a==\"complete\"||a==\"timePlayed\"||a==\"CPM\"?(d&&(d+=\",\"+\r\ng),a==\"timePlayed\"||a==\"CPM\"?e[f]&&(w.events2+=(w.events2?\",\":\"\")+g+\"=\"+e[f]):e[f]&&(w.events2+=(w.events2?\",\":\"\")+g)):a==\"segment\"&&e[f+\"Num\"]?(h&&(h+=\",\"+g),w[g]=e[f+\"Num\"]+\":\"+e[f]):(h&&(h+=\",\"+g),w[g]=e[f])}else if(a==\"milestones\"||a==\"offsetMilestones\")f=f.substring(0,f.length-1),e[f]&&m.contextDataMapping[f+\"s\"][e[f]]&&(d&&(d+=\",\"+m.contextDataMapping[f+\"s\"][e[f]]),w.events2+=(w.events2?\",\":\"\")+m.contextDataMapping[f+\"s\"][e[f]]);e[f]&&(e[f]=0);a==\"segment\"&&e[f+\"Num\"]&&(e[f+\"Num\"]=0)}}w.linkTrackVars=\r\nh;w.linkTrackEvents=d};m.g=function(w,b,c,h,d){var a={},g=(new Date).getTime()/1E3,e,f,s=m.trackVars,n=m.trackEvents,o=m.trackSeconds,p=m.trackMilestones,q=m.trackOffsetMilestones,r=m.segmentByMilestones,t=m.segmentByOffsetMilestones,k,j,l=1,i={},u;if(!m.channel)m.channel=m.s.w.location.hostname;if(a=w&&m.list&&m.list[w]?m.list[w]:0){if(a.l)o=m.adTrackSeconds,p=m.adTrackMilestones,q=m.adTrackOffsetMilestones,r=m.adSegmentByMilestones,t=m.adSegmentByOffsetMilestones;c<0&&(c=a.j==1&&a.r>0?g-a.r+a.a:\r\na.a);a.length>0&&(c=c<a.length?c:a.length);c<0&&(c=0);a.u=c;if(a.length>0)a.c=a.u/a.length*100,a.c=a.c>100?100:a.c;if(a.a<0)a.a=c;u=a.C;i.name=w;i.ad=a.l;i.length=a.length;i.openTime=new Date;i.openTime.setTime(a.timestamp*1E3);i.offset=a.u;i.percent=a.c;i.playerName=a.playerName;i.mediaEvent=a.k<0?\"OPEN\":b==1?\"PLAY\":b==2?\"STOP\":b==3?\"MONITOR\":b==4?\"TRACK\":b==5?\"COMPLETE\":b==7?\"CLICK\":\"CLOSE\";if(b>2||b!=a.j&&(b!=2||a.j==1)){if(!d)h=a.m,d=a.e;if(b){if(b==1)a.a=c;if((b<=3||b>=5)&&a.k>=0)if(l=!1,s=n=\r\n\"None\",a.k!=c){f=a.k;if(f>c)f=a.a,f>c&&(f=c);k=p?p.split(\",\"):0;if(a.length>0&&k&&c>=f)for(j=0;j<k.length;j++)if((e=k[j]?parseFloat(\"\"+k[j]):0)&&f/a.length*100<e&&a.c>=e)l=!0,j=k.length,i.mediaEvent=\"MILESTONE\",a.o=i.milestone=e;if((k=q?q.split(\",\"):0)&&c>=f)for(j=0;j<k.length;j++)if((e=k[j]?parseFloat(\"\"+k[j]):0)&&f<e&&c>=e)l=!0,j=k.length,i.mediaEvent=\"OFFSET_MILESTONE\",a.p=i.offsetMilestone=e}if(a.K||!d){if(r&&p&&a.length>0){if(k=p.split(\",\")){k.push(\"100\");for(j=f=0;j<k.length;j++)if(e=k[j]?parseFloat(\"\"+\r\nk[j]):0){if(a.c<e)h=j+1,d=\"M:\"+f+\"-\"+e,j=k.length;f=e}}}else if(t&&q&&(k=q.split(\",\"))){k.push(\"\"+(a.length>0?a.length:\"E\"));for(j=f=0;j<k.length;j++)if((e=k[j]?parseFloat(\"\"+k[j]):0)||k[j]==\"E\"){if(c<e||k[j]==\"E\")h=j+1,d=\"O:\"+f+\"-\"+e,j=k.length;f=e}}if(d)a.K=!0}if((d||a.e)&&d!=a.e){a.D=!0;if(!a.e)a.m=h,a.e=d;a.k>=0&&(l=!0)}if((b>=2||a.c>=100)&&a.a<c)a.L+=c-a.a,a.f+=c-a.a;if(b<=2||b==3&&!a.j)a.B+=(b==1||b==3?\"S\":\"E\")+Math.floor(c),a.j=b==3?1:b;if(!l&&a.k>=0&&b<=3&&(o=o?o:0)&&a.f>=o)l=!0,i.mediaEvent=\r\n\"SECONDS\";a.r=g;a.a=c}if(!b||b<=3&&a.c>=100)a.j!=2&&(a.B+=\"E\"+Math.floor(c)),b=0,s=n=\"None\",i.mediaEvent=\"CLOSE\";if(b==7)l=i.clicked=a.q=!0;if(b==5||m.completeByCloseOffset&&(!b||a.c>=100)&&a.length>0&&c>=a.length-m.completeCloseOffsetThreshold)l=i.complete=a.complete=!0;g=i.mediaEvent;g==\"MILESTONE\"?g+=\"_\"+i.milestone:g==\"OFFSET_MILESTONE\"&&(g+=\"_\"+i.offsetMilestone);a.H[g]?i.eventFirstTime=!1:(i.eventFirstTime=!0,a.H[g]=1);i.event=i.mediaEvent;i.timePlayed=a.L;i.segmentNum=a.m;i.segment=a.e;i.segmentLength=\r\na.A;m.monitor&&b!=4&&m.monitor(m.s,i);b==0&&m.M(w);if(l&&a.C==u){w={};w.contextData={};w.linkTrackVars=s;w.linkTrackEvents=n;if(!w.linkTrackVars)w.linkTrackVars=\"\";if(!w.linkTrackEvents)w.linkTrackEvents=\"\";m.P(w,a);w.linkTrackVars||(w[\"!linkTrackVars\"]=1);w.linkTrackEvents||(w[\"!linkTrackEvents\"]=1);m.s.track(w);if(a.D)a.m=h,a.e=d,a.z=!0,a.D=!1;else if(a.f>0)a.z=!1;a.B=\"\";a.o=a.p=0;a.f-=Math.floor(a.f);a.k=c;a.C++}}}return a};m.O=function(w,b,c,h,d){var a=0;if(w&&(!m.autoTrackMediaLengthRequired||\r\nb&&b>0)){if(!m.list||!m.list[w]){if(c==1||c==3)m.open(w,b,\"HTML5 Video\",d),a=1}else a=1;a&&m.g(w,c,h,-1,0)}};m.attach=function(w){var b,c,h;if(w&&w.tagName&&w.tagName.toUpperCase()==\"VIDEO\"){if(!m.n)m.n=function(b,a,w){var c,f;if(m.autoTrack){c=b.currentSrc;(f=b.duration)||(f=-1);if(w<0)w=b.currentTime;m.O(c,f,a,w,b)}};b=function(){m.n(w,1,-1)};c=function(){m.n(w,1,-1)};m.i(w,\"play\",b);m.i(w,\"pause\",c);m.i(w,\"seeking\",c);m.i(w,\"seeked\",b);m.i(w,\"ended\",function(){m.n(w,0,-1)});m.i(w,\"timeupdate\",\r\nb);h=function(){!w.paused&&!w.ended&&!w.seeking&&m.n(w,3,-1);setTimeout(h,1E3)};h()}};m.i=function(m,b,c){m.attachEvent?m.attachEvent(\"on\"+b,c):m.addEventListener&&m.addEventListener(b,c,!1)};if(m.completeByCloseOffset==void 0)m.completeByCloseOffset=1;if(m.completeCloseOffsetThreshold==void 0)m.completeCloseOffsetThreshold=1;m.N=function(){var w,b;if(m.autoTrack&&(w=m.s.d.getElementsByTagName(\"VIDEO\")))for(b=0;b<w.length;b++)m.attach(w[b])};m.i(s,\"load\",m.N)}", "create () {\r\n // Send a create-job message to the native-app.\r\n openPort();\r\n return browser.storage.local.get({ props: {} }).then(result => {\r\n // Get a cookie jar for the job.\r\n return getCookieJarForVideo(this.props.videoUrl).then(cookieJar => {\r\n state.port.postMessage({\r\n topic: 'create-job',\r\n data: {\r\n jobId: this.id,\r\n // Merge the default props and the job props.\r\n props: Object.assign({ cookieJar }, result.props, this.props)\r\n }\r\n });\r\n \r\n // Flag this job as active.\r\n this.state = 'active';\r\n \r\n // Make the icon blue because a job is running.\r\n browser.browserAction.setIcon({\r\n path: 'icons/film-blue.svg'\r\n });\r\n });\r\n });\r\n }", "supportsPlatform() {\n return true;\n }", "function FileSystemService($http, $q, $log) {\n var _directory = LocalFileSystem.PERSISTENT;\n var _fs = null;\n var _that = this;\n\n this.isInitalized = false;\n\n function errorHandler(e) {\n var msg = '';\n\n switch (e.code) {\n case FileError.QUOTA_EXCEEDED_ERR:\n msg = 'QUOTA_EXCEEDED_ERR';\n break;\n case FileError.NOT_FOUND_ERR:\n msg = 'NOT_FOUND_ERR';\n break;\n case FileError.SECURITY_ERR:\n msg = 'SECURITY_ERR';\n break;\n case FileError.INVALID_MODIFICATION_ERR:\n msg = 'INVALID_MODIFICATION_ERR';\n break;\n case FileError.INVALID_STATE_ERR:\n msg = 'INVALID_STATE_ERR';\n break;\n default:\n msg = 'Unknown Error';\n break;\n };\n\n $log.error('FileSystemService: ' + msg);\n }\n\n // startup\n window.requestFileSystem(_directory, 0, function(fs){\n _fs = fs;\n _that.isInitalized = true;\n }, errorHandler);\n\n\n /**\n * Checks if file is in persistent storage\n */\n this.fileExists = function(filename) {\n // fs not initialised\n if(!_that.isInitalized)\n return;\n //var uri = _directory + \"/\" + filename;\n //return $http.get(uri);\n var deferred = $q.defer();\n\n _fs.root.getFile(filename, {}, function(fileEntry) {\n // Get a File object representing the file,\n // then use FileReader to read its contents.\n fileEntry.file(function(file) {\n var reader = new FileReader();\n\n reader.onloadend = function(e) {\n deferred.resolve(e.target.result);\n };\n\n reader.readAsDataURL(file);\n }, errorHandler);\n }, errorHandler);\n\n return deferred.promise;\n }\n\n /**\n * Get File from perstistent storage\n */\n this.getFile = function(filename) {\n // fs not initialised\n if(!_that.isInitalized)\n return;\n //var uri = _directory + \"/\" + filename;\n //return $http.get(uri);\n var deferred = $q.defer();\n\n _fs.root.getFile(filename, {}, function(fileEntry) {\n // Get a File object representing the file,\n // then use FileReader to read its contents.\n fileEntry.file(function(file) {\n var reader = new FileReader();\n\n reader.onloadend = function(e) {\n deferred.resolve(e.target.result);\n };\n\n reader.readAsDataURL(file);\n }, errorHandler);\n }, errorHandler);\n\n return deferred.promise;\n }\n\n /**\n * Save data into file (and create that if necessary).\n */\n this.saveFile = function(filename, data) {\n // fs not initialised\n if(!_that.isInitalized)\n return;\n\n var deferred = $q.defer();\n\n _fs.root.getFile(filename, {create: true}, function(fileEntry) {\n // Create a FileWriter object for our FileEntry (log.txt).\n fileEntry.createWriter(function(fileWriter) {\n\n fileWriter.onwriteend = function(e) {\n $log.log('Write completed.');\n deferred.resolve();\n };\n\n fileWriter.onerror = function(e) {\n deferred.reject(e);\n $log.error('FileSystemService: write failed, ' + e.toString());\n };\n\n // Create a new Blob and write it to log.txt.\n var blob = new Blob([data], {type: 'text/plain'});\n\n fileWriter.write(blob);\n\n }, errorHandler);\n }, errorHandler);\n\n return deferred.promise;\n }\n}", "static initialize(app, changeLogService, deviceService, deviceFileService, deviceFileUploadService, file, httpService, localDBManagementService, localDbService, networkService, securityService) {\n if (this.initialized) {\n return;\n }\n deviceService.addStartUpService({\n serviceName: 'OfflineStartupService',\n start: () => {\n if (window['SQLitePlugin']) {\n localDBManagementService.setLogSQl((sessionStorage.getItem('wm.logSql') === 'true') || (sessionStorage.getItem('debugMode') === 'true'));\n window.logSql = (flag = true) => {\n localDBManagementService.setLogSQl(flag);\n sessionStorage.setItem('wm.logSql', flag ? 'true' : 'false');\n };\n window.executeLocalSql = (dbName, query, params) => {\n localDBManagementService.executeSQLQuery(dbName, query, params, true);\n };\n return localDBManagementService.loadDatabases().then(() => {\n changeLogService.addWorker(new IdResolver(localDBManagementService));\n changeLogService.addWorker(new ErrorBlocker(localDBManagementService));\n changeLogService.addWorker(new FileHandler());\n changeLogService.addWorker(new MultiPartParamTransformer(deviceFileService, localDBManagementService));\n new LiveVariableOfflineBehaviour(changeLogService, httpService, localDBManagementService, networkService, localDbService).add();\n new FileUploadOfflineBehaviour(changeLogService, deviceFileService, deviceFileUploadService, file, networkService, deviceFileService.getUploadDirectory()).add();\n new NamedQueryExecutionOfflineBehaviour(changeLogService, httpService, localDBManagementService, networkService).add();\n localDBManagementService.registerCallback(new UploadedFilesImportAndExportService(changeLogService, deviceFileService, localDBManagementService, file));\n changeLogService.addWorker({\n onAddCall: () => {\n if (!networkService.isConnected()) {\n networkService.disableAutoConnect();\n }\n },\n postFlush: stats => {\n if (stats.totalTaskCount > 0) {\n localDBManagementService.close()\n .catch(noop)\n .then(() => {\n location.assign(window.location.origin + window.location.pathname);\n });\n }\n }\n });\n });\n }\n return Promise.resolve();\n }\n });\n new SecurityOfflineBehaviour(app, file, deviceService, networkService, securityService).add();\n }", "constructor(){\n\t\t//console.log('API START');\n\t}", "get deviceServiceUUID() { return this._deviceServiceUUID ? this._deviceServiceUUID : 'FFE0'; }", "constructor () {\r\n\t\t\r\n\t}", "_sdkCompatibility() {\n // WebSocket\n // http://caniuse.com/#feat=websockets\n var canCreateWebSocket = 'WebSocket' in window;\n console.log('Native WebSocket capability: ' +\n canCreateWebSocket);\n\n if (!canCreateWebSocket) {\n throw new Error('No WebSocket capabilities');\n }\n }", "constructor(args) {\n super();\n args = args || {}\n this.CONSTRUCTOR_ID = 0x330b4067;\n this.SUBCLASS_OF_ID = 0xd3262a4a;\n\n this.phonecallsEnabled = args.phonecallsEnabled || null;\n this.defaultP2pContacts = args.defaultP2pContacts || null;\n this.preloadFeaturedStickers = args.preloadFeaturedStickers || null;\n this.ignorePhoneEntities = args.ignorePhoneEntities || null;\n this.revokePmInbox = args.revokePmInbox || null;\n this.blockedMode = args.blockedMode || null;\n this.pfsEnabled = args.pfsEnabled || null;\n this.date = args.date;\n this.expires = args.expires;\n this.testMode = args.testMode;\n this.thisDc = args.thisDc;\n this.dcOptions = args.dcOptions;\n this.dcTxtDomainName = args.dcTxtDomainName;\n this.chatSizeMax = args.chatSizeMax;\n this.megagroupSizeMax = args.megagroupSizeMax;\n this.forwardedCountMax = args.forwardedCountMax;\n this.onlineUpdatePeriodMs = args.onlineUpdatePeriodMs;\n this.offlineBlurTimeoutMs = args.offlineBlurTimeoutMs;\n this.offlineIdleTimeoutMs = args.offlineIdleTimeoutMs;\n this.onlineCloudTimeoutMs = args.onlineCloudTimeoutMs;\n this.notifyCloudDelayMs = args.notifyCloudDelayMs;\n this.notifyDefaultDelayMs = args.notifyDefaultDelayMs;\n this.pushChatPeriodMs = args.pushChatPeriodMs;\n this.pushChatLimit = args.pushChatLimit;\n this.savedGifsLimit = args.savedGifsLimit;\n this.editTimeLimit = args.editTimeLimit;\n this.revokeTimeLimit = args.revokeTimeLimit;\n this.revokePmTimeLimit = args.revokePmTimeLimit;\n this.ratingEDecay = args.ratingEDecay;\n this.stickersRecentLimit = args.stickersRecentLimit;\n this.stickersFavedLimit = args.stickersFavedLimit;\n this.channelsReadMediaPeriod = args.channelsReadMediaPeriod;\n this.tmpSessions = args.tmpSessions || null;\n this.pinnedDialogsCountMax = args.pinnedDialogsCountMax;\n this.pinnedInfolderCountMax = args.pinnedInfolderCountMax;\n this.callReceiveTimeoutMs = args.callReceiveTimeoutMs;\n this.callRingTimeoutMs = args.callRingTimeoutMs;\n this.callConnectTimeoutMs = args.callConnectTimeoutMs;\n this.callPacketTimeoutMs = args.callPacketTimeoutMs;\n this.meUrlPrefix = args.meUrlPrefix;\n this.autoupdateUrlPrefix = args.autoupdateUrlPrefix || null;\n this.gifSearchUsername = args.gifSearchUsername || null;\n this.venueSearchUsername = args.venueSearchUsername || null;\n this.imgSearchUsername = args.imgSearchUsername || null;\n this.staticMapsProvider = args.staticMapsProvider || null;\n this.captionLengthMax = args.captionLengthMax;\n this.messageLengthMax = args.messageLengthMax;\n this.webfileDcId = args.webfileDcId;\n this.suggestedLangCode = args.suggestedLangCode || null;\n this.langPackVersion = args.langPackVersion || null;\n this.baseLangPackVersion = args.baseLangPackVersion || null;\n }", "static _getName() {\n return 'ContentPlayback';\n }", "initleancloud() {\n AV.init({\n appId: keys.appId,\n appKey: keys.appKey\n })\n this.globalData.AV = AV\n }", "start(callback){\n \n }", "onStartHeaders() {}", "async componentWillMount() {\n var _this = this\n _this.setUpUserDataFromFB()\n\n //ASK FOR CAMERA ONLT IF IS PREVIEW TRUE AND SHOWBARCODE TRUE\n if (Config.isPreview && Config.showBCScanner) {\n const { status } = await Permissions.askAsync(Permissions.CAMERA);\n this.setState({ hasCameraPermission: status === 'granted' });\n }\n\n\n\n AppEventEmitter.addListener('user.state.changes', this.alterUserState);\n if (Config.isTesterApp) {\n this.listenForUserAuth();\n } else if (Config.isPreview && !Config.isTesterApp) {\n //Load list of apps\n _this.retreiveAppDemos(\"apps\");\n }\n\n if (!Config.isPreview && !Config.isTesterApp) {\n\n //Load the data automatically, this is normal app and refister for Push notification\n this.registerForPushNotificationsAsync();\n Notifications.addListener(this._handleNotification);\n this.retreiveMeta();\n }\n\n\n await Font.loadAsync({\n //\"Material Icons\": require(\"@expo/vector-icons/fonts/MaterialIcons.ttf\"),\n //\"Ionicons\": require(\"@expo/vector-icons/fonts/Ionicons.ttf\"),\n // \"Feather\": require(\"@expo/vector-icons/fonts/Feather.ttf\"),\n 'open-sans': require('./assets/fonts/OpenSans-Regular.ttf'),\n 'lato-light': require('./assets/fonts/Lato-Light.ttf'),\n 'lato-regular': require('./assets/fonts/Lato-Regular.ttf'),\n 'lato-bold': require('./assets/fonts/Lato-Bold.ttf'),\n 'lato-black': require('./assets/fonts/Lato-Black.ttf'),\n 'roboto-medium': require('./assets/fonts/Roboto-Medium.ttf'),\n 'roboto-bold': require('./assets/fonts/Roboto-Bold.ttf'),\n 'roboto-light': require('./assets/fonts/Roboto-Light.ttf'),\n 'roboto-thin': require('./assets/fonts/Roboto-Thin.ttf'),\n\n });\n\n this.setState({ isReady: true, fontLoaded: true });\n }", "function writeHeader() {\n seekHead = createSeekHead();\n \n let\n ebmlHeader = {\n \"id\": 0x1a45dfa3, // EBML\n \"data\": [\n {\n \"id\": 0x4286, // EBMLVersion\n \"data\": 1\n },\n {\n \"id\": 0x42f7, // EBMLReadVersion\n \"data\": 1\n },\n {\n \"id\": 0x42f2, // EBMLMaxIDLength\n \"data\": 4\n },\n {\n \"id\": 0x42f3, // EBMLMaxSizeLength\n \"data\": 8\n },\n {\n \"id\": 0x4282, // DocType\n \"data\": \"webm\"\n },\n {\n \"id\": 0x4287, // DocTypeVersion\n \"data\": 2\n },\n {\n \"id\": 0x4285, // DocTypeReadVersion\n \"data\": 2\n }\n ]\n },\n \n segmentInfo = {\n \"id\": 0x1549a966, // Info\n \"data\": [\n {\n \"id\": 0x2ad7b1, // TimecodeScale\n \"data\": 1e6 // Times will be in miliseconds (1e6 nanoseconds per step = 1ms)\n },\n {\n \"id\": 0x4d80, // MuxingApp\n \"data\": \"webm-writer-js\",\n },\n {\n \"id\": 0x5741, // WritingApp\n \"data\": \"webm-writer-js\"\n },\n segmentDuration // To be filled in later\n ]\n },\n \n videoProperties = [\n {\n \"id\": 0xb0, // PixelWidth\n \"data\": videoWidth\n },\n {\n \"id\": 0xba, // PixelHeight\n \"data\": videoHeight\n }\n ];\n \n if (options.transparent) {\n videoProperties.push(\n {\n \"id\": 0x53C0, // AlphaMode\n \"data\": 1\n }\n );\n }\n \n let\n tracks = {\n \"id\": 0x1654ae6b, // Tracks\n \"data\": [\n {\n \"id\": 0xae, // TrackEntry\n \"data\": [\n {\n \"id\": 0xd7, // TrackNumber\n \"data\": DEFAULT_TRACK_NUMBER\n },\n {\n \"id\": 0x73c5, // TrackUID\n \"data\": DEFAULT_TRACK_NUMBER\n },\n {\n \"id\": 0x9c, // FlagLacing\n \"data\": 0\n },\n {\n \"id\": 0x22b59c, // Language\n \"data\": \"und\"\n },\n {\n \"id\": 0x86, // CodecID\n \"data\": \"V_VP8\"\n },\n {\n \"id\": 0x258688, // CodecName\n \"data\": \"VP8\"\n },\n {\n \"id\": 0x83, // TrackType\n \"data\": 1\n },\n {\n \"id\": 0xe0, // Video\n \"data\": videoProperties\n }\n ]\n }\n ]\n };\n \n ebmlSegment = {\n \"id\": 0x18538067, // Segment\n \"size\": -1, // Unbounded size\n \"data\": [\n seekHead,\n segmentInfo,\n tracks,\n ]\n };\n \n let\n bufferStream = new ArrayBufferDataStream(256);\n \n writeEBML(bufferStream, blobBuffer.pos, [ebmlHeader, ebmlSegment]);\n blobBuffer.write(bufferStream.getAsDataArray());\n \n // Now we know where these top-level elements lie in the file:\n seekPoints.SegmentInfo.positionEBML.data = fileOffsetToSegmentRelative(segmentInfo.offset);\n seekPoints.Tracks.positionEBML.data = fileOffsetToSegmentRelative(tracks.offset);\n \n\t writtenHeader = true;\n }", "function AppMeasurement(){var s=this;s.version=\"1.0.3\";var w=window;if(!w.s_c_in)w.s_c_il=[],w.s_c_in=0;s._il=w.s_c_il;s._in=w.s_c_in;s._il[s._in]=s;w.s_c_in++;s._c=\"s_c\";var n=w,g,k;try{g=n.parent;for(k=n.location;g&&g.location&&k&&\"\"+g.location!=\"\"+k&&n.location&&\"\"+g.location!=\"\"+n.location&&g.location.host==k.host;)n=g,g=n.parent}catch(o){}s.za=function(s){try{console.log(s)}catch(a){}};s.ba=function(s){return\"\"+parseInt(s)==\"\"+s};s.replace=function(s,a,c){if(!s||s.indexOf(a)<0)return s;return s.split(a).join(c)};\r\ns.escape=function(b){var a,c;if(!b)return b;b=encodeURIComponent(b);for(a=0;a<7;a++)c=\"+~!*()'\".substring(a,a+1),b.indexOf(c)>=0&&(b=s.replace(b,c,\"%\"+c.charCodeAt(0).toString(16).toUpperCase()));return b};s.unescape=function(b){if(!b)return b;b=b.indexOf(\"+\")>=0?s.replace(b,\"+\",\" \"):b;try{return decodeURIComponent(b)}catch(a){}return unescape(b)};s.pa=function(){var b=w.location.hostname,a=s.fpCookieDomainPeriods,c;if(!a)a=s.cookieDomainPeriods;if(b&&!s.U&&!/^[0-9.]+$/.test(b)&&(a=a?parseInt(a):\r\n2,a=a>2?a:2,c=b.lastIndexOf(\".\"),c>=0)){for(;c>=0&&a>1;)c=b.lastIndexOf(\".\",c-1),a--;s.U=c>0?b.substring(c):b}return s.U};s.c_r=s.cookieRead=function(b){b=s.escape(b);var a=\" \"+s.d.cookie,c=a.indexOf(\" \"+b+\"=\"),e=c<0?c:a.indexOf(\";\",c);b=c<0?\"\":s.unescape(a.substring(c+2+b.length,e<0?a.length:e));return b!=\"[[B]]\"?b:\"\"};s.c_w=s.cookieWrite=function(b,a,c){var e=s.pa(),d=s.cookieLifetime,f;a=\"\"+a;d=d?(\"\"+d).toUpperCase():\"\";c&&d!=\"SESSION\"&&d!=\"NONE\"&&((f=a!=\"\"?parseInt(d?d:0):-60)?(c=new Date,c.setTime(c.getTime()+\r\nf*1E3)):c==1&&(c=new Date,f=c.getYear(),c.setYear(f+5+(f<1900?1900:0))));if(b&&d!=\"NONE\")return s.d.cookie=b+\"=\"+s.escape(a!=\"\"?a:\"[[B]]\")+\"; path=/;\"+(c&&d!=\"SESSION\"?\" expires=\"+c.toGMTString()+\";\":\"\")+(e?\" domain=\"+e+\";\":\"\"),s.cookieRead(b)==a;return 0};s.v=[];s.V=function(b,a){if(s.W)return 0;if(!s.maxDelay)s.maxDelay=250;var c=0,e=(new Date).getTime()+s.maxDelay,d=s.d.Ma,f=[\"webkitvisibilitychange\",\"visibilitychange\"];if(!d)d=s.d.Na;if(d&&d==\"prerender\"){if(!s.G){s.G=1;for(c=0;c<f.length;c++)s.d.addEventListener(f[c],\r\nfunction(){var b=s.d.Ma;if(!b)b=s.d.Na;if(b==\"visible\")s.G=0,s.delayReady()})}c=1;e=0}else s.u(\"_d\")&&(c=1);c&&(s.v.push({m:b,a:a,t:e}),s.G||setTimeout(s.delayReady,s.maxDelay));return c};s.delayReady=function(){var b=(new Date).getTime(),a=0,c;for(s.u(\"_d\")&&(a=1);s.v.length>0;){c=s.v.shift();if(a&&!c.t&&c.t>b){s.v.unshift(c);setTimeout(s.delayReady,parseInt(s.maxDelay/2));break}s.W=1;s[c.m].apply(s,c.a);s.W=0}};s.setAccount=s.sa=function(b){var a,c;if(!s.V(\"setAccount\",arguments))if(s.account=b,\r\ns.allAccounts){a=s.allAccounts.concat(b.split(\",\"));s.allAccounts=[];a.sort();for(c=0;c<a.length;c++)(c==0||a[c-1]!=a[c])&&s.allAccounts.push(a[c])}else s.allAccounts=b.split(\",\")};s.P=function(b,a,c,e,d){var f=\"\",i,j,w,q,g=0;b==\"contextData\"&&(b=\"c\");if(a){for(i in a)if(!Object.prototype[i]&&(!d||i.substring(0,d.length)==d)&&a[i]&&(!c||c.indexOf(\",\"+(e?e+\".\":\"\")+i+\",\")>=0)){w=!1;if(g)for(j=0;j<g.length;j++)i.substring(0,g[j].length)==g[j]&&(w=!0);if(!w&&(f==\"\"&&(f+=\"&\"+b+\".\"),j=a[i],d&&(i=i.substring(d.length)),\r\ni.length>0))if(w=i.indexOf(\".\"),w>0)j=i.substring(0,w),w=(d?d:\"\")+j+\".\",g||(g=[]),g.push(w),f+=s.P(j,a,c,e,w);else if(typeof j==\"boolean\"&&(j=j?\"true\":\"false\"),j){if(e==\"retrieveLightData\"&&d.indexOf(\".contextData.\")<0)switch(w=i.substring(0,4),q=i.substring(4),i){case \"transactionID\":i=\"xact\";break;case \"channel\":i=\"ch\";break;case \"campaign\":i=\"v0\";break;default:s.ba(q)&&(w==\"prop\"?i=\"c\"+q:w==\"eVar\"?i=\"v\"+q:w==\"list\"?i=\"l\"+q:w==\"hier\"&&(i=\"h\"+q,j=j.substring(0,255)))}f+=\"&\"+s.escape(i)+\"=\"+s.escape(j)}}f!=\r\n\"\"&&(f+=\"&.\"+b)}return f};s.ra=function(){var b=\"\",a,c,e,d,f,i,j,w,g=\"\",n=\"\",k=c=\"\";if(s.lightProfileID)a=s.J,(g=s.lightTrackVars)&&(g=\",\"+g+\",\"+s.ea.join(\",\")+\",\");else{a=s.e;if(s.pe||s.linkType)if(g=s.linkTrackVars,n=s.linkTrackEvents,s.pe&&(c=s.pe.substring(0,1).toUpperCase()+s.pe.substring(1),s[c]))g=s[c].Va,n=s[c].Ua;g&&(g=\",\"+g+\",\"+s.C.join(\",\")+\",\");n&&(n=\",\"+n+\",\",g&&(g+=\",events,\"));s.events2&&(k+=(k!=\"\"?\",\":\"\")+s.events2)}for(c=0;c<a.length;c++){d=a[c];f=s[d];e=d.substring(0,4);i=d.substring(4);\r\n!f&&d==\"events\"&&k&&(f=k,k=\"\");if(f&&(!g||g.indexOf(\",\"+d+\",\")>=0)){switch(d){case \"timestamp\":d=\"ts\";break;case \"dynamicVariablePrefix\":d=\"D\";break;case \"visitorID\":d=\"vid\";break;case \"pageURL\":d=\"g\";if(f.length>255)s.pageURLRest=f.substring(255),f=f.substring(0,255);break;case \"pageURLRest\":d=\"-g\";break;case \"referrer\":d=\"r\";break;case \"vmk\":case \"visitorMigrationKey\":d=\"vmt\";break;case \"visitorMigrationServer\":d=\"vmf\";s.ssl&&s.visitorMigrationServerSecure&&(f=\"\");break;case \"visitorMigrationServerSecure\":d=\r\n\"vmf\";!s.ssl&&s.visitorMigrationServer&&(f=\"\");break;case \"charSet\":d=\"ce\";break;case \"visitorNamespace\":d=\"ns\";break;case \"cookieDomainPeriods\":d=\"cdp\";break;case \"cookieLifetime\":d=\"cl\";break;case \"variableProvider\":d=\"vvp\";break;case \"currencyCode\":d=\"cc\";break;case \"channel\":d=\"ch\";break;case \"transactionID\":d=\"xact\";break;case \"campaign\":d=\"v0\";break;case \"resolution\":d=\"s\";break;case \"colorDepth\":d=\"c\";break;case \"javascriptVersion\":d=\"j\";break;case \"javaEnabled\":d=\"v\";break;case \"cookiesEnabled\":d=\r\n\"k\";break;case \"browserWidth\":d=\"bw\";break;case \"browserHeight\":d=\"bh\";break;case \"connectionType\":d=\"ct\";break;case \"homepage\":d=\"hp\";break;case \"plugins\":d=\"p\";break;case \"events\":k&&(f+=(f!=\"\"?\",\":\"\")+k);if(n){i=f.split(\",\");f=\"\";for(e=0;e<i.length;e++)j=i[e],w=j.indexOf(\"=\"),w>=0&&(j=j.substring(0,w)),w=j.indexOf(\":\"),w>=0&&(j=j.substring(0,w)),n.indexOf(\",\"+j+\",\")>=0&&(f+=(f?\",\":\"\")+i[e])}break;case \"events2\":f=\"\";break;case \"contextData\":b+=s.P(\"c\",s[d],g,d);f=\"\";break;case \"lightProfileID\":d=\r\n\"mtp\";break;case \"lightStoreForSeconds\":d=\"mtss\";s.lightProfileID||(f=\"\");break;case \"lightIncrementBy\":d=\"mti\";s.lightProfileID||(f=\"\");break;case \"retrieveLightProfiles\":d=\"mtsr\";break;case \"deleteLightProfiles\":d=\"mtsd\";break;case \"retrieveLightData\":s.retrieveLightProfiles&&(b+=s.P(\"mts\",s[d],g,d));f=\"\";break;default:s.ba(i)&&(e==\"prop\"?d=\"c\"+i:e==\"eVar\"?d=\"v\"+i:e==\"list\"?d=\"l\"+i:e==\"hier\"&&(d=\"h\"+i,f=f.substring(0,255)))}f&&(b+=\"&\"+d+\"=\"+(d.substring(0,3)!=\"pev\"?s.escape(f):f))}d==\"pev3\"&&s.g&&\r\n(b+=s.g)}return b};s.p=function(s){var a=s.tagName;if(\"\"+s.Ta!=\"undefined\"||\"\"+s.Ea!=\"undefined\"&&(\"\"+s.Ea).toUpperCase()!=\"HTML\")return\"\";a=a&&a.toUpperCase?a.toUpperCase():\"\";a==\"SHAPE\"&&(a=\"\");a&&((a==\"INPUT\"||a==\"BUTTON\")&&s.type&&s.type.toUpperCase?a=s.type.toUpperCase():!a&&s.href&&(a=\"A\"));return a};s.Y=function(s){var a=s.href?s.href:\"\",c,e,d;c=a.indexOf(\":\");e=a.indexOf(\"?\");d=a.indexOf(\"/\");if(a&&(c<0||e>=0&&c>e||d>=0&&c>d))e=s.protocol&&s.protocol.length>1?s.protocol:l.protocol?l.protocol:\r\n\"\",c=l.pathname.lastIndexOf(\"/\"),a=(e?e+\"//\":\"\")+(s.host?s.host:l.host?l.host:\"\")+(h.substring(0,1)!=\"/\"?l.pathname.substring(0,c<0?0:c)+\"/\":\"\")+a;return a};s.z=function(b){var a=s.p(b),c,e,d=\"\",f=0;if(a){c=b.protocol;e=b.onclick;if(b.href&&(a==\"A\"||a==\"AREA\")&&(!e||!c||c.toLowerCase().indexOf(\"javascript\")<0))d=s.Y(b);else if(e)d=s.replace(s.replace(s.replace(s.replace(\"\"+e,\"\\r\",\"\"),\"\\n\",\"\"),\"\\t\",\"\"),\" \",\"\"),f=2;else if(a==\"INPUT\"||a==\"SUBMIT\"){if(b.value)d=b.value;else if(b.innerText)d=b.innerText;\r\nelse if(b.textContent)d=b.textContent;f=3}else if(b.src&&a==\"IMAGE\")d=b.src;if(d)return{id:d.substring(0,100),type:f}}return 0};s.Qa=function(b){for(var a=s.p(b),c=s.z(b);b&&!c&&a!=\"BODY\";)if(b=b.parentElement?b.parentElement:b.parentNode)a=s.p(b),c=s.z(b);if(!c||a==\"BODY\")b=0;if(b&&(a=b.onclick?\"\"+b.onclick:\"\",a.indexOf(\".tl(\")>=0||a.indexOf(\".trackLink(\")>=0))b=0;return b};s.Ca=function(){var b,a,c=s.linkObject,e=s.linkType,d=s.linkURL,f,i;s.K=1;if(!c)s.K=0,c=s.j;if(c){b=s.p(c);for(a=s.z(c);c&&\r\n!a&&b!=\"BODY\";)if(c=c.parentElement?c.parentElement:c.parentNode)b=s.p(c),a=s.z(c);if(!a||b==\"BODY\")c=0;if(c){var j=c.onclick?\"\"+c.onclick:\"\";if(j.indexOf(\".tl(\")>=0||j.indexOf(\".trackLink(\")>=0)c=0}}else s.K=1;!d&&c&&(d=s.Y(c));d&&!s.linkLeaveQueryString&&(f=d.indexOf(\"?\"),f>=0&&(d=d.substring(0,f)));if(!e&&d){var g=0,n=0,k;if(s.trackDownloadLinks&&s.linkDownloadFileTypes){j=d.toLowerCase();f=j.indexOf(\"?\");i=j.indexOf(\"#\");f>=0?i>=0&&i<f&&(f=i):f=i;f>=0&&(j=j.substring(0,f));f=s.linkDownloadFileTypes.toLowerCase().split(\",\");\r\nfor(i=0;i<f.length;i++)(k=f[i])&&j.substring(j.length-(k.length+1))==\".\"+k&&(e=\"d\")}if(s.trackExternalLinks&&!e&&(j=d.toLowerCase(),s.aa(j))){if(!s.linkInternalFilters)s.linkInternalFilters=w.location.hostname;f=0;s.linkExternalFilters?(f=s.linkExternalFilters.toLowerCase().split(\",\"),g=1):s.linkInternalFilters&&(f=s.linkInternalFilters.toLowerCase().split(\",\"));if(f){for(i=0;i<f.length;i++)k=f[i],j.indexOf(k)>=0&&(n=1);n?g&&(e=\"e\"):g||(e=\"e\")}}}s.linkObject=c;s.linkURL=d;s.linkType=e;if(s.trackClickMap||\r\ns.trackInlineStats)if(s.g=\"\",c){e=s.pageName;d=1;c=c.sourceIndex;if(!e)e=s.pageURL,d=0;if(w.s_objectID)a.id=w.s_objectID,c=a.type=1;if(e&&a&&a.id&&b)s.g=\"&pid=\"+s.escape(e.substring(0,255))+(d?\"&pidt=\"+d:\"\")+\"&oid=\"+s.escape(a.id.substring(0,100))+(a.type?\"&oidt=\"+a.type:\"\")+\"&ot=\"+b+(c?\"&oi=\"+c:\"\")}};s.ta=function(){var b=s.K,a=s.linkType,c=s.linkURL,e=s.linkName;if(a&&(c||e))a=a.toLowerCase(),a!=\"d\"&&a!=\"e\"&&(a=\"o\"),s.pe=\"lnk_\"+a,s.pev1=c?s.escape(c):\"\",s.pev2=e?s.escape(e):\"\",b=1;s.abort&&(b=0);\r\nif(s.trackClickMap||s.trackInlineStats){a={};c=0;var d=s.cookieRead(\"s_sq\"),f=d?d.split(\"&\"):0,i,j,w;d=0;if(f)for(i=0;i<f.length;i++)j=f[i].split(\"=\"),e=s.unescape(j[0]).split(\",\"),j=s.unescape(j[1]),a[j]=e;e=s.account.split(\",\");if(b||s.g){b&&!s.g&&(d=1);for(j in a)if(!Object.prototype[j])for(i=0;i<e.length;i++){d&&(w=a[j].join(\",\"),w==s.account&&(s.g+=(j.charAt(0)!=\"&\"?\"&\":\"\")+j,a[j]=[],c=1));for(f=0;f<a[j].length;f++)w=a[j][f],w==e[i]&&(d&&(s.g+=\"&u=\"+s.escape(w)+(j.charAt(0)!=\"&\"?\"&\":\"\")+j+\"&u=0\"),\r\na[j].splice(f,1),c=1)}b||(c=1);if(c){d=\"\";i=2;!b&&s.g&&(d=s.escape(e.join(\",\"))+\"=\"+s.escape(s.g),i=1);for(j in a)!Object.prototype[j]&&i>0&&a[j].length>0&&(d+=(d?\"&\":\"\")+s.escape(a[j].join(\",\"))+\"=\"+s.escape(j),i--);s.cookieWrite(\"s_sq\",d)}}}return b};s.ua=function(){if(!s.Ka){var b=new Date,a=n.location,c,e,d,f=d=e=c=\"\",i=\"\",w=\"\",g=\"1.2\",k=s.cookieWrite(\"s_cc\",\"true\",0)?\"Y\":\"N\",o=\"\",p=\"\",r=0;if(b.setUTCDate&&(g=\"1.3\",r.toPrecision&&(g=\"1.5\",c=[],c.forEach))){g=\"1.6\";d=0;e={};try{d=new Iterator(e),\r\nd.next&&(g=\"1.7\",c.reduce&&(g=\"1.8\",g.trim&&(g=\"1.8.1\",Date.parse&&(g=\"1.8.2\",Object.create&&(g=\"1.8.5\")))))}catch(t){}}c=screen.width+\"x\"+screen.height;d=navigator.javaEnabled()?\"Y\":\"N\";e=screen.pixelDepth?screen.pixelDepth:screen.colorDepth;i=s.w.innerWidth?s.w.innerWidth:s.d.documentElement.offsetWidth;w=s.w.innerHeight?s.w.innerHeight:s.d.documentElement.offsetHeight;b=navigator.plugins;try{s.b.addBehavior(\"#default#homePage\"),o=s.b.Ra(a)?\"Y\":\"N\"}catch(u){}try{s.b.addBehavior(\"#default#clientCaps\"),\r\np=s.b.connectionType}catch(x){}if(b)for(;r<b.length&&r<30;){if(a=b[r].name)a=a.substring(0,100)+\";\",f.indexOf(a)<0&&(f+=a);r++}s.resolution=c;s.colorDepth=e;s.javascriptVersion=g;s.javaEnabled=d;s.cookiesEnabled=k;s.browserWidth=i;s.browserHeight=w;s.connectionType=p;s.homepage=o;s.plugins=f;s.Ka=1}};s.B={};s.loadModule=function(b,a){s.B[b]||(s[b]=w[\"AppMeasurement_Module_\"+b]?new w[\"AppMeasurement_Module_\"+b](s):{},s.B[b]=s[b]);a&&(s[b+\"_onLoad\"]=a,delayCall(b+\"_onLoad\",[s,m],1)||a(s,m))};s.u=function(b){var a,\r\nc;for(a in s.B)if(!Object.prototype[a]&&(c=s.B[a])&&c[b]&&c[b]())return 1;return 0};s.xa=function(){var b=Math.floor(Math.random()*1E13),a=s.visitorSampling,c=s.visitorSamplingGroup;c=\"s_vsn_\"+(s.visitorNamespace?s.visitorNamespace:s.account)+(c?\"_\"+c:\"\");var e=s.cookieRead(c);if(a){e&&(e=parseInt(e));if(!e){if(!s.cookieWrite(c,b))return 0;e=b}if(e%1E4>v)return 0}return 1};s.Q=function(b,a){var c,e,d,f,i,w;for(c=0;c<2;c++){e=c>0?s.R:s.e;for(d=0;d<e.length;d++)if(f=e[d],(i=b[f])||b[\"!\"+f]){if(!a&&\r\n(f==\"contextData\"||f==\"retrieveLightData\")&&s[f])for(w in s[f])i[w]||(i[w]=s[f][w]);s[f]=i}}};s.La=function(b){var a,c,e,d;for(a=0;a<2;a++){c=a>0?s.R:s.e;for(e=0;e<c.length;e++)d=c[e],b[d]=s[d],b[d]||(b[\"!\"+d]=1)}};s.oa=function(s){var a,c,e,d,f,w=0,g,n=\"\",k=\"\";if(s&&s.length>255&&(a=\"\"+s,c=a.indexOf(\"?\"),c>0&&(g=a.substring(c+1),a=a.substring(0,c),d=a.toLowerCase(),e=0,d.substring(0,7)==\"http://\"?e+=7:d.substring(0,8)==\"https://\"&&(e+=8),c=d.indexOf(\"/\",e),c>0&&(d=d.substring(e,c),f=a.substring(c),\r\na=a.substring(0,c),d.indexOf(\"google\")>=0?w=\",q,ie,start,search_key,word,kw,cd,\":d.indexOf(\"yahoo.co\")>=0&&(w=\",p,ei,\"),w&&g)))){if((s=g.split(\"&\"))&&s.length>1){for(e=0;e<s.length;e++)d=s[e],c=d.indexOf(\"=\"),c>0&&w.indexOf(\",\"+d.substring(0,c)+\",\")>=0?n+=(n?\"&\":\"\")+d:k+=(k?\"&\":\"\")+d;n&&k?g=n+\"&\"+k:k=\"\"}c=253-(g.length-k.length)-a.length;s=a+(c>0?f.substring(0,c):\"\")+\"?\"+g}return s};s.qa=function(){var b=s.cookieRead(\"s_fid\"),a=\"\",c=\"\",e;e=8;var d=4;if(!b||b.indexOf(\"-\")<0){for(b=0;b<16;b++)e=Math.floor(Math.random()*\r\ne),a+=\"0123456789ABCDEF\".substring(e,e+1),e=Math.floor(Math.random()*d),c+=\"0123456789ABCDEF\".substring(e,e+1),e=d=16;b=a+\"-\"+c}s.cookieWrite(\"s_fid\",b,1)||(b=0);return b};s.t=s.track=function(b){var a,c=new Date,e=\"s\"+Math.floor(c.getTime()/108E5)%10+Math.floor(Math.random()*1E13),d=c.getYear();d=\"t=\"+s.escape(c.getDate()+\"/\"+c.getMonth()+\"/\"+(d<1900?d+1900:d)+\" \"+c.getHours()+\":\"+c.getMinutes()+\":\"+c.getSeconds()+\" \"+c.getDay()+\" \"+c.getTimezoneOffset());if(!s.V(\"track\",arguments)){b&&(a={},s.La(a),\r\ns.Q(b));if(s.xa()&&(s.fid=s.qa(),s.Ca(),s.usePlugins&&s.doPlugins&&s.doPlugins(s),s.account)){if(!s.abort){if(s.trackOffline&&!s.timestamp)s.timestamp=Math.floor(c.getTime()/1E3);c=w.location;if(!s.pageURL)s.pageURL=c.href?c.href:c;if(!s.referrer&&!s.ia)s.referrer=n.document.referrer,s.ia=1;s.referrer=s.oa(s.referrer);s.u(\"_g\")}s.ta()&&!s.abort&&(s.ua(),d+=s.ra(),s.Ba(e,d));s.abort||s.u(\"_t\")}b&&s.Q(a,1);s.timestamp=s.linkObject=s.j=s.linkURL=s.linkName=s.linkType=w.Sa=s.pe=s.pev1=s.pev2=s.pev3=s.g=\r\n0}};s.tl=s.trackLink=function(b,a,c,e,d){s.linkObject=b;s.linkType=a;s.linkName=c;if(d)s.i=b,s.l=d;return s.track(e)};s.trackLight=function(b,a,c,e){s.lightProfileID=b;s.lightStoreForSeconds=a;s.lightIncrementBy=c;return s.track(e)};s.clearVars=function(){var b,a;for(b=0;b<s.e.length;b++)if(a=s.e[b],a.substring(0,4)==\"prop\"||a.substring(0,4)==\"eVar\"||a.substring(0,4)==\"hier\"||a.substring(0,4)==\"list\"||a==\"channel\"||a==\"events\"||a==\"eventList\"||a==\"products\"||a==\"productList\"||a==\"purchaseID\"||a==\r\n\"transactionID\"||a==\"state\"||a==\"zip\"||a==\"campaign\")s[a]=void 0};s.Ba=function(b,a){var c,e=s.trackingServer;c=\"\";var d=s.dc,f=\"sc.\",w=s.visitorNamespace;if(e){if(s.trackingServerSecure&&s.ssl)e=s.trackingServerSecure}else{if(!w)w=s.account,e=w.indexOf(\",\"),e>=0&&(w=w.Oa(0,e)),w=w.replace(/[^A-Za-z0-9]/g,\"\");c||(c=\"2o7.net\");d=d?(\"\"+d).toLowerCase():\"d1\";c==\"2o7.net\"&&(d==\"d1\"?d=\"112\":d==\"d2\"&&(d=\"122\"),f=\"\");e=w+\".\"+d+\".\"+f+c}c=s.ssl?\"https://\":\"http://\";c+=e+\"/b/ss/\"+s.account+\"/\"+(s.mobile?\"5.\":\r\n\"\")+\"1/JS-\"+s.version+(s.Ja?\"T\":\"\")+\"/\"+b+\"?AQB=1&ndh=1&\"+a+\"&AQE=1\";s.wa&&(c=c.substring(0,2047));s.ma(c);s.H()};s.ma=function(b){s.c||s.va();s.c.push(b);s.I=s.o();s.ha()};s.va=function(){s.c=s.ya();if(!s.c)s.c=[]};s.ya=function(){var b,a;if(s.M()){try{(a=w.localStorage.getItem(s.L()))&&(b=w.JSON.parse(a))}catch(c){}return b}};s.M=function(){var b=!0;if(!s.trackOffline||!s.offlineFilename||!w.localStorage||!w.JSON)b=!1;return b};s.Z=function(){var b=0;if(s.c)b=s.c.length;s.q&&b++;return b};s.H=function(){if(!s.q)if(s.$=\r\nnull,s.fa)s.I>s.A&&s.ga(s.c),s.O(500);else{var b=s.ja();if(b>0)s.O(b);else if(b=s.X())s.q=1,s.Aa(b),s.Fa(b)}};s.O=function(b){if(!s.$)b||(b=0),s.$=setTimeout(s.H,b)};s.ja=function(){var b;if(!s.trackOffline||s.offlineThrottleDelay<=0)return 0;b=s.o()-s.da;if(s.offlineThrottleDelay<b)return 0;return s.offlineThrottleDelay-b};s.X=function(){if(s.c.length>0)return s.c.shift()};s.Aa=function(b){if(s.debugTracking){var a=\"AppMeasurement Debug: \"+b;b=b.split(\"&\");var c;for(c=0;c<b.length;c++)a+=\"\\n\\t\"+\r\ns.unescape(b[c]);s.za(a)}};s.Fa=function(b){var a;a||(a=new Image);a.T=function(){try{if(s.N)clearTimeout(s.N),s.N=0;if(a.timeout)clearTimeout(a.timeout),a.timeout=0}catch(b){}};a.onload=a.Ia=function(){a.T();s.la();s.D();s.q=0;s.H()};a.onabort=a.onerror=a.na=function(){a.T();s.q&&s.c.unshift(s.ka);s.q=0;s.I>s.A&&s.ga(s.c);s.D();s.O(500)};a.onreadystatechange=function(){a.readyState==4&&(a.status==200?a.Ia():a.na())};s.da=s.o();a.src=b;if(a.abort)s.N=setTimeout(a.abort,5E3);s.ka=b;s.Pa=w[\"s_i_\"+s.replace(s.account,\r\n\",\",\"_\")]=a;if(s.useForcedLinkTracking&&s.r||s.l){if(!s.forcedLinkTrackingTimeout)s.forcedLinkTrackingTimeout=250;s.F=setTimeout(s.D,s.forcedLinkTrackingTimeout)}};s.la=function(){if(s.M()&&!(s.ca>s.A))try{w.localStorage.removeItem(s.L()),s.ca=s.o()}catch(b){}};s.ga=function(b){if(s.M()){s.ha();try{w.localStorage.setItem(s.L(),w.JSON.stringify(b)),s.A=s.o()}catch(a){}}};s.ha=function(){if(s.trackOffline){if(!s.offlineLimit||s.offlineLimit<=0)s.offlineLimit=10;for(;s.c.length>s.offlineLimit;)s.X()}};\r\ns.forceOffline=function(){s.fa=!0};s.forceOnline=function(){s.fa=!1};s.L=function(){return s.offlineFilename+\"-\"+s.visitorNamespace+s.account};s.o=function(){return(new Date).getTime()};s.aa=function(s){s=s.toLowerCase();if(s.indexOf(\"#\")!=0&&s.indexOf(\"about:\")!=0&&s.indexOf(\"javascript:\")!=0)return!0;return!1};s.setTagContainer=function(b){var a,c,e;s.Ja=b;for(a=0;a<s._il.length;a++)if((c=s._il[a])&&c._c==\"s_l\"&&c.tagContainerName==b){s.Q(c);if(c.lmq)for(a=0;a<c.lmq.length;a++)e=c.lmq[a],s.loadModule(e.n);\r\nif(c.ml)for(e in c.ml)if(s[e])for(a in b=s[e],e=c.ml[e],e)if(!Object.prototype[a]&&(typeof e[a]!=\"function\"||(\"\"+e[a]).indexOf(\"s_c_il\")<0))b[a]=e[a];if(c.mmq)for(a=0;a<c.mmq.length;a++)e=c.mmq[a],s[e.m]&&(b=s[e.m],b[e.f]&&typeof b[e.f]==\"function\"&&(e.a?b[e.f].apply(b,e.a):b[e.f].apply(b)));if(c.tq)for(a=0;a<c.tq.length;a++)s.track(c.tq[a]);c.s=s;break}};s.Util={urlEncode:s.escape,urlDecode:s.unescape,cookieRead:s.cookieRead,cookieWrite:s.cookieWrite,getQueryParam:function(b,a,c){var e;a||(a=s.pageURL?\r\ns.pageURL:w.location);c||(c=\"&\");if(b&&a&&(a=\"\"+a,e=a.indexOf(\"?\"),e>=0&&(a=c+a.substring(e+1)+c,e=a.indexOf(c+b+\"=\"),e>=0&&(a=a.substring(e+c.length+b.length+1),e=a.indexOf(c),e>=0&&(a=a.substring(0,e)),a.length>0))))return s.unescape(a);return\"\"}};s.C=[\"timestamp\",\"dynamicVariablePrefix\",\"visitorID\",\"anonymousVisitorID\",\"globalVisitorID\",\"globalLocationHint\",\"fid\",\"vmk\",\"visitorMigrationKey\",\"visitorMigrationServer\",\"visitorMigrationServerSecure\",\"charSet\",\"visitorNamespace\",\"cookieDomainPeriods\",\r\n\"fpCookieDomainPeriods\",\"cookieLifetime\",\"pageName\",\"pageURL\",\"referrer\",\"contextData\",\"currencyCode\",\"lightProfileID\",\"lightStoreForSeconds\",\"lightIncrementBy\",\"retrieveLightProfiles\",\"deleteLightProfiles\",\"retrieveLightData\",\"pe\",\"pev1\",\"pev2\",\"pev3\",\"pageURLRest\"];s.e=s.C.concat([\"purchaseID\",\"variableProvider\",\"channel\",\"server\",\"pageType\",\"transactionID\",\"campaign\",\"state\",\"zip\",\"events\",\"events2\",\"products\",\"tnt\"]);s.ea=[\"timestamp\",\"charSet\",\"visitorNamespace\",\"cookieDomainPeriods\",\"cookieLifetime\",\r\n\"contextData\",\"lightProfileID\",\"lightStoreForSeconds\",\"lightIncrementBy\"];s.J=s.ea.slice(0);s.R=[\"account\",\"allAccounts\",\"debugTracking\",\"visitor\",\"trackOffline\",\"offlineLimit\",\"offlineThrottleDelay\",\"offlineFilename\",\"usePlugins\",\"doPlugins\",\"configURL\",\"visitorSampling\",\"s.visitorSamplingGroup\",\"linkObject\",\"linkURL\",\"linkName\",\"linkType\",\"trackDownloadLinks\",\"trackExternalLinks\",\"trackClickMap\",\"trackInlineStats\",\"linkLeaveQueryString\",\"linkTrackVars\",\"linkTrackEvents\",\"linkDownloadFileTypes\",\r\n\"linkExternalFilters\",\"linkInternalFilters\",\"useForcedLinkTracking\",\"forcedLinkTrackingTimeout\",\"trackingServer\",\"trackingServerSecure\",\"ssl\",\"abort\",\"mobile\",\"dc\",\"lightTrackVars\",\"maxDelay\"];for(g=0;g<=75;g++)s.e.push(\"prop\"+g),s.J.push(\"prop\"+g),s.e.push(\"eVar\"+g),s.J.push(\"eVar\"+g),g<6&&s.e.push(\"hier\"+g),g<4&&s.e.push(\"list\"+g);g=[\"resolution\",\"colorDepth\",\"javascriptVersion\",\"javaEnabled\",\"cookiesEnabled\",\"browserWidth\",\"browserHeight\",\"connectionType\",\"homepage\",\"plugins\"];s.e=s.e.concat(g);\r\ns.C=s.C.concat(g);s.ssl=w.location.protocol.toLowerCase().indexOf(\"https\")>=0;s.charSet=\"UTF-8\";s.contextData={};s.offlineThrottleDelay=0;s.offlineFilename=\"AppMeasurement.offline\";s.da=0;s.I=0;s.A=0;s.ca=0;s.linkDownloadFileTypes=\"exe,zip,wav,mp3,mov,mpg,avi,wmv,pdf,doc,docx,xls,xlsx,ppt,pptx\";s.w=w;s.d=w.document;try{s.wa=navigator.appName==\"Microsoft Internet Explorer\"}catch(p){}s.D=function(){if(s.F)w.clearTimeout(s.F),s.F=null;s.i&&s.r&&s.i.dispatchEvent(s.r);if(s.l)if(typeof s.l==\"function\")s.l();\r\nelse if(s.i&&s.i.href)s.d.location=s.i.href;s.i=s.r=s.l=0};s.Ga=function(){s.b=s.d.body;if(s.b)if(s.k=function(b){var a,c,e,d,f;if(!(s.d&&s.d.getElementById(\"cppXYctnr\")||b&&b.Da)){if(s.S)if(s.useForcedLinkTracking)s.b.removeEventListener(\"click\",s.k,!1);else{s.b.removeEventListener(\"click\",s.k,!0);s.S=s.useForcedLinkTracking=0;return}else s.useForcedLinkTracking=0;s.j=b.srcElement?b.srcElement:b.target;try{if(s.j&&(s.j.tagName||s.j.parentElement||s.j.parentNode))if(e=s.Z(),s.track(),e<s.Z()&&s.useForcedLinkTracking&&\r\nb.target){for(d=b.target;d&&d!=s.b&&d.tagName.toUpperCase()!=\"A\"&&d.tagName.toUpperCase()!=\"AREA\";)d=d.parentNode;if(d&&(f=d.href,s.aa(f)||(f=0),c=d.target,b.target.dispatchEvent&&f&&(!c||c==\"_self\"||c==\"_top\"||c==\"_parent\"||w.name&&c==w.name))){try{a=s.d.createEvent(\"MouseEvents\")}catch(g){a=new w.MouseEvent}if(a){try{a.initMouseEvent(\"click\",b.bubbles,b.cancelable,b.view,b.detail,b.screenX,b.screenY,b.clientX,b.clientY,b.ctrlKey,b.altKey,b.shiftKey,b.metaKey,b.button,b.relatedTarget)}catch(j){a=\r\n0}if(a)a.Da=1,b.stopPropagation(),b.Ha&&b.Ha(),b.preventDefault(),s.i=b.target,s.r=a}}}}catch(k){}s.j=0}},s.b&&s.b.attachEvent)s.b.attachEvent(\"onclick\",s.k);else{if(s.b&&s.b.addEventListener){if(navigator&&(navigator.userAgent.indexOf(\"WebKit\")>=0&&s.d.createEvent||navigator.userAgent.indexOf(\"Firefox/2\")>=0&&w.MouseEvent))s.S=1,s.useForcedLinkTracking=1,s.b.addEventListener(\"click\",s.k,!0);s.b.addEventListener(\"click\",s.k,!1)}}else setTimeout(setupBody,30)};s.Ga()}", "function getVersion(){return _VERSION}", "InitVsaEngine() {\n\n }", "constructor() {\n this.systemLog = false\n this.appName = '@codedungeon/messenger'\n this.logToFile = false\n this.methods = [\n 'write',\n 'critical',\n 'lblCritical',\n 'danger',\n 'lblDanger',\n 'debug',\n 'error',\n 'lblError',\n 'important',\n 'lblImportant',\n 'info',\n 'lblInfo',\n 'log',\n 'note',\n 'notice',\n 'lblNotice',\n 'status',\n 'success',\n 'lblSuccess',\n 'warn',\n 'lblWarn',\n 'warning',\n 'lblWarning'\n ]\n }", "private internal function m248() {}", "function WebSocketRpcConnection()\n{\nvar self = this;\n\nvar isNodeJs = (typeof window === \"undefined\" ? true : false);\n\nvar lib = null;\nvar SpaceifyError = null;\nvar SpaceifyUtility = null;\nvar RpcCommunicator = null;\n//var SpaceifyLogger = null;\nvar WebSocketConnection = null;\n\nif (isNodeJs)\n\t{\n\tlib = \"/var/lib/spaceify/code/\";\n\n\tSpaceifyError = require(lib + \"spaceifyerror\");\n\t//SpaceifyLogger = require(lib + \"spaceifylogger\");\n\tSpaceifyUtility = require(lib + \"spaceifyutility\");\n\tRpcCommunicator = require(lib + \"rpccommunicator\");\n\tWebSocketConnection = require(lib + \"websocketconnection\");\n\t}\nelse\n\t{\n\tlib = (window.WEBPACK_MAIN_LIBRARY ? window.WEBPACK_MAIN_LIBRARY : window);\n\n\t//SpaceifyLogger = lib.SpaceifyLogger;\n\tSpaceifyError = lib.SpaceifyError;\n\tSpaceifyUtility = lib.SpaceifyUtility;\n\tRpcCommunicator = lib.RpcCommunicator;\n\tWebSocketConnection = lib.WebSocketConnection;\n\t}\n\nvar errorc = new SpaceifyError();\nvar utility = new SpaceifyUtility();\nvar communicator = new RpcCommunicator();\nvar connection = new WebSocketConnection();\n//var logger = new SpaceifyLogger(\"WebSocketRpcConnection\");\n\nself.connect = function(options, callback)\n\t{\n\tconnection.connect(options, function(err, data)\n\t\t{\n\t\tif(!err)\n\t\t\t{\n\t\t\tcommunicator.addConnection(connection);\n\n\t\t\tif(callback)\n\t\t\t\tcallback(null, true);\n\t\t\t}\n\t\telse\n\t\t\t{\n\t\t\tif(callback)\n\t\t\t\tcallback(errorc.makeErrorObject(\"wsrpcc\", \"Failed to open WebsocketRpcConnection.\", \"WebSocketRpcConnection::connect\"), null);\n\t\t\t}\n\t\t});\n\t};\n\nself.close = function()\n\t{\n\t};\n\nself.getCommunicator = function()\n\t{\n\treturn communicator;\n\t};\n\nself.getConnection = function()\n\t{\n\treturn connection;\n\t};\n\n// Inherited methods\nself.getIsOpen = function()\n\t{\n\treturn connection.getIsOpen();\n\t}\n\nself.getIsSecure = function()\n\t{\n\treturn connection.getIsSecure();\n\t}\n\nself.getPort = function()\n\t{\n\treturn connection.getPort();\n\t}\n\nself.getId = function()\n\t{\n\treturn connection.getId();\n\t}\n\nself.connectionExists = function(connectionId)\n\t{\n\treturn communicator.connectionExists(connectionId);\n\t}\n\nself.exposeRpcMethod = function(name, object, method)\n\t{\n\tcommunicator.exposeRpcMethod(name, object, method);\n\t}\n\nself.exposeRpcMethodSync = function(name, object, method)\n\t{\n\tcommunicator.exposeRpcMethodSync(name, object, method);\n\t}\n\nself.callRpc = function(method, params, object, listener)\n\t{\n\treturn communicator.callRpc(method, params, object, listener, connection.getId());\n\t}\n\n// External event listeners\nself.setConnectionListener = function(listener)\n\t{\n\tcommunicator.setConnectionListener(listener);\n\t};\n\nself.setDisconnectionListener = function(listener)\n\t{\n\tcommunicator.setDisconnectionListener(listener);\n\t};\n\n}", "heartbeat () {\n }", "function _____SHARED_functions_____(){}", "onShareAppMessage() {\n\n }", "function getString(key, params) {\n var result = WEB_PLATFORM.getString(\"org_opensds_storage_devices\", key, params);\n if(result == null){\n return key;\n }else{\n return result;\n }\n }", "componentDidMount(){\n console.info(this.constructor.name+ 'Component mount process finished');\n }", "onMessage() {}", "onMessage() {}", "requestThumbnails() {\n let position = this.state.position;\n let ed = this.state.ed;\n let ts = position == 'start' ? ed.start : ed.end;\n\n this.props.socket.emit('frameSelect',{ ts: ts } );\n }", "static get tag(){return\"hal-9000\"}", "constructor(t){const e={...t};this.connectionState=new h,this.server=\"https://hub-server-2.heatgenius.co.uk\",this.username=\"\",this.signature=\"\",this.auth={header:{}},this.lastQueryTime=null,this._axios=i.a.create({}),this.logger=e.logger?e.logger:console,this.debug=!!e.debug&&e.debug}", "started() {\r\n\r\n\t}", "get EXTERNAL_API() {\n return ['setUsageMode',\n 'setBackupMode',\n 'setLocationMode',\n 'setUsageOptinHidden',\n ];\n }", "getVideoDataBuffer() {\n return this.videoDataBuffer;\n }", "addTPKLayer(){\n //<editor-fold desc=\"old code to eliminate\">\n /* if (typeof local == 'undefined') {\n\n //todo: maybe based on this url we could decide if taking the tpk from File API or form URL\n var xhrRequest = new XMLHttpRequest();\n var _this = this;\n xhrRequest.open(\"GET\", url, true);\n xhrRequest.responseType = \"blob\";\n xhrRequest.onprogress = function(evt){\n var percent = 0;\n if(/!*evt.hasOwnProperty(\"total\")*!/typeof evt[\"total\"] !== 'undefined'){\n percent = (parseFloat(evt.loaded / evt.total) * 100).toFixed(0);\n }\n else{\n percent = (parseFloat(evt.loaded / evt.totalSize) * 100).toFixed(0);\n }\n\n console.log(\"Get file via url \" + percent + \"%\");\n console.log(\"Begin downloading remote tpk file...\");\n };\n\n xhrRequest.error = function(err){\n console.log(\"ERROR retrieving TPK file: \" + err.toString());\n alert(\"There was a problem retrieve the file.\");\n };\n var __this = _this;\n xhrRequest.onload = function(oEvent) {\n if(this.status === 200) {\n console.log(\"Remote tpk download finished.\" + oEvent);\n __this.zipParser(this.response);\n }\n else{\n alert(\"There was a problem loading the file. \" + this.status + \": \" + this.statusText );\n }\n };\n xhrRequest.send();\n }\n*/\n //</editor-fold>\n if (this.get('ermesCordova').isNative()){\n\n var basemapName = this.get('parcels').get('basemapName');\n var store = cordova.file.dataDirectory;\n var fileName = basemapName;\n this.set(\"loading\", true);\n this.getBaseMapZip (store, fileName).then((binary)=>{\n if (binary!== null) {\n this.zipParser(binary);\n }\n else {\n Ember.debug(\"getBaseMapZip: error loading the zip file\");\n }\n });\n }\n\n }", "private public function m246() {}", "started () {\n\n }", "started () {\n\n }", "started () {\n\n }", "async onReady() {\n try {\n // Initialize your adapter here\n //Logging of adapter start\n this.log.info('start fb-checkpresence: ip-address: \"' + this.config.ipaddress + '\" - interval devices: ' + this.config.interval + ' Min.' + ' - interval members: ' + this.config.intervalFamily + ' s');\n this.log.debug('configuration user: <' + this.config.username + '>');\n this.log.debug('configuration history: <' + this.config.history + '>');\n this.log.debug('configuration dateformat: <' + this.config.dateformat + '>');\n this.log.debug('configuration familymembers: ' + JSON.stringify(this.config.familymembers));\n this.log.debug('configuration fb-devices ' + this.config.fbdevices);\n this.log.debug('configuratuion mesh info: ' + this.config.meshinfo); \n\n //decrypt fritzbox password\n const sysObj = await this.getForeignObjectAsync('system.config');\n if (sysObj && sysObj.native && sysObj.native.secret) {\n this.config.password = this.decrypt(sysObj.native.secret, this.config.password);\n } else {\n this.config.password = this.decrypt('SdoeQ85NTrg1B0FtEyzf', this.config.password);\n }\n\n //Configuration changes if needed\n let adapterObj = (await this.getForeignObjectAsync(`system.adapter.${this.namespace}`));\n let adapterObjChanged = false; //for changes\n \n //if interval <= 0 than set to 1\n if (this.config.interval <= 0) {\n adapterObj.native.interval = 1;\n adapterObjChanged = true;\n this.config.interval = 1;\n this.log.warn('interval is less than 1. Set to 1 Min.');\n }\n\n //if interval <= 0 than set to 1\n if (this.config.intervalFamily <= 9) {\n adapterObj.native.intervalFamily = 10;\n adapterObjChanged = true;\n this.config.intervalFamily = 10;\n this.log.warn('interval is less than 10. Set to 10s.');\n }\n\n //create new configuration items -> workaround for older versions\n for(let i=0;i<this.config.familymembers.length;i++){\n if (this.config.familymembers[i].useip == undefined) {\n adapterObj.native.familymembers[i].useip = false;\n adapterObj.native.familymembers[i].ipaddress = '';\n adapterObjChanged = true;\n }\n }\n\n if (adapterObjChanged === true){ //Save changes\n await this.setForeignObjectAsync(`system.adapter.${this.namespace}`, adapterObj);\n }\n\n const cfg = {\n ip: this.config.ipaddress,\n port: '49000',\n iv: this.config.interval,\n history: this.config.history,\n dateFormat: this.config.dateformat,\n uid: this.config.username,\n pwd: this.config.password,\n members: this.config.familymembers,\n wl: this.config.whitelist\n };\n \n const cron = cfg.iv * 60;\n const cronFamily = this.config.intervalFamily;\n \n const devInfo = {\n host: this.config.ipaddress,\n port: '49000',\n sslPort: null,\n uid: this.config.username,\n pwd: this.config.password\n };\n\n this.Fb = await fb.Fb.init(devInfo, this);\n if(this.Fb.services === null) {\n this.log.error('Can not get services! Adapter stops');\n this.stopAdapter();\n }\n\n //Check if services/actions are supported\n this.GETPATH = await this.Fb.chkService('X_AVM-DE_GetHostListPath', 'Hosts1', 'X_AVM-DE_GetHostListPath');\n this.GETMESHPATH = await this.Fb.chkService('X_AVM-DE_GetMeshListPath', 'Hosts1', 'X_AVM-DE_GetMeshListPath');\n this.GETBYMAC = await this.Fb.chkService('GetSpecificHostEntry', 'Hosts1', 'GetSpecificHostEntry');\n this.GETBYIP = await this.Fb.chkService('X_AVM-DE_GetSpecificHostEntryByIP', 'Hosts1', 'X_AVM-DE_GetSpecificHostEntryByIP');\n this.GETPORT = await this.Fb.chkService('GetSecurityPort', 'DeviceInfo1', 'GetSecurityPort');\n this.GETEXTIP = await this.Fb.chkService('GetInfo', 'WANPPPConnection1', 'GetInfo');\n if ( this.GETEXTIP == false) this.GETEXTIP = await this.Fb.chkService('GetInfo', 'WANIPConnection1', 'GetInfo');\n this.SETENABLE = await this.Fb.chkService('SetEnable', 'WLANConfiguration3', 'SetEnable');\n this.WLAN3INFO = await this.Fb.chkService('GetInfo', 'WLANConfiguration3', 'WLANConfiguration3-GetInfo');\n this.DEVINFO = await this.Fb.chkService('GetInfo', 'DeviceInfo1', 'DeviceInfo1-GetInfo');\n this.DISALLOWWANACCESSBYIP = await this.Fb.chkService('DisallowWANAccessByIP', 'X_AVM-DE_HostFilter', 'DisallowWANAccessByIP');\n this.GETWANACCESSBYIP = await this.Fb.chkService('GetWANAccessByIP', 'X_AVM-DE_HostFilter', 'GetWANAccessByIP');\n this.REBOOT = await this.Fb.chkService('Reboot', 'DeviceConfig1', 'Reboot');\n \n //const test = await Fb.soapAction(Fb, '/upnp/control/deviceconfig', 'urn:dslforum-org:service:DeviceConfig:1', 'X_AVM-DE_CreateUrlSID', null);\n\n //Create global objects\n await obj.createGlobalObjects(this, this.HTML+this.HTML_END, this.HTML_GUEST+this.HTML_END, this.enabled);\n await obj.createMemberObjects(this, cfg, this.HTML_HISTORY + this.HTML_END, this.enabled);\n\n //create Fb devices\n if (this.GETPATH != null && this.GETPATH == true && this.config.fbdevices == true){\n const items = await this.Fb.getDeviceList(this, cfg, this.Fb);\n if (items != null){\n let res = await obj.createFbDeviceObjects(this, items, this.enabled);\n if (res === true) this.log.info('createFbDeviceObjects finished successfully');\n res = await obj.createMeshObjects(this, items, 0, this.enabled); //create channel 0 as default interface\n if (res === true) this.log.info('createMeshObjects finished successfully');\n }else{\n this.log.error('createFbDeviceObjects -> ' + \"can't read devices from fritzbox! Adapter stops\");\n adapterObj = await this.getForeignObjectAsync(`system.adapter.${this.namespace}`);\n adapterObj.common.enabled = false; // Adapter ausschalten\n await this.setForeignObjectAsync(`system.adapter.${this.namespace}`, adapterObj);\n }\n await this.resyncFbObjects(items);\n }\n\n // states changes inside the adapters namespace are subscribed\n if (this.SETENABLE === true && this.WLAN3INFO === true) this.subscribeStates(`${this.namespace}` + '.guest.wlan');\n if (this.DISALLOWWANACCESSBYIP === true && this.GETWANACCESSBYIP === true) this.subscribeStates(`${this.namespace}` + '.fb-devices.*.disabled'); \n if (this.REBOOT === true) this.subscribeStates(`${this.namespace}` + '.reboot'); \n\n //get uuid for transaction\n //const sSid = await Fb.soapAction(Fb, '/upnp/control/deviceconfig', urn + 'DeviceConfig:1', 'X_GenerateUUID', null);\n //const uuid = sSid['NewUUID'].replace('uuid:', '');\n this.loop(10, 55, cronFamily, cron, cfg);\n } catch (error) {\n this.showError('onReady: ' + error);\n }\n }", "async onReady() {\n // Initialize your adapter here\n\n this.setState(\"info.connection\", false, true);\n // Reset the connection indicator during startup\n this.type = \"VW\";\n this.country = \"DE\";\n this.clientId = \"9496332b-ea03-4091-a224-8c746b885068%40apps_vw-dilab_com\";\n this.xclientId = \"38761134-34d0-41f3-9a73-c4be88d7d337\";\n this.scope = \"openid%20profile%20mbb%20email%20cars%20birthdate%20badge%20address%20vin\";\n this.redirect = \"carnet%3A%2F%2Fidentity-kit%2Flogin\";\n this.xrequest = \"de.volkswagen.carnet.eu.eremote\";\n this.responseType = \"id_token%20token%20code\";\n this.xappversion = \"5.1.2\";\n this.xappname = \"eRemote\";\n if (this.config.type === \"id\") {\n this.type = \"Id\";\n this.country = \"DE\";\n this.clientId = \"a24fba63-34b3-4d43-b181-942111e6bda8@apps_vw-dilab_com\";\n this.xclientId = \"\";\n this.scope = \"openid profile badge cars dealers birthdate vin\";\n this.redirect = \"weconnect://authenticated\";\n this.xrequest = \"com.volkswagen.weconnect\";\n this.responseType = \"code id_token token\";\n this.xappversion = \"\";\n this.xappname = \"\";\n }\n if (this.config.type === \"skoda\") {\n this.type = \"Skoda\";\n this.country = \"CZ\";\n this.clientId = \"7f045eee-7003-4379-9968-9355ed2adb06%40apps_vw-dilab_com\";\n this.xclientId = \"28cd30c6-dee7-4529-a0e6-b1e07ff90b79\";\n this.scope = \"openid%20profile%20phone%20address%20cars%20email%20birthdate%20badge%20dealers%20driversLicense%20mbb\";\n this.redirect = \"skodaconnect%3A%2F%2Foidc.login%2F\";\n this.xrequest = \"cz.skodaauto.connect\";\n this.responseType = \"code%20id_token\";\n this.xappversion = \"3.2.6\";\n this.xappname = \"cz.skodaauto.connect\";\n }\n if (this.config.type === \"seat\") {\n this.type = \"Seat\";\n this.country = \"ES\";\n this.clientId = \"50f215ac-4444-4230-9fb1-fe15cd1a9bcc@apps_vw-dilab_com\";\n this.xclientId = \"9dcc70f0-8e79-423a-a3fa-4065d99088b4\";\n this.scope = \"openid profile mbb cars birthdate nickname address phone\";\n this.redirect = \"seatconnect://identity-kit/login\";\n this.xrequest = \"cz.skodaauto.connect\";\n this.responseType = \"code%20id_token\";\n this.xappversion = \"1.1.29\";\n this.xappname = \"SEATConnect\";\n }\n if (this.config.type === \"audi\") {\n this.type = \"Audi\";\n this.country = \"DE\";\n this.clientId = \"09b6cbec-cd19-4589-82fd-363dfa8c24da@apps_vw-dilab_com\";\n this.xclientId = \"77869e21-e30a-4a92-b016-48ab7d3db1d8\";\n this.scope = \"address profile badge birthdate birthplace nationalIdentifier nationality profession email vin phone nickname name picture mbb gallery openid\";\n this.redirect = \"myaudi:///\";\n this.xrequest = \"de.myaudi.mobile.assistant\";\n this.responseType = \"token%20id_token\";\n // this.responseType = \"code\";\n this.xappversion = \"3.22.0\";\n this.xappname = \"myAudi\";\n }\n if (this.config.type === \"go\") {\n this.type = \"\";\n this.country = \"\";\n this.clientId = \"ac42b0fa-3b11-48a0-a941-43a399e7ef84@apps_vw-dilab_com\";\n this.xclientId = \"\";\n this.scope = \"openid%20profile%20address%20email%20phone\";\n this.redirect = \"vwconnect%3A%2F%2Fde.volkswagen.vwconnect%2Foauth2redirect%2Fidentitykit\";\n this.xrequest = \"\";\n this.responseType = \"code\";\n this.xappversion = \"\";\n this.xappname = \"\";\n }\n if (this.config.interval === 0) {\n this.log.info(\"Interval of 0 is not allowed reset to 1\");\n this.config.interval = 1;\n }\n this.login()\n .then(() => {\n this.log.debug(\"Login successful\");\n this.setState(\"info.connection\", true, true);\n this.getPersonalData()\n .then(() => {\n this.getVehicles()\n .then(() => {\n if (this.config.type !== \"go\") {\n this.vinArray.forEach((vin) => {\n if (this.config.type === \"id\") {\n this.getIdStatus(vin).catch(() => {\n this.log.error(\"get id status Failed\");\n });\n } else {\n this.getHomeRegion(vin)\n .catch(() => {\n this.log.debug(\"get home region Failed\");\n })\n .finally(() => {\n this.getVehicleData(vin).catch(() => {\n this.log.error(\"get vehicle data Failed\");\n });\n this.getVehicleRights(vin).catch(() => {\n this.log.error(\"get vehicle rights Failed\");\n });\n this.requestStatusUpdate(vin)\n .finally(() => {\n this.statesArray.forEach((state) => {\n this.getVehicleStatus(vin, state.url, state.path, state.element, state.element2, state.element3, state.element4).catch(() => {\n this.log.debug(\"error while getting \" + state.url);\n });\n });\n })\n .catch(() => {\n this.log.error(\"status update Failed\");\n });\n })\n .catch(() => {\n this.log.error(\"Error getting home region\");\n });\n }\n });\n }\n\n this.updateInterval = setInterval(() => {\n if (this.config.type === \"go\") {\n this.getVehicles();\n return;\n } else if (this.config.type === \"id\") {\n this.vinArray.forEach((vin) => {\n this.getIdStatus(vin).catch(() => {\n this.log.error(\"get id status Failed\");\n this.refreshIDToken().catch(() => {});\n });\n this.getWcData();\n });\n return;\n } else {\n this.vinArray.forEach((vin) => {\n this.statesArray.forEach((state) => {\n this.getVehicleStatus(vin, state.url, state.path, state.element, state.element2).catch(() => {\n this.log.debug(\"error while getting \" + state.url);\n });\n });\n });\n }\n }, this.config.interval * 60 * 1000);\n\n if (this.config.forceinterval > 0) {\n this.fupdateInterval = setInterval(() => {\n if (this.config.type === \"go\") {\n this.getVehicles();\n return;\n }\n this.vinArray.forEach((vin) => {\n this.requestStatusUpdate(vin).catch(() => {\n this.log.error(\"force status update Failed\");\n });\n });\n }, this.config.forceinterval * 60 * 1000);\n }\n })\n .catch(() => {\n this.log.error(\"Get Vehicles Failed\");\n });\n })\n .catch(() => {\n this.log.error(\"get personal data Failed\");\n });\n })\n .catch(() => {\n this.log.error(\"Login Failed\");\n });\n this.subscribeStates(\"*\");\n }", "started () {}", "_specializedInitialisation()\r\n\t{\r\n\t\tLogger.log(\"Specialisation for service AVTransport\", LogType.Info);\r\n\t\tvar relativeTime = this.getVariableByName(\"RelativeTimePosition\");\r\n\t\t//Implémentation pour OpenHome\r\n\t\tif (!relativeTime)\r\n\t\t\trelativeTime = this.getVariableByName(\"A_ARG_TYPE_GetPositionInfo_RelTime\");\r\n\t\tvar transportState = this.getVariableByName(\"TransportState\");\r\n\t\t//Implémentation pour OpenHome\r\n\t\tif (!transportState)\r\n\t\t\ttransportState = this.getVariableByName(\"A_ARG_TYPE_GetTransportInfo_CurrentTransportState\");\r\n\r\n\t\tif (transportState)\r\n\t\t{\r\n\t\t\ttransportState.on('updated', (variable, newVal) =>\r\n\t\t\t{\r\n\t\t\t\tLogger.log(\"On transportStateUpdate : \" + newVal, LogType.DEBUG);\r\n\t\t\t\tvar actPosInfo = this.getActionByName(\"GetPositionInfo\");\r\n\t\t\t\tvar actMediaInfo = this.getActionByName(\"GetMediaInfo\");\r\n\t\t\t\t/*\r\n\t\t\t\t“STOPPED” R\r\n\t\t\t\t“PLAYING” R\r\n\t\t\t\t“TRANSITIONING” O\r\n\t\t\t\t”PAUSED_PLAYBACK” O\r\n\t\t\t\t“PAUSED_RECORDING” O\r\n\t\t\t\t“RECORDING” O\r\n\t\t\t\t“NO_MEDIA_PRESENT”\r\n\t\t\t\t */\r\n\t\t\t\tif (relativeTime && !relativeTime.SendEvent && actPosInfo)\r\n\t\t\t\t{\r\n\t\t\t\t\tif (this._intervalUpdateRelativeTime)\r\n\t\t\t\t\t\tclearInterval(this._intervalUpdateRelativeTime);\r\n\t\t\t\t\tif (newVal == \"PLAYING\" || newVal == \"RECORDING\")\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tactPosInfo.execute(\t{\tInstanceID: 0\t} );\r\n\t\t\t\t\t\t//Déclenche la maj toutes les 4 secondes\r\n\t\t\t\t\t\tthis._intervalUpdateRelativeTime = setInterval(() =>{\r\n\t\t\t\t\t\t\t\t//Logger.log(\"On autoUpdate\", LogType.DEBUG);\r\n\t\t\t\t\t\t\t\tactPosInfo.execute(\t{\tInstanceID: 0\t}\t);\r\n\t\t\t\t\t\t\t}, 4000);\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\t//else if (newVal == \"STOPPED\" || newVal == \"PAUSED_PLAYBACK\" || newVal == \"PAUSED_RECORDING\" || newVal == \"NO_MEDIA_PRESENT\")\r\n\t\t\t\t//{\r\n\t\t\t\t//\r\n\t\t\t\t//}\r\n\t\t\t\t//On met a jour les media info et position info pour etre sur de mettre a jour les Metadata(par defaut la freebox ne le fait pas ou plutot le fait mal)\r\n\t\t\t\tif (newVal == \"TRANSITIONING\")\r\n\t\t\t\t{\r\n\t\t\t\t\tif (actPosInfo)\r\n\t\t\t\t\t\tactPosInfo.execute(\t{InstanceID: 0}\t);\r\n\t\t\t\t\tif (actMediaInfo)\r\n\t\t\t\t\t\tactMediaInfo.execute(\t{InstanceID: 0} );\r\n\t\t\t\t}\r\n\r\n\t\t\t\tif (newVal == \"STOPPED\")\r\n\t\t\t\t{\r\n\t\t\t\t\tif (actPosInfo)\r\n\t\t\t\t\t\tactPosInfo.execute(\t{\tInstanceID: 0\t});\r\n\t\t\t\t\tif (actMediaInfo)\r\n\t\t\t\t\t\tactMediaInfo.execute(\t{\tInstanceID: 0 });\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\t);\r\n\t\t}\r\n\t}", "loadComponent(nodeURI, baseURI, callback_async /* nodeDescriptor */, errback_async /* errorMessage */) { // TODO: turn this into a generic xhr loader exposed as a kernel function?\n\n let self = this;\n\n if (nodeURI == self.kutility.protoNodeURI) {\n\n callback_async(self.kutility.protoNodeDescriptor);\n\n } else if (nodeURI.match(RegExp(\"^data:application/json;base64,\"))) {\n\n // Primarly for testing, parse one specific form of data URIs. We need to parse\n // these ourselves since Chrome can't load data URIs due to cross origin\n // restrictions.\n\n callback_async(JSON.parse(atob(nodeURI.substring(29)))); // TODO: support all data URIs\n\n } else {\n\n self.virtualTime.suspend(\"while loading \" + nodeURI); // suspend the queue\n\n let fetchUrl = self.remappedURI(nodeURI, baseURI);\n let dbName = fetchUrl.split(\".\").join(\"_\");\n\n const parseComp = function (f) {\n\n let result = JSON.parse(f);\n\n let nativeObject = result;\n // console.log(nativeObject);\n\n if (nativeObject) {\n callback_async(nativeObject);\n self.virtualTime.resume(\"after loading \" + nodeURI); // resume the queue; may invoke dispatch(), so call last before returning to the host\n\n } else {\n\n self.logger.warnx(\"loadComponent\", \"error loading\", nodeURI + \":\", error);\n errback_async(error);\n self.virtualTime.resume(\"after loading \" + nodeURI); // resume the queue; may invoke dispatch(), so call last before returning to the host\n }\n\n }\n\n\n //var fileName = \"\";\n // let userDB = _LCSDB.user(_LCS_WORLD_USER.pub); \n if (dbName.includes(\"proxy\")) {\n //userDB = await window._LCS_SYS_USER.get('proxy').then();\n let proxyDB = self.proxy ? _LCSDB.user(self.proxy) : _LCSDB.user(_LCS_WORLD_USER.pub);\n let fileName = dbName + '_json';\n let dbNode = proxyDB.get('proxy').get(fileName);\n let nodeProm = new Promise(res => dbNode.once(res));\n\n nodeProm.then(comp => {\n parseComp(comp);\n })\n\n // (function(r){\n // //console.log(r);\n // parseComp(r);\n\n // });\n\n } else {\n var worldName = dbName.split('/')[1];\n var fileName = dbName.split('/')[2];\n //+ '_json';\n\n if (!fileName) {\n worldName = self.helpers.appPath\n fileName = dbName + '_json';\n } else {\n fileName = fileName + '_json';\n }\n\n let dbNode = _LCSDB.user(_LCS_WORLD_USER.pub).get('worlds').path(worldName).get(fileName);\n\n let nodeProm = new Promise(res => dbNode.once(res))\n nodeProm.then(comp => {\n parseComp(comp);\n })\n\n // (function(r){\n // //console.log(r);\n // parseComp(r);\n\n // });\n }\n\n //console.log(source);\n\n //userDB.get(fileName).once(async function(res) {\n\n\n\n\n // }, {wait: 1000})\n }\n\n }", "async onReady() {\n // Initialize your adapter here\n await this.setObjectNotExistsAsync('speed', {\n type: 'channel',\n common: {\n name: 'speed'\n },\n native: {},\n });\n await this.setObjectNotExistsAsync('speed.download', {\n type: 'state',\n common: {\n name: 'download',\n role: 'info.status',\n type: 'number',\n desc: 'Download speed',\n def: 0,\n read: true,\n write: false,\n unit: 'Mbit/s',\n },\n native: {},\n });\n await this.setObjectNotExistsAsync('speed.upload', {\n type: 'state',\n common: {\n name: 'upload',\n role: 'info.status',\n type: 'number',\n desc: 'Upload speed',\n def: 0,\n read: true,\n write: false,\n unit: 'Mbit/s',\n },\n native: {},\n });\n await this.setObjectNotExistsAsync('speed.ping', {\n type: 'state',\n common: {\n name: 'ping',\n role: 'info.status',\n type: 'number',\n desc: 'Ping Latency',\n def: 0,\n read: true,\n write: false,\n unit: 'ms',\n },\n native: {},\n });\n await this.setObjectNotExistsAsync('speed.progress', {\n type: 'state',\n common: {\n name: 'progress',\n role: 'info.status',\n type: 'number',\n desc: 'Progress',\n def: 0,\n read: true,\n write: false,\n unit: '%',\n },\n native: {},\n });\n await this.setObjectNotExistsAsync('speed.speedcheck', {\n type: 'state',\n common: {\n name: 'Run speed test',\n type: 'boolean',\n read: true,\n role: 'button',\n write: true,\n def: false\n },\n native: {},\n });\n await this.setObjectNotExistsAsync('progress', {\n type: 'channel',\n common: {\n name: 'speed'\n },\n native: {},\n });\n await this.setObjectNotExistsAsync('progress.download', {\n type: 'state',\n common: {\n name: 'download',\n role: 'info.status',\n type: 'number',\n desc: 'Download speed',\n def: 0,\n read: true,\n write: false,\n unit: 'Mbit/s',\n },\n native: {},\n });\n await this.setObjectNotExistsAsync('progress.upload', {\n type: 'state',\n common: {\n name: 'upload',\n role: 'info.status',\n type: 'number',\n desc: 'Upload speed',\n def: 0,\n read: true,\n write: false,\n unit: 'Mbit/s',\n },\n native: {},\n });\n await this.setObjectNotExistsAsync('progress.ping', {\n type: 'state',\n common: {\n name: 'ping',\n role: 'info.status',\n type: 'number',\n desc: 'Ping Latency',\n def: 0,\n read: true,\n write: false,\n unit: 'ms',\n },\n native: {},\n });\n await this.setObjectNotExistsAsync('progress.progress', {\n type: 'state',\n common: {\n name: 'progress',\n role: 'info.status',\n type: 'number',\n desc: 'Progress',\n def: 0,\n read: true,\n write: false,\n unit: '%',\n },\n native: {},\n });\n await this.setObjectNotExistsAsync('progress.speedcheck', {\n type: 'state',\n common: {\n name: 'Run speed test',\n type: 'boolean',\n read: true,\n role: 'button',\n write: true,\n def: false\n },\n native: {},\n });\n await this.setObjectNotExistsAsync('info', {\n type: 'channel',\n common: {\n name: 'Information'\n },\n native: {},\n });\n await this.setObjectNotExistsAsync('info.externalip', {\n type: 'state',\n common: {\n name: 'External IP',\n role: 'info.status',\n type: 'string',\n desc: 'External IP',\n read: true,\n write: false,\n },\n native: {},\n });\n await this.setObjectNotExistsAsync('info.internalip', {\n type: 'state',\n common: {\n name: 'Internal IP',\n role: 'info.status',\n type: 'string',\n desc: 'Internal IP',\n read: true,\n write: false,\n },\n native: {},\n });\n this.subscribeStates('*');\n await this.setStateAsync('info.connection', { val: true, ack: true });\n // let result = await this.checkPasswordAsync('admin', 'iobroker');\n // this.log.info('check user admin pw iobroker: ' + result);\n // result = await this.checkGroupAsync('admin', 'admin');\n // this.log.info('check group user admin group admin: ' + result);\n if (this.config.polltime > 1) {\n this.log.info('Checking internet speed every ' + this.config.polltime + ' minutes');\n } else {\n this.log.info('Checking internet speed every ' + this.config.polltime + ' minute');\n }\n await this.start(this.config.polltime);\n }", "enqueue() {\n\n }", "started() { }", "onBrowserStart(browser) {\n\n }", "getPort2() {\n return 0;\n }", "requestReceived(request,response){\n if(this.config.log){\n const logData={\n method : request.method,\n url : request.url,\n headers : request.headers\n };\n\n this.config.logFunction(\n logData\n );\n }\n\n let uri = url.parse(request.url);\n uri.protocol='http';\n uri.host=uri.hostname=request.headers.host;\n uri.port=80;\n uri.query=querystring.parse(uri.query);\n\n if(request.connection.encrypted){\n uri.protocol='https';\n uri.port=443;\n }\n\n (\n function(){\n if(!uri.host){\n return;\n }\n const host=uri.host.split(':');\n\n if(!host[1]){\n return;\n }\n uri.host=uri.hostname=host[0];\n uri.port=host[1];\n }\n )();\n\n for(let key in uri){\n if(uri[key]!==null){\n continue;\n }\n uri[key]='';\n }\n\n request.uri=uri;\n\n if(\n this.onRawRequest(\n request,\n response,\n completeServing.bind(this)\n )\n ){\n return;\n };\n\n uri=uri.pathname;\n\n if (uri=='/'){\n uri=`/${this.config.server.index}`;\n }\n\n let hostname= [];\n\n if (request.headers.host !== undefined){\n hostname = request.headers.host.split(':');\n }\n\n let root = this.config.root;\n\n if(this.config.verbose){\n console.log(`${this.config.logID} REQUEST ###\\n\\n`,\n request.headers,'\\n',\n uri,'\\n\\n',\n hostname,'\\n\\n'\n );\n }\n\n if(this.config.domain!='0.0.0.0' && hostname.length > 0 && hostname[0]!=this.config.domain){\n if(!this.config.domains[hostname[0]]){\n if(this.config.verbose){\n console.log(`${this.config.logID} INVALID HOST ###\\n\\n`);\n }\n this.serveFile(hostname[0],false,response);\n return;\n }\n root=this.config.domains[hostname[0]];\n }\n\n\n if(this.config.verbose){\n console.log(`${this.config.logID} USING ROOT : ${root}###\\n\\n`);\n }\n\n if(uri.slice(-1)=='/'){\n uri+=this.config.server.index;\n }\n\n request.url=uri;\n request.serverRoot=root;\n\n request.body='';\n\n request.on(\n 'data',\n function(chunk){\n request.body+=chunk;\n }.bind(this)\n ).on(\n 'end',\n function(){\n if(this.config.verbose){\n console.log(`###REQUEST BODY :\n ${request.body}\n ###\n `);\n }\n\n requestBodyComplete.bind(this,request,response)();\n }.bind(this)\n );\n }", "function OnChannelOpen()\n{\n}", "connect() {\n throw new Error(\n 'The Message Bus is not currently supported in browser environments'\n );\n }", "constructor() {\n throw new Error('Not implemented');\n }", "constructor() {\n this._connectionResolver = new pip_services3_components_node_1.ConnectionResolver();\n this._maxKeySize = 250;\n this._maxExpiration = 2592000;\n this._maxValue = 1048576;\n this._poolSize = 5;\n this._reconnect = 10000;\n this._timeout = 5000;\n this._retries = 5;\n this._failures = 5;\n this._retry = 30000;\n this._remove = false;\n this._idle = 5000;\n this._client = null;\n }", "componentDidMount()\n {\n\n }", "function OfflineStreamProcessor(config) {\n config = config || {};\n var context = this.context;\n var eventBus = config.eventBus;\n var events = config.events;\n var errors = config.errors;\n var debug = config.debug;\n var constants = config.constants;\n var settings = config.settings;\n var dashConstants = config.dashConstants;\n var manifestId = config.id;\n var type = config.type;\n var streamInfo = config.streamInfo;\n var errHandler = config.errHandler;\n var mediaPlayerModel = config.mediaPlayerModel;\n var abrController = config.abrController;\n var playbackController = config.playbackController;\n var adapter = config.adapter;\n var dashMetrics = config.dashMetrics;\n var baseURLController = config.baseURLController;\n var timelineConverter = config.timelineConverter;\n var bitrate = config.bitrate;\n var offlineStoreController = config.offlineStoreController;\n var completedCb = config.callbacks && config.callbacks.completed;\n var progressCb = config.callbacks && config.callbacks.progression;\n var instance, logger, mediaInfo, indexHandler, representationController, fragmentModel, updating, downloadedSegments, isInitialized, segmentsController, isStopped;\n\n function setup() {\n resetInitialSettings();\n logger = debug.getLogger(instance);\n segmentsController = Object(_dash_controllers_SegmentsController__WEBPACK_IMPORTED_MODULE_6__[\"default\"])(context).create({\n events: events,\n eventBus: eventBus,\n streamInfo: streamInfo,\n timelineConverter: timelineConverter,\n dashConstants: dashConstants,\n segmentBaseController: config.segmentBaseController,\n type: type\n });\n indexHandler = Object(_dash_DashHandler__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(context).create({\n streamInfo: streamInfo,\n type: type,\n timelineConverter: timelineConverter,\n dashMetrics: dashMetrics,\n mediaPlayerModel: mediaPlayerModel,\n baseURLController: baseURLController,\n errHandler: errHandler,\n settings: settings,\n // boxParser: boxParser,\n eventBus: eventBus,\n events: events,\n debug: debug,\n requestModifier: Object(_streaming_utils_RequestModifier__WEBPACK_IMPORTED_MODULE_5__[\"default\"])(context).getInstance(),\n dashConstants: dashConstants,\n constants: constants,\n segmentsController: segmentsController,\n urlUtils: Object(_streaming_utils_URLUtils__WEBPACK_IMPORTED_MODULE_4__[\"default\"])(context).getInstance()\n });\n representationController = Object(_dash_controllers_RepresentationController__WEBPACK_IMPORTED_MODULE_1__[\"default\"])(context).create({\n streamInfo: streamInfo,\n type: type,\n abrController: abrController,\n dashMetrics: dashMetrics,\n playbackController: playbackController,\n timelineConverter: timelineConverter,\n dashConstants: dashConstants,\n events: events,\n eventBus: eventBus,\n errors: errors,\n segmentsController: segmentsController\n });\n fragmentModel = Object(_streaming_models_FragmentModel__WEBPACK_IMPORTED_MODULE_2__[\"default\"])(context).create({\n streamInfo: streamInfo,\n dashMetrics: dashMetrics,\n fragmentLoader: Object(_streaming_FragmentLoader__WEBPACK_IMPORTED_MODULE_3__[\"default\"])(context).create({\n dashMetrics: dashMetrics,\n mediaPlayerModel: mediaPlayerModel,\n errHandler: errHandler,\n requestModifier: Object(_streaming_utils_RequestModifier__WEBPACK_IMPORTED_MODULE_5__[\"default\"])(context).getInstance(),\n settings: settings,\n eventBus: eventBus,\n events: events,\n errors: errors,\n constants: constants,\n dashConstants: dashConstants,\n urlUtils: Object(_streaming_utils_URLUtils__WEBPACK_IMPORTED_MODULE_4__[\"default\"])(context).getInstance()\n }),\n debug: debug,\n eventBus: eventBus,\n events: events\n });\n eventBus.on(events.STREAM_REQUESTING_COMPLETED, onStreamRequestingCompleted, instance);\n eventBus.on(events.FRAGMENT_LOADING_COMPLETED, onFragmentLoadingCompleted, instance);\n }\n\n function initialize(_mediaInfo) {\n mediaInfo = _mediaInfo;\n indexHandler.initialize(false);\n updateRepresentation(mediaInfo);\n }\n\n function isInitRequest(request) {\n return request.type === 'InitializationSegment';\n }\n\n function onFragmentLoadingCompleted(e) {\n if (e.sender !== fragmentModel) {\n return;\n }\n\n if (e.request !== null) {\n var isInit = isInitRequest(e.request);\n var suffix = isInit ? 'init' : e.request.index;\n var fragmentName = e.request.representationId + '_' + suffix;\n offlineStoreController.storeFragment(manifestId, fragmentName, e.response).then(function () {\n if (!isInit) {\n // store current index and downloadedSegments number\n offlineStoreController.setRepresentationCurrentState(manifestId, e.request.representationId, {\n index: e.request.index,\n downloaded: downloadedSegments\n });\n }\n });\n }\n\n if (e.error && e.request.serviceLocation && !isStopped) {\n fragmentModel.executeRequest(e.request);\n } else {\n downloadedSegments++;\n download();\n }\n }\n\n function onStreamRequestingCompleted(e) {\n if (e.fragmentModel !== fragmentModel) {\n return;\n }\n\n logger.info(\"[\".concat(manifestId, \"] Stream is complete\"));\n stop();\n completedCb();\n }\n\n function getRepresentationController() {\n return representationController;\n }\n\n function getRepresentationId() {\n return representationController.getCurrentRepresentation().id;\n }\n /**\n * Stops download of fragments\n * @memberof OfflineStreamProcessor#\n */\n\n\n function stop() {\n if (isStopped) {\n return;\n }\n\n isStopped = true;\n }\n\n function removeExecutedRequestsBeforeTime(time) {\n if (fragmentModel) {\n fragmentModel.removeExecutedRequestsBeforeTime(time);\n }\n }\n /**\n * Execute init request for the represenation\n * @memberof OfflineStreamProcessor#\n */\n\n\n function getInitRequest() {\n if (!representationController.getCurrentRepresentation()) {\n return null;\n }\n\n return indexHandler.getInitRequest(getMediaInfo(), representationController.getCurrentRepresentation());\n }\n /**\n * Get next request\n * @memberof OfflineStreamProcessor#\n */\n\n\n function getNextRequest() {\n return indexHandler.getNextSegmentRequest(getMediaInfo(), representationController.getCurrentRepresentation());\n }\n /**\n * Start download\n * @memberof OfflineStreamProcessor#\n */\n\n\n function start() {\n if (representationController) {\n if (!representationController.getCurrentRepresentation()) {\n throw new Error('Start denied to OfflineStreamProcessor');\n }\n\n isStopped = false;\n offlineStoreController.getRepresentationCurrentState(manifestId, representationController.getCurrentRepresentation().id).then(function (state) {\n if (state) {\n indexHandler.setCurrentIndex(state.index);\n downloadedSegments = state.downloaded;\n }\n\n download();\n })[\"catch\"](function () {\n // start from beginining\n download();\n });\n }\n }\n /**\n * Performs download of fragment according to type\n * @memberof OfflineStreamProcessor#\n */\n\n\n function download() {\n if (isStopped) {\n return;\n }\n\n if (isNaN(representationController.getCurrentRepresentation())) {\n var request = null;\n\n if (!isInitialized) {\n request = getInitRequest();\n isInitialized = true;\n } else {\n request = getNextRequest(); // update progression : done here because availableSegmentsNumber is done in getNextRequest from dash handler\n\n updateProgression();\n }\n\n if (request) {\n logger.info(\"[\".concat(manifestId, \"] download request : \").concat(request.url));\n fragmentModel.executeRequest(request);\n } else {\n logger.info(\"[\".concat(manifestId, \"] no request to be downloaded\"));\n }\n }\n }\n /**\n * Update representation\n * @param {Object} mediaInfo - mediaInfo\n * @memberof OfflineStreamProcessor#\n */\n\n\n function updateRepresentation(mediaInfo) {\n updating = true;\n var voRepresentations = adapter.getVoRepresentations(mediaInfo); // get representation VO according to id.\n\n var quality = voRepresentations.findIndex(function (representation) {\n return representation.id === bitrate.id;\n });\n\n if (type !== constants.VIDEO && type !== constants.AUDIO && type !== constants.TEXT) {\n updating = false;\n return;\n }\n\n representationController.updateData(null, voRepresentations, type, mediaInfo.isFragmented, quality);\n }\n\n function isUpdating() {\n return updating;\n }\n\n function getType() {\n return type;\n }\n\n function getMediaInfo() {\n return mediaInfo;\n }\n\n function getAvailableSegmentsNumber() {\n return representationController.getCurrentRepresentation().availableSegmentsNumber + 1; // do not forget init segment\n }\n\n function updateProgression() {\n if (progressCb) {\n progressCb(instance, downloadedSegments, getAvailableSegmentsNumber());\n }\n }\n\n function resetInitialSettings() {\n isInitialized = false;\n downloadedSegments = 0;\n updating = false;\n }\n /**\n * Reset\n * @memberof OfflineStreamProcessor#\n */\n\n\n function reset() {\n resetInitialSettings();\n indexHandler.reset();\n eventBus.off(events.STREAM_REQUESTING_COMPLETED, onStreamRequestingCompleted, instance);\n eventBus.off(events.FRAGMENT_LOADING_COMPLETED, onFragmentLoadingCompleted, instance);\n }\n\n instance = {\n initialize: initialize,\n getMediaInfo: getMediaInfo,\n getRepresentationController: getRepresentationController,\n removeExecutedRequestsBeforeTime: removeExecutedRequestsBeforeTime,\n getType: getType,\n getRepresentationId: getRepresentationId,\n isUpdating: isUpdating,\n start: start,\n stop: stop,\n getAvailableSegmentsNumber: getAvailableSegmentsNumber,\n reset: reset\n };\n setup();\n return instance;\n}", "constructor() {\r\n }", "constructor() {\n\t\t// ...\n\t}", "static get STATUS() {\n return 0;\n }", "onReady() {\n return __awaiter(this, void 0, void 0, function* () {\n this.logger = new log_1.ioBrokerLogger(this.log);\n yield this.setObjectNotExistsAsync(\"verify_code\", {\n type: \"state\",\n common: {\n name: \"2FA verification code\",\n type: \"number\",\n role: \"state\",\n read: true,\n write: true,\n },\n native: {},\n });\n yield this.setObjectNotExistsAsync(\"info\", {\n type: \"channel\",\n common: {\n name: \"info\"\n },\n native: {},\n });\n yield this.setObjectNotExistsAsync(\"info.connection\", {\n type: \"state\",\n common: {\n name: \"Global connection\",\n type: \"boolean\",\n role: \"indicator.connection\",\n read: true,\n write: false,\n },\n native: {},\n });\n yield this.setStateAsync(\"info.connection\", { val: false, ack: true });\n yield this.setObjectNotExistsAsync(\"info.push_connection\", {\n type: \"state\",\n common: {\n name: \"Push notification connection\",\n type: \"boolean\",\n role: \"indicator.connection\",\n read: true,\n write: false,\n },\n native: {},\n });\n // Remove old states of previous adapter versions\n try {\n const schedule_modes = yield this.getStatesAsync(\"*.schedule_mode\");\n Object.keys(schedule_modes).forEach((id) => __awaiter(this, void 0, void 0, function* () {\n yield this.delObjectAsync(id);\n }));\n }\n catch (error) {\n }\n try {\n const push_notifications = yield this.getStatesAsync(\"push_notification.*\");\n Object.keys(push_notifications).forEach((id) => __awaiter(this, void 0, void 0, function* () {\n yield this.delObjectAsync(id);\n }));\n yield this.delObjectAsync(\"push_notification\");\n }\n catch (error) {\n }\n try {\n const last_camera_url = yield this.getStatesAsync(\"*.last_camera_url\");\n Object.keys(last_camera_url).forEach((id) => __awaiter(this, void 0, void 0, function* () {\n yield this.delObjectAsync(id);\n }));\n }\n catch (error) {\n }\n try {\n const captured_pic_url = yield this.getStatesAsync(\"*.captured_pic_url\");\n Object.keys(captured_pic_url).forEach((id) => __awaiter(this, void 0, void 0, function* () {\n yield this.delObjectAsync(id);\n }));\n }\n catch (error) {\n }\n try {\n const person_identified = yield this.getStatesAsync(\"*.person_identified\");\n Object.keys(person_identified).forEach((id) => __awaiter(this, void 0, void 0, function* () {\n yield this.delObjectAsync(id);\n }));\n }\n catch (error) {\n }\n try {\n const last_captured_pic_url = yield this.getStatesAsync(\"*.last_captured_pic_url\");\n Object.keys(last_captured_pic_url).forEach((id) => __awaiter(this, void 0, void 0, function* () {\n yield this.delObjectAsync(id);\n }));\n }\n catch (error) {\n }\n try {\n const last_captured_pic_html = yield this.getStatesAsync(\"*.last_captured_pic_html\");\n Object.keys(last_captured_pic_html).forEach((id) => __awaiter(this, void 0, void 0, function* () {\n yield this.delObjectAsync(id);\n }));\n }\n catch (error) {\n }\n // End\n // Reset event states if necessary (for example because of an unclean exit)\n yield this.initializeEvents(types_1.CameraStateID.PERSON_DETECTED);\n yield this.initializeEvents(types_1.CameraStateID.MOTION_DETECTED);\n yield this.initializeEvents(types_1.DoorbellStateID.RINGING);\n yield this.initializeEvents(types_1.IndoorCameraStateID.CRYING_DETECTED);\n yield this.initializeEvents(types_1.IndoorCameraStateID.SOUND_DETECTED);\n yield this.initializeEvents(types_1.IndoorCameraStateID.PET_DETECTED);\n try {\n if (fs.statSync(this.persistentFile).isFile()) {\n const fileContent = fs.readFileSync(this.persistentFile, \"utf8\");\n this.persistentData = JSON.parse(fileContent);\n }\n }\n catch (err) {\n this.logger.debug(\"No stored data from last exit found.\");\n }\n //TODO: Temporary Test to be removed!\n /*await this.setObjectNotExistsAsync(\"test_button\", {\n type: \"state\",\n common: {\n name: \"Test button\",\n type: \"boolean\",\n role: \"button\",\n read: false,\n write: true,\n },\n native: {},\n });\n this.subscribeStates(\"test_button\");\n await this.setObjectNotExistsAsync(\"test_button2\", {\n type: \"state\",\n common: {\n name: \"Test button2\",\n type: \"boolean\",\n role: \"button\",\n read: false,\n write: true,\n },\n native: {},\n });\n this.subscribeStates(\"test_button2\");*/\n // END\n this.subscribeStates(\"verify_code\");\n const systemConfig = yield this.getForeignObjectAsync(\"system.config\");\n let countryCode = undefined;\n let languageCode = undefined;\n if (systemConfig) {\n countryCode = i18n_iso_countries_1.getAlpha2Code(systemConfig.common.country, \"en\");\n if (i18n_iso_languages_1.isValid(systemConfig.common.language))\n languageCode = systemConfig.common.language;\n }\n try {\n const adapter_info = yield this.getForeignObjectAsync(`system.adapter.${this.namespace}`);\n if (adapter_info && adapter_info.common && adapter_info.common.version) {\n if (this.persistentData.version !== adapter_info.common.version) {\n const currentVersion = Number.parseFloat(utils_1.removeLastChar(adapter_info.common.version, \".\"));\n const previousVersion = this.persistentData.version !== \"\" && this.persistentData.version !== undefined ? Number.parseFloat(utils_1.removeLastChar(this.persistentData.version, \".\")) : 0;\n this.logger.debug(`Handling of adapter update - currentVersion: ${currentVersion} previousVersion: ${previousVersion}`);\n if (previousVersion < currentVersion) {\n yield utils_1.handleUpdate(this, this.logger, previousVersion);\n this.persistentData.version = adapter_info.common.version;\n this.writePersistentData();\n }\n }\n }\n }\n catch (error) {\n this.logger.error(`Handling of adapter update - Error:`, error);\n }\n this.eufy = new EufySecurityAPI.EufySecurity(this, this.logger, countryCode, languageCode);\n this.eufy.on(\"stations\", (stations) => this.handleStations(stations));\n this.eufy.on(\"devices\", (devices) => this.handleDevices(devices));\n this.eufy.on(\"push message\", (messages) => this.handlePushNotification(messages));\n this.eufy.on(\"connect\", () => this.onConnect());\n this.eufy.on(\"close\", () => this.onClose());\n this.eufy.on(\"livestream start\", (station, device, url) => this.onStartLivestream(station, device, url));\n this.eufy.on(\"livestream stop\", (station, device) => this.onStopLivestream(station, device));\n this.eufy.on(\"push connect\", () => this.onPushConnect());\n this.eufy.on(\"push close\", () => this.onPushClose());\n const api = this.eufy.getApi();\n if (this.persistentData.api_base && this.persistentData.api_base != \"\") {\n this.logger.debug(`Load previous api_base: ${this.persistentData.api_base}`);\n api.setAPIBase(this.persistentData.api_base);\n }\n if (this.persistentData.login_hash && this.persistentData.login_hash != \"\") {\n this.logger.debug(`Load previous login_hash: ${this.persistentData.login_hash}`);\n if (utils_1.md5(`${this.config.username}:${this.config.password}`) != this.persistentData.login_hash) {\n this.logger.info(`Authentication properties changed, invalidate saved cloud token.`);\n this.persistentData.cloud_token = \"\";\n this.persistentData.cloud_token_expiration = 0;\n this.persistentData.api_base = \"\";\n }\n }\n else {\n this.persistentData.cloud_token = \"\";\n this.persistentData.cloud_token_expiration = 0;\n }\n if (this.persistentData.cloud_token && this.persistentData.cloud_token != \"\") {\n this.logger.debug(`Load previous token: ${this.persistentData.cloud_token} token_expiration: ${this.persistentData.cloud_token_expiration}`);\n api.setToken(this.persistentData.cloud_token);\n api.setTokenExpiration(new Date(this.persistentData.cloud_token_expiration));\n }\n if (!this.persistentData.openudid || this.persistentData.openudid == \"\") {\n this.persistentData.openudid = utils_1.generateUDID();\n this.logger.debug(`Generated new openudid: ${this.persistentData.openudid}`);\n }\n api.setOpenUDID(this.persistentData.openudid);\n if (!this.persistentData.serial_number || this.persistentData.serial_number == \"\") {\n this.persistentData.serial_number = utils_1.generateSerialnumber(12);\n this.logger.debug(`Generated new serial_number: ${this.persistentData.serial_number}`);\n }\n api.setSerialNumber(this.persistentData.serial_number);\n yield this.eufy.logon();\n });\n }", "function AppMeasurement(r){var a=this;a.version=\"2.8.2\";var k=window;k.s_c_in||(k.s_c_il=[],k.s_c_in=0);a._il=k.s_c_il;a._in=k.s_c_in;a._il[a._in]=a;k.s_c_in++;a._c=\"s_c\";var p=k.AppMeasurement.Xb;p||(p=null);var n=k,m,s;try{for(m=n.parent,s=n.location;m&&m.location&&s&&\"\"+m.location!=\"\"+s&&n.location&&\"\"+m.location!=\"\"+n.location&&m.location.host==s.host;)n=m,m=n.parent}catch(u){}a.F=function(a){try{console.log(a)}catch(b){}};a.Oa=function(a){return\"\"+parseInt(a)==\"\"+a};a.replace=function(a,b,d){return!a||\r\n0>a.indexOf(b)?a:a.split(b).join(d)};a.escape=function(c){var b,d;if(!c)return c;c=encodeURIComponent(c);for(b=0;7>b;b++)d=\"+~!*()'\".substring(b,b+1),0<=c.indexOf(d)&&(c=a.replace(c,d,\"%\"+d.charCodeAt(0).toString(16).toUpperCase()));return c};a.unescape=function(c){if(!c)return c;c=0<=c.indexOf(\"+\")?a.replace(c,\"+\",\" \"):c;try{return decodeURIComponent(c)}catch(b){}return unescape(c)};a.Fb=function(){var c=k.location.hostname,b=a.fpCookieDomainPeriods,d;b||(b=a.cookieDomainPeriods);if(c&&!a.Ga&&!/^[0-9.]+$/.test(c)&&\r\n(b=b?parseInt(b):2,b=2<b?b:2,d=c.lastIndexOf(\".\"),0<=d)){for(;0<=d&&1<b;)d=c.lastIndexOf(\".\",d-1),b--;a.Ga=0<d?c.substring(d):c}return a.Ga};a.c_r=a.cookieRead=function(c){c=a.escape(c);var b=\" \"+a.d.cookie,d=b.indexOf(\" \"+c+\"=\"),f=0>d?d:b.indexOf(\";\",d);c=0>d?\"\":a.unescape(b.substring(d+2+c.length,0>f?b.length:f));return\"[[B]]\"!=c?c:\"\"};a.c_w=a.cookieWrite=function(c,b,d){var f=a.Fb(),e=a.cookieLifetime,g;b=\"\"+b;e=e?(\"\"+e).toUpperCase():\"\";d&&\"SESSION\"!=e&&\"NONE\"!=e&&((g=\"\"!=b?parseInt(e?e:0):-60)?\r\n(d=new Date,d.setTime(d.getTime()+1E3*g)):1==d&&(d=new Date,g=d.getYear(),d.setYear(g+5+(1900>g?1900:0))));return c&&\"NONE\"!=e?(a.d.cookie=a.escape(c)+\"=\"+a.escape(\"\"!=b?b:\"[[B]]\")+\"; path=/;\"+(d&&\"SESSION\"!=e?\" expires=\"+d.toUTCString()+\";\":\"\")+(f?\" domain=\"+f+\";\":\"\"),a.cookieRead(c)==b):0};a.Cb=function(){var c=a.Util.getIeVersion();\"number\"===typeof c&&10>c&&(a.unsupportedBrowser=!0,a.rb(a,function(){}))};a.rb=function(a,b){for(var d in a)a.hasOwnProperty(d)&&\"function\"===typeof a[d]&&(a[d]=b)};\r\na.L=[];a.ja=function(c,b,d){if(a.Ha)return 0;a.maxDelay||(a.maxDelay=250);var f=0,e=(new Date).getTime()+a.maxDelay,g=a.d.visibilityState,h=[\"webkitvisibilitychange\",\"visibilitychange\"];g||(g=a.d.webkitVisibilityState);if(g&&\"prerender\"==g){if(!a.ka)for(a.ka=1,d=0;d<h.length;d++)a.d.addEventListener(h[d],function(){var c=a.d.visibilityState;c||(c=a.d.webkitVisibilityState);\"visible\"==c&&(a.ka=0,a.delayReady())});f=1;e=0}else d||a.p(\"_d\")&&(f=1);f&&(a.L.push({m:c,a:b,t:e}),a.ka||setTimeout(a.delayReady,\r\na.maxDelay));return f};a.delayReady=function(){var c=(new Date).getTime(),b=0,d;for(a.p(\"_d\")?b=1:a.za();0<a.L.length;){d=a.L.shift();if(b&&!d.t&&d.t>c){a.L.unshift(d);setTimeout(a.delayReady,parseInt(a.maxDelay/2));break}a.Ha=1;a[d.m].apply(a,d.a);a.Ha=0}};a.setAccount=a.sa=function(c){var b,d;if(!a.ja(\"setAccount\",arguments))if(a.account=c,a.allAccounts)for(b=a.allAccounts.concat(c.split(\",\")),a.allAccounts=[],b.sort(),d=0;d<b.length;d++)0!=d&&b[d-1]==b[d]||a.allAccounts.push(b[d]);else a.allAccounts=\r\nc.split(\",\")};a.foreachVar=function(c,b){var d,f,e,g,h=\"\";e=f=\"\";if(a.lightProfileID)d=a.P,(h=a.lightTrackVars)&&(h=\",\"+h+\",\"+a.oa.join(\",\")+\",\");else{d=a.g;if(a.pe||a.linkType)h=a.linkTrackVars,f=a.linkTrackEvents,a.pe&&(e=a.pe.substring(0,1).toUpperCase()+a.pe.substring(1),a[e]&&(h=a[e].Vb,f=a[e].Ub));h&&(h=\",\"+h+\",\"+a.H.join(\",\")+\",\");f&&h&&(h+=\",events,\")}b&&(b=\",\"+b+\",\");for(f=0;f<d.length;f++)e=d[f],(g=a[e])&&(!h||0<=h.indexOf(\",\"+e+\",\"))&&(!b||0<=b.indexOf(\",\"+e+\",\"))&&c(e,g)};a.r=function(c,\r\nb,d,f,e){var g=\"\",h,l,k,q,m=0;\"contextData\"==c&&(c=\"c\");if(b){for(h in b)if(!(Object.prototype[h]||e&&h.substring(0,e.length)!=e)&&b[h]&&(!d||0<=d.indexOf(\",\"+(f?f+\".\":\"\")+h+\",\"))){k=!1;if(m)for(l=0;l<m.length;l++)h.substring(0,m[l].length)==m[l]&&(k=!0);if(!k&&(\"\"==g&&(g+=\"&\"+c+\".\"),l=b[h],e&&(h=h.substring(e.length)),0<h.length))if(k=h.indexOf(\".\"),0<k)l=h.substring(0,k),k=(e?e:\"\")+l+\".\",m||(m=[]),m.push(k),g+=a.r(l,b,d,f,k);else if(\"boolean\"==typeof l&&(l=l?\"true\":\"false\"),l){if(\"retrieveLightData\"==\r\nf&&0>e.indexOf(\".contextData.\"))switch(k=h.substring(0,4),q=h.substring(4),h){case \"transactionID\":h=\"xact\";break;case \"channel\":h=\"ch\";break;case \"campaign\":h=\"v0\";break;default:a.Oa(q)&&(\"prop\"==k?h=\"c\"+q:\"eVar\"==k?h=\"v\"+q:\"list\"==k?h=\"l\"+q:\"hier\"==k&&(h=\"h\"+q,l=l.substring(0,255)))}g+=\"&\"+a.escape(h)+\"=\"+a.escape(l)}}\"\"!=g&&(g+=\"&.\"+c)}return g};a.usePostbacks=0;a.Ib=function(){var c=\"\",b,d,f,e,g,h,l,k,q=\"\",m=\"\",n=e=\"\";if(a.lightProfileID)b=a.P,(q=a.lightTrackVars)&&(q=\",\"+q+\",\"+a.oa.join(\",\")+\r\n\",\");else{b=a.g;if(a.pe||a.linkType)q=a.linkTrackVars,m=a.linkTrackEvents,a.pe&&(e=a.pe.substring(0,1).toUpperCase()+a.pe.substring(1),a[e]&&(q=a[e].Vb,m=a[e].Ub));q&&(q=\",\"+q+\",\"+a.H.join(\",\")+\",\");m&&(m=\",\"+m+\",\",q&&(q+=\",events,\"));a.events2&&(n+=(\"\"!=n?\",\":\"\")+a.events2)}if(a.visitor&&a.visitor.getCustomerIDs){e=p;if(g=a.visitor.getCustomerIDs())for(d in g)Object.prototype[d]||(f=g[d],\"object\"==typeof f&&(e||(e={}),f.id&&(e[d+\".id\"]=f.id),f.authState&&(e[d+\".as\"]=f.authState)));e&&(c+=a.r(\"cid\",\r\ne))}a.AudienceManagement&&a.AudienceManagement.isReady()&&(c+=a.r(\"d\",a.AudienceManagement.getEventCallConfigParams()));for(d=0;d<b.length;d++){e=b[d];g=a[e];f=e.substring(0,4);h=e.substring(4);g||(\"events\"==e&&n?(g=n,n=\"\"):\"marketingCloudOrgID\"==e&&a.visitor&&(g=a.visitor.marketingCloudOrgID));if(g&&(!q||0<=q.indexOf(\",\"+e+\",\"))){switch(e){case \"customerPerspective\":e=\"cp\";break;case \"marketingCloudOrgID\":e=\"mcorgid\";break;case \"supplementalDataID\":e=\"sdid\";break;case \"timestamp\":e=\"ts\";break;case \"dynamicVariablePrefix\":e=\r\n\"D\";break;case \"visitorID\":e=\"vid\";break;case \"marketingCloudVisitorID\":e=\"mid\";break;case \"analyticsVisitorID\":e=\"aid\";break;case \"audienceManagerLocationHint\":e=\"aamlh\";break;case \"audienceManagerBlob\":e=\"aamb\";break;case \"authState\":e=\"as\";break;case \"pageURL\":e=\"g\";255<g.length&&(a.pageURLRest=g.substring(255),g=g.substring(0,255));break;case \"pageURLRest\":e=\"-g\";break;case \"referrer\":e=\"r\";break;case \"vmk\":case \"visitorMigrationKey\":e=\"vmt\";break;case \"visitorMigrationServer\":e=\"vmf\";a.ssl&&\r\na.visitorMigrationServerSecure&&(g=\"\");break;case \"visitorMigrationServerSecure\":e=\"vmf\";!a.ssl&&a.visitorMigrationServer&&(g=\"\");break;case \"charSet\":e=\"ce\";break;case \"visitorNamespace\":e=\"ns\";break;case \"cookieDomainPeriods\":e=\"cdp\";break;case \"cookieLifetime\":e=\"cl\";break;case \"variableProvider\":e=\"vvp\";break;case \"currencyCode\":e=\"cc\";break;case \"channel\":e=\"ch\";break;case \"transactionID\":e=\"xact\";break;case \"campaign\":e=\"v0\";break;case \"latitude\":e=\"lat\";break;case \"longitude\":e=\"lon\";break;\r\ncase \"resolution\":e=\"s\";break;case \"colorDepth\":e=\"c\";break;case \"javascriptVersion\":e=\"j\";break;case \"javaEnabled\":e=\"v\";break;case \"cookiesEnabled\":e=\"k\";break;case \"browserWidth\":e=\"bw\";break;case \"browserHeight\":e=\"bh\";break;case \"connectionType\":e=\"ct\";break;case \"homepage\":e=\"hp\";break;case \"events\":n&&(g+=(\"\"!=g?\",\":\"\")+n);if(m)for(h=g.split(\",\"),g=\"\",f=0;f<h.length;f++)l=h[f],k=l.indexOf(\"=\"),0<=k&&(l=l.substring(0,k)),k=l.indexOf(\":\"),0<=k&&(l=l.substring(0,k)),0<=m.indexOf(\",\"+l+\",\")&&(g+=\r\n(g?\",\":\"\")+h[f]);break;case \"events2\":g=\"\";break;case \"contextData\":c+=a.r(\"c\",a[e],q,e);g=\"\";break;case \"lightProfileID\":e=\"mtp\";break;case \"lightStoreForSeconds\":e=\"mtss\";a.lightProfileID||(g=\"\");break;case \"lightIncrementBy\":e=\"mti\";a.lightProfileID||(g=\"\");break;case \"retrieveLightProfiles\":e=\"mtsr\";break;case \"deleteLightProfiles\":e=\"mtsd\";break;case \"retrieveLightData\":a.retrieveLightProfiles&&(c+=a.r(\"mts\",a[e],q,e));g=\"\";break;default:a.Oa(h)&&(\"prop\"==f?e=\"c\"+h:\"eVar\"==f?e=\"v\"+h:\"list\"==\r\nf?e=\"l\"+h:\"hier\"==f&&(e=\"h\"+h,g=g.substring(0,255)))}g&&(c+=\"&\"+e+\"=\"+(\"pev\"!=e.substring(0,3)?a.escape(g):g))}\"pev3\"==e&&a.e&&(c+=a.e)}a.na&&(c+=\"&lrt=\"+a.na,a.na=null);return c};a.D=function(a){var b=a.tagName;if(\"undefined\"!=\"\"+a.$b||\"undefined\"!=\"\"+a.Qb&&\"HTML\"!=(\"\"+a.Qb).toUpperCase())return\"\";b=b&&b.toUpperCase?b.toUpperCase():\"\";\"SHAPE\"==b&&(b=\"\");b&&((\"INPUT\"==b||\"BUTTON\"==b)&&a.type&&a.type.toUpperCase?b=a.type.toUpperCase():!b&&a.href&&(b=\"A\"));return b};a.Ka=function(a){var b=k.location,\r\nd=a.href?a.href:\"\",f,e,g;f=d.indexOf(\":\");e=d.indexOf(\"?\");g=d.indexOf(\"/\");d&&(0>f||0<=e&&f>e||0<=g&&f>g)&&(e=a.protocol&&1<a.protocol.length?a.protocol:b.protocol?b.protocol:\"\",f=b.pathname.lastIndexOf(\"/\"),d=(e?e+\"//\":\"\")+(a.host?a.host:b.host?b.host:\"\")+(\"/\"!=d.substring(0,1)?b.pathname.substring(0,0>f?0:f)+\"/\":\"\")+d);return d};a.M=function(c){var b=a.D(c),d,f,e=\"\",g=0;return b&&(d=c.protocol,f=c.onclick,!c.href||\"A\"!=b&&\"AREA\"!=b||f&&d&&!(0>d.toLowerCase().indexOf(\"javascript\"))?f?(e=a.replace(a.replace(a.replace(a.replace(\"\"+\r\nf,\"\\r\",\"\"),\"\\n\",\"\"),\"\\t\",\"\"),\" \",\"\"),g=2):\"INPUT\"==b||\"SUBMIT\"==b?(c.value?e=c.value:c.innerText?e=c.innerText:c.textContent&&(e=c.textContent),g=3):\"IMAGE\"==b&&c.src&&(e=c.src):e=a.Ka(c),e)?{id:e.substring(0,100),type:g}:0};a.Yb=function(c){for(var b=a.D(c),d=a.M(c);c&&!d&&\"BODY\"!=b;)if(c=c.parentElement?c.parentElement:c.parentNode)b=a.D(c),d=a.M(c);d&&\"BODY\"!=b||(c=0);c&&(b=c.onclick?\"\"+c.onclick:\"\",0<=b.indexOf(\".tl(\")||0<=b.indexOf(\".trackLink(\"))&&(c=0);return c};a.Pb=function(){var c,b,d=a.linkObject,\r\nf=a.linkType,e=a.linkURL,g,h;a.pa=1;d||(a.pa=0,d=a.clickObject);if(d){c=a.D(d);for(b=a.M(d);d&&!b&&\"BODY\"!=c;)if(d=d.parentElement?d.parentElement:d.parentNode)c=a.D(d),b=a.M(d);b&&\"BODY\"!=c||(d=0);if(d&&!a.linkObject){var l=d.onclick?\"\"+d.onclick:\"\";if(0<=l.indexOf(\".tl(\")||0<=l.indexOf(\".trackLink(\"))d=0}}else a.pa=1;!e&&d&&(e=a.Ka(d));e&&!a.linkLeaveQueryString&&(g=e.indexOf(\"?\"),0<=g&&(e=e.substring(0,g)));if(!f&&e){var m=0,q=0,n;if(a.trackDownloadLinks&&a.linkDownloadFileTypes)for(l=e.toLowerCase(),\r\ng=l.indexOf(\"?\"),h=l.indexOf(\"#\"),0<=g?0<=h&&h<g&&(g=h):g=h,0<=g&&(l=l.substring(0,g)),g=a.linkDownloadFileTypes.toLowerCase().split(\",\"),h=0;h<g.length;h++)(n=g[h])&&l.substring(l.length-(n.length+1))==\".\"+n&&(f=\"d\");if(a.trackExternalLinks&&!f&&(l=e.toLowerCase(),a.Na(l)&&(a.linkInternalFilters||(a.linkInternalFilters=k.location.hostname),g=0,a.linkExternalFilters?(g=a.linkExternalFilters.toLowerCase().split(\",\"),m=1):a.linkInternalFilters&&(g=a.linkInternalFilters.toLowerCase().split(\",\")),g))){for(h=\r\n0;h<g.length;h++)n=g[h],0<=l.indexOf(n)&&(q=1);q?m&&(f=\"e\"):m||(f=\"e\")}}a.linkObject=d;a.linkURL=e;a.linkType=f;if(a.trackClickMap||a.trackInlineStats)a.e=\"\",d&&(f=a.pageName,e=1,d=d.sourceIndex,f||(f=a.pageURL,e=0),k.s_objectID&&(b.id=k.s_objectID,d=b.type=1),f&&b&&b.id&&c&&(a.e=\"&pid=\"+a.escape(f.substring(0,255))+(e?\"&pidt=\"+e:\"\")+\"&oid=\"+a.escape(b.id.substring(0,100))+(b.type?\"&oidt=\"+b.type:\"\")+\"&ot=\"+c+(d?\"&oi=\"+d:\"\")))};a.Jb=function(){var c=a.pa,b=a.linkType,d=a.linkURL,f=a.linkName;b&&(d||\r\nf)&&(b=b.toLowerCase(),\"d\"!=b&&\"e\"!=b&&(b=\"o\"),a.pe=\"lnk_\"+b,a.pev1=d?a.escape(d):\"\",a.pev2=f?a.escape(f):\"\",c=1);a.abort&&(c=0);if(a.trackClickMap||a.trackInlineStats||a.ActivityMap){var b={},d=0,e=a.cookieRead(\"s_sq\"),g=e?e.split(\"&\"):0,h,l,k,e=0;if(g)for(h=0;h<g.length;h++)l=g[h].split(\"=\"),f=a.unescape(l[0]).split(\",\"),l=a.unescape(l[1]),b[l]=f;f=a.account.split(\",\");h={};for(k in a.contextData)k&&!Object.prototype[k]&&\"a.activitymap.\"==k.substring(0,14)&&(h[k]=a.contextData[k],a.contextData[k]=\r\n\"\");a.e=a.r(\"c\",h)+(a.e?a.e:\"\");if(c||a.e){c&&!a.e&&(e=1);for(l in b)if(!Object.prototype[l])for(k=0;k<f.length;k++)for(e&&(g=b[l].join(\",\"),g==a.account&&(a.e+=(\"&\"!=l.charAt(0)?\"&\":\"\")+l,b[l]=[],d=1)),h=0;h<b[l].length;h++)g=b[l][h],g==f[k]&&(e&&(a.e+=\"&u=\"+a.escape(g)+(\"&\"!=l.charAt(0)?\"&\":\"\")+l+\"&u=0\"),b[l].splice(h,1),d=1);c||(d=1);if(d){e=\"\";h=2;!c&&a.e&&(e=a.escape(f.join(\",\"))+\"=\"+a.escape(a.e),h=1);for(l in b)!Object.prototype[l]&&0<h&&0<b[l].length&&(e+=(e?\"&\":\"\")+a.escape(b[l].join(\",\"))+\r\n\"=\"+a.escape(l),h--);a.cookieWrite(\"s_sq\",e)}}}return c};a.Kb=function(){if(!a.Tb){var c=new Date,b=n.location,d,f,e=f=d=\"\",g=\"\",h=\"\",l=\"1.2\",k=a.cookieWrite(\"s_cc\",\"true\",0)?\"Y\":\"N\",m=\"\",p=\"\";if(c.setUTCDate&&(l=\"1.3\",(0).toPrecision&&(l=\"1.5\",c=[],c.forEach))){l=\"1.6\";f=0;d={};try{f=new Iterator(d),f.next&&(l=\"1.7\",c.reduce&&(l=\"1.8\",l.trim&&(l=\"1.8.1\",Date.parse&&(l=\"1.8.2\",Object.create&&(l=\"1.8.5\")))))}catch(r){}}d=screen.width+\"x\"+screen.height;e=navigator.javaEnabled()?\"Y\":\"N\";f=screen.pixelDepth?\r\nscreen.pixelDepth:screen.colorDepth;g=a.w.innerWidth?a.w.innerWidth:a.d.documentElement.offsetWidth;h=a.w.innerHeight?a.w.innerHeight:a.d.documentElement.offsetHeight;try{a.b.addBehavior(\"#default#homePage\"),m=a.b.Zb(b)?\"Y\":\"N\"}catch(s){}try{a.b.addBehavior(\"#default#clientCaps\"),p=a.b.connectionType}catch(t){}a.resolution=d;a.colorDepth=f;a.javascriptVersion=l;a.javaEnabled=e;a.cookiesEnabled=k;a.browserWidth=g;a.browserHeight=h;a.connectionType=p;a.homepage=m;a.Tb=1}};a.Q={};a.loadModule=function(c,\r\nb){var d=a.Q[c];if(!d){d=k[\"AppMeasurement_Module_\"+c]?new k[\"AppMeasurement_Module_\"+c](a):{};a.Q[c]=a[c]=d;d.kb=function(){return d.qb};d.sb=function(b){if(d.qb=b)a[c+\"_onLoad\"]=b,a.ja(c+\"_onLoad\",[a,d],1)||b(a,d)};try{Object.defineProperty?Object.defineProperty(d,\"onLoad\",{get:d.kb,set:d.sb}):d._olc=1}catch(f){d._olc=1}}b&&(a[c+\"_onLoad\"]=b,a.ja(c+\"_onLoad\",[a,d],1)||b(a,d))};a.p=function(c){var b,d;for(b in a.Q)if(!Object.prototype[b]&&(d=a.Q[b])&&(d._olc&&d.onLoad&&(d._olc=0,d.onLoad(a,d)),d[c]&&\r\nd[c]()))return 1;return 0};a.Mb=function(){var c=Math.floor(1E13*Math.random()),b=a.visitorSampling,d=a.visitorSamplingGroup,d=\"s_vsn_\"+(a.visitorNamespace?a.visitorNamespace:a.account)+(d?\"_\"+d:\"\"),f=a.cookieRead(d);if(b){b*=100;f&&(f=parseInt(f));if(!f){if(!a.cookieWrite(d,c))return 0;f=c}if(f%1E4>b)return 0}return 1};a.R=function(c,b){var d,f,e,g,h,l;for(d=0;2>d;d++)for(f=0<d?a.Ca:a.g,e=0;e<f.length;e++)if(g=f[e],(h=c[g])||c[\"!\"+g]){if(!b&&(\"contextData\"==g||\"retrieveLightData\"==g)&&a[g])for(l in a[g])h[l]||\r\n(h[l]=a[g][l]);a[g]=h}};a.Ya=function(c,b){var d,f,e,g;for(d=0;2>d;d++)for(f=0<d?a.Ca:a.g,e=0;e<f.length;e++)g=f[e],c[g]=a[g],b||c[g]||(c[\"!\"+g]=1)};a.Eb=function(a){var b,d,f,e,g,h=0,l,k=\"\",m=\"\";if(a&&255<a.length&&(b=\"\"+a,d=b.indexOf(\"?\"),0<d&&(l=b.substring(d+1),b=b.substring(0,d),e=b.toLowerCase(),f=0,\"http://\"==e.substring(0,7)?f+=7:\"https://\"==e.substring(0,8)&&(f+=8),d=e.indexOf(\"/\",f),0<d&&(e=e.substring(f,d),g=b.substring(d),b=b.substring(0,d),0<=e.indexOf(\"google\")?h=\",q,ie,start,search_key,word,kw,cd,\":\r\n0<=e.indexOf(\"yahoo.co\")&&(h=\",p,ei,\"),h&&l)))){if((a=l.split(\"&\"))&&1<a.length){for(f=0;f<a.length;f++)e=a[f],d=e.indexOf(\"=\"),0<d&&0<=h.indexOf(\",\"+e.substring(0,d)+\",\")?k+=(k?\"&\":\"\")+e:m+=(m?\"&\":\"\")+e;k&&m?l=k+\"&\"+m:m=\"\"}d=253-(l.length-m.length)-b.length;a=b+(0<d?g.substring(0,d):\"\")+\"?\"+l}return a};a.eb=function(c){var b=a.d.visibilityState,d=[\"webkitvisibilitychange\",\"visibilitychange\"];b||(b=a.d.webkitVisibilityState);if(b&&\"prerender\"==b){if(c)for(b=0;b<d.length;b++)a.d.addEventListener(d[b],\r\nfunction(){var b=a.d.visibilityState;b||(b=a.d.webkitVisibilityState);\"visible\"==b&&c()});return!1}return!0};a.fa=!1;a.J=!1;a.ub=function(){a.J=!0;a.j()};a.da=!1;a.V=!1;a.pb=function(c){a.marketingCloudVisitorID=c;a.V=!0;a.j()};a.ga=!1;a.W=!1;a.vb=function(c){a.visitorOptedOut=c;a.W=!0;a.j()};a.aa=!1;a.S=!1;a.$a=function(c){a.analyticsVisitorID=c;a.S=!0;a.j()};a.ca=!1;a.U=!1;a.bb=function(c){a.audienceManagerLocationHint=c;a.U=!0;a.j()};a.ba=!1;a.T=!1;a.ab=function(c){a.audienceManagerBlob=c;a.T=\r\n!0;a.j()};a.cb=function(c){a.maxDelay||(a.maxDelay=250);return a.p(\"_d\")?(c&&setTimeout(function(){c()},a.maxDelay),!1):!0};a.ea=!1;a.I=!1;a.za=function(){a.I=!0;a.j()};a.isReadyToTrack=function(){var c=!0,b=a.visitor,d,f,e;a.fa||a.J||(a.eb(a.ub)?a.J=!0:a.fa=!0);if(a.fa&&!a.J)return!1;b&&b.isAllowed()&&(a.da||a.marketingCloudVisitorID||!b.getMarketingCloudVisitorID||(a.da=!0,a.marketingCloudVisitorID=b.getMarketingCloudVisitorID([a,a.pb]),a.marketingCloudVisitorID&&(a.V=!0)),a.ga||a.visitorOptedOut||\r\n!b.isOptedOut||(a.ga=!0,a.visitorOptedOut=b.isOptedOut([a,a.vb]),a.visitorOptedOut!=p&&(a.W=!0)),a.aa||a.analyticsVisitorID||!b.getAnalyticsVisitorID||(a.aa=!0,a.analyticsVisitorID=b.getAnalyticsVisitorID([a,a.$a]),a.analyticsVisitorID&&(a.S=!0)),a.ca||a.audienceManagerLocationHint||!b.getAudienceManagerLocationHint||(a.ca=!0,a.audienceManagerLocationHint=b.getAudienceManagerLocationHint([a,a.bb]),a.audienceManagerLocationHint&&(a.U=!0)),a.ba||a.audienceManagerBlob||!b.getAudienceManagerBlob||(a.ba=\r\n!0,a.audienceManagerBlob=b.getAudienceManagerBlob([a,a.ab]),a.audienceManagerBlob&&(a.T=!0)),c=a.da&&!a.V&&!a.marketingCloudVisitorID,b=a.aa&&!a.S&&!a.analyticsVisitorID,d=a.ca&&!a.U&&!a.audienceManagerLocationHint,f=a.ba&&!a.T&&!a.audienceManagerBlob,e=a.ga&&!a.W,c=c||b||d||f||e?!1:!0);a.ea||a.I||(a.cb(a.za)?a.I=!0:a.ea=!0);a.ea&&!a.I&&(c=!1);return c};a.o=p;a.u=0;a.callbackWhenReadyToTrack=function(c,b,d){var f;f={};f.zb=c;f.yb=b;f.wb=d;a.o==p&&(a.o=[]);a.o.push(f);0==a.u&&(a.u=setInterval(a.j,\r\n100))};a.j=function(){var c;if(a.isReadyToTrack()&&(a.tb(),a.o!=p))for(;0<a.o.length;)c=a.o.shift(),c.yb.apply(c.zb,c.wb)};a.tb=function(){a.u&&(clearInterval(a.u),a.u=0)};a.mb=function(c){var b,d,f=p,e=p;if(!a.isReadyToTrack()){b=[];if(c!=p)for(d in f={},c)f[d]=c[d];e={};a.Ya(e,!0);b.push(f);b.push(e);a.callbackWhenReadyToTrack(a,a.track,b);return!0}return!1};a.Gb=function(){var c=a.cookieRead(\"s_fid\"),b=\"\",d=\"\",f;f=8;var e=4;if(!c||0>c.indexOf(\"-\")){for(c=0;16>c;c++)f=Math.floor(Math.random()*f),\r\nb+=\"0123456789ABCDEF\".substring(f,f+1),f=Math.floor(Math.random()*e),d+=\"0123456789ABCDEF\".substring(f,f+1),f=e=16;c=b+\"-\"+d}a.cookieWrite(\"s_fid\",c,1)||(c=0);return c};a.t=a.track=function(c,b){var d,f=new Date,e=\"s\"+Math.floor(f.getTime()/108E5)%10+Math.floor(1E13*Math.random()),g=f.getYear(),g=\"t=\"+a.escape(f.getDate()+\"/\"+f.getMonth()+\"/\"+(1900>g?g+1900:g)+\" \"+f.getHours()+\":\"+f.getMinutes()+\":\"+f.getSeconds()+\" \"+f.getDay()+\" \"+f.getTimezoneOffset());a.visitor&&a.visitor.getAuthState&&(a.authState=\r\na.visitor.getAuthState());a.p(\"_s\");a.mb(c)||(b&&a.R(b),c&&(d={},a.Ya(d,0),a.R(c)),a.Mb()&&!a.visitorOptedOut&&(a.analyticsVisitorID||a.marketingCloudVisitorID||(a.fid=a.Gb()),a.Pb(),a.usePlugins&&a.doPlugins&&a.doPlugins(a),a.account&&(a.abort||(a.trackOffline&&!a.timestamp&&(a.timestamp=Math.floor(f.getTime()/1E3)),f=k.location,a.pageURL||(a.pageURL=f.href?f.href:f),a.referrer||a.Za||(f=a.Util.getQueryParam(\"adobe_mc_ref\",null,null,!0),a.referrer=f||void 0===f?void 0===f?\"\":f:n.document.referrer),\r\na.Za=1,a.referrer=a.Eb(a.referrer),a.p(\"_g\")),a.Jb()&&!a.abort&&(a.visitor&&!a.supplementalDataID&&a.visitor.getSupplementalDataID&&(a.supplementalDataID=a.visitor.getSupplementalDataID(\"AppMeasurement:\"+a._in,a.expectSupplementalData?!1:!0)),a.Kb(),g+=a.Ib(),a.ob(e,g),a.p(\"_t\"),a.referrer=\"\"))),c&&a.R(d,1));a.abort=a.supplementalDataID=a.timestamp=a.pageURLRest=a.linkObject=a.clickObject=a.linkURL=a.linkName=a.linkType=k.s_objectID=a.pe=a.pev1=a.pev2=a.pev3=a.e=a.lightProfileID=0};a.Ba=[];a.registerPreTrackCallback=\r\nfunction(c){for(var b=[],d=1;d<arguments.length;d++)b.push(arguments[d]);\"function\"==typeof c?a.Ba.push([c,b]):a.debugTracking&&a.F(\"DEBUG: Non function type passed to registerPreTrackCallback\")};a.hb=function(c){a.xa(a.Ba,c)};a.Aa=[];a.registerPostTrackCallback=function(c){for(var b=[],d=1;d<arguments.length;d++)b.push(arguments[d]);\"function\"==typeof c?a.Aa.push([c,b]):a.debugTracking&&a.F(\"DEBUG: Non function type passed to registerPostTrackCallback\")};a.gb=function(c){a.xa(a.Aa,c)};a.xa=function(c,\r\nb){if(\"object\"==typeof c)for(var d=0;d<c.length;d++){var f=c[d][0],e=c[d][1];e.unshift(b);if(\"function\"==typeof f)try{f.apply(null,e)}catch(g){a.debugTracking&&a.F(g.message)}}};a.tl=a.trackLink=function(c,b,d,f,e){a.linkObject=c;a.linkType=b;a.linkName=d;e&&(a.l=c,a.A=e);return a.track(f)};a.trackLight=function(c,b,d,f){a.lightProfileID=c;a.lightStoreForSeconds=b;a.lightIncrementBy=d;return a.track(f)};a.clearVars=function(){var c,b;for(c=0;c<a.g.length;c++)if(b=a.g[c],\"prop\"==b.substring(0,4)||\r\n\"eVar\"==b.substring(0,4)||\"hier\"==b.substring(0,4)||\"list\"==b.substring(0,4)||\"channel\"==b||\"events\"==b||\"eventList\"==b||\"products\"==b||\"productList\"==b||\"purchaseID\"==b||\"transactionID\"==b||\"state\"==b||\"zip\"==b||\"campaign\"==b)a[b]=void 0};a.tagContainerMarker=\"\";a.ob=function(c,b){var d=a.ib()+\"/\"+c+\"?AQB=1&ndh=1&pf=1&\"+(a.ya()?\"callback=s_c_il[\"+a._in+\"].doPostbacks&et=1&\":\"\")+b+\"&AQE=1\";a.hb(d);a.fb(d);a.X()};a.ib=function(){var c=a.jb();return\"http\"+(a.ssl?\"s\":\"\")+\"://\"+c+\"/b/ss/\"+a.account+\"/\"+\r\n(a.mobile?\"5.\":\"\")+(a.ya()?\"10\":\"1\")+\"/JS-\"+a.version+(a.Sb?\"T\":\"\")+(a.tagContainerMarker?\"-\"+a.tagContainerMarker:\"\")};a.ya=function(){return a.AudienceManagement&&a.AudienceManagement.isReady()||0!=a.usePostbacks};a.jb=function(){var c=a.dc,b=a.trackingServer;b?a.trackingServerSecure&&a.ssl&&(b=a.trackingServerSecure):(c=c?(\"\"+c).toLowerCase():\"d1\",\"d1\"==c?c=\"112\":\"d2\"==c&&(c=\"122\"),b=a.lb()+\".\"+c+\".2o7.net\");return b};a.lb=function(){var c=a.visitorNamespace;c||(c=a.account.split(\",\")[0],c=c.replace(/[^0-9a-z]/gi,\r\n\"\"));return c};a.Xa=/{(%?)(.*?)(%?)}/;a.Wb=RegExp(a.Xa.source,\"g\");a.Db=function(c){if(\"object\"==typeof c.dests)for(var b=0;b<c.dests.length;++b){var d=c.dests[b];if(\"string\"==typeof d.c&&\"aa.\"==d.id.substr(0,3))for(var f=d.c.match(a.Wb),e=0;e<f.length;++e){var g=f[e],h=g.match(a.Xa),k=\"\";\"%\"==h[1]&&\"timezone_offset\"==h[2]?k=(new Date).getTimezoneOffset():\"%\"==h[1]&&\"timestampz\"==h[2]&&(k=a.Hb());d.c=d.c.replace(g,a.escape(k))}}};a.Hb=function(){var c=new Date,b=new Date(6E4*Math.abs(c.getTimezoneOffset()));\r\nreturn a.k(4,c.getFullYear())+\"-\"+a.k(2,c.getMonth()+1)+\"-\"+a.k(2,c.getDate())+\"T\"+a.k(2,c.getHours())+\":\"+a.k(2,c.getMinutes())+\":\"+a.k(2,c.getSeconds())+(0<c.getTimezoneOffset()?\"-\":\"+\")+a.k(2,b.getUTCHours())+\":\"+a.k(2,b.getUTCMinutes())};a.k=function(a,b){return(Array(a+1).join(0)+b).slice(-a)};a.ua={};a.doPostbacks=function(c){if(\"object\"==typeof c)if(a.Db(c),\"object\"==typeof a.AudienceManagement&&\"function\"==typeof a.AudienceManagement.isReady&&a.AudienceManagement.isReady()&&\"function\"==typeof a.AudienceManagement.passData)a.AudienceManagement.passData(c);\r\nelse if(\"object\"==typeof c&&\"object\"==typeof c.dests)for(var b=0;b<c.dests.length;++b){var d=c.dests[b];\"object\"==typeof d&&\"string\"==typeof d.c&&\"string\"==typeof d.id&&\"aa.\"==d.id.substr(0,3)&&(a.ua[d.id]=new Image,a.ua[d.id].alt=\"\",a.ua[d.id].src=d.c)}};a.fb=function(c){a.i||a.Lb();a.i.push(c);a.ma=a.C();a.Va()};a.Lb=function(){a.i=a.Nb();a.i||(a.i=[])};a.Nb=function(){var c,b;if(a.ta()){try{(b=k.localStorage.getItem(a.qa()))&&(c=k.JSON.parse(b))}catch(d){}return c}};a.ta=function(){var c=!0;a.trackOffline&&\r\na.offlineFilename&&k.localStorage&&k.JSON||(c=!1);return c};a.La=function(){var c=0;a.i&&(c=a.i.length);a.q&&c++;return c};a.X=function(){if(a.q&&(a.B&&a.B.complete&&a.B.G&&a.B.wa(),a.q))return;a.Ma=p;if(a.ra)a.ma>a.O&&a.Ta(a.i),a.va(500);else{var c=a.xb();if(0<c)a.va(c);else if(c=a.Ia())a.q=1,a.Ob(c),a.Rb(c)}};a.va=function(c){a.Ma||(c||(c=0),a.Ma=setTimeout(a.X,c))};a.xb=function(){var c;if(!a.trackOffline||0>=a.offlineThrottleDelay)return 0;c=a.C()-a.Ra;return a.offlineThrottleDelay<c?0:a.offlineThrottleDelay-\r\nc};a.Ia=function(){if(0<a.i.length)return a.i.shift()};a.Ob=function(c){if(a.debugTracking){var b=\"AppMeasurement Debug: \"+c;c=c.split(\"&\");var d;for(d=0;d<c.length;d++)b+=\"\\n\\t\"+a.unescape(c[d]);a.F(b)}};a.nb=function(){return a.marketingCloudVisitorID||a.analyticsVisitorID};a.Z=!1;var t;try{t=JSON.parse('{\"x\":\"y\"}')}catch(w){t=null}t&&\"y\"==t.x?(a.Z=!0,a.Y=function(a){return JSON.parse(a)}):k.$&&k.$.parseJSON?(a.Y=function(a){return k.$.parseJSON(a)},a.Z=!0):a.Y=function(){return null};a.Rb=function(c){var b,\r\nd,f;a.nb()&&2047<c.length&&(\"undefined\"!=typeof XMLHttpRequest&&(b=new XMLHttpRequest,\"withCredentials\"in b?d=1:b=0),b||\"undefined\"==typeof XDomainRequest||(b=new XDomainRequest,d=2),b&&(a.AudienceManagement&&a.AudienceManagement.isReady()||0!=a.usePostbacks)&&(a.Z?b.Da=!0:b=0));!b&&a.Wa&&(c=c.substring(0,2047));!b&&a.d.createElement&&(0!=a.usePostbacks||a.AudienceManagement&&a.AudienceManagement.isReady())&&(b=a.d.createElement(\"SCRIPT\"))&&\"async\"in b&&((f=(f=a.d.getElementsByTagName(\"HEAD\"))&&f[0]?\r\nf[0]:a.d.body)?(b.type=\"text/javascript\",b.setAttribute(\"async\",\"async\"),d=3):b=0);b||(b=new Image,b.alt=\"\",b.abort||\"undefined\"===typeof k.InstallTrigger||(b.abort=function(){b.src=p}));b.Sa=Date.now();b.Fa=function(){try{b.G&&(clearTimeout(b.G),b.G=0)}catch(a){}};b.onload=b.wa=function(){b.Sa&&(a.na=Date.now()-b.Sa);a.gb(c);b.Fa();a.Bb();a.ha();a.q=0;a.X();if(b.Da){b.Da=!1;try{a.doPostbacks(a.Y(b.responseText))}catch(d){}}};b.onabort=b.onerror=b.Ja=function(){b.Fa();(a.trackOffline||a.ra)&&a.q&&\r\na.i.unshift(a.Ab);a.q=0;a.ma>a.O&&a.Ta(a.i);a.ha();a.va(500)};b.onreadystatechange=function(){4==b.readyState&&(200==b.status?b.wa():b.Ja())};a.Ra=a.C();if(1==d||2==d){var e=c.indexOf(\"?\");f=c.substring(0,e);e=c.substring(e+1);e=e.replace(/&callback=[a-zA-Z0-9_.\\[\\]]+/,\"\");1==d?(b.open(\"POST\",f,!0),b.send(e)):2==d&&(b.open(\"POST\",f),b.send(e))}else if(b.src=c,3==d){if(a.Pa)try{f.removeChild(a.Pa)}catch(g){}f.firstChild?f.insertBefore(b,f.firstChild):f.appendChild(b);a.Pa=a.B}b.G=setTimeout(function(){b.G&&\r\n(b.complete?b.wa():(a.trackOffline&&b.abort&&b.abort(),b.Ja()))},5E3);a.Ab=c;a.B=k[\"s_i_\"+a.replace(a.account,\",\",\"_\")]=b;if(a.useForcedLinkTracking&&a.K||a.A)a.forcedLinkTrackingTimeout||(a.forcedLinkTrackingTimeout=250),a.ia=setTimeout(a.ha,a.forcedLinkTrackingTimeout)};a.Bb=function(){if(a.ta()&&!(a.Qa>a.O))try{k.localStorage.removeItem(a.qa()),a.Qa=a.C()}catch(c){}};a.Ta=function(c){if(a.ta()){a.Va();try{k.localStorage.setItem(a.qa(),k.JSON.stringify(c)),a.O=a.C()}catch(b){}}};a.Va=function(){if(a.trackOffline){if(!a.offlineLimit||\r\n0>=a.offlineLimit)a.offlineLimit=10;for(;a.i.length>a.offlineLimit;)a.Ia()}};a.forceOffline=function(){a.ra=!0};a.forceOnline=function(){a.ra=!1};a.qa=function(){return a.offlineFilename+\"-\"+a.visitorNamespace+a.account};a.C=function(){return(new Date).getTime()};a.Na=function(a){a=a.toLowerCase();return 0!=a.indexOf(\"#\")&&0!=a.indexOf(\"about:\")&&0!=a.indexOf(\"opera:\")&&0!=a.indexOf(\"javascript:\")?!0:!1};a.setTagContainer=function(c){var b,d,f;a.Sb=c;for(b=0;b<a._il.length;b++)if((d=a._il[b])&&\"s_l\"==\r\nd._c&&d.tagContainerName==c){a.R(d);if(d.lmq)for(b=0;b<d.lmq.length;b++)f=d.lmq[b],a.loadModule(f.n);if(d.ml)for(f in d.ml)if(a[f])for(b in c=a[f],f=d.ml[f],f)!Object.prototype[b]&&(\"function\"!=typeof f[b]||0>(\"\"+f[b]).indexOf(\"s_c_il\"))&&(c[b]=f[b]);if(d.mmq)for(b=0;b<d.mmq.length;b++)f=d.mmq[b],a[f.m]&&(c=a[f.m],c[f.f]&&\"function\"==typeof c[f.f]&&(f.a?c[f.f].apply(c,f.a):c[f.f].apply(c)));if(d.tq)for(b=0;b<d.tq.length;b++)a.track(d.tq[b]);d.s=a;break}};a.Util={urlEncode:a.escape,urlDecode:a.unescape,\r\ncookieRead:a.cookieRead,cookieWrite:a.cookieWrite,getQueryParam:function(c,b,d,f){var e,g=\"\";b||(b=a.pageURL?a.pageURL:k.location);d=d?d:\"&\";if(!c||!b)return g;b=\"\"+b;e=b.indexOf(\"?\");if(0>e)return g;b=d+b.substring(e+1)+d;if(!f||!(0<=b.indexOf(d+c+d)||0<=b.indexOf(d+c+\"=\"+d))){e=b.indexOf(\"#\");0<=e&&(b=b.substr(0,e)+d);e=b.indexOf(d+c+\"=\");if(0>e)return g;b=b.substring(e+d.length+c.length+1);e=b.indexOf(d);0<=e&&(b=b.substring(0,e));0<b.length&&(g=a.unescape(b));return g}},getIeVersion:function(){if(document.documentMode)return document.documentMode;\r\nfor(var a=7;4<a;a--){var b=document.createElement(\"div\");b.innerHTML=\"\\x3c!--[if IE \"+a+\"]><span></span><![endif]--\\x3e\";if(b.getElementsByTagName(\"span\").length)return a}return null}};a.H=\"supplementalDataID timestamp dynamicVariablePrefix visitorID marketingCloudVisitorID analyticsVisitorID audienceManagerLocationHint authState fid vmk visitorMigrationKey visitorMigrationServer visitorMigrationServerSecure charSet visitorNamespace cookieDomainPeriods fpCookieDomainPeriods cookieLifetime pageName pageURL customerPerspective referrer contextData currencyCode lightProfileID lightStoreForSeconds lightIncrementBy retrieveLightProfiles deleteLightProfiles retrieveLightData\".split(\" \");\r\na.g=a.H.concat(\"purchaseID variableProvider channel server pageType transactionID campaign state zip events events2 products audienceManagerBlob tnt\".split(\" \"));a.oa=\"timestamp charSet visitorNamespace cookieDomainPeriods cookieLifetime contextData lightProfileID lightStoreForSeconds lightIncrementBy\".split(\" \");a.P=a.oa.slice(0);a.Ca=\"account allAccounts debugTracking visitor visitorOptedOut trackOffline offlineLimit offlineThrottleDelay offlineFilename usePlugins doPlugins configURL visitorSampling visitorSamplingGroup linkObject clickObject linkURL linkName linkType trackDownloadLinks trackExternalLinks trackClickMap trackInlineStats linkLeaveQueryString linkTrackVars linkTrackEvents linkDownloadFileTypes linkExternalFilters linkInternalFilters useForcedLinkTracking forcedLinkTrackingTimeout trackingServer trackingServerSecure ssl abort mobile dc lightTrackVars maxDelay expectSupplementalData usePostbacks registerPreTrackCallback registerPostTrackCallback AudienceManagement\".split(\" \");\r\nfor(m=0;250>=m;m++)76>m&&(a.g.push(\"prop\"+m),a.P.push(\"prop\"+m)),a.g.push(\"eVar\"+m),a.P.push(\"eVar\"+m),6>m&&a.g.push(\"hier\"+m),4>m&&a.g.push(\"list\"+m);m=\"pe pev1 pev2 pev3 latitude longitude resolution colorDepth javascriptVersion javaEnabled cookiesEnabled browserWidth browserHeight connectionType homepage pageURLRest marketingCloudOrgID\".split(\" \");a.g=a.g.concat(m);a.H=a.H.concat(m);a.ssl=0<=k.location.protocol.toLowerCase().indexOf(\"https\");a.charSet=\"UTF-8\";a.contextData={};a.offlineThrottleDelay=\r\n0;a.offlineFilename=\"AppMeasurement.offline\";a.Ra=0;a.ma=0;a.O=0;a.Qa=0;a.linkDownloadFileTypes=\"exe,zip,wav,mp3,mov,mpg,avi,wmv,pdf,doc,docx,xls,xlsx,ppt,pptx\";a.w=k;a.d=k.document;try{if(a.Wa=!1,navigator){var v=navigator.userAgent;if(\"Microsoft Internet Explorer\"==navigator.appName||0<=v.indexOf(\"MSIE \")||0<=v.indexOf(\"Trident/\")&&0<=v.indexOf(\"Windows NT 6\"))a.Wa=!0}}catch(x){}a.ha=function(){a.ia&&(k.clearTimeout(a.ia),a.ia=p);a.l&&a.K&&a.l.dispatchEvent(a.K);a.A&&(\"function\"==typeof a.A?a.A():\r\na.l&&a.l.href&&(a.d.location=a.l.href));a.l=a.K=a.A=0};a.Ua=function(){a.b=a.d.body;a.b?(a.v=function(c){var b,d,f,e,g;if(!(a.d&&a.d.getElementById(\"cppXYctnr\")||c&&c[\"s_fe_\"+a._in])){if(a.Ea)if(a.useForcedLinkTracking)a.b.removeEventListener(\"click\",a.v,!1);else{a.b.removeEventListener(\"click\",a.v,!0);a.Ea=a.useForcedLinkTracking=0;return}else a.useForcedLinkTracking=0;a.clickObject=c.srcElement?c.srcElement:c.target;try{if(!a.clickObject||a.N&&a.N==a.clickObject||!(a.clickObject.tagName||a.clickObject.parentElement||\r\na.clickObject.parentNode))a.clickObject=0;else{var h=a.N=a.clickObject;a.la&&(clearTimeout(a.la),a.la=0);a.la=setTimeout(function(){a.N==h&&(a.N=0)},1E4);f=a.La();a.track();if(f<a.La()&&a.useForcedLinkTracking&&c.target){for(e=c.target;e&&e!=a.b&&\"A\"!=e.tagName.toUpperCase()&&\"AREA\"!=e.tagName.toUpperCase();)e=e.parentNode;if(e&&(g=e.href,a.Na(g)||(g=0),d=e.target,c.target.dispatchEvent&&g&&(!d||\"_self\"==d||\"_top\"==d||\"_parent\"==d||k.name&&d==k.name))){try{b=a.d.createEvent(\"MouseEvents\")}catch(l){b=\r\nnew k.MouseEvent}if(b){try{b.initMouseEvent(\"click\",c.bubbles,c.cancelable,c.view,c.detail,c.screenX,c.screenY,c.clientX,c.clientY,c.ctrlKey,c.altKey,c.shiftKey,c.metaKey,c.button,c.relatedTarget)}catch(m){b=0}b&&(b[\"s_fe_\"+a._in]=b.s_fe=1,c.stopPropagation(),c.stopImmediatePropagation&&c.stopImmediatePropagation(),c.preventDefault(),a.l=c.target,a.K=b)}}}}}catch(n){a.clickObject=0}}},a.b&&a.b.attachEvent?a.b.attachEvent(\"onclick\",a.v):a.b&&a.b.addEventListener&&(navigator&&(0<=navigator.userAgent.indexOf(\"WebKit\")&&\r\na.d.createEvent||0<=navigator.userAgent.indexOf(\"Firefox/2\")&&k.MouseEvent)&&(a.Ea=1,a.useForcedLinkTracking=1,a.b.addEventListener(\"click\",a.v,!0)),a.b.addEventListener(\"click\",a.v,!1))):setTimeout(a.Ua,30)};a.Cb();a.ac||(r?a.setAccount(r):a.F(\"Error, missing Report Suite ID in AppMeasurement initialization\"),a.Ua(),a.loadModule(\"ActivityMap\"))}" ]
[ "0.47174537", "0.4658246", "0.45285463", "0.45032862", "0.44835344", "0.44350168", "0.4382653", "0.43627265", "0.43324777", "0.4301593", "0.42541128", "0.42418656", "0.4221815", "0.42179117", "0.41816333", "0.41801563", "0.41795337", "0.417805", "0.4176735", "0.41745046", "0.4172715", "0.416532", "0.4140857", "0.4140857", "0.4125978", "0.41207212", "0.41181394", "0.41115952", "0.41091898", "0.41079316", "0.41062677", "0.41049024", "0.41027054", "0.41022694", "0.410083", "0.4095065", "0.40917927", "0.40812904", "0.40807405", "0.40791658", "0.40771678", "0.40754294", "0.40733093", "0.407272", "0.40688023", "0.40591353", "0.40538645", "0.40534827", "0.4049118", "0.40481293", "0.40477178", "0.40440556", "0.40431336", "0.4041285", "0.40409878", "0.4040742", "0.4034237", "0.40251347", "0.4021832", "0.401967", "0.40185636", "0.40154555", "0.40134138", "0.40127307", "0.40119314", "0.40104625", "0.40068188", "0.40068188", "0.40059087", "0.4004625", "0.3991457", "0.3990997", "0.39907634", "0.39872354", "0.3983524", "0.39815342", "0.39802438", "0.39802438", "0.39802438", "0.39799574", "0.39766735", "0.39765778", "0.39743623", "0.39739642", "0.39738163", "0.39735964", "0.396918", "0.3966224", "0.39611036", "0.39610842", "0.3960728", "0.3956596", "0.39565182", "0.39551875", "0.3950826", "0.39456856", "0.3944749", "0.39428768", "0.39405105", "0.39404854", "0.39403772" ]
0.0
-1
Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file distributed with this work for additional information regarding copyright ownership. The ASF licenses this file to you under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. import Group from 'zrender/src/container/Group';
function TooltipRichContent(api) { this._zr = api.getZr(); this._show = false; /** * @private */ this._hideTimeout; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "render() {\n return (\n <g className=\"chart-legend-group\"/>\n );\n }", "function Group(options) {\n // parent can be position(global level) or another group\n\n\n this.children = [];\n this.points = [];\n this.circles = [];\n\n this.state = {\n inAir: false\n };\n\n this.dPos = [0,0];\n this.velocity = [0,0];\n this.acceleration = [0,0];\n\n this.childrenAngle = 0;\n this.childrenSpin = 0;\n\n this.lines = {\n fromOrigin: false,\n //ctx.strokeStyle\n color: 'black',\n //ctx.lineWidth\n width: '5',\n\n connectEnds: true,\n };\n\n this.fill = {\n filled: false,\n //\n fillMode: 'object',\n };\n\n}", "function Group(/* null | group */)\n{\n this.internals = []; \t\t\t\t // a list of internal objects\n\tthis.transformationMarker = new Transformation(); // transformation marker\n\tthis.axes = [];\n\tGroup.count++;\n\tthis.name = \"Group\"+Group.count;\n\tthis.viewPoint = new Transformation();\n\tthis.vpd = 500;\n\t\n\tthis.initializeAxes();\n \n\t// not available yet\n\t//this.scenarioMarker = new Scenario(); // scenario marker\n\t\n\tif(arguments.length == 1 )\n\t{\n\t\tthis.internals = arguments[0].internals;\n\t\tthis.transformationMarker = arguments[0].transformationMarker;\n\t\tthis.axes = arguments[0].axes;\n\t\tthis.name = arguments[0].name;\n\t\tthis.viewPoint = arguments[0].viewPoint;\n\t\tthis.vpd = arguments[0].vpd;\n\t}\n}", "addGroup() {\n this.mapping.groups.push({\n toPrefix: this.loaderPath ? this.loaderPath : null,\n properties: []\n });\n }", "get canvasElt(){\n return this.group; \n }", "componentDidMount() {\n const { data, options, layerOptions } = this.props;\n this.layer = this.plot.overlay_array(data, options, layerOptions);\n }", "function Group() {\n var group = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};\n\n _classCallCheck(this, Group);\n\n if (!group.sketchObject) {\n // eslint-disable-next-line no-param-reassign\n group.sketchObject = _Factory__WEBPACK_IMPORTED_MODULE_4__[\"Factory\"].createNative(Group).alloc().initWithFrame(new _models_Rectangle__WEBPACK_IMPORTED_MODULE_2__[\"Rectangle\"](0, 0, 100, 100).asCGRect());\n }\n\n return _possibleConstructorReturn(this, _getPrototypeOf(Group).call(this, group));\n } // @deprecated", "function RenderingGroup(index,scene,opaqueSortCompareFn,alphaTestSortCompareFn,transparentSortCompareFn){if(opaqueSortCompareFn===void 0){opaqueSortCompareFn=null;}if(alphaTestSortCompareFn===void 0){alphaTestSortCompareFn=null;}if(transparentSortCompareFn===void 0){transparentSortCompareFn=null;}this.index=index;this._opaqueSubMeshes=new BABYLON.SmartArray(256);this._transparentSubMeshes=new BABYLON.SmartArray(256);this._alphaTestSubMeshes=new BABYLON.SmartArray(256);this._particleSystems=new BABYLON.SmartArray(256);this._spriteManagers=new BABYLON.SmartArray(256);this._edgesRenderers=new BABYLON.SmartArray(16);this._scene=scene;this.opaqueSortCompareFn=opaqueSortCompareFn;this.alphaTestSortCompareFn=alphaTestSortCompareFn;this.transparentSortCompareFn=transparentSortCompareFn;}", "function Group(parent) {\n var _this = this;\n\n this.visualElement = sf.base.createElement('div', {\n className: 'e-cloneproperties e-dragclone e-gdclone',\n styles: 'line-height:23px',\n attrs: {\n action: 'grouping'\n }\n });\n\n this.helper = function (e) {\n var gObj = _this.parent;\n var target = e.sender.target;\n var element = target.classList.contains('e-groupheadercell') ? target : parentsUntil(target, 'e-groupheadercell');\n\n if (!element || !target.classList.contains('e-drag') && _this.parent.options.groupReordering) {\n return false;\n }\n\n _this.column = gObj.getColumnByField(element.firstElementChild.getAttribute('ej-mappingname'));\n _this.visualElement.textContent = element.textContent;\n _this.visualElement.style.width = element.offsetWidth + 2 + 'px';\n _this.visualElement.style.height = element.offsetHeight + 2 + 'px';\n\n _this.visualElement.setAttribute('e-mappinguid', _this.column.uid);\n\n gObj.element.appendChild(_this.visualElement);\n return _this.visualElement;\n };\n\n this.dragStart = function (e) {\n _this.parent.element.classList.add('e-ungroupdrag');\n\n document.body.classList.add('e-prevent-select');\n e.bindEvents(e.dragElement);\n };\n\n this.drag = function (e) {\n // if (this.groupSettings.allowReordering) {\n // this.animateDropper(e);\n // }\n var target = e.target;\n\n var cloneElement = _this.parent.element.querySelector('.e-cloneproperties'); // this.parent.trigger(events.columnDrag, { target: target, draggableType: 'headercell', column: this.column });\n\n\n if (!_this.parent.options.groupReordering) {\n sf.base.classList(cloneElement, ['e-defaultcur'], ['e-notallowedcur']);\n\n if (!(parentsUntil(target, 'e-gridcontent') || parentsUntil(target, 'e-headercell'))) {\n sf.base.classList(cloneElement, ['e-notallowedcur'], ['e-defaultcur']);\n }\n }\n };\n\n this.dragStop = function (e) {\n document.body.classList.remove('e-prevent-select');\n\n _this.parent.element.classList.remove('e-ungroupdrag');\n\n var preventDrop = !(parentsUntil(e.target, 'e-gridcontent') || parentsUntil(e.target, 'e-gridheader')); // if (this.groupSettings.allowReordering && preventDrop) { //TODO: reordering\n // remove(e.helper);\n // if (parentsUntil(e.target, 'e-groupdroparea')) {\n // this.rearrangeGroup(e);\n // } else if (!(parentsUntil(e.target, 'e-grid'))) {\n // let field: string = this.parent.getColumnByUid(e.helper.getAttribute('e-mappinguid')).field;\n // if (this.groupSettings.columns.indexOf(field) !== -1) {\n // this.ungroupColumn(field);\n // }\n // }\n // return;\n // } else\n\n if (preventDrop) {\n sf.base.remove(e.helper);\n return;\n }\n }; //TODO: reordering\n // private animateDropper: Function = (e: { target: HTMLElement, event: MouseEventArgs, helper: Element }) => {\n // let uid: string = this.parent.element.querySelector('.e-cloneproperties').getAttribute('e-mappinguid');\n // let dragField: string = this.parent.getColumnByUid(uid).field;\n // let parent: Element = parentsUntil(e.target, 'e-groupdroparea');\n // let dropTarget: Element = parentsUntil(e.target, 'e-group-animator');\n // // tslint:disable-next-line\n // let grouped: string[] = [].slice.call(this.element.querySelectorAll('.e-groupheadercell'))\n // .map((e: Element) => e.querySelector('div').getAttribute('ej-mappingname'));\n // let cols: string[] = JSON.parse(JSON.stringify(grouped));\n // if (dropTarget || parent) {\n // if (dropTarget) {\n // let dropField: string = dropTarget.querySelector('div[ej-mappingname]').getAttribute('ej-mappingname');\n // let dropIndex: number = +(dropTarget.getAttribute('index'));\n // if (dropField !== dragField) {\n // let dragIndex: number = cols.indexOf(dragField);\n // if (dragIndex !== -1) {\n // cols.splice(dragIndex, 1);\n // }\n // let flag: boolean = dropIndex !== -1 && dragIndex === dropIndex;\n // cols.splice(dropIndex + (flag ? 1 : 0), 0, dragField);\n // }\n // } else if (parent && cols.indexOf(dragField) === -1) {\n // cols.push(dragField);\n // }\n // this.element.innerHTML = '';\n // if (cols.length && !this.element.classList.contains('e-grouped')) {\n // this.element.classList.add('e-grouped');\n // }\n // this.reorderingColumns = cols;\n // for (let c: number = 0; c < cols.length; c++) {\n // this.addColToGroupDrop(cols[c]);\n // }\n // } else {\n // this.addLabel();\n // this.removeColFromGroupDrop(dragField);\n // }\n // }\n // private rearrangeGroup(e: { target: HTMLElement, event: MouseEventArgs, helper: Element }): void {\n // this.sortRequired = false;\n // this.updateModel();\n // }\n\n\n this.preventTouchOnWindow = function (e) {\n e.preventDefault();\n };\n\n this.drop = function (e) {\n var gObj = _this.parent;\n var column = gObj.getColumnByUid(e.droppedElement.getAttribute('e-mappinguid'));\n gObj.element.querySelector('.e-groupdroparea').classList.remove('e-hover');\n sf.base.remove(e.droppedElement);\n\n if (gObj.options.allowGrouping) {\n sf.base.EventHandler.remove(window, 'touchmove', _this.preventTouchOnWindow);\n }\n\n _this.parent.element.querySelector('.e-groupdroparea').removeAttribute(\"aria-dropeffect\");\n\n _this.parent.element.querySelector('[aria-grabbed=true]').setAttribute(\"aria-grabbed\", 'false');\n\n if (sf.base.isNullOrUndefined(column) || column.allowGrouping === false || parentsUntil(gObj.getColumnHeaderByUid(column.uid), 'e-grid').getAttribute('id') !== gObj.element.getAttribute('id')) {\n return;\n }\n\n gObj.dotNetRef.invokeMethodAsync(\"GroupColumn\", column.field, 'Group');\n };\n\n this.parent = parent;\n\n if (this.parent.options.allowGrouping && this.parent.options.showDropArea) {\n this.initDragAndDrop();\n }\n }", "_draw(callback) {\n super._draw(callback);\n\n const height = this._height - this._margin.top - this._margin.bottom,\n width = this._width - this._margin.left - this._margin.right;\n\n const diameter = Math.min(height, width);\n const transform = `translate(${(width - diameter) / 2}, ${(height - diameter) / 2})`;\n\n let nestedData = nest();\n for (let i = 0; i <= this._drawDepth; i++) nestedData.key(this._groupBy[i]);\n nestedData = nestedData.entries(this._filteredData);\n\n const packData = this._pack\n .padding(this._layoutPadding)\n .size([diameter, diameter])(\n hierarchy({key: nestedData.key, values: nestedData}, d => d.values).sum(this._sum).sort(this._sort)\n )\n .descendants();\n\n packData.forEach((d, i) => {\n d.__d3plus__ = true;\n d.i = i;\n d.id = d.parent ? d.parent.data.key : null;\n d.data.__d3plusOpacity__ = d.height ? this._packOpacity(d.data, i) : 1;\n d.data.__d3plusTooltip__ = !d.height ? true : false;\n });\n\n this._shapes.push(\n new Circle()\n .data(packData)\n .select(\n elem(\"g.d3plus-Pack\", {\n parent: this._select,\n enter: {transform},\n update: {transform}\n }).node()\n )\n .config(configPrep.bind(this)(this._shapeConfig, \"shape\", \"Circle\"))\n .render()\n );\n\n return this;\n }", "constructor() { \n \n Group.initialize(this);\n }", "function LineChartDemoComponent(charts) {\n this.charts = charts;\n this.dateArray = [];\n this.userArray = [];\n this.tagArray = [];\n this.groupArray = [];\n this.lineChartData = [{ data: [], label: '' }, { data: [], label: '' }, { data: [], label: '' }];\n this.lineChartLabels = []; //Users \n this.lineChartOptions = {\n responsive: true,\n scales: {\n xAxes: [{\n stacked: true\n }],\n yAxes: [{\n stacked: true\n }]\n },\n height: '500px',\n width: '720px'\n };\n this.lineChartColors = [\n {\n backgroundColor: 'rgba(148,159,177,0.2)',\n borderColor: 'rgba(148,159,177,1)',\n pointBackgroundColor: 'rgba(148,159,177,1)',\n pointBorderColor: '#fff',\n pointHoverBackgroundColor: '#fff',\n pointHoverBorderColor: 'rgba(148,159,177,0.8)'\n },\n {\n backgroundColor: 'rgba(77,83,96,0.3)',\n borderColor: 'rgba(77,83,96,1)',\n pointBackgroundColor: 'rgba(77,83,96,1)',\n pointBorderColor: '#fff',\n pointHoverBackgroundColor: '#fff',\n pointHoverBorderColor: 'rgba(77,83,96,1)'\n },\n {\n backgroundColor: 'rgba(148,159,177,0.4)',\n borderColor: 'rgba(148,159,177,1)',\n pointBackgroundColor: 'rgba(148,159,177,1)',\n pointBorderColor: '#fff',\n pointHoverBackgroundColor: '#fff',\n pointHoverBorderColor: 'rgba(148,159,177,0.8)'\n }\n ];\n this.lineChartLegend = true;\n this.lineChartType = 'line';\n }", "render() {\n // Add loader if any point's data is being loading.\n let loader = null;\n if (this.state.loading) {\n let style = {\n position: 'absolute',\n top: 10,\n left: 50,\n zIndex: 999\n };\n\n loader = (\n <div style={style}>\n <ScaleLoader/>\n </div>\n );\n }\n\n const columns = this.state.dataColumnRanges;\n\n return (\n <MuiThemeProvider theme={theme}>\n <div className=\"App\">\n <CssBaseline/>\n {loader}\n <AppMap\n points={this.state.points}\n selectedPoints={this.state.groups[this.state.selectedGroup].selection}\n addPoint={this.addPoint}\n removePoint={this.removePoint}\n />\n <AppMenu\n height={this.state.window.height}\n >\n <SelectionComponent\n key={'Seleccionar'}\n groups={this.state.groups}\n selectedGroup={this.state.selectedGroup}\n selectGroup={this.changeSelectedGroup}\n changeGroupName={(group, name) => this.changeGroupName(group, name)}\n newGroup={() => this.newGroup()}\n deleteGroup={(group) => this.deleteGroup(group)}\n deleteAllGroups={() => this.deleteAllGroups()}\n changeManualSelection={() => this.changeManualSelection()}\n pointColumnRanges={this.state.pointColumnRanges}\n changeFilters={(group, filters) => this.changeFilters(group, filters)}\n />\n <FilterComponent\n key={'Filtrar'}\n dataColumnRanges={this.state.dataColumnRanges}\n getDates={this.getSelectionDates}\n dataFilters={this.state.dataFilters}\n timeFilters={this.state.groups[this.state.selectedGroup].timeFilters}\n dateFilters={this.state.groups[this.state.selectedGroup].months}\n changeDataFilters={this.changeDataFilters}\n changeDateFilters={this.changeDateFilters}\n changeTimeFilters={this.changeTimeFilters}\n />\n <DisaggregationComponent\n key={'Desagregar'}\n columns={columns}\n disaggregators={this.state.disaggregators}\n changeDisaggregators={(agg) => this.setState({disaggregators: agg})}\n />\n <AggregationComponent\n key={'Agregar'}\n columns={columns}\n aggregators={this.state.aggregators}\n disaggregators={this.state.disaggregators}\n changeAggregators={(agg) => this.setState({aggregators: agg})}\n />\n <GraphComponent\n key={'Graficar'}\n getFilteredData={this.getFilteredData}\n getGroupedData={this.getGroupedData}\n groupInfo={this.state.groups}\n />\n </AppMenu>\n </div>\n {this.renderErrorWindow()}\n </MuiThemeProvider>\n );\n }", "function Group(parent, groupSettings, sortedColumns, serviceLocator) {\n var _this = this;\n this.isAppliedGroup = false;\n this.isAppliedUnGroup = false;\n this.visualElement = createElement('div', {\n className: 'e-cloneproperties e-dragclone e-gdclone',\n styles: 'line-height:23px', attrs: { action: 'grouping' }\n });\n this.helper = function (e) {\n var gObj = _this.parent;\n var target = e.sender.target;\n var element = target.classList.contains('e-groupheadercell') ? target :\n parentsUntil(target, 'e-groupheadercell');\n if (!element) {\n return false;\n }\n _this.column = gObj.getColumnByField(element.firstElementChild.getAttribute('ej-mappingname'));\n _this.visualElement.textContent = element.textContent;\n _this.visualElement.style.width = element.offsetWidth + 2 + 'px';\n _this.visualElement.style.height = element.offsetHeight + 2 + 'px';\n _this.visualElement.setAttribute('e-mappinguid', _this.column.uid);\n gObj.element.appendChild(_this.visualElement);\n return _this.visualElement;\n };\n this.dragStart = function (e) {\n _this.parent.element.classList.add('e-ungroupdrag');\n if (isBlazor()) {\n e.bindEvents(e.dragElement);\n }\n };\n this.drag = function (e) {\n var target = e.target;\n var cloneElement = _this.parent.element.querySelector('.e-cloneproperties');\n _this.parent.trigger(columnDrag, { target: target, draggableType: 'headercell', column: _this.column });\n classList(cloneElement, ['e-defaultcur'], ['e-notallowedcur']);\n if (!(parentsUntil(target, 'e-gridcontent') || parentsUntil(target, 'e-headercell'))) {\n classList(cloneElement, ['e-notallowedcur'], ['e-defaultcur']);\n }\n };\n this.dragStop = function (e) {\n _this.parent.element.classList.remove('e-ungroupdrag');\n if (!(parentsUntil(e.target, 'e-gridcontent') || parentsUntil(e.target, 'e-gridheader'))) {\n remove(e.helper);\n return;\n }\n };\n this.drop = function (e) {\n var gObj = _this.parent;\n var column = gObj.getColumnByUid(e.droppedElement.getAttribute('e-mappinguid'));\n _this.element.classList.remove('e-hover');\n remove(e.droppedElement);\n _this.aria.setDropTarget(_this.parent.element.querySelector('.e-groupdroparea'), false);\n _this.aria.setGrabbed(_this.parent.getHeaderTable().querySelector('[aria-grabbed=true]'), false);\n if (isNullOrUndefined(column) || column.allowGrouping === false ||\n parentsUntil(gObj.getColumnHeaderByUid(column.uid), 'e-grid').getAttribute('id') !==\n gObj.element.getAttribute('id')) {\n _this.parent.log('action_disabled_column', { moduleName: _this.getModuleName(), columnName: column.headerText });\n return;\n }\n _this.groupColumn(column.field);\n };\n this.contentRefresh = true;\n this.aria = new AriaService();\n this.parent = parent;\n this.groupSettings = groupSettings;\n this.serviceLocator = serviceLocator;\n this.sortedColumns = sortedColumns;\n this.focus = serviceLocator.getService('focus');\n this.addEventListener();\n this.groupGenerator = new GroupModelGenerator(this.parent);\n }", "function getConstructor() {\n /**\n * Construct the component and return exposed functions and objects\n * @param {String} id that identifies instance of constructed component\n * @return {Object} THREE.js Group, Draw fn, id\n */\n function construct(id, debug) {\n\n const _debug = (debug === true);\n const selectedColor = '#ff0000';\n const unselectedColor = '#eeeeee';\n\n // Array of element names to update on each frame\n let toUpdate = [];\n let toUpdateTypes = ['video'];\n let drawPerType = {\n image: applyMaterialImage,\n text: applyMaterialText,\n video: applyMaterialVideo\n };\n let elements = {\n main: { \n name: 'main',\n position: new THREE.Vector3(0, 0, 1),\n type: 'drawable',\n object: createDrawable('main')\n },\n leftSide: { \n name: 'leftSide',\n position: new THREE.Vector3(-1, .5, 1.2),\n type: 'drawable',\n object: createDrawable('leftSide')\n },\n rightSide: { \n name: 'rightSide',\n position: new THREE.Vector3(.8, .8, -1),\n type: 'drawable',\n object: createDrawable('rightSide')\n },\n frame: {\n name: 'frame',\n position: new THREE.Vector3(0, 0, 0),\n type: 'helper',\n object: createFrame(elementOptions.frame, debug) \n }\n };\n\n let component = new THREE.Group();\n let elementNames = Object.keys(elements);\n\n component.name = 'componentGroup';\n\n elementNames.forEach(elementName => {\n let element = elements[elementName];\n\n component.add(element.object);\n element.object.position.copy(element.position);\n });\n // mainObject.position.set(0,0,opt.radius/opt.vCutOff);\n draw(sampleData);\n\n /**\n * Draw data point value onto drawable.\n * @param {Object} value: '', drawableId: String, draw_type: String\n * @return {void}\n */\n function draw(data) {\n if (data instanceof Array) {\n data.forEach(renderDrawable);\n } else renderDrawable(data);\n }\n\n function renderDrawable(data) {\n let element = elements[data.drawableId] || {};\n let object = element.object;\n let drawFn = drawPerType[data.type];\n\n if (\n data.drawableId && object && element.type === 'drawable' &&\n typeof(drawFn) === 'function'\n ) {\n drawFn(data, object);\n object.visible = true;\n\n if (~toUpdateTypes.indexOf(data.type) && !~toUpdate.indexOf(element.name)) {\n toUpdate.push(element.name);\n }\n }\n }\n\n function deactivate() {\n draw(sampleData);\n elements.leftSide.object.visible = false;\n }\n\n function highlight(inView) {\n if (_debug && elements.frame.object.material) {\n elements.frame.material.color.set(\n inView ? selectedColor : unselectedColor\n );\n }\n }\n\n /**\n * Update data on any element that is marked for keeping updated.\n * @param {Object} value: '', drawableId: String, draw_type: String\n * @return {void}\n */\n\n function update() {\n toUpdate.forEach(elementName => {\n let element = elements[elementName];\n\n if (\n element && element.object && element.object.userData && \n typeof(element.object.userData.update) === 'function'\n ) element.object.userData.update();\n });\n }\n\n return {\n draw,\n update,\n highlight,\n deactivate,\n component,\n id,\n frame: elements.frame.object,\n timeStamp: Date.now(),\n };\n }\n\n console.log('timeStamp:', Date.now());\n\n return construct;\n}", "function Group(domoticz) {\n this.domoticz = domoticz;\n}", "function AxisGroupLayout() {\n go.Layout.call(this);\n // go.GridLayout.call(this);\n // this.cellSize = new go.Size(1, 1);\n // this.wrappingColumn = Infinity;\n // this.wrappingWidth = Infinity;\n // this.spacing = new go.Size(0, 0);\n // this.alignment = go.GridLayout.Position;\n}", "triggerToggleLayerGroup() {\n const datasetID = this.props.dataset.id;\n const addLayerGroup = !this.props.isLayerGroupAdded(datasetID);\n this.props.toggleLayerGroup(datasetID, addLayerGroup);\n }", "onStoreGroup({ groupers }) {\n const grid = this.grid,\n element = grid.element,\n curGroupHeaders = element && DomHelper.children(element, '.b-grid-header.b-group');\n\n if (element) {\n for (let header of curGroupHeaders) {\n // IE11 doesnt support this\n //header.classList.remove('b-group', 'b-asc', 'b-desc');\n header.classList.remove('b-group');\n header.classList.remove('b-asc');\n header.classList.remove('b-desc');\n }\n\n for (let groupInfo of groupers) {\n let header = grid.getHeaderElementByField(groupInfo.field);\n // IE11 doesnt support this\n //header && header.classList.add('b-group', groupInfo.ascending ? 'b-asc' : 'b-desc');\n if (header) {\n header.classList.add('b-group');\n header.classList.add(groupInfo.ascending ? 'b-asc' : 'b-desc');\n }\n }\n }\n }", "constructor(props){\n super(props);\n this.state ={\n chartItems:[], //[{group:string, type:stirng, data:[{dataName:string, data:{}}]}]\n isLoaded:false,\n labels:[]\n }\n }", "static get name() {\n return \"DrawingsLayer\"\n }", "function getFeatureGroup() {\n return getMarkerFeatureGroup('_layers');\n }", "function ShapeGroupData() {\n this.it = [];\n this.prevViewData = [];\n this.gr = createNS('g');\n }", "addLegend () {\n \n }", "function add_to_fabric_group(fabric_obj) {\n\tfabric_group.addWithUpdate(fabric_obj);\n\tcanvas.add(fabric_obj);\n\t// canvas._activeObject = null;\n}", "static template() { return 'CanvasComponent'; }", "showFeatureGroup (groupId, map) {\n this.currentLayer = this.indexedFeatures()[groupId]\n map.addLayer(this.currentLayer)\n }", "init() {\n this.groups = {};\n }", "renderHeader(headerContainerElement) {\n let me = this,\n grid = me.grid,\n groupers = me.store.groupers;\n\n // Sorted from start, reflect in rendering\n for (let groupInfo of groupers) {\n // Might be grouping by field without column, which is valid\n const column = grid.columns.get(groupInfo.field),\n header = column && grid.getHeaderElement(column.id);\n // IE11 doesnt support this\n //header && header.classList.add('b-group', groupInfo.ascending ? 'b-asc' : 'b-desc');\n if (header) {\n header.classList.add('b-group');\n header.classList.add(groupInfo.ascending ? 'b-asc' : 'b-desc');\n }\n }\n }", "function top10VAChart(group) {\n\tvar dataArray = [];\n\tvar vaArray = roleCountOfVA();\n\tfor(var i = 10*(group-1); i < 10*group; i++) {\n\t\tdataArray.push(vaArray[0].dataPoints[i]);\n\t}\n\t//console.log(dataArray);\n\tvar chart = new CanvasJS.Chart(\"chart_div\", {\n\t\tbackgroundColor: \"#FFD90F\",\n\t\t//theme: \"theme3\",\n\t\ttitle: {\n\t\t\ttext: \"The Simpsons VA\",\n\t\t\tfontSize: 30\n\t\t},\n\t\taxisX: {\n\t\t\ttitle: \"Voice Actors\",\n\t\t\ttitleFontColor: \"black\",\n\t\t\ttitleFontSize: 24,\n\t\t\tlabelAutoFit: true,\n\t\t\tlabelFontSize: 14.5,\n\t\t\tlabelFontColor: \"black\",\n\t\t\tinterval: 1,\n\t\t\tmargin: 0,\n\t\t\tgridColor: \"gray\",\n\t\t\ttickColor: \"gray\"\n\t\t},\n\t\taxisY: {\n\t\t\ttitle: \"Roles Played\",\n\t\t\ttitleFontSize: 24,\n\t\t\ttitleFontColor: \"black\",\n\t\t\tlabelFontColor: \"black\",\n\t\t\tgridColor: \"gray\",\n\t\t\ttickColor: \"gray\"\n\t\t},\n\t\tlegend: {\n\t\t\tfontFamily: \"sans-serif\",\n\t\t\tverticalAlign: \"bottom\",\n\t\t\thorizontalAlign: \"center\",\n\t\t\tcursor: \"pointer\",\n\t\t\t//itemclick: function\n\t\t},\n\t\tcreditText: \"\",\n\t\tdata: [\n\t\t\t{\n\t\t\t\ttype: \"column\",\n\t\t\t\tdataPoints: dataArray,\n\t\t\t}\n\t\t],\n\t});\n\tchart.render();\n}", "function CardGroup(props) {\n var children = props.children,\n className = props.className,\n doubling = props.doubling,\n items = props.items,\n itemsPerRow = props.itemsPerRow,\n stackable = props.stackable;\n\n\n var classes = __WEBPACK_IMPORTED_MODULE_3_classnames___default()('ui', __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_5__lib__[\"a\" /* useKeyOnly */])(doubling, 'doubling'), __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_5__lib__[\"a\" /* useKeyOnly */])(stackable, 'stackable'), __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_5__lib__[\"f\" /* useWidthProp */])(itemsPerRow), className, 'cards');\n var rest = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_5__lib__[\"b\" /* getUnhandledProps */])(CardGroup, props);\n var ElementType = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_5__lib__[\"c\" /* getElementType */])(CardGroup, props);\n\n if (!__WEBPACK_IMPORTED_MODULE_2_lodash_isNil___default()(children)) {\n return __WEBPACK_IMPORTED_MODULE_4_react___default.a.createElement(\n ElementType,\n __WEBPACK_IMPORTED_MODULE_0_babel_runtime_helpers_extends___default()({}, rest, { className: classes }),\n children\n );\n }\n\n var content = __WEBPACK_IMPORTED_MODULE_1_lodash_map___default()(items, function (item) {\n var key = item.key || [item.header, item.description].join('-');\n return __WEBPACK_IMPORTED_MODULE_4_react___default.a.createElement(__WEBPACK_IMPORTED_MODULE_6__Card__[\"a\" /* default */], __WEBPACK_IMPORTED_MODULE_0_babel_runtime_helpers_extends___default()({ key: key }, item));\n });\n\n return __WEBPACK_IMPORTED_MODULE_4_react___default.a.createElement(\n ElementType,\n __WEBPACK_IMPORTED_MODULE_0_babel_runtime_helpers_extends___default()({}, rest, { className: classes }),\n content\n );\n}", "function CardGroup(props) {\n var centered = props.centered,\n children = props.children,\n className = props.className,\n content = props.content,\n doubling = props.doubling,\n items = props.items,\n itemsPerRow = props.itemsPerRow,\n stackable = props.stackable,\n textAlign = props.textAlign;\n var classes = __WEBPACK_IMPORTED_MODULE_3_classnames___default()('ui', Object(__WEBPACK_IMPORTED_MODULE_6__lib__[\"A\" /* useKeyOnly */])(centered, 'centered'), Object(__WEBPACK_IMPORTED_MODULE_6__lib__[\"A\" /* useKeyOnly */])(doubling, 'doubling'), Object(__WEBPACK_IMPORTED_MODULE_6__lib__[\"A\" /* useKeyOnly */])(stackable, 'stackable'), Object(__WEBPACK_IMPORTED_MODULE_6__lib__[\"D\" /* useTextAlignProp */])(textAlign), Object(__WEBPACK_IMPORTED_MODULE_6__lib__[\"G\" /* useWidthProp */])(itemsPerRow), 'cards', className);\n var rest = Object(__WEBPACK_IMPORTED_MODULE_6__lib__[\"r\" /* getUnhandledProps */])(CardGroup, props);\n var ElementType = Object(__WEBPACK_IMPORTED_MODULE_6__lib__[\"q\" /* getElementType */])(CardGroup, props);\n\n if (!__WEBPACK_IMPORTED_MODULE_6__lib__[\"c\" /* childrenUtils */].isNil(children)) {\n return __WEBPACK_IMPORTED_MODULE_5_react___default.a.createElement(ElementType, __WEBPACK_IMPORTED_MODULE_0__babel_runtime_helpers_extends___default()({}, rest, {\n className: classes\n }), children);\n }\n\n if (!__WEBPACK_IMPORTED_MODULE_6__lib__[\"c\" /* childrenUtils */].isNil(content)) {\n return __WEBPACK_IMPORTED_MODULE_5_react___default.a.createElement(ElementType, __WEBPACK_IMPORTED_MODULE_0__babel_runtime_helpers_extends___default()({}, rest, {\n className: classes\n }), content);\n }\n\n var itemsJSX = __WEBPACK_IMPORTED_MODULE_2_lodash_map___default()(items, function (item) {\n var key = item.key || [item.header, item.description].join('-');\n return __WEBPACK_IMPORTED_MODULE_5_react___default.a.createElement(__WEBPACK_IMPORTED_MODULE_7__Card__[\"a\" /* default */], __WEBPACK_IMPORTED_MODULE_0__babel_runtime_helpers_extends___default()({\n key: key\n }, item));\n });\n\n return __WEBPACK_IMPORTED_MODULE_5_react___default.a.createElement(ElementType, __WEBPACK_IMPORTED_MODULE_0__babel_runtime_helpers_extends___default()({}, rest, {\n className: classes\n }), itemsJSX);\n}", "onCreateGroup() {\n this.createGroup.visible = true;\n }", "function Layer () {\n this._components = [];\n this._componentIsDirty = [];\n}", "function Group() {\n this.cells = []; //array of cell objects\n }", "function GroupingBar(parent){/* eslint-enable */this.parent=parent;this.parent.groupingBarModule=this;this.resColWidth=this.parent.isAdaptive?180:249;this.addEventListener();this.parent.axisFieldModule=new AxisFields(this.parent);this.touchObj=new sf.base.Touch(this.parent.element,{tapHold:this.tapHoldHandler.bind(this)});}", "function LayerGroupView(base) {\n var GMapsCartoDBLayerGroupView = function(layerModel, gmapsMap) {\n var self = this;\n var hovers = [];\n\n _.bindAll(this, 'featureOut', 'featureOver', 'featureClick');\n\n var opts = _.clone(layerModel.attributes);\n\n opts.map = gmapsMap;\n\n var // preserve the user's callbacks\n _featureOver = opts.featureOver,\n _featureOut = opts.featureOut,\n _featureClick = opts.featureClick;\n\n var previousEvent;\n var eventTimeout = -1;\n\n opts.featureOver = function(e, latlon, pxPos, data, layer) {\n if (!hovers[layer]) {\n self.trigger('layerenter', e, latlon, pxPos, data, layer);\n }\n hovers[layer] = 1;\n _featureOver && _featureOver.apply(this, arguments);\n self.featureOver && self.featureOver.apply(this, arguments);\n\n // if the event is the same than before just cancel the event\n // firing because there is a layer on top of it\n if (e.timeStamp === previousEvent) {\n clearTimeout(eventTimeout);\n }\n eventTimeout = setTimeout(function() {\n self.trigger('mouseover', e, latlon, pxPos, data, layer);\n self.trigger('layermouseover', e, latlon, pxPos, data, layer);\n }, 0);\n previousEvent = e.timeStamp;\n };\n\n opts.featureOut = function(m, layer) {\n if (hovers[layer]) {\n self.trigger('layermouseout', layer);\n }\n hovers[layer] = 0;\n if(!_.any(hovers)) {\n self.trigger('mouseout');\n }\n _featureOut && _featureOut.apply(this, arguments);\n self.featureOut && self.featureOut.apply(this, arguments);\n };\n\n opts.featureClick = _.debounce(function() {\n _featureClick && _featureClick.apply(this, arguments);\n self.featureClick && self.featureClick.apply(opts, arguments);\n }, 10);\n\n \n //CartoDBLayerGroup.call(this, opts);\n base.call(this, opts);\n cdb.geo.GMapsLayerView.call(this, layerModel, this, gmapsMap);\n };\n\n _.extend(\n GMapsCartoDBLayerGroupView.prototype,\n cdb.geo.GMapsLayerView.prototype,\n base.prototype,\n {\n\n _update: function() {\n this.setOptions(this.model.attributes);\n },\n\n reload: function() {\n this.model.invalidate();\n },\n\n remove: function() {\n cdb.geo.GMapsLayerView.prototype.remove.call(this);\n this.clear();\n },\n\n featureOver: function(e, latlon, pixelPos, data, layer) {\n // dont pass gmaps LatLng\n this.trigger('featureOver', e, [latlon.lat(), latlon.lng()], pixelPos, data, layer);\n },\n\n featureOut: function(e, layer) {\n this.trigger('featureOut', e, layer);\n },\n\n featureClick: function(e, latlon, pixelPos, data, layer) {\n // dont pass leaflet lat/lon\n this.trigger('featureClick', e, [latlon.lat(), latlon.lng()], pixelPos, data, layer);\n },\n\n error: function(e) {\n if(this.model) {\n //trigger the error form _checkTiles in the model\n this.model.trigger('error', e?e.errors:'unknown error');\n this.model.trigger('tileError', e?e.errors:'unknown error');\n }\n },\n\n ok: function(e) {\n this.model.trigger('tileOk');\n },\n\n tilesOk: function(e) {\n this.model.trigger('tileOk');\n },\n\n loading: function() {\n this.trigger(\"loading\");\n },\n\n finishLoading: function() {\n this.trigger(\"load\");\n }\n\n\n });\n return GMapsCartoDBLayerGroupView;\n}", "_getRenderers() {\n return this.getRenderersMapper.mapTree(this.state.rendererDataTree, this.props.shape);\n }", "function render(){var createNodes=require(\"./create-nodes\"),createClusters=require(\"./create-clusters\"),createEdgeLabels=require(\"./create-edge-labels\"),createEdgePaths=require(\"./create-edge-paths\"),positionNodes=require(\"./position-nodes\"),positionEdgeLabels=require(\"./position-edge-labels\"),positionClusters=require(\"./position-clusters\"),shapes=require(\"./shapes\"),arrows=require(\"./arrows\");var fn=function(svg,g){preProcessGraph(g);svg.selectAll(\"*\").remove();var outputGroup=createOrSelectGroup(svg,\"output\"),clustersGroup=createOrSelectGroup(outputGroup,\"clusters\"),edgePathsGroup=createOrSelectGroup(outputGroup,\"edgePaths\"),edgeLabels=createEdgeLabels(createOrSelectGroup(outputGroup,\"edgeLabels\"),g),nodes=createNodes(createOrSelectGroup(outputGroup,\"nodes\"),g,shapes);layout(g);positionNodes(nodes,g);positionEdgeLabels(edgeLabels,g);createEdgePaths(edgePathsGroup,g,arrows);var clusters=createClusters(clustersGroup,g);positionClusters(clusters,g);postProcessGraph(g)};fn.createNodes=function(value){if(!arguments.length)return createNodes;createNodes=value;return fn};fn.createClusters=function(value){if(!arguments.length)return createClusters;createClusters=value;return fn};fn.createEdgeLabels=function(value){if(!arguments.length)return createEdgeLabels;createEdgeLabels=value;return fn};fn.createEdgePaths=function(value){if(!arguments.length)return createEdgePaths;createEdgePaths=value;return fn};fn.shapes=function(value){if(!arguments.length)return shapes;shapes=value;return fn};fn.arrows=function(value){if(!arguments.length)return arrows;arrows=value;return fn};return fn}", "function loadModel() {\n if (g.object.type === 'Group') {\n g.object.traverse( function ( child ) {\n if ( child.isMesh ) {\n child.material.map = g.mat.map;\n child.material.normalMap = g.mat.normalMap;\n //child.material.roughnessMap = g.mat.roughnessMap;\n //child.material.displacementMap = g.mat.displacementMap;\n child.material.normalMap = g.mat.normalMap;\n child.material.shininess = 2000;\n }\n } );\n }\n\t}", "render() {\n return (\n <div>\n <FeatureGoup featureGroups={this.state.featureGroups}/>\n </div>\n );\n }", "function CardGroup(props) {\n var centered = props.centered,\n children = props.children,\n className = props.className,\n content = props.content,\n doubling = props.doubling,\n items = props.items,\n itemsPerRow = props.itemsPerRow,\n stackable = props.stackable,\n textAlign = props.textAlign;\n\n\n var classes = __WEBPACK_IMPORTED_MODULE_3_classnames___default()('ui', Object(__WEBPACK_IMPORTED_MODULE_6__lib__[\"B\" /* useKeyOnly */])(centered, 'centered'), Object(__WEBPACK_IMPORTED_MODULE_6__lib__[\"B\" /* useKeyOnly */])(doubling, 'doubling'), Object(__WEBPACK_IMPORTED_MODULE_6__lib__[\"B\" /* useKeyOnly */])(stackable, 'stackable'), Object(__WEBPACK_IMPORTED_MODULE_6__lib__[\"E\" /* useTextAlignProp */])(textAlign), Object(__WEBPACK_IMPORTED_MODULE_6__lib__[\"H\" /* useWidthProp */])(itemsPerRow), 'cards', className);\n var rest = Object(__WEBPACK_IMPORTED_MODULE_6__lib__[\"r\" /* getUnhandledProps */])(CardGroup, props);\n var ElementType = Object(__WEBPACK_IMPORTED_MODULE_6__lib__[\"q\" /* getElementType */])(CardGroup, props);\n\n if (!__WEBPACK_IMPORTED_MODULE_6__lib__[\"d\" /* childrenUtils */].isNil(children)) return __WEBPACK_IMPORTED_MODULE_5_react___default.a.createElement(\n ElementType,\n __WEBPACK_IMPORTED_MODULE_0_babel_runtime_helpers_extends___default()({}, rest, { className: classes }),\n children\n );\n if (!__WEBPACK_IMPORTED_MODULE_6__lib__[\"d\" /* childrenUtils */].isNil(content)) return __WEBPACK_IMPORTED_MODULE_5_react___default.a.createElement(\n ElementType,\n __WEBPACK_IMPORTED_MODULE_0_babel_runtime_helpers_extends___default()({}, rest, { className: classes }),\n content\n );\n\n var itemsJSX = __WEBPACK_IMPORTED_MODULE_2_lodash_map___default()(items, function (item) {\n var key = item.key || [item.header, item.description].join('-');\n return __WEBPACK_IMPORTED_MODULE_5_react___default.a.createElement(__WEBPACK_IMPORTED_MODULE_7__Card__[\"a\" /* default */], __WEBPACK_IMPORTED_MODULE_0_babel_runtime_helpers_extends___default()({ key: key }, item));\n });\n\n return __WEBPACK_IMPORTED_MODULE_5_react___default.a.createElement(\n ElementType,\n __WEBPACK_IMPORTED_MODULE_0_babel_runtime_helpers_extends___default()({}, rest, { className: classes }),\n itemsJSX\n );\n}", "function CardGroup(props) {\n var children = props.children,\n className = props.className,\n content = props.content,\n doubling = props.doubling,\n items = props.items,\n itemsPerRow = props.itemsPerRow,\n stackable = props.stackable,\n textAlign = props.textAlign;\n\n\n var classes = __WEBPACK_IMPORTED_MODULE_3_classnames___default()('ui', __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_6__lib__[\"a\" /* useKeyOnly */])(doubling, 'doubling'), __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_6__lib__[\"a\" /* useKeyOnly */])(stackable, 'stackable'), __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_6__lib__[\"o\" /* useTextAlignProp */])(textAlign), __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_6__lib__[\"h\" /* useWidthProp */])(itemsPerRow), 'cards', className);\n var rest = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_6__lib__[\"b\" /* getUnhandledProps */])(CardGroup, props);\n var ElementType = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_6__lib__[\"c\" /* getElementType */])(CardGroup, props);\n\n if (!__WEBPACK_IMPORTED_MODULE_6__lib__[\"d\" /* childrenUtils */].isNil(children)) return __WEBPACK_IMPORTED_MODULE_5_react___default.a.createElement(\n ElementType,\n __WEBPACK_IMPORTED_MODULE_0_babel_runtime_helpers_extends___default()({}, rest, { className: classes }),\n children\n );\n if (!__WEBPACK_IMPORTED_MODULE_6__lib__[\"d\" /* childrenUtils */].isNil(content)) return __WEBPACK_IMPORTED_MODULE_5_react___default.a.createElement(\n ElementType,\n __WEBPACK_IMPORTED_MODULE_0_babel_runtime_helpers_extends___default()({}, rest, { className: classes }),\n content\n );\n\n var itemsJSX = __WEBPACK_IMPORTED_MODULE_2_lodash_map___default()(items, function (item) {\n var key = item.key || [item.header, item.description].join('-');\n return __WEBPACK_IMPORTED_MODULE_5_react___default.a.createElement(__WEBPACK_IMPORTED_MODULE_7__Card__[\"a\" /* default */], __WEBPACK_IMPORTED_MODULE_0_babel_runtime_helpers_extends___default()({ key: key }, item));\n });\n\n return __WEBPACK_IMPORTED_MODULE_5_react___default.a.createElement(\n ElementType,\n __WEBPACK_IMPORTED_MODULE_0_babel_runtime_helpers_extends___default()({}, rest, { className: classes }),\n itemsJSX\n );\n}", "constructor(idVertex, groupVertex) {\n this.id = idVertex;\n this.label = String(idVertex);\n this.group = groupVertex;\n }", "function CardGroup(props) {\n var children = props.children,\n className = props.className,\n doubling = props.doubling,\n items = props.items,\n itemsPerRow = props.itemsPerRow,\n stackable = props.stackable,\n textAlign = props.textAlign;\n\n\n var classes = __WEBPACK_IMPORTED_MODULE_3_classnames___default()('ui', Object(__WEBPACK_IMPORTED_MODULE_6__lib__[\"z\" /* useKeyOnly */])(doubling, 'doubling'), Object(__WEBPACK_IMPORTED_MODULE_6__lib__[\"z\" /* useKeyOnly */])(stackable, 'stackable'), Object(__WEBPACK_IMPORTED_MODULE_6__lib__[\"C\" /* useTextAlignProp */])(textAlign), Object(__WEBPACK_IMPORTED_MODULE_6__lib__[\"F\" /* useWidthProp */])(itemsPerRow), 'cards', className);\n var rest = Object(__WEBPACK_IMPORTED_MODULE_6__lib__[\"q\" /* getUnhandledProps */])(CardGroup, props);\n var ElementType = Object(__WEBPACK_IMPORTED_MODULE_6__lib__[\"p\" /* getElementType */])(CardGroup, props);\n\n if (!__WEBPACK_IMPORTED_MODULE_6__lib__[\"d\" /* childrenUtils */].isNil(children)) {\n return __WEBPACK_IMPORTED_MODULE_5_react___default.a.createElement(\n ElementType,\n __WEBPACK_IMPORTED_MODULE_0_babel_runtime_helpers_extends___default()({}, rest, { className: classes }),\n children\n );\n }\n\n var content = __WEBPACK_IMPORTED_MODULE_2_lodash_map___default()(items, function (item) {\n var key = item.key || [item.header, item.description].join('-');\n return __WEBPACK_IMPORTED_MODULE_5_react___default.a.createElement(__WEBPACK_IMPORTED_MODULE_7__Card__[\"a\" /* default */], __WEBPACK_IMPORTED_MODULE_0_babel_runtime_helpers_extends___default()({ key: key }, item));\n });\n\n return __WEBPACK_IMPORTED_MODULE_5_react___default.a.createElement(\n ElementType,\n __WEBPACK_IMPORTED_MODULE_0_babel_runtime_helpers_extends___default()({}, rest, { className: classes }),\n content\n );\n}", "renderCell(renderData) {\n const me = this; // no need to run the code below if not grouping or of feature is disabled\n\n if (!me.store.isGrouped || me.disabled) {\n return;\n }\n\n const {\n cellElement,\n rowElement,\n column\n } = renderData,\n grid = me.grid,\n meta = renderData.record.meta,\n firstColumn = grid.columns.visibleColumns[0],\n firstSubGridColumns = grid.subGrids[grid.regions[0]].columns.visibleColumns;\n\n if ('groupRowFor' in meta) {\n // do nothing with action column to make possible using actions for groups\n if (column.type === 'action') {\n return;\n } // let column clear the cell, in case it needs to do some cleanup\n\n column.clearCell(cellElement); // this is a group row, add css classes\n // IE11 doesnt support this\n //rowElement.classList.toggle('b-grid-group-collapsed', meta.collapsed === undefined ? false : meta.collapsed);\n\n rowElement.classList[meta.collapsed ? 'add' : 'remove']('b-grid-group-collapsed');\n rowElement.classList.add('b-group-row');\n\n if (firstColumn.type === 'rownumber' && column === firstSubGridColumns[1] || firstColumn.type !== 'rownumber' && column === firstSubGridColumns[0]) {\n cellElement.classList.add('b-group-title');\n }\n\n me.buildGroupHeader(renderData);\n } else {\n // not a group row, remove css classes\n // TODO: use dom query to remove before render instead?\n if (cellElement === rowElement.firstElementChild) {\n // IE11 doesnt support this\n //rowElement.classList.remove('b-group-row', 'b-grid-group-collapsed');\n rowElement.classList.remove('b-group-row');\n rowElement.classList.remove('b-grid-group-collapsed');\n cellElement.classList.remove('b-group-title');\n }\n }\n }", "function BasicLinechartComponent(renderer) {\n this.renderer = renderer;\n /**\n * Input width of the component\n * Default value : 900\n */\n this.width = 900;\n /**\n * Input height of the compenent\n * Default value : 200\n */\n this.height = 200;\n /**\n * Input data array that the component display\n * Default value : []\n */\n this.data = [];\n /**\n * Input domain of the Axis Y\n * Works only for continuous values\n * Default value : [0,0]\n */\n this.domain = [0, 0];\n /**\n * Input speed of zoom between 0 and 1\n * Default value : 0.2\n */\n this.speedZoom = 0.2;\n /**\n * Input range of timestamp\n * Default value : [0,0]\n */\n this.range = [0, 0];\n /**\n * Output rangeChange that emit range\n */\n this.rangeChange = new i0.EventEmitter();\n /**\n * Input currentTime\n * Default value : 0\n */\n this.currentTime = 0;\n /**\n * Output currentTimeChange that emit currentTime\n */\n this.currentTimeChange = new i0.EventEmitter();\n /**\n * Title of the component\n */\n this.title = 'Timeline : ';\n /**\n * Margin of the component\n */\n this.margin = { top: 20, right: 20, bottom: 20, left: 50 }; //marge interne au svg \n /**\n * dataZoom is a copy of data with the range specify\n */\n this.dataZoom = [];\n /**\n * idZoom is the number of wheel notch\n */\n this.idZoom = 0;\n /**\n * It's the smallest timestamp of data\n */\n this.minTime = 0;\n /**\n * It's the biggest timestamp of data\n */\n this.maxTime = 0;\n /**\n * It's the difference between the smallest and the biggest\n */\n this.lengthTime = 0;\n /**\n * Width of the svg\n */\n this.svgWidth = 0;\n /**\n * Height of the svg\n */\n this.svgHeight = 0;\n /**\n * Scale of the X axis\n */\n this.scaleX = d3__namespace.scaleTime();\n /**\n * Scale of the Y axis\n */\n this.scaleY = d3__namespace.scaleLinear();\n /**\n * Array of area definition\n */\n this.area = [];\n /**\n * Array of line definition\n */\n this.line = [];\n /**\n * data length before the new change\n */\n this.lastDatalength = 0;\n /**\n * Mode of the tooltip\n */\n this.modeToolTips = \"normal\";\n /**\n * true if the currentTimeline is selected\n */\n this.currentTimeSelected = false;\n /**\n * true if the scrollbar is selected\n */\n this.scrollbarSelected = false;\n /**\n * Last position of the mouse\n */\n this.lastPos = 0;\n /**\n * true if the CTRL Key of keyBoard is push\n */\n this.zoomSelected = false;\n }", "function buildContainerGroups() {\n let container = svg\n .append('g')\n .classed('container-group', true)\n .attr('transform', `translate(${margin.left + yAxisPaddingBetweenChart}, ${margin.top-2})`);\n\n container\n .append('g').classed('grid-lines-group', true);\n\n container\n .append('g').classed('chart-group', true);\n\n // labels on the bottom\n container\n .append('g').classed('x-axis-group axis', true);\n\n // this is the labels on the left, and the line\n container\n .append('g')\n .attr('transform', `translate(${-1 * (yAxisPaddingBetweenChart)}, 0)`)\n .classed('y-axis-group axis', true);\n\n\n // the tooltip and also labels on the right\n container\n .append('g').classed('metadata-group', true);\n }", "function AbstractChartPainter() {\n\n}", "componentWillMount() {\n\n this.groups = {\n 'Date' : this.props.data.dimensions['_date'].object.group(d=> {\n const year = d.getFullYear()\n const month = d.getMonth()+1\n\n return year + '\\n' + ((month <= 9) ? '0' : '') + month\n }),\n 'Manager' : this.props.data.dimensions['Manager'].group(),\n 'Category' : this.props.data.dimensions['Category'].group(),\n 'Brand' : this.props.data.dimensions['Brand'].group(),\n 'Customer' : this.props.data.dimensions['Customer'].group(),\n 'Year' : this.props.data.dimensions['Year'].group()\n }\n\n this.componentWillReceiveProps(this.props)\n }", "function createChart(options){var data=Chartist.normalizeData(this.data,options.reverseData,true);// Create new svg object\nthis.svg=Chartist.createSvg(this.container,options.width,options.height,options.classNames.chart);// Create groups for labels, grid and series\nvar gridGroup=this.svg.elem('g').addClass(options.classNames.gridGroup);var seriesGroup=this.svg.elem('g');var labelGroup=this.svg.elem('g').addClass(options.classNames.labelGroup);var chartRect=Chartist.createChartRect(this.svg,options,defaultOptions.padding);var axisX,axisY;if(options.axisX.type===undefined){axisX=new Chartist.StepAxis(Chartist.Axis.units.x,data.normalized.series,chartRect,Chartist.extend({},options.axisX,{ticks:data.normalized.labels,stretch:options.fullWidth}));}else {axisX=options.axisX.type.call(Chartist,Chartist.Axis.units.x,data.normalized.series,chartRect,options.axisX);}if(options.axisY.type===undefined){axisY=new Chartist.AutoScaleAxis(Chartist.Axis.units.y,data.normalized.series,chartRect,Chartist.extend({},options.axisY,{high:Chartist.isNumeric(options.high)?options.high:options.axisY.high,low:Chartist.isNumeric(options.low)?options.low:options.axisY.low}));}else {axisY=options.axisY.type.call(Chartist,Chartist.Axis.units.y,data.normalized.series,chartRect,options.axisY);}axisX.createGridAndLabels(gridGroup,labelGroup,this.supportsForeignObject,options,this.eventEmitter);axisY.createGridAndLabels(gridGroup,labelGroup,this.supportsForeignObject,options,this.eventEmitter);if(options.showGridBackground){Chartist.createGridBackground(gridGroup,chartRect,options.classNames.gridBackground,this.eventEmitter);}// Draw the series\ndata.raw.series.forEach(function(series,seriesIndex){var seriesElement=seriesGroup.elem('g');// Write attributes to series group element. If series name or meta is undefined the attributes will not be written\nseriesElement.attr({'ct:series-name':series.name,'ct:meta':Chartist.serialize(series.meta)});// Use series class from series data or if not set generate one\nseriesElement.addClass([options.classNames.series,series.className||options.classNames.series+'-'+Chartist.alphaNumerate(seriesIndex)].join(' '));var pathCoordinates=[],pathData=[];data.normalized.series[seriesIndex].forEach(function(value,valueIndex){var p={x:chartRect.x1+axisX.projectValue(value,valueIndex,data.normalized.series[seriesIndex]),y:chartRect.y1-axisY.projectValue(value,valueIndex,data.normalized.series[seriesIndex])};pathCoordinates.push(p.x,p.y);pathData.push({value:value,valueIndex:valueIndex,meta:Chartist.getMetaData(series,valueIndex)});}.bind(this));var seriesOptions={lineSmooth:Chartist.getSeriesOption(series,options,'lineSmooth'),showPoint:Chartist.getSeriesOption(series,options,'showPoint'),showLine:Chartist.getSeriesOption(series,options,'showLine'),showArea:Chartist.getSeriesOption(series,options,'showArea'),areaBase:Chartist.getSeriesOption(series,options,'areaBase')};var smoothing=typeof seriesOptions.lineSmooth==='function'?seriesOptions.lineSmooth:seriesOptions.lineSmooth?Chartist.Interpolation.monotoneCubic():Chartist.Interpolation.none();// Interpolating path where pathData will be used to annotate each path element so we can trace back the original\n// index, value and meta data\nvar path=smoothing(pathCoordinates,pathData);// If we should show points we need to create them now to avoid secondary loop\n// Points are drawn from the pathElements returned by the interpolation function\n// Small offset for Firefox to render squares correctly\nif(seriesOptions.showPoint){path.pathElements.forEach(function(pathElement){var point=seriesElement.elem('line',{x1:pathElement.x,y1:pathElement.y,x2:pathElement.x+0.01,y2:pathElement.y},options.classNames.point).attr({'ct:value':[pathElement.data.value.x,pathElement.data.value.y].filter(Chartist.isNumeric).join(','),'ct:meta':Chartist.serialize(pathElement.data.meta)});this.eventEmitter.emit('draw',{type:'point',value:pathElement.data.value,index:pathElement.data.valueIndex,meta:pathElement.data.meta,series:series,seriesIndex:seriesIndex,axisX:axisX,axisY:axisY,group:seriesElement,element:point,x:pathElement.x,y:pathElement.y});}.bind(this));}if(seriesOptions.showLine){var line=seriesElement.elem('path',{d:path.stringify()},options.classNames.line,true);this.eventEmitter.emit('draw',{type:'line',values:data.normalized.series[seriesIndex],path:path.clone(),chartRect:chartRect,index:seriesIndex,series:series,seriesIndex:seriesIndex,seriesMeta:series.meta,axisX:axisX,axisY:axisY,group:seriesElement,element:line});}// Area currently only works with axes that support a range!\nif(seriesOptions.showArea&&axisY.range){// If areaBase is outside the chart area (< min or > max) we need to set it respectively so that\n// the area is not drawn outside the chart area.\nvar areaBase=Math.max(Math.min(seriesOptions.areaBase,axisY.range.max),axisY.range.min);// We project the areaBase value into screen coordinates\nvar areaBaseProjected=chartRect.y1-axisY.projectValue(areaBase);// In order to form the area we'll first split the path by move commands so we can chunk it up into segments\npath.splitByCommand('M').filter(function onlySolidSegments(pathSegment){// We filter only \"solid\" segments that contain more than one point. Otherwise there's no need for an area\nreturn pathSegment.pathElements.length>1;}).map(function convertToArea(solidPathSegments){// Receiving the filtered solid path segments we can now convert those segments into fill areas\nvar firstElement=solidPathSegments.pathElements[0];var lastElement=solidPathSegments.pathElements[solidPathSegments.pathElements.length-1];// Cloning the solid path segment with closing option and removing the first move command from the clone\n// We then insert a new move that should start at the area base and draw a straight line up or down\n// at the end of the path we add an additional straight line to the projected area base value\n// As the closing option is set our path will be automatically closed\nreturn solidPathSegments.clone(true).position(0).remove(1).move(firstElement.x,areaBaseProjected).line(firstElement.x,firstElement.y).position(solidPathSegments.pathElements.length+1).line(lastElement.x,areaBaseProjected);}).forEach(function createArea(areaPath){// For each of our newly created area paths, we'll now create path elements by stringifying our path objects\n// and adding the created DOM elements to the correct series group\nvar area=seriesElement.elem('path',{d:areaPath.stringify()},options.classNames.area,true);// Emit an event for each area that was drawn\nthis.eventEmitter.emit('draw',{type:'area',values:data.normalized.series[seriesIndex],path:areaPath.clone(),series:series,seriesIndex:seriesIndex,axisX:axisX,axisY:axisY,chartRect:chartRect,index:seriesIndex,group:seriesElement,element:area});}.bind(this));}}.bind(this));this.eventEmitter.emit('created',{bounds:axisY.bounds,chartRect:chartRect,axisX:axisX,axisY:axisY,svg:this.svg,options:options});}", "function ArrayGroup(arrayTypes) {\n var LayoutVertexArrayType = arrayTypes.layoutVertexArrayType;\n this.layoutVertexArray = new LayoutVertexArrayType();\n\n var ElementArrayType = arrayTypes.elementArrayType;\n if (ElementArrayType) this.elementArray = new ElementArrayType();\n\n var ElementArrayType2 = arrayTypes.elementArrayType2;\n if (ElementArrayType2) this.elementArray2 = new ElementArrayType2();\n\n this.paintVertexArrays = util.mapObject(arrayTypes.paintVertexArrayTypes, function (PaintVertexArrayType) {\n return new PaintVertexArrayType();\n });\n}", "addAxes () {\n }", "renderGroup(group) {\n let section = [];\n section.push(\n <View style={styles.groupDateRow} key={group.item[0]}>\n <Icon name=\"date-range\" type=\"MaterialIcons\" size={16} color=\"#fff\" />\n <Text style={styles.groupDate}>{group.item[0]}</Text>\n </View>\n );\n group.item[1].map((item, index) => {\n section.push(this.renderRow(item, index));\n });\n return section;\n }", "render() {\n\t\tvar layers = Object.keys(this.props.layers).map(function(layer_id, i) {\n\t\t\tvar layer = this.props.layers[layer_id];\n var style = \"info\";\n var active = (layer_id == this.state.active_layer);\n var glyphicon = (this.state.visible_layers.indexOf(layer_id) < 0) ? \"ban-circle\" : \"eye-open\";\n\n\t\t\treturn (\n\t\t\t\t<ListGroupItem\n\t\t\t\t\tdata-id={ i } key={ i }\n\t\t\t\t\tbsStyle={style} active={active}>\n <Button className=\"layer-visible-button\" bsSize=\"xsmall\" onClick={this.toggleLayerVisibility(layer_id).bind(this)}><Glyphicon glyph={glyphicon} /></Button>\n <span className=\"active-layer-clickable\" onClick={this.toggleLayerActive(layer_id).bind(this)}>{layer.layer_name}</span>\n <Button className=\"layer-delete-button\" bsSize=\"xsmall\" onClick={this.deleteLayer(layer_id).bind(this)}><Glyphicon glyph=\"glyphicon glyphicon-remove\" /></Button>\n\t\t\t\t</ListGroupItem>\n\t\t\t);\n\t\t}.bind(this));\n\n\t\treturn <ListGroup id=\"layers\">{ layers }</ListGroup>\n\t}", "function YunGroupLayout() {\n go.Layout.call(this);\n // go.GridLayout.call(this);\n // this.cellSize = new go.Size(1, 1);\n // this.wrappingColumn = Infinity;\n // this.wrappingWidth = Infinity;\n // this.spacing = new go.Size(0, 0);\n // this.alignment = go.GridLayout.Position;\n}", "function YunGroupLayout() {\n go.Layout.call(this);\n // go.GridLayout.call(this);\n // this.cellSize = new go.Size(1, 1);\n // this.wrappingColumn = Infinity;\n // this.wrappingWidth = Infinity;\n // this.spacing = new go.Size(0, 0);\n // this.alignment = go.GridLayout.Position;\n}", "pieTemplate1() {\n const pieData = [\n { 'x': 'Chrome', y: 37, text: '37%' },\n { 'x': 'UC Browser', y: 17, text: '17%' },\n { 'x': 'iPhone', y: 19, text: '19%' },\n { 'x': 'Others', y: 4, text: '4%' },\n { 'x': 'Opera', y: 11, text: '11%' },\n { 'x': 'Android', y: 12, text: '12%' }\n ];\n const dataLabel = { visible: true, position: 'Inside', name: 'text', font: { fontWeight: '600' } };\n const enableAnimation = false;\n return (<div className=\"template\">\n <AccumulationChartComponent style={{ \"height\": \"162px\" }} enableAnimation={enableAnimation} legendSettings={{ visible: false }} tooltip={{ enable: true, format: `${10} : <b>${10}%</b>` }}>\n <Inject services={[AccumulationTooltip]}/>\n <AccumulationSeriesCollectionDirective>\n <AccumulationSeriesDirective dataSource={pieData} dataLabel={dataLabel} xName='x' yName='y' radius=\"70%\" name='Browser'/>\n </AccumulationSeriesCollectionDirective>\n </AccumulationChartComponent>\n </div>);\n }", "function Group2D(settings){var _this=this;if(settings==null){settings={};}if(settings.origin==null){settings.origin=new BABYLON.Vector2(0,0);}_this=_super.call(this,settings)||this;var size=!settings.size&&!settings.width&&!settings.height?null:settings.size||new BABYLON.Size(settings.width||0,settings.height||0);if(!(_this instanceof BABYLON.WorldSpaceCanvas2D)){_this._trackedNode=settings.trackNode==null?null:settings.trackNode;_this._trackedNodeOffset=settings.trackNodeOffset==null?null:settings.trackNodeOffset;if(_this._trackedNode&&_this.owner){_this.owner._registerTrackedNode(_this);}}_this._cacheBehavior=settings.cacheBehavior==null?Group2D_1.GROUPCACHEBEHAVIOR_FOLLOWCACHESTRATEGY:settings.cacheBehavior;var rd=_this._renderableData;if(rd){rd._noResizeOnScale=(_this.cacheBehavior&Group2D_1.GROUPCACHEBEHAVIOR_NORESIZEONSCALE)!==0;}_this.size=size;_this._viewportPosition=BABYLON.Vector2.Zero();_this._viewportSize=BABYLON.Size.Zero();return _this;}", "function DecorationGroup(groupId, groupName) {\n var items = [];\n var lastItemId = 0;\n var container = null;\n var activable = false;\n\n function isActivable() {\n return activable;\n }\n\n function setActivable() {\n activable = true;\n }\n\n /**\n * Adds a new decoration to the group.\n */\n function add(decoration) {\n let id = groupId + \"-\" + lastItemId++;\n\n let range = (0,_utils__WEBPACK_IMPORTED_MODULE_1__.rangeFromLocator)(decoration.locator);\n if (!range) {\n (0,_utils__WEBPACK_IMPORTED_MODULE_1__.log)(\"Can't locate DOM range for decoration\", decoration);\n return;\n }\n\n let item = { id, decoration, range };\n items.push(item);\n layout(item);\n }\n\n /**\n * Removes the decoration with given ID from the group.\n */\n function remove(decorationId) {\n let index = items.findIndex((i) => i.decoration.id === decorationId);\n if (index === -1) {\n return;\n }\n\n let item = items[index];\n items.splice(index, 1);\n item.clickableElements = null;\n if (item.container) {\n item.container.remove();\n item.container = null;\n }\n }\n\n /**\n * Notifies that the given decoration was modified and needs to be updated.\n */\n function update(decoration) {\n remove(decoration.id);\n add(decoration);\n }\n\n /**\n * Removes all decorations from this group.\n */\n function clear() {\n clearContainer();\n items.length = 0;\n }\n\n /**\n * Recreates the decoration elements.\n *\n * To be called after reflowing the resource, for example.\n */\n function requestLayout() {\n clearContainer();\n items.forEach((item) => layout(item));\n }\n\n /**\n * Layouts a single Decoration item.\n */\n function layout(item) {\n let groupContainer = requireContainer();\n\n let style = styles.get(item.decoration.style);\n if (!style) {\n (0,_utils__WEBPACK_IMPORTED_MODULE_1__.logErrorMessage)(`Unknown decoration style: ${item.decoration.style}`);\n return;\n }\n\n let itemContainer = document.createElement(\"div\");\n itemContainer.setAttribute(\"id\", item.id);\n itemContainer.setAttribute(\"data-style\", item.decoration.style);\n itemContainer.style.setProperty(\"pointer-events\", \"none\");\n\n let viewportWidth = window.innerWidth;\n let columnCount = parseInt(\n getComputedStyle(document.documentElement).getPropertyValue(\n \"column-count\"\n )\n );\n let pageWidth = viewportWidth / (columnCount || 1);\n let scrollingElement = document.scrollingElement;\n let xOffset = scrollingElement.scrollLeft;\n let yOffset = scrollingElement.scrollTop;\n\n function positionElement(element, rect, boundingRect) {\n element.style.position = \"absolute\";\n\n if (style.width === \"wrap\") {\n element.style.width = `${rect.width}px`;\n element.style.height = `${rect.height}px`;\n element.style.left = `${rect.left + xOffset}px`;\n element.style.top = `${rect.top + yOffset}px`;\n } else if (style.width === \"viewport\") {\n element.style.width = `${viewportWidth}px`;\n element.style.height = `${rect.height}px`;\n let left = Math.floor(rect.left / viewportWidth) * viewportWidth;\n element.style.left = `${left + xOffset}px`;\n element.style.top = `${rect.top + yOffset}px`;\n } else if (style.width === \"bounds\") {\n element.style.width = `${boundingRect.width}px`;\n element.style.height = `${rect.height}px`;\n element.style.left = `${boundingRect.left + xOffset}px`;\n element.style.top = `${rect.top + yOffset}px`;\n } else if (style.width === \"page\") {\n element.style.width = `${pageWidth}px`;\n element.style.height = `${rect.height}px`;\n let left = Math.floor(rect.left / pageWidth) * pageWidth;\n element.style.left = `${left + xOffset}px`;\n element.style.top = `${rect.top + yOffset}px`;\n }\n }\n\n let boundingRect = item.range.getBoundingClientRect();\n\n let elementTemplate;\n try {\n let template = document.createElement(\"template\");\n template.innerHTML = item.decoration.element.trim();\n elementTemplate = template.content.firstElementChild;\n } catch (error) {\n (0,_utils__WEBPACK_IMPORTED_MODULE_1__.logErrorMessage)(\n `Invalid decoration element \"${item.decoration.element}\": ${error.message}`\n );\n return;\n }\n\n if (style.layout === \"boxes\") {\n let doNotMergeHorizontallyAlignedRects = true;\n let clientRects = (0,_rect__WEBPACK_IMPORTED_MODULE_0__.getClientRectsNoOverlap)(\n item.range,\n doNotMergeHorizontallyAlignedRects\n );\n\n clientRects = clientRects.sort((r1, r2) => {\n if (r1.top < r2.top) {\n return -1;\n } else if (r1.top > r2.top) {\n return 1;\n } else {\n return 0;\n }\n });\n\n for (let clientRect of clientRects) {\n const line = elementTemplate.cloneNode(true);\n line.style.setProperty(\"pointer-events\", \"none\");\n positionElement(line, clientRect, boundingRect);\n itemContainer.append(line);\n }\n } else if (style.layout === \"bounds\") {\n const bounds = elementTemplate.cloneNode(true);\n bounds.style.setProperty(\"pointer-events\", \"none\");\n positionElement(bounds, boundingRect, boundingRect);\n\n itemContainer.append(bounds);\n }\n\n groupContainer.append(itemContainer);\n item.container = itemContainer;\n item.clickableElements = Array.from(\n itemContainer.querySelectorAll(\"[data-activable='1']\")\n );\n if (item.clickableElements.length === 0) {\n item.clickableElements = Array.from(itemContainer.children);\n }\n }\n\n /**\n * Returns the group container element, after making sure it exists.\n */\n function requireContainer() {\n if (!container) {\n container = document.createElement(\"div\");\n container.setAttribute(\"id\", groupId);\n container.setAttribute(\"data-group\", groupName);\n container.style.setProperty(\"pointer-events\", \"none\");\n document.body.append(container);\n }\n return container;\n }\n\n /**\n * Removes the group container.\n */\n function clearContainer() {\n if (container) {\n container.remove();\n container = null;\n }\n }\n\n return {\n add,\n remove,\n update,\n clear,\n items,\n requestLayout,\n isActivable,\n setActivable,\n };\n}", "function ArrayGroup(arrayTypes) {\n\t var LayoutVertexArrayType = arrayTypes.layoutVertexArrayType;\n\t this.layoutVertexArray = new LayoutVertexArrayType();\n\t\n\t var ElementArrayType = arrayTypes.elementArrayType;\n\t if (ElementArrayType) this.elementArray = new ElementArrayType();\n\t\n\t var ElementArrayType2 = arrayTypes.elementArrayType2;\n\t if (ElementArrayType2) this.elementArray2 = new ElementArrayType2();\n\t\n\t this.paintVertexArrays = util.mapObject(arrayTypes.paintVertexArrayTypes, function (PaintVertexArrayType) {\n\t return new PaintVertexArrayType();\n\t });\n\t}", "function CardGroup(props) {\n var centered = props.centered,\n children = props.children,\n className = props.className,\n content = props.content,\n doubling = props.doubling,\n items = props.items,\n itemsPerRow = props.itemsPerRow,\n stackable = props.stackable,\n textAlign = props.textAlign;\n var classes = Object(clsx__WEBPACK_IMPORTED_MODULE_3__[\"default\"])('ui', Object(_lib__WEBPACK_IMPORTED_MODULE_6__[\"useKeyOnly\"])(centered, 'centered'), Object(_lib__WEBPACK_IMPORTED_MODULE_6__[\"useKeyOnly\"])(doubling, 'doubling'), Object(_lib__WEBPACK_IMPORTED_MODULE_6__[\"useKeyOnly\"])(stackable, 'stackable'), Object(_lib__WEBPACK_IMPORTED_MODULE_6__[\"useTextAlignProp\"])(textAlign), Object(_lib__WEBPACK_IMPORTED_MODULE_6__[\"useWidthProp\"])(itemsPerRow), 'cards', className);\n var rest = Object(_lib__WEBPACK_IMPORTED_MODULE_6__[\"getUnhandledProps\"])(CardGroup, props);\n var ElementType = Object(_lib__WEBPACK_IMPORTED_MODULE_6__[\"getElementType\"])(CardGroup, props);\n\n if (!_lib__WEBPACK_IMPORTED_MODULE_6__[\"childrenUtils\"].isNil(children)) {\n return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_5___default.a.createElement(ElementType, Object(_babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_0__[\"default\"])({}, rest, {\n className: classes\n }), children);\n }\n\n if (!_lib__WEBPACK_IMPORTED_MODULE_6__[\"childrenUtils\"].isNil(content)) {\n return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_5___default.a.createElement(ElementType, Object(_babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_0__[\"default\"])({}, rest, {\n className: classes\n }), content);\n }\n\n var itemsJSX = Object(lodash_es_map__WEBPACK_IMPORTED_MODULE_2__[\"default\"])(items, function (item) {\n var key = item.key || [item.header, item.description].join('-');\n return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_5___default.a.createElement(_Card__WEBPACK_IMPORTED_MODULE_7__[\"default\"], Object(_babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_0__[\"default\"])({\n key: key\n }, item));\n });\n\n return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_5___default.a.createElement(ElementType, Object(_babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_0__[\"default\"])({}, rest, {\n className: classes\n }), itemsJSX);\n}", "getOptions() {\n let grids = []\n let xAxies = []\n let yAxies = []\n let series = []\n \n let sampleRate = store.getState().sampleRate\n let keysArray = Object.keys(this.state.eegData)\n // Remove deleted keys\n keysArray = keysArray.filter((key) => {\n return !this.removedAxies.includes(key);\n });\n\n // Layout configuration\n function generateGridTops(grid_height, num_grids) {\n // Returns an array of the top value for each\n // grid to be represented by keysArray\n let padding = 4\n let render_limits = [0+padding, 100-padding]\n let jump_width = (100 - 2*padding) / num_grids\n var list = [];\n for (var i = render_limits[0]; i <= render_limits[1]; i += jump_width) {\n let adjusted_top = i - (grid_height / 2) \n list.push(Math.ceil(adjusted_top));\n }\n return list\n }\n let height = 40\n let topsList = generateGridTops(height, keysArray.length)\n\n keysArray.forEach((key) => {\n let i = keysArray.indexOf(key)\n let grid_top = topsList[i] + \"%\"\n\n grids.push({\n id: key,\n left: '10%',\n right: '2%',\n top: grid_top,\n height: height + \"%\",\n show: true,\n name: key,\n tooltip: {\n show: false,\n trigger: 'axis',\n showDelay: 25\n },\n containLabel: false, // Help grids aligned by axis\n borderWidth: 0\n })\n\n xAxies.push({\n id: key,\n name: key,\n // Index of data as categories, for now\n data: [...Array(this.state.eegData[key].length).keys()],\n type: 'category',\n gridIndex: i,\n showGrid: false,\n axisTick: {\n show: false,\n },\n axisLabel: {\n show: (i == keysArray.length - 1), // Only show on last grid\n interval: sampleRate - 1,\n formatter: (value, index) => {\n return (this.bufferStartIndex + parseInt(value)) / sampleRate\n }\n },\n axisLine: {\n show: false,\n },\n splitLine: {\n show: true,\n interval: sampleRate - 1,\n },\n // Trigger event means you can click on name to register event\n triggerEvent: true,\n nameLocation: 'start',\n })\n\n // let scaleMax = new MyMaths().roundToNextDigit(Math.max(...this.state.eegData[key]))\n let scaleMax = 1\n let scaleMin = -scaleMax\n\n yAxies.push({\n id: key,\n type: 'value',\n gridIndex: i,\n axisLabel: {\n show: false,\n },\n axisLine: {\n show: false,\n },\n splitLine: {\n show: false,\n },\n showGrid: false,\n // Programatically scale min/max\n min: scaleMin,\n max: scaleMax\n })\n\n // Add a line config to series object\n series.push({\n name: key,\n type: 'line',\n symbol: 'none',\n lineStyle: {\n width: 0.5,\n color: 'black',\n },\n gridIndex: i,\n yAxisIndex: i,\n xAxisIndex: i,\n smooth: false,\n sampling: 'lttb',\n\n data: this.state.eegData[key],\n })\n })\n\n /**\n * Configure backsplash grid for highlights and such\n * Adds a grid at backsplashGridIndex that takes full height\n * Adds an xAxis identical to the others\n * Adds a series of 0s meant to be undisplayed,\n * just for markAreas to be applied to\n */\n let timestampFormatter = (value) => {\n let secs = ((value + this.bufferStartIndex) / sampleRate) + this.time_adjustment_secs\n var date = new Date(0);\n date.setSeconds(secs);\n return date.toISOString().substr(11, 8);\n }\n\n this.backsplashGridIndex = keysArray.length\n let backsplashGridIndex = this.backsplashGridIndex\n let configureBacksplashGrid = () => {\n if (backsplashGridIndex == 0) {\n // Catch before data loads in\n return\n }\n let arbitraryKey = keysArray[0]\n\n grids.push({\n left: '10%',\n right: '4%',\n top: '0%',\n bottom: '4%',\n show: false,\n containLabel: false, // Help grids aligned by axis\n })\n yAxies.push({\n type: 'value',\n gridIndex: backsplashGridIndex,\n axisLabel: {\n show: false,\n },\n axisLine: {\n show: false,\n },\n splitLine: {\n show: false,\n },\n showGrid: false,\n min: -1e-3,\n max: 1e-3,\n })\n xAxies.push({\n // Index of data as categories, for now\n data: [...Array(this.state.eegData[arbitraryKey].length).keys()],\n type: 'category',\n gridIndex: backsplashGridIndex,\n showGrid: false,\n axisTick: {\n show: false,\n },\n axisLabel: {\n show: true,\n interval: sampleRate - 1,\n formatter: (value, index) => {\n return timestampFormatter(value)\n }\n },\n axisLine: {\n show: false,\n },\n })\n series.push({\n type: 'line',\n symbol: 'none',\n lineStyle: {\n width: 0,\n color: '#00000000',\n },\n gridIndex: backsplashGridIndex,\n yAxisIndex: backsplashGridIndex,\n xAxisIndex: backsplashGridIndex,\n sampling: 'lttb',\n \n name: 'backSplashSeries',\n \n data: new Array(this.state.eegData[arbitraryKey].length).fill(0),\n })\n }\n configureBacksplashGrid()\n\n /**\n * \n * The actual configuration for the chart\n * Loads in all of the previously filled grids, xAxies, yAxies, and series\n * \n */\n let options = {\n // Use the values configured above\n grid: grids,\n xAxis: xAxies,\n yAxis: yAxies,\n series: series,\n\n // Other Configuration options\n animation: false,\n\n tooltip: {\n show: false,\n },\n\n // toolbox hidden\n toolbox: {\n orient: 'vertical',\n show: false,\n },\n\n // Brush allows for selection that gets turned into markAreas\n brush: {\n toolbox: ['lineX', 'keep'],\n xAxisIndex: backsplashGridIndex\n },\n\n dataZoom: [\n {\n show: false,\n xAxisIndex: Object.keys(series),\n type: 'slider',\n bottom: '2%',\n startValue: this.dz_start,\n endValue: this.dz_end,\n preventDefaultMouseMove: true,\n\n zoomOnMouseWheel: false,\n moveOnMouseWheel: false,\n moveOnMouseMove: false,\n },\n {\n yAxisIndex: Object.keys(series),\n type: 'slider',\n top: '45%',\n filterMode: 'none',\n show: false,\n\n zoomOnMouseWheel: false,\n moveOnMouseWheel: false,\n moveOnMouseMove: false,\n\n id: 'eegGain',\n start: 50 - this.yZoom,\n end: 50 + this.yZoom,\n },{\n type: 'inside',\n yAxisIndex: Object.keys(series),\n\n zoomOnMouseWheel: false,\n moveOnMouseWheel: false,\n moveOnMouseMove: false,\n }\n ],\n }\n\n return options\n }", "createAxes () {\n }", "componentWillReceiveProps(nextProps) {\n let allGroups = [];\n let allLayers = this.state.allLayers;\n const nextLayers = allLayers[nextProps.group.value];\n if (nextProps.sortAlpha !== this.props.sortAlpha) {\n this.sortLayers(this.state.layers, nextProps.sortAlpha);\n }\n\n if (nextProps.group.value !== this.props.group.value) {\n const layers = this.state.allLayers[this.props.group.value];\n if (layers !== undefined) {\n // DISABLE LAYER VISIBILITY FROM PREVIOUS GROUP\n TOCHelpers.disableLayersVisiblity(layers, newLayers => {\n allLayers[this.props.group.value] = newLayers;\n this.setState({ allLayers: allLayers }, () => {\n // ENABLE LAYER VISIBILITY FROM PREVIOUS GROUP\n\n if (nextLayers !== undefined) {\n TOCHelpers.enableLayersVisiblity(nextLayers, newLayers => {\n let allLayers = this.state.allLayers;\n allLayers[nextProps.group.value] = newLayers;\n this.setState({ layers: newLayers, allLayers: allLayers, allGroups: allGroups }, () => {\n this.refreshLayers(nextProps.group, nextProps.sortAlpha, nextProps.allGroups);\n });\n });\n } else {\n this.refreshLayers(nextProps.group, nextProps.sortAlpha, nextProps.allGroups);\n }\n });\n });\n } else this.refreshLayers(nextProps.group, nextProps.sortAlpha, nextProps.allGroups);\n }\n }", "render() {\n\n\n return (\n <section className=\"chart\">\n\n <div className=\"chart-contain\">\n <Line\n width={550}\n\t height={300}\n \tdata={this.state.chartData}\n \toptions={{title:{display:true, text:\"Closing Prices of Each Month for the Past Year\", fontSize: 20}, legend:{display: true, position: 'bottom'}}}\n redraw\n />\n </div>\n\n </section>\n );\n }", "function makeOverlayLyrGroups() {\r\n\r\n for (var key in lyrGroups) {\r\n // create the ardLayer\r\n map.doubleClickZoom.disable();\r\n\r\n function style(feature) { // this is the styling for the ARD grid\r\n return {\r\n //weight: 2,\r\n opacity: 1,\r\n color: '#51b9ff',\r\n dashArray: '1,1,1',\r\n fillOpacity: 0.0,\r\n fillColor: '#ffffff'\r\n };\r\n }\r\n\r\n function highlightFeature(e) {\r\n var layer = e.target;\r\n layer.setStyle({\r\n weight: 5,\r\n color: '#666',\r\n dashArray: '',\r\n fillOpacity: 0.7\r\n });\r\n if (!L.Browser.ie && !L.Browser.opera && !L.Browser.edge) {\r\n layer.bringToFront();\r\n }\r\n\r\n }\r\n\r\n var ardLayer;\r\n\r\n function markFeature(e) { // this is the style for that show if a tile is selected.\r\n\r\n a = 2;\r\n var layer = e.target;\r\n layer.setStyle({\r\n weight: 7,\r\n \r\n dashArray: '',\r\n fillOpacity: 0.7\r\n });\r\n if (!L.Browser.ie && !L.Browser.opera && !L.Browser.edge) { // this brings styling to the front\r\n layer.bringToFront();\r\n }\r\n // information for the dataListcontrol function\r\n dataListControl(e, a)\r\n\r\n //$(\".hvcount\").remove()\r\n //$('#download').append(\"<span class='hvcount'> \"+hvlist.length+\" selected</span>\")\r\n\r\n\r\n }\r\n\r\n function resetHighlight(e) { // resets the the style when the tile is unselected\r\n ardLayer.resetStyle(e.target);\r\n a = 1; // information for the dataListcontrol function\r\n dataListControl(e, a)\r\n //$(\".hvcount\").remove()\r\n //$('#download').append(\"<span class='hvcount'> \"+hvlist.length+\" selected</span>\")\r\n }\r\n\r\n\r\n function dataListControl(e, a) {\r\n var e_info = e.target.label; // gets the the <pre>h00v00</pre>\r\n if (a === 2) {\r\n hvlist.push(e_info); // adds the e_info to the hvlist list\r\n hvlist.filter(function (value, index) {\r\n return hvlist.indexOf(value) == index\r\n }); // removes any double values\r\n } else if (a === 1) {\r\n for (p in hvlist) {\r\n if (e_info === hvlist[p]) {\r\n hvlist.splice(hvlist.indexOf(hvlist[p]), 1); // removes a value from hvList if unselected\r\n } else {\r\n // nothing\r\n }\r\n }\r\n }\r\n\r\n if (hvlist.length < 1) {\r\n $('#download').removeClass('w3-green').addClass('w3-grey').css('cursor', 'not-allowed').text('Select Tile(s)')\r\n } else {\r\n $('#download').removeClass('w3-grey').addClass('w3-green').css('cursor', 'pointer').text(\"Download: \" + hvlist.length + \" tile(s)\")\r\n }\r\n return hvlist\r\n }\r\n\r\n function onEachFeature(feature, layer) {\r\n //layer.bindTooltip(feature.properties.name, {permanent: true, direction: 'center'})//.openTooltip();\r\n //layer.bindPopup('<pre>'+JSON.stringify(feature.properties,null,' ').replace(/[\\{\\}\"]/g,'')+'</pre>');\r\n // //layer.bindPopup(label);\r\n\r\n layer['label'] = '<pre>' + JSON.stringify(feature.properties.ARD_tile, null, ' ').replace(/[\\{\\}\"]/g, '') + '</pre>';\r\n\r\n //layer.on({mouseover: highlightFeature});//high ligths layer when mouse is over it\r\n\r\n //layer.on({mouseout: resetHighlight});\r\n\r\n\r\n layer.on({dblclick: markFeature});\r\n\r\n layer.on({click: resetHighlight});\r\n }\r\n\r\n var ardLayer = L.geoJSON(ard, {\r\n style: style,\r\n onEachFeature: onEachFeature\r\n });\r\n overlays.ard.maps[key] = {'layer': ardLayer}\r\n }\r\n\r\n}", "display_group_all() {\n this.hide_labels();\n this.force.gravity(this.layout_gravity)\n .charge(this.charge)\n .friction(0.9)\n .on(\"tick\", e => {\n return this.circles.each(this.move_towards_center(e.alpha))\n .attr(\"cx\", d => d.x)\n .attr(\"cy\", d => d.y);\n });\n return this.force.start();\n }", "get group(){ return this.__group; }", "function ButtonGroup(props) {\n var attached = props.attached,\n basic = props.basic,\n children = props.children,\n className = props.className,\n color = props.color,\n compact = props.compact,\n floated = props.floated,\n fluid = props.fluid,\n icon = props.icon,\n inverted = props.inverted,\n labeled = props.labeled,\n negative = props.negative,\n positive = props.positive,\n primary = props.primary,\n secondary = props.secondary,\n size = props.size,\n toggle = props.toggle,\n vertical = props.vertical,\n widths = props.widths;\n\n\n var classes = __WEBPACK_IMPORTED_MODULE_1_classnames___default()('ui', color, size, __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_3__lib__[\"a\" /* useKeyOnly */])(basic, 'basic'), __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_3__lib__[\"a\" /* useKeyOnly */])(compact, 'compact'), __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_3__lib__[\"a\" /* useKeyOnly */])(fluid, 'fluid'), __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_3__lib__[\"a\" /* useKeyOnly */])(icon, 'icon'), __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_3__lib__[\"a\" /* useKeyOnly */])(inverted, 'inverted'), __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_3__lib__[\"a\" /* useKeyOnly */])(labeled, 'labeled'), __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_3__lib__[\"a\" /* useKeyOnly */])(negative, 'negative'), __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_3__lib__[\"a\" /* useKeyOnly */])(positive, 'positive'), __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_3__lib__[\"a\" /* useKeyOnly */])(primary, 'primary'), __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_3__lib__[\"a\" /* useKeyOnly */])(secondary, 'secondary'), __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_3__lib__[\"a\" /* useKeyOnly */])(toggle, 'toggle'), __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_3__lib__[\"a\" /* useKeyOnly */])(vertical, 'vertical'), __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_3__lib__[\"h\" /* useValueAndKey */])(attached, 'attached'), __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_3__lib__[\"h\" /* useValueAndKey */])(floated, 'floated'), __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_3__lib__[\"f\" /* useWidthProp */])(widths), 'buttons', className);\n var rest = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_3__lib__[\"b\" /* getUnhandledProps */])(ButtonGroup, props);\n var ElementType = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_3__lib__[\"c\" /* getElementType */])(ButtonGroup, props);\n\n return __WEBPACK_IMPORTED_MODULE_2_react___default.a.createElement(\n ElementType,\n __WEBPACK_IMPORTED_MODULE_0_babel_runtime_helpers_extends___default()({}, rest, { className: classes }),\n children\n );\n}", "get [Symbol.toStringTag]() {\n return 'GroupedList';\n }", "function CardGroup(props) {\n var centered = props.centered,\n children = props.children,\n className = props.className,\n content = props.content,\n doubling = props.doubling,\n items = props.items,\n itemsPerRow = props.itemsPerRow,\n stackable = props.stackable,\n textAlign = props.textAlign;\n var classes = classnames__WEBPACK_IMPORTED_MODULE_3___default()('ui', Object(_lib__WEBPACK_IMPORTED_MODULE_6__[\"useKeyOnly\"])(centered, 'centered'), Object(_lib__WEBPACK_IMPORTED_MODULE_6__[\"useKeyOnly\"])(doubling, 'doubling'), Object(_lib__WEBPACK_IMPORTED_MODULE_6__[\"useKeyOnly\"])(stackable, 'stackable'), Object(_lib__WEBPACK_IMPORTED_MODULE_6__[\"useTextAlignProp\"])(textAlign), Object(_lib__WEBPACK_IMPORTED_MODULE_6__[\"useWidthProp\"])(itemsPerRow), 'cards', className);\n var rest = Object(_lib__WEBPACK_IMPORTED_MODULE_6__[\"getUnhandledProps\"])(CardGroup, props);\n var ElementType = Object(_lib__WEBPACK_IMPORTED_MODULE_6__[\"getElementType\"])(CardGroup, props);\n\n if (!_lib__WEBPACK_IMPORTED_MODULE_6__[\"childrenUtils\"].isNil(children)) {\n return react__WEBPACK_IMPORTED_MODULE_5___default.a.createElement(ElementType, _babel_runtime_helpers_extends__WEBPACK_IMPORTED_MODULE_0___default()({}, rest, {\n className: classes\n }), children);\n }\n\n if (!_lib__WEBPACK_IMPORTED_MODULE_6__[\"childrenUtils\"].isNil(content)) {\n return react__WEBPACK_IMPORTED_MODULE_5___default.a.createElement(ElementType, _babel_runtime_helpers_extends__WEBPACK_IMPORTED_MODULE_0___default()({}, rest, {\n className: classes\n }), content);\n }\n\n var itemsJSX = lodash_map__WEBPACK_IMPORTED_MODULE_2___default()(items, function (item) {\n var key = item.key || [item.header, item.description].join('-');\n return react__WEBPACK_IMPORTED_MODULE_5___default.a.createElement(_Card__WEBPACK_IMPORTED_MODULE_7__[\"default\"], _babel_runtime_helpers_extends__WEBPACK_IMPORTED_MODULE_0___default()({\n key: key\n }, item));\n });\n\n return react__WEBPACK_IMPORTED_MODULE_5___default.a.createElement(ElementType, _babel_runtime_helpers_extends__WEBPACK_IMPORTED_MODULE_0___default()({}, rest, {\n className: classes\n }), itemsJSX);\n}", "function CardGroup(props) {\n var centered = props.centered,\n children = props.children,\n className = props.className,\n content = props.content,\n doubling = props.doubling,\n items = props.items,\n itemsPerRow = props.itemsPerRow,\n stackable = props.stackable,\n textAlign = props.textAlign;\n var classes = classnames__WEBPACK_IMPORTED_MODULE_3___default()('ui', Object(_lib__WEBPACK_IMPORTED_MODULE_6__[\"useKeyOnly\"])(centered, 'centered'), Object(_lib__WEBPACK_IMPORTED_MODULE_6__[\"useKeyOnly\"])(doubling, 'doubling'), Object(_lib__WEBPACK_IMPORTED_MODULE_6__[\"useKeyOnly\"])(stackable, 'stackable'), Object(_lib__WEBPACK_IMPORTED_MODULE_6__[\"useTextAlignProp\"])(textAlign), Object(_lib__WEBPACK_IMPORTED_MODULE_6__[\"useWidthProp\"])(itemsPerRow), 'cards', className);\n var rest = Object(_lib__WEBPACK_IMPORTED_MODULE_6__[\"getUnhandledProps\"])(CardGroup, props);\n var ElementType = Object(_lib__WEBPACK_IMPORTED_MODULE_6__[\"getElementType\"])(CardGroup, props);\n\n if (!_lib__WEBPACK_IMPORTED_MODULE_6__[\"childrenUtils\"].isNil(children)) {\n return react__WEBPACK_IMPORTED_MODULE_5___default.a.createElement(ElementType, _babel_runtime_helpers_extends__WEBPACK_IMPORTED_MODULE_0___default()({}, rest, {\n className: classes\n }), children);\n }\n\n if (!_lib__WEBPACK_IMPORTED_MODULE_6__[\"childrenUtils\"].isNil(content)) {\n return react__WEBPACK_IMPORTED_MODULE_5___default.a.createElement(ElementType, _babel_runtime_helpers_extends__WEBPACK_IMPORTED_MODULE_0___default()({}, rest, {\n className: classes\n }), content);\n }\n\n var itemsJSX = lodash_map__WEBPACK_IMPORTED_MODULE_2___default()(items, function (item) {\n var key = item.key || [item.header, item.description].join('-');\n return react__WEBPACK_IMPORTED_MODULE_5___default.a.createElement(_Card__WEBPACK_IMPORTED_MODULE_7__[\"default\"], _babel_runtime_helpers_extends__WEBPACK_IMPORTED_MODULE_0___default()({\n key: key\n }, item));\n });\n\n return react__WEBPACK_IMPORTED_MODULE_5___default.a.createElement(ElementType, _babel_runtime_helpers_extends__WEBPACK_IMPORTED_MODULE_0___default()({}, rest, {\n className: classes\n }), itemsJSX);\n}", "function Layer() {\n return {\n name: 'layer',\n template: __WEBPACK_IMPORTED_MODULE_1__layer_ejs___default()({\n name: '模板',\n arr: ['oppop', 'iphone', 'HUAWEI']\n })\n };\n}", "renderHeader(headerContainerElement) {\n const {\n store,\n grid\n } = this;\n\n if (store.isGrouped) {\n // Sorted from start, reflect in rendering\n for (const groupInfo of store.groupers) {\n // Might be grouping by field without column, which is valid\n const column = grid.columns.get(groupInfo.field),\n header = column && grid.getHeaderElement(column.id); // IE11 doesnt support this\n //header && header.classList.add('b-group', groupInfo.ascending ? 'b-asc' : 'b-desc');\n\n if (header) {\n header.classList.add('b-group');\n header.classList.add(groupInfo.ascending ? 'b-asc' : 'b-desc');\n }\n }\n }\n }", "function ArrayGroup(arrayTypes) {\n\t var LayoutVertexArrayType = arrayTypes.layoutVertexArrayType;\n\t this.layoutVertexArray = new LayoutVertexArrayType();\n\n\t var ElementArrayType = arrayTypes.elementArrayType;\n\t if (ElementArrayType) this.elementArray = new ElementArrayType();\n\n\t var ElementArrayType2 = arrayTypes.elementArrayType2;\n\t if (ElementArrayType2) this.elementArray2 = new ElementArrayType2();\n\n\t this.paintVertexArrays = util.mapObject(arrayTypes.paintVertexArrayTypes, function (PaintVertexArrayType) {\n\t return new PaintVertexArrayType();\n\t });\n\t}", "function App() {\n return (\n <div>\n <Dummy/>\n {/* <MyChart/> */}\n <ChartJsTest/>\n <Avg />\n </div>\n );\n}", "function ButtonGroup(props) {\n var attached = props.attached,\n basic = props.basic,\n children = props.children,\n className = props.className,\n color = props.color,\n compact = props.compact,\n floated = props.floated,\n fluid = props.fluid,\n icon = props.icon,\n inverted = props.inverted,\n labeled = props.labeled,\n negative = props.negative,\n positive = props.positive,\n primary = props.primary,\n secondary = props.secondary,\n size = props.size,\n toggle = props.toggle,\n vertical = props.vertical,\n widths = props.widths;\n\n\n var classes = __WEBPACK_IMPORTED_MODULE_1_classnames___default()('ui', color, size, Object(__WEBPACK_IMPORTED_MODULE_4__lib__[\"z\" /* useKeyOnly */])(basic, 'basic'), Object(__WEBPACK_IMPORTED_MODULE_4__lib__[\"z\" /* useKeyOnly */])(compact, 'compact'), Object(__WEBPACK_IMPORTED_MODULE_4__lib__[\"z\" /* useKeyOnly */])(fluid, 'fluid'), Object(__WEBPACK_IMPORTED_MODULE_4__lib__[\"z\" /* useKeyOnly */])(icon, 'icon'), Object(__WEBPACK_IMPORTED_MODULE_4__lib__[\"z\" /* useKeyOnly */])(inverted, 'inverted'), Object(__WEBPACK_IMPORTED_MODULE_4__lib__[\"z\" /* useKeyOnly */])(labeled, 'labeled'), Object(__WEBPACK_IMPORTED_MODULE_4__lib__[\"z\" /* useKeyOnly */])(negative, 'negative'), Object(__WEBPACK_IMPORTED_MODULE_4__lib__[\"z\" /* useKeyOnly */])(positive, 'positive'), Object(__WEBPACK_IMPORTED_MODULE_4__lib__[\"z\" /* useKeyOnly */])(primary, 'primary'), Object(__WEBPACK_IMPORTED_MODULE_4__lib__[\"z\" /* useKeyOnly */])(secondary, 'secondary'), Object(__WEBPACK_IMPORTED_MODULE_4__lib__[\"z\" /* useKeyOnly */])(toggle, 'toggle'), Object(__WEBPACK_IMPORTED_MODULE_4__lib__[\"z\" /* useKeyOnly */])(vertical, 'vertical'), Object(__WEBPACK_IMPORTED_MODULE_4__lib__[\"D\" /* useValueAndKey */])(attached, 'attached'), Object(__WEBPACK_IMPORTED_MODULE_4__lib__[\"D\" /* useValueAndKey */])(floated, 'floated'), Object(__WEBPACK_IMPORTED_MODULE_4__lib__[\"F\" /* useWidthProp */])(widths), 'buttons', className);\n var rest = Object(__WEBPACK_IMPORTED_MODULE_4__lib__[\"q\" /* getUnhandledProps */])(ButtonGroup, props);\n var ElementType = Object(__WEBPACK_IMPORTED_MODULE_4__lib__[\"p\" /* getElementType */])(ButtonGroup, props);\n\n return __WEBPACK_IMPORTED_MODULE_3_react___default.a.createElement(\n ElementType,\n __WEBPACK_IMPORTED_MODULE_0_babel_runtime_helpers_extends___default()({}, rest, { className: classes }),\n children\n );\n}", "beforeDatasetsDraw(chart) {\n if (!this._enabled(chart)) {\n return;\n }\n const scale = this._findScale(chart);\n const flat = chart.data.flatLabels;\n const visible = chart.data.labels;\n const roots = chart.data.rootNodes;\n const visibles = new Set(visible);\n const ctx = chart.ctx;\n const hor = scale.isHorizontal();\n\n const boxSize = scale.options.hierarchyBoxSize;\n const boxSize05 = boxSize * 0.5;\n const boxSize01 = boxSize * 0.1;\n const boxRow = scale.options.hierarchyBoxLineHeight;\n const boxColor = scale.options.hierarchyBoxColor;\n const boxWidth = scale.options.hierarchyBoxWidth;\n const boxSpanColor = scale.options.hierarchySpanColor;\n const boxSpanWidth = scale.options.hierarchySpanWidth;\n const renderLabel = scale.options.hierarchyLabelPosition;\n const groupLabelPosition = scale.options.hierarchyGroupLabelPosition;\n\n const scaleLabel = scale.options.scaleLabel;\n const scaleLabelFontColor = helpers.valueOrDefault(scaleLabel.fontColor, defaults.global.defaultFontColor);\n const scaleLabelFont = parseFontOptions(scaleLabel);\n\n ctx.save();\n ctx.strokeStyle = boxColor;\n ctx.lineWidth = boxWidth;\n ctx.fillStyle = scaleLabelFontColor; // render in correct color\n ctx.font = scaleLabelFont.font;\n\n const renderHorLevel = (node) => {\n if (node.children.length === 0) {\n return false;\n }\n const offset = node.level * boxRow;\n\n if (!node.expand) {\n if (visibles.has(node)) {\n // expand button\n ctx.strokeRect(node.center - boxSize05, offset + 0, boxSize, boxSize);\n ctx.fillRect(node.center - boxSize05 + 2, offset + boxSize05 - 1, boxSize - 4, 2);\n ctx.fillRect(node.center - 1, offset + 2, 2, boxSize - 4);\n }\n return false;\n }\n const r = spanLogic(node, flat, visibles, groupLabelPosition);\n if (!r) {\n return false;\n }\n const {\n hasFocusBox,\n hasCollapseBox,\n leftVisible,\n rightVisible,\n leftFirstVisible,\n rightLastVisible,\n groupLabelCenter\n } = r;\n\n // render group label\n if (renderLabel === 'below') {\n ctx.fillText(node.label, groupLabelCenter, offset + boxSize);\n } else if (renderLabel === 'above') {\n ctx.fillText(node.label, groupLabelCenter, offset - boxSize);\n }\n\n if (hasCollapseBox) {\n // collapse button\n ctx.strokeRect(leftVisible.center - boxSize05, offset + 0, boxSize, boxSize);\n ctx.fillRect(leftVisible.center - boxSize05 + 2, offset + boxSize05 - 1, boxSize - 4, 2);\n }\n\n if (hasFocusBox) {\n // focus button\n ctx.strokeRect(rightVisible.center - boxSize05, offset + 0, boxSize, boxSize);\n ctx.fillRect(rightVisible.center - 2, offset + boxSize05 - 2, 4, 4);\n }\n\n if (leftVisible !== rightVisible) {\n // helper span line\n ctx.strokeStyle = boxSpanColor;\n ctx.lineWidth = boxSpanWidth;\n ctx.beginPath();\n if (hasCollapseBox) {\n // stitch to box\n ctx.moveTo(leftVisible.center + boxSize05, offset + boxSize05);\n } else if (leftFirstVisible) {\n // add starting group hint\n ctx.moveTo(leftVisible.center, offset + boxSize01);\n ctx.lineTo(leftVisible.center, offset + boxSize05);\n } else {\n // just a line\n ctx.moveTo(leftVisible.center, offset + boxSize05);\n }\n\n if (hasFocusBox) {\n ctx.lineTo(rightVisible.center - boxSize05, offset + boxSize05);\n } else if (rightLastVisible) {\n ctx.lineTo(rightVisible.center, offset + boxSize05);\n ctx.lineTo(rightVisible.center, offset + boxSize01);\n } else {\n ctx.lineTo(rightVisible.center, offset + boxSize05);\n }\n ctx.stroke();\n ctx.strokeStyle = boxColor;\n ctx.lineWidth = boxWidth;\n }\n\n return true;\n };\n\n const renderVertLevel = (node) => {\n if (node.children.length === 0) {\n return false;\n }\n const offset = node.level * boxRow * -1;\n\n if (!node.expand) {\n if (visibles.has(node)) {\n ctx.strokeRect(offset - boxSize, node.center - boxSize05, boxSize, boxSize);\n ctx.fillRect(offset - boxSize + 2, node.center - 1, boxSize - 4, 2);\n ctx.fillRect(offset - boxSize05 - 1, node.center - boxSize05 + 2, 2, boxSize - 4);\n }\n return false;\n }\n const r = spanLogic(node, flat, visibles);\n if (!r) {\n return false;\n }\n const {\n hasFocusBox,\n hasCollapseBox,\n leftVisible,\n rightVisible,\n leftFirstVisible,\n rightLastVisible,\n groupLabelCenter\n } = r;\n\n // render group label\n ctx.fillText(node.label, offset - boxSize, groupLabelCenter);\n\n if (hasCollapseBox) {\n // collapse button\n ctx.strokeRect(offset - boxSize, leftVisible.center - boxSize05, boxSize, boxSize);\n ctx.fillRect(offset - boxSize + 2, leftVisible.center - 1, boxSize - 4, 2);\n }\n\n if (hasFocusBox) {\n // focus\n ctx.strokeRect(offset - boxSize, rightVisible.center - boxSize05, boxSize, boxSize);\n ctx.fillRect(offset - boxSize05 - 2, rightVisible.center - 2, 4, 4);\n }\n\n if (leftVisible !== rightVisible) {\n // helper span line\n ctx.strokeStyle = boxSpanColor;\n ctx.lineWidth = boxSpanWidth;\n ctx.beginPath();\n if (hasCollapseBox) {\n // stitch to box\n ctx.moveTo(offset - boxSize05, leftVisible.center + boxSize05);\n } else if (leftFirstVisible) {\n // add starting group hint\n ctx.moveTo(offset - boxSize01, leftVisible.center);\n ctx.lineTo(offset - boxSize05, leftVisible.center);\n } else {\n // just a line\n ctx.lineTo(offset - boxSize05, leftVisible.center);\n }\n\n if (hasFocusBox) {\n ctx.lineTo(offset - boxSize05, rightVisible.center - boxSize05);\n } else if (rightLastVisible) {\n ctx.lineTo(offset - boxSize05, rightVisible.center - boxSize05);\n ctx.lineTo(offset - boxSize01, rightVisible.center - boxSize05);\n } else {\n ctx.lineTo(offset - boxSize05, rightVisible.center);\n }\n ctx.stroke();\n ctx.strokeStyle = boxColor;\n ctx.lineWidth = boxWidth;\n }\n\n return true;\n };\n\n if (hor) {\n ctx.textAlign = 'center';\n ctx.textBaseline = renderLabel === 'above' ? 'bottom' : 'top';\n ctx.translate(scale.left, scale.top + scale.options.padding);\n roots.forEach((n) => preOrderTraversal(n, renderHorLevel));\n } else {\n ctx.textAlign = 'right';\n ctx.textBaseline = 'center';\n ctx.translate(scale.left - scale.options.padding, scale.top);\n\n roots.forEach((n) => preOrderTraversal(n, renderVertLevel));\n }\n\n ctx.restore();\n }", "function addShapes() {\n scene.add(group);\n scene.add(camera);\n scene.add(ambientlight);\n}", "getGroup() {\r\n return this.builder.group;\r\n }", "function makeCircleSelectable( _group, _type ){\n\tif( typeof _group == 'string' ){\n\t\t_group = master.canvas.stage.find( '#' + _group )[0];\n\t}\n\t\n\tif( _group == undefined )\n\t\treturn;\n\t\t\n\tvar hasOutter = false;\n\t\n\tvar maxRadius = -1;\n\t\n\tvar children = _group.getChildren().toArray();\n\tfor( var i = 0; i < children.length; i++ ){\n\t\tvar child = children[i];\n\t\tif( child.getName() === 'outter' ){\n\t\t\thasOutter = true;\n\t\t} else if ( child.getClassName() === 'Circle' ) {\n\t\t\tchild.offsetX( child.radius() * -1 );\n\t\t\tchild.offsetY( child.radius() * -1 );\n\t\t\tif( child.radius() > maxRadius )\n\t\t\t\tmaxRadius = child.radius();\n\t\t}\n\t}\n\t\n\tif( hasOutter === true )\n\t\treturn;\n\t\n\tvar outter = new Kinetic.Circle({\n\t\tname: \"outter\",\n\t\tradius: maxRadius + 3,\n\t\toffsetX: ( maxRadius + 3 ) * -1, \n\t\toffsetY: ( maxRadius + 3 ) * -1,\n\t\tx: -3,\n\t\ty: -3,\n\t\tstroke: SELECTED_HEX,\n\t\tstrokeWidth: 3\n\t});\n\toutter.hide();\n\t_group.add( outter );\n\t\n\t_group.setAttr( 'selected', false );\n\t_group.setAttr( 'disabled', false );\n\t\n\t_group.on('click touchstart', function(e){\n\t\tif( _group.getAttr( 'disabled' ) ) return;\n\t\t\n\t\tif( !_group.getAttr( 'selected' ) || Kinetic.multiSelect != null || !e.evt.shiftKey || !e.evt.ctrlKey ){\n\t\t\t//If shif and cntrl were not held during the click\n\t\t\tif( !e.evt.shiftKey && !e.evt.ctrlKey ){\n\t\t\t\tdeselect();\n\t\t\t\tselect( _group );\n\t\t\t} else if ( _group.getAttr( 'selected' ) ) {\n\t\t\t//If shif or cntrl were held during the click and object was already selected\n\t\t\t\tdeselect( _group );\n\t\t\t} else {\n\t\t\t//If shif and cntrl were held during the click and object was not already selected\n\t\t\t\tselect( _group );\n\t\t\t}\n\t\t\t\n\t\t\tselectStyle();\n\t\t}\n\t});\n\t\n\t_group.on('dragstart', function(e){\n\t\tif( _group.getAttr( 'disabled' ) ) return;\n\t\t\n\t\tif( !_group.getAttr( 'selected' ) ){\n\t\t\t//If shif and cntrl were not held during the click\n\t\t\tif( !e.evt.shiftKey && !e.evt.ctrlKey ){\n\t\t\t\tdeselect();\n\t\t\t\tselect( _group );\n\t\t\t} else if ( _group.getAttr( 'selected' ) ) {\n\t\t\t//If shif or cntrl were held during the click and object was already selected\n\t\t\t\tdeselect( _group );\n\t\t\t} else {\n\t\t\t//If shif and cntrl were held during the click and object was not already selected\n\t\t\t\tselect( _group );\n\t\t\t}\n\t\t\t\n\t\t\tselectStyle();\n\t\t}\n\t});\n\t\n\t_group.on('mouseover', function() {\n\t\tif( _group.getAttr( 'disabled' ) ) return;\n\t\t\n\t\tdocument.body.style.cursor = 'all-scroll';\n\t});\n\t\n\t_group.on('mouseout', function() {\n\t\tif( _group.getAttr( 'disabled' ) ) return;\n\t\t\n\t\tdocument.body.style.cursor = 'default';\n \t});\n \t\n \t_group.on('dragend', function() {\n\t\tif( _group.getAttr( 'disabled' ) ) return;\n \t\t\n\t\tmaster.canvas.ormObj.visualOnlySync();\n\t});\n\t\n\tif( typeof _type !== 'undefined' && _type === 'objects' ){\n\t\t_group.on('dblclick dbltap', function(){\n\t\t\tif( _group.getAttr( 'disabled' ) ) return;\n\t\t\t\n\t\t\tmaster.ormObj.openProperties( _group.id() );\n\t\t\tdeselect( _group );\n\t\t});\n\t} else if ( typeof _type !== 'undefined' && _type === 'predicate' ){\n\t\t_group.on('dblclick dbltap', function(){\n\t\t\tif( _group.getAttr('disabled') ) return;\n\t\t\t\n\t\t\tmaster.canvas.line.editPredicate( _group.id() );\n\t\t});\n\t} else if ( typeof _type !== 'undefined' && _type === 'rule' ){\n\t\t_group.on('dblclick dbltap', function(){\n\t\t\tif( _group.getAttr('disabled') ) return;\n\t\t\t\n\t\t\tmaster.rule.openChangeSymbol( _group.id() );\n\t\t});\n\t}\n}", "get sourceButtonGroup() {\n return {\n type: \"button-group\",\n subtype: \"source-button-group\",\n buttons: [this.sourceButton],\n };\n }", "makeMarkerLayerGroup() {\n this._markerLayerGroup = new L.layerGroup().addTo(this.getMap());\n }", "function ButtonGroup(props) {\n var attached = props.attached,\n basic = props.basic,\n children = props.children,\n className = props.className,\n color = props.color,\n compact = props.compact,\n content = props.content,\n floated = props.floated,\n fluid = props.fluid,\n icon = props.icon,\n inverted = props.inverted,\n labeled = props.labeled,\n negative = props.negative,\n positive = props.positive,\n primary = props.primary,\n secondary = props.secondary,\n size = props.size,\n toggle = props.toggle,\n vertical = props.vertical,\n widths = props.widths;\n\n\n var classes = __WEBPACK_IMPORTED_MODULE_1_classnames___default()('ui', color, size, __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_4__lib__[\"a\" /* useKeyOnly */])(basic, 'basic'), __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_4__lib__[\"a\" /* useKeyOnly */])(compact, 'compact'), __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_4__lib__[\"a\" /* useKeyOnly */])(fluid, 'fluid'), __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_4__lib__[\"a\" /* useKeyOnly */])(icon, 'icon'), __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_4__lib__[\"a\" /* useKeyOnly */])(inverted, 'inverted'), __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_4__lib__[\"a\" /* useKeyOnly */])(labeled, 'labeled'), __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_4__lib__[\"a\" /* useKeyOnly */])(negative, 'negative'), __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_4__lib__[\"a\" /* useKeyOnly */])(positive, 'positive'), __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_4__lib__[\"a\" /* useKeyOnly */])(primary, 'primary'), __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_4__lib__[\"a\" /* useKeyOnly */])(secondary, 'secondary'), __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_4__lib__[\"a\" /* useKeyOnly */])(toggle, 'toggle'), __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_4__lib__[\"a\" /* useKeyOnly */])(vertical, 'vertical'), __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_4__lib__[\"k\" /* useKeyOrValueAndKey */])(attached, 'attached'), __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_4__lib__[\"j\" /* useValueAndKey */])(floated, 'floated'), __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_4__lib__[\"h\" /* useWidthProp */])(widths), 'buttons', className);\n var rest = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_4__lib__[\"b\" /* getUnhandledProps */])(ButtonGroup, props);\n var ElementType = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_4__lib__[\"c\" /* getElementType */])(ButtonGroup, props);\n\n return __WEBPACK_IMPORTED_MODULE_3_react___default.a.createElement(\n ElementType,\n __WEBPACK_IMPORTED_MODULE_0_babel_runtime_helpers_extends___default()({}, rest, { className: classes }),\n __WEBPACK_IMPORTED_MODULE_4__lib__[\"d\" /* childrenUtils */].isNil(children) ? content : children\n );\n}", "function ChartsContainer() {\n return (\n <div className=\"row\">\n <AreaChart />\n <PieChart />\n </div>\n );\n}", "function buildContainerGroups() {\n const container = svg\n .append(\"g\")\n .classed(\"container-group\", true)\n .attr(\"transform\", `translate(${margin.left},${margin.top})`);\n\n container.append(\"g\").classed(\"chart-group\", true);\n container.append(\"g\").classed(\"x-axis-group axis\", true);\n container.append(\"g\").classed(\"y-axis-group axis\", true);\n }", "function CardGroup(props) {\n var children = props.children,\n className = props.className,\n content = props.content,\n doubling = props.doubling,\n items = props.items,\n itemsPerRow = props.itemsPerRow,\n stackable = props.stackable,\n textAlign = props.textAlign;\n\n\n var classes = __WEBPACK_IMPORTED_MODULE_3_classnames___default()('ui', Object(__WEBPACK_IMPORTED_MODULE_6__lib__[\"B\" /* useKeyOnly */])(doubling, 'doubling'), Object(__WEBPACK_IMPORTED_MODULE_6__lib__[\"B\" /* useKeyOnly */])(stackable, 'stackable'), Object(__WEBPACK_IMPORTED_MODULE_6__lib__[\"E\" /* useTextAlignProp */])(textAlign), Object(__WEBPACK_IMPORTED_MODULE_6__lib__[\"H\" /* useWidthProp */])(itemsPerRow), 'cards', className);\n var rest = Object(__WEBPACK_IMPORTED_MODULE_6__lib__[\"r\" /* getUnhandledProps */])(CardGroup, props);\n var ElementType = Object(__WEBPACK_IMPORTED_MODULE_6__lib__[\"q\" /* getElementType */])(CardGroup, props);\n\n if (!__WEBPACK_IMPORTED_MODULE_6__lib__[\"d\" /* childrenUtils */].isNil(children)) return __WEBPACK_IMPORTED_MODULE_5_react___default.a.createElement(\n ElementType,\n __WEBPACK_IMPORTED_MODULE_0_babel_runtime_helpers_extends___default()({}, rest, { className: classes }),\n children\n );\n if (!__WEBPACK_IMPORTED_MODULE_6__lib__[\"d\" /* childrenUtils */].isNil(content)) return __WEBPACK_IMPORTED_MODULE_5_react___default.a.createElement(\n ElementType,\n __WEBPACK_IMPORTED_MODULE_0_babel_runtime_helpers_extends___default()({}, rest, { className: classes }),\n content\n );\n\n var itemsJSX = __WEBPACK_IMPORTED_MODULE_2_lodash_map___default()(items, function (item) {\n var key = item.key || [item.header, item.description].join('-');\n return __WEBPACK_IMPORTED_MODULE_5_react___default.a.createElement(__WEBPACK_IMPORTED_MODULE_7__Card__[\"a\" /* default */], __WEBPACK_IMPORTED_MODULE_0_babel_runtime_helpers_extends___default()({ key: key }, item));\n });\n\n return __WEBPACK_IMPORTED_MODULE_5_react___default.a.createElement(\n ElementType,\n __WEBPACK_IMPORTED_MODULE_0_babel_runtime_helpers_extends___default()({}, rest, { className: classes }),\n itemsJSX\n );\n}", "render(renderer, frame) {\n if (typeof frame === 'undefined') {\n throw 'Must supply coordinate frame to render the group';\n }\n for (let k = 0; k < this.children.length; k++) {\n const ch = this.children[k];\n // pre-multiply the requested coordindate with this child's CF\n mat4.multiply(this.tempMat, frame, ch.frame);\n // If the child is also a GroupObject\n // do a recursive call on that child\n // otherwise call the renderer function directly\n if (ch.object instanceof ObjectGroup)\n ch.object.render(renderer, this.tempMat);\n else renderer(ch.object, this.tempMat);\n }\n }", "function BasicLineGroup( layer, scene, neuralGroup, color, minOpacity ) {\n\n\tthis.layer = layer;\n\tthis.scene = scene;\n\tthis.neuralGroup = neuralGroup;\n\tthis.color = color;\n\tthis.minOpacity = minOpacity;\n\n\t// actual relative lines element for layer\n\n\tthis.lineGroup = undefined;\n\n\tthis.init();\n\n}", "_initializeComponent() {\n //Heade\n this.elements.header = document.createElement(\"div\");\n this.elements.title = document.createElement(\"span\");\n this.elements.range = document.createElement(\"span\");\n\n this.elements.header.className = \"chart-header\";\n this.elements.title.className = \"chart-title\";\n this.elements.range.className = \"chart-range\";\n\n this.elements.header.appendChild(this.elements.title);\n this.elements.header.appendChild(this.elements.range);\n\n //Tooltip\n this.elements.tooltip = document.createElement(\"div\");\n this.elements.date = document.createElement(\"span\");\n this.elements.values = document.createElement(\"div\");\n\n this.elements.tooltip.className = \"chart-tooltip\";\n this.elements.date.className = \"chart-tooltip-date\";\n this.elements.values.className = \"chart-tooltip-values\";\n\n this.elements.tooltip.appendChild(this.elements.date);\n this.elements.tooltip.appendChild(this.elements.values);\n\n //Render\n this.elements.render = document.createElement(\"div\");\n this.elements.chart = document.createElement(\"canvas\");\n this.elements.layout = document.createElement(\"canvas\");\n\n this.elements.render.className = \"chart-render\";\n this.elements.chart.className = \"chart-render-chart\";\n this.elements.layout.className = \"chart-render-layout\";\n\n this.elements.render.appendChild(this.elements.chart);\n this.elements.render.appendChild(this.elements.layout);\n\n //Preview\n this.elements.control = document.createElement(\"div\");\n this.elements.preview = document.createElement(\"canvas\");\n this.elements.select = document.createElement(\"div\");\n this.elements.draggerLeft = document.createElement(\"div\");\n this.elements.draggerRight = document.createElement(\"div\");\n this.elements.coverLeft = document.createElement(\"div\");\n this.elements.coverRight = document.createElement(\"div\");\n\n this.elements.control.className = \"chart-control\";\n this.elements.preview.className = \"chart-preview\";\n this.elements.select.className = \"chart-select\";\n this.elements.draggerLeft.className = \"chart-dragger chart-dragger-left\";\n this.elements.draggerRight.className = \"chart-dragger chart-dragger-right\";\n this.elements.coverLeft.className = \"chart-cover chart-cover-left\";\n this.elements.coverRight.className = \"chart-cover chart-cover-right\";\n\n this.elements.control.appendChild(this.elements.preview);\n this.elements.control.appendChild(this.elements.coverLeft);\n this.elements.control.appendChild(this.elements.select);\n this.elements.select.appendChild(this.elements.draggerLeft);\n this.elements.select.appendChild(this.elements.draggerRight);\n this.elements.control.appendChild(this.elements.coverRight);\n\n //Graph buttons container\n this.elements.graphs = document.createElement(\"div\");\n\n this.elements.graphs.className = \"chart-graphs\";\n\n //Main container\n this.elements.container.className += \" chart-container\";\n\n this.elements.container.appendChild(this.elements.header);\n this.elements.container.appendChild(this.elements.tooltip);\n this.elements.container.appendChild(this.elements.render);\n this.elements.container.appendChild(this.elements.control);\n this.elements.container.appendChild(this.elements.graphs);\n }", "render() {\n return (\n <View style={styles.container} >\n <StatusBar barStyle='default' />\n <Surface width={width} height={(height - (Platform.OS === 'ios' ? 64 : 76))/2}style={styles.surface} >\n <Group x={100} y={120}>\n <Text font={`20px \"Helvetica Neue\", \"Helvetica\", Arial`} stroke=\"purple\" y={20}>\n STROKED TEXT\n </Text>\n <Text font={`20px \"Helvetica Neue\", \"Helvetica\", Arial`} stroke=\"blue\" y={60}>\n 这三行继承了Group的属性\n </Text>\n <Text font={`20px \"Helvetica Neue\", \"Helvetica\", Arial`} stroke=\"green\" y={100}>\n 小米智能家庭👪\n </Text>\n </Group>\n </Surface>\n </View>\n );\n }", "constructor() {\n super();\n\n this.groups = new Map();\n }", "onStoreGroup({\n groupers\n }) {\n const {\n grid\n } = this,\n {\n element\n } = grid,\n curGroupHeaders = element && DomHelper.children(element, '.b-grid-header.b-group');\n\n if (element) {\n for (const header of curGroupHeaders) {\n DomHelper.removeClasses(header, ['b-group', 'b-asc', 'b-desc']);\n }\n\n if (groupers) {\n for (const groupInfo of groupers) {\n const header = grid.getHeaderElementByField(groupInfo.field);\n\n if (header) {\n DomHelper.addClasses(header, ['b-group', groupInfo.ascending ? 'b-asc' : 'b-desc']);\n }\n }\n }\n }\n }", "renderCell(renderData) {\n const me = this;\n\n // no need to run the code below if not grouping\n if (!me.store.isGrouped) return;\n\n let { cellElement, rowElement, column } = renderData,\n grid = me.grid,\n meta = renderData.record.meta,\n firstColumn = grid.columns.visibleColumns[0],\n subGrid = grid.getSubGridFromColumn(column);\n\n if (meta.hasOwnProperty('groupRowFor')) {\n // Let column clear the cell, in case it needs to do some cleanup\n column.clearCell(cellElement);\n\n // this is a group row, add css classes\n\n // IE11 doesnt support this\n //rowElement.classList.toggle('b-grid-group-collapsed', meta.collapsed === undefined ? false : meta.collapsed);\n if (meta.collapsed) {\n rowElement.classList.add('b-grid-group-collapsed');\n } else {\n rowElement.classList.remove('b-grid-group-collapsed');\n }\n\n rowElement.classList.add('b-group-row');\n\n if (\n column.region === grid.regions[0] &&\n ((firstColumn.type === 'rownumber' && column === subGrid.columns.visibleColumns[1]) ||\n (firstColumn.type !== 'rownumber' && column === subGrid.columns.visibleColumns[0]))\n ) {\n cellElement.classList.add('b-group-title');\n }\n\n me.buildGroupHeader(renderData);\n } else {\n // not a group row, remove css classes\n // TODO: use dom query to remove before render instead?\n if (cellElement === rowElement.firstElementChild) {\n // IE11 doesnt support this\n //rowElement.classList.remove('b-group-row', 'b-grid-group-collapsed');\n rowElement.classList.remove('b-group-row');\n rowElement.classList.remove('b-grid-group-collapsed');\n cellElement.classList.remove('b-group-title');\n }\n }\n }", "function render() {\n var createNodes = __webpack_require__(877);\n var createClusters = __webpack_require__(880);\n var createEdgeLabels = __webpack_require__(881);\n var createEdgePaths = __webpack_require__(882);\n var positionNodes = __webpack_require__(883);\n var positionEdgeLabels = __webpack_require__(884);\n var positionClusters = __webpack_require__(885);\n var shapes = __webpack_require__(886);\n var arrows = __webpack_require__(887);\n\n var fn = function(svg, g) {\n preProcessGraph(g);\n\n var outputGroup = createOrSelectGroup(svg, \"output\");\n var clustersGroup = createOrSelectGroup(outputGroup, \"clusters\");\n var edgePathsGroup = createOrSelectGroup(outputGroup, \"edgePaths\");\n var edgeLabels = createEdgeLabels(createOrSelectGroup(outputGroup, \"edgeLabels\"), g);\n var nodes = createNodes(createOrSelectGroup(outputGroup, \"nodes\"), g, shapes);\n\n layout(g);\n\n positionNodes(nodes, g);\n positionEdgeLabels(edgeLabels, g);\n createEdgePaths(edgePathsGroup, g, arrows);\n\n var clusters = createClusters(clustersGroup, g);\n positionClusters(clusters, g);\n\n postProcessGraph(g);\n };\n\n fn.createNodes = function(value) {\n if (!arguments.length) return createNodes;\n createNodes = value;\n return fn;\n };\n\n fn.createClusters = function(value) {\n if (!arguments.length) return createClusters;\n createClusters = value;\n return fn;\n };\n\n fn.createEdgeLabels = function(value) {\n if (!arguments.length) return createEdgeLabels;\n createEdgeLabels = value;\n return fn;\n };\n\n fn.createEdgePaths = function(value) {\n if (!arguments.length) return createEdgePaths;\n createEdgePaths = value;\n return fn;\n };\n\n fn.shapes = function(value) {\n if (!arguments.length) return shapes;\n shapes = value;\n return fn;\n };\n\n fn.arrows = function(value) {\n if (!arguments.length) return arrows;\n arrows = value;\n return fn;\n };\n\n return fn;\n}", "function LabelGroup(props) {\n var children = props.children,\n circular = props.circular,\n className = props.className,\n color = props.color,\n size = props.size,\n tag = props.tag;\n\n\n var classes = __WEBPACK_IMPORTED_MODULE_1_classnames___default()('ui', color, size, __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_3__lib__[\"a\" /* useKeyOnly */])(circular, 'circular'), __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_3__lib__[\"a\" /* useKeyOnly */])(tag, 'tag'), 'labels', className);\n var rest = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_3__lib__[\"b\" /* getUnhandledProps */])(LabelGroup, props);\n var ElementType = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_3__lib__[\"c\" /* getElementType */])(LabelGroup, props);\n\n return __WEBPACK_IMPORTED_MODULE_2_react___default.a.createElement(\n ElementType,\n __WEBPACK_IMPORTED_MODULE_0_babel_runtime_helpers_extends___default()({}, rest, { className: classes }),\n children\n );\n}", "componentWillMount() {\n\n this.idToMarker = {};\n\n // Create a group for the markers.\n this.group = L.featureGroup();\n this.group.addTo(this.props.map);\n\n // HIGHLIGHT\n this.group.on('mouseover', e => {\n events.highlightCollection(e.layer.options.feature.id);\n });\n\n // UNHIGHLIGHT\n this.group.on('mouseout', e => {\n events.unhighlightCollection(e.layer.options.feature.id);\n });\n\n // SELECT\n this.group.on('click', e => {\n let localItems = this.tree.search(this.toRbushTreeItem(e.layer));\n let localMarkers = localItems.map((item) => this.idToMarker[item.id]);\n this.props.selectCollection(e.layer.options.feature, localMarkers);\n });\n\n window.markers = this;\n\n }", "function groupLoader(groupName){\n\n\tthis.createPromise = this.createPromise.bind(this);\n\n\tthis.groupData = this.getElement(groupName, dataModels.group, 'name');\n\tthis.groupCount = dataModels.group.length;\n\tthis.modelsData = this.getElements(groupName, dataModels.models, 'group');\n\tthis.modelsCount = this.modelsData.length;\n\n\tthis.promises = this.getPromises();\n\n\n}", "static getModelName() {\n return \"AccountGroup\";\n }", "getMarkerLayerGroup() {\n return this._markerLayerGroup;\n }" ]
[ "0.580015", "0.5718398", "0.5697423", "0.5436387", "0.5426001", "0.5347102", "0.53044784", "0.5227024", "0.52139956", "0.5191827", "0.5161938", "0.5144934", "0.51263905", "0.5037152", "0.50369686", "0.5036872", "0.50325257", "0.50307554", "0.5011569", "0.49984258", "0.4982125", "0.4972487", "0.49463195", "0.49414998", "0.49327087", "0.49223527", "0.49204504", "0.4912581", "0.49056056", "0.48932502", "0.48888877", "0.48704237", "0.48591176", "0.48562887", "0.48537952", "0.48526585", "0.4851094", "0.48487696", "0.484614", "0.48355788", "0.4834195", "0.4831483", "0.48246422", "0.48168048", "0.48028794", "0.4801662", "0.47949982", "0.47948325", "0.47941193", "0.47916314", "0.47873607", "0.47842035", "0.4779835", "0.47796932", "0.47757635", "0.47731414", "0.47731414", "0.47686163", "0.4765377", "0.4760661", "0.47565413", "0.47536355", "0.47527948", "0.47520208", "0.4750758", "0.4745191", "0.47441772", "0.47430494", "0.47427994", "0.47425413", "0.47413647", "0.4736491", "0.4736491", "0.47275388", "0.47242326", "0.47214082", "0.47095686", "0.47075573", "0.4702617", "0.47006908", "0.470025", "0.46963495", "0.4695301", "0.46919915", "0.46913704", "0.4690875", "0.46890575", "0.4685795", "0.46814552", "0.46783286", "0.4678279", "0.46736512", "0.46654117", "0.46604785", "0.46589345", "0.46563327", "0.465579", "0.4655163", "0.4654209", "0.46523437", "0.46507984" ]
0.0
-1
If a block is tsv format
function isTSVFormat(block) { // Simple method to find out if a block is tsv format var firstLine = block.slice(0, block.indexOf('\n')); if (firstLine.indexOf(ITEM_SPLITER) >= 0) { return true; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function isTSVFormat(block) {\n\t // Simple method to find out if a block is tsv format\n\t var firstLine = block.slice(0, block.indexOf('\\n'));\n\t\n\t if (firstLine.indexOf(ITEM_SPLITER) >= 0) {\n\t return true;\n\t }\n\t }", "function isTSVFormat(block){ // Simple method to find out if a block is tsv format\n var firstLine=block.slice(0,block.indexOf('\\n'));if(firstLine.indexOf(ITEM_SPLITER) >= 0){return true;}}", "function isTSVFormat(block) {\n // Simple method to find out if a block is tsv format\n var firstLine = block.slice(0, block.indexOf('\\n'));\n if (firstLine.indexOf(ITEM_SPLITER) >= 0) {\n return true;\n }\n }", "function isTSVFormat(block) {\n // Simple method to find out if a block is tsv format\n var firstLine = block.slice(0, block.indexOf('\\n'));\n if (firstLine.indexOf(ITEM_SPLITER) >= 0) {\n return true;\n }\n }", "function isTSVFormat(block) {\n\t // Simple method to find out if a block is tsv format\n\t var firstLine = block.slice(0, block.indexOf('\\n'));\n\t if (firstLine.indexOf(ITEM_SPLITER) >= 0) {\n\t return true;\n\t }\n\t}", "function parseTsv(text) {\r\n\t\t\tvar m = text.match(/(\\t|\\r?\\n|[^\\t\"\\r\\n]+|\"(?:[^\"]|\"\")*\")/g);\r\n\t\t\tvar tsv = [];\r\n\t\t\tvar line = [];\r\n\t\t\ttsv.push(line);\r\n\t\t\tfor(var i = 0; i < m.length; i++) {\r\n\t\t\t\tvar str = m[i];\r\n\t\t\t\tif(/^(\\r\\n|\\r|\\n)$/.test(str)) {\r\n\t\t\t\t\tline = [];\r\n\t\t\t\t\ttsv.push(line);\r\n\t\t\t\t}\r\n\t\t\t\telse if(/^\\t$/.test(str)) {\r\n\t\t\t\t\t//noop\r\n\t\t\t\t}\r\n\t\t\t\telse {\r\n\t\t\t\t\tif(/^\"[^\"]*\"$/.test(str)) {\r\n\t\t\t\t\t\tstr = str.replace(/^\"|\"$/g, '');\r\n\t\t\t\t\t}\r\n\t\t\t\t\tstr = str.replace(/\"\"/g, '\"');\r\n\t\t\t\t\tline.push(str);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\treturn tsv;\r\n\t\t}", "function matchTab() {\n\t\tvar pattern = /^\\t/;\n\t\tvar x = lexString.match(pattern);\n\t\tif(x !== null) {\n\t\t\treturn true;\n\t\t}\n\t\telse {\n\t\t\treturn false;\n\t\t}\n\t}", "function getCellsTsv(data) {\r\n\t\t\tvar tsv = '';\r\n\t\t\tfor(var row = 0; row < data.length; row++) {\r\n\t\t\t\t// Exclude invisible cells\r\n\t\t\t\tif(!$(data[row][0].parentNode).is(':visible')) {\r\n\t\t\t\t\tcontinue;\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\tif(row != 0) tsv += '\\n';\r\n\t\t\t\tfor(var col = 0; col < data[row].length; col++) {\r\n\t\t\t\t\tif(col != 0) tsv += '\\t';\r\n\t\t\t\t\tvar text = getStaticText(data[row][col]);\r\n\t\t\t\t\tif(/[\\t\\n\"]/.test(text)) {\r\n\t\t\t\t\t\t// If it contains line breaks and tabs, enclose it in a double coat.\r\n\t\t\t\t\t\t// And if there is \" in the character, it is converted to \"\".\r\n\t\t\t\t\t\t// Because of IE7, I don't use replaceAll('\"', '\"\"') function.\r\n\t\t\t\t\t\ttsv += '\"' + text.split('\"').join('\"\"') + '\"';\r\n\t\t\t\t\t}\r\n\t\t\t\t\telse {\r\n\t\t\t\t\t\ttsv += text;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\treturn tsv;\r\n\t\t}", "acceptsTableEdit(row) {\n const lastRow = this.getLastRow();\n if (row > lastRow) {\n return false;\n }\n const line = this.editor.document.lineAt(row).text.trimLeft();\n if (line.startsWith('|')) {\n return true;\n }\n return false;\n }", "function tt(e,t,a,n){var r,f=e.doc,o=f.mode;t=q(f,t);var i,s=T(f,t.line),c=Xe(e,t.line,a),u=new di(s.text,e.options.tabSize,c);for(n&&(i=[]);(n||u.pos<t.ch)&&!u.eol();)u.start=u.pos,r=et(o,u,c.state),n&&i.push(new pi(u,r,We(f.mode,c.state)));return n?i:new pi(u,r,c.state)}", "_formatTable(object, cb) {\n var lineType = {};\n // Create object with all line model\n object.forOrder.forEach((type, i) => {\n // If an header rows is define we take line after that header rows\n if (object.headerRows) {\n lineType[type] = _.cloneDeep(object.body[i+object.headerRows]);\n } else {\n lineType[type] = _.cloneDeep(object.body[i]);\n }\n });\n var dataName;\n // Take the data name we need, if headerRows define we take the first model line\n if (object.headerRows) {\n dataName = this._recoverDataName(object.body[object.headerRows]);\n } else {\n dataName = this._recoverDataName(object.body[0]);\n }\n // Remove all model line from dd\n if (object.headerRows) {\n object.body = object.body.slice(0, object.headerRows);\n } else {\n object.body = [];\n }\n if (this._data[dataName]) {\n var count = 0;\n // For each line in data we create a new line with correct model and replace all tag with data\n asynk.each(this._data[dataName], (line, cb) => {\n if (!line.type) {\n return cb();\n }\n if (!lineType[line.type]) {\n return cb();\n }\n var newLine = _.cloneDeep(lineType[line.type]);\n asynk.each(newLine, (column, cb) => {\n if (column.text) {\n // verify if tag is present, if true replace tag with data\n if (column.text.indexOf(this._tag) != -1) {\n column.text = this._replaceTagLine(column.text, dataName, count);\n }\n if (column.rowSpan) {\n column.rowSpan = this._data[dataName].length;\n }\n }\n cb();\n }).serie().done(()=> {\n object.body.push(newLine);\n count++;\n cb();\n });\n }).serie().asCallback(cb);\n }\n }", "get isTextblock() {\n return this.type.isTextblock;\n }", "function checkVertical(symbol) {\n if (row1[1] == `:${symbol}:`) {\n if (row2[1] == `:${symbol}:`) {\n if (row3[1] == `:${symbol}:`) {\n return fin = symbol;\n }\n }\n }\n if (row1[2] == `:${symbol}:`) {\n if (row2[2] == `:${symbol}:`) {\n if (row3[2] == `:${symbol}:`) {\n return fin = symbol;\n }\n }\n }\n if (row1[3] == `:${symbol}:`) {\n if (row2[3] == `:${symbol}:`) {\n if (row3[3] == `:${symbol}:`) {\n return fin = symbol;\n }\n }\n }\n }", "function objectToTsv(data) {\n const tsvRows = [];\n //Header for first row\n const headers = Object.keys(data[0]);\n tsvRows.push(headers.join('\t'));\n\n //Loop over the rows and escapping the ',' and '\"'\n for (const row of data) {\n const values = headers.map(header => {\n const escaped = ('' + row[header]).replace(/\"/g, '\\\\\"');\n return `\"${escaped}\"`;\n });\n tsvRows.push(values.join('\\t'));\n }\n return tsvRows.join('\\n');\n}", "function isTextBlock(node){\n\t\treturn node.$element && (node.name() in dtd.$block || node.name() in dtd.$listItem) && dtd[node.name()]['#'];\n\t}", "isTocStyle(paragraph) {\n let style = paragraph.paragraphFormat.baseStyle;\n return (style !== undefined && (style.name.toLowerCase().indexOf('toc') !== -1));\n }", "function isOutputChunk(file) {\n return typeof file.code === 'string';\n}", "function csvFromTem(CSV, temHead, tem, temBetween, temFoot, temCond, temOptions) {\r\n var j;\r\n var v;\r\n if(!CSV){return;}\r\n var s = \"\";\r\n //alert(tem);\r\n var seqobj = new SeqObj();\r\n s += temHandler(CSV, temHead, -1, 0);\r\n for (j = 0; j < CSV.table.length; j++) {\r\n v = temHandler(CSV, temCond, j, j, null); // check conditional\r\n if (v.toString().left(5) == \"false\") continue;\r\n s += temHandler(CSV, tem, j, seqobj.next(), temOptions);\r\n if (j != CSV.table.length - 1) s += temHandler(CSV, temBetween, j, seqobj.curr());\r\n }\r\n s += temHandler(CSV, temFoot, -1, seqobj.curr(), temOptions);\r\n return s;\r\n}", "function List2TSV(LST){\n\t\tvar out=\"\";\n\t\tfor (var i in LST){\n\t\t\tvar LSTI=LST[i].join(\"\t\");\n\t\t\tout+=LSTI+'\\n';\n\t\t}\n\t\treturn out;\n\t}", "function handleSingle(tokenizer, block) {\n var nsStart = tokenizer.currentTokenStart, nsEnd = getNamespaceEnd(tokenizer), name = getNamespace(tokenizer, nsEnd), column, columns = [], tokens = TokenIndexBuilder.create(512), tokenCount = 0, readingNames = true;\n while (readingNames) {\n if (tokenizer.currentTokenType !== 4 /* ColumnName */ || !isNamespace(tokenizer, nsStart, nsEnd)) {\n readingNames = false;\n break;\n }\n column = getTokenString(tokenizer);\n moveNext(tokenizer);\n if (tokenizer.currentTokenType !== 3 /* Value */) {\n return {\n hasError: true,\n errorLine: tokenizer.currentLineNumber,\n errorMessage: \"Expected value.\"\n };\n }\n columns[columns.length] = column;\n TokenIndexBuilder.addToken(tokens, tokenizer.currentTokenStart, tokenizer.currentTokenEnd);\n tokenCount++;\n moveNext(tokenizer);\n }\n block.addCategory(new Text.Category(block.data, name, nsStart, tokenizer.currentTokenStart, columns, tokens.tokens, tokenCount));\n return {\n hasError: false,\n errorLine: 0,\n errorMessage: \"\"\n };\n }", "function hasTabs(input)\n{\n\treturn input.split(/[^\\t]/)[0].length;\n}", "function notBlockUseCaseMultilineBlock() { console.log('Not an block use case - Block - Multine');}", "function quick_and_dirty_vtt_or_srt_parser(vtt) {\n console.log('--quick_and_dirty_vtt_or_srt_parser--');\n\tlet lines = vtt.trim().replace('\\r\\n', '\\n').split(/[\\r\\n]/).map(function(line) {\n\t\treturn line.trim();\n });\n // console.log(lines);\n\tlet cues = [];\n\tlet start = null;\n\tlet end = null;\n\tlet payload = null;\n\tfor (let i = 0; i < lines.length; i++) {\n\t\tif (lines[i].indexOf('-->') >= 0) {\n\t\t\tlet splitted = lines[i].split(/[ \\t]+-->[ \\t]+/);\n\t\t\tif (splitted.length != 2) {\n\t\t\t\tthrow 'Error when splitting \"-->\": ' + lines[i];\n\t\t\t}\n\n\t\t\t// Already ignoring anything past the \"end\" timestamp (i.e. cue settings).\n\t\t\tstart = parse_timestamp(splitted[0]);\n\t\t\tend = parse_timestamp(splitted[1]);\n\t\t} else if (lines[i] == '') {\n\t\t\tif (start && end) {\n\t\t\t\tlet cue = { 'start': start, 'end': end, 'text': payload };\n\t\t\t\tcues.push(cue);\n\t\t\t\tstart = null;\n\t\t\t\tend = null;\n\t\t\t\tpayload = null;\n\t\t\t}\n\t\t} else if(start && end) {\n\t\t\tif (payload == null) {\n\t\t\t\tpayload = lines[i];\n\t\t\t} else {\n\t\t\t\tpayload += '\\n' + lines[i];\n\t\t\t}\n\t\t}\n\t}\n\tif (start && end) {\n\t\tlet cue = { 'start': start, 'end': end, 'text': payload };\n\t\tcues.push(cue);\n }\n \n console.log(cues);\n\n\treturn cues;\n}", "identify() {\n let output = this.default;\n\n let sameLineCommas = 0;\n let newLineCommas = 0;\n\n this.objectBlocks.forEach(block => {\n sameLineCommas += [...block.matchAll(/,\\n/gms)].length;\n newLineCommas += [...block.matchAll(/\\n\\s*,/gms)].length;\n });\n\n this.arrayBrackets.forEach(block => {\n sameLineCommas += [...block.matchAll(/,\\n/gms)].length;\n newLineCommas += [...block.matchAll(/\\n\\s*,/gms)].length;\n });\n\n if (newLineCommas > sameLineCommas) {\n output = 'first';\n }\n\n return output;\n }", "function extractCtabData(data, format) \n\t{\n\t\tvar fmt = format.toLowerCase();\n\t\tif (fmt === 'mol')\n\t\t{\n\t\t\tvar a = data.split('\\n');\n\t\t\t// discard first two lines\n\t\t\ta.splice(0, 2);\n\t\t\treturn a.join('\\n');\n\t\t}\n\t\telse if (fmt === 'pdb')\n\t\t{\n\t\t\tvar a = data.split('\\n');\t\t\t\n\t\t\ta.splice(0, 3);\n\t\t\tvar str = a.join('\\n');\n\t\t\t//var s = str.replace(/\\s/g, '');\n\t\t\t//console.log(str, s);\n\t\t\treturn str;\n\t\t}\n\t\telse\n\t\t\treturn data;\n\t}", "_parseTextTemplate() {\n\n let figureRows = this._textTemplate.split('\\n');\n\n figureRows.forEach(row => {\n this._width = row.trim().length;\n this._height += 1;\n\n row.split('').forEach((char) => {\n if (char === DIED_CHAR) {\n this._dataTemplate.push(false);\n } else if (char === ALIVE_CHAR) {\n this._dataTemplate.push(true);\n }\n })\n\n });\n\n }", "function isHeader () {\n return /^(Name|Syntax|Description|Examples|See also)/i.test(line)\n }", "function T(e,t){if((t-=e.first)<0||t>=e.size)throw new Error(\"There is no line \"+(t+e.first)+\" in the document.\");for(var a=e;!a.lines;)for(var n=0;;++n){var r=a.children[n],f=r.chunkSize();if(t<f){a=r;break}t-=f}return a.lines[t]}", "function hasSign( block ){\n if (block && block.state && block.state.setLine)\n return block.state;\n return false;\n}", "isHeadingStyle(para) {\n let style = para.paragraphFormat.baseStyle;\n if (style !== undefined) {\n return isNullOrUndefined(this.tocStyles[style.name]) ? false : true;\n }\n return false;\n }", "function tsvJSON(tsv) {\n const lines = tsv.split('\\n');\n const headers = lines.slice(0, 1)[0].split('\\t');\n return lines.slice(1, lines.length).map(line => {\n const data = line.split('\\t');\n return headers.reduce((obj, nextKey, index) => {\n obj[nextKey] = data[index];\n return obj;\n }, {});\n });\n }", "function testFor(trRow) {\n\n let sectionPath =\n ('Section Hierarchy' in trRow && trRow['Section Hierarchy']) ?\n trRow['Section Hierarchy'] :\n trRow['Section'];\n\n let title = trRow['Title'];\n let testFile = safePath(sectionPath, title) + flags.testFileSuffix;\n\n // These fields are kind of HTML-ish - double whitespace isn't rendered.\n // Our text files *do* care about this.\n let steps = trRow['Steps'];\n if (steps) steps = steps.replace(/[ \\t]+/g, ' ');\n let results = trRow['Expected Result'];\n if (results) results = results.replace(/[ \\t]+/g, ' ');\n\n let content = steps + \"\\n\\n\" +\n (results ? \"Expected Result:\\n\" + results + \"\\n\\n\" : \"\");\n\n // Append any extra persisted TestRail data as fields in the\n // test file\n let fieldContent = [];\n for (let i = 0; i < persistedTrFields.length; ++i) {\n\n let trField = persistedTrFields[i];\n if (trRow[trField] == null) continue;\n\n fieldContent.push(trField + \": \" + trRow[trField]);\n }\n\n content = content + fieldContent.join('\\n');\n\n return [testFile, content];\n}", "function printBlockString(value, isDescription) {\n\t return (value[0] === ' ' || value[0] === '\\t') && value.indexOf('\\n') === -1 ? '\"\"\"' + value.replace(/\"\"\"/g, '\\\\\"\"\"') + '\"\"\"' : isDescription ? '\"\"\"\\n' + value.replace(/\"\"\"/g, '\\\\\"\"\"') + '\\n\"\"\"' : indent('\"\"\"\\n' + value.replace(/\"\"\"/g, '\\\\\"\"\"')) + '\\n\"\"\"';\n\t}", "function tabletypeformatter(value, row, index) { \n let multiple = false; \n if (value === null || value === '' || value === undefined) \n { \n return \"\";\n } \n if (multiple) { \n let valarray = value.split(','); \n let result = tabletypedatasource.filter(item => valarray.includes(item.value));\n let textarray = result.map(x => x.text);\n if (textarray.length > 0)\n return textarray.join(\",\");\n else \n return value;\n } else { \n let result = tabletypedatasource.filter(x => x.value == value);\n if (result.length > 0)\n return result[0].text;\n else\n return value;\n } \n }", "function parseInternal(data) {\n var tokenizer = createTokenizer(data), cat, id, file = new Text.File(data), block = new Text.DataBlock(data, \"default\"), saveFrame = new Text.DataBlock(data, \"empty\"), inSaveFrame = false, blockSaveFrames;\n moveNext(tokenizer);\n while (tokenizer.currentTokenType !== 6 /* End */) {\n var token = tokenizer.currentTokenType;\n // Data block\n if (token === 0 /* Data */) {\n if (inSaveFrame) {\n return error(tokenizer.currentLineNumber, \"Unexpected data block inside a save frame.\");\n }\n if (block.categories.length > 0) {\n file.dataBlocks.push(block);\n }\n block = new Text.DataBlock(data, data.substring(tokenizer.currentTokenStart + 5, tokenizer.currentTokenEnd));\n moveNext(tokenizer);\n // Save frame\n }\n else if (token === 1 /* Save */) {\n id = data.substring(tokenizer.currentTokenStart + 5, tokenizer.currentTokenEnd);\n if (id.length === 0) {\n if (saveFrame.categories.length > 0) {\n blockSaveFrames = block.additionalData[\"saveFrames\"];\n if (!blockSaveFrames) {\n blockSaveFrames = [];\n block.additionalData[\"saveFrames\"] = blockSaveFrames;\n }\n blockSaveFrames[blockSaveFrames.length] = saveFrame;\n }\n inSaveFrame = false;\n }\n else {\n if (inSaveFrame) {\n return error(tokenizer.currentLineNumber, \"Save frames cannot be nested.\");\n }\n inSaveFrame = true;\n saveFrame = new Text.DataBlock(data, id);\n }\n moveNext(tokenizer);\n // Loop\n }\n else if (token === 2 /* Loop */) {\n cat = handleLoop(tokenizer, inSaveFrame ? saveFrame : block);\n if (cat.hasError) {\n return error(cat.errorLine, cat.errorMessage);\n }\n // Single row\n }\n else if (token === 4 /* ColumnName */) {\n cat = handleSingle(tokenizer, inSaveFrame ? saveFrame : block);\n if (cat.hasError) {\n return error(cat.errorLine, cat.errorMessage);\n }\n // Out of options\n }\n else {\n return error(tokenizer.currentLineNumber, \"Unexpected token. Expected data_, loop_, or data name.\");\n }\n }\n // Check if the latest save frame was closed.\n if (inSaveFrame) {\n return error(tokenizer.currentLineNumber, \"Unfinished save frame (`\" + saveFrame.header + \"`).\");\n }\n if (block.categories.length > 0) {\n file.dataBlocks.push(block);\n }\n return result(file);\n }", "function checkCanBePlain( schema, block ) {\n\t// TMP will be replaced with schema.checkWrap().\n\tconst isPlainAllowed = schema.checkChild( block.parent, 'plain' );\n\tconst isBlockAllowedInPlain = schema.checkChild( [ '$root', 'plain' ], block );\n\n\treturn isPlainAllowed && isBlockAllowedInPlain;\n}", "function displayTableTabularFile(data) {\n // Transform columns to rows\n for(let i=0;i<data.files.length;i++) {\n if ('preview_data' in data.files[i]) {\n data.files[i].preview_data = cols2rows(data.files[i].preview_data);\n }\n }\n\n // display received data\n var template = $('#template-source_file-preview').html();\n\n var templateScript = Handlebars.compile(template);\n var html = templateScript(data);\n\n $(\"#content_integration\").html(html);\n\n function mapCallback() {\n return $(this).val();\n }\n\n function getSelectCallback(index, value) {\n selectbox.find(\"option[value=\"+value+\"]\").hide();\n }\n\n // Select the correct type for each column\n /*\n data.file[i]\n - name : name file\n - preview_data : first line of file\n - column_types : text, numeric, etc...\n */\n for(let i=0, l=data.files.length; i<l; i++) {\n\n if ('column_types' in data.files[i]) {\n var cols = data.files[i].column_types;\n for(let j=0; j<cols.length; j++) {\n var selectbox = $('div#content_integration form.template-source_file:eq(' + i + ') select.column_type:eq(' + j + ')');\n var values = selectbox.find(\"option\").map(mapCallback);\n\n if ($.inArray(cols[j], ['start', 'end', 'numeric']) == -1) {\n $.each(['start', 'end', 'numeric'],getSelectCallback);\n }\n\n if ($.inArray(cols[j], ['entityGoterm']) == -1) {\n $.each(['entityGoterm'],getSelectCallback);\n }\n\n if ($.inArray( cols[j], values) >= 0) {\n selectbox.val(cols[j]);\n }\n\n // Check what is in the db\n checkExistingData($('div#content_integration form.template-source_file:eq(' + i + ')'));\n }\n }\n }\n}", "function isTokenSeparated(stream) {\n return stream.sol() ||\n stream.string.charAt(stream.start - 1) == \" \" ||\n stream.string.charAt(stream.start - 1) == \"\\t\";\n }", "function printBlockString(value, isDescription) {\n return (value[0] === ' ' || value[0] === '\\t') && value.indexOf('\\n') === -1 ? '\"\"\"' + value.replace(/\"\"\"/g, '\\\\\"\"\"') + '\"\"\"' : isDescription ? '\"\"\"\\n' + value.replace(/\"\"\"/g, '\\\\\"\"\"') + '\\n\"\"\"' : indent('\"\"\"\\n' + value.replace(/\"\"\"/g, '\\\\\"\"\"')) + '\\n\"\"\"';\n}", "get isTextblock() {\n return this.isBlock && this.inlineContent;\n }", "function parseTSVtoJSON() {\n var tsv_data = fs.readFileSync('./jason_concerts.tsv').toString();\n\n var parsed = TSV.parse(tsv_data);\n var post_processing = [];\n // Remove Junk Data\n for (var i = 0; i < parsed.length; i++ ){\n var c = parsed[i];\n if (c.hasOwnProperty('artist') && c.artist !== \"\") {\n post_processing.push(c);\n }\n }\n return post_processing;\n}", "function createTxt(report) {\n const output = entities.decode(report.markdown());\n csvAccumulator.push([report.kind, output]);\n}", "function looks_like_log_line(line) {\n return (typeof line == 'string' && Date.parse(line.split('T')[0]) > 0);\n }", "function handleLastBlockCharacterDelete(isForward, rng) {\n\t\t\t\tvar path, blockElm, newBlockElm, clonedBlockElm, sibling,\n\t\t\t\t\tcontainer, offset, br, currentFormatNodes;\n\n\t\t\t\tfunction cloneTextBlockWithFormats(blockElm, node) {\n\t\t\t\t\tcurrentFormatNodes = $(node).parents().filter(function(idx, node) {\n\t\t\t\t\t\treturn !!editor.schema.getTextInlineElements()[node.nodeName];\n\t\t\t\t\t});\n\n\t\t\t\t\tnewBlockElm = blockElm.cloneNode(false);\n\n\t\t\t\t\tcurrentFormatNodes = Tools.map(currentFormatNodes, function(formatNode) {\n\t\t\t\t\t\tformatNode = formatNode.cloneNode(false);\n\n\t\t\t\t\t\tif (newBlockElm.hasChildNodes()) {\n\t\t\t\t\t\t\tformatNode.appendChild(newBlockElm.firstChild);\n\t\t\t\t\t\t\tnewBlockElm.appendChild(formatNode);\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tnewBlockElm.appendChild(formatNode);\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tnewBlockElm.appendChild(formatNode);\n\n\t\t\t\t\t\treturn formatNode;\n\t\t\t\t\t});\n\n\t\t\t\t\tif (currentFormatNodes.length) {\n\t\t\t\t\t\tbr = dom.create('br');\n\t\t\t\t\t\tcurrentFormatNodes[0].appendChild(br);\n\t\t\t\t\t\tdom.replace(newBlockElm, blockElm);\n\n\t\t\t\t\t\trng.setStartBefore(br);\n\t\t\t\t\t\trng.setEndBefore(br);\n\t\t\t\t\t\teditor.selection.setRng(rng);\n\n\t\t\t\t\t\treturn br;\n\t\t\t\t\t}\n\n\t\t\t\t\treturn null;\n\t\t\t\t}\n\n\t\t\t\tfunction isTextBlock(node) {\n\t\t\t\t\treturn node && editor.schema.getTextBlockElements()[node.tagName];\n\t\t\t\t}\n\n\t\t\t\tif (!rng.collapsed) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\tcontainer = rng.startContainer;\n\t\t\t\toffset = rng.startOffset;\n\t\t\t\tblockElm = dom.getParent(container, dom.isBlock);\n\t\t\t\tif (!isTextBlock(blockElm)) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\tif (container.nodeType == 1) {\n\t\t\t\t\tcontainer = container.childNodes[offset];\n\t\t\t\t\tif (container && container.tagName != 'BR') {\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\n\t\t\t\t\tif (isForward) {\n\t\t\t\t\t\tsibling = blockElm.nextSibling;\n\t\t\t\t\t} else {\n\t\t\t\t\t\tsibling = blockElm.previousSibling;\n\t\t\t\t\t}\n\n\t\t\t\t\tif (dom.isEmpty(blockElm) && isTextBlock(sibling) && dom.isEmpty(sibling)) {\n\t\t\t\t\t\tif (cloneTextBlockWithFormats(blockElm, container)) {\n\t\t\t\t\t\t\tdom.remove(sibling);\n\t\t\t\t\t\t\treturn true;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t} else if (container.nodeType == 3) {\n\t\t\t\t\tpath = NodePath.create(blockElm, container);\n\t\t\t\t\tclonedBlockElm = blockElm.cloneNode(true);\n\t\t\t\t\tcontainer = NodePath.resolve(clonedBlockElm, path);\n\n\t\t\t\t\tif (isForward) {\n\t\t\t\t\t\tif (offset >= container.data.length) {\n\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tcontainer.deleteData(offset, 1);\n\t\t\t\t\t} else {\n\t\t\t\t\t\tif (offset <= 0) {\n\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tcontainer.deleteData(offset - 1, 1);\n\t\t\t\t\t}\n\n\t\t\t\t\tif (dom.isEmpty(clonedBlockElm)) {\n\t\t\t\t\t\treturn cloneTextBlockWithFormats(blockElm, container);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}", "function handleLastBlockCharacterDelete(isForward, rng) {\n\t\t\t\tvar path, blockElm, newBlockElm, clonedBlockElm, sibling,\n\t\t\t\t\tcontainer, offset, br, currentFormatNodes;\n\n\t\t\t\tfunction cloneTextBlockWithFormats(blockElm, node) {\n\t\t\t\t\tcurrentFormatNodes = $(node).parents().filter(function(idx, node) {\n\t\t\t\t\t\treturn !!editor.schema.getTextInlineElements()[node.nodeName];\n\t\t\t\t\t});\n\n\t\t\t\t\tnewBlockElm = blockElm.cloneNode(false);\n\n\t\t\t\t\tcurrentFormatNodes = Tools.map(currentFormatNodes, function(formatNode) {\n\t\t\t\t\t\tformatNode = formatNode.cloneNode(false);\n\n\t\t\t\t\t\tif (newBlockElm.hasChildNodes()) {\n\t\t\t\t\t\t\tformatNode.appendChild(newBlockElm.firstChild);\n\t\t\t\t\t\t\tnewBlockElm.appendChild(formatNode);\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tnewBlockElm.appendChild(formatNode);\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tnewBlockElm.appendChild(formatNode);\n\n\t\t\t\t\t\treturn formatNode;\n\t\t\t\t\t});\n\n\t\t\t\t\tif (currentFormatNodes.length) {\n\t\t\t\t\t\tbr = dom.create('br');\n\t\t\t\t\t\tcurrentFormatNodes[0].appendChild(br);\n\t\t\t\t\t\tdom.replace(newBlockElm, blockElm);\n\n\t\t\t\t\t\trng.setStartBefore(br);\n\t\t\t\t\t\trng.setEndBefore(br);\n\t\t\t\t\t\teditor.selection.setRng(rng);\n\n\t\t\t\t\t\treturn br;\n\t\t\t\t\t}\n\n\t\t\t\t\treturn null;\n\t\t\t\t}\n\n\t\t\t\tfunction isTextBlock(node) {\n\t\t\t\t\treturn node && editor.schema.getTextBlockElements()[node.tagName];\n\t\t\t\t}\n\n\t\t\t\tif (!rng.collapsed) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\tcontainer = rng.startContainer;\n\t\t\t\toffset = rng.startOffset;\n\t\t\t\tblockElm = dom.getParent(container, dom.isBlock);\n\t\t\t\tif (!isTextBlock(blockElm)) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\tif (container.nodeType == 1) {\n\t\t\t\t\tcontainer = container.childNodes[offset];\n\t\t\t\t\tif (container && container.tagName != 'BR') {\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\n\t\t\t\t\tif (isForward) {\n\t\t\t\t\t\tsibling = blockElm.nextSibling;\n\t\t\t\t\t} else {\n\t\t\t\t\t\tsibling = blockElm.previousSibling;\n\t\t\t\t\t}\n\n\t\t\t\t\tif (dom.isEmpty(blockElm) && isTextBlock(sibling) && dom.isEmpty(sibling)) {\n\t\t\t\t\t\tif (cloneTextBlockWithFormats(blockElm, container)) {\n\t\t\t\t\t\t\tdom.remove(sibling);\n\t\t\t\t\t\t\treturn true;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t} else if (container.nodeType == 3) {\n\t\t\t\t\tpath = NodePath.create(blockElm, container);\n\t\t\t\t\tclonedBlockElm = blockElm.cloneNode(true);\n\t\t\t\t\tcontainer = NodePath.resolve(clonedBlockElm, path);\n\n\t\t\t\t\tif (isForward) {\n\t\t\t\t\t\tif (offset >= container.data.length) {\n\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tcontainer.deleteData(offset, 1);\n\t\t\t\t\t} else {\n\t\t\t\t\t\tif (offset <= 0) {\n\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tcontainer.deleteData(offset - 1, 1);\n\t\t\t\t\t}\n\n\t\t\t\t\tif (dom.isEmpty(clonedBlockElm)) {\n\t\t\t\t\t\treturn cloneTextBlockWithFormats(blockElm, container);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}", "function handleLastBlockCharacterDelete(isForward, rng) {\n\t\t\t\tvar path, blockElm, newBlockElm, clonedBlockElm, sibling,\n\t\t\t\t\tcontainer, offset, br, currentFormatNodes;\n\n\t\t\t\tfunction cloneTextBlockWithFormats(blockElm, node) {\n\t\t\t\t\tcurrentFormatNodes = $(node).parents().filter(function(idx, node) {\n\t\t\t\t\t\treturn !!editor.schema.getTextInlineElements()[node.nodeName];\n\t\t\t\t\t});\n\n\t\t\t\t\tnewBlockElm = blockElm.cloneNode(false);\n\n\t\t\t\t\tcurrentFormatNodes = Tools.map(currentFormatNodes, function(formatNode) {\n\t\t\t\t\t\tformatNode = formatNode.cloneNode(false);\n\n\t\t\t\t\t\tif (newBlockElm.hasChildNodes()) {\n\t\t\t\t\t\t\tformatNode.appendChild(newBlockElm.firstChild);\n\t\t\t\t\t\t\tnewBlockElm.appendChild(formatNode);\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tnewBlockElm.appendChild(formatNode);\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tnewBlockElm.appendChild(formatNode);\n\n\t\t\t\t\t\treturn formatNode;\n\t\t\t\t\t});\n\n\t\t\t\t\tif (currentFormatNodes.length) {\n\t\t\t\t\t\tbr = dom.create('br');\n\t\t\t\t\t\tcurrentFormatNodes[0].appendChild(br);\n\t\t\t\t\t\tdom.replace(newBlockElm, blockElm);\n\n\t\t\t\t\t\trng.setStartBefore(br);\n\t\t\t\t\t\trng.setEndBefore(br);\n\t\t\t\t\t\teditor.selection.setRng(rng);\n\n\t\t\t\t\t\treturn br;\n\t\t\t\t\t}\n\n\t\t\t\t\treturn null;\n\t\t\t\t}\n\n\t\t\t\tfunction isTextBlock(node) {\n\t\t\t\t\treturn node && editor.schema.getTextBlockElements()[node.tagName];\n\t\t\t\t}\n\n\t\t\t\tif (!rng.collapsed) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\tcontainer = rng.startContainer;\n\t\t\t\toffset = rng.startOffset;\n\t\t\t\tblockElm = dom.getParent(container, dom.isBlock);\n\t\t\t\tif (!isTextBlock(blockElm)) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\tif (container.nodeType == 1) {\n\t\t\t\t\tcontainer = container.childNodes[offset];\n\t\t\t\t\tif (container && container.tagName != 'BR') {\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\n\t\t\t\t\tif (isForward) {\n\t\t\t\t\t\tsibling = blockElm.nextSibling;\n\t\t\t\t\t} else {\n\t\t\t\t\t\tsibling = blockElm.previousSibling;\n\t\t\t\t\t}\n\n\t\t\t\t\tif (dom.isEmpty(blockElm) && isTextBlock(sibling) && dom.isEmpty(sibling)) {\n\t\t\t\t\t\tif (cloneTextBlockWithFormats(blockElm, container)) {\n\t\t\t\t\t\t\tdom.remove(sibling);\n\t\t\t\t\t\t\treturn true;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t} else if (container.nodeType == 3) {\n\t\t\t\t\tpath = NodePath.create(blockElm, container);\n\t\t\t\t\tclonedBlockElm = blockElm.cloneNode(true);\n\t\t\t\t\tcontainer = NodePath.resolve(clonedBlockElm, path);\n\n\t\t\t\t\tif (isForward) {\n\t\t\t\t\t\tif (offset >= container.data.length) {\n\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tcontainer.deleteData(offset, 1);\n\t\t\t\t\t} else {\n\t\t\t\t\t\tif (offset <= 0) {\n\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tcontainer.deleteData(offset - 1, 1);\n\t\t\t\t\t}\n\n\t\t\t\t\tif (dom.isEmpty(clonedBlockElm)) {\n\t\t\t\t\t\treturn cloneTextBlockWithFormats(blockElm, container);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}", "function pt(o){\n p(\"\\t\" + o);\n }", "static tag_lines(raw)\r\n {\r\n let lines = [];\r\n let next_is_def = false;\r\n let in_code_block = false;\r\n let in_quote_block = false;\r\n for (const [index, value] of raw.entries())\r\n {\r\n let trimmed = value.trim();\r\n if (in_code_block)\r\n {\r\n lines.push(new Line(value, 'code'))\r\n }\r\n else if (in_quote_block)\r\n {\r\n lines.push(new Line(value, 'quote'))\r\n }\r\n else if (trimmed.length === 0)\r\n {\r\n lines.push(new Line('', 'empty'));\r\n }\r\n // Titles :\r\n else if (trimmed[0] === '#')\r\n {\r\n lines.push(new Line(trimmed, 'title'));\r\n }\r\n // HR :\r\n else if ((trimmed.match(/-/g)||[]).length === trimmed.length)\r\n {\r\n lines.push(new Line('', 'separator'));\r\n }\r\n // Lists, line with the first non empty character is \"* \" or \"+ \" or \"- \" :\r\n else if (trimmed.substring(0, 2) === '* ')\r\n {\r\n lines.push(new Line(value, 'unordered_list'));\r\n }\r\n else if (trimmed.substring(0, 2) === '+ ')\r\n {\r\n lines.push(new Line(value, 'ordered_list'));\r\n }\r\n else if (trimmed.substring(0, 2) === '- ')\r\n {\r\n lines.push(new Line(value, 'reverse_list'));\r\n }\r\n // Keywords, line with the first non empty character is \"!\" :\r\n // var, const, include, require, css, html, comment\r\n else if (trimmed.startsWith('!var '))\r\n {\r\n lines.push(new Line(trimmed, 'var'));\r\n }\r\n else if (trimmed.startsWith('!const '))\r\n {\r\n lines.push(new Line(trimmed, 'const'));\r\n }\r\n else if (trimmed.startsWith('!include '))\r\n {\r\n lines.push(new Line(trimmed, 'include'));\r\n }\r\n else if (trimmed.startsWith('!require '))\r\n {\r\n lines.push(new Line(trimmed, 'require'));\r\n }\r\n else if (trimmed.startsWith('!css '))\r\n {\r\n lines.push(new Line(trimmed, 'css'));\r\n }\r\n else if (trimmed.startsWith('!html'))\r\n {\r\n lines.push(new Line(trimmed, 'html'));\r\n }\r\n else if (trimmed.substring(0, 2) === '//')\r\n {\r\n lines.push(new Line(trimmed, 'comment'));\r\n }\r\n // Block of code\r\n else if (trimmed.substring(0, 2) === '@@@')\r\n {\r\n in_code_block = !in_code_block;\r\n lines.push(new Line(value, 'code'))\r\n }\r\n else if (trimmed.substring(0, 2) === '@@' && trimmed.substring(trimmed.length-2, trimmed.length) !== '@@') // :TODO: Escaping @@ in code for Ruby. @@code@@ should be a <p> not a <pre>!\r\n {\r\n lines.push(new Line(value, 'code'));\r\n }\r\n // Block of quote\r\n else if (trimmed.substring(0, 2) === '>>>')\r\n {\r\n in_quote_block = !in_quote_block;\r\n lines.push(new Line(value, 'quote'))\r\n }\r\n else if (trimmed.substring(0, 2) === '>>')\r\n {\r\n lines.push(new Line(value, 'quote'));\r\n }\r\n // Labels\r\n else if (trimmed.substring(0, 2) === '::')\r\n {\r\n lines.push(new Line(trimmed, 'label'));\r\n }\r\n // Div (Si la ligne entière est {{ }}, c'est une div. On ne fait pas de span d'une ligne)\r\n else if (trimmed.substring(0, 2) === '{{' && trimmed.substring(trimmed.length - 2) === '}}')\r\n {\r\n lines.push(new Line(trimmed, 'div'));\r\n }\r\n // Tables\r\n else if (trimmed[0] === '|' && trimmed[trimmed.length - 1] === '|')\r\n {\r\n lines.push(new Line(trimmed, 'row'));\r\n }\r\n // Definition lists\r\n else if (trimmed.substring(0, 2) === '$ ')\r\n {\r\n lines.push(new Line(trimmed.substring(2), 'definition-header'));\r\n next_is_def = true;\r\n }\r\n else\r\n {\r\n if (!next_is_def)\r\n {\r\n lines.push(new Line(trimmed, 'text'));\r\n }\r\n else\r\n {\r\n lines.push(new Line(trimmed, 'definition-content'));\r\n next_is_def = false;\r\n }\r\n }\r\n }\r\n return lines;\r\n }", "function formatMultiDTab(textes) {\r\n\tlet textesArray = splitTextToArray(textes);\r\n\tlet newStringText = \"\";\r\n\tfor (let i = 0; i < textesArray.length; i++) {\r\n\t\tnewStringText = newStringText + \"\\n\" + reverseArrayIndex(textesArray[i]);\r\n\t}\r\n\treturn newStringText;\r\n}", "isTextFile(file) {\n let extensions = [\"doc\", \"docx\", \"odt\", \"pdf\", \"rtf\", \"txt\"];\n return extensions.includes(file.extension);\n }", "isStringUnIndentedCollectionItem() {\n return this.currentLine === '-' || this.currentLine.slice(0, 2) === '- ';\n }", "function is_node_block(node) {\n if (node.nodeType != 1)\n return false;\n return (Pattern.NodeName.line.test(node.nodeName) ||\n Pattern.NodeName.li.test(node.nodeName) ||\n Pattern.NodeName.pre.test(node.nodeName));\n }", "loadTableFromCSVFile(seperator){\n var seperator = this.csvSeperator;\n var firstLine = [];\n\n var indexTime = -1;\n var indexLow = -1;\n var indexHigh = -1;\n var indexOpen = -1;\n var indexClose = -1;\n var indexVolume = -1;\n\n var loadedIntervalls = [];\n\n fs.readFileSync(this.csvFilePath).toString().split('\\n').forEach(function (line) { \n \n var lineArray = line.split(seperator);\n\n if (firstLine.length == 0){\n\n indexTime = lineArray.indexOf(\"time\");\n indexLow = lineArray.indexOf(\"low\");\n indexHigh = lineArray.indexOf(\"high\");\n indexOpen = lineArray.indexOf(\"open\");\n indexClose = lineArray.indexOf(\"close\");\n indexVolume = lineArray.indexOf(\"volume\");\n\n //check availability needed gdax columns\n if ((indexTime != -1) && (indexLow != -1) && (indexHigh != -1) && (indexOpen != -1) && (indexClose != -1) && (indexVolume != -1) ){\n //continue\n firstLine = lineArray;\n }else{\n throw new Error(\"First line of csv needs to contain: time, low, high, open, close, volume. Additional columns are possible but will not be loaded!\");\n }\n \n }else{\n //add row by row to the TradeTable json object\n if (lineArray.length >=6){\n loadedIntervalls.push({ index: loadedIntervalls.length ,\n time: Number(lineArray[indexTime]), \n low: Number(lineArray[indexLow]), \n high: Number(lineArray[indexHigh]), \n open: Number(lineArray[indexOpen]), \n close: Number(lineArray[indexClose]), \n volume: Number(lineArray[indexVolume])});\n }\n\n \n }\n\n })\n\n this.data.intervalls = loadedIntervalls;\n }", "stringify(chunk) {\n var column, columns, containsEscape, containsQuote, containsRowDelimiter, containsdelimiter, csvrecord, delimiter, err, escape, field, header, i, j, l, len, m, options, quote, quoted, quotedMatch, quotedString, quoted_empty, quoted_match, quoted_string, record, record_delimiter, ref, ref1, regexp, shouldQuote, value;\n if (typeof chunk !== 'object') {\n return chunk;\n }\n ({columns, header} = this.options);\n record = [];\n // Record is an array\n if (Array.isArray(chunk)) {\n if (columns) {\n // We are getting an array but the user has specified output columns. In\n // this case, we respect the columns indexes\n chunk.splice(columns.length);\n }\n// Cast record elements\n for (i = j = 0, len = chunk.length; j < len; i = ++j) {\n field = chunk[i];\n [err, value] = this.__cast(field, {\n index: i,\n column: i,\n records: this.info.records,\n header: header && this.info.records === 0\n });\n if (err) {\n this.emit('error', err);\n return;\n }\n record[i] = [value, field];\n }\n } else {\n // Record is a literal object\n if (columns) {\n for (i = l = 0, ref = columns.length; (0 <= ref ? l < ref : l > ref); i = 0 <= ref ? ++l : --l) {\n field = get(chunk, columns[i].key);\n [err, value] = this.__cast(field, {\n index: i,\n column: columns[i].key,\n records: this.info.records,\n header: header && this.info.records === 0\n });\n if (err) {\n this.emit('error', err);\n return;\n }\n record[i] = [value, field];\n }\n } else {\n for (column in chunk) {\n field = chunk[column];\n [err, value] = this.__cast(field, {\n index: i,\n column: columns[i].key,\n records: this.info.records,\n header: header && this.info.records === 0\n });\n if (err) {\n this.emit('error', err);\n return;\n }\n record.push([value, field]);\n }\n }\n }\n csvrecord = '';\n for (i = m = 0, ref1 = record.length; (0 <= ref1 ? m < ref1 : m > ref1); i = 0 <= ref1 ? ++m : --m) {\n [value, field] = record[i];\n if (typeof value === 'string') {\n options = this.options;\n } else if (isObject(value)) {\n ({value, ...options} = value);\n if (!(typeof value === 'string' || value === void 0 || value === null)) {\n this.emit('error', Error(`Invalid Casting Value: returned value must return a string, null or undefined, got ${JSON.stringify(value)}`));\n return;\n }\n options = {...this.options, ...options};\n } else if (value === void 0 || value === null) {\n options = this.options;\n } else {\n this.emit('error', Error(`Invalid Casting Value: returned value must return a string, an object, null or undefined, got ${JSON.stringify(value)}`));\n return;\n }\n ({delimiter, escape, quote, quoted, quoted_empty, quoted_string, quoted_match, record_delimiter} = options);\n if (value) {\n if (typeof value !== 'string') {\n this.emit('error', Error(`Formatter must return a string, null or undefined, got ${JSON.stringify(value)}`));\n return null;\n }\n containsdelimiter = delimiter.length && value.indexOf(delimiter) >= 0;\n containsQuote = (quote !== '') && value.indexOf(quote) >= 0;\n containsEscape = value.indexOf(escape) >= 0 && (escape !== quote);\n containsRowDelimiter = value.indexOf(record_delimiter) >= 0;\n quotedString = quoted_string && typeof field === 'string';\n quotedMatch = quoted_match && typeof field === 'string' && quoted_match.filter(function(quoted_match) {\n if (typeof quoted_match === 'string') {\n return value.indexOf(quoted_match) !== -1;\n } else {\n return quoted_match.test(value);\n }\n });\n quotedMatch = quotedMatch && quotedMatch.length > 0;\n shouldQuote = containsQuote || containsdelimiter || containsRowDelimiter || quoted || quotedString || quotedMatch;\n if (shouldQuote && containsEscape) {\n regexp = escape === '\\\\' ? new RegExp(escape + escape, 'g') : new RegExp(escape, 'g');\n value = value.replace(regexp, escape + escape);\n }\n if (containsQuote) {\n regexp = new RegExp(quote, 'g');\n value = value.replace(regexp, escape + quote);\n }\n if (shouldQuote) {\n value = quote + value + quote;\n }\n csvrecord += value;\n } else if (quoted_empty || ((quoted_empty == null) && field === '' && quoted_string)) {\n csvrecord += quote + quote;\n }\n if (i !== record.length - 1) {\n csvrecord += delimiter;\n }\n }\n return csvrecord;\n }", "isThead() {\n return true\n }", "function processReorderConversion(){\n let reordered_tsv = reOrderTable(reorder_table,template_header,reorder_header);\n downloadTSV(reordered_tsv,`reordered_tsv.tsv`);\n \n }", "function printBlockString(value, isDescription) {\n var escaped = value.replace(/\"\"\"/g, '\\\\\"\"\"');\n return (value[0] === ' ' || value[0] === '\\t') && value.indexOf('\\n') === -1 ? '\"\"\"' + escaped.replace(/\"$/, '\"\\n') + '\"\"\"' : '\"\"\"\\n' + (isDescription ? escaped : indent(escaped)) + '\\n\"\"\"';\n }", "function isStatementOrBlock() {\n\t if (this.parentPath.isLabeledStatement() || t.isBlockStatement(this.container)) {\n\t return false;\n\t } else {\n\t return _lodashCollectionIncludes2[\"default\"](t.STATEMENT_OR_BLOCK_KEYS, this.key);\n\t }\n\t}", "function isStatementOrBlock() {\n\t if (this.parentPath.isLabeledStatement() || t.isBlockStatement(this.container)) {\n\t return false;\n\t } else {\n\t return _lodashCollectionIncludes2[\"default\"](t.STATEMENT_OR_BLOCK_KEYS, this.key);\n\t }\n\t}", "function isStatementOrBlock() {\n\t if (this.parentPath.isLabeledStatement() || t.isBlockStatement(this.container)) {\n\t return false;\n\t } else {\n\t return _lodashCollectionIncludes2[\"default\"](t.STATEMENT_OR_BLOCK_KEYS, this.key);\n\t }\n\t}", "function isStatementOrBlock() {\n\t if (this.parentPath.isLabeledStatement() || t.isBlockStatement(this.container)) {\n\t return false;\n\t } else {\n\t return _lodashCollectionIncludes2[\"default\"](t.STATEMENT_OR_BLOCK_KEYS, this.key);\n\t }\n\t}", "function isStatementOrBlock() {\n\t if (this.parentPath.isLabeledStatement() || t.isBlockStatement(this.container)) {\n\t return false;\n\t } else {\n\t return _lodashCollectionIncludes2[\"default\"](t.STATEMENT_OR_BLOCK_KEYS, this.key);\n\t }\n\t}", "_transform(chunk, encoding, callback) {\n var base, e;\n if (this.state.stop === true) {\n return;\n }\n // Chunk validation\n if (!(Array.isArray(chunk) || typeof chunk === 'object')) {\n this.state.stop = true;\n return callback(Error(`Invalid Record: expect an array or an object, got ${JSON.stringify(chunk)}`));\n }\n // Detect columns from the first record\n if (this.info.records === 0) {\n if (Array.isArray(chunk)) {\n if (this.options.header === true && !this.options.columns) {\n this.state.stop = true;\n return callback(Error('Undiscoverable Columns: header option requires column option or object records'));\n }\n } else {\n if ((base = this.options).columns == null) {\n base.columns = this.normalize_columns(Object.keys(chunk));\n }\n }\n }\n if (this.info.records === 0) {\n // Emit the header\n this.headers();\n }\n try {\n // Emit and stringify the record if an object or an array\n this.emit('record', chunk, this.info.records);\n } catch (error) {\n e = error;\n this.state.stop = true;\n return this.emit('error', e);\n }\n // Convert the record into a string\n if (this.options.eof) {\n chunk = this.stringify(chunk);\n if (chunk == null) {\n return;\n }\n chunk = chunk + this.options.record_delimiter;\n } else {\n chunk = this.stringify(chunk);\n if (chunk == null) {\n return;\n }\n if (this.options.header || this.info.records) {\n chunk = this.options.record_delimiter + chunk;\n }\n }\n // Emit the csv\n this.info.records++;\n this.push(chunk);\n return callback();\n }", "function hasTable(input)\n{\n\treturn (input.indexOf('<table>') != -1 && input.indexOf('</table>') != -1);\n}", "function trimTabs(data) {\n\tvar lines = data.split(/\\r?\\n/);\n\tvar output = \"\";\n\tfor (var i=0; i<lines.length; i++) {\n\t\tlet line = lines[i].replace(/\\t+$/, \"\");\n\t\tif (line.match(/^\\s*$/)) {\n\t\t\t// ignoring blank lines\n\t\t\tcontinue;\n\t\t}\n\t\tif (line.match(/^!!![^\\s]+:\\t/)) {\n\t\t\tline = line.replace(/\\t/, \" \");\n\t\t}\n\t\toutput += line + \"\\n\";\n\t}\n\treturn output;\n}", "function isStatementOrBlock() {\n if (this.parentPath.isLabeledStatement() || t.isBlockStatement(this.container)) {\n return false;\n } else {\n return _lodashCollectionIncludes2[\"default\"](t.STATEMENT_OR_BLOCK_KEYS, this.key);\n }\n}", "function impostaStanziamenti(importo, tabella) {\n \tvar anno = importo.annoCompetenza,\n tabellaStanziamenti = tabella.first().children(\"th\").slice(1);\n if(anno === parseInt(tabellaStanziamenti.eq(0).html(), 10)) {\n impostaDati(importo, 0);\n } else if (anno === parseInt(tabellaStanziamenti.eq(1).html(), 10)) {\n impostaDati(importo, 1);\n } else if (anno === parseInt(tabellaStanziamenti.eq(2).html(), 10)) {\n impostaDati(importo, 2);\n }\n }", "function isWikiTreeTurboJSON(element) {\n try {\n const o = JSON.parse(element.innerText);\n return o.hasOwnProperty('wikiTreeTurbo');\n }\n catch (err) {\n return false;\n }\n}", "function filaBuida(tr) {\n\tconsole.log(tr.children);\n\tfor (var i=0; i<tr.chidren.length; i++) {\n\t\tconsole.log(tr.children[i].textContent);\n\t\tif (tr.children[i].textContent.length > 0) {\n\t\t\treturn false;\n\t\t}\n\t}\n\treturn true;\n}", "function tsv2json(string) {\r\n let json = [];\r\n string = string.replace(/['\"]+/g, '');\r\n let array = string.split('\\n');\r\n let headers = array[0].split('\\t');\r\n for (var i = 1; i < array.length - 1; i++) {\r\n let data = array[i].split('\\t');\r\n let obj = {};\r\n for (var j = 0; j < data.length; j++) {\r\n obj[headers[j].trim()] = data[j].trim();\r\n }\r\n json.push(obj);\r\n }\r\n return json;\r\n}", "isTag(tag, lineMatchIndex, line) {\n let prevChar = line.charAt(lineMatchIndex - 1)\n let nextChar = line.charAt(lineMatchIndex + tag.length)\n\n if ((nextChar == ':' || nextChar == ']' || (this._config._whitespaceTagging && (nextChar == ' ' || nextChar == \"\\t\"))) && (prevChar !== '_')) {\n return true\n } else {\n return false\n }\n }", "_controlUploadFile(event) {\n let file = event.target.files[0];\n let fileName = file.name;\n let fileType = fileName.split(\".\")[fileName.split(\".\").length - 1];\n\n if(this.options.tableRender) {\n let table = this._componentRoot.querySelector('[data-component=\"table-custom\"]');\n\n if(table) {\n this._inputData = [];\n table.parentNode.removeChild(table);\n }\n\n this.options.tableRender = false;\n }\n\n let chooseFields = this._componentRoot.querySelector(\"#chooseFields\");\n\n if (chooseFields) {\n chooseFields.parentNode.removeChild(chooseFields);\n }\n\n if(fileType !== 'csv') {\n\n noty({\n text: 'Файл ' + fileName + ' некорректный, выберите корректный файл, формата csv.',\n type: 'error',\n timeout: 3000\n });\n\n return;\n\n } else {\n\n noty({\n text: 'Был выбран файл ' + fileName + '.',\n type: 'success',\n timeout: 3000\n });\n }\n\n this._parseCSV(event, file);\n }", "get type() {\n return typeof this._content == \"number\" ? exports.BlockType.Text :\n Array.isArray(this._content) ? this._content : this._content.type;\n }", "function printBlockString(value, isDescription) {\n var escaped = value.replace(/\"\"\"/g, '\\\\\"\"\"');\n return (value[0] === ' ' || value[0] === '\\t') && value.indexOf('\\n') === -1 ? \"\\\"\\\"\\\"\".concat(escaped.replace(/\"$/, '\"\\n'), \"\\\"\\\"\\\"\") : \"\\\"\\\"\\\"\\n\".concat(isDescription ? escaped : indent(escaped), \"\\n\\\"\\\"\\\"\");\n}", "function isInlineTemplate(tNode) {\n return tNode.type === 4\n /* Container */\n && tNode.value !== NG_TEMPLATE_SELECTOR;\n }", "function isInlineTemplate(tNode) {\n return tNode.type === 4 /* Container */ && tNode.value !== NG_TEMPLATE_SELECTOR;\n}", "function isInlineTemplate(tNode) {\n return tNode.type === 4 /* Container */ && tNode.value !== NG_TEMPLATE_SELECTOR;\n}", "function isInlineTemplate(tNode) {\n return tNode.type === 4 /* Container */ && tNode.value !== NG_TEMPLATE_SELECTOR;\n}", "function isInlineTemplate(tNode) {\n return tNode.type === 4 /* Container */ && tNode.value !== NG_TEMPLATE_SELECTOR;\n}", "function isInlineTemplate(tNode) {\n return tNode.type === 4 /* Container */ && tNode.value !== NG_TEMPLATE_SELECTOR;\n}", "function isInlineTemplate(tNode) {\n return tNode.type === 4 /* Container */ && tNode.value !== NG_TEMPLATE_SELECTOR;\n}", "function getBlockStyle(block) {\n const type = block.getType()\n if(type.indexOf('text-align-') === 0) return type\n return null\n}", "blockToTree(p) {\n\t\tlet point = p.clone();\n\t\tconst oldY = p.y;\n\t\tlet bottom;\n\t\tlet top;\n\t\twhile (!bottom) {\n\t\t\tpoint.subtract(new Vec3(0, 1, 0));\n\t\t\tlet block = this.bot.blockAt(point);\n\t\t\tif (!block.name.match(/_log$/)) {\n\t\t\t\tif (block.name === 'dirt') {\n\t\t\t\t\tbottom = block.position.clone().add(new Vec3(0, 1, 0));\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\t//console.log(`Block: ${p} is not a tree because it does not have dirt below it's base`);\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tpoint.y = oldY;\n\t\twhile (!top) {\n\t\t\tpoint.add(new Vec3(0, 1, 0));\n\t\t\tconst block = this.bot.blockAt(point);\n\t\t\tif (!block.name.match(/_log$/)) {\n\t\t\t\tif (block.name.match(/_leaves$/)) {\n\t\t\t\t\ttop = point.clone().subtract(new Vec3(0, 1, 0));\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\t//console.log(`Block: ${p} is not a tree because it does not have leaves above it's top`);\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tconst tree = Array();\n\t\tfor (var i = bottom.y; i <= top.y; i++) {\n\t\t\tconst block = this.bot.blockAt(new Vec3(bottom.x, i, bottom.z));\n\t\t\ttree.push(block);\n\t\t}\n\t\treturn tree;\n\t}", "identify() {\n let output = this.default;\n let hasQuotes = false;\n let hasNoQuotes = false;\n\n // Determine if any have quotes\n this.objectBlocks.forEach(block => {\n if (!hasQuotes) {\n hasQuotes = !!block.match(/['\"]\\s*:/);\n }\n\n if (!hasNoQuotes) {\n hasNoQuotes = !!block.match(/[^'\"]\\s*:/);\n }\n });\n\n // Set consistent if we don't mix quotes\n if ((!hasQuotes && hasNoQuotes) || (hasQuotes && !hasNoQuotes)) {\n output = 'consistent';\n }\n\n return output;\n }", "function parse_TxO(blob, length, opts) {\n var s = blob.l;\n var texts = \"\";\n\n try {\n blob.l += 4;\n var ot = (opts.lastobj || {\n cmo: [0, 0]\n }).cmo[1];\n var controlInfo; // eslint-disable-line no-unused-vars\n\n if ([0, 5, 7, 11, 12, 14].indexOf(ot) == -1) blob.l += 6;else controlInfo = parse_ControlInfo(blob, 6, opts);\n var cchText = blob.read_shift(2);\n /*var cbRuns = */\n\n blob.read_shift(2);\n /*var ifntEmpty = */\n\n parseuint16(blob, 2);\n var len = blob.read_shift(2);\n blob.l += len; //var fmla = parse_ObjFmla(blob, s + length - blob.l);\n\n for (var i = 1; i < blob.lens.length - 1; ++i) {\n if (blob.l - s != blob.lens[i]) throw new Error(\"TxO: bad continue record\");\n var hdr = blob[blob.l];\n var t = parse_XLUnicodeStringNoCch(blob, blob.lens[i + 1] - blob.lens[i] - 1);\n texts += t;\n if (texts.length >= (hdr ? cchText : 2 * cchText)) break;\n }\n\n if (texts.length !== cchText && texts.length !== cchText * 2) {\n throw new Error(\"cchText: \" + cchText + \" != \" + texts.length);\n }\n\n blob.l = s + length;\n /* [MS-XLS] 2.5.272 TxORuns */\n //\tvar rgTxoRuns = [];\n //\tfor(var j = 0; j != cbRuns/8-1; ++j) blob.l += 8;\n //\tvar cchText2 = blob.read_shift(2);\n //\tif(cchText2 !== cchText) throw new Error(\"TxOLastRun mismatch: \" + cchText2 + \" \" + cchText);\n //\tblob.l += 6;\n //\tif(s + length != blob.l) throw new Error(\"TxO \" + (s + length) + \", at \" + blob.l);\n\n return {\n t: texts\n };\n } catch (e) {\n blob.l = s + length;\n return {\n t: texts\n };\n }\n }", "function isSingleOutput(csvhead) {\r\n var singlenums = 0;\r\n for (var key in csvhead[0]) {\r\n if (csvhead[0][key] == 'single') {\r\n ++singlenums;\r\n }\r\n }\r\n\r\n return singlenums == 1;\r\n}", "function checkFileType(file, cb) {\n const filetypes = /csv/;\n const extname = filetypes.test(path.extname(file.originalname).toLocaleLowerCase());\n const mimetype = filetypes.test(file.mimetype);\n\n if (mimetype && extname){\n return cb(null, true);\n }else{\n cb('Error: CSV Files only');\n }\n}", "function printBlockString(value, isDescription) {\n var escaped = value.replace(/\"\"\"/g, '\\\\\"\"\"');\n return (value[0] === ' ' || value[0] === '\\t') && value.indexOf('\\n') === -1 ? '\"\"\"' + escaped.replace(/\"$/, '\"\\n') + '\"\"\"' : '\"\"\"\\n' + (isDescription ? escaped : indent(escaped)) + '\\n\"\"\"';\n}", "function printBlockString(value, isDescription) {\n var escaped = value.replace(/\"\"\"/g, '\\\\\"\"\"');\n return (value[0] === ' ' || value[0] === '\\t') && value.indexOf('\\n') === -1 ? '\"\"\"' + escaped.replace(/\"$/, '\"\\n') + '\"\"\"' : '\"\"\"\\n' + (isDescription ? escaped : indent(escaped)) + '\\n\"\"\"';\n}", "function printBlockString(value, isDescription) {\n var escaped = value.replace(/\"\"\"/g, '\\\\\"\"\"');\n return (value[0] === ' ' || value[0] === '\\t') && value.indexOf('\\n') === -1 ? '\"\"\"' + escaped.replace(/\"$/, '\"\\n') + '\"\"\"' : '\"\"\"\\n' + (isDescription ? escaped : indent(escaped)) + '\\n\"\"\"';\n}", "function printBlockString(value, isDescription) {\n var escaped = value.replace(/\"\"\"/g, '\\\\\"\"\"');\n return (value[0] === ' ' || value[0] === '\\t') && value.indexOf('\\n') === -1 ? '\"\"\"' + escaped.replace(/\"$/, '\"\\n') + '\"\"\"' : '\"\"\"\\n' + (isDescription ? escaped : indent(escaped)) + '\\n\"\"\"';\n}", "function printBlockString(value, isDescription) {\n var escaped = value.replace(/\"\"\"/g, '\\\\\"\"\"');\n return (value[0] === ' ' || value[0] === '\\t') && value.indexOf('\\n') === -1 ? '\"\"\"' + escaped.replace(/\"$/, '\"\\n') + '\"\"\"' : '\"\"\"\\n' + (isDescription ? escaped : indent(escaped)) + '\\n\"\"\"';\n}", "function isInlineTemplate(tNode) {\n return tNode.type === 4\n /* Container */\n && tNode.value !== NG_TEMPLATE_SELECTOR;\n}" ]
[ "0.8859122", "0.8845361", "0.88139796", "0.88139796", "0.87741005", "0.60407025", "0.5190595", "0.5138938", "0.50869346", "0.50047666", "0.4966861", "0.4956511", "0.49283457", "0.4926797", "0.49011958", "0.49008223", "0.48291752", "0.4825572", "0.48156893", "0.48068026", "0.4762295", "0.47622553", "0.47584796", "0.4758284", "0.47018436", "0.46605614", "0.46585336", "0.46497816", "0.46455517", "0.45798063", "0.45588118", "0.45483378", "0.4540758", "0.45277497", "0.4524823", "0.45197693", "0.44993928", "0.44931686", "0.44649318", "0.44533098", "0.44473606", "0.4441786", "0.44390595", "0.44218835", "0.44218835", "0.44218835", "0.43989822", "0.4398534", "0.43920135", "0.4385844", "0.43858045", "0.43849078", "0.4378184", "0.43715328", "0.43467543", "0.43428147", "0.43418846", "0.4339475", "0.4339475", "0.4339475", "0.4339475", "0.4339475", "0.43342447", "0.43110368", "0.43102944", "0.43100482", "0.430757", "0.43068117", "0.4306103", "0.43031627", "0.43023103", "0.4300174", "0.42935055", "0.42911908", "0.42826542", "0.42810342", "0.42810342", "0.42810342", "0.42810342", "0.42810342", "0.42810342", "0.42807367", "0.4277868", "0.42761943", "0.42754477", "0.42682362", "0.4257495", "0.42563403", "0.42563403", "0.42563403", "0.42563403", "0.42563403", "0.4255048" ]
0.8741611
12
although it might be not accurate.
function getScales(xyMinMaxCurr, xyMinMaxOrigin) { var sizeCurr = getSize(xyMinMaxCurr); var sizeOrigin = getSize(xyMinMaxOrigin); var scales = [sizeCurr[0] / sizeOrigin[0], sizeCurr[1] / sizeOrigin[1]]; isNaN(scales[0]) && (scales[0] = 1); isNaN(scales[1]) && (scales[1] = 1); return scales; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private internal function m248() {}", "function returnsNonSmi(){ return 0.25; }", "get newLength() {\n let result = 0;\n for (let i = 0; i < this.sections.length; i += 2) {\n let ins = this.sections[i + 1];\n result += ins < 0 ? this.sections[i] : ins;\n }\n return result;\n }", "_calcMovePrecision() {\n let precision = (this.o.maxVal - this.o.minVal) / 127;\n return precision;\n }", "_getClosest(val) {\n return Math.floor(val / 17) * 17;\n }", "Ec(){\r\n return 57*Math.pow(this.fc,0.5)\r\n }", "snpMDG(v) {\n // console.log(v)\n // console.log(Math.round(v/this.cellSize/this.scale) * this.cellSize/this.scale)\n return Math.round(v/this.cellSize) * this.cellSize\n }", "value() {return 0}", "static getRefreshCost() {\n let notComplete = player.completedQuestList.filter((elem) => { return !elem(); }).length;\n return Math.floor(250000 * Math.LOG10E * Math.log(Math.pow(notComplete, 4) + 1));\n }", "lengthSq() {\n return this.w * this.w + this.xyz.clone().lengthSq();\n }", "function j(){var e=s.getBoundingClientRect(),r=\"offset\"+[\"Width\",\"Height\"][t.ort]\nreturn 0===t.ort?e.width||s[r]:e.height||s[r]}", "function k538(matches) { return 250 / Math.pow(matches + 5, .4); }", "getTopUnit(){return this.__topUnit}", "Cr(){\n return 0.721 + 0.00725*(this.Lj*12/this.Dj)\n }", "static private internal function m121() {}", "function t4(){\n return (dataArray[numPoints-1][1]-dataArray[0][1])/(numPoints-1);\n }", "computeBestSupportingPosition() {\n\n\t\tthis._supportSpotCalculator.computeBestSupportingPosition();\n\n\t}", "Fsv(){\n if(this.Fyv == 60){\n return 32000\n }\n else{\n return 20000\n }\n }", "get y() { return init.h - inProptn(1, 7) * 1.5; }", "get _physicalEnd(){return(this._physicalStart+this._physicalCount-1)%this._physicalCount;}", "p(pos) { return Math.ceil((pos-1)/this.d); }", "stringX() {return this.x - 0.5*this.r/2;}", "Nr(){\n return this.Lj*12/6+1\n }", "get estimatedHeight() { return -1; }", "get referencePixelsPerUnit() {}", "oblivionFactor() {\n return Math.pow(2, - this.timestep / this.HALFTIME);\n }", "private public function m246() {}", "promedio(){\n let promedio = 0;\n let i =0;\n for(let x of this._data){\n i = i++;\n promedio = promedio + x;\n }\n return promedio/i;\n }", "transient final private internal function m170() {}", "get normal (){\n\t\treturn this.dir.perp(1);\t\t\t\n\t}", "wu_nc(){\n return (1.2*this.DL + 1.6*this.CL)*(this.Sj/12)\n }", "function R(){var e=s.getBoundingClientRect(),n=\"offset\"+[\"Width\",\"Height\"][t.ort];return 0===t.ort?e.width||s[n]:e.height||s[n]}", "get _physicalEnd(){return(this._physicalStart+this._physicalCount-1)%this._physicalCount}", "function P(e,t){return e.line-t.line||e.ch-t.ch}", "function S(){var e=le.getBoundingClientRect(),t=\"offset\"+[\"Width\",\"Height\"][n.ort];return 0===n.ort?e.width||le[t]:e.height||le[t]}", "function q(){var e=p.getBoundingClientRect(),t=\"offset\"+[\"Width\",\"Height\"][r.ort];return 0===r.ort?e.width||p[t]:e.height||p[t]}", "function calcPerim() {\n\tthis.perimetr=0;\n\tfor(key in this){\n\t\tif(checkisNum(this[key])&&key!=='perimetr'){\n\t\t\tthis.perimetr+=this[key];\n\t\t}\n\t}\n\treturn this.perimetr;\n}", "function getOffset() {\n\t\t\tif (!vm.current) {\n\t\t\t\treturn 0;\n\t\t\t}\n\t\t\t//console.log(vm.getRank(vm.current));\n\t\t\treturn (vm.getRank(vm.current) - 2) * 17;\n\t\t}", "Deff(){\n return 5*(this.wt()*this.Sj/(12*12))*Math.pow(this.Lj,4)*Math.pow(12,4)/(384*29000000*this.Ieff())\n }", "function N() {\n var t = p.getBoundingClientRect(),\n e = \"offset\" + [\"Width\", \"Height\"][i.ort];\n return 0 === i.ort ? t.width || p[e] : t.height || p[e]\n }", "static approxEq(x, y) {\nvar DIFF, EPS, SIZE;\n//--------\nEPS = 5e-5;\nDIFF = Math.abs(x - y);\nSIZE = Math.max(Math.abs(x), Math.abs(y));\nif (SIZE <= 1) {\nreturn DIFF < EPS;\n} else {\nreturn DIFF / SIZE < EPS;\n}\n}", "static private protected internal function m118() {}", "enhetspris() {\n return this.pris / this.antall;\n }", "function calcPrestigeLevel() {\n\n}", "Ds(){\n return (12*Math.pow(this.hc+this.hd/2,3))/(12*this.n())\n }", "_a(){\n\t\t\treturn Math.max(Math.min(0.1*this.B,0.4*this.z),0.04*this.B,3)\n }", "getBackendDataLen(x0,y0,x1,y1){\n\treturn Math.max(x1 - x0, y1 - y0);\n }", "function countCoordinate (val){\n return (val * side ) + (side / 2);\n}", "get horizontalSpeed () { \n if (this.pointers.length > 0) \n return this.pointers.reduce((sum, pointer) => {return sum+pointer.horizontalSpeed}, 0) / this.pointers.length;\n else\n return 0;\n }", "get pointerMoveTolerance() {\n return 1;\n }", "get pointerMoveTolerance() {\n return 1;\n }", "wu_c(){\n return (1.2*(this.DL+this.SDL) + 1.6*this.LL)*(this.Sj/12)\n }", "function _findMeasurements () {\n // Capture the header height and the sub nav offset\n if ($header.length > 0 && $banner.length > 0) {\n // headerHeight = $header.outerHeight();\n subnavOffsetTop = $banner.outerHeight();\n }\n\n }", "function estimatedComparisons() {\n\tn = idList.length;\n\tresult = n * Math.log(n) - Math.pow(2, Math.log(n)) + 1;\n\treturn Math.floor(result);\n}", "blocksTravelled(){\n let horizontal = Math.abs(eastWest.indexOf(this.beginningLocation.horizontal) - eastWest.indexOf(this.endingLocation.horizontal))\n let vertical = Math.abs(parseInt(this.beginningLocation.vertical)-parseInt(this.endingLocation.vertical))\n return (horizontal + vertical);\n }", "length() {\n return Math.sqrt(this.w * this.w + this.xyz.clone().lengthSq() );\n }", "function randomOffset() {\r\n\r\n\t\treturn ( Math.random() - 0.5 ) * 2 * 1e-6;\r\n\r\n\t}", "getPreviousIntervalTotalPoints() {\n let totalPoints = 0;\n this.previousIntervalPoints.forEach(element => {\n totalPoints += element.totalPoints;\n });\n return totalPoints;\n }", "function getRatio() {\n\tlet TradePoint = findTradePoint()\n\tlet Close = findClosePoint()\n\n\tlet Ratio = TradePoint - Close\n\treturn Ratio\n}", "function getRemainingStomach() {\n return (0, _kolmafia.fullnessLimit)() - (0, _kolmafia.myFullness)();\n}", "calcValue() {\n const trackRatio = this.normalize(this.thumb.position().left, 0, this.track.innerWidth() - (this.thumbOffset * 2));\n return (trackRatio * (this.max - this.min)) + this.min;\n }", "static get THRESHOLD () {\n return 9;\n }", "function frameCorrected(value) {\n return Math.floor(value / numerator) * numerator;\n }", "lifeExpectancyJupiter() {\n let jovianLifeExpectancy = Math.floor(this.lifeExpectancy/11.86);\n return jovianLifeExpectancy;\n }", "function isCorrectPercentage(){\n let x = table.children[0];\n let theSpot;\n let leftD, leftM, leftU, upM, rightU, rightM, rightD, downM;\n for(let i=0; i<val; i++){\n for(let j=0; j<val; j++){\n let totalX = 0;\n let totalY = 0;\n theSpot = x.children[i].children[j];\n if(i!=0 && j!=0){\n leftD = x.children[i-1].children[j-1];\n }if(i!=0){\n leftM = x.children[i-1].children[j];\n }if(i!=0 && j<val-1){\n leftU = x.children[i-1].children[j+1];\n }if(j<val-1){\n upM = x.children[i].children[j+1];\n }if(i<val-1 && j!=0){\n rightU = x.children[i+1].children[j+1];\n }if(i<val-1){\n rightM = x.children[i+1].children[j];\n }if(i<val-1 && j!=0){\n rightD = x.children[i+1].children[j-1];\n }if(i!=0){\n downM = x.children[i].children[j-1];\n }\n if(theSpot.innerHTML == \"1\"){\n if(typeof(leftD) != \"undefined\"){\n if(leftD.innerHTML == \"1\"){\n totalX++;\n }}if(typeof(leftM) != \"undefined\"){\n if(leftM.innerHTML == \"1\"){\n totalX++;\n }}if(typeof(leftU) != \"undefined\"){\n if(leftU.innerHTML == \"1\"){\n totalX++;\n }}if(typeof(upM) != \"undefined\"){\n if(upM.innerHTML == \"1\"){\n totalX++;\n }}if(typeof(rightU) != \"undefined\"){\n if(rightU.innerHTML == \"1\"){\n totalX++;\n }}if(typeof(rightM) != \"undefined\"){\n if(rightM.innerHTML == \"1\"){\n totalX++;\n }}if(typeof(rightD) != \"undefined\"){\n if(rightD.innerHTML == \"1\"){\n totalX++;\n }}if(typeof(downM) != \"undefined\"){\n if(downM.innerHTML == \"1\"){\n totalX++;\n }}\n }if(theSpot.innerHTML == \"2\"){\n if(typeof(leftD) != \"undefined\"){\n if(leftD.innerHTML == \"2\"){\n totalY++;\n }}if(typeof(leftM) != \"undefined\"){\n if(leftM.innerHTML == \"2\"){\n totalY++;\n }}if(typeof(leftU) != \"undefined\"){\n if(leftU.innerHTML == \"2\"){\n totalY++;\n }}if(typeof(upM) != \"undefined\"){\n if(upM.innerHTML == \"2\"){\n totalY++;\n }}if(typeof(rightU) != \"undefined\"){\n if(rightU.innerHTML == \"2\"){\n totalY++;\n }}if(typeof(rightM) != \"undefined\"){\n if(rightM.innerHTML == \"2\"){\n totalY++;\n }}if(typeof(rightD) != \"undefined\"){\n if(rightD.innerHTML == \"2\"){\n totalY++;\n }}if(typeof(downM) != \"undefined\"){\n if(downM.innerHTML == \"2\"){\n totalY++;\n }}\n }\n console.log(totalX);\n console.log(totalY);\n if(totalX<(threshold.value*8)){\n theSpot.style.backgroundColor = \"#ffffff\";\n theSpot.innerHTML = \"0\";\n changeLocation(popXcolor.value);\n }if(totalY<(threshold.value*8)){\n theSpot.style.backgroundColor = \"#ffffff\";\n theSpot.innerHTML = \"0\";\n changeLocation(popYcolor.value);\n }\n }\n }\n /**\n * This function changes the location of the population to a vacant spot\n * @param {*} color \n */\n function changeLocation(color){\n let x = table.children[0];\n let theSpot;\n for (let i=0;i<val;i++){\n for(let j=0;j<val;j++){\n theSpot = x.children[i].children[j];\n if(theSpot.innerHTML == \"0\"){\n theSpot.style.backgroundColor = color;\n thePlace.style.color = \"#FFFFFF\";\n break;\n }\n }\n }\n }\n}", "thresholdMet() {}", "thresholdMet() {}", "offset() {\n if (this.overlap) return this.dot ? 8 : 12;\n return this.dot ? 2 : 4;\n }", "transient protected internal function m189() {}", "function getI(name,un_name) \n{\n\tvar x=getVar(name);\n\tvar unit=getVtext(un_name);\n\tif(\"mA\"==unit) return x/=1e3;\n\tif(\"A\"==unit) return x;\n\tif(\"uA\"==unit) return x/=1e6;\n\tif(\"pA\"==unit) return x/=1e9;\n\treturn x;\n}", "function randomOffset() {\n\t\t\treturn ( Math.random() - 0.5 ) * 2 * 1e-6;\n\t\t}", "function PropulsionUnit() {\n\t}", "get len() { // added to normailze the speed of the ball when it starts\n\t\treturn Math.sqrt(this.x * this.x + this.y * this.y);\n\t}", "overTime(){\n\t\t//\n\t}", "function findLow() {\n\n}", "epsilon() {\n return super.epsilon();\n }", "function getaim() {\n\tvar aim = marks[misto]+markaim;\n\tif (aim > 16) {aim -= 16; }\n\tif (aim < 0) {aim += 16; }\n\treturn aim;\n}", "function ee(t){return t.length<3?0:Math.abs(function(t){for(var e=0,n=t.length-1;n>=0;--n)e+=t[n];return e}(t.map((function(e,n){var r=t[n+1]||t[0];return e[0]*r[1]-r[0]*e[1]}))))/2}", "baseAmount() {return inChallenge(\"m\",11)?player.points:player.l1.points}", "function absRotChange(sketch){\r\n var absSum = 0;\r\n for (var i = 0; i < sketch[\"strokes\"].length; i++){\r\n var stroke = sketch[\"strokes\"][i][\"points\"];\r\n for (var j = 1; j < stroke.length - 1; j++){\r\n var subSum = rotChangeHelper(sketch, stroke, j);\r\n absSum += isNaN(subSum) ? 0 : Math.abs(subSum);\r\n }\r\n }\r\n // console.log(\"abs Rot change is: \" + absSum);\r\n return absSum;\r\n}", "function proFullhouse(pc, dc, numSame){\n\tif (numSame.num == 3){\n\t\tvar outAlready = 1 + contain(dc, numSame.rem1);\n\t\treturn (4.0 - outAlready)/43.0;\n\t}\n\telse if (numSame.twoPair) {\n\t\tvar out1Already = 2 + contain(dc, pc[0].value);\n\t\tvar out2Already = 2 + contain(dc, pc[2].value);\n\t\treturn (4.0+4.0-out1Already-out2Already)/43.0;\t\t\n\t} else {\n\t\treturn 0.0;\n\t}\n}", "estimatedTime(peak) {\n // The estimated time depends on the distance in blocks\n // and whether the trip is occurring during peak hours or off peak hours.\n\n if (peak === true) {\n // while during peak hours\n // - two blocks in a minute.\n console.log(this.blocksTravelled()/2)\n let blocksOnPeak = this.blocksTravelled()/ 2;\n return Math.ceil(blocksOnPeak)\n } else {\n // During off peak hours,\n // - three blocks in a minute,\n console.log(this.blocksTravelled()/3)\n let blocksOnPeak = this.blocksTravelled()/ 3;\n return Math.ceil(blocksOnPeak)\n }\n }", "function getNewUniformDotValue() {\n return 0.\n }", "getWidthUnit(){return this.__widthUnit}", "getSynergy(){\n return 0.25 + 0.75 * (this.getActivePlayingPlayers().length / 11) ** 2;\n }", "protected internal function m252() {}", "function t1(){\n return (1/3)*(dataArray[1][1]-dataArray[0][1])+(dataArray[2][1]-dataArray[1][1])+(dataArray[3][1]-dataArray[2][1]);\n }", "getBoneEndDistance(b) {\nreturn this.distance[b];\n}", "lifeExpectancyVenus() {\n let venusianLifeExpectancy = Math.floor(this.lifeExpectancy/0.62);\n return venusianLifeExpectancy;\n }", "mag()\r\n {\r\n return Math.sqrt(this.magSq());\r\n }", "function H(){var t=f.getBoundingClientRect(),e=\"offset\"+[\"Width\",\"Height\"][n.ort];return 0===n.ort?t.width||f[e]:t.height||f[e]}", "function X(){var t=c.getBoundingClientRect(),e=\"offset\"+[\"Width\",\"Height\"][i.ort];return 0===i.ort?t.width||c[e]:t.height||c[e]}", "quotaMysWPass(){\n return math.chain(+this.props.numLocalEmp || 0).multiply(0.666667).floor().done();\n }", "calculateByEnglish() {\n const result = ((this.weight) / Math.pow((this.height * 12), 2)) * 703.0704;\n return Math.round(result* 100) / 100;\n }", "_hash(pt) {\n return (15485867 + pt.X) * 15485867 + pt.Y;\n }", "static aThreatToHumanity(){\n return 0.75;\n }", "function t3(){\n return dataArray[1][1]-dataArray[0][1];\n }", "function findCoordination(input) {\n\t\t// easy calculation, no need to write code \n}", "xpDiff (swapSkater) {\n let skaterOverall = this.props.selectedSkater.edges + this.props.selectedSkater.jumps + this.props.selectedSkater.form + this.props.selectedSkater.presentation;\n let swapSkaterOverall = swapSkater.edges + swapSkater.jumps + swapSkater.form + swapSkater.presentation;\n return swapSkaterOverall - skaterOverall;\n }", "function calculateUnitRatios () {\n\n /************************\n Same Ratio Checks\n ************************/\n\n /* The properties below are used to determine whether the element differs sufficiently from this call's\n previously iterated element to also differ in its unit conversion ratios. If the properties match up with those\n of the prior element, the prior element's conversion ratios are used. Like most optimizations in Velocity,\n this is done to minimize DOM querying. */\n var sameRatioIndicators = {\n myParent: element.parentNode || document.body, /* GET */\n position: CSS.getPropertyValue(element, \"position\"), /* GET */\n fontSize: CSS.getPropertyValue(element, \"fontSize\") /* GET */\n },\n /* Determine if the same % ratio can be used. % is based on the element's position value and its parent's width and height dimensions. */\n samePercentRatio = ((sameRatioIndicators.position === callUnitConversionData.lastPosition) && (sameRatioIndicators.myParent === callUnitConversionData.lastParent)),\n /* Determine if the same em ratio can be used. em is relative to the element's fontSize. */\n sameEmRatio = (sameRatioIndicators.fontSize === callUnitConversionData.lastFontSize);\n\n /* Store these ratio indicators call-wide for the next element to compare against. */\n callUnitConversionData.lastParent = sameRatioIndicators.myParent;\n callUnitConversionData.lastPosition = sameRatioIndicators.position;\n callUnitConversionData.lastFontSize = sameRatioIndicators.fontSize;\n\n /***************************\n Element-Specific Units\n ***************************/\n\n /* Note: IE8 rounds to the nearest pixel when returning CSS values, thus we perform conversions using a measurement\n of 100 (instead of 1) to give our ratios a precision of at least 2 decimal values. */\n var measurement = 100,\n unitRatios = {};\n\n if (!sameEmRatio || !samePercentRatio) {\n var dummy = Data(element).isSVG ? document.createElementNS(\"http://www.w3.org/2000/svg\", \"rect\") : document.createElement(\"div\");\n\n Velocity.init(dummy);\n sameRatioIndicators.myParent.appendChild(dummy);\n\n /* To accurately and consistently calculate conversion ratios, the element's cascaded overflow and box-sizing are stripped.\n Similarly, since width/height can be artificially constrained by their min-/max- equivalents, these are controlled for as well. */\n /* Note: Overflow must be also be controlled for per-axis since the overflow property overwrites its per-axis values. */\n $.each([ \"overflow\", \"overflowX\", \"overflowY\" ], function(i, property) {\n Velocity.CSS.setPropertyValue(dummy, property, \"hidden\");\n });\n Velocity.CSS.setPropertyValue(dummy, \"position\", sameRatioIndicators.position);\n Velocity.CSS.setPropertyValue(dummy, \"fontSize\", sameRatioIndicators.fontSize);\n Velocity.CSS.setPropertyValue(dummy, \"boxSizing\", \"content-box\");\n\n /* width and height act as our proxy properties for measuring the horizontal and vertical % ratios. */\n $.each([ \"minWidth\", \"maxWidth\", \"width\", \"minHeight\", \"maxHeight\", \"height\" ], function(i, property) {\n Velocity.CSS.setPropertyValue(dummy, property, measurement + \"%\");\n });\n /* paddingLeft arbitrarily acts as our proxy property for the em ratio. */\n Velocity.CSS.setPropertyValue(dummy, \"paddingLeft\", measurement + \"em\");\n\n /* Divide the returned value by the measurement to get the ratio between 1% and 1px. Default to 1 since working with 0 can produce Infinite. */\n unitRatios.percentToPxWidth = callUnitConversionData.lastPercentToPxWidth = (parseFloat(CSS.getPropertyValue(dummy, \"width\", null, true)) || 1) / measurement; /* GET */\n unitRatios.percentToPxHeight = callUnitConversionData.lastPercentToPxHeight = (parseFloat(CSS.getPropertyValue(dummy, \"height\", null, true)) || 1) / measurement; /* GET */\n unitRatios.emToPx = callUnitConversionData.lastEmToPx = (parseFloat(CSS.getPropertyValue(dummy, \"paddingLeft\")) || 1) / measurement; /* GET */\n\n sameRatioIndicators.myParent.removeChild(dummy);\n } else {\n unitRatios.emToPx = callUnitConversionData.lastEmToPx;\n unitRatios.percentToPxWidth = callUnitConversionData.lastPercentToPxWidth;\n unitRatios.percentToPxHeight = callUnitConversionData.lastPercentToPxHeight;\n }\n\n /***************************\n Element-Agnostic Units\n ***************************/\n\n /* Whereas % and em ratios are determined on a per-element basis, the rem unit only needs to be checked\n once per call since it's exclusively dependant upon document.body's fontSize. If this is the first time\n that calculateUnitRatios() is being run during this call, remToPx will still be set to its default value of null,\n so we calculate it now. */\n if (callUnitConversionData.remToPx === null) {\n /* Default to browsers' default fontSize of 16px in the case of 0. */\n callUnitConversionData.remToPx = parseFloat(CSS.getPropertyValue(document.body, \"fontSize\")) || 16; /* GET */\n }\n\n /* Similarly, viewport units are %-relative to the window's inner dimensions. */\n if (callUnitConversionData.vwToPx === null) {\n callUnitConversionData.vwToPx = parseFloat(window.innerWidth) / 100; /* GET */\n callUnitConversionData.vhToPx = parseFloat(window.innerHeight) / 100; /* GET */\n }\n\n unitRatios.remToPx = callUnitConversionData.remToPx;\n unitRatios.vwToPx = callUnitConversionData.vwToPx;\n unitRatios.vhToPx = callUnitConversionData.vhToPx;\n\n if (Velocity.debug >= 1) console.log(\"Unit ratios: \" + JSON.stringify(unitRatios), element);\n\n return unitRatios;\n }", "function calculate_coordinates () {\n\t }" ]
[ "0.58490884", "0.5675055", "0.5659532", "0.56369245", "0.55556214", "0.5525809", "0.55252767", "0.5480208", "0.5458002", "0.54400927", "0.5436296", "0.5426854", "0.54142547", "0.5408865", "0.5396282", "0.5395298", "0.5387921", "0.53818756", "0.5363293", "0.5362013", "0.53528345", "0.5333518", "0.53188276", "0.53066385", "0.5291364", "0.5290014", "0.52805173", "0.52797085", "0.52750903", "0.526908", "0.5262591", "0.5256388", "0.5252583", "0.5241525", "0.523775", "0.5234359", "0.5227109", "0.5222652", "0.5222641", "0.5221134", "0.52128947", "0.5201739", "0.5196526", "0.51926404", "0.5189387", "0.5184081", "0.518287", "0.51788205", "0.5175565", "0.51738244", "0.51738244", "0.51726943", "0.5171159", "0.5168639", "0.51637465", "0.51613474", "0.51566297", "0.5156116", "0.51543504", "0.5153986", "0.51537955", "0.51507074", "0.5149546", "0.51487356", "0.5144053", "0.5141348", "0.5141348", "0.5141165", "0.5129767", "0.51280785", "0.51278263", "0.5126009", "0.51244724", "0.51244295", "0.5121275", "0.51198125", "0.5115279", "0.51144046", "0.511031", "0.510926", "0.51079744", "0.5107775", "0.51071787", "0.51036704", "0.510337", "0.5101371", "0.50992554", "0.5098161", "0.5093288", "0.50922084", "0.5088738", "0.50883466", "0.5085771", "0.50843644", "0.50815505", "0.50807124", "0.5076143", "0.5072583", "0.50716484", "0.50710744", "0.5068327" ]
0.0
-1
Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file distributed with this work for additional information regarding copyright ownership. The ASF licenses this file to you under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
function makeRectPanelClipPath(rect) { rect = normalizeRect(rect); return function (localPoints, transform) { return graphicUtil.clipPointsByRect(localPoints, rect); }; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "get Android() {}", "function SBRecordsetPHP_analyzePlatformSpecific()\r\n{\r\n\r\n\r\n}", "onChildAppStart () {\n\n }", "private internal function m248() {}", "private public function m246() {}", "onMessageStart() { }", "createStream () {\n\n }", "_playbackCompatibility() {\n // Detect audio playback capabilities.\n\n // Detect HTML5 Audio playback.\n // http://caniuse.com/#feat=audio\n this.canUseAudio = Boolean(new Audio());\n console.log('Native HTML5 Audio playback capability: ' +\n this.canUseAudio);\n\n // Detect Cordova Media Playback\n // It allows playing audio using the native bridge inside WebView Apps.\n // https://github.com/apache/cordova-plugin-media/blob/master/doc/index.md\n this.canUseCordovaMedia = Boolean(window.Media);\n console.log('Cordova Media playback capability: ' +\n this.canUseCordovaMedia);\n\n if (!(this.canUseAudio || this.canUseCordovaMedia)) {\n throw new Error(\n 'Some form of audio playback capability is required');\n }\n\n var _audio = new Audio();\n if (_audio.canPlayType === 'function') {\n throw new Error(\n 'Unable to detect audio playback capabilities');\n }\n\n var canPlayOggVorbis = _audio.canPlayType(\n 'audio/ogg; codecs=\"vorbis\"') !== '';\n var canPlayOggOpus = _audio.canPlayType(\n 'audio/ogg; codecs=\"opus\"') !== '';\n var canPlayWave = _audio.canPlayType('audio/wav') !== '';\n var canPlayMP3 = _audio.canPlayType('audio/mpeg; codecs=\"mp3\"') !== '';\n var canPlayAAC = _audio.canPlayType(\n 'audio/mp4; codecs=\"mp4a.40.2\"') !== '';\n var canPlay3GPP = _audio.canPlayType(\n 'audio/3gpp; codecs=\"samr\"') !== '';\n\n console.log('Native Vorbis audio in Ogg container playback capability: ' +\n canPlayOggVorbis);\n console.log('Native Opus audio in Ogg container playback capability: ' +\n canPlayOggOpus);\n console.log('Native PCM audio in Waveform Audio File Format (WAVE) ' +\n 'playback capability: ' + canPlayWave);\n console.log('Native MPEG Audio Layer 3 (MP3) playback capability: ' +\n canPlayMP3);\n console.log('Native Low-Complexity AAC audio in MP4 container playback ' +\n 'capability: ' + canPlayAAC);\n console.log('Native AMR audio in 3GPP container playback capability: ' +\n canPlay3GPP);\n\n if (!(canPlayWave || canPlayMP3)) {\n throw new Error(\n 'Native Wave or MP3 playback is required');\n }\n }", "constructor() {\n\t}", "constructor() {\n\t}", "constructor() {\n\n\t}", "onComponentMount() {\n\n }", "constructor() {\n throw new Error('Not implemented');\n }", "supportsPlatform() {\n return true;\n }", "function _____SHARED_functions_____(){}", "constructor() {\n }", "constructor() {\n\t\t// ...\n\t}", "static get tag(){return\"hal-9000\"}", "static getDeviceModel() {\n return \"zhimi.fan.za4\";\n }", "requestContainerInfo() {}", "constructor () { super() }", "function BaseDeviceProfile() {\n \n this.audioNeedsTranscodingCodecs = []; // fill these with audio codecs that the implemented device can handle natively\n this.videoNeedsTranscodingCodecs = []; // fill these with video codecs that the implemented device can handle natively\n this.validFormats = []; // fill these with video formats that the implemented device can handle natively\n\n this.transcodeOptions = {\n rescaleVideo : false, // BaseDeviceProfile.prototype.rescale\n subtitle : false, // BaseDeviceProfile.prototype.hardCodeSubtitle\n audioShiftCorrect : false // BaseDeviceProfile.prototype.correctAudioOffset\n };\n\n /**\n * @todo: whutz this?\n * @param {[type]} probeData [description]\n * @return {[type]} [description]\n */\n this.canPlayContainer = function (probeData) {\n throw new Error(\"canPlayContainer : Not Implemented\");\n };\n\n /**\n * Implement this method to return device specific ffmpeg flags for a probed media\n * @param {object} probeData ffmpeg probe data\n * @param {[type]} forceTranscode force transcode even if native format?\n * @return {Promise} [description]\n */\n this.getFFmpegFlags = function (probeData, forceTranscode) {\n throw new Error(\"getFFmpegFlags : Not Implemented!\");\n };\n\n}", "static get STATUS() {\n return 0;\n }", "static create () {}", "get() {}", "didMount() {\n }", "_onMessage() {\n throw new Error(\"not implemented\");\n }", "onReady() {}", "native() {\n throw new Error('NOT_IMPLEMENTED_EXCEPTION: you must override this method in order to use it')\n }", "function sdk(){\n}", "constructor () {\r\n\t\t\r\n\t}", "transient private protected internal function m182() {}", "function version(){ return \"0.13.0\" }", "static getDeviceModel() {\n return \"zhimi.fan.za5\";\n }", "started () {}", "function getVersion(){return _VERSION}", "transient private internal function m185() {}", "constructor() {\r\n }", "started() { }", "InitVsaEngine() {\n\n }", "started() {\r\n\r\n\t}", "function SigV4Utils() { }", "static get NOT_READY () {return 0}", "started () {\n\n }", "started () {\n\n }", "started () {\n\n }", "initialize() {\n\n }", "onMessageReceive() {}", "initialize()\n {\n }", "_get () {\n throw new Error('_get not implemented')\n }", "get () {\n }", "constructor() { }", "constructor() { }", "constructor() { }", "constructor() { }", "constructor() { }", "constructor() { }", "constructor() { }", "constructor() { }", "constructor() { }", "constructor() { }", "constructor() { }", "function getImplementation( cb ){\n\n }", "started() {}", "started() {}", "started() {}", "started() {}", "started() {}", "started() {}", "started() {}", "started() {}", "started() {}", "started() {}", "heartbeat () {\n }", "constructor() {\n \n }", "constructor() {\n \n }", "constructor() {\n \n }", "constructor() {\n \n }", "constructor() {\n \n }", "constructor() {\n \n }", "constructor() {\n \n }", "constructor() {\n \n }", "constructor() {\n \n }", "constructor() {\n \n }", "constructor() {\n \n }", "constructor() {\n \n }", "constructor() {\n \n }", "constructor() {\n \n }", "constructor() {\n \n }", "constructor() {\n \n }", "constructor() {\n \n }", "constructor() {\n \n }", "constructor() {\n \n }", "constructor() {\n \n }", "initleancloud() {\n AV.init({\n appId: keys.appId,\n appKey: keys.appKey\n })\n this.globalData.AV = AV\n }", "static final private internal function m106() {}", "getStreamPosition() {\n return Native.getStreamPosition();\n }", "onMessage() {}", "onMessage() {}", "constructor() {\n super();\n this._logger = new pip_services3_components_node_3.CompositeLogger();\n this._connectionResolver = new connect_1.AwsConnectionResolver();\n this._connectTimeout = 30000;\n this._client = null; //AmazonCloudWatchClient\n this._opened = false;\n }", "get WSAPlayerX64() {}" ]
[ "0.5349978", "0.48933455", "0.48501366", "0.48083982", "0.4772584", "0.474481", "0.47349635", "0.47027457", "0.46929818", "0.46929818", "0.4673667", "0.4644517", "0.46389893", "0.46253318", "0.4618249", "0.4582536", "0.45813942", "0.45742747", "0.45687214", "0.45623618", "0.45563498", "0.45493752", "0.45489514", "0.45457798", "0.4538844", "0.45218396", "0.45187637", "0.4498104", "0.44946006", "0.44832855", "0.44729492", "0.44691566", "0.44642788", "0.44588575", "0.44554883", "0.4453296", "0.44531393", "0.4443642", "0.44374335", "0.44267404", "0.44238108", "0.44228086", "0.4407407", "0.44043022", "0.44043022", "0.44043022", "0.44035548", "0.4393825", "0.43761918", "0.43697277", "0.4364149", "0.43530616", "0.43530616", "0.43530616", "0.43530616", "0.43530616", "0.43530616", "0.43530616", "0.43530616", "0.43530616", "0.43530616", "0.43530616", "0.43517888", "0.43511248", "0.43511248", "0.43511248", "0.43511248", "0.43511248", "0.43511248", "0.43511248", "0.43511248", "0.43511248", "0.43511248", "0.43502304", "0.43493763", "0.43493763", "0.43493763", "0.43493763", "0.43493763", "0.43493763", "0.43493763", "0.43493763", "0.43493763", "0.43493763", "0.43493763", "0.43493763", "0.43493763", "0.43493763", "0.43493763", "0.43493763", "0.43493763", "0.43493763", "0.43493763", "0.43493763", "0.43440503", "0.43416435", "0.43375877", "0.43357816", "0.43357816", "0.43336093", "0.43330038" ]
0.0
-1
Avoid that: mouse click on a elements that is over geo or graph, but roam is triggered.
function onIrrelevantElement(e, api, targetCoordSysModel) { var model = api.getComponentByElement(e.topTarget); // If model is axisModel, it works only if it is injected with coordinateSystem. var coordSys = model && model.coordinateSystem; return model && model !== targetCoordSysModel && !IRRELEVANT_EXCLUDES[model.mainType] && coordSys && coordSys.model !== targetCoordSysModel; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function setGridToNonClickable(grid){\n grid.style.pointerEvents=\"none\";\n}", "function disableRightClick() {\n // stop zoom\n if (d3.event.button == 2) {\n console.log('No right click allowed');\n d3.event.stopImmediatePropagation();\n }\n }", "function block_user_interaction(paper) {\n paper.setInteractivity(false);\n}", "function toggleGridUnclickable() {\n grid.style.pointerEvents = \"none\";\n}", "async mouseAway() {\n await this._actions().mouseMove(this.element(), { x: -1, y: -1 }).perform();\n await this._stabilize();\n }", "function onMouseClick(event) {\n freeze = !freeze;\n }", "function mouseClicked() {\n // Ignore clicks outside window\n if (!window.ev) {\n return;\n }\n \n if (!menu_toggles.forces.parameter) return;\n \n // Delete force\n for (var i = 1; i < forcePoints.length; i++) {\n // Check if hovering over fixed forcePoint\n if (forcePoints[i].hover) {\n forcePoints.splice(i, 1);\n return;\n }\n }\n \n // Create force\n forcePoints.push(new ForcePoint(cursorPoint.center, cursorPoint.forceFactor, cursorPoint.forceExp, cursorPoint.forceIntensity, \"CONTRACTING\"));\n}", "function mousedown() {\n if (!mousedown_node && !mousedown_link) {\n // allow panning if nothing is selected\n vis.call(d3.behavior.zoom().on(\"zoom\"), rescale);\n return;\n }\n}", "function onMouseUp(event){if(preventMouseUp){event.preventDefault();}}", "_onMapClick(e) {\r\n\t const targetElement = e.originalEvent.target;\r\n\t const element = this._element;\r\n\r\n\t if (\r\n\t this._handleClick &&\r\n\t (targetElement === element || element.contains(targetElement))\r\n\t ) {\r\n\t this._handleClick();\r\n\t }\r\n\t }", "triggerLower(e) {\n //Skip if not left click\n if (e.button !== 0) {\n return false;\n }\n const mouseX = e.pageX\n const mouseY = e.pageY\n let lowerElement;\n if (!document.elementsFromPoint) document.elementsFromPoint = UTILS.elementsFromPoint\n\n lowerElement = document.elementsFromPoint(mouseX, mouseY).find((element) => {\n return element.classList.contains(\"calendar__block\")\n });\n\n if (!lowerElement) return;\n let event\n const parentElement = e.target\n switch (e.type) {\n case \"mousedown\":\n event = new MouseEvent('mousedown', {\n bubbles: true,\n });\n parentElement.style.pointerEvents = 'none'\n BreakDragHelper.addForegroundElement(parentElement)\n lowerElement.dispatchEvent(event)\n break;\n case \"mouseover\":\n if (BreakDragHelper.getMousedown()) {\n parentElement.style.pointerEvents = 'none'\n BreakDragHelper.addForegroundElement(parentElement)\n event = new MouseEvent('mouseover', {\n bubbles: true,\n });\n lowerElement.dispatchEvent(event)\n }\n break;\n default:\n break;\n }\n }", "function cClick(){\r\nif(OLloaded&&OLgateOK){OLhover=0;OLhideObject(over);o3_showingsticky=0;}\r\nreturn false;\r\n}", "function unblock_user_interaction(paper) {\n paper.setInteractivity(true);\n}", "function preventGhostClick(x, y) {\n if (!touchCoordinates) {\n $rootElement[0].addEventListener('click', onClick, true);\n $rootElement[0].addEventListener('touchstart', onTouchStart, true);\n touchCoordinates = [];\n }\n\n lastPreventedTime = Date.now();\n\n checkAllowableRegions(touchCoordinates, x, y);\n }", "function click() {\n d3_eventCancel();\n w.on(\"click.drag\", null);\n }", "function preventGhostClick(x, y) {\n if (!touchCoordinates) {\n $rootElement[0].addEventListener('click', onClick, true);\n $rootElement[0].addEventListener('touchstart', onTouchStart, true);\n touchCoordinates = [];\n }\n\n lastPreventedTime = Date.now();\n\n checkAllowableRegions(touchCoordinates, x, y);\n }", "function preventGhostClick(x, y) {\n if (!touchCoordinates) {\n $rootElement[0].addEventListener('click', onClick, true);\n $rootElement[0].addEventListener('touchstart', onTouchStart, true);\n touchCoordinates = [];\n }\n\n lastPreventedTime = Date.now();\n\n checkAllowableRegions(touchCoordinates, x, y);\n }", "function disableMouse(clic) {\r\n document.addEventListener(\"click\", e => {\r\n if (clic) {\r\n e.stopPropagation();\r\n e.preventDefault();\r\n }\r\n }, true);\r\n}", "function moveClickable() {\n // Move\n clickable.x += clickable.vx;\n clickable.y += clickable.vy;\n\n // Check if off screen and just kill the program if so\n if (clickable.x < 0 || clickable.x > width || clickable.y < 0 || clickable.y > height) {\n noLoop();\n }\n}", "function disableInteraction() {\n moving = true;\n setTimeout(function () {\n moving = false;\n }, 500);\n }", "function preventGhostClick(x, y) {\n if (!touchCoordinates) {\n $rootElement[0].addEventListener('click', onClick, true);\n $rootElement[0].addEventListener('touchstart', onTouchStart, true);\n touchCoordinates = [];\n }\n\n lastPreventedTime = Date.now();\n\n checkAllowableRegions(touchCoordinates, x, y);\n }", "function preventGhostClick(x, y) {\n if (!touchCoordinates) {\n $rootElement[0].addEventListener('click', onClick, true);\n $rootElement[0].addEventListener('touchstart', onTouchStart, true);\n touchCoordinates = [];\n }\n\n lastPreventedTime = Date.now();\n\n checkAllowableRegions(touchCoordinates, x, y);\n }", "function preventGhostClick(x, y) {\n if (!touchCoordinates) {\n $rootElement[0].addEventListener('click', onClick, true);\n $rootElement[0].addEventListener('touchstart', onTouchStart, true);\n touchCoordinates = [];\n }\n\n lastPreventedTime = Date.now();\n\n checkAllowableRegions(touchCoordinates, x, y);\n }", "function preventGhostClick(x, y) {\n if (!touchCoordinates) {\n $rootElement[0].addEventListener('click', onClick, true);\n $rootElement[0].addEventListener('touchstart', onTouchStart, true);\n touchCoordinates = [];\n }\n\n lastPreventedTime = Date.now();\n\n checkAllowableRegions(touchCoordinates, x, y);\n }", "function preventGhostClick(x, y) {\n if (!touchCoordinates) {\n $rootElement[0].addEventListener('click', onClick, true);\n $rootElement[0].addEventListener('touchstart', onTouchStart, true);\n touchCoordinates = [];\n }\n\n lastPreventedTime = Date.now();\n\n checkAllowableRegions(touchCoordinates, x, y);\n }", "function ClickBlock() {\n // for(let i = 0; i < itemEls.length; i++){\n // itemEls[i].style.pointerEvents = 'none';\n // }\n // setTimeout(()=>{\n // for(let i = 0; i < itemEls.length; i++){\n // itemEls[i].style.pointerEvents = 'auto';\n // }\n // }, 210);\n }", "_onMapClick(e) {\n const targetElement = e.originalEvent.target;\n const element = this._element;\n\n if (\n this._handleClick &&\n (targetElement === element || element.contains(targetElement))\n ) {\n this._handleClick();\n }\n }", "function mapper_disable_dragging() {\n if( map ) map.disableDragging();\n}", "function ignorePendingMouseEvents() { ignore_mouse = guac_mouse.touchMouseThreshold; }", "function _clicked_ele_trigger(oEle,e)\r\n{\r\n\tif(isNaN(e))\r\n\t{\r\n\t\tvar mLeft = app.findMousePos(e)[0];\r\n\t}\r\n\telse\r\n\t{\r\n\t\tvar mLeft = e;\r\n\t}\r\n\r\n\tvar eleMaxRight = oEle.offsetWidth + app.eleLeft(oEle);\r\n\tvar eleMinRight = eleMaxRight - 16;\r\n\r\n\tif((mLeft>eleMinRight)&&(mLeft<eleMaxRight))\r\n\t{\r\n\t\treturn true;\r\n\t}\r\n\treturn false;\r\n}", "function toggleClickable(){\n \t\tfor (var i = 0; i < 10; i++){\n \t\t\tif (shapes[i].style.pointerEvents === 'none'){\n \t\t\t\tshapes[i].style.pointerEvents = '';\n \t\t\t}\n \t\t\telse {\n \t\t\t\tshapes[i].style.pointerEvents = 'none';\n \t\t\t}\n \t\t}\n \t}", "function gcb_clickBuster (event)\r\n{\r\n //console.log (\"Clicked \" + event.clientX + \", \" + event.clientY );\r\n if (gcb_ignoreClick(event.clientX, event.clientY))\r\n {\r\n //console.log (\"... and ignored it.\");\r\n event.stopPropagation();\r\n event.preventDefault();\r\n }\r\n}", "onMinimapDragMouseDown() {\n this.isMinimapPanning = true;\n }", "function disableClickZoom () {\n status.disableClickZoom = true;\n }", "function setGridToClickable(grid){\n grid.style.pointerEvents=\"visiblePainted\";\n}", "externalClick() {\n this._strikeClick();\n this._localPointer.x = this.getPointer().x;\n this._localPointer.y = this.getPointer().y;\n }", "function mouseClicked() {\n if (mouseY >= 620 && mouseY <= 720 && mouseX >= 1040 && mouseX <= 1280) {\n aanvalActie = false;\n aanvalKnopStatus = false;\n beweegActie = false;\n beweegKnopStatus = false;\n beurtVeranderen();\n veranderKleur(donkerblauw,wit);\n veranderKleur(lichtblauw,wit);\n }\n}", "onElementMouseUp(event) {\n if (this.dragContext) {\n this.endMove();\n event.preventDefault();\n }\n }", "onElementMouseUp(event) {\n if (this.dragContext) {\n this.endMove();\n event.preventDefault();\n }\n }", "_moveHandler() {\n if (this.hasAttribute('dragged') && JQX.Utilities.Core.isMobile) {\n event.originalEvent.preventDefault();\n }\n }", "function mapMouseDown(event) {\n var tx, ty;\n tx = event.pageX - parseInt($(\"#map\")[0].style.marginLeft);\n ty = event.pageY - 35 - parseInt($(\"#map\")[0].style.marginTop);\n if (event.preventDefault) event.preventDefault();\n else event.returnValue = false;\n mapX = event.clientX;\n mapY = event.clientY;\n return false;\n}", "handle_mouse_click(mouse_ray) {\n if (this.disable_marker_tile || this.game_over) return;\n const width = 10, length = 10;\n // TODO: Collisions against the menu items should override any other collisions.\n let tiles = this.calculate_ray_tile_intersection(mouse_ray, width, length);\n if (!this.moving)\n this.clicked_tile = tiles;\n this.click_ray = mouse_ray;\n }", "handleMouseUp() {\n let { map, isDrawingEnabled, option } = this.state;\n\n /**\n * We track it only for \"Draw\" drawing mode\n */\n if ( ! (isDrawingEnabled && option === \"draw\") ) return;\n\n this.refs.map.leafletElement.dragging.enable();\n map.mouseDown = false;\n this.setState({\n map: map,\n isDrawingEnabled: false\n });\n }", "function mousedown() {\n \"use strict\";\n mouseclicked = !mouseclicked;\n}", "function hardClick() {\n if (hardButton.isUnderMouse(mouseX, mouseY)) {\n isUnder = true;\n hardLevel();\n levelPicked = true;\n }\n}", "function onMouseNothing(e) {\n e.preventDefault();\n e.stopPropagation();\n return false;\n}", "function onIrrelevantElement(e, api, targetCoordSysModel) {\n\t var model = api.getComponentByElement(e.topTarget); // If model is axisModel, it works only if it is injected with coordinateSystem.\n\t\n\t var coordSys = model && model.coordinateSystem;\n\t return model && model !== targetCoordSysModel && !IRRELEVANT_EXCLUDES.hasOwnProperty(model.mainType) && coordSys && coordSys.model !== targetCoordSysModel;\n\t }", "function dontPosSelect() {\n return false;\n }", "function isMouseDown() {\n let allUnvisited = document.querySelectorAll(\".unvisited\");\n allUnvisited.forEach((point) => {\n point.addEventListener(\"mousedown\", function () {\n canDrag = true;\n });\n });\n}", "function removeMouseClick() {\n click_active = false;\n current_click = null;\n nodes_selected = nodes; //Re-instate the mouse events\n\n mouse_zoom_rect.on('mouseout', function (d) {\n if (current_hover !== null) mouseOutNode();\n }); //Release click\n\n mouseOutNode();\n hideTooltip(); //Hide the rotating circle\n\n node_hover.style('display', 'none'); //Hide the icon to the bottom right of a clicked node\n\n node_modal_group.style('display', 'none');\n } //function removeMouseClick", "function removeMouseClick() {\n click_active = false;\n current_click = null;\n nodes_selected = nodes; //Re-instate the mouse events\n\n mouse_zoom_rect.on('mouseout', function (d) {\n if (current_hover !== null) mouseOutNode();\n }); //Release click\n\n mouseOutNode();\n hideTooltip(); //Hide the rotating circle\n\n node_hover.style('display', 'none'); //Hide the icon to the bottom right of a clicked node\n\n node_modal_group.style('display', 'none');\n } //function removeMouseClick", "function ignoreDragging() {\n try {\n window.event.returnValue = false; }\n catch (e) {}\n return false; }", "function handleMouseUp(evt)\r\n{\r\n\tisClicked = false;\r\n\tmapFrame.style.cursor = \"default\";\r\n}", "function onIrrelevantElement(e, api, targetCoordSysModel) {\n var model = api.getComponentByElement(e.topTarget); // If model is axisModel, it works only if it is injected with coordinateSystem.\n\n var coordSys = model && model.coordinateSystem;\n return model && model !== targetCoordSysModel && !IRRELEVANT_EXCLUDES.hasOwnProperty(model.mainType) && coordSys && coordSys.model !== targetCoordSysModel;\n}", "function mousePressed() {\n return false;\n}", "function avoidAreasToolClicked(e) {\n\t\t\tvar btn = e.target;\n\t\t\tvar tag = e.target.tagName;\n\t\t\tif (tag.toUpperCase() == 'IMG') {\n\t\t\t\t//we selected the image inside the button; get the parent (this will be the button).\n\t\t\t\tbtn = $(e.target).parent().get(0);\n\t\t\t}\n\n\t\t\t//will be either create, edit or remove\n\t\t\tvar mainPart = 'avoid'.length;\n\t\t\tvar toolType = btn.id.substring(mainPart).toLowerCase();\n\n\t\t\tvar btnIsActive = btn.className.indexOf('active') > -1;\n\n\t\t\t//set all btns to inactive\n\t\t\tvar allBtn = $(btn).parent().get(0).querySelectorAll('button');\n\t\t\tfor (var i = 0; i < allBtn.length; i++) {\n\t\t\t\t$(allBtn[i]).removeClass('active');\n\t\t\t}\n\t\t\t//activate current button if necessary\n\t\t\tif (!btnIsActive) {\n\t\t\t\t$(btn).addClass('active');\n\t\t\t}\n\n\t\t\ttheInterface.emit('ui:avoidAreaControls', {\n\t\t\t\ttoolType : toolType,\n\t\t\t\t//if the button has been active before, it will be de-activated now!\n\t\t\t\tactivated : !btnIsActive\n\t\t\t});\n\t\t}", "function mousePressed(){\n\treturn false;\n}", "function startClick() {\n $('maze').addEventListener('mouseleave', overBody);\n [].forEach.call($$('.boundary'), function(element){\n element.removeClassName('youlose');\n });\n [].forEach.call($$('.boundary'), function(element){\n element.observe('mouseover', overBoundary);\n });\n loser = null;\n}", "function mouseClicked() {\r\n var a = Math.floor(mouseX / w);\r\n var b = Math.floor(mouseY / h);\r\n if (grid[a][b].wall == true) {\r\n grid[a][b].wall = false;\r\n } else {\r\n if (grid[a][b] != start && grid[a][b] != end) {\r\n grid[a][b].wall = true;\r\n\r\n }\r\n }\r\n return false;\r\n}", "_onMouseUp () {\n Actions.changeDragging(false);\n }", "externalMouseDown() {\n this._strikeMouseDown();\n this._localPointer._mouseIsActive = true;\n }", "function startIgnoringMouse() {\n ignoreMouseDepth++;\n setTimeout(function () {\n ignoreMouseDepth--;\n }, _fullcalendar_core__WEBPACK_IMPORTED_MODULE_0__[\"config\"].touchMouseIgnoreWait);\n}", "handleMapClick(event) {\n //this.toggleHover(-1);\n }", "function preventMove(event) {\r\n\tevent.preventDefault();\r\n}", "onElementMouseUp(event) {\n if (this.dragContext) {\n this.endMove();\n event.preventDefault();\n }\n }", "function mapper_enable_dragging() {\n if( map ) map.enableDragging();\n}", "function mouseClick(d, click_type) {\n if (d3__WEBPACK_IMPORTED_MODULE_4__[\"event\"]) d3__WEBPACK_IMPORTED_MODULE_4__[\"event\"].stopPropagation();\n click_active = true; //Call the correct drawing function\n\n if (click_type === 'element') mouseOverElement(d);else if (click_type === 'country') mouseOverCountry(d);else if (click_type === 'domain') mouseOverDomain(d);\n current_click = d;\n } //function mouseClick", "function handleMouseDown(evt)\r\n{\r\n\tif (inFrame(evt.clientX,evt.clientY)) \r\n\t{\r\n\t\txOld = evt.clientX - getLeft();\r\n\t\tyOld = evt.clientY - getTop();\r\n\t\tisClicked = true;\r\n\t\tevt.preventDefault();\r\n\t}\r\n\tmapFrame.style.cursor = \"move\";\r\n}", "function mousedownForCanvas(event)\n{\n global_mouseButtonDown = true;\n event.preventDefault(); //need? (maybe not on desktop)\n}", "function avoidAreasError(errorous) {\n\t\t\tui.showAvoidAreasError(errorous);\n\t\t}", "function toggleGridClickable() {\n grid.style.pointerEvents = \"auto\";\n}", "function handlClickLinks(ev) {\r\n ev.preventDefault();\r\n \r\n}", "function disablePointSelection(){\r\n\taddPointMode = false;\r\n}", "function onMouseUp(event) {\n if (preventMouseUp) {\n event.preventDefault();\n }\n }", "function mousePressed(e) {\n return false;\n}", "function mapaClick(mouse) {\r\n\tswitch (root.actividad) {\r\n\t\tcase 0: // Nada cargado\r\n\t\t\tbreak\r\n\r\n\t\tcase 1: // Ubicar marcas para recorte\r\n\t\t\tLogEtaCorte.agregarMarca(mouse)\r\n\t\t\tbreak\r\n\r\n\t\tcase 2: // Marcar contornos\r\n\t\t\tvar posR = posReal(mouse, mapa.escala)\r\n\t\t\tconsole.log(\"pos real: \", posR.x, posR.y)\r\n\r\n\t\t\tif (Glo.hayTrazoRojo) {\r\n\t\t\t\tmiProxy.guardarTrazo()\r\n\t\t\t\tGlo.hayTrazoVerde = true\r\n\t\t\t}\r\n\r\n\t\t\tmiProxy.marcarTrazo(\r\n\t\t\t\t\tposR.x,\tposR.y,\r\n\t\t\t\t\tNumber(pin_radio.currentText),\r\n\t\t\t\t\tNumber(pin_vecinos.currentText),\r\n\t\t\t\t\tNumber(pin_cambioAng.value) * 0.0174532925)\r\n\r\n\t\t\tGlo.hayTrazoRojo = true\r\n\t\t\tpin_btBorrarCapa.enabled = true\r\n\r\n\t\t\tmapa.actualizTrazos()\r\n\t\t\tbreak\r\n\t}\r\n}", "function mouseClick(e) {\n // pin point on plane, if applicable\n drawPinnedPoint();\n}", "function disableMouse() {\n\tnoMouse = true;\n}", "onTileClicked(e){\n var w = this.map.tilewidth;\n var h = this.map.tileheight;\n var scrollLeft = document.documentElement.scrollLeft;\n var scrollTop = document.documentElement.scrollTop;\n\n var mx = e.src.pageX-scrollLeft;\n var my = e.src.pageY-scrollTop;\n \n var nodes = document.elementsFromPoint(mx,my);\n var tilenodes = nodes;//nodes.filter(n => n.classList.contains(\"tile\"));\n console.log(\"objects in proximity of click\", tilenodes)\n var target = tilenodes.shift();\n console.log(mx,my)\n console.log(\"top most object\", target);\n // console.log(this.renderer.screenXY_to_mapXY(mx+scrollLeft,my+scrollTop));\n }", "function disableClick() {\n body.style.pointerEvents = 'none';\n setTimeout(function() {body.style.pointerEvents = 'auto';}, 1000);\n}", "function disableClick(){\r\n body.style.pointerEvents='none';\r\n setTimeout(function() {body.style.pointerEvents='auto';},1000);\r\n}", "function CALCULATE_TOUCH_UP_OR_MOUSE_UP() {\r\n \r\n GLOBAL_CLICK.CLICK_PRESSED = false;\r\n \r\n }", "function mouseClicked() {\n dropPoke();\n}", "clickUsingAction(element) {\r\n if (typeof element !== 'undefined') {\r\n element.isDisplayed(() => {\r\n element.isEnabled().then(() => {\r\n browser.actions().mouseMove(element).click().perform();\r\n return this;\r\n });\r\n });\r\n }\r\n }", "function allowUserClick() {\n blocks.forEach(function(i) {\n i.addEventListener('click', tileClicked);\n });\n\n function tileClicked() {\n this.classList.toggle('green');\n this.classList.toggle('blue');\n }\n }", "function onMouseUp(event) {\n if (preventMouseUp) {\n event.preventDefault();\n }\n }", "function onMouseUp(event) {\n if (preventMouseUp) {\n event.preventDefault();\n }\n }", "function onMouseUp(event) {\n if (preventMouseUp) {\n event.preventDefault();\n }\n }", "preventToggling(evt) {\n evt.stopPropagation();\n }", "function handleInput(e) {\n e.preventDefault();\n e.stopPropagation();\n if(inputBlocked === true) {\n console.log(\"you must wait!\");\n return;\n }\n var hole = convertMouseToHole(e);\n if(hole != null){\n console.log(\"tapped on a hole\", hole);\n holeTap(hole);\n }\n}", "function clickHandler(event){\n\t\t\tif(ignoreClick){\n\t\t\t\tignoreClick = false;\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tvar offset = overlay.cumulativeOffset();\t\t\t\n\t\t\ttarget.fire('flotr:click', [{\n\t\t\t\tx: xaxis.min + (event.pageX - offset.left - plotOffset.left) / hozScale,\n\t\t\t\ty: yaxis.max - (event.pageY - offset.top - plotOffset.top) / vertScale\n\t\t\t}]);\n\t\t}", "function mouseMoveChart() {\n if (d3__WEBPACK_IMPORTED_MODULE_6__[\"event\"]) {\n d3__WEBPACK_IMPORTED_MODULE_6__[\"event\"].stopPropagation();\n m = d3__WEBPACK_IMPORTED_MODULE_6__[\"mouse\"](this);\n } else {\n current_hover = null;\n } //else\n //Find the nearest person to the mouse, within a distance of X pixels\n //Using the voronoi technique\n\n\n var found_hover = mouseNodeFind(m);\n found_edge = null;\n if (found_hover) showTooltip(found_hover); //If no node is found, check if an edge is clicked (only needed during an active click)\n\n if (click_active && !found_hover) found_edge = mouseEdgeFind(m); //Run the correct \"interaction\" event\n\n mouseMoveActions(found_hover, found_edge, m);\n } //function mouseMoveChart", "function mouseMoveChart() {\n if (d3__WEBPACK_IMPORTED_MODULE_6__[\"event\"]) {\n d3__WEBPACK_IMPORTED_MODULE_6__[\"event\"].stopPropagation();\n m = d3__WEBPACK_IMPORTED_MODULE_6__[\"mouse\"](this);\n } else {\n current_hover = null;\n } //else\n //Find the nearest person to the mouse, within a distance of X pixels\n //Using the voronoi technique\n\n\n var found_hover = mouseNodeFind(m);\n found_edge = null;\n if (found_hover) showTooltip(found_hover); //If no node is found, check if an edge is clicked (only needed during an active click)\n\n if (click_active && !found_hover) found_edge = mouseEdgeFind(m); //Run the correct \"interaction\" event\n\n mouseMoveActions(found_hover, found_edge, m);\n } //function mouseMoveChart" ]
[ "0.61968404", "0.6105043", "0.60895973", "0.59898186", "0.5986817", "0.5959793", "0.5935528", "0.5916358", "0.5888169", "0.58759063", "0.58450454", "0.5827085", "0.5826638", "0.5816487", "0.5810856", "0.57984626", "0.57984626", "0.5756743", "0.57469094", "0.5743923", "0.5734568", "0.5734568", "0.5734568", "0.5734568", "0.5734568", "0.5731013", "0.572934", "0.57208705", "0.57075655", "0.5694997", "0.5661156", "0.5649265", "0.5646645", "0.5637759", "0.56328946", "0.5607835", "0.560154", "0.5597443", "0.5597443", "0.5578447", "0.55758494", "0.5572247", "0.5569847", "0.55688035", "0.55587405", "0.5554177", "0.5549407", "0.55453223", "0.5543675", "0.5532991", "0.5532991", "0.55159324", "0.5502155", "0.5498086", "0.5491174", "0.54742163", "0.54669505", "0.54573995", "0.5454127", "0.54430497", "0.54402035", "0.5436782", "0.54319155", "0.54286236", "0.5425215", "0.54231876", "0.5422333", "0.5421767", "0.5420797", "0.54201317", "0.5418888", "0.5417087", "0.5416969", "0.5414128", "0.5413732", "0.5411316", "0.54105055", "0.5410189", "0.54071814", "0.54067934", "0.5399993", "0.53934", "0.5392677", "0.5390704", "0.5383826", "0.53821635", "0.53821635", "0.53821635", "0.5371056", "0.53691584", "0.53612965", "0.53612936", "0.53612936" ]
0.5562286
50
Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file distributed with this work for additional information regarding copyright ownership. The ASF licenses this file to you under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
function Cartesian2D(name) { Cartesian.call(this, name); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "get Android() {}", "function SBRecordsetPHP_analyzePlatformSpecific()\r\n{\r\n\r\n\r\n}", "onChildAppStart () {\n\n }", "private internal function m248() {}", "private public function m246() {}", "onMessageStart() { }", "createStream () {\n\n }", "_playbackCompatibility() {\n // Detect audio playback capabilities.\n\n // Detect HTML5 Audio playback.\n // http://caniuse.com/#feat=audio\n this.canUseAudio = Boolean(new Audio());\n console.log('Native HTML5 Audio playback capability: ' +\n this.canUseAudio);\n\n // Detect Cordova Media Playback\n // It allows playing audio using the native bridge inside WebView Apps.\n // https://github.com/apache/cordova-plugin-media/blob/master/doc/index.md\n this.canUseCordovaMedia = Boolean(window.Media);\n console.log('Cordova Media playback capability: ' +\n this.canUseCordovaMedia);\n\n if (!(this.canUseAudio || this.canUseCordovaMedia)) {\n throw new Error(\n 'Some form of audio playback capability is required');\n }\n\n var _audio = new Audio();\n if (_audio.canPlayType === 'function') {\n throw new Error(\n 'Unable to detect audio playback capabilities');\n }\n\n var canPlayOggVorbis = _audio.canPlayType(\n 'audio/ogg; codecs=\"vorbis\"') !== '';\n var canPlayOggOpus = _audio.canPlayType(\n 'audio/ogg; codecs=\"opus\"') !== '';\n var canPlayWave = _audio.canPlayType('audio/wav') !== '';\n var canPlayMP3 = _audio.canPlayType('audio/mpeg; codecs=\"mp3\"') !== '';\n var canPlayAAC = _audio.canPlayType(\n 'audio/mp4; codecs=\"mp4a.40.2\"') !== '';\n var canPlay3GPP = _audio.canPlayType(\n 'audio/3gpp; codecs=\"samr\"') !== '';\n\n console.log('Native Vorbis audio in Ogg container playback capability: ' +\n canPlayOggVorbis);\n console.log('Native Opus audio in Ogg container playback capability: ' +\n canPlayOggOpus);\n console.log('Native PCM audio in Waveform Audio File Format (WAVE) ' +\n 'playback capability: ' + canPlayWave);\n console.log('Native MPEG Audio Layer 3 (MP3) playback capability: ' +\n canPlayMP3);\n console.log('Native Low-Complexity AAC audio in MP4 container playback ' +\n 'capability: ' + canPlayAAC);\n console.log('Native AMR audio in 3GPP container playback capability: ' +\n canPlay3GPP);\n\n if (!(canPlayWave || canPlayMP3)) {\n throw new Error(\n 'Native Wave or MP3 playback is required');\n }\n }", "constructor() {\n\t}", "constructor() {\n\t}", "constructor() {\n\n\t}", "onComponentMount() {\n\n }", "constructor() {\n throw new Error('Not implemented');\n }", "supportsPlatform() {\n return true;\n }", "function _____SHARED_functions_____(){}", "constructor() {\n }", "constructor() {\n\t\t// ...\n\t}", "static get tag(){return\"hal-9000\"}", "static getDeviceModel() {\n return \"zhimi.fan.za4\";\n }", "requestContainerInfo() {}", "constructor () { super() }", "function BaseDeviceProfile() {\n \n this.audioNeedsTranscodingCodecs = []; // fill these with audio codecs that the implemented device can handle natively\n this.videoNeedsTranscodingCodecs = []; // fill these with video codecs that the implemented device can handle natively\n this.validFormats = []; // fill these with video formats that the implemented device can handle natively\n\n this.transcodeOptions = {\n rescaleVideo : false, // BaseDeviceProfile.prototype.rescale\n subtitle : false, // BaseDeviceProfile.prototype.hardCodeSubtitle\n audioShiftCorrect : false // BaseDeviceProfile.prototype.correctAudioOffset\n };\n\n /**\n * @todo: whutz this?\n * @param {[type]} probeData [description]\n * @return {[type]} [description]\n */\n this.canPlayContainer = function (probeData) {\n throw new Error(\"canPlayContainer : Not Implemented\");\n };\n\n /**\n * Implement this method to return device specific ffmpeg flags for a probed media\n * @param {object} probeData ffmpeg probe data\n * @param {[type]} forceTranscode force transcode even if native format?\n * @return {Promise} [description]\n */\n this.getFFmpegFlags = function (probeData, forceTranscode) {\n throw new Error(\"getFFmpegFlags : Not Implemented!\");\n };\n\n}", "static get STATUS() {\n return 0;\n }", "static create () {}", "get() {}", "didMount() {\n }", "_onMessage() {\n throw new Error(\"not implemented\");\n }", "onReady() {}", "native() {\n throw new Error('NOT_IMPLEMENTED_EXCEPTION: you must override this method in order to use it')\n }", "function sdk(){\n}", "constructor () {\r\n\t\t\r\n\t}", "transient private protected internal function m182() {}", "function version(){ return \"0.13.0\" }", "static getDeviceModel() {\n return \"zhimi.fan.za5\";\n }", "started () {}", "function getVersion(){return _VERSION}", "transient private internal function m185() {}", "constructor() {\r\n }", "started() { }", "InitVsaEngine() {\n\n }", "started() {\r\n\r\n\t}", "function SigV4Utils() { }", "static get NOT_READY () {return 0}", "started () {\n\n }", "started () {\n\n }", "started () {\n\n }", "initialize() {\n\n }", "onMessageReceive() {}", "initialize()\n {\n }", "_get () {\n throw new Error('_get not implemented')\n }", "get () {\n }", "constructor() { }", "constructor() { }", "constructor() { }", "constructor() { }", "constructor() { }", "constructor() { }", "constructor() { }", "constructor() { }", "constructor() { }", "constructor() { }", "constructor() { }", "function getImplementation( cb ){\n\n }", "started() {}", "started() {}", "started() {}", "started() {}", "started() {}", "started() {}", "started() {}", "started() {}", "started() {}", "started() {}", "heartbeat () {\n }", "constructor() {\n \n }", "constructor() {\n \n }", "constructor() {\n \n }", "constructor() {\n \n }", "constructor() {\n \n }", "constructor() {\n \n }", "constructor() {\n \n }", "constructor() {\n \n }", "constructor() {\n \n }", "constructor() {\n \n }", "constructor() {\n \n }", "constructor() {\n \n }", "constructor() {\n \n }", "constructor() {\n \n }", "constructor() {\n \n }", "constructor() {\n \n }", "constructor() {\n \n }", "constructor() {\n \n }", "constructor() {\n \n }", "constructor() {\n \n }", "initleancloud() {\n AV.init({\n appId: keys.appId,\n appKey: keys.appKey\n })\n this.globalData.AV = AV\n }", "static final private internal function m106() {}", "getStreamPosition() {\n return Native.getStreamPosition();\n }", "onMessage() {}", "onMessage() {}", "constructor() {\n super();\n this._logger = new pip_services3_components_node_3.CompositeLogger();\n this._connectionResolver = new connect_1.AwsConnectionResolver();\n this._connectTimeout = 30000;\n this._client = null; //AmazonCloudWatchClient\n this._opened = false;\n }", "get WSAPlayerX64() {}" ]
[ "0.5349978", "0.48933455", "0.48501366", "0.48083982", "0.4772584", "0.474481", "0.47349635", "0.47027457", "0.46929818", "0.46929818", "0.4673667", "0.4644517", "0.46389893", "0.46253318", "0.4618249", "0.4582536", "0.45813942", "0.45742747", "0.45687214", "0.45623618", "0.45563498", "0.45493752", "0.45489514", "0.45457798", "0.4538844", "0.45218396", "0.45187637", "0.4498104", "0.44946006", "0.44832855", "0.44729492", "0.44691566", "0.44642788", "0.44588575", "0.44554883", "0.4453296", "0.44531393", "0.4443642", "0.44374335", "0.44267404", "0.44238108", "0.44228086", "0.4407407", "0.44043022", "0.44043022", "0.44043022", "0.44035548", "0.4393825", "0.43761918", "0.43697277", "0.4364149", "0.43530616", "0.43530616", "0.43530616", "0.43530616", "0.43530616", "0.43530616", "0.43530616", "0.43530616", "0.43530616", "0.43530616", "0.43530616", "0.43517888", "0.43511248", "0.43511248", "0.43511248", "0.43511248", "0.43511248", "0.43511248", "0.43511248", "0.43511248", "0.43511248", "0.43511248", "0.43502304", "0.43493763", "0.43493763", "0.43493763", "0.43493763", "0.43493763", "0.43493763", "0.43493763", "0.43493763", "0.43493763", "0.43493763", "0.43493763", "0.43493763", "0.43493763", "0.43493763", "0.43493763", "0.43493763", "0.43493763", "0.43493763", "0.43493763", "0.43493763", "0.43440503", "0.43416435", "0.43375877", "0.43357816", "0.43357816", "0.43336093", "0.43330038" ]
0.0
-1
Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file distributed with this work for additional information regarding copyright ownership. The ASF licenses this file to you under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. Cartesian coordinate system
function dimAxisMapper(dim) { return this._axes[dim]; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "get Center() { return [this.x1 + (0.5 * this.x2 - this.x1), this.y1 + (0.5 * this.y2 - this.y1)]; }", "get Center() { return [this.x1 + (0.5 * this.x2 - this.x1), this.y1 + (0.5 * this.y2 - this.y1)]; }", "center() {\n let x_center = 0, y_center = 0;\n const coords = this.getCoords();\n for (let axis = 0; axis < coords.length; axis ++) {\n let [i, j] = num_60rotations(2*axis);\n x_center += i * coords[axis];\n y_center += j * coords[axis];\n }\n return [x_center, y_center];\n }", "coordinates () {\n return this._position.coordinates()\n }", "getCoords() {\n return [this.x, this.y, this.z];\n }", "computeCoords() {\n this.distanceFromEarthCenter = bv3.length(this.position)\n this.distanceFromEarthSurface = this.distanceFromEarthCenter - 6378\n\n this.lat = radians2degrees(Math.asin(-this.position[1] / this.distanceFromEarthCenter))\n\n\n const posAtEquator = [this.position[0], 0, this.position[2]]\n\n\n const distanceFromEarthCenterAtEquator = bv3.length(posAtEquator)\n const l90 = radians2degrees(Math.asin(-this.position[0] / distanceFromEarthCenterAtEquator))\n\n\n if (this.position[0] > 0 != this.position[2] > 0) {\n if (this.position[0] > 0) {\n //CCconsole.log(\"c1\")\n this.lon = l90;\n } else {\n //CCconsole.log(\"c2\")\n this.lon = 180 - l90;\n }\n } else {\n if (this.position[0] > 0) {\n //CCconsole.log(\"c3\")\n this.lon = -180 - l90;\n } else {\n //CCconsole.log(\"c4\")\n this.lon = l90;\n }\n }\n\n \n }", "project(coord, transMat) {\n var point = BABYLON.Vector3.TransformCoordinates(coord, transMat);\n // The transformed coordinates will be based on coordinate system\n // starting on the center of the screen. But drawing on screen normally starts\n // from top left. We then need to transform them again to have x:0, y:0 on top left.\n var x = point.x * this.workingWidth + this.workingWidth / 2.0 >> 0; // >>0 二进制右移 相当于取整\n var y = -point.y * this.workingHeight + this.workingHeight / 2.0 >> 0;\n return (new BABYLON.Vector2(x, y));\n }", "function sphericalToCartesian( r, a, e ) {\n var x = r * Math.cos(e) * Math.cos(a);\n var y = r * Math.sin(e);\n var z = r * Math.cos(e) * Math.sin(a);\n\n return [x,y,z];\n }", "get center() {\r\n return {\r\n x: this.x + this.width / 2,\r\n y: this.y + this.height / 2\r\n }\r\n }", "function cartesian(coordinates) {\n var lambda = coordinates[0] * __WEBPACK_IMPORTED_MODULE_1__math__[\"v\" /* radians */],\n phi = coordinates[1] * __WEBPACK_IMPORTED_MODULE_1__math__[\"v\" /* radians */],\n cosphi = Object(__WEBPACK_IMPORTED_MODULE_1__math__[\"h\" /* cos */])(phi);\n return [cosphi * Object(__WEBPACK_IMPORTED_MODULE_1__math__[\"h\" /* cos */])(lambda), cosphi * Object(__WEBPACK_IMPORTED_MODULE_1__math__[\"y\" /* sin */])(lambda), Object(__WEBPACK_IMPORTED_MODULE_1__math__[\"y\" /* sin */])(phi)];\n}", "_coord(arr) {\n var a = arr[0], d = arr[1], b = arr[2];\n var sum, pos = [0, 0];\n sum = a + d + b;\n if (sum !== 0) {\n a /= sum;\n d /= sum;\n b /= sum;\n pos[0] = corners[0][0] * a + corners[1][0] * d + corners[2][0] * b;\n pos[1] = corners[0][1] * a + corners[1][1] * d + corners[2][1] * b;\n }\n return pos;\n }", "function canvasToCartesianAxisCoords(pos) {\n // return an object with x/y corresponding to all used axes\n var res = {},\n i, axis;\n for (i = 0; i < xaxes.length; ++i) {\n axis = xaxes[i];\n if (axis && axis.used) {\n res[\"x\" + axis.n] = axis.c2p(pos.left);\n }\n }\n\n for (i = 0; i < yaxes.length; ++i) {\n axis = yaxes[i];\n if (axis && axis.used) {\n res[\"y\" + axis.n] = axis.c2p(pos.top);\n }\n }\n\n if (res.x1 !== undefined) {\n res.x = res.x1;\n }\n\n if (res.y1 !== undefined) {\n res.y = res.y1;\n }\n\n return res;\n }", "function coordinateSystem(unit) {\n return {\n dx: new Point(unit / 3, -unit / 3),\n dy: new Point(unit, 0),\n dz: new Point(0, unit)\n };\n}", "function cartesian(coordinates) {\n var lambda = coordinates[0] * __WEBPACK_IMPORTED_MODULE_1__math__[\"v\" /* radians */],\n phi = coordinates[1] * __WEBPACK_IMPORTED_MODULE_1__math__[\"v\" /* radians */],\n cosphi = Object(__WEBPACK_IMPORTED_MODULE_1__math__[\"h\" /* cos */])(phi);\n return [\n cosphi * Object(__WEBPACK_IMPORTED_MODULE_1__math__[\"h\" /* cos */])(lambda),\n cosphi * Object(__WEBPACK_IMPORTED_MODULE_1__math__[\"y\" /* sin */])(lambda),\n Object(__WEBPACK_IMPORTED_MODULE_1__math__[\"y\" /* sin */])(phi)\n ];\n}", "get position() { return p5.prototype.createVector(0, this.height + Earth.RADIUS, 0); }", "get center() {\n return {\n x: this.width / 2,\n y: this.height / 2\n };\n }", "transformCoords(x: number, y: number) {\n return {\n x: (x * this.im.scale) + this.im.position.x,\n y: (y * this.im.scale) + this.im.position.y,\n };\n }", "projectPosition(xyz) {\n const [X, Y] = this.projectFlat(xyz);\n const Z = (xyz[2] || 0) * this.unitsPerMeter;\n return [X, Y, Z];\n }", "get positionCentre()\n {\n return new Vector2D(\n this.position.x + this.#width/2,\n this.position.y + this.#height/2\n );\n }", "center(x, y) {\n return this.cx(x).cy(y);\n }", "calculatePositions() {\n this.x1 = this.from.getCenterX()\n this.y1 = this.from.getCenterY()\n this.x2 = this.to.getCenterX()\n this.y2 = this.to.getCenterY()\n }", "function WGS84ToCartesian(lng, lat, elv)\n{\n var result = [];\n var lngRad = lng * Math.PI / 180.0;\n var latRad = lat * Math.PI / 180.0;\n var sinlat = Math.sin(latRad);\n var coslat = Math.cos(latRad);\n var sinlong = Math.sin(lngRad);\n var coslong = Math.cos(lngRad);\n var Rn = 6378137.0 / Math.sqrt(1.0-0.006694379990197*sinlat*sinlat);\n result[0] = (Rn + elv) * coslat * coslong * 1.1920930376163765926810017443897e-7;\n result[1] = (Rn + elv) * coslat * sinlong * 1.1920930376163765926810017443897e-7;\n result[2] = (0.993305620011365*Rn + elv) * sinlat * 1.1920930376163765926810017443897e-7;\n return result;\n}", "getCenterPosition() {\n\t\tlet center = this.getCenter();\n\t\treturn {\n\t\t\tx: this.x + center.x,\n\t\t\ty: this.y + center.y\n\t\t};\n\t}", "transformPoint(x_, y_){\n let rads = this.angle * (Math.PI / 180);\n let sin = Math.sin(rads);\n let cos = Math.cos(rads);\n return {\n x: ((x_ * cos) - (y_ * sin)) + this.x\n , y: ((x_ * sin) + (y_ * cos)) + this.y\n }\n }", "get center () {\n return [this.lng, this.lat];\n }", "get center(): _Point {\n return Point(\n this.position.x + this.width / 2,\n this.position.y + this.height / 2\n )\n }", "getCenterPoint() {\n var x1 = this.point1.getX();\n var y1 = this.point1.getY();\n var x2 = this.point2.getX();\n var y2 = this.point2.getY();\n var centerX = (x1 - x2) / 2 + x2;\n var centerY = (y1 - y2) / 2 + y2;\n return new Point2D({x: centerX, y: centerY});\n }", "getRotationAxis() {\n let theta_2 = Math.acos(this.s);\n let a_inv = Math.sin(theta_2);\n this.theta = theta_2 * 2;\n return new Vector3(this.x / a_inv, this.y / a_inv, this.z / a_inv);\n }", "canvasToWorldCoordinates(p) {\r\n\t\tlet m = MathTools.inverseMatMul(this.camera.t, [\r\n\t\t\t[p.x-window.innerWidth/2+this.camera.x],\r\n\t\t\t[window.innerHeight-(p.y+window.innerHeight/2)+this.camera.y]\r\n\t\t])\r\n\t\treturn {\r\n\t\t\tx: m[0][0],\r\n\t\t\ty: m[1][0]\r\n\t\t}\r\n\t}", "project(xyz) {\n const {viewport} = this.context;\n const worldPosition = getWorldPosition(xyz, {\n viewport,\n modelMatrix: this.props.modelMatrix,\n coordinateOrigin: this.props.coordinateOrigin,\n coordinateSystem: this.props.coordinateSystem\n });\n const [x, y, z] = worldToPixels(worldPosition, viewport.pixelProjectionMatrix);\n return xyz.length === 2 ? [x, y] : [x, y, z];\n }", "static cartesianToDegrees([x = 0, y = 0]) {\n\t\treturn ArrayCoords.radiansToDegrees(ArrayCoords.cartesianToRadians([x, y]));\n\t}", "function axialCoords(q, r) {\r\n\tthis.q = q;\r\n\tthis.r = r;\r\n}", "function Position(x, y) {\n \"use strict\";\n\n this.x = x;\n this.y = y;\n\n this.oneDimPosition = function () {\n return ((this.y * 3) + this.x);\n };\n\n this.toString = function () {\n return (\"X: \" + this.x + \" Y: \" + this.y);\n };\n}", "centerPosition() {\n return [this.clientWidth() / 2, this.clientHeight() / 2, ];\n }", "circumcenter(ax, ay, bx, by, cx, cy) \n {\n bx -= ax;\n by -= ay;\n cx -= ax;\n cy -= ay;\n\n var bl = bx * bx + by * by;\n var cl = cx * cx + cy * cy;\n\n var d = bx * cy - by * cx;\n\n var x = (cy * bl - by * cl) * 0.5 / d;\n var y = (bx * cl - cx * bl) * 0.5 / d;\n\n return {\n x: ax + x,\n y: ay + y\n };\n }", "function init() {\n\n // array of: r_maj,r_min,lat1,lat2,c_lon,c_lat,false_east,false_north\n //double c_lat; /* center latitude */\n //double c_lon; /* center longitude */\n //double lat1; /* first standard parallel */\n //double lat2; /* second standard parallel */\n //double r_maj; /* major axis */\n //double r_min; /* minor axis */\n //double false_east; /* x offset in meters */\n //double false_north; /* y offset in meters */\n\n if (!this.lat2) {\n this.lat2 = this.lat1;\n } //if lat2 is not defined\n if (!this.k0) {\n this.k0 = 1;\n }\n this.x0 = this.x0 || 0;\n this.y0 = this.y0 || 0;\n // Standard Parallels cannot be equal and on opposite sides of the equator\n if (Math.abs(this.lat1 + this.lat2) < __WEBPACK_IMPORTED_MODULE_5__constants_values__[\"a\" /* EPSLN */]) {\n return;\n }\n\n var temp = this.b / this.a;\n this.e = Math.sqrt(1 - temp * temp);\n\n var sin1 = Math.sin(this.lat1);\n var cos1 = Math.cos(this.lat1);\n var ms1 = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0__common_msfnz__[\"a\" /* default */])(this.e, sin1, cos1);\n var ts1 = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_1__common_tsfnz__[\"a\" /* default */])(this.e, this.lat1, sin1);\n\n var sin2 = Math.sin(this.lat2);\n var cos2 = Math.cos(this.lat2);\n var ms2 = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0__common_msfnz__[\"a\" /* default */])(this.e, sin2, cos2);\n var ts2 = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_1__common_tsfnz__[\"a\" /* default */])(this.e, this.lat2, sin2);\n\n var ts0 = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_1__common_tsfnz__[\"a\" /* default */])(this.e, this.lat0, Math.sin(this.lat0));\n\n if (Math.abs(this.lat1 - this.lat2) > __WEBPACK_IMPORTED_MODULE_5__constants_values__[\"a\" /* EPSLN */]) {\n this.ns = Math.log(ms1 / ms2) / Math.log(ts1 / ts2);\n }\n else {\n this.ns = sin1;\n }\n if (isNaN(this.ns)) {\n this.ns = sin1;\n }\n this.f0 = ms1 / (this.ns * Math.pow(ts1, this.ns));\n this.rh = this.a * this.f0 * Math.pow(ts0, this.ns);\n if (!this.title) {\n this.title = \"Lambert Conformal Conic\";\n }\n}", "function XY(x,y)\r\n{\r\n \tvar pnt = domSVG.createSVGPoint();\r\n\tpnt.x = x\r\n\tpnt.y = y\r\n\tvar sCTM = domSVG.getScreenCTM();\r\n\tvar PNT = pnt.matrixTransform(sCTM.inverse());\r\n \treturn {x:PNT.x,y:PNT.y}\r\n}", "getMatrixForWindowCoordsToSVGUserSpaceCoords() {\n const { transformationContainer } = this;\n return transformationContainer.getScreenCTM().inverse();\n }", "function calcPos() {\n\t\t// Current coordinates\n\t\tvar coords = sphoords.getCoordinates();\n\t\tvar coords_deg = sphoords.getCoordinatesInDegrees();\n\n\t\t// Corresponding position on the sphere\n\t\treturn {\n\t\t\t\tx: radius * Math.cos(coords.latitude) * Math.sin(coords.longitude),\n\t\t\t\ty: radius * Math.cos(coords.latitude) * Math.cos(coords.longitude),\n\t\t\t\tz: radius * Math.sin(coords.latitude),\n\t\t\t\tlong: coords_deg.longitude,\n\t\t\t\tlat: coords_deg.latitude,\n\t\t\t\torientation: sphoords.getScreenOrientation()\n\t\t\t};\n\t}", "findCenter() {\n return {\n x: (this.right - this.left)/2 + this.left,\n y: (this.bottom - this.top)/2 + this.top\n };\n }", "function cartesian(coordinates) {\n const lambda = coordinates[0] * radians,\n phi = coordinates[1] * radians,\n cosphi = cos(phi);\n return [cosphi * cos(lambda), cosphi * sin(lambda), sin(phi)];\n}", "cameraCoords() {\n let coords0 = vec3.fromValues(5, 2, 0);\n let coords1 = vec3.fromValues(3, 3, 1);\n let coords2 = vec3.fromValues(-3,3,1);\n return new Array(coords0, coords1, coords2);\n }", "constructor() {\n super(\"position\", \"normal\", \"texture_coord\");\n // Loop 3 times (for each axis), and inside loop twice (for opposing cube sides):\n for (var i = 0; i < 3; i++)\n for (var j = 0; j < 2; j++) {\n var square_transform = Mat4.rotation(\n i == 0 ? Math.PI / 2 : 0,\n Vec.of(1, 0, 0)\n )\n .times(\n Mat4.rotation(\n Math.PI * j - (i == 1 ? Math.PI / 2 : 0),\n Vec.of(0, 1, 0)\n )\n )\n .times(Mat4.translation([0, 0, 1]));\n // Calling this function of a Square (or any Shape) copies it into the specified\n // Shape (this one) at the specified matrix offset (square_transform):\n Square.insert_transformed_copy_into(this, [], square_transform);\n }\n }", "project(ax, ay, az, angles){\r\n var x = ax - this.camera_p.x;\r\n var y = ay - this.camera_p.y;\r\n var z = az - this.camera_p.z;\r\n \r\n var dx = angles.cy*(angles.sz*y + angles.cz*x) - angles.sy*z;\r\n var dy = angles.sx*(angles.cy*z + angles.sy*(angles.sz*y + angles.cz*x)) + angles.cx*(angles.cz*y - angles.sz*x);\r\n var dz = angles.cx*(angles.cy*z + angles.sy*(angles.sz*y + angles.cz*x)) - angles.sx*(angles.cz*y - angles.sz*x);\r\n return {x: (this.view_p.z*dx)/dz - this.view_p.x, y: (this.view_p.z*dy)/dz - this.view_p.y, dx:dx, dy:dy, dz:dz};\r\n }", "translate(x,y) {\n return new Point({\n x: this.x + x,\n y: this.y + y\n })\n }", "function cartesianAxisToCanvasCoords(pos) {\n // get canvas coords from the first pair of x/y found in pos\n var res = {},\n i, axis, key;\n\n for (i = 0; i < xaxes.length; ++i) {\n axis = xaxes[i];\n if (axis && axis.used) {\n key = \"x\" + axis.n;\n if (pos[key] == null && axis.n === 1) {\n key = \"x\";\n }\n\n if (pos[key] != null) {\n res.left = axis.p2c(pos[key]);\n break;\n }\n }\n }\n\n for (i = 0; i < yaxes.length; ++i) {\n axis = yaxes[i];\n if (axis && axis.used) {\n key = \"y\" + axis.n;\n if (pos[key] == null && axis.n === 1) {\n key = \"y\";\n }\n\n if (pos[key] != null) {\n res.top = axis.p2c(pos[key]);\n break;\n }\n }\n }\n\n return res;\n }", "function Matrix() {\n this.cos = 0.0;\n this.sin = 0.0;\n this.pos = new Vector2();\n this.ang = 0.0;\n}", "get coords() {\n return [this.x, this.y];\n }", "function get_axis(r1, r2, r3) {\n rnorm = Math.sqrt(r1 * r1 + r2 * r2 + r3 * r3)\n k1 = r1 / rnorm\n k2 = r2 / rnorm\n k3 = r3 / rnorm\n return new THREE.Vector3(k1, k2, k3)\n}", "get position() {\n return this._boundingBox.topLeft.rotate(this.rotation, this.pivot);\n }", "constructor() {\n this.matrix = Matrix.identity(3);\n this._centerPoint = new Point(0, 0);\n }", "get worldMatrixInner() {\n return Matrix44.identity();\n }", "static cartesianToRadians([x = 0, y = 0]) {\n\t\treturn Math.atan2(y, x);\n\t}", "static getCoords(t, c, p) {\r\n\t\tlet m = MathTools.matMul(t.t, [\r\n\t\t\t[p.x],\r\n\t\t\t[p.y],\r\n\t\t\t[1]\r\n\t\t])\r\n\t\tm[0][0] += (t.x - c.x)\r\n\t\tm[1][0] += (t.y - c.y)\r\n\t\tm = MathTools.matMul(c.t, m)\r\n\t\treturn {\r\n\t\t\tx: m[0][0]+window.innerWidth/2,\r\n\t\t\ty: window.innerHeight - (m[1][0]+window.innerHeight/2)\r\n\t\t}\r\n\t}", "function orient2D(ax, ay, bx, by, cx, cy) {\n return determinant2D(ax - cx, ay - cy, bx - cx, by - cy);\n }", "function calculateCoordinatesForTiles(){\n var coordinates = {},\n\t\tc2 = new Cesium.Cartesian2(0, 0)\n \tleftTop = scene.camera.pickEllipsoid(c2)\n c2 = new Cesium.Cartesian2(canvas.width, canvas.height)\n var rightDown = scene.camera.pickEllipsoid(c2)\n\n if (leftTop != null && rightDown != null) {\n coordinates.leftTop = Cesium.Ellipsoid.WGS84.cartesianToCartographic(leftTop)\n coordinates.rightDown = Cesium.Ellipsoid.WGS84.cartesianToCartographic(rightDown)\n console.log(\"min lat/long - \", coordinates.leftTop.latitude, coordinates.leftTop.longitude)\n console.log(\"max lat/long - \", coordinates.rightDown.latitude, coordinates.rightDown.longitude)\n\n\t\treturn coordinates\n } else {\n //The sky is visible in 3D\n return null\n }\n}", "function cubeCoords(q, r) {\r\n\tthis.x = q;\r\n\tthis.z = r;\r\n\tthis.y = -q-r;\r\n}", "adjustPosition() {\n //this.geometry.applyMatrix( new THREE.Matrix4().makeTranslation( -(this.width / 2), 0, -(this.height / 2)) );\n this.geometry.translate(-(this.width / 2), 0, -(this.height / 2));\n }", "screenToWorld(x, y) {\r\n\t\tconst dpr = window.devicePixelRatio || 1;\r\n\t \treturn {\r\n\t\t\tx:(x - this._canvas.width / dpr / 2) / this.zoom + this.posX,\r\n\t\t\tz:(y - this._canvas.height / dpr / 2) / this.zoom + this.posZ\r\n\t\t};\r\n\t}", "constructor(x_pos, y_pos) {\n this.x_pos = x_pos;\n this.y_pos = y_pos;\n }", "function rotateCartesian(vector, axis, angle) {\n\t var angleRads = angle * radians,\n\t vectorOut = vector.slice(),\n\t ax1 = (axis === 0) ? 1 : 0,\n\t ax2 = (axis === 2) ? 1 : 2,\n\t cosa = Math.cos(angleRads),\n\t sina = Math.sin(angleRads);\n\t\n\t vectorOut[ax1] = vector[ax1] * cosa - vector[ax2] * sina;\n\t vectorOut[ax2] = vector[ax2] * cosa + vector[ax1] * sina;\n\t\n\t return vectorOut;\n\t}", "function rotateCartesian(vector, axis, angle) {\n\t var angleRads = angle * radians,\n\t vectorOut = vector.slice(),\n\t ax1 = (axis === 0) ? 1 : 0,\n\t ax2 = (axis === 2) ? 1 : 2,\n\t cosa = Math.cos(angleRads),\n\t sina = Math.sin(angleRads);\n\t\n\t vectorOut[ax1] = vector[ax1] * cosa - vector[ax2] * sina;\n\t vectorOut[ax2] = vector[ax2] * cosa + vector[ax1] * sina;\n\t\n\t return vectorOut;\n\t}", "function Cartesian2D(name) {\n Cartesian.call(this, name);\n}", "function Cartesian2D(name) {\n Cartesian.call(this, name);\n}", "function Cartesian2D(name) {\n Cartesian.call(this, name);\n}", "function Cartesian2D(name) {\n Cartesian.call(this, name);\n}", "function Cartesian2D(name) {\n Cartesian.call(this, name);\n}", "transform (matrix) {\n return new Point(this.native().matrixTransform(matrix))\n }", "apply() {\n var transMatrix = mat4.create();\n mat4.identity(transMatrix);\n\n mat4.translate(transMatrix, transMatrix, [this.centerX, this.centerY, this.centerZ]);\n mat4.translate(transMatrix, transMatrix, this.position);\n mat4.rotate(transMatrix, transMatrix, this.angle, [0, 1, 0]);\n\n return transMatrix;\n }", "translate(x, y) {\r\n let tempCubes = [[0, 0], [0, 0], [0, 0], [0, 0]];\r\n this.cubes.forEach(translateCube);\r\n let tempPivotCube = [0, 0];\r\n tempPivotCube[0] = this.pivotCube[0] + x;\r\n tempPivotCube[1] = this.pivotCube[1] + y;\r\n function translateCube(item, index) {\r\n tempCubes[index][0] = item[0] + x;\r\n tempCubes[index][1] = item[1] + y;\r\n }\r\n\r\n return new Tetromino(tempCubes, tempPivotCube, this.material);\r\n }", "function cartesian$1(coordinates) {\n var lambda = coordinates[0] * radians,\n phi = coordinates[1] * radians,\n cosphi = cos(phi);\n return [\n cosphi * cos(lambda),\n cosphi * sin(lambda),\n sin(phi)\n ];\n}", "rotXYZ(XYZ, y_axis, x_axis_p)\n\t{\n\t\tlet XYZrotated = {\n\t\t X: null,\n\t\t Y: null,\n\t\t Z: null};\n\t\tXYZrotated.X = this.rotate(XYZ.X, y_axis, x_axis_p);\n\t\tXYZrotated.Y = this.rotate(XYZ.Y, y_axis, x_axis_p);\n\t\tXYZrotated.Z = this.rotate(XYZ.Z, y_axis, x_axis_p);\n\t\t// Normalize\n\t\tXYZrotated.X = this.normalizeVect(XYZrotated.X);\n\t\tXYZrotated.Y = this.normalizeVect(XYZrotated.Y);\n\t\tXYZrotated.Z = this.normalizeVect(XYZrotated.Z);\n\t\t// Reduce residue of Y\n\t\tlet a = this.innerProductXYZ(XYZrotated.X, XYZrotated.Y);\n\t\tXYZrotated.Y.x -= a * XYZrotated.X.x;\n\t\tXYZrotated.Y.y -= a * XYZrotated.X.y;\n\t\tXYZrotated.Y.z -= a * XYZrotated.X.z;\n\t\t// Reduce residue of Z\n\t\ta = this.innerProductXYZ(XYZrotated.X, XYZrotated.Z);\n\t\tXYZrotated.Z.x -= a * XYZrotated.X.x;\n\t\tXYZrotated.Z.y -= a * XYZrotated.X.y;\n\t\tXYZrotated.Z.z -= a * XYZrotated.X.z;\n\t\ta = this.innerProductXYZ(XYZrotated.Y, XYZrotated.Z);\n\t\tXYZrotated.Z.x -= a * XYZrotated.Y.x;\n\t\tXYZrotated.Z.y -= a * XYZrotated.Y.y;\n\t\tXYZrotated.Z.z -= a * XYZrotated.Y.z;\n\t\treturn XYZrotated;\n\t}", "rotXYZ(XYZ, y_axis, x_axis_p)\n\t{\n\t\tlet XYZrotated = {\n\t\t X: null,\n\t\t Y: null,\n\t\t Z: null};\n\t\tXYZrotated.X = this.rotate(XYZ.X, y_axis, x_axis_p);\n\t\tXYZrotated.Y = this.rotate(XYZ.Y, y_axis, x_axis_p);\n\t\tXYZrotated.Z = this.rotate(XYZ.Z, y_axis, x_axis_p);\n\t\t// Normalize\n\t\tXYZrotated.X = this.normalizeVect(XYZrotated.X);\n\t\tXYZrotated.Y = this.normalizeVect(XYZrotated.Y);\n\t\tXYZrotated.Z = this.normalizeVect(XYZrotated.Z);\n\t\t// Reduce residue of Y\n\t\tlet a = this.innerProductXYZ(XYZrotated.X, XYZrotated.Y);\n\t\tXYZrotated.Y.x -= a * XYZrotated.X.x;\n\t\tXYZrotated.Y.y -= a * XYZrotated.X.y;\n\t\tXYZrotated.Y.z -= a * XYZrotated.X.z;\n\t\t// Reduce residue of Z\n\t\ta = this.innerProductXYZ(XYZrotated.X, XYZrotated.Z);\n\t\tXYZrotated.Z.x -= a * XYZrotated.X.x;\n\t\tXYZrotated.Z.y -= a * XYZrotated.X.y;\n\t\tXYZrotated.Z.z -= a * XYZrotated.X.z;\n\t\ta = this.innerProductXYZ(XYZrotated.Y, XYZrotated.Z);\n\t\tXYZrotated.Z.x -= a * XYZrotated.Y.x;\n\t\tXYZrotated.Z.y -= a * XYZrotated.Y.y;\n\t\tXYZrotated.Z.z -= a * XYZrotated.Y.z;\n\t\treturn XYZrotated;\n\t}", "getMatrix() {\n let x, y;\n\n x = this.transform.getPosition().x;\n y = this.transform.getPosition().y;\n\n this._transformMatrix.identity();\n\n //mat4.translate(this._transformMatrix, this._transformMatrix, [x, y, 0]);\n //mat4.rotate(this._transformMatrix, this._transformMatrix, this.transform.getRotation(), [0.0, 0.0, 1.0]);\n //mat4.translate(this._transformMatrix, this._transformMatrix, [-x, -y, 0]);\n\n this._transformMatrix.translate([x, y, 0]);\n\n return this._transformMatrix.asArray();\n }", "worldToScreen(x, y) {\n if (y === undefined) {\n y = x.y;\n x = x.x;\n }\n\n let M = this.ctx.getTransform();\n\n let ret = {\n x: x * M.a + y * M.c + M.e,\n y: x * M.b + y * M.d + M.f,\n };\n\n return ret;\n }", "function d3f_geo_cartesian(spherical) {\n var λ = spherical[0],\n φ = spherical[1],\n cosφ = Math.cos(φ);\n return [\n cosφ * Math.cos(λ),\n cosφ * Math.sin(λ),\n Math.sin(φ)\n ];\n}", "function PolarCoordinates() {\r\n}", "get center() {}", "function spherical(cartesian) {\n return [Object(__WEBPACK_IMPORTED_MODULE_1__math__[\"g\" /* atan2 */])(cartesian[1], cartesian[0]) * __WEBPACK_IMPORTED_MODULE_1__math__[\"j\" /* degrees */], Object(__WEBPACK_IMPORTED_MODULE_1__math__[\"e\" /* asin */])(Object(__WEBPACK_IMPORTED_MODULE_1__math__[\"q\" /* max */])(-1, Object(__WEBPACK_IMPORTED_MODULE_1__math__[\"r\" /* min */])(1, cartesian[2]))) * __WEBPACK_IMPORTED_MODULE_1__math__[\"j\" /* degrees */]];\n}", "cartesianToCartographic(cartesian, result = [0, 0, 0]) {\n scratchCartesian.from(cartesian);\n const point = this.scaleToGeodeticSurface(scratchCartesian, scratchPosition);\n\n if (!point) {\n return undefined;\n }\n\n const normal = this.geodeticSurfaceNormal(point, scratchNormal);\n\n const h = scratchHeight;\n h.copy(scratchCartesian).subtract(point);\n\n const longitude = Math.atan2(normal.y, normal.x);\n const latitude = Math.asin(normal.z);\n const height = Math.sign(vec3.dot(h, scratchCartesian)) * vec3.length(h);\n\n return toCartographicFromRadians([longitude, latitude, height], result);\n }", "getMatrix() {\n let x, y;\n\n x = this.transform.getPosition().x;\n y = this.transform.getPosition().y;\n\n this._transformMatrix.identity();\n\n //mat4.translate(this._transformMatrix, this._transformMatrix, [x, y, 0]);\n // eslint-disable-next-line\n //mat4.rotate(this._transformMatrix, this._transformMatrix, this.transform.getRotation(), [0.0, 0.0, 1.0]);\n //mat4.translate(this._transformMatrix, this._transformMatrix, [-x, -y, 0]);\n\n this._transformMatrix.translate([x, y, 0]);\n\n return this._transformMatrix.asArray();\n }", "rotate(axis, angle) {\n let x = axis[0];\n let y = axis[1];\n let z = axis[2];\n let n = Math.sqrt(x * x + y * y + z * z);\n x /= n;\n y /= n;\n z /= n;\n\n let xx = x * x;\n let yy = y * y;\n let zz = z * z;\n let c = Math.cos(angle);\n let s = Math.sin(angle);\n let oneMinusCosine = 1 - c;\n\n let r00 = xx + (1 - xx) * c;\n let r01 = x * y * oneMinusCosine + z * s;\n let r02 = x * z * oneMinusCosine - y * s;\n let r10 = x * y * oneMinusCosine - z * s;\n let r11 = yy + (1 - yy) * c;\n let r12 = y * z * oneMinusCosine + x * s;\n let r20 = x * z * oneMinusCosine + y * s;\n let r21 = y * z * oneMinusCosine - x * s;\n let r22 = zz + (1 - zz) * c;\n\n let m00 = this._matrix[0 * 4 + 0];\n let m01 = this._matrix[0 * 4 + 1];\n let m02 = this._matrix[0 * 4 + 2];\n let m03 = this._matrix[0 * 4 + 3];\n let m10 = this._matrix[1 * 4 + 0];\n let m11 = this._matrix[1 * 4 + 1];\n let m12 = this._matrix[1 * 4 + 2];\n let m13 = this._matrix[1 * 4 + 3];\n let m20 = this._matrix[2 * 4 + 0];\n let m21 = this._matrix[2 * 4 + 1];\n let m22 = this._matrix[2 * 4 + 2];\n let m23 = this._matrix[2 * 4 + 3];\n\n this._matrix[0] = r00 * m00 + r01 * m10 + r02 * m20;\n this._matrix[1] = r00 * m01 + r01 * m11 + r02 * m21;\n this._matrix[2] = r00 * m02 + r01 * m12 + r02 * m22;\n this._matrix[3] = r00 * m03 + r01 * m13 + r02 * m23;\n this._matrix[4] = r10 * m00 + r11 * m10 + r12 * m20;\n this._matrix[5] = r10 * m01 + r11 * m11 + r12 * m21;\n this._matrix[6] = r10 * m02 + r11 * m12 + r12 * m22;\n this._matrix[7] = r10 * m03 + r11 * m13 + r12 * m23;\n this._matrix[8] = r20 * m00 + r21 * m10 + r22 * m20;\n this._matrix[9] = r20 * m01 + r21 * m11 + r22 * m21;\n this._matrix[10] = r20 * m02 + r21 * m12 + r22 * m22;\n this._matrix[11] = r20 * m03 + r21 * m13 + r22 * m23;\n\n return this._matrix;\n }", "_getWorldCoords() {\n const corners = [\n tempCorner1.set(-1, 1, 0), // plane's top left corner\n tempCorner2.set(1, 1, 0), // plane's top right corner\n tempCorner3.set(1, -1, 0), // plane's bottom right corner\n tempCorner4.set(-1, -1, 0), // plane's bottom left corner\n ];\n\n // corners with model view projection matrix applied\n let mvpCorners = [];\n // eventual clipped corners\n let clippedCorners = [];\n\n // we are going to get our plane's four corners relative to our model view projection matrix\n for(let i = 0; i < corners.length; i++) {\n const mvpCorner = corners[i].applyMat4(this._matrices.modelViewProjection.matrix);\n mvpCorners.push(mvpCorner);\n\n // Z position is > 1 or < -1 means the corner is clipped\n if(Math.abs(mvpCorner.z) > 1) {\n clippedCorners.push(i);\n }\n }\n\n // near plane is clipping, get intersections between plane and near plane\n if(clippedCorners.length) {\n mvpCorners = this._getNearPlaneIntersections(corners, mvpCorners, clippedCorners);\n }\n\n // we need to check for the X and Y min and max values\n // use arbitrary integers that will be overriden anyway\n let minX = Infinity;\n let maxX = -Infinity;\n\n let minY = Infinity;\n let maxY = -Infinity;\n\n for(let i = 0; i < mvpCorners.length; i++) {\n const corner = mvpCorners[i];\n\n if(corner.x < minX) {\n minX = corner.x;\n }\n if(corner.x > maxX) {\n maxX = corner.x;\n }\n\n if(corner.y < minY) {\n minY = corner.y;\n }\n if(corner.y > maxY) {\n maxY = corner.y;\n }\n }\n\n return {\n top: maxY,\n right: maxX,\n bottom: minY,\n left: minX,\n };\n }", "get Center() {}", "function calculateMatrixAndOffset(_ref) {\n var projectionMode = _ref.projectionMode,\n positionOrigin = _ref.positionOrigin,\n viewport = _ref.viewport;\n var viewMatrixUncentered = viewport.viewMatrixUncentered,\n projectionMatrix = viewport.projectionMatrix;\n var viewMatrix = viewport.viewMatrix,\n viewProjectionMatrix = viewport.viewProjectionMatrix;\n\n var projectionCenter = void 0;\n\n switch (projectionMode) {\n\n case __WEBPACK_IMPORTED_MODULE_4__lib_constants__[\"a\" /* COORDINATE_SYSTEM */].IDENTITY:\n case __WEBPACK_IMPORTED_MODULE_4__lib_constants__[\"a\" /* COORDINATE_SYSTEM */].LNGLAT:\n projectionCenter = ZERO_VECTOR;\n break;\n\n // TODO: make lighitng work for meter offset mode\n case __WEBPACK_IMPORTED_MODULE_4__lib_constants__[\"a\" /* COORDINATE_SYSTEM */].METER_OFFSETS:\n // Calculate transformed projectionCenter (in 64 bit precision)\n // This is the key to offset mode precision (avoids doing this\n // addition in 32 bit precision)\n var positionPixels = viewport.projectFlat(positionOrigin);\n // projectionCenter = new Matrix4(viewProjectionMatrix)\n // .transformVector([positionPixels[0], positionPixels[1], 0.0, 1.0]);\n projectionCenter = __WEBPACK_IMPORTED_MODULE_2_gl_vec4_transformMat4___default()([], [positionPixels[0], positionPixels[1], 0.0, 1.0], viewProjectionMatrix);\n\n // Always apply uncentered projection matrix if available (shader adds center)\n // Zero out 4th coordinate (\"after\" model matrix) - avoids further translations\n // viewMatrix = new Matrix4(viewMatrixUncentered || viewMatrix)\n // .multiplyRight(VECTOR_TO_POINT_MATRIX);\n viewMatrix = __WEBPACK_IMPORTED_MODULE_1_gl_mat4_multiply___default()([], viewMatrixUncentered || viewMatrix, VECTOR_TO_POINT_MATRIX);\n viewProjectionMatrix = __WEBPACK_IMPORTED_MODULE_1_gl_mat4_multiply___default()([], projectionMatrix, viewMatrix);\n break;\n\n default:\n throw new Error('Unknown projection mode');\n }\n\n var viewMatrixInv = __WEBPACK_IMPORTED_MODULE_0_gl_mat4_invert___default()([], viewMatrix) || viewMatrix;\n var cameraPos = [viewMatrixInv[12], viewMatrixInv[13], viewMatrixInv[14]];\n\n return {\n viewMatrix: viewMatrix,\n viewProjectionMatrix: viewProjectionMatrix,\n projectionCenter: projectionCenter,\n cameraPos: cameraPos\n };\n}", "function posfor(x, y, axis) {\n if (axis == 0) return x * 9 + y;\n if (axis == 1) return y * 9 + x;\n return [0,3,6,27,30,33,54,57,60][x] + [0,1,2,9,10,11,18,19,20][y];\n}", "function posfor(x, y, axis) {\n if (axis == 0) return x * 9 + y;\n if (axis == 1) return y * 9 + x;\n return [0,3,6,27,30,33,54,57,60][x] + [0,1,2,9,10,11,18,19,20][y];\n}", "function rotateCartesian(vector, axis, angle) {\n var angleRads = angle * radians,\n vectorOut = vector.slice(),\n ax1 = (axis === 0) ? 1 : 0,\n ax2 = (axis === 2) ? 1 : 2,\n cosa = Math.cos(angleRads),\n sina = Math.sin(angleRads);\n\n vectorOut[ax1] = vector[ax1] * cosa - vector[ax2] * sina;\n vectorOut[ax2] = vector[ax2] * cosa + vector[ax1] * sina;\n\n return vectorOut;\n}", "function Origin(){\n this.x = midWidth;\n this.y = midHeight;\n}", "toRadians() {\n\t\tif (this.y == 0 && this.x == 0) {\n\t\t\treturn 0; //special case, zero length vector\n\t\t}\n\t\treturn Math.atan2 ( this.y, this.x ) + Math.PI / 2;\n\t}", "project(xyz, {topLeft = true} = {}) {\n const worldPosition = this.projectPosition(xyz);\n const coord = worldToPixels(worldPosition, this.pixelProjectionMatrix);\n\n const [x, y] = coord;\n const y2 = topLeft ? y : this.height - y;\n return xyz.length === 2 ? [x, y2] : [x, y2, coord[2]];\n }", "addVertex(givenX, givenY, xMove, yMove, zoom){ //generally the mouse coords\n\n //apply transformations!\n let xcoor = (givenX - (width/2)) / (width/2);\n let ycoor = ((height - givenY) - (height/2)) / (height/2); //weird since canvas is upside down for mouse\n let hit = false;\n //now you have to apply the transformations for world, not inverse\n xcoor = xcoor/zoom;\n ycoor = ycoor/zoom;\n\n\n xcoor -= xMove; //minus because shifting left is negative, so subtracting a negative value moves to the right\n ycoor -= yMove;\n\n //now just create a vertex with these coords\n this.numVertices++; //get a unique ID\n\n let vert = new Vertex(xcoor, ycoor, this.numVertices);\n this.vertices.addFront(new VertexItem(vert));\n this.vertArray.push(vert);\n\n }", "function calculatePosition() {\n var t = p1.angle;\n var p = p2.angle;\n\n var x1 = l*Math.sin(t);\n var y1 = l*Math.cos(t);\n var _y1 = -y1;\n\n var x2 = x1 + L*Math.sin(p);\n var y2 = y1 + L*Math.cos(p);\n var _y2 = -y2;\n\n p1.x = x1;\n p1.y = _y1;\n p2.x = x2;\n p2.y = _y2;\n}", "function getCoords () {\n return {\n x: 10,\n y: 22\n }\n }", "constructor ()\n\t{\n\t\tthis.x = 0;\n\t\tthis.y = 0;\n\t}", "eventCoordsToSVGCoords(x, y) {\n const svg = this.svgSubjectArea;\n const newPoint = svg.createSVGPoint();\n newPoint.x = x;\n newPoint.y = y;\n const matrixForWindowCoordsToSVGUserSpaceCoords = this.getMatrixForWindowCoordsToSVGUserSpaceCoords();\n const pointforSVGSystem = newPoint.matrixTransform(matrixForWindowCoordsToSVGUserSpaceCoords);\n return pointforSVGSystem;\n }", "get origin() {\n return { x: this.x, y: this.y };\n }", "function getWorldPosition(_ref7) {\n var longitude = _ref7.longitude,\n latitude = _ref7.latitude,\n zoom = _ref7.zoom,\n scale = _ref7.scale,\n meterOffset = _ref7.meterOffset,\n _ref7$distanceScales = _ref7.distanceScales,\n distanceScales = _ref7$distanceScales === undefined ? null : _ref7$distanceScales;\n\n // Calculate scale from zoom if not provided\n scale = scale !== undefined ? scale : zoomToScale(zoom);\n\n // Make a centered version of the matrix for projection modes without an offset\n var center2d = lngLatToWorld([longitude, latitude], scale);\n var center = new __WEBPACK_IMPORTED_MODULE_0_math_gl__[\"b\" /* Vector3 */](center2d[0], center2d[1], 0);\n\n if (meterOffset) {\n // Calculate distance scales if lng/lat/zoom are provided\n distanceScales = distanceScales || getDistanceScales({ latitude: latitude, longitude: longitude, scale: scale });\n\n var pixelPosition = new __WEBPACK_IMPORTED_MODULE_0_math_gl__[\"b\" /* Vector3 */](meterOffset)\n // Convert to pixels in current zoom\n .scale(distanceScales.pixelsPerMeter)\n // We want positive Y to represent an offset towards north,\n // but web mercator world coordinates is top-left\n .scale([1, -1, 1]);\n center.add(pixelPosition);\n }\n\n return center;\n}", "getCenter(){\n\t\treturn {\n\t\t\tx: 2,\n\t\t\ty: 2\n\t\t};\n\t}", "function TransformCoordinates(orderedPair) {\n let xCoordinate = orderedPair[0]\n orderedPair[0] = xCoordinate*30\n // makes parabola look like a quadrant 1 parabola\n let yCoordinate = orderedPair[1];\n orderedPair[1] = canvasSize - yCoordinate;\n return orderedPair;\n\n}", "get position() {\n return {\n x: this.x,\n y: this.y\n };\n }" ]
[ "0.589108", "0.589108", "0.57303226", "0.5684142", "0.56726396", "0.561011", "0.5600579", "0.5583609", "0.55618536", "0.55525583", "0.5520512", "0.5502633", "0.54673386", "0.54541224", "0.54532754", "0.5447362", "0.5438439", "0.5435534", "0.54311943", "0.54281527", "0.5427857", "0.5416701", "0.54110336", "0.5403987", "0.54033476", "0.54029834", "0.53929377", "0.53929263", "0.5391928", "0.5379793", "0.53723395", "0.53616345", "0.5359735", "0.53568643", "0.5356844", "0.5353435", "0.535218", "0.53519636", "0.5344358", "0.53303933", "0.5324258", "0.53221726", "0.5321003", "0.5315539", "0.5313864", "0.5307743", "0.5296015", "0.5291722", "0.5276956", "0.5273548", "0.5273284", "0.52721846", "0.52667147", "0.52576977", "0.5254911", "0.52546304", "0.5242345", "0.5234168", "0.5229546", "0.52212876", "0.52178615", "0.52178615", "0.5214692", "0.5214692", "0.5214692", "0.5214692", "0.5214692", "0.52109396", "0.52101535", "0.5205386", "0.5202126", "0.520157", "0.520157", "0.5190837", "0.51870304", "0.51784825", "0.51776564", "0.51700836", "0.5169037", "0.5167569", "0.5164717", "0.51633435", "0.516293", "0.5157751", "0.51483846", "0.51440746", "0.51440746", "0.5140416", "0.51215065", "0.512071", "0.51172614", "0.5112009", "0.5109107", "0.50999707", "0.50981724", "0.5097034", "0.50964135", "0.50873905", "0.50819963", "0.5077569", "0.50745887" ]
0.0
-1
Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file distributed with this work for additional information regarding copyright ownership. The ASF licenses this file to you under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
function setLabel(normalStyle, hoverStyle, itemModel, color, seriesModel, dataIndex, labelPositionOutside) { var labelModel = itemModel.getModel('label'); var hoverLabelModel = itemModel.getModel('emphasis.label'); graphic.setLabelStyle(normalStyle, hoverStyle, labelModel, hoverLabelModel, { labelFetcher: seriesModel, labelDataIndex: dataIndex, defaultText: getDefaultLabel(seriesModel.getData(), dataIndex), isRectText: true, autoColor: color }); fixPosition(normalStyle); fixPosition(hoverStyle); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "get Android() {}", "function SBRecordsetPHP_analyzePlatformSpecific()\r\n{\r\n\r\n\r\n}", "onChildAppStart () {\n\n }", "private internal function m248() {}", "private public function m246() {}", "onMessageStart() { }", "createStream () {\n\n }", "_playbackCompatibility() {\n // Detect audio playback capabilities.\n\n // Detect HTML5 Audio playback.\n // http://caniuse.com/#feat=audio\n this.canUseAudio = Boolean(new Audio());\n console.log('Native HTML5 Audio playback capability: ' +\n this.canUseAudio);\n\n // Detect Cordova Media Playback\n // It allows playing audio using the native bridge inside WebView Apps.\n // https://github.com/apache/cordova-plugin-media/blob/master/doc/index.md\n this.canUseCordovaMedia = Boolean(window.Media);\n console.log('Cordova Media playback capability: ' +\n this.canUseCordovaMedia);\n\n if (!(this.canUseAudio || this.canUseCordovaMedia)) {\n throw new Error(\n 'Some form of audio playback capability is required');\n }\n\n var _audio = new Audio();\n if (_audio.canPlayType === 'function') {\n throw new Error(\n 'Unable to detect audio playback capabilities');\n }\n\n var canPlayOggVorbis = _audio.canPlayType(\n 'audio/ogg; codecs=\"vorbis\"') !== '';\n var canPlayOggOpus = _audio.canPlayType(\n 'audio/ogg; codecs=\"opus\"') !== '';\n var canPlayWave = _audio.canPlayType('audio/wav') !== '';\n var canPlayMP3 = _audio.canPlayType('audio/mpeg; codecs=\"mp3\"') !== '';\n var canPlayAAC = _audio.canPlayType(\n 'audio/mp4; codecs=\"mp4a.40.2\"') !== '';\n var canPlay3GPP = _audio.canPlayType(\n 'audio/3gpp; codecs=\"samr\"') !== '';\n\n console.log('Native Vorbis audio in Ogg container playback capability: ' +\n canPlayOggVorbis);\n console.log('Native Opus audio in Ogg container playback capability: ' +\n canPlayOggOpus);\n console.log('Native PCM audio in Waveform Audio File Format (WAVE) ' +\n 'playback capability: ' + canPlayWave);\n console.log('Native MPEG Audio Layer 3 (MP3) playback capability: ' +\n canPlayMP3);\n console.log('Native Low-Complexity AAC audio in MP4 container playback ' +\n 'capability: ' + canPlayAAC);\n console.log('Native AMR audio in 3GPP container playback capability: ' +\n canPlay3GPP);\n\n if (!(canPlayWave || canPlayMP3)) {\n throw new Error(\n 'Native Wave or MP3 playback is required');\n }\n }", "constructor() {\n\t}", "constructor() {\n\t}", "constructor() {\n\n\t}", "onComponentMount() {\n\n }", "constructor() {\n throw new Error('Not implemented');\n }", "supportsPlatform() {\n return true;\n }", "function _____SHARED_functions_____(){}", "constructor() {\n }", "constructor() {\n\t\t// ...\n\t}", "static get tag(){return\"hal-9000\"}", "static getDeviceModel() {\n return \"zhimi.fan.za4\";\n }", "requestContainerInfo() {}", "constructor () { super() }", "function BaseDeviceProfile() {\n \n this.audioNeedsTranscodingCodecs = []; // fill these with audio codecs that the implemented device can handle natively\n this.videoNeedsTranscodingCodecs = []; // fill these with video codecs that the implemented device can handle natively\n this.validFormats = []; // fill these with video formats that the implemented device can handle natively\n\n this.transcodeOptions = {\n rescaleVideo : false, // BaseDeviceProfile.prototype.rescale\n subtitle : false, // BaseDeviceProfile.prototype.hardCodeSubtitle\n audioShiftCorrect : false // BaseDeviceProfile.prototype.correctAudioOffset\n };\n\n /**\n * @todo: whutz this?\n * @param {[type]} probeData [description]\n * @return {[type]} [description]\n */\n this.canPlayContainer = function (probeData) {\n throw new Error(\"canPlayContainer : Not Implemented\");\n };\n\n /**\n * Implement this method to return device specific ffmpeg flags for a probed media\n * @param {object} probeData ffmpeg probe data\n * @param {[type]} forceTranscode force transcode even if native format?\n * @return {Promise} [description]\n */\n this.getFFmpegFlags = function (probeData, forceTranscode) {\n throw new Error(\"getFFmpegFlags : Not Implemented!\");\n };\n\n}", "static get STATUS() {\n return 0;\n }", "static create () {}", "get() {}", "didMount() {\n }", "_onMessage() {\n throw new Error(\"not implemented\");\n }", "onReady() {}", "native() {\n throw new Error('NOT_IMPLEMENTED_EXCEPTION: you must override this method in order to use it')\n }", "function sdk(){\n}", "constructor () {\r\n\t\t\r\n\t}", "transient private protected internal function m182() {}", "function version(){ return \"0.13.0\" }", "static getDeviceModel() {\n return \"zhimi.fan.za5\";\n }", "started () {}", "function getVersion(){return _VERSION}", "transient private internal function m185() {}", "constructor() {\r\n }", "started() { }", "InitVsaEngine() {\n\n }", "started() {\r\n\r\n\t}", "function SigV4Utils() { }", "static get NOT_READY () {return 0}", "started () {\n\n }", "started () {\n\n }", "started () {\n\n }", "initialize() {\n\n }", "onMessageReceive() {}", "initialize()\n {\n }", "_get () {\n throw new Error('_get not implemented')\n }", "get () {\n }", "constructor() { }", "constructor() { }", "constructor() { }", "constructor() { }", "constructor() { }", "constructor() { }", "constructor() { }", "constructor() { }", "constructor() { }", "constructor() { }", "constructor() { }", "function getImplementation( cb ){\n\n }", "started() {}", "started() {}", "started() {}", "started() {}", "started() {}", "started() {}", "started() {}", "started() {}", "started() {}", "started() {}", "heartbeat () {\n }", "constructor() {\n \n }", "constructor() {\n \n }", "constructor() {\n \n }", "constructor() {\n \n }", "constructor() {\n \n }", "constructor() {\n \n }", "constructor() {\n \n }", "constructor() {\n \n }", "constructor() {\n \n }", "constructor() {\n \n }", "constructor() {\n \n }", "constructor() {\n \n }", "constructor() {\n \n }", "constructor() {\n \n }", "constructor() {\n \n }", "constructor() {\n \n }", "constructor() {\n \n }", "constructor() {\n \n }", "constructor() {\n \n }", "constructor() {\n \n }", "initleancloud() {\n AV.init({\n appId: keys.appId,\n appKey: keys.appKey\n })\n this.globalData.AV = AV\n }", "static final private internal function m106() {}", "getStreamPosition() {\n return Native.getStreamPosition();\n }", "onMessage() {}", "onMessage() {}", "constructor() {\n super();\n this._logger = new pip_services3_components_node_3.CompositeLogger();\n this._connectionResolver = new connect_1.AwsConnectionResolver();\n this._connectTimeout = 30000;\n this._client = null; //AmazonCloudWatchClient\n this._opened = false;\n }", "get WSAPlayerX64() {}" ]
[ "0.5349978", "0.48933455", "0.48501366", "0.48083982", "0.4772584", "0.474481", "0.47349635", "0.47027457", "0.46929818", "0.46929818", "0.4673667", "0.4644517", "0.46389893", "0.46253318", "0.4618249", "0.4582536", "0.45813942", "0.45742747", "0.45687214", "0.45623618", "0.45563498", "0.45493752", "0.45489514", "0.45457798", "0.4538844", "0.45218396", "0.45187637", "0.4498104", "0.44946006", "0.44832855", "0.44729492", "0.44691566", "0.44642788", "0.44588575", "0.44554883", "0.4453296", "0.44531393", "0.4443642", "0.44374335", "0.44267404", "0.44238108", "0.44228086", "0.4407407", "0.44043022", "0.44043022", "0.44043022", "0.44035548", "0.4393825", "0.43761918", "0.43697277", "0.4364149", "0.43530616", "0.43530616", "0.43530616", "0.43530616", "0.43530616", "0.43530616", "0.43530616", "0.43530616", "0.43530616", "0.43530616", "0.43530616", "0.43517888", "0.43511248", "0.43511248", "0.43511248", "0.43511248", "0.43511248", "0.43511248", "0.43511248", "0.43511248", "0.43511248", "0.43511248", "0.43502304", "0.43493763", "0.43493763", "0.43493763", "0.43493763", "0.43493763", "0.43493763", "0.43493763", "0.43493763", "0.43493763", "0.43493763", "0.43493763", "0.43493763", "0.43493763", "0.43493763", "0.43493763", "0.43493763", "0.43493763", "0.43493763", "0.43493763", "0.43493763", "0.43440503", "0.43416435", "0.43375877", "0.43357816", "0.43357816", "0.43336093", "0.43330038" ]
0.0
-1
Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file distributed with this work for additional information regarding copyright ownership. The ASF licenses this file to you under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. FIXME step not support polar
function isPointsSame(points1, points2) { if (points1.length !== points2.length) { return; } for (var i = 0; i < points1.length; i++) { var p1 = points1[i]; var p2 = points2[i]; if (p1[0] !== p2[0] || p1[1] !== p2[1]) { return; } } return true; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "_radialCoordinates(angles, radius){\n\n return angles.map((angle) => {\n return Coordinate.polar({\n coords: [radius, angle - 90],\n isDegree: true\n });\n })\n\n }", "static polar (len, angle) {\n return new Point (Math.cos(angle)*len, Math.sin(angle)*len);\n }", "function cartesian2Polar(point){\n var x = point[0];\n var y = point[1];\n var theta = rad2deg(Math.atan(y/x));\n \n // Q1: Use theta\n // Q2, Q3: Use theta + 180\n // Q4: Use theta + 360\n if(x < 0) theta += 180; // Handles Q2, Q3\n if(x > 0 && y < 0) theta += 360; // Handles Q4 \n \n if(x == 0){\n if(y > 0) theta = 90;\n else if(y < 0) theta = 270;\n else theta = 0;\n }\n \n return [magnitude(x,y), theta];\n}", "function polarAdd(origin, angle, length) {\n\t var x = origin[0];\n\t var y = origin[1];\n\t return [x + Math.cos(angle * 2 * Math.PI / 360) * length, y + -1.0 * Math.sin(angle * 2 * Math.PI / 360) * length];\n\t}", "static fromRot(axis, angle) {\nvar q;\n//-------\nq = new RQ();\nq.setFromAxisAngle(axis, angle);\nreturn q;\n}", "rotate(azimuthAngle, polarAngle, enableTransition) {\n \n this.rotateTo(\n this._sphericalEnd.theta + azimuthAngle,\n this._sphericalEnd.phi + polarAngle,\n enableTransition\n )\n \n }", "function polarAdd(origin, angle, length) {\n var x = origin[0];\n var y = origin[1];\n return [x + Math.cos(angle * 2 * Math.PI / 360) * length, y + -1.0 * Math.sin(angle * 2 * Math.PI / 360) * length];\n}", "function init() {\n\n // array of: r_maj,r_min,lat1,lat2,c_lon,c_lat,false_east,false_north\n //double c_lat; /* center latitude */\n //double c_lon; /* center longitude */\n //double lat1; /* first standard parallel */\n //double lat2; /* second standard parallel */\n //double r_maj; /* major axis */\n //double r_min; /* minor axis */\n //double false_east; /* x offset in meters */\n //double false_north; /* y offset in meters */\n\n if (!this.lat2) {\n this.lat2 = this.lat1;\n } //if lat2 is not defined\n if (!this.k0) {\n this.k0 = 1;\n }\n this.x0 = this.x0 || 0;\n this.y0 = this.y0 || 0;\n // Standard Parallels cannot be equal and on opposite sides of the equator\n if (Math.abs(this.lat1 + this.lat2) < __WEBPACK_IMPORTED_MODULE_5__constants_values__[\"a\" /* EPSLN */]) {\n return;\n }\n\n var temp = this.b / this.a;\n this.e = Math.sqrt(1 - temp * temp);\n\n var sin1 = Math.sin(this.lat1);\n var cos1 = Math.cos(this.lat1);\n var ms1 = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0__common_msfnz__[\"a\" /* default */])(this.e, sin1, cos1);\n var ts1 = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_1__common_tsfnz__[\"a\" /* default */])(this.e, this.lat1, sin1);\n\n var sin2 = Math.sin(this.lat2);\n var cos2 = Math.cos(this.lat2);\n var ms2 = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0__common_msfnz__[\"a\" /* default */])(this.e, sin2, cos2);\n var ts2 = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_1__common_tsfnz__[\"a\" /* default */])(this.e, this.lat2, sin2);\n\n var ts0 = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_1__common_tsfnz__[\"a\" /* default */])(this.e, this.lat0, Math.sin(this.lat0));\n\n if (Math.abs(this.lat1 - this.lat2) > __WEBPACK_IMPORTED_MODULE_5__constants_values__[\"a\" /* EPSLN */]) {\n this.ns = Math.log(ms1 / ms2) / Math.log(ts1 / ts2);\n }\n else {\n this.ns = sin1;\n }\n if (isNaN(this.ns)) {\n this.ns = sin1;\n }\n this.f0 = ms1 / (this.ns * Math.pow(ts1, this.ns));\n this.rh = this.a * this.f0 * Math.pow(ts0, this.ns);\n if (!this.title) {\n this.title = \"Lambert Conformal Conic\";\n }\n}", "updateAngleStep() {\n\n\t\tthis.defines.set(\"ANGLE_STEP\", (Math.PI * 2.0 * this.rings / this.samples).toFixed(11));\n\n\t}", "function getTheta(){\n return theta * Math.PI / 180;\n}", "function polar(rFunctionOfTheta){\n return function(parameter){\n var theta = parameter;\n var radius = rFunctionOfTheta(theta);\n return [radius * Math.cos(theta), radius * Math.sin(theta)];\n }\n}", "static fromRPY(roll, pitch, yaw) {\nvar q;\n//-------\nq = new RQ();\nq.setFromAxisRotations(roll, pitch, yaw);\nreturn q;\n}", "function init() {\n var t = Math.abs(this.lat0);\n if (Math.abs(t - __WEBPACK_IMPORTED_MODULE_0__constants_values__[\"b\" /* HALF_PI */]) < __WEBPACK_IMPORTED_MODULE_0__constants_values__[\"a\" /* EPSLN */]) {\n this.mode = this.lat0 < 0 ? this.S_POLE : this.N_POLE;\n }\n else if (Math.abs(t) < __WEBPACK_IMPORTED_MODULE_0__constants_values__[\"a\" /* EPSLN */]) {\n this.mode = this.EQUIT;\n }\n else {\n this.mode = this.OBLIQ;\n }\n if (this.es > 0) {\n var sinphi;\n\n this.qp = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_1__common_qsfnz__[\"a\" /* default */])(this.e, 1);\n this.mmf = 0.5 / (1 - this.es);\n this.apa = authset(this.es);\n switch (this.mode) {\n case this.N_POLE:\n this.dd = 1;\n break;\n case this.S_POLE:\n this.dd = 1;\n break;\n case this.EQUIT:\n this.rq = Math.sqrt(0.5 * this.qp);\n this.dd = 1 / this.rq;\n this.xmf = 1;\n this.ymf = 0.5 * this.qp;\n break;\n case this.OBLIQ:\n this.rq = Math.sqrt(0.5 * this.qp);\n sinphi = Math.sin(this.lat0);\n this.sinb1 = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_1__common_qsfnz__[\"a\" /* default */])(this.e, sinphi) / this.qp;\n this.cosb1 = Math.sqrt(1 - this.sinb1 * this.sinb1);\n this.dd = Math.cos(this.lat0) / (Math.sqrt(1 - this.es * sinphi * sinphi) * this.rq * this.cosb1);\n this.ymf = (this.xmf = this.rq) / this.dd;\n this.xmf *= this.dd;\n break;\n }\n }\n else {\n if (this.mode === this.OBLIQ) {\n this.sinph0 = Math.sin(this.lat0);\n this.cosph0 = Math.cos(this.lat0);\n }\n }\n}", "angle() {\n // Use simulated time.\n const clocksPerRevolution = Math.round(this.machine.clockHz / (RPM / 60));\n return (this.machine.tStateCount % clocksPerRevolution) / clocksPerRevolution;\n }", "summerPolarNightHandler() {\n let diff = this.summerOrFall(this.prevDay) ? -POLAR_NIGHT_ANIM_SPEED : POLAR_NIGHT_ANIM_SPEED;\n let newDay = (this.seasonsState.day + diff + 365) % 365;\n this.targetAngle = Math.min(180, this.sunrayAngle(newDay));\n this.setSeasonsState({day: newDay});\n }", "function componentPolarArea () {\n\n /* Default Properties */\n var width = 300;\n var height = 300;\n var radius = 150;\n var startAngle = 0;\n var endAngle = 360;\n var transition = { ease: d3.easeBounce, duration: 500 };\n var colors = palette.categorical(3);\n var colorScale = void 0;\n var xScale = void 0;\n var yScale = void 0;\n var dispatch = d3.dispatch(\"customValueMouseOver\", \"customValueMouseOut\", \"customValueClick\", \"customSeriesMouseOver\", \"customSeriesMouseOut\", \"customSeriesClick\");\n var classed = \"polarArea\";\n\n /**\n * Initialise Data and Scales\n *\n * @private\n * @param {Array} data - Chart data.\n */\n function init(data) {\n var _dataTransform$summar = dataTransform(data).summary(),\n columnKeys = _dataTransform$summar.columnKeys,\n valueMax = _dataTransform$summar.valueMax;\n\n var valueExtent = [0, valueMax];\n\n if (typeof radius === \"undefined\") {\n radius = Math.min(width, height) / 2;\n }\n\n if (typeof colorScale === \"undefined\") {\n colorScale = d3.scaleOrdinal().domain(columnKeys).range(colors);\n }\n\n if (typeof xScale === \"undefined\") {\n xScale = d3.scaleBand().domain(columnKeys).rangeRound([startAngle, endAngle]).padding(0.15);\n }\n\n if (typeof yScale === \"undefined\") {\n yScale = d3.scaleLinear().domain(valueExtent).range([0, radius]).nice();\n }\n }\n\n /**\n * Constructor\n *\n * @constructor\n * @alias polarArea\n * @param {d3.selection} selection - The chart holder D3 selection.\n */\n function my(selection) {\n init(selection.data());\n selection.each(function () {\n\n // Pie Generator\n startAngle = d3.min(xScale.range());\n endAngle = d3.max(xScale.range());\n var pie = d3.pie().value(1).sort(null).startAngle(startAngle * (Math.PI / 180)).endAngle(endAngle * (Math.PI / 180)).padAngle(0);\n\n // Arc Generator\n var arc = d3.arc().outerRadius(function (d) {\n return yScale(d.data.value);\n }).innerRadius(0).cornerRadius(2);\n\n // Update series group\n var seriesGroup = d3.select(this);\n seriesGroup.classed(classed, true).attr(\"id\", function (d) {\n return d.key;\n }).on(\"mouseover\", function (d) {\n dispatch.call(\"customSeriesMouseOver\", this, d);\n }).on(\"click\", function (d) {\n dispatch.call(\"customSeriesClick\", this, d);\n });\n\n // Add segments to series\n var segments = seriesGroup.selectAll(\".segment\").data(function (d) {\n return pie(d.values);\n });\n\n segments.enter().append(\"path\").classed(\"segment\", true).style(\"fill\", function (d) {\n return colorScale(d.data.key);\n }).on(\"mouseover\", function (d) {\n dispatch.call(\"customValueMouseOver\", this, d.data);\n }).on(\"click\", function (d) {\n dispatch.call(\"customValueClick\", this, d.data);\n }).merge(segments).transition().ease(transition.ease).duration(transition.duration).attr(\"d\", arc);\n\n segments.exit().transition().style(\"opacity\", 0).remove();\n });\n }\n\n /**\n * Width Getter / Setter\n *\n * @param {number} _v - Width in px.\n * @returns {*}\n */\n my.width = function (_v) {\n if (!arguments.length) return width;\n width = _v;\n return this;\n };\n\n /**\n * Height Getter / Setter\n *\n * @param {number} _v - Height in px.\n * @returns {*}\n */\n my.height = function (_v) {\n if (!arguments.length) return height;\n height = _v;\n return this;\n };\n\n /**\n * Radius Getter / Setter\n *\n * @param {number} _v - Radius in px.\n * @returns {*}\n */\n my.radius = function (_v) {\n if (!arguments.length) return radius;\n radius = _v;\n return this;\n };\n\n /**\n * Color Scale Getter / Setter\n *\n * @param {d3.scale} _v - D3 color scale.\n * @returns {*}\n */\n my.colorScale = function (_v) {\n if (!arguments.length) return colorScale;\n colorScale = _v;\n return my;\n };\n\n /**\n * Colors Getter / Setter\n *\n * @param {Array} _v - Array of colours used by color scale.\n * @returns {*}\n */\n my.colors = function (_v) {\n if (!arguments.length) return colors;\n colors = _v;\n return my;\n };\n\n /**\n * X Scale Getter / Setter\n *\n * @param {d3.scale} _v - D3 scale.\n * @returns {*}\n */\n my.xScale = function (_v) {\n if (!arguments.length) return xScale;\n xScale = _v;\n return my;\n };\n\n /**\n * Y Scale Getter / Setter\n *\n * @param {d3.scale} _v - D3 scale.\n * @returns {*}\n */\n my.yScale = function (_v) {\n if (!arguments.length) return yScale;\n yScale = _v;\n return my;\n };\n\n /**\n * Dispatch Getter / Setter\n *\n * @param {d3.dispatch} _v - Dispatch event handler.\n * @returns {*}\n */\n my.dispatch = function (_v) {\n if (!arguments.length) return dispatch();\n dispatch = _v;\n return this;\n };\n\n /**\n * Dispatch On Getter\n *\n * @returns {*}\n */\n my.on = function () {\n var value = dispatch.on.apply(dispatch, arguments);\n return value === dispatch ? my : value;\n };\n\n return my;\n }", "setFromAxisRotations(roll, pitch, yaw) {\nvar D2R_BY2, RPY_by2, cp, cr, cy, cycp, cysp, rpy, rpyb2, sp, sr, sy, sycp, sysp;\n//-------------------\n// The Euler-angle-to-axis bindings,and the order in which\n// the Euler angle rotations are applied are:\n// X-roll ; Y-pitch ; Z-yaw .\n// [See note below on the orientation of the notional craft.]\n// Hence to get the required quaternion components, we\n// compute the quaternion product:\n// Q-yaw x Q-pitch x Q-roll .\n// NB\n// These axis bindings assume a notional craft lying in\n// the XY-plane, with its body lying along the X-axis\n// (facing +X), with +Y on its right/starboard side, and\n// with +Z _below_ it.\n// For a craft with this orientation, an increase in ROLL\n// (from 0) dips the right/starboard wing, an increase in\n// PITCH raises the nose, and an increase in YAW turns the\n// nose to the right/starboard.\nD2R_BY2 = RQ.DEGS_TO_RADS / 2;\n// Angles of rotation by 2 (i.e quaternion angles) in radians, and\n// the cosines and sines of these half-angles.\nRPY_by2 = (function() {\nvar j, len, ref, results;\nref = [roll, pitch, yaw];\nresults = [];\nfor (j = 0, len = ref.length; j < len; j++) {\nrpy = ref[j];\nresults.push(rpy * D2R_BY2);\n}\nreturn results;\n})();\n[cr, cp, cy] = (function() {\nvar j, len, results;\nresults = [];\nfor (j = 0, len = RPY_by2.length; j < len; j++) {\nrpyb2 = RPY_by2[j];\nresults.push(Math.cos(rpyb2));\n}\nreturn results;\n})();\n[sr, sp, sy] = (function() {\nvar j, len, results;\nresults = [];\nfor (j = 0, len = RPY_by2.length; j < len; j++) {\nrpyb2 = RPY_by2[j];\nresults.push(Math.sin(rpyb2));\n}\nreturn results;\n})();\n// Compute components of Q-yaw (Z) x Q-pitch (Y)\n[cycp, sysp, sycp, cysp] = [cy * cp, sy * sp, sy * cp, cy * sp];\n// Finally, compute the product of the three axis-rotation quaternions:\n// (cy; 0 0 sy) * (cp; 0 sp 0) * (cr; sr 0 0)\nreturn this.set_xyzw(cycp * sr - sysp * cr, cysp * cr + sycp * sr, sycp * cr - cysp * sr, cycp * cr + sysp * sr);\n}", "function PolarCoordinates() {\r\n}", "function rosettePeriodicMirrorPhi(position,n){\n\tvar angle=position.angle();\n\tangle*=n*0.159154; // n/2pi\n\tangle=0.5*imageFastFunction.periodicMapping(angle);\n\tangle*=6.28318/n;\n\tposition.setPolar(position.radius(),angle);\n}", "static createRotation(axis, angle) {\n//--------------\nreturn RQ.setAxisAngleQV(RQ.makeQV(0, 0, 0, 0), axis, angle);\n}", "updateAngle () {\n this.angleRadians = (this.data.angle / 180) * Math.PI\n }", "function init() {\n var t = Math.abs(this.lat0);\n if (Math.abs(t - _constants_values__WEBPACK_IMPORTED_MODULE_0__[\"HALF_PI\"]) < _constants_values__WEBPACK_IMPORTED_MODULE_0__[\"EPSLN\"]) {\n this.mode = this.lat0 < 0 ? this.S_POLE : this.N_POLE;\n }\n else if (Math.abs(t) < _constants_values__WEBPACK_IMPORTED_MODULE_0__[\"EPSLN\"]) {\n this.mode = this.EQUIT;\n }\n else {\n this.mode = this.OBLIQ;\n }\n if (this.es > 0) {\n var sinphi;\n\n this.qp = Object(_common_qsfnz__WEBPACK_IMPORTED_MODULE_1__[\"default\"])(this.e, 1);\n this.mmf = 0.5 / (1 - this.es);\n this.apa = authset(this.es);\n switch (this.mode) {\n case this.N_POLE:\n this.dd = 1;\n break;\n case this.S_POLE:\n this.dd = 1;\n break;\n case this.EQUIT:\n this.rq = Math.sqrt(0.5 * this.qp);\n this.dd = 1 / this.rq;\n this.xmf = 1;\n this.ymf = 0.5 * this.qp;\n break;\n case this.OBLIQ:\n this.rq = Math.sqrt(0.5 * this.qp);\n sinphi = Math.sin(this.lat0);\n this.sinb1 = Object(_common_qsfnz__WEBPACK_IMPORTED_MODULE_1__[\"default\"])(this.e, sinphi) / this.qp;\n this.cosb1 = Math.sqrt(1 - this.sinb1 * this.sinb1);\n this.dd = Math.cos(this.lat0) / (Math.sqrt(1 - this.es * sinphi * sinphi) * this.rq * this.cosb1);\n this.ymf = (this.xmf = this.rq) / this.dd;\n this.xmf *= this.dd;\n break;\n }\n }\n else {\n if (this.mode === this.OBLIQ) {\n this.sinph0 = Math.sin(this.lat0);\n this.cosph0 = Math.cos(this.lat0);\n }\n }\n}", "rotation() {\n return this.rotationInRadians().map(VrMath.radToDeg);\n }", "get secondaryUVHardAngle() {}", "function solar_radius_vector(t) {\n var d2r = Math.PI / 180.0;\n var e = Math.exp(0);\n return (1.000001018 * (1.0 - e)) /\n (1.0 + e * Math.cos(d2r * solar_true_anomaly(t)));\n}", "rotateTo(azimuthAngle, polarAngle, enableTransition) {\n \n const theta = Math.max(this.minAzimuthAngle, Math.min(this.maxAzimuthAngle, azimuthAngle))\n const phi = Math.max(this.minPolarAngle, Math.min(this.maxPolarAngle, polarAngle))\n \n this._sphericalEnd.theta = theta\n this._sphericalEnd.phi = phi\n this._sphericalEnd.makeSafe()\n \n if (!enableTransition) {\n \n this._spherical.theta = this._sphericalEnd.theta\n this._spherical.phi = this._sphericalEnd.phi\n \n }\n \n this._hasUpdated = true\n \n }", "theta(p = new Point()) {\n const ref = Point.create(p);\n const y = -(ref.y - this.y); // invert the y-axis.\n const x = ref.x - this.x;\n let rad = Math.atan2(y, x);\n // Correction for III. and IV. quadrant.\n if (rad < 0) {\n rad = 2 * Math.PI + rad;\n }\n return (180 * rad) / Math.PI;\n }", "lerpAngle (a, b, t) {\n\n let difference = Math.abs(b - a);\n\n if (difference > Math.PI) {\n // We need to add on to one of the values.\n if (b > a) {\n // We'll add it on to start...\n a += 2*Math.PI;\n } else {\n // Add it on to end.\n b += 2*Math.PI;\n }\n }\n\n // Interpolate it.\n let value = this.lerp(a, b, t);\n\n // Wrap it..\n let rangeZero = 2*Math.PI;\n\n if (value >= 0 && value <= 2*Math.PI)\n return value;\n\n return (value % rangeZero);\n\n }", "spinTo(angle) {\n const {hubContext} = this;\n const r = maxCusps - this.cusps;\n hubContext.transform({\n pos: [-maxCusps + r * Math.cos(angle), r * Math.sin(angle)],\n rot: -(maxCusps / this.cusps - 1) * angle,\n });\n }", "function setServoDegrees(value) {\n local scaledValue = (value + 81) / 161.0 * (SERVO_MAX - SERVO_MIN) + SERVO_MIN;\n Servo.write(scaledValue);\n imp.sleep(0.5);\n Servo.write(0);\n devicelog(false,\"servo angle \" + value + \" scaled valut \" + scaledValue);\n}", "GetAngle(First, Next) {\n let dRotateAngle = Math.atan2(Math.abs(First.Latitude - Next.Latitude), Math.abs(First.Longitude - Next.Longitude));\n if (Next.Latitude >= First.Latitude) {\n if (Next.Longitude >= First.Longitude) {\n } else {\n dRotateAngle = Math.PI - dRotateAngle;\n }\n } else {\n if (Next.Longitude >= First.Longitude) {\n dRotateAngle = 2 * Math.PI - dRotateAngle;\n } else {\n dRotateAngle = Math.PI + dRotateAngle;\n }\n }\n dRotateAngle = dRotateAngle * 180 / Math.PI;\n return dRotateAngle;\n\n}", "function init() {\n\n /* Place parameters in static storage for common use\n -------------------------------------------------*/\n // Standard Parallels cannot be equal and on opposite sides of the equator\n if (Math.abs(this.lat1 + this.lat2) < __WEBPACK_IMPORTED_MODULE_9__constants_values__[\"a\" /* EPSLN */]) {\n return;\n }\n this.lat2 = this.lat2 || this.lat1;\n this.temp = this.b / this.a;\n this.es = 1 - Math.pow(this.temp, 2);\n this.e = Math.sqrt(this.es);\n this.e0 = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0__common_e0fn__[\"a\" /* default */])(this.es);\n this.e1 = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_1__common_e1fn__[\"a\" /* default */])(this.es);\n this.e2 = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_2__common_e2fn__[\"a\" /* default */])(this.es);\n this.e3 = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_3__common_e3fn__[\"a\" /* default */])(this.es);\n\n this.sinphi = Math.sin(this.lat1);\n this.cosphi = Math.cos(this.lat1);\n\n this.ms1 = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_4__common_msfnz__[\"a\" /* default */])(this.e, this.sinphi, this.cosphi);\n this.ml1 = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_5__common_mlfn__[\"a\" /* default */])(this.e0, this.e1, this.e2, this.e3, this.lat1);\n\n if (Math.abs(this.lat1 - this.lat2) < __WEBPACK_IMPORTED_MODULE_9__constants_values__[\"a\" /* EPSLN */]) {\n this.ns = this.sinphi;\n }\n else {\n this.sinphi = Math.sin(this.lat2);\n this.cosphi = Math.cos(this.lat2);\n this.ms2 = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_4__common_msfnz__[\"a\" /* default */])(this.e, this.sinphi, this.cosphi);\n this.ml2 = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_5__common_mlfn__[\"a\" /* default */])(this.e0, this.e1, this.e2, this.e3, this.lat2);\n this.ns = (this.ms1 - this.ms2) / (this.ml2 - this.ml1);\n }\n this.g = this.ml1 + this.ms1 / this.ns;\n this.ml0 = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_5__common_mlfn__[\"a\" /* default */])(this.e0, this.e1, this.e2, this.e3, this.lat0);\n this.rh = this.a * (this.g - this.ml0);\n}", "ensureClockwise() {\n let vectorsRelativeToCenter = [];\n let headingValues = [];\n for (let v of this.pixelVectorPositions) {\n vectorsRelativeToCenter.push(p5.Vector.sub(v, this.center));\n }\n\n\n for (let v of vectorsRelativeToCenter) {\n let temp = v.heading();\n if (temp < 0) {\n temp += 2 * PI;\n }\n\n headingValues.push(temp);\n }\n //print(headingValues);\n\n let rotationalDifferenceTotal = 0;\n for (let i = 0; i < headingValues.length; i++) {\n let difference = 0;\n if (i === headingValues.length - 1) {\n difference = headingValues[0] - headingValues[i];\n } else {\n difference = headingValues[i + 1] - headingValues[i];\n }\n if (difference > 0) {\n rotationalDifferenceTotal += 1;\n } else {\n rotationalDifferenceTotal -= 1;\n }\n }\n\n if (rotationalDifferenceTotal < 0) {\n this.pixelVectorPositions.reverse();\n }\n }", "_degreeToRadian(angle) {\n return angle * Math.PI / 180;\n }", "_updateInitialRotation() {\n this.arNodeRef.getTransformAsync().then((retDict)=>{\n let rotation = retDict.rotation;\n let absX = Math.abs(rotation[0]);\n let absZ = Math.abs(rotation[2]);\n\n let yRotation = (rotation[1]);\n\n // If the X and Z aren't 0, then adjust the y rotation.\n if (absX > 1 && absZ > 1) {\n yRotation = 180 - (yRotation);\n }\n\n this.setState({\n markerRotation: [0,yRotation,0],\n shouldBillboard : false,\n });\n });\n }", "toPolar(origin) {\n this.update(Point.toPolar(this, origin));\n return this;\n }", "function rad(deg) {return deg * pi/180;}", "function forward(p) {\n var xy = {x: 0, y: 0};\n var lat, lon;\n var theta, phi;\n var t, mu;\n /* nu; */\n var area = {value: 0};\n\n // move lon according to projection's lon\n p.x -= this.long0;\n\n /* Convert the geodetic latitude to a geocentric latitude.\n * This corresponds to the shift from the ellipsoid to the sphere\n * described in [LK12]. */\n if (this.es !== 0) {//if (P->es != 0) {\n lat = Math.atan(this.one_minus_f_squared * Math.tan(p.y));\n } else {\n lat = p.y;\n }\n\n /* Convert the input lat, lon into theta, phi as used by QSC.\n * This depends on the cube face and the area on it.\n * For the top and bottom face, we can compute theta and phi\n * directly from phi, lam. For the other faces, we must use\n * unit sphere cartesian coordinates as an intermediate step. */\n lon = p.x; //lon = lp.lam;\n if (this.face === FACE_ENUM.TOP) {\n phi = _constants_values__WEBPACK_IMPORTED_MODULE_0__[\"HALF_PI\"] - lat;\n if (lon >= _constants_values__WEBPACK_IMPORTED_MODULE_0__[\"FORTPI\"] && lon <= _constants_values__WEBPACK_IMPORTED_MODULE_0__[\"HALF_PI\"] + _constants_values__WEBPACK_IMPORTED_MODULE_0__[\"FORTPI\"]) {\n area.value = AREA_ENUM.AREA_0;\n theta = lon - _constants_values__WEBPACK_IMPORTED_MODULE_0__[\"HALF_PI\"];\n } else if (lon > _constants_values__WEBPACK_IMPORTED_MODULE_0__[\"HALF_PI\"] + _constants_values__WEBPACK_IMPORTED_MODULE_0__[\"FORTPI\"] || lon <= -(_constants_values__WEBPACK_IMPORTED_MODULE_0__[\"HALF_PI\"] + _constants_values__WEBPACK_IMPORTED_MODULE_0__[\"FORTPI\"])) {\n area.value = AREA_ENUM.AREA_1;\n theta = (lon > 0.0 ? lon - _constants_values__WEBPACK_IMPORTED_MODULE_0__[\"SPI\"] : lon + _constants_values__WEBPACK_IMPORTED_MODULE_0__[\"SPI\"]);\n } else if (lon > -(_constants_values__WEBPACK_IMPORTED_MODULE_0__[\"HALF_PI\"] + _constants_values__WEBPACK_IMPORTED_MODULE_0__[\"FORTPI\"]) && lon <= -_constants_values__WEBPACK_IMPORTED_MODULE_0__[\"FORTPI\"]) {\n area.value = AREA_ENUM.AREA_2;\n theta = lon + _constants_values__WEBPACK_IMPORTED_MODULE_0__[\"HALF_PI\"];\n } else {\n area.value = AREA_ENUM.AREA_3;\n theta = lon;\n }\n } else if (this.face === FACE_ENUM.BOTTOM) {\n phi = _constants_values__WEBPACK_IMPORTED_MODULE_0__[\"HALF_PI\"] + lat;\n if (lon >= _constants_values__WEBPACK_IMPORTED_MODULE_0__[\"FORTPI\"] && lon <= _constants_values__WEBPACK_IMPORTED_MODULE_0__[\"HALF_PI\"] + _constants_values__WEBPACK_IMPORTED_MODULE_0__[\"FORTPI\"]) {\n area.value = AREA_ENUM.AREA_0;\n theta = -lon + _constants_values__WEBPACK_IMPORTED_MODULE_0__[\"HALF_PI\"];\n } else if (lon < _constants_values__WEBPACK_IMPORTED_MODULE_0__[\"FORTPI\"] && lon >= -_constants_values__WEBPACK_IMPORTED_MODULE_0__[\"FORTPI\"]) {\n area.value = AREA_ENUM.AREA_1;\n theta = -lon;\n } else if (lon < -_constants_values__WEBPACK_IMPORTED_MODULE_0__[\"FORTPI\"] && lon >= -(_constants_values__WEBPACK_IMPORTED_MODULE_0__[\"HALF_PI\"] + _constants_values__WEBPACK_IMPORTED_MODULE_0__[\"FORTPI\"])) {\n area.value = AREA_ENUM.AREA_2;\n theta = -lon - _constants_values__WEBPACK_IMPORTED_MODULE_0__[\"HALF_PI\"];\n } else {\n area.value = AREA_ENUM.AREA_3;\n theta = (lon > 0.0 ? -lon + _constants_values__WEBPACK_IMPORTED_MODULE_0__[\"SPI\"] : -lon - _constants_values__WEBPACK_IMPORTED_MODULE_0__[\"SPI\"]);\n }\n } else {\n var q, r, s;\n var sinlat, coslat;\n var sinlon, coslon;\n\n if (this.face === FACE_ENUM.RIGHT) {\n lon = qsc_shift_lon_origin(lon, +_constants_values__WEBPACK_IMPORTED_MODULE_0__[\"HALF_PI\"]);\n } else if (this.face === FACE_ENUM.BACK) {\n lon = qsc_shift_lon_origin(lon, +_constants_values__WEBPACK_IMPORTED_MODULE_0__[\"SPI\"]);\n } else if (this.face === FACE_ENUM.LEFT) {\n lon = qsc_shift_lon_origin(lon, -_constants_values__WEBPACK_IMPORTED_MODULE_0__[\"HALF_PI\"]);\n }\n sinlat = Math.sin(lat);\n coslat = Math.cos(lat);\n sinlon = Math.sin(lon);\n coslon = Math.cos(lon);\n q = coslat * coslon;\n r = coslat * sinlon;\n s = sinlat;\n\n if (this.face === FACE_ENUM.FRONT) {\n phi = Math.acos(q);\n theta = qsc_fwd_equat_face_theta(phi, s, r, area);\n } else if (this.face === FACE_ENUM.RIGHT) {\n phi = Math.acos(r);\n theta = qsc_fwd_equat_face_theta(phi, s, -q, area);\n } else if (this.face === FACE_ENUM.BACK) {\n phi = Math.acos(-q);\n theta = qsc_fwd_equat_face_theta(phi, s, -r, area);\n } else if (this.face === FACE_ENUM.LEFT) {\n phi = Math.acos(-r);\n theta = qsc_fwd_equat_face_theta(phi, s, q, area);\n } else {\n /* Impossible */\n phi = theta = 0;\n area.value = AREA_ENUM.AREA_0;\n }\n }\n\n /* Compute mu and nu for the area of definition.\n * For mu, see Eq. (3-21) in [OL76], but note the typos:\n * compare with Eq. (3-14). For nu, see Eq. (3-38). */\n mu = Math.atan((12 / _constants_values__WEBPACK_IMPORTED_MODULE_0__[\"SPI\"]) * (theta + Math.acos(Math.sin(theta) * Math.cos(_constants_values__WEBPACK_IMPORTED_MODULE_0__[\"FORTPI\"])) - _constants_values__WEBPACK_IMPORTED_MODULE_0__[\"HALF_PI\"]));\n t = Math.sqrt((1 - Math.cos(phi)) / (Math.cos(mu) * Math.cos(mu)) / (1 - Math.cos(Math.atan(1 / Math.cos(theta)))));\n\n /* Apply the result to the real area. */\n if (area.value === AREA_ENUM.AREA_1) {\n mu += _constants_values__WEBPACK_IMPORTED_MODULE_0__[\"HALF_PI\"];\n } else if (area.value === AREA_ENUM.AREA_2) {\n mu += _constants_values__WEBPACK_IMPORTED_MODULE_0__[\"SPI\"];\n } else if (area.value === AREA_ENUM.AREA_3) {\n mu += 1.5 * _constants_values__WEBPACK_IMPORTED_MODULE_0__[\"SPI\"];\n }\n\n /* Now compute x, y from mu and nu */\n xy.x = t * Math.cos(mu);\n xy.y = t * Math.sin(mu);\n xy.x = xy.x * this.a + this.x0;\n xy.y = xy.y * this.a + this.y0;\n\n p.x = xy.x;\n p.y = xy.y;\n return p;\n}", "function startOrbitalControls(){\n var controls = new THREE.OrbitControls(PIEcamera, PIErenderer.domElement);\n controls.maxPolarAngle = Math.PI * 0.5;\n controls.minDistance = 35;\n controls.maxDistance = 75;\n\n}", "function radians(degrees) {\n return map(degrees, function (degrees) {\n return degrees / 180 * Math.PI;\n });\n} // GLSL equivalent: Works on single values and vectors", "degreeToRad(angle){\n return Math.PI*angle/180;\n }", "function polarTriangleArea(tan1, lng1, tan2, lng2) {\n\n var deltaLng = lng1 - lng2;\n var t = tan1 * tan2;\n return 2 * Math.atan2(t * Math.sin(deltaLng), 1 + t * Math.cos(deltaLng));\n}", "function polar2x(r, θ) {\r\n return Math.cos(θ) * r;\r\n}", "static lathe(base, out, steps = 2, repeatStart = false, angleRng = Maths.PI_2, rotAxis = \"y\") {\n const inc = angleRng / steps;\n const v = new Vec3();\n const len = base.length;\n let i, j, angle, cos, sin;\n let rx = 0, ry = 0, rz = 0;\n for (i = 0; i < steps; i++) {\n angle = i * inc;\n cos = Math.cos(angle);\n sin = Math.sin(angle);\n for (j = 0; j < len; j += 3) {\n v.fromBuf(base, j);\n switch (rotAxis) { // https://www.siggraph.org/education/materials/HyperGraph/modeling/mod_tran/3drota.htm#Y-Axis%20Rotation\n case \"y\":\n ry = v.y;\n rx = v.z * sin + v.x * cos;\n rz = v.z * cos - v.x * sin;\n break;\n case \"x\":\n rx = v.x;\n ry = v.y * cos - v.z * sin;\n rz = v.y * sin + v.z * cos;\n break;\n case \"z\":\n rz = v.z;\n rx = v.x * cos - v.y * sin;\n ry = v.x * sin + v.y * cos;\n break;\n }\n out.push(rx, ry, rz);\n }\n }\n if (repeatStart)\n out.push(...base);\n }", "constructor(startRadians = 0, endRadians = 0) { this._radians0 = startRadians; this._radians1 = endRadians; }", "function drawPolar(ptsArr, yoff) {\n let center = getArrayCenter(ptsArr); // returns array [x,y]\n push();\n translate(center[0], center[1]);\n\n beginShape();\n for (let i=0; i<ptsArr.length; i++) {\n let pt = [ptsArr[i][0], ptsArr[i][1]];\n let angle = getAngle(center, pt);\n\n // offset is generated using perlin noise, which is always output between 0 and 1\n // first parameter of noise() changes the wobble as we rotate around the center (parameterized on angle)\n // second parameter of noise() changes the wobble over time\n // to reduce wobble, we can change the noise parameters (move less along the noise curve each step in space/time)\n // or we can map to smaller -/+ values\n // let magnitude = 10;\n \n let magnitude = 10 + 500*vol;\n // let offset = map(sin(angle*100 + frameCount*.01), -1, 1, -magnitude, magnitude); // distort w sin curve on edge\n let offset = map(sin(angle*100 + yoff*2), -1, 1, -magnitude, magnitude); // distort w sin curve on edge\n \n // let magnitude = 20;\n // let offset = map(noise(angle*.5, yoff), 0, 1, -magnitude, magnitude);\n\n let r = getDistance(center, pt) + offset;\n curveVertex(r * cos(angle), r * sin(angle));\n }\n\n endShape();\n pop();\n\n return yoff + .005;\n}", "function polarize(value, threshold) {\n return (value > threshold) ? 0xFF0033 : 0XFF;\n}", "function getRotaryRadii(startTool, endTool, startABC, endABC) {\r\n var radii = new Vector(0, 0, 0);\r\n var startRadius;\r\n var endRadius;\r\n var axis = new Array(machineConfiguration.getAxisU(), machineConfiguration.getAxisV(), machineConfiguration.getAxisW());\r\n for (var i = 0; i < 3; ++i) {\r\n if (axis[i].isEnabled()) {\r\n var startRadius = getRotaryRadius(axis[i], startTool, startABC);\r\n var endRadius = getRotaryRadius(axis[i], endTool, endABC);\r\n radii.setCoordinate(axis[i].getCoordinate(), Math.max(startRadius, endRadius));\r\n }\r\n }\r\n return radii;\r\n}", "toRad(Value) {\n return Value * Math.PI / 180;\n }", "function hammerRetroazimuthalRotation(phi0) {\n var sinPhi0 = Object(__WEBPACK_IMPORTED_MODULE_1__math__[\"y\" /* sin */])(phi0),\n cosPhi0 = Object(__WEBPACK_IMPORTED_MODULE_1__math__[\"h\" /* cos */])(phi0);\n\n return function(lambda, phi) {\n var cosPhi = Object(__WEBPACK_IMPORTED_MODULE_1__math__[\"h\" /* cos */])(phi),\n x = Object(__WEBPACK_IMPORTED_MODULE_1__math__[\"h\" /* cos */])(lambda) * cosPhi,\n y = Object(__WEBPACK_IMPORTED_MODULE_1__math__[\"y\" /* sin */])(lambda) * cosPhi,\n z = Object(__WEBPACK_IMPORTED_MODULE_1__math__[\"y\" /* sin */])(phi);\n return [\n Object(__WEBPACK_IMPORTED_MODULE_1__math__[\"g\" /* atan2 */])(y, x * cosPhi0 - z * sinPhi0),\n Object(__WEBPACK_IMPORTED_MODULE_1__math__[\"e\" /* asin */])(z * cosPhi0 + x * sinPhi0)\n ];\n };\n}", "isRotateSupported() {\n return true;\n }", "function forward(p) {\n var lon = p.x;\n var lat = p.y;\n // convert to radians\n if (lat * __WEBPACK_IMPORTED_MODULE_4__constants_values__[\"j\" /* R2D */] > 90 && lat * __WEBPACK_IMPORTED_MODULE_4__constants_values__[\"j\" /* R2D */] < -90 && lon * __WEBPACK_IMPORTED_MODULE_4__constants_values__[\"j\" /* R2D */] > 180 && lon * __WEBPACK_IMPORTED_MODULE_4__constants_values__[\"j\" /* R2D */] < -180) {\n return null;\n }\n\n var x, y;\n if (Math.abs(Math.abs(lat) - __WEBPACK_IMPORTED_MODULE_4__constants_values__[\"b\" /* HALF_PI */]) <= __WEBPACK_IMPORTED_MODULE_4__constants_values__[\"a\" /* EPSLN */]) {\n return null;\n }\n else {\n if (this.sphere) {\n x = this.x0 + this.a * this.k0 * __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_1__common_adjust_lon__[\"a\" /* default */])(lon - this.long0);\n y = this.y0 + this.a * this.k0 * Math.log(Math.tan(__WEBPACK_IMPORTED_MODULE_4__constants_values__[\"f\" /* FORTPI */] + 0.5 * lat));\n }\n else {\n var sinphi = Math.sin(lat);\n var ts = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_2__common_tsfnz__[\"a\" /* default */])(this.e, lat, sinphi);\n x = this.x0 + this.a * this.k0 * __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_1__common_adjust_lon__[\"a\" /* default */])(lon - this.long0);\n y = this.y0 - this.a * this.k0 * Math.log(ts);\n }\n p.x = x;\n p.y = y;\n return p;\n }\n}", "function qsc_fwd_equat_face_theta(phi, y, x, area) {\n var theta;\n if (phi < _constants_values__WEBPACK_IMPORTED_MODULE_0__[\"EPSLN\"]) {\n area.value = AREA_ENUM.AREA_0;\n theta = 0.0;\n } else {\n theta = Math.atan2(y, x);\n if (Math.abs(theta) <= _constants_values__WEBPACK_IMPORTED_MODULE_0__[\"FORTPI\"]) {\n area.value = AREA_ENUM.AREA_0;\n } else if (theta > _constants_values__WEBPACK_IMPORTED_MODULE_0__[\"FORTPI\"] && theta <= _constants_values__WEBPACK_IMPORTED_MODULE_0__[\"HALF_PI\"] + _constants_values__WEBPACK_IMPORTED_MODULE_0__[\"FORTPI\"]) {\n area.value = AREA_ENUM.AREA_1;\n theta -= _constants_values__WEBPACK_IMPORTED_MODULE_0__[\"HALF_PI\"];\n } else if (theta > _constants_values__WEBPACK_IMPORTED_MODULE_0__[\"HALF_PI\"] + _constants_values__WEBPACK_IMPORTED_MODULE_0__[\"FORTPI\"] || theta <= -(_constants_values__WEBPACK_IMPORTED_MODULE_0__[\"HALF_PI\"] + _constants_values__WEBPACK_IMPORTED_MODULE_0__[\"FORTPI\"])) {\n area.value = AREA_ENUM.AREA_2;\n theta = (theta >= 0.0 ? theta - _constants_values__WEBPACK_IMPORTED_MODULE_0__[\"SPI\"] : theta + _constants_values__WEBPACK_IMPORTED_MODULE_0__[\"SPI\"]);\n } else {\n area.value = AREA_ENUM.AREA_3;\n theta += _constants_values__WEBPACK_IMPORTED_MODULE_0__[\"HALF_PI\"];\n }\n }\n return theta;\n}", "function onMotionRawValueChanged(event) {\r\n var v = event.target.value;\r\n\r\n // accel: 6Q10\r\n var _ax = cnvtEndian16(v, 0).getInt16(0);\r\n var ax = toFixedPoint(_ax, 10);\r\n var _ay = cnvtEndian16(v, 2).getInt16(2);\r\n var ay = toFixedPoint(_ay, 10);\r\n var _az = cnvtEndian16(v, 4).getInt16(4);\r\n var az = toFixedPoint(_az, 10);\r\n document.querySelector('#ax').value = ax;\r\n document.querySelector('#ay').value = ay;\r\n document.querySelector('#az').value = az;\r\n\r\n // gyro: 11Q5\r\n var _gx = cnvtEndian16(v, 6).getInt16(6);\r\n var gx = toFixedPoint(_gx, 5);\r\n var _gy = cnvtEndian16(v, 8).getInt16(8);\r\n var gy = toFixedPoint(_gy, 5);\r\n var _gz = cnvtEndian16(v, 10).getInt16(10);\r\n var gz = toFixedPoint(_gz, 5);\r\n document.querySelector('#gx').value = gx;\r\n document.querySelector('#gy').value = gy;\r\n document.querySelector('#gz').value = gz;\r\n\r\n // compass: 12Q4\r\n var _cx = cnvtEndian16(v, 12).getInt16(12);\r\n var cx = toFixedPoint(_cx, 4);\r\n var _cy = cnvtEndian16(v, 14).getInt16(14);\r\n var cy = toFixedPoint(_cy, 4);\r\n var _cz = cnvtEndian16(v, 16).getInt16(16);\r\n var cz = toFixedPoint(_cz, 4);\r\n\r\n document.querySelector('#cx').value = cx;\r\n document.querySelector('#cy').value = cy;\r\n document.querySelector('#cz').value = cz;\r\n\r\n var accel = { x: ax, y: ay, z: az };\r\n appendAccelData(accel);\r\n var gyro = { x: gx, y: gy, z: gz };\r\n appendGyroData(gyro);\r\n var compass = { x: cx, y: cy, z: cz };\r\n appendCompassData(compass);\r\n frames.a += 1;\r\n frames.g += 1;\r\n frames.c += 1;\r\n\r\n save(accel.x.toString() + ',' + accel.y.toString() + ',' + accel.z.toString() +\r\n gyro.x.toString() + ',' + gyro.y.toString() + ',' + gyro.z.toString() +\r\n compass.x.toString() + ',' + compass.y.toString() + ',' + compass.z.toString());\r\n}", "get startRadians() { return this._radians0; }", "setFromAxisAngle(xyz, angle) {\n//---------------\nRQ.setAxisAngleQV(this.xyzw, xyz, angle);\nreturn this;\n}", "function calculatePeriphery(r) {\n var result = 2 * r * Math.PI;\n return result;\n console.log(result);\n}", "function psi2thetaRo(psi){\n //var shift = Math.PI*2*0.3;\n var shift = 0;\n\tx = (R-r)*sin(psi+shift) \n + r2 * sin( (R-r)*psi/r - shift - pi );\n\ty = -(R-r)*cos(psi+shift)\n\t\t + r2 * cos( (R-r)*psi/r - shift - pi );\n var theta = Math.atan2(x,y);\n theta = pi - theta;\n if (theta<0){\n theta = theta + 2*pi;\n }\n var ro = Math.sqrt(x*x+y*y);\n return [theta, ro];\n}", "function computeCirclularFlight(lon, lat, height, radius) {\n console.log(lon, lat, height, radius)\n var property = new Cesium.SampledPositionProperty();\n for (var i = 0; i <= 360; i += 45) {\n console.log(start, i)\n var radians = Cesium.Math.toRadians(i);\n var time = Cesium.JulianDate.addSeconds(\n start,\n i,\n new Cesium.JulianDate()\n );\n var position = Cesium.Cartesian3.fromDegrees(\n lon + radius * 1.5 * Math.cos(radians),\n lat + radius * Math.sin(radians),\n height\n );\n // console.log(position)\n property.addSample(time, position);\n\n }\n return property;\n }", "function hammerRetroazimuthalRotation(phi0) {\n var sinPhi0 = Object(__WEBPACK_IMPORTED_MODULE_1__math__[\"y\" /* sin */])(phi0),\n cosPhi0 = Object(__WEBPACK_IMPORTED_MODULE_1__math__[\"h\" /* cos */])(phi0);\n\n return function (lambda, phi) {\n var cosPhi = Object(__WEBPACK_IMPORTED_MODULE_1__math__[\"h\" /* cos */])(phi),\n x = Object(__WEBPACK_IMPORTED_MODULE_1__math__[\"h\" /* cos */])(lambda) * cosPhi,\n y = Object(__WEBPACK_IMPORTED_MODULE_1__math__[\"y\" /* sin */])(lambda) * cosPhi,\n z = Object(__WEBPACK_IMPORTED_MODULE_1__math__[\"y\" /* sin */])(phi);\n return [Object(__WEBPACK_IMPORTED_MODULE_1__math__[\"g\" /* atan2 */])(y, x * cosPhi0 - z * sinPhi0), Object(__WEBPACK_IMPORTED_MODULE_1__math__[\"e\" /* asin */])(z * cosPhi0 + x * sinPhi0)];\n };\n}", "function fnc_azimuth(values, context) {\n return false;\n}", "function fnc_azimuth(values, context) {\n return false;\n}", "function draw(){\n console.log(spiro.radius1, spiro.radius2, spiro.scalar)\n console.log('\\nangle', spiro.angle * 180 / (2*Math.PI))\n let deg = spiro.angle * 180 / (2 * Math.PI)\n\n console.log('steps', steps)\n if(deg < steps){\n spiro.update()\n spiro.draw()\n\n frameRequest = window.requestAnimationFrame(draw);\n } else {\n window.cancelAnimationFrame(frameRequest)\n }\n}", "get angle() {\n let leftAngle = FLIPPER_RESTING_ANGLE + (FLIPPER_ACTIVE_ANGLE - FLIPPER_RESTING_ANGLE) * this.angleRatio;\n return this.isLeft ? leftAngle : Math.PI - leftAngle;\n }", "function polar2x(r, θ) {\n return Math.cos(θ) * r;\n }", "function toPolar(point, origin = new Point()) {\n const p = clone(point);\n const o = clone(origin);\n const dx = p.x - o.x;\n const dy = p.y - o.y;\n return new Point(Math.sqrt(dx * dx + dy * dy), // r\n Angle.toRad(o.theta(p)));\n }", "function tan_solar_right_ascension(t) {\n var d2r = Math.PI / 180.0;\n var eps = obliquity_of_ecliptic(t);\n var lon = solar_true_longitude(t);\n return Math.cos(d2r * eps) * Math.sin(d2r * lon) / Math.cos(d2r * lon);\n}", "function toCompass(angle){\n return -1*angle;\n }", "function toCompass(angle){\n return -1*angle;\n }", "function radians(xx) {return (Math.PI * xx / 180.0);}", "function inverse(p) {\n p.x -= this.x0;\n p.y -= this.y0;\n var lon, lat, ts, ce, Chi;\n var rh = Math.sqrt(p.x * p.x + p.y * p.y);\n if (this.sphere) {\n var c = 2 * Math.atan(rh / (0.5 * this.a * this.k0));\n lon = this.long0;\n lat = this.lat0;\n if (rh <= __WEBPACK_IMPORTED_MODULE_0__constants_values__[\"a\" /* EPSLN */]) {\n p.x = lon;\n p.y = lat;\n return p;\n }\n lat = Math.asin(Math.cos(c) * this.sinlat0 + p.y * Math.sin(c) * this.coslat0 / rh);\n if (Math.abs(this.coslat0) < __WEBPACK_IMPORTED_MODULE_0__constants_values__[\"a\" /* EPSLN */]) {\n if (this.lat0 > 0) {\n lon = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_5__common_adjust_lon__[\"a\" /* default */])(this.long0 + Math.atan2(p.x, - 1 * p.y));\n }\n else {\n lon = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_5__common_adjust_lon__[\"a\" /* default */])(this.long0 + Math.atan2(p.x, p.y));\n }\n }\n else {\n lon = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_5__common_adjust_lon__[\"a\" /* default */])(this.long0 + Math.atan2(p.x * Math.sin(c), rh * this.coslat0 * Math.cos(c) - p.y * this.sinlat0 * Math.sin(c)));\n }\n p.x = lon;\n p.y = lat;\n return p;\n }\n else {\n if (Math.abs(this.coslat0) <= __WEBPACK_IMPORTED_MODULE_0__constants_values__[\"a\" /* EPSLN */]) {\n if (rh <= __WEBPACK_IMPORTED_MODULE_0__constants_values__[\"a\" /* EPSLN */]) {\n lat = this.lat0;\n lon = this.long0;\n p.x = lon;\n p.y = lat;\n //trace(p.toString());\n return p;\n }\n p.x *= this.con;\n p.y *= this.con;\n ts = rh * this.cons / (2 * this.a * this.k0);\n lat = this.con * __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_4__common_phi2z__[\"a\" /* default */])(this.e, ts);\n lon = this.con * __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_5__common_adjust_lon__[\"a\" /* default */])(this.con * this.long0 + Math.atan2(p.x, - 1 * p.y));\n }\n else {\n ce = 2 * Math.atan(rh * this.cosX0 / (2 * this.a * this.k0 * this.ms1));\n lon = this.long0;\n if (rh <= __WEBPACK_IMPORTED_MODULE_0__constants_values__[\"a\" /* EPSLN */]) {\n Chi = this.X0;\n }\n else {\n Chi = Math.asin(Math.cos(ce) * this.sinX0 + p.y * Math.sin(ce) * this.cosX0 / rh);\n lon = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_5__common_adjust_lon__[\"a\" /* default */])(this.long0 + Math.atan2(p.x * Math.sin(ce), rh * this.cosX0 * Math.cos(ce) - p.y * this.sinX0 * Math.sin(ce)));\n }\n lat = -1 * __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_4__common_phi2z__[\"a\" /* default */])(this.e, Math.tan(0.5 * (__WEBPACK_IMPORTED_MODULE_0__constants_values__[\"b\" /* HALF_PI */] + Chi)));\n }\n }\n p.x = lon;\n p.y = lat;\n\n //trace(p.toString());\n return p;\n\n}", "oscillate() {\n this.angle += 0.02;\n }", "function __WEBPACK_DEFAULT_EXPORT__(p0, p1) {\n var ux0 = p0[0], uy0 = p0[1], w0 = p0[2],\n ux1 = p1[0], uy1 = p1[1], w1 = p1[2],\n dx = ux1 - ux0,\n dy = uy1 - uy0,\n d2 = dx * dx + dy * dy,\n i,\n S;\n\n // Special case for u0 ≅ u1.\n if (d2 < epsilon2) {\n S = Math.log(w1 / w0) / rho;\n i = function(t) {\n return [\n ux0 + t * dx,\n uy0 + t * dy,\n w0 * Math.exp(rho * t * S)\n ];\n }\n }\n\n // General case.\n else {\n var d1 = Math.sqrt(d2),\n b0 = (w1 * w1 - w0 * w0 + rho4 * d2) / (2 * w0 * rho2 * d1),\n b1 = (w1 * w1 - w0 * w0 - rho4 * d2) / (2 * w1 * rho2 * d1),\n r0 = Math.log(Math.sqrt(b0 * b0 + 1) - b0),\n r1 = Math.log(Math.sqrt(b1 * b1 + 1) - b1);\n S = (r1 - r0) / rho;\n i = function(t) {\n var s = t * S,\n coshr0 = cosh(r0),\n u = w0 / (rho2 * d1) * (coshr0 * tanh(rho * s + r0) - sinh(r0));\n return [\n ux0 + u * dx,\n uy0 + u * dy,\n w0 * coshr0 / cosh(rho * s + r0)\n ];\n }\n }\n\n i.duration = S * 1000;\n\n return i;\n}", "function __WEBPACK_DEFAULT_EXPORT__(p0, p1) {\n var ux0 = p0[0], uy0 = p0[1], w0 = p0[2],\n ux1 = p1[0], uy1 = p1[1], w1 = p1[2],\n dx = ux1 - ux0,\n dy = uy1 - uy0,\n d2 = dx * dx + dy * dy,\n i,\n S;\n\n // Special case for u0 ≅ u1.\n if (d2 < epsilon2) {\n S = Math.log(w1 / w0) / rho;\n i = function(t) {\n return [\n ux0 + t * dx,\n uy0 + t * dy,\n w0 * Math.exp(rho * t * S)\n ];\n }\n }\n\n // General case.\n else {\n var d1 = Math.sqrt(d2),\n b0 = (w1 * w1 - w0 * w0 + rho4 * d2) / (2 * w0 * rho2 * d1),\n b1 = (w1 * w1 - w0 * w0 - rho4 * d2) / (2 * w1 * rho2 * d1),\n r0 = Math.log(Math.sqrt(b0 * b0 + 1) - b0),\n r1 = Math.log(Math.sqrt(b1 * b1 + 1) - b1);\n S = (r1 - r0) / rho;\n i = function(t) {\n var s = t * S,\n coshr0 = cosh(r0),\n u = w0 / (rho2 * d1) * (coshr0 * tanh(rho * s + r0) - sinh(r0));\n return [\n ux0 + u * dx,\n uy0 + u * dy,\n w0 * coshr0 / cosh(rho * s + r0)\n ];\n }\n }\n\n i.duration = S * 1000;\n\n return i;\n}", "function init() {\n this.no_off = this.no_off || false;\n this.no_rot = this.no_rot || false;\n\n if (isNaN(this.k0)) {\n this.k0 = 1;\n }\n var sinlat = Math.sin(this.lat0);\n var coslat = Math.cos(this.lat0);\n var con = this.e * sinlat;\n\n this.bl = Math.sqrt(1 + this.es / (1 - this.es) * Math.pow(coslat, 4));\n this.al = this.a * this.bl * this.k0 * Math.sqrt(1 - this.es) / (1 - con * con);\n var t0 = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0__common_tsfnz__[\"a\" /* default */])(this.e, this.lat0, sinlat);\n var dl = this.bl / coslat * Math.sqrt((1 - this.es) / (1 - con * con));\n if (dl * dl < 1) {\n dl = 1;\n }\n var fl;\n var gl;\n if (!isNaN(this.longc)) {\n //Central point and azimuth method\n\n if (this.lat0 >= 0) {\n fl = dl + Math.sqrt(dl * dl - 1);\n }\n else {\n fl = dl - Math.sqrt(dl * dl - 1);\n }\n this.el = fl * Math.pow(t0, this.bl);\n gl = 0.5 * (fl - 1 / fl);\n this.gamma0 = Math.asin(Math.sin(this.alpha) / dl);\n this.long0 = this.longc - Math.asin(gl * Math.tan(this.gamma0)) / this.bl;\n\n }\n else {\n //2 points method\n var t1 = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0__common_tsfnz__[\"a\" /* default */])(this.e, this.lat1, Math.sin(this.lat1));\n var t2 = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0__common_tsfnz__[\"a\" /* default */])(this.e, this.lat2, Math.sin(this.lat2));\n if (this.lat0 >= 0) {\n this.el = (dl + Math.sqrt(dl * dl - 1)) * Math.pow(t0, this.bl);\n }\n else {\n this.el = (dl - Math.sqrt(dl * dl - 1)) * Math.pow(t0, this.bl);\n }\n var hl = Math.pow(t1, this.bl);\n var ll = Math.pow(t2, this.bl);\n fl = this.el / hl;\n gl = 0.5 * (fl - 1 / fl);\n var jl = (this.el * this.el - ll * hl) / (this.el * this.el + ll * hl);\n var pl = (ll - hl) / (ll + hl);\n var dlon12 = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_1__common_adjust_lon__[\"a\" /* default */])(this.long1 - this.long2);\n this.long0 = 0.5 * (this.long1 + this.long2) - Math.atan(jl * Math.tan(0.5 * this.bl * (dlon12)) / pl) / this.bl;\n this.long0 = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_1__common_adjust_lon__[\"a\" /* default */])(this.long0);\n var dlon10 = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_1__common_adjust_lon__[\"a\" /* default */])(this.long1 - this.long0);\n this.gamma0 = Math.atan(Math.sin(this.bl * (dlon10)) / gl);\n this.alpha = Math.asin(dl * Math.sin(this.gamma0));\n }\n\n if (this.no_off) {\n this.uc = 0;\n }\n else {\n if (this.lat0 >= 0) {\n this.uc = this.al / this.bl * Math.atan2(Math.sqrt(dl * dl - 1), Math.cos(this.alpha));\n }\n else {\n this.uc = -1 * this.al / this.bl * Math.atan2(Math.sqrt(dl * dl - 1), Math.cos(this.alpha));\n }\n }\n\n}", "function toradians(deg)\n{\n return deg * Math.PI / 180.0;\n}", "get endRadians() { return this._radians1; }", "get baseRotationDegree() { return this._baseRotation * 180.0 / Math.PI; }", "yawPitchRoll() {\n return this.yawPitchRollInRadians().map(VrMath.radToDeg);\n }", "angle() {\n return this.get(Math.PI * 2, true)\n }", "function getRotaryRadius(axis, toolPosition, abc) {\r\n if (!axis.isEnabled()) {\r\n return 0;\r\n }\r\n\r\n var direction = axis.getEffectiveAxis();\r\n var normal = direction.getNormalized();\r\n // calculate the rotary center based on head/table\r\n var center;\r\n var radius;\r\n if (axis.isHead()) {\r\n var pivot;\r\n if (typeof headOffset === \"number\") {\r\n pivot = headOffset;\r\n } else {\r\n pivot = tool.getBodyLength();\r\n }\r\n if (axis.getCoordinate() == machineConfiguration.getAxisU().getCoordinate()) { // rider\r\n center = Vector.sum(toolPosition, Vector.product(machineConfiguration.getDirection(abc), pivot));\r\n center = Vector.sum(center, axis.getOffset());\r\n radius = Vector.diff(toolPosition, center).length;\r\n } else { // carrier\r\n var angle = abc.getCoordinate(machineConfiguration.getAxisU().getCoordinate());\r\n radius = Math.abs(pivot * Math.sin(angle));\r\n radius += axis.getOffset().length;\r\n }\r\n } else {\r\n center = axis.getOffset();\r\n var d1 = toolPosition.x - center.x;\r\n var d2 = toolPosition.y - center.y;\r\n var d3 = toolPosition.z - center.z;\r\n var radius = Math.sqrt(\r\n Math.pow((d1 * normal.y) - (d2 * normal.x), 2.0) +\r\n Math.pow((d2 * normal.z) - (d3 * normal.y), 2.0) +\r\n Math.pow((d3 * normal.x) - (d1 * normal.z), 2.0)\r\n );\r\n }\r\n return radius;\r\n}", "toRadians(degrees) {\n return degrees * Math.PI / 180;\n }", "set baseRotationDegree(value) { this._baseRotation = (value / 180.0 * Math.PI); }", "function angleCalculation(){\n\n var newDate = new Date();\n\n var seconds = newDate.getSeconds(),\n minutesL = newDate.getMinutes(),\n hours = newDate.getHours(),\n days = newDate.getDate(),\n month = newDate.getMonth()+1;\n console.log('minL',minutesL,'minutes',minutes);\n\n if(minutesL !== minutes){random = parseInt(Math.random() * 360); minutes = minutesL;}\n\n masterClock[0].seconds = minSec(seconds);\n masterClock[0].minutes = minSec(minutesL);\n masterClock[0].hours = hourScale(hours);\n masterClock[0].days = daysScale(days);\n masterClock[0].months = monthScale(month);\n\n watchS.transition().duration(500).style('fill','hsl('+random+','+colorSec(seconds)+'%,'+colorSec(seconds)+'%)').text(seconds+' -');\n watchM.text(minutesL+':');\n watchH.text(hours+':');\n watchD.text(days+' / ');\n watchMt.text(' '+month);\n\n return seconds;\n }", "test_MARelplot_render_r_equals_cos_theta() {\n let formulaStr = \"r = cos(theta)\"\n let result = []\n let formulaFn = MAUtils.convertJSToFn(MAUtils.convertFormulaToJS(formulaStr))\n let xInterval = new MAInterval(-12, 12)\n let yInterval = new MAInterval(-9, 9)\n let res = (xInterval.ub-xInterval.lb)/800\n MARelplot.render(formulaFn, xInterval, yInterval, 0, res, result)\n\n // On the curve\n assertListVisuallyContainsPoint(result, new MAPoint(0, 0), res, true)\n assertListVisuallyContainsPoint(result, new MAPoint(0.5, 0.5), res, true)\n assertListVisuallyContainsPoint(result, new MAPoint(0.78, 0.39), res, true)\n assertListVisuallyContainsPoint(result, new MAPoint(1, 0), res, true)\n assertListVisuallyContainsPoint(result, new MAPoint(0.87, -0.34), res, true)\n assertListVisuallyContainsPoint(result, new MAPoint(0.5, -0.5), res, true)\n assertListVisuallyContainsPoint(result, new MAPoint(0.19, -0.39), res, true)\n\n // Not on the curve\n assertListVisuallyContainsPoint(result, new MAPoint(0, 1), res, false)\n assertListVisuallyContainsPoint(result, new MAPoint(0, 2), res, false)\n assertListVisuallyContainsPoint(result, new MAPoint(0, 4), res, false)\n assertListVisuallyContainsPoint(result, new MAPoint(-5, 0), res, false)\n assertListVisuallyContainsPoint(result, new MAPoint(-5, 1), res, false)\n assertListVisuallyContainsPoint(result, new MAPoint(-5, -4), res, false)\n }", "setAngle (angle, raw) {\n // console.log(angle, raw);\n if (!this.isDeviceConnected()) return;\n if (isNaN(angle)) angle = this.__angle;\n this.__angle = angle;\n switch (this.data.protocolVersion) {\n case 3: // Protocol V3\n if (angle == undefined) {\n this.rest()\n } else {\n angle = Math.round(angle + 90)\n if (angle < 0) angle += 0x10000\n let hi = (angle>>8)\n let low = angle - (hi<<8)\n this.write(0, 0, raw? TModuleServo.COMMAND_SET_RAW_ANGLE: TModuleServo.COMMAND_SET_ANGLE, [hi, low], true) // Must assign a non-zero bufferID to avoid conflict with battery check response\n }\n break\n default: // Protocol V2\n if (angle == undefined) angle = 0\n angle = Math.max(-90, Math.min(90, raw? angle: angle + this.data.calibration[1]))\n this.write(0, 0, TModuleServo.COMMAND_SET_ANGLE, [Math.round(angle + 90)], true) // 8-bit uint as the angle\n break\n }\n }", "function toPolarCoordinates(inpt) {\n\t//Find origin point.\n\tvar xorig=(inpt[0].xpos+inpt[1].xpos)/2;\n\tvar yorig=(inpt[0].ypos+inpt[1].ypos)/2;\n\t\t\n\t//First reset the original point. We have done all of the reference spiral calculations at this point, so safe. \n\tinpt[0].r=Math.sqrt(Math.pow(inpt[0].xpos-xorig,2)+Math.pow(inpt[0].ypos-yorig,2));\n\t//Compute theta, but adjust for the preceding point so that theta is always positively increasing. \n\tinpt[0].theta=atanRotate(inpt[0].ypos-yorig,inpt[0].xpos-xorig);\n\t\n\t//Now do this for all spiral points.\n\tvar pre=inpt[0].theta; \n\tvar zeroCrossing = 0; \n\tfor (var i=1; i<inpt.length;i++) {\n\t\tinpt[i].r=Math.sqrt(Math.pow(inpt[i].xpos-xorig,2)+Math.pow(inpt[i].ypos-yorig,2));\n\t\t\n\t\tvar tmp=atanRotate(inpt[i].xpos-xorig,inpt[i].ypos-yorig)+360*(zeroCrossing-1);\n\t\tif (tmp<pre) {\n\t\t\t//Hit a point where we cross back over x=1,y=0. Need to add 360 degrees.\n\t\t\tzeroCrossing++;\n\t\t}\n\t\tinpt[i].theta = tmp; \n\t\tpre=tmp; \n\t}\n\t\n\t//Now convert back to radians.\n\tfor (var i=0; i<inpt.length; i++) {\n\t\tinpt[i].theta=toRadian(inpt[i].theta);\n\t}\n}", "static newPolarPoint(rho, theta) {\n return new PointFM(\n rho * Math.cos(theta),\n rho * Math.sin(theta)\n )\n }", "static newPolarPoint(rho, theta) {\n return new PointFM(\n rho * Math.cos(theta),\n rho * Math.sin(theta)\n )\n }", "animateToAngle(angle_, time_) {\n let time = time_ || 1000;\n let relativeAngle = angle_ - this.position.angle || 0;\n if(relativeAngle !== 0){\n this.position.angle = angle_;\n let rotateTransform = {\n rotation: relativeAngle,\n cx:0,\n cy:0,\n relative:true\n };\n\n this.torso.animate(time, \">\", 0)\n .transform(rotateTransform, true);\n\n }\n }", "function interpolate(from,to,direction,stream){circleStream(stream,radius,delta,direction,from,to)}", "function polar_x(radius, angle) {return(radius * Math.cos(Math.PI/180*angle + Math.PI/180*270));}", "getCorrectiveRotation() {\n const slope = (this.initialPosition.top - 50) / (this.initialPosition.left - 50);\n return Math.atan(slope);\n }", "getCarAngle() {\n let deltaX = this.vehicle.carLocation[0] - this.craneX;\n let deltaY = this.vehicle.carLocation[1] - this.craneZ;\n let angle = Math.atan(deltaX / deltaY);\n let finalAngle = angle - this.arm1HorizontalAngle;\n\n this.carInitialAngle = this.arm1HorizontalAngle - finalAngle;\n }", "function rtd(r)\n{\n return (r * 180.0) / Math.PI;\n}", "function forward(p) {\n var lon = p.x;\n var lat = p.y;\n var dlon = Object(_common_adjust_lon__WEBPACK_IMPORTED_MODULE_1__[\"default\"])(lon - this.long0);\n var us, vs;\n var con;\n if (Math.abs(Math.abs(lat) - _constants_values__WEBPACK_IMPORTED_MODULE_3__[\"HALF_PI\"]) <= _constants_values__WEBPACK_IMPORTED_MODULE_3__[\"EPSLN\"]) {\n if (lat > 0) {\n con = -1;\n }\n else {\n con = 1;\n }\n vs = this.al / this.bl * Math.log(Math.tan(_constants_values__WEBPACK_IMPORTED_MODULE_3__[\"FORTPI\"] + con * this.gamma0 * 0.5));\n us = -1 * con * _constants_values__WEBPACK_IMPORTED_MODULE_3__[\"HALF_PI\"] * this.al / this.bl;\n }\n else {\n var t = Object(_common_tsfnz__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(this.e, lat, Math.sin(lat));\n var ql = this.el / Math.pow(t, this.bl);\n var sl = 0.5 * (ql - 1 / ql);\n var tl = 0.5 * (ql + 1 / ql);\n var vl = Math.sin(this.bl * (dlon));\n var ul = (sl * Math.sin(this.gamma0) - vl * Math.cos(this.gamma0)) / tl;\n if (Math.abs(Math.abs(ul) - 1) <= _constants_values__WEBPACK_IMPORTED_MODULE_3__[\"EPSLN\"]) {\n vs = Number.POSITIVE_INFINITY;\n }\n else {\n vs = 0.5 * this.al * Math.log((1 - ul) / (1 + ul)) / this.bl;\n }\n if (Math.abs(Math.cos(this.bl * (dlon))) <= _constants_values__WEBPACK_IMPORTED_MODULE_3__[\"EPSLN\"]) {\n us = this.al * this.bl * (dlon);\n }\n else {\n us = this.al * Math.atan2(sl * Math.cos(this.gamma0) + vl * Math.sin(this.gamma0), Math.cos(this.bl * dlon)) / this.bl;\n }\n }\n\n if (this.no_rot) {\n p.x = this.x0 + us;\n p.y = this.y0 + vs;\n }\n else {\n\n us -= this.uc;\n p.x = this.x0 + vs * Math.cos(this.alpha) + us * Math.sin(this.alpha);\n p.y = this.y0 + us * Math.cos(this.alpha) - vs * Math.sin(this.alpha);\n }\n return p;\n}", "function forward(p) {\n var lon = p.x;\n var lat = p.y;\n\n var delta_lon = Object(_common_adjust_lon__WEBPACK_IMPORTED_MODULE_3__[\"default\"])(lon - this.long0);\n var con;\n var x, y;\n var sin_phi = Math.sin(lat);\n var cos_phi = Math.cos(lat);\n\n if (!this.es) {\n var b = cos_phi * Math.sin(delta_lon);\n\n if ((Math.abs(Math.abs(b) - 1)) < _constants_values__WEBPACK_IMPORTED_MODULE_4__[\"EPSLN\"]) {\n return (93);\n }\n else {\n x = 0.5 * this.a * this.k0 * Math.log((1 + b) / (1 - b)) + this.x0;\n y = cos_phi * Math.cos(delta_lon) / Math.sqrt(1 - Math.pow(b, 2));\n b = Math.abs(y);\n\n if (b >= 1) {\n if ((b - 1) > _constants_values__WEBPACK_IMPORTED_MODULE_4__[\"EPSLN\"]) {\n return (93);\n }\n else {\n y = 0;\n }\n }\n else {\n y = Math.acos(y);\n }\n\n if (lat < 0) {\n y = -y;\n }\n\n y = this.a * this.k0 * (y - this.lat0) + this.y0;\n }\n }\n else {\n var al = cos_phi * delta_lon;\n var als = Math.pow(al, 2);\n var c = this.ep2 * Math.pow(cos_phi, 2);\n var cs = Math.pow(c, 2);\n var tq = Math.abs(cos_phi) > _constants_values__WEBPACK_IMPORTED_MODULE_4__[\"EPSLN\"] ? Math.tan(lat) : 0;\n var t = Math.pow(tq, 2);\n var ts = Math.pow(t, 2);\n con = 1 - this.es * Math.pow(sin_phi, 2);\n al = al / Math.sqrt(con);\n var ml = Object(_common_pj_mlfn__WEBPACK_IMPORTED_MODULE_1__[\"default\"])(lat, sin_phi, cos_phi, this.en);\n\n x = this.a * (this.k0 * al * (1 +\n als / 6 * (1 - t + c +\n als / 20 * (5 - 18 * t + ts + 14 * c - 58 * t * c +\n als / 42 * (61 + 179 * ts - ts * t - 479 * t))))) +\n this.x0;\n\n y = this.a * (this.k0 * (ml - this.ml0 +\n sin_phi * delta_lon * al / 2 * (1 +\n als / 12 * (5 - t + 9 * c + 4 * cs +\n als / 30 * (61 + ts - 58 * t + 270 * c - 330 * t * c +\n als / 56 * (1385 + 543 * ts - ts * t - 3111 * t)))))) +\n this.y0;\n }\n\n p.x = x;\n p.y = y;\n\n return p;\n}", "function rad(angle) {\n return Math.PI * angle / 180;\n}", "function init() {\n\n if (Math.abs(this.lat1 + this.lat2) < __WEBPACK_IMPORTED_MODULE_4__constants_values__[\"a\" /* EPSLN */]) {\n return;\n }\n this.temp = this.b / this.a;\n this.es = 1 - Math.pow(this.temp, 2);\n this.e3 = Math.sqrt(this.es);\n\n this.sin_po = Math.sin(this.lat1);\n this.cos_po = Math.cos(this.lat1);\n this.t1 = this.sin_po;\n this.con = this.sin_po;\n this.ms1 = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0__common_msfnz__[\"a\" /* default */])(this.e3, this.sin_po, this.cos_po);\n this.qs1 = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_1__common_qsfnz__[\"a\" /* default */])(this.e3, this.sin_po, this.cos_po);\n\n this.sin_po = Math.sin(this.lat2);\n this.cos_po = Math.cos(this.lat2);\n this.t2 = this.sin_po;\n this.ms2 = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0__common_msfnz__[\"a\" /* default */])(this.e3, this.sin_po, this.cos_po);\n this.qs2 = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_1__common_qsfnz__[\"a\" /* default */])(this.e3, this.sin_po, this.cos_po);\n\n this.sin_po = Math.sin(this.lat0);\n this.cos_po = Math.cos(this.lat0);\n this.t3 = this.sin_po;\n this.qs0 = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_1__common_qsfnz__[\"a\" /* default */])(this.e3, this.sin_po, this.cos_po);\n\n if (Math.abs(this.lat1 - this.lat2) > __WEBPACK_IMPORTED_MODULE_4__constants_values__[\"a\" /* EPSLN */]) {\n this.ns0 = (this.ms1 * this.ms1 - this.ms2 * this.ms2) / (this.qs2 - this.qs1);\n }\n else {\n this.ns0 = this.con;\n }\n this.c = this.ms1 * this.ms1 + this.ns0 * this.qs1;\n this.rh = this.a * Math.sqrt(this.c - this.ns0 * this.qs0) / this.ns0;\n}", "function lerpRotation(start, end, t) {\n var difference = Math.abs(end - start);\n if (difference > PI) {\n // We need to add on to one of the values.\n if (end > start) {\n // We'll add it on to start...\n start += TWO_PI;\n } else {\n // Add it on to end.\n end += PI + TWO_PI;\n }\n }\n\n // Interpolate it.\n var value = start + (end - start) * t;\n\n // wrap to 0-2PI\n /*if (value >= 0 && value <= TWO_PI)\n return value;\n return value % TWO_PI;*/\n\n //just return, as it's faster\n return value;\n}", "function evalPolar(func, ...args) {\n const prev_evaluatingPolar = exports.defs.evaluatingPolar;\n exports.defs.evaluatingPolar = true;\n try {\n return func(...args);\n }\n finally {\n exports.defs.evaluatingPolar = prev_evaluatingPolar;\n }\n}" ]
[ "0.5401542", "0.5277288", "0.52670497", "0.5204954", "0.5201989", "0.51756907", "0.5160999", "0.5063061", "0.5048604", "0.50392836", "0.5035456", "0.49938932", "0.49804178", "0.4977963", "0.49748492", "0.49673912", "0.49535117", "0.4950302", "0.49470907", "0.4945801", "0.492645", "0.4923917", "0.49107945", "0.4906075", "0.48948228", "0.48921505", "0.48913458", "0.48799136", "0.48789483", "0.4871133", "0.48676765", "0.48357219", "0.48311585", "0.48203006", "0.48195922", "0.48180115", "0.47950137", "0.47913176", "0.47905996", "0.47897917", "0.4777014", "0.4769511", "0.47655183", "0.47648183", "0.47547445", "0.47507426", "0.4740177", "0.4733814", "0.4731303", "0.47305095", "0.47250932", "0.47218826", "0.47098714", "0.47078264", "0.47049704", "0.4693664", "0.46875533", "0.46871936", "0.4682673", "0.4682169", "0.46566886", "0.46566886", "0.4653957", "0.46506524", "0.46481597", "0.46481276", "0.46435246", "0.46408015", "0.46408015", "0.46362495", "0.46353886", "0.46342784", "0.46328855", "0.46328855", "0.46311718", "0.46286932", "0.46282503", "0.46251264", "0.4624663", "0.46220273", "0.4620605", "0.4619243", "0.46163657", "0.46104816", "0.4607247", "0.46057624", "0.45853463", "0.45847765", "0.45847765", "0.4582499", "0.45823786", "0.45805874", "0.45782036", "0.4576779", "0.45753378", "0.45722187", "0.45646474", "0.45634025", "0.45590872", "0.4557905", "0.45512113" ]
0.0
-1
Draw smoothed line in nonmonotone, in may cause undesired curve in extreme situations. This should be used when points are nonmonotone neither in x or y dimension.
function drawNonMono(ctx, points, start, segLen, allLen, dir, smoothMin, smoothMax, smooth, smoothMonotone, connectNulls) { var prevIdx = 0; var idx = start; for (var k = 0; k < segLen; k++) { var p = points[idx]; if (idx >= allLen || idx < 0) { break; } if (isPointNull(p)) { if (connectNulls) { idx += dir; continue; } break; } if (idx === start) { ctx[dir > 0 ? 'moveTo' : 'lineTo'](p[0], p[1]); v2Copy(cp0, p); } else { if (smooth > 0) { var nextIdx = idx + dir; var nextP = points[nextIdx]; if (connectNulls) { // Find next point not null while (nextP && isPointNull(points[nextIdx])) { nextIdx += dir; nextP = points[nextIdx]; } } var ratioNextSeg = 0.5; var prevP = points[prevIdx]; var nextP = points[nextIdx]; // Last point if (!nextP || isPointNull(nextP)) { v2Copy(cp1, p); } else { // If next data is null in not connect case if (isPointNull(nextP) && !connectNulls) { nextP = p; } vec2.sub(v, nextP, prevP); var lenPrevSeg; var lenNextSeg; if (smoothMonotone === 'x' || smoothMonotone === 'y') { var dim = smoothMonotone === 'x' ? 0 : 1; lenPrevSeg = Math.abs(p[dim] - prevP[dim]); lenNextSeg = Math.abs(p[dim] - nextP[dim]); } else { lenPrevSeg = vec2.dist(p, prevP); lenNextSeg = vec2.dist(p, nextP); } // Use ratio of seg length ratioNextSeg = lenNextSeg / (lenNextSeg + lenPrevSeg); scaleAndAdd(cp1, p, v, -smooth * (1 - ratioNextSeg)); } // Smooth constraint vec2Min(cp0, cp0, smoothMax); vec2Max(cp0, cp0, smoothMin); vec2Min(cp1, cp1, smoothMax); vec2Max(cp1, cp1, smoothMin); ctx.bezierCurveTo(cp0[0], cp0[1], cp1[0], cp1[1], p[0], p[1]); // cp0 of next segment scaleAndAdd(cp0, p, v, smooth * ratioNextSeg); } else { ctx.lineTo(p[0], p[1]); } } prevIdx = idx; idx += dir; } return k; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function drawSeriesLines(series){\n\t\t\tfunction plotLine(data, offset){\n\t\t\t\tif(data.length < 2) return;\n\t\n\t\t\t\tvar prevx = tHoz(data[0][0]),\n\t\t\t\t\tprevy = tVert(data[0][1]) + offset;\n\t\n\t\t\t\tctx.beginPath();\n\t\t\t\tctx.moveTo(prevx, prevy);\n\t\t\t\tfor(var i = 0; i < data.length - 1; ++i){\n\t\t\t\t\tvar x1 = data[i][0], y1 = data[i][1],\n\t\t\t\t\t\tx2 = data[i+1][0], y2 = data[i+1][1];\n\t\n\t\t\t\t\t/**\n\t\t\t\t\t * Clip with ymin.\n\t\t\t\t\t */\n\t\t\t\t\tif(y1 <= y2 && y1 < yaxis.min){\n\t\t\t\t\t\t/**\n\t\t\t\t\t\t * Line segment is outside the drawing area.\n\t\t\t\t\t\t */\n\t\t\t\t\t\tif(y2 < yaxis.min) continue;\n\t\t\t\t\t\t\n\t\t\t\t\t\t/**\n\t\t\t\t\t\t * Compute new intersection point.\n\t\t\t\t\t\t */\n\t\t\t\t\t\tx1 = (yaxis.min - y1) / (y2 - y1) * (x2 - x1) + x1;\n\t\t\t\t\t\ty1 = yaxis.min;\n\t\t\t\t\t}else if(y2 <= y1 && y2 < yaxis.min){\n\t\t\t\t\t\tif(y1 < yaxis.min) continue;\n\t\t\t\t\t\tx2 = (yaxis.min - y1) / (y2 - y1) * (x2 - x1) + x1;\n\t\t\t\t\t\ty2 = yaxis.min;\n\t\t\t\t\t}\n\t\n\t\t\t\t\t/**\n\t\t\t\t\t * Clip with ymax.\n\t\t\t\t\t */ \n\t\t\t\t\tif(y1 >= y2 && y1 > yaxis.max) {\n\t\t\t\t\t\tif(y2 > yaxis.max) continue;\n\t\t\t\t\t\tx1 = (yaxis.max - y1) / (y2 - y1) * (x2 - x1) + x1;\n\t\t\t\t\t\ty1 = yaxis.max;\n\t\t\t\t\t}\n\t\t\t\t\telse if(y2 >= y1 && y2 > yaxis.max){\n\t\t\t\t\t\tif(y1 > yaxis.max) continue;\n\t\t\t\t\t\tx2 = (yaxis.max - y1) / (y2 - y1) * (x2 - x1) + x1;\n\t\t\t\t\t\ty2 = yaxis.max;\n\t\t\t\t\t}\n\t\n\t\t\t\t\t/**\n\t\t\t\t\t * Clip with xmin.\n\t\t\t\t\t */\n\t\t\t\t\tif(x1 <= x2 && x1 < xaxis.min){\n\t\t\t\t\t\tif(x2 < xaxis.min) continue;\n\t\t\t\t\t\ty1 = (xaxis.min - x1) / (x2 - x1) * (y2 - y1) + y1;\n\t\t\t\t\t\tx1 = xaxis.min;\n\t\t\t\t\t}else if(x2 <= x1 && x2 < xaxis.min){\n\t\t\t\t\t\tif(x1 < xaxis.min) continue;\n\t\t\t\t\t\ty2 = (xaxis.min - x1) / (x2 - x1) * (y2 - y1) + y1;\n\t\t\t\t\t\tx2 = xaxis.min;\n\t\t\t\t\t}\n\t\n\t\t\t\t\t/**\n\t\t\t\t\t * Clip with xmax.\n\t\t\t\t\t */\n\t\t\t\t\tif(x1 >= x2 && x1 > xaxis.max){\n\t\t\t\t\t\tif (x2 > xaxis.max) continue;\n\t\t\t\t\t\ty1 = (xaxis.max - x1) / (x2 - x1) * (y2 - y1) + y1;\n\t\t\t\t\t\tx1 = xaxis.max;\n\t\t\t\t\t}else if(x2 >= x1 && x2 > xaxis.max){\n\t\t\t\t\t\tif(x1 > xaxis.max) continue;\n\t\t\t\t\t\ty2 = (xaxis.max - x1) / (x2 - x1) * (y2 - y1) + y1;\n\t\t\t\t\t\tx2 = xaxis.max;\n\t\t\t\t\t}\n\t\n\t\t\t\t\tif(prevx != tHoz(x1) || prevy != tVert(y1) + offset)\n\t\t\t\t\t\tctx.moveTo(tHoz(x1), tVert(y1) + offset);\n\t\t\t\t\t\n\t\t\t\t\tprevx = tHoz(x2);\n\t\t\t\t\tprevy = tVert(y2) + offset;\n\t\t\t\t\tctx.lineTo(prevx, prevy);\n\t\t\t\t}\n\t\t\t\tctx.stroke();\n\t\t\t}\n\t\t\t\n\t\t\t/**\n\t\t\t * Function used to fill\n\t\t\t * @param {Object} data\n\t\t\t */\n\t\t\tfunction plotLineArea(data){\n\t\t\t\tif(data.length < 2) return;\n\t\n\t\t\t\tvar bottom = Math.min(Math.max(0, yaxis.min), yaxis.max);\n\t\t\t\tvar top, lastX = 0;\n\t\t\t\tvar first = true;\n\t\t\t\t\n\t\t\t\tctx.beginPath();\n\t\t\t\tfor(var i = 0; i < data.length - 1; ++i){\n\t\t\t\t\t\n\t\t\t\t\tvar x1 = data[i][0], y1 = data[i][1],\n\t\t\t\t\t\tx2 = data[i+1][0], y2 = data[i+1][1];\n\t\t\t\t\t\n\t\t\t\t\tif(x1 <= x2 && x1 < xaxis.min){\n\t\t\t\t\t\tif(x2 < xaxis.min) continue;\n\t\t\t\t\t\ty1 = (xaxis.min - x1) / (x2 - x1) * (y2 - y1) + y1;\n\t\t\t\t\t\tx1 = xaxis.min;\n\t\t\t\t\t}else if(x2 <= x1 && x2 < xaxis.min){\n\t\t\t\t\t\tif(x1 < xaxis.min) continue;\n\t\t\t\t\t\ty2 = (xaxis.min - x1) / (x2 - x1) * (y2 - y1) + y1;\n\t\t\t\t\t\tx2 = xaxis.min;\n\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\tif(x1 >= x2 && x1 > xaxis.max){\n\t\t\t\t\t\tif(x2 > xaxis.max) continue;\n\t\t\t\t\t\ty1 = (xaxis.max - x1) / (x2 - x1) * (y2 - y1) + y1;\n\t\t\t\t\t\tx1 = xaxis.max;\n\t\t\t\t\t}else if(x2 >= x1 && x2 > xaxis.max){\n\t\t\t\t\t\tif (x1 > xaxis.max) continue;\n\t\t\t\t\t\ty2 = (xaxis.max - x1) / (x2 - x1) * (y2 - y1) + y1;\n\t\t\t\t\t\tx2 = xaxis.max;\n\t\t\t\t\t}\n\n\t\t\t\t\tif(first){\n\t\t\t\t\t\tctx.moveTo(tHoz(x1), tVert(bottom));\n\t\t\t\t\t\tfirst = false;\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\t/**\n\t\t\t\t\t * Now check the case where both is outside.\n\t\t\t\t\t */\n\t\t\t\t\tif(y1 >= yaxis.max && y2 >= yaxis.max){\n\t\t\t\t\t\tctx.lineTo(tHoz(x1), tVert(yaxis.max));\n\t\t\t\t\t\tctx.lineTo(tHoz(x2), tVert(yaxis.max));\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t}else if(y1 <= yaxis.min && y2 <= yaxis.min){\n\t\t\t\t\t\tctx.lineTo(tHoz(x1), tVert(yaxis.min));\n\t\t\t\t\t\tctx.lineTo(tHoz(x2), tVert(yaxis.min));\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\t/**\n\t\t\t\t\t * Else it's a bit more complicated, there might\n\t\t\t\t\t * be two rectangles and two triangles we need to fill\n\t\t\t\t\t * in; to find these keep track of the current x values.\n\t\t\t\t\t */\n\t\t\t\t\tvar x1old = x1, x2old = x2;\n\t\t\t\t\t\n\t\t\t\t\t/**\n\t\t\t\t\t * And clip the y values, without shortcutting.\n\t\t\t\t\t * Clip with ymin.\n\t\t\t\t\t */\n\t\t\t\t\tif(y1 <= y2 && y1 < yaxis.min && y2 >= yaxis.min){\n\t\t\t\t\t\tx1 = (yaxis.min - y1) / (y2 - y1) * (x2 - x1) + x1;\n\t\t\t\t\t\ty1 = yaxis.min;\n\t\t\t\t\t}else if(y2 <= y1 && y2 < yaxis.min && y1 >= yaxis.min){\n\t\t\t\t\t\tx2 = (yaxis.min - y1) / (y2 - y1) * (x2 - x1) + x1;\n\t\t\t\t\t\ty2 = yaxis.min;\n\t\t\t\t\t}\n\t\n\t\t\t\t\t/**\n\t\t\t\t\t * Clip with ymax.\n\t\t\t\t\t */\n\t\t\t\t\tif(y1 >= y2 && y1 > yaxis.max && y2 <= yaxis.max){\n\t\t\t\t\t\tx1 = (yaxis.max - y1) / (y2 - y1) * (x2 - x1) + x1;\n\t\t\t\t\t\ty1 = yaxis.max;\n\t\t\t\t\t}else if(y2 >= y1 && y2 > yaxis.max && y1 <= yaxis.max){\n\t\t\t\t\t\tx2 = (yaxis.max - y1) / (y2 - y1) * (x2 - x1) + x1;\n\t\t\t\t\t\ty2 = yaxis.max;\n\t\t\t\t\t}\n\t\n\t\t\t\t\t/**\n\t\t\t\t\t * If the x value was changed we got a rectangle to fill.\n\t\t\t\t\t */\n\t\t\t\t\tif(x1 != x1old){\n\t\t\t\t\t\ttop = (y1 <= yaxis.min) ? top = yaxis.min : yaxis.max;\t\t\t\t\t\t\n\t\t\t\t\t\tctx.lineTo(tHoz(x1old), tVert(top));\n\t\t\t\t\t\tctx.lineTo(tHoz(x1), tVert(top));\n\t\t\t\t\t}\n\t\t\t\t \t\n\t\t\t\t\t/**\n\t\t\t\t\t * Fill the triangles.\n\t\t\t\t\t */\n\t\t\t\t\tctx.lineTo(tHoz(x1), tVert(y1));\n\t\t\t\t\tctx.lineTo(tHoz(x2), tVert(y2));\n\n\t\t\t\t\t/**\n\t\t\t\t\t * Fill the other rectangle if it's there.\n\t\t\t\t\t */\n\t\t\t\t\tif(x2 != x2old){\n\t\t\t\t\t\ttop = (y2 <= yaxis.min) ? yaxis.min : yaxis.max;\n\t\t\t\t\t\tctx.lineTo(tHoz(x2old), tVert(top));\n\t\t\t\t\t\tctx.lineTo(tHoz(x2), tVert(top));\n\t\t\t\t\t}\n\t\n\t\t\t\t\tlastX = Math.max(x2, x2old);\n\t\t\t\t}\n\t\t\t\t/*\n\t\t\t\tctx.beginPath();\n\t\t\t\tctx.moveTo(tHoz(data[0][0]), tVert(0));\n\t\t\t\tfor (var i = 0; i < data.length; i++) {\n\t\t\t\t\tctx.lineTo(tHoz(data[i][0]), tVert(data[i][1]));\n\t\t\t\t}\n\t\t\t\tctx.lineTo(tHoz(data[data.length - 1][0]), tVert(0));*/\n\t\t\t\tctx.lineTo(tHoz(lastX), tVert(bottom));\n\t\t\t\tctx.closePath();\n\t\t\t\tctx.fill();\n\t\t\t}\n\t\t\t\n\t\t\tctx.save();\n\t\t\tctx.translate(plotOffset.left, plotOffset.top);\n\t\t\tctx.lineJoin = 'round';\n\t\n\t\t\tvar lw = series.lines.lineWidth;\n\t\t\tvar sw = series.shadowSize;\n\t\t\t/**\n\t\t\t * @todo: consider another form of shadow when filling is turned on\n\t\t\t */\n\t\t\tif(sw > 0){\n\t\t\t\tctx.lineWidth = sw / 2;\n\t\t\t\tctx.strokeStyle = \"rgba(0,0,0,0.1)\";\n\t\t\t\tplotLine(series.data, lw/2 + sw/2 + ctx.lineWidth/2);\n\t\n\t\t\t\tctx.lineWidth = sw / 2;\n\t\t\t\tctx.strokeStyle = \"rgba(0,0,0,0.2)\";\n\t\t\t\tplotLine(series.data, lw/2 + ctx.lineWidth/2);\n\t\t\t}\n\t\n\t\t\tctx.lineWidth = lw;\n\t\t\tctx.strokeStyle = series.color;\n\t\t\tif(series.lines.fill){\n\t\t\t\tctx.fillStyle = series.lines.fillColor != null ? series.lines.fillColor : parseColor(series.color).scale(null, null, null, 0.4).toString();\n\t\t\t\tplotLineArea(series.data, 0);\n\t\t\t}\n\t\n\t\t\tplotLine(series.data, 0);\n\t\t\tctx.restore();\n\t\t}", "function drawLine() {\n // if one point isn't on the plane, do not draw a line\n if (pt1.pinned && plane.getContext) {\n let ctx = plane.getContext('2d');\n ctx.beginPath();\n ctx.strokeStyle = 'rgb(45, 166, 87)';\n // when pt2 is not pinned, line is dotted\n if (!pt2.pinned) {\n ctx.setLineDash([5, 5]);\n // moving dotted line animation\n ctx.lineDashOffset -= .25;\n }\n ctx.lineWidth = 3;\n // we want the line to extend past the points up to the edges of the plane\n // therefore we need the canvas boundary intercepts\n let boundInt = getPlaneBoundaryIntercepts();\n ctx.moveTo(boundInt.xBoundary1, boundInt.yBoundary1);\n ctx.lineTo(boundInt.xBoundary2, boundInt.yBoundary2);\n ctx.stroke();\n // reset line dash to be solid\n ctx.setLineDash([]);\n }\n}", "function drawLines(point) {\n for(var i in point.closest) {\n var lineAlpha = 0.1;\n ctx.beginPath();\n ctx.moveTo(point.x, point.y);\n ctx.lineTo(point.closest[i].x, point.closest[i].y);\n ctx.strokeStyle = 'rgba(70, 160, 190, ' + lineAlpha + ')';\n ctx.stroke();\n }\n}", "function draw() {\n line(lineX, lineY, lineXEnd, lineY);\n lineX+=5;\n lineXEnd +=5;\n if(lineX==width && lineXEnd==width){\n noLoop();\n }\n}", "function draw() {\n\tbackground(241);\n\tstroke(210);\n\tvar t = 1.0*(frameCount - 1)/numFrames;\n\tnoiseDetail(1, 0.5);\n\tfor(var i = 0; i < m; i++){\n\t\tvar p = 1.0*i/m;\n\t\t//squiggly line 1\n\t\tvar dx1 = 100*noise(13.3 + rad*cos(TWO_PI*(nperiod*p - t)), rad*sin(TWO_PI*(nperiod*p - t)), 50.0*p);\n\t\tvar dy1 = 100*noise(2*13.3 + rad*cos(TWO_PI*(nperiod*p - t)), rad*sin(TWO_PI*(nperiod*p - t)), 50.0*p);\n\t\tpoint(p*width + dx1, dy1);\n\t\t//squiggly line 2\n\t\tvar dx2 = 100*noise(23.3 + rad*cos(TWO_PI*(nperiod*p - t)), rad*sin(TWO_PI*(nperiod*p - t)), 50.0*p);\n\t\tvar dy2 = 100*noise(2*23.3 + rad*cos(TWO_PI*(nperiod*p - t)), rad*sin(TWO_PI*(nperiod*p - t)), 50.0*p);\n\t\tpoint(p*width + dx2, height/6 + dy2);\n\t\t//squiggly line 3\n\t\tvar dx3 = 100*noise(33.3 + rad*cos(TWO_PI*(nperiod*p - t)), rad*sin(TWO_PI*(nperiod*p - t)), 50.0*p);\n\t\tvar dy3 = 100*noise(2*33.3 + rad*cos(TWO_PI*(nperiod*p - t)), rad*sin(TWO_PI*(nperiod*p - t)), 50.0*p);\n\t\tpoint(p*width + dx3, 2*height/6 + dy3);\n\t\t//squiggly line 4\n\t\tvar dx4 = 100*noise(43.3 + rad*cos(TWO_PI*(nperiod*p - t)), rad*sin(TWO_PI*(nperiod*p - t)), 50.0*p);\n\t\tvar dy4 = 100*noise(2*43.3 + rad*cos(TWO_PI*(nperiod*p - t)), rad*sin(TWO_PI*(nperiod*p - t)), 50.0*p);\n\t\tpoint(p*width + dx4, 3*height/6 + dy4);\n\t\t//squiggly line 5\n\t\tvar dx5 = 100*noise(53.3 + rad*cos(TWO_PI*(nperiod*p - t)), rad*sin(TWO_PI*(nperiod*p - t)), 50.0*p);\n\t\tvar dy5 = 100*noise(2*53.3 + rad*cos(TWO_PI*(nperiod*p - t)), rad*sin(TWO_PI*(nperiod*p - t)), 50.0*p);\n\t\tpoint(p*width + dx5, 4*height/6 + dy5);\n\t\t//squiggly line 6\n\t\tvar dx6 = 100*noise(63.3 + rad*cos(TWO_PI*(nperiod*p - t)), rad*sin(TWO_PI*(nperiod*p - t)), 50.0*p);\n\t\tvar dy6 = 100*noise(2*63.3 + rad*cos(TWO_PI*(nperiod*p - t)), rad*sin(TWO_PI*(nperiod*p - t)), 50.0*p);\n\t\tpoint(p*width + dx6, 5*height/6 + dy6);\n\t}\n}", "function clipLine(stream) {\n var point0, // previous point\n c0, // code for previous point\n v0, // visibility of previous point\n v00, // visibility of first point\n clean; // no intersections\n return {\n lineStart: function() {\n v00 = v0 = false;\n clean = 1;\n },\n point: function(lambda, phi) {\n var point1 = [lambda, phi],\n point2,\n v = visible(lambda, phi),\n c = smallRadius\n ? v ? 0 : code(lambda, phi)\n : v ? code(lambda + (lambda < 0 ? pi : -pi), phi) : 0;\n if (!point0 && (v00 = v0 = v)) stream.lineStart();\n // Handle degeneracies.\n // TODO ignore if not clipping polygons.\n if (v !== v0) {\n point2 = intersect(point0, point1);\n if (!point2 || pointEqual(point0, point2) || pointEqual(point1, point2)) {\n point1[0] += epsilon;\n point1[1] += epsilon;\n v = visible(point1[0], point1[1]);\n }\n }\n if (v !== v0) {\n clean = 0;\n if (v) {\n // outside going in\n stream.lineStart();\n point2 = intersect(point1, point0);\n stream.point(point2[0], point2[1]);\n } else {\n // inside going out\n point2 = intersect(point0, point1);\n stream.point(point2[0], point2[1]);\n stream.lineEnd();\n }\n point0 = point2;\n } else if (notHemisphere && point0 && smallRadius ^ v) {\n var t;\n // If the codes for two points are different, or are both zero,\n // and there this segment intersects with the small circle.\n if (!(c & c0) && (t = intersect(point1, point0, true))) {\n clean = 0;\n if (smallRadius) {\n stream.lineStart();\n stream.point(t[0][0], t[0][1]);\n stream.point(t[1][0], t[1][1]);\n stream.lineEnd();\n } else {\n stream.point(t[1][0], t[1][1]);\n stream.lineEnd();\n stream.lineStart();\n stream.point(t[0][0], t[0][1]);\n }\n }\n }\n if (v && (!point0 || !pointEqual(point0, point1))) {\n stream.point(point1[0], point1[1]);\n }\n point0 = point1, v0 = v, c0 = c;\n },\n lineEnd: function() {\n if (v0) stream.lineEnd();\n point0 = null;\n },\n // Rejoin first and last segments if there were intersections and the first\n // and last points were visible.\n clean: function() {\n return clean | ((v00 && v0) << 1);\n }\n };\n }", "function drawLines() {\n ctx.lineWidth = 0.5;\n\n for (var i = 0; i < numOfDots; i++) {\n for (var j = i + 1; j < numOfDots; j++) {\n\n var dot1 = dots[i];\n var dot2 = dots[j];\n var distance = Math.hypot(Math.abs(dot1.x - dot2.x),\n Math.abs(dot1.y - dot2.y));\n\n if (distance <= 200) {\n\n var saturation = 1 - distance / 200;\n saturation = Math.floor(saturation * 100) / 100;\n ctx.strokeStyle = `rgba(255, 255, 255, ${saturation})`;\n\n ctx.beginPath();\n ctx.moveTo(dot1.x, dot1.y);\n ctx.lineTo(dot2.x, dot2.y);\n ctx.stroke();\n }\n }\n }\n}", "function drawSVGLine(points, svg) {\n if (points.length < 3) return;\n\n let smoothRange = getSmoothRange(points, smoothSteps);\n points = smoothRange.points;\n\n svg.beginPath();\n svg.strokeStyle = lineStroke;\n svg.lineWidth = lineWidth;\n let wasVisible = false;\n for (let i = 0; i < points.length; i += 2) {\n let x = points[i];\n let y = points[i + 1];\n\n let lastRenderedColumnHeight = columnHeights[x];\n let isVisible = y <= lastRenderedColumnHeight && y >= 0 && y < trueWindowHeight;\n if (isVisible) {\n // This is important bit. We mark the entire area below as \"rendered\"\n // so that next `isVisible` check will return false, and we will break the line\n columnHeights[x] = Math.min(y, lastRenderedColumnHeight)\n // the path is visible:\n if (wasVisible) {\n svg.lineTo(x, y);\n } else {\n svg.moveTo(x, y);\n }\n } else {\n // The path is no longer visible\n if (wasVisible) {\n // But it was visible before\n svg.lineTo(x, y < 0 ? 0 : lastRenderedColumnHeight);\n } else {\n svg.moveTo(x, y < 0? 0 : lastRenderedColumnHeight);\n }\n }\n wasVisible = isVisible;\n }\n svg.stroke();\n }", "function clipLine(stream) {\n var point0, // previous point\n c0, // code for previous point\n v0, // visibility of previous point\n v00, // visibility of first point\n clean; // no intersections\n return {\n lineStart: function() {\n v00 = v0 = false;\n clean = 1;\n },\n point: function(lambda, phi) {\n var point1 = [lambda, phi],\n point2,\n v = visible(lambda, phi),\n c = smallRadius\n ? v ? 0 : code(lambda, phi)\n : v ? code(lambda + (lambda < 0 ? pi$3 : -pi$3), phi) : 0;\n if (!point0 && (v00 = v0 = v)) stream.lineStart();\n // Handle degeneracies.\n // TODO ignore if not clipping polygons.\n if (v !== v0) {\n point2 = intersect(point0, point1);\n if (!point2 || pointEqual(point0, point2) || pointEqual(point1, point2)) {\n point1[0] += epsilon$2;\n point1[1] += epsilon$2;\n v = visible(point1[0], point1[1]);\n }\n }\n if (v !== v0) {\n clean = 0;\n if (v) {\n // outside going in\n stream.lineStart();\n point2 = intersect(point1, point0);\n stream.point(point2[0], point2[1]);\n } else {\n // inside going out\n point2 = intersect(point0, point1);\n stream.point(point2[0], point2[1]);\n stream.lineEnd();\n }\n point0 = point2;\n } else if (notHemisphere && point0 && smallRadius ^ v) {\n var t;\n // If the codes for two points are different, or are both zero,\n // and there this segment intersects with the small circle.\n if (!(c & c0) && (t = intersect(point1, point0, true))) {\n clean = 0;\n if (smallRadius) {\n stream.lineStart();\n stream.point(t[0][0], t[0][1]);\n stream.point(t[1][0], t[1][1]);\n stream.lineEnd();\n } else {\n stream.point(t[1][0], t[1][1]);\n stream.lineEnd();\n stream.lineStart();\n stream.point(t[0][0], t[0][1]);\n }\n }\n }\n if (v && (!point0 || !pointEqual(point0, point1))) {\n stream.point(point1[0], point1[1]);\n }\n point0 = point1, v0 = v, c0 = c;\n },\n lineEnd: function() {\n if (v0) stream.lineEnd();\n point0 = null;\n },\n // Rejoin first and last segments if there were intersections and the first\n // and last points were visible.\n clean: function() {\n return clean | ((v00 && v0) << 1);\n }\n };\n }", "function clipLine(stream) {\n var point0, // previous point\n c0, // code for previous point\n v0, // visibility of previous point\n v00, // visibility of first point\n clean; // no intersections\n return {\n lineStart: function() {\n v00 = v0 = false;\n clean = 1;\n },\n point: function(lambda, phi) {\n var point1 = [lambda, phi],\n point2,\n v = visible(lambda, phi),\n c = smallRadius\n ? v ? 0 : code(lambda, phi)\n : v ? code(lambda + (lambda < 0 ? pi$3 : -pi$3), phi) : 0;\n if (!point0 && (v00 = v0 = v)) stream.lineStart();\n // Handle degeneracies.\n // TODO ignore if not clipping polygons.\n if (v !== v0) {\n point2 = intersect(point0, point1);\n if (pointEqual(point0, point2) || pointEqual(point1, point2)) {\n point1[0] += epsilon$4;\n point1[1] += epsilon$4;\n v = visible(point1[0], point1[1]);\n }\n }\n if (v !== v0) {\n clean = 0;\n if (v) {\n // outside going in\n stream.lineStart();\n point2 = intersect(point1, point0);\n stream.point(point2[0], point2[1]);\n } else {\n // inside going out\n point2 = intersect(point0, point1);\n stream.point(point2[0], point2[1]);\n stream.lineEnd();\n }\n point0 = point2;\n } else if (notHemisphere && point0 && smallRadius ^ v) {\n var t;\n // If the codes for two points are different, or are both zero,\n // and there this segment intersects with the small circle.\n if (!(c & c0) && (t = intersect(point1, point0, true))) {\n clean = 0;\n if (smallRadius) {\n stream.lineStart();\n stream.point(t[0][0], t[0][1]);\n stream.point(t[1][0], t[1][1]);\n stream.lineEnd();\n } else {\n stream.point(t[1][0], t[1][1]);\n stream.lineEnd();\n stream.lineStart();\n stream.point(t[0][0], t[0][1]);\n }\n }\n }\n if (v && (!point0 || !pointEqual(point0, point1))) {\n stream.point(point1[0], point1[1]);\n }\n point0 = point1, v0 = v, c0 = c;\n },\n lineEnd: function() {\n if (v0) stream.lineEnd();\n point0 = null;\n },\n // Rejoin first and last segments if there were intersections and the first\n // and last points were visible.\n clean: function() {\n return clean | ((v00 && v0) << 1);\n }\n };\n }", "function clipLine(stream) {\n var point0, // previous point\n c0, // code for previous point\n v0, // visibility of previous point\n v00, // visibility of first point\n clean; // no intersections\n return {\n lineStart: function() {\n v00 = v0 = false;\n clean = 1;\n },\n point: function(lambda, phi) {\n var point1 = [lambda, phi],\n point2,\n v = visible(lambda, phi),\n c = smallRadius\n ? v ? 0 : code(lambda, phi)\n : v ? code(lambda + (lambda < 0 ? pi$1 : -pi$1), phi) : 0;\n if (!point0 && (v00 = v0 = v)) stream.lineStart();\n if (v !== v0) {\n point2 = intersect(point0, point1);\n if (!point2 || pointEqual(point0, point2) || pointEqual(point1, point2))\n point1[2] = 1;\n }\n if (v !== v0) {\n clean = 0;\n if (v) {\n // outside going in\n stream.lineStart();\n point2 = intersect(point1, point0);\n stream.point(point2[0], point2[1]);\n } else {\n // inside going out\n point2 = intersect(point0, point1);\n stream.point(point2[0], point2[1], 2);\n stream.lineEnd();\n }\n point0 = point2;\n } else if (notHemisphere && point0 && smallRadius ^ v) {\n var t;\n // If the codes for two points are different, or are both zero,\n // and there this segment intersects with the small circle.\n if (!(c & c0) && (t = intersect(point1, point0, true))) {\n clean = 0;\n if (smallRadius) {\n stream.lineStart();\n stream.point(t[0][0], t[0][1]);\n stream.point(t[1][0], t[1][1]);\n stream.lineEnd();\n } else {\n stream.point(t[1][0], t[1][1]);\n stream.lineEnd();\n stream.lineStart();\n stream.point(t[0][0], t[0][1], 3);\n }\n }\n }\n if (v && (!point0 || !pointEqual(point0, point1))) {\n stream.point(point1[0], point1[1]);\n }\n point0 = point1, v0 = v, c0 = c;\n },\n lineEnd: function() {\n if (v0) stream.lineEnd();\n point0 = null;\n },\n // Rejoin first and last segments if there were intersections and the first\n // and last points were visible.\n clean: function() {\n return clean | ((v00 && v0) << 1);\n }\n };\n }", "function clipLine(stream) {\n var point0, // previous point\n c0, // code for previous point\n v0, // visibility of previous point\n v00, // visibility of first point\n clean;\n // no intersections\n return {\n lineStart: function () {\n v00 = v0 = false;\n clean = 1;\n },\n point: function (lambda, phi) {\n var point1 = [lambda, phi], point2, v = visible(lambda, phi), c = smallRadius ? v ? 0 : code(lambda, phi) : v ? code(lambda + (lambda < 0 ? pi : -pi), phi) : 0;\n if (!point0 && (v00 = v0 = v)) stream.lineStart();\n if (v !== v0) {\n point2 = intersect(point0, point1);\n if (!point2 || pointEqual(point0, point2) || pointEqual(point1, point2)) point1[2] = 1;\n }\n if (v !== v0) {\n clean = 0;\n if (v) {\n // outside going in\n stream.lineStart();\n point2 = intersect(point1, point0);\n stream.point(point2[0], point2[1]);\n } else {\n // inside going out\n point2 = intersect(point0, point1);\n stream.point(point2[0], point2[1], 2);\n stream.lineEnd();\n }\n point0 = point2;\n } else if (notHemisphere && point0 && smallRadius ^ v) {\n var t;\n // If the codes for two points are different, or are both zero,\n // and there this segment intersects with the small circle.\n if (!(c & c0) && (t = intersect(point1, point0, true))) {\n clean = 0;\n if (smallRadius) {\n stream.lineStart();\n stream.point(t[0][0], t[0][1]);\n stream.point(t[1][0], t[1][1]);\n stream.lineEnd();\n } else {\n stream.point(t[1][0], t[1][1]);\n stream.lineEnd();\n stream.lineStart();\n stream.point(t[0][0], t[0][1], 3);\n }\n }\n }\n if (v && (!point0 || !pointEqual(point0, point1))) {\n stream.point(point1[0], point1[1]);\n }\n (point0 = point1, v0 = v, c0 = c);\n },\n lineEnd: function () {\n if (v0) stream.lineEnd();\n point0 = null;\n },\n // Rejoin first and last segments if there were intersections and the first\n // and last points were visible.\n clean: function () {\n return clean | (v00 && v0) << 1;\n }\n };\n }", "function clipLine(stream) {\n var point0, // previous point\n c0, // code for previous point\n v0, // visibility of previous point\n v00, // visibility of first point\n clean; // no intersections\n\n return {\n lineStart: function () {\n v00 = v0 = false;\n clean = 1;\n },\n point: function (lambda, phi) {\n var point1 = [lambda, phi],\n point2,\n v = visible(lambda, phi),\n c = smallRadius ? v ? 0 : code(lambda, phi) : v ? code(lambda + (lambda < 0 ? _math.pi : -_math.pi), phi) : 0;\n if (!point0 && (v00 = v0 = v)) stream.lineStart(); // Handle degeneracies.\n // TODO ignore if not clipping polygons.\n\n if (v !== v0) {\n point2 = intersect(point0, point1);\n\n if (!point2 || (0, _pointEqual.default)(point0, point2) || (0, _pointEqual.default)(point1, point2)) {\n point1[0] += _math.epsilon;\n point1[1] += _math.epsilon;\n v = visible(point1[0], point1[1]);\n }\n }\n\n if (v !== v0) {\n clean = 0;\n\n if (v) {\n // outside going in\n stream.lineStart();\n point2 = intersect(point1, point0);\n stream.point(point2[0], point2[1]);\n } else {\n // inside going out\n point2 = intersect(point0, point1);\n stream.point(point2[0], point2[1]);\n stream.lineEnd();\n }\n\n point0 = point2;\n } else if (notHemisphere && point0 && smallRadius ^ v) {\n var t; // If the codes for two points are different, or are both zero,\n // and there this segment intersects with the small circle.\n\n if (!(c & c0) && (t = intersect(point1, point0, true))) {\n clean = 0;\n\n if (smallRadius) {\n stream.lineStart();\n stream.point(t[0][0], t[0][1]);\n stream.point(t[1][0], t[1][1]);\n stream.lineEnd();\n } else {\n stream.point(t[1][0], t[1][1]);\n stream.lineEnd();\n stream.lineStart();\n stream.point(t[0][0], t[0][1]);\n }\n }\n }\n\n if (v && (!point0 || !(0, _pointEqual.default)(point0, point1))) {\n stream.point(point1[0], point1[1]);\n }\n\n point0 = point1, v0 = v, c0 = c;\n },\n lineEnd: function () {\n if (v0) stream.lineEnd();\n point0 = null;\n },\n // Rejoin first and last segments if there were intersections and the first\n // and last points were visible.\n clean: function () {\n return clean | (v00 && v0) << 1;\n }\n };\n } // Intersects the great circle between a and b with the clip circle.", "function clipLine(stream) {\n var point0, // previous point\n c0, // code for previous point\n v0, // visibility of previous point\n v00, // visibility of first point\n clean; // no intersections\n\n return {\n lineStart: function () {\n v00 = v0 = false;\n clean = 1;\n },\n point: function (lambda, phi) {\n var point1 = [lambda, phi],\n point2,\n v = visible(lambda, phi),\n c = smallRadius ? v ? 0 : code(lambda, phi) : v ? code(lambda + (lambda < 0 ? _math.pi : -_math.pi), phi) : 0;\n if (!point0 && (v00 = v0 = v)) stream.lineStart(); // Handle degeneracies.\n // TODO ignore if not clipping polygons.\n\n if (v !== v0) {\n point2 = intersect(point0, point1);\n\n if (!point2 || (0, _pointEqual.default)(point0, point2) || (0, _pointEqual.default)(point1, point2)) {\n point1[0] += _math.epsilon;\n point1[1] += _math.epsilon;\n v = visible(point1[0], point1[1]);\n }\n }\n\n if (v !== v0) {\n clean = 0;\n\n if (v) {\n // outside going in\n stream.lineStart();\n point2 = intersect(point1, point0);\n stream.point(point2[0], point2[1]);\n } else {\n // inside going out\n point2 = intersect(point0, point1);\n stream.point(point2[0], point2[1]);\n stream.lineEnd();\n }\n\n point0 = point2;\n } else if (notHemisphere && point0 && smallRadius ^ v) {\n var t; // If the codes for two points are different, or are both zero,\n // and there this segment intersects with the small circle.\n\n if (!(c & c0) && (t = intersect(point1, point0, true))) {\n clean = 0;\n\n if (smallRadius) {\n stream.lineStart();\n stream.point(t[0][0], t[0][1]);\n stream.point(t[1][0], t[1][1]);\n stream.lineEnd();\n } else {\n stream.point(t[1][0], t[1][1]);\n stream.lineEnd();\n stream.lineStart();\n stream.point(t[0][0], t[0][1]);\n }\n }\n }\n\n if (v && (!point0 || !(0, _pointEqual.default)(point0, point1))) {\n stream.point(point1[0], point1[1]);\n }\n\n point0 = point1, v0 = v, c0 = c;\n },\n lineEnd: function () {\n if (v0) stream.lineEnd();\n point0 = null;\n },\n // Rejoin first and last segments if there were intersections and the first\n // and last points were visible.\n clean: function () {\n return clean | (v00 && v0) << 1;\n }\n };\n } // Intersects the great circle between a and b with the clip circle.", "function clipLine(stream) {\n var point0, // previous point\n c0, // code for previous point\n v0, // visibility of previous point\n v00, // visibility of first point\n clean; // no intersections\n\n return {\n lineStart: function () {\n v00 = v0 = false;\n clean = 1;\n },\n point: function (lambda, phi) {\n var point1 = [lambda, phi],\n point2,\n v = visible(lambda, phi),\n c = smallRadius ? v ? 0 : code(lambda, phi) : v ? code(lambda + (lambda < 0 ? _math.pi : -_math.pi), phi) : 0;\n if (!point0 && (v00 = v0 = v)) stream.lineStart(); // Handle degeneracies.\n // TODO ignore if not clipping polygons.\n\n if (v !== v0) {\n point2 = intersect(point0, point1);\n\n if (!point2 || (0, _pointEqual.default)(point0, point2) || (0, _pointEqual.default)(point1, point2)) {\n point1[0] += _math.epsilon;\n point1[1] += _math.epsilon;\n v = visible(point1[0], point1[1]);\n }\n }\n\n if (v !== v0) {\n clean = 0;\n\n if (v) {\n // outside going in\n stream.lineStart();\n point2 = intersect(point1, point0);\n stream.point(point2[0], point2[1]);\n } else {\n // inside going out\n point2 = intersect(point0, point1);\n stream.point(point2[0], point2[1]);\n stream.lineEnd();\n }\n\n point0 = point2;\n } else if (notHemisphere && point0 && smallRadius ^ v) {\n var t; // If the codes for two points are different, or are both zero,\n // and there this segment intersects with the small circle.\n\n if (!(c & c0) && (t = intersect(point1, point0, true))) {\n clean = 0;\n\n if (smallRadius) {\n stream.lineStart();\n stream.point(t[0][0], t[0][1]);\n stream.point(t[1][0], t[1][1]);\n stream.lineEnd();\n } else {\n stream.point(t[1][0], t[1][1]);\n stream.lineEnd();\n stream.lineStart();\n stream.point(t[0][0], t[0][1]);\n }\n }\n }\n\n if (v && (!point0 || !(0, _pointEqual.default)(point0, point1))) {\n stream.point(point1[0], point1[1]);\n }\n\n point0 = point1, v0 = v, c0 = c;\n },\n lineEnd: function () {\n if (v0) stream.lineEnd();\n point0 = null;\n },\n // Rejoin first and last segments if there were intersections and the first\n // and last points were visible.\n clean: function () {\n return clean | (v00 && v0) << 1;\n }\n };\n } // Intersects the great circle between a and b with the clip circle.", "function clipLine(stream) {\n var point0, // previous point\n c0, // code for previous point\n v0, // visibility of previous point\n v00, // visibility of first point\n clean; // no intersections\n return {\n lineStart: function() {\n v00 = v0 = false;\n clean = 1;\n },\n point: function(lambda, phi) {\n var point1 = [lambda, phi],\n point2,\n v = visible(lambda, phi),\n c = smallRadius\n ? v ? 0 : code(lambda, phi)\n : v ? code(lambda + (lambda < 0 ? pi : -pi), phi) : 0;\n if (!point0 && (v00 = v0 = v)) stream.lineStart();\n // Handle degeneracies.\n // TODO ignore if not clipping polygons.\n if (v !== v0) {\n point2 = intersect(point0, point1);\n if (!point2 || pointEqual(point0, point2) || pointEqual(point1, point2)) {\n point1[0] += epsilon;\n point1[1] += epsilon;\n v = visible(point1[0], point1[1]);\n }\n }\n if (v !== v0) {\n clean = 0;\n if (v) {\n // outside going in\n stream.lineStart();\n point2 = intersect(point1, point0);\n stream.point(point2[0], point2[1]);\n } else {\n // inside going out\n point2 = intersect(point0, point1);\n stream.point(point2[0], point2[1]);\n stream.lineEnd();\n }\n point0 = point2;\n } else if (notHemisphere && point0 && smallRadius ^ v) {\n var t;\n // If the codes for two points are different, or are both zero,\n // and there this segment intersects with the small circle.\n if (!(c & c0) && (t = intersect(point1, point0, true))) {\n clean = 0;\n if (smallRadius) {\n stream.lineStart();\n stream.point(t[0][0], t[0][1]);\n stream.point(t[1][0], t[1][1]);\n stream.lineEnd();\n } else {\n stream.point(t[1][0], t[1][1]);\n stream.lineEnd();\n stream.lineStart();\n stream.point(t[0][0], t[0][1]);\n }\n }\n }\n if (v && (!point0 || !pointEqual(point0, point1))) {\n stream.point(point1[0], point1[1]);\n }\n point0 = point1, v0 = v, c0 = c;\n },\n lineEnd: function() {\n if (v0) stream.lineEnd();\n point0 = null;\n },\n // Rejoin first and last segments if there were intersections and the first\n // and last points were visible.\n clean: function() {\n return clean | ((v00 && v0) << 1);\n }\n };\n }", "function clipLine(stream) {\n var point0, // previous point\n c0, // code for previous point\n v0, // visibility of previous point\n v00, // visibility of first point\n clean; // no intersections\n return {\n lineStart: function() {\n v00 = v0 = false;\n clean = 1;\n },\n point: function(lambda, phi) {\n var point1 = [lambda, phi],\n point2,\n v = visible(lambda, phi),\n c = smallRadius\n ? v ? 0 : code(lambda, phi)\n : v ? code(lambda + (lambda < 0 ? pi : -pi), phi) : 0;\n if (!point0 && (v00 = v0 = v)) stream.lineStart();\n // Handle degeneracies.\n // TODO ignore if not clipping polygons.\n if (v !== v0) {\n point2 = intersect(point0, point1);\n if (!point2 || pointEqual(point0, point2) || pointEqual(point1, point2)) {\n point1[0] += epsilon;\n point1[1] += epsilon;\n v = visible(point1[0], point1[1]);\n }\n }\n if (v !== v0) {\n clean = 0;\n if (v) {\n // outside going in\n stream.lineStart();\n point2 = intersect(point1, point0);\n stream.point(point2[0], point2[1]);\n } else {\n // inside going out\n point2 = intersect(point0, point1);\n stream.point(point2[0], point2[1]);\n stream.lineEnd();\n }\n point0 = point2;\n } else if (notHemisphere && point0 && smallRadius ^ v) {\n var t;\n // If the codes for two points are different, or are both zero,\n // and there this segment intersects with the small circle.\n if (!(c & c0) && (t = intersect(point1, point0, true))) {\n clean = 0;\n if (smallRadius) {\n stream.lineStart();\n stream.point(t[0][0], t[0][1]);\n stream.point(t[1][0], t[1][1]);\n stream.lineEnd();\n } else {\n stream.point(t[1][0], t[1][1]);\n stream.lineEnd();\n stream.lineStart();\n stream.point(t[0][0], t[0][1]);\n }\n }\n }\n if (v && (!point0 || !pointEqual(point0, point1))) {\n stream.point(point1[0], point1[1]);\n }\n point0 = point1, v0 = v, c0 = c;\n },\n lineEnd: function() {\n if (v0) stream.lineEnd();\n point0 = null;\n },\n // Rejoin first and last segments if there were intersections and the first\n // and last points were visible.\n clean: function() {\n return clean | ((v00 && v0) << 1);\n }\n };\n }", "function clipLine(stream) {\n var point0, // previous point\n c0, // code for previous point\n v0, // visibility of previous point\n v00, // visibility of first point\n clean; // no intersections\n return {\n lineStart: function() {\n v00 = v0 = false;\n clean = 1;\n },\n point: function(lambda, phi) {\n var point1 = [lambda, phi],\n point2,\n v = visible(lambda, phi),\n c = smallRadius\n ? v ? 0 : code(lambda, phi)\n : v ? code(lambda + (lambda < 0 ? pi : -pi), phi) : 0;\n if (!point0 && (v00 = v0 = v)) stream.lineStart();\n // Handle degeneracies.\n // TODO ignore if not clipping polygons.\n if (v !== v0) {\n point2 = intersect(point0, point1);\n if (!point2 || pointEqual(point0, point2) || pointEqual(point1, point2)) {\n point1[0] += epsilon;\n point1[1] += epsilon;\n v = visible(point1[0], point1[1]);\n }\n }\n if (v !== v0) {\n clean = 0;\n if (v) {\n // outside going in\n stream.lineStart();\n point2 = intersect(point1, point0);\n stream.point(point2[0], point2[1]);\n } else {\n // inside going out\n point2 = intersect(point0, point1);\n stream.point(point2[0], point2[1]);\n stream.lineEnd();\n }\n point0 = point2;\n } else if (notHemisphere && point0 && smallRadius ^ v) {\n var t;\n // If the codes for two points are different, or are both zero,\n // and there this segment intersects with the small circle.\n if (!(c & c0) && (t = intersect(point1, point0, true))) {\n clean = 0;\n if (smallRadius) {\n stream.lineStart();\n stream.point(t[0][0], t[0][1]);\n stream.point(t[1][0], t[1][1]);\n stream.lineEnd();\n } else {\n stream.point(t[1][0], t[1][1]);\n stream.lineEnd();\n stream.lineStart();\n stream.point(t[0][0], t[0][1]);\n }\n }\n }\n if (v && (!point0 || !pointEqual(point0, point1))) {\n stream.point(point1[0], point1[1]);\n }\n point0 = point1, v0 = v, c0 = c;\n },\n lineEnd: function() {\n if (v0) stream.lineEnd();\n point0 = null;\n },\n // Rejoin first and last segments if there were intersections and the first\n // and last points were visible.\n clean: function() {\n return clean | ((v00 && v0) << 1);\n }\n };\n }", "function clipLine(stream) {\n var point0, // previous point\n c0, // code for previous point\n v0, // visibility of previous point\n v00, // visibility of first point\n clean; // no intersections\n return {\n lineStart: function() {\n v00 = v0 = false;\n clean = 1;\n },\n point: function(lambda, phi) {\n var point1 = [lambda, phi],\n point2,\n v = visible(lambda, phi),\n c = smallRadius\n ? v ? 0 : code(lambda, phi)\n : v ? code(lambda + (lambda < 0 ? pi : -pi), phi) : 0;\n if (!point0 && (v00 = v0 = v)) stream.lineStart();\n // Handle degeneracies.\n // TODO ignore if not clipping polygons.\n if (v !== v0) {\n point2 = intersect(point0, point1);\n if (!point2 || pointEqual(point0, point2) || pointEqual(point1, point2)) {\n point1[0] += epsilon;\n point1[1] += epsilon;\n v = visible(point1[0], point1[1]);\n }\n }\n if (v !== v0) {\n clean = 0;\n if (v) {\n // outside going in\n stream.lineStart();\n point2 = intersect(point1, point0);\n stream.point(point2[0], point2[1]);\n } else {\n // inside going out\n point2 = intersect(point0, point1);\n stream.point(point2[0], point2[1]);\n stream.lineEnd();\n }\n point0 = point2;\n } else if (notHemisphere && point0 && smallRadius ^ v) {\n var t;\n // If the codes for two points are different, or are both zero,\n // and there this segment intersects with the small circle.\n if (!(c & c0) && (t = intersect(point1, point0, true))) {\n clean = 0;\n if (smallRadius) {\n stream.lineStart();\n stream.point(t[0][0], t[0][1]);\n stream.point(t[1][0], t[1][1]);\n stream.lineEnd();\n } else {\n stream.point(t[1][0], t[1][1]);\n stream.lineEnd();\n stream.lineStart();\n stream.point(t[0][0], t[0][1]);\n }\n }\n }\n if (v && (!point0 || !pointEqual(point0, point1))) {\n stream.point(point1[0], point1[1]);\n }\n point0 = point1, v0 = v, c0 = c;\n },\n lineEnd: function() {\n if (v0) stream.lineEnd();\n point0 = null;\n },\n // Rejoin first and last segments if there were intersections and the first\n // and last points were visible.\n clean: function() {\n return clean | ((v00 && v0) << 1);\n }\n };\n }", "function clipLine(stream) {\n var point0, // previous point\n c0, // code for previous point\n v0, // visibility of previous point\n v00, // visibility of first point\n clean; // no intersections\n return {\n lineStart: function() {\n v00 = v0 = false;\n clean = 1;\n },\n point: function(lambda, phi) {\n var point1 = [lambda, phi],\n point2,\n v = visible(lambda, phi),\n c = smallRadius\n ? v ? 0 : code(lambda, phi)\n : v ? code(lambda + (lambda < 0 ? pi : -pi), phi) : 0;\n if (!point0 && (v00 = v0 = v)) stream.lineStart();\n // Handle degeneracies.\n // TODO ignore if not clipping polygons.\n if (v !== v0) {\n point2 = intersect(point0, point1);\n if (!point2 || pointEqual(point0, point2) || pointEqual(point1, point2)) {\n point1[0] += epsilon;\n point1[1] += epsilon;\n v = visible(point1[0], point1[1]);\n }\n }\n if (v !== v0) {\n clean = 0;\n if (v) {\n // outside going in\n stream.lineStart();\n point2 = intersect(point1, point0);\n stream.point(point2[0], point2[1]);\n } else {\n // inside going out\n point2 = intersect(point0, point1);\n stream.point(point2[0], point2[1]);\n stream.lineEnd();\n }\n point0 = point2;\n } else if (notHemisphere && point0 && smallRadius ^ v) {\n var t;\n // If the codes for two points are different, or are both zero,\n // and there this segment intersects with the small circle.\n if (!(c & c0) && (t = intersect(point1, point0, true))) {\n clean = 0;\n if (smallRadius) {\n stream.lineStart();\n stream.point(t[0][0], t[0][1]);\n stream.point(t[1][0], t[1][1]);\n stream.lineEnd();\n } else {\n stream.point(t[1][0], t[1][1]);\n stream.lineEnd();\n stream.lineStart();\n stream.point(t[0][0], t[0][1]);\n }\n }\n }\n if (v && (!point0 || !pointEqual(point0, point1))) {\n stream.point(point1[0], point1[1]);\n }\n point0 = point1, v0 = v, c0 = c;\n },\n lineEnd: function() {\n if (v0) stream.lineEnd();\n point0 = null;\n },\n // Rejoin first and last segments if there were intersections and the first\n // and last points were visible.\n clean: function() {\n return clean | ((v00 && v0) << 1);\n }\n };\n }", "function clipLine(stream) {\n var point0, // previous point\n c0, // code for previous point\n v0, // visibility of previous point\n v00, // visibility of first point\n clean; // no intersections\n return {\n lineStart: function() {\n v00 = v0 = false;\n clean = 1;\n },\n point: function(lambda, phi) {\n var point1 = [lambda, phi],\n point2,\n v = visible(lambda, phi),\n c = smallRadius\n ? v ? 0 : code(lambda, phi)\n : v ? code(lambda + (lambda < 0 ? pi : -pi), phi) : 0;\n if (!point0 && (v00 = v0 = v)) stream.lineStart();\n // Handle degeneracies.\n // TODO ignore if not clipping polygons.\n if (v !== v0) {\n point2 = intersect(point0, point1);\n if (!point2 || pointEqual(point0, point2) || pointEqual(point1, point2)) {\n point1[0] += epsilon;\n point1[1] += epsilon;\n v = visible(point1[0], point1[1]);\n }\n }\n if (v !== v0) {\n clean = 0;\n if (v) {\n // outside going in\n stream.lineStart();\n point2 = intersect(point1, point0);\n stream.point(point2[0], point2[1]);\n } else {\n // inside going out\n point2 = intersect(point0, point1);\n stream.point(point2[0], point2[1]);\n stream.lineEnd();\n }\n point0 = point2;\n } else if (notHemisphere && point0 && smallRadius ^ v) {\n var t;\n // If the codes for two points are different, or are both zero,\n // and there this segment intersects with the small circle.\n if (!(c & c0) && (t = intersect(point1, point0, true))) {\n clean = 0;\n if (smallRadius) {\n stream.lineStart();\n stream.point(t[0][0], t[0][1]);\n stream.point(t[1][0], t[1][1]);\n stream.lineEnd();\n } else {\n stream.point(t[1][0], t[1][1]);\n stream.lineEnd();\n stream.lineStart();\n stream.point(t[0][0], t[0][1]);\n }\n }\n }\n if (v && (!point0 || !pointEqual(point0, point1))) {\n stream.point(point1[0], point1[1]);\n }\n point0 = point1, v0 = v, c0 = c;\n },\n lineEnd: function() {\n if (v0) stream.lineEnd();\n point0 = null;\n },\n // Rejoin first and last segments if there were intersections and the first\n // and last points were visible.\n clean: function() {\n return clean | ((v00 && v0) << 1);\n }\n };\n }", "function drawLine(pointsArray, scene, isClosed, color) {\n\n\tlet material;\n\tlet line;\n\tlet geometry = new THREE.BufferGeometry().setFromPoints(pointsArray);\n\n\tif (color == undefined) {\n\t\tmaterial = new THREE.LineBasicMaterial({color: 0x000000});\n\t} else {\n\t\tmaterial = new THREE.LineBasicMaterial({color: color});\n\t};\n\n\tif (isClosed == undefined) {isClosed = false};\n\n\n\tif (isClosed == false) {\n\n\t\tline = new THREE.Line(geometry, material);\n\t\tscene.add(line);\n\t};\n\n\n\tif (isClosed == true) {\n\n\t\tline = new THREE.LineLoop(geometry, material);\n\t\tscene.add(line);\n\t};\n\t\n\treturn line;\n\n}", "function smooth() {\n let change = 0.5;\n let changedPoints = 1;\n while (change / changedPoints >= 0.01) {\n change = 0;\n changedPoints = 0;\n\n let newPoints = [...points];\n\n for (let i = 1; i < points.length - 1; i++) {\n let point = points[i];\n\n let middle = new Vector(points[i + 1].subtract(points[i - 1]));\n\n middle = new Vector(points[i - 1].add(middle.normalize().scale(middle.magnitude / 2)));\n\n let delta = new Vector(middle.subtract(point));\n\n let newPoint = point.add(delta.normalize().scale(delta.magnitude * fSmoothing));\n\n if (!isNaN(newPoint.x) && !isNaN(newPoint.y)) {\n newPoints[i] = newPoint;\n change += point.distance(newPoint);\n changedPoints++;\n }\n }\n\n points = newPoints;\n }\n}", "function clipLine(stream) {\n var point0, // previous point\n c0, // code for previous point\n v0, // visibility of previous point\n v00, // visibility of first point\n clean; // no intersections\n return {\n lineStart: function() {\n v00 = v0 = false;\n clean = 1;\n },\n point: function(lambda, phi) {\n var point1 = [lambda, phi],\n point2,\n v = visible(lambda, phi),\n c = smallRadius\n ? v ? 0 : code(lambda, phi)\n : v ? code(lambda + (lambda < 0 ? pi$3 : -pi$3), phi) : 0;\n if (!point0 && (v00 = v0 = v)) stream.lineStart();\n // Handle degeneracies.\n // TODO ignore if not clipping polygons.\n if (v !== v0) {\n point2 = intersect(point0, point1);\n if (!point2 || pointEqual(point0, point2) || pointEqual(point1, point2)) {\n point1[0] += epsilon$2;\n point1[1] += epsilon$2;\n v = visible(point1[0], point1[1]);\n }\n }\n if (v !== v0) {\n clean = 0;\n if (v) {\n // outside going in\n stream.lineStart();\n point2 = intersect(point1, point0);\n stream.point(point2[0], point2[1]);\n } else {\n // inside going out\n point2 = intersect(point0, point1);\n stream.point(point2[0], point2[1]);\n stream.lineEnd();\n }\n point0 = point2;\n } else if (notHemisphere && point0 && smallRadius ^ v) {\n var t;\n // If the codes for two points are different, or are both zero,\n // and there this segment intersects with the small circle.\n if (!(c & c0) && (t = intersect(point1, point0, true))) {\n clean = 0;\n if (smallRadius) {\n stream.lineStart();\n stream.point(t[0][0], t[0][1]);\n stream.point(t[1][0], t[1][1]);\n stream.lineEnd();\n } else {\n stream.point(t[1][0], t[1][1]);\n stream.lineEnd();\n stream.lineStart();\n stream.point(t[0][0], t[0][1]);\n }\n }\n }\n if (v && (!point0 || !pointEqual(point0, point1))) {\n stream.point(point1[0], point1[1]);\n }\n point0 = point1, v0 = v, c0 = c;\n },\n lineEnd: function() {\n if (v0) stream.lineEnd();\n point0 = null;\n },\n // Rejoin first and last segments if there were intersections and the first\n // and last points were visible.\n clean: function() {\n return clean | ((v00 && v0) << 1);\n }\n };\n }", "function clipLine(stream) {\n var point0, // previous point\n c0, // code for previous point\n v0, // visibility of previous point\n v00, // visibility of first point\n clean; // no intersections\n return {\n lineStart: function() {\n v00 = v0 = false;\n clean = 1;\n },\n point: function(lambda, phi) {\n var point1 = [lambda, phi],\n point2,\n v = visible(lambda, phi),\n c = smallRadius\n ? v ? 0 : code(lambda, phi)\n : v ? code(lambda + (lambda < 0 ? pi$3 : -pi$3), phi) : 0;\n if (!point0 && (v00 = v0 = v)) stream.lineStart();\n // Handle degeneracies.\n // TODO ignore if not clipping polygons.\n if (v !== v0) {\n point2 = intersect(point0, point1);\n if (!point2 || pointEqual(point0, point2) || pointEqual(point1, point2)) {\n point1[0] += epsilon$2;\n point1[1] += epsilon$2;\n v = visible(point1[0], point1[1]);\n }\n }\n if (v !== v0) {\n clean = 0;\n if (v) {\n // outside going in\n stream.lineStart();\n point2 = intersect(point1, point0);\n stream.point(point2[0], point2[1]);\n } else {\n // inside going out\n point2 = intersect(point0, point1);\n stream.point(point2[0], point2[1]);\n stream.lineEnd();\n }\n point0 = point2;\n } else if (notHemisphere && point0 && smallRadius ^ v) {\n var t;\n // If the codes for two points are different, or are both zero,\n // and there this segment intersects with the small circle.\n if (!(c & c0) && (t = intersect(point1, point0, true))) {\n clean = 0;\n if (smallRadius) {\n stream.lineStart();\n stream.point(t[0][0], t[0][1]);\n stream.point(t[1][0], t[1][1]);\n stream.lineEnd();\n } else {\n stream.point(t[1][0], t[1][1]);\n stream.lineEnd();\n stream.lineStart();\n stream.point(t[0][0], t[0][1]);\n }\n }\n }\n if (v && (!point0 || !pointEqual(point0, point1))) {\n stream.point(point1[0], point1[1]);\n }\n point0 = point1, v0 = v, c0 = c;\n },\n lineEnd: function() {\n if (v0) stream.lineEnd();\n point0 = null;\n },\n // Rejoin first and last segments if there were intersections and the first\n // and last points were visible.\n clean: function() {\n return clean | ((v00 && v0) << 1);\n }\n };\n }", "function clipLine(stream) {\n var point0, // previous point\n c0, // code for previous point\n v0, // visibility of previous point\n v00, // visibility of first point\n clean; // no intersections\n return {\n lineStart: function() {\n v00 = v0 = false;\n clean = 1;\n },\n point: function(lambda, phi) {\n var point1 = [lambda, phi],\n point2,\n v = visible(lambda, phi),\n c = smallRadius\n ? v ? 0 : code(lambda, phi)\n : v ? code(lambda + (lambda < 0 ? pi$3 : -pi$3), phi) : 0;\n if (!point0 && (v00 = v0 = v)) stream.lineStart();\n // Handle degeneracies.\n // TODO ignore if not clipping polygons.\n if (v !== v0) {\n point2 = intersect(point0, point1);\n if (!point2 || pointEqual(point0, point2) || pointEqual(point1, point2)) {\n point1[0] += epsilon$2;\n point1[1] += epsilon$2;\n v = visible(point1[0], point1[1]);\n }\n }\n if (v !== v0) {\n clean = 0;\n if (v) {\n // outside going in\n stream.lineStart();\n point2 = intersect(point1, point0);\n stream.point(point2[0], point2[1]);\n } else {\n // inside going out\n point2 = intersect(point0, point1);\n stream.point(point2[0], point2[1]);\n stream.lineEnd();\n }\n point0 = point2;\n } else if (notHemisphere && point0 && smallRadius ^ v) {\n var t;\n // If the codes for two points are different, or are both zero,\n // and there this segment intersects with the small circle.\n if (!(c & c0) && (t = intersect(point1, point0, true))) {\n clean = 0;\n if (smallRadius) {\n stream.lineStart();\n stream.point(t[0][0], t[0][1]);\n stream.point(t[1][0], t[1][1]);\n stream.lineEnd();\n } else {\n stream.point(t[1][0], t[1][1]);\n stream.lineEnd();\n stream.lineStart();\n stream.point(t[0][0], t[0][1]);\n }\n }\n }\n if (v && (!point0 || !pointEqual(point0, point1))) {\n stream.point(point1[0], point1[1]);\n }\n point0 = point1, v0 = v, c0 = c;\n },\n lineEnd: function() {\n if (v0) stream.lineEnd();\n point0 = null;\n },\n // Rejoin first and last segments if there were intersections and the first\n // and last points were visible.\n clean: function() {\n return clean | ((v00 && v0) << 1);\n }\n };\n }", "function clipLine(stream) {\n var point0, // previous point\n c0, // code for previous point\n v0, // visibility of previous point\n v00, // visibility of first point\n clean; // no intersections\n return {\n lineStart: function() {\n v00 = v0 = false;\n clean = 1;\n },\n point: function(lambda, phi) {\n var point1 = [lambda, phi],\n point2,\n v = visible(lambda, phi),\n c = smallRadius\n ? v ? 0 : code(lambda, phi)\n : v ? code(lambda + (lambda < 0 ? pi$3 : -pi$3), phi) : 0;\n if (!point0 && (v00 = v0 = v)) stream.lineStart();\n // Handle degeneracies.\n // TODO ignore if not clipping polygons.\n if (v !== v0) {\n point2 = intersect(point0, point1);\n if (!point2 || pointEqual(point0, point2) || pointEqual(point1, point2)) {\n point1[0] += epsilon$2;\n point1[1] += epsilon$2;\n v = visible(point1[0], point1[1]);\n }\n }\n if (v !== v0) {\n clean = 0;\n if (v) {\n // outside going in\n stream.lineStart();\n point2 = intersect(point1, point0);\n stream.point(point2[0], point2[1]);\n } else {\n // inside going out\n point2 = intersect(point0, point1);\n stream.point(point2[0], point2[1]);\n stream.lineEnd();\n }\n point0 = point2;\n } else if (notHemisphere && point0 && smallRadius ^ v) {\n var t;\n // If the codes for two points are different, or are both zero,\n // and there this segment intersects with the small circle.\n if (!(c & c0) && (t = intersect(point1, point0, true))) {\n clean = 0;\n if (smallRadius) {\n stream.lineStart();\n stream.point(t[0][0], t[0][1]);\n stream.point(t[1][0], t[1][1]);\n stream.lineEnd();\n } else {\n stream.point(t[1][0], t[1][1]);\n stream.lineEnd();\n stream.lineStart();\n stream.point(t[0][0], t[0][1]);\n }\n }\n }\n if (v && (!point0 || !pointEqual(point0, point1))) {\n stream.point(point1[0], point1[1]);\n }\n point0 = point1, v0 = v, c0 = c;\n },\n lineEnd: function() {\n if (v0) stream.lineEnd();\n point0 = null;\n },\n // Rejoin first and last segments if there were intersections and the first\n // and last points were visible.\n clean: function() {\n return clean | ((v00 && v0) << 1);\n }\n };\n }", "function clipLine(stream){var point0,// previous point\nc0,// code for previous point\nv0,// visibility of previous point\nv00,// visibility of first point\nclean;// no intersections\nreturn{lineStart:function(){v00=v0=false;clean=1},point:function(lambda,phi){var point1=[lambda,phi],point2,v=visible(lambda,phi),c=smallRadius?v?0:code(lambda,phi):v?code(lambda+(lambda<0?pi:-pi),phi):0;if(!point0&&(v00=v0=v))stream.lineStart();\n// Handle degeneracies.\n// TODO ignore if not clipping polygons.\nif(v!==v0){point2=intersect(point0,point1);if(!point2||pointEqual(point0,point2)||pointEqual(point1,point2)){point1[0]+=epsilon;point1[1]+=epsilon;v=visible(point1[0],point1[1])}}if(v!==v0){clean=0;if(v){\n// outside going in\nstream.lineStart();point2=intersect(point1,point0);stream.point(point2[0],point2[1])}else{\n// inside going out\npoint2=intersect(point0,point1);stream.point(point2[0],point2[1]);stream.lineEnd()}point0=point2}else if(notHemisphere&&point0&&smallRadius^v){var t;\n// If the codes for two points are different, or are both zero,\n// and there this segment intersects with the small circle.\nif(!(c&c0)&&(t=intersect(point1,point0,true))){clean=0;if(smallRadius){stream.lineStart();stream.point(t[0][0],t[0][1]);stream.point(t[1][0],t[1][1]);stream.lineEnd()}else{stream.point(t[1][0],t[1][1]);stream.lineEnd();stream.lineStart();stream.point(t[0][0],t[0][1])}}}if(v&&(!point0||!pointEqual(point0,point1))){stream.point(point1[0],point1[1])}point0=point1,v0=v,c0=c},lineEnd:function(){if(v0)stream.lineEnd();point0=null},\n// Rejoin first and last segments if there were intersections and the first\n// and last points were visible.\nclean:function(){return clean|(v00&&v0)<<1}}}", "function clipLine(stream) {\n var point0, // previous point\n c0, // code for previous point\n v0, // visibility of previous point\n v00, // visibility of first point\n clean; // no intersections\n\n return {\n lineStart: function () {\n v00 = v0 = false;\n clean = 1;\n },\n point: function (lambda, phi) {\n var point1 = [lambda, phi],\n point2,\n v = visible(lambda, phi),\n c = smallRadius ? v ? 0 : code(lambda, phi) : v ? code(lambda + (lambda < 0 ? _math__WEBPACK_IMPORTED_MODULE_2__[\"pi\"] : -_math__WEBPACK_IMPORTED_MODULE_2__[\"pi\"]), phi) : 0;\n if (!point0 && (v00 = v0 = v)) stream.lineStart(); // Handle degeneracies.\n // TODO ignore if not clipping polygons.\n\n if (v !== v0) {\n point2 = intersect(point0, point1);\n\n if (!point2 || Object(_pointEqual__WEBPACK_IMPORTED_MODULE_3__[\"default\"])(point0, point2) || Object(_pointEqual__WEBPACK_IMPORTED_MODULE_3__[\"default\"])(point1, point2)) {\n point1[0] += _math__WEBPACK_IMPORTED_MODULE_2__[\"epsilon\"];\n point1[1] += _math__WEBPACK_IMPORTED_MODULE_2__[\"epsilon\"];\n v = visible(point1[0], point1[1]);\n }\n }\n\n if (v !== v0) {\n clean = 0;\n\n if (v) {\n // outside going in\n stream.lineStart();\n point2 = intersect(point1, point0);\n stream.point(point2[0], point2[1]);\n } else {\n // inside going out\n point2 = intersect(point0, point1);\n stream.point(point2[0], point2[1]);\n stream.lineEnd();\n }\n\n point0 = point2;\n } else if (notHemisphere && point0 && smallRadius ^ v) {\n var t; // If the codes for two points are different, or are both zero,\n // and there this segment intersects with the small circle.\n\n if (!(c & c0) && (t = intersect(point1, point0, true))) {\n clean = 0;\n\n if (smallRadius) {\n stream.lineStart();\n stream.point(t[0][0], t[0][1]);\n stream.point(t[1][0], t[1][1]);\n stream.lineEnd();\n } else {\n stream.point(t[1][0], t[1][1]);\n stream.lineEnd();\n stream.lineStart();\n stream.point(t[0][0], t[0][1]);\n }\n }\n }\n\n if (v && (!point0 || !Object(_pointEqual__WEBPACK_IMPORTED_MODULE_3__[\"default\"])(point0, point1))) {\n stream.point(point1[0], point1[1]);\n }\n\n point0 = point1, v0 = v, c0 = c;\n },\n lineEnd: function () {\n if (v0) stream.lineEnd();\n point0 = null;\n },\n // Rejoin first and last segments if there were intersections and the first\n // and last points were visible.\n clean: function () {\n return clean | (v00 && v0) << 1;\n }\n };\n } // Intersects the great circle between a and b with the clip circle.", "function clipLine(stream) {\n var point0, // previous point\n c0, // code for previous point\n v0, // visibility of previous point\n v00, // visibility of first point\n clean; // no intersections\n\n return {\n lineStart: function () {\n v00 = v0 = false;\n clean = 1;\n },\n point: function (lambda, phi) {\n var point1 = [lambda, phi],\n point2,\n v = visible(lambda, phi),\n c = smallRadius ? v ? 0 : code(lambda, phi) : v ? code(lambda + (lambda < 0 ? _math.pi : -_math.pi), phi) : 0;\n if (!point0 && (v00 = v0 = v)) stream.lineStart();\n\n if (v !== v0) {\n point2 = intersect(point0, point1);\n if (!point2 || (0, _pointEqual.default)(point0, point2) || (0, _pointEqual.default)(point1, point2)) point1[2] = 1;\n }\n\n if (v !== v0) {\n clean = 0;\n\n if (v) {\n // outside going in\n stream.lineStart();\n point2 = intersect(point1, point0);\n stream.point(point2[0], point2[1]);\n } else {\n // inside going out\n point2 = intersect(point0, point1);\n stream.point(point2[0], point2[1], 2);\n stream.lineEnd();\n }\n\n point0 = point2;\n } else if (notHemisphere && point0 && smallRadius ^ v) {\n var t; // If the codes for two points are different, or are both zero,\n // and there this segment intersects with the small circle.\n\n if (!(c & c0) && (t = intersect(point1, point0, true))) {\n clean = 0;\n\n if (smallRadius) {\n stream.lineStart();\n stream.point(t[0][0], t[0][1]);\n stream.point(t[1][0], t[1][1]);\n stream.lineEnd();\n } else {\n stream.point(t[1][0], t[1][1]);\n stream.lineEnd();\n stream.lineStart();\n stream.point(t[0][0], t[0][1], 3);\n }\n }\n }\n\n if (v && (!point0 || !(0, _pointEqual.default)(point0, point1))) {\n stream.point(point1[0], point1[1]);\n }\n\n point0 = point1, v0 = v, c0 = c;\n },\n lineEnd: function () {\n if (v0) stream.lineEnd();\n point0 = null;\n },\n // Rejoin first and last segments if there were intersections and the first\n // and last points were visible.\n clean: function () {\n return clean | (v00 && v0) << 1;\n }\n };\n } // Intersects the great circle between a and b with the clip circle.", "function drawSnowf(obj) {\n for (i = 0; i < obj.xArray.length; i++) {\n if (i !== obj.xArray.length - 1) {\n drawLine(contextSnowf, [obj.xArray[i],\n obj.yArray[i]],\n [obj.xArray[i+1],\n obj.yArray[i+1]]);\n }\n else {\n drawLine(contextSnowf, [obj.xArray[i] + OFFSET[0],\n obj.yArray[i] + OFFSET[1]],\n [obj.xArray[0] + OFFSET[0],\n obj.yArray[0] + OFFSET[1]]);\n }\n }\n}", "function clipLine(stream) {\n\t var point0, // previous point\n\t c0, // code for previous point\n\t v0, // visibility of previous point\n\t v00, // visibility of first point\n\t _clean2; // no intersections\n\t return {\n\t lineStart: function lineStart() {\n\t v00 = v0 = false;\n\t _clean2 = 1;\n\t },\n\t point: function point(lambda, phi) {\n\t var point1 = [lambda, phi],\n\t point2,\n\t v = visible(lambda, phi),\n\t c = smallRadius ? v ? 0 : code(lambda, phi) : v ? code(lambda + (lambda < 0 ? pi : -pi), phi) : 0;\n\t if (!point0 && (v00 = v0 = v)) stream.lineStart();\n\t // Handle degeneracies.\n\t // TODO ignore if not clipping polygons.\n\t if (v !== v0) {\n\t point2 = intersect(point0, point1);\n\t if (!point2 || pointEqual(point0, point2) || pointEqual(point1, point2)) {\n\t point1[0] += epsilon;\n\t point1[1] += epsilon;\n\t v = visible(point1[0], point1[1]);\n\t }\n\t }\n\t if (v !== v0) {\n\t _clean2 = 0;\n\t if (v) {\n\t // outside going in\n\t stream.lineStart();\n\t point2 = intersect(point1, point0);\n\t stream.point(point2[0], point2[1]);\n\t } else {\n\t // inside going out\n\t point2 = intersect(point0, point1);\n\t stream.point(point2[0], point2[1]);\n\t stream.lineEnd();\n\t }\n\t point0 = point2;\n\t } else if (notHemisphere && point0 && smallRadius ^ v) {\n\t var t;\n\t // If the codes for two points are different, or are both zero,\n\t // and there this segment intersects with the small circle.\n\t if (!(c & c0) && (t = intersect(point1, point0, true))) {\n\t _clean2 = 0;\n\t if (smallRadius) {\n\t stream.lineStart();\n\t stream.point(t[0][0], t[0][1]);\n\t stream.point(t[1][0], t[1][1]);\n\t stream.lineEnd();\n\t } else {\n\t stream.point(t[1][0], t[1][1]);\n\t stream.lineEnd();\n\t stream.lineStart();\n\t stream.point(t[0][0], t[0][1]);\n\t }\n\t }\n\t }\n\t if (v && (!point0 || !pointEqual(point0, point1))) {\n\t stream.point(point1[0], point1[1]);\n\t }\n\t point0 = point1, v0 = v, c0 = c;\n\t },\n\t lineEnd: function lineEnd() {\n\t if (v0) stream.lineEnd();\n\t point0 = null;\n\t },\n\t // Rejoin first and last segments if there were intersections and the first\n\t // and last points were visible.\n\t clean: function clean() {\n\t return _clean2 | (v00 && v0) << 1;\n\t }\n\t };\n\t }", "function clipLine(stream) {\n var point0, // previous point\n c0, // code for previous point\n v0, // visibility of previous point\n v00, // visibility of first point\n clean; // no intersections\n return {\n lineStart: function() {\n v00 = v0 = false;\n clean = 1;\n },\n point: function(lambda, phi) {\n var point1 = [lambda, phi],\n point2,\n v = visible(lambda, phi),\n c = smallRadius\n ? v ? 0 : code(lambda, phi)\n : v ? code(lambda + (lambda < 0 ? math_pi : -math_pi), phi) : 0;\n if (!point0 && (v00 = v0 = v)) stream.lineStart();\n if (v !== v0) {\n point2 = intersect(point0, point1);\n if (!point2 || pointEqual(point0, point2) || pointEqual(point1, point2))\n point1[2] = 1;\n }\n if (v !== v0) {\n clean = 0;\n if (v) {\n // outside going in\n stream.lineStart();\n point2 = intersect(point1, point0);\n stream.point(point2[0], point2[1]);\n } else {\n // inside going out\n point2 = intersect(point0, point1);\n stream.point(point2[0], point2[1], 2);\n stream.lineEnd();\n }\n point0 = point2;\n } else if (notHemisphere && point0 && smallRadius ^ v) {\n var t;\n // If the codes for two points are different, or are both zero,\n // and there this segment intersects with the small circle.\n if (!(c & c0) && (t = intersect(point1, point0, true))) {\n clean = 0;\n if (smallRadius) {\n stream.lineStart();\n stream.point(t[0][0], t[0][1]);\n stream.point(t[1][0], t[1][1]);\n stream.lineEnd();\n } else {\n stream.point(t[1][0], t[1][1]);\n stream.lineEnd();\n stream.lineStart();\n stream.point(t[0][0], t[0][1], 3);\n }\n }\n }\n if (v && (!point0 || !pointEqual(point0, point1))) {\n stream.point(point1[0], point1[1]);\n }\n point0 = point1, v0 = v, c0 = c;\n },\n lineEnd: function() {\n if (v0) stream.lineEnd();\n point0 = null;\n },\n // Rejoin first and last segments if there were intersections and the first\n // and last points were visible.\n clean: function() {\n return clean | ((v00 && v0) << 1);\n }\n };\n }", "function clipLine(stream) {\n\t var point0, // previous point\n\t c0, // code for previous point\n\t v0, // visibility of previous point\n\t v00, // visibility of first point\n\t clean; // no intersections\n\t return {\n\t lineStart: function() {\n\t v00 = v0 = false;\n\t clean = 1;\n\t },\n\t point: function(lambda, phi) {\n\t var point1 = [lambda, phi],\n\t point2,\n\t v = visible(lambda, phi),\n\t c = smallRadius\n\t ? v ? 0 : code(lambda, phi)\n\t : v ? code(lambda + (lambda < 0 ? pi : -pi), phi) : 0;\n\t if (!point0 && (v00 = v0 = v)) stream.lineStart();\n\t // Handle degeneracies.\n\t // TODO ignore if not clipping polygons.\n\t if (v !== v0) {\n\t point2 = intersect(point0, point1);\n\t if (pointEqual(point0, point2) || pointEqual(point1, point2)) {\n\t point1[0] += epsilon;\n\t point1[1] += epsilon;\n\t v = visible(point1[0], point1[1]);\n\t }\n\t }\n\t if (v !== v0) {\n\t clean = 0;\n\t if (v) {\n\t // outside going in\n\t stream.lineStart();\n\t point2 = intersect(point1, point0);\n\t stream.point(point2[0], point2[1]);\n\t } else {\n\t // inside going out\n\t point2 = intersect(point0, point1);\n\t stream.point(point2[0], point2[1]);\n\t stream.lineEnd();\n\t }\n\t point0 = point2;\n\t } else if (notHemisphere && point0 && smallRadius ^ v) {\n\t var t;\n\t // If the codes for two points are different, or are both zero,\n\t // and there this segment intersects with the small circle.\n\t if (!(c & c0) && (t = intersect(point1, point0, true))) {\n\t clean = 0;\n\t if (smallRadius) {\n\t stream.lineStart();\n\t stream.point(t[0][0], t[0][1]);\n\t stream.point(t[1][0], t[1][1]);\n\t stream.lineEnd();\n\t } else {\n\t stream.point(t[1][0], t[1][1]);\n\t stream.lineEnd();\n\t stream.lineStart();\n\t stream.point(t[0][0], t[0][1]);\n\t }\n\t }\n\t }\n\t if (v && (!point0 || !pointEqual(point0, point1))) {\n\t stream.point(point1[0], point1[1]);\n\t }\n\t point0 = point1, v0 = v, c0 = c;\n\t },\n\t lineEnd: function() {\n\t if (v0) stream.lineEnd();\n\t point0 = null;\n\t },\n\t // Rejoin first and last segments if there were intersections and the first\n\t // and last points were visible.\n\t clean: function() {\n\t return clean | ((v00 && v0) << 1);\n\t }\n\t };\n\t }", "function clipLine(stream) {\n\t var point0, // previous point\n\t c0, // code for previous point\n\t v0, // visibility of previous point\n\t v00, // visibility of first point\n\t clean; // no intersections\n\t return {\n\t lineStart: function() {\n\t v00 = v0 = false;\n\t clean = 1;\n\t },\n\t point: function(lambda, phi) {\n\t var point1 = [lambda, phi],\n\t point2,\n\t v = visible(lambda, phi),\n\t c = smallRadius\n\t ? v ? 0 : code(lambda, phi)\n\t : v ? code(lambda + (lambda < 0 ? pi$4 : -pi$4), phi) : 0;\n\t if (!point0 && (v00 = v0 = v)) stream.lineStart();\n\t // Handle degeneracies.\n\t // TODO ignore if not clipping polygons.\n\t if (v !== v0) {\n\t point2 = intersect(point0, point1);\n\t if (pointEqual(point0, point2) || pointEqual(point1, point2)) {\n\t point1[0] += epsilon$4;\n\t point1[1] += epsilon$4;\n\t v = visible(point1[0], point1[1]);\n\t }\n\t }\n\t if (v !== v0) {\n\t clean = 0;\n\t if (v) {\n\t // outside going in\n\t stream.lineStart();\n\t point2 = intersect(point1, point0);\n\t stream.point(point2[0], point2[1]);\n\t } else {\n\t // inside going out\n\t point2 = intersect(point0, point1);\n\t stream.point(point2[0], point2[1]);\n\t stream.lineEnd();\n\t }\n\t point0 = point2;\n\t } else if (notHemisphere && point0 && smallRadius ^ v) {\n\t var t;\n\t // If the codes for two points are different, or are both zero,\n\t // and there this segment intersects with the small circle.\n\t if (!(c & c0) && (t = intersect(point1, point0, true))) {\n\t clean = 0;\n\t if (smallRadius) {\n\t stream.lineStart();\n\t stream.point(t[0][0], t[0][1]);\n\t stream.point(t[1][0], t[1][1]);\n\t stream.lineEnd();\n\t } else {\n\t stream.point(t[1][0], t[1][1]);\n\t stream.lineEnd();\n\t stream.lineStart();\n\t stream.point(t[0][0], t[0][1]);\n\t }\n\t }\n\t }\n\t if (v && (!point0 || !pointEqual(point0, point1))) {\n\t stream.point(point1[0], point1[1]);\n\t }\n\t point0 = point1, v0 = v, c0 = c;\n\t },\n\t lineEnd: function() {\n\t if (v0) stream.lineEnd();\n\t point0 = null;\n\t },\n\t // Rejoin first and last segments if there were intersections and the first\n\t // and last points were visible.\n\t clean: function() {\n\t return clean | ((v00 && v0) << 1);\n\t }\n\t };\n\t }", "function clipLine(stream) {\n\t var point0, // previous point\n\t c0, // code for previous point\n\t v0, // visibility of previous point\n\t v00, // visibility of first point\n\t clean; // no intersections\n\t return {\n\t lineStart: function() {\n\t v00 = v0 = false;\n\t clean = 1;\n\t },\n\t point: function(lambda, phi) {\n\t var point1 = [lambda, phi],\n\t point2,\n\t v = visible(lambda, phi),\n\t c = smallRadius\n\t ? v ? 0 : code(lambda, phi)\n\t : v ? code(lambda + (lambda < 0 ? pi$4 : -pi$4), phi) : 0;\n\t if (!point0 && (v00 = v0 = v)) stream.lineStart();\n\t // Handle degeneracies.\n\t // TODO ignore if not clipping polygons.\n\t if (v !== v0) {\n\t point2 = intersect(point0, point1);\n\t if (pointEqual(point0, point2) || pointEqual(point1, point2)) {\n\t point1[0] += epsilon$4;\n\t point1[1] += epsilon$4;\n\t v = visible(point1[0], point1[1]);\n\t }\n\t }\n\t if (v !== v0) {\n\t clean = 0;\n\t if (v) {\n\t // outside going in\n\t stream.lineStart();\n\t point2 = intersect(point1, point0);\n\t stream.point(point2[0], point2[1]);\n\t } else {\n\t // inside going out\n\t point2 = intersect(point0, point1);\n\t stream.point(point2[0], point2[1]);\n\t stream.lineEnd();\n\t }\n\t point0 = point2;\n\t } else if (notHemisphere && point0 && smallRadius ^ v) {\n\t var t;\n\t // If the codes for two points are different, or are both zero,\n\t // and there this segment intersects with the small circle.\n\t if (!(c & c0) && (t = intersect(point1, point0, true))) {\n\t clean = 0;\n\t if (smallRadius) {\n\t stream.lineStart();\n\t stream.point(t[0][0], t[0][1]);\n\t stream.point(t[1][0], t[1][1]);\n\t stream.lineEnd();\n\t } else {\n\t stream.point(t[1][0], t[1][1]);\n\t stream.lineEnd();\n\t stream.lineStart();\n\t stream.point(t[0][0], t[0][1]);\n\t }\n\t }\n\t }\n\t if (v && (!point0 || !pointEqual(point0, point1))) {\n\t stream.point(point1[0], point1[1]);\n\t }\n\t point0 = point1, v0 = v, c0 = c;\n\t },\n\t lineEnd: function() {\n\t if (v0) stream.lineEnd();\n\t point0 = null;\n\t },\n\t // Rejoin first and last segments if there were intersections and the first\n\t // and last points were visible.\n\t clean: function() {\n\t return clean | ((v00 && v0) << 1);\n\t }\n\t };\n\t }", "scratchLine(x, y, fresh) {\n const drawctx = this.canvas[0].draw.getContext('2d');\n const strokectx = this.strokeCanvas.getContext('2d');\n\n drawctx.lineWidth = strokectx.lineWidth = this.brushSize;\n drawctx.lineCap = drawctx.lineJoin = strokectx.lineCap = strokectx.lineJoin = 'round';\n\n drawctx.strokeStyle = '#fff'; // can be any opaque color\n strokectx.strokeStyle = '#000';\n\n if (fresh) {\n drawctx.beginPath();\n strokectx.beginPath();\n\n // this +0.01 hackishly causes Linux Chrome to draw a\n // \"zero\"-length line (a single point), otherwise it doesn't\n // draw when the mouse is clicked but not moved\n // Plus 1 for the border\n\n drawctx.moveTo(x+0.01+1, y);\n strokectx.moveTo(x+0.01+1, y);\n }\n\n drawctx.lineTo(x+1, y);\n strokectx.lineTo(x+1, y);\n\n drawctx.stroke();\n strokectx.stroke();\n }", "function clipLine(stream) {\n var point0, // previous point\n c0, // code for previous point\n v0, // visibility of previous point\n v00, // visibility of first point\n clean; // no intersections\n return {\n lineStart: function() {\n v00 = v0 = false;\n clean = 1;\n },\n point: function(lambda, phi) {\n var point1 = [lambda, phi],\n point2,\n v = visible(lambda, phi),\n c = smallRadius\n ? v ? 0 : code(lambda, phi)\n : v ? code(lambda + (lambda < 0 ? _math__WEBPACK_IMPORTED_MODULE_2__[\"pi\"] : -_math__WEBPACK_IMPORTED_MODULE_2__[\"pi\"]), phi) : 0;\n if (!point0 && (v00 = v0 = v)) stream.lineStart();\n // Handle degeneracies.\n // TODO ignore if not clipping polygons.\n if (v !== v0) {\n point2 = intersect(point0, point1);\n if (!point2 || Object(_pointEqual__WEBPACK_IMPORTED_MODULE_3__[\"default\"])(point0, point2) || Object(_pointEqual__WEBPACK_IMPORTED_MODULE_3__[\"default\"])(point1, point2)) {\n point1[0] += _math__WEBPACK_IMPORTED_MODULE_2__[\"epsilon\"];\n point1[1] += _math__WEBPACK_IMPORTED_MODULE_2__[\"epsilon\"];\n v = visible(point1[0], point1[1]);\n }\n }\n if (v !== v0) {\n clean = 0;\n if (v) {\n // outside going in\n stream.lineStart();\n point2 = intersect(point1, point0);\n stream.point(point2[0], point2[1]);\n } else {\n // inside going out\n point2 = intersect(point0, point1);\n stream.point(point2[0], point2[1]);\n stream.lineEnd();\n }\n point0 = point2;\n } else if (notHemisphere && point0 && smallRadius ^ v) {\n var t;\n // If the codes for two points are different, or are both zero,\n // and there this segment intersects with the small circle.\n if (!(c & c0) && (t = intersect(point1, point0, true))) {\n clean = 0;\n if (smallRadius) {\n stream.lineStart();\n stream.point(t[0][0], t[0][1]);\n stream.point(t[1][0], t[1][1]);\n stream.lineEnd();\n } else {\n stream.point(t[1][0], t[1][1]);\n stream.lineEnd();\n stream.lineStart();\n stream.point(t[0][0], t[0][1]);\n }\n }\n }\n if (v && (!point0 || !Object(_pointEqual__WEBPACK_IMPORTED_MODULE_3__[\"default\"])(point0, point1))) {\n stream.point(point1[0], point1[1]);\n }\n point0 = point1, v0 = v, c0 = c;\n },\n lineEnd: function() {\n if (v0) stream.lineEnd();\n point0 = null;\n },\n // Rejoin first and last segments if there were intersections and the first\n // and last points were visible.\n clean: function() {\n return clean | ((v00 && v0) << 1);\n }\n };\n }", "function clipLine(stream) {\n var point0, // previous point\n c0, // code for previous point\n v0, // visibility of previous point\n v00, // visibility of first point\n clean; // no intersections\n return {\n lineStart: function() {\n v00 = v0 = false;\n clean = 1;\n },\n point: function(lambda, phi) {\n var point1 = [lambda, phi],\n point2,\n v = visible(lambda, phi),\n c = smallRadius\n ? v ? 0 : code(lambda, phi)\n : v ? code(lambda + (lambda < 0 ? _math__WEBPACK_IMPORTED_MODULE_2__[\"pi\"] : -_math__WEBPACK_IMPORTED_MODULE_2__[\"pi\"]), phi) : 0;\n if (!point0 && (v00 = v0 = v)) stream.lineStart();\n // Handle degeneracies.\n // TODO ignore if not clipping polygons.\n if (v !== v0) {\n point2 = intersect(point0, point1);\n if (!point2 || Object(_pointEqual__WEBPACK_IMPORTED_MODULE_3__[\"default\"])(point0, point2) || Object(_pointEqual__WEBPACK_IMPORTED_MODULE_3__[\"default\"])(point1, point2)) {\n point1[0] += _math__WEBPACK_IMPORTED_MODULE_2__[\"epsilon\"];\n point1[1] += _math__WEBPACK_IMPORTED_MODULE_2__[\"epsilon\"];\n v = visible(point1[0], point1[1]);\n }\n }\n if (v !== v0) {\n clean = 0;\n if (v) {\n // outside going in\n stream.lineStart();\n point2 = intersect(point1, point0);\n stream.point(point2[0], point2[1]);\n } else {\n // inside going out\n point2 = intersect(point0, point1);\n stream.point(point2[0], point2[1]);\n stream.lineEnd();\n }\n point0 = point2;\n } else if (notHemisphere && point0 && smallRadius ^ v) {\n var t;\n // If the codes for two points are different, or are both zero,\n // and there this segment intersects with the small circle.\n if (!(c & c0) && (t = intersect(point1, point0, true))) {\n clean = 0;\n if (smallRadius) {\n stream.lineStart();\n stream.point(t[0][0], t[0][1]);\n stream.point(t[1][0], t[1][1]);\n stream.lineEnd();\n } else {\n stream.point(t[1][0], t[1][1]);\n stream.lineEnd();\n stream.lineStart();\n stream.point(t[0][0], t[0][1]);\n }\n }\n }\n if (v && (!point0 || !Object(_pointEqual__WEBPACK_IMPORTED_MODULE_3__[\"default\"])(point0, point1))) {\n stream.point(point1[0], point1[1]);\n }\n point0 = point1, v0 = v, c0 = c;\n },\n lineEnd: function() {\n if (v0) stream.lineEnd();\n point0 = null;\n },\n // Rejoin first and last segments if there were intersections and the first\n // and last points were visible.\n clean: function() {\n return clean | ((v00 && v0) << 1);\n }\n };\n }", "function clipLine(stream) {\n var point0, // previous point\n c0, // code for previous point\n v0, // visibility of previous point\n v00, // visibility of first point\n clean; // no intersections\n return {\n lineStart: function() {\n v00 = v0 = false;\n clean = 1;\n },\n point: function(lambda, phi) {\n var point1 = [lambda, phi],\n point2,\n v = visible(lambda, phi),\n c = smallRadius\n ? v ? 0 : code(lambda, phi)\n : v ? code(lambda + (lambda < 0 ? _math__WEBPACK_IMPORTED_MODULE_2__[\"pi\"] : -_math__WEBPACK_IMPORTED_MODULE_2__[\"pi\"]), phi) : 0;\n if (!point0 && (v00 = v0 = v)) stream.lineStart();\n // Handle degeneracies.\n // TODO ignore if not clipping polygons.\n if (v !== v0) {\n point2 = intersect(point0, point1);\n if (!point2 || Object(_pointEqual__WEBPACK_IMPORTED_MODULE_3__[\"default\"])(point0, point2) || Object(_pointEqual__WEBPACK_IMPORTED_MODULE_3__[\"default\"])(point1, point2)) {\n point1[0] += _math__WEBPACK_IMPORTED_MODULE_2__[\"epsilon\"];\n point1[1] += _math__WEBPACK_IMPORTED_MODULE_2__[\"epsilon\"];\n v = visible(point1[0], point1[1]);\n }\n }\n if (v !== v0) {\n clean = 0;\n if (v) {\n // outside going in\n stream.lineStart();\n point2 = intersect(point1, point0);\n stream.point(point2[0], point2[1]);\n } else {\n // inside going out\n point2 = intersect(point0, point1);\n stream.point(point2[0], point2[1]);\n stream.lineEnd();\n }\n point0 = point2;\n } else if (notHemisphere && point0 && smallRadius ^ v) {\n var t;\n // If the codes for two points are different, or are both zero,\n // and there this segment intersects with the small circle.\n if (!(c & c0) && (t = intersect(point1, point0, true))) {\n clean = 0;\n if (smallRadius) {\n stream.lineStart();\n stream.point(t[0][0], t[0][1]);\n stream.point(t[1][0], t[1][1]);\n stream.lineEnd();\n } else {\n stream.point(t[1][0], t[1][1]);\n stream.lineEnd();\n stream.lineStart();\n stream.point(t[0][0], t[0][1]);\n }\n }\n }\n if (v && (!point0 || !Object(_pointEqual__WEBPACK_IMPORTED_MODULE_3__[\"default\"])(point0, point1))) {\n stream.point(point1[0], point1[1]);\n }\n point0 = point1, v0 = v, c0 = c;\n },\n lineEnd: function() {\n if (v0) stream.lineEnd();\n point0 = null;\n },\n // Rejoin first and last segments if there were intersections and the first\n // and last points were visible.\n clean: function() {\n return clean | ((v00 && v0) << 1);\n }\n };\n }", "function clipLine(stream) {\n var point0, // previous point\n c0, // code for previous point\n v0, // visibility of previous point\n v00, // visibility of first point\n clean; // no intersections\n return {\n lineStart: function() {\n v00 = v0 = false;\n clean = 1;\n },\n point: function(lambda, phi) {\n var point1 = [lambda, phi],\n point2,\n v = visible(lambda, phi),\n c = smallRadius\n ? v ? 0 : code(lambda, phi)\n : v ? code(lambda + (lambda < 0 ? _math__WEBPACK_IMPORTED_MODULE_2__[\"pi\"] : -_math__WEBPACK_IMPORTED_MODULE_2__[\"pi\"]), phi) : 0;\n if (!point0 && (v00 = v0 = v)) stream.lineStart();\n // Handle degeneracies.\n // TODO ignore if not clipping polygons.\n if (v !== v0) {\n point2 = intersect(point0, point1);\n if (!point2 || Object(_pointEqual__WEBPACK_IMPORTED_MODULE_3__[\"default\"])(point0, point2) || Object(_pointEqual__WEBPACK_IMPORTED_MODULE_3__[\"default\"])(point1, point2)) {\n point1[0] += _math__WEBPACK_IMPORTED_MODULE_2__[\"epsilon\"];\n point1[1] += _math__WEBPACK_IMPORTED_MODULE_2__[\"epsilon\"];\n v = visible(point1[0], point1[1]);\n }\n }\n if (v !== v0) {\n clean = 0;\n if (v) {\n // outside going in\n stream.lineStart();\n point2 = intersect(point1, point0);\n stream.point(point2[0], point2[1]);\n } else {\n // inside going out\n point2 = intersect(point0, point1);\n stream.point(point2[0], point2[1]);\n stream.lineEnd();\n }\n point0 = point2;\n } else if (notHemisphere && point0 && smallRadius ^ v) {\n var t;\n // If the codes for two points are different, or are both zero,\n // and there this segment intersects with the small circle.\n if (!(c & c0) && (t = intersect(point1, point0, true))) {\n clean = 0;\n if (smallRadius) {\n stream.lineStart();\n stream.point(t[0][0], t[0][1]);\n stream.point(t[1][0], t[1][1]);\n stream.lineEnd();\n } else {\n stream.point(t[1][0], t[1][1]);\n stream.lineEnd();\n stream.lineStart();\n stream.point(t[0][0], t[0][1]);\n }\n }\n }\n if (v && (!point0 || !Object(_pointEqual__WEBPACK_IMPORTED_MODULE_3__[\"default\"])(point0, point1))) {\n stream.point(point1[0], point1[1]);\n }\n point0 = point1, v0 = v, c0 = c;\n },\n lineEnd: function() {\n if (v0) stream.lineEnd();\n point0 = null;\n },\n // Rejoin first and last segments if there were intersections and the first\n // and last points were visible.\n clean: function() {\n return clean | ((v00 && v0) << 1);\n }\n };\n }", "function clipLine(stream) {\n var point0, // previous point\n c0, // code for previous point\n v0, // visibility of previous point\n v00, // visibility of first point\n clean; // no intersections\n return {\n lineStart: function() {\n v00 = v0 = false;\n clean = 1;\n },\n point: function(lambda, phi) {\n var point1 = [lambda, phi],\n point2,\n v = visible(lambda, phi),\n c = smallRadius\n ? v ? 0 : code(lambda, phi)\n : v ? code(lambda + (lambda < 0 ? _math__WEBPACK_IMPORTED_MODULE_2__[\"pi\"] : -_math__WEBPACK_IMPORTED_MODULE_2__[\"pi\"]), phi) : 0;\n if (!point0 && (v00 = v0 = v)) stream.lineStart();\n // Handle degeneracies.\n // TODO ignore if not clipping polygons.\n if (v !== v0) {\n point2 = intersect(point0, point1);\n if (!point2 || Object(_pointEqual__WEBPACK_IMPORTED_MODULE_3__[\"default\"])(point0, point2) || Object(_pointEqual__WEBPACK_IMPORTED_MODULE_3__[\"default\"])(point1, point2)) {\n point1[0] += _math__WEBPACK_IMPORTED_MODULE_2__[\"epsilon\"];\n point1[1] += _math__WEBPACK_IMPORTED_MODULE_2__[\"epsilon\"];\n v = visible(point1[0], point1[1]);\n }\n }\n if (v !== v0) {\n clean = 0;\n if (v) {\n // outside going in\n stream.lineStart();\n point2 = intersect(point1, point0);\n stream.point(point2[0], point2[1]);\n } else {\n // inside going out\n point2 = intersect(point0, point1);\n stream.point(point2[0], point2[1]);\n stream.lineEnd();\n }\n point0 = point2;\n } else if (notHemisphere && point0 && smallRadius ^ v) {\n var t;\n // If the codes for two points are different, or are both zero,\n // and there this segment intersects with the small circle.\n if (!(c & c0) && (t = intersect(point1, point0, true))) {\n clean = 0;\n if (smallRadius) {\n stream.lineStart();\n stream.point(t[0][0], t[0][1]);\n stream.point(t[1][0], t[1][1]);\n stream.lineEnd();\n } else {\n stream.point(t[1][0], t[1][1]);\n stream.lineEnd();\n stream.lineStart();\n stream.point(t[0][0], t[0][1]);\n }\n }\n }\n if (v && (!point0 || !Object(_pointEqual__WEBPACK_IMPORTED_MODULE_3__[\"default\"])(point0, point1))) {\n stream.point(point1[0], point1[1]);\n }\n point0 = point1, v0 = v, c0 = c;\n },\n lineEnd: function() {\n if (v0) stream.lineEnd();\n point0 = null;\n },\n // Rejoin first and last segments if there were intersections and the first\n // and last points were visible.\n clean: function() {\n return clean | ((v00 && v0) << 1);\n }\n };\n }", "function clipLine(stream) {\n var point0, // previous point\n c0, // code for previous point\n v0, // visibility of previous point\n v00, // visibility of first point\n clean; // no intersections\n return {\n lineStart: function() {\n v00 = v0 = false;\n clean = 1;\n },\n point: function(lambda, phi) {\n var point1 = [lambda, phi],\n point2,\n v = visible(lambda, phi),\n c = smallRadius\n ? v ? 0 : code(lambda, phi)\n : v ? code(lambda + (lambda < 0 ? _math__WEBPACK_IMPORTED_MODULE_2__[\"pi\"] : -_math__WEBPACK_IMPORTED_MODULE_2__[\"pi\"]), phi) : 0;\n if (!point0 && (v00 = v0 = v)) stream.lineStart();\n // Handle degeneracies.\n // TODO ignore if not clipping polygons.\n if (v !== v0) {\n point2 = intersect(point0, point1);\n if (!point2 || Object(_pointEqual__WEBPACK_IMPORTED_MODULE_3__[\"default\"])(point0, point2) || Object(_pointEqual__WEBPACK_IMPORTED_MODULE_3__[\"default\"])(point1, point2)) {\n point1[0] += _math__WEBPACK_IMPORTED_MODULE_2__[\"epsilon\"];\n point1[1] += _math__WEBPACK_IMPORTED_MODULE_2__[\"epsilon\"];\n v = visible(point1[0], point1[1]);\n }\n }\n if (v !== v0) {\n clean = 0;\n if (v) {\n // outside going in\n stream.lineStart();\n point2 = intersect(point1, point0);\n stream.point(point2[0], point2[1]);\n } else {\n // inside going out\n point2 = intersect(point0, point1);\n stream.point(point2[0], point2[1]);\n stream.lineEnd();\n }\n point0 = point2;\n } else if (notHemisphere && point0 && smallRadius ^ v) {\n var t;\n // If the codes for two points are different, or are both zero,\n // and there this segment intersects with the small circle.\n if (!(c & c0) && (t = intersect(point1, point0, true))) {\n clean = 0;\n if (smallRadius) {\n stream.lineStart();\n stream.point(t[0][0], t[0][1]);\n stream.point(t[1][0], t[1][1]);\n stream.lineEnd();\n } else {\n stream.point(t[1][0], t[1][1]);\n stream.lineEnd();\n stream.lineStart();\n stream.point(t[0][0], t[0][1]);\n }\n }\n }\n if (v && (!point0 || !Object(_pointEqual__WEBPACK_IMPORTED_MODULE_3__[\"default\"])(point0, point1))) {\n stream.point(point1[0], point1[1]);\n }\n point0 = point1, v0 = v, c0 = c;\n },\n lineEnd: function() {\n if (v0) stream.lineEnd();\n point0 = null;\n },\n // Rejoin first and last segments if there were intersections and the first\n // and last points were visible.\n clean: function() {\n return clean | ((v00 && v0) << 1);\n }\n };\n }", "function clipLine(stream) {\n\t var point0, // previous point\n\t c0, // code for previous point\n\t v0, // visibility of previous point\n\t v00, // visibility of first point\n\t clean; // no intersections\n\t return {\n\t lineStart: function() {\n\t v00 = v0 = false;\n\t clean = 1;\n\t },\n\t point: function(lambda, phi) {\n\t var point1 = [lambda, phi],\n\t point2,\n\t v = visible(lambda, phi),\n\t c = smallRadius\n\t ? v ? 0 : code(lambda, phi)\n\t : v ? code(lambda + (lambda < 0 ? pi$3 : -pi$3), phi) : 0;\n\t if (!point0 && (v00 = v0 = v)) stream.lineStart();\n\t // Handle degeneracies.\n\t // TODO ignore if not clipping polygons.\n\t if (v !== v0) {\n\t point2 = intersect(point0, point1);\n\t if (pointEqual(point0, point2) || pointEqual(point1, point2)) {\n\t point1[0] += epsilon$2;\n\t point1[1] += epsilon$2;\n\t v = visible(point1[0], point1[1]);\n\t }\n\t }\n\t if (v !== v0) {\n\t clean = 0;\n\t if (v) {\n\t // outside going in\n\t stream.lineStart();\n\t point2 = intersect(point1, point0);\n\t stream.point(point2[0], point2[1]);\n\t } else {\n\t // inside going out\n\t point2 = intersect(point0, point1);\n\t stream.point(point2[0], point2[1]);\n\t stream.lineEnd();\n\t }\n\t point0 = point2;\n\t } else if (notHemisphere && point0 && smallRadius ^ v) {\n\t var t;\n\t // If the codes for two points are different, or are both zero,\n\t // and there this segment intersects with the small circle.\n\t if (!(c & c0) && (t = intersect(point1, point0, true))) {\n\t clean = 0;\n\t if (smallRadius) {\n\t stream.lineStart();\n\t stream.point(t[0][0], t[0][1]);\n\t stream.point(t[1][0], t[1][1]);\n\t stream.lineEnd();\n\t } else {\n\t stream.point(t[1][0], t[1][1]);\n\t stream.lineEnd();\n\t stream.lineStart();\n\t stream.point(t[0][0], t[0][1]);\n\t }\n\t }\n\t }\n\t if (v && (!point0 || !pointEqual(point0, point1))) {\n\t stream.point(point1[0], point1[1]);\n\t }\n\t point0 = point1, v0 = v, c0 = c;\n\t },\n\t lineEnd: function() {\n\t if (v0) stream.lineEnd();\n\t point0 = null;\n\t },\n\t // Rejoin first and last segments if there were intersections and the first\n\t // and last points were visible.\n\t clean: function() {\n\t return clean | ((v00 && v0) << 1);\n\t }\n\t };\n\t }", "function clipLine(stream) {\n\t var point0, // previous point\n\t c0, // code for previous point\n\t v0, // visibility of previous point\n\t v00, // visibility of first point\n\t clean; // no intersections\n\t return {\n\t lineStart: function() {\n\t v00 = v0 = false;\n\t clean = 1;\n\t },\n\t point: function(lambda, phi) {\n\t var point1 = [lambda, phi],\n\t point2,\n\t v = visible(lambda, phi),\n\t c = smallRadius\n\t ? v ? 0 : code(lambda, phi)\n\t : v ? code(lambda + (lambda < 0 ? pi$3 : -pi$3), phi) : 0;\n\t if (!point0 && (v00 = v0 = v)) stream.lineStart();\n\t // Handle degeneracies.\n\t // TODO ignore if not clipping polygons.\n\t if (v !== v0) {\n\t point2 = intersect(point0, point1);\n\t if (pointEqual(point0, point2) || pointEqual(point1, point2)) {\n\t point1[0] += epsilon$2;\n\t point1[1] += epsilon$2;\n\t v = visible(point1[0], point1[1]);\n\t }\n\t }\n\t if (v !== v0) {\n\t clean = 0;\n\t if (v) {\n\t // outside going in\n\t stream.lineStart();\n\t point2 = intersect(point1, point0);\n\t stream.point(point2[0], point2[1]);\n\t } else {\n\t // inside going out\n\t point2 = intersect(point0, point1);\n\t stream.point(point2[0], point2[1]);\n\t stream.lineEnd();\n\t }\n\t point0 = point2;\n\t } else if (notHemisphere && point0 && smallRadius ^ v) {\n\t var t;\n\t // If the codes for two points are different, or are both zero,\n\t // and there this segment intersects with the small circle.\n\t if (!(c & c0) && (t = intersect(point1, point0, true))) {\n\t clean = 0;\n\t if (smallRadius) {\n\t stream.lineStart();\n\t stream.point(t[0][0], t[0][1]);\n\t stream.point(t[1][0], t[1][1]);\n\t stream.lineEnd();\n\t } else {\n\t stream.point(t[1][0], t[1][1]);\n\t stream.lineEnd();\n\t stream.lineStart();\n\t stream.point(t[0][0], t[0][1]);\n\t }\n\t }\n\t }\n\t if (v && (!point0 || !pointEqual(point0, point1))) {\n\t stream.point(point1[0], point1[1]);\n\t }\n\t point0 = point1, v0 = v, c0 = c;\n\t },\n\t lineEnd: function() {\n\t if (v0) stream.lineEnd();\n\t point0 = null;\n\t },\n\t // Rejoin first and last segments if there were intersections and the first\n\t // and last points were visible.\n\t clean: function() {\n\t return clean | ((v00 && v0) << 1);\n\t }\n\t };\n\t }", "function clipLine(stream) {\n\t var point0, // previous point\n\t c0, // code for previous point\n\t v0, // visibility of previous point\n\t v00, // visibility of first point\n\t clean; // no intersections\n\t return {\n\t lineStart: function() {\n\t v00 = v0 = false;\n\t clean = 1;\n\t },\n\t point: function(lambda, phi) {\n\t var point1 = [lambda, phi],\n\t point2,\n\t v = visible(lambda, phi),\n\t c = smallRadius\n\t ? v ? 0 : code(lambda, phi)\n\t : v ? code(lambda + (lambda < 0 ? pi$3 : -pi$3), phi) : 0;\n\t if (!point0 && (v00 = v0 = v)) stream.lineStart();\n\t // Handle degeneracies.\n\t // TODO ignore if not clipping polygons.\n\t if (v !== v0) {\n\t point2 = intersect(point0, point1);\n\t if (pointEqual(point0, point2) || pointEqual(point1, point2)) {\n\t point1[0] += epsilon$2;\n\t point1[1] += epsilon$2;\n\t v = visible(point1[0], point1[1]);\n\t }\n\t }\n\t if (v !== v0) {\n\t clean = 0;\n\t if (v) {\n\t // outside going in\n\t stream.lineStart();\n\t point2 = intersect(point1, point0);\n\t stream.point(point2[0], point2[1]);\n\t } else {\n\t // inside going out\n\t point2 = intersect(point0, point1);\n\t stream.point(point2[0], point2[1]);\n\t stream.lineEnd();\n\t }\n\t point0 = point2;\n\t } else if (notHemisphere && point0 && smallRadius ^ v) {\n\t var t;\n\t // If the codes for two points are different, or are both zero,\n\t // and there this segment intersects with the small circle.\n\t if (!(c & c0) && (t = intersect(point1, point0, true))) {\n\t clean = 0;\n\t if (smallRadius) {\n\t stream.lineStart();\n\t stream.point(t[0][0], t[0][1]);\n\t stream.point(t[1][0], t[1][1]);\n\t stream.lineEnd();\n\t } else {\n\t stream.point(t[1][0], t[1][1]);\n\t stream.lineEnd();\n\t stream.lineStart();\n\t stream.point(t[0][0], t[0][1]);\n\t }\n\t }\n\t }\n\t if (v && (!point0 || !pointEqual(point0, point1))) {\n\t stream.point(point1[0], point1[1]);\n\t }\n\t point0 = point1, v0 = v, c0 = c;\n\t },\n\t lineEnd: function() {\n\t if (v0) stream.lineEnd();\n\t point0 = null;\n\t },\n\t // Rejoin first and last segments if there were intersections and the first\n\t // and last points were visible.\n\t clean: function() {\n\t return clean | ((v00 && v0) << 1);\n\t }\n\t };\n\t }", "function clipLine(stream) {\n var point0, // previous point\n c0, // code for previous point\n v0, // visibility of previous point\n v00, // visibility of first point\n clean; // no intersections\n return {\n lineStart: function() {\n v00 = v0 = false;\n clean = 1;\n },\n point: function(lambda, phi) {\n var point1 = [lambda, phi],\n point2,\n v = visible(lambda, phi),\n c = smallRadius\n ? v ? 0 : code(lambda, phi)\n : v ? code(lambda + (lambda < 0 ? _math_js__WEBPACK_IMPORTED_MODULE_2__[\"pi\"] : -_math_js__WEBPACK_IMPORTED_MODULE_2__[\"pi\"]), phi) : 0;\n if (!point0 && (v00 = v0 = v)) stream.lineStart();\n // Handle degeneracies.\n // TODO ignore if not clipping polygons.\n if (v !== v0) {\n point2 = intersect(point0, point1);\n if (!point2 || Object(_pointEqual_js__WEBPACK_IMPORTED_MODULE_3__[\"default\"])(point0, point2) || Object(_pointEqual_js__WEBPACK_IMPORTED_MODULE_3__[\"default\"])(point1, point2)) {\n point1[0] += _math_js__WEBPACK_IMPORTED_MODULE_2__[\"epsilon\"];\n point1[1] += _math_js__WEBPACK_IMPORTED_MODULE_2__[\"epsilon\"];\n v = visible(point1[0], point1[1]);\n }\n }\n if (v !== v0) {\n clean = 0;\n if (v) {\n // outside going in\n stream.lineStart();\n point2 = intersect(point1, point0);\n stream.point(point2[0], point2[1]);\n } else {\n // inside going out\n point2 = intersect(point0, point1);\n stream.point(point2[0], point2[1]);\n stream.lineEnd();\n }\n point0 = point2;\n } else if (notHemisphere && point0 && smallRadius ^ v) {\n var t;\n // If the codes for two points are different, or are both zero,\n // and there this segment intersects with the small circle.\n if (!(c & c0) && (t = intersect(point1, point0, true))) {\n clean = 0;\n if (smallRadius) {\n stream.lineStart();\n stream.point(t[0][0], t[0][1]);\n stream.point(t[1][0], t[1][1]);\n stream.lineEnd();\n } else {\n stream.point(t[1][0], t[1][1]);\n stream.lineEnd();\n stream.lineStart();\n stream.point(t[0][0], t[0][1]);\n }\n }\n }\n if (v && (!point0 || !Object(_pointEqual_js__WEBPACK_IMPORTED_MODULE_3__[\"default\"])(point0, point1))) {\n stream.point(point1[0], point1[1]);\n }\n point0 = point1, v0 = v, c0 = c;\n },\n lineEnd: function() {\n if (v0) stream.lineEnd();\n point0 = null;\n },\n // Rejoin first and last segments if there were intersections and the first\n // and last points were visible.\n clean: function() {\n return clean | ((v00 && v0) << 1);\n }\n };\n }", "function clipLine(stream) {\n var point0, // previous point\n c0, // code for previous point\n v0, // visibility of previous point\n v00, // visibility of first point\n clean; // no intersections\n return {\n lineStart: function() {\n v00 = v0 = false;\n clean = 1;\n },\n point: function(lambda, phi) {\n var point1 = [lambda, phi],\n point2,\n v = visible(lambda, phi),\n c = smallRadius\n ? v ? 0 : code(lambda, phi)\n : v ? code(lambda + (lambda < 0 ? _math_js__WEBPACK_IMPORTED_MODULE_2__[\"pi\"] : -_math_js__WEBPACK_IMPORTED_MODULE_2__[\"pi\"]), phi) : 0;\n if (!point0 && (v00 = v0 = v)) stream.lineStart();\n // Handle degeneracies.\n // TODO ignore if not clipping polygons.\n if (v !== v0) {\n point2 = intersect(point0, point1);\n if (!point2 || Object(_pointEqual_js__WEBPACK_IMPORTED_MODULE_3__[\"default\"])(point0, point2) || Object(_pointEqual_js__WEBPACK_IMPORTED_MODULE_3__[\"default\"])(point1, point2)) {\n point1[0] += _math_js__WEBPACK_IMPORTED_MODULE_2__[\"epsilon\"];\n point1[1] += _math_js__WEBPACK_IMPORTED_MODULE_2__[\"epsilon\"];\n v = visible(point1[0], point1[1]);\n }\n }\n if (v !== v0) {\n clean = 0;\n if (v) {\n // outside going in\n stream.lineStart();\n point2 = intersect(point1, point0);\n stream.point(point2[0], point2[1]);\n } else {\n // inside going out\n point2 = intersect(point0, point1);\n stream.point(point2[0], point2[1]);\n stream.lineEnd();\n }\n point0 = point2;\n } else if (notHemisphere && point0 && smallRadius ^ v) {\n var t;\n // If the codes for two points are different, or are both zero,\n // and there this segment intersects with the small circle.\n if (!(c & c0) && (t = intersect(point1, point0, true))) {\n clean = 0;\n if (smallRadius) {\n stream.lineStart();\n stream.point(t[0][0], t[0][1]);\n stream.point(t[1][0], t[1][1]);\n stream.lineEnd();\n } else {\n stream.point(t[1][0], t[1][1]);\n stream.lineEnd();\n stream.lineStart();\n stream.point(t[0][0], t[0][1]);\n }\n }\n }\n if (v && (!point0 || !Object(_pointEqual_js__WEBPACK_IMPORTED_MODULE_3__[\"default\"])(point0, point1))) {\n stream.point(point1[0], point1[1]);\n }\n point0 = point1, v0 = v, c0 = c;\n },\n lineEnd: function() {\n if (v0) stream.lineEnd();\n point0 = null;\n },\n // Rejoin first and last segments if there were intersections and the first\n // and last points were visible.\n clean: function() {\n return clean | ((v00 && v0) << 1);\n }\n };\n }", "function clipLine(stream) {\n var point0, // previous point\n c0, // code for previous point\n v0, // visibility of previous point\n v00, // visibility of first point\n clean; // no intersections\n return {\n lineStart: function() {\n v00 = v0 = false;\n clean = 1;\n },\n point: function(lambda, phi) {\n var point1 = [lambda, phi],\n point2,\n v = visible(lambda, phi),\n c = smallRadius\n ? v ? 0 : code(lambda, phi)\n : v ? code(lambda + (lambda < 0 ? _math_js__WEBPACK_IMPORTED_MODULE_2__[\"pi\"] : -_math_js__WEBPACK_IMPORTED_MODULE_2__[\"pi\"]), phi) : 0;\n if (!point0 && (v00 = v0 = v)) stream.lineStart();\n // Handle degeneracies.\n // TODO ignore if not clipping polygons.\n if (v !== v0) {\n point2 = intersect(point0, point1);\n if (!point2 || Object(_pointEqual_js__WEBPACK_IMPORTED_MODULE_3__[\"default\"])(point0, point2) || Object(_pointEqual_js__WEBPACK_IMPORTED_MODULE_3__[\"default\"])(point1, point2)) {\n point1[0] += _math_js__WEBPACK_IMPORTED_MODULE_2__[\"epsilon\"];\n point1[1] += _math_js__WEBPACK_IMPORTED_MODULE_2__[\"epsilon\"];\n v = visible(point1[0], point1[1]);\n }\n }\n if (v !== v0) {\n clean = 0;\n if (v) {\n // outside going in\n stream.lineStart();\n point2 = intersect(point1, point0);\n stream.point(point2[0], point2[1]);\n } else {\n // inside going out\n point2 = intersect(point0, point1);\n stream.point(point2[0], point2[1]);\n stream.lineEnd();\n }\n point0 = point2;\n } else if (notHemisphere && point0 && smallRadius ^ v) {\n var t;\n // If the codes for two points are different, or are both zero,\n // and there this segment intersects with the small circle.\n if (!(c & c0) && (t = intersect(point1, point0, true))) {\n clean = 0;\n if (smallRadius) {\n stream.lineStart();\n stream.point(t[0][0], t[0][1]);\n stream.point(t[1][0], t[1][1]);\n stream.lineEnd();\n } else {\n stream.point(t[1][0], t[1][1]);\n stream.lineEnd();\n stream.lineStart();\n stream.point(t[0][0], t[0][1]);\n }\n }\n }\n if (v && (!point0 || !Object(_pointEqual_js__WEBPACK_IMPORTED_MODULE_3__[\"default\"])(point0, point1))) {\n stream.point(point1[0], point1[1]);\n }\n point0 = point1, v0 = v, c0 = c;\n },\n lineEnd: function() {\n if (v0) stream.lineEnd();\n point0 = null;\n },\n // Rejoin first and last segments if there were intersections and the first\n // and last points were visible.\n clean: function() {\n return clean | ((v00 && v0) << 1);\n }\n };\n }", "function clipLine(stream) {\n\t var point0, // previous point\n\t c0, // code for previous point\n\t v0, // visibility of previous point\n\t v00, // visibility of first point\n\t clean; // no intersections\n\t return {\n\t lineStart: function() {\n\t v00 = v0 = false;\n\t clean = 1;\n\t },\n\t point: function(lambda, phi) {\n\t var point1 = [lambda, phi],\n\t point2,\n\t v = visible(lambda, phi),\n\t c = smallRadius\n\t ? v ? 0 : code(lambda, phi)\n\t : v ? code(lambda + (lambda < 0 ? pi$4 : -pi$4), phi) : 0;\n\t if (!point0 && (v00 = v0 = v)) stream.lineStart();\n\t // Handle degeneracies.\n\t // TODO ignore if not clipping polygons.\n\t if (v !== v0) {\n\t point2 = intersect(point0, point1);\n\t if (pointEqual(point0, point2) || pointEqual(point1, point2)) {\n\t point1[0] += epsilon$4;\n\t point1[1] += epsilon$4;\n\t v = visible(point1[0], point1[1]);\n\t }\n\t }\n\t if (v !== v0) {\n\t clean = 0;\n\t if (v) {\n\t // outside going in\n\t stream.lineStart();\n\t point2 = intersect(point1, point0);\n\t stream.point(point2[0], point2[1]);\n\t } else {\n\t // inside going out\n\t point2 = intersect(point0, point1);\n\t stream.point(point2[0], point2[1]);\n\t stream.lineEnd();\n\t }\n\t point0 = point2;\n\t } else if (notHemisphere && point0 && smallRadius ^ v) {\n\t var t;\n\t // If the codes for two points are different, or are both zero,\n\t // and there this segment intersects with the small circle.\n\t if (!(c & c0) && (t = intersect(point1, point0, true))) {\n\t clean = 0;\n\t if (smallRadius) {\n\t stream.lineStart();\n\t stream.point(t[0][0], t[0][1]);\n\t stream.point(t[1][0], t[1][1]);\n\t stream.lineEnd();\n\t } else {\n\t stream.point(t[1][0], t[1][1]);\n\t stream.lineEnd();\n\t stream.lineStart();\n\t stream.point(t[0][0], t[0][1]);\n\t }\n\t }\n\t }\n\t if (v && (!point0 || !pointEqual(point0, point1))) {\n\t stream.point(point1[0], point1[1]);\n\t }\n\t point0 = point1, v0 = v, c0 = c;\n\t },\n\t lineEnd: function() {\n\t if (v0) stream.lineEnd();\n\t point0 = null;\n\t },\n\t // Rejoin first and last segments if there were intersections and the first\n\t // and last points were visible.\n\t clean: function() {\n\t return clean | ((v00 && v0) << 1);\n\t }\n\t };\n\t }", "function render_lineNegatief() {\n var plotLine = hgiLine().mapping(['meetmoment', 'somberheid', 'onrust']).yDomain([0, 100]).legend(['Somberheid', 'Onrust']).yTicks(5).xLabel('Meetmoment').yLabel(\"Negatieve gevoelens\");\n d3.select('#lineNegatief').datum(data).call(plotLine);\n}", "function clipLine(stream) {\n var point0, // previous point\n c0, // code for previous point\n v0, // visibility of previous point\n v00, // visibility of first point\n clean; // no intersections\n return {\n lineStart: function() {\n v00 = v0 = false;\n clean = 1;\n },\n point: function(lambda, phi) {\n var point1 = [lambda, phi],\n point2,\n v = visible(lambda, phi),\n c = smallRadius\n ? v ? 0 : code(lambda, phi)\n : v ? code(lambda + (lambda < 0 ? _math_js__WEBPACK_IMPORTED_MODULE_2__[\"pi\"] : -_math_js__WEBPACK_IMPORTED_MODULE_2__[\"pi\"]), phi) : 0;\n if (!point0 && (v00 = v0 = v)) stream.lineStart();\n if (v !== v0) {\n point2 = intersect(point0, point1);\n if (!point2 || Object(_pointEqual_js__WEBPACK_IMPORTED_MODULE_3__[\"default\"])(point0, point2) || Object(_pointEqual_js__WEBPACK_IMPORTED_MODULE_3__[\"default\"])(point1, point2))\n point1[2] = 1;\n }\n if (v !== v0) {\n clean = 0;\n if (v) {\n // outside going in\n stream.lineStart();\n point2 = intersect(point1, point0);\n stream.point(point2[0], point2[1]);\n } else {\n // inside going out\n point2 = intersect(point0, point1);\n stream.point(point2[0], point2[1], 2);\n stream.lineEnd();\n }\n point0 = point2;\n } else if (notHemisphere && point0 && smallRadius ^ v) {\n var t;\n // If the codes for two points are different, or are both zero,\n // and there this segment intersects with the small circle.\n if (!(c & c0) && (t = intersect(point1, point0, true))) {\n clean = 0;\n if (smallRadius) {\n stream.lineStart();\n stream.point(t[0][0], t[0][1]);\n stream.point(t[1][0], t[1][1]);\n stream.lineEnd();\n } else {\n stream.point(t[1][0], t[1][1]);\n stream.lineEnd();\n stream.lineStart();\n stream.point(t[0][0], t[0][1], 3);\n }\n }\n }\n if (v && (!point0 || !Object(_pointEqual_js__WEBPACK_IMPORTED_MODULE_3__[\"default\"])(point0, point1))) {\n stream.point(point1[0], point1[1]);\n }\n point0 = point1, v0 = v, c0 = c;\n },\n lineEnd: function() {\n if (v0) stream.lineEnd();\n point0 = null;\n },\n // Rejoin first and last segments if there were intersections and the first\n // and last points were visible.\n clean: function() {\n return clean | ((v00 && v0) << 1);\n }\n };\n }", "function clipLine(stream) {\n var point0, // previous point\n c0, // code for previous point\n v0, // visibility of previous point\n v00, // visibility of first point\n clean; // no intersections\n return {\n lineStart: function() {\n v00 = v0 = false;\n clean = 1;\n },\n point: function(lambda, phi) {\n var point1 = [lambda, phi],\n point2,\n v = visible(lambda, phi),\n c = smallRadius\n ? v ? 0 : code(lambda, phi)\n : v ? code(lambda + (lambda < 0 ? _math_js__WEBPACK_IMPORTED_MODULE_2__[\"pi\"] : -_math_js__WEBPACK_IMPORTED_MODULE_2__[\"pi\"]), phi) : 0;\n if (!point0 && (v00 = v0 = v)) stream.lineStart();\n if (v !== v0) {\n point2 = intersect(point0, point1);\n if (!point2 || Object(_pointEqual_js__WEBPACK_IMPORTED_MODULE_3__[\"default\"])(point0, point2) || Object(_pointEqual_js__WEBPACK_IMPORTED_MODULE_3__[\"default\"])(point1, point2))\n point1[2] = 1;\n }\n if (v !== v0) {\n clean = 0;\n if (v) {\n // outside going in\n stream.lineStart();\n point2 = intersect(point1, point0);\n stream.point(point2[0], point2[1]);\n } else {\n // inside going out\n point2 = intersect(point0, point1);\n stream.point(point2[0], point2[1], 2);\n stream.lineEnd();\n }\n point0 = point2;\n } else if (notHemisphere && point0 && smallRadius ^ v) {\n var t;\n // If the codes for two points are different, or are both zero,\n // and there this segment intersects with the small circle.\n if (!(c & c0) && (t = intersect(point1, point0, true))) {\n clean = 0;\n if (smallRadius) {\n stream.lineStart();\n stream.point(t[0][0], t[0][1]);\n stream.point(t[1][0], t[1][1]);\n stream.lineEnd();\n } else {\n stream.point(t[1][0], t[1][1]);\n stream.lineEnd();\n stream.lineStart();\n stream.point(t[0][0], t[0][1], 3);\n }\n }\n }\n if (v && (!point0 || !Object(_pointEqual_js__WEBPACK_IMPORTED_MODULE_3__[\"default\"])(point0, point1))) {\n stream.point(point1[0], point1[1]);\n }\n point0 = point1, v0 = v, c0 = c;\n },\n lineEnd: function() {\n if (v0) stream.lineEnd();\n point0 = null;\n },\n // Rejoin first and last segments if there were intersections and the first\n // and last points were visible.\n clean: function() {\n return clean | ((v00 && v0) << 1);\n }\n };\n }", "function clipLine(stream) {\n var point0, // previous point\n c0, // code for previous point\n v0, // visibility of previous point\n v00, // visibility of first point\n clean; // no intersections\n return {\n lineStart: function() {\n v00 = v0 = false;\n clean = 1;\n },\n point: function(lambda, phi) {\n var point1 = [lambda, phi],\n point2,\n v = visible(lambda, phi),\n c = smallRadius\n ? v ? 0 : code(lambda, phi)\n : v ? code(lambda + (lambda < 0 ? _math_js__WEBPACK_IMPORTED_MODULE_0__.pi : -_math_js__WEBPACK_IMPORTED_MODULE_0__.pi), phi) : 0;\n if (!point0 && (v00 = v0 = v)) stream.lineStart();\n // Handle degeneracies.\n // TODO ignore if not clipping polygons.\n if (v !== v0) {\n point2 = intersect(point0, point1);\n if (!point2 || (0,_pointEqual_js__WEBPACK_IMPORTED_MODULE_2__.default)(point0, point2) || (0,_pointEqual_js__WEBPACK_IMPORTED_MODULE_2__.default)(point1, point2)) {\n point1[0] += _math_js__WEBPACK_IMPORTED_MODULE_0__.epsilon;\n point1[1] += _math_js__WEBPACK_IMPORTED_MODULE_0__.epsilon;\n v = visible(point1[0], point1[1]);\n }\n }\n if (v !== v0) {\n clean = 0;\n if (v) {\n // outside going in\n stream.lineStart();\n point2 = intersect(point1, point0);\n stream.point(point2[0], point2[1]);\n } else {\n // inside going out\n point2 = intersect(point0, point1);\n stream.point(point2[0], point2[1]);\n stream.lineEnd();\n }\n point0 = point2;\n } else if (notHemisphere && point0 && smallRadius ^ v) {\n var t;\n // If the codes for two points are different, or are both zero,\n // and there this segment intersects with the small circle.\n if (!(c & c0) && (t = intersect(point1, point0, true))) {\n clean = 0;\n if (smallRadius) {\n stream.lineStart();\n stream.point(t[0][0], t[0][1]);\n stream.point(t[1][0], t[1][1]);\n stream.lineEnd();\n } else {\n stream.point(t[1][0], t[1][1]);\n stream.lineEnd();\n stream.lineStart();\n stream.point(t[0][0], t[0][1]);\n }\n }\n }\n if (v && (!point0 || !(0,_pointEqual_js__WEBPACK_IMPORTED_MODULE_2__.default)(point0, point1))) {\n stream.point(point1[0], point1[1]);\n }\n point0 = point1, v0 = v, c0 = c;\n },\n lineEnd: function() {\n if (v0) stream.lineEnd();\n point0 = null;\n },\n // Rejoin first and last segments if there were intersections and the first\n // and last points were visible.\n clean: function() {\n return clean | ((v00 && v0) << 1);\n }\n };\n }", "function clipLine(stream) {\n var point0, // previous point\n c0, // code for previous point\n v0, // visibility of previous point\n v00, // visibility of first point\n clean; // no intersections\n return {\n lineStart: function() {\n v00 = v0 = false;\n clean = 1;\n },\n point: function(lambda, phi) {\n var point1 = [lambda, phi],\n point2,\n v = visible(lambda, phi),\n c = smallRadius\n ? v ? 0 : code(lambda, phi)\n : v ? code(lambda + (lambda < 0 ? _math_js__WEBPACK_IMPORTED_MODULE_0__.pi : -_math_js__WEBPACK_IMPORTED_MODULE_0__.pi), phi) : 0;\n if (!point0 && (v00 = v0 = v)) stream.lineStart();\n if (v !== v0) {\n point2 = intersect(point0, point1);\n if (!point2 || (0,_pointEqual_js__WEBPACK_IMPORTED_MODULE_2__.default)(point0, point2) || (0,_pointEqual_js__WEBPACK_IMPORTED_MODULE_2__.default)(point1, point2))\n point1[2] = 1;\n }\n if (v !== v0) {\n clean = 0;\n if (v) {\n // outside going in\n stream.lineStart();\n point2 = intersect(point1, point0);\n stream.point(point2[0], point2[1]);\n } else {\n // inside going out\n point2 = intersect(point0, point1);\n stream.point(point2[0], point2[1], 2);\n stream.lineEnd();\n }\n point0 = point2;\n } else if (notHemisphere && point0 && smallRadius ^ v) {\n var t;\n // If the codes for two points are different, or are both zero,\n // and there this segment intersects with the small circle.\n if (!(c & c0) && (t = intersect(point1, point0, true))) {\n clean = 0;\n if (smallRadius) {\n stream.lineStart();\n stream.point(t[0][0], t[0][1]);\n stream.point(t[1][0], t[1][1]);\n stream.lineEnd();\n } else {\n stream.point(t[1][0], t[1][1]);\n stream.lineEnd();\n stream.lineStart();\n stream.point(t[0][0], t[0][1], 3);\n }\n }\n }\n if (v && (!point0 || !(0,_pointEqual_js__WEBPACK_IMPORTED_MODULE_2__.default)(point0, point1))) {\n stream.point(point1[0], point1[1]);\n }\n point0 = point1, v0 = v, c0 = c;\n },\n lineEnd: function() {\n if (v0) stream.lineEnd();\n point0 = null;\n },\n // Rejoin first and last segments if there were intersections and the first\n // and last points were visible.\n clean: function() {\n return clean | ((v00 && v0) << 1);\n }\n };\n }", "function clipLine(stream) {\n var point0, // previous point\n c0, // code for previous point\n v0, // visibility of previous point\n v00, // visibility of first point\n clean; // no intersections\n return {\n lineStart: function() {\n v00 = v0 = false;\n clean = 1;\n },\n point: function(lambda, phi) {\n var point1 = [lambda, phi],\n point2,\n v = visible(lambda, phi),\n c = smallRadius\n ? v ? 0 : code(lambda, phi)\n : v ? code(lambda + (lambda < 0 ? _math_js__WEBPACK_IMPORTED_MODULE_0__.pi : -_math_js__WEBPACK_IMPORTED_MODULE_0__.pi), phi) : 0;\n if (!point0 && (v00 = v0 = v)) stream.lineStart();\n if (v !== v0) {\n point2 = intersect(point0, point1);\n if (!point2 || (0,_pointEqual_js__WEBPACK_IMPORTED_MODULE_2__.default)(point0, point2) || (0,_pointEqual_js__WEBPACK_IMPORTED_MODULE_2__.default)(point1, point2))\n point1[2] = 1;\n }\n if (v !== v0) {\n clean = 0;\n if (v) {\n // outside going in\n stream.lineStart();\n point2 = intersect(point1, point0);\n stream.point(point2[0], point2[1]);\n } else {\n // inside going out\n point2 = intersect(point0, point1);\n stream.point(point2[0], point2[1], 2);\n stream.lineEnd();\n }\n point0 = point2;\n } else if (notHemisphere && point0 && smallRadius ^ v) {\n var t;\n // If the codes for two points are different, or are both zero,\n // and there this segment intersects with the small circle.\n if (!(c & c0) && (t = intersect(point1, point0, true))) {\n clean = 0;\n if (smallRadius) {\n stream.lineStart();\n stream.point(t[0][0], t[0][1]);\n stream.point(t[1][0], t[1][1]);\n stream.lineEnd();\n } else {\n stream.point(t[1][0], t[1][1]);\n stream.lineEnd();\n stream.lineStart();\n stream.point(t[0][0], t[0][1], 3);\n }\n }\n }\n if (v && (!point0 || !(0,_pointEqual_js__WEBPACK_IMPORTED_MODULE_2__.default)(point0, point1))) {\n stream.point(point1[0], point1[1]);\n }\n point0 = point1, v0 = v, c0 = c;\n },\n lineEnd: function() {\n if (v0) stream.lineEnd();\n point0 = null;\n },\n // Rejoin first and last segments if there were intersections and the first\n // and last points were visible.\n clean: function() {\n return clean | ((v00 && v0) << 1);\n }\n };\n }", "function _drawLineStrip(points, color) {\n if (points.length < 2) {\n console.error('Line strips must have at least 2 points.');\n return;\n }\n\n var p = new Primitive();\n\n p.vertices = points;\n p.color = toColor(color);\n\n renderer.addPrimitive(p);\n }", "function clipLine(stream) {\n var point0, // previous point\n c0, // code for previous point\n v0, // visibility of previous point\n v00, // visibility of first point\n clean; // no intersections\n return {\n lineStart: function() {\n v00 = v0 = false;\n clean = 1;\n },\n point: function(lambda, phi) {\n var point1 = [lambda, phi],\n point2,\n v = visible(lambda, phi),\n c = smallRadius\n ? v ? 0 : code(lambda, phi)\n : v ? code(lambda + (lambda < 0 ? __WEBPACK_IMPORTED_MODULE_2__math__[\"o\" /* pi */] : -__WEBPACK_IMPORTED_MODULE_2__math__[\"o\" /* pi */]), phi) : 0;\n if (!point0 && (v00 = v0 = v)) stream.lineStart();\n // Handle degeneracies.\n // TODO ignore if not clipping polygons.\n if (v !== v0) {\n point2 = intersect(point0, point1);\n if (!point2 || Object(__WEBPACK_IMPORTED_MODULE_3__pointEqual__[\"a\" /* default */])(point0, point2) || Object(__WEBPACK_IMPORTED_MODULE_3__pointEqual__[\"a\" /* default */])(point1, point2)) {\n point1[0] += __WEBPACK_IMPORTED_MODULE_2__math__[\"i\" /* epsilon */];\n point1[1] += __WEBPACK_IMPORTED_MODULE_2__math__[\"i\" /* epsilon */];\n v = visible(point1[0], point1[1]);\n }\n }\n if (v !== v0) {\n clean = 0;\n if (v) {\n // outside going in\n stream.lineStart();\n point2 = intersect(point1, point0);\n stream.point(point2[0], point2[1]);\n } else {\n // inside going out\n point2 = intersect(point0, point1);\n stream.point(point2[0], point2[1]);\n stream.lineEnd();\n }\n point0 = point2;\n } else if (notHemisphere && point0 && smallRadius ^ v) {\n var t;\n // If the codes for two points are different, or are both zero,\n // and there this segment intersects with the small circle.\n if (!(c & c0) && (t = intersect(point1, point0, true))) {\n clean = 0;\n if (smallRadius) {\n stream.lineStart();\n stream.point(t[0][0], t[0][1]);\n stream.point(t[1][0], t[1][1]);\n stream.lineEnd();\n } else {\n stream.point(t[1][0], t[1][1]);\n stream.lineEnd();\n stream.lineStart();\n stream.point(t[0][0], t[0][1]);\n }\n }\n }\n if (v && (!point0 || !Object(__WEBPACK_IMPORTED_MODULE_3__pointEqual__[\"a\" /* default */])(point0, point1))) {\n stream.point(point1[0], point1[1]);\n }\n point0 = point1, v0 = v, c0 = c;\n },\n lineEnd: function() {\n if (v0) stream.lineEnd();\n point0 = null;\n },\n // Rejoin first and last segments if there were intersections and the first\n // and last points were visible.\n clean: function() {\n return clean | ((v00 && v0) << 1);\n }\n };\n }", "function clipLine(stream) {\n var point0, // previous point\n c0, // code for previous point\n v0, // visibility of previous point\n v00, // visibility of first point\n clean; // no intersections\n return {\n lineStart: function() {\n v00 = v0 = false;\n clean = 1;\n },\n point: function(lambda, phi) {\n var point1 = [lambda, phi],\n point2,\n v = visible(lambda, phi),\n c = smallRadius\n ? v ? 0 : code(lambda, phi)\n : v ? code(lambda + (lambda < 0 ? __WEBPACK_IMPORTED_MODULE_2__math__[\"o\" /* pi */] : -__WEBPACK_IMPORTED_MODULE_2__math__[\"o\" /* pi */]), phi) : 0;\n if (!point0 && (v00 = v0 = v)) stream.lineStart();\n // Handle degeneracies.\n // TODO ignore if not clipping polygons.\n if (v !== v0) {\n point2 = intersect(point0, point1);\n if (!point2 || Object(__WEBPACK_IMPORTED_MODULE_3__pointEqual__[\"a\" /* default */])(point0, point2) || Object(__WEBPACK_IMPORTED_MODULE_3__pointEqual__[\"a\" /* default */])(point1, point2)) {\n point1[0] += __WEBPACK_IMPORTED_MODULE_2__math__[\"i\" /* epsilon */];\n point1[1] += __WEBPACK_IMPORTED_MODULE_2__math__[\"i\" /* epsilon */];\n v = visible(point1[0], point1[1]);\n }\n }\n if (v !== v0) {\n clean = 0;\n if (v) {\n // outside going in\n stream.lineStart();\n point2 = intersect(point1, point0);\n stream.point(point2[0], point2[1]);\n } else {\n // inside going out\n point2 = intersect(point0, point1);\n stream.point(point2[0], point2[1]);\n stream.lineEnd();\n }\n point0 = point2;\n } else if (notHemisphere && point0 && smallRadius ^ v) {\n var t;\n // If the codes for two points are different, or are both zero,\n // and there this segment intersects with the small circle.\n if (!(c & c0) && (t = intersect(point1, point0, true))) {\n clean = 0;\n if (smallRadius) {\n stream.lineStart();\n stream.point(t[0][0], t[0][1]);\n stream.point(t[1][0], t[1][1]);\n stream.lineEnd();\n } else {\n stream.point(t[1][0], t[1][1]);\n stream.lineEnd();\n stream.lineStart();\n stream.point(t[0][0], t[0][1]);\n }\n }\n }\n if (v && (!point0 || !Object(__WEBPACK_IMPORTED_MODULE_3__pointEqual__[\"a\" /* default */])(point0, point1))) {\n stream.point(point1[0], point1[1]);\n }\n point0 = point1, v0 = v, c0 = c;\n },\n lineEnd: function() {\n if (v0) stream.lineEnd();\n point0 = null;\n },\n // Rejoin first and last segments if there were intersections and the first\n // and last points were visible.\n clean: function() {\n return clean | ((v00 && v0) << 1);\n }\n };\n }", "function clipLine(stream) {\n var point0, // previous point\n c0, // code for previous point\n v0, // visibility of previous point\n v00, // visibility of first point\n clean; // no intersections\n return {\n lineStart: function() {\n v00 = v0 = false;\n clean = 1;\n },\n point: function(lambda, phi) {\n var point1 = [lambda, phi],\n point2,\n v = visible(lambda, phi),\n c = smallRadius\n ? v ? 0 : code(lambda, phi)\n : v ? code(lambda + (lambda < 0 ? __WEBPACK_IMPORTED_MODULE_2__math__[\"o\" /* pi */] : -__WEBPACK_IMPORTED_MODULE_2__math__[\"o\" /* pi */]), phi) : 0;\n if (!point0 && (v00 = v0 = v)) stream.lineStart();\n // Handle degeneracies.\n // TODO ignore if not clipping polygons.\n if (v !== v0) {\n point2 = intersect(point0, point1);\n if (!point2 || Object(__WEBPACK_IMPORTED_MODULE_3__pointEqual__[\"a\" /* default */])(point0, point2) || Object(__WEBPACK_IMPORTED_MODULE_3__pointEqual__[\"a\" /* default */])(point1, point2)) {\n point1[0] += __WEBPACK_IMPORTED_MODULE_2__math__[\"i\" /* epsilon */];\n point1[1] += __WEBPACK_IMPORTED_MODULE_2__math__[\"i\" /* epsilon */];\n v = visible(point1[0], point1[1]);\n }\n }\n if (v !== v0) {\n clean = 0;\n if (v) {\n // outside going in\n stream.lineStart();\n point2 = intersect(point1, point0);\n stream.point(point2[0], point2[1]);\n } else {\n // inside going out\n point2 = intersect(point0, point1);\n stream.point(point2[0], point2[1]);\n stream.lineEnd();\n }\n point0 = point2;\n } else if (notHemisphere && point0 && smallRadius ^ v) {\n var t;\n // If the codes for two points are different, or are both zero,\n // and there this segment intersects with the small circle.\n if (!(c & c0) && (t = intersect(point1, point0, true))) {\n clean = 0;\n if (smallRadius) {\n stream.lineStart();\n stream.point(t[0][0], t[0][1]);\n stream.point(t[1][0], t[1][1]);\n stream.lineEnd();\n } else {\n stream.point(t[1][0], t[1][1]);\n stream.lineEnd();\n stream.lineStart();\n stream.point(t[0][0], t[0][1]);\n }\n }\n }\n if (v && (!point0 || !Object(__WEBPACK_IMPORTED_MODULE_3__pointEqual__[\"a\" /* default */])(point0, point1))) {\n stream.point(point1[0], point1[1]);\n }\n point0 = point1, v0 = v, c0 = c;\n },\n lineEnd: function() {\n if (v0) stream.lineEnd();\n point0 = null;\n },\n // Rejoin first and last segments if there were intersections and the first\n // and last points were visible.\n clean: function() {\n return clean | ((v00 && v0) << 1);\n }\n };\n }", "function clipLine(stream) {\n var point0, // previous point\n c0, // code for previous point\n v0, // visibility of previous point\n v00, // visibility of first point\n clean; // no intersections\n return {\n lineStart: function() {\n v00 = v0 = false;\n clean = 1;\n },\n point: function(lambda, phi) {\n var point1 = [lambda, phi],\n point2,\n v = visible(lambda, phi),\n c = smallRadius\n ? v ? 0 : code(lambda, phi)\n : v ? code(lambda + (lambda < 0 ? __WEBPACK_IMPORTED_MODULE_2__math__[\"o\" /* pi */] : -__WEBPACK_IMPORTED_MODULE_2__math__[\"o\" /* pi */]), phi) : 0;\n if (!point0 && (v00 = v0 = v)) stream.lineStart();\n // Handle degeneracies.\n // TODO ignore if not clipping polygons.\n if (v !== v0) {\n point2 = intersect(point0, point1);\n if (!point2 || Object(__WEBPACK_IMPORTED_MODULE_3__pointEqual__[\"a\" /* default */])(point0, point2) || Object(__WEBPACK_IMPORTED_MODULE_3__pointEqual__[\"a\" /* default */])(point1, point2)) {\n point1[0] += __WEBPACK_IMPORTED_MODULE_2__math__[\"i\" /* epsilon */];\n point1[1] += __WEBPACK_IMPORTED_MODULE_2__math__[\"i\" /* epsilon */];\n v = visible(point1[0], point1[1]);\n }\n }\n if (v !== v0) {\n clean = 0;\n if (v) {\n // outside going in\n stream.lineStart();\n point2 = intersect(point1, point0);\n stream.point(point2[0], point2[1]);\n } else {\n // inside going out\n point2 = intersect(point0, point1);\n stream.point(point2[0], point2[1]);\n stream.lineEnd();\n }\n point0 = point2;\n } else if (notHemisphere && point0 && smallRadius ^ v) {\n var t;\n // If the codes for two points are different, or are both zero,\n // and there this segment intersects with the small circle.\n if (!(c & c0) && (t = intersect(point1, point0, true))) {\n clean = 0;\n if (smallRadius) {\n stream.lineStart();\n stream.point(t[0][0], t[0][1]);\n stream.point(t[1][0], t[1][1]);\n stream.lineEnd();\n } else {\n stream.point(t[1][0], t[1][1]);\n stream.lineEnd();\n stream.lineStart();\n stream.point(t[0][0], t[0][1]);\n }\n }\n }\n if (v && (!point0 || !Object(__WEBPACK_IMPORTED_MODULE_3__pointEqual__[\"a\" /* default */])(point0, point1))) {\n stream.point(point1[0], point1[1]);\n }\n point0 = point1, v0 = v, c0 = c;\n },\n lineEnd: function() {\n if (v0) stream.lineEnd();\n point0 = null;\n },\n // Rejoin first and last segments if there were intersections and the first\n // and last points were visible.\n clean: function() {\n return clean | ((v00 && v0) << 1);\n }\n };\n }", "function clipLine(stream) {\n var point0, // previous point\n c0, // code for previous point\n v0, // visibility of previous point\n v00, // visibility of first point\n clean; // no intersections\n return {\n lineStart: function() {\n v00 = v0 = false;\n clean = 1;\n },\n point: function(lambda, phi) {\n var point1 = [lambda, phi],\n point2,\n v = visible(lambda, phi),\n c = smallRadius\n ? v ? 0 : code(lambda, phi)\n : v ? code(lambda + (lambda < 0 ? __WEBPACK_IMPORTED_MODULE_2__math__[\"o\" /* pi */] : -__WEBPACK_IMPORTED_MODULE_2__math__[\"o\" /* pi */]), phi) : 0;\n if (!point0 && (v00 = v0 = v)) stream.lineStart();\n // Handle degeneracies.\n // TODO ignore if not clipping polygons.\n if (v !== v0) {\n point2 = intersect(point0, point1);\n if (!point2 || Object(__WEBPACK_IMPORTED_MODULE_3__pointEqual__[\"a\" /* default */])(point0, point2) || Object(__WEBPACK_IMPORTED_MODULE_3__pointEqual__[\"a\" /* default */])(point1, point2)) {\n point1[0] += __WEBPACK_IMPORTED_MODULE_2__math__[\"i\" /* epsilon */];\n point1[1] += __WEBPACK_IMPORTED_MODULE_2__math__[\"i\" /* epsilon */];\n v = visible(point1[0], point1[1]);\n }\n }\n if (v !== v0) {\n clean = 0;\n if (v) {\n // outside going in\n stream.lineStart();\n point2 = intersect(point1, point0);\n stream.point(point2[0], point2[1]);\n } else {\n // inside going out\n point2 = intersect(point0, point1);\n stream.point(point2[0], point2[1]);\n stream.lineEnd();\n }\n point0 = point2;\n } else if (notHemisphere && point0 && smallRadius ^ v) {\n var t;\n // If the codes for two points are different, or are both zero,\n // and there this segment intersects with the small circle.\n if (!(c & c0) && (t = intersect(point1, point0, true))) {\n clean = 0;\n if (smallRadius) {\n stream.lineStart();\n stream.point(t[0][0], t[0][1]);\n stream.point(t[1][0], t[1][1]);\n stream.lineEnd();\n } else {\n stream.point(t[1][0], t[1][1]);\n stream.lineEnd();\n stream.lineStart();\n stream.point(t[0][0], t[0][1]);\n }\n }\n }\n if (v && (!point0 || !Object(__WEBPACK_IMPORTED_MODULE_3__pointEqual__[\"a\" /* default */])(point0, point1))) {\n stream.point(point1[0], point1[1]);\n }\n point0 = point1, v0 = v, c0 = c;\n },\n lineEnd: function() {\n if (v0) stream.lineEnd();\n point0 = null;\n },\n // Rejoin first and last segments if there were intersections and the first\n // and last points were visible.\n clean: function() {\n return clean | ((v00 && v0) << 1);\n }\n };\n }", "function clipLine(stream) {\n var point0, // previous point\n c0, // code for previous point\n v0, // visibility of previous point\n v00, // visibility of first point\n clean; // no intersections\n return {\n lineStart: function() {\n v00 = v0 = false;\n clean = 1;\n },\n point: function(lambda, phi) {\n var point1 = [lambda, phi],\n point2,\n v = visible(lambda, phi),\n c = smallRadius\n ? v ? 0 : code(lambda, phi)\n : v ? code(lambda + (lambda < 0 ? __WEBPACK_IMPORTED_MODULE_2__math__[\"o\" /* pi */] : -__WEBPACK_IMPORTED_MODULE_2__math__[\"o\" /* pi */]), phi) : 0;\n if (!point0 && (v00 = v0 = v)) stream.lineStart();\n // Handle degeneracies.\n // TODO ignore if not clipping polygons.\n if (v !== v0) {\n point2 = intersect(point0, point1);\n if (!point2 || Object(__WEBPACK_IMPORTED_MODULE_3__pointEqual__[\"a\" /* default */])(point0, point2) || Object(__WEBPACK_IMPORTED_MODULE_3__pointEqual__[\"a\" /* default */])(point1, point2)) {\n point1[0] += __WEBPACK_IMPORTED_MODULE_2__math__[\"i\" /* epsilon */];\n point1[1] += __WEBPACK_IMPORTED_MODULE_2__math__[\"i\" /* epsilon */];\n v = visible(point1[0], point1[1]);\n }\n }\n if (v !== v0) {\n clean = 0;\n if (v) {\n // outside going in\n stream.lineStart();\n point2 = intersect(point1, point0);\n stream.point(point2[0], point2[1]);\n } else {\n // inside going out\n point2 = intersect(point0, point1);\n stream.point(point2[0], point2[1]);\n stream.lineEnd();\n }\n point0 = point2;\n } else if (notHemisphere && point0 && smallRadius ^ v) {\n var t;\n // If the codes for two points are different, or are both zero,\n // and there this segment intersects with the small circle.\n if (!(c & c0) && (t = intersect(point1, point0, true))) {\n clean = 0;\n if (smallRadius) {\n stream.lineStart();\n stream.point(t[0][0], t[0][1]);\n stream.point(t[1][0], t[1][1]);\n stream.lineEnd();\n } else {\n stream.point(t[1][0], t[1][1]);\n stream.lineEnd();\n stream.lineStart();\n stream.point(t[0][0], t[0][1]);\n }\n }\n }\n if (v && (!point0 || !Object(__WEBPACK_IMPORTED_MODULE_3__pointEqual__[\"a\" /* default */])(point0, point1))) {\n stream.point(point1[0], point1[1]);\n }\n point0 = point1, v0 = v, c0 = c;\n },\n lineEnd: function() {\n if (v0) stream.lineEnd();\n point0 = null;\n },\n // Rejoin first and last segments if there were intersections and the first\n // and last points were visible.\n clean: function() {\n return clean | ((v00 && v0) << 1);\n }\n };\n }", "function clipLine(stream) {\n var point0, // previous point\n c0, // code for previous point\n v0, // visibility of previous point\n v00, // visibility of first point\n clean; // no intersections\n return {\n lineStart: function() {\n v00 = v0 = false;\n clean = 1;\n },\n point: function(lambda, phi) {\n var point1 = [lambda, phi],\n point2,\n v = visible(lambda, phi),\n c = smallRadius\n ? v ? 0 : code(lambda, phi)\n : v ? code(lambda + (lambda < 0 ? __WEBPACK_IMPORTED_MODULE_2__math__[\"o\" /* pi */] : -__WEBPACK_IMPORTED_MODULE_2__math__[\"o\" /* pi */]), phi) : 0;\n if (!point0 && (v00 = v0 = v)) stream.lineStart();\n // Handle degeneracies.\n // TODO ignore if not clipping polygons.\n if (v !== v0) {\n point2 = intersect(point0, point1);\n if (!point2 || Object(__WEBPACK_IMPORTED_MODULE_3__pointEqual__[\"a\" /* default */])(point0, point2) || Object(__WEBPACK_IMPORTED_MODULE_3__pointEqual__[\"a\" /* default */])(point1, point2)) {\n point1[0] += __WEBPACK_IMPORTED_MODULE_2__math__[\"i\" /* epsilon */];\n point1[1] += __WEBPACK_IMPORTED_MODULE_2__math__[\"i\" /* epsilon */];\n v = visible(point1[0], point1[1]);\n }\n }\n if (v !== v0) {\n clean = 0;\n if (v) {\n // outside going in\n stream.lineStart();\n point2 = intersect(point1, point0);\n stream.point(point2[0], point2[1]);\n } else {\n // inside going out\n point2 = intersect(point0, point1);\n stream.point(point2[0], point2[1]);\n stream.lineEnd();\n }\n point0 = point2;\n } else if (notHemisphere && point0 && smallRadius ^ v) {\n var t;\n // If the codes for two points are different, or are both zero,\n // and there this segment intersects with the small circle.\n if (!(c & c0) && (t = intersect(point1, point0, true))) {\n clean = 0;\n if (smallRadius) {\n stream.lineStart();\n stream.point(t[0][0], t[0][1]);\n stream.point(t[1][0], t[1][1]);\n stream.lineEnd();\n } else {\n stream.point(t[1][0], t[1][1]);\n stream.lineEnd();\n stream.lineStart();\n stream.point(t[0][0], t[0][1]);\n }\n }\n }\n if (v && (!point0 || !Object(__WEBPACK_IMPORTED_MODULE_3__pointEqual__[\"a\" /* default */])(point0, point1))) {\n stream.point(point1[0], point1[1]);\n }\n point0 = point1, v0 = v, c0 = c;\n },\n lineEnd: function() {\n if (v0) stream.lineEnd();\n point0 = null;\n },\n // Rejoin first and last segments if there were intersections and the first\n // and last points were visible.\n clean: function() {\n return clean | ((v00 && v0) << 1);\n }\n };\n }", "function clipLine(stream) {\n var point0, // previous point\n c0, // code for previous point\n v0, // visibility of previous point\n v00, // visibility of first point\n clean; // no intersections\n return {\n lineStart: function() {\n v00 = v0 = false;\n clean = 1;\n },\n point: function(lambda, phi) {\n var point1 = [lambda, phi],\n point2,\n v = visible(lambda, phi),\n c = smallRadius\n ? v ? 0 : code(lambda, phi)\n : v ? code(lambda + (lambda < 0 ? __WEBPACK_IMPORTED_MODULE_2__math__[\"o\" /* pi */] : -__WEBPACK_IMPORTED_MODULE_2__math__[\"o\" /* pi */]), phi) : 0;\n if (!point0 && (v00 = v0 = v)) stream.lineStart();\n // Handle degeneracies.\n // TODO ignore if not clipping polygons.\n if (v !== v0) {\n point2 = intersect(point0, point1);\n if (!point2 || Object(__WEBPACK_IMPORTED_MODULE_3__pointEqual__[\"a\" /* default */])(point0, point2) || Object(__WEBPACK_IMPORTED_MODULE_3__pointEqual__[\"a\" /* default */])(point1, point2)) {\n point1[0] += __WEBPACK_IMPORTED_MODULE_2__math__[\"i\" /* epsilon */];\n point1[1] += __WEBPACK_IMPORTED_MODULE_2__math__[\"i\" /* epsilon */];\n v = visible(point1[0], point1[1]);\n }\n }\n if (v !== v0) {\n clean = 0;\n if (v) {\n // outside going in\n stream.lineStart();\n point2 = intersect(point1, point0);\n stream.point(point2[0], point2[1]);\n } else {\n // inside going out\n point2 = intersect(point0, point1);\n stream.point(point2[0], point2[1]);\n stream.lineEnd();\n }\n point0 = point2;\n } else if (notHemisphere && point0 && smallRadius ^ v) {\n var t;\n // If the codes for two points are different, or are both zero,\n // and there this segment intersects with the small circle.\n if (!(c & c0) && (t = intersect(point1, point0, true))) {\n clean = 0;\n if (smallRadius) {\n stream.lineStart();\n stream.point(t[0][0], t[0][1]);\n stream.point(t[1][0], t[1][1]);\n stream.lineEnd();\n } else {\n stream.point(t[1][0], t[1][1]);\n stream.lineEnd();\n stream.lineStart();\n stream.point(t[0][0], t[0][1]);\n }\n }\n }\n if (v && (!point0 || !Object(__WEBPACK_IMPORTED_MODULE_3__pointEqual__[\"a\" /* default */])(point0, point1))) {\n stream.point(point1[0], point1[1]);\n }\n point0 = point1, v0 = v, c0 = c;\n },\n lineEnd: function() {\n if (v0) stream.lineEnd();\n point0 = null;\n },\n // Rejoin first and last segments if there were intersections and the first\n // and last points were visible.\n clean: function() {\n return clean | ((v00 && v0) << 1);\n }\n };\n }", "function clipLine(stream) {\n var point0, // previous point\n c0, // code for previous point\n v0, // visibility of previous point\n v00, // visibility of first point\n clean; // no intersections\n return {\n lineStart: function() {\n v00 = v0 = false;\n clean = 1;\n },\n point: function(lambda, phi) {\n var point1 = [lambda, phi],\n point2,\n v = visible(lambda, phi),\n c = smallRadius\n ? v ? 0 : code(lambda, phi)\n : v ? code(lambda + (lambda < 0 ? __WEBPACK_IMPORTED_MODULE_2__math__[\"o\" /* pi */] : -__WEBPACK_IMPORTED_MODULE_2__math__[\"o\" /* pi */]), phi) : 0;\n if (!point0 && (v00 = v0 = v)) stream.lineStart();\n // Handle degeneracies.\n // TODO ignore if not clipping polygons.\n if (v !== v0) {\n point2 = intersect(point0, point1);\n if (!point2 || Object(__WEBPACK_IMPORTED_MODULE_3__pointEqual__[\"a\" /* default */])(point0, point2) || Object(__WEBPACK_IMPORTED_MODULE_3__pointEqual__[\"a\" /* default */])(point1, point2)) {\n point1[0] += __WEBPACK_IMPORTED_MODULE_2__math__[\"i\" /* epsilon */];\n point1[1] += __WEBPACK_IMPORTED_MODULE_2__math__[\"i\" /* epsilon */];\n v = visible(point1[0], point1[1]);\n }\n }\n if (v !== v0) {\n clean = 0;\n if (v) {\n // outside going in\n stream.lineStart();\n point2 = intersect(point1, point0);\n stream.point(point2[0], point2[1]);\n } else {\n // inside going out\n point2 = intersect(point0, point1);\n stream.point(point2[0], point2[1]);\n stream.lineEnd();\n }\n point0 = point2;\n } else if (notHemisphere && point0 && smallRadius ^ v) {\n var t;\n // If the codes for two points are different, or are both zero,\n // and there this segment intersects with the small circle.\n if (!(c & c0) && (t = intersect(point1, point0, true))) {\n clean = 0;\n if (smallRadius) {\n stream.lineStart();\n stream.point(t[0][0], t[0][1]);\n stream.point(t[1][0], t[1][1]);\n stream.lineEnd();\n } else {\n stream.point(t[1][0], t[1][1]);\n stream.lineEnd();\n stream.lineStart();\n stream.point(t[0][0], t[0][1]);\n }\n }\n }\n if (v && (!point0 || !Object(__WEBPACK_IMPORTED_MODULE_3__pointEqual__[\"a\" /* default */])(point0, point1))) {\n stream.point(point1[0], point1[1]);\n }\n point0 = point1, v0 = v, c0 = c;\n },\n lineEnd: function() {\n if (v0) stream.lineEnd();\n point0 = null;\n },\n // Rejoin first and last segments if there were intersections and the first\n // and last points were visible.\n clean: function() {\n return clean | ((v00 && v0) << 1);\n }\n };\n }", "function clipLine(stream) {\n var point0, // previous point\n c0, // code for previous point\n v0, // visibility of previous point\n v00, // visibility of first point\n clean; // no intersections\n return {\n lineStart: function() {\n v00 = v0 = false;\n clean = 1;\n },\n point: function(lambda, phi) {\n var point1 = [lambda, phi],\n point2,\n v = visible(lambda, phi),\n c = smallRadius\n ? v ? 0 : code(lambda, phi)\n : v ? code(lambda + (lambda < 0 ? __WEBPACK_IMPORTED_MODULE_2__math__[\"o\" /* pi */] : -__WEBPACK_IMPORTED_MODULE_2__math__[\"o\" /* pi */]), phi) : 0;\n if (!point0 && (v00 = v0 = v)) stream.lineStart();\n // Handle degeneracies.\n // TODO ignore if not clipping polygons.\n if (v !== v0) {\n point2 = intersect(point0, point1);\n if (!point2 || Object(__WEBPACK_IMPORTED_MODULE_3__pointEqual__[\"a\" /* default */])(point0, point2) || Object(__WEBPACK_IMPORTED_MODULE_3__pointEqual__[\"a\" /* default */])(point1, point2)) {\n point1[0] += __WEBPACK_IMPORTED_MODULE_2__math__[\"i\" /* epsilon */];\n point1[1] += __WEBPACK_IMPORTED_MODULE_2__math__[\"i\" /* epsilon */];\n v = visible(point1[0], point1[1]);\n }\n }\n if (v !== v0) {\n clean = 0;\n if (v) {\n // outside going in\n stream.lineStart();\n point2 = intersect(point1, point0);\n stream.point(point2[0], point2[1]);\n } else {\n // inside going out\n point2 = intersect(point0, point1);\n stream.point(point2[0], point2[1]);\n stream.lineEnd();\n }\n point0 = point2;\n } else if (notHemisphere && point0 && smallRadius ^ v) {\n var t;\n // If the codes for two points are different, or are both zero,\n // and there this segment intersects with the small circle.\n if (!(c & c0) && (t = intersect(point1, point0, true))) {\n clean = 0;\n if (smallRadius) {\n stream.lineStart();\n stream.point(t[0][0], t[0][1]);\n stream.point(t[1][0], t[1][1]);\n stream.lineEnd();\n } else {\n stream.point(t[1][0], t[1][1]);\n stream.lineEnd();\n stream.lineStart();\n stream.point(t[0][0], t[0][1]);\n }\n }\n }\n if (v && (!point0 || !Object(__WEBPACK_IMPORTED_MODULE_3__pointEqual__[\"a\" /* default */])(point0, point1))) {\n stream.point(point1[0], point1[1]);\n }\n point0 = point1, v0 = v, c0 = c;\n },\n lineEnd: function() {\n if (v0) stream.lineEnd();\n point0 = null;\n },\n // Rejoin first and last segments if there were intersections and the first\n // and last points were visible.\n clean: function() {\n return clean | ((v00 && v0) << 1);\n }\n };\n }", "function clipLine(stream) {\n var point0, // previous point\n c0, // code for previous point\n v0, // visibility of previous point\n v00, // visibility of first point\n clean; // no intersections\n return {\n lineStart: function() {\n v00 = v0 = false;\n clean = 1;\n },\n point: function(lambda, phi) {\n var point1 = [lambda, phi],\n point2,\n v = visible(lambda, phi),\n c = smallRadius\n ? v ? 0 : code(lambda, phi)\n : v ? code(lambda + (lambda < 0 ? __WEBPACK_IMPORTED_MODULE_2__math__[\"o\" /* pi */] : -__WEBPACK_IMPORTED_MODULE_2__math__[\"o\" /* pi */]), phi) : 0;\n if (!point0 && (v00 = v0 = v)) stream.lineStart();\n // Handle degeneracies.\n // TODO ignore if not clipping polygons.\n if (v !== v0) {\n point2 = intersect(point0, point1);\n if (!point2 || Object(__WEBPACK_IMPORTED_MODULE_3__pointEqual__[\"a\" /* default */])(point0, point2) || Object(__WEBPACK_IMPORTED_MODULE_3__pointEqual__[\"a\" /* default */])(point1, point2)) {\n point1[0] += __WEBPACK_IMPORTED_MODULE_2__math__[\"i\" /* epsilon */];\n point1[1] += __WEBPACK_IMPORTED_MODULE_2__math__[\"i\" /* epsilon */];\n v = visible(point1[0], point1[1]);\n }\n }\n if (v !== v0) {\n clean = 0;\n if (v) {\n // outside going in\n stream.lineStart();\n point2 = intersect(point1, point0);\n stream.point(point2[0], point2[1]);\n } else {\n // inside going out\n point2 = intersect(point0, point1);\n stream.point(point2[0], point2[1]);\n stream.lineEnd();\n }\n point0 = point2;\n } else if (notHemisphere && point0 && smallRadius ^ v) {\n var t;\n // If the codes for two points are different, or are both zero,\n // and there this segment intersects with the small circle.\n if (!(c & c0) && (t = intersect(point1, point0, true))) {\n clean = 0;\n if (smallRadius) {\n stream.lineStart();\n stream.point(t[0][0], t[0][1]);\n stream.point(t[1][0], t[1][1]);\n stream.lineEnd();\n } else {\n stream.point(t[1][0], t[1][1]);\n stream.lineEnd();\n stream.lineStart();\n stream.point(t[0][0], t[0][1]);\n }\n }\n }\n if (v && (!point0 || !Object(__WEBPACK_IMPORTED_MODULE_3__pointEqual__[\"a\" /* default */])(point0, point1))) {\n stream.point(point1[0], point1[1]);\n }\n point0 = point1, v0 = v, c0 = c;\n },\n lineEnd: function() {\n if (v0) stream.lineEnd();\n point0 = null;\n },\n // Rejoin first and last segments if there were intersections and the first\n // and last points were visible.\n clean: function() {\n return clean | ((v00 && v0) << 1);\n }\n };\n }", "function clipLine(stream) {\n var point0, // previous point\n c0, // code for previous point\n v0, // visibility of previous point\n v00, // visibility of first point\n clean; // no intersections\n return {\n lineStart: function() {\n v00 = v0 = false;\n clean = 1;\n },\n point: function(lambda, phi) {\n var point1 = [lambda, phi],\n point2,\n v = visible(lambda, phi),\n c = smallRadius\n ? v ? 0 : code(lambda, phi)\n : v ? code(lambda + (lambda < 0 ? __WEBPACK_IMPORTED_MODULE_2__math__[\"o\" /* pi */] : -__WEBPACK_IMPORTED_MODULE_2__math__[\"o\" /* pi */]), phi) : 0;\n if (!point0 && (v00 = v0 = v)) stream.lineStart();\n // Handle degeneracies.\n // TODO ignore if not clipping polygons.\n if (v !== v0) {\n point2 = intersect(point0, point1);\n if (!point2 || Object(__WEBPACK_IMPORTED_MODULE_3__pointEqual__[\"a\" /* default */])(point0, point2) || Object(__WEBPACK_IMPORTED_MODULE_3__pointEqual__[\"a\" /* default */])(point1, point2)) {\n point1[0] += __WEBPACK_IMPORTED_MODULE_2__math__[\"i\" /* epsilon */];\n point1[1] += __WEBPACK_IMPORTED_MODULE_2__math__[\"i\" /* epsilon */];\n v = visible(point1[0], point1[1]);\n }\n }\n if (v !== v0) {\n clean = 0;\n if (v) {\n // outside going in\n stream.lineStart();\n point2 = intersect(point1, point0);\n stream.point(point2[0], point2[1]);\n } else {\n // inside going out\n point2 = intersect(point0, point1);\n stream.point(point2[0], point2[1]);\n stream.lineEnd();\n }\n point0 = point2;\n } else if (notHemisphere && point0 && smallRadius ^ v) {\n var t;\n // If the codes for two points are different, or are both zero,\n // and there this segment intersects with the small circle.\n if (!(c & c0) && (t = intersect(point1, point0, true))) {\n clean = 0;\n if (smallRadius) {\n stream.lineStart();\n stream.point(t[0][0], t[0][1]);\n stream.point(t[1][0], t[1][1]);\n stream.lineEnd();\n } else {\n stream.point(t[1][0], t[1][1]);\n stream.lineEnd();\n stream.lineStart();\n stream.point(t[0][0], t[0][1]);\n }\n }\n }\n if (v && (!point0 || !Object(__WEBPACK_IMPORTED_MODULE_3__pointEqual__[\"a\" /* default */])(point0, point1))) {\n stream.point(point1[0], point1[1]);\n }\n point0 = point1, v0 = v, c0 = c;\n },\n lineEnd: function() {\n if (v0) stream.lineEnd();\n point0 = null;\n },\n // Rejoin first and last segments if there were intersections and the first\n // and last points were visible.\n clean: function() {\n return clean | ((v00 && v0) << 1);\n }\n };\n }", "function clipLine(stream) {\n var point0, // previous point\n c0, // code for previous point\n v0, // visibility of previous point\n v00, // visibility of first point\n clean; // no intersections\n return {\n lineStart: function() {\n v00 = v0 = false;\n clean = 1;\n },\n point: function(lambda, phi) {\n var point1 = [lambda, phi],\n point2,\n v = visible(lambda, phi),\n c = smallRadius\n ? v ? 0 : code(lambda, phi)\n : v ? code(lambda + (lambda < 0 ? __WEBPACK_IMPORTED_MODULE_2__math__[\"o\" /* pi */] : -__WEBPACK_IMPORTED_MODULE_2__math__[\"o\" /* pi */]), phi) : 0;\n if (!point0 && (v00 = v0 = v)) stream.lineStart();\n // Handle degeneracies.\n // TODO ignore if not clipping polygons.\n if (v !== v0) {\n point2 = intersect(point0, point1);\n if (!point2 || Object(__WEBPACK_IMPORTED_MODULE_3__pointEqual__[\"a\" /* default */])(point0, point2) || Object(__WEBPACK_IMPORTED_MODULE_3__pointEqual__[\"a\" /* default */])(point1, point2)) {\n point1[0] += __WEBPACK_IMPORTED_MODULE_2__math__[\"i\" /* epsilon */];\n point1[1] += __WEBPACK_IMPORTED_MODULE_2__math__[\"i\" /* epsilon */];\n v = visible(point1[0], point1[1]);\n }\n }\n if (v !== v0) {\n clean = 0;\n if (v) {\n // outside going in\n stream.lineStart();\n point2 = intersect(point1, point0);\n stream.point(point2[0], point2[1]);\n } else {\n // inside going out\n point2 = intersect(point0, point1);\n stream.point(point2[0], point2[1]);\n stream.lineEnd();\n }\n point0 = point2;\n } else if (notHemisphere && point0 && smallRadius ^ v) {\n var t;\n // If the codes for two points are different, or are both zero,\n // and there this segment intersects with the small circle.\n if (!(c & c0) && (t = intersect(point1, point0, true))) {\n clean = 0;\n if (smallRadius) {\n stream.lineStart();\n stream.point(t[0][0], t[0][1]);\n stream.point(t[1][0], t[1][1]);\n stream.lineEnd();\n } else {\n stream.point(t[1][0], t[1][1]);\n stream.lineEnd();\n stream.lineStart();\n stream.point(t[0][0], t[0][1]);\n }\n }\n }\n if (v && (!point0 || !Object(__WEBPACK_IMPORTED_MODULE_3__pointEqual__[\"a\" /* default */])(point0, point1))) {\n stream.point(point1[0], point1[1]);\n }\n point0 = point1, v0 = v, c0 = c;\n },\n lineEnd: function() {\n if (v0) stream.lineEnd();\n point0 = null;\n },\n // Rejoin first and last segments if there were intersections and the first\n // and last points were visible.\n clean: function() {\n return clean | ((v00 && v0) << 1);\n }\n };\n }", "function clipLine(stream) {\n var point0, // previous point\n c0, // code for previous point\n v0, // visibility of previous point\n v00, // visibility of first point\n clean; // no intersections\n return {\n lineStart: function() {\n v00 = v0 = false;\n clean = 1;\n },\n point: function(lambda, phi) {\n var point1 = [lambda, phi],\n point2,\n v = visible(lambda, phi),\n c = smallRadius\n ? v ? 0 : code(lambda, phi)\n : v ? code(lambda + (lambda < 0 ? __WEBPACK_IMPORTED_MODULE_2__math__[\"o\" /* pi */] : -__WEBPACK_IMPORTED_MODULE_2__math__[\"o\" /* pi */]), phi) : 0;\n if (!point0 && (v00 = v0 = v)) stream.lineStart();\n // Handle degeneracies.\n // TODO ignore if not clipping polygons.\n if (v !== v0) {\n point2 = intersect(point0, point1);\n if (!point2 || Object(__WEBPACK_IMPORTED_MODULE_3__pointEqual__[\"a\" /* default */])(point0, point2) || Object(__WEBPACK_IMPORTED_MODULE_3__pointEqual__[\"a\" /* default */])(point1, point2)) {\n point1[0] += __WEBPACK_IMPORTED_MODULE_2__math__[\"i\" /* epsilon */];\n point1[1] += __WEBPACK_IMPORTED_MODULE_2__math__[\"i\" /* epsilon */];\n v = visible(point1[0], point1[1]);\n }\n }\n if (v !== v0) {\n clean = 0;\n if (v) {\n // outside going in\n stream.lineStart();\n point2 = intersect(point1, point0);\n stream.point(point2[0], point2[1]);\n } else {\n // inside going out\n point2 = intersect(point0, point1);\n stream.point(point2[0], point2[1]);\n stream.lineEnd();\n }\n point0 = point2;\n } else if (notHemisphere && point0 && smallRadius ^ v) {\n var t;\n // If the codes for two points are different, or are both zero,\n // and there this segment intersects with the small circle.\n if (!(c & c0) && (t = intersect(point1, point0, true))) {\n clean = 0;\n if (smallRadius) {\n stream.lineStart();\n stream.point(t[0][0], t[0][1]);\n stream.point(t[1][0], t[1][1]);\n stream.lineEnd();\n } else {\n stream.point(t[1][0], t[1][1]);\n stream.lineEnd();\n stream.lineStart();\n stream.point(t[0][0], t[0][1]);\n }\n }\n }\n if (v && (!point0 || !Object(__WEBPACK_IMPORTED_MODULE_3__pointEqual__[\"a\" /* default */])(point0, point1))) {\n stream.point(point1[0], point1[1]);\n }\n point0 = point1, v0 = v, c0 = c;\n },\n lineEnd: function() {\n if (v0) stream.lineEnd();\n point0 = null;\n },\n // Rejoin first and last segments if there were intersections and the first\n // and last points were visible.\n clean: function() {\n return clean | ((v00 && v0) << 1);\n }\n };\n }", "function clipLine(stream) {\n var point0, // previous point\n c0, // code for previous point\n v0, // visibility of previous point\n v00, // visibility of first point\n clean; // no intersections\n return {\n lineStart: function() {\n v00 = v0 = false;\n clean = 1;\n },\n point: function(lambda, phi) {\n var point1 = [lambda, phi],\n point2,\n v = visible(lambda, phi),\n c = smallRadius\n ? v ? 0 : code(lambda, phi)\n : v ? code(lambda + (lambda < 0 ? __WEBPACK_IMPORTED_MODULE_2__math__[\"o\" /* pi */] : -__WEBPACK_IMPORTED_MODULE_2__math__[\"o\" /* pi */]), phi) : 0;\n if (!point0 && (v00 = v0 = v)) stream.lineStart();\n // Handle degeneracies.\n // TODO ignore if not clipping polygons.\n if (v !== v0) {\n point2 = intersect(point0, point1);\n if (!point2 || Object(__WEBPACK_IMPORTED_MODULE_3__pointEqual__[\"a\" /* default */])(point0, point2) || Object(__WEBPACK_IMPORTED_MODULE_3__pointEqual__[\"a\" /* default */])(point1, point2)) {\n point1[0] += __WEBPACK_IMPORTED_MODULE_2__math__[\"i\" /* epsilon */];\n point1[1] += __WEBPACK_IMPORTED_MODULE_2__math__[\"i\" /* epsilon */];\n v = visible(point1[0], point1[1]);\n }\n }\n if (v !== v0) {\n clean = 0;\n if (v) {\n // outside going in\n stream.lineStart();\n point2 = intersect(point1, point0);\n stream.point(point2[0], point2[1]);\n } else {\n // inside going out\n point2 = intersect(point0, point1);\n stream.point(point2[0], point2[1]);\n stream.lineEnd();\n }\n point0 = point2;\n } else if (notHemisphere && point0 && smallRadius ^ v) {\n var t;\n // If the codes for two points are different, or are both zero,\n // and there this segment intersects with the small circle.\n if (!(c & c0) && (t = intersect(point1, point0, true))) {\n clean = 0;\n if (smallRadius) {\n stream.lineStart();\n stream.point(t[0][0], t[0][1]);\n stream.point(t[1][0], t[1][1]);\n stream.lineEnd();\n } else {\n stream.point(t[1][0], t[1][1]);\n stream.lineEnd();\n stream.lineStart();\n stream.point(t[0][0], t[0][1]);\n }\n }\n }\n if (v && (!point0 || !Object(__WEBPACK_IMPORTED_MODULE_3__pointEqual__[\"a\" /* default */])(point0, point1))) {\n stream.point(point1[0], point1[1]);\n }\n point0 = point1, v0 = v, c0 = c;\n },\n lineEnd: function() {\n if (v0) stream.lineEnd();\n point0 = null;\n },\n // Rejoin first and last segments if there were intersections and the first\n // and last points were visible.\n clean: function() {\n return clean | ((v00 && v0) << 1);\n }\n };\n }", "function clipLine(stream) {\n var point0, // previous point\n c0, // code for previous point\n v0, // visibility of previous point\n v00, // visibility of first point\n clean; // no intersections\n return {\n lineStart: function() {\n v00 = v0 = false;\n clean = 1;\n },\n point: function(lambda, phi) {\n var point1 = [lambda, phi],\n point2,\n v = visible(lambda, phi),\n c = smallRadius\n ? v ? 0 : code(lambda, phi)\n : v ? code(lambda + (lambda < 0 ? __WEBPACK_IMPORTED_MODULE_2__math_js__[\"o\" /* pi */] : -__WEBPACK_IMPORTED_MODULE_2__math_js__[\"o\" /* pi */]), phi) : 0;\n if (!point0 && (v00 = v0 = v)) stream.lineStart();\n // Handle degeneracies.\n // TODO ignore if not clipping polygons.\n if (v !== v0) {\n point2 = intersect(point0, point1);\n if (!point2 || Object(__WEBPACK_IMPORTED_MODULE_3__pointEqual_js__[\"a\" /* default */])(point0, point2) || Object(__WEBPACK_IMPORTED_MODULE_3__pointEqual_js__[\"a\" /* default */])(point1, point2)) {\n point1[0] += __WEBPACK_IMPORTED_MODULE_2__math_js__[\"i\" /* epsilon */];\n point1[1] += __WEBPACK_IMPORTED_MODULE_2__math_js__[\"i\" /* epsilon */];\n v = visible(point1[0], point1[1]);\n }\n }\n if (v !== v0) {\n clean = 0;\n if (v) {\n // outside going in\n stream.lineStart();\n point2 = intersect(point1, point0);\n stream.point(point2[0], point2[1]);\n } else {\n // inside going out\n point2 = intersect(point0, point1);\n stream.point(point2[0], point2[1]);\n stream.lineEnd();\n }\n point0 = point2;\n } else if (notHemisphere && point0 && smallRadius ^ v) {\n var t;\n // If the codes for two points are different, or are both zero,\n // and there this segment intersects with the small circle.\n if (!(c & c0) && (t = intersect(point1, point0, true))) {\n clean = 0;\n if (smallRadius) {\n stream.lineStart();\n stream.point(t[0][0], t[0][1]);\n stream.point(t[1][0], t[1][1]);\n stream.lineEnd();\n } else {\n stream.point(t[1][0], t[1][1]);\n stream.lineEnd();\n stream.lineStart();\n stream.point(t[0][0], t[0][1]);\n }\n }\n }\n if (v && (!point0 || !Object(__WEBPACK_IMPORTED_MODULE_3__pointEqual_js__[\"a\" /* default */])(point0, point1))) {\n stream.point(point1[0], point1[1]);\n }\n point0 = point1, v0 = v, c0 = c;\n },\n lineEnd: function() {\n if (v0) stream.lineEnd();\n point0 = null;\n },\n // Rejoin first and last segments if there were intersections and the first\n // and last points were visible.\n clean: function() {\n return clean | ((v00 && v0) << 1);\n }\n };\n }", "function clipLine(stream) {\n var point0, // previous point\n c0, // code for previous point\n v0, // visibility of previous point\n v00, // visibility of first point\n clean; // no intersections\n return {\n lineStart: function() {\n v00 = v0 = false;\n clean = 1;\n },\n point: function(lambda, phi) {\n var point1 = [lambda, phi],\n point2,\n v = visible(lambda, phi),\n c = smallRadius\n ? v ? 0 : code(lambda, phi)\n : v ? code(lambda + (lambda < 0 ? __WEBPACK_IMPORTED_MODULE_2__math__[\"o\" /* pi */] : -__WEBPACK_IMPORTED_MODULE_2__math__[\"o\" /* pi */]), phi) : 0;\n if (!point0 && (v00 = v0 = v)) stream.lineStart();\n // Handle degeneracies.\n // TODO ignore if not clipping polygons.\n if (v !== v0) {\n point2 = intersect(point0, point1);\n if (Object(__WEBPACK_IMPORTED_MODULE_3__pointEqual__[\"a\" /* default */])(point0, point2) || Object(__WEBPACK_IMPORTED_MODULE_3__pointEqual__[\"a\" /* default */])(point1, point2)) {\n point1[0] += __WEBPACK_IMPORTED_MODULE_2__math__[\"i\" /* epsilon */];\n point1[1] += __WEBPACK_IMPORTED_MODULE_2__math__[\"i\" /* epsilon */];\n v = visible(point1[0], point1[1]);\n }\n }\n if (v !== v0) {\n clean = 0;\n if (v) {\n // outside going in\n stream.lineStart();\n point2 = intersect(point1, point0);\n stream.point(point2[0], point2[1]);\n } else {\n // inside going out\n point2 = intersect(point0, point1);\n stream.point(point2[0], point2[1]);\n stream.lineEnd();\n }\n point0 = point2;\n } else if (notHemisphere && point0 && smallRadius ^ v) {\n var t;\n // If the codes for two points are different, or are both zero,\n // and there this segment intersects with the small circle.\n if (!(c & c0) && (t = intersect(point1, point0, true))) {\n clean = 0;\n if (smallRadius) {\n stream.lineStart();\n stream.point(t[0][0], t[0][1]);\n stream.point(t[1][0], t[1][1]);\n stream.lineEnd();\n } else {\n stream.point(t[1][0], t[1][1]);\n stream.lineEnd();\n stream.lineStart();\n stream.point(t[0][0], t[0][1]);\n }\n }\n }\n if (v && (!point0 || !Object(__WEBPACK_IMPORTED_MODULE_3__pointEqual__[\"a\" /* default */])(point0, point1))) {\n stream.point(point1[0], point1[1]);\n }\n point0 = point1, v0 = v, c0 = c;\n },\n lineEnd: function() {\n if (v0) stream.lineEnd();\n point0 = null;\n },\n // Rejoin first and last segments if there were intersections and the first\n // and last points were visible.\n clean: function() {\n return clean | ((v00 && v0) << 1);\n }\n };\n }", "function draw_first_line(){\n points.push(start);\n points.push(end);\n}", "function drawLineBressenhamSimple(buffer, x1, y1, x2, y2, colour) {\n var dx = Math.abs(x2 - x1);\n var dy = Math.abs(y2 - y1);\n var sx, sy;\n if (x1 < x2) {\n sx = 1;\n } else {\n sx = -1;\n }\n if (y1 < y2) {\n sy = 1;\n } else {\n sy = -1;\n }\n var err = dx - dy;\n while (x1 !== x2 && y1 !== y2) {\n setPixel(buffer, x1, y1, colour);\n var e2 = 2 * err;\n if (e2 > -dy) {\n err = err - dy;\n x1 = x1 + sx;\n }\n if (e2 < dx) {\n err = err + dx;\n y1 = y1 + sy;\n }\n }\n}", "function smoothLine(id) {\n let index = indexArray.indexOf(id);\n let config = configArray[index];\n if (config.options.elements.line.tension == '0.4') {\n config.options.elements.line.tension = 0.000001;\n } else {\n config.options.elements.line.tension = 0.4;\n }\n chartsArray[indexArray.indexOf(id)].update();\n}", "function clipLine(stream) {\n var point0, // previous point\n c0, // code for previous point\n v0, // visibility of previous point\n v00, // visibility of first point\n _clean; // no intersections\n return {\n lineStart: function lineStart() {\n v00 = v0 = false;\n _clean = 1;\n },\n point: function point(lambda, phi) {\n var point1 = [lambda, phi],\n point2,\n v = visible(lambda, phi),\n c = smallRadius ? v ? 0 : code(lambda, phi) : v ? code(lambda + (lambda < 0 ? __WEBPACK_IMPORTED_MODULE_2__math__[\"o\" /* pi */] : -__WEBPACK_IMPORTED_MODULE_2__math__[\"o\" /* pi */]), phi) : 0;\n if (!point0 && (v00 = v0 = v)) stream.lineStart();\n // Handle degeneracies.\n // TODO ignore if not clipping polygons.\n if (v !== v0) {\n point2 = intersect(point0, point1);\n if (Object(__WEBPACK_IMPORTED_MODULE_3__pointEqual__[\"a\" /* default */])(point0, point2) || Object(__WEBPACK_IMPORTED_MODULE_3__pointEqual__[\"a\" /* default */])(point1, point2)) {\n point1[0] += __WEBPACK_IMPORTED_MODULE_2__math__[\"i\" /* epsilon */];\n point1[1] += __WEBPACK_IMPORTED_MODULE_2__math__[\"i\" /* epsilon */];\n v = visible(point1[0], point1[1]);\n }\n }\n if (v !== v0) {\n _clean = 0;\n if (v) {\n // outside going in\n stream.lineStart();\n point2 = intersect(point1, point0);\n stream.point(point2[0], point2[1]);\n } else {\n // inside going out\n point2 = intersect(point0, point1);\n stream.point(point2[0], point2[1]);\n stream.lineEnd();\n }\n point0 = point2;\n } else if (notHemisphere && point0 && smallRadius ^ v) {\n var t;\n // If the codes for two points are different, or are both zero,\n // and there this segment intersects with the small circle.\n if (!(c & c0) && (t = intersect(point1, point0, true))) {\n _clean = 0;\n if (smallRadius) {\n stream.lineStart();\n stream.point(t[0][0], t[0][1]);\n stream.point(t[1][0], t[1][1]);\n stream.lineEnd();\n } else {\n stream.point(t[1][0], t[1][1]);\n stream.lineEnd();\n stream.lineStart();\n stream.point(t[0][0], t[0][1]);\n }\n }\n }\n if (v && (!point0 || !Object(__WEBPACK_IMPORTED_MODULE_3__pointEqual__[\"a\" /* default */])(point0, point1))) {\n stream.point(point1[0], point1[1]);\n }\n point0 = point1, v0 = v, c0 = c;\n },\n lineEnd: function lineEnd() {\n if (v0) stream.lineEnd();\n point0 = null;\n },\n // Rejoin first and last segments if there were intersections and the first\n // and last points were visible.\n clean: function clean() {\n return _clean | (v00 && v0) << 1;\n }\n };\n }", "function clipLine(stream) {\n var point0, // previous point\n c0, // code for previous point\n v0, // visibility of previous point\n v00, // visibility of first point\n _clean; // no intersections\n return {\n lineStart: function lineStart() {\n v00 = v0 = false;\n _clean = 1;\n },\n point: function point(lambda, phi) {\n var point1 = [lambda, phi],\n point2,\n v = visible(lambda, phi),\n c = smallRadius ? v ? 0 : code(lambda, phi) : v ? code(lambda + (lambda < 0 ? __WEBPACK_IMPORTED_MODULE_2__math__[\"o\" /* pi */] : -__WEBPACK_IMPORTED_MODULE_2__math__[\"o\" /* pi */]), phi) : 0;\n if (!point0 && (v00 = v0 = v)) stream.lineStart();\n // Handle degeneracies.\n // TODO ignore if not clipping polygons.\n if (v !== v0) {\n point2 = intersect(point0, point1);\n if (!point2 || Object(__WEBPACK_IMPORTED_MODULE_3__pointEqual__[\"a\" /* default */])(point0, point2) || Object(__WEBPACK_IMPORTED_MODULE_3__pointEqual__[\"a\" /* default */])(point1, point2)) {\n point1[0] += __WEBPACK_IMPORTED_MODULE_2__math__[\"i\" /* epsilon */];\n point1[1] += __WEBPACK_IMPORTED_MODULE_2__math__[\"i\" /* epsilon */];\n v = visible(point1[0], point1[1]);\n }\n }\n if (v !== v0) {\n _clean = 0;\n if (v) {\n // outside going in\n stream.lineStart();\n point2 = intersect(point1, point0);\n stream.point(point2[0], point2[1]);\n } else {\n // inside going out\n point2 = intersect(point0, point1);\n stream.point(point2[0], point2[1]);\n stream.lineEnd();\n }\n point0 = point2;\n } else if (notHemisphere && point0 && smallRadius ^ v) {\n var t;\n // If the codes for two points are different, or are both zero,\n // and there this segment intersects with the small circle.\n if (!(c & c0) && (t = intersect(point1, point0, true))) {\n _clean = 0;\n if (smallRadius) {\n stream.lineStart();\n stream.point(t[0][0], t[0][1]);\n stream.point(t[1][0], t[1][1]);\n stream.lineEnd();\n } else {\n stream.point(t[1][0], t[1][1]);\n stream.lineEnd();\n stream.lineStart();\n stream.point(t[0][0], t[0][1]);\n }\n }\n }\n if (v && (!point0 || !Object(__WEBPACK_IMPORTED_MODULE_3__pointEqual__[\"a\" /* default */])(point0, point1))) {\n stream.point(point1[0], point1[1]);\n }\n point0 = point1, v0 = v, c0 = c;\n },\n lineEnd: function lineEnd() {\n if (v0) stream.lineEnd();\n point0 = null;\n },\n // Rejoin first and last segments if there were intersections and the first\n // and last points were visible.\n clean: function clean() {\n return _clean | (v00 && v0) << 1;\n }\n };\n }", "function clipLine(listener) {\n var point0, // previous point\n c0, // code for previous point\n v0, // visibility of previous point\n v00, // visibility of first point\n clean; // no intersections\n return {\n lineStart: function() {\n v00 = v0 = false;\n clean = 1;\n },\n point: function(λ, φ) {\n var point1 = [λ, φ],\n point2,\n v = visible(λ, φ),\n c = smallRadius\n ? v ? 0 : code(λ, φ)\n : v ? code(λ + (λ < 0 ? π : -π), φ) : 0;\n if (!point0 && (v00 = v0 = v)) listener.lineStart();\n // Handle degeneracies.\n // TODO ignore if not clipping polygons.\n if (v !== v0) {\n point2 = intersect(point0, point1);\n if (d3f_geo_sphericalEqual(point0, point2) || d3f_geo_sphericalEqual(point1, point2)) {\n point1[0] += ε;\n point1[1] += ε;\n v = visible(point1[0], point1[1]);\n }\n }\n if (v !== v0) {\n clean = 0;\n if (v) {\n // outside going in\n listener.lineStart();\n point2 = intersect(point1, point0);\n listener.point(point2[0], point2[1]);\n } else {\n // inside going out\n point2 = intersect(point0, point1);\n listener.point(point2[0], point2[1]);\n listener.lineEnd();\n }\n point0 = point2;\n } else if (notHemisphere && point0 && smallRadius ^ v) {\n var t;\n // If the codes for two points are different, or are both zero,\n // and there this segment intersects with the small circle.\n if (!(c & c0) && (t = intersect(point1, point0, true))) {\n clean = 0;\n if (smallRadius) {\n listener.lineStart();\n listener.point(t[0][0], t[0][1]);\n listener.point(t[1][0], t[1][1]);\n listener.lineEnd();\n } else {\n listener.point(t[1][0], t[1][1]);\n listener.lineEnd();\n listener.lineStart();\n listener.point(t[0][0], t[0][1]);\n }\n }\n }\n if (v && (!point0 || !d3f_geo_sphericalEqual(point0, point1))) {\n listener.point(point1[0], point1[1]);\n }\n point0 = point1, v0 = v, c0 = c;\n },\n lineEnd: function() {\n if (v0) listener.lineEnd();\n point0 = null;\n },\n // Rejoin first and last segments if there were intersections and the first\n // and last points were visible.\n clean: function() { return clean | ((v00 && v0) << 1); }\n };\n }", "function d3_svg_lineCardinal(points, tension, closed) {\n return points.length < 3\n ? d3_svg_lineLinear(points)\n : points[0] + d3_svg_lineHermite(points,\n d3_svg_lineCardinalTangents(points, tension));\n}", "function d3_svg_lineCardinal(points, tension, closed) {\n return points.length < 3\n ? d3_svg_lineLinear(points)\n : points[0] + d3_svg_lineHermite(points,\n d3_svg_lineCardinalTangents(points, tension));\n}", "visitLinePixels(visitor, line) {\n const vec = { dx: line.x1 - line.x0, dy: line.y1 - line.y0 }\n // If line is a point we're lazy (and eliminate some special cases)\n if (vec.dx === 0 && vec.dy === 0) {\n const x = Math.floor(line.x0);\n const y = Math.floor(line.y0);\n const idx = x + this.width * y;\n visitor(x, y, idx);\n return;\n }\n const len = Math.sqrt(Math.pow(vec.dx, 2) + Math.pow(vec.dy, 2));\n const unit = { dx: vec.dx / len, dy: vec.dy / len };\n const ortho = { dx: unit.dy, dy: -unit.dx };\n // Using a Set makes it easy to comply with the pixel uniqueness\n // requirement\n const indices = new Set();\n const addPixel = (x, y) => {\n x = Math.floor(x);\n y = Math.floor(y);\n if (x < 0 || x >= this.width)\n return\n if (y < 0 || y >= this.height)\n return;\n const idx = x + this.width * y;\n if (idx !== idx)\n throw new Error('Trying to add NaN as a line pixel index');\n indices.add(idx);\n };\n const pos = { x: line.x0, y: line.y0 };\n const sigX = line.x1 - line.x0;\n const sigY = line.y1 - line.y0;\n do {\n addPixel(pos.x, pos.y);\n for (let i = 0; i < this.strokeWidth; i++) {\n const xt = pos.x + .5 * ortho.dx;\n const yt = pos.y + .5 * ortho.dy;\n addPixel(xt, yt);\n const xb = pos.x - .5 * ortho.dx;\n const yb = pos.y - .5 * ortho.dy;\n addPixel(xb, yb);\n }\n pos.x += unit.dx;\n pos.y += unit.dy;\n } while((line.x1 - pos.x) * sigX > 0 || (line.y1 - pos.y) * sigY > 0);\n const iterator = indices.values();\n for (let i = 0; i < indices.size; i++) {\n const idx = iterator.next().value;\n const x = idx % this.width;\n const y = Math.floor(idx / this.width);\n if (x !== x || y !== y)\n throw new Error('Encountered line coordinates which are NaN');\n const res = visitor(x, y, idx);\n // Bailing mechanism\n if (res === false)\n break;\n }\n }", "function d3_v3_svg_lineCardinal(points, tension, closed) {\n return points.length < 3\n ? d3_v3_svg_lineLinear(points)\n : points[0] + d3_v3_svg_lineHermite(points,\n d3_v3_svg_lineCardinalTangents(points, tension));\n}", "function clipLine(stream) {\n var point0, c0, v0, v00, clean; // no intersections\n return {\n lineStart: function() {\n v00 = v0 = false;\n clean = 1;\n },\n point: function(lambda, phi) {\n var point1 = [\n lambda,\n phi\n ], point2, v = visible(lambda, phi), c = smallRadius ? v ? 0 : code1(lambda, phi) : v ? code1(lambda + (lambda < 0 ? _mathJs.pi : -_mathJs.pi), phi) : 0;\n if (!point0 && (v00 = v0 = v)) stream.lineStart();\n if (v !== v0) {\n point2 = intersect(point0, point1);\n if (!point2 || _pointEqualJsDefault.default(point0, point2) || _pointEqualJsDefault.default(point1, point2)) point1[2] = 1;\n }\n if (v !== v0) {\n clean = 0;\n if (v) {\n // outside going in\n stream.lineStart();\n point2 = intersect(point1, point0);\n stream.point(point2[0], point2[1]);\n } else {\n // inside going out\n point2 = intersect(point0, point1);\n stream.point(point2[0], point2[1], 2);\n stream.lineEnd();\n }\n point0 = point2;\n } else if (notHemisphere && point0 && smallRadius ^ v) {\n var t;\n // If the codes for two points are different, or are both zero,\n // and there this segment intersects with the small circle.\n if (!(c & c0) && (t = intersect(point1, point0, true))) {\n clean = 0;\n if (smallRadius) {\n stream.lineStart();\n stream.point(t[0][0], t[0][1]);\n stream.point(t[1][0], t[1][1]);\n stream.lineEnd();\n } else {\n stream.point(t[1][0], t[1][1]);\n stream.lineEnd();\n stream.lineStart();\n stream.point(t[0][0], t[0][1], 3);\n }\n }\n }\n if (v && (!point0 || !_pointEqualJsDefault.default(point0, point1))) stream.point(point1[0], point1[1]);\n point0 = point1, v0 = v, c0 = c;\n },\n lineEnd: function() {\n if (v0) stream.lineEnd();\n point0 = null;\n },\n // Rejoin first and last segments if there were intersections and the first\n // and last points were visible.\n clean: function() {\n return clean | (v00 && v0) << 1;\n }\n };\n }", "function line(x0, y0, x1, y1){\n var dx = Math.abs(x1-x0);\n var dy = Math.abs(y1-y0);\n var sx = (x0 < x1) ? 1 : -1;\n var sy = (y0 < y1) ? 1 : -1;\n var err = dx-dy;\n var terminationConst = 1.1;\n\n while(true){\n // putPixel\n ctx.fillStyle = 'black';\n ctx.fillRect(x0, y0, 1, 1);\n\n if ((Math.abs(x0-x1) < terminationConst) && (Math.abs(y0-y1) < terminationConst)) break;\n var e2 = 2*err;\n if (e2 >-dy){ err -= dy; x0 += sx; }\n if (e2 < dx){ err += dx; y0 += sy; }\n }\n }", "function line(x1, y1, x2, y2, lW, sS) {\n window.ctx.save();\n window.ctx.lineWidth = lW + 2;\n window.ctx.beginPath();\n window.ctx.moveTo(x1, y1);\n window.ctx.lineTo(x2, y2);\n window.ctx.strokeStyle = \"rgba(0, 0, 0, 0.25)\";\n window.ctx.stroke();\n window.ctx.lineWidth = lW;\n window.ctx.strokeStyle = sS;\n window.ctx.stroke();\n window.ctx.restore();\n}", "function drawOnePixelLine(line, context, color) {\n var imageData;\n if (line.x1 == line.x2) {\n imageData = context.getImageData(line.x1, line.y1, 1, Math.abs(line.y2-line.y1));\n } else if (line.y1 == line.y2) {\n imageData = context.getImageData(line.x1, line.y1, Math.abs(line.x2-line.x1), 1);\n } else {\n alert('error');\n }\n var linedata = imageData.data;\n for (var i = 0; i < linedata.length; ++i) {\n linedata[i++] = color.R;\n linedata[i++] = color.G;\n linedata[i++] = color.B;\n linedata[i] = color.A;\n }\n context.putImageData(imageData, line.x1, line.y1);\n}", "function drawline() {\n\n if (isDrawing) {\n linePoint2 = d3.mouse(this);\n gContainer.select('line').remove();\n gContainer.append('line')\n .attr(\"x1\", linePoint1.x)\n .attr(\"y1\", linePoint1.y)\n .attr(\"x2\", linePoint2[0] - 2) //arbitary value must be substracted due to circle cursor hover not working\n .attr(\"y2\", linePoint2[1] - 2); // arbitary values must be tested\n\n }\n }", "function pinselada() {\n ctx.lineWidth = tamLinea;\n ctx.lineJoin = \"round\";\n ctx.lineCap = \"round\";\n ctx.lineTo(mouse.x, mouse.y);\n ctx.stroke();\n }", "function d3_svg_lineCardinal(points, tension) {\n return points.length < 3\n ? d3_svg_lineLinear(points)\n : points[0] + d3_svg_lineHermite(points,\n d3_svg_lineCardinalTangents(points, tension));\n}", "function drawLine(pointA, pointB, pointC, forPower) {\n\n var pointStatus = false;\n\n // equation of line \"mx-y-(mx1-y1)\" so m = y-y1/x-x1\n var m = (pointB[1] - pointA[1]) / (pointB[0] - pointA[0]);\n var c = pointA[1] - m * pointA[0];\n var b = -1;\n\n var valueAtPointC = m * pointC[0] - pointC[1] + c;\n if ((valueAtPointC == 0) || (valueAtPointC > 0 && b < 0) || (valueAtPointC < 0 && b > 0)) {\n pointStatus = true;\n } else {\n pointStatus = false;\n }\n\n if (!forPower) {\n // calculation for Torque and Speed utilization.\n var peakTorqueUtilization = (pointC[1] * 100) / (m * pointC[0] + c);\n var peakSpeedUtilization = (pointC[0] * 100) / motorData.maxSpeed;\n torqueUtilizationArray.push(peakTorqueUtilization);\n speedUtilizationArray.push(peakSpeedUtilization);\n } else {\n // calculation for average power utilization. formula: power = speed * torque.\n var powerOfApp = pointC[0] * pointC[1];\n var powerOfMotor = pointC[0] * (m * pointC[0] + c);\n var avgPower = (powerOfApp * 100) / powerOfMotor;\n averagePowerArray.push(avgPower);\n }\n\n return pointStatus;\n }", "function drawLine(m, b) {\n m *= -1; // flip\n let x1 = 0;\n let y1 = (x1 * m) + b;\n\n let x2 = W;\n let y2 = (x2 * m) + b;\n\n line(x1, y1,\n x2, y2);\n}", "function drawLine(){\n //loop through the array of coordinates and connect them with a line if they are not directly next to each other\n for (let i = 0; i < savedCoords.length-1; i++){\n if (savedCoords.length > 1) {\n // if x is not directly next to x, or y not next to y\n if ((savedCoords[i][0] != savedCoords[i+1][0]+1) || (savedCoords[i][1] != savedCoords[i+1][1]+1)){\n // set start and end, draw line between them\n draw(savedCoords , i);\n }\n }\n }\n}", "_drawLineLow( x1, y1, x2, y2, id ) {\n const dx = x2 - x1;\n let dy = y2 - y1;\n let yIncrement = 1;\n if ( dy < 0 ) {\n yIncrement = -1;\n dy = -dy;\n }\n\n let decision = 2 * dy - dx;\n let y = y1;\n\n for ( let x = x1; x <= x2; x += 1 ) {\n this.setPixel( x, y, id );\n\n if ( decision > 0 ) {\n y += yIncrement;\n decision = decision - ( 2 * dx );\n }\n\n decision = decision + ( 2 * dy );\n }\n }" ]
[ "0.6029256", "0.6015774", "0.59806824", "0.5928093", "0.5922997", "0.5870417", "0.5858161", "0.5855403", "0.5854368", "0.5852314", "0.5850531", "0.5846535", "0.58302444", "0.58302444", "0.58302444", "0.58270085", "0.58270085", "0.58270085", "0.58270085", "0.58270085", "0.58270085", "0.5821405", "0.5816759", "0.58096874", "0.58096874", "0.58096874", "0.58096874", "0.58023083", "0.5798356", "0.57840395", "0.5780169", "0.5776549", "0.57725114", "0.5759245", "0.5759034", "0.5759034", "0.5757009", "0.5756783", "0.5756783", "0.5756783", "0.5756783", "0.5756783", "0.5756783", "0.5744646", "0.5744646", "0.5744646", "0.5742087", "0.5742087", "0.5742087", "0.5741842", "0.57308364", "0.5727509", "0.5727509", "0.5719825", "0.5716807", "0.5716807", "0.571664", "0.57102346", "0.57102346", "0.57102346", "0.57102346", "0.57102346", "0.57102346", "0.57102346", "0.57102346", "0.57102346", "0.57102346", "0.57102346", "0.57102346", "0.57102346", "0.57102346", "0.57102346", "0.5705958", "0.570289", "0.5693138", "0.56910366", "0.5683148", "0.5681051", "0.5676406", "0.56644225", "0.5656681", "0.5656681", "0.5640827", "0.5618938", "0.56158906", "0.56124175", "0.56064516", "0.55893636", "0.55850494", "0.557742", "0.5571576", "0.5566272", "0.55465454", "0.55252004", "0.5518613" ]
0.6422131
5
Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file distributed with this work for additional information regarding copyright ownership. The ASF licenses this file to you under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. / Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file distributed with this work for additional information regarding copyright ownership. The ASF licenses this file to you under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
function _default(seriesType, defaultSymbolType, legendSymbol) { // Encoding visual for all series include which is filtered for legend drawing return { seriesType: seriesType, // For legend. performRawSeries: true, reset: function (seriesModel, ecModel, api) { var data = seriesModel.getData(); var symbolType = seriesModel.get('symbol') || defaultSymbolType; var symbolSize = seriesModel.get('symbolSize'); var keepAspect = seriesModel.get('symbolKeepAspect'); data.setVisual({ legendSymbol: legendSymbol || symbolType, symbol: symbolType, symbolSize: symbolSize, symbolKeepAspect: keepAspect }); // Only visible series has each data be visual encoded if (ecModel.isSeriesFiltered(seriesModel)) { return; } var hasCallback = typeof symbolSize === 'function'; function dataEach(data, idx) { if (typeof symbolSize === 'function') { var rawValue = seriesModel.getRawValue(idx); // FIXME var params = seriesModel.getDataParams(idx); data.setItemVisual(idx, 'symbolSize', symbolSize(rawValue, params)); } if (data.hasItemOption) { var itemModel = data.getItemModel(idx); var itemSymbolType = itemModel.getShallow('symbol', true); var itemSymbolSize = itemModel.getShallow('symbolSize', true); var itemSymbolKeepAspect = itemModel.getShallow('symbolKeepAspect', true); // If has item symbol if (itemSymbolType != null) { data.setItemVisual(idx, 'symbol', itemSymbolType); } if (itemSymbolSize != null) { // PENDING Transform symbolSize ? data.setItemVisual(idx, 'symbolSize', itemSymbolSize); } if (itemSymbolKeepAspect != null) { data.setItemVisual(idx, 'symbolKeepAspect', itemSymbolKeepAspect); } } } return { dataEach: data.hasItemOption || hasCallback ? dataEach : null }; } }; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "onChildAppStart () {\n\n }", "get Android() {}", "onMessageStart() { }", "_playbackCompatibility() {\n // Detect audio playback capabilities.\n\n // Detect HTML5 Audio playback.\n // http://caniuse.com/#feat=audio\n this.canUseAudio = Boolean(new Audio());\n console.log('Native HTML5 Audio playback capability: ' +\n this.canUseAudio);\n\n // Detect Cordova Media Playback\n // It allows playing audio using the native bridge inside WebView Apps.\n // https://github.com/apache/cordova-plugin-media/blob/master/doc/index.md\n this.canUseCordovaMedia = Boolean(window.Media);\n console.log('Cordova Media playback capability: ' +\n this.canUseCordovaMedia);\n\n if (!(this.canUseAudio || this.canUseCordovaMedia)) {\n throw new Error(\n 'Some form of audio playback capability is required');\n }\n\n var _audio = new Audio();\n if (_audio.canPlayType === 'function') {\n throw new Error(\n 'Unable to detect audio playback capabilities');\n }\n\n var canPlayOggVorbis = _audio.canPlayType(\n 'audio/ogg; codecs=\"vorbis\"') !== '';\n var canPlayOggOpus = _audio.canPlayType(\n 'audio/ogg; codecs=\"opus\"') !== '';\n var canPlayWave = _audio.canPlayType('audio/wav') !== '';\n var canPlayMP3 = _audio.canPlayType('audio/mpeg; codecs=\"mp3\"') !== '';\n var canPlayAAC = _audio.canPlayType(\n 'audio/mp4; codecs=\"mp4a.40.2\"') !== '';\n var canPlay3GPP = _audio.canPlayType(\n 'audio/3gpp; codecs=\"samr\"') !== '';\n\n console.log('Native Vorbis audio in Ogg container playback capability: ' +\n canPlayOggVorbis);\n console.log('Native Opus audio in Ogg container playback capability: ' +\n canPlayOggOpus);\n console.log('Native PCM audio in Waveform Audio File Format (WAVE) ' +\n 'playback capability: ' + canPlayWave);\n console.log('Native MPEG Audio Layer 3 (MP3) playback capability: ' +\n canPlayMP3);\n console.log('Native Low-Complexity AAC audio in MP4 container playback ' +\n 'capability: ' + canPlayAAC);\n console.log('Native AMR audio in 3GPP container playback capability: ' +\n canPlay3GPP);\n\n if (!(canPlayWave || canPlayMP3)) {\n throw new Error(\n 'Native Wave or MP3 playback is required');\n }\n }", "createStream () {\n\n }", "onComponentMount() {\n\n }", "function BaseDeviceProfile() {\n \n this.audioNeedsTranscodingCodecs = []; // fill these with audio codecs that the implemented device can handle natively\n this.videoNeedsTranscodingCodecs = []; // fill these with video codecs that the implemented device can handle natively\n this.validFormats = []; // fill these with video formats that the implemented device can handle natively\n\n this.transcodeOptions = {\n rescaleVideo : false, // BaseDeviceProfile.prototype.rescale\n subtitle : false, // BaseDeviceProfile.prototype.hardCodeSubtitle\n audioShiftCorrect : false // BaseDeviceProfile.prototype.correctAudioOffset\n };\n\n /**\n * @todo: whutz this?\n * @param {[type]} probeData [description]\n * @return {[type]} [description]\n */\n this.canPlayContainer = function (probeData) {\n throw new Error(\"canPlayContainer : Not Implemented\");\n };\n\n /**\n * Implement this method to return device specific ffmpeg flags for a probed media\n * @param {object} probeData ffmpeg probe data\n * @param {[type]} forceTranscode force transcode even if native format?\n * @return {Promise} [description]\n */\n this.getFFmpegFlags = function (probeData, forceTranscode) {\n throw new Error(\"getFFmpegFlags : Not Implemented!\");\n };\n\n}", "didMount() {\n }", "requestContainerInfo() {}", "function SBRecordsetPHP_analyzePlatformSpecific()\r\n{\r\n\r\n\r\n}", "function bridgeAndroidAndIOS() {\r\n\r\n //ios\r\n function setupWebViewJavascriptBridge(callback) {\r\n if (window.WebViewJavascriptBridge) {\r\n return callback(WebViewJavascriptBridge);\r\n }\r\n if (window.WVJBCallbacks) {\r\n return window.WVJBCallbacks.push(callback);\r\n }\r\n window.WVJBCallbacks = [callback];\r\n var WVJBIframe = document.createElement('iframe');\r\n WVJBIframe.style.display = 'none';\r\n WVJBIframe.src = 'https://__bridge_loaded__';\r\n document.documentElement.appendChild(WVJBIframe);\r\n setTimeout(function() {\r\n document.documentElement.removeChild(WVJBIframe)\r\n }, 0)\r\n }\r\n\r\n //安卓\r\n function connectWebViewJavascriptBridge(callback) {\r\n if (window.WebViewJavascriptBridge) {\r\n callback(WebViewJavascriptBridge)\r\n } else {\r\n document.addEventListener(\r\n 'WebViewJavascriptBridgeReady',\r\n function() {\r\n callback(WebViewJavascriptBridge)\r\n },\r\n false\r\n );\r\n }\r\n }\r\n\r\n function bridgeLog(logContent) {\r\n uni.showModal({\r\n title: \"原始数据\",\r\n content: logContent,\r\n })\r\n }\r\n\r\n switch (uni.getSystemInfoSync().platform) {\r\n case 'android':\r\n connectWebViewJavascriptBridge(function(bridge) {\r\n bridge.init();\r\n bridge.registerHandler(\"GetUser\", function(data, responseCallback) {\r\n if(JSON.parse(data).guid != \"null\"){\r\n uni.setStorageSync('userInfo', {\r\n guid: JSON.parse(data).guid,\r\n token: JSON.parse(data).token\r\n })\r\n }\r\n uni.setStorageSync('parameter', {\r\n activityID: JSON.parse(data).activityID,\r\n AppCode: JSON.parse(data).AppCode\r\n })\r\n // 初始传入token和guid\r\n Vue.config.configDic = {\r\n Authorization: JSON.parse(data).Authorization,\r\n statusBarHeight: Number.parseInt(JSON.parse(data).statusBarHeight),\r\n };\r\n });\r\n\r\n })\r\n break;\r\n case 'ios':\r\n setupWebViewJavascriptBridge(function(bridge) {\r\n bridge.registerHandler('GetUser', function(data, responseCallback) {\r\n if(data.guid != \"null\"){\r\n uni.setStorageSync('userInfo', {\r\n guid: data.guid,\r\n token: data.token\r\n })\r\n }\r\n uni.setStorageSync('parameter', {\r\n activityID: data.activityID,\r\n AppCode: data.AppCode\r\n })\r\n // 初始传入token和guid\r\n Vue.config.configDic = {\r\n Authorization: data.Authorization,\r\n productID: data.productID,\r\n statusBarHeight: data.statusBarHeight,\r\n };\r\n })\r\n })\r\n break;\r\n default:\r\n console.log('运行在开发者工具上')\r\n break;\r\n }\r\n\r\n}", "constructor() {\n super();\n this._logger = new pip_services3_components_node_3.CompositeLogger();\n this._connectionResolver = new connect_1.AwsConnectionResolver();\n this._connectTimeout = 30000;\n this._client = null; //AmazonCloudWatchClient\n this._opened = false;\n }", "static getDeviceModel() {\n return \"zhimi.fan.za4\";\n }", "constructor(speechCallback, clientId, streamId) {\n console.log(\"in gcloud\");\n const useOpus = false;\n this.clientId = clientId;\n this.streamId = streamId;\n this.isOpen = true;\n\n // Note: \n // 1) The client side detects silence and does a startStream, and endStream\n // The streamId is incremented everytime this happens, \n // so a combination of clientId + streamId can uniquely identify a stream.\n // The server will be transcribing each client's stream in parallel.\n //\n // 2) The streaming API has a limit of 5 minutes. So just before 5 minutes are up\n // there will timer that will close and reopen the stream. Any non final results will\n // we sent again to be re-transcribed,\n // The restartCounter will be incremented every time the stream is restarted. However\n // the streamId will remain the same.\n //\n // 3) Every stream will have set of results. Some results will be final and some won't be\n // After a result is final, that portion of the audio will not be transcribed again by the API\n // each final result will have resultEndTime, - this is time in seconds (and nanoseconds) \n // from the time the stream was started/restarted.\n // Results don'd have a startTime, it is implicit that the startTime is resultEndTime\n // of the last final stream, or 0 if there was no final stream before this\n // We augment the result to add this startTime\n //\n // We also keep a cumulative restartTime, which is the difference betwen the beginning of \n // stream start and begining of the most recent stream restart. And add this to \n // the startTime and endTime. This way the client is completely unaware of the internal restarts\n // \n \n // Have we started/restarted a new stream ?\n this.newStream = true;\n\n // number of times the stream has been restarted\n this.restartCounter = 0;\n\n // audio Input is any array of chunks (buffer)\n this.audioInput = [];\n this.audioInputSize = 0; // total size of all the buffers\n\n // the end time (in seconds) of the last result. \n // the End time is calculated from the beginning of start/restart stream\n this.resultEndTime = 0;\n\n // the end time of the last final result.\n this.finalEndTime = 0;\n\n // the start time (in seconds) of the current result. \n // It is calculated fom beginning of start/restart stream\n this.startTime = 0;\n \n // the time between the of beginning of start stream and the beginning of the most current restart stream.\n this.restartTime = 0;\n\n\n this.lastTranscriptWasFinal = false;\n\n this.restartTimer = null;\n\n this.config = {\n encoding: useOpus ? 'OGG_OPUS' : 'LINEAR16',\n sampleRateHertz: useOpus ? 48000 : 16000,\n languageCode: 'en_us',\n enableAutomaticPunctuation: true,\n speechContexts: [{ phrases: phrases}],\n };\n\n this.request = {\n config : this.config,\n interimResults: true,\n };\n\n this.startStreamInternal();\n }", "constructor() {\n }", "constructor(info) {\n super();\n\n _defineProperty(this, \"_peerConnectionId\", void 0);\n\n _defineProperty(this, \"_reactTag\", void 0);\n\n _defineProperty(this, \"_id\", void 0);\n\n _defineProperty(this, \"_label\", void 0);\n\n _defineProperty(this, \"_maxPacketLifeTime\", void 0);\n\n _defineProperty(this, \"_maxRetransmits\", void 0);\n\n _defineProperty(this, \"_negotiated\", void 0);\n\n _defineProperty(this, \"_ordered\", void 0);\n\n _defineProperty(this, \"_protocol\", void 0);\n\n _defineProperty(this, \"_readyState\", void 0);\n\n _defineProperty(this, \"_subscriptions\", []);\n\n _defineProperty(this, \"binaryType\", 'arraybuffer');\n\n _defineProperty(this, \"bufferedAmount\", 0);\n\n _defineProperty(this, \"bufferedAmountLowThreshold\", 0);\n\n this._peerConnectionId = info.peerConnectionId;\n this._reactTag = info.reactTag;\n this._label = info.label;\n this._id = info.id === -1 ? null : info.id; // null until negotiated.\n\n this._ordered = Boolean(info.ordered);\n this._maxPacketLifeTime = info.maxPacketLifeTime;\n this._maxRetransmits = info.maxRetransmits;\n this._protocol = info.protocol || '';\n this._negotiated = Boolean(info.negotiated);\n this._readyState = info.readyState;\n\n this._registerEvents();\n }", "_onMessage() {\n throw new Error(\"not implemented\");\n }", "getStreamPosition() {\n return Native.getStreamPosition();\n }", "onChildAppSourceChangeRestart () {\n\n }", "constructor() {\n\n\t}", "async componentDidUpdate() {\n console.log(this.props.directory);\n //this needs to be replaced with environment variable\n const beginingUrl = \"http://10.34.1.30:8080/songs/\";\n const songLoc = this.props.directory + \"/outputlist.m3u8\";\n var hlsUrl = beginingUrl + songLoc;\n var audio = this.player;\n\n //Should this logic be loacated here??This looks hacky,\n const token = await getToken();\n let bearerTokenString = \"Bearer \" + token;\n\n if (Hls.isSupported()) {\n var hls = new Hls({\n // This configuration is required to insure that only the\n // viewer can access the content by sending a session cookie\n // to api.video service\n xhrSetup: function (xhr, url) {\n xhr.setRequestHeader(\"Authorization\", bearerTokenString);\n },\n });\n hls.loadSource(hlsUrl);\n hls.attachMedia(audio);\n hls.on(Hls.Events.MANIFEST_PARSED, function () {\n audio.play();\n });\n } else if (audio.canPlayType(\"application/vnd.apple.mpegurl\")) {\n console.log(\"Nigga we here!!\");\n audio.src = hlsUrl;\n audio.addEventListener(\"loadedmetadata\", function () {\n audio.play();\n });\n }\n }", "onMessageReceive() {}", "constructor() {\n\t}", "constructor() {\n\t}", "componentWillMount() {\n //CodePush.disallowRestart();\n //Alert.alert(\"mounted cool vite OK OK MAINTENANT CA MARCHE !!!!!\");\n/*CodePush.sync(\n{\ndeploymentKey: 'giMb817KrtTFkIuOg4i5ohnEUDyoBJvD1i-VN',\nupdateDialog: true,\ninstallMode: CodePush.InstallMode.IMMEDIATE,\n},\nthis.CodePushStatusDidChange.bind(this),\nthis.CodePushDownloadDidProgress.bind(this)\n);*/\n /* Animated.loop(\n Animated.sequence([\n Animated.timing(this.animatedValue, { toValue: 1, duration: 3000, easing: Easing.ease, useNativeDriver: true }),\n Animated.timing(this.animatedValue, { toValue: 0, duration: 3000, easing: Easing.ease, useNativeDriver: true }),\n ])).start();*/\n //this.toggleLike(); \n //CodePush.notifyApplicationReady();\n this._onLoadStart();\n }", "get supportStreaming() { return exists && has(WA.instantiateStreaming); }", "function version(){ return \"0.13.0\" }", "static getDeviceModel() {\n return \"zhimi.fan.za5\";\n }", "_init(config) {\n this.name = config.name;\n this.appId = config.appid || config.appId;\n this.serverUrl = config.server_url + '/sync_xcx';\n this.autoTrackProperties = {};\n // cache commands.\n this._queue = [];\n\n if (config.isChildInstance) {\n this._state = {};\n } else {\n logger.enabled = config.enableLog;\n this.instances = []; // 子实例名称\n this._state = {\n getSystemInfo: false,\n initComplete: false,\n };\n systemInfo.getSystemInfo(() => {\n this._updateState({\n getSystemInfo: true,\n });\n });\n\n if (config.autoTrack) {\n this.autoTrack = PlatformAPI.initAutoTrackInstance(this, config);\n } else {\n var launchOptions = PlatformAPI.getAppOptions((options) => {\n if (options && options.scene) {\n this._setAutoTrackProperties({\n '#scene': options.scene,\n });\n }\n\n });\n if (launchOptions.scene) {\n this._setAutoTrackProperties({\n '#scene': launchOptions.scene,\n });\n }\n }\n }\n\n this.store = new ThinkingDataPersistence(config, () => {\n if (this.config.asyncPersistence && _.isFunction(this.config.persistenceComplete)) {\n this.config.persistenceComplete(this);\n }\n this._updateState();\n });\n }", "onChildAppRestart (/* reason */) {\n\n }", "_addHMRClientCode(data) {\n// If we have it, grab supporting code...\n let prependage = fs.readFileSync('./lib/hmr/clientSocket.js'),\n appendage = fs.readFileSync('./lib/hmr/hmr.js')\n\n// Prepend clientSocket.js to bundle.... Append hmr runtime to bundle\n return `${prependage}${data}${appendage}`\n }", "componentDidMount() {\n this.setState({\n configuration: {\n flow: {\n name: \"sample1\",\n id: \"01\",\n components: [\n {\n type: \"http-listener\",\n id: \"http-list-01\",\n properties: {\n method: \"get\",\n port: 8000,\n path: \"http://localhost\"\n }\n },\n {\n type: \"logger\",\n id: \"logger-01\",\n properties: {\n level: \"info\"\n }\n },\n {\n type: \"file-writer\",\n id: \"file-write-01\",\n properties: {\n location: \"xx\",\n username: \"sachith\",\n password: \"\",\n filename: \"hello.txt\"\n }\n }\n ]\n }\n }\n\n });\n }", "componentWillUnmount(){\n Streaming.disconnect();\n }", "pushStart() {\n Cordova.exec(\n () => {},\n () => {},\n 'SparkProxy',\n 'pushStart',\n []);\n }", "async onReady() {\n // Initialize your adapter here\n // Subsribe to all state changes\n this.subscribeStates('*');\n this.axiosInstance = axios_1.default.create({\n baseURL: `http://${this.config.host}/api/v1/`,\n timeout: 1000\n });\n // try to ping volumio\n const connectionSuccess = await this.pingVolumio();\n if (this.config.checkConnection) {\n let interval = this.config.checkConnectionInterval;\n if (!interval || !isNumber(interval)) {\n this.log.error(`Invalid connection check interval setting. Will be set to 30s`);\n interval = 30;\n }\n this.checkConnectionInterval = setInterval(this.checkConnection, interval * 1000, this);\n }\n // get system infos\n if (connectionSuccess) {\n this.apiGet('getSystemInfo').then(sysInfo => {\n this.setStateAsync('info.id', sysInfo.id, true);\n this.setStateAsync('info.host', sysInfo.host, true);\n this.setStateAsync('info.name', sysInfo.name, true);\n this.setStateAsync('info.type', sysInfo.type, true);\n this.setStateAsync('info.serviceName', sysInfo.serviceName, true);\n this.setStateAsync('info.systemversion', sysInfo.systemversion, true);\n this.setStateAsync('info.builddate', sysInfo.builddate, true);\n this.setStateAsync('info.variant', sysInfo.variant, true);\n this.setStateAsync('info.hardware', sysInfo.hardware, true);\n });\n // get inital player state\n this.updatePlayerState();\n }\n if (this.config.subscribeToStateChanges && this.config.subscriptionPort && connectionSuccess) {\n this.log.debug('Subscription mode is activated');\n try {\n this.httpServerInstance = this.httpServer.listen(this.config.subscriptionPort);\n this.log.debug(`Server is listening on ${ip_1.default.address()}:${this.config.subscriptionPort}`);\n this.subscribeToVolumioNotifications();\n }\n catch (error) {\n this.log.error(`Starting server on ${this.config.subscriptionPort} for subscription mode failed: ${error.message}`);\n }\n }\n else if (this.config.subscribeToStateChanges && !this.config.subscriptionPort) {\n this.log.error('Subscription mode is activated, but port is not configured.');\n }\n else if (!this.config.subscribeToStateChanges && connectionSuccess) {\n this.unsubscribeFromVolumioNotifications();\n }\n this.httpServer.post('/volumiostatus', (req, res) => {\n this.onVolumioStateChange(req.body);\n res.sendStatus(200);\n });\n }", "function IbtRealTimeSJ(){/***********************************************************\n\t * @attributes\n\t ***********************************************************/var appKey;// application key\n\tvar authToken;// authentication token\n\tvar clusterUrl;// cluster URL to connect\n\tvar waitingClusterResponse;// indicates whether is waiting for a cluster response\n\tvar connectionTimeout;// connection timeout in milliseconds\n\tvar messageMaxSize;// message maximum size in bytes\n\tvar channelMaxSize;// channel maximum size in bytes\n\tvar channelsMaxSize;// maximum of channels for batchSend\n\tvar messagesBuffer;// buffer to hold the message parts\n\tvar id;// object identifier\n\tvar isConnected;// indicates whether the client object is connected\n\tvar isConnecting;// indicates whether the client object is connecting\n\tvar alreadyConnectedFirstTime;// indicates whether the client already connected for the first time\n\tvar stopReconnecting;// indicates whether the user disconnected (stop the reconnecting proccess)\n\tvar ortc;// represents the object itself\n\tvar sockjs;// socket connected to\n\tvar url;// URL to connect\n\tvar userPerms;// user permissions\n\tvar connectionMetadata;// connection metadata used to identify the client\n\tvar announcementSubChannel;// announcement subchannel\n\tvar subscribedChannels;// subscribed/subscribing channels\n\tvar lastKeepAlive;// holds the time of the last keep alive received\n\tvar invalidConnection;// indicates whether the connection is valid\n\tvar reconnectIntervalId;// id used for the reconnect interval\n\tvar reconnectStartedAt;// the time which the reconnect started\n\tvar validatedTimeoutId;// id used for the validated timeout\n\tvar validatedArrived;// indicates whether the validated message arrived\n\tvar retryingWithSsl;// indicates whether the connection is being retried with SSL\n\tvar protocol;// protocol to use\n\tvar sslSessionCookieName;// the SSL session cookie name\n\tvar sessionCookieName;// the session cookie name\n\tvar sessionId;// the session ID\n\tvar registrationId;// browser device token for push notifications\n\tvar pushPlatform;// push notifications platform\n\t/***********************************************************\n\t * @attributes initialization\n\t ***********************************************************/sslSessionCookieName=\"ortcssl\";sessionCookieName=\"ortcsession-\";connectionTimeout=5000;messageMaxSize=800;channelMaxSize=100;connectionMetadataMaxSize=256;channelsMaxSize=50;// Time in seconds\n\tvar heartbeatDefaultTime=15;// Heartbeat default interval time\n\tvar heartbeatDefaultFails=3;// Heartbeat default max fails\n\tvar heartbeatMaxTime=60;var heartbeatMinTime=10;var heartbeatMaxFails=6;var heartbeatMinFails=1;var heartbeatTime=heartbeatDefaultTime;// Heartbeat interval time\n\tvar heartbeatFails=heartbeatDefaultFails;// Heartbeat max fails\n\tvar heartbeatInterval=null;// Heartbeat interval\n\tvar heartbeatActive=false;messagesBuffer={};subscribedChannels={};isConnected=false;isConnecting=false;alreadyConnectedFirstTime=false;invalidConnection=false;waitingClusterResponse=false;validatedArrived=false;retryingWithSsl=false;ortc=this;lastKeepAlive=null;userPerms=null;reconnectStartedAt=null;protocol=undefined;pushPlatform=\"GCM\";var delegateExceptionCallback=function(ortcArg,event){if(ortcArg!==null&&ortcArg.onException!==null){ortcArg.onException(ortcArg,event);}};/***********************************************************\n\t * @properties\n\t ***********************************************************/this.getId=function(){return id;};this.setId=function(newId){id=newId;};this.getUrl=function(){return url;};this.setUrl=function(newUrl){url=newUrl;clusterUrl=null;};this.getClusterUrl=function(){return clusterUrl;};this.setClusterUrl=function(newUrl){clusterUrl=newUrl;url=null;};this.getConnectionTimeout=function(){return connectionTimeout;};this.setConnectionTimeout=function(newTimeout){connectionTimeout=newTimeout;};this.getIsConnected=function(){return isConnected&&ortc.sockjs!==null;};this.getConnectionMetadata=function(){return connectionMetadata;};this.setConnectionMetadata=function(newConnectionMetadata){connectionMetadata=newConnectionMetadata;};this.getAnnouncementSubChannel=function(){return announcementSubChannel;};this.setAnnouncementSubChannel=function(newAnnouncementSubChannel){announcementSubChannel=newAnnouncementSubChannel;};this.getProtocol=function(){return protocol;};this.setProtocol=function(newProtocol){protocol=newProtocol;};this.getSessionId=function(){return sessionId;};/*\n\t * Get heartbeat interval.\n\t */this.getHeartbeatTime=function(){return heartbeatTime;};/*\n\t * Set heartbeat interval.\n\t */this.setHeartbeatTime=function(newHeartbeatTime){if(newHeartbeatTime&&!isNaN(newHeartbeatTime)){if(newHeartbeatTime>heartbeatMaxTime||newHeartbeatTime<heartbeatMinTime){delegateExceptionCallback(ortc,`Heartbeat time is out of limits - Min: ${heartbeatMinTime} | Max: ${heartbeatMaxTime}`);}else{heartbeatTime=newHeartbeatTime;}}else{delegateExceptionCallback(ortc,`Invalid heartbeat time ${newHeartbeatTime}`);}};/*\n\t * Get how many times can the client fail the heartbeat.\n\t */this.getHeartbeatFails=function(){return heartbeatFails;};/*\n\t * Set heartbeat fails. Defines how many times can the client fail the heartbeat.\n\t */this.setHeartbeatFails=function(newHeartbeatFails){if(newHeartbeatFails&&!isNaN(newHeartbeatFails)){if(newHeartbeatFails>heartbeatMaxFails||newHeartbeatFails<heartbeatMinFails){delegateExceptionCallback(ortc,`Heartbeat fails is out of limits - Min: ${heartbeatMinFails} | Max: ${heartbeatMaxFails}`);}else{heartbeatFails=newHeartbeatFails;}}else{delegateExceptionCallback(ortc,`Invalid heartbeat fails ${newHeartbeatFails}`);}};/*\n\t * Get heart beat active.\n\t */this.getHeartbeatActive=function(){return heartbeatActive;};/*\n\t * Set heart beat active. Heart beat provides better accuracy for presence data.\n\t */this.setHeartbeatActive=function(active){heartbeatActive=active;};/***********************************************************\n\t * @events\n\t ***********************************************************/this.onConnected=null;this.onDisconnected=null;this.onSubscribed=null;this.onUnsubscribed=null;this.onException=null;this.onReconnecting=null;this.onReconnected=null;/***********************************************************\n\t * @public methods\n\t ***********************************************************//*\n\t * Connects to the gateway with the application key and authentication token.\n\t */this.connect=function(appKey,authToken){/*\n\t Sanity Checks\n\t */if(isConnected){delegateExceptionCallback(ortc,\"Already connected\");}else if(!url&&!clusterUrl){delegateExceptionCallback(ortc,\"URL and Cluster URL are null or empty\");}else if(!appKey){delegateExceptionCallback(ortc,\"Application Key is null or empty\");}else if(!authToken){delegateExceptionCallback(ortc,\"Authentication Token is null or empty\");}else if(url&&!ortcIsValidUrl(url)){delegateExceptionCallback(ortc,\"Invalid URL\");}else if(clusterUrl&&!ortcIsValidUrl(clusterUrl)){delegateExceptionCallback(ortc,\"Invalid Cluster URL\");}else if(!ortcIsValidInput(appKey)){delegateExceptionCallback(ortc,\"Application Key has invalid characters\");}else if(!ortcIsValidInput(authToken)){delegateExceptionCallback(ortc,\"Authentication Token has invalid characters\");}else if(!ortcIsValidInput(announcementSubChannel)){delegateExceptionCallback(ortc,\"Announcement Subchannel has invalid characters\");}else if(connectionMetadata&&connectionMetadata.length>connectionMetadataMaxSize){delegateExceptionCallback(ortc,\"Connection metadata size exceeds the limit of \"+connectionMetadataMaxSize+\" characters\");}else{ortc.appKey=appKey;ortc.authToken=authToken;isConnecting=true;stopReconnecting=false;validatedArrived=false;clearValidatedTimeout(self);// Read SSL session cookie\n\t//var sslConn = readCookie(sslSessionCookieName);\n\tvar sslConn=false;if(sslConn){changeUrlSsl();}if(clusterUrl&&clusterUrl!=null){clusterUrl=clusterUrl.ortcTreatUrl();clusterConnection();}else{url=url.ortcTreatUrl();ortc.sockjs=createSocketConnection(url);}//If ssl connection increase connection timeout\n\tif(clusterUrl&&clusterUrl!=null&&clusterUrl.indexOf(\"/ssl\")>=0||url&&url.indexOf(\"https\")>=0){if(!retryingWithSsl){ortc.setConnectionTimeout(30*1000);}else{if(ortc.getConnectionTimeout()<300*1000){if(ortc.getConnectionTimeout()<30*1000){ortc.setConnectionTimeout(30*1000);}else{ortc.setConnectionTimeout((ortc.getConnectionTimeout()+10)*1000);}}else{stopReconnecting=true;clearReconnectInterval();}}}if(!ortc.reconnectIntervalId&&!stopReconnecting){// Interval to reconnect\n\tortc.reconnectIntervalId=setInterval(function(){if(stopReconnecting){clearReconnectInterval();}else{var currentDateTime=new Date();if(ortc.sockjs==null&&!waitingClusterResponse){reconnectSocket();}// 35 seconds\n\tif(lastKeepAlive!=null&&lastKeepAlive+35000<new Date().getTime()){lastKeepAlive=null;// Server went down\n\tif(isConnected){disconnectSocket();}}}},ortc.getConnectionTimeout());}}};this.setNotificationConfig=function(config){config.cmd=\"config\";this.sendMessageToServiceWorker(config);};this.showNotification=function(notification){notification.cmd=\"notification\";this.sendMessageToServiceWorker(notification);};this.sendMessageToServiceWorker=function(message){return new Promise(function(resolve,reject){var messageChannel=new MessageChannel();messageChannel.port1.onmessage=function(event){if(event.data.error){reject(event.data.error);}else{resolve(event.data);}};navigator.serviceWorker.controller.postMessage(message,[messageChannel.port2]);});};/*\n\t * Subscribes to the channel so the client object can receive all messages sent to it by other clients with Notifications.\n\t */this.subscribeWithNotifications=function(channel,subscribeOnReconnected,regId,onMessageCallback){ortc.registrationId=regId;this._subscribe(channel,subscribeOnReconnected,regId,null,onMessageCallback);};/*\n\t * Subscribes to the channel so the client object can receive all messages sent that are valid according to the given filter\n\t */this.subscribeWithFilter=function(channel,subscribeOnReconnected,filter,onMessageCallback){this._subscribe(channel,subscribeOnReconnected,null,filter,onMessageCallback);};/*\n\t * Subscribes to the channel so the client object can receive all messages sent to it by other clients.\n\t */this.subscribe=function(channel,subscribeOnReconnected,onMessageCallback){this._subscribe(channel,subscribeOnReconnected,null,null,onMessageCallback);};this._subscribe=function(channel,subscribeOnReconnected,regId,filter,onMessageCallback){/*\n\t Sanity Checks\n\t */if(!isConnected){delegateExceptionCallback(ortc,\"Not connected\");}else if(!channel){delegateExceptionCallback(ortc,\"Channel is null or empty\");}else if(!ortcIsValidInput(channel)){delegateExceptionCallback(ortc,\"Channel has invalid characters\");}else if(subscribedChannels[channel]&&subscribedChannels[channel].isSubscribing){delegateExceptionCallback(ortc,\"Already subscribing to the channel \\\"\"+channel+\"\\\"\");}else if(subscribedChannels[channel]&&subscribedChannels[channel].isSubscribed){delegateExceptionCallback(ortc,\"Already subscribed to the channel \\\"\"+channel+\"\\\"\");}else if(channel.length>channelMaxSize){delegateExceptionCallback(ortc,\"Channel size exceeds the limit of \"+channelMaxSize+\" characters\");}else if(!ortcIsValidBoolean(subscribeOnReconnected)){delegateExceptionCallback(ortc,\"The argument \\\"subscribeOnReconnected\\\" must be a boolean\");}else if(!ortcIsFunction(onMessageCallback)){delegateExceptionCallback(ortc,\"The argument \\\"onMessageCallback\\\" must be a function\");}else{if(ortc.sockjs!=null){var domainChannelCharacterIndex=channel.indexOf(\":\");var channelToValidate=channel;var hashPerm=null;if(domainChannelCharacterIndex>0){channelToValidate=channel.substring(0,domainChannelCharacterIndex+1)+\"*\";}if(userPerms&&userPerms!=null){hashPerm=userPerms[channelToValidate]?userPerms[channelToValidate]:userPerms[channel];}if(userPerms&&userPerms!=null&&!hashPerm){delegateExceptionCallback(ortc,\"No permission found to subscribe to the channel \\\"\"+channel+\"\\\"\");}else{if(subscribedChannels[channel]){subscribedChannels[channel].isSubscribing=true;subscribedChannels[channel].isSubscribed=false;subscribedChannels[channel].subscribeOnReconnected=subscribeOnReconnected;subscribedChannels[channel].onMessageCallback=onMessageCallback;subscribedChannels[channel].filter=filter;}else{subscribedChannels[channel]={\"isSubscribing\":true,\"isSubscribed\":false,\"subscribeOnReconnected\":subscribeOnReconnected,\"onMessageCallback\":onMessageCallback,\"filter\":filter};}if(regId){subscribedChannels[channel].withNotifications=true;ortc.sockjs.send(\"subscribe;\"+ortc.appKey+\";\"+ortc.authToken+\";\"+channel+\";\"+hashPerm+\";\"+regId+\";\"+pushPlatform);}else{subscribedChannels[channel].withNotifications=false;if(filter){ortc.sockjs.send(\"subscribefilter;\"+ortc.appKey+\";\"+ortc.authToken+\";\"+channel+\";\"+hashPerm+\";\"+filter);}else{ortc.sockjs.send(\"subscribe;\"+ortc.appKey+\";\"+ortc.authToken+\";\"+channel+\";\"+hashPerm);}}}}}};/*\n\t * Unsubscribes from the channel so the client object stops receiving messages sent to it.\n\t */this.unsubscribe=function(channel){/*\n\t Sanity Checks\n\t */if(!isConnected){delegateExceptionCallback(ortc,\"Not connected\");}else if(!channel){delegateExceptionCallback(ortc,\"Channel is null or empty\");}else if(!ortcIsValidInput(channel)){delegateExceptionCallback(ortc,\"Channel has invalid characters\");}else if(!subscribedChannels[channel]||subscribedChannels[channel]&&!subscribedChannels[channel].isSubscribed){delegateExceptionCallback(ortc,\"Not subscribed to the channel \"+channel);}else if(channel.length>channelMaxSize){delegateExceptionCallback(ortc,\"Channel size exceeds the limit of \"+channelMaxSize+\" characters\");}else{if(ortc.sockjs!=null){if(subscribedChannels[channel].withNotifications==true){ortc.sockjs.send(\"unsubscribe;\"+ortc.appKey+\";\"+channel+\";\"+ortc.registrationId+\";\"+pushPlatform);}else{ortc.sockjs.send(\"unsubscribe;\"+ortc.appKey+\";\"+channel);}}}};/*\n\t * Sends the message to the channel.\n\t */this.send=function(channel,message){/*\n\t Sanity Checks\n\t */if(!isConnected||ortc.sockjs==null){delegateExceptionCallback(ortc,\"Not connected\");}else if(!channel){delegateExceptionCallback(ortc,\"Channel is null or empty\");}else if(!ortcIsValidInput(channel)){delegateExceptionCallback(ortc,\"Channel has invalid characters\");}else if(!message){delegateExceptionCallback(ortc,\"Message is null or empty\");}else if(!ortcIsString(message)){delegateExceptionCallback(ortc,\"Message must be a string\");}else if(channel.length>channelMaxSize){delegateExceptionCallback(ortc,\"Channel size exceeds the limit of \"+channelMaxSize+\" characters\");}else{var domainChannelCharacterIndex=channel.indexOf(\":\");var channelToValidate=channel;var hashPerm=null;if(domainChannelCharacterIndex>0){channelToValidate=channel.substring(0,domainChannelCharacterIndex+1)+\"*\";}if(userPerms&&userPerms!=null){hashPerm=userPerms[channelToValidate]?userPerms[channelToValidate]:userPerms[channel];}if(userPerms&&userPerms!=null&&!hashPerm){delegateExceptionCallback(ortc,\"No permission found to send to the channel \\\"\"+channel+\"\\\"\");}else{// Multi part\n\tvar messageParts=[];var messageId=generateId(8);var i;var allowedMaxSize=messageMaxSize-channel.length;for(i=0;i<message.length;i=i+allowedMaxSize){// Just one part\n\tif(message.length<=allowedMaxSize){messageParts.push(message);break;}if(message.substring(i,i+allowedMaxSize)){messageParts.push(message.substring(i,i+allowedMaxSize));}}for(var j=1;j<=messageParts.length;j++){ortc.sockjs.send(\"send;\"+ortc.appKey+\";\"+ortc.authToken+\";\"+channel+\";\"+hashPerm+\";\"+messageId+\"_\"+j+\"-\"+messageParts.length+\"_\"+messageParts[j-1]);}}}};/*\n\t * Sends the message to multiple channels.\n\t */this.batchSend=function(channels,message){/*\n\t Sanity Checks\n\t */channels=ortcStrToArray(channels);if(!isConnected||ortc.sockjs==null){delegateExceptionCallback(ortc,\"Not connected\");}else if(!ortcIsArray(channels)){delegateExceptionCallback(ortc,\"Channels must be a array\");}else if(!message){delegateExceptionCallback(ortc,\"Message is null or empty\");}else if(!ortcIsString(message)){delegateExceptionCallback(ortc,\"Message must be a string\");}else if(channels.length<=0){delegateExceptionCallback(ortc,\"Channels must be an array at least with one channel\");}else if(channels.length>channelsMaxSize){channels=[];delegateExceptionCallback(ortc,\"The channel maximum was reached (>\"+channelsMaxSize+\")\");}for(i=0;i<channels.length;i++){var channel=channels[i];if(channel.length>channelMaxSize){channels.splice(i,1);delegateExceptionCallback(ortc,\"Channel \"+channel+\" size exceeds the limit of \"+channelMaxSize+\" characters\");}}if(channels.length>0){var arrayHashPerm=[];for(i=0;i<channels.length;i++){var channel=channels[i];var domainChannelCharacterIndex=channel.indexOf(\":\");var channelToValidate=channel;var hashPerm=null;if(domainChannelCharacterIndex>0){channelToValidate=channel.substring(0,domainChannelCharacterIndex+1)+\"*\";}if(userPerms&&userPerms!=null){hashPerm=userPerms[channelToValidate]?userPerms[channelToValidate]:userPerms[channel];}if(userPerms&&userPerms!=null&&!hashPerm){channels.splice(i,1);delegateExceptionCallback(ortc,\"No permission found to send to the channel \\\"\"+channel+\"\\\"\");}else{arrayHashPerm.push(hashPerm);}}if(channels.length>0){var messageParts=[];var messageId=generateId(8);var allowedMaxSize=messageMaxSize-channels.toString().length;for(i=0;i<message.length;i=i+allowedMaxSize){// Just one part\n\tif(message.length<=allowedMaxSize){messageParts.push(message);break;}if(message.substring(i,i+allowedMaxSize)){messageParts.push(message.substring(i,i+allowedMaxSize));}}for(j=1;j<=messageParts.length;j++){ortc.sockjs.send(\"batchSend;\"+ortc.appKey+\";\"+ortc.authToken+\";\"+JSON.stringify(channels)+\";\"+JSON.stringify(arrayHashPerm)+\";\"+messageId+\"_\"+j+\"-\"+messageParts.length+\"_\"+messageParts[j-1]);}}}};/*\n\t * Disconnects from the gateway.\n\t */this.disconnect=function(){clearReconnectInterval();stopReconnectProcess();// Clear subscribed channels\n\tsubscribedChannels={};/*\n\t Sanity Checks\n\t */if(!isConnected&&!invalidConnection){delegateExceptionCallback(ortc,\"Not connected\");}else{disconnectSocket();}};/*\n\t * Gets a value indicating whether this client object is subscribed to the channel.\n\t */this.isSubscribed=function(channel){/*\n\t Sanity Checks\n\t */if(!isConnected){delegateExceptionCallback(ortc,\"Not connected\");}else if(!channel){delegateExceptionCallback(ortc,\"Channel is null or empty\");}else if(!ortcIsValidInput(channel)){delegateExceptionCallback(ortc,\"Channel has invalid characters\");}else{if(subscribedChannels[channel]&&subscribedChannels[channel].isSubscribed){return subscribedChannels[channel].isSubscribed;}else{return false;}}};/*\n\t * Gets a json indicating the subscriptions in a channel.\n\t */this.presence=function(parameters,callback){try{var requestUrl=null,isCluster=false,appKey=ortc.appKey,authToken=ortc.authToken;if(parameters.url){requestUrl=parameters.url.ortcTreatUrl();isCluster=parameters.isCluster;appKey=parameters.applicationKey;authToken=parameters.authenticationToken;}else{if(clusterUrl&&clusterUrl!=null){requestUrl=clusterUrl;isCluster=true;}else{requestUrl=url.ortcTreatUrl();;}}getServerUrl({requestUrl:requestUrl,isCluster:isCluster,appKey:appKey},function(error,serverUrl){if(error){callback(error,null);}else{jsonp(serverUrl+\"/presence/\"+appKey+\"/\"+authToken+\"/\"+parameters.channel,callback);}});}catch(e){callback(\"Unable to get presence data\",null);}};var getServerUrl=function(parameters,callback){if(parameters.requestUrl&&parameters.isCluster){var guid=generateGuid();var queryString=\"guid=\"+generateGuid();queryString=parameters.appKey?queryString+\"&appkey=\"+parameters.appKey:queryString;loadClusterServerScript(parameters.requestUrl+\"/?\"+queryString,guid,function(clusterServerResolved,scriptGuid){if(clusterServerResolved){var resultUrl=SOCKET_SERVER;callback(null,resultUrl);}else{callback(null,\"Unable to get server from cluster\");}try{clearScripts(scriptGuid);}catch(loadError){}});}else{var resultUrl=parameters.requestUrl.ortcTreatUrl();callback(null,resultUrl);}};/*\n\t * Adds the Webspectator bootstrap script for the outmost frame on the same domain.\n\t */this.setMonetizerId=function(publicId){var tempWin;var win=tempWin=window;while(tempWin!=window.top){try{if(tempWin.frameElement){win=tempWin.parent;}}catch(e){}tempWin=tempWin.parent;}if(!win._WS_BOOT){var s=document.createElement(\"SCRIPT\");s.src=\"//wfpscripts.webspectator.com/bootstrap/ws-\"+publicId+\".js\";document.getElementsByTagName(\"head\")[0].appendChild(s);}};/***********************************************************\n\t * @private methods\n\t ***********************************************************//*\n\t * Change the current URL to use SSL\n\t */var changeUrlSsl=function(){if(!(\"ActiveXObject\"in window)){if(clusterUrl&&clusterUrl!=null){//clusterUrl = clusterUrl.replace(\"http://\", \"https://\");\n\tif(clusterUrl.indexOf(\"ssl/\")<0){var slashAtTheEnd=clusterUrl.search(/\\/([\\d.]*)\\/$/);if(slashAtTheEnd>-1){clusterUrl=clusterUrl.substring(0,slashAtTheEnd+1)+\"ssl/\"+clusterUrl.substring(slashAtTheEnd+1,clusterUrl.length);}else{clusterUrl=clusterUrl.substring(0,clusterUrl.lastIndexOf(\"/\")+1)+\"ssl/\"+clusterUrl.substring(clusterUrl.lastIndexOf(\"/\")+1);}}}else{url=url.replace(\"http://\",\"https://\");}}// Create session cookie\n\t//createSessionCookie(sslSessionCookieName, 1);\n\t};/*\n\t * Clear the reconnecting interval\n\t */var clearReconnectInterval=function(){if(ortc.reconnectIntervalId){clearInterval(ortc.reconnectIntervalId);ortc.reconnectIntervalId=null;}};/*\n\t * Clear the validated timeout\n\t */var clearValidatedTimeout=function(self){if(self.validatedTimeoutId){clearTimeout(self.validatedTimeoutId);self.validatedTimeoutId=null;}};/*\n\t * Stop the reconnecting process\n\t */var stopReconnectProcess=function(){stopReconnecting=true;alreadyConnectedFirstTime=false;};var startHeartBeatInterval=function(self){if(!self.heartbeatInterval&&heartbeatActive){self.sockjs.send(\"b\");self.heartbeatInterval=setInterval(function(){if(!heartbeatActive){stopHeartBeatInterval(self);}else{self.sockjs.send(\"b\");}},heartbeatTime*1000);}};var stopHeartBeatInterval=function(self){if(self.heartbeatInterval){clearInterval(self.heartbeatInterval);self.heartbeatInterval=null;}};/*\n\t * Creates a cookie with expiration time.\n\t */var createExpireCookie=function(name,value,minutes){var expires=\"\";if(minutes){var date=new Date();date.setTime(date.getTime()+minutes*60*1000);expires=\"; expires=\"+date.toGMTString();}document.cookie=name+\"=\"+value+expires+\"; path=/\";};/*\n\t * Creates a session cookie.\n\t */var createSessionCookie=function(name,value){document.cookie=name+\"=\"+value+\"; path=/\";};/*\n\t * Reads a cookie.\n\t */var readCookie=function(name){var nameEQ=name+\"=\";var ca=document.cookie.split(\";\");var result=null;for(var i=0;i<ca.length;i++){var c=ca[i];while(c.charAt(0)==\" \"){c=c.substring(1,c.length);}if(c.indexOf(nameEQ)==0){result=c.substring(nameEQ.length,c.length);break;}}return result;};/*\n\t * Generates an ID.\n\t */var generateId=function(size){var result=\"\";var S4=function(){return((1+Math.random())*0x10000|0).toString(16).substring(1);};for(var i=0;i<size/4;i++){result+=S4();}return result;};/*\n\t * Disconnects the socket.\n\t */var disconnectSocket=function(){stopHeartBeatInterval(ortc);reconnectStartedAt=null;isConnected=false;isConnecting=false;validatedArrived=false;retryingWithSsl=false;clearValidatedTimeout(self);if(ortc.sockjs!=null){ortc.sockjs.close();ortc.sockjs=null;}};/*\n\t * Reconnects the socket.\n\t */var reconnectSocket=function(){stopHeartBeatInterval(ortc);if(isConnecting){delegateExceptionCallback(ortc,\"Unable to connect\");}isConnecting=true;delegateReconnectingCallback(ortc);reconnectStartedAt=new Date().getTime();if(clusterUrl&&clusterUrl!=null){clusterConnection();}else{ortc.sockjs=createSocketConnection(url);}};/*\n\t * Tries a connection through the cluster gateway with the application key and authentication token.\n\t */var clusterConnection=function(){var guid=generateGuid();var queryString=\"guid=\"+generateGuid();queryString=ortc.appKey?queryString+\"&appkey=\"+ortc.appKey:queryString;loadClusterServerScript(clusterUrl+\"/?\"+queryString,guid,function(clusterServerResolved,scriptGuid){if(clusterServerResolved){url=SOCKET_SERVER;sockjs=createSocketConnection(ortc.getUrl());}try{clearScripts(scriptGuid);}catch(loadError){}});};/*\n\t * Clears the javascript scripts previously loaded into the page.\n\t */var clearScripts=function(guid){var headChildren=document.getElementsByTagName(\"head\")[0].children;var childrenToRemove=[];for(var i=0;i<headChildren.length;i++){if(headChildren[i].attributes!=null&&headChildren[i].attributes[\"ortcScriptId\"]&&headChildren[i].attributes[\"ortcScriptId\"].value==guid){childrenToRemove.push(i);}}for(var child in childrenToRemove){document.getElementsByTagName(\"head\")[0].removeChild(headChildren[childrenToRemove[child]]);}};/*\n\t * Loads the cluster server javascript script into the page.\n\t */var loadClusterServerScript=function(scriptUrl,guid,callback){var script=document.createElement(\"script\");script.type=\"text/javascript\";script.setAttribute(\"ortcScriptId\",guid);waitingClusterResponse=true;if(script.readyState){// IE\n\tscript.onreadystatechange=function(){if(script.readyState==\"loaded\"||script.readyState==\"complete\"){waitingClusterResponse=false;script.onreadystatechange=null;if(typeof SOCKET_SERVER!=\"undefined\"&&SOCKET_SERVER.indexOf(\"undefined\")<0&&SOCKET_SERVER.indexOf(\"unknown_server\")<0){callback(true,guid);}else{callback(false,guid);}}};}else{// Others\n\tscript.onload=function(){waitingClusterResponse=false;if(typeof SOCKET_SERVER!=\"undefined\"&&SOCKET_SERVER.indexOf(\"undefined\")<0&&SOCKET_SERVER.indexOf(\"unknown_server\")<0){callback(true,guid);}else{callback(false,guid);}};}script.onerror=function(){waitingClusterResponse=false;};script.src=scriptUrl;document.getElementsByTagName(\"head\")[0].appendChild(script);};/*\n\t * Generates a GUID.\n\t */var generateGuid=function(){var S4=function(){return((1+Math.random())*0x10000|0).toString(16).substring(1);};return S4()+S4()+\"-\"+S4()+\"-\"+S4()+\"-\"+S4()+\"-\"+S4()+S4()+S4();};/*\n\t * Count the dictionary keys.\n\t */var countKeys=function(dic){var count=0;for(var i in dic){count++;}return count;};/*\n\t * Creates a socket connection.\n\t */var createSocketConnection=function(connectionUrl){var self=ortc;if(self.sockjs==null){if(navigator&&navigator.userAgent&&navigator.userAgent.indexOf(\"PlayStation Vita\")>=0){protocol=\"jsonp-polling\";}self.sockjs=new SockJS(connectionUrl+\"/broadcast\",protocol);// Timeout to receive the validated message\n\tif(!self.sslFallback){var validateTimeoutTime=5000;self.validatedTimeoutId=setTimeout(function(){self.sslFallback=true;stopReconnectProcess();disconnectSocket();invalidConnection=true;retryingWithSsl=true;if(connectionUrl.indexOf(\"https://\")>=0){// We are already using SSL, try streaming\n\tprotocol=\"xhr-streaming\";}else{protocol=undefined;}changeUrlSsl();},validateTimeoutTime);}else if(!self.xhrStreamingFallback){// The SSL fallback failed. Try xhr-streaming\n\tvar validateSslTimeoutTime=5000;self.validatedTimeoutId=setTimeout(function(){self.xhrStreamingFallback=true;stopReconnectProcess();disconnectSocket();invalidConnection=true;retryingWithSsl=true;protocol=\"xhr-streaming\";},validateSslTimeoutTime);}// Connect handler\n\tself.sockjs.onopen=function(){protocol=self.sockjs.protocol;// Update last keep alive time\n\tlastKeepAlive=new Date().getTime();// If is a reconnect do not count session\n\tif(alreadyConnectedFirstTime){sessionId=\"\";}else{// Read session cookie\n\tsessionId=readCookie(sessionCookieName+self.appKey+\"-s\");if(!sessionId){// Read expiration cookie\n\tsessionId=readCookie(sessionCookieName+self.appKey);if(!sessionId){sessionId=generateId(16);}// Create session cookie\n\tcreateSessionCookie(sessionCookieName+self.appKey+\"-s\",sessionId);// Check if session cookie was created\n\tif(!readCookie(sessionCookieName+self.appKey+\"-s\")){sessionId=\"\";}}}var heartbeatDetails=heartbeatActive?\";\"+self.getHeartbeatTime()+\";\"+self.getHeartbeatFails()+\";\":\"\";self.sockjs.send(\"validate;\"+self.appKey+\";\"+self.authToken+\";\"+(announcementSubChannel?announcementSubChannel:\"\")+\";\"+sessionId+\";\"+connectionMetadata+heartbeatDetails);};// Disconnect handler\n\tself.sockjs.onclose=function(e){// e.code=1000 - e.reason=Normal closure\n\t// e.code=1006 - e.reason=WebSocket connection broken\n\t// e.code=2000 - e.reason=All transports failed\n\tstopHeartBeatInterval(ortc);if(ortc.sockjs!=null){ortc.sockjs.close();ortc.sockjs=null;}// Clear user permissions\n\tuserPerms=null;if(e.code!=1000){if(isConnected){isConnected=false;isConnecting=false;protocol=undefined;delegateDisconnectedCallback(self);}if(!stopReconnecting){if(!reconnectStartedAt||reconnectStartedAt+connectionTimeout<new Date().getTime()){reconnectSocket();}}}else{if(!invalidConnection){isConnected=false;isConnecting=false;protocol=undefined;delegateDisconnectedCallback(self);}}if(retryingWithSsl){self.connect(self.appKey,self.authToken);retryingWithSsl=false;}invalidConnection=false;};// Receive handler\n\tself.sockjs.onmessage=function(e){// Update last keep alive time\n\tlastKeepAlive=new Date().getTime();var data=e.data;var channel=data.ch;var message=data.m;var filtered=data.f;// Multi part\n\tvar regexPattern=/^(\\w[^_]*)_{1}(\\d*)-{1}(\\d*)_{1}([\\s\\S.]*)$/;var match=regexPattern.exec(message);var messageId=null;var messageCurrentPart=1;var messageTotalPart=1;var lastPart=false;if(match&&match.length>0){if(match[1]){messageId=match[1];}if(match[2]){messageCurrentPart=match[2];}if(match[3]){messageTotalPart=match[3];}if(match[4]){message=match[4];}}if(messageId){if(!messagesBuffer[messageId]){messagesBuffer[messageId]={};}messagesBuffer[messageId][messageCurrentPart]=message;if(countKeys(messagesBuffer[messageId])==messageTotalPart){lastPart=true;}}else{lastPart=true;}if(lastPart){if(messageId){message=\"\";for(var i=1;i<=messageTotalPart;i++){message+=messagesBuffer[messageId][i];delete messagesBuffer[messageId][i];}delete messagesBuffer[messageId];}delegateMessagesCallback(self,channel,filtered,message);}};self.sockjs.onortcsubscribed=function(e){lastKeepAlive=new Date().getTime();var channel=e.data;if(subscribedChannels[channel]){subscribedChannels[channel].isSubscribing=false;subscribedChannels[channel].isSubscribed=true;}delegateSubscribedCallback(self,channel);};self.sockjs.onortcunsubscribed=function(e){lastKeepAlive=new Date().getTime();var channel=e.data;if(subscribedChannels[channel]){subscribedChannels[channel].isSubscribed=false;}delegateUnsubscribedCallback(self,channel);};self.sockjs.onheartbeat=function(){lastKeepAlive=new Date().getTime();};self.sockjs.onortcvalidated=function(e){var sessionExpirationTime=30;if(e.data){userPerms=e.data;}if(e.set){sessionExpirationTime=e.set;}clearValidatedTimeout(self);validatedArrived=true;retryingWithSsl=false;isConnecting=false;isConnected=true;reconnectStartedAt=null;if(sessionId){if(!readCookie(sessionCookieName+self.appKey+\"-s\")){createSessionCookie(sessionCookieName+self.appKey+\"-s\",sessionId);}if(!readCookie(sessionCookieName+self.appKey)){createExpireCookie(sessionCookieName+self.appKey,sessionId,sessionExpirationTime);}}if(alreadyConnectedFirstTime){var channelsToRemove={};// Subscribe to the previously subscribed channels\n\tfor(var key in subscribedChannels){// Subscribe again\n\tif(subscribedChannels[key].subscribeOnReconnected==true&&(subscribedChannels[key].isSubscribing||subscribedChannels[key].isSubscribed)){subscribedChannels[key].isSubscribing=true;subscribedChannels[key].isSubscribed=false;var domainChannelCharacterIndex=key.indexOf(\":\");var channelToValidate=key;var hashPerm=null;if(domainChannelCharacterIndex>0){channelToValidate=key.substring(0,domainChannelCharacterIndex+1)+\"*\";}if(userPerms&&userPerms!=null){hashPerm=userPerms[channelToValidate]?userPerms[channelToValidate]:userPerms[key];}if(subscribedChannels[key].filter){self.sockjs.send(\"subscribefilter;\"+self.appKey+\";\"+self.authToken+\";\"+key+\";\"+hashPerm+\";\"+subscribedChannels[key].filter);}else{self.sockjs.send(\"subscribe;\"+self.appKey+\";\"+self.authToken+\";\"+key+\";\"+hashPerm);}}else{channelsToRemove[key]=key;}}for(var keyToRemove in channelsToRemove){delete subscribedChannels[keyToRemove];}messagesBuffer={};delegateReconnectedCallback(self);}else{alreadyConnectedFirstTime=true;delegateConnectedCallback(self);}};self.sockjs.onortcerror=function(e){lastKeepAlive=new Date().getTime();var data=e.data;var operation=data.op;var channel=data.ch;var error=data.ex?data.ex:data;delegateExceptionCallback(self,error);switch(operation){case\"validate\":if(error.indexOf(\"busy\")<0){invalidConnection=true;clearValidatedTimeout(self);retryingWithSsl=false;stopReconnectProcess();}else{clearValidatedTimeout(self);retryingWithSsl=false;}break;case\"subscribe\":if(channel&&subscribedChannels[channel]){subscribedChannels[channel].isSubscribing=false;}break;case\"subscribe_maxsize\":case\"unsubscribe_maxsize\":case\"shutdown\":clearValidatedTimeout(self);retryingWithSsl=false;break;case\"send_maxsize\":if(channel&&subscribedChannels[channel]){subscribedChannels[channel].isSubscribing=false;}stopReconnectProcess();break;default:break;}};}return self.sockjs;};var jsonp=function(url,callback){var head=document.head?document.head:document.getElementsByTagName(\"head\")[0];var script=document.createElement(\"script\");var guid=\"ortcJsonp\"+ +new Date();var jsonpCallTimeout=setTimeout(function(){try{callback(\"Unable to get data\",null);window[guid]=undefined;delete window[guid];head.removeChild(script);}catch(e){}},15*1000);window[guid]=function(data){clearTimeout(jsonpCallTimeout);if(data.error){callback(data.error,null);}else{callback(null,data.content);}try{window[guid]=undefined;delete window[guid];head.removeChild(script);}catch(e){}};script.setAttribute(\"src\",url+\"?callback=\"+guid);head.appendChild(script);};var delegateConnectedCallback=function(ortc){if(ortc!=null&&ortc.onConnected!=null){startHeartBeatInterval(ortc);ortc.onConnected(ortc);}};var delegateDisconnectedCallback=function(ortc){if(ortc!=null&&ortc.onDisconnected!=null){ortc.onDisconnected(ortc);}};var delegateSubscribedCallback=function(ortc,channel){if(ortc!=null&&ortc.onSubscribed!=null&&channel!=null){ortc.onSubscribed(ortc,channel);}};var delegateUnsubscribedCallback=function(ortc,channel){if(ortc!=null&&ortc.onUnsubscribed!=null&&channel!=null){ortc.onUnsubscribed(ortc,channel);}};var delegateMessagesCallback=function(ortc,channel,filtered,message){if(ortc!=null&&subscribedChannels[channel]&&subscribedChannels[channel].isSubscribed&&subscribedChannels[channel].onMessageCallback!=null){if(filtered==null){// regular subscription\n\tsubscribedChannels[channel].onMessageCallback(ortc,channel,message);}else{// filtered subscription\n\tsubscribedChannels[channel].onMessageCallback(ortc,channel,filtered,message);}}};var delegateExceptionCallback=function(ortc,event){if(ortc!=null&&ortc.onException!=null){ortc.onException(ortc,event);}};var delegateReconnectingCallback=function(ortc){if(ortc!=null&&ortc.onReconnecting!=null){ortc.onReconnecting(ortc);}};var delegateReconnectedCallback=function(ortc){if(ortc!=null&&ortc.onReconnected!=null){startHeartBeatInterval(ortc);ortc.onReconnected(ortc);}};}", "componentDidMount() {\n //setLocalNotification();\n }", "constructor(httpClient) {\n this.httpClient = httpClient;\n //public url_base = \"http://localhost:8080\";\n this.url_base = \"https://yaoyuan333.wm.r.appspot.com\";\n }", "function AppMeasurement_Module_Media(s){var m=this;m.s=s;s=window;if(!s.s_c_in)s.s_c_il=[],s.s_c_in=0;m._il=s.s_c_il;m._in=s.s_c_in;m._il[m._in]=m;s.s_c_in++;m._c=\"s_m\";m.list=[];m.open=function(w,b,c,h){var d={},a=new Date,g=\"\",e;b||(b=-1);if(w&&c){if(!m.list)m.list={};m.list[w]&&m.close(w);if(h&&h.id)g=h.id;if(g)for(e in m.list)!Object.prototype[e]&&m.list[e]&&m.list[e].S==g&&m.close(m.list[e].name);d.name=w;d.length=b;d.u=0;d.c=0;d.playerName=m.playerName?m.playerName:c;d.S=g;d.L=0;d.f=0;d.timestamp=\r\n\t\tMath.floor(a.getTime()/1E3);d.j=0;d.r=d.timestamp;d.a=-1;d.B=\"\";d.k=-1;d.C=0;d.H={};d.F=0;d.m=0;d.e=\"\";d.A=0;d.K=0;d.z=0;d.D=0;d.l=!1;d.v=\"\";d.I=\"\";d.J=0;d.q=!1;d.G=\"\";d.complete=0;d.Q=0;d.o=0;d.p=0;m.list[w]=d}};m.openAd=function(w,b,c,h,d,a,g,e){var f={};m.open(w,b,c,e);if(f=m.list[w])f.l=!0,f.v=h,f.I=d,f.J=a,f.G=g};m.M=function(w){var b=m.list[w];m.list[w]=0;b&&b.monitor&&clearTimeout(b.monitor.R)};m.close=function(w){m.g(w,0,-1)};m.play=function(w,b,c,h){var d=m.g(w,1,b,c,h);if(d&&!d.monitor)d.monitor=\r\n\t\t{},d.monitor.update=function(){d.j==1&&m.g(d.name,3,-1);d.monitor.R=setTimeout(d.monitor.update,1E3)},d.monitor.update()};m.click=function(w,b){m.g(w,7,b)};m.complete=function(w,b){m.g(w,5,b)};m.stop=function(w,b){m.g(w,2,b)};m.track=function(w){m.g(w,4,-1)};m.P=function(w,b){var c=\"a.media.\",h=w.linkTrackVars,d=w.linkTrackEvents,a=\"m_i\",g,e=w.contextData,f;if(b.l){c+=\"ad.\";if(b.v)e[\"a.media.name\"]=b.v,e[c+\"pod\"]=b.I,e[c+\"podPosition\"]=b.J;if(!b.F)e[c+\"CPM\"]=b.G}if(b.q)e[c+\"clicked\"]=!0,b.q=!1;e[\"a.contentType\"]=\r\n\t\t\"video\"+(b.l?\"Ad\":\"\");e[\"a.media.channel\"]=m.channel;e[c+\"name\"]=b.name;e[c+\"playerName\"]=b.playerName;if(b.length>0)e[c+\"length\"]=b.length;e[c+\"timePlayed\"]=Math.floor(b.f);Math.floor(b.f)>0&&(e[c+\"timePlayed\"]=Math.floor(b.f));if(!b.F)e[c+\"view\"]=!0,a=\"m_s\",b.F=1;if(b.e){e[c+\"segmentNum\"]=b.m;e[c+\"segment\"]=b.e;if(b.A>0)e[c+\"segmentLength\"]=b.A;b.z&&b.f>0&&(e[c+\"segmentView\"]=!0)}if(!b.Q&&b.complete)e[c+\"complete\"]=!0,b.T=1;if(b.o>0)e[c+\"milestone\"]=b.o;if(b.p>0)e[c+\"offsetMilestone\"]=b.p;if(h)for(f in e)Object.prototype[f]||\r\n\t\t(h+=\",contextData.\"+f);g=e[\"a.contentType\"];w.pe=a;w.pev3=g;var s,n;if(m.contextDataMapping){if(!w.events2)w.events2=\"\";h&&(h+=\",events\");for(f in m.contextDataMapping)if(!Object.prototype[f]){a=f.length>c.length&&f.substring(0,c.length)==c?f.substring(c.length):\"\";g=m.contextDataMapping[f];if(typeof g==\"string\"){s=g.split(\",\");for(n=0;n<s.length;n++)g=s[n],f==\"a.contentType\"?(h&&(h+=\",\"+g),w[g]=e[f]):a==\"view\"||a==\"segmentView\"||a==\"clicked\"||a==\"complete\"||a==\"timePlayed\"||a==\"CPM\"?(d&&(d+=\",\"+\r\n\t\tg),a==\"timePlayed\"||a==\"CPM\"?e[f]&&(w.events2+=(w.events2?\",\":\"\")+g+\"=\"+e[f]):e[f]&&(w.events2+=(w.events2?\",\":\"\")+g)):a==\"segment\"&&e[f+\"Num\"]?(h&&(h+=\",\"+g),w[g]=e[f+\"Num\"]+\":\"+e[f]):(h&&(h+=\",\"+g),w[g]=e[f])}else if(a==\"milestones\"||a==\"offsetMilestones\")f=f.substring(0,f.length-1),e[f]&&m.contextDataMapping[f+\"s\"][e[f]]&&(d&&(d+=\",\"+m.contextDataMapping[f+\"s\"][e[f]]),w.events2+=(w.events2?\",\":\"\")+m.contextDataMapping[f+\"s\"][e[f]]);e[f]&&(e[f]=0);a==\"segment\"&&e[f+\"Num\"]&&(e[f+\"Num\"]=0)}}w.linkTrackVars=\r\n\t\th;w.linkTrackEvents=d};m.g=function(w,b,c,h,d){var a={},g=(new Date).getTime()/1E3,e,f,s=m.trackVars,n=m.trackEvents,o=m.trackSeconds,p=m.trackMilestones,q=m.trackOffsetMilestones,r=m.segmentByMilestones,t=m.segmentByOffsetMilestones,k,j,l=1,i={},u;if(!m.channel)m.channel=m.s.w.location.hostname;if(a=w&&m.list&&m.list[w]?m.list[w]:0){if(a.l)o=m.adTrackSeconds,p=m.adTrackMilestones,q=m.adTrackOffsetMilestones,r=m.adSegmentByMilestones,t=m.adSegmentByOffsetMilestones;c<0&&(c=a.j==1&&a.r>0?g-a.r+a.a:\r\n\t\ta.a);a.length>0&&(c=c<a.length?c:a.length);c<0&&(c=0);a.u=c;if(a.length>0)a.c=a.u/a.length*100,a.c=a.c>100?100:a.c;if(a.a<0)a.a=c;u=a.C;i.name=w;i.ad=a.l;i.length=a.length;i.openTime=new Date;i.openTime.setTime(a.timestamp*1E3);i.offset=a.u;i.percent=a.c;i.playerName=a.playerName;i.mediaEvent=a.k<0?\"OPEN\":b==1?\"PLAY\":b==2?\"STOP\":b==3?\"MONITOR\":b==4?\"TRACK\":b==5?\"COMPLETE\":b==7?\"CLICK\":\"CLOSE\";if(b>2||b!=a.j&&(b!=2||a.j==1)){if(!d)h=a.m,d=a.e;if(b){if(b==1)a.a=c;if((b<=3||b>=5)&&a.k>=0)if(l=!1,s=n=\r\n\t\t\"None\",a.k!=c){f=a.k;if(f>c)f=a.a,f>c&&(f=c);k=p?p.split(\",\"):0;if(a.length>0&&k&&c>=f)for(j=0;j<k.length;j++)if((e=k[j]?parseFloat(\"\"+k[j]):0)&&f/a.length*100<e&&a.c>=e)l=!0,j=k.length,i.mediaEvent=\"MILESTONE\",a.o=i.milestone=e;if((k=q?q.split(\",\"):0)&&c>=f)for(j=0;j<k.length;j++)if((e=k[j]?parseFloat(\"\"+k[j]):0)&&f<e&&c>=e)l=!0,j=k.length,i.mediaEvent=\"OFFSET_MILESTONE\",a.p=i.offsetMilestone=e}if(a.K||!d){if(r&&p&&a.length>0){if(k=p.split(\",\")){k.push(\"100\");for(j=f=0;j<k.length;j++)if(e=k[j]?parseFloat(\"\"+\r\n\t\tk[j]):0){if(a.c<e)h=j+1,d=\"M:\"+f+\"-\"+e,j=k.length;f=e}}}else if(t&&q&&(k=q.split(\",\"))){k.push(\"\"+(a.length>0?a.length:\"E\"));for(j=f=0;j<k.length;j++)if((e=k[j]?parseFloat(\"\"+k[j]):0)||k[j]==\"E\"){if(c<e||k[j]==\"E\")h=j+1,d=\"O:\"+f+\"-\"+e,j=k.length;f=e}}if(d)a.K=!0}if((d||a.e)&&d!=a.e){a.D=!0;if(!a.e)a.m=h,a.e=d;a.k>=0&&(l=!0)}if((b>=2||a.c>=100)&&a.a<c)a.L+=c-a.a,a.f+=c-a.a;if(b<=2||b==3&&!a.j)a.B+=(b==1||b==3?\"S\":\"E\")+Math.floor(c),a.j=b==3?1:b;if(!l&&a.k>=0&&b<=3&&(o=o?o:0)&&a.f>=o)l=!0,i.mediaEvent=\r\n\t\t\"SECONDS\";a.r=g;a.a=c}if(!b||b<=3&&a.c>=100)a.j!=2&&(a.B+=\"E\"+Math.floor(c)),b=0,s=n=\"None\",i.mediaEvent=\"CLOSE\";if(b==7)l=i.clicked=a.q=!0;if(b==5||m.completeByCloseOffset&&(!b||a.c>=100)&&a.length>0&&c>=a.length-m.completeCloseOffsetThreshold)l=i.complete=a.complete=!0;g=i.mediaEvent;g==\"MILESTONE\"?g+=\"_\"+i.milestone:g==\"OFFSET_MILESTONE\"&&(g+=\"_\"+i.offsetMilestone);a.H[g]?i.eventFirstTime=!1:(i.eventFirstTime=!0,a.H[g]=1);i.event=i.mediaEvent;i.timePlayed=a.L;i.segmentNum=a.m;i.segment=a.e;i.segmentLength=\r\n\t\ta.A;m.monitor&&b!=4&&m.monitor(m.s,i);b==0&&m.M(w);if(l&&a.C==u){w={};w.contextData={};w.linkTrackVars=s;w.linkTrackEvents=n;if(!w.linkTrackVars)w.linkTrackVars=\"\";if(!w.linkTrackEvents)w.linkTrackEvents=\"\";m.P(w,a);w.linkTrackVars||(w[\"!linkTrackVars\"]=1);w.linkTrackEvents||(w[\"!linkTrackEvents\"]=1);m.s.track(w);if(a.D)a.m=h,a.e=d,a.z=!0,a.D=!1;else if(a.f>0)a.z=!1;a.B=\"\";a.o=a.p=0;a.f-=Math.floor(a.f);a.k=c;a.C++}}}return a};m.O=function(w,b,c,h,d){var a=0;if(w&&(!m.autoTrackMediaLengthRequired||\r\n\t\tb&&b>0)){if(!m.list||!m.list[w]){if(c==1||c==3)m.open(w,b,\"HTML5 Video\",d),a=1}else a=1;a&&m.g(w,c,h,-1,0)}};m.attach=function(w){var b,c,h;if(w&&w.tagName&&w.tagName.toUpperCase()==\"VIDEO\"){if(!m.n)m.n=function(b,a,w){var c,f;if(m.autoTrack){c=b.currentSrc;(f=b.duration)||(f=-1);if(w<0)w=b.currentTime;m.O(c,f,a,w,b)}};b=function(){m.n(w,1,-1)};c=function(){m.n(w,1,-1)};m.i(w,\"play\",b);m.i(w,\"pause\",c);m.i(w,\"seeking\",c);m.i(w,\"seeked\",b);m.i(w,\"ended\",function(){m.n(w,0,-1)});m.i(w,\"timeupdate\",\r\n\t\tb);h=function(){!w.paused&&!w.ended&&!w.seeking&&m.n(w,3,-1);setTimeout(h,1E3)};h()}};m.i=function(m,b,c){m.attachEvent?m.attachEvent(\"on\"+b,c):m.addEventListener&&m.addEventListener(b,c,!1)};if(m.completeByCloseOffset==void 0)m.completeByCloseOffset=1;if(m.completeCloseOffsetThreshold==void 0)m.completeCloseOffsetThreshold=1;m.N=function(){var w,b;if(m.autoTrack&&(w=m.s.d.getElementsByTagName(\"VIDEO\")))for(b=0;b<w.length;b++)m.attach(w[b])};m.i(s,\"load\",m.N)}", "create () {\r\n // Send a create-job message to the native-app.\r\n openPort();\r\n return browser.storage.local.get({ props: {} }).then(result => {\r\n // Get a cookie jar for the job.\r\n return getCookieJarForVideo(this.props.videoUrl).then(cookieJar => {\r\n state.port.postMessage({\r\n topic: 'create-job',\r\n data: {\r\n jobId: this.id,\r\n // Merge the default props and the job props.\r\n props: Object.assign({ cookieJar }, result.props, this.props)\r\n }\r\n });\r\n \r\n // Flag this job as active.\r\n this.state = 'active';\r\n \r\n // Make the icon blue because a job is running.\r\n browser.browserAction.setIcon({\r\n path: 'icons/film-blue.svg'\r\n });\r\n });\r\n });\r\n }", "function AppMeasurement_Module_Media(s){var m=this;m.s=s;s=window;if(!s.s_c_in)s.s_c_il=[],s.s_c_in=0;m._il=s.s_c_il;m._in=s.s_c_in;m._il[m._in]=m;s.s_c_in++;m._c=\"s_m\";m.list=[];m.open=function(w,b,c,h){var d={},a=new Date,g=\"\",e;b||(b=-1);if(w&&c){if(!m.list)m.list={};m.list[w]&&m.close(w);if(h&&h.id)g=h.id;if(g)for(e in m.list)!Object.prototype[e]&&m.list[e]&&m.list[e].S==g&&m.close(m.list[e].name);d.name=w;d.length=b;d.u=0;d.c=0;d.playerName=m.playerName?m.playerName:c;d.S=g;d.L=0;d.f=0;d.timestamp=\r\nMath.floor(a.getTime()/1E3);d.j=0;d.r=d.timestamp;d.a=-1;d.B=\"\";d.k=-1;d.C=0;d.H={};d.F=0;d.m=0;d.e=\"\";d.A=0;d.K=0;d.z=0;d.D=0;d.l=!1;d.v=\"\";d.I=\"\";d.J=0;d.q=!1;d.G=\"\";d.complete=0;d.Q=0;d.o=0;d.p=0;m.list[w]=d}};m.openAd=function(w,b,c,h,d,a,g,e){var f={};m.open(w,b,c,e);if(f=m.list[w])f.l=!0,f.v=h,f.I=d,f.J=a,f.G=g};m.M=function(w){var b=m.list[w];m.list[w]=0;b&&b.monitor&&clearTimeout(b.monitor.R)};m.close=function(w){m.g(w,0,-1)};m.play=function(w,b,c,h){var d=m.g(w,1,b,c,h);if(d&&!d.monitor)d.monitor=\r\n{},d.monitor.update=function(){d.j==1&&m.g(d.name,3,-1);d.monitor.R=setTimeout(d.monitor.update,1E3)},d.monitor.update()};m.click=function(w,b){m.g(w,7,b)};m.complete=function(w,b){m.g(w,5,b)};m.stop=function(w,b){m.g(w,2,b)};m.track=function(w){m.g(w,4,-1)};m.P=function(w,b){var c=\"a.media.\",h=w.linkTrackVars,d=w.linkTrackEvents,a=\"m_i\",g,e=w.contextData,f;if(b.l){c+=\"ad.\";if(b.v)e[\"a.media.name\"]=b.v,e[c+\"pod\"]=b.I,e[c+\"podPosition\"]=b.J;if(!b.F)e[c+\"CPM\"]=b.G}if(b.q)e[c+\"clicked\"]=!0,b.q=!1;e[\"a.contentType\"]=\r\n\"video\"+(b.l?\"Ad\":\"\");e[\"a.media.channel\"]=m.channel;e[c+\"name\"]=b.name;e[c+\"playerName\"]=b.playerName;if(b.length>0)e[c+\"length\"]=b.length;e[c+\"timePlayed\"]=Math.floor(b.f);Math.floor(b.f)>0&&(e[c+\"timePlayed\"]=Math.floor(b.f));if(!b.F)e[c+\"view\"]=!0,a=\"m_s\",b.F=1;if(b.e){e[c+\"segmentNum\"]=b.m;e[c+\"segment\"]=b.e;if(b.A>0)e[c+\"segmentLength\"]=b.A;b.z&&b.f>0&&(e[c+\"segmentView\"]=!0)}if(!b.Q&&b.complete)e[c+\"complete\"]=!0,b.T=1;if(b.o>0)e[c+\"milestone\"]=b.o;if(b.p>0)e[c+\"offsetMilestone\"]=b.p;if(h)for(f in e)Object.prototype[f]||\r\n(h+=\",contextData.\"+f);g=e[\"a.contentType\"];w.pe=a;w.pev3=g;var s,n;if(m.contextDataMapping){if(!w.events2)w.events2=\"\";h&&(h+=\",events\");for(f in m.contextDataMapping)if(!Object.prototype[f]){a=f.length>c.length&&f.substring(0,c.length)==c?f.substring(c.length):\"\";g=m.contextDataMapping[f];if(typeof g==\"string\"){s=g.split(\",\");for(n=0;n<s.length;n++)g=s[n],f==\"a.contentType\"?(h&&(h+=\",\"+g),w[g]=e[f]):a==\"view\"||a==\"segmentView\"||a==\"clicked\"||a==\"complete\"||a==\"timePlayed\"||a==\"CPM\"?(d&&(d+=\",\"+\r\ng),a==\"timePlayed\"||a==\"CPM\"?e[f]&&(w.events2+=(w.events2?\",\":\"\")+g+\"=\"+e[f]):e[f]&&(w.events2+=(w.events2?\",\":\"\")+g)):a==\"segment\"&&e[f+\"Num\"]?(h&&(h+=\",\"+g),w[g]=e[f+\"Num\"]+\":\"+e[f]):(h&&(h+=\",\"+g),w[g]=e[f])}else if(a==\"milestones\"||a==\"offsetMilestones\")f=f.substring(0,f.length-1),e[f]&&m.contextDataMapping[f+\"s\"][e[f]]&&(d&&(d+=\",\"+m.contextDataMapping[f+\"s\"][e[f]]),w.events2+=(w.events2?\",\":\"\")+m.contextDataMapping[f+\"s\"][e[f]]);e[f]&&(e[f]=0);a==\"segment\"&&e[f+\"Num\"]&&(e[f+\"Num\"]=0)}}w.linkTrackVars=\r\nh;w.linkTrackEvents=d};m.g=function(w,b,c,h,d){var a={},g=(new Date).getTime()/1E3,e,f,s=m.trackVars,n=m.trackEvents,o=m.trackSeconds,p=m.trackMilestones,q=m.trackOffsetMilestones,r=m.segmentByMilestones,t=m.segmentByOffsetMilestones,k,j,l=1,i={},u;if(!m.channel)m.channel=m.s.w.location.hostname;if(a=w&&m.list&&m.list[w]?m.list[w]:0){if(a.l)o=m.adTrackSeconds,p=m.adTrackMilestones,q=m.adTrackOffsetMilestones,r=m.adSegmentByMilestones,t=m.adSegmentByOffsetMilestones;c<0&&(c=a.j==1&&a.r>0?g-a.r+a.a:\r\na.a);a.length>0&&(c=c<a.length?c:a.length);c<0&&(c=0);a.u=c;if(a.length>0)a.c=a.u/a.length*100,a.c=a.c>100?100:a.c;if(a.a<0)a.a=c;u=a.C;i.name=w;i.ad=a.l;i.length=a.length;i.openTime=new Date;i.openTime.setTime(a.timestamp*1E3);i.offset=a.u;i.percent=a.c;i.playerName=a.playerName;i.mediaEvent=a.k<0?\"OPEN\":b==1?\"PLAY\":b==2?\"STOP\":b==3?\"MONITOR\":b==4?\"TRACK\":b==5?\"COMPLETE\":b==7?\"CLICK\":\"CLOSE\";if(b>2||b!=a.j&&(b!=2||a.j==1)){if(!d)h=a.m,d=a.e;if(b){if(b==1)a.a=c;if((b<=3||b>=5)&&a.k>=0)if(l=!1,s=n=\r\n\"None\",a.k!=c){f=a.k;if(f>c)f=a.a,f>c&&(f=c);k=p?p.split(\",\"):0;if(a.length>0&&k&&c>=f)for(j=0;j<k.length;j++)if((e=k[j]?parseFloat(\"\"+k[j]):0)&&f/a.length*100<e&&a.c>=e)l=!0,j=k.length,i.mediaEvent=\"MILESTONE\",a.o=i.milestone=e;if((k=q?q.split(\",\"):0)&&c>=f)for(j=0;j<k.length;j++)if((e=k[j]?parseFloat(\"\"+k[j]):0)&&f<e&&c>=e)l=!0,j=k.length,i.mediaEvent=\"OFFSET_MILESTONE\",a.p=i.offsetMilestone=e}if(a.K||!d){if(r&&p&&a.length>0){if(k=p.split(\",\")){k.push(\"100\");for(j=f=0;j<k.length;j++)if(e=k[j]?parseFloat(\"\"+\r\nk[j]):0){if(a.c<e)h=j+1,d=\"M:\"+f+\"-\"+e,j=k.length;f=e}}}else if(t&&q&&(k=q.split(\",\"))){k.push(\"\"+(a.length>0?a.length:\"E\"));for(j=f=0;j<k.length;j++)if((e=k[j]?parseFloat(\"\"+k[j]):0)||k[j]==\"E\"){if(c<e||k[j]==\"E\")h=j+1,d=\"O:\"+f+\"-\"+e,j=k.length;f=e}}if(d)a.K=!0}if((d||a.e)&&d!=a.e){a.D=!0;if(!a.e)a.m=h,a.e=d;a.k>=0&&(l=!0)}if((b>=2||a.c>=100)&&a.a<c)a.L+=c-a.a,a.f+=c-a.a;if(b<=2||b==3&&!a.j)a.B+=(b==1||b==3?\"S\":\"E\")+Math.floor(c),a.j=b==3?1:b;if(!l&&a.k>=0&&b<=3&&(o=o?o:0)&&a.f>=o)l=!0,i.mediaEvent=\r\n\"SECONDS\";a.r=g;a.a=c}if(!b||b<=3&&a.c>=100)a.j!=2&&(a.B+=\"E\"+Math.floor(c)),b=0,s=n=\"None\",i.mediaEvent=\"CLOSE\";if(b==7)l=i.clicked=a.q=!0;if(b==5||m.completeByCloseOffset&&(!b||a.c>=100)&&a.length>0&&c>=a.length-m.completeCloseOffsetThreshold)l=i.complete=a.complete=!0;g=i.mediaEvent;g==\"MILESTONE\"?g+=\"_\"+i.milestone:g==\"OFFSET_MILESTONE\"&&(g+=\"_\"+i.offsetMilestone);a.H[g]?i.eventFirstTime=!1:(i.eventFirstTime=!0,a.H[g]=1);i.event=i.mediaEvent;i.timePlayed=a.L;i.segmentNum=a.m;i.segment=a.e;i.segmentLength=\r\na.A;m.monitor&&b!=4&&m.monitor(m.s,i);b==0&&m.M(w);if(l&&a.C==u){w={};w.contextData={};w.linkTrackVars=s;w.linkTrackEvents=n;if(!w.linkTrackVars)w.linkTrackVars=\"\";if(!w.linkTrackEvents)w.linkTrackEvents=\"\";m.P(w,a);w.linkTrackVars||(w[\"!linkTrackVars\"]=1);w.linkTrackEvents||(w[\"!linkTrackEvents\"]=1);m.s.track(w);if(a.D)a.m=h,a.e=d,a.z=!0,a.D=!1;else if(a.f>0)a.z=!1;a.B=\"\";a.o=a.p=0;a.f-=Math.floor(a.f);a.k=c;a.C++}}}return a};m.O=function(w,b,c,h,d){var a=0;if(w&&(!m.autoTrackMediaLengthRequired||\r\nb&&b>0)){if(!m.list||!m.list[w]){if(c==1||c==3)m.open(w,b,\"HTML5 Video\",d),a=1}else a=1;a&&m.g(w,c,h,-1,0)}};m.attach=function(w){var b,c,h;if(w&&w.tagName&&w.tagName.toUpperCase()==\"VIDEO\"){if(!m.n)m.n=function(b,a,w){var c,f;if(m.autoTrack){c=b.currentSrc;(f=b.duration)||(f=-1);if(w<0)w=b.currentTime;m.O(c,f,a,w,b)}};b=function(){m.n(w,1,-1)};c=function(){m.n(w,1,-1)};m.i(w,\"play\",b);m.i(w,\"pause\",c);m.i(w,\"seeking\",c);m.i(w,\"seeked\",b);m.i(w,\"ended\",function(){m.n(w,0,-1)});m.i(w,\"timeupdate\",\r\nb);h=function(){!w.paused&&!w.ended&&!w.seeking&&m.n(w,3,-1);setTimeout(h,1E3)};h()}};m.i=function(m,b,c){m.attachEvent?m.attachEvent(\"on\"+b,c):m.addEventListener&&m.addEventListener(b,c,!1)};if(m.completeByCloseOffset==void 0)m.completeByCloseOffset=1;if(m.completeCloseOffsetThreshold==void 0)m.completeCloseOffsetThreshold=1;m.N=function(){var w,b;if(m.autoTrack&&(w=m.s.d.getElementsByTagName(\"VIDEO\")))for(b=0;b<w.length;b++)m.attach(w[b])};m.i(s,\"load\",m.N)}", "supportsPlatform() {\n return true;\n }", "function FileSystemService($http, $q, $log) {\n var _directory = LocalFileSystem.PERSISTENT;\n var _fs = null;\n var _that = this;\n\n this.isInitalized = false;\n\n function errorHandler(e) {\n var msg = '';\n\n switch (e.code) {\n case FileError.QUOTA_EXCEEDED_ERR:\n msg = 'QUOTA_EXCEEDED_ERR';\n break;\n case FileError.NOT_FOUND_ERR:\n msg = 'NOT_FOUND_ERR';\n break;\n case FileError.SECURITY_ERR:\n msg = 'SECURITY_ERR';\n break;\n case FileError.INVALID_MODIFICATION_ERR:\n msg = 'INVALID_MODIFICATION_ERR';\n break;\n case FileError.INVALID_STATE_ERR:\n msg = 'INVALID_STATE_ERR';\n break;\n default:\n msg = 'Unknown Error';\n break;\n };\n\n $log.error('FileSystemService: ' + msg);\n }\n\n // startup\n window.requestFileSystem(_directory, 0, function(fs){\n _fs = fs;\n _that.isInitalized = true;\n }, errorHandler);\n\n\n /**\n * Checks if file is in persistent storage\n */\n this.fileExists = function(filename) {\n // fs not initialised\n if(!_that.isInitalized)\n return;\n //var uri = _directory + \"/\" + filename;\n //return $http.get(uri);\n var deferred = $q.defer();\n\n _fs.root.getFile(filename, {}, function(fileEntry) {\n // Get a File object representing the file,\n // then use FileReader to read its contents.\n fileEntry.file(function(file) {\n var reader = new FileReader();\n\n reader.onloadend = function(e) {\n deferred.resolve(e.target.result);\n };\n\n reader.readAsDataURL(file);\n }, errorHandler);\n }, errorHandler);\n\n return deferred.promise;\n }\n\n /**\n * Get File from perstistent storage\n */\n this.getFile = function(filename) {\n // fs not initialised\n if(!_that.isInitalized)\n return;\n //var uri = _directory + \"/\" + filename;\n //return $http.get(uri);\n var deferred = $q.defer();\n\n _fs.root.getFile(filename, {}, function(fileEntry) {\n // Get a File object representing the file,\n // then use FileReader to read its contents.\n fileEntry.file(function(file) {\n var reader = new FileReader();\n\n reader.onloadend = function(e) {\n deferred.resolve(e.target.result);\n };\n\n reader.readAsDataURL(file);\n }, errorHandler);\n }, errorHandler);\n\n return deferred.promise;\n }\n\n /**\n * Save data into file (and create that if necessary).\n */\n this.saveFile = function(filename, data) {\n // fs not initialised\n if(!_that.isInitalized)\n return;\n\n var deferred = $q.defer();\n\n _fs.root.getFile(filename, {create: true}, function(fileEntry) {\n // Create a FileWriter object for our FileEntry (log.txt).\n fileEntry.createWriter(function(fileWriter) {\n\n fileWriter.onwriteend = function(e) {\n $log.log('Write completed.');\n deferred.resolve();\n };\n\n fileWriter.onerror = function(e) {\n deferred.reject(e);\n $log.error('FileSystemService: write failed, ' + e.toString());\n };\n\n // Create a new Blob and write it to log.txt.\n var blob = new Blob([data], {type: 'text/plain'});\n\n fileWriter.write(blob);\n\n }, errorHandler);\n }, errorHandler);\n\n return deferred.promise;\n }\n}", "static initialize(app, changeLogService, deviceService, deviceFileService, deviceFileUploadService, file, httpService, localDBManagementService, localDbService, networkService, securityService) {\n if (this.initialized) {\n return;\n }\n deviceService.addStartUpService({\n serviceName: 'OfflineStartupService',\n start: () => {\n if (window['SQLitePlugin']) {\n localDBManagementService.setLogSQl((sessionStorage.getItem('wm.logSql') === 'true') || (sessionStorage.getItem('debugMode') === 'true'));\n window.logSql = (flag = true) => {\n localDBManagementService.setLogSQl(flag);\n sessionStorage.setItem('wm.logSql', flag ? 'true' : 'false');\n };\n window.executeLocalSql = (dbName, query, params) => {\n localDBManagementService.executeSQLQuery(dbName, query, params, true);\n };\n return localDBManagementService.loadDatabases().then(() => {\n changeLogService.addWorker(new IdResolver(localDBManagementService));\n changeLogService.addWorker(new ErrorBlocker(localDBManagementService));\n changeLogService.addWorker(new FileHandler());\n changeLogService.addWorker(new MultiPartParamTransformer(deviceFileService, localDBManagementService));\n new LiveVariableOfflineBehaviour(changeLogService, httpService, localDBManagementService, networkService, localDbService).add();\n new FileUploadOfflineBehaviour(changeLogService, deviceFileService, deviceFileUploadService, file, networkService, deviceFileService.getUploadDirectory()).add();\n new NamedQueryExecutionOfflineBehaviour(changeLogService, httpService, localDBManagementService, networkService).add();\n localDBManagementService.registerCallback(new UploadedFilesImportAndExportService(changeLogService, deviceFileService, localDBManagementService, file));\n changeLogService.addWorker({\n onAddCall: () => {\n if (!networkService.isConnected()) {\n networkService.disableAutoConnect();\n }\n },\n postFlush: stats => {\n if (stats.totalTaskCount > 0) {\n localDBManagementService.close()\n .catch(noop)\n .then(() => {\n location.assign(window.location.origin + window.location.pathname);\n });\n }\n }\n });\n });\n }\n return Promise.resolve();\n }\n });\n new SecurityOfflineBehaviour(app, file, deviceService, networkService, securityService).add();\n }", "constructor(){\n\t\t//console.log('API START');\n\t}", "get deviceServiceUUID() { return this._deviceServiceUUID ? this._deviceServiceUUID : 'FFE0'; }", "_sdkCompatibility() {\n // WebSocket\n // http://caniuse.com/#feat=websockets\n var canCreateWebSocket = 'WebSocket' in window;\n console.log('Native WebSocket capability: ' +\n canCreateWebSocket);\n\n if (!canCreateWebSocket) {\n throw new Error('No WebSocket capabilities');\n }\n }", "constructor () {\r\n\t\t\r\n\t}", "initleancloud() {\n AV.init({\n appId: keys.appId,\n appKey: keys.appKey\n })\n this.globalData.AV = AV\n }", "constructor(args) {\n super();\n args = args || {}\n this.CONSTRUCTOR_ID = 0x330b4067;\n this.SUBCLASS_OF_ID = 0xd3262a4a;\n\n this.phonecallsEnabled = args.phonecallsEnabled || null;\n this.defaultP2pContacts = args.defaultP2pContacts || null;\n this.preloadFeaturedStickers = args.preloadFeaturedStickers || null;\n this.ignorePhoneEntities = args.ignorePhoneEntities || null;\n this.revokePmInbox = args.revokePmInbox || null;\n this.blockedMode = args.blockedMode || null;\n this.pfsEnabled = args.pfsEnabled || null;\n this.date = args.date;\n this.expires = args.expires;\n this.testMode = args.testMode;\n this.thisDc = args.thisDc;\n this.dcOptions = args.dcOptions;\n this.dcTxtDomainName = args.dcTxtDomainName;\n this.chatSizeMax = args.chatSizeMax;\n this.megagroupSizeMax = args.megagroupSizeMax;\n this.forwardedCountMax = args.forwardedCountMax;\n this.onlineUpdatePeriodMs = args.onlineUpdatePeriodMs;\n this.offlineBlurTimeoutMs = args.offlineBlurTimeoutMs;\n this.offlineIdleTimeoutMs = args.offlineIdleTimeoutMs;\n this.onlineCloudTimeoutMs = args.onlineCloudTimeoutMs;\n this.notifyCloudDelayMs = args.notifyCloudDelayMs;\n this.notifyDefaultDelayMs = args.notifyDefaultDelayMs;\n this.pushChatPeriodMs = args.pushChatPeriodMs;\n this.pushChatLimit = args.pushChatLimit;\n this.savedGifsLimit = args.savedGifsLimit;\n this.editTimeLimit = args.editTimeLimit;\n this.revokeTimeLimit = args.revokeTimeLimit;\n this.revokePmTimeLimit = args.revokePmTimeLimit;\n this.ratingEDecay = args.ratingEDecay;\n this.stickersRecentLimit = args.stickersRecentLimit;\n this.stickersFavedLimit = args.stickersFavedLimit;\n this.channelsReadMediaPeriod = args.channelsReadMediaPeriod;\n this.tmpSessions = args.tmpSessions || null;\n this.pinnedDialogsCountMax = args.pinnedDialogsCountMax;\n this.pinnedInfolderCountMax = args.pinnedInfolderCountMax;\n this.callReceiveTimeoutMs = args.callReceiveTimeoutMs;\n this.callRingTimeoutMs = args.callRingTimeoutMs;\n this.callConnectTimeoutMs = args.callConnectTimeoutMs;\n this.callPacketTimeoutMs = args.callPacketTimeoutMs;\n this.meUrlPrefix = args.meUrlPrefix;\n this.autoupdateUrlPrefix = args.autoupdateUrlPrefix || null;\n this.gifSearchUsername = args.gifSearchUsername || null;\n this.venueSearchUsername = args.venueSearchUsername || null;\n this.imgSearchUsername = args.imgSearchUsername || null;\n this.staticMapsProvider = args.staticMapsProvider || null;\n this.captionLengthMax = args.captionLengthMax;\n this.messageLengthMax = args.messageLengthMax;\n this.webfileDcId = args.webfileDcId;\n this.suggestedLangCode = args.suggestedLangCode || null;\n this.langPackVersion = args.langPackVersion || null;\n this.baseLangPackVersion = args.baseLangPackVersion || null;\n }", "static _getName() {\n return 'ContentPlayback';\n }", "start(callback){\n \n }", "onStartHeaders() {}", "async componentWillMount() {\n var _this = this\n _this.setUpUserDataFromFB()\n\n //ASK FOR CAMERA ONLT IF IS PREVIEW TRUE AND SHOWBARCODE TRUE\n if (Config.isPreview && Config.showBCScanner) {\n const { status } = await Permissions.askAsync(Permissions.CAMERA);\n this.setState({ hasCameraPermission: status === 'granted' });\n }\n\n\n\n AppEventEmitter.addListener('user.state.changes', this.alterUserState);\n if (Config.isTesterApp) {\n this.listenForUserAuth();\n } else if (Config.isPreview && !Config.isTesterApp) {\n //Load list of apps\n _this.retreiveAppDemos(\"apps\");\n }\n\n if (!Config.isPreview && !Config.isTesterApp) {\n\n //Load the data automatically, this is normal app and refister for Push notification\n this.registerForPushNotificationsAsync();\n Notifications.addListener(this._handleNotification);\n this.retreiveMeta();\n }\n\n\n await Font.loadAsync({\n //\"Material Icons\": require(\"@expo/vector-icons/fonts/MaterialIcons.ttf\"),\n //\"Ionicons\": require(\"@expo/vector-icons/fonts/Ionicons.ttf\"),\n // \"Feather\": require(\"@expo/vector-icons/fonts/Feather.ttf\"),\n 'open-sans': require('./assets/fonts/OpenSans-Regular.ttf'),\n 'lato-light': require('./assets/fonts/Lato-Light.ttf'),\n 'lato-regular': require('./assets/fonts/Lato-Regular.ttf'),\n 'lato-bold': require('./assets/fonts/Lato-Bold.ttf'),\n 'lato-black': require('./assets/fonts/Lato-Black.ttf'),\n 'roboto-medium': require('./assets/fonts/Roboto-Medium.ttf'),\n 'roboto-bold': require('./assets/fonts/Roboto-Bold.ttf'),\n 'roboto-light': require('./assets/fonts/Roboto-Light.ttf'),\n 'roboto-thin': require('./assets/fonts/Roboto-Thin.ttf'),\n\n });\n\n this.setState({ isReady: true, fontLoaded: true });\n }", "function writeHeader() {\n seekHead = createSeekHead();\n \n let\n ebmlHeader = {\n \"id\": 0x1a45dfa3, // EBML\n \"data\": [\n {\n \"id\": 0x4286, // EBMLVersion\n \"data\": 1\n },\n {\n \"id\": 0x42f7, // EBMLReadVersion\n \"data\": 1\n },\n {\n \"id\": 0x42f2, // EBMLMaxIDLength\n \"data\": 4\n },\n {\n \"id\": 0x42f3, // EBMLMaxSizeLength\n \"data\": 8\n },\n {\n \"id\": 0x4282, // DocType\n \"data\": \"webm\"\n },\n {\n \"id\": 0x4287, // DocTypeVersion\n \"data\": 2\n },\n {\n \"id\": 0x4285, // DocTypeReadVersion\n \"data\": 2\n }\n ]\n },\n \n segmentInfo = {\n \"id\": 0x1549a966, // Info\n \"data\": [\n {\n \"id\": 0x2ad7b1, // TimecodeScale\n \"data\": 1e6 // Times will be in miliseconds (1e6 nanoseconds per step = 1ms)\n },\n {\n \"id\": 0x4d80, // MuxingApp\n \"data\": \"webm-writer-js\",\n },\n {\n \"id\": 0x5741, // WritingApp\n \"data\": \"webm-writer-js\"\n },\n segmentDuration // To be filled in later\n ]\n },\n \n videoProperties = [\n {\n \"id\": 0xb0, // PixelWidth\n \"data\": videoWidth\n },\n {\n \"id\": 0xba, // PixelHeight\n \"data\": videoHeight\n }\n ];\n \n if (options.transparent) {\n videoProperties.push(\n {\n \"id\": 0x53C0, // AlphaMode\n \"data\": 1\n }\n );\n }\n \n let\n tracks = {\n \"id\": 0x1654ae6b, // Tracks\n \"data\": [\n {\n \"id\": 0xae, // TrackEntry\n \"data\": [\n {\n \"id\": 0xd7, // TrackNumber\n \"data\": DEFAULT_TRACK_NUMBER\n },\n {\n \"id\": 0x73c5, // TrackUID\n \"data\": DEFAULT_TRACK_NUMBER\n },\n {\n \"id\": 0x9c, // FlagLacing\n \"data\": 0\n },\n {\n \"id\": 0x22b59c, // Language\n \"data\": \"und\"\n },\n {\n \"id\": 0x86, // CodecID\n \"data\": \"V_VP8\"\n },\n {\n \"id\": 0x258688, // CodecName\n \"data\": \"VP8\"\n },\n {\n \"id\": 0x83, // TrackType\n \"data\": 1\n },\n {\n \"id\": 0xe0, // Video\n \"data\": videoProperties\n }\n ]\n }\n ]\n };\n \n ebmlSegment = {\n \"id\": 0x18538067, // Segment\n \"size\": -1, // Unbounded size\n \"data\": [\n seekHead,\n segmentInfo,\n tracks,\n ]\n };\n \n let\n bufferStream = new ArrayBufferDataStream(256);\n \n writeEBML(bufferStream, blobBuffer.pos, [ebmlHeader, ebmlSegment]);\n blobBuffer.write(bufferStream.getAsDataArray());\n \n // Now we know where these top-level elements lie in the file:\n seekPoints.SegmentInfo.positionEBML.data = fileOffsetToSegmentRelative(segmentInfo.offset);\n seekPoints.Tracks.positionEBML.data = fileOffsetToSegmentRelative(tracks.offset);\n \n\t writtenHeader = true;\n }", "function AppMeasurement(){var s=this;s.version=\"1.0.3\";var w=window;if(!w.s_c_in)w.s_c_il=[],w.s_c_in=0;s._il=w.s_c_il;s._in=w.s_c_in;s._il[s._in]=s;w.s_c_in++;s._c=\"s_c\";var n=w,g,k;try{g=n.parent;for(k=n.location;g&&g.location&&k&&\"\"+g.location!=\"\"+k&&n.location&&\"\"+g.location!=\"\"+n.location&&g.location.host==k.host;)n=g,g=n.parent}catch(o){}s.za=function(s){try{console.log(s)}catch(a){}};s.ba=function(s){return\"\"+parseInt(s)==\"\"+s};s.replace=function(s,a,c){if(!s||s.indexOf(a)<0)return s;return s.split(a).join(c)};\r\ns.escape=function(b){var a,c;if(!b)return b;b=encodeURIComponent(b);for(a=0;a<7;a++)c=\"+~!*()'\".substring(a,a+1),b.indexOf(c)>=0&&(b=s.replace(b,c,\"%\"+c.charCodeAt(0).toString(16).toUpperCase()));return b};s.unescape=function(b){if(!b)return b;b=b.indexOf(\"+\")>=0?s.replace(b,\"+\",\" \"):b;try{return decodeURIComponent(b)}catch(a){}return unescape(b)};s.pa=function(){var b=w.location.hostname,a=s.fpCookieDomainPeriods,c;if(!a)a=s.cookieDomainPeriods;if(b&&!s.U&&!/^[0-9.]+$/.test(b)&&(a=a?parseInt(a):\r\n2,a=a>2?a:2,c=b.lastIndexOf(\".\"),c>=0)){for(;c>=0&&a>1;)c=b.lastIndexOf(\".\",c-1),a--;s.U=c>0?b.substring(c):b}return s.U};s.c_r=s.cookieRead=function(b){b=s.escape(b);var a=\" \"+s.d.cookie,c=a.indexOf(\" \"+b+\"=\"),e=c<0?c:a.indexOf(\";\",c);b=c<0?\"\":s.unescape(a.substring(c+2+b.length,e<0?a.length:e));return b!=\"[[B]]\"?b:\"\"};s.c_w=s.cookieWrite=function(b,a,c){var e=s.pa(),d=s.cookieLifetime,f;a=\"\"+a;d=d?(\"\"+d).toUpperCase():\"\";c&&d!=\"SESSION\"&&d!=\"NONE\"&&((f=a!=\"\"?parseInt(d?d:0):-60)?(c=new Date,c.setTime(c.getTime()+\r\nf*1E3)):c==1&&(c=new Date,f=c.getYear(),c.setYear(f+5+(f<1900?1900:0))));if(b&&d!=\"NONE\")return s.d.cookie=b+\"=\"+s.escape(a!=\"\"?a:\"[[B]]\")+\"; path=/;\"+(c&&d!=\"SESSION\"?\" expires=\"+c.toGMTString()+\";\":\"\")+(e?\" domain=\"+e+\";\":\"\"),s.cookieRead(b)==a;return 0};s.v=[];s.V=function(b,a){if(s.W)return 0;if(!s.maxDelay)s.maxDelay=250;var c=0,e=(new Date).getTime()+s.maxDelay,d=s.d.Ma,f=[\"webkitvisibilitychange\",\"visibilitychange\"];if(!d)d=s.d.Na;if(d&&d==\"prerender\"){if(!s.G){s.G=1;for(c=0;c<f.length;c++)s.d.addEventListener(f[c],\r\nfunction(){var b=s.d.Ma;if(!b)b=s.d.Na;if(b==\"visible\")s.G=0,s.delayReady()})}c=1;e=0}else s.u(\"_d\")&&(c=1);c&&(s.v.push({m:b,a:a,t:e}),s.G||setTimeout(s.delayReady,s.maxDelay));return c};s.delayReady=function(){var b=(new Date).getTime(),a=0,c;for(s.u(\"_d\")&&(a=1);s.v.length>0;){c=s.v.shift();if(a&&!c.t&&c.t>b){s.v.unshift(c);setTimeout(s.delayReady,parseInt(s.maxDelay/2));break}s.W=1;s[c.m].apply(s,c.a);s.W=0}};s.setAccount=s.sa=function(b){var a,c;if(!s.V(\"setAccount\",arguments))if(s.account=b,\r\ns.allAccounts){a=s.allAccounts.concat(b.split(\",\"));s.allAccounts=[];a.sort();for(c=0;c<a.length;c++)(c==0||a[c-1]!=a[c])&&s.allAccounts.push(a[c])}else s.allAccounts=b.split(\",\")};s.P=function(b,a,c,e,d){var f=\"\",i,j,w,q,g=0;b==\"contextData\"&&(b=\"c\");if(a){for(i in a)if(!Object.prototype[i]&&(!d||i.substring(0,d.length)==d)&&a[i]&&(!c||c.indexOf(\",\"+(e?e+\".\":\"\")+i+\",\")>=0)){w=!1;if(g)for(j=0;j<g.length;j++)i.substring(0,g[j].length)==g[j]&&(w=!0);if(!w&&(f==\"\"&&(f+=\"&\"+b+\".\"),j=a[i],d&&(i=i.substring(d.length)),\r\ni.length>0))if(w=i.indexOf(\".\"),w>0)j=i.substring(0,w),w=(d?d:\"\")+j+\".\",g||(g=[]),g.push(w),f+=s.P(j,a,c,e,w);else if(typeof j==\"boolean\"&&(j=j?\"true\":\"false\"),j){if(e==\"retrieveLightData\"&&d.indexOf(\".contextData.\")<0)switch(w=i.substring(0,4),q=i.substring(4),i){case \"transactionID\":i=\"xact\";break;case \"channel\":i=\"ch\";break;case \"campaign\":i=\"v0\";break;default:s.ba(q)&&(w==\"prop\"?i=\"c\"+q:w==\"eVar\"?i=\"v\"+q:w==\"list\"?i=\"l\"+q:w==\"hier\"&&(i=\"h\"+q,j=j.substring(0,255)))}f+=\"&\"+s.escape(i)+\"=\"+s.escape(j)}}f!=\r\n\"\"&&(f+=\"&.\"+b)}return f};s.ra=function(){var b=\"\",a,c,e,d,f,i,j,w,g=\"\",n=\"\",k=c=\"\";if(s.lightProfileID)a=s.J,(g=s.lightTrackVars)&&(g=\",\"+g+\",\"+s.ea.join(\",\")+\",\");else{a=s.e;if(s.pe||s.linkType)if(g=s.linkTrackVars,n=s.linkTrackEvents,s.pe&&(c=s.pe.substring(0,1).toUpperCase()+s.pe.substring(1),s[c]))g=s[c].Va,n=s[c].Ua;g&&(g=\",\"+g+\",\"+s.C.join(\",\")+\",\");n&&(n=\",\"+n+\",\",g&&(g+=\",events,\"));s.events2&&(k+=(k!=\"\"?\",\":\"\")+s.events2)}for(c=0;c<a.length;c++){d=a[c];f=s[d];e=d.substring(0,4);i=d.substring(4);\r\n!f&&d==\"events\"&&k&&(f=k,k=\"\");if(f&&(!g||g.indexOf(\",\"+d+\",\")>=0)){switch(d){case \"timestamp\":d=\"ts\";break;case \"dynamicVariablePrefix\":d=\"D\";break;case \"visitorID\":d=\"vid\";break;case \"pageURL\":d=\"g\";if(f.length>255)s.pageURLRest=f.substring(255),f=f.substring(0,255);break;case \"pageURLRest\":d=\"-g\";break;case \"referrer\":d=\"r\";break;case \"vmk\":case \"visitorMigrationKey\":d=\"vmt\";break;case \"visitorMigrationServer\":d=\"vmf\";s.ssl&&s.visitorMigrationServerSecure&&(f=\"\");break;case \"visitorMigrationServerSecure\":d=\r\n\"vmf\";!s.ssl&&s.visitorMigrationServer&&(f=\"\");break;case \"charSet\":d=\"ce\";break;case \"visitorNamespace\":d=\"ns\";break;case \"cookieDomainPeriods\":d=\"cdp\";break;case \"cookieLifetime\":d=\"cl\";break;case \"variableProvider\":d=\"vvp\";break;case \"currencyCode\":d=\"cc\";break;case \"channel\":d=\"ch\";break;case \"transactionID\":d=\"xact\";break;case \"campaign\":d=\"v0\";break;case \"resolution\":d=\"s\";break;case \"colorDepth\":d=\"c\";break;case \"javascriptVersion\":d=\"j\";break;case \"javaEnabled\":d=\"v\";break;case \"cookiesEnabled\":d=\r\n\"k\";break;case \"browserWidth\":d=\"bw\";break;case \"browserHeight\":d=\"bh\";break;case \"connectionType\":d=\"ct\";break;case \"homepage\":d=\"hp\";break;case \"plugins\":d=\"p\";break;case \"events\":k&&(f+=(f!=\"\"?\",\":\"\")+k);if(n){i=f.split(\",\");f=\"\";for(e=0;e<i.length;e++)j=i[e],w=j.indexOf(\"=\"),w>=0&&(j=j.substring(0,w)),w=j.indexOf(\":\"),w>=0&&(j=j.substring(0,w)),n.indexOf(\",\"+j+\",\")>=0&&(f+=(f?\",\":\"\")+i[e])}break;case \"events2\":f=\"\";break;case \"contextData\":b+=s.P(\"c\",s[d],g,d);f=\"\";break;case \"lightProfileID\":d=\r\n\"mtp\";break;case \"lightStoreForSeconds\":d=\"mtss\";s.lightProfileID||(f=\"\");break;case \"lightIncrementBy\":d=\"mti\";s.lightProfileID||(f=\"\");break;case \"retrieveLightProfiles\":d=\"mtsr\";break;case \"deleteLightProfiles\":d=\"mtsd\";break;case \"retrieveLightData\":s.retrieveLightProfiles&&(b+=s.P(\"mts\",s[d],g,d));f=\"\";break;default:s.ba(i)&&(e==\"prop\"?d=\"c\"+i:e==\"eVar\"?d=\"v\"+i:e==\"list\"?d=\"l\"+i:e==\"hier\"&&(d=\"h\"+i,f=f.substring(0,255)))}f&&(b+=\"&\"+d+\"=\"+(d.substring(0,3)!=\"pev\"?s.escape(f):f))}d==\"pev3\"&&s.g&&\r\n(b+=s.g)}return b};s.p=function(s){var a=s.tagName;if(\"\"+s.Ta!=\"undefined\"||\"\"+s.Ea!=\"undefined\"&&(\"\"+s.Ea).toUpperCase()!=\"HTML\")return\"\";a=a&&a.toUpperCase?a.toUpperCase():\"\";a==\"SHAPE\"&&(a=\"\");a&&((a==\"INPUT\"||a==\"BUTTON\")&&s.type&&s.type.toUpperCase?a=s.type.toUpperCase():!a&&s.href&&(a=\"A\"));return a};s.Y=function(s){var a=s.href?s.href:\"\",c,e,d;c=a.indexOf(\":\");e=a.indexOf(\"?\");d=a.indexOf(\"/\");if(a&&(c<0||e>=0&&c>e||d>=0&&c>d))e=s.protocol&&s.protocol.length>1?s.protocol:l.protocol?l.protocol:\r\n\"\",c=l.pathname.lastIndexOf(\"/\"),a=(e?e+\"//\":\"\")+(s.host?s.host:l.host?l.host:\"\")+(h.substring(0,1)!=\"/\"?l.pathname.substring(0,c<0?0:c)+\"/\":\"\")+a;return a};s.z=function(b){var a=s.p(b),c,e,d=\"\",f=0;if(a){c=b.protocol;e=b.onclick;if(b.href&&(a==\"A\"||a==\"AREA\")&&(!e||!c||c.toLowerCase().indexOf(\"javascript\")<0))d=s.Y(b);else if(e)d=s.replace(s.replace(s.replace(s.replace(\"\"+e,\"\\r\",\"\"),\"\\n\",\"\"),\"\\t\",\"\"),\" \",\"\"),f=2;else if(a==\"INPUT\"||a==\"SUBMIT\"){if(b.value)d=b.value;else if(b.innerText)d=b.innerText;\r\nelse if(b.textContent)d=b.textContent;f=3}else if(b.src&&a==\"IMAGE\")d=b.src;if(d)return{id:d.substring(0,100),type:f}}return 0};s.Qa=function(b){for(var a=s.p(b),c=s.z(b);b&&!c&&a!=\"BODY\";)if(b=b.parentElement?b.parentElement:b.parentNode)a=s.p(b),c=s.z(b);if(!c||a==\"BODY\")b=0;if(b&&(a=b.onclick?\"\"+b.onclick:\"\",a.indexOf(\".tl(\")>=0||a.indexOf(\".trackLink(\")>=0))b=0;return b};s.Ca=function(){var b,a,c=s.linkObject,e=s.linkType,d=s.linkURL,f,i;s.K=1;if(!c)s.K=0,c=s.j;if(c){b=s.p(c);for(a=s.z(c);c&&\r\n!a&&b!=\"BODY\";)if(c=c.parentElement?c.parentElement:c.parentNode)b=s.p(c),a=s.z(c);if(!a||b==\"BODY\")c=0;if(c){var j=c.onclick?\"\"+c.onclick:\"\";if(j.indexOf(\".tl(\")>=0||j.indexOf(\".trackLink(\")>=0)c=0}}else s.K=1;!d&&c&&(d=s.Y(c));d&&!s.linkLeaveQueryString&&(f=d.indexOf(\"?\"),f>=0&&(d=d.substring(0,f)));if(!e&&d){var g=0,n=0,k;if(s.trackDownloadLinks&&s.linkDownloadFileTypes){j=d.toLowerCase();f=j.indexOf(\"?\");i=j.indexOf(\"#\");f>=0?i>=0&&i<f&&(f=i):f=i;f>=0&&(j=j.substring(0,f));f=s.linkDownloadFileTypes.toLowerCase().split(\",\");\r\nfor(i=0;i<f.length;i++)(k=f[i])&&j.substring(j.length-(k.length+1))==\".\"+k&&(e=\"d\")}if(s.trackExternalLinks&&!e&&(j=d.toLowerCase(),s.aa(j))){if(!s.linkInternalFilters)s.linkInternalFilters=w.location.hostname;f=0;s.linkExternalFilters?(f=s.linkExternalFilters.toLowerCase().split(\",\"),g=1):s.linkInternalFilters&&(f=s.linkInternalFilters.toLowerCase().split(\",\"));if(f){for(i=0;i<f.length;i++)k=f[i],j.indexOf(k)>=0&&(n=1);n?g&&(e=\"e\"):g||(e=\"e\")}}}s.linkObject=c;s.linkURL=d;s.linkType=e;if(s.trackClickMap||\r\ns.trackInlineStats)if(s.g=\"\",c){e=s.pageName;d=1;c=c.sourceIndex;if(!e)e=s.pageURL,d=0;if(w.s_objectID)a.id=w.s_objectID,c=a.type=1;if(e&&a&&a.id&&b)s.g=\"&pid=\"+s.escape(e.substring(0,255))+(d?\"&pidt=\"+d:\"\")+\"&oid=\"+s.escape(a.id.substring(0,100))+(a.type?\"&oidt=\"+a.type:\"\")+\"&ot=\"+b+(c?\"&oi=\"+c:\"\")}};s.ta=function(){var b=s.K,a=s.linkType,c=s.linkURL,e=s.linkName;if(a&&(c||e))a=a.toLowerCase(),a!=\"d\"&&a!=\"e\"&&(a=\"o\"),s.pe=\"lnk_\"+a,s.pev1=c?s.escape(c):\"\",s.pev2=e?s.escape(e):\"\",b=1;s.abort&&(b=0);\r\nif(s.trackClickMap||s.trackInlineStats){a={};c=0;var d=s.cookieRead(\"s_sq\"),f=d?d.split(\"&\"):0,i,j,w;d=0;if(f)for(i=0;i<f.length;i++)j=f[i].split(\"=\"),e=s.unescape(j[0]).split(\",\"),j=s.unescape(j[1]),a[j]=e;e=s.account.split(\",\");if(b||s.g){b&&!s.g&&(d=1);for(j in a)if(!Object.prototype[j])for(i=0;i<e.length;i++){d&&(w=a[j].join(\",\"),w==s.account&&(s.g+=(j.charAt(0)!=\"&\"?\"&\":\"\")+j,a[j]=[],c=1));for(f=0;f<a[j].length;f++)w=a[j][f],w==e[i]&&(d&&(s.g+=\"&u=\"+s.escape(w)+(j.charAt(0)!=\"&\"?\"&\":\"\")+j+\"&u=0\"),\r\na[j].splice(f,1),c=1)}b||(c=1);if(c){d=\"\";i=2;!b&&s.g&&(d=s.escape(e.join(\",\"))+\"=\"+s.escape(s.g),i=1);for(j in a)!Object.prototype[j]&&i>0&&a[j].length>0&&(d+=(d?\"&\":\"\")+s.escape(a[j].join(\",\"))+\"=\"+s.escape(j),i--);s.cookieWrite(\"s_sq\",d)}}}return b};s.ua=function(){if(!s.Ka){var b=new Date,a=n.location,c,e,d,f=d=e=c=\"\",i=\"\",w=\"\",g=\"1.2\",k=s.cookieWrite(\"s_cc\",\"true\",0)?\"Y\":\"N\",o=\"\",p=\"\",r=0;if(b.setUTCDate&&(g=\"1.3\",r.toPrecision&&(g=\"1.5\",c=[],c.forEach))){g=\"1.6\";d=0;e={};try{d=new Iterator(e),\r\nd.next&&(g=\"1.7\",c.reduce&&(g=\"1.8\",g.trim&&(g=\"1.8.1\",Date.parse&&(g=\"1.8.2\",Object.create&&(g=\"1.8.5\")))))}catch(t){}}c=screen.width+\"x\"+screen.height;d=navigator.javaEnabled()?\"Y\":\"N\";e=screen.pixelDepth?screen.pixelDepth:screen.colorDepth;i=s.w.innerWidth?s.w.innerWidth:s.d.documentElement.offsetWidth;w=s.w.innerHeight?s.w.innerHeight:s.d.documentElement.offsetHeight;b=navigator.plugins;try{s.b.addBehavior(\"#default#homePage\"),o=s.b.Ra(a)?\"Y\":\"N\"}catch(u){}try{s.b.addBehavior(\"#default#clientCaps\"),\r\np=s.b.connectionType}catch(x){}if(b)for(;r<b.length&&r<30;){if(a=b[r].name)a=a.substring(0,100)+\";\",f.indexOf(a)<0&&(f+=a);r++}s.resolution=c;s.colorDepth=e;s.javascriptVersion=g;s.javaEnabled=d;s.cookiesEnabled=k;s.browserWidth=i;s.browserHeight=w;s.connectionType=p;s.homepage=o;s.plugins=f;s.Ka=1}};s.B={};s.loadModule=function(b,a){s.B[b]||(s[b]=w[\"AppMeasurement_Module_\"+b]?new w[\"AppMeasurement_Module_\"+b](s):{},s.B[b]=s[b]);a&&(s[b+\"_onLoad\"]=a,delayCall(b+\"_onLoad\",[s,m],1)||a(s,m))};s.u=function(b){var a,\r\nc;for(a in s.B)if(!Object.prototype[a]&&(c=s.B[a])&&c[b]&&c[b]())return 1;return 0};s.xa=function(){var b=Math.floor(Math.random()*1E13),a=s.visitorSampling,c=s.visitorSamplingGroup;c=\"s_vsn_\"+(s.visitorNamespace?s.visitorNamespace:s.account)+(c?\"_\"+c:\"\");var e=s.cookieRead(c);if(a){e&&(e=parseInt(e));if(!e){if(!s.cookieWrite(c,b))return 0;e=b}if(e%1E4>v)return 0}return 1};s.Q=function(b,a){var c,e,d,f,i,w;for(c=0;c<2;c++){e=c>0?s.R:s.e;for(d=0;d<e.length;d++)if(f=e[d],(i=b[f])||b[\"!\"+f]){if(!a&&\r\n(f==\"contextData\"||f==\"retrieveLightData\")&&s[f])for(w in s[f])i[w]||(i[w]=s[f][w]);s[f]=i}}};s.La=function(b){var a,c,e,d;for(a=0;a<2;a++){c=a>0?s.R:s.e;for(e=0;e<c.length;e++)d=c[e],b[d]=s[d],b[d]||(b[\"!\"+d]=1)}};s.oa=function(s){var a,c,e,d,f,w=0,g,n=\"\",k=\"\";if(s&&s.length>255&&(a=\"\"+s,c=a.indexOf(\"?\"),c>0&&(g=a.substring(c+1),a=a.substring(0,c),d=a.toLowerCase(),e=0,d.substring(0,7)==\"http://\"?e+=7:d.substring(0,8)==\"https://\"&&(e+=8),c=d.indexOf(\"/\",e),c>0&&(d=d.substring(e,c),f=a.substring(c),\r\na=a.substring(0,c),d.indexOf(\"google\")>=0?w=\",q,ie,start,search_key,word,kw,cd,\":d.indexOf(\"yahoo.co\")>=0&&(w=\",p,ei,\"),w&&g)))){if((s=g.split(\"&\"))&&s.length>1){for(e=0;e<s.length;e++)d=s[e],c=d.indexOf(\"=\"),c>0&&w.indexOf(\",\"+d.substring(0,c)+\",\")>=0?n+=(n?\"&\":\"\")+d:k+=(k?\"&\":\"\")+d;n&&k?g=n+\"&\"+k:k=\"\"}c=253-(g.length-k.length)-a.length;s=a+(c>0?f.substring(0,c):\"\")+\"?\"+g}return s};s.qa=function(){var b=s.cookieRead(\"s_fid\"),a=\"\",c=\"\",e;e=8;var d=4;if(!b||b.indexOf(\"-\")<0){for(b=0;b<16;b++)e=Math.floor(Math.random()*\r\ne),a+=\"0123456789ABCDEF\".substring(e,e+1),e=Math.floor(Math.random()*d),c+=\"0123456789ABCDEF\".substring(e,e+1),e=d=16;b=a+\"-\"+c}s.cookieWrite(\"s_fid\",b,1)||(b=0);return b};s.t=s.track=function(b){var a,c=new Date,e=\"s\"+Math.floor(c.getTime()/108E5)%10+Math.floor(Math.random()*1E13),d=c.getYear();d=\"t=\"+s.escape(c.getDate()+\"/\"+c.getMonth()+\"/\"+(d<1900?d+1900:d)+\" \"+c.getHours()+\":\"+c.getMinutes()+\":\"+c.getSeconds()+\" \"+c.getDay()+\" \"+c.getTimezoneOffset());if(!s.V(\"track\",arguments)){b&&(a={},s.La(a),\r\ns.Q(b));if(s.xa()&&(s.fid=s.qa(),s.Ca(),s.usePlugins&&s.doPlugins&&s.doPlugins(s),s.account)){if(!s.abort){if(s.trackOffline&&!s.timestamp)s.timestamp=Math.floor(c.getTime()/1E3);c=w.location;if(!s.pageURL)s.pageURL=c.href?c.href:c;if(!s.referrer&&!s.ia)s.referrer=n.document.referrer,s.ia=1;s.referrer=s.oa(s.referrer);s.u(\"_g\")}s.ta()&&!s.abort&&(s.ua(),d+=s.ra(),s.Ba(e,d));s.abort||s.u(\"_t\")}b&&s.Q(a,1);s.timestamp=s.linkObject=s.j=s.linkURL=s.linkName=s.linkType=w.Sa=s.pe=s.pev1=s.pev2=s.pev3=s.g=\r\n0}};s.tl=s.trackLink=function(b,a,c,e,d){s.linkObject=b;s.linkType=a;s.linkName=c;if(d)s.i=b,s.l=d;return s.track(e)};s.trackLight=function(b,a,c,e){s.lightProfileID=b;s.lightStoreForSeconds=a;s.lightIncrementBy=c;return s.track(e)};s.clearVars=function(){var b,a;for(b=0;b<s.e.length;b++)if(a=s.e[b],a.substring(0,4)==\"prop\"||a.substring(0,4)==\"eVar\"||a.substring(0,4)==\"hier\"||a.substring(0,4)==\"list\"||a==\"channel\"||a==\"events\"||a==\"eventList\"||a==\"products\"||a==\"productList\"||a==\"purchaseID\"||a==\r\n\"transactionID\"||a==\"state\"||a==\"zip\"||a==\"campaign\")s[a]=void 0};s.Ba=function(b,a){var c,e=s.trackingServer;c=\"\";var d=s.dc,f=\"sc.\",w=s.visitorNamespace;if(e){if(s.trackingServerSecure&&s.ssl)e=s.trackingServerSecure}else{if(!w)w=s.account,e=w.indexOf(\",\"),e>=0&&(w=w.Oa(0,e)),w=w.replace(/[^A-Za-z0-9]/g,\"\");c||(c=\"2o7.net\");d=d?(\"\"+d).toLowerCase():\"d1\";c==\"2o7.net\"&&(d==\"d1\"?d=\"112\":d==\"d2\"&&(d=\"122\"),f=\"\");e=w+\".\"+d+\".\"+f+c}c=s.ssl?\"https://\":\"http://\";c+=e+\"/b/ss/\"+s.account+\"/\"+(s.mobile?\"5.\":\r\n\"\")+\"1/JS-\"+s.version+(s.Ja?\"T\":\"\")+\"/\"+b+\"?AQB=1&ndh=1&\"+a+\"&AQE=1\";s.wa&&(c=c.substring(0,2047));s.ma(c);s.H()};s.ma=function(b){s.c||s.va();s.c.push(b);s.I=s.o();s.ha()};s.va=function(){s.c=s.ya();if(!s.c)s.c=[]};s.ya=function(){var b,a;if(s.M()){try{(a=w.localStorage.getItem(s.L()))&&(b=w.JSON.parse(a))}catch(c){}return b}};s.M=function(){var b=!0;if(!s.trackOffline||!s.offlineFilename||!w.localStorage||!w.JSON)b=!1;return b};s.Z=function(){var b=0;if(s.c)b=s.c.length;s.q&&b++;return b};s.H=function(){if(!s.q)if(s.$=\r\nnull,s.fa)s.I>s.A&&s.ga(s.c),s.O(500);else{var b=s.ja();if(b>0)s.O(b);else if(b=s.X())s.q=1,s.Aa(b),s.Fa(b)}};s.O=function(b){if(!s.$)b||(b=0),s.$=setTimeout(s.H,b)};s.ja=function(){var b;if(!s.trackOffline||s.offlineThrottleDelay<=0)return 0;b=s.o()-s.da;if(s.offlineThrottleDelay<b)return 0;return s.offlineThrottleDelay-b};s.X=function(){if(s.c.length>0)return s.c.shift()};s.Aa=function(b){if(s.debugTracking){var a=\"AppMeasurement Debug: \"+b;b=b.split(\"&\");var c;for(c=0;c<b.length;c++)a+=\"\\n\\t\"+\r\ns.unescape(b[c]);s.za(a)}};s.Fa=function(b){var a;a||(a=new Image);a.T=function(){try{if(s.N)clearTimeout(s.N),s.N=0;if(a.timeout)clearTimeout(a.timeout),a.timeout=0}catch(b){}};a.onload=a.Ia=function(){a.T();s.la();s.D();s.q=0;s.H()};a.onabort=a.onerror=a.na=function(){a.T();s.q&&s.c.unshift(s.ka);s.q=0;s.I>s.A&&s.ga(s.c);s.D();s.O(500)};a.onreadystatechange=function(){a.readyState==4&&(a.status==200?a.Ia():a.na())};s.da=s.o();a.src=b;if(a.abort)s.N=setTimeout(a.abort,5E3);s.ka=b;s.Pa=w[\"s_i_\"+s.replace(s.account,\r\n\",\",\"_\")]=a;if(s.useForcedLinkTracking&&s.r||s.l){if(!s.forcedLinkTrackingTimeout)s.forcedLinkTrackingTimeout=250;s.F=setTimeout(s.D,s.forcedLinkTrackingTimeout)}};s.la=function(){if(s.M()&&!(s.ca>s.A))try{w.localStorage.removeItem(s.L()),s.ca=s.o()}catch(b){}};s.ga=function(b){if(s.M()){s.ha();try{w.localStorage.setItem(s.L(),w.JSON.stringify(b)),s.A=s.o()}catch(a){}}};s.ha=function(){if(s.trackOffline){if(!s.offlineLimit||s.offlineLimit<=0)s.offlineLimit=10;for(;s.c.length>s.offlineLimit;)s.X()}};\r\ns.forceOffline=function(){s.fa=!0};s.forceOnline=function(){s.fa=!1};s.L=function(){return s.offlineFilename+\"-\"+s.visitorNamespace+s.account};s.o=function(){return(new Date).getTime()};s.aa=function(s){s=s.toLowerCase();if(s.indexOf(\"#\")!=0&&s.indexOf(\"about:\")!=0&&s.indexOf(\"javascript:\")!=0)return!0;return!1};s.setTagContainer=function(b){var a,c,e;s.Ja=b;for(a=0;a<s._il.length;a++)if((c=s._il[a])&&c._c==\"s_l\"&&c.tagContainerName==b){s.Q(c);if(c.lmq)for(a=0;a<c.lmq.length;a++)e=c.lmq[a],s.loadModule(e.n);\r\nif(c.ml)for(e in c.ml)if(s[e])for(a in b=s[e],e=c.ml[e],e)if(!Object.prototype[a]&&(typeof e[a]!=\"function\"||(\"\"+e[a]).indexOf(\"s_c_il\")<0))b[a]=e[a];if(c.mmq)for(a=0;a<c.mmq.length;a++)e=c.mmq[a],s[e.m]&&(b=s[e.m],b[e.f]&&typeof b[e.f]==\"function\"&&(e.a?b[e.f].apply(b,e.a):b[e.f].apply(b)));if(c.tq)for(a=0;a<c.tq.length;a++)s.track(c.tq[a]);c.s=s;break}};s.Util={urlEncode:s.escape,urlDecode:s.unescape,cookieRead:s.cookieRead,cookieWrite:s.cookieWrite,getQueryParam:function(b,a,c){var e;a||(a=s.pageURL?\r\ns.pageURL:w.location);c||(c=\"&\");if(b&&a&&(a=\"\"+a,e=a.indexOf(\"?\"),e>=0&&(a=c+a.substring(e+1)+c,e=a.indexOf(c+b+\"=\"),e>=0&&(a=a.substring(e+c.length+b.length+1),e=a.indexOf(c),e>=0&&(a=a.substring(0,e)),a.length>0))))return s.unescape(a);return\"\"}};s.C=[\"timestamp\",\"dynamicVariablePrefix\",\"visitorID\",\"anonymousVisitorID\",\"globalVisitorID\",\"globalLocationHint\",\"fid\",\"vmk\",\"visitorMigrationKey\",\"visitorMigrationServer\",\"visitorMigrationServerSecure\",\"charSet\",\"visitorNamespace\",\"cookieDomainPeriods\",\r\n\"fpCookieDomainPeriods\",\"cookieLifetime\",\"pageName\",\"pageURL\",\"referrer\",\"contextData\",\"currencyCode\",\"lightProfileID\",\"lightStoreForSeconds\",\"lightIncrementBy\",\"retrieveLightProfiles\",\"deleteLightProfiles\",\"retrieveLightData\",\"pe\",\"pev1\",\"pev2\",\"pev3\",\"pageURLRest\"];s.e=s.C.concat([\"purchaseID\",\"variableProvider\",\"channel\",\"server\",\"pageType\",\"transactionID\",\"campaign\",\"state\",\"zip\",\"events\",\"events2\",\"products\",\"tnt\"]);s.ea=[\"timestamp\",\"charSet\",\"visitorNamespace\",\"cookieDomainPeriods\",\"cookieLifetime\",\r\n\"contextData\",\"lightProfileID\",\"lightStoreForSeconds\",\"lightIncrementBy\"];s.J=s.ea.slice(0);s.R=[\"account\",\"allAccounts\",\"debugTracking\",\"visitor\",\"trackOffline\",\"offlineLimit\",\"offlineThrottleDelay\",\"offlineFilename\",\"usePlugins\",\"doPlugins\",\"configURL\",\"visitorSampling\",\"s.visitorSamplingGroup\",\"linkObject\",\"linkURL\",\"linkName\",\"linkType\",\"trackDownloadLinks\",\"trackExternalLinks\",\"trackClickMap\",\"trackInlineStats\",\"linkLeaveQueryString\",\"linkTrackVars\",\"linkTrackEvents\",\"linkDownloadFileTypes\",\r\n\"linkExternalFilters\",\"linkInternalFilters\",\"useForcedLinkTracking\",\"forcedLinkTrackingTimeout\",\"trackingServer\",\"trackingServerSecure\",\"ssl\",\"abort\",\"mobile\",\"dc\",\"lightTrackVars\",\"maxDelay\"];for(g=0;g<=75;g++)s.e.push(\"prop\"+g),s.J.push(\"prop\"+g),s.e.push(\"eVar\"+g),s.J.push(\"eVar\"+g),g<6&&s.e.push(\"hier\"+g),g<4&&s.e.push(\"list\"+g);g=[\"resolution\",\"colorDepth\",\"javascriptVersion\",\"javaEnabled\",\"cookiesEnabled\",\"browserWidth\",\"browserHeight\",\"connectionType\",\"homepage\",\"plugins\"];s.e=s.e.concat(g);\r\ns.C=s.C.concat(g);s.ssl=w.location.protocol.toLowerCase().indexOf(\"https\")>=0;s.charSet=\"UTF-8\";s.contextData={};s.offlineThrottleDelay=0;s.offlineFilename=\"AppMeasurement.offline\";s.da=0;s.I=0;s.A=0;s.ca=0;s.linkDownloadFileTypes=\"exe,zip,wav,mp3,mov,mpg,avi,wmv,pdf,doc,docx,xls,xlsx,ppt,pptx\";s.w=w;s.d=w.document;try{s.wa=navigator.appName==\"Microsoft Internet Explorer\"}catch(p){}s.D=function(){if(s.F)w.clearTimeout(s.F),s.F=null;s.i&&s.r&&s.i.dispatchEvent(s.r);if(s.l)if(typeof s.l==\"function\")s.l();\r\nelse if(s.i&&s.i.href)s.d.location=s.i.href;s.i=s.r=s.l=0};s.Ga=function(){s.b=s.d.body;if(s.b)if(s.k=function(b){var a,c,e,d,f;if(!(s.d&&s.d.getElementById(\"cppXYctnr\")||b&&b.Da)){if(s.S)if(s.useForcedLinkTracking)s.b.removeEventListener(\"click\",s.k,!1);else{s.b.removeEventListener(\"click\",s.k,!0);s.S=s.useForcedLinkTracking=0;return}else s.useForcedLinkTracking=0;s.j=b.srcElement?b.srcElement:b.target;try{if(s.j&&(s.j.tagName||s.j.parentElement||s.j.parentNode))if(e=s.Z(),s.track(),e<s.Z()&&s.useForcedLinkTracking&&\r\nb.target){for(d=b.target;d&&d!=s.b&&d.tagName.toUpperCase()!=\"A\"&&d.tagName.toUpperCase()!=\"AREA\";)d=d.parentNode;if(d&&(f=d.href,s.aa(f)||(f=0),c=d.target,b.target.dispatchEvent&&f&&(!c||c==\"_self\"||c==\"_top\"||c==\"_parent\"||w.name&&c==w.name))){try{a=s.d.createEvent(\"MouseEvents\")}catch(g){a=new w.MouseEvent}if(a){try{a.initMouseEvent(\"click\",b.bubbles,b.cancelable,b.view,b.detail,b.screenX,b.screenY,b.clientX,b.clientY,b.ctrlKey,b.altKey,b.shiftKey,b.metaKey,b.button,b.relatedTarget)}catch(j){a=\r\n0}if(a)a.Da=1,b.stopPropagation(),b.Ha&&b.Ha(),b.preventDefault(),s.i=b.target,s.r=a}}}}catch(k){}s.j=0}},s.b&&s.b.attachEvent)s.b.attachEvent(\"onclick\",s.k);else{if(s.b&&s.b.addEventListener){if(navigator&&(navigator.userAgent.indexOf(\"WebKit\")>=0&&s.d.createEvent||navigator.userAgent.indexOf(\"Firefox/2\")>=0&&w.MouseEvent))s.S=1,s.useForcedLinkTracking=1,s.b.addEventListener(\"click\",s.k,!0);s.b.addEventListener(\"click\",s.k,!1)}}else setTimeout(setupBody,30)};s.Ga()}", "function getVersion(){return _VERSION}", "InitVsaEngine() {\n\n }", "constructor() {\n this.systemLog = false\n this.appName = '@codedungeon/messenger'\n this.logToFile = false\n this.methods = [\n 'write',\n 'critical',\n 'lblCritical',\n 'danger',\n 'lblDanger',\n 'debug',\n 'error',\n 'lblError',\n 'important',\n 'lblImportant',\n 'info',\n 'lblInfo',\n 'log',\n 'note',\n 'notice',\n 'lblNotice',\n 'status',\n 'success',\n 'lblSuccess',\n 'warn',\n 'lblWarn',\n 'warning',\n 'lblWarning'\n ]\n }", "function WebSocketRpcConnection()\n{\nvar self = this;\n\nvar isNodeJs = (typeof window === \"undefined\" ? true : false);\n\nvar lib = null;\nvar SpaceifyError = null;\nvar SpaceifyUtility = null;\nvar RpcCommunicator = null;\n//var SpaceifyLogger = null;\nvar WebSocketConnection = null;\n\nif (isNodeJs)\n\t{\n\tlib = \"/var/lib/spaceify/code/\";\n\n\tSpaceifyError = require(lib + \"spaceifyerror\");\n\t//SpaceifyLogger = require(lib + \"spaceifylogger\");\n\tSpaceifyUtility = require(lib + \"spaceifyutility\");\n\tRpcCommunicator = require(lib + \"rpccommunicator\");\n\tWebSocketConnection = require(lib + \"websocketconnection\");\n\t}\nelse\n\t{\n\tlib = (window.WEBPACK_MAIN_LIBRARY ? window.WEBPACK_MAIN_LIBRARY : window);\n\n\t//SpaceifyLogger = lib.SpaceifyLogger;\n\tSpaceifyError = lib.SpaceifyError;\n\tSpaceifyUtility = lib.SpaceifyUtility;\n\tRpcCommunicator = lib.RpcCommunicator;\n\tWebSocketConnection = lib.WebSocketConnection;\n\t}\n\nvar errorc = new SpaceifyError();\nvar utility = new SpaceifyUtility();\nvar communicator = new RpcCommunicator();\nvar connection = new WebSocketConnection();\n//var logger = new SpaceifyLogger(\"WebSocketRpcConnection\");\n\nself.connect = function(options, callback)\n\t{\n\tconnection.connect(options, function(err, data)\n\t\t{\n\t\tif(!err)\n\t\t\t{\n\t\t\tcommunicator.addConnection(connection);\n\n\t\t\tif(callback)\n\t\t\t\tcallback(null, true);\n\t\t\t}\n\t\telse\n\t\t\t{\n\t\t\tif(callback)\n\t\t\t\tcallback(errorc.makeErrorObject(\"wsrpcc\", \"Failed to open WebsocketRpcConnection.\", \"WebSocketRpcConnection::connect\"), null);\n\t\t\t}\n\t\t});\n\t};\n\nself.close = function()\n\t{\n\t};\n\nself.getCommunicator = function()\n\t{\n\treturn communicator;\n\t};\n\nself.getConnection = function()\n\t{\n\treturn connection;\n\t};\n\n// Inherited methods\nself.getIsOpen = function()\n\t{\n\treturn connection.getIsOpen();\n\t}\n\nself.getIsSecure = function()\n\t{\n\treturn connection.getIsSecure();\n\t}\n\nself.getPort = function()\n\t{\n\treturn connection.getPort();\n\t}\n\nself.getId = function()\n\t{\n\treturn connection.getId();\n\t}\n\nself.connectionExists = function(connectionId)\n\t{\n\treturn communicator.connectionExists(connectionId);\n\t}\n\nself.exposeRpcMethod = function(name, object, method)\n\t{\n\tcommunicator.exposeRpcMethod(name, object, method);\n\t}\n\nself.exposeRpcMethodSync = function(name, object, method)\n\t{\n\tcommunicator.exposeRpcMethodSync(name, object, method);\n\t}\n\nself.callRpc = function(method, params, object, listener)\n\t{\n\treturn communicator.callRpc(method, params, object, listener, connection.getId());\n\t}\n\n// External event listeners\nself.setConnectionListener = function(listener)\n\t{\n\tcommunicator.setConnectionListener(listener);\n\t};\n\nself.setDisconnectionListener = function(listener)\n\t{\n\tcommunicator.setDisconnectionListener(listener);\n\t};\n\n}", "private internal function m248() {}", "heartbeat () {\n }", "function getString(key, params) {\n var result = WEB_PLATFORM.getString(\"org_opensds_storage_devices\", key, params);\n if(result == null){\n return key;\n }else{\n return result;\n }\n }", "function _____SHARED_functions_____(){}", "onShareAppMessage() {\n\n }", "componentDidMount(){\n console.info(this.constructor.name+ 'Component mount process finished');\n }", "requestThumbnails() {\n let position = this.state.position;\n let ed = this.state.ed;\n let ts = position == 'start' ? ed.start : ed.end;\n\n this.props.socket.emit('frameSelect',{ ts: ts } );\n }", "onMessage() {}", "onMessage() {}", "static get tag(){return\"hal-9000\"}", "get EXTERNAL_API() {\n return ['setUsageMode',\n 'setBackupMode',\n 'setLocationMode',\n 'setUsageOptinHidden',\n ];\n }", "constructor(t){const e={...t};this.connectionState=new h,this.server=\"https://hub-server-2.heatgenius.co.uk\",this.username=\"\",this.signature=\"\",this.auth={header:{}},this.lastQueryTime=null,this._axios=i.a.create({}),this.logger=e.logger?e.logger:console,this.debug=!!e.debug&&e.debug}", "started() {\r\n\r\n\t}", "getVideoDataBuffer() {\n return this.videoDataBuffer;\n }", "addTPKLayer(){\n //<editor-fold desc=\"old code to eliminate\">\n /* if (typeof local == 'undefined') {\n\n //todo: maybe based on this url we could decide if taking the tpk from File API or form URL\n var xhrRequest = new XMLHttpRequest();\n var _this = this;\n xhrRequest.open(\"GET\", url, true);\n xhrRequest.responseType = \"blob\";\n xhrRequest.onprogress = function(evt){\n var percent = 0;\n if(/!*evt.hasOwnProperty(\"total\")*!/typeof evt[\"total\"] !== 'undefined'){\n percent = (parseFloat(evt.loaded / evt.total) * 100).toFixed(0);\n }\n else{\n percent = (parseFloat(evt.loaded / evt.totalSize) * 100).toFixed(0);\n }\n\n console.log(\"Get file via url \" + percent + \"%\");\n console.log(\"Begin downloading remote tpk file...\");\n };\n\n xhrRequest.error = function(err){\n console.log(\"ERROR retrieving TPK file: \" + err.toString());\n alert(\"There was a problem retrieve the file.\");\n };\n var __this = _this;\n xhrRequest.onload = function(oEvent) {\n if(this.status === 200) {\n console.log(\"Remote tpk download finished.\" + oEvent);\n __this.zipParser(this.response);\n }\n else{\n alert(\"There was a problem loading the file. \" + this.status + \": \" + this.statusText );\n }\n };\n xhrRequest.send();\n }\n*/\n //</editor-fold>\n if (this.get('ermesCordova').isNative()){\n\n var basemapName = this.get('parcels').get('basemapName');\n var store = cordova.file.dataDirectory;\n var fileName = basemapName;\n this.set(\"loading\", true);\n this.getBaseMapZip (store, fileName).then((binary)=>{\n if (binary!== null) {\n this.zipParser(binary);\n }\n else {\n Ember.debug(\"getBaseMapZip: error loading the zip file\");\n }\n });\n }\n\n }", "private public function m246() {}", "async onReady() {\n try {\n // Initialize your adapter here\n //Logging of adapter start\n this.log.info('start fb-checkpresence: ip-address: \"' + this.config.ipaddress + '\" - interval devices: ' + this.config.interval + ' Min.' + ' - interval members: ' + this.config.intervalFamily + ' s');\n this.log.debug('configuration user: <' + this.config.username + '>');\n this.log.debug('configuration history: <' + this.config.history + '>');\n this.log.debug('configuration dateformat: <' + this.config.dateformat + '>');\n this.log.debug('configuration familymembers: ' + JSON.stringify(this.config.familymembers));\n this.log.debug('configuration fb-devices ' + this.config.fbdevices);\n this.log.debug('configuratuion mesh info: ' + this.config.meshinfo); \n\n //decrypt fritzbox password\n const sysObj = await this.getForeignObjectAsync('system.config');\n if (sysObj && sysObj.native && sysObj.native.secret) {\n this.config.password = this.decrypt(sysObj.native.secret, this.config.password);\n } else {\n this.config.password = this.decrypt('SdoeQ85NTrg1B0FtEyzf', this.config.password);\n }\n\n //Configuration changes if needed\n let adapterObj = (await this.getForeignObjectAsync(`system.adapter.${this.namespace}`));\n let adapterObjChanged = false; //for changes\n \n //if interval <= 0 than set to 1\n if (this.config.interval <= 0) {\n adapterObj.native.interval = 1;\n adapterObjChanged = true;\n this.config.interval = 1;\n this.log.warn('interval is less than 1. Set to 1 Min.');\n }\n\n //if interval <= 0 than set to 1\n if (this.config.intervalFamily <= 9) {\n adapterObj.native.intervalFamily = 10;\n adapterObjChanged = true;\n this.config.intervalFamily = 10;\n this.log.warn('interval is less than 10. Set to 10s.');\n }\n\n //create new configuration items -> workaround for older versions\n for(let i=0;i<this.config.familymembers.length;i++){\n if (this.config.familymembers[i].useip == undefined) {\n adapterObj.native.familymembers[i].useip = false;\n adapterObj.native.familymembers[i].ipaddress = '';\n adapterObjChanged = true;\n }\n }\n\n if (adapterObjChanged === true){ //Save changes\n await this.setForeignObjectAsync(`system.adapter.${this.namespace}`, adapterObj);\n }\n\n const cfg = {\n ip: this.config.ipaddress,\n port: '49000',\n iv: this.config.interval,\n history: this.config.history,\n dateFormat: this.config.dateformat,\n uid: this.config.username,\n pwd: this.config.password,\n members: this.config.familymembers,\n wl: this.config.whitelist\n };\n \n const cron = cfg.iv * 60;\n const cronFamily = this.config.intervalFamily;\n \n const devInfo = {\n host: this.config.ipaddress,\n port: '49000',\n sslPort: null,\n uid: this.config.username,\n pwd: this.config.password\n };\n\n this.Fb = await fb.Fb.init(devInfo, this);\n if(this.Fb.services === null) {\n this.log.error('Can not get services! Adapter stops');\n this.stopAdapter();\n }\n\n //Check if services/actions are supported\n this.GETPATH = await this.Fb.chkService('X_AVM-DE_GetHostListPath', 'Hosts1', 'X_AVM-DE_GetHostListPath');\n this.GETMESHPATH = await this.Fb.chkService('X_AVM-DE_GetMeshListPath', 'Hosts1', 'X_AVM-DE_GetMeshListPath');\n this.GETBYMAC = await this.Fb.chkService('GetSpecificHostEntry', 'Hosts1', 'GetSpecificHostEntry');\n this.GETBYIP = await this.Fb.chkService('X_AVM-DE_GetSpecificHostEntryByIP', 'Hosts1', 'X_AVM-DE_GetSpecificHostEntryByIP');\n this.GETPORT = await this.Fb.chkService('GetSecurityPort', 'DeviceInfo1', 'GetSecurityPort');\n this.GETEXTIP = await this.Fb.chkService('GetInfo', 'WANPPPConnection1', 'GetInfo');\n if ( this.GETEXTIP == false) this.GETEXTIP = await this.Fb.chkService('GetInfo', 'WANIPConnection1', 'GetInfo');\n this.SETENABLE = await this.Fb.chkService('SetEnable', 'WLANConfiguration3', 'SetEnable');\n this.WLAN3INFO = await this.Fb.chkService('GetInfo', 'WLANConfiguration3', 'WLANConfiguration3-GetInfo');\n this.DEVINFO = await this.Fb.chkService('GetInfo', 'DeviceInfo1', 'DeviceInfo1-GetInfo');\n this.DISALLOWWANACCESSBYIP = await this.Fb.chkService('DisallowWANAccessByIP', 'X_AVM-DE_HostFilter', 'DisallowWANAccessByIP');\n this.GETWANACCESSBYIP = await this.Fb.chkService('GetWANAccessByIP', 'X_AVM-DE_HostFilter', 'GetWANAccessByIP');\n this.REBOOT = await this.Fb.chkService('Reboot', 'DeviceConfig1', 'Reboot');\n \n //const test = await Fb.soapAction(Fb, '/upnp/control/deviceconfig', 'urn:dslforum-org:service:DeviceConfig:1', 'X_AVM-DE_CreateUrlSID', null);\n\n //Create global objects\n await obj.createGlobalObjects(this, this.HTML+this.HTML_END, this.HTML_GUEST+this.HTML_END, this.enabled);\n await obj.createMemberObjects(this, cfg, this.HTML_HISTORY + this.HTML_END, this.enabled);\n\n //create Fb devices\n if (this.GETPATH != null && this.GETPATH == true && this.config.fbdevices == true){\n const items = await this.Fb.getDeviceList(this, cfg, this.Fb);\n if (items != null){\n let res = await obj.createFbDeviceObjects(this, items, this.enabled);\n if (res === true) this.log.info('createFbDeviceObjects finished successfully');\n res = await obj.createMeshObjects(this, items, 0, this.enabled); //create channel 0 as default interface\n if (res === true) this.log.info('createMeshObjects finished successfully');\n }else{\n this.log.error('createFbDeviceObjects -> ' + \"can't read devices from fritzbox! Adapter stops\");\n adapterObj = await this.getForeignObjectAsync(`system.adapter.${this.namespace}`);\n adapterObj.common.enabled = false; // Adapter ausschalten\n await this.setForeignObjectAsync(`system.adapter.${this.namespace}`, adapterObj);\n }\n await this.resyncFbObjects(items);\n }\n\n // states changes inside the adapters namespace are subscribed\n if (this.SETENABLE === true && this.WLAN3INFO === true) this.subscribeStates(`${this.namespace}` + '.guest.wlan');\n if (this.DISALLOWWANACCESSBYIP === true && this.GETWANACCESSBYIP === true) this.subscribeStates(`${this.namespace}` + '.fb-devices.*.disabled'); \n if (this.REBOOT === true) this.subscribeStates(`${this.namespace}` + '.reboot'); \n\n //get uuid for transaction\n //const sSid = await Fb.soapAction(Fb, '/upnp/control/deviceconfig', urn + 'DeviceConfig:1', 'X_GenerateUUID', null);\n //const uuid = sSid['NewUUID'].replace('uuid:', '');\n this.loop(10, 55, cronFamily, cron, cfg);\n } catch (error) {\n this.showError('onReady: ' + error);\n }\n }", "started () {\n\n }", "started () {\n\n }", "started () {\n\n }", "async onReady() {\n // Initialize your adapter here\n\n this.setState(\"info.connection\", false, true);\n // Reset the connection indicator during startup\n this.type = \"VW\";\n this.country = \"DE\";\n this.clientId = \"9496332b-ea03-4091-a224-8c746b885068%40apps_vw-dilab_com\";\n this.xclientId = \"38761134-34d0-41f3-9a73-c4be88d7d337\";\n this.scope = \"openid%20profile%20mbb%20email%20cars%20birthdate%20badge%20address%20vin\";\n this.redirect = \"carnet%3A%2F%2Fidentity-kit%2Flogin\";\n this.xrequest = \"de.volkswagen.carnet.eu.eremote\";\n this.responseType = \"id_token%20token%20code\";\n this.xappversion = \"5.1.2\";\n this.xappname = \"eRemote\";\n if (this.config.type === \"id\") {\n this.type = \"Id\";\n this.country = \"DE\";\n this.clientId = \"a24fba63-34b3-4d43-b181-942111e6bda8@apps_vw-dilab_com\";\n this.xclientId = \"\";\n this.scope = \"openid profile badge cars dealers birthdate vin\";\n this.redirect = \"weconnect://authenticated\";\n this.xrequest = \"com.volkswagen.weconnect\";\n this.responseType = \"code id_token token\";\n this.xappversion = \"\";\n this.xappname = \"\";\n }\n if (this.config.type === \"skoda\") {\n this.type = \"Skoda\";\n this.country = \"CZ\";\n this.clientId = \"7f045eee-7003-4379-9968-9355ed2adb06%40apps_vw-dilab_com\";\n this.xclientId = \"28cd30c6-dee7-4529-a0e6-b1e07ff90b79\";\n this.scope = \"openid%20profile%20phone%20address%20cars%20email%20birthdate%20badge%20dealers%20driversLicense%20mbb\";\n this.redirect = \"skodaconnect%3A%2F%2Foidc.login%2F\";\n this.xrequest = \"cz.skodaauto.connect\";\n this.responseType = \"code%20id_token\";\n this.xappversion = \"3.2.6\";\n this.xappname = \"cz.skodaauto.connect\";\n }\n if (this.config.type === \"seat\") {\n this.type = \"Seat\";\n this.country = \"ES\";\n this.clientId = \"50f215ac-4444-4230-9fb1-fe15cd1a9bcc@apps_vw-dilab_com\";\n this.xclientId = \"9dcc70f0-8e79-423a-a3fa-4065d99088b4\";\n this.scope = \"openid profile mbb cars birthdate nickname address phone\";\n this.redirect = \"seatconnect://identity-kit/login\";\n this.xrequest = \"cz.skodaauto.connect\";\n this.responseType = \"code%20id_token\";\n this.xappversion = \"1.1.29\";\n this.xappname = \"SEATConnect\";\n }\n if (this.config.type === \"audi\") {\n this.type = \"Audi\";\n this.country = \"DE\";\n this.clientId = \"09b6cbec-cd19-4589-82fd-363dfa8c24da@apps_vw-dilab_com\";\n this.xclientId = \"77869e21-e30a-4a92-b016-48ab7d3db1d8\";\n this.scope = \"address profile badge birthdate birthplace nationalIdentifier nationality profession email vin phone nickname name picture mbb gallery openid\";\n this.redirect = \"myaudi:///\";\n this.xrequest = \"de.myaudi.mobile.assistant\";\n this.responseType = \"token%20id_token\";\n // this.responseType = \"code\";\n this.xappversion = \"3.22.0\";\n this.xappname = \"myAudi\";\n }\n if (this.config.type === \"go\") {\n this.type = \"\";\n this.country = \"\";\n this.clientId = \"ac42b0fa-3b11-48a0-a941-43a399e7ef84@apps_vw-dilab_com\";\n this.xclientId = \"\";\n this.scope = \"openid%20profile%20address%20email%20phone\";\n this.redirect = \"vwconnect%3A%2F%2Fde.volkswagen.vwconnect%2Foauth2redirect%2Fidentitykit\";\n this.xrequest = \"\";\n this.responseType = \"code\";\n this.xappversion = \"\";\n this.xappname = \"\";\n }\n if (this.config.interval === 0) {\n this.log.info(\"Interval of 0 is not allowed reset to 1\");\n this.config.interval = 1;\n }\n this.login()\n .then(() => {\n this.log.debug(\"Login successful\");\n this.setState(\"info.connection\", true, true);\n this.getPersonalData()\n .then(() => {\n this.getVehicles()\n .then(() => {\n if (this.config.type !== \"go\") {\n this.vinArray.forEach((vin) => {\n if (this.config.type === \"id\") {\n this.getIdStatus(vin).catch(() => {\n this.log.error(\"get id status Failed\");\n });\n } else {\n this.getHomeRegion(vin)\n .catch(() => {\n this.log.debug(\"get home region Failed\");\n })\n .finally(() => {\n this.getVehicleData(vin).catch(() => {\n this.log.error(\"get vehicle data Failed\");\n });\n this.getVehicleRights(vin).catch(() => {\n this.log.error(\"get vehicle rights Failed\");\n });\n this.requestStatusUpdate(vin)\n .finally(() => {\n this.statesArray.forEach((state) => {\n this.getVehicleStatus(vin, state.url, state.path, state.element, state.element2, state.element3, state.element4).catch(() => {\n this.log.debug(\"error while getting \" + state.url);\n });\n });\n })\n .catch(() => {\n this.log.error(\"status update Failed\");\n });\n })\n .catch(() => {\n this.log.error(\"Error getting home region\");\n });\n }\n });\n }\n\n this.updateInterval = setInterval(() => {\n if (this.config.type === \"go\") {\n this.getVehicles();\n return;\n } else if (this.config.type === \"id\") {\n this.vinArray.forEach((vin) => {\n this.getIdStatus(vin).catch(() => {\n this.log.error(\"get id status Failed\");\n this.refreshIDToken().catch(() => {});\n });\n this.getWcData();\n });\n return;\n } else {\n this.vinArray.forEach((vin) => {\n this.statesArray.forEach((state) => {\n this.getVehicleStatus(vin, state.url, state.path, state.element, state.element2).catch(() => {\n this.log.debug(\"error while getting \" + state.url);\n });\n });\n });\n }\n }, this.config.interval * 60 * 1000);\n\n if (this.config.forceinterval > 0) {\n this.fupdateInterval = setInterval(() => {\n if (this.config.type === \"go\") {\n this.getVehicles();\n return;\n }\n this.vinArray.forEach((vin) => {\n this.requestStatusUpdate(vin).catch(() => {\n this.log.error(\"force status update Failed\");\n });\n });\n }, this.config.forceinterval * 60 * 1000);\n }\n })\n .catch(() => {\n this.log.error(\"Get Vehicles Failed\");\n });\n })\n .catch(() => {\n this.log.error(\"get personal data Failed\");\n });\n })\n .catch(() => {\n this.log.error(\"Login Failed\");\n });\n this.subscribeStates(\"*\");\n }", "started () {}", "loadComponent(nodeURI, baseURI, callback_async /* nodeDescriptor */, errback_async /* errorMessage */) { // TODO: turn this into a generic xhr loader exposed as a kernel function?\n\n let self = this;\n\n if (nodeURI == self.kutility.protoNodeURI) {\n\n callback_async(self.kutility.protoNodeDescriptor);\n\n } else if (nodeURI.match(RegExp(\"^data:application/json;base64,\"))) {\n\n // Primarly for testing, parse one specific form of data URIs. We need to parse\n // these ourselves since Chrome can't load data URIs due to cross origin\n // restrictions.\n\n callback_async(JSON.parse(atob(nodeURI.substring(29)))); // TODO: support all data URIs\n\n } else {\n\n self.virtualTime.suspend(\"while loading \" + nodeURI); // suspend the queue\n\n let fetchUrl = self.remappedURI(nodeURI, baseURI);\n let dbName = fetchUrl.split(\".\").join(\"_\");\n\n const parseComp = function (f) {\n\n let result = JSON.parse(f);\n\n let nativeObject = result;\n // console.log(nativeObject);\n\n if (nativeObject) {\n callback_async(nativeObject);\n self.virtualTime.resume(\"after loading \" + nodeURI); // resume the queue; may invoke dispatch(), so call last before returning to the host\n\n } else {\n\n self.logger.warnx(\"loadComponent\", \"error loading\", nodeURI + \":\", error);\n errback_async(error);\n self.virtualTime.resume(\"after loading \" + nodeURI); // resume the queue; may invoke dispatch(), so call last before returning to the host\n }\n\n }\n\n\n //var fileName = \"\";\n // let userDB = _LCSDB.user(_LCS_WORLD_USER.pub); \n if (dbName.includes(\"proxy\")) {\n //userDB = await window._LCS_SYS_USER.get('proxy').then();\n let proxyDB = self.proxy ? _LCSDB.user(self.proxy) : _LCSDB.user(_LCS_WORLD_USER.pub);\n let fileName = dbName + '_json';\n let dbNode = proxyDB.get('proxy').get(fileName);\n let nodeProm = new Promise(res => dbNode.once(res));\n\n nodeProm.then(comp => {\n parseComp(comp);\n })\n\n // (function(r){\n // //console.log(r);\n // parseComp(r);\n\n // });\n\n } else {\n var worldName = dbName.split('/')[1];\n var fileName = dbName.split('/')[2];\n //+ '_json';\n\n if (!fileName) {\n worldName = self.helpers.appPath\n fileName = dbName + '_json';\n } else {\n fileName = fileName + '_json';\n }\n\n let dbNode = _LCSDB.user(_LCS_WORLD_USER.pub).get('worlds').path(worldName).get(fileName);\n\n let nodeProm = new Promise(res => dbNode.once(res))\n nodeProm.then(comp => {\n parseComp(comp);\n })\n\n // (function(r){\n // //console.log(r);\n // parseComp(r);\n\n // });\n }\n\n //console.log(source);\n\n //userDB.get(fileName).once(async function(res) {\n\n\n\n\n // }, {wait: 1000})\n }\n\n }", "_specializedInitialisation()\r\n\t{\r\n\t\tLogger.log(\"Specialisation for service AVTransport\", LogType.Info);\r\n\t\tvar relativeTime = this.getVariableByName(\"RelativeTimePosition\");\r\n\t\t//Implémentation pour OpenHome\r\n\t\tif (!relativeTime)\r\n\t\t\trelativeTime = this.getVariableByName(\"A_ARG_TYPE_GetPositionInfo_RelTime\");\r\n\t\tvar transportState = this.getVariableByName(\"TransportState\");\r\n\t\t//Implémentation pour OpenHome\r\n\t\tif (!transportState)\r\n\t\t\ttransportState = this.getVariableByName(\"A_ARG_TYPE_GetTransportInfo_CurrentTransportState\");\r\n\r\n\t\tif (transportState)\r\n\t\t{\r\n\t\t\ttransportState.on('updated', (variable, newVal) =>\r\n\t\t\t{\r\n\t\t\t\tLogger.log(\"On transportStateUpdate : \" + newVal, LogType.DEBUG);\r\n\t\t\t\tvar actPosInfo = this.getActionByName(\"GetPositionInfo\");\r\n\t\t\t\tvar actMediaInfo = this.getActionByName(\"GetMediaInfo\");\r\n\t\t\t\t/*\r\n\t\t\t\t“STOPPED” R\r\n\t\t\t\t“PLAYING” R\r\n\t\t\t\t“TRANSITIONING” O\r\n\t\t\t\t”PAUSED_PLAYBACK” O\r\n\t\t\t\t“PAUSED_RECORDING” O\r\n\t\t\t\t“RECORDING” O\r\n\t\t\t\t“NO_MEDIA_PRESENT”\r\n\t\t\t\t */\r\n\t\t\t\tif (relativeTime && !relativeTime.SendEvent && actPosInfo)\r\n\t\t\t\t{\r\n\t\t\t\t\tif (this._intervalUpdateRelativeTime)\r\n\t\t\t\t\t\tclearInterval(this._intervalUpdateRelativeTime);\r\n\t\t\t\t\tif (newVal == \"PLAYING\" || newVal == \"RECORDING\")\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tactPosInfo.execute(\t{\tInstanceID: 0\t} );\r\n\t\t\t\t\t\t//Déclenche la maj toutes les 4 secondes\r\n\t\t\t\t\t\tthis._intervalUpdateRelativeTime = setInterval(() =>{\r\n\t\t\t\t\t\t\t\t//Logger.log(\"On autoUpdate\", LogType.DEBUG);\r\n\t\t\t\t\t\t\t\tactPosInfo.execute(\t{\tInstanceID: 0\t}\t);\r\n\t\t\t\t\t\t\t}, 4000);\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\t//else if (newVal == \"STOPPED\" || newVal == \"PAUSED_PLAYBACK\" || newVal == \"PAUSED_RECORDING\" || newVal == \"NO_MEDIA_PRESENT\")\r\n\t\t\t\t//{\r\n\t\t\t\t//\r\n\t\t\t\t//}\r\n\t\t\t\t//On met a jour les media info et position info pour etre sur de mettre a jour les Metadata(par defaut la freebox ne le fait pas ou plutot le fait mal)\r\n\t\t\t\tif (newVal == \"TRANSITIONING\")\r\n\t\t\t\t{\r\n\t\t\t\t\tif (actPosInfo)\r\n\t\t\t\t\t\tactPosInfo.execute(\t{InstanceID: 0}\t);\r\n\t\t\t\t\tif (actMediaInfo)\r\n\t\t\t\t\t\tactMediaInfo.execute(\t{InstanceID: 0} );\r\n\t\t\t\t}\r\n\r\n\t\t\t\tif (newVal == \"STOPPED\")\r\n\t\t\t\t{\r\n\t\t\t\t\tif (actPosInfo)\r\n\t\t\t\t\t\tactPosInfo.execute(\t{\tInstanceID: 0\t});\r\n\t\t\t\t\tif (actMediaInfo)\r\n\t\t\t\t\t\tactMediaInfo.execute(\t{\tInstanceID: 0 });\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\t);\r\n\t\t}\r\n\t}", "async onReady() {\n // Initialize your adapter here\n await this.setObjectNotExistsAsync('speed', {\n type: 'channel',\n common: {\n name: 'speed'\n },\n native: {},\n });\n await this.setObjectNotExistsAsync('speed.download', {\n type: 'state',\n common: {\n name: 'download',\n role: 'info.status',\n type: 'number',\n desc: 'Download speed',\n def: 0,\n read: true,\n write: false,\n unit: 'Mbit/s',\n },\n native: {},\n });\n await this.setObjectNotExistsAsync('speed.upload', {\n type: 'state',\n common: {\n name: 'upload',\n role: 'info.status',\n type: 'number',\n desc: 'Upload speed',\n def: 0,\n read: true,\n write: false,\n unit: 'Mbit/s',\n },\n native: {},\n });\n await this.setObjectNotExistsAsync('speed.ping', {\n type: 'state',\n common: {\n name: 'ping',\n role: 'info.status',\n type: 'number',\n desc: 'Ping Latency',\n def: 0,\n read: true,\n write: false,\n unit: 'ms',\n },\n native: {},\n });\n await this.setObjectNotExistsAsync('speed.progress', {\n type: 'state',\n common: {\n name: 'progress',\n role: 'info.status',\n type: 'number',\n desc: 'Progress',\n def: 0,\n read: true,\n write: false,\n unit: '%',\n },\n native: {},\n });\n await this.setObjectNotExistsAsync('speed.speedcheck', {\n type: 'state',\n common: {\n name: 'Run speed test',\n type: 'boolean',\n read: true,\n role: 'button',\n write: true,\n def: false\n },\n native: {},\n });\n await this.setObjectNotExistsAsync('progress', {\n type: 'channel',\n common: {\n name: 'speed'\n },\n native: {},\n });\n await this.setObjectNotExistsAsync('progress.download', {\n type: 'state',\n common: {\n name: 'download',\n role: 'info.status',\n type: 'number',\n desc: 'Download speed',\n def: 0,\n read: true,\n write: false,\n unit: 'Mbit/s',\n },\n native: {},\n });\n await this.setObjectNotExistsAsync('progress.upload', {\n type: 'state',\n common: {\n name: 'upload',\n role: 'info.status',\n type: 'number',\n desc: 'Upload speed',\n def: 0,\n read: true,\n write: false,\n unit: 'Mbit/s',\n },\n native: {},\n });\n await this.setObjectNotExistsAsync('progress.ping', {\n type: 'state',\n common: {\n name: 'ping',\n role: 'info.status',\n type: 'number',\n desc: 'Ping Latency',\n def: 0,\n read: true,\n write: false,\n unit: 'ms',\n },\n native: {},\n });\n await this.setObjectNotExistsAsync('progress.progress', {\n type: 'state',\n common: {\n name: 'progress',\n role: 'info.status',\n type: 'number',\n desc: 'Progress',\n def: 0,\n read: true,\n write: false,\n unit: '%',\n },\n native: {},\n });\n await this.setObjectNotExistsAsync('progress.speedcheck', {\n type: 'state',\n common: {\n name: 'Run speed test',\n type: 'boolean',\n read: true,\n role: 'button',\n write: true,\n def: false\n },\n native: {},\n });\n await this.setObjectNotExistsAsync('info', {\n type: 'channel',\n common: {\n name: 'Information'\n },\n native: {},\n });\n await this.setObjectNotExistsAsync('info.externalip', {\n type: 'state',\n common: {\n name: 'External IP',\n role: 'info.status',\n type: 'string',\n desc: 'External IP',\n read: true,\n write: false,\n },\n native: {},\n });\n await this.setObjectNotExistsAsync('info.internalip', {\n type: 'state',\n common: {\n name: 'Internal IP',\n role: 'info.status',\n type: 'string',\n desc: 'Internal IP',\n read: true,\n write: false,\n },\n native: {},\n });\n this.subscribeStates('*');\n await this.setStateAsync('info.connection', { val: true, ack: true });\n // let result = await this.checkPasswordAsync('admin', 'iobroker');\n // this.log.info('check user admin pw iobroker: ' + result);\n // result = await this.checkGroupAsync('admin', 'admin');\n // this.log.info('check group user admin group admin: ' + result);\n if (this.config.polltime > 1) {\n this.log.info('Checking internet speed every ' + this.config.polltime + ' minutes');\n } else {\n this.log.info('Checking internet speed every ' + this.config.polltime + ' minute');\n }\n await this.start(this.config.polltime);\n }", "enqueue() {\n\n }", "started() { }", "onBrowserStart(browser) {\n\n }", "getPort2() {\n return 0;\n }", "requestReceived(request,response){\n if(this.config.log){\n const logData={\n method : request.method,\n url : request.url,\n headers : request.headers\n };\n\n this.config.logFunction(\n logData\n );\n }\n\n let uri = url.parse(request.url);\n uri.protocol='http';\n uri.host=uri.hostname=request.headers.host;\n uri.port=80;\n uri.query=querystring.parse(uri.query);\n\n if(request.connection.encrypted){\n uri.protocol='https';\n uri.port=443;\n }\n\n (\n function(){\n if(!uri.host){\n return;\n }\n const host=uri.host.split(':');\n\n if(!host[1]){\n return;\n }\n uri.host=uri.hostname=host[0];\n uri.port=host[1];\n }\n )();\n\n for(let key in uri){\n if(uri[key]!==null){\n continue;\n }\n uri[key]='';\n }\n\n request.uri=uri;\n\n if(\n this.onRawRequest(\n request,\n response,\n completeServing.bind(this)\n )\n ){\n return;\n };\n\n uri=uri.pathname;\n\n if (uri=='/'){\n uri=`/${this.config.server.index}`;\n }\n\n let hostname= [];\n\n if (request.headers.host !== undefined){\n hostname = request.headers.host.split(':');\n }\n\n let root = this.config.root;\n\n if(this.config.verbose){\n console.log(`${this.config.logID} REQUEST ###\\n\\n`,\n request.headers,'\\n',\n uri,'\\n\\n',\n hostname,'\\n\\n'\n );\n }\n\n if(this.config.domain!='0.0.0.0' && hostname.length > 0 && hostname[0]!=this.config.domain){\n if(!this.config.domains[hostname[0]]){\n if(this.config.verbose){\n console.log(`${this.config.logID} INVALID HOST ###\\n\\n`);\n }\n this.serveFile(hostname[0],false,response);\n return;\n }\n root=this.config.domains[hostname[0]];\n }\n\n\n if(this.config.verbose){\n console.log(`${this.config.logID} USING ROOT : ${root}###\\n\\n`);\n }\n\n if(uri.slice(-1)=='/'){\n uri+=this.config.server.index;\n }\n\n request.url=uri;\n request.serverRoot=root;\n\n request.body='';\n\n request.on(\n 'data',\n function(chunk){\n request.body+=chunk;\n }.bind(this)\n ).on(\n 'end',\n function(){\n if(this.config.verbose){\n console.log(`###REQUEST BODY :\n ${request.body}\n ###\n `);\n }\n\n requestBodyComplete.bind(this,request,response)();\n }.bind(this)\n );\n }", "function OnChannelOpen()\n{\n}", "constructor() {\n throw new Error('Not implemented');\n }", "connect() {\n throw new Error(\n 'The Message Bus is not currently supported in browser environments'\n );\n }", "constructor() {\n this._connectionResolver = new pip_services3_components_node_1.ConnectionResolver();\n this._maxKeySize = 250;\n this._maxExpiration = 2592000;\n this._maxValue = 1048576;\n this._poolSize = 5;\n this._reconnect = 10000;\n this._timeout = 5000;\n this._retries = 5;\n this._failures = 5;\n this._retry = 30000;\n this._remove = false;\n this._idle = 5000;\n this._client = null;\n }", "componentDidMount()\n {\n\n }", "function OfflineStreamProcessor(config) {\n config = config || {};\n var context = this.context;\n var eventBus = config.eventBus;\n var events = config.events;\n var errors = config.errors;\n var debug = config.debug;\n var constants = config.constants;\n var settings = config.settings;\n var dashConstants = config.dashConstants;\n var manifestId = config.id;\n var type = config.type;\n var streamInfo = config.streamInfo;\n var errHandler = config.errHandler;\n var mediaPlayerModel = config.mediaPlayerModel;\n var abrController = config.abrController;\n var playbackController = config.playbackController;\n var adapter = config.adapter;\n var dashMetrics = config.dashMetrics;\n var baseURLController = config.baseURLController;\n var timelineConverter = config.timelineConverter;\n var bitrate = config.bitrate;\n var offlineStoreController = config.offlineStoreController;\n var completedCb = config.callbacks && config.callbacks.completed;\n var progressCb = config.callbacks && config.callbacks.progression;\n var instance, logger, mediaInfo, indexHandler, representationController, fragmentModel, updating, downloadedSegments, isInitialized, segmentsController, isStopped;\n\n function setup() {\n resetInitialSettings();\n logger = debug.getLogger(instance);\n segmentsController = Object(_dash_controllers_SegmentsController__WEBPACK_IMPORTED_MODULE_6__[\"default\"])(context).create({\n events: events,\n eventBus: eventBus,\n streamInfo: streamInfo,\n timelineConverter: timelineConverter,\n dashConstants: dashConstants,\n segmentBaseController: config.segmentBaseController,\n type: type\n });\n indexHandler = Object(_dash_DashHandler__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(context).create({\n streamInfo: streamInfo,\n type: type,\n timelineConverter: timelineConverter,\n dashMetrics: dashMetrics,\n mediaPlayerModel: mediaPlayerModel,\n baseURLController: baseURLController,\n errHandler: errHandler,\n settings: settings,\n // boxParser: boxParser,\n eventBus: eventBus,\n events: events,\n debug: debug,\n requestModifier: Object(_streaming_utils_RequestModifier__WEBPACK_IMPORTED_MODULE_5__[\"default\"])(context).getInstance(),\n dashConstants: dashConstants,\n constants: constants,\n segmentsController: segmentsController,\n urlUtils: Object(_streaming_utils_URLUtils__WEBPACK_IMPORTED_MODULE_4__[\"default\"])(context).getInstance()\n });\n representationController = Object(_dash_controllers_RepresentationController__WEBPACK_IMPORTED_MODULE_1__[\"default\"])(context).create({\n streamInfo: streamInfo,\n type: type,\n abrController: abrController,\n dashMetrics: dashMetrics,\n playbackController: playbackController,\n timelineConverter: timelineConverter,\n dashConstants: dashConstants,\n events: events,\n eventBus: eventBus,\n errors: errors,\n segmentsController: segmentsController\n });\n fragmentModel = Object(_streaming_models_FragmentModel__WEBPACK_IMPORTED_MODULE_2__[\"default\"])(context).create({\n streamInfo: streamInfo,\n dashMetrics: dashMetrics,\n fragmentLoader: Object(_streaming_FragmentLoader__WEBPACK_IMPORTED_MODULE_3__[\"default\"])(context).create({\n dashMetrics: dashMetrics,\n mediaPlayerModel: mediaPlayerModel,\n errHandler: errHandler,\n requestModifier: Object(_streaming_utils_RequestModifier__WEBPACK_IMPORTED_MODULE_5__[\"default\"])(context).getInstance(),\n settings: settings,\n eventBus: eventBus,\n events: events,\n errors: errors,\n constants: constants,\n dashConstants: dashConstants,\n urlUtils: Object(_streaming_utils_URLUtils__WEBPACK_IMPORTED_MODULE_4__[\"default\"])(context).getInstance()\n }),\n debug: debug,\n eventBus: eventBus,\n events: events\n });\n eventBus.on(events.STREAM_REQUESTING_COMPLETED, onStreamRequestingCompleted, instance);\n eventBus.on(events.FRAGMENT_LOADING_COMPLETED, onFragmentLoadingCompleted, instance);\n }\n\n function initialize(_mediaInfo) {\n mediaInfo = _mediaInfo;\n indexHandler.initialize(false);\n updateRepresentation(mediaInfo);\n }\n\n function isInitRequest(request) {\n return request.type === 'InitializationSegment';\n }\n\n function onFragmentLoadingCompleted(e) {\n if (e.sender !== fragmentModel) {\n return;\n }\n\n if (e.request !== null) {\n var isInit = isInitRequest(e.request);\n var suffix = isInit ? 'init' : e.request.index;\n var fragmentName = e.request.representationId + '_' + suffix;\n offlineStoreController.storeFragment(manifestId, fragmentName, e.response).then(function () {\n if (!isInit) {\n // store current index and downloadedSegments number\n offlineStoreController.setRepresentationCurrentState(manifestId, e.request.representationId, {\n index: e.request.index,\n downloaded: downloadedSegments\n });\n }\n });\n }\n\n if (e.error && e.request.serviceLocation && !isStopped) {\n fragmentModel.executeRequest(e.request);\n } else {\n downloadedSegments++;\n download();\n }\n }\n\n function onStreamRequestingCompleted(e) {\n if (e.fragmentModel !== fragmentModel) {\n return;\n }\n\n logger.info(\"[\".concat(manifestId, \"] Stream is complete\"));\n stop();\n completedCb();\n }\n\n function getRepresentationController() {\n return representationController;\n }\n\n function getRepresentationId() {\n return representationController.getCurrentRepresentation().id;\n }\n /**\n * Stops download of fragments\n * @memberof OfflineStreamProcessor#\n */\n\n\n function stop() {\n if (isStopped) {\n return;\n }\n\n isStopped = true;\n }\n\n function removeExecutedRequestsBeforeTime(time) {\n if (fragmentModel) {\n fragmentModel.removeExecutedRequestsBeforeTime(time);\n }\n }\n /**\n * Execute init request for the represenation\n * @memberof OfflineStreamProcessor#\n */\n\n\n function getInitRequest() {\n if (!representationController.getCurrentRepresentation()) {\n return null;\n }\n\n return indexHandler.getInitRequest(getMediaInfo(), representationController.getCurrentRepresentation());\n }\n /**\n * Get next request\n * @memberof OfflineStreamProcessor#\n */\n\n\n function getNextRequest() {\n return indexHandler.getNextSegmentRequest(getMediaInfo(), representationController.getCurrentRepresentation());\n }\n /**\n * Start download\n * @memberof OfflineStreamProcessor#\n */\n\n\n function start() {\n if (representationController) {\n if (!representationController.getCurrentRepresentation()) {\n throw new Error('Start denied to OfflineStreamProcessor');\n }\n\n isStopped = false;\n offlineStoreController.getRepresentationCurrentState(manifestId, representationController.getCurrentRepresentation().id).then(function (state) {\n if (state) {\n indexHandler.setCurrentIndex(state.index);\n downloadedSegments = state.downloaded;\n }\n\n download();\n })[\"catch\"](function () {\n // start from beginining\n download();\n });\n }\n }\n /**\n * Performs download of fragment according to type\n * @memberof OfflineStreamProcessor#\n */\n\n\n function download() {\n if (isStopped) {\n return;\n }\n\n if (isNaN(representationController.getCurrentRepresentation())) {\n var request = null;\n\n if (!isInitialized) {\n request = getInitRequest();\n isInitialized = true;\n } else {\n request = getNextRequest(); // update progression : done here because availableSegmentsNumber is done in getNextRequest from dash handler\n\n updateProgression();\n }\n\n if (request) {\n logger.info(\"[\".concat(manifestId, \"] download request : \").concat(request.url));\n fragmentModel.executeRequest(request);\n } else {\n logger.info(\"[\".concat(manifestId, \"] no request to be downloaded\"));\n }\n }\n }\n /**\n * Update representation\n * @param {Object} mediaInfo - mediaInfo\n * @memberof OfflineStreamProcessor#\n */\n\n\n function updateRepresentation(mediaInfo) {\n updating = true;\n var voRepresentations = adapter.getVoRepresentations(mediaInfo); // get representation VO according to id.\n\n var quality = voRepresentations.findIndex(function (representation) {\n return representation.id === bitrate.id;\n });\n\n if (type !== constants.VIDEO && type !== constants.AUDIO && type !== constants.TEXT) {\n updating = false;\n return;\n }\n\n representationController.updateData(null, voRepresentations, type, mediaInfo.isFragmented, quality);\n }\n\n function isUpdating() {\n return updating;\n }\n\n function getType() {\n return type;\n }\n\n function getMediaInfo() {\n return mediaInfo;\n }\n\n function getAvailableSegmentsNumber() {\n return representationController.getCurrentRepresentation().availableSegmentsNumber + 1; // do not forget init segment\n }\n\n function updateProgression() {\n if (progressCb) {\n progressCb(instance, downloadedSegments, getAvailableSegmentsNumber());\n }\n }\n\n function resetInitialSettings() {\n isInitialized = false;\n downloadedSegments = 0;\n updating = false;\n }\n /**\n * Reset\n * @memberof OfflineStreamProcessor#\n */\n\n\n function reset() {\n resetInitialSettings();\n indexHandler.reset();\n eventBus.off(events.STREAM_REQUESTING_COMPLETED, onStreamRequestingCompleted, instance);\n eventBus.off(events.FRAGMENT_LOADING_COMPLETED, onFragmentLoadingCompleted, instance);\n }\n\n instance = {\n initialize: initialize,\n getMediaInfo: getMediaInfo,\n getRepresentationController: getRepresentationController,\n removeExecutedRequestsBeforeTime: removeExecutedRequestsBeforeTime,\n getType: getType,\n getRepresentationId: getRepresentationId,\n isUpdating: isUpdating,\n start: start,\n stop: stop,\n getAvailableSegmentsNumber: getAvailableSegmentsNumber,\n reset: reset\n };\n setup();\n return instance;\n}", "constructor() {\r\n }", "constructor() {\n\t\t// ...\n\t}", "onReady() {\n return __awaiter(this, void 0, void 0, function* () {\n this.logger = new log_1.ioBrokerLogger(this.log);\n yield this.setObjectNotExistsAsync(\"verify_code\", {\n type: \"state\",\n common: {\n name: \"2FA verification code\",\n type: \"number\",\n role: \"state\",\n read: true,\n write: true,\n },\n native: {},\n });\n yield this.setObjectNotExistsAsync(\"info\", {\n type: \"channel\",\n common: {\n name: \"info\"\n },\n native: {},\n });\n yield this.setObjectNotExistsAsync(\"info.connection\", {\n type: \"state\",\n common: {\n name: \"Global connection\",\n type: \"boolean\",\n role: \"indicator.connection\",\n read: true,\n write: false,\n },\n native: {},\n });\n yield this.setStateAsync(\"info.connection\", { val: false, ack: true });\n yield this.setObjectNotExistsAsync(\"info.push_connection\", {\n type: \"state\",\n common: {\n name: \"Push notification connection\",\n type: \"boolean\",\n role: \"indicator.connection\",\n read: true,\n write: false,\n },\n native: {},\n });\n // Remove old states of previous adapter versions\n try {\n const schedule_modes = yield this.getStatesAsync(\"*.schedule_mode\");\n Object.keys(schedule_modes).forEach((id) => __awaiter(this, void 0, void 0, function* () {\n yield this.delObjectAsync(id);\n }));\n }\n catch (error) {\n }\n try {\n const push_notifications = yield this.getStatesAsync(\"push_notification.*\");\n Object.keys(push_notifications).forEach((id) => __awaiter(this, void 0, void 0, function* () {\n yield this.delObjectAsync(id);\n }));\n yield this.delObjectAsync(\"push_notification\");\n }\n catch (error) {\n }\n try {\n const last_camera_url = yield this.getStatesAsync(\"*.last_camera_url\");\n Object.keys(last_camera_url).forEach((id) => __awaiter(this, void 0, void 0, function* () {\n yield this.delObjectAsync(id);\n }));\n }\n catch (error) {\n }\n try {\n const captured_pic_url = yield this.getStatesAsync(\"*.captured_pic_url\");\n Object.keys(captured_pic_url).forEach((id) => __awaiter(this, void 0, void 0, function* () {\n yield this.delObjectAsync(id);\n }));\n }\n catch (error) {\n }\n try {\n const person_identified = yield this.getStatesAsync(\"*.person_identified\");\n Object.keys(person_identified).forEach((id) => __awaiter(this, void 0, void 0, function* () {\n yield this.delObjectAsync(id);\n }));\n }\n catch (error) {\n }\n try {\n const last_captured_pic_url = yield this.getStatesAsync(\"*.last_captured_pic_url\");\n Object.keys(last_captured_pic_url).forEach((id) => __awaiter(this, void 0, void 0, function* () {\n yield this.delObjectAsync(id);\n }));\n }\n catch (error) {\n }\n try {\n const last_captured_pic_html = yield this.getStatesAsync(\"*.last_captured_pic_html\");\n Object.keys(last_captured_pic_html).forEach((id) => __awaiter(this, void 0, void 0, function* () {\n yield this.delObjectAsync(id);\n }));\n }\n catch (error) {\n }\n // End\n // Reset event states if necessary (for example because of an unclean exit)\n yield this.initializeEvents(types_1.CameraStateID.PERSON_DETECTED);\n yield this.initializeEvents(types_1.CameraStateID.MOTION_DETECTED);\n yield this.initializeEvents(types_1.DoorbellStateID.RINGING);\n yield this.initializeEvents(types_1.IndoorCameraStateID.CRYING_DETECTED);\n yield this.initializeEvents(types_1.IndoorCameraStateID.SOUND_DETECTED);\n yield this.initializeEvents(types_1.IndoorCameraStateID.PET_DETECTED);\n try {\n if (fs.statSync(this.persistentFile).isFile()) {\n const fileContent = fs.readFileSync(this.persistentFile, \"utf8\");\n this.persistentData = JSON.parse(fileContent);\n }\n }\n catch (err) {\n this.logger.debug(\"No stored data from last exit found.\");\n }\n //TODO: Temporary Test to be removed!\n /*await this.setObjectNotExistsAsync(\"test_button\", {\n type: \"state\",\n common: {\n name: \"Test button\",\n type: \"boolean\",\n role: \"button\",\n read: false,\n write: true,\n },\n native: {},\n });\n this.subscribeStates(\"test_button\");\n await this.setObjectNotExistsAsync(\"test_button2\", {\n type: \"state\",\n common: {\n name: \"Test button2\",\n type: \"boolean\",\n role: \"button\",\n read: false,\n write: true,\n },\n native: {},\n });\n this.subscribeStates(\"test_button2\");*/\n // END\n this.subscribeStates(\"verify_code\");\n const systemConfig = yield this.getForeignObjectAsync(\"system.config\");\n let countryCode = undefined;\n let languageCode = undefined;\n if (systemConfig) {\n countryCode = i18n_iso_countries_1.getAlpha2Code(systemConfig.common.country, \"en\");\n if (i18n_iso_languages_1.isValid(systemConfig.common.language))\n languageCode = systemConfig.common.language;\n }\n try {\n const adapter_info = yield this.getForeignObjectAsync(`system.adapter.${this.namespace}`);\n if (adapter_info && adapter_info.common && adapter_info.common.version) {\n if (this.persistentData.version !== adapter_info.common.version) {\n const currentVersion = Number.parseFloat(utils_1.removeLastChar(adapter_info.common.version, \".\"));\n const previousVersion = this.persistentData.version !== \"\" && this.persistentData.version !== undefined ? Number.parseFloat(utils_1.removeLastChar(this.persistentData.version, \".\")) : 0;\n this.logger.debug(`Handling of adapter update - currentVersion: ${currentVersion} previousVersion: ${previousVersion}`);\n if (previousVersion < currentVersion) {\n yield utils_1.handleUpdate(this, this.logger, previousVersion);\n this.persistentData.version = adapter_info.common.version;\n this.writePersistentData();\n }\n }\n }\n }\n catch (error) {\n this.logger.error(`Handling of adapter update - Error:`, error);\n }\n this.eufy = new EufySecurityAPI.EufySecurity(this, this.logger, countryCode, languageCode);\n this.eufy.on(\"stations\", (stations) => this.handleStations(stations));\n this.eufy.on(\"devices\", (devices) => this.handleDevices(devices));\n this.eufy.on(\"push message\", (messages) => this.handlePushNotification(messages));\n this.eufy.on(\"connect\", () => this.onConnect());\n this.eufy.on(\"close\", () => this.onClose());\n this.eufy.on(\"livestream start\", (station, device, url) => this.onStartLivestream(station, device, url));\n this.eufy.on(\"livestream stop\", (station, device) => this.onStopLivestream(station, device));\n this.eufy.on(\"push connect\", () => this.onPushConnect());\n this.eufy.on(\"push close\", () => this.onPushClose());\n const api = this.eufy.getApi();\n if (this.persistentData.api_base && this.persistentData.api_base != \"\") {\n this.logger.debug(`Load previous api_base: ${this.persistentData.api_base}`);\n api.setAPIBase(this.persistentData.api_base);\n }\n if (this.persistentData.login_hash && this.persistentData.login_hash != \"\") {\n this.logger.debug(`Load previous login_hash: ${this.persistentData.login_hash}`);\n if (utils_1.md5(`${this.config.username}:${this.config.password}`) != this.persistentData.login_hash) {\n this.logger.info(`Authentication properties changed, invalidate saved cloud token.`);\n this.persistentData.cloud_token = \"\";\n this.persistentData.cloud_token_expiration = 0;\n this.persistentData.api_base = \"\";\n }\n }\n else {\n this.persistentData.cloud_token = \"\";\n this.persistentData.cloud_token_expiration = 0;\n }\n if (this.persistentData.cloud_token && this.persistentData.cloud_token != \"\") {\n this.logger.debug(`Load previous token: ${this.persistentData.cloud_token} token_expiration: ${this.persistentData.cloud_token_expiration}`);\n api.setToken(this.persistentData.cloud_token);\n api.setTokenExpiration(new Date(this.persistentData.cloud_token_expiration));\n }\n if (!this.persistentData.openudid || this.persistentData.openudid == \"\") {\n this.persistentData.openudid = utils_1.generateUDID();\n this.logger.debug(`Generated new openudid: ${this.persistentData.openudid}`);\n }\n api.setOpenUDID(this.persistentData.openudid);\n if (!this.persistentData.serial_number || this.persistentData.serial_number == \"\") {\n this.persistentData.serial_number = utils_1.generateSerialnumber(12);\n this.logger.debug(`Generated new serial_number: ${this.persistentData.serial_number}`);\n }\n api.setSerialNumber(this.persistentData.serial_number);\n yield this.eufy.logon();\n });\n }", "static get STATUS() {\n return 0;\n }", "_recordingCompatibility() {\n // Detect audio recording capabilities.\n // http://caniuse.com/#feat=stream\n // https://developer.mozilla.org/en-US/docs/Web/API/Navigator.getUserMedia\n navigator.getUserMedia = (navigator.getUserMedia ||\n navigator.webkitGetUserMedia ||\n navigator.mozGetUserMedia ||\n navigator.msGetUserMedia);\n this.canGetUserMedia = Boolean(navigator.getUserMedia);\n console.log('Native deprecated navigator.getUserMedia API capability: ' +\n this.canGetUserMedia);\n\n // https://developer.mozilla.org/en-US/docs/Web/API/MediaDevices/mediaDevices.getUserMedia\n this.canMediaDevicesGetUserMedia = false;\n if (navigator.mediaDevices) {\n navigator.mediaDevices.getUserMedia = navigator.mediaDevices.getUserMedia || navigator.mediaDevices.webkitGetUserMedia || navigator.mediaDevices.mozGetUserMedia;\n this.canMediaDevicesGetUserMedia = Boolean(navigator.mediaDevices.getUserMedia);\n }\n console.log('Native navigator.mediaDevices.getUserMedia API capability:',\n this.canMediaDevicesGetUserMedia);\n\n // Detect MediaStream Recording\n // It allows recording audio using the MediaStream from the above\n // getUserMedia directly with a native codec better than Wave.\n // http://www.w3.org/TR/mediastream-recording/\n this.canUseMediaRecorder = Boolean(window.MediaRecorder);\n console.log('Native MediaRecorder recording capability: ' +\n this.canUseMediaRecorder);\n\n // Web Audio API\n // High-level JavaScript API for processing and synthesizing audio\n // http://caniuse.com/#feat=audio-api\n window.AudioContext = window.AudioContext ||\n window.webkitAudioContext || window.mozAudioContext;\n var canCreateAudioContext = Boolean(window.AudioContext);\n console.log('Native Web Audio API (AudioContext) processing capability: ' +\n canCreateAudioContext);\n\n // Detect Cordova Media Recording\n // It allows recording audio using the native bridge inside WebView Apps.\n // Note that it may also require native playback when codecs were used for\n // recording that are not yet supported in the WebView.\n // https://github.com/apache/cordova-plugin-media/blob/master/doc/index.md\n this.canUseCordovaMedia = Boolean(window.Media);\n console.log('Cordova Media recording capability: ' +\n this.canUseCordovaMedia);\n\n if (!(this.canGetUserMedia || this.canUseCordovaMedia)) {\n throw new Error(\n 'Some form of audio recording capability is required');\n }\n\n window.URL = (window.URL || window.webkitURL);\n var hasWindowURL = Boolean(window.URL);\n console.log('Native window.URL capability: ' +\n hasWindowURL);\n if (!hasWindowURL) {\n throw new Error(\n 'No window.URL blob conversion capabilities');\n }\n }" ]
[ "0.47163445", "0.46584114", "0.45273763", "0.45036152", "0.448429", "0.44346538", "0.43841133", "0.4362977", "0.4333602", "0.43013042", "0.42535996", "0.42417178", "0.42218232", "0.42189214", "0.41818306", "0.41804415", "0.4179575", "0.41772082", "0.41758674", "0.41746357", "0.41729844", "0.41645744", "0.41409218", "0.41409218", "0.41248086", "0.4119414", "0.4119171", "0.41116208", "0.41086638", "0.4108044", "0.41061", "0.41053793", "0.4102025", "0.41017646", "0.41016397", "0.40947947", "0.40918016", "0.40808365", "0.40797257", "0.40781054", "0.4077613", "0.40756986", "0.40750656", "0.40738243", "0.40694946", "0.40600455", "0.40542144", "0.4053162", "0.40487152", "0.40486646", "0.40476045", "0.40436408", "0.40428442", "0.40415418", "0.40402153", "0.40385923", "0.40334603", "0.40256238", "0.4020882", "0.4018672", "0.40179121", "0.40143794", "0.4013364", "0.4012688", "0.40110162", "0.4010018", "0.40062585", "0.40060434", "0.40060434", "0.40040717", "0.3991394", "0.39912733", "0.3990626", "0.39878824", "0.39843145", "0.39805657", "0.39803058", "0.39801094", "0.39801094", "0.39801094", "0.39764443", "0.3976021", "0.3975312", "0.39746568", "0.39738244", "0.3973245", "0.39689064", "0.39649746", "0.3960977", "0.39609686", "0.39590856", "0.3957125", "0.39569685", "0.39549816", "0.39504528", "0.3946225", "0.39447936", "0.39438543", "0.39406016", "0.39402705", "0.3938285" ]
0.0
-1
Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file distributed with this work for additional information regarding copyright ownership. The ASF licenses this file to you under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. / global Float32Array
function _default(seriesType) { return { seriesType: seriesType, plan: createRenderPlanner(), reset: function (seriesModel) { var data = seriesModel.getData(); var coordSys = seriesModel.coordinateSystem; var pipelineContext = seriesModel.pipelineContext; var isLargeRender = pipelineContext.large; if (!coordSys) { return; } var dims = map(coordSys.dimensions, function (dim) { return data.mapDimension(dim); }).slice(0, 2); var dimLen = dims.length; var stackResultDim = data.getCalculationInfo('stackResultDimension'); if (isDimensionStacked(data, dims[0] /*, dims[1]*/ )) { dims[0] = stackResultDim; } if (isDimensionStacked(data, dims[1] /*, dims[0]*/ )) { dims[1] = stackResultDim; } function progress(params, data) { var segCount = params.end - params.start; var points = isLargeRender && new Float32Array(segCount * dimLen); for (var i = params.start, offset = 0, tmpIn = [], tmpOut = []; i < params.end; i++) { var point; if (dimLen === 1) { var x = data.get(dims[0], i); point = !isNaN(x) && coordSys.dataToPoint(x, null, tmpOut); } else { var x = tmpIn[0] = data.get(dims[0], i); var y = tmpIn[1] = data.get(dims[1], i); // Also {Array.<number>}, not undefined to avoid if...else... statement point = !isNaN(x) && !isNaN(y) && coordSys.dataToPoint(tmpIn, null, tmpOut); } if (isLargeRender) { points[offset++] = point ? point[0] : NaN; points[offset++] = point ? point[1] : NaN; } else { data.setItemLayout(i, point && point.slice() || [NaN, NaN]); } } isLargeRender && data.setLayout('symbolPoints', points); } return dimLen && { progress: progress }; } }; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function n$1(){return new Float32Array(4)}", "function r(){const r=new Float32Array(4);return r[3]=1,r}", "constructor()\n {\n this.m = new Float32Array(16);\n\n this.m[0] = this.m[5] = this.m[10] = this.m[15] = 1;\n }", "setFloat32Buffers() {\n let tempArr = []\n for(let i = 0; i < this.vertices.length; i++) {\n let vertex = this.vertices[i];\n tempArr[3*i] = vertex.points[0];\n tempArr[3*i + 1] = vertex.points[1];\n tempArr[3*i + 2] = vertex.points[2];\n }\n this.vertexPosArray = new Float32Array(tempArr);\n this.colorArray = new Float32Array(this.colors);\n this.normalArray = new Float32Array(this.normals);\n }", "function r() {\n var r = new Float32Array(9);\n return r[0] = 1, r[4] = 1, r[8] = 1, r;\n }", "constructor() {\nthis.xyzw = new Float32Array(4);\nthis.xyzw[3] = 1;\n}", "static makeV3(x, y, z) {\nreturn new Float32Array([x, y, z]);\n}", "OBB3(values) {\n return new Float32Array(values || 32);\n }", "function testFloat32Array(L) {\n var f = new Float32Array(8);\n assertEq(f[0], 0);\n assertEq(f[L], 0);\n assertEq(f[L+8], undefined);\n assertEq(f[8], undefined);\n f[0] = 12;\n f[L+1] = 13.5;\n f[2] = f[1];\n f[L+3] = 4294967295;\n f[L+4] = true;\n f[L+5] = L;\n assertEq(f[0], 12);\n assertEq(f[1], 13.5);\n assertEq(f[2], 13.5);\n assertEq(f[3], 4294967296);\n assertEq(f[4], 1);\n assertEq(f[5], 0);\n}", "static makeIdTRMat() {\nvar m;\n//---------\nm = new Float32Array(16);\nm[0] = m[5] = m[10] = m[15] = 1;\nreturn m;\n}", "function mergeFloat(recBuffers, recLength) {\n\tvar result = new Float32Array(recLength);\n\tresult.set(recBuffers, 0);\n\treturn result;\n}", "static make3Vec() {\nreturn new Float32Array(3);\n}", "function n() {\n return new Float32Array(2);\n }", "readFloat32Array(ar, label)\n\t{\n\t\treturn this.readArray(ar, label);\n\t}", "function makeFloat32Buffer(data, size, elems) {\n let buff = new Float32Array(size * size * elems);\n if (data) {\n data.forEach((d, i) => buff[i] = d);\n } \n return buff;\n}", "function n$1(){const n=new Float32Array(4);return n[3]=1,n}", "static makeQV(x, y, z, w) {\nreturn new Float32Array([x, y, z, w]);\n}", "toFloat32(begin, end) {\n if (typeof end !== \"undefined\") {\n return this.bufferF32.subarray(begin, end);\n } else {\n return this.bufferF32;\n }\n }", "function f() {\n var bytes = new Uint32Array([0x7F800001]);\n var floats = new Float32Array(bytes.buffer);\n assertTrue(isNaN(floats[0]));\n assertTrue(isNaN(floats[0]*2.0));\n assertTrue(isNaN(floats[0] + 0.5));\n }", "static copyOfV3(xyz) {\nreturn new Float32Array(xyz);\n}", "function f() {\n var bytes = new Uint32Array([0x7FC00000]);\n var floats = new Float32Array(bytes.buffer);\n assertTrue(isNaN(floats[0]));\n assertTrue(isNaN(floats[0]*2.0));\n assertTrue(isNaN(floats[0] + 0.5));\n }", "static copyOfQV(qv) {\nreturn new Float32Array(qv);\n}", "function n() {\n var n = new Float32Array(6);\n return n[0] = 1, n[3] = 1, n;\n }", "static make4Vec() {\nreturn new Float32Array(4);\n}", "function DynamicFloatArray(stride,initialElementCount){this.compareValueOffset=null;this.sortingAscending=true;this._stride=stride;this.buffer=new Float32Array(stride*initialElementCount);this._lastUsed=0;this._firstFree=0;this._allEntries=new Array(initialElementCount);this._freeEntries=new Array(initialElementCount);for(var i=0;i<initialElementCount;i++){var element=new DynamicFloatArrayElementInfo();element.offset=i*stride;this._allEntries[i]=element;this._freeEntries[initialElementCount-i-1]=element;}}", "f32() {\n this._convo.u8.set(this.buffer.subarray(this.at, this.at += 4));\n return this._convo.f32[0];\n }", "function getInitArr(length) {\n var arr = new Float32Array(length);\n for (var i = 0; i < length; i++) {\n arr[i] = 0;\n }\n return arr;\n }", "static makeMat4() {\nreturn new Float32Array(16);\n}", "supportsFloatArrayValues() {\n return true;\n }", "function makeNativeFloatArray(size) {\n var arr = [];\n if (!size)\n return arr;\n arr[0] = 0.1;\n for (var i = 0; i < size; i++)\n arr[i] = 0;\n return arr;\n }", "function testSetTypedFloat32Array(k) {\n var ar = new Float32Array(8);\n ar[k+5] = { };\n ar[k+6] = ar;\n ar[k+4] = (k + 800) * 897 * 800 * 800 * 810 * 1923437;\n var t = k + 555;\n var L = ar[k+7] = t & 5;\n ar[0] = 12.3;\n ar[8] = 500;\n ar[k+8] = 1200;\n ar[k+1] = 500;\n ar[k+2] = \"3\" + k;\n ar[k+3] = true;\n assertEq(ar[0] - 12.3 >= 0 &&\n ar[0] - 12.3 <= 0.0001, true);\n assertEq(ar[1], 500);\n assertEq(ar[2], 30);\n assertEq(ar[3], 1);\n assertEq(ar[4], 715525927453369300000);\n assertEq(ar[5], NaN);\n assertEq(ar[6], NaN);\n assertEq(ar[7], 1);\n assertEq(ar[8], undefined);\n assertEq(ar[k+8], undefined);\n}", "static makeIdMat4() {\nvar m;\n//----------\nm = new Float32Array(16);\nm[0] = m[5] = m[10] = m[15] = 1;\nreturn m;\n}", "static create() {\n const matrix = new Float32Array(9);\n Matrix.identity(matrix);\n return matrix;\n }", "OBB2(values) {\n return new Float32Array(values || 16);\n }", "constructor(data){\r\n this.type = EEE.MATH_MATRIX4;\r\n this.data = data || new Float32Array(16);\r\n }", "function to_float(rows) {\n return rows.map(function(row) {\n return new Float32Array(row);\n });\n }", "static identity()\n\t{\n\t\treturn new Float32Array([\n\t\t\t1, 0, 0, 0,\n\t\t\t0, 1, 0, 0,\n\t\t\t0, 0, 1, 0,\n\t\t\t0, 0, 0, 1\n\t\t]);\n\t}", "function identity() {\n return Float32Array.of(1, 0, 0, 0, 1, 0, 0, 0, 1);\n} // TODO: optimize", "function createBuffer(data)\n{\n var buffer = gl.createBuffer();\n gl.bindBuffer(gl.ARRAY_BUFFER, buffer);\n gl.bufferData(gl.ARRAY_BUFFER, new Float32Array(data), gl.STATIC_DRAW);\n gl.bindBuffer(gl.ARRAY_BUFFER, null);\n return buffer;\n}", "function floatToInt(floatArray) {\n\tvar intArray = new Uint32Array(new Float64Array([floatArray]).buffer)\n\treturn [intArray[0],intArray[1]]\n}", "function convertFloat32ToInt16(buffer) {\n\tlet l = buffer.length;\n\tlet buf = new Int16Array(l / 3);\n\n\twhile (l--) {\n\t\tif (l % 3 == 0) {\n\t\t\tbuf[l / 3] = buffer[l] * 0xFFFF;\n\t\t}\n\t}\n\treturn buf.buffer\n}", "function v11(v12,v13) {\n const v15 = new Float32Array(Float32Array);\n // v15 = .object(ofGroup: Float32Array, withProperties: [\"__proto__\", \"constructor\", \"buffer\", \"byteLength\", \"length\", \"byteOffset\"], withMethods: [\"sort\", \"fill\", \"lastIndexOf\", \"findIndex\", \"entries\", \"copyWithin\", \"reverse\", \"forEach\", \"filter\", \"includes\", \"map\", \"set\", \"keys\", \"every\", \"subarray\", \"reduceRight\", \"join\", \"some\", \"values\", \"find\", \"reduce\", \"indexOf\", \"slice\"])\n const v16 = v10.set(v15,gc);\n // v16 = .undefined\n}", "function float32String(v) {\n return Math.abs(v) > 1e-37 ? v : 0;\n } // Create matrix array for looping", "function mat(r, c){\n var arr = [];\n for(var i = 0; i < r; i++) arr[i] = new Float32Array(c);\n return arr;\n}", "function rgba32( R, G, B, A )\r\n{\r\n if( R > 255 ) R = 255;\r\n if( R < 0 ) R = 0;\r\n if( G > 255 ) G = 255;\r\n if( G < 0 ) G = 0;\r\n if( B > 255 ) B = 255;\r\n if( B < 0 ) B = 0;\r\n if( A > 1.0 ) A = 255;\r\n if( A < 0 ) A = 0;\r\n\r\n return new Float32Array\r\n ([ R/255, G/255, B/255, A/255 ]);\r\n}", "function float32String(v) {\n return Math.abs(v) > 1e-37 ? v : 0;\n } // Create matrix array for looping", "makeMat4x4() {\nvar m;\nm = new Float32Array(16);\nreturn this.convertToMat4x4(m);\n}", "function MVbuffer(size) {\n var b = {};\n b.buf = new Float32Array(size);\n b.index = 0;\n b.push = function(x) {\n for(var i=0; i<x.length; i++) {\n b.buf[b.index+i] = x[i];\n }\n b.index += x.length;\n b.type = '';\n }\n return b;\n}", "create_vertex_arrays() {\r\n\r\n this.glTF.bufferViews.forEach(bufferView => {\r\n // console.log(bufferView);\r\n\r\n // Create the buffer.\r\n const [buffer, arrayBuffer] = this.gpuDevice.createBufferMapped({\r\n size: bufferView.byteLength,\r\n usage: GPUBufferUsage.VERTEX | GPUBufferUsage.COPY_DST\r\n });\r\n\r\n // Fill it.\r\n new Float32Array(arrayBuffer).set(bufferView.data);\r\n\r\n // Prepare buffer for GPU operations.\r\n buffer.unmap();\r\n\r\n bufferView.buffer = buffer;\r\n });\r\n\r\n console.log(`Created ${this.glTF.bufferViews.length} vertex array(s).`);\r\n }", "constructor(){\n // 1D array, because it can be passed\n // to WebGL shader as is.\n this.data = new Float32Array(16);\n return this;\n }", "function GEN_BASELINE(buffer, start) {\r\n var IntHeap32 = new Int32Array(buffer);\r\n var FloatHeap32 = new Float32Array(buffer);\r\n var f4;\r\n var dim1 = IntHeap32[start];\r\n var dim2 = IntHeap32[start + 1];\r\n WScript.Echo(\"[\");\r\n for (var i = 0; i < Math.imul(dim1, dim2) ; i += 4) {\r\n f4 = SIMD.Float32x4.load(FloatHeap32, i + start + 2);\r\n WScript.Echo(f4.toString()+\",\");\r\n }\r\n WScript.Echo(\"]\");\r\n}", "function float32String(v){return Math.abs(v)>1e-37?v:0;}// Create matrix array for looping", "function float32String(v){return Math.abs(v)>1e-37?v:0;}// Create matrix array for looping", "function abfunc3() {\n new Uint32Array(ab,4,3);\n}", "function getFloat(reg){\r\n\t//same stuff as in getLong()\r\n\tlet buffer = new ArrayBuffer(4);\r\n\tlet view = new DataView(buffer);\r\n\tview.setUint16(0, modbusValues[reg], true);\r\n\tview.setUint16(2, modbusValues[reg+1], true);\r\n\t//read the buffer as float and round to 5 digits\r\n\treturn view.getFloat32(0, true).toPrecision(5);\r\n}", "function EBMLFloat32(value) {\n this.value = value;\n }", "_createFloatTexture(data) {\n let gl = this.context.context;\n\n let texture = gl.createTexture();\n gl.bindTexture(gl.TEXTURE_2D, texture);\n\n // No Need to pad\n gl.texImage2D(gl.TEXTURE_2D, 0, gl.RGBA, this.width / COMPONENT_PER_TEXEL, this.height, 0, gl.RGBA, gl.FLOAT, data || null);\n\n // TODO: PAdding\n\n // clamp to edge to support non-power of two textures\n gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_S, gl.CLAMP_TO_EDGE);\n gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_T, gl.CLAMP_TO_EDGE);\n\n // don't interpolate when getting data from texture\n gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MAG_FILTER, gl.NEAREST);\n gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MIN_FILTER, gl.NEAREST);\n\n // we're done with setup, so unbind current texture\n gl.bindTexture(gl.TEXTURE_2D, null);\n\n return texture;\n }", "upload(){\n this._compile();\n\n let buffer = new Float32Array(this._bufferData);\n\n exports.gl.bindBuffer(exports.gl.ARRAY_BUFFER, this._vbo);\n exports.gl.bufferData(exports.gl.ARRAY_BUFFER, buffer, exports.gl.STATIC_DRAW);\n exports.gl.bindBuffer(exports.gl.ARRAY_BUFFER, null);\n \n this._bufferData = null;\n }", "constructor(){\n this.isLoaded = false;\n this.minXYZ=[0,0,0];\n this.maxXYZ=[0,0,0];\n \n this.numFaces=0;\n this.numVertices=0;\n \n // Allocate vertex array\n this.vBuffer = [];\n // Allocate triangle array\n this.fBuffer = [];\n // Allocate normal array\n this.nBuffer = [];\n // Allocate array for edges so we can draw wireframe\n this.eBuffer = [];\n // Allocate array for texture coordinates\n this.texcoordBuffer = [];\n \n console.log(\"TriMesh: Allocated buffers\");\n \n // Get extension for 4 byte integer indices for drawElements\n var ext = gl.getExtension('OES_element_index_uint');\n if (ext ==null){\n alert(\"OES_element_index_uint is unsupported by your browser and terrain generation cannot proceed.\");\n }\n else{\n console.log(\"OES_element_index_uint is supported!\");\n }\n }", "function flatten( v )\n{\n\n if(isVector(v)) {\n var floats = new Float32Array(v.length)\n for(var i =0; i<v.length; i++) floats[i] = v[i];\n return floats;\n }\n if(isMatrix(v)) {\n\n var floats = new Float32Array(v.length*v.length);\n for(var i =0; i<v.length; i++) for(j=0;j<v.length; j++) {\n floats[i*v.length+j] = v[j][i];\n }\n return floats;\n }\n\n var floats = new Float32Array( v.length*v[0].length );\n\n for(var i = 0; i<v.length; i++) for(var j=0; j<v[0].length; j++) {\n floats[i*v[0].length+j] = v[i][j];\n }\n return floats;\n}", "constructor(options, options2){\n super(options); //Passing options to native class constructor. (REQUIRED)\n this.count = options2.count; //A self declared variable to limit the data which is to be read.\n this.factor = options2.theta;\n this.chunk = options2.chunk;\n\n this.debug_count = 0;\n this.phase = 0;\n\n\n // dv.setFloat64(0, number, false);\n\n // 8 is for bytes per float, 2 is for real/imag\n this.thebuffer = new ArrayBuffer(this.chunk*8*2); // in bytes\n this.uint8_view = new Uint8Array(this.thebuffer);\n this.uint32_view = new Uint32Array(this.thebuffer);\n this.float64_view = new Float64Array(this.thebuffer);\n // this.dv = new DataView(this.thebuffer);\n\n for(let i = 0; i < this.chunk; i++) {\n this.uint32_view[i] = i;\n }\n\n\n }", "function f() {\n if(isLittleEndian()) {\n var bytes = new Uint32Array([0, 0x7FF80000]);\n } else {\n var bytes = new Uint32Array([0x7FF80000, 0]);\n }\n var doubles = new Float64Array(bytes.buffer);\n assertTrue(isNaN(doubles[0]));\n assertTrue(isNaN(doubles[0]*2.0));\n assertTrue(isNaN(doubles[0] + 0.5));\n }", "identityMat3(mat = new Float32Array(9)) {\n mat[0] = 1.0;\n mat[1] = 0.0;\n mat[2] = 0.0;\n\n mat[3] = 0.0;\n mat[4] = 1.0;\n mat[5] = 0.0;\n\n mat[6] = 0.0;\n mat[7] = 0.0;\n mat[8] = 1.0;\n\n return mat;\n }", "constructor() {\n\n\t\t/**\n\t\t * The matrix elements.\n\t\t *\n\t\t * @type {Float32Array}\n\t\t */\n\n\t\tthis.elements = new Float32Array([\n\n\t\t\t1, 0, 0,\n\t\t\t0, 1, 0,\n\t\t\t0, 0, 1\n\n\t\t]);\n\n\t}", "Sphere3(x, y, z, r) {\n return new Float32Array([x, y, z, r]);\n }", "function asUint32Array(arr) {\n return new Uint32Array(arr);\n }", "constructor(sharedArrayBuffer) {\n this.sharedArrayBuffer = sharedArrayBuffer;\n this.int32 = new Int32Array(sharedArrayBuffer);\n }", "function getFloat16Decoder() {\n // Algorithm is based off of\n // http://www.fox-toolkit.org/ftp/fasthalffloatconversion.pdf\n // Cache lookup tables\n const mantisaTable = computeFloat16MantisaTable();\n const exponentTable = computeFloat16ExponentTable();\n const offsetTable = computeFloat16OffsetTable();\n return (quantizedArray) => {\n const buffer = new ArrayBuffer(4 * quantizedArray.length);\n const bufferUint32View = new Uint32Array(buffer);\n for (let index = 0; index < quantizedArray.length; index++) {\n const float16Bits = quantizedArray[index];\n const float32Bits = mantisaTable[offsetTable[float16Bits >> 10] + (float16Bits & 0x3ff)] +\n exponentTable[float16Bits >> 10];\n bufferUint32View[index] = float32Bits;\n }\n return new Float32Array(buffer);\n };\n}", "function inputReals(size) {\n var result = new Float32Array(size);\n for (var i = 0; i < result.length; i++)\n\tresult[i] = (i % 2) / 4.0;\n return result;\n}", "function toArray1D(array) {\n array = Array.isArray(array) ? new Float32Array(array) : array;\n return Object(_tensorflow_tfjs_core__WEBPACK_IMPORTED_MODULE_0__[\"tensor1d\"])(array);\n}", "allocate() {\n if (!this.data) {\n let elements = this.width * this.height * this.channels;\n if (this.isFloat) {\n this.data = new Float32Array(elements);\n } else {\n this.data = new Uint8Array(elements);\n }\n }\n return this;\n }", "function f() {\n if(isLittleEndian()) {\n var bytes = new Uint32Array([1, 0x7FF00000]);\n } else {\n var bytes = new Uint32Array([0x7FF00000, 1]);\n }\n var doubles = new Float64Array(bytes.buffer);\n assertTrue(isNaN(doubles[0]));\n assertTrue(isNaN(doubles[0]*2.0));\n assertTrue(isNaN(doubles[0] + 0.5));\n }", "AABB3(values) {\n return new Float32Array(values || 6);\n }", "function asUint32Array(arr) {\n return new Uint32Array(arr);\n}", "function rgbeToFloat(buffer) {\n var intensity = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 1;\n var texels = buffer.length / 4;\n var floatBuffer = new Float32Array(texels * 3);\n var expTable = [];\n\n for (var i = 0; i < 255; i++) {\n expTable[i] = intensity * Math.pow(2, i - 128) / 255;\n }\n\n for (var _i = 0; _i < texels; _i++) {\n var r = buffer[4 * _i];\n var g = buffer[4 * _i + 1];\n var b = buffer[4 * _i + 2];\n var a = buffer[4 * _i + 3];\n var e = expTable[a];\n floatBuffer[3 * _i] = r * e;\n floatBuffer[3 * _i + 1] = g * e;\n floatBuffer[3 * _i + 2] = b * e;\n }\n\n return floatBuffer;\n }", "function toArray1D(array) {\n array = Array.isArray(array) ? new Float32Array(array) : array;\n return tfjs_core_1.tensor1d(array);\n}", "function toArray1D(array) {\n array = Array.isArray(array) ? new Float32Array(array) : array;\n return tfjs_core_1.tensor1d(array);\n}", "function l(e,i,n,r){function o(e,t){return 1-3*t+3*e}function a(e,t){return 3*t-6*e}function s(e){return 3*e}function l(e,t,i){return((o(t,i)*e+a(t,i))*e+s(t))*e}function c(e,t,i){return 3*o(t,i)*e*e+2*a(t,i)*e+s(t)}function u(t,i){for(var r=0;f>r;++r){var o=c(i,e,n);if(0===o)return i;var a=l(i,e,n)-t;i-=a/o}return i}function d(){for(var t=0;C>t;++t)A[t]=l(t*w,e,n)}function h(t,i,r){var o,a,s=0;do a=i+(r-i)/2,o=l(a,e,n)-t,o>0?r=a:i=a;while(Math.abs(o)>v&&++s<b);return a}function g(t){for(var i=0,r=1,o=C-1;r!=o&&A[r]<=t;++r)i+=w;--r;var a=(t-A[r])/(A[r+1]-A[r]),s=i+a*w,l=c(s,e,n);return l>=m?u(t,s):0==l?s:h(t,i,i+w)}function p(){S=!0,(e!=i||n!=r)&&d()}var f=4,m=.001,v=1e-7,b=10,C=11,w=1/(C-1),y=\"Float32Array\"in t;if(4!==arguments.length)return!1;for(var x=0;4>x;++x)if(\"number\"!=typeof arguments[x]||isNaN(arguments[x])||!isFinite(arguments[x]))return!1;e=Math.min(e,1),n=Math.min(n,1),e=Math.max(e,0),n=Math.max(n,0);var A=y?new Float32Array(C):new Array(C),S=!1,E=function(t){return S||p(),e===i&&n===r?t:0===t?0:1===t?1:l(g(t),i,r)};E.getControlPoints=function(){return[{x:e,y:i},{x:n,y:r}]};var _=\"generateBezier(\"+[e,i,n,r]+\")\";return E.toString=function(){return _},E}", "function gen_op_neon_add_f32()\n{\n gen_opc_ptr.push({func:op_neon_add_f32});\n}", "allocate() {\n if (!this.data) {\n let elements = this.width * this.height * this.depth * this.channels;\n\t\t\t\tthis.elements = elements;\n if (this.isFloat) {\n this.data = new Float32Array(elements);\n } else {\n this.data = new Uint8Array(elements);\n }\n }\n return this;\n }", "static flatten_2D_to_1D(M) // Turn any 2D Array into a row-major 1D array of raw floats.\r\n {\r\n var index = 0,\r\n floats = new Float32Array(M.length && M.length * M[0].length);\r\n for (let i = 0; i < M.length; i++)\r\n for (let j = 0; j < M[i].length; j++) floats[index++] = M[i][j];\r\n return floats;\r\n }", "function computeFloat16OffsetTable() {\n const offsetTable = new Uint32Array(64);\n for (let i = 0; i < 64; i++) {\n offsetTable[i] = 1024;\n }\n offsetTable[0] = offsetTable[32] = 0;\n return offsetTable;\n}", "f32(num) {\n this._convo.f32[0] = num;\n this.buffer.set(this._convo.u8.slice(0, 4), this.length);\n this.length += 4;\n return this;\n }", "function mockFloat32Data(now,coefficient){\n let timeStamps = [] // timeStamps\n let values = [] // values\n for (let i = 0; i < counts; i++) {\n const t = now.add(1, 'second')\n const ts = t.unix() + 8 * 3600 // timeStamp\n timeStamps.push(ts)\n if (t.second() >= 20 && t.second() <= 30){\n values.push(coefficient) // write constant value\n }else{\n values.push(Math.random() * coefficient)\n }\n }\n return [timeStamps, values]\n}", "function getView(alignLog2, signed, float) {\n const buffer = memory.buffer;\n if (float) {\n switch (alignLog2) {\n case 2: return new Float32Array(buffer);\n case 3: return new Float64Array(buffer);\n }\n } else {\n switch (alignLog2) {\n case 0: return new (signed ? Int8Array : Uint8Array)(buffer);\n case 1: return new (signed ? Int16Array : Uint16Array)(buffer);\n case 2: return new (signed ? Int32Array : Uint32Array)(buffer);\n case 3: return new (signed ? BigInt64Array : BigUint64Array)(buffer);\n }\n }\n throw Error(`unsupported align: ${alignLog2}`);\n }", "function gw(t,e,r,n){var a=4,i=.001,s=1e-7,o=10,u=11,l=1/(u-1),f=typeof Float32Array<\"u\";if(arguments.length!==4)return!1;for(var c=0;c<4;++c)if(typeof arguments[c]!=\"number\"||isNaN(arguments[c])||!isFinite(arguments[c]))return!1;t=Math.min(t,1),r=Math.min(r,1),t=Math.max(t,0),r=Math.max(r,0);var v=f?new Float32Array(u):new Array(u);function h(S,L){return 1-3*L+3*S}function d(S,L){return 3*L-6*S}function g(S){return 3*S}function b(S,L,A){return((h(L,A)*S+d(L,A))*S+g(L))*S}function p(S,L,A){return 3*h(L,A)*S*S+2*d(L,A)*S+g(L)}function m(S,L){for(var A=0;A<a;++A){var O=p(L,t,r);if(O===0)return L;var N=b(L,t,r)-S;L-=N/O}return L}function y(){for(var S=0;S<u;++S)v[S]=b(S*l,t,r)}function E(S,L,A){var O,N,R=0;do N=L+(A-L)/2,O=b(N,t,r)-S,O>0?A=N:L=N;while(Math.abs(O)>s&&++R<o);return N}function C(S){for(var L=0,A=1,O=u-1;A!==O&&v[A]<=S;++A)L+=l;--A;var N=(S-v[A])/(v[A+1]-v[A]),R=L+N*l,I=p(R,t,r);return I>=i?m(S,R):I===0?R:E(S,L,L+l)}var D=!1;function w(){D=!0,(t!==e||r!==n)&&y()}var T=function(L){return D||w(),t===e&&r===n?L:L===0?0:L===1?1:b(C(L),e,n)};T.getControlPoints=function(){return[{x:t,y:e},{x:r,y:n}]};var x=\"generateBezier(\"+[t,e,r,n]+\")\";return T.toString=function(){return x},T}", "function initBuffers() {\n // 3 stk 3D vertekser:\n let trianglePositions = new Float32Array([ //NB! ClockWise!!\n -10, -10, 0, //0\n 0, -5, 0,\n 10, -8, 0,\n -1, -8, 0,\n 3, 4, 0,\n 7, -6, 0,\n -15, -10, 0,\n 0, 5, 0,\n 10, -7, -5,\n 2, 5, 0,\n 5, -7, -5, //10\n\n -25, 9, 0, //11 triangle\n -25, -15, 0,\n -10, 8, -2,\n\n -26, 11, 0, //14 line\n -29, -16, 0,\n\n -30, -25, 0, //16 line\n 6, -20, 0,\n\n -15, -25, 0, //18 LINE_STRIP\n 6, -10, 0,\n 8, -15, 0,\n -15, -25, 0,\n\n -8, -25, 0, //22 TRIANGLE_STRIP\n -6, -10, 0,\n -9, -15, 0,\n\n -15, -20, 0,\n -12, -22, 0,\n\n -9, -30, 0,\n -15, -29, 0,\n\n -12, -18, 0,\n -12, -17, 0, //30\n\n\n ]);\n\n // Verteksbuffer:\n positionBuffer = gl.createBuffer();\n gl.bindBuffer(gl.ARRAY_BUFFER, positionBuffer);\n gl.bufferData(gl.ARRAY_BUFFER, trianglePositions, gl.STATIC_DRAW);\n\n positionBuffer.itemSize = 3; // NB!!\n positionBuffer.numberOfItems = 3; // NB!!\n\n gl.bindBuffer(gl.ARRAY_BUFFER, null);\n}", "createArrayBuffer(floatAry,isStatic,isUnbind){\n\t\tif(isStatic === undefined) isStatic = true; //So we can call this function without setting isStatic\n\n\t\tvar buf = this.ctx.createBuffer();\n\t\tthis.ctx.bindBuffer(this.ctx.ARRAY_BUFFER, buf);\n\t\tthis.ctx.bufferData(this.ctx.ARRAY_BUFFER, floatAry, (isStatic)? this.ctx.STATIC_DRAW : this.ctx.DYNAMIC_DRAW);\n\n\t\tif(isUnbind != false) this.ctx.bindBuffer(this.ctx.ARRAY_BUFFER,null);\n\t\treturn buf;\n\t}", "function rgbeToFloat(buffer, intensity = 1) {\n const texels = buffer.length / 4;\n const floatBuffer = new Float32Array(texels * 3);\n\n const expTable = [];\n for (let i = 0; i < 255; i++) {\n expTable[i] = intensity * Math.pow(2, i - 128) / 255;\n }\n\n for (let i = 0; i < texels; i++) {\n\n const r = buffer[4 * i];\n const g = buffer[4 * i + 1];\n const b = buffer[4 * i + 2];\n const a = buffer[4 * i + 3];\n const e = expTable[a];\n\n floatBuffer[3 * i] = r * e;\n floatBuffer[3 * i + 1] = g * e;\n floatBuffer[3 * i + 2] = b * e;\n }\n\n return floatBuffer;\n }", "function initBuffers2d(gl) {\n\n const positionBuffer = gl.createBuffer();\n gl.bindBuffer(gl.ARRAY_BUFFER, positionBuffer);\n\n var positions = new Float32Array(\n [\n -0.5, -0.5, -0.5,\n -0.5, 0.5, -0.5,\n 0.5, -0.5, -0.5,\n -0.5, 0.5, -0.5,\n 0.5, 0.5, -0.5,\n 0.5, -0.5, -0.5,\n\n -0.5, -0.5, 0.5,\n 0.5, -0.5, 0.5,\n -0.5, 0.5, 0.5,\n -0.5, 0.5, 0.5,\n 0.5, -0.5, 0.5,\n 0.5, 0.5, 0.5,\n\n -0.5, 0.5, -0.5,\n -0.5, 0.5, 0.5,\n 0.5, 0.5, -0.5,\n -0.5, 0.5, 0.5,\n 0.5, 0.5, 0.5,\n 0.5, 0.5, -0.5,\n\n -0.5, -0.5, -0.5,\n 0.5, -0.5, -0.5,\n -0.5, -0.5, 0.5,\n -0.5, -0.5, 0.5,\n 0.5, -0.5, -0.5,\n 0.5, -0.5, 0.5,\n\n -0.5, -0.5, -0.5,\n -0.5, -0.5, 0.5,\n -0.5, 0.5, -0.5,\n -0.5, -0.5, 0.5,\n -0.5, 0.5, 0.5,\n -0.5, 0.5, -0.5,\n\n 0.5, -0.5, -0.5,\n 0.5, 0.5, -0.5,\n 0.5, -0.5, 0.5,\n 0.5, -0.5, 0.5,\n 0.5, 0.5, -0.5,\n 0.5, 0.5, 0.5,\n\n ]);\n gl.bufferData(gl.ARRAY_BUFFER, positions, gl.STATIC_DRAW);\n\n const normalBuffer = gl.createBuffer();\n gl.bindBuffer(gl.ARRAY_BUFFER, normalBuffer);\n const vertexNormals = [\n // Front\n 0.0, 0.0, 1.0,\n 0.0, 0.0, 1.0,\n 0.0, 0.0, 1.0,\n 0.0, 0.0, 1.0,\n 0.0, 0.0, 1.0,\n 0.0, 0.0, 1.0,\n\n // Back\n 0.0, 0.0, -1.0,\n 0.0, 0.0, -1.0,\n 0.0, 0.0, -1.0,\n 0.0, 0.0, -1.0,\n 0.0, 0.0, -1.0,\n 0.0, 0.0, -1.0,\n\n // Top\n 0.0, 1.0, 0.0,\n 0.0, 1.0, 0.0,\n 0.0, 1.0, 0.0,\n 0.0, 1.0, 0.0,\n 0.0, 1.0, 0.0,\n 0.0, 1.0, 0.0,\n\n // Bottom\n 0.0, -1.0, 0.0,\n 0.0, -1.0, 0.0,\n 0.0, -1.0, 0.0,\n 0.0, -1.0, 0.0,\n 0.0, -1.0, 0.0,\n 0.0, -1.0, 0.0,\n\n // Right\n 1.0, 0.0, 0.0,\n 1.0, 0.0, 0.0,\n 1.0, 0.0, 0.0,\n 1.0, 0.0, 0.0,\n 1.0, 0.0, 0.0,\n 1.0, 0.0, 0.0,\n\n // Left\n -1.0, 0.0, 0.0,\n -1.0, 0.0, 0.0,\n -1.0, 0.0, 0.0,\n -1.0, 0.0, 0.0,\n -1.0, 0.0, 0.0,\n -1.0, 0.0, 0.0,\n ];\n gl.bufferData(gl.ARRAY_BUFFER, new Float32Array(vertexNormals),\n gl.STATIC_DRAW);\n\n\n const textureCoordBuffer = gl.createBuffer();\n gl.bindBuffer(gl.ARRAY_BUFFER, textureCoordBuffer);\n let texcoords = [\n 0, 0,\n 0, 1,\n 1, 0,\n 0, 1,\n 1, 1,\n 1, 0,\n\n 0, 0,\n 0, 1,\n 1, 0,\n 1, 0,\n 0, 1,\n 1, 1,\n\n 0, 0,\n 0, 1,\n 1, 0,\n 0, 1,\n 1, 1,\n 1, 0,\n\n 0, 0,\n 0, 1,\n 1, 0,\n 1, 0,\n 0, 1,\n 1, 1,\n\n 0, 0,\n 0, 1,\n 1, 0,\n 0, 1,\n 1, 1,\n 1, 0,\n\n 0, 0,\n 0, 1,\n 1, 0,\n 1, 0,\n 0, 1,\n 1, 1,\n ]\n gl.bufferData( gl.ARRAY_BUFFER, new Float32Array(texcoords), gl.STATIC_DRAW);\n\n let offsets = [];\n let colors = [];\n let index = [];\n for (let i = 0; i < SIDE; i++) {\n const x = (-SIDE + 1) * 3 / 2 + i * 3;\n for (let j = 0; j < SIDE; j++) {\n const y = (-SIDE + 1) * 3 / 2 + j * 3;\n offsets.push(x, y, 0.0);\n let color = Math.random() * 0.75 + 0.25\n colors.push(Math.random() * 0.75 + 0.25, Math.random() * 0.75 + 0.25, color, 1.0)\n index.push(i/SIDE,j/SIDE)\n }\n }\n\n const instanceOffsets = gl.createBuffer();\n gl.bindBuffer(gl.ARRAY_BUFFER, instanceOffsets);\n gl.bufferData(gl.ARRAY_BUFFER, new Float32Array(offsets), gl.STATIC_DRAW);\n\n const instanceColors = gl.createBuffer();\n gl.bindBuffer(gl.ARRAY_BUFFER, instanceColors);\n gl.bufferData(gl.ARRAY_BUFFER, new Float32Array(colors), gl.STATIC_DRAW);\n\n const instanceIndex = gl.createBuffer();\n gl.bindBuffer(gl.ARRAY_BUFFER, instanceIndex);\n gl.bufferData(gl.ARRAY_BUFFER, new Float32Array(index), gl.STATIC_DRAW);\n\n //const colors = new Float32Array(SIDE * SIDE * 4).map(\n //() => Math.random() * 0.75 + 0.25\n //);\n\n const animatedImageTexture = initVideoTexture(gl);\n\n return {\n vertexCount: positions.length / 3,\n positions: positionBuffer,\n textureCoord: textureCoordBuffer,\n normals: normalBuffer,\n instanceOffsets,\n instanceColors,\n instanceIndex,\n animatedImageTexture,\n };\n}", "function VertexColorArray (size) {\n return new Float32Array(size * 4)\n}", "function readFloat(){\n checkLen(4);\n var flt = buf.readFloatLE(pos);\n pos += 4;\n return formSinglePrecision(flt);\n }", "function resizeBuffer (oldBuffer, newSize) {\n const newBuffer = new Float32Array(newSize);\n newBuffer.set(oldBuffer);\n return newBuffer;\n}", "function resizeBuffer (oldBuffer, newSize) {\n const newBuffer = new Float32Array(newSize);\n newBuffer.set(oldBuffer);\n return newBuffer;\n}", "function initVertexBuffers(gl) {\r\n // Coordinates(Cube which length of one side is 1 with the origin on the center of the bottom)\r\n var vertices = new Float32Array([\r\n 0.5, 1.0, 0.5, -0.5, 1.0, 0.5, -0.5, 0.0, 0.5, 0.5, 0.0, 0.5, // v0-v1-v2-v3 front\r\n 0.5, 1.0, 0.5, 0.5, 0.0, 0.5, 0.5, 0.0,-0.5, 0.5, 1.0,-0.5, // v0-v3-v4-v5 right\r\n 0.5, 1.0, 0.5, 0.5, 1.0,-0.5, -0.5, 1.0,-0.5, -0.5, 1.0, 0.5, // v0-v5-v6-v1 up\r\n -0.5, 1.0, 0.5, -0.5, 1.0,-0.5, -0.5, 0.0,-0.5, -0.5, 0.0, 0.5, // v1-v6-v7-v2 left\r\n -0.5, 0.0,-0.5, 0.5, 0.0,-0.5, 0.5, 0.0, 0.5, -0.5, 0.0, 0.5, // v7-v4-v3-v2 down\r\n 0.5, 0.0,-0.5, -0.5, 0.0,-0.5, -0.5, 1.0,-0.5, 0.5, 1.0,-0.5 // v4-v7-v6-v5 back\r\n ]);\r\n\r\n // Normal\r\n var normals = new Float32Array([\r\n 0.0, 0.0, 1.0, 0.0, 0.0, 1.0, 0.0, 0.0, 1.0, 0.0, 0.0, 1.0, // v0-v1-v2-v3 front\r\n 1.0, 0.0, 0.0, 1.0, 0.0, 0.0, 1.0, 0.0, 0.0, 1.0, 0.0, 0.0, // v0-v3-v4-v5 right\r\n 0.0, 1.0, 0.0, 0.0, 1.0, 0.0, 0.0, 1.0, 0.0, 0.0, 1.0, 0.0, // v0-v5-v6-v1 up\r\n -1.0, 0.0, 0.0, -1.0, 0.0, 0.0, -1.0, 0.0, 0.0, -1.0, 0.0, 0.0, // v1-v6-v7-v2 left\r\n 0.0,-1.0, 0.0, 0.0,-1.0, 0.0, 0.0,-1.0, 0.0, 0.0,-1.0, 0.0, // v7-v4-v3-v2 down\r\n 0.0, 0.0,-1.0, 0.0, 0.0,-1.0, 0.0, 0.0,-1.0, 0.0, 0.0,-1.0 // v4-v7-v6-v5 back\r\n ]);\r\n\r\n // Indices of the vertices\r\n var indices = new Uint8Array([\r\n 0, 1, 2, 0, 2, 3, // front\r\n 4, 5, 6, 4, 6, 7, // right\r\n 8, 9,10, 8,10,11, // up\r\n 12,13,14, 12,14,15, // left\r\n 16,17,18, 16,18,19, // down\r\n 20,21,22, 20,22,23 // back\r\n ]);\r\n\r\n // Write the vertex property to buffers (coordinates and normals)\r\n if (!initArrayBuffer(gl, 'a_Position', vertices, gl.FLOAT, 3)) return -1;\r\n if (!initArrayBuffer(gl, 'a_Normal', normals, gl.FLOAT, 3)) return -1;\r\n\r\n // Unbind the buffer object\r\n gl.bindBuffer(gl.ARRAY_BUFFER, null);\r\n\r\n // Write the indices to the buffer object\r\n var indexBuffer = gl.createBuffer();\r\n if (!indexBuffer) {\r\n console.log('Failed to create the buffer object');\r\n return -1;\r\n }\r\n gl.bindBuffer(gl.ELEMENT_ARRAY_BUFFER, indexBuffer);\r\n gl.bufferData(gl.ELEMENT_ARRAY_BUFFER, indices, gl.STATIC_DRAW);\r\n\r\n return indices.length;\r\n}", "initializeArrays()\n {\n this.vertices = [];\n this.colors = [];\n this.indices = [];\n this.normals = [];\n this.verticesBuffer = null;\n this.colorsBuffer = null;\n this.indicesBuffer = null;\n this.normalsBuffer = null;\n }", "function TextureCoordinatesArray (count) {\n let ar = new Float32Array(count * BOX_LENGTH) \n\n for (var i = 0, len = ar.length; i < len; i += BOX_LENGTH) {\n setBox(ar, i, 1, 1, 0, 0)\n } \n return ar\n}", "static mul(mat1, mat2)\n\t{\n\t\tvar result = [];\n\t\tfor (var row=0; row<4; ++row) { //row of result\n\t\t\tfor (var col=0; col<4; ++col) { //col of result\n\t\t\t\tresult.push(Matrix.mul_helper(row, col, mat1, mat2));\n\t\t\t}\n\t\t}\n\t\treturn new Float32Array(result);\n\t}", "function generateFloat32Randoms(w, h, n, max = 1, min = 0) {\n var randoms = new Float32Array(w * h * n);\n var range = max - min;\n var mid = min + range / 2;\n for (var i = 0; i < w * h * n; i++) {\n randoms[i] = Math.random() * range + min;\n }\n return randoms;\n }", "positionInfoArray(){\r\n\r\n var info = new Float32Array(\r\n this.bullets.length > 0 ?\r\n this.bullets.length * 3 :\r\n 3\r\n );\r\n\r\n for ( let i = 0; i < this.bullets.length; i++ ){\r\n info[i*3] = this.bullets[i].x;\r\n info[i*3+1] = this.bullets[i].y;\r\n info[i*3+2] = this.bullets[i].z;\r\n }\r\n\r\n return info;\r\n }", "loadTriangleStripIndices(jsntsis) {\n//-----------------------\nreturn this.triStripIndices = new Uint16Array(jsntsis);\n}" ]
[ "0.7301188", "0.7209965", "0.69897056", "0.6968867", "0.6805486", "0.6755758", "0.6741204", "0.6690487", "0.66401666", "0.6595015", "0.6564376", "0.65474814", "0.653853", "0.6511759", "0.64967626", "0.64861786", "0.64791584", "0.64246136", "0.64054227", "0.63486075", "0.6347872", "0.63149923", "0.6269378", "0.62260914", "0.61561733", "0.61131287", "0.6090871", "0.60540146", "0.60442954", "0.6015572", "0.5988324", "0.596127", "0.59504014", "0.5878945", "0.58399385", "0.57995707", "0.5777822", "0.57694435", "0.570175", "0.5699476", "0.5617637", "0.5614976", "0.5571423", "0.5556561", "0.55384207", "0.55300254", "0.55145204", "0.55042744", "0.5501864", "0.54909885", "0.549018", "0.5483683", "0.5483683", "0.54585636", "0.54270625", "0.5405091", "0.5404915", "0.5357972", "0.53537863", "0.5341204", "0.5325705", "0.53171945", "0.5282928", "0.52781034", "0.5271453", "0.5266094", "0.5255596", "0.52554286", "0.52541167", "0.52371776", "0.5214476", "0.5211858", "0.52014077", "0.5190965", "0.518625", "0.51724255", "0.51724255", "0.51668125", "0.51660115", "0.51637906", "0.51562285", "0.51454395", "0.5139317", "0.51280177", "0.51235896", "0.5119505", "0.5108397", "0.51070637", "0.50936425", "0.50554335", "0.5047961", "0.50372344", "0.50312746", "0.50312746", "0.5025567", "0.50246984", "0.50024253", "0.49911848", "0.49887198", "0.4987553", "0.49718368" ]
0.0
-1
v8 likes predictible objects
function Item(fun, array) { this.fun = fun; this.array = array; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function compareLike(a,b){\n var al = a.idLikesProp.length;\n var bl = b.idLikesProp.length;\n if(al > bl) return -1;\n if(bl > al) return 1;\n return 0;\n}", "function lookAround() {\n var objectDescription = \"\"\n tj.see().then(function(objects) {\n objects.forEach(function(each) {\n if (each.score >= 0.4) {\n objectDescription = objectDescription + \", \" + each.class\n }\n })\n tj.speak(\"The objects I see are: \" + objectDescription)\n });\n}", "function recommendNewPosts() {\n model.loadModel();\n getNewPosts(function (err, posts) {\n var label\n ;\n posts.forEach(function (post) {\n label = model.classifyPost(post);\n if (label == 'like') {\n console.log(post);\n }\n });\n });\n }", "function BOT_onLike() {\r\n\tBOT_traceString += \"GOTO command judge\" + \"\\n\"; // change performative\r\n\tBOT_theReqJudgement = \"likeable\";\r\n\tBOT_onJudge(); \t\r\n\tif(BOT_reqSuccess) {\r\n\t\tvar ta = [BOT_theReqTopic,BOT_theReqAttribute]; \r\n\t\tBOT_del(BOT_theUserTopicId,\"distaste\",\"VAL\",ta);\r\n\t\tBOT_add(BOT_theUserTopicId,\"preference\",\"VAL\",ta);\r\n\t}\r\n}", "function like (data, archetype) {\n var name;\n\n for (name in archetype) {\n if (archetype.hasOwnProperty(name)) {\n if (data.hasOwnProperty(name) === false || typeof data[name] !== typeof archetype[name]) {\n return false;\n }\n\n if (object(data[name]) && like(data[name], archetype[name]) === false) {\n return false;\n }\n }\n }\n\n return true;\n }", "function LanguageUnderstandingModel() {\n }", "function guess() {\n classifier.predict(video.elt, 5, gotResult);\n}", "function theBigBang() {\n\t\tinitLibs();\n\t\tinitFuncs();\n\t\tObject.setPrototypeOf(Universe.prototype, universe.kjsclasses._primitive_prototype);\n\t\tObject.setPrototypeOf(Object.prototype, universe); // [0]\n\t}", "function readOwn(obj, name, pumpkin) {\n if (typeof obj !== 'object' || !obj) {\n if (typeOf(obj) !== 'object') {\n return pumpkin;\n }\n }\n if (typeof name === 'number' && name >= 0) {\n if (myOriginalHOP.call(obj, name)) { return obj[name]; }\n return pumpkin;\n }\n name = String(name);\n if (obj[name + '_canRead___'] === obj) { return obj[name]; }\n if (!myOriginalHOP.call(obj, name)) { return pumpkin; }\n // inline remaining relevant cases from canReadPub\n if (endsWith__.test(name)) { return pumpkin; }\n if (name === 'toString') { return pumpkin; }\n if (!isJSONContainer(obj)) { return pumpkin; }\n fastpathRead(obj, name);\n return obj[name];\n }", "function a(e,t,n){(n?Reflect.getOwnMetadataKeys(t,n):Reflect.getOwnMetadataKeys(t)).forEach(function(r){var i=n?Reflect.getOwnMetadata(r,t,n):Reflect.getOwnMetadata(r,t);n?Reflect.defineMetadata(r,i,e,n):Reflect.defineMetadata(r,i,e)})}", "function NXObject() {}", "function isPrimative(val) { return (typeof val !== 'object') }", "function like (data, duck) {\n var name;\n\n assert.object(data);\n assert.object(duck);\n\n for (name in duck) {\n if (duck.hasOwnProperty(name)) {\n if (data.hasOwnProperty(name) === false || typeof data[name] !== typeof duck[name]) {\n return false;\n }\n\n if (object(data[name]) && like(data[name], duck[name]) === false) {\n return false;\n }\n }\n }\n\n return true;\n }", "static get observedAttributes() {\n return ['rainbow', 'lang'];\n }", "function a(e,t,n){(n?Reflect.getOwnMetadataKeys(t,n):Reflect.getOwnMetadataKeys(t)).forEach((function(r){var i=n?Reflect.getOwnMetadata(r,t,n):Reflect.getOwnMetadata(r,t);n?Reflect.defineMetadata(r,i,e,n):Reflect.defineMetadata(r,i,e)}))}", "function testSimpleHole_prototype() {\n var theHole = Object.create({ x: \"in proto\" });\n var theReplacement = \"yay\";\n var serialized = bidar.serialize(theHole, holeFilter);\n var parsed = bidar.parse(serialized, holeFiller);\n\n assert.equal(parsed, theReplacement);\n\n function holeFilter(x) {\n assert.equal(x, theHole);\n return { data: \"blort\" };\n }\n\n function holeFiller(x) {\n assert.equal(x, \"blort\");\n return theReplacement;\n }\n}", "function test() {\n\t// \"ex nihilo\" object creation using the literal\n\t// object notation {}.\n\tvar foo = {\n\t\tname : \"foo\",\n\t\tone : 1,\n\t\ttwo : 2\n\t};\n\n\t// Another \"ex nihilo\" object.\n\tvar bar = {\n\t\ttwo : \"two\",\n\t\tthree : 3\n\t};\n\n\t// Gecko and Webkit JavaScript engines can directly\n\t// manipulate the internal prototype link.\n\t// For the sake of simplicity, let us pretend\n\t// that the following line works regardless of the\n\t// engine used:\n\tbar.__proto__ = foo; // foo is now the prototype of bar.\n\n\t// If we try to access foo's properties from bar\n\t// from now on, we'll succeed.\n\tlog(bar.one) // Resolves to 1.\n\n\t// The child object's properties are also accessible.\n\tlog(bar.three) // Resolves to 3.\n\n\t// Own properties shadow prototype properties\n\tlog(bar.two); // Resolves to \"two\"\n\tlog(foo.name); // unaffected, resolves to \"foo\"\n\tlog(bar.name); // Resolves to \"foo\"\n log(foo.__proto__);\n}", "function wrappedPrimitivePreviewer(className, classObj, objectActor, grip) {\r\n let {_obj} = objectActor;\r\n\r\n if (!_obj.proto || _obj.proto.class != className) {\r\n return false;\r\n }\r\n\r\n let raw = _obj.unsafeDereference();\r\n let v = null;\r\n try {\r\n v = classObj.prototype.valueOf.call(raw);\r\n } catch (ex) {\r\n // valueOf() can throw if the raw JS object is \"misbehaved\".\r\n return false;\r\n }\r\n\r\n if (v === null) {\r\n return false;\r\n }\r\n\r\n let canHandle = GenericObject(objectActor, grip, className === \"String\");\r\n if (!canHandle) {\r\n return false;\r\n }\r\n\r\n grip.preview.wrappedValue = objectActor.getGrip(makeDebuggeeValueIfNeeded(_obj, v));\r\n return true;\r\n}", "function DartObject(o) {\n this.o = o;\n}", "function i(t,e,n){(n?Reflect.getOwnMetadataKeys(e,n):Reflect.getOwnMetadataKeys(e)).forEach(function(r){var o=n?Reflect.getOwnMetadata(r,e,n):Reflect.getOwnMetadata(r,e);n?Reflect.defineMetadata(r,o,t,n):Reflect.defineMetadata(r,o,t)})}", "function i(t,e,n){(n?Reflect.getOwnMetadataKeys(e,n):Reflect.getOwnMetadataKeys(e)).forEach(function(r){var o=n?Reflect.getOwnMetadata(r,e,n):Reflect.getOwnMetadata(r,e);n?Reflect.defineMetadata(r,o,t,n):Reflect.defineMetadata(r,o,t)})}", "function likeVsLikes(toyLikeCount){\n\t\tif (toyLikeCount == 1){\n\t\t\treturn 'Like';\n\t\t} else {\n\t\t\treturn 'Likes';\n\t\t}\n\t}", "constructor(spec) {\n this.cached = /* @__PURE__ */ Object.create(null);\n let instanceSpec = this.spec = {};\n for (let prop in spec)\n instanceSpec[prop] = spec[prop];\n instanceSpec.nodes = OrderedMap.from(spec.nodes), instanceSpec.marks = OrderedMap.from(spec.marks || {}), this.nodes = NodeType$1.compile(this.spec.nodes, this);\n this.marks = MarkType.compile(this.spec.marks, this);\n let contentExprCache = /* @__PURE__ */ Object.create(null);\n for (let prop in this.nodes) {\n if (prop in this.marks)\n throw new RangeError(prop + \" can not be both a node and a mark\");\n let type = this.nodes[prop], contentExpr = type.spec.content || \"\", markExpr = type.spec.marks;\n type.contentMatch = contentExprCache[contentExpr] || (contentExprCache[contentExpr] = ContentMatch.parse(contentExpr, this.nodes));\n type.inlineContent = type.contentMatch.inlineContent;\n type.markSet = markExpr == \"_\" ? null : markExpr ? gatherMarks(this, markExpr.split(\" \")) : markExpr == \"\" || !type.inlineContent ? [] : null;\n }\n for (let prop in this.marks) {\n let type = this.marks[prop], excl = type.spec.excludes;\n type.excluded = excl == null ? [type] : excl == \"\" ? [] : gatherMarks(this, excl.split(\" \"));\n }\n this.nodeFromJSON = this.nodeFromJSON.bind(this);\n this.markFromJSON = this.markFromJSON.bind(this);\n this.topNodeType = this.nodes[this.spec.topNode || \"doc\"];\n this.cached.wrappings = /* @__PURE__ */ Object.create(null);\n }", "wordClass(word) {\r\n return {\r\n der: word.artikel == \"der\",\r\n die: word.artikel == \"die\",\r\n das: word.artikel == \"das\",\r\n marked: word.marker\r\n }\r\n }", "function dummyObjects(name, age){\n this.name = name\n this.age = age\n}", "function handleLikes() {\n // Get a random number\n let randomNumber = Math.random();\n // To make it unpredictable, only change the likes if =>\n if (randomNumber < REVEAL_PROBABILITY) {\n defineLikes();\n }\n}", "constructor() { \n \n Like.initialize(this);\n }", "like() {\r\n return this.clone(Comment, \"Like\").postCore();\r\n }", "like() {\r\n return this.getItem().then(i => {\r\n return i.like();\r\n });\r\n }", "added(vrobject){}", "classify(phrase) { return this.clf.classify(phrase) }", "function badIdea(){\n this.idea = \"bad\";\n}", "shouldSerialize(prop, dataKey) {\n const contains = (str, re) => (str.match(re) || []).length > 0;\n const a = contains(dataKey, /\\./g);\n const b = contains(dataKey, /\\[/g);\n return !!prop.object && !(a || b);\n }", "static get observedAttributes(){this.finalize();const e=[];// Use forEach so this works even if for/of loops are compiled to for loops\n// expecting arrays\nreturn this._classProperties.forEach((t,n)=>{const r=this._attributeNameForProperty(n,t);void 0!==r&&(this._attributeToPropertyMap.set(r,n),e.push(r))}),e}", "function oldAndLoud(object){\n\tobject.age++;\n\tobject.name = object.name.toUpperCase();\n}", "like() {\r\n return this.clone(Item, \"like\").postCore();\r\n }", "function classifyPose() {\n if (pose && working) {\n inputs = [];\n for (let i = 0; i < pose.landmarks.length; i++) {\n inputs.push(pose.landmarks[i][0]);\n inputs.push(pose.landmarks[i][1]);\n inputs.push(pose.landmarks[i][2]);\n }\n brain.classify(inputs, gotResult)\n }\n }", "function PropertyDetection() {}", "constructor()\n {\n this.likes = [];\n }", "async TestLikeDoctorPost(){\n var response = await entity.Likes(6,28,true,true);\n //console.log(response)\n if(response != null){\n console.log(\"\\x1b[32m%s\\x1b[0m\",\"TestDOctorRating Passed\");\n }else{\n console.log(\"\\x1b[31m%s\\x1b[0m\",\"TestDOctorRating Failed\");\n }\n\n }", "function classifyVideo() {\n classifier.predict(gotResult);\n}", "function classifyVideo() {\n classifier.predict(gotResult);\n}", "function classifyVideo() {\n classifier.predict(gotResult);\n}", "function showLikes(likes) {\n\tconsole.log(`THINGS I LIKE:\\n`);\n\tfor(let like of likes) {\n\t\tconsole.log(like);\n\t}\n}", "function protoAugment(target,src,keys){/* eslint-disable no-proto */target.__proto__=src;/* eslint-enable no-proto */}", "function protoAugment(target,src,keys){/* eslint-disable no-proto */target.__proto__=src;/* eslint-enable no-proto */}", "function Nevis() {}", "function Nevis() {}", "function Nevis() {}", "test_primitivesExtended() {\n let translator = new Translator();\n translator.registerPackage(PackageFile);\n let text = JSON.stringify(this.json.primitivesExtended);\n let object = translator.decode(text).getRoot();\n Assert.equals(\"ca.frar.jjjrmi.translator.testclasses.PrimitivesExtended\", object.constructor.__getClass());\n Assert.equals(\"alpha16\", object.string);\n }", "function buildObjectsObj(gCloudV, azureCV, minScore = 0.0){\n let objects = [];\n\n if(gCloudV) {// gcloud vision results are available\n let gCloudObjects = gCloudV['localizedObjectAnnotations'];\n\n //apply standard bounding box to all the detected objects\n if(azureCV)// azure computer vision results are available\n gCloudVObjsToCogniBoundingBox(gCloudObjects, azureCV['metadata']['width'], azureCV['metadata']['height']);\n\n else//need to retrieve image sizes from gcloud (already done and put in the metadata tag of gcloudv with appropriate calls)\n gCloudVObjsToCogniBoundingBox(gCloudObjects, gCloudV['metadata']['width'], gCloudV['metadata']['height']);\n\n for (let gCloudObj of gCloudObjects) {\n if (gCloudObj['score'] > minScore) { //filter out unwanted tags\n objects.push({\n name: gCloudObj['name'],\n mid: (gCloudObj['mid'] && gCloudObj['mid']!= '')? gCloudObj['mid']: undefined,\n confidence: gCloudObj['score'],\n boundingBox: gCloudObj['boundingBox']\n });\n }\n }\n }\n\n if(azureCV){// azure computer vision results are available\n let azureObjects = azureCV['objects'];\n //apply standard bounding box to all the detected objects\n azureCVObjsToCogniBoundingBox(azureObjects, azureCV['metadata']['width'], azureCV['metadata']['height']);\n for(let aObj of azureObjects){\n if(aObj['confidence'] > minScore) { //filter out unwanted tags\n objects.push({\n name: aObj['object'],\n confidence: aObj['confidence'],\n boundingBox: aObj['boundingBox']\n });\n }\n }\n }\n\n objects = combineObjectsArray(objects);// build an array where labels regarding the same exact object are combined with averaged confidence\n\n objects.sort((a, b) => {\n if(a['confidence']>b['confidence'])\n return -1;\n else if(a['confidence']==b['confidence'])\n return 0;\n else\n return 1;\n });\n\n return objects;\n}", "function V(e){if(null===e||\"[object Object]\"!==function(e){return Object.prototype.toString.call(e)}(e))return!1;var t=Object.getPrototypeOf(e);return null===t||t===Object.prototype}", "function classifyVideo() {\r\n classifier.classify(vid, gotResult);\r\n\r\n}", "function test_nountag_does_not_think_it_has_watch_tag_when_it_does_not() {\n Assert.equal(TagNoun.fromJSON(\"watch\"), undefined);\n}", "function v11(v12,v13) {\n const v15 = v11(Object,Function);\n // v15 = .unknown\n const v16 = Object(v13,v8,0,v6);\n // v16 = .object()\n const v17 = 0;\n // v17 = .integer\n const v18 = 1;\n // v18 = .integer\n const v19 = 512;\n // v19 = .integer\n const v20 = \"-1024\";\n // v20 = .string + .object(ofGroup: String, withProperties: [\"constructor\", \"__proto__\", \"length\"], withMethods: [\"padEnd\", \"split\", \"charAt\", \"match\", \"lastIndexOf\", \"charCodeAt\", \"trim\", \"startsWith\", \"includes\", \"repeat\", \"search\", \"slice\", \"endsWith\", \"matchAll\", \"indexOf\", \"concat\", \"replace\", \"padStart\", \"substring\", \"codePointAt\"])\n const v21 = isFinite;\n // v21 = .function([.anything] => .boolean)\n const v23 = [1337];\n // v23 = .object(ofGroup: Array, withProperties: [\"length\", \"__proto__\", \"constructor\"], withMethods: [\"concat\", \"fill\", \"indexOf\", \"entries\", \"forEach\", \"find\", \"reverse\", \"slice\", \"flat\", \"reduce\", \"join\", \"findIndex\", \"reduceRight\", \"some\", \"copyWithin\", \"toString\", \"pop\", \"filter\", \"map\", \"splice\", \"keys\", \"unshift\", \"sort\", \"includes\", \"flatMap\", \"shift\", \"values\", \"every\", \"toLocaleString\", \"push\", \"lastIndexOf\"])\n const v24 = {};\n // v24 = .object(ofGroup: Object, withProperties: [\"__proto__\"])\n let v25 = v23;\n const v26 = -29897853;\n // v26 = .integer\n const v27 = \"replace\";\n // v27 = .string + .object(ofGroup: String, withProperties: [\"constructor\", \"__proto__\", \"length\"], withMethods: [\"padEnd\", \"split\", \"charAt\", \"match\", \"lastIndexOf\", \"charCodeAt\", \"trim\", \"startsWith\", \"includes\", \"repeat\", \"search\", \"slice\", \"endsWith\", \"matchAll\", \"indexOf\", \"concat\", \"replace\", \"padStart\", \"substring\", \"codePointAt\"])\n const v28 = Boolean;\n // v28 = .object(ofGroup: BooleanConstructor, withProperties: [\"prototype\"]) + .function([.anything] => .boolean) + .constructor([.anything] => .boolean)\n const v30 = [13.37,13.37];\n // v30 = .object(ofGroup: Array, withProperties: [\"length\", \"__proto__\", \"constructor\"], withMethods: [\"concat\", \"fill\", \"indexOf\", \"entries\", \"forEach\", \"find\", \"reverse\", \"slice\", \"flat\", \"reduce\", \"join\", \"findIndex\", \"reduceRight\", \"some\", \"copyWithin\", \"toString\", \"pop\", \"filter\", \"map\", \"splice\", \"keys\", \"unshift\", \"sort\", \"includes\", \"flatMap\", \"shift\", \"values\", \"every\", \"toLocaleString\", \"push\", \"lastIndexOf\"])\n const v31 = 1337;\n // v31 = .integer\n let v32 = 13.37;\n const v36 = [13.37,13.37,13.37];\n // v36 = .object(ofGroup: Array, withProperties: [\"length\", \"__proto__\", \"constructor\"], withMethods: [\"concat\", \"fill\", \"indexOf\", \"entries\", \"forEach\", \"find\", \"reverse\", \"slice\", \"flat\", \"reduce\", \"join\", \"findIndex\", \"reduceRight\", \"some\", \"copyWithin\", \"toString\", \"pop\", \"filter\", \"map\", \"splice\", \"keys\", \"unshift\", \"sort\", \"includes\", \"flatMap\", \"shift\", \"values\", \"every\", \"toLocaleString\", \"push\", \"lastIndexOf\"])\n const v38 = [1337,1337];\n // v38 = .object(ofGroup: Array, withProperties: [\"length\", \"__proto__\", \"constructor\"], withMethods: [\"concat\", \"fill\", \"indexOf\", \"entries\", \"forEach\", \"find\", \"reverse\", \"slice\", \"flat\", \"reduce\", \"join\", \"findIndex\", \"reduceRight\", \"some\", \"copyWithin\", \"toString\", \"pop\", \"filter\", \"map\", \"splice\", \"keys\", \"unshift\", \"sort\", \"includes\", \"flatMap\", \"shift\", \"values\", \"every\", \"toLocaleString\", \"push\", \"lastIndexOf\"])\n const v39 = [13.37,1337,v38,1337,\"-128\",13.37,\"-128\",\"-128\",2147483647,1337];\n // v39 = .object(ofGroup: Array, withProperties: [\"length\", \"__proto__\", \"constructor\"], withMethods: [\"concat\", \"fill\", \"indexOf\", \"entries\", \"forEach\", \"find\", \"reverse\", \"slice\", \"flat\", \"reduce\", \"join\", \"findIndex\", \"reduceRight\", \"some\", \"copyWithin\", \"toString\", \"pop\", \"filter\", \"map\", \"splice\", \"keys\", \"unshift\", \"sort\", \"includes\", \"flatMap\", \"shift\", \"values\", \"every\", \"toLocaleString\", \"push\", \"lastIndexOf\"])\n const v40 = {__proto__:v36,length:v39};\n // v40 = .object(ofGroup: Object, withProperties: [\"__proto__\", \"length\"])\n const v41 = \"0\";\n // v41 = .string + .object(ofGroup: String, withProperties: [\"constructor\", \"__proto__\", \"length\"], withMethods: [\"padEnd\", \"split\", \"charAt\", \"match\", \"lastIndexOf\", \"charCodeAt\", \"trim\", \"startsWith\", \"includes\", \"repeat\", \"search\", \"slice\", \"endsWith\", \"matchAll\", \"indexOf\", \"concat\", \"replace\", \"padStart\", \"substring\", \"codePointAt\"])\n const v42 = -4130093409;\n // v42 = .integer\n const v44 = {b:2147483647,e:v38,valueOf:v36};\n // v44 = .object(ofGroup: Object, withProperties: [\"__proto__\", \"b\", \"valueOf\", \"e\"])\n const v45 = \"k**baeaDif\";\n // v45 = .string + .object(ofGroup: String, withProperties: [\"constructor\", \"__proto__\", \"length\"], withMethods: [\"padEnd\", \"split\", \"charAt\", \"match\", \"lastIndexOf\", \"charCodeAt\", \"trim\", \"startsWith\", \"includes\", \"repeat\", \"search\", \"slice\", \"endsWith\", \"matchAll\", \"indexOf\", \"concat\", \"replace\", \"padStart\", \"substring\", \"codePointAt\"])\n const v46 = 65536;\n // v46 = .integer\n const v47 = \"k**baeaDif\";\n // v47 = .string + .object(ofGroup: String, withProperties: [\"constructor\", \"__proto__\", \"length\"], withMethods: [\"padEnd\", \"split\", \"charAt\", \"match\", \"lastIndexOf\", \"charCodeAt\", \"trim\", \"startsWith\", \"includes\", \"repeat\", \"search\", \"slice\", \"endsWith\", \"matchAll\", \"indexOf\", \"concat\", \"replace\", \"padStart\", \"substring\", \"codePointAt\"])\n const v48 = 13.37;\n // v48 = .float\n const v50 = [13.37,13.37];\n // v50 = .object(ofGroup: Array, withProperties: [\"length\", \"__proto__\", \"constructor\"], withMethods: [\"concat\", \"fill\", \"indexOf\", \"entries\", \"forEach\", \"find\", \"reverse\", \"slice\", \"flat\", \"reduce\", \"join\", \"findIndex\", \"reduceRight\", \"some\", \"copyWithin\", \"toString\", \"pop\", \"filter\", \"map\", \"splice\", \"keys\", \"unshift\", \"sort\", \"includes\", \"flatMap\", \"shift\", \"values\", \"every\", \"toLocaleString\", \"push\", \"lastIndexOf\"])\n const v51 = ~v50;\n // v51 = .boolean\n const v53 = [13.37];\n // v53 = .object(ofGroup: Array, withProperties: [\"length\", \"__proto__\", \"constructor\"], withMethods: [\"concat\", \"fill\", \"indexOf\", \"entries\", \"forEach\", \"find\", \"reverse\", \"slice\", \"flat\", \"reduce\", \"join\", \"findIndex\", \"reduceRight\", \"some\", \"copyWithin\", \"toString\", \"pop\", \"filter\", \"map\", \"splice\", \"keys\", \"unshift\", \"sort\", \"includes\", \"flatMap\", \"shift\", \"values\", \"every\", \"toLocaleString\", \"push\", \"lastIndexOf\"])\n let v54 = v53;\n const v55 = gc;\n // v55 = .function([] => .undefined)\n const v58 = [13.37,13.37,13.37,13.37];\n // v58 = .object(ofGroup: Array, withProperties: [\"length\", \"__proto__\", \"constructor\"], withMethods: [\"concat\", \"fill\", \"indexOf\", \"entries\", \"forEach\", \"find\", \"reverse\", \"slice\", \"flat\", \"reduce\", \"join\", \"findIndex\", \"reduceRight\", \"some\", \"copyWithin\", \"toString\", \"pop\", \"filter\", \"map\", \"splice\", \"keys\", \"unshift\", \"sort\", \"includes\", \"flatMap\", \"shift\", \"values\", \"every\", \"toLocaleString\", \"push\", \"lastIndexOf\"])\n const v60 = [1337,1337,1337,1337];\n // v60 = .object(ofGroup: Array, withProperties: [\"length\", \"__proto__\", \"constructor\"], withMethods: [\"concat\", \"fill\", \"indexOf\", \"entries\", \"forEach\", \"find\", \"reverse\", \"slice\", \"flat\", \"reduce\", \"join\", \"findIndex\", \"reduceRight\", \"some\", \"copyWithin\", \"toString\", \"pop\", \"filter\", \"map\", \"splice\", \"keys\", \"unshift\", \"sort\", \"includes\", \"flatMap\", \"shift\", \"values\", \"every\", \"toLocaleString\", \"push\", \"lastIndexOf\"])\n const v61 = [3697200800,v58,v60];\n // v61 = .object(ofGroup: Array, withProperties: [\"length\", \"__proto__\", \"constructor\"], withMethods: [\"concat\", \"fill\", \"indexOf\", \"entries\", \"forEach\", \"find\", \"reverse\", \"slice\", \"flat\", \"reduce\", \"join\", \"findIndex\", \"reduceRight\", \"some\", \"copyWithin\", \"toString\", \"pop\", \"filter\", \"map\", \"splice\", \"keys\", \"unshift\", \"sort\", \"includes\", \"flatMap\", \"shift\", \"values\", \"every\", \"toLocaleString\", \"push\", \"lastIndexOf\"])\n const v62 = {__proto__:3697200800,constructor:1337,e:3697200800,length:13.37,toString:3697200800,valueOf:v61};\n // v62 = .object(ofGroup: Object, withProperties: [\"e\", \"__proto__\", \"length\", \"constructor\", \"toString\", \"valueOf\"])\n const v65 = [13.37,13.37,13.37,13.37];\n // v65 = .object(ofGroup: Array, withProperties: [\"length\", \"__proto__\", \"constructor\"], withMethods: [\"concat\", \"fill\", \"indexOf\", \"entries\", \"forEach\", \"find\", \"reverse\", \"slice\", \"flat\", \"reduce\", \"join\", \"findIndex\", \"reduceRight\", \"some\", \"copyWithin\", \"toString\", \"pop\", \"filter\", \"map\", \"splice\", \"keys\", \"unshift\", \"sort\", \"includes\", \"flatMap\", \"shift\", \"values\", \"every\", \"toLocaleString\", \"push\", \"lastIndexOf\"])\n const v67 = [1337,1337,1337,1337];\n // v67 = .object(ofGroup: Array, withProperties: [\"length\", \"__proto__\", \"constructor\"], withMethods: [\"concat\", \"fill\", \"indexOf\", \"entries\", \"forEach\", \"find\", \"reverse\", \"slice\", \"flat\", \"reduce\", \"join\", \"findIndex\", \"reduceRight\", \"some\", \"copyWithin\", \"toString\", \"pop\", \"filter\", \"map\", \"splice\", \"keys\", \"unshift\", \"sort\", \"includes\", \"flatMap\", \"shift\", \"values\", \"every\", \"toLocaleString\", \"push\", \"lastIndexOf\"])\n const v68 = [3697200800,v65,v67];\n // v68 = .object(ofGroup: Array, withProperties: [\"length\", \"__proto__\", \"constructor\"], withMethods: [\"concat\", \"fill\", \"indexOf\", \"entries\", \"forEach\", \"find\", \"reverse\", \"slice\", \"flat\", \"reduce\", \"join\", \"findIndex\", \"reduceRight\", \"some\", \"copyWithin\", \"toString\", \"pop\", \"filter\", \"map\", \"splice\", \"keys\", \"unshift\", \"sort\", \"includes\", \"flatMap\", \"shift\", \"values\", \"every\", \"toLocaleString\", \"push\", \"lastIndexOf\"])\n const v69 = {__proto__:3697200800,constructor:1337,e:3697200800,length:13.37,toString:3697200800,valueOf:v68};\n // v69 = .object(ofGroup: Object, withProperties: [\"e\", \"constructor\", \"__proto__\", \"length\", \"toString\", \"valueOf\"])\n const v70 = Object;\n // v70 = .object(ofGroup: ObjectConstructor, withProperties: [\"prototype\"], withMethods: [\"setPrototypeOf\", \"assign\", \"fromEntries\", \"seal\", \"getOwnPropertyNames\", \"freeze\", \"defineProperty\", \"create\", \"getPrototypeOf\", \"getOwnPropertySymbols\", \"keys\", \"values\", \"isExtensible\", \"entries\", \"is\", \"getOwnPropertyDescriptor\", \"preventExtensions\", \"defineProperties\", \"getOwnPropertyDescriptors\", \"isSealed\", \"isFrozen\"]) + .function([.anything...] => .object()) + .constructor([.anything...] => .object())\n function v71(v72) {\n }\n const v74 = [13.37];\n // v74 = .object(ofGroup: Array, withProperties: [\"length\", \"__proto__\", \"constructor\"], withMethods: [\"concat\", \"fill\", \"indexOf\", \"entries\", \"forEach\", \"find\", \"reverse\", \"slice\", \"flat\", \"reduce\", \"join\", \"findIndex\", \"reduceRight\", \"some\", \"copyWithin\", \"toString\", \"pop\", \"filter\", \"map\", \"splice\", \"keys\", \"unshift\", \"sort\", \"includes\", \"flatMap\", \"shift\", \"values\", \"every\", \"toLocaleString\", \"push\", \"lastIndexOf\"])\n const v75 = 1337;\n // v75 = .integer\n const v76 = v44 ** 13.37;\n // v76 = .integer | .float | .bigint\n function v77(v78,v79,v80,v81,v82) {\n }\n let v83 = v74;\n const v84 = \"2\";\n // v84 = .string + .object(ofGroup: String, withProperties: [\"constructor\", \"__proto__\", \"length\"], withMethods: [\"padEnd\", \"split\", \"charAt\", \"match\", \"lastIndexOf\", \"charCodeAt\", \"trim\", \"startsWith\", \"includes\", \"repeat\", \"search\", \"slice\", \"endsWith\", \"matchAll\", \"indexOf\", \"concat\", \"replace\", \"padStart\", \"substring\", \"codePointAt\"])\n const v85 = \"2\";\n // v85 = .string + .object(ofGroup: String, withProperties: [\"constructor\", \"__proto__\", \"length\"], withMethods: [\"padEnd\", \"split\", \"charAt\", \"match\", \"lastIndexOf\", \"charCodeAt\", \"trim\", \"startsWith\", \"includes\", \"repeat\", \"search\", \"slice\", \"endsWith\", \"matchAll\", \"indexOf\", \"concat\", \"replace\", \"padStart\", \"substring\", \"codePointAt\"])\n const v88 = [13.37,13.37,1337,13.37];\n // v88 = .object(ofGroup: Array, withProperties: [\"length\", \"__proto__\", \"constructor\"], withMethods: [\"concat\", \"fill\", \"indexOf\", \"entries\", \"forEach\", \"find\", \"reverse\", \"slice\", \"flat\", \"reduce\", \"join\", \"findIndex\", \"reduceRight\", \"some\", \"copyWithin\", \"toString\", \"pop\", \"filter\", \"map\", \"splice\", \"keys\", \"unshift\", \"sort\", \"includes\", \"flatMap\", \"shift\", \"values\", \"every\", \"toLocaleString\", \"push\", \"lastIndexOf\"])\n function v89(v90,v91,v92) {\n }\n const v94 = [1337,1337,1337,1337];\n // v94 = .object(ofGroup: Array, withProperties: [\"length\", \"__proto__\", \"constructor\"], withMethods: [\"concat\", \"fill\", \"indexOf\", \"entries\", \"forEach\", \"find\", \"reverse\", \"slice\", \"flat\", \"reduce\", \"join\", \"findIndex\", \"reduceRight\", \"some\", \"copyWithin\", \"toString\", \"pop\", \"filter\", \"map\", \"splice\", \"keys\", \"unshift\", \"sort\", \"includes\", \"flatMap\", \"shift\", \"values\", \"every\", \"toLocaleString\", \"push\", \"lastIndexOf\"])\n const v95 = [3697200800,v88,v94];\n // v95 = .object(ofGroup: Array, withProperties: [\"length\", \"__proto__\", \"constructor\"], withMethods: [\"concat\", \"fill\", \"indexOf\", \"entries\", \"forEach\", \"find\", \"reverse\", \"slice\", \"flat\", \"reduce\", \"join\", \"findIndex\", \"reduceRight\", \"some\", \"copyWithin\", \"toString\", \"pop\", \"filter\", \"map\", \"splice\", \"keys\", \"unshift\", \"sort\", \"includes\", \"flatMap\", \"shift\", \"values\", \"every\", \"toLocaleString\", \"push\", \"lastIndexOf\"])\n function v96(v97,v98) {\n }\n const v99 = {__proto__:3697200800,constructor:1337,e:3697200800,length:13.37,toString:3697200800,d:v95};\n // v99 = .object(ofGroup: Object, withProperties: [\"toString\", \"length\", \"constructor\", \"__proto__\", \"e\", \"d\"])\n let v100 = 13.37;\n const v101 = typeof v74;\n // v101 = .string\n const v102 = \"symbol\";\n // v102 = .string + .object(ofGroup: String, withProperties: [\"constructor\", \"__proto__\", \"length\"], withMethods: [\"padEnd\", \"split\", \"charAt\", \"match\", \"lastIndexOf\", \"charCodeAt\", \"trim\", \"startsWith\", \"includes\", \"repeat\", \"search\", \"slice\", \"endsWith\", \"matchAll\", \"indexOf\", \"concat\", \"replace\", \"padStart\", \"substring\", \"codePointAt\"])\n const v103 = 3697200800;\n // v103 = .integer\n const v104 = \"2\";\n // v104 = .string + .object(ofGroup: String, withProperties: [\"constructor\", \"__proto__\", \"length\"], withMethods: [\"padEnd\", \"split\", \"charAt\", \"match\", \"lastIndexOf\", \"charCodeAt\", \"trim\", \"startsWith\", \"includes\", \"repeat\", \"search\", \"slice\", \"endsWith\", \"matchAll\", \"indexOf\", \"concat\", \"replace\", \"padStart\", \"substring\", \"codePointAt\"])\n const v105 = Boolean;\n // v105 = .object(ofGroup: BooleanConstructor, withProperties: [\"prototype\"]) + .function([.anything] => .boolean) + .constructor([.anything] => .boolean)\n const v106 = Function;\n // v106 = .constructor([.string] => .object(ofGroup: Function, withProperties: [\"constructor\", \"arguments\", \"__proto__\", \"name\", \"caller\", \"prototype\", \"length\"], withMethods: [\"call\", \"bind\", \"apply\"]) + .function([.anything...] => .unknown) + .constructor([.anything...] => .unknown))\n const v107 = 13.37;\n // v107 = .float\n const v108 = 1337;\n // v108 = .integer\n const v109 = \"2\";\n // v109 = .string + .object(ofGroup: String, withProperties: [\"constructor\", \"__proto__\", \"length\"], withMethods: [\"padEnd\", \"split\", \"charAt\", \"match\", \"lastIndexOf\", \"charCodeAt\", \"trim\", \"startsWith\", \"includes\", \"repeat\", \"search\", \"slice\", \"endsWith\", \"matchAll\", \"indexOf\", \"concat\", \"replace\", \"padStart\", \"substring\", \"codePointAt\"])\n const v110 = Function;\n // v110 = .constructor([.string] => .object(ofGroup: Function, withProperties: [\"constructor\", \"arguments\", \"__proto__\", \"name\", \"caller\", \"prototype\", \"length\"], withMethods: [\"call\", \"bind\", \"apply\"]) + .function([.anything...] => .unknown) + .constructor([.anything...] => .unknown))\n const v112 = [13.37,13.37,13.37,13.37];\n // v112 = .object(ofGroup: Array, withProperties: [\"length\", \"__proto__\", \"constructor\"], withMethods: [\"concat\", \"fill\", \"indexOf\", \"entries\", \"forEach\", \"find\", \"reverse\", \"slice\", \"flat\", \"reduce\", \"join\", \"findIndex\", \"reduceRight\", \"some\", \"copyWithin\", \"toString\", \"pop\", \"filter\", \"map\", \"splice\", \"keys\", \"unshift\", \"sort\", \"includes\", \"flatMap\", \"shift\", \"values\", \"every\", \"toLocaleString\", \"push\", \"lastIndexOf\"])\n const v113 = 1337;\n // v113 = .integer\n let v114 = 13.37;\n const v116 = {...3697200800,...3697200800};\n // v116 = .object(ofGroup: Object, withProperties: [\"__proto__\"])\n const v117 = Object;\n // v117 = .object(ofGroup: ObjectConstructor, withProperties: [\"prototype\"], withMethods: [\"setPrototypeOf\", \"assign\", \"fromEntries\", \"seal\", \"getOwnPropertyNames\", \"freeze\", \"defineProperty\", \"create\", \"getPrototypeOf\", \"getOwnPropertySymbols\", \"keys\", \"values\", \"isExtensible\", \"entries\", \"is\", \"getOwnPropertyDescriptor\", \"preventExtensions\", \"defineProperties\", \"getOwnPropertyDescriptors\", \"isSealed\", \"isFrozen\"]) + .function([.anything...] => .object()) + .constructor([.anything...] => .object())\n const v118 = Function;\n // v118 = .constructor([.string] => .object(ofGroup: Function, withProperties: [\"constructor\", \"arguments\", \"__proto__\", \"name\", \"caller\", \"prototype\", \"length\"], withMethods: [\"call\", \"bind\", \"apply\"]) + .function([.anything...] => .unknown) + .constructor([.anything...] => .unknown))\n const v119 = {};\n // v119 = .object(ofGroup: Object, withProperties: [\"__proto__\"])\n let v120 = v119;\n const v121 = (3697200800).constructor;\n // v121 = .unknown\n function v122(v123,v124) {\n }\n const v125 = Promise;\n // v125 = .object(ofGroup: PromiseConstructor, withProperties: [\"prototype\"], withMethods: [\"race\", \"allSettled\", \"reject\", \"all\", \"resolve\"]) + .constructor([.function()] => .object(ofGroup: Promise, withProperties: [\"__proto__\"], withMethods: [\"finally\", \"then\", \"catch\"]))\n const v128 = 4;\n // v128 = .integer\n let v129 = 0;\n const v131 = [13.37,13.37,13.37,13.37];\n // v131 = .object(ofGroup: Array, withProperties: [\"length\", \"__proto__\", \"constructor\"], withMethods: [\"concat\", \"fill\", \"indexOf\", \"entries\", \"forEach\", \"find\", \"reverse\", \"slice\", \"flat\", \"reduce\", \"join\", \"findIndex\", \"reduceRight\", \"some\", \"copyWithin\", \"toString\", \"pop\", \"filter\", \"map\", \"splice\", \"keys\", \"unshift\", \"sort\", \"includes\", \"flatMap\", \"shift\", \"values\", \"every\", \"toLocaleString\", \"push\", \"lastIndexOf\"])\n const v133 = [1337,1337,1337,1337];\n // v133 = .object(ofGroup: Array, withProperties: [\"length\", \"__proto__\", \"constructor\"], withMethods: [\"concat\", \"fill\", \"indexOf\", \"entries\", \"forEach\", \"find\", \"reverse\", \"slice\", \"flat\", \"reduce\", \"join\", \"findIndex\", \"reduceRight\", \"some\", \"copyWithin\", \"toString\", \"pop\", \"filter\", \"map\", \"splice\", \"keys\", \"unshift\", \"sort\", \"includes\", \"flatMap\", \"shift\", \"values\", \"every\", \"toLocaleString\", \"push\", \"lastIndexOf\"])\n const v134 = [3697200800,v131,v133];\n // v134 = .object(ofGroup: Array, withProperties: [\"length\", \"__proto__\", \"constructor\"], withMethods: [\"concat\", \"fill\", \"indexOf\", \"entries\", \"forEach\", \"find\", \"reverse\", \"slice\", \"flat\", \"reduce\", \"join\", \"findIndex\", \"reduceRight\", \"some\", \"copyWithin\", \"toString\", \"pop\", \"filter\", \"map\", \"splice\", \"keys\", \"unshift\", \"sort\", \"includes\", \"flatMap\", \"shift\", \"values\", \"every\", \"toLocaleString\", \"push\", \"lastIndexOf\"])\n const v135 = Object;\n // v135 = .object(ofGroup: ObjectConstructor, withProperties: [\"prototype\"], withMethods: [\"setPrototypeOf\", \"assign\", \"fromEntries\", \"seal\", \"getOwnPropertyNames\", \"freeze\", \"defineProperty\", \"create\", \"getPrototypeOf\", \"getOwnPropertySymbols\", \"keys\", \"values\", \"isExtensible\", \"entries\", \"is\", \"getOwnPropertyDescriptor\", \"preventExtensions\", \"defineProperties\", \"getOwnPropertyDescriptors\", \"isSealed\", \"isFrozen\"]) + .function([.anything...] => .object()) + .constructor([.anything...] => .object())\n const v136 = -944747134;\n // v136 = .integer\n const v139 = [13.37,13.37,13.37,13.37];\n // v139 = .object(ofGroup: Array, withProperties: [\"length\", \"__proto__\", \"constructor\"], withMethods: [\"concat\", \"fill\", \"indexOf\", \"entries\", \"forEach\", \"find\", \"reverse\", \"slice\", \"flat\", \"reduce\", \"join\", \"findIndex\", \"reduceRight\", \"some\", \"copyWithin\", \"toString\", \"pop\", \"filter\", \"map\", \"splice\", \"keys\", \"unshift\", \"sort\", \"includes\", \"flatMap\", \"shift\", \"values\", \"every\", \"toLocaleString\", \"push\", \"lastIndexOf\"])\n const v141 = [1337,1337,1337,1337];\n // v141 = .object(ofGroup: Array, withProperties: [\"length\", \"__proto__\", \"constructor\"], withMethods: [\"concat\", \"fill\", \"indexOf\", \"entries\", \"forEach\", \"find\", \"reverse\", \"slice\", \"flat\", \"reduce\", \"join\", \"findIndex\", \"reduceRight\", \"some\", \"copyWithin\", \"toString\", \"pop\", \"filter\", \"map\", \"splice\", \"keys\", \"unshift\", \"sort\", \"includes\", \"flatMap\", \"shift\", \"values\", \"every\", \"toLocaleString\", \"push\", \"lastIndexOf\"])\n const v142 = [3697200800,v139,v141];\n // v142 = .object(ofGroup: Array, withProperties: [\"length\", \"__proto__\", \"constructor\"], withMethods: [\"concat\", \"fill\", \"indexOf\", \"entries\", \"forEach\", \"find\", \"reverse\", \"slice\", \"flat\", \"reduce\", \"join\", \"findIndex\", \"reduceRight\", \"some\", \"copyWithin\", \"toString\", \"pop\", \"filter\", \"map\", \"splice\", \"keys\", \"unshift\", \"sort\", \"includes\", \"flatMap\", \"shift\", \"values\", \"every\", \"toLocaleString\", \"push\", \"lastIndexOf\"])\n const v143 = {__proto__:3697200800,constructor:1337,e:3697200800,length:13.37,toString:3697200800,valueOf:v142};\n // v143 = .object(ofGroup: Object, withProperties: [\"toString\", \"constructor\", \"e\", \"__proto__\", \"valueOf\", \"length\"])\n let v144 = v143;\n const v145 = gc;\n // v145 = .function([] => .undefined)\n let v146 = 13.37;\n const v150 = [13.37,13.37,13.37,Function];\n // v150 = .object(ofGroup: Array, withProperties: [\"length\", \"__proto__\", \"constructor\"], withMethods: [\"concat\", \"fill\", \"indexOf\", \"entries\", \"forEach\", \"find\", \"reverse\", \"slice\", \"flat\", \"reduce\", \"join\", \"findIndex\", \"reduceRight\", \"some\", \"copyWithin\", \"toString\", \"pop\", \"filter\", \"map\", \"splice\", \"keys\", \"unshift\", \"sort\", \"includes\", \"flatMap\", \"shift\", \"values\", \"every\", \"toLocaleString\", \"push\", \"lastIndexOf\"])\n const v152 = [1337,1337,1337,1337];\n // v152 = .object(ofGroup: Array, withProperties: [\"length\", \"__proto__\", \"constructor\"], withMethods: [\"concat\", \"fill\", \"indexOf\", \"entries\", \"forEach\", \"find\", \"reverse\", \"slice\", \"flat\", \"reduce\", \"join\", \"findIndex\", \"reduceRight\", \"some\", \"copyWithin\", \"toString\", \"pop\", \"filter\", \"map\", \"splice\", \"keys\", \"unshift\", \"sort\", \"includes\", \"flatMap\", \"shift\", \"values\", \"every\", \"toLocaleString\", \"push\", \"lastIndexOf\"])\n const v153 = [3697200800,v150,v152];\n // v153 = .object(ofGroup: Array, withProperties: [\"length\", \"__proto__\", \"constructor\"], withMethods: [\"concat\", \"fill\", \"indexOf\", \"entries\", \"forEach\", \"find\", \"reverse\", \"slice\", \"flat\", \"reduce\", \"join\", \"findIndex\", \"reduceRight\", \"some\", \"copyWithin\", \"toString\", \"pop\", \"filter\", \"map\", \"splice\", \"keys\", \"unshift\", \"sort\", \"includes\", \"flatMap\", \"shift\", \"values\", \"every\", \"toLocaleString\", \"push\", \"lastIndexOf\"])\n const v154 = v153 + 1;\n // v154 = .primitive\n let v155 = 0;\n const v156 = v155 + 1;\n // v156 = .primitive\n const v158 = \"2\";\n // v158 = .string + .object(ofGroup: String, withProperties: [\"constructor\", \"__proto__\", \"length\"], withMethods: [\"padEnd\", \"split\", \"charAt\", \"match\", \"lastIndexOf\", \"charCodeAt\", \"trim\", \"startsWith\", \"includes\", \"repeat\", \"search\", \"slice\", \"endsWith\", \"matchAll\", \"indexOf\", \"concat\", \"replace\", \"padStart\", \"substring\", \"codePointAt\"])\n const v160 = [13.37,13.37,13.37,13.37];\n // v160 = .object(ofGroup: Array, withProperties: [\"length\", \"__proto__\", \"constructor\"], withMethods: [\"concat\", \"fill\", \"indexOf\", \"entries\", \"forEach\", \"find\", \"reverse\", \"slice\", \"flat\", \"reduce\", \"join\", \"findIndex\", \"reduceRight\", \"some\", \"copyWithin\", \"toString\", \"pop\", \"filter\", \"map\", \"splice\", \"keys\", \"unshift\", \"sort\", \"includes\", \"flatMap\", \"shift\", \"values\", \"every\", \"toLocaleString\", \"push\", \"lastIndexOf\"])\n const v162 = 0;\n // v162 = .integer\n const v163 = [1337,1337,1337,1337];\n // v163 = .object(ofGroup: Array, withProperties: [\"length\", \"__proto__\", \"constructor\"], withMethods: [\"concat\", \"fill\", \"indexOf\", \"entries\", \"forEach\", \"find\", \"reverse\", \"slice\", \"flat\", \"reduce\", \"join\", \"findIndex\", \"reduceRight\", \"some\", \"copyWithin\", \"toString\", \"pop\", \"filter\", \"map\", \"splice\", \"keys\", \"unshift\", \"sort\", \"includes\", \"flatMap\", \"shift\", \"values\", \"every\", \"toLocaleString\", \"push\", \"lastIndexOf\"])\n const v164 = [3697200800,1337,v163];\n // v164 = .object(ofGroup: Array, withProperties: [\"length\", \"__proto__\", \"constructor\"], withMethods: [\"concat\", \"fill\", \"indexOf\", \"entries\", \"forEach\", \"find\", \"reverse\", \"slice\", \"flat\", \"reduce\", \"join\", \"findIndex\", \"reduceRight\", \"some\", \"copyWithin\", \"toString\", \"pop\", \"filter\", \"map\", \"splice\", \"keys\", \"unshift\", \"sort\", \"includes\", \"flatMap\", \"shift\", \"values\", \"every\", \"toLocaleString\", \"push\", \"lastIndexOf\"])\n const v166 = 1337;\n // v166 = .integer\n let v167 = 2594067260;\n const v169 = 4;\n // v169 = .integer\n let v170 = 0;\n const v171 = v167 + 1;\n // v171 = .primitive\n const v172 = {__proto__:3697200800,constructor:v163,e:3697200800,length:13.37,toString:3697200800,valueOf:v164};\n // v172 = .object(ofGroup: Object, withProperties: [\"e\", \"__proto__\", \"constructor\", \"valueOf\", \"length\", \"toString\"])\n const v173 = 0;\n // v173 = .integer\n const v174 = 5;\n // v174 = .integer\n const v175 = 2937513072;\n // v175 = .integer\n const v176 = Object;\n // v176 = .object(ofGroup: ObjectConstructor, withProperties: [\"prototype\"], withMethods: [\"setPrototypeOf\", \"assign\", \"fromEntries\", \"seal\", \"getOwnPropertyNames\", \"freeze\", \"defineProperty\", \"create\", \"getPrototypeOf\", \"getOwnPropertySymbols\", \"keys\", \"values\", \"isExtensible\", \"entries\", \"is\", \"getOwnPropertyDescriptor\", \"preventExtensions\", \"defineProperties\", \"getOwnPropertyDescriptors\", \"isSealed\", \"isFrozen\"]) + .function([.anything...] => .object()) + .constructor([.anything...] => .object())\n const v177 = v172.constructor;\n // v177 = .unknown\n const v178 = 0;\n // v178 = .integer\n const v179 = 1;\n // v179 = .integer\n try {\n } catch(v180) {\n const v182 = [13.37,13.37,13.37,13.37];\n // v182 = .object(ofGroup: Array, withProperties: [\"length\", \"__proto__\", \"constructor\"], withMethods: [\"concat\", \"fill\", \"indexOf\", \"entries\", \"forEach\", \"find\", \"reverse\", \"slice\", \"flat\", \"reduce\", \"join\", \"findIndex\", \"reduceRight\", \"some\", \"copyWithin\", \"toString\", \"pop\", \"filter\", \"map\", \"splice\", \"keys\", \"unshift\", \"sort\", \"includes\", \"flatMap\", \"shift\", \"values\", \"every\", \"toLocaleString\", \"push\", \"lastIndexOf\"])\n const v183 = v182.__proto__;\n // v183 = .object()\n function v185(v186) {\n }\n const v187 = Object >>> v183;\n // v187 = .integer | .bigint\n }\n function v188(v189,v190,v191,v192,...v193) {\n }\n}", "function markRaw(obj) {\r\n if (!(isPlainObject(obj) || isArray(obj)) || !Object.isExtensible(obj)) {\r\n return obj;\r\n }\r\n // set the vue observable flag at obj\r\n var ob = createObserver();\r\n ob.__raw__ = true;\r\n def(obj, '__ob__', ob);\r\n // mark as Raw\r\n rawSet.set(obj, true);\r\n return obj;\r\n}", "function markRaw(obj) {\r\n if (!(isPlainObject(obj) || isArray(obj)) || !Object.isExtensible(obj)) {\r\n return obj;\r\n }\r\n // set the vue observable flag at obj\r\n var ob = createObserver();\r\n ob.__raw__ = true;\r\n def(obj, '__ob__', ob);\r\n // mark as Raw\r\n rawSet.set(obj, true);\r\n return obj;\r\n}", "transient private internal function m185() {}", "function rekognizeLabels(bucket, key) {\n let params = {\n Image: {\n S3Object: {\n Bucket: bucket,\n Name: key\n }\n },\n MaxLabels: 3,\n MinConfidence: 80\n };\n\n return rekognition.detectLabels(params).promise()\n}", "test_doNotRetainAnno(){\n let translator = new Translator();\n translator.registerPackage(PackageFile);\n let text = JSON.stringify(this.json.doNotRetainAnno);\n let object1 = translator.decode(text).getRoot();\n let object2 = translator.decode(text).getRoot();\n\n Assert.equals(\"ca.frar.jjjrmi.translator.testclasses.DoNotRetainAnno\", object1.constructor.__getClass());\n Assert.equals(\"ca.frar.jjjrmi.translator.testclasses.DoNotRetainAnno\", object2.constructor.__getClass());\n Assert.notEquals(object1, object2);\n }", "function LK_likeIt(elem) {\n var likeGroup = elem.getAttribute(LK_LIKEGROUP);\n var likeValue = elem.getAttribute(LK_LIKEVALUE);\n localStorage[likeGroup] = likeValue;\n\n // Change the style of the liker nodes\n var siblings = elem.parentNode.childNodes;\n for (var i = 0; i < siblings.length; i++) {\n if (siblings[i].style) { \n LK_applyNormalStyle(siblings[i]);\n }\n }\n LK_applySelectedStyle(elem, likeValue);\n\n // Change the value of any mini likers\n var allSpans = document.getElementsByTagName('span');\n for (var i = 0; i < allSpans.length; i++) {\n var span = allSpans[i];\n if (span.getAttribute(LK_LIKEGROUP) == likeGroup) {\n if (span.getAttribute(LK_LIKETYPE) == 'mini') {\n span.innerHTML = LK_MAPPINGS[likeValue].label;\n LK_applySelectedStyle(allSpans[i], likeValue);\n }\n }\n }\n}", "function OOPExample(who) {\n this.me = who;\n}", "getLikes(state, data) {\n state.likes = data\n }", "function _isAlternativeRecognitionResult(obj) {\r\n return obj && typeof obj === 'object';\r\n}", "function addLikes() {\n if (propLike?.includes(user.username)) {\n let index = propLike.indexOf(user.username);\n let removeLike = [\n ...propLike.slice(0, index),\n ...propLike.slice(index + 1),\n ];\n setLikeGet(removeLike);\n setPropLike(removeLike);\n setRedLike(\"\");\n\n addToLike(eventid, removeLike);\n } else {\n let likesArr = [...propLike, `${user.username}`];\n\n setLikeGet(likesArr);\n setPropLike(likesArr);\n setRedLike(\"red\");\n addToLike(eventid, likesArr);\n }\n }", "function LiteralObject() {\r\n}", "function Komunalne() {}", "function Bevy() {}", "function Prediction() {\n this.score = {};\n}", "function Object() {}", "function Object() {}", "function canEnumPub(obj, name) {\n if (obj === null) { return false; }\n if (obj === void 0) { return false; }\n name = String(name);\n if (obj[name + '_canEnum___']) { return true; }\n if (endsWith__.test(name)) { return false; }\n if (!isJSONContainer(obj)) { return false; }\n if (!myOriginalHOP.call(obj, name)) { return false; }\n fastpathEnum(obj, name);\n if (name === 'toString') { return true; }\n fastpathRead(obj, name);\n return true;\n }", "function Obj(){ return Literal.apply(this,arguments) }", "test_primitives() {\n let translator = new Translator();\n translator.registerPackage(PackageFile);\n let text = JSON.stringify(this.json.primitives);\n let object = translator.decode(text).getRoot();\n Assert.equals(\"ca.frar.jjjrmi.translator.testclasses.Primitives\", object.constructor.__getClass());\n Assert.equals(\"alpha9\", object.string);\n }", "function hello()\n{\n /* ATTRIBUTES */\n this.coolbeans = 'class';\n this.something = 'hello-class';\n\n}", "function test_cluster_tagged_crosshair_op_vsphere65() {}", "function classifyVideo() {\n classifier.classify(gotResult);\n}", "function classifyVideo() {\n classifier.classify(gotResult);\n}", "constructor(papa,mummy,sivlings,belongs,loving_bro,favs_bro){\n super(papa,mummy,sivlings,belongs)\n this.loving_bro=loving_bro\n this.favs_bro=favs_bro\n }", "function v8(v9,v10) {\n const v16 = [1337,1337];\n // v16 = .object(ofGroup: Array, withProperties: [\"length\", \"__proto__\", \"constructor\"], withMethods: [\"concat\", \"fill\", \"indexOf\", \"entries\", \"forEach\", \"find\", \"reverse\", \"slice\", \"flat\", \"reduce\", \"join\", \"findIndex\", \"reduceRight\", \"some\", \"copyWithin\", \"toString\", \"pop\", \"filter\", \"map\", \"splice\", \"keys\", \"unshift\", \"sort\", \"includes\", \"flatMap\", \"shift\", \"values\", \"every\", \"toLocaleString\", \"push\", \"lastIndexOf\"])\n const v17 = [\"536870912\",-3848843708,v16,-3848843708,1337,13.37,13.37,WeakMap,-3848843708];\n // v17 = .object(ofGroup: Array, withProperties: [\"length\", \"__proto__\", \"constructor\"], withMethods: [\"concat\", \"fill\", \"indexOf\", \"entries\", \"forEach\", \"find\", \"reverse\", \"slice\", \"flat\", \"reduce\", \"join\", \"findIndex\", \"reduceRight\", \"some\", \"copyWithin\", \"toString\", \"pop\", \"filter\", \"map\", \"splice\", \"keys\", \"unshift\", \"sort\", \"includes\", \"flatMap\", \"shift\", \"values\", \"every\", \"toLocaleString\", \"push\", \"lastIndexOf\"])\n const v18 = {constructor:13.37,e:v16};\n // v18 = .object(ofGroup: Object, withProperties: [\"constructor\", \"e\", \"__proto__\"])\n const v19 = {__proto__:-3848843708,a:v18,b:-3848843708,constructor:1337,d:v18,e:v17,length:WeakMap};\n // v19 = .object(ofGroup: Object, withProperties: [\"d\", \"b\", \"a\", \"__proto__\", \"e\", \"constructor\", \"length\"])\n const v21 = new Float64Array(v19);\n // v21 = .object(ofGroup: Float64Array, withProperties: [\"byteOffset\", \"constructor\", \"buffer\", \"__proto__\", \"byteLength\", \"length\"], withMethods: [\"map\", \"values\", \"subarray\", \"find\", \"fill\", \"set\", \"findIndex\", \"some\", \"reduceRight\", \"reverse\", \"join\", \"includes\", \"entries\", \"reduce\", \"every\", \"copyWithin\", \"sort\", \"forEach\", \"lastIndexOf\", \"indexOf\", \"filter\", \"slice\", \"keys\"])\n v6[6] = v7;\n v7.toString = v9;\n }", "function defineInspect(classObject) {\n var fn = classObject.prototype.toJSON;\n typeof fn === 'function' || invariant(0);\n classObject.prototype.inspect = fn; // istanbul ignore else (See: 'https://github.com/graphql/graphql-js/issues/2317')\n\n if (nodejsCustomInspectSymbol[\"a\" /* default */]) {\n classObject.prototype[nodejsCustomInspectSymbol[\"a\" /* default */]] = fn;\n }\n}", "annotate(message: string, data: Object) {\n this.message = message;\n this.data = assign(this.data, data);\n }", "function encodeObject(o) {\n if (_.isNumber(o)) {\n if (_.isNaN(o)) {\n return ['SPECIAL_FLOAT', 'NaN'];\n } else if (o === Infinity) {\n return ['SPECIAL_FLOAT', 'Infinity'];\n } else if (o === -Infinity) {\n return ['SPECIAL_FLOAT', '-Infinity'];\n } else {\n return o;\n }\n } else if (_.isString(o)) {\n return o;\n } else if (_.isBoolean(o) || _.isNull(o) || _.isUndefined(o)) {\n return ['JS_SPECIAL_VAL', String(o)];\n } else if (typeof o === 'symbol') {\n // ES6 symbol\n return ['JS_SPECIAL_VAL', String(o)];\n } else {\n // render these as heap objects\n\n // very important to use _.has since we don't want to\n // grab the property in your prototype, only in YOURSELF ... SUBTLE!\n if (!_.has(o, 'smallObjId_hidden_')) {\n // make this non-enumerable so that it doesn't show up in\n // console.log() or other inspector functions\n Object.defineProperty(o, 'smallObjId_hidden_', { value: smallObjId,\n enumerable: false });\n smallObjId++;\n }\n assert(o.smallObjId_hidden_ > 0);\n\n var ret = ['REF', o.smallObjId_hidden_];\n\n if (encodedHeapObjects[String(o.smallObjId_hidden_)] !== undefined) {\n return ret;\n }\n else {\n assert(_.isObject(o));\n\n var newEncodedObj = [];\n encodedHeapObjects[String(o.smallObjId_hidden_)] = newEncodedObj;\n\n var i;\n\n if (_.isFunction(o)) {\n var funcProperties = []; // each element is a pair of [name, encoded value]\n\n var encodedProto = null;\n if (_.isObject(o.prototype)) {\n // TRICKY TRICKY! for inheritance to be displayed properly, we\n // want to find the prototype of o.prototype and see if it's\n // non-empty. if that's true, then even if o.prototype is\n // empty (i.e., has no properties of its own), then we should\n // still encode it since its 'prototype' \"uber-hidden\n // property\" is non-empty\n var prototypeOfPrototype = Object.getPrototypeOf(o.prototype);\n if (!_.isEmpty(o.prototype) ||\n (_.isObject(prototypeOfPrototype) && !_.isEmpty(prototypeOfPrototype))) {\n encodedProto = encodeObject(o.prototype);\n }\n }\n\n if (encodedProto) {\n funcProperties.push(['prototype', encodedProto]);\n }\n\n // now get all of the normal properties out of this function\n // object (it's unusual to put properties in a function object,\n // but it's still legal!)\n var funcPropPairs = _.pairs(o);\n for (i = 0; i < funcPropPairs.length; i++) {\n funcProperties.push([funcPropPairs[i][0], encodeObject(funcPropPairs[i][1])]);\n }\n\n var funcCodeString = o.toString();\n\n /*\n\n #craftsmanship -- make nested functions look better by indenting\n the first line of a nested function definition by however much\n the LAST line is indented, ONLY if the last line is simply a\n single ending '}'. otherwise it will look ugly since the\n function definition doesn't start out indented, like so:\n\nfunction bar(x) {\n globalZ += 100;\n return x + y + globalZ;\n }\n\n */\n var codeLines = funcCodeString.split('\\n');\n if (codeLines.length > 1) {\n var lastLine = _.last(codeLines);\n if (lastLine.trim() === '}') {\n var lastLinePrefix = lastLine.slice(0, lastLine.indexOf('}'));\n funcCodeString = lastLinePrefix + funcCodeString; // prepend!\n }\n }\n\n newEncodedObj.push('JS_FUNCTION',\n o.name,\n funcCodeString, /* code string*/\n funcProperties.length ? funcProperties : null, /* OPTIONAL */\n null /* parent frame */);\n } else if (_.isArray(o)) {\n newEncodedObj.push('LIST');\n for (i = 0; i < o.length; i++) {\n newEncodedObj.push(encodeObject(o[i]));\n }\n } else if (o.__proto__.toString() === canonicalSet.__proto__.toString()) { // dunno why 'instanceof' doesn't work :(\n newEncodedObj.push('SET');\n // ES6 Set (TODO: add WeakSet)\n for (let item of o) {\n newEncodedObj.push(encodeObject(item));\n }\n } else if (o.__proto__.toString() === canonicalMap.__proto__.toString()) { // dunno why 'instanceof' doesn't work :(\n // ES6 Map (TODO: add WeakMap)\n newEncodedObj.push('DICT'); // use the Python 'DICT' type since it's close enough; adjust display in frontend\n for (let [key, value] of o) {\n newEncodedObj.push([encodeObject(key), encodeObject(value)]);\n }\n } else {\n // a true object\n\n // if there's a custom toString() function (note that a truly\n // prototypeless object won't have toString method, so check first to\n // see if toString is *anywhere* up the prototype chain)\n var s = (o.toString !== undefined) ? o.toString() : '';\n if (s !== '' && s !== '[object Object]') {\n newEncodedObj.push('INSTANCE_PPRINT', 'object', s);\n } else {\n newEncodedObj.push('INSTANCE', '');\n var pairs = _.pairs(o);\n for (i = 0; i < pairs.length; i++) {\n var e = pairs[i];\n newEncodedObj.push([encodeObject(e[0]), encodeObject(e[1])]);\n }\n\n var proto = Object.getPrototypeOf(o);\n if (_.isObject(proto) && !_.isEmpty(proto)) {\n //log('obj.prototype', proto, proto.smallObjId_hidden_);\n // I think __proto__ is the official term for this field,\n // *not* 'prototype'\n newEncodedObj.push(['__proto__', encodeObject(proto)]);\n }\n }\n }\n\n return ret;\n }\n\n }\n assert(false);\n}", "function dist_index_esm_contains(obj,key){return Object.prototype.hasOwnProperty.call(obj,key);}", "function isRawPostcodeObject(o, additionalAttr, blackListedAttr) {\n\tif (!additionalAttr) additionalAttr = [];\n\tif (!blackListedAttr) blackListedAttr = [];\n\tisSomeObject(o, rawPostcodeAttributes, additionalAttr, blackListedAttr);\n}", "function _meta_(v,m){var ms=v['__meta__']||{};for(var k in m){ms[k]=m[k]};v['__meta__']=ms;return v}", "function Animal() {\n this.kind = \"Dog\"\n}", "function Kitten(name, photo, interests, isGoodWithKids, isGoodWithDogs, isGoodWithCats) {\n this.name = name;\n this.photo = photo;\n this.interests = interests;\n this.isGoodWithKids = isGoodWithKids;\n this.isGoodWithCats = isGoodWithCats;\n this.isGoodWithDogs = isGoodWithDogs;\n}", "getMeta () {\n }", "function np(e){return\"[object Object]\"===Object.prototype.toString.call(e)}", "function Obj() {}", "function isFriend(name, object) {\n//use hasWord function to check object names array\n// console.log(object);\n// console.log(name);\n//conditional to check for property\nif (object['friends'] !== undefined) {\nreturn hasWord(object.friends.join(' '), name);\n}\nelse {return false};\n \n}", "function test_fail_hole_prototype() {\n var obj = Object.create({ stuff: \"in prototype\" });\n obj.foo = \"bar\";\n\n function f1() {\n bidar.serialize(obj);\n }\n assert.throws(f1, /Hole-ful graph, but no hole filter/);\n}", "function Person(saying) {\n this.saying = saying;\n /*\n return {\n dumbObject: true\n }\n */\n}", "transient private protected internal function m182() {}", "function kotlin(hljs) {\n const KEYWORDS = {\n keyword:\n 'abstract as val var vararg get set class object open private protected public noinline ' +\n 'crossinline dynamic final enum if else do while for when throw try catch finally ' +\n 'import package is in fun override companion reified inline lateinit init ' +\n 'interface annotation data sealed internal infix operator out by constructor super ' +\n 'tailrec where const inner suspend typealias external expect actual',\n built_in:\n 'Byte Short Char Int Long Boolean Float Double Void Unit Nothing',\n literal:\n 'true false null'\n };\n const KEYWORDS_WITH_LABEL = {\n className: 'keyword',\n begin: /\\b(break|continue|return|this)\\b/,\n starts: {\n contains: [\n {\n className: 'symbol',\n begin: /@\\w+/\n }\n ]\n }\n };\n const LABEL = {\n className: 'symbol',\n begin: hljs.UNDERSCORE_IDENT_RE + '@'\n };\n\n // for string templates\n const SUBST = {\n className: 'subst',\n begin: /\\$\\{/,\n end: /\\}/,\n contains: [ hljs.C_NUMBER_MODE ]\n };\n const VARIABLE = {\n className: 'variable',\n begin: '\\\\$' + hljs.UNDERSCORE_IDENT_RE\n };\n const STRING = {\n className: 'string',\n variants: [\n {\n begin: '\"\"\"',\n end: '\"\"\"(?=[^\"])',\n contains: [\n VARIABLE,\n SUBST\n ]\n },\n // Can't use built-in modes easily, as we want to use STRING in the meta\n // context as 'meta-string' and there's no syntax to remove explicitly set\n // classNames in built-in modes.\n {\n begin: '\\'',\n end: '\\'',\n illegal: /\\n/,\n contains: [ hljs.BACKSLASH_ESCAPE ]\n },\n {\n begin: '\"',\n end: '\"',\n illegal: /\\n/,\n contains: [\n hljs.BACKSLASH_ESCAPE,\n VARIABLE,\n SUBST\n ]\n }\n ]\n };\n SUBST.contains.push(STRING);\n\n const ANNOTATION_USE_SITE = {\n className: 'meta',\n begin: '@(?:file|property|field|get|set|receiver|param|setparam|delegate)\\\\s*:(?:\\\\s*' + hljs.UNDERSCORE_IDENT_RE + ')?'\n };\n const ANNOTATION = {\n className: 'meta',\n begin: '@' + hljs.UNDERSCORE_IDENT_RE,\n contains: [\n {\n begin: /\\(/,\n end: /\\)/,\n contains: [\n hljs.inherit(STRING, {\n className: 'meta-string'\n })\n ]\n }\n ]\n };\n\n // https://kotlinlang.org/docs/reference/whatsnew11.html#underscores-in-numeric-literals\n // According to the doc above, the number mode of kotlin is the same as java 8,\n // so the code below is copied from java.js\n const KOTLIN_NUMBER_MODE = NUMERIC;\n const KOTLIN_NESTED_COMMENT = hljs.COMMENT(\n '/\\\\*', '\\\\*/',\n {\n contains: [ hljs.C_BLOCK_COMMENT_MODE ]\n }\n );\n const KOTLIN_PAREN_TYPE = {\n variants: [\n {\n className: 'type',\n begin: hljs.UNDERSCORE_IDENT_RE\n },\n {\n begin: /\\(/,\n end: /\\)/,\n contains: [] // defined later\n }\n ]\n };\n const KOTLIN_PAREN_TYPE2 = KOTLIN_PAREN_TYPE;\n KOTLIN_PAREN_TYPE2.variants[1].contains = [ KOTLIN_PAREN_TYPE ];\n KOTLIN_PAREN_TYPE.variants[1].contains = [ KOTLIN_PAREN_TYPE2 ];\n\n return {\n name: 'Kotlin',\n aliases: [ 'kt' ],\n keywords: KEYWORDS,\n contains: [\n hljs.COMMENT(\n '/\\\\*\\\\*',\n '\\\\*/',\n {\n relevance: 0,\n contains: [\n {\n className: 'doctag',\n begin: '@[A-Za-z]+'\n }\n ]\n }\n ),\n hljs.C_LINE_COMMENT_MODE,\n KOTLIN_NESTED_COMMENT,\n KEYWORDS_WITH_LABEL,\n LABEL,\n ANNOTATION_USE_SITE,\n ANNOTATION,\n {\n className: 'function',\n beginKeywords: 'fun',\n end: '[(]|$',\n returnBegin: true,\n excludeEnd: true,\n keywords: KEYWORDS,\n relevance: 5,\n contains: [\n {\n begin: hljs.UNDERSCORE_IDENT_RE + '\\\\s*\\\\(',\n returnBegin: true,\n relevance: 0,\n contains: [ hljs.UNDERSCORE_TITLE_MODE ]\n },\n {\n className: 'type',\n begin: /</,\n end: />/,\n keywords: 'reified',\n relevance: 0\n },\n {\n className: 'params',\n begin: /\\(/,\n end: /\\)/,\n endsParent: true,\n keywords: KEYWORDS,\n relevance: 0,\n contains: [\n {\n begin: /:/,\n end: /[=,\\/]/,\n endsWithParent: true,\n contains: [\n KOTLIN_PAREN_TYPE,\n hljs.C_LINE_COMMENT_MODE,\n KOTLIN_NESTED_COMMENT\n ],\n relevance: 0\n },\n hljs.C_LINE_COMMENT_MODE,\n KOTLIN_NESTED_COMMENT,\n ANNOTATION_USE_SITE,\n ANNOTATION,\n STRING,\n hljs.C_NUMBER_MODE\n ]\n },\n KOTLIN_NESTED_COMMENT\n ]\n },\n {\n className: 'class',\n beginKeywords: 'class interface trait', // remove 'trait' when removed from KEYWORDS\n end: /[:\\{(]|$/,\n excludeEnd: true,\n illegal: 'extends implements',\n contains: [\n {\n beginKeywords: 'public protected internal private constructor'\n },\n hljs.UNDERSCORE_TITLE_MODE,\n {\n className: 'type',\n begin: /</,\n end: />/,\n excludeBegin: true,\n excludeEnd: true,\n relevance: 0\n },\n {\n className: 'type',\n begin: /[,:]\\s*/,\n end: /[<\\(,]|$/,\n excludeBegin: true,\n returnEnd: true\n },\n ANNOTATION_USE_SITE,\n ANNOTATION\n ]\n },\n STRING,\n {\n className: 'meta',\n begin: \"^#!/usr/bin/env\",\n end: '$',\n illegal: '\\n'\n },\n KOTLIN_NUMBER_MODE\n ]\n };\n}", "function kotlin(hljs) {\n const KEYWORDS = {\n keyword:\n 'abstract as val var vararg get set class object open private protected public noinline ' +\n 'crossinline dynamic final enum if else do while for when throw try catch finally ' +\n 'import package is in fun override companion reified inline lateinit init ' +\n 'interface annotation data sealed internal infix operator out by constructor super ' +\n 'tailrec where const inner suspend typealias external expect actual',\n built_in:\n 'Byte Short Char Int Long Boolean Float Double Void Unit Nothing',\n literal:\n 'true false null'\n };\n const KEYWORDS_WITH_LABEL = {\n className: 'keyword',\n begin: /\\b(break|continue|return|this)\\b/,\n starts: {\n contains: [\n {\n className: 'symbol',\n begin: /@\\w+/\n }\n ]\n }\n };\n const LABEL = {\n className: 'symbol',\n begin: hljs.UNDERSCORE_IDENT_RE + '@'\n };\n\n // for string templates\n const SUBST = {\n className: 'subst',\n begin: /\\$\\{/,\n end: /\\}/,\n contains: [ hljs.C_NUMBER_MODE ]\n };\n const VARIABLE = {\n className: 'variable',\n begin: '\\\\$' + hljs.UNDERSCORE_IDENT_RE\n };\n const STRING = {\n className: 'string',\n variants: [\n {\n begin: '\"\"\"',\n end: '\"\"\"(?=[^\"])',\n contains: [\n VARIABLE,\n SUBST\n ]\n },\n // Can't use built-in modes easily, as we want to use STRING in the meta\n // context as 'meta-string' and there's no syntax to remove explicitly set\n // classNames in built-in modes.\n {\n begin: '\\'',\n end: '\\'',\n illegal: /\\n/,\n contains: [ hljs.BACKSLASH_ESCAPE ]\n },\n {\n begin: '\"',\n end: '\"',\n illegal: /\\n/,\n contains: [\n hljs.BACKSLASH_ESCAPE,\n VARIABLE,\n SUBST\n ]\n }\n ]\n };\n SUBST.contains.push(STRING);\n\n const ANNOTATION_USE_SITE = {\n className: 'meta',\n begin: '@(?:file|property|field|get|set|receiver|param|setparam|delegate)\\\\s*:(?:\\\\s*' + hljs.UNDERSCORE_IDENT_RE + ')?'\n };\n const ANNOTATION = {\n className: 'meta',\n begin: '@' + hljs.UNDERSCORE_IDENT_RE,\n contains: [\n {\n begin: /\\(/,\n end: /\\)/,\n contains: [\n hljs.inherit(STRING, {\n className: 'meta-string'\n })\n ]\n }\n ]\n };\n\n // https://kotlinlang.org/docs/reference/whatsnew11.html#underscores-in-numeric-literals\n // According to the doc above, the number mode of kotlin is the same as java 8,\n // so the code below is copied from java.js\n const KOTLIN_NUMBER_MODE = NUMERIC;\n const KOTLIN_NESTED_COMMENT = hljs.COMMENT(\n '/\\\\*', '\\\\*/',\n {\n contains: [ hljs.C_BLOCK_COMMENT_MODE ]\n }\n );\n const KOTLIN_PAREN_TYPE = {\n variants: [\n {\n className: 'type',\n begin: hljs.UNDERSCORE_IDENT_RE\n },\n {\n begin: /\\(/,\n end: /\\)/,\n contains: [] // defined later\n }\n ]\n };\n const KOTLIN_PAREN_TYPE2 = KOTLIN_PAREN_TYPE;\n KOTLIN_PAREN_TYPE2.variants[1].contains = [ KOTLIN_PAREN_TYPE ];\n KOTLIN_PAREN_TYPE.variants[1].contains = [ KOTLIN_PAREN_TYPE2 ];\n\n return {\n name: 'Kotlin',\n aliases: [ 'kt' ],\n keywords: KEYWORDS,\n contains: [\n hljs.COMMENT(\n '/\\\\*\\\\*',\n '\\\\*/',\n {\n relevance: 0,\n contains: [\n {\n className: 'doctag',\n begin: '@[A-Za-z]+'\n }\n ]\n }\n ),\n hljs.C_LINE_COMMENT_MODE,\n KOTLIN_NESTED_COMMENT,\n KEYWORDS_WITH_LABEL,\n LABEL,\n ANNOTATION_USE_SITE,\n ANNOTATION,\n {\n className: 'function',\n beginKeywords: 'fun',\n end: '[(]|$',\n returnBegin: true,\n excludeEnd: true,\n keywords: KEYWORDS,\n relevance: 5,\n contains: [\n {\n begin: hljs.UNDERSCORE_IDENT_RE + '\\\\s*\\\\(',\n returnBegin: true,\n relevance: 0,\n contains: [ hljs.UNDERSCORE_TITLE_MODE ]\n },\n {\n className: 'type',\n begin: /</,\n end: />/,\n keywords: 'reified',\n relevance: 0\n },\n {\n className: 'params',\n begin: /\\(/,\n end: /\\)/,\n endsParent: true,\n keywords: KEYWORDS,\n relevance: 0,\n contains: [\n {\n begin: /:/,\n end: /[=,\\/]/,\n endsWithParent: true,\n contains: [\n KOTLIN_PAREN_TYPE,\n hljs.C_LINE_COMMENT_MODE,\n KOTLIN_NESTED_COMMENT\n ],\n relevance: 0\n },\n hljs.C_LINE_COMMENT_MODE,\n KOTLIN_NESTED_COMMENT,\n ANNOTATION_USE_SITE,\n ANNOTATION,\n STRING,\n hljs.C_NUMBER_MODE\n ]\n },\n KOTLIN_NESTED_COMMENT\n ]\n },\n {\n className: 'class',\n beginKeywords: 'class interface trait', // remove 'trait' when removed from KEYWORDS\n end: /[:\\{(]|$/,\n excludeEnd: true,\n illegal: 'extends implements',\n contains: [\n {\n beginKeywords: 'public protected internal private constructor'\n },\n hljs.UNDERSCORE_TITLE_MODE,\n {\n className: 'type',\n begin: /</,\n end: />/,\n excludeBegin: true,\n excludeEnd: true,\n relevance: 0\n },\n {\n className: 'type',\n begin: /[,:]\\s*/,\n end: /[<\\(,]|$/,\n excludeBegin: true,\n returnEnd: true\n },\n ANNOTATION_USE_SITE,\n ANNOTATION\n ]\n },\n STRING,\n {\n className: 'meta',\n begin: \"^#!/usr/bin/env\",\n end: '$',\n illegal: '\\n'\n },\n KOTLIN_NUMBER_MODE\n ]\n };\n}", "function Surrogate(){}", "function Surrogate(){}", "function Surrogate(){}", "static serialize(obj, allowPrimitives, fallbackToJson, requireJsonType = false) {\n if (allowPrimitives) {\n if (typeof obj === \"string\") {\n return this.serializePrimitive(obj, \"string\");\n } else if (typeof obj === \"number\") {\n return this.serializePrimitive(obj, \"double\");\n } else if (Buffer.isBuffer(obj)) {\n return this.serializePrimitive(obj, \"bytes\");\n } else if (typeof obj === \"boolean\") {\n return this.serializePrimitive(obj, \"bool\");\n } else if (Long.isLong(obj)) {\n return this.serializePrimitive(obj, \"int64\");\n }\n }\n if (obj.constructor && typeof obj.constructor.encode === \"function\" && obj.constructor.$type) {\n return Any.create({\n // I have *no* idea why it's type_url and not typeUrl, but it is.\n type_url: \"type.googleapis.com/\" + AnySupport.fullNameOf(obj.constructor.$type),\n value: obj.constructor.encode(obj).finish()\n });\n } else if (fallbackToJson && typeof obj === \"object\") {\n let type = obj.type;\n if (type === undefined) {\n if (requireJsonType) {\n throw new Error(util.format(\"Fallback to JSON serialization supported, but object does not define a type property: %o\", obj));\n } else {\n type = \"object\";\n }\n }\n return Any.create({\n type_url: CloudStateJson + type,\n value: this.serializePrimitiveValue(stableJsonStringify(obj), \"string\")\n });\n } else {\n throw new Error(util.format(\"Object %o is not a protobuf object, and hence can't be dynamically \" +\n \"serialized. Try passing the object to the protobuf classes create function.\", obj));\n }\n }" ]
[ "0.527866", "0.52612406", "0.51951283", "0.518796", "0.51302594", "0.5044646", "0.48934332", "0.4857401", "0.484017", "0.48302925", "0.482028", "0.4812441", "0.4808473", "0.47852293", "0.47828078", "0.47574478", "0.47493434", "0.4739314", "0.47239366", "0.4703992", "0.4703992", "0.46990207", "0.4690639", "0.46904448", "0.46862254", "0.46716532", "0.46667543", "0.46522382", "0.46354175", "0.46053663", "0.46017453", "0.45926702", "0.45891586", "0.45877746", "0.458541", "0.45851982", "0.45847243", "0.4584686", "0.458378", "0.45767823", "0.45753202", "0.45753202", "0.45753202", "0.45713404", "0.45637134", "0.45637134", "0.4557141", "0.4557141", "0.4557141", "0.45494914", "0.45366898", "0.45342454", "0.4533338", "0.45322663", "0.45229813", "0.452288", "0.452288", "0.45159692", "0.45102093", "0.45099118", "0.45062032", "0.4506134", "0.45033473", "0.4502599", "0.44998378", "0.4497197", "0.44843012", "0.44764578", "0.44738895", "0.44715428", "0.44715428", "0.4471341", "0.44594073", "0.44552016", "0.44538808", "0.44522536", "0.44464657", "0.44464657", "0.4443469", "0.4443427", "0.44433454", "0.4437557", "0.4436382", "0.4430658", "0.4429719", "0.4428169", "0.44260293", "0.4420813", "0.44155774", "0.44130567", "0.4406073", "0.4401904", "0.44010627", "0.43994573", "0.43948644", "0.43847254", "0.43847254", "0.43830302", "0.43830302", "0.43830302", "0.4381413" ]
0.0
-1
Copyright (c) 2013present, Facebook, Inc. All rights reserved. This source code is licensed under the BSDstyle license found in the LICENSE file in the root directory of this source tree. An additional grant of patent rights can be found in the PATENTS file in the same directory.
function makeEmptyFunction(arg) { return function () { return arg; }; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "componentDidMount() {\n // if this is the first time the home screen is loading\n // we must initialize Facebook\n if (!window.FB) {\n window.fbAsyncInit = function() {\n window.FB.init({\n appId : '280945375708713',\n cookie : true, // enable cookies to allow the server to access\n // the session\n xfbml : true, // parse social plugins on this page\n version : 'v2.1' // use version 2.1\n });\n \n window.FB.getLoginStatus(function(response) {\n // upon opening the ma\n if (response.status === \"connected\") {\n loadStream(response);\n }\n }.bind(this));\n }.bind(this);\n } else {\n window.FB.getLoginStatus(function(response) {\n console.log(\"getting status\");\n this.initiateLoginOrLogout(response);\n }.bind(this));\n }\n\n // Load the SDK asynchronously\n (function(d, s, id) {\n var js, fjs = d.getElementsByTagName(s)[0];\n if (d.getElementById(id)) return;\n js = d.createElement(s); js.id = id;\n js.src = \"//connect.facebook.net/en_US/sdk.js\";\n fjs.parentNode.insertBefore(js, fjs);\n }(document, 'script', 'facebook-jssdk'));\n }", "componentDidMount() {\n\n\t window.fbAsyncInit = function() {\n\t window.FB.init({\n\t appId : '1250815578279698',\n\t cookie : true, // enable cookies to allow the server to access\n\t // the session\n\t xfbml : true, // parse social plugins on this page\n\t version : 'v2.11' // use version 2.1\n\t });\n\n //window.FB.Event.subscribe('auth.statusChange', this.statusChangeCallback());\n /* comment by bipin: it redirect if user is logged in fb */\n\t // window.FB.getLoginStatus(function(response) {\n\t // this.statusChangeCallback(response);\n\t // }.bind(this));\n\t }.bind(this);\n\n // Load the SDK asynchronously\n\t (function(d, s, id) {\n\t var js, fjs = d.getElementsByTagName(s)[0];\n\t if (d.getElementById(id)) return;\n\t js = d.createElement(s); js.id = id;js.async = true;\n\t js.src = \"https://connect.facebook.net/en_GB/sdk.js#xfbml=1&version=v2.11\";\n\t fjs.parentNode.insertBefore(js, fjs);\n\t }(document, 'script', 'facebook-jssdk'));\n\t}", "function facebookLogin()\r\n{\r\n var fb = FBConnect.install();\r\n fb.connect(client_id,redir_url,\"touch\");\r\n fb.onConnect = onFBConnected;\r\n \r\n}", "private public function m246() {}", "componentDidMount(){\n (function(d, s, id) {\n var js, fjs = d.getElementsByTagName(s)[0];\n if (d.getElementById(id)) return;\n js = d.createElement(s); js.id = id;\n js.src = \"https://connect.facebook.net/en_US/sdk.js\";\n fjs.parentNode.insertBefore(js, fjs);\n }(document, 'script', 'facebook-jssdk'));\n \n window.fbAsyncInit = function() {\n window.FB.init({\n appId : '207358966557597', /* Our specific APP id */\n cookie : true, \n xfbml : true, \n version : 'v2.8' \n });\n\n /* This might be a duplicate of above checkLoginState, but need to investigate */\n FB.getLoginStatus(function(response) {\n this.statusChangeCallback(response);\n }.bind(this));\n }.bind(this)\n }", "__fbpReady(){super.__fbpReady();//this._FBPTraceWires()\n}", "__fbpReady(){super.__fbpReady();//this._FBPTraceWires()\n}", "private internal function m248() {}", "componentWillUnmount() {\n //disconnect from FB\n }", "componentDidMount() {\n const _this = this;\n\n\n _this._manageGlobalEventHandlers(_this.props);\n\n _this._FB_init(function() {\n _this.setState({\n initializing: false\n });\n });\n }", "frame() {\n throw new Error('Not implemented');\n }", "componentDidMount() {\n this.props.facebookLogin();\n // AsyncStorage.removeItem('fb_token');\n // this.onAuthComplete(this.props);\n }", "beforeConnectedCallbackHook(){\n\t\t\n\t}", "function auth_Facebook()\n{\n authenticate(new firebase.auth.FacebookAuthProvider());\n}", "componentDidMount() {\n const {\n videoId,\n } = this.props;\n\n if (typeof window !== \"undefined\") {\n this.loadFB()\n .then(res => {\n if (res) {\n this.FB = res;\n this.createPlayer(videoId);\n }\n });\n }\n }", "loginWithFacebook(){\n LoginManager.logInWithReadPermissions(['public_profile']).then(loginResult => {\n if (loginResult.isCancelled) {\n console.log('user canceled');\n return;\n }\n AccessToken.getCurrentAccessToken()\n .then(accessTokenData => {\n const credential = this.props.provider.credential(accessTokenData.accessToken);\n return auth.signInWithCredential(credential);\n })\n .then(credData => {\n console.log(credData);\n })\n .catch(err => {\n console.log(err);\n });\n });\n\n }", "_FBPReady() {\n super._FBPReady();\n\n }", "function sdk(){\n}", "onShareAppMessage() {\n\n }", "static checkMobileWallet(){\n\t\tif(typeof window.ReactNativeWebView !== 'undefined' || typeof window.PopOutWebView !== 'undefined'){\n\t\t\tconst parseIfNeeded = x => {\n\t\t\t\tif(x && typeof x === 'string' && x.indexOf(`{`) > -1) x = JSON.parse(x);\n\t\t\t}\n\n\t\t\t// For mobile popouts only.\n\t\t\tif(typeof window.ReactNativeWebView === 'undefined'){\n\t\t\t\twindow.ReactNativeWebView = {\n\t\t\t\t\tpostMessage:() => {}\n\t\t\t\t};\n\t\t\t}\n\n\t\t\tlet resolvers = {};\n\n\t\t\twindow.ReactNativeWebView.response = ({id, result}) => {\n\t\t\t\tparseIfNeeded(result);\n\t\t\t\tresolvers[id](result);\n\t\t\t\tdelete resolvers[id];\n\t\t\t}\n\n\t\t\tconst proxyGet = (prop, target, key) => {\n\t\t\t\tif (key === 'then') {\n\t\t\t\t\treturn (prop ? target[prop] : target).then.bind(target);\n\t\t\t\t}\n\n\t\t\t\tif(key === 'socketResponse'){\n\t\t\t\t\treturn (prop ? target[prop] : target)[key];\n\t\t\t\t}\n\n\t\t\t\treturn (...params) => new Promise(async resolve => {\n\t\t\t\t\tconst id = IdGenerator.text(24);\n\t\t\t\t\tresolvers[id] = resolve;\n\t\t\t\t\twindow.ReactNativeWebView.postMessage(JSON.stringify({id, prop, key, params}));\n\t\t\t\t});\n\t\t\t};\n\n\t\t\tconst proxied = (prop) => new Proxy({}, { get(target, key){ return proxyGet(prop, target, key); } });\n\n\n\t\t\twindow.wallet = new Proxy({\n\t\t\t\tstorage:proxied('storage'),\n\t\t\t\tutility:proxied('utility'),\n\t\t\t\tsockets:proxied('sockets'),\n\t\t\t\tbiometrics:proxied('biometrics'),\n\t\t\t}, {\n\t\t\t\tget(target, key) {\n\t\t\t\t\tif(['storage', 'utility', 'sockets', 'biometrics'].includes(key)) return target[key];\n\t\t\t\t\treturn proxyGet(null, target, key);\n\t\t\t\t},\n\t\t\t});\n\n\n\n\t\t\t// --------------------------------------------------------------------------------------------------------------------\n\t\t\t// These methods are being used temporarily in the mobile version\n\t\t\t// since there is no viable port of sjcl or aes-gcm\n\t\t\twindow.ReactNativeWebView.mobileEncrypt = ({id, data, key}) => {\n\t\t\t\tparseIfNeeded(data);\n\t\t\t\twindow.ReactNativeWebView.postMessage(JSON.stringify({type:'mobile_response', id, result:AES.encrypt(data, key)}));\n\t\t\t\treturn true;\n\t\t\t};\n\n\t\t\twindow.ReactNativeWebView.mobileDecrypt = ({id, data, key}) => {\n\t\t\t\tparseIfNeeded(data);\n\t\t\t\twindow.ReactNativeWebView.postMessage(JSON.stringify({type:'mobile_response', id, result:AES.decrypt(data, key)}));\n\t\t\t\treturn true;\n\t\t\t};\n\n\t\t\tconst Mnemonic = require('@walletpack/core/util/Mnemonic').default;\n\t\t\twindow.ReactNativeWebView.seedPassword = async ({id, password, salt}) => {\n\t\t\t\tconst [_, seed] = await Mnemonic.generateMnemonic(password, salt);\n\t\t\t\twindow.ReactNativeWebView.postMessage(JSON.stringify({type:'mobile_response', id, result:seed}));\n\t\t\t\treturn true;\n\t\t\t};\n\n\t\t\t// Just because doing sha256 on a buffer in react is dumb.\n\t\t\tconst ecc = require('eosjs-ecc');\n\t\t\twindow.ReactNativeWebView.sha256 = ({id, data}) => {\n\t\t\t\tparseIfNeeded(data);\n\t\t\t\twindow.ReactNativeWebView.postMessage(JSON.stringify({type:'mobile_response', id, result:ecc.sha256(Buffer.from(data))}));\n\t\t\t\treturn true;\n\t\t\t};\n\n\t\t\tconst log = console.log;\n\t\t\tconst error = console.error;\n\n\t\t\tconsole.log = (...params) => {\n\t\t\t\twindow.ReactNativeWebView.postMessage(JSON.stringify({type:'console', params}));\n\t\t\t\treturn log(...params);\n\t\t\t};\n\n\t\t\tconsole.error = (...params) => {\n\t\t\t\twindow.ReactNativeWebView.postMessage(JSON.stringify({type:'console', params}));\n\t\t\t\treturn error(...params);\n\t\t\t};\n\n\t\t}\n\t}", "loginByFacebook() {\n if (!this.props.accsessToken) {\n this.props.facebookLogin();\n } else {\n return Alert.alert('', 'Please logout first');\n }\n }", "async contentFrame() {\n throw new Error('Not implemented');\n }", "async contentFrame() {\n throw new Error('Not implemented');\n }", "async componentWillMount() {\n var _this = this\n _this.setUpUserDataFromFB()\n\n //ASK FOR CAMERA ONLT IF IS PREVIEW TRUE AND SHOWBARCODE TRUE\n if (Config.isPreview && Config.showBCScanner) {\n const { status } = await Permissions.askAsync(Permissions.CAMERA);\n this.setState({ hasCameraPermission: status === 'granted' });\n }\n\n\n\n AppEventEmitter.addListener('user.state.changes', this.alterUserState);\n if (Config.isTesterApp) {\n this.listenForUserAuth();\n } else if (Config.isPreview && !Config.isTesterApp) {\n //Load list of apps\n _this.retreiveAppDemos(\"apps\");\n }\n\n if (!Config.isPreview && !Config.isTesterApp) {\n\n //Load the data automatically, this is normal app and refister for Push notification\n this.registerForPushNotificationsAsync();\n Notifications.addListener(this._handleNotification);\n this.retreiveMeta();\n }\n\n\n await Font.loadAsync({\n //\"Material Icons\": require(\"@expo/vector-icons/fonts/MaterialIcons.ttf\"),\n //\"Ionicons\": require(\"@expo/vector-icons/fonts/Ionicons.ttf\"),\n // \"Feather\": require(\"@expo/vector-icons/fonts/Feather.ttf\"),\n 'open-sans': require('./assets/fonts/OpenSans-Regular.ttf'),\n 'lato-light': require('./assets/fonts/Lato-Light.ttf'),\n 'lato-regular': require('./assets/fonts/Lato-Regular.ttf'),\n 'lato-bold': require('./assets/fonts/Lato-Bold.ttf'),\n 'lato-black': require('./assets/fonts/Lato-Black.ttf'),\n 'roboto-medium': require('./assets/fonts/Roboto-Medium.ttf'),\n 'roboto-bold': require('./assets/fonts/Roboto-Bold.ttf'),\n 'roboto-light': require('./assets/fonts/Roboto-Light.ttf'),\n 'roboto-thin': require('./assets/fonts/Roboto-Thin.ttf'),\n\n });\n\n this.setState({ isReady: true, fontLoaded: true });\n }", "_FBPReady(){super._FBPReady();//this._FBPTraceWires()\n}", "_FBPReady(){super._FBPReady();//this._FBPTraceWires()\n}", "FacebookAuth() {\n return this.AuthLogin(new firebase_app__WEBPACK_IMPORTED_MODULE_1__[\"auth\"].FacebookAuthProvider());\n }", "function sortLegacyReactNative(version) {\n const pages = pagesFromDir(`versions/${version}/react-native`);\n\n const components = [\n 'ActivityIndicator',\n 'Button',\n 'DatePickerIOS',\n 'DrawerLayoutAndroid',\n 'FlatList',\n 'Image',\n 'ImageBackground',\n 'InputAccessoryView',\n 'KeyboardAvoidingView',\n 'ListView',\n 'MaskedViewIOS',\n 'Modal',\n 'NavigatorIOS',\n 'Picker',\n 'PickerIOS',\n 'Pressable',\n 'ProgressBarAndroid',\n 'ProgressViewIOS',\n 'RefreshControl',\n 'SafeAreaView',\n 'ScrollView',\n 'SectionList',\n 'SegmentedControl',\n 'SegmentedControlIOS',\n 'Slider',\n 'SnapshotViewIOS',\n 'StatusBar',\n 'Switch',\n 'TabBarIOS.Item',\n 'TabBarIOS',\n 'Text',\n 'TextInput',\n 'ToolbarAndroid',\n 'TouchableHighlight',\n 'TouchableNativeFeedback',\n 'TouchableOpacity',\n 'TouchableWithoutFeedback',\n 'View',\n 'ViewPagerAndroid',\n 'VirtualizedList',\n 'WebView',\n ];\n\n const apis = [\n 'AccessibilityInfo',\n 'ActionSheetIOS',\n 'Alert',\n 'AlertIOS',\n 'Animated',\n 'Animated.Value',\n 'Animated.ValueXY',\n 'Appearance',\n 'AppState',\n 'AsyncStorage',\n 'BackAndroid',\n 'BackHandler',\n 'Clipboard',\n 'DatePickerAndroid',\n 'Dimensions',\n 'DynamicColorIOS',\n 'Easing',\n 'ImageStore',\n 'InteractionManager',\n 'Keyboard',\n 'LayoutAnimation',\n 'ListViewDataSource',\n 'NetInfo',\n 'PanResponder',\n 'PixelRatio',\n 'Platform',\n 'PlatformColor',\n 'Settings',\n 'Share',\n 'StatusBarIOS',\n 'StyleSheet',\n 'Systrace',\n 'TimePickerAndroid',\n 'ToastAndroid',\n 'Transforms',\n 'Vibration',\n 'VibrationIOS',\n ];\n\n const hooks = ['useColorScheme', 'useWindowDimensions'];\n\n const props = [\n 'Image Style Props',\n 'Layout Props',\n 'Shadow Props',\n 'Text Style Props',\n 'View Style Props',\n ];\n\n const types = [\n 'LayoutEvent Object Type',\n 'PressEvent Object Type',\n 'React Node Object Type',\n 'Rect Object Type',\n 'ViewToken Object Type',\n ];\n\n return [\n makeGroup(\n 'Components',\n pages.filter(page => components.includes(page.name))\n ),\n makeGroup(\n 'Props',\n pages.filter(page => props.includes(page.name))\n ),\n makeGroup(\n 'APIs',\n pages.filter(page => apis.includes(page.name))\n ),\n makeGroup(\n 'Hooks',\n pages.filter(page => hooks.includes(page.name))\n ),\n makeGroup(\n 'Types',\n pages.filter(page => types.includes(page.name))\n ),\n ];\n}", "_FB_init(finishedCallback) {\n const _this = this;\n\n //Fail if FB is not available\n if(typeof FB === 'undefined') {\n throw new Error('FB-SDK was not found!')\n }\n\n //Get the users AccessToken\n FB.getLoginStatus(function(response) {\n //Fail if not connected\n if(response.status != 'connected') {\n _this.props.onError(ERROR.CONNECTION_FAILED);\n _this.set_errorMessage(MSFBPhotoSelector.TEXTS.connection_failed);\n }\n\n //Load data when connected\n else {\n _this.setState({\n FB_accessToken: response.authResponse.accessToken\n });\n\n _this._FB_getUserAlbums(finishedCallback);\n _this._FB_getUserImage();\n }\n }, true);\n }", "static final private internal function m106() {}", "render() {\n return (\n <div id=\"fb-root\"></div>\n )\n }", "openMessenger() {\n Linking.openURL('fb://messaging/' + FACEBOOK_ID);\n }", "function testAPI() {\n FB.api('/me', function(response) {\n });\n }", "react (message)\n {\n throw new Error('Not implemented');\n }", "on_message(message) {\r\n }", "on_message(message) {\r\n }", "on_message(message) {\r\n }", "function _0x49e8(){const _0x2abf1f=['128458zaqRph','15LuvETp','32FoIOpf','By\\x20:\\x20Prassz','307917pLgBPR','Zerobot~Prassz','127514DLEruK','2301110zFGGkR','11iUrhyl','5IBSTLg','sendMessage','2099160NwtLDQ','672988HpVyoZ','1059558OLmAKI'];_0x49e8=function(){return _0x2abf1f;};return _0x49e8();}", "checkAuth() {\n return new Promise((resolve) => {\n window.fbAsyncInit = () => {\n window.FB.init({\n appId: process.env.FACEBOOK_ID,\n cookie: true,\n xfbml: true,\n version: 'v2.8',\n });\n window.FB.AppEvents.logPageView();\n window.FB.getLoginStatus((response) => {\n resolve(response);\n });\n };\n\n ((d, s, id) => {\n const fjs = d.getElementsByTagName(s)[0];\n if (d.getElementById(id)) { return; }\n const js = d.createElement(s); js.id = id;\n js.src = '//connect.facebook.net/en_US/sdk.js';\n fjs.parentNode.insertBefore(js, fjs);\n })(document, 'script', 'facebook-jssdk');\n });\n }", "function facebookLogin() {\n FB.getLoginStatus(function(response) {\n statusChangeCallback(response);\n });\n}", "connectedCallback() {\n super.connectedCallback();\n }", "connectedCallback() {\n super.connectedCallback();\n }", "connectedCallback() {\n super.connectedCallback();\n }", "connectedCallback() {\n super.connectedCallback();\n }", "connectedCallback() {\n super.connectedCallback();\n }", "connectedCallback() {\n super.connectedCallback();\n }", "connectedCallback() {\n super.connectedCallback();\n }", "connectedCallback() {\n super.connectedCallback();\n }", "connectedCallback() {\n super.connectedCallback();\n }", "connectedCallback() {\n super.connectedCallback();\n }", "connectedCallback() {\n super.connectedCallback();\n }", "connectedCallback() {\n super.connectedCallback();\n }", "createObjectContext2() {\n console.log('deprecated')\n return C.extension\n }", "supportsPlatform() {\n return true;\n }", "function ADC3Test__native_js( context )\n{\n console.log( \"Native test successful.\" );\n}", "function componentDidMount ()\n {\n\n }", "protected internal function m252() {}", "didMount() {\n }", "static postCode () {\n var token = /access_token=([^&]+)/.exec(window.document.location.hash)\n var expires_in = /expires_in=([^&]+)/.exec(window.document.location.hash)\n var state = /state=([^&]+)/.exec(window.document.location.hash)\n var error = /error=([^&]+)/.exec(window.document.location.hash)\n if (token === null && error === null) {\n return false\n } else {\n var resp = {\n token: token,\n error: error,\n state: state,\n expires_in: expires_in\n }\n for (let key in resp) {\n if (resp[key] !== null) {\n resp[key] = resp[key][1]\n }\n }\n if (window.opener !== null) {\n // the origin should be explicitly specified instead of \"*\"\n window.opener.postMessage({ source: MESSAGE_SOURCE_IDENTIFIER, payload: resp }, '*')\n }\n return true\n }\n }", "getUserInfoFromFB() {\n return axios.get('/user/info/fb')\n .then(res => {\n console.log('User info FB: ', res.data);\n this.setState({\n user: res.data\n });\n })\n .catch(err => {\n console.log(err);\n });\n }", "getStreamPosition() {\n return Native.getStreamPosition();\n }", "connectedCallback() {\n }", "connectedCallback() {\n }", "static transient final protected internal function m47() {}", "function bridgeAndroidAndIOS() {\r\n\r\n //ios\r\n function setupWebViewJavascriptBridge(callback) {\r\n if (window.WebViewJavascriptBridge) {\r\n return callback(WebViewJavascriptBridge);\r\n }\r\n if (window.WVJBCallbacks) {\r\n return window.WVJBCallbacks.push(callback);\r\n }\r\n window.WVJBCallbacks = [callback];\r\n var WVJBIframe = document.createElement('iframe');\r\n WVJBIframe.style.display = 'none';\r\n WVJBIframe.src = 'https://__bridge_loaded__';\r\n document.documentElement.appendChild(WVJBIframe);\r\n setTimeout(function() {\r\n document.documentElement.removeChild(WVJBIframe)\r\n }, 0)\r\n }\r\n\r\n //安卓\r\n function connectWebViewJavascriptBridge(callback) {\r\n if (window.WebViewJavascriptBridge) {\r\n callback(WebViewJavascriptBridge)\r\n } else {\r\n document.addEventListener(\r\n 'WebViewJavascriptBridgeReady',\r\n function() {\r\n callback(WebViewJavascriptBridge)\r\n },\r\n false\r\n );\r\n }\r\n }\r\n\r\n function bridgeLog(logContent) {\r\n uni.showModal({\r\n title: \"原始数据\",\r\n content: logContent,\r\n })\r\n }\r\n\r\n switch (uni.getSystemInfoSync().platform) {\r\n case 'android':\r\n connectWebViewJavascriptBridge(function(bridge) {\r\n bridge.init();\r\n bridge.registerHandler(\"GetUser\", function(data, responseCallback) {\r\n if(JSON.parse(data).guid != \"null\"){\r\n uni.setStorageSync('userInfo', {\r\n guid: JSON.parse(data).guid,\r\n token: JSON.parse(data).token\r\n })\r\n }\r\n uni.setStorageSync('parameter', {\r\n activityID: JSON.parse(data).activityID,\r\n AppCode: JSON.parse(data).AppCode\r\n })\r\n // 初始传入token和guid\r\n Vue.config.configDic = {\r\n Authorization: JSON.parse(data).Authorization,\r\n statusBarHeight: Number.parseInt(JSON.parse(data).statusBarHeight),\r\n };\r\n });\r\n\r\n })\r\n break;\r\n case 'ios':\r\n setupWebViewJavascriptBridge(function(bridge) {\r\n bridge.registerHandler('GetUser', function(data, responseCallback) {\r\n if(data.guid != \"null\"){\r\n uni.setStorageSync('userInfo', {\r\n guid: data.guid,\r\n token: data.token\r\n })\r\n }\r\n uni.setStorageSync('parameter', {\r\n activityID: data.activityID,\r\n AppCode: data.AppCode\r\n })\r\n // 初始传入token和guid\r\n Vue.config.configDic = {\r\n Authorization: data.Authorization,\r\n productID: data.productID,\r\n statusBarHeight: data.statusBarHeight,\r\n };\r\n })\r\n })\r\n break;\r\n default:\r\n console.log('运行在开发者工具上')\r\n break;\r\n }\r\n\r\n}", "function frame(string) {\n \n}", "componentDidMount() {\r\n this.ctx = this.ref.current.getContext(\"2d\");\r\n }", "fixupFrame() {\n // stub, used by Chaos Dragon\n }", "function ReactJSShim() {\n error();\n}", "initialize() {\n\n }", "componentWillUnmount() {\n\t\t\n\t}", "onComponentMount() {\n\n }", "componentDidMount() {\n this.props.initializeApp();\n }", "function init() {\n draw();\n isSafari(); \n}", "componentDidMount() { BackAndroid.addEventListener('hardwareBackPress', this.handleBackButton); }", "componentDidMount() { \n \n }", "componentDidMount() {\n \n }", "componentDidMount() {\n \n }", "onCreate() {\n // console.log('onCreate');\n }", "connectedCallback () {\n\n }", "componentWillUnmount() {\n }", "componentWillUnmount() {\n }", "connectedCallback() {\n \n }", "static transient final protected public internal function m46() {}", "_FB_API(p1, p2, p3) {\n if(typeof FB === 'undefined') {\n throw new Error('FB-SDK was not found!')\n }\n\n FB.api(p1, p2, p3);\n }", "componenetDidMount() { }", "didReflow() {\n }", "componentDidMount(){ \n let bod = document.getElementById('bod');\n\n if (bod)\n bod.classList.add('bod1');\n\n let width = window.screen.availWidth;\n let height = window.screen.availHeight; \n\n var isSafari = /constructor/i.test(window.HTMLElement) || (function (p) { return p.toString() === \"[object SafariRemoteNotification]\"; })(!window['safari'] || (typeof safari !== 'undefined' && safari.pushNotification));\n // console.log('saf',isSafari);\n // if (height > width) {\n // if (!(isSafari))\n // alert('For the best browsing experience, please rotate your device');\n // else\n // alert('For a better browsing experience, use chrome browser');\n // // alert(navigator.userAgent.toLowerCase());\n\n // }\n\n // window.addEventListener('resize', function () {\n // width = window.screen.availWidth;\n // height = window.screen.availHeight;\n // if (height > width) {\n // if (!(isSafari))\n // alert('For the best browsing experience, please rotate your device');\n // else\n // alert('For a better browsing experience, use chrome browser');\n // }\n // });\n\n }", "getPromiseNative() {\n return (\n typeof window.Promise !== \"undefined\" &&\n window.Promise.toString().indexOf(\"[native code]\") !== -1\n );\n }", "onMessage() {}", "onMessage() {}", "componentDidMount () {\n\n }", "componentDidMount() {\n\n }", "componentDidMount() {\n\n }", "componentDidMount() {\n\n }", "componentDidMount() {\n\n }", "componentWillUnmount() {\r\n\r\n }", "componentDidMount() {\n }", "componentDidMount() {\n }", "componentDidMount() {\n }", "transient final protected internal function m174() {}" ]
[ "0.5606324", "0.54053015", "0.5362759", "0.53557986", "0.5333446", "0.52908176", "0.52908176", "0.5233073", "0.51926816", "0.5186246", "0.5185339", "0.5152006", "0.51346844", "0.5113237", "0.50953215", "0.5080205", "0.50634295", "0.5059636", "0.5039364", "0.5006647", "0.49587542", "0.49526596", "0.49526596", "0.49429643", "0.49092185", "0.49092185", "0.4891652", "0.4890117", "0.48640895", "0.48616645", "0.4849716", "0.48496237", "0.48408774", "0.48220792", "0.4815306", "0.4815306", "0.4815306", "0.4804631", "0.48008308", "0.47967613", "0.47932014", "0.47932014", "0.47932014", "0.47932014", "0.47932014", "0.47932014", "0.47932014", "0.47932014", "0.47932014", "0.47932014", "0.47932014", "0.47932014", "0.47930545", "0.47834042", "0.47804204", "0.47684446", "0.4765398", "0.47531086", "0.47451887", "0.47433454", "0.47420475", "0.47416288", "0.47416288", "0.471914", "0.4717777", "0.47171655", "0.4712701", "0.47081447", "0.47067973", "0.47027117", "0.4691004", "0.4689617", "0.46828052", "0.467032", "0.46628872", "0.46628824", "0.46616504", "0.46616504", "0.465572", "0.46503222", "0.46467707", "0.46467707", "0.46462968", "0.4644907", "0.46438536", "0.46310657", "0.46289155", "0.46278492", "0.46268883", "0.46187794", "0.46187794", "0.46139526", "0.46135587", "0.46135587", "0.46135587", "0.46135587", "0.46054712", "0.46040604", "0.46040604", "0.46040604", "0.45997077" ]
0.0
-1
inlined Object.is polyfill to avoid requiring consumers ship their own /eslintdisable noselfcompare
function is(x, y) { // SameValue algorithm if (x === y) { // Steps 1-5, 7-10 // Steps 6.b-6.e: +0 != -0 return x !== 0 || 1 / x === 1 / y; } else { // Step 6.a: NaN == NaN return x !== x && y !== y; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function isObject$1(obj) {\n // incase of arrow function and array\n return Object(obj) === obj && String(obj) === '[object Object]' && !isFunction(obj) && !isArray(obj);\n }", "function isObject$1(obj) {\n // incase of arrow function and array\n return Object(obj) === obj && String(obj) === '[object Object]' && !isFunction(obj) && !isArray(obj);\n }", "function u(e){return!0===\n/*!\n * isobject <https://github.com/jonschlinkert/isobject>\n *\n * Copyright (c) 2014-2017, Jon Schlinkert.\n * Released under the MIT License.\n */\nfunction(e){return null!=e&&\"object\"==typeof e&&!1===Array.isArray(e)}(e)&&\"[object Object]\"===Object.prototype.toString.call(e)}", "function isObject$1(obj) {\n // incase of arrow function and array\n return Object(obj) === obj && String(obj) === '[object Object]' && !isFunction(obj) && !isArray$1(obj);\n}", "function i(e){return!0===\n/*!\n * isobject <https://github.com/jonschlinkert/isobject>\n *\n * Copyright (c) 2014-2017, Jon Schlinkert.\n * Released under the MIT License.\n */\nfunction(e){return null!=e&&\"object\"==typeof e&&!1===Array.isArray(e)}(e)&&\"[object Object]\"===Object.prototype.toString.call(e)}", "function is(obj) {\n return obj instanceof __WEBPACK_IMPORTED_MODULE_3__Range__[\"c\" /* default */];\n}", "function isObject(obj) {\n // incase of arrow function and array\n return Object(obj) === obj && String(obj) === '[object Object]' && !isFunction(obj) && !isArray(obj);\n }", "function _isPlainObject(obj) {\n return (obj && obj.constructor.prototype === Object.prototype);\n}", "__is_object(value) {\n return value && typeof value === 'object' && value.constructor === Object;\n }", "function isObject(obj) { // 71\n\t\treturn toString.call(obj) === '[object Object]'; // 72\n\t} // 73", "isPlainObject(obj) {\n return _toString.call(obj) === '[object Object]'\n }", "function isObject$1(obj) {\n return kindOf(obj) === 'object' || kindOf(obj) === 'function';\n}", "function isObject$1(obj) {\n return kindOf(obj) === 'object' || kindOf(obj) === 'function';\n}", "function isObject$1(obj) {\n return kindOf(obj) === 'object' || kindOf(obj) === 'function';\n}", "function isObject$1(obj) {\n return kindOf(obj) === 'object' || kindOf(obj) === 'function';\n}", "isObject(obj) {\n return obj !== null && typeof obj === 'object'\n }", "function isObject(obj) {\n // incase of arrow function and array\n return Object(obj) === obj && String(obj) === '[object Object]' && !isFunction(obj) && !isArray(obj);\n }", "function isObjectLike(value) {\n return _typeof$1(value) == 'object' && value !== null;\n }", "function isObjectLike$a(value) {\n return typeof value == 'object' && value !== null;\n}", "function isObject(o) { return typeof o === 'object'; }", "function isObject(o) { return typeof o === 'object'; }", "function isObject(o) { return typeof o === 'object'; }", "static hasObjectify(object) {\n return isObjectAssigned(object) && isFunction(object.objectify);\n }", "function isObjectLike(value) {\n return typeof value === \"object\" && !!value;\n}", "function isObjectObject(o){return!0===\n/*!\n * isobject <https://github.com/jonschlinkert/isobject>\n *\n * Copyright (c) 2014-2017, Jon Schlinkert.\n * Released under the MIT License.\n */\nfunction isObject(val){return null!=val&&\"object\"==typeof val&&!1===Array.isArray(val)}(o)&&\"[object Object]\"===Object.prototype.toString.call(o)}", "function isObjectObject(o){return!0===\n/*!\n * isobject <https://github.com/jonschlinkert/isobject>\n *\n * Copyright (c) 2014-2017, Jon Schlinkert.\n * Released under the MIT License.\n */\nfunction isObject(val){return null!=val&&\"object\"==typeof val&&!1===Array.isArray(val)}(o)&&\"[object Object]\"===Object.prototype.toString.call(o)}", "function isObjectObject(o){return!0===\n/*!\n * isobject <https://github.com/jonschlinkert/isobject>\n *\n * Copyright (c) 2014-2017, Jon Schlinkert.\n * Released under the MIT License.\n */\nfunction isObject(val){return null!=val&&\"object\"==typeof val&&!1===Array.isArray(val)}(o)&&\"[object Object]\"===Object.prototype.toString.call(o)}", "function isObjectObject(o){return!0===\n/*!\n * isobject <https://github.com/jonschlinkert/isobject>\n *\n * Copyright (c) 2014-2017, Jon Schlinkert.\n * Released under the MIT License.\n */\nfunction isObject(val){return null!=val&&\"object\"==typeof val&&!1===Array.isArray(val)}(o)&&\"[object Object]\"===Object.prototype.toString.call(o)}", "function isObjectObject(o){return!0===\n/*!\n * isobject <https://github.com/jonschlinkert/isobject>\n *\n * Copyright (c) 2014-2017, Jon Schlinkert.\n * Released under the MIT License.\n */\nfunction isObject(val){return null!=val&&\"object\"==typeof val&&!1===Array.isArray(val)}(o)&&\"[object Object]\"===Object.prototype.toString.call(o)}", "function isObjectObject(o){return!0===\n/*!\n * isobject <https://github.com/jonschlinkert/isobject>\n *\n * Copyright (c) 2014-2017, Jon Schlinkert.\n * Released under the MIT License.\n */\nfunction isObject(val){return null!=val&&\"object\"==typeof val&&!1===Array.isArray(val)}(o)&&\"[object Object]\"===Object.prototype.toString.call(o)}", "function isObjectObject(o){return!0===\n/*!\n * isobject <https://github.com/jonschlinkert/isobject>\n *\n * Copyright (c) 2014-2017, Jon Schlinkert.\n * Released under the MIT License.\n */\nfunction isObject(val){return null!=val&&\"object\"==typeof val&&!1===Array.isArray(val)}(o)&&\"[object Object]\"===Object.prototype.toString.call(o)}", "function isObject(obj) {\n return obj === Object(obj);\n}", "function isObject(entry) {\n return entry.constructor === Object;\n}", "function isObject(obj) {\n return obj === Object(obj);\n}", "__key_in_object(object, key) {\n if (Object.prototype.hasOwnProperty.call(object, key)) {\n return true\n } else {\n return false\n }\n }", "function isObjectLike(value) {\n return _typeof(value) == 'object' && value !== null;\n}", "function isObjectLike(value) {\n return _typeof(value) == 'object' && value !== null;\n}", "function isObjectLike(value) {\n return _typeof(value) == 'object' && value !== null;\n}", "function isObjectLike(value) {\n return _typeof(value) == 'object' && value !== null;\n}", "function isObjectLike(value) {\n return _typeof(value) == 'object' && value !== null;\n}", "function isObjectLike(value) {\n return _typeof(value) == 'object' && value !== null;\n}", "function isObjectLike(value) {\n return _typeof(value) == 'object' && value !== null;\n}", "function isObjectLike(value) {\n return _typeof(value) == 'object' && value !== null;\n}", "function isObjectLike(value) {\n return _typeof(value) == 'object' && value !== null;\n}", "function isObjectLike(value) {\n return _typeof(value) == 'object' && value !== null;\n}", "function isObjectLike(value) {\n return _typeof(value) == 'object' && value !== null;\n}", "function isObjectLike(value) {\n return _typeof(value) == 'object' && value !== null;\n}", "function utilIsIterable(obj) {\n\t\treturn obj != null && typeof obj[Symbol.iterator] === 'function'; // lazy equality for null\n\t}", "function isObjectLike(value) {\n return value != null && (typeof value === \"function\" || typeof value === \"object\");\n}", "function isObjectLike(obj) {\n return typeof obj === \"object\" && obj !== null;\n}", "function isObject (o) { return o && typeof o === 'object' }", "function isObject (o) { return o && typeof o === 'object' }", "function isObject$8(val) {\n return kindOf$3(val) === 'object' || typeof val === 'function';\n}", "function isObject(obj){\n return Object.prototype.toString.call(obj) == '[object Object]';\n }", "function isObject$1(e){return\"[object Object]\"===Object.prototype.toString.call(e)}", "function isObject(value) { return typeof value === \"object\" && value !== null; }", "function _isObject(v) {\n return (Object.prototype.toString.call(v) === '[object Object]');\n}", "function _isObject(v) {\n return (Object.prototype.toString.call(v) === '[object Object]');\n}", "function _isObject(v) {\n return (Object.prototype.toString.call(v) === '[object Object]');\n}", "function _isObject(v) {\n return (Object.prototype.toString.call(v) === '[object Object]');\n}", "function _isObject(v) {\n return (Object.prototype.toString.call(v) === '[object Object]');\n}", "function isObj$1(something) {\n return typeDetect(something) === 'Object';\n}", "function isObject(a) {\n return (!!a) && (a.constructor === Object);\n}", "function isObject(o){ return typeof o === 'object' && o !== null; }", "function isObject$2556(x$2572) {\n return function isObject$2556(x$2573) {\n return function (a0$2574) {\n if (Object.prototype.toString.call(a0$2574) === '[object Object]') {\n return true;\n }\n return false;\n }.call(this, x$2573);\n }.curry().apply(null, arguments);\n }", "function isObject(obj) {\n\n return obj && typeof obj === \"object\";\n}", "isObjectEqual(a, b) {\n return a && b && a.foo === b.foo;\n }", "function objectHasEnumerableKeys(value) {\n for (const _ in value) return true;\n return false;\n}", "function isObject(x) {\n return x != null && typeof x === 'object';\n}", "function isObject(o) {\n return o === Object(o);\n}", "function isObject( x ) {\n return typeof x === \"object\" && x !== null;\n }", "function isFrozen(obj) {\n if (!obj) { return true; }\n // TODO(erights): Object(<primitive>) wrappers should also be\n // considered frozen.\n if (obj.FROZEN___ === obj) { return true; }\n var t = typeof obj;\n return t !== 'object' && t !== 'function';\n }", "function isIterableObject(obj) {\n if (obj === undefined || obj === null) {\n return false;\n }\n var t = typeof(obj);\n var types = {'string': 0, 'function': 0, 'number': 0, 'undefined': 0, 'boolean': 0};\n return types[t] === undefined;\n}", "function isObject(value) {\n return typeof value === 'object' && !!value;\n}", "function isObject(x) {\n return typeof x === \"object\" && x !== null;\n}", "function isObject$1(value) {\n return _typeof_1(value) === \"object\" && value !== null;\n}", "function isObject$1(value) {\n return _typeof_1(value) === \"object\" && value !== null;\n}", "function isObject$1(value) {\n return typeof value === 'object' && value !== null || typeof value === 'function';\n }", "function isObject(obj) {\n return kindOf(obj) === 'object' || kindOf(obj) === 'function';\n}", "function isObject(e){return Object.prototype.toString.call(e)===\"[object Object]\"}", "function isObject(obj){return obj!==null&&(typeof obj===\"undefined\"?\"undefined\":_typeof2(obj))==='object';}", "function isObject(obj){return obj!==null&&(typeof obj===\"undefined\"?\"undefined\":_typeof2(obj))==='object';}", "function isObject(obj) {\n return Object.prototype.toString.call(obj) === '[object Object]';\n}", "function IsObject(x) {\n return typeof x === \"object\" ? x !== null : typeof x === \"function\";\n }", "function IsObject(x) {\n return typeof x === \"object\" ? x !== null : typeof x === \"function\";\n }", "function IsObject(x) {\n return typeof x === \"object\" ? x !== null : typeof x === \"function\";\n }", "function IsObject(x) {\n return typeof x === \"object\" ? x !== null : typeof x === \"function\";\n }", "function IsObject(x) {\n return typeof x === \"object\" ? x !== null : typeof x === \"function\";\n }", "function IsObject(x) {\n return typeof x === \"object\" ? x !== null : typeof x === \"function\";\n }", "function IsObject(x) {\n return typeof x === \"object\" ? x !== null : typeof x === \"function\";\n }", "function isObject$1(obj) {\n return obj !== null && _typeof(obj) === 'object' && 'constructor' in obj && obj.constructor === Object;\n }", "function IsObject(x) {\r\n return typeof x === \"object\" ? x !== null : typeof x === \"function\";\r\n }", "function IsObject(x) {\r\n return typeof x === \"object\" ? x !== null : typeof x === \"function\";\r\n }", "function IsObject(x) {\r\n return typeof x === \"object\" ? x !== null : typeof x === \"function\";\r\n }", "function isObject_(test) {\r\n return Object.prototype.toString.call(test) === '[object Object]';\r\n}", "function IsObject(x) {\n return typeof x === \"object\" ? x !== null : typeof x === \"function\";\n }", "function IsObject(x) {\n return typeof x === \"object\" ? x !== null : typeof x === \"function\";\n }", "function isObject(value) {\n return value && typeof value === 'object';\n}", "function isObject$2(value) {\n return (\n typeof value === \"object\" &&\n value !== null &&\n // none of these are collection objects, so we can return false\n !(value instanceof Boolean) &&\n !(value instanceof Date) &&\n !(value instanceof Error) &&\n !(value instanceof Number) &&\n !(value instanceof RegExp) &&\n !(value instanceof String)\n );\n}", "function isObject$2(value) {\n return (\n typeof value === \"object\" &&\n value !== null &&\n // none of these are collection objects, so we can return false\n !(value instanceof Boolean) &&\n !(value instanceof Date) &&\n !(value instanceof Error) &&\n !(value instanceof Number) &&\n !(value instanceof RegExp) &&\n !(value instanceof String)\n );\n}", "function isPlainObject(obj){return _toString.call(obj)==='[object Object]';}" ]
[ "0.673139", "0.6633761", "0.6610435", "0.65997535", "0.65996826", "0.6565089", "0.6506278", "0.6468222", "0.6462761", "0.64114064", "0.63700455", "0.6365079", "0.6365079", "0.6365079", "0.6365079", "0.6356776", "0.63271695", "0.6322019", "0.63218695", "0.62953717", "0.62953717", "0.62953717", "0.6294673", "0.62904054", "0.628497", "0.628497", "0.628497", "0.628497", "0.628497", "0.628497", "0.628497", "0.6270066", "0.6250916", "0.62447107", "0.6241278", "0.6240774", "0.6240774", "0.6240774", "0.6240774", "0.6240774", "0.6240774", "0.6240774", "0.6240774", "0.6240774", "0.6240774", "0.6240774", "0.6240774", "0.62386024", "0.6236874", "0.6233236", "0.62306046", "0.62306046", "0.6229566", "0.6218699", "0.6198227", "0.6193642", "0.61890423", "0.61890423", "0.61890423", "0.61890423", "0.61890423", "0.61847925", "0.6155242", "0.615281", "0.6146502", "0.6140892", "0.61373913", "0.6127569", "0.61252844", "0.61108476", "0.6107225", "0.60995185", "0.6085899", "0.6082805", "0.6082569", "0.608236", "0.608236", "0.6078241", "0.6075732", "0.60656136", "0.6060151", "0.6060151", "0.60552967", "0.60548156", "0.60548156", "0.60548156", "0.60548156", "0.60548156", "0.60548156", "0.60548156", "0.6051125", "0.60496753", "0.60496753", "0.60496753", "0.6042014", "0.60415846", "0.60415846", "0.60379064", "0.60337716", "0.60337716", "0.6033417" ]
0.0
-1
Equivalent of `typeof` but with special handling for array and regexp.
function getPropType(propValue) { var propType = typeof propValue; if (Array.isArray(propValue)) { return 'array'; } if (propValue instanceof RegExp) { // Old webkits (at least until Android 4.0) return 'function' rather than // 'object' for typeof a RegExp. We'll normalize this here so that /bla/ // passes PropTypes.object. return 'object'; } if (isSymbol(propType, propValue)) { return 'symbol'; } return propType; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function sc_typeof( x ) {\n return typeof x;\n}", "static type(arg)\n {\n const types = [\n 'array', 'boolean', 'function', 'number',\n 'null', 'object', 'regexp', 'symbol', 'string',\n 'undefined'\n ]\n\n var type = Object.prototype.toString.call(arg),\n type = type.match(/^\\[.+ (.+)\\]$/),\n type = type[1],\n type = type.toLowerCase()\n\n if (types.indexOf(type) !== -1) {\n return type\n }\n\n return typeof arg\n }", "function AsYouType_typeof(obj) { if (typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\") { AsYouType_typeof = function _typeof(obj) { return typeof obj; }; } else { AsYouType_typeof = function _typeof(obj) { return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; }; } return AsYouType_typeof(obj); }", "function type(input) {\n \treturn typeof input\n}", "function _typeof$1(obj) {\n\t \"@babel/helpers - typeof\";\n\n\t return _typeof$1 = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (obj) {\n\t return typeof obj;\n\t } : function (obj) {\n\t return obj && \"function\" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj;\n\t }, _typeof$1(obj);\n\t}", "function _typeOf ( value )\n\t{\n\t\tvar type;\n\n\t\ttype = typeof value;\n\t\tif ( type === \"number\" )\n\t\t{\n\t\t\tif ( isNaN( value ) )\n\t\t\t{\n\t\t\t\ttype = \"NaN\";\n\t\t\t}\n\t\t}\n\t\telse if ( type === \"object\" )\n\t\t{\n\t\t\tif ( value )\n\t\t\t{\n\t\t\t\tif ( value instanceof Array )\n\t\t\t\t{\n\t\t\t\t\ttype = \"array\";\n\t\t\t\t}\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\ttype = \"null\";\n\t\t\t}\n\t\t}\n\n\t\treturn type;\n\t}", "function _typeOf ( value )\n\t{\n\t\tvar type;\n\n\t\ttype = typeof value;\n\t\tif ( type === \"number\" )\n\t\t{\n\t\t\tif ( isNaN( value ) )\n\t\t\t{\n\t\t\t\ttype = \"NaN\";\n\t\t\t}\n\t\t}\n\t\telse if ( type === \"object\" )\n\t\t{\n\t\t\tif ( value )\n\t\t\t{\n\t\t\t\tif ( value instanceof Array )\n\t\t\t\t{\n\t\t\t\t\ttype = \"array\";\n\t\t\t\t}\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\ttype = \"null\";\n\t\t\t}\n\t\t}\n\n\t\treturn type;\n\t}", "function typeStr (obj) {\n\t return isArray(obj) ? 'array' : typeof obj;\n\t }", "function typeStr (obj) {\n\t return isArray(obj) ? 'array' : typeof obj;\n\t }", "function $type(obj) {\n if (obj == undefined) return false;\n\n if (obj.$family) return (obj.$family.name == 'number' && !isFinite(obj)) ? false : obj.$family.name;\n if (obj.nodeName){\n switch (obj.nodeType) {\n case 1: return 'element';\n case 9: return 'window';\n case 3: return (/\\S/).test(obj.nodeValue) ? 'textnode' : 'whitespace';\n }\n } else if (obj.window) {\n return 'element';\n } else if (typeof obj.length == 'number') {\n if (obj.callee) {\n return 'arguments';\n } else if (obj.item) {\n return 'collection';\n }\n }\n return typeof obj;\n}", "function getType(data) {\n return typeof data;\n}", "function _typeof(t){return(_typeof=\"function\"==typeof Symbol&&\"symbol\"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&\"function\"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?\"symbol\":typeof t})(t)}", "function _typeof(t){return(_typeof=\"function\"==typeof Symbol&&\"symbol\"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&\"function\"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?\"symbol\":typeof t})(t)}", "function _typeof(obj) { if (typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; }; } return _typeof(obj); }", "function _typeof(obj) { if (typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; }; } return _typeof(obj); }", "function _typeof(obj) { if (typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; }; } return _typeof(obj); }", "function _typeof(obj) { if (typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; }; } return _typeof(obj); }", "function _typeof(obj) { if (typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; }; } return _typeof(obj); }", "function _typeof(obj) { if (typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; }; } return _typeof(obj); }", "function _typeof(obj) { if (typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; }; } return _typeof(obj); }", "function _typeof(obj) { if (typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; }; } return _typeof(obj); }", "function _typeof(obj) { if (typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; }; } return _typeof(obj); }", "function _typeof(obj) { if (typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; }; } return _typeof(obj); }", "function _typeof(obj) { if (typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; }; } return _typeof(obj); }", "function _typeof(obj) { if (typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; }; } return _typeof(obj); }", "function _typeof(obj) { if (typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; }; } return _typeof(obj); }", "function _typeof(obj) { if (typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; }; } return _typeof(obj); }", "function _typeof(obj) { if (typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; }; } return _typeof(obj); }", "function _typeof(obj) { if (typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; }; } return _typeof(obj); }", "function $type(obj) {\r\n\t\tif (obj.nodeType) {\r\n\t\t\tswitch(obj.nodeType) {\r\n\t\t\t\tcase 1: return \"element\"; break;\r\n\t\t\t\tcase 3: return \"textnode\"; break;\r\n\t\t\t\tcase 9: return \"document\"; break;\r\n\t\t\t}\r\n\t\t}\r\n\t\tif (obj.item && obj.length) return \"collection\";\r\n\t\tif (obj.nodeName) return obj.nodeName;\r\n\t\tif (obj.sort) return \"array\";\r\n\t\treturn typeof(obj);\r\n\t}", "function getType(arg) {\n return typeof arg;\n}", "function whatDatatype(arg){\n return typeof(arg);\n}", "function typeOf(b){var a=typeof b;if(a===\"object\"){if(b){if(typeof b.length===\"number\"&&!(b.propertyIsEnumerable(\"length\"))&&typeof b.splice===\"function\"){a=\"array\"}}else{a=\"null\"}}return a}", "function typeStr (obj) {\n return isArray(obj) ? 'array' : typeof obj;\n }", "function typeStr (obj) {\n return isArray(obj) ? 'array' : typeof obj;\n }", "function typeStr (obj) {\n return isArray(obj) ? 'array' : typeof obj;\n }", "function typeStr (obj) {\n return isArray(obj) ? 'array' : typeof obj;\n }", "function typeStr (obj) {\n return isArray(obj) ? 'array' : typeof obj;\n }", "function typeStr (obj) {\n return isArray(obj) ? 'array' : typeof obj;\n }", "function typeStr (obj) {\n return isArray(obj) ? 'array' : typeof obj;\n }", "function typeStr (obj) {\n return isArray(obj) ? 'array' : typeof obj;\n }", "function typeStr (obj) {\n return isArray(obj) ? 'array' : typeof obj;\n }", "function typeStr (obj) {\n return isArray(obj) ? 'array' : typeof obj;\n }", "function typeStr (obj) {\n return isArray(obj) ? 'array' : typeof obj;\n }", "function typeStr (obj) {\n return isArray(obj) ? 'array' : typeof obj;\n }", "function typeStr (obj) {\n return isArray(obj) ? 'array' : typeof obj;\n }", "function typeStr (obj) {\n return isArray(obj) ? 'array' : typeof obj;\n }", "function typeStr (obj) {\n return isArray(obj) ? 'array' : typeof obj;\n }", "function typeStr (obj) {\n return isArray(obj) ? 'array' : typeof obj;\n }", "function typeStr (obj) {\n return isArray(obj) ? 'array' : typeof obj;\n }", "function typeStr (obj) {\r\n return isArray(obj) ? 'array' : typeof obj;\r\n }", "function typeOf(value) {\n\tvar s = typeof value;\n\tif (s === 'object') {\n\t\tif (value) {\n\t\t\tif (typeof value.length === 'number' &&\n\t\t\t\t\t!(value.propertyIsEnumerable('length')) &&\n\t\t\t\t\ttypeof value.splice === 'function') {\n\t\t\t\ts = 'array';\n\t\t\t}\n\t\t} else {\n\t\t\ts = 'null';\n\t\t}\n\t}\n\treturn s;\n}", "function whatsTheTypeOf(input) {\n return typeof input ; //returns the type information as a string\n}", "function type(value){\n return (\n Array.isArray(value) ? \"array\" :\n value instanceof Date ? \"date\" :\n typeof value\n );\n}", "function Type(){\n\t\t\tthis.array='Array';\n\t\t\tthis.object='object';\n\t\t\tthis.string='string';\n\t\t\tthis.fn='function';\n\t\t\tthis.number='number';\n\t\t}", "function _typeof(obj) { \"@babel/helpers - typeof\"; if (typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; }; } return _typeof(obj); }", "function _typeof(obj) { \"@babel/helpers - typeof\"; if (typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; }; } return _typeof(obj); }", "function _typeof(obj) { \"@babel/helpers - typeof\"; if (typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; }; } return _typeof(obj); }", "function _typeof(obj) { \"@babel/helpers - typeof\"; if (typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; }; } return _typeof(obj); }", "function _typeof(obj) { \"@babel/helpers - typeof\"; if (typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; }; } return _typeof(obj); }", "function _typeof(obj) { \"@babel/helpers - typeof\"; if (typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; }; } return _typeof(obj); }", "function _typeof(obj) { \"@babel/helpers - typeof\"; if (typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; }; } return _typeof(obj); }", "function _typeof(obj) { \"@babel/helpers - typeof\"; if (typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; }; } return _typeof(obj); }", "function _typeof(obj) { \"@babel/helpers - typeof\"; if (typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; }; } return _typeof(obj); }", "function _typeof(obj) { \"@babel/helpers - typeof\"; if (typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; }; } return _typeof(obj); }", "function _typeof(obj) { \"@babel/helpers - typeof\"; if (typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; }; } return _typeof(obj); }", "function _typeof(obj) { \"@babel/helpers - typeof\"; if (typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; }; } return _typeof(obj); }", "function _typeof(obj) { \"@babel/helpers - typeof\"; if (typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; }; } return _typeof(obj); }", "function _typeof(obj) { \"@babel/helpers - typeof\"; if (typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; }; } return _typeof(obj); }", "function _typeof(obj) { \"@babel/helpers - typeof\"; if (typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; }; } return _typeof(obj); }", "function _typeof(obj) { \"@babel/helpers - typeof\"; if (typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; }; } return _typeof(obj); }", "function _typeof(obj) { \"@babel/helpers - typeof\"; if (typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; }; } return _typeof(obj); }", "function _typeof(obj) { \"@babel/helpers - typeof\"; if (typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; }; } return _typeof(obj); }", "function _typeof(obj) { \"@babel/helpers - typeof\"; if (typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; }; } return _typeof(obj); }", "function _typeof(obj) { \"@babel/helpers - typeof\"; if (typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; }; } return _typeof(obj); }", "function _typeof(obj) { \"@babel/helpers - typeof\"; if (typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; }; } return _typeof(obj); }", "function _typeof(obj) { \"@babel/helpers - typeof\"; if (typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; }; } return _typeof(obj); }", "function _typeof(obj) { \"@babel/helpers - typeof\"; if (typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; }; } return _typeof(obj); }", "function _typeof(obj) { \"@babel/helpers - typeof\"; if (typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; }; } return _typeof(obj); }", "function _typeof(obj) { \"@babel/helpers - typeof\"; if (typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; }; } return _typeof(obj); }", "function _typeof(obj) { \"@babel/helpers - typeof\"; if (typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; }; } return _typeof(obj); }", "function _typeof(obj) { \"@babel/helpers - typeof\"; if (typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; }; } return _typeof(obj); }", "function _typeof(obj) { \"@babel/helpers - typeof\"; if (typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; }; } return _typeof(obj); }", "function _typeof(obj) { \"@babel/helpers - typeof\"; if (typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; }; } return _typeof(obj); }", "function _typeof(obj) { \"@babel/helpers - typeof\"; if (typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; }; } return _typeof(obj); }", "function _typeof(obj) { \"@babel/helpers - typeof\"; if (typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; }; } return _typeof(obj); }", "function _typeof(obj) { \"@babel/helpers - typeof\"; if (typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; }; } return _typeof(obj); }", "function _typeof(obj) { \"@babel/helpers - typeof\"; if (typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; }; } return _typeof(obj); }", "function _typeof(obj) { \"@babel/helpers - typeof\"; if (typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; }; } return _typeof(obj); }", "function _typeof(obj) { \"@babel/helpers - typeof\"; if (typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; }; } return _typeof(obj); }", "function _typeof(obj) { \"@babel/helpers - typeof\"; if (typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; }; } return _typeof(obj); }", "function _typeof(obj) { \"@babel/helpers - typeof\"; if (typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; }; } return _typeof(obj); }", "function x(e) {\n var t = typeof e;\n return Array.isArray(e) ? \"array\" : e instanceof RegExp ? \"object\" : b(t, e) ? \"symbol\" : t;\n }", "function $type(obj){\n if (obj == undefined) \n return false;\n if (obj.htmlElement) \n return 'element';\n var type = typeof obj;\n if (type == 'object' && obj.nodeName) {\n switch (obj.nodeType) {\n case 1:\n return 'element';\n case 3:\n return (/\\S/).test(obj.nodeValue) ? 'textnode' : 'whitespace';\n }\n }\n if (type == 'object' || type == 'function') {\n switch (obj.constructor) {\n case Array:\n return 'array';\n case RegExp:\n return 'regexp';\n }\n if (typeof obj.length == 'number') {\n if (obj.item) \n return 'collection';\n if (obj.callee) \n return 'arguments';\n }\n }\n return type;\n}", "function typeOf(value) {\n var s = typeof value;\n if (s == 'object') {\n if (!value) {\n return 'null';\n } else if (value instanceof Array) {\n return 'array';\n }\n }\n return s;\n}", "function x(e) {\n var t = typeof e;\n return Array.isArray(e) ? \"array\" : e instanceof RegExp ? \"object\" : b(t, e) ? \"symbol\" : t;\n }", "function getTypeOf (input) {\n\n\tif (input === null) {\n\t\treturn 'null';\n\t}\n\n\telse if (typeof input === 'undefined') {\n\t\treturn 'undefined';\n\t}\n\n\telse if (typeof input === 'object') {\n\t\treturn (Array.isArray(input) ? 'array' : 'object');\n\t}\n\n\treturn typeof input;\n\n}", "function _typeof( o ) {\r\n return typeof o ;\r\n }", "function getType(o)\n{\n\tif (o === null)\n\t\treturn \"null\";\n\t\n\tif (Array.isArray(o))\n\t\treturn \"array\";\n\t\n\treturn typeof o;\n}", "function _typeof2(e){return _typeof2=\"function\"==typeof Symbol&&\"symbol\"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&\"function\"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?\"symbol\":typeof e},_typeof2(e)}", "function $type(obj){\r\n if (!$defined(obj)) \r\n return false;\r\n if (obj.htmlElement) \r\n return 'element';\r\n var type = typeof obj;\r\n if (type == 'object' && obj.nodeName) {\r\n switch (obj.nodeType) {\r\n case 1:\r\n return 'element';\r\n case 3:\r\n return (/\\S/).test(obj.nodeValue) ? 'textnode' : 'whitespace';\r\n }\r\n }\r\n if (type == 'object' || type == 'function') {\r\n switch (obj.constructor) {\r\n case Array:\r\n return 'array';\r\n case RegExp:\r\n return 'regexp';\r\n case Class:\r\n return 'class';\r\n }\r\n if (typeof obj.length == 'number') {\r\n if (obj.item) \r\n return 'collection';\r\n if (obj.callee) \r\n return 'arguments';\r\n }\r\n }\r\n return type;\r\n }" ]
[ "0.69097364", "0.6775297", "0.6607535", "0.65383923", "0.64938533", "0.64889115", "0.64889115", "0.64495087", "0.64495087", "0.6429092", "0.6428121", "0.6404058", "0.6404058", "0.6395446", "0.6395446", "0.6395446", "0.6395446", "0.6395446", "0.6395446", "0.6395446", "0.6395446", "0.6395446", "0.6395446", "0.6395446", "0.6395446", "0.6395446", "0.6395446", "0.6395446", "0.6395446", "0.6376513", "0.637383", "0.63708526", "0.63503146", "0.6307572", "0.6307572", "0.6307572", "0.6307572", "0.6307572", "0.6307572", "0.6307572", "0.6307572", "0.6307572", "0.6307572", "0.6307572", "0.6307572", "0.6307572", "0.6307572", "0.6307572", "0.6307572", "0.6307572", "0.63033754", "0.6298678", "0.62888914", "0.6283712", "0.6259015", "0.6253731", "0.6253731", "0.6253731", "0.6253731", "0.6253731", "0.6253731", "0.6253731", "0.6253731", "0.6253731", "0.6253731", "0.6253731", "0.6253731", "0.6253731", "0.6253731", "0.6253731", "0.6253731", "0.6253731", "0.6253731", "0.6253731", "0.6253731", "0.6253731", "0.6253731", "0.6253731", "0.6253731", "0.6253731", "0.6253731", "0.6253731", "0.6253731", "0.6253731", "0.6253731", "0.6253731", "0.6253731", "0.6253731", "0.6253731", "0.6253731", "0.6253731", "0.6253731", "0.6247632", "0.6233973", "0.6231082", "0.62246406", "0.62218714", "0.6207757", "0.6196434", "0.6169869", "0.6169239" ]
0.0
-1
This handles more types than `getPropType`. Only used for error messages. See `createPrimitiveTypeChecker`.
function getPreciseType(propValue) { if (typeof propValue === 'undefined' || propValue === null) { return '' + propValue; } var propType = getPropType(propValue); if (propType === 'object') { if (propValue instanceof Date) { return 'date'; } else if (propValue instanceof RegExp) { return 'regexp'; } } return propType; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getPropType(propValue) {\n\t\t var propType = typeof propValue;\n\t\t if (Array.isArray(propValue)) {\n\t\t return 'array';\n\t\t }\n\t\t if (propValue instanceof RegExp) {\n\t\t // Old webkits (at least until Android 4.0) return 'function' rather than\n\t\t // 'object' for typeof a RegExp. We'll normalize this here so that /bla/\n\t\t // passes PropTypes.object.\n\t\t return 'object';\n\t\t }\n\t\t if (isSymbol(propType, propValue)) {\n\t\t return 'symbol';\n\t\t }\n\t\t return propType;\n\t\t }", "function getPropType(propValue) {\n var propType = typeof propValue;\n if (Array.isArray(propValue)) {\n return 'array';\n }\n if (propValue instanceof RegExp) {\n // Old webkits (at least until Android 4.0) return 'function' rather than\n // 'object' for typeof a RegExp. We'll normalize this here so that /bla/\n // passes PropTypes.object.\n return 'object';\n }\n if (isSymbol(propType, propValue)) {\n return 'symbol';\n }\n return propType;\n }", "function getPropType(propValue) {\n var propType = typeof propValue;\n if (Array.isArray(propValue)) {\n return 'array';\n }\n if (propValue instanceof RegExp) {\n // Old webkits (at least until Android 4.0) return 'function' rather than\n // 'object' for typeof a RegExp. We'll normalize this here so that /bla/\n // passes PropTypes.object.\n return 'object';\n }\n if (isSymbol(propType, propValue)) {\n return 'symbol';\n }\n return propType;\n }", "function getPropType(propValue) {\n var propType = typeof propValue;\n if (Array.isArray(propValue)) {\n return 'array';\n }\n if (propValue instanceof RegExp) {\n // Old webkits (at least until Android 4.0) return 'function' rather than\n // 'object' for typeof a RegExp. We'll normalize this here so that /bla/\n // passes PropTypes.object.\n return 'object';\n }\n if (isSymbol(propType, propValue)) {\n return 'symbol';\n }\n return propType;\n }", "function getPropType(propValue) {\n var propType = typeof propValue;\n if (Array.isArray(propValue)) {\n return 'array';\n }\n if (propValue instanceof RegExp) {\n // Old webkits (at least until Android 4.0) return 'function' rather than\n // 'object' for typeof a RegExp. We'll normalize this here so that /bla/\n // passes PropTypes.object.\n return 'object';\n }\n if (isSymbol(propType, propValue)) {\n return 'symbol';\n }\n return propType;\n }", "function getPropType(propValue) {\n\t\t var propType = typeof propValue;\n\t\t if (Array.isArray(propValue)) {\n\t\t return 'array';\n\t\t }\n\t\t if (propValue instanceof RegExp) {\n\t\t // Old webkits (at least until Android 4.0) return 'function' rather than\n\t\t // 'object' for typeof a RegExp. We'll normalize this here so that /bla/\n\t\t // passes PropTypes.object.\n\t\t return 'object';\n\t\t }\n\t\t return propType;\n\t\t}", "function getPropType(propValue) {\n\t var propType = typeof propValue;\n\t if (Array.isArray(propValue)) {\n\t return 'array';\n\t }\n\t if (propValue instanceof RegExp) {\n\t // Old webkits (at least until Android 4.0) return 'function' rather than\n\t // 'object' for typeof a RegExp. We'll normalize this here so that /bla/\n\t // passes PropTypes.object.\n\t return 'object';\n\t }\n\t if (isSymbol(propType, propValue)) {\n\t return 'symbol';\n\t }\n\t return propType;\n\t }", "function getPropType(propValue) {\n\t var propType = typeof propValue;\n\t if (Array.isArray(propValue)) {\n\t return 'array';\n\t }\n\t if (propValue instanceof RegExp) {\n\t // Old webkits (at least until Android 4.0) return 'function' rather than\n\t // 'object' for typeof a RegExp. We'll normalize this here so that /bla/\n\t // passes PropTypes.object.\n\t return 'object';\n\t }\n\t if (isSymbol(propType, propValue)) {\n\t return 'symbol';\n\t }\n\t return propType;\n\t }", "function getPropType(propValue) {\n\t var propType = typeof propValue;\n\t if (Array.isArray(propValue)) {\n\t return 'array';\n\t }\n\t if (propValue instanceof RegExp) {\n\t // Old webkits (at least until Android 4.0) return 'function' rather than\n\t // 'object' for typeof a RegExp. We'll normalize this here so that /bla/\n\t // passes PropTypes.object.\n\t return 'object';\n\t }\n\t if (isSymbol(propType, propValue)) {\n\t return 'symbol';\n\t }\n\t return propType;\n\t }", "function getPropType(propValue) {\n\t var propType = typeof propValue;\n\t if (Array.isArray(propValue)) {\n\t return 'array';\n\t }\n\t if (propValue instanceof RegExp) {\n\t // Old webkits (at least until Android 4.0) return 'function' rather than\n\t // 'object' for typeof a RegExp. We'll normalize this here so that /bla/\n\t // passes PropTypes.object.\n\t return 'object';\n\t }\n\t if (isSymbol(propType, propValue)) {\n\t return 'symbol';\n\t }\n\t return propType;\n\t }", "function getPropType(propValue) {\n\t var propType = typeof propValue;\n\t if (Array.isArray(propValue)) {\n\t return 'array';\n\t }\n\t if (propValue instanceof RegExp) {\n\t // Old webkits (at least until Android 4.0) return 'function' rather than\n\t // 'object' for typeof a RegExp. We'll normalize this here so that /bla/\n\t // passes PropTypes.object.\n\t return 'object';\n\t }\n\t if (isSymbol(propType, propValue)) {\n\t return 'symbol';\n\t }\n\t return propType;\n\t }", "function getPropType(propValue) {\n\t var propType = typeof propValue;\n\t if (Array.isArray(propValue)) {\n\t return 'array';\n\t }\n\t if (propValue instanceof RegExp) {\n\t // Old webkits (at least until Android 4.0) return 'function' rather than\n\t // 'object' for typeof a RegExp. We'll normalize this here so that /bla/\n\t // passes PropTypes.object.\n\t return 'object';\n\t }\n\t if (isSymbol(propType, propValue)) {\n\t return 'symbol';\n\t }\n\t return propType;\n\t }", "function getPropType(propValue) {\n\t var propType = typeof propValue;\n\t if (Array.isArray(propValue)) {\n\t return 'array';\n\t }\n\t if (propValue instanceof RegExp) {\n\t // Old webkits (at least until Android 4.0) return 'function' rather than\n\t // 'object' for typeof a RegExp. We'll normalize this here so that /bla/\n\t // passes PropTypes.object.\n\t return 'object';\n\t }\n\t if (isSymbol(propType, propValue)) {\n\t return 'symbol';\n\t }\n\t return propType;\n\t }", "function getPropType(propValue) {\n\t var propType = typeof propValue;\n\t if (Array.isArray(propValue)) {\n\t return 'array';\n\t }\n\t if (propValue instanceof RegExp) {\n\t // Old webkits (at least until Android 4.0) return 'function' rather than\n\t // 'object' for typeof a RegExp. We'll normalize this here so that /bla/\n\t // passes PropTypes.object.\n\t return 'object';\n\t }\n\t if (isSymbol(propType, propValue)) {\n\t return 'symbol';\n\t }\n\t return propType;\n\t }", "function getPropType(propValue) {\n\t var propType = typeof propValue;\n\t if (Array.isArray(propValue)) {\n\t return 'array';\n\t }\n\t if (propValue instanceof RegExp) {\n\t // Old webkits (at least until Android 4.0) return 'function' rather than\n\t // 'object' for typeof a RegExp. We'll normalize this here so that /bla/\n\t // passes PropTypes.object.\n\t return 'object';\n\t }\n\t if (isSymbol(propType, propValue)) {\n\t return 'symbol';\n\t }\n\t return propType;\n\t }", "function getPropType(propValue) {\n\t var propType = typeof propValue;\n\t if (Array.isArray(propValue)) {\n\t return 'array';\n\t }\n\t if (propValue instanceof RegExp) {\n\t // Old webkits (at least until Android 4.0) return 'function' rather than\n\t // 'object' for typeof a RegExp. We'll normalize this here so that /bla/\n\t // passes PropTypes.object.\n\t return 'object';\n\t }\n\t if (isSymbol(propType, propValue)) {\n\t return 'symbol';\n\t }\n\t return propType;\n\t }", "function getPropType(propValue) {\n\t var propType = typeof propValue;\n\t if (Array.isArray(propValue)) {\n\t return 'array';\n\t }\n\t if (propValue instanceof RegExp) {\n\t // Old webkits (at least until Android 4.0) return 'function' rather than\n\t // 'object' for typeof a RegExp. We'll normalize this here so that /bla/\n\t // passes PropTypes.object.\n\t return 'object';\n\t }\n\t if (isSymbol(propType, propValue)) {\n\t return 'symbol';\n\t }\n\t return propType;\n\t }", "function getPropType(propValue) {\n\t var propType = typeof propValue;\n\t if (Array.isArray(propValue)) {\n\t return 'array';\n\t }\n\t if (propValue instanceof RegExp) {\n\t // Old webkits (at least until Android 4.0) return 'function' rather than\n\t // 'object' for typeof a RegExp. We'll normalize this here so that /bla/\n\t // passes PropTypes.object.\n\t return 'object';\n\t }\n\t if (isSymbol(propType, propValue)) {\n\t return 'symbol';\n\t }\n\t return propType;\n\t }", "function getPropType(propValue) {\n\t var propType = typeof propValue;\n\t if (Array.isArray(propValue)) {\n\t return 'array';\n\t }\n\t if (propValue instanceof RegExp) {\n\t // Old webkits (at least until Android 4.0) return 'function' rather than\n\t // 'object' for typeof a RegExp. We'll normalize this here so that /bla/\n\t // passes PropTypes.object.\n\t return 'object';\n\t }\n\t if (isSymbol(propType, propValue)) {\n\t return 'symbol';\n\t }\n\t return propType;\n\t }", "function getPropType(propValue) {\n\t var propType = typeof propValue;\n\t if (Array.isArray(propValue)) {\n\t return 'array';\n\t }\n\t if (propValue instanceof RegExp) {\n\t // Old webkits (at least until Android 4.0) return 'function' rather than\n\t // 'object' for typeof a RegExp. We'll normalize this here so that /bla/\n\t // passes PropTypes.object.\n\t return 'object';\n\t }\n\t if (isSymbol(propType, propValue)) {\n\t return 'symbol';\n\t }\n\t return propType;\n\t }", "function getPropType(propValue) {\n\t var propType = typeof propValue;\n\t if (Array.isArray(propValue)) {\n\t return 'array';\n\t }\n\t if (propValue instanceof RegExp) {\n\t // Old webkits (at least until Android 4.0) return 'function' rather than\n\t // 'object' for typeof a RegExp. We'll normalize this here so that /bla/\n\t // passes PropTypes.object.\n\t return 'object';\n\t }\n\t if (isSymbol(propType, propValue)) {\n\t return 'symbol';\n\t }\n\t return propType;\n\t }", "function getPropType(propValue) {\n\t var propType = typeof propValue;\n\t if (Array.isArray(propValue)) {\n\t return 'array';\n\t }\n\t if (propValue instanceof RegExp) {\n\t // Old webkits (at least until Android 4.0) return 'function' rather than\n\t // 'object' for typeof a RegExp. We'll normalize this here so that /bla/\n\t // passes PropTypes.object.\n\t return 'object';\n\t }\n\t if (isSymbol(propType, propValue)) {\n\t return 'symbol';\n\t }\n\t return propType;\n\t }", "function getPropType(propValue) {\n\t var propType = typeof propValue;\n\t if (Array.isArray(propValue)) {\n\t return 'array';\n\t }\n\t if (propValue instanceof RegExp) {\n\t // Old webkits (at least until Android 4.0) return 'function' rather than\n\t // 'object' for typeof a RegExp. We'll normalize this here so that /bla/\n\t // passes PropTypes.object.\n\t return 'object';\n\t }\n\t if (isSymbol(propType, propValue)) {\n\t return 'symbol';\n\t }\n\t return propType;\n\t }", "function getPropType(propValue) {\n\t var propType = typeof propValue;\n\t if (Array.isArray(propValue)) {\n\t return 'array';\n\t }\n\t if (propValue instanceof RegExp) {\n\t // Old webkits (at least until Android 4.0) return 'function' rather than\n\t // 'object' for typeof a RegExp. We'll normalize this here so that /bla/\n\t // passes PropTypes.object.\n\t return 'object';\n\t }\n\t if (isSymbol(propType, propValue)) {\n\t return 'symbol';\n\t }\n\t return propType;\n\t }", "function getPropType(propValue) {\n\t var propType = typeof propValue;\n\t if (Array.isArray(propValue)) {\n\t return 'array';\n\t }\n\t if (propValue instanceof RegExp) {\n\t // Old webkits (at least until Android 4.0) return 'function' rather than\n\t // 'object' for typeof a RegExp. We'll normalize this here so that /bla/\n\t // passes PropTypes.object.\n\t return 'object';\n\t }\n\t if (isSymbol(propType, propValue)) {\n\t return 'symbol';\n\t }\n\t return propType;\n\t }", "function getPropType(propValue) {\n\t var propType = typeof propValue;\n\t if (Array.isArray(propValue)) {\n\t return 'array';\n\t }\n\t if (propValue instanceof RegExp) {\n\t // Old webkits (at least until Android 4.0) return 'function' rather than\n\t // 'object' for typeof a RegExp. We'll normalize this here so that /bla/\n\t // passes PropTypes.object.\n\t return 'object';\n\t }\n\t if (isSymbol(propType, propValue)) {\n\t return 'symbol';\n\t }\n\t return propType;\n\t }", "function getPropType(propValue) {\n\t var propType = typeof propValue;\n\t if (Array.isArray(propValue)) {\n\t return 'array';\n\t }\n\t if (propValue instanceof RegExp) {\n\t // Old webkits (at least until Android 4.0) return 'function' rather than\n\t // 'object' for typeof a RegExp. We'll normalize this here so that /bla/\n\t // passes PropTypes.object.\n\t return 'object';\n\t }\n\t if (isSymbol(propType, propValue)) {\n\t return 'symbol';\n\t }\n\t return propType;\n\t }", "function getPropType(propValue) {\n\t var propType = typeof propValue;\n\t if (Array.isArray(propValue)) {\n\t return 'array';\n\t }\n\t if (propValue instanceof RegExp) {\n\t // Old webkits (at least until Android 4.0) return 'function' rather than\n\t // 'object' for typeof a RegExp. We'll normalize this here so that /bla/\n\t // passes PropTypes.object.\n\t return 'object';\n\t }\n\t if (isSymbol(propType, propValue)) {\n\t return 'symbol';\n\t }\n\t return propType;\n\t }", "function getPropType(propValue) {\n\t var propType = typeof propValue;\n\t if (Array.isArray(propValue)) {\n\t return 'array';\n\t }\n\t if (propValue instanceof RegExp) {\n\t // Old webkits (at least until Android 4.0) return 'function' rather than\n\t // 'object' for typeof a RegExp. We'll normalize this here so that /bla/\n\t // passes PropTypes.object.\n\t return 'object';\n\t }\n\t if (isSymbol(propType, propValue)) {\n\t return 'symbol';\n\t }\n\t return propType;\n\t }", "function getPropType(propValue) {\n\t var propType = typeof propValue;\n\t if (Array.isArray(propValue)) {\n\t return 'array';\n\t }\n\t if (propValue instanceof RegExp) {\n\t // Old webkits (at least until Android 4.0) return 'function' rather than\n\t // 'object' for typeof a RegExp. We'll normalize this here so that /bla/\n\t // passes PropTypes.object.\n\t return 'object';\n\t }\n\t if (isSymbol(propType, propValue)) {\n\t return 'symbol';\n\t }\n\t return propType;\n\t }", "function getPropType(propValue) {\n\t var propType = typeof propValue;\n\t if (Array.isArray(propValue)) {\n\t return 'array';\n\t }\n\t if (propValue instanceof RegExp) {\n\t // Old webkits (at least until Android 4.0) return 'function' rather than\n\t // 'object' for typeof a RegExp. We'll normalize this here so that /bla/\n\t // passes PropTypes.object.\n\t return 'object';\n\t }\n\t if (isSymbol(propType, propValue)) {\n\t return 'symbol';\n\t }\n\t return propType;\n\t }", "function getPropType(propValue) {\n\t var propType = typeof propValue;\n\t if (Array.isArray(propValue)) {\n\t return 'array';\n\t }\n\t if (propValue instanceof RegExp) {\n\t // Old webkits (at least until Android 4.0) return 'function' rather than\n\t // 'object' for typeof a RegExp. We'll normalize this here so that /bla/\n\t // passes PropTypes.object.\n\t return 'object';\n\t }\n\t if (isSymbol(propType, propValue)) {\n\t return 'symbol';\n\t }\n\t return propType;\n\t }", "function getPropType(propValue) {\n\t var propType = typeof propValue;\n\t if (Array.isArray(propValue)) {\n\t return 'array';\n\t }\n\t if (propValue instanceof RegExp) {\n\t // Old webkits (at least until Android 4.0) return 'function' rather than\n\t // 'object' for typeof a RegExp. We'll normalize this here so that /bla/\n\t // passes PropTypes.object.\n\t return 'object';\n\t }\n\t if (isSymbol(propType, propValue)) {\n\t return 'symbol';\n\t }\n\t return propType;\n\t }", "function getPropType(propValue) {\n\t var propType = typeof propValue;\n\t if (Array.isArray(propValue)) {\n\t return 'array';\n\t }\n\t if (propValue instanceof RegExp) {\n\t // Old webkits (at least until Android 4.0) return 'function' rather than\n\t // 'object' for typeof a RegExp. We'll normalize this here so that /bla/\n\t // passes PropTypes.object.\n\t return 'object';\n\t }\n\t if (isSymbol(propType, propValue)) {\n\t return 'symbol';\n\t }\n\t return propType;\n\t }", "function getPropType(propValue) {\n\t var propType = typeof propValue;\n\t if (Array.isArray(propValue)) {\n\t return 'array';\n\t }\n\t if (propValue instanceof RegExp) {\n\t // Old webkits (at least until Android 4.0) return 'function' rather than\n\t // 'object' for typeof a RegExp. We'll normalize this here so that /bla/\n\t // passes PropTypes.object.\n\t return 'object';\n\t }\n\t if (isSymbol(propType, propValue)) {\n\t return 'symbol';\n\t }\n\t return propType;\n\t }", "function getPropType(propValue) {\n\t var propType = typeof propValue;\n\t if (Array.isArray(propValue)) {\n\t return 'array';\n\t }\n\t if (propValue instanceof RegExp) {\n\t // Old webkits (at least until Android 4.0) return 'function' rather than\n\t // 'object' for typeof a RegExp. We'll normalize this here so that /bla/\n\t // passes PropTypes.object.\n\t return 'object';\n\t }\n\t if (isSymbol(propType, propValue)) {\n\t return 'symbol';\n\t }\n\t return propType;\n\t }", "function getPropType(propValue) {\n\t var propType = typeof propValue;\n\t if (Array.isArray(propValue)) {\n\t return 'array';\n\t }\n\t if (propValue instanceof RegExp) {\n\t // Old webkits (at least until Android 4.0) return 'function' rather than\n\t // 'object' for typeof a RegExp. We'll normalize this here so that /bla/\n\t // passes PropTypes.object.\n\t return 'object';\n\t }\n\t if (isSymbol(propType, propValue)) {\n\t return 'symbol';\n\t }\n\t return propType;\n\t }", "function getPropType(propValue) {\n\t var propType = typeof propValue;\n\t if (Array.isArray(propValue)) {\n\t return 'array';\n\t }\n\t if (propValue instanceof RegExp) {\n\t // Old webkits (at least until Android 4.0) return 'function' rather than\n\t // 'object' for typeof a RegExp. We'll normalize this here so that /bla/\n\t // passes PropTypes.object.\n\t return 'object';\n\t }\n\t if (isSymbol(propType, propValue)) {\n\t return 'symbol';\n\t }\n\t return propType;\n\t }", "function getPropType(propValue) {\n\t var propType = typeof propValue;\n\t if (Array.isArray(propValue)) {\n\t return 'array';\n\t }\n\t if (propValue instanceof RegExp) {\n\t // Old webkits (at least until Android 4.0) return 'function' rather than\n\t // 'object' for typeof a RegExp. We'll normalize this here so that /bla/\n\t // passes PropTypes.object.\n\t return 'object';\n\t }\n\t if (isSymbol(propType, propValue)) {\n\t return 'symbol';\n\t }\n\t return propType;\n\t }", "function getPropType(propValue) {\n\t var propType = typeof propValue;\n\t if (Array.isArray(propValue)) {\n\t return 'array';\n\t }\n\t if (propValue instanceof RegExp) {\n\t // Old webkits (at least until Android 4.0) return 'function' rather than\n\t // 'object' for typeof a RegExp. We'll normalize this here so that /bla/\n\t // passes PropTypes.object.\n\t return 'object';\n\t }\n\t if (isSymbol(propType, propValue)) {\n\t return 'symbol';\n\t }\n\t return propType;\n\t }", "function getPropType(propValue) {\n\t var propType = typeof propValue;\n\t if (Array.isArray(propValue)) {\n\t return 'array';\n\t }\n\t if (propValue instanceof RegExp) {\n\t // Old webkits (at least until Android 4.0) return 'function' rather than\n\t // 'object' for typeof a RegExp. We'll normalize this here so that /bla/\n\t // passes PropTypes.object.\n\t return 'object';\n\t }\n\t if (isSymbol(propType, propValue)) {\n\t return 'symbol';\n\t }\n\t return propType;\n\t }", "function getPropType(propValue) {\n\t var propType = typeof propValue;\n\t if (Array.isArray(propValue)) {\n\t return 'array';\n\t }\n\t if (propValue instanceof RegExp) {\n\t // Old webkits (at least until Android 4.0) return 'function' rather than\n\t // 'object' for typeof a RegExp. We'll normalize this here so that /bla/\n\t // passes PropTypes.object.\n\t return 'object';\n\t }\n\t if (isSymbol(propType, propValue)) {\n\t return 'symbol';\n\t }\n\t return propType;\n\t }", "function getPropType(propValue) {\n\t var propType = typeof propValue;\n\t if (Array.isArray(propValue)) {\n\t return 'array';\n\t }\n\t if (propValue instanceof RegExp) {\n\t // Old webkits (at least until Android 4.0) return 'function' rather than\n\t // 'object' for typeof a RegExp. We'll normalize this here so that /bla/\n\t // passes PropTypes.object.\n\t return 'object';\n\t }\n\t if (isSymbol(propType, propValue)) {\n\t return 'symbol';\n\t }\n\t return propType;\n\t }", "function getPropType(propValue) {\n\t var propType = typeof propValue;\n\t if (Array.isArray(propValue)) {\n\t return 'array';\n\t }\n\t if (propValue instanceof RegExp) {\n\t // Old webkits (at least until Android 4.0) return 'function' rather than\n\t // 'object' for typeof a RegExp. We'll normalize this here so that /bla/\n\t // passes PropTypes.object.\n\t return 'object';\n\t }\n\t if (isSymbol(propType, propValue)) {\n\t return 'symbol';\n\t }\n\t return propType;\n\t }", "function getPropType(propValue) {\n\t var propType = typeof propValue;\n\t if (Array.isArray(propValue)) {\n\t return 'array';\n\t }\n\t if (propValue instanceof RegExp) {\n\t // Old webkits (at least until Android 4.0) return 'function' rather than\n\t // 'object' for typeof a RegExp. We'll normalize this here so that /bla/\n\t // passes PropTypes.object.\n\t return 'object';\n\t }\n\t if (isSymbol(propType, propValue)) {\n\t return 'symbol';\n\t }\n\t return propType;\n\t }", "function getPropType(propValue) {\n\t var propType = typeof propValue;\n\t if (Array.isArray(propValue)) {\n\t return 'array';\n\t }\n\t if (propValue instanceof RegExp) {\n\t // Old webkits (at least until Android 4.0) return 'function' rather than\n\t // 'object' for typeof a RegExp. We'll normalize this here so that /bla/\n\t // passes PropTypes.object.\n\t return 'object';\n\t }\n\t if (isSymbol(propType, propValue)) {\n\t return 'symbol';\n\t }\n\t return propType;\n\t }", "function getPropType(propValue) {\n\t var propType = typeof propValue;\n\t if (Array.isArray(propValue)) {\n\t return 'array';\n\t }\n\t if (propValue instanceof RegExp) {\n\t // Old webkits (at least until Android 4.0) return 'function' rather than\n\t // 'object' for typeof a RegExp. We'll normalize this here so that /bla/\n\t // passes PropTypes.object.\n\t return 'object';\n\t }\n\t if (isSymbol(propType, propValue)) {\n\t return 'symbol';\n\t }\n\t return propType;\n\t }", "function getPropType(propValue) {\n\t var propType = typeof propValue;\n\t if (Array.isArray(propValue)) {\n\t return 'array';\n\t }\n\t if (propValue instanceof RegExp) {\n\t // Old webkits (at least until Android 4.0) return 'function' rather than\n\t // 'object' for typeof a RegExp. We'll normalize this here so that /bla/\n\t // passes PropTypes.object.\n\t return 'object';\n\t }\n\t if (isSymbol(propType, propValue)) {\n\t return 'symbol';\n\t }\n\t return propType;\n\t }", "function getPropType(propValue) {\n\t var propType = typeof propValue;\n\t if (Array.isArray(propValue)) {\n\t return 'array';\n\t }\n\t if (propValue instanceof RegExp) {\n\t // Old webkits (at least until Android 4.0) return 'function' rather than\n\t // 'object' for typeof a RegExp. We'll normalize this here so that /bla/\n\t // passes PropTypes.object.\n\t return 'object';\n\t }\n\t if (isSymbol(propType, propValue)) {\n\t return 'symbol';\n\t }\n\t return propType;\n\t }", "function getPropType(propValue) {\n\t var propType = typeof propValue;\n\t if (Array.isArray(propValue)) {\n\t return 'array';\n\t }\n\t if (propValue instanceof RegExp) {\n\t // Old webkits (at least until Android 4.0) return 'function' rather than\n\t // 'object' for typeof a RegExp. We'll normalize this here so that /bla/\n\t // passes PropTypes.object.\n\t return 'object';\n\t }\n\t if (isSymbol(propType, propValue)) {\n\t return 'symbol';\n\t }\n\t return propType;\n\t }", "function getPropType(propValue) {\n\t var propType = typeof propValue;\n\t if (Array.isArray(propValue)) {\n\t return 'array';\n\t }\n\t if (propValue instanceof RegExp) {\n\t // Old webkits (at least until Android 4.0) return 'function' rather than\n\t // 'object' for typeof a RegExp. We'll normalize this here so that /bla/\n\t // passes PropTypes.object.\n\t return 'object';\n\t }\n\t if (isSymbol(propType, propValue)) {\n\t return 'symbol';\n\t }\n\t return propType;\n\t }", "function getPropType(propValue) {\n\t var propType = typeof propValue;\n\t if (Array.isArray(propValue)) {\n\t return 'array';\n\t }\n\t if (propValue instanceof RegExp) {\n\t // Old webkits (at least until Android 4.0) return 'function' rather than\n\t // 'object' for typeof a RegExp. We'll normalize this here so that /bla/\n\t // passes PropTypes.object.\n\t return 'object';\n\t }\n\t if (isSymbol(propType, propValue)) {\n\t return 'symbol';\n\t }\n\t return propType;\n\t }", "function getPropType(propValue) {\n\t var propType = typeof propValue;\n\t if (Array.isArray(propValue)) {\n\t return 'array';\n\t }\n\t if (propValue instanceof RegExp) {\n\t // Old webkits (at least until Android 4.0) return 'function' rather than\n\t // 'object' for typeof a RegExp. We'll normalize this here so that /bla/\n\t // passes PropTypes.object.\n\t return 'object';\n\t }\n\t if (isSymbol(propType, propValue)) {\n\t return 'symbol';\n\t }\n\t return propType;\n\t }", "function getPropType(propValue) {\n\t var propType = typeof propValue;\n\t if (Array.isArray(propValue)) {\n\t return 'array';\n\t }\n\t if (propValue instanceof RegExp) {\n\t // Old webkits (at least until Android 4.0) return 'function' rather than\n\t // 'object' for typeof a RegExp. We'll normalize this here so that /bla/\n\t // passes PropTypes.object.\n\t return 'object';\n\t }\n\t if (isSymbol(propType, propValue)) {\n\t return 'symbol';\n\t }\n\t return propType;\n\t }", "function getPropType(propValue) {\n\t\t var propType = typeof propValue;\n\t\t if (Array.isArray(propValue)) {\n\t\t return 'array';\n\t\t }\n\t\t if (propValue instanceof RegExp) {\n\t\t // Old webkits (at least until Android 4.0) return 'function' rather than\n\t\t // 'object' for typeof a RegExp. We'll normalize this here so that /bla/\n\t\t // passes PropTypes.object.\n\t\t return 'object';\n\t\t }\n\t\t if (isSymbol(propType, propValue)) {\n\t\t return 'symbol';\n\t\t }\n\t\t return propType;\n\t\t}", "function getPropType(propValue) {\n\t\t var propType = typeof propValue;\n\t\t if (Array.isArray(propValue)) {\n\t\t return 'array';\n\t\t }\n\t\t if (propValue instanceof RegExp) {\n\t\t // Old webkits (at least until Android 4.0) return 'function' rather than\n\t\t // 'object' for typeof a RegExp. We'll normalize this here so that /bla/\n\t\t // passes PropTypes.object.\n\t\t return 'object';\n\t\t }\n\t\t if (isSymbol(propType, propValue)) {\n\t\t return 'symbol';\n\t\t }\n\t\t return propType;\n\t\t}", "function getPropType(propValue) {\n var propType = typeof propValue;\n if (Array.isArray(propValue)) {\n return \"array\";\n }\n if (propValue instanceof RegExp) {\n // Old webkits (at least until Android 4.0) return 'function' rather than\n // 'object' for typeof a RegExp. We'll normalize this here so that /bla/\n // passes PropTypes.object.\n return \"object\";\n }\n if (isSymbol(propType, propValue)) {\n return \"symbol\";\n }\n return propType;\n }", "function getPropType(propValue) {\n var propType = typeof propValue;\n if (Array.isArray(propValue)) {\n return 'array';\n }\n if (propValue instanceof RegExp) {\n // Old webkits (at least until Android 4.0) return 'function' rather than\n // 'object' for typeof a RegExp. We'll normalize this here so that /bla/\n // passes PropTypes.object.\n return 'object';\n }\n if (isSymbol(propType, propValue)) {\n return 'symbol';\n }\n return propType;\n }", "function getPropType(propValue) {\n var propType = typeof propValue;\n if (Array.isArray(propValue)) {\n return 'array';\n }\n if (propValue instanceof RegExp) {\n // Old webkits (at least until Android 4.0) return 'function' rather than\n // 'object' for typeof a RegExp. We'll normalize this here so that /bla/\n // passes PropTypes.object.\n return 'object';\n }\n if (isSymbol(propType, propValue)) {\n return 'symbol';\n }\n return propType;\n }", "function getPropType(propValue) {\n var propType = typeof propValue;\n if (Array.isArray(propValue)) {\n return 'array';\n }\n if (propValue instanceof RegExp) {\n // Old webkits (at least until Android 4.0) return 'function' rather than\n // 'object' for typeof a RegExp. We'll normalize this here so that /bla/\n // passes PropTypes.object.\n return 'object';\n }\n if (isSymbol(propType, propValue)) {\n return 'symbol';\n }\n return propType;\n }", "function getPropType(propValue) {\n var propType = typeof propValue;\n if (Array.isArray(propValue)) {\n return 'array';\n }\n if (propValue instanceof RegExp) {\n // Old webkits (at least until Android 4.0) return 'function' rather than\n // 'object' for typeof a RegExp. We'll normalize this here so that /bla/\n // passes PropTypes.object.\n return 'object';\n }\n if (isSymbol(propType, propValue)) {\n return 'symbol';\n }\n return propType;\n }", "function getPropType(propValue) {\n var propType = typeof propValue;\n if (Array.isArray(propValue)) {\n return 'array';\n }\n if (propValue instanceof RegExp) {\n // Old webkits (at least until Android 4.0) return 'function' rather than\n // 'object' for typeof a RegExp. We'll normalize this here so that /bla/\n // passes PropTypes.object.\n return 'object';\n }\n if (isSymbol(propType, propValue)) {\n return 'symbol';\n }\n return propType;\n }", "function getPropType(propValue) {\n var propType = typeof propValue;\n if (Array.isArray(propValue)) {\n return 'array';\n }\n if (propValue instanceof RegExp) {\n // Old webkits (at least until Android 4.0) return 'function' rather than\n // 'object' for typeof a RegExp. We'll normalize this here so that /bla/\n // passes PropTypes.object.\n return 'object';\n }\n if (isSymbol(propType, propValue)) {\n return 'symbol';\n }\n return propType;\n }", "function getPropType(propValue) {\n\t var propType = typeof propValue === 'undefined' ? 'undefined' : _typeof(propValue);\n\t if (Array.isArray(propValue)) {\n\t return 'array';\n\t }\n\t if (propValue instanceof RegExp) {\n\t // Old webkits (at least until Android 4.0) return 'function' rather than\n\t // 'object' for typeof a RegExp. We'll normalize this here so that /bla/\n\t // passes PropTypes.object.\n\t return 'object';\n\t }\n\t if (isSymbol(propType, propValue)) {\n\t return 'symbol';\n\t }\n\t return propType;\n\t }", "function getPropType(propValue) {\n var propType = typeof propValue;\n if (Array.isArray(propValue)) {\n return 'array';\n }\n if (propValue instanceof RegExp) {\n // Old webkits (at least until Android 4.0) return 'function' rather than\n // 'object' for typeof a RegExp. We'll normalize this here so that /bla/\n // passes PropTypes.object.\n return 'object';\n }\n if (isSymbol(propType, propValue)) {\n return 'symbol';\n }\n return propType;\n }", "function getPropType(propValue) {\n var propType = typeof propValue;\n if (Array.isArray(propValue)) {\n return 'array';\n }\n if (propValue instanceof RegExp) {\n // Old webkits (at least until Android 4.0) return 'function' rather than\n // 'object' for typeof a RegExp. We'll normalize this here so that /bla/\n // passes PropTypes.object.\n return 'object';\n }\n if (isSymbol(propType, propValue)) {\n return 'symbol';\n }\n return propType;\n }", "function getPropType(propValue) {\n var propType = typeof propValue;\n if (Array.isArray(propValue)) {\n return 'array';\n }\n if (propValue instanceof RegExp) {\n // Old webkits (at least until Android 4.0) return 'function' rather than\n // 'object' for typeof a RegExp. We'll normalize this here so that /bla/\n // passes PropTypes.object.\n return 'object';\n }\n if (isSymbol(propType, propValue)) {\n return 'symbol';\n }\n return propType;\n }", "function getPropType(propValue) {\n var propType = typeof propValue;\n if (Array.isArray(propValue)) {\n return 'array';\n }\n if (propValue instanceof RegExp) {\n // Old webkits (at least until Android 4.0) return 'function' rather than\n // 'object' for typeof a RegExp. We'll normalize this here so that /bla/\n // passes PropTypes.object.\n return 'object';\n }\n if (isSymbol(propType, propValue)) {\n return 'symbol';\n }\n return propType;\n }", "function getPropType(propValue) {\n var propType = typeof propValue;\n if (Array.isArray(propValue)) {\n return 'array';\n }\n if (propValue instanceof RegExp) {\n // Old webkits (at least until Android 4.0) return 'function' rather than\n // 'object' for typeof a RegExp. We'll normalize this here so that /bla/\n // passes PropTypes.object.\n return 'object';\n }\n if (isSymbol(propType, propValue)) {\n return 'symbol';\n }\n return propType;\n }", "function getPropType(propValue) {\n var propType = typeof propValue;\n if (Array.isArray(propValue)) {\n return 'array';\n }\n if (propValue instanceof RegExp) {\n // Old webkits (at least until Android 4.0) return 'function' rather than\n // 'object' for typeof a RegExp. We'll normalize this here so that /bla/\n // passes PropTypes.object.\n return 'object';\n }\n if (isSymbol(propType, propValue)) {\n return 'symbol';\n }\n return propType;\n }", "function getPropType(propValue) {\n var propType = typeof propValue;\n if (Array.isArray(propValue)) {\n return 'array';\n }\n if (propValue instanceof RegExp) {\n // Old webkits (at least until Android 4.0) return 'function' rather than\n // 'object' for typeof a RegExp. We'll normalize this here so that /bla/\n // passes PropTypes.object.\n return 'object';\n }\n if (isSymbol(propType, propValue)) {\n return 'symbol';\n }\n return propType;\n }", "function getPropType(propValue) {\n var propType = typeof propValue;\n if (Array.isArray(propValue)) {\n return 'array';\n }\n if (propValue instanceof RegExp) {\n // Old webkits (at least until Android 4.0) return 'function' rather than\n // 'object' for typeof a RegExp. We'll normalize this here so that /bla/\n // passes PropTypes.object.\n return 'object';\n }\n if (isSymbol(propType, propValue)) {\n return 'symbol';\n }\n return propType;\n }", "function getPropType(propValue) {\n var propType = typeof propValue;\n if (Array.isArray(propValue)) {\n return 'array';\n }\n if (propValue instanceof RegExp) {\n // Old webkits (at least until Android 4.0) return 'function' rather than\n // 'object' for typeof a RegExp. We'll normalize this here so that /bla/\n // passes PropTypes.object.\n return 'object';\n }\n if (isSymbol(propType, propValue)) {\n return 'symbol';\n }\n return propType;\n }", "function getPropType(propValue) {\n var propType = typeof propValue;\n if (Array.isArray(propValue)) {\n return 'array';\n }\n if (propValue instanceof RegExp) {\n // Old webkits (at least until Android 4.0) return 'function' rather than\n // 'object' for typeof a RegExp. We'll normalize this here so that /bla/\n // passes PropTypes.object.\n return 'object';\n }\n if (isSymbol(propType, propValue)) {\n return 'symbol';\n }\n return propType;\n }", "function getPropType(propValue) {\n var propType = typeof propValue;\n if (Array.isArray(propValue)) {\n return 'array';\n }\n if (propValue instanceof RegExp) {\n // Old webkits (at least until Android 4.0) return 'function' rather than\n // 'object' for typeof a RegExp. We'll normalize this here so that /bla/\n // passes PropTypes.object.\n return 'object';\n }\n if (isSymbol(propType, propValue)) {\n return 'symbol';\n }\n return propType;\n }", "function getPropType(propValue) {\n var propType = typeof propValue;\n if (Array.isArray(propValue)) {\n return 'array';\n }\n if (propValue instanceof RegExp) {\n // Old webkits (at least until Android 4.0) return 'function' rather than\n // 'object' for typeof a RegExp. We'll normalize this here so that /bla/\n // passes PropTypes.object.\n return 'object';\n }\n if (isSymbol(propType, propValue)) {\n return 'symbol';\n }\n return propType;\n }", "function getPropType(propValue) {\n var propType = typeof propValue;\n if (Array.isArray(propValue)) {\n return 'array';\n }\n if (propValue instanceof RegExp) {\n // Old webkits (at least until Android 4.0) return 'function' rather than\n // 'object' for typeof a RegExp. We'll normalize this here so that /bla/\n // passes PropTypes.object.\n return 'object';\n }\n if (isSymbol(propType, propValue)) {\n return 'symbol';\n }\n return propType;\n }", "function getPropType(propValue) {\n var propType = typeof propValue;\n if (Array.isArray(propValue)) {\n return 'array';\n }\n if (propValue instanceof RegExp) {\n // Old webkits (at least until Android 4.0) return 'function' rather than\n // 'object' for typeof a RegExp. We'll normalize this here so that /bla/\n // passes PropTypes.object.\n return 'object';\n }\n if (isSymbol(propType, propValue)) {\n return 'symbol';\n }\n return propType;\n }", "function getPropType(propValue) {\n var propType = typeof propValue;\n if (Array.isArray(propValue)) {\n return 'array';\n }\n if (propValue instanceof RegExp) {\n // Old webkits (at least until Android 4.0) return 'function' rather than\n // 'object' for typeof a RegExp. We'll normalize this here so that /bla/\n // passes PropTypes.object.\n return 'object';\n }\n if (isSymbol(propType, propValue)) {\n return 'symbol';\n }\n return propType;\n }", "function getPropType(propValue) {\n var propType = typeof propValue;\n if (Array.isArray(propValue)) {\n return 'array';\n }\n if (propValue instanceof RegExp) {\n // Old webkits (at least until Android 4.0) return 'function' rather than\n // 'object' for typeof a RegExp. We'll normalize this here so that /bla/\n // passes PropTypes.object.\n return 'object';\n }\n if (isSymbol(propType, propValue)) {\n return 'symbol';\n }\n return propType;\n }", "function getPropType(propValue) {\n var propType = typeof propValue;\n if (Array.isArray(propValue)) {\n return 'array';\n }\n if (propValue instanceof RegExp) {\n // Old webkits (at least until Android 4.0) return 'function' rather than\n // 'object' for typeof a RegExp. We'll normalize this here so that /bla/\n // passes PropTypes.object.\n return 'object';\n }\n if (isSymbol(propType, propValue)) {\n return 'symbol';\n }\n return propType;\n }", "function getPropType(propValue) {\n var propType = typeof propValue;\n if (Array.isArray(propValue)) {\n return 'array';\n }\n if (propValue instanceof RegExp) {\n // Old webkits (at least until Android 4.0) return 'function' rather than\n // 'object' for typeof a RegExp. We'll normalize this here so that /bla/\n // passes PropTypes.object.\n return 'object';\n }\n if (isSymbol(propType, propValue)) {\n return 'symbol';\n }\n return propType;\n }", "function getPropType(propValue) {\n var propType = typeof propValue;\n if (Array.isArray(propValue)) {\n return 'array';\n }\n if (propValue instanceof RegExp) {\n // Old webkits (at least until Android 4.0) return 'function' rather than\n // 'object' for typeof a RegExp. We'll normalize this here so that /bla/\n // passes PropTypes.object.\n return 'object';\n }\n if (isSymbol(propType, propValue)) {\n return 'symbol';\n }\n return propType;\n }", "function getPropType(propValue) {\n var propType = typeof propValue;\n if (Array.isArray(propValue)) {\n return 'array';\n }\n if (propValue instanceof RegExp) {\n // Old webkits (at least until Android 4.0) return 'function' rather than\n // 'object' for typeof a RegExp. We'll normalize this here so that /bla/\n // passes PropTypes.object.\n return 'object';\n }\n if (isSymbol(propType, propValue)) {\n return 'symbol';\n }\n return propType;\n }", "function getPropType(propValue) {\n var propType = typeof propValue;\n if (Array.isArray(propValue)) {\n return 'array';\n }\n if (propValue instanceof RegExp) {\n // Old webkits (at least until Android 4.0) return 'function' rather than\n // 'object' for typeof a RegExp. We'll normalize this here so that /bla/\n // passes PropTypes.object.\n return 'object';\n }\n if (isSymbol(propType, propValue)) {\n return 'symbol';\n }\n return propType;\n }", "function getPropType(propValue) {\n var propType = typeof propValue;\n if (Array.isArray(propValue)) {\n return 'array';\n }\n if (propValue instanceof RegExp) {\n // Old webkits (at least until Android 4.0) return 'function' rather than\n // 'object' for typeof a RegExp. We'll normalize this here so that /bla/\n // passes PropTypes.object.\n return 'object';\n }\n if (isSymbol(propType, propValue)) {\n return 'symbol';\n }\n return propType;\n }", "function getPropType(propValue) {\n var propType = typeof propValue;\n if (Array.isArray(propValue)) {\n return 'array';\n }\n if (propValue instanceof RegExp) {\n // Old webkits (at least until Android 4.0) return 'function' rather than\n // 'object' for typeof a RegExp. We'll normalize this here so that /bla/\n // passes PropTypes.object.\n return 'object';\n }\n if (isSymbol(propType, propValue)) {\n return 'symbol';\n }\n return propType;\n }", "function getPropType(propValue) {\n var propType = typeof propValue;\n if (Array.isArray(propValue)) {\n return 'array';\n }\n if (propValue instanceof RegExp) {\n // Old webkits (at least until Android 4.0) return 'function' rather than\n // 'object' for typeof a RegExp. We'll normalize this here so that /bla/\n // passes PropTypes.object.\n return 'object';\n }\n if (isSymbol(propType, propValue)) {\n return 'symbol';\n }\n return propType;\n }", "function getPropType(propValue) {\n var propType = typeof propValue;\n if (Array.isArray(propValue)) {\n return 'array';\n }\n if (propValue instanceof RegExp) {\n // Old webkits (at least until Android 4.0) return 'function' rather than\n // 'object' for typeof a RegExp. We'll normalize this here so that /bla/\n // passes PropTypes.object.\n return 'object';\n }\n if (isSymbol(propType, propValue)) {\n return 'symbol';\n }\n return propType;\n }", "function getPropType(propValue) {\n var propType = typeof propValue;\n if (Array.isArray(propValue)) {\n return 'array';\n }\n if (propValue instanceof RegExp) {\n // Old webkits (at least until Android 4.0) return 'function' rather than\n // 'object' for typeof a RegExp. We'll normalize this here so that /bla/\n // passes PropTypes.object.\n return 'object';\n }\n if (isSymbol(propType, propValue)) {\n return 'symbol';\n }\n return propType;\n }", "function getPropType(propValue) {\n var propType = typeof propValue;\n if (Array.isArray(propValue)) {\n return 'array';\n }\n if (propValue instanceof RegExp) {\n // Old webkits (at least until Android 4.0) return 'function' rather than\n // 'object' for typeof a RegExp. We'll normalize this here so that /bla/\n // passes PropTypes.object.\n return 'object';\n }\n if (isSymbol(propType, propValue)) {\n return 'symbol';\n }\n return propType;\n }", "function getPropType(propValue) {\n var propType = typeof propValue;\n if (Array.isArray(propValue)) {\n return 'array';\n }\n if (propValue instanceof RegExp) {\n // Old webkits (at least until Android 4.0) return 'function' rather than\n // 'object' for typeof a RegExp. We'll normalize this here so that /bla/\n // passes PropTypes.object.\n return 'object';\n }\n if (isSymbol(propType, propValue)) {\n return 'symbol';\n }\n return propType;\n }", "function getPropType(propValue) {\n var propType = typeof propValue;\n if (Array.isArray(propValue)) {\n return 'array';\n }\n if (propValue instanceof RegExp) {\n // Old webkits (at least until Android 4.0) return 'function' rather than\n // 'object' for typeof a RegExp. We'll normalize this here so that /bla/\n // passes PropTypes.object.\n return 'object';\n }\n if (isSymbol(propType, propValue)) {\n return 'symbol';\n }\n return propType;\n }", "function getPropType(propValue) {\n var propType = typeof propValue;\n if (Array.isArray(propValue)) {\n return 'array';\n }\n if (propValue instanceof RegExp) {\n // Old webkits (at least until Android 4.0) return 'function' rather than\n // 'object' for typeof a RegExp. We'll normalize this here so that /bla/\n // passes PropTypes.object.\n return 'object';\n }\n if (isSymbol(propType, propValue)) {\n return 'symbol';\n }\n return propType;\n }", "function getPropType(propValue) {\n var propType = typeof propValue;\n if (Array.isArray(propValue)) {\n return 'array';\n }\n if (propValue instanceof RegExp) {\n // Old webkits (at least until Android 4.0) return 'function' rather than\n // 'object' for typeof a RegExp. We'll normalize this here so that /bla/\n // passes PropTypes.object.\n return 'object';\n }\n if (isSymbol(propType, propValue)) {\n return 'symbol';\n }\n return propType;\n }", "function getPropType(propValue) {\n var propType = typeof propValue;\n if (Array.isArray(propValue)) {\n return 'array';\n }\n if (propValue instanceof RegExp) {\n // Old webkits (at least until Android 4.0) return 'function' rather than\n // 'object' for typeof a RegExp. We'll normalize this here so that /bla/\n // passes PropTypes.object.\n return 'object';\n }\n if (isSymbol(propType, propValue)) {\n return 'symbol';\n }\n return propType;\n }", "function getPropType(propValue) {\n var propType = typeof propValue;\n if (Array.isArray(propValue)) {\n return 'array';\n }\n if (propValue instanceof RegExp) {\n // Old webkits (at least until Android 4.0) return 'function' rather than\n // 'object' for typeof a RegExp. We'll normalize this here so that /bla/\n // passes PropTypes.object.\n return 'object';\n }\n if (isSymbol(propType, propValue)) {\n return 'symbol';\n }\n return propType;\n }", "function getPropType(propValue) {\n var propType = typeof propValue;\n if (Array.isArray(propValue)) {\n return 'array';\n }\n if (propValue instanceof RegExp) {\n // Old webkits (at least until Android 4.0) return 'function' rather than\n // 'object' for typeof a RegExp. We'll normalize this here so that /bla/\n // passes PropTypes.object.\n return 'object';\n }\n if (isSymbol(propType, propValue)) {\n return 'symbol';\n }\n return propType;\n }", "function getPropType(propValue) {\n var propType = typeof propValue;\n if (Array.isArray(propValue)) {\n return 'array';\n }\n if (propValue instanceof RegExp) {\n // Old webkits (at least until Android 4.0) return 'function' rather than\n // 'object' for typeof a RegExp. We'll normalize this here so that /bla/\n // passes PropTypes.object.\n return 'object';\n }\n if (isSymbol(propType, propValue)) {\n return 'symbol';\n }\n return propType;\n }", "function getPropType(propValue) {\n var propType = typeof propValue;\n if (Array.isArray(propValue)) {\n return 'array';\n }\n if (propValue instanceof RegExp) {\n // Old webkits (at least until Android 4.0) return 'function' rather than\n // 'object' for typeof a RegExp. We'll normalize this here so that /bla/\n // passes PropTypes.object.\n return 'object';\n }\n if (isSymbol(propType, propValue)) {\n return 'symbol';\n }\n return propType;\n }", "function getPropType(propValue) {\n var propType = typeof propValue;\n if (Array.isArray(propValue)) {\n return 'array';\n }\n if (propValue instanceof RegExp) {\n // Old webkits (at least until Android 4.0) return 'function' rather than\n // 'object' for typeof a RegExp. We'll normalize this here so that /bla/\n // passes PropTypes.object.\n return 'object';\n }\n if (isSymbol(propType, propValue)) {\n return 'symbol';\n }\n return propType;\n }" ]
[ "0.68773127", "0.6853938", "0.6853938", "0.6853938", "0.6853938", "0.6852637", "0.6847169", "0.6847169", "0.6847169", "0.6847169", "0.6847169", "0.6847169", "0.6847169", "0.6847169", "0.6847169", "0.6847169", "0.6847169", "0.6847169", "0.6847169", "0.6847169", "0.6847169", "0.6847169", "0.6847169", "0.6847169", "0.6847169", "0.6847169", "0.6847169", "0.6847169", "0.6847169", "0.6847169", "0.6847169", "0.6847169", "0.6847169", "0.6847169", "0.6847169", "0.6847169", "0.6847169", "0.6847169", "0.6847169", "0.6847169", "0.6847169", "0.6847169", "0.6847169", "0.6847169", "0.6847169", "0.6847169", "0.6847169", "0.6847169", "0.6847169", "0.6847169", "0.6847169", "0.6847169", "0.6847169", "0.6847169", "0.6838684", "0.6838684", "0.68368113", "0.68184006", "0.68153244", "0.68153244", "0.68153244", "0.68153244", "0.68153244", "0.68009436", "0.6781347", "0.6781347", "0.6781347", "0.6781347", "0.6781347", "0.6781347", "0.6781347", "0.6781347", "0.6781347", "0.6781347", "0.6781347", "0.6781347", "0.6781347", "0.6781347", "0.6781347", "0.6781347", "0.6781347", "0.6781347", "0.6781347", "0.6781347", "0.6781347", "0.6781347", "0.6781347", "0.6781347", "0.6781347", "0.6781347", "0.6781347", "0.6781347", "0.6781347", "0.6781347", "0.6781347", "0.6781347", "0.6781347", "0.6781347", "0.6781347", "0.6781347", "0.6781347" ]
0.0
-1
Returns a string that is postfixed to a warning about an invalid type. For example, "undefined" or "of type array"
function getPostfixForTypeWarning(value) { var type = getPreciseType(value); switch (type) { case 'array': case 'object': return 'an ' + type; case 'boolean': case 'date': case 'regexp': return 'a ' + type; default: return type; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function _undefinedCoerce() {\n return '';\n}", "function getPostfixForTypeWarning(value) {\n var type = getPreciseType(value);\n switch (type) {\n case \"array\":\n case \"object\":\n return \"an \" + type;\n case \"boolean\":\n case \"date\":\n case \"regexp\":\n return \"a \" + type;\n default:\n return type;\n }\n }", "function getPostfixForTypeWarning(value) {\n var type = getPreciseType(value);\n switch (type) {\n case 'array':\n case 'object':\n return 'an ' + type;\n case 'boolean':\n case 'date':\n case 'regexp':\n return 'a ' + type;\n default:\n return type;\n }\n }", "function getPostfixForTypeWarning(value) {\n var type = getPreciseType(value);\n switch (type) {\n case 'array':\n case 'object':\n return 'an ' + type;\n case 'boolean':\n case 'date':\n case 'regexp':\n return 'a ' + type;\n default:\n return type;\n }\n }", "function getPostfixForTypeWarning(value) {\n var type = getPreciseType(value);\n switch (type) {\n case 'array':\n case 'object':\n return 'an ' + type;\n case 'boolean':\n case 'date':\n case 'regexp':\n return 'a ' + type;\n default:\n return type;\n }\n }", "function getPostfixForTypeWarning(value) {\n var type = getPreciseType(value);\n switch (type) {\n case 'array':\n case 'object':\n return 'an ' + type;\n case 'boolean':\n case 'date':\n case 'regexp':\n return 'a ' + type;\n default:\n return type;\n }\n }", "function getPostfixForTypeWarning(value) {\n var type = getPreciseType(value);\n switch (type) {\n case 'array':\n case 'object':\n return 'an ' + type;\n case 'boolean':\n case 'date':\n case 'regexp':\n return 'a ' + type;\n default:\n return type;\n }\n }", "function getPostfixForTypeWarning(value) {\n\t\t var type = getPreciseType(value);\n\t\t switch (type) {\n\t\t case 'array':\n\t\t case 'object':\n\t\t return 'an ' + type;\n\t\t case 'boolean':\n\t\t case 'date':\n\t\t case 'regexp':\n\t\t return 'a ' + type;\n\t\t default:\n\t\t return type;\n\t\t }\n\t\t }", "function getPostfixForTypeWarning(value) {\n var type = getPreciseType(value);\n switch (type) {\n case 'array':\n case 'object':\n return 'an ' + type;\n case 'boolean':\n case 'date':\n case 'regexp':\n return 'a ' + type;\n default:\n return type;\n }\n }", "function getPostfixForTypeWarning(value) {\n var type = getPreciseType(value);\n switch (type) {\n case 'array':\n case 'object':\n return 'an ' + type;\n case 'boolean':\n case 'date':\n case 'regexp':\n return 'a ' + type;\n default:\n return type;\n }\n }", "function getPostfixForTypeWarning(value) {\n var type = getPreciseType(value);\n switch (type) {\n case 'array':\n case 'object':\n return 'an ' + type;\n case 'boolean':\n case 'date':\n case 'regexp':\n return 'a ' + type;\n default:\n return type;\n }\n }", "function getPostfixForTypeWarning(value) {\n var type = getPreciseType(value);\n switch (type) {\n case 'array':\n case 'object':\n return 'an ' + type;\n case 'boolean':\n case 'date':\n case 'regexp':\n return 'a ' + type;\n default:\n return type;\n }\n }", "function getPostfixForTypeWarning(value) {\n var type = getPreciseType(value);\n switch (type) {\n case 'array':\n case 'object':\n return 'an ' + type;\n case 'boolean':\n case 'date':\n case 'regexp':\n return 'a ' + type;\n default:\n return type;\n }\n }", "function getPostfixForTypeWarning(value) {\n var type = getPreciseType(value);\n switch(type){\n case 'array':\n case 'object':\n return 'an ' + type;\n case 'boolean':\n case 'date':\n case 'regexp':\n return 'a ' + type;\n default:\n return type;\n }\n }", "function getPostfixForTypeWarning(value) {\n\t var type = getPreciseType(value);\n\t switch (type) {\n\t case 'array':\n\t case 'object':\n\t return 'an ' + type;\n\t case 'boolean':\n\t case 'date':\n\t case 'regexp':\n\t return 'a ' + type;\n\t default:\n\t return type;\n\t }\n\t }", "function getPostfixForTypeWarning(value) {\n\t var type = getPreciseType(value);\n\t switch (type) {\n\t case 'array':\n\t case 'object':\n\t return 'an ' + type;\n\t case 'boolean':\n\t case 'date':\n\t case 'regexp':\n\t return 'a ' + type;\n\t default:\n\t return type;\n\t }\n\t }", "function getPostfixForTypeWarning(value) {\n\t var type = getPreciseType(value);\n\t switch (type) {\n\t case 'array':\n\t case 'object':\n\t return 'an ' + type;\n\t case 'boolean':\n\t case 'date':\n\t case 'regexp':\n\t return 'a ' + type;\n\t default:\n\t return type;\n\t }\n\t }", "function getPostfixForTypeWarning(value) {\n\t var type = getPreciseType(value);\n\t switch (type) {\n\t case 'array':\n\t case 'object':\n\t return 'an ' + type;\n\t case 'boolean':\n\t case 'date':\n\t case 'regexp':\n\t return 'a ' + type;\n\t default:\n\t return type;\n\t }\n\t }", "function getPostfixForTypeWarning(value) {\n\t var type = getPreciseType(value);\n\t switch (type) {\n\t case 'array':\n\t case 'object':\n\t return 'an ' + type;\n\t case 'boolean':\n\t case 'date':\n\t case 'regexp':\n\t return 'a ' + type;\n\t default:\n\t return type;\n\t }\n\t }", "function getPostfixForTypeWarning(value) {\n\t var type = getPreciseType(value);\n\t switch (type) {\n\t case 'array':\n\t case 'object':\n\t return 'an ' + type;\n\t case 'boolean':\n\t case 'date':\n\t case 'regexp':\n\t return 'a ' + type;\n\t default:\n\t return type;\n\t }\n\t }", "function getPostfixForTypeWarning(value) {\n\t var type = getPreciseType(value);\n\t switch (type) {\n\t case 'array':\n\t case 'object':\n\t return 'an ' + type;\n\t case 'boolean':\n\t case 'date':\n\t case 'regexp':\n\t return 'a ' + type;\n\t default:\n\t return type;\n\t }\n\t }", "function getPostfixForTypeWarning(value) {\n\t var type = getPreciseType(value);\n\t switch (type) {\n\t case 'array':\n\t case 'object':\n\t return 'an ' + type;\n\t case 'boolean':\n\t case 'date':\n\t case 'regexp':\n\t return 'a ' + type;\n\t default:\n\t return type;\n\t }\n\t }", "function getPostfixForTypeWarning(value) {\n\t var type = getPreciseType(value);\n\t switch (type) {\n\t case 'array':\n\t case 'object':\n\t return 'an ' + type;\n\t case 'boolean':\n\t case 'date':\n\t case 'regexp':\n\t return 'a ' + type;\n\t default:\n\t return type;\n\t }\n\t }", "function getPostfixForTypeWarning(value) {\n\t var type = getPreciseType(value);\n\t switch (type) {\n\t case 'array':\n\t case 'object':\n\t return 'an ' + type;\n\t case 'boolean':\n\t case 'date':\n\t case 'regexp':\n\t return 'a ' + type;\n\t default:\n\t return type;\n\t }\n\t }", "function getPostfixForTypeWarning(value) {\n\t var type = getPreciseType(value);\n\t switch (type) {\n\t case 'array':\n\t case 'object':\n\t return 'an ' + type;\n\t case 'boolean':\n\t case 'date':\n\t case 'regexp':\n\t return 'a ' + type;\n\t default:\n\t return type;\n\t }\n\t }", "function getPostfixForTypeWarning(value) {\n\t var type = getPreciseType(value);\n\t switch (type) {\n\t case 'array':\n\t case 'object':\n\t return 'an ' + type;\n\t case 'boolean':\n\t case 'date':\n\t case 'regexp':\n\t return 'a ' + type;\n\t default:\n\t return type;\n\t }\n\t }", "function getPostfixForTypeWarning(value) {\n\t var type = getPreciseType(value);\n\t switch (type) {\n\t case 'array':\n\t case 'object':\n\t return 'an ' + type;\n\t case 'boolean':\n\t case 'date':\n\t case 'regexp':\n\t return 'a ' + type;\n\t default:\n\t return type;\n\t }\n\t }", "function getPostfixForTypeWarning(value) {\n\t var type = getPreciseType(value);\n\t switch (type) {\n\t case 'array':\n\t case 'object':\n\t return 'an ' + type;\n\t case 'boolean':\n\t case 'date':\n\t case 'regexp':\n\t return 'a ' + type;\n\t default:\n\t return type;\n\t }\n\t }", "function getPostfixForTypeWarning(value) {\n\t var type = getPreciseType(value);\n\t switch (type) {\n\t case 'array':\n\t case 'object':\n\t return 'an ' + type;\n\t case 'boolean':\n\t case 'date':\n\t case 'regexp':\n\t return 'a ' + type;\n\t default:\n\t return type;\n\t }\n\t }", "function getPostfixForTypeWarning(value) {\n\t var type = getPreciseType(value);\n\t switch (type) {\n\t case 'array':\n\t case 'object':\n\t return 'an ' + type;\n\t case 'boolean':\n\t case 'date':\n\t case 'regexp':\n\t return 'a ' + type;\n\t default:\n\t return type;\n\t }\n\t }", "function getPostfixForTypeWarning(value) {\n\t var type = getPreciseType(value);\n\t switch (type) {\n\t case 'array':\n\t case 'object':\n\t return 'an ' + type;\n\t case 'boolean':\n\t case 'date':\n\t case 'regexp':\n\t return 'a ' + type;\n\t default:\n\t return type;\n\t }\n\t }", "function getPostfixForTypeWarning(value) {\n\t var type = getPreciseType(value);\n\t switch (type) {\n\t case 'array':\n\t case 'object':\n\t return 'an ' + type;\n\t case 'boolean':\n\t case 'date':\n\t case 'regexp':\n\t return 'a ' + type;\n\t default:\n\t return type;\n\t }\n\t }", "function getPostfixForTypeWarning(value) {\n\t var type = getPreciseType(value);\n\t switch (type) {\n\t case 'array':\n\t case 'object':\n\t return 'an ' + type;\n\t case 'boolean':\n\t case 'date':\n\t case 'regexp':\n\t return 'a ' + type;\n\t default:\n\t return type;\n\t }\n\t }", "function getPostfixForTypeWarning(value) {\n\t var type = getPreciseType(value);\n\t switch (type) {\n\t case 'array':\n\t case 'object':\n\t return 'an ' + type;\n\t case 'boolean':\n\t case 'date':\n\t case 'regexp':\n\t return 'a ' + type;\n\t default:\n\t return type;\n\t }\n\t }", "function getPostfixForTypeWarning(value) {\n\t var type = getPreciseType(value);\n\t switch (type) {\n\t case 'array':\n\t case 'object':\n\t return 'an ' + type;\n\t case 'boolean':\n\t case 'date':\n\t case 'regexp':\n\t return 'a ' + type;\n\t default:\n\t return type;\n\t }\n\t }", "function getPostfixForTypeWarning(value) {\n\t var type = getPreciseType(value);\n\t switch (type) {\n\t case 'array':\n\t case 'object':\n\t return 'an ' + type;\n\t case 'boolean':\n\t case 'date':\n\t case 'regexp':\n\t return 'a ' + type;\n\t default:\n\t return type;\n\t }\n\t }", "function getPostfixForTypeWarning(value) {\n\t var type = getPreciseType(value);\n\t switch (type) {\n\t case 'array':\n\t case 'object':\n\t return 'an ' + type;\n\t case 'boolean':\n\t case 'date':\n\t case 'regexp':\n\t return 'a ' + type;\n\t default:\n\t return type;\n\t }\n\t }", "function getPostfixForTypeWarning(value) {\n\t var type = getPreciseType(value);\n\t switch (type) {\n\t case 'array':\n\t case 'object':\n\t return 'an ' + type;\n\t case 'boolean':\n\t case 'date':\n\t case 'regexp':\n\t return 'a ' + type;\n\t default:\n\t return type;\n\t }\n\t }", "function getPostfixForTypeWarning(value) {\n\t var type = getPreciseType(value);\n\t switch (type) {\n\t case 'array':\n\t case 'object':\n\t return 'an ' + type;\n\t case 'boolean':\n\t case 'date':\n\t case 'regexp':\n\t return 'a ' + type;\n\t default:\n\t return type;\n\t }\n\t }", "function getPostfixForTypeWarning(value) {\n\t var type = getPreciseType(value);\n\t switch (type) {\n\t case 'array':\n\t case 'object':\n\t return 'an ' + type;\n\t case 'boolean':\n\t case 'date':\n\t case 'regexp':\n\t return 'a ' + type;\n\t default:\n\t return type;\n\t }\n\t }", "function getPostfixForTypeWarning(value) {\n\t var type = getPreciseType(value);\n\t switch (type) {\n\t case 'array':\n\t case 'object':\n\t return 'an ' + type;\n\t case 'boolean':\n\t case 'date':\n\t case 'regexp':\n\t return 'a ' + type;\n\t default:\n\t return type;\n\t }\n\t }", "function getPostfixForTypeWarning(value) {\n\t var type = getPreciseType(value);\n\t switch (type) {\n\t case 'array':\n\t case 'object':\n\t return 'an ' + type;\n\t case 'boolean':\n\t case 'date':\n\t case 'regexp':\n\t return 'a ' + type;\n\t default:\n\t return type;\n\t }\n\t }", "function getPostfixForTypeWarning(value) {\n\t var type = getPreciseType(value);\n\t switch (type) {\n\t case 'array':\n\t case 'object':\n\t return 'an ' + type;\n\t case 'boolean':\n\t case 'date':\n\t case 'regexp':\n\t return 'a ' + type;\n\t default:\n\t return type;\n\t }\n\t }", "function getPostfixForTypeWarning(value) {\n\t var type = getPreciseType(value);\n\t switch (type) {\n\t case 'array':\n\t case 'object':\n\t return 'an ' + type;\n\t case 'boolean':\n\t case 'date':\n\t case 'regexp':\n\t return 'a ' + type;\n\t default:\n\t return type;\n\t }\n\t }", "function getPostfixForTypeWarning(value) {\n\t var type = getPreciseType(value);\n\t switch (type) {\n\t case 'array':\n\t case 'object':\n\t return 'an ' + type;\n\t case 'boolean':\n\t case 'date':\n\t case 'regexp':\n\t return 'a ' + type;\n\t default:\n\t return type;\n\t }\n\t }", "function getPostfixForTypeWarning(value) {\n\t var type = getPreciseType(value);\n\t switch (type) {\n\t case 'array':\n\t case 'object':\n\t return 'an ' + type;\n\t case 'boolean':\n\t case 'date':\n\t case 'regexp':\n\t return 'a ' + type;\n\t default:\n\t return type;\n\t }\n\t }", "function getPostfixForTypeWarning(value) {\n\t var type = getPreciseType(value);\n\t switch (type) {\n\t case 'array':\n\t case 'object':\n\t return 'an ' + type;\n\t case 'boolean':\n\t case 'date':\n\t case 'regexp':\n\t return 'a ' + type;\n\t default:\n\t return type;\n\t }\n\t }", "function getPostfixForTypeWarning(value) {\n\t var type = getPreciseType(value);\n\t switch (type) {\n\t case 'array':\n\t case 'object':\n\t return 'an ' + type;\n\t case 'boolean':\n\t case 'date':\n\t case 'regexp':\n\t return 'a ' + type;\n\t default:\n\t return type;\n\t }\n\t }", "function getPostfixForTypeWarning(value) {\n\t var type = getPreciseType(value);\n\t switch (type) {\n\t case 'array':\n\t case 'object':\n\t return 'an ' + type;\n\t case 'boolean':\n\t case 'date':\n\t case 'regexp':\n\t return 'a ' + type;\n\t default:\n\t return type;\n\t }\n\t }", "function getPostfixForTypeWarning(value) {\n\t var type = getPreciseType(value);\n\t switch (type) {\n\t case 'array':\n\t case 'object':\n\t return 'an ' + type;\n\t case 'boolean':\n\t case 'date':\n\t case 'regexp':\n\t return 'a ' + type;\n\t default:\n\t return type;\n\t }\n\t }", "function getPostfixForTypeWarning(value) {\n\t var type = getPreciseType(value);\n\t switch (type) {\n\t case 'array':\n\t case 'object':\n\t return 'an ' + type;\n\t case 'boolean':\n\t case 'date':\n\t case 'regexp':\n\t return 'a ' + type;\n\t default:\n\t return type;\n\t }\n\t }", "function getPostfixForTypeWarning(value) {\n\t var type = getPreciseType(value);\n\t switch (type) {\n\t case 'array':\n\t case 'object':\n\t return 'an ' + type;\n\t case 'boolean':\n\t case 'date':\n\t case 'regexp':\n\t return 'a ' + type;\n\t default:\n\t return type;\n\t }\n\t }", "function getPostfixForTypeWarning(value) {\n\t var type = getPreciseType(value);\n\t switch (type) {\n\t case 'array':\n\t case 'object':\n\t return 'an ' + type;\n\t case 'boolean':\n\t case 'date':\n\t case 'regexp':\n\t return 'a ' + type;\n\t default:\n\t return type;\n\t }\n\t }", "function getPostfixForTypeWarning(value) {\n\t var type = getPreciseType(value);\n\t switch (type) {\n\t case 'array':\n\t case 'object':\n\t return 'an ' + type;\n\t case 'boolean':\n\t case 'date':\n\t case 'regexp':\n\t return 'a ' + type;\n\t default:\n\t return type;\n\t }\n\t }", "function getPostfixForTypeWarning(value) {\n\t var type = getPreciseType(value);\n\t switch (type) {\n\t case 'array':\n\t case 'object':\n\t return 'an ' + type;\n\t case 'boolean':\n\t case 'date':\n\t case 'regexp':\n\t return 'a ' + type;\n\t default:\n\t return type;\n\t }\n\t }", "function getPostfixForTypeWarning(value) {\n\t var type = getPreciseType(value);\n\t switch (type) {\n\t case 'array':\n\t case 'object':\n\t return 'an ' + type;\n\t case 'boolean':\n\t case 'date':\n\t case 'regexp':\n\t return 'a ' + type;\n\t default:\n\t return type;\n\t }\n\t }", "function getPostfixForTypeWarning(value) {\n\t var type = getPreciseType(value);\n\t switch (type) {\n\t case 'array':\n\t case 'object':\n\t return 'an ' + type;\n\t case 'boolean':\n\t case 'date':\n\t case 'regexp':\n\t return 'a ' + type;\n\t default:\n\t return type;\n\t }\n\t }" ]
[ "0.6599196", "0.6566137", "0.6560382", "0.6560382", "0.6560382", "0.6560382", "0.6523208", "0.6522379", "0.6506975", "0.6506975", "0.6506975", "0.6506975", "0.6506975", "0.65022165", "0.64905936", "0.6478573", "0.6478573", "0.6478573", "0.6478573", "0.6478573", "0.6478573", "0.6478573", "0.6478573", "0.6478573", "0.6478573", "0.6478573", "0.6478573", "0.6478573", "0.6478573", "0.6478573", "0.6478573", "0.6478573", "0.6478573", "0.6478573", "0.6478573", "0.6478573", "0.6478573", "0.6478573", "0.6478573", "0.6478573", "0.6478573", "0.6478573", "0.6478573", "0.6478573", "0.6478573", "0.6478573", "0.6478573", "0.6478573", "0.6478573", "0.6478573", "0.6478573", "0.6478573", "0.6478573", "0.6478573", "0.6478573", "0.6478573", "0.6478573" ]
0.0
-1
Returns class name of the object, if any.
function getClassName(propValue) { if (!propValue.constructor || !propValue.constructor.name) { return ANONYMOUS; } return propValue.constructor.name; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getClassName(obj) {\n var funcNameRegex = /function\\s+(.+?)\\s*\\(/;\n var results = funcNameRegex.exec(obj['constructor'].toString());\n return (results && results.length > 1) ? results[1] : '';\n }", "getClassName() {\n return this.constructor\n .className;\n }", "getClassName() {\n return this.constructor\n .className;\n }", "function getClassName(obj)\n{\n if (obj === null) {\n return 'null';\n }\n if (obj === undefined) {\n return 'undefined';\n }\n var c = obj.constructor.toString();\n return c.substring(9, c.indexOf('(', 10));\n}", "function getClass(o) {\n\n\tif (o === null || o === undefined) return \"Object\";\n\treturn OP_toString.call(o).slice(\"[object \".length, -1);\n}", "getClassName() {\n return this.constructor.name\n }", "function getClass(obj) {\r\n return Object.prototype.toString.call(obj);\r\n}", "function getClass(obj) {\n return {}.toString.call(obj).slice(8, -1);\n}", "static getClassName() {\n return \"Object\";\n }", "function classOf(o){\n if(o === null) return \"Null\";\n if(o === undefined) return \"Undefined\";\n return Object.prototype.toString.call(o).slice(8, -1);\n}", "function get$className()/* : String*/\n {\n return flash.utils.getQualifiedClassName(this).replace(/::/, \".\");\n }", "function get_class_name(current_obj) {\n\t\t\tvar id = current_obj.attr('id');\n\t\t\tvar name = id.substring(6,id.length);\n\t\t\treturn name;\n\t\t}", "function getObjectName(object) {\n if (object === undefined) {\n return '';\n }\n if (object === null) {\n return 'Object';\n }\n if (typeof object === 'object' && !object.constructor) {\n return 'Object';\n }\n var funcNameRegex = /function ([^(]*)/;\n var results = (funcNameRegex).exec((object).constructor.toString());\n if (results && results.length > 1) {\n return results[1];\n }\n else {\n return '';\n }\n }", "function _getClazz() {\r\n\t\tvar n = clz = this.vj$._class, idx = n.lastIndexOf('.');\r\n\t\tif (idx != -1) clz = n.substring(idx+1); \r\n\t\tif (this.vj$[clz]) return this.vj$[clz].clazz;\r\n\r\n\t\t//Error case...\r\n\t\treturn null;\r\n\t}", "getClassName() {\n return this.statesTable.getString(this.currentState, 'ClassName');\n }", "function getClassName(propValue) {\n if (!propValue.constructor || !propValue.constructor.name) {\n return ANONYMOUS;\n }\n return propValue.constructor.name;\n }", "function getClassName(propValue) {\n if (!propValue.constructor || !propValue.constructor.name) {\n return ANONYMOUS;\n }\n return propValue.constructor.name;\n }", "function getClassName(propValue) {\n if (!propValue.constructor || !propValue.constructor.name) {\n return ANONYMOUS;\n }\n return propValue.constructor.name;\n }", "function getClassName(propValue) {\n if (!propValue.constructor || !propValue.constructor.name) {\n return ANONYMOUS;\n }\n return propValue.constructor.name;\n }", "function getClassName(propValue) {\n if (!propValue.constructor || !propValue.constructor.name) {\n return ANONYMOUS;\n }\n return propValue.constructor.name;\n }", "function getClassName(propValue) {\n if (!propValue.constructor || !propValue.constructor.name) {\n return ANONYMOUS;\n }\n return propValue.constructor.name;\n }", "function getClassName(propValue) {\n if (!propValue.constructor || !propValue.constructor.name) {\n return ANONYMOUS;\n }\n return propValue.constructor.name;\n }", "function getClassName(propValue) {\n if (!propValue.constructor || !propValue.constructor.name) {\n return ANONYMOUS;\n }\n return propValue.constructor.name;\n }", "function getClassName(propValue) {\n if (!propValue.constructor || !propValue.constructor.name) {\n return ANONYMOUS;\n }\n return propValue.constructor.name;\n }", "function getClassName(propValue) {\n if (!propValue.constructor || !propValue.constructor.name) {\n return ANONYMOUS;\n }\n return propValue.constructor.name;\n }", "function getClassName(propValue) {\n if (!propValue.constructor || !propValue.constructor.name) {\n return ANONYMOUS;\n }\n return propValue.constructor.name;\n }", "function getClassName(propValue) {\n if (!propValue.constructor || !propValue.constructor.name) {\n return ANONYMOUS;\n }\n return propValue.constructor.name;\n }" ]
[ "0.7730571", "0.74697196", "0.74697196", "0.74258965", "0.7164231", "0.71448183", "0.7083163", "0.7080694", "0.6995368", "0.6971116", "0.6901662", "0.6883398", "0.67147285", "0.66557264", "0.6639163", "0.6611592", "0.6611592", "0.6611592", "0.6611592", "0.6600893", "0.6599787", "0.6599787", "0.6599787", "0.6599787", "0.6599787", "0.6582472", "0.6582472" ]
0.0
-1
Function to create the first processor.
function unified() { var attachers = [] var transformers = trough() var namespace = {} var frozen = false var freezeIndex = -1 /* Data management. */ processor.data = data /* Lock. */ processor.freeze = freeze /* Plug-ins. */ processor.attachers = attachers processor.use = use /* API. */ processor.parse = parse processor.stringify = stringify processor.run = run processor.runSync = runSync processor.process = process processor.processSync = processSync /* Expose. */ return processor /* Create a new processor based on the processor * in the current scope. */ function processor() { var destination = unified() var length = attachers.length var index = -1 while (++index < length) { destination.use.apply(null, attachers[index]) } destination.data(extend(true, {}, namespace)) return destination } /* Freeze: used to signal a processor that has finished * configuration. * * For example, take unified itself. It’s frozen. * Plug-ins should not be added to it. Rather, it should * be extended, by invoking it, before modifying it. * * In essence, always invoke this when exporting a * processor. */ function freeze() { var values var plugin var options var transformer if (frozen) { return processor } while (++freezeIndex < attachers.length) { values = attachers[freezeIndex] plugin = values[0] options = values[1] transformer = null if (options === false) { continue } if (options === true) { values[1] = undefined } transformer = plugin.apply(processor, values.slice(1)) if (typeof transformer === 'function') { transformers.use(transformer) } } frozen = true freezeIndex = Infinity return processor } /* Data management. * Getter / setter for processor-specific informtion. */ function data(key, value) { if (string(key)) { /* Set `key`. */ if (arguments.length === 2) { assertUnfrozen('data', frozen) namespace[key] = value return processor } /* Get `key`. */ return (own.call(namespace, key) && namespace[key]) || null } /* Set space. */ if (key) { assertUnfrozen('data', frozen) namespace = key return processor } /* Get space. */ return namespace } /* Plug-in management. * * Pass it: * * an attacher and options, * * a preset, * * a list of presets, attachers, and arguments (list * of attachers and options). */ function use(value) { var settings assertUnfrozen('use', frozen) if (value === null || value === undefined) { /* Empty */ } else if (typeof value === 'function') { addPlugin.apply(null, arguments) } else if (typeof value === 'object') { if ('length' in value) { addList(value) } else { addPreset(value) } } else { throw new Error('Expected usable value, not `' + value + '`') } if (settings) { namespace.settings = extend(namespace.settings || {}, settings) } return processor function addPreset(result) { addList(result.plugins) if (result.settings) { settings = extend(settings || {}, result.settings) } } function add(value) { if (typeof value === 'function') { addPlugin(value) } else if (typeof value === 'object') { if ('length' in value) { addPlugin.apply(null, value) } else { addPreset(value) } } else { throw new Error('Expected usable value, not `' + value + '`') } } function addList(plugins) { var length var index if (plugins === null || plugins === undefined) { /* Empty */ } else if (typeof plugins === 'object' && 'length' in plugins) { length = plugins.length index = -1 while (++index < length) { add(plugins[index]) } } else { throw new Error('Expected a list of plugins, not `' + plugins + '`') } } function addPlugin(plugin, value) { var entry = find(plugin) if (entry) { if (plain(entry[1]) && plain(value)) { value = extend(entry[1], value) } entry[1] = value } else { attachers.push(slice.call(arguments)) } } } function find(plugin) { var length = attachers.length var index = -1 var entry while (++index < length) { entry = attachers[index] if (entry[0] === plugin) { return entry } } } /* Parse a file (in string or VFile representation) * into a Unist node using the `Parser` on the * processor. */ function parse(doc) { var file = vfile(doc) var Parser freeze() Parser = processor.Parser assertParser('parse', Parser) if (newable(Parser)) { return new Parser(String(file), file).parse() } return Parser(String(file), file) // eslint-disable-line new-cap } /* Run transforms on a Unist node representation of a file * (in string or VFile representation), async. */ function run(node, file, cb) { assertNode(node) freeze() if (!cb && typeof file === 'function') { cb = file file = null } if (!cb) { return new Promise(executor) } executor(null, cb) function executor(resolve, reject) { transformers.run(node, vfile(file), done) function done(err, tree, file) { tree = tree || node if (err) { reject(err) } else if (resolve) { resolve(tree) } else { cb(null, tree, file) } } } } /* Run transforms on a Unist node representation of a file * (in string or VFile representation), sync. */ function runSync(node, file) { var complete = false var result run(node, file, done) assertDone('runSync', 'run', complete) return result function done(err, tree) { complete = true bail(err) result = tree } } /* Stringify a Unist node representation of a file * (in string or VFile representation) into a string * using the `Compiler` on the processor. */ function stringify(node, doc) { var file = vfile(doc) var Compiler freeze() Compiler = processor.Compiler assertCompiler('stringify', Compiler) assertNode(node) if (newable(Compiler)) { return new Compiler(node, file).compile() } return Compiler(node, file) // eslint-disable-line new-cap } /* Parse a file (in string or VFile representation) * into a Unist node using the `Parser` on the processor, * then run transforms on that node, and compile the * resulting node using the `Compiler` on the processor, * and store that result on the VFile. */ function process(doc, cb) { freeze() assertParser('process', processor.Parser) assertCompiler('process', processor.Compiler) if (!cb) { return new Promise(executor) } executor(null, cb) function executor(resolve, reject) { var file = vfile(doc) pipeline.run(processor, {file: file}, done) function done(err) { if (err) { reject(err) } else if (resolve) { resolve(file) } else { cb(null, file) } } } } /* Process the given document (in string or VFile * representation), sync. */ function processSync(doc) { var complete = false var file freeze() assertParser('processSync', processor.Parser) assertCompiler('processSync', processor.Compiler) file = vfile(doc) process(file, done) assertDone('processSync', 'process', complete) return file function done(err) { complete = true bail(err) } } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function DeviceProcessor() {\n\tvar builder = new processor.Chain();\n\tbuilder.Add(save_flags);\n\tbuilder.Add(strip_syslog_priority);\n\tbuilder.Add(chain1);\n\tbuilder.Add(populate_fields);\n\tbuilder.Add(restore_flags);\n\tvar chain = builder.Build();\n\treturn {\n\t\tprocess: chain.Run,\n\t}\n}", "function DeviceProcessor() {\n\tvar builder = new processor.Chain();\n\tbuilder.Add(save_flags);\n\tbuilder.Add(strip_syslog_priority);\n\tbuilder.Add(chain1);\n\tbuilder.Add(populate_fields);\n\tbuilder.Add(restore_flags);\n\tvar chain = builder.Build();\n\treturn {\n\t\tprocess: chain.Run,\n\t}\n}", "function DeviceProcessor() {\n\tvar builder = new processor.Chain();\n\tbuilder.Add(save_flags);\n\tbuilder.Add(strip_syslog_priority);\n\tbuilder.Add(chain1);\n\tbuilder.Add(populate_fields);\n\tbuilder.Add(restore_flags);\n\tvar chain = builder.Build();\n\treturn {\n\t\tprocess: chain.Run,\n\t}\n}", "function unified() {\n var attachers = []\n var transformers = trough()\n var namespace = {}\n var freezeIndex = -1\n var frozen\n\n // Data management.\n processor.data = data\n\n // Lock.\n processor.freeze = freeze\n\n // Plugins.\n processor.attachers = attachers\n processor.use = use\n\n // API.\n processor.parse = parse\n processor.stringify = stringify\n processor.run = run\n processor.runSync = runSync\n processor.process = process\n processor.processSync = processSync\n\n // Expose.\n return processor\n\n // Create a new processor based on the processor in the current scope.\n function processor() {\n var destination = unified()\n var index = -1\n\n while (++index < attachers.length) {\n destination.use.apply(null, attachers[index])\n }\n\n destination.data(extend(true, {}, namespace))\n\n return destination\n }\n\n // Freeze: used to signal a processor that has finished configuration.\n //\n // For example, take unified itself: it’s frozen.\n // Plugins should not be added to it.\n // Rather, it should be extended, by invoking it, before modifying it.\n //\n // In essence, always invoke this when exporting a processor.\n function freeze() {\n var values\n var transformer\n\n if (frozen) {\n return processor\n }\n\n while (++freezeIndex < attachers.length) {\n values = attachers[freezeIndex]\n\n if (values[1] === false) {\n continue\n }\n\n if (values[1] === true) {\n values[1] = undefined\n }\n\n transformer = values[0].apply(processor, values.slice(1))\n\n if (typeof transformer === 'function') {\n transformers.use(transformer)\n }\n }\n\n frozen = true\n freezeIndex = Infinity\n\n return processor\n }\n\n // Data management.\n // Getter / setter for processor-specific informtion.\n function data(key, value) {\n if (typeof key === 'string') {\n // Set `key`.\n if (arguments.length === 2) {\n assertUnfrozen('data', frozen)\n namespace[key] = value\n return processor\n }\n\n // Get `key`.\n return (own.call(namespace, key) && namespace[key]) || null\n }\n\n // Set space.\n if (key) {\n assertUnfrozen('data', frozen)\n namespace = key\n return processor\n }\n\n // Get space.\n return namespace\n }\n\n // Plugin management.\n //\n // Pass it:\n // * an attacher and options,\n // * a preset,\n // * a list of presets, attachers, and arguments (list of attachers and\n // options).\n function use(value) {\n var settings\n\n assertUnfrozen('use', frozen)\n\n if (value === null || value === undefined) {\n // Empty.\n } else if (typeof value === 'function') {\n addPlugin.apply(null, arguments)\n } else if (typeof value === 'object') {\n if ('length' in value) {\n addList(value)\n } else {\n addPreset(value)\n }\n } else {\n throw new Error('Expected usable value, not `' + value + '`')\n }\n\n if (settings) {\n namespace.settings = extend(namespace.settings || {}, settings)\n }\n\n return processor\n\n function addPreset(result) {\n addList(result.plugins)\n\n if (result.settings) {\n settings = extend(settings || {}, result.settings)\n }\n }\n\n function add(value) {\n if (typeof value === 'function') {\n addPlugin(value)\n } else if (typeof value === 'object') {\n if ('length' in value) {\n addPlugin.apply(null, value)\n } else {\n addPreset(value)\n }\n } else {\n throw new Error('Expected usable value, not `' + value + '`')\n }\n }\n\n function addList(plugins) {\n var index = -1\n\n if (plugins === null || plugins === undefined) {\n // Empty.\n } else if (typeof plugins === 'object' && 'length' in plugins) {\n while (++index < plugins.length) {\n add(plugins[index])\n }\n } else {\n throw new Error('Expected a list of plugins, not `' + plugins + '`')\n }\n }\n\n function addPlugin(plugin, value) {\n var entry = find(plugin)\n\n if (entry) {\n if (plain(entry[1]) && plain(value)) {\n value = extend(true, entry[1], value)\n }\n\n entry[1] = value\n } else {\n attachers.push(slice.call(arguments))\n }\n }\n }\n\n function find(plugin) {\n var index = -1\n\n while (++index < attachers.length) {\n if (attachers[index][0] === plugin) {\n return attachers[index]\n }\n }\n }\n\n // Parse a file (in string or vfile representation) into a unist node using\n // the `Parser` on the processor.\n function parse(doc) {\n var file = vfile(doc)\n var Parser\n\n freeze()\n Parser = processor.Parser\n assertParser('parse', Parser)\n\n if (newable(Parser, 'parse')) {\n return new Parser(String(file), file).parse()\n }\n\n return Parser(String(file), file) // eslint-disable-line new-cap\n }\n\n // Run transforms on a unist node representation of a file (in string or\n // vfile representation), async.\n function run(node, file, cb) {\n assertNode(node)\n freeze()\n\n if (!cb && typeof file === 'function') {\n cb = file\n file = null\n }\n\n if (!cb) {\n return new Promise(executor)\n }\n\n executor(null, cb)\n\n function executor(resolve, reject) {\n transformers.run(node, vfile(file), done)\n\n function done(error, tree, file) {\n tree = tree || node\n if (error) {\n reject(error)\n } else if (resolve) {\n resolve(tree)\n } else {\n cb(null, tree, file)\n }\n }\n }\n }\n\n // Run transforms on a unist node representation of a file (in string or\n // vfile representation), sync.\n function runSync(node, file) {\n var result\n var complete\n\n run(node, file, done)\n\n assertDone('runSync', 'run', complete)\n\n return result\n\n function done(error, tree) {\n complete = true\n result = tree\n bail(error)\n }\n }\n\n // Stringify a unist node representation of a file (in string or vfile\n // representation) into a string using the `Compiler` on the processor.\n function stringify(node, doc) {\n var file = vfile(doc)\n var Compiler\n\n freeze()\n Compiler = processor.Compiler\n assertCompiler('stringify', Compiler)\n assertNode(node)\n\n if (newable(Compiler, 'compile')) {\n return new Compiler(node, file).compile()\n }\n\n return Compiler(node, file) // eslint-disable-line new-cap\n }\n\n // Parse a file (in string or vfile representation) into a unist node using\n // the `Parser` on the processor, then run transforms on that node, and\n // compile the resulting node using the `Compiler` on the processor, and\n // store that result on the vfile.\n function process(doc, cb) {\n freeze()\n assertParser('process', processor.Parser)\n assertCompiler('process', processor.Compiler)\n\n if (!cb) {\n return new Promise(executor)\n }\n\n executor(null, cb)\n\n function executor(resolve, reject) {\n var file = vfile(doc)\n\n pipeline.run(processor, {file: file}, done)\n\n function done(error) {\n if (error) {\n reject(error)\n } else if (resolve) {\n resolve(file)\n } else {\n cb(null, file)\n }\n }\n }\n }\n\n // Process the given document (in string or vfile representation), sync.\n function processSync(doc) {\n var file\n var complete\n\n freeze()\n assertParser('processSync', processor.Parser)\n assertCompiler('processSync', processor.Compiler)\n file = vfile(doc)\n\n process(file, done)\n\n assertDone('processSync', 'process', complete)\n\n return file\n\n function done(error) {\n complete = true\n bail(error)\n }\n }\n}", "function unified() {\n var attachers = []\n var transformers = trough()\n var namespace = {}\n var freezeIndex = -1\n var frozen\n\n // Data management.\n processor.data = data\n\n // Lock.\n processor.freeze = freeze\n\n // Plugins.\n processor.attachers = attachers\n processor.use = use\n\n // API.\n processor.parse = parse\n processor.stringify = stringify\n processor.run = run\n processor.runSync = runSync\n processor.process = process\n processor.processSync = processSync\n\n // Expose.\n return processor\n\n // Create a new processor based on the processor in the current scope.\n function processor() {\n var destination = unified()\n var index = -1\n\n while (++index < attachers.length) {\n destination.use.apply(null, attachers[index])\n }\n\n destination.data(extend(true, {}, namespace))\n\n return destination\n }\n\n // Freeze: used to signal a processor that has finished configuration.\n //\n // For example, take unified itself: it’s frozen.\n // Plugins should not be added to it.\n // Rather, it should be extended, by invoking it, before modifying it.\n //\n // In essence, always invoke this when exporting a processor.\n function freeze() {\n var values\n var transformer\n\n if (frozen) {\n return processor\n }\n\n while (++freezeIndex < attachers.length) {\n values = attachers[freezeIndex]\n\n if (values[1] === false) {\n continue\n }\n\n if (values[1] === true) {\n values[1] = undefined\n }\n\n transformer = values[0].apply(processor, values.slice(1))\n\n if (typeof transformer === 'function') {\n transformers.use(transformer)\n }\n }\n\n frozen = true\n freezeIndex = Infinity\n\n return processor\n }\n\n // Data management.\n // Getter / setter for processor-specific informtion.\n function data(key, value) {\n if (typeof key === 'string') {\n // Set `key`.\n if (arguments.length === 2) {\n assertUnfrozen('data', frozen)\n namespace[key] = value\n return processor\n }\n\n // Get `key`.\n return (own.call(namespace, key) && namespace[key]) || null\n }\n\n // Set space.\n if (key) {\n assertUnfrozen('data', frozen)\n namespace = key\n return processor\n }\n\n // Get space.\n return namespace\n }\n\n // Plugin management.\n //\n // Pass it:\n // * an attacher and options,\n // * a preset,\n // * a list of presets, attachers, and arguments (list of attachers and\n // options).\n function use(value) {\n var settings\n\n assertUnfrozen('use', frozen)\n\n if (value === null || value === undefined) {\n // Empty.\n } else if (typeof value === 'function') {\n addPlugin.apply(null, arguments)\n } else if (typeof value === 'object') {\n if ('length' in value) {\n addList(value)\n } else {\n addPreset(value)\n }\n } else {\n throw new Error('Expected usable value, not `' + value + '`')\n }\n\n if (settings) {\n namespace.settings = extend(namespace.settings || {}, settings)\n }\n\n return processor\n\n function addPreset(result) {\n addList(result.plugins)\n\n if (result.settings) {\n settings = extend(settings || {}, result.settings)\n }\n }\n\n function add(value) {\n if (typeof value === 'function') {\n addPlugin(value)\n } else if (typeof value === 'object') {\n if ('length' in value) {\n addPlugin.apply(null, value)\n } else {\n addPreset(value)\n }\n } else {\n throw new Error('Expected usable value, not `' + value + '`')\n }\n }\n\n function addList(plugins) {\n var index = -1\n\n if (plugins === null || plugins === undefined) {\n // Empty.\n } else if (typeof plugins === 'object' && 'length' in plugins) {\n while (++index < plugins.length) {\n add(plugins[index])\n }\n } else {\n throw new Error('Expected a list of plugins, not `' + plugins + '`')\n }\n }\n\n function addPlugin(plugin, value) {\n var entry = find(plugin)\n\n if (entry) {\n if (plain(entry[1]) && plain(value)) {\n value = extend(true, entry[1], value)\n }\n\n entry[1] = value\n } else {\n attachers.push(slice.call(arguments))\n }\n }\n }\n\n function find(plugin) {\n var index = -1\n\n while (++index < attachers.length) {\n if (attachers[index][0] === plugin) {\n return attachers[index]\n }\n }\n }\n\n // Parse a file (in string or vfile representation) into a unist node using\n // the `Parser` on the processor.\n function parse(doc) {\n var file = vfile(doc)\n var Parser\n\n freeze()\n Parser = processor.Parser\n assertParser('parse', Parser)\n\n if (newable(Parser, 'parse')) {\n return new Parser(String(file), file).parse()\n }\n\n return Parser(String(file), file) // eslint-disable-line new-cap\n }\n\n // Run transforms on a unist node representation of a file (in string or\n // vfile representation), async.\n function run(node, file, cb) {\n assertNode(node)\n freeze()\n\n if (!cb && typeof file === 'function') {\n cb = file\n file = null\n }\n\n if (!cb) {\n return new Promise(executor)\n }\n\n executor(null, cb)\n\n function executor(resolve, reject) {\n transformers.run(node, vfile(file), done)\n\n function done(error, tree, file) {\n tree = tree || node\n if (error) {\n reject(error)\n } else if (resolve) {\n resolve(tree)\n } else {\n cb(null, tree, file)\n }\n }\n }\n }\n\n // Run transforms on a unist node representation of a file (in string or\n // vfile representation), sync.\n function runSync(node, file) {\n var result\n var complete\n\n run(node, file, done)\n\n assertDone('runSync', 'run', complete)\n\n return result\n\n function done(error, tree) {\n complete = true\n result = tree\n bail(error)\n }\n }\n\n // Stringify a unist node representation of a file (in string or vfile\n // representation) into a string using the `Compiler` on the processor.\n function stringify(node, doc) {\n var file = vfile(doc)\n var Compiler\n\n freeze()\n Compiler = processor.Compiler\n assertCompiler('stringify', Compiler)\n assertNode(node)\n\n if (newable(Compiler, 'compile')) {\n return new Compiler(node, file).compile()\n }\n\n return Compiler(node, file) // eslint-disable-line new-cap\n }\n\n // Parse a file (in string or vfile representation) into a unist node using\n // the `Parser` on the processor, then run transforms on that node, and\n // compile the resulting node using the `Compiler` on the processor, and\n // store that result on the vfile.\n function process(doc, cb) {\n freeze()\n assertParser('process', processor.Parser)\n assertCompiler('process', processor.Compiler)\n\n if (!cb) {\n return new Promise(executor)\n }\n\n executor(null, cb)\n\n function executor(resolve, reject) {\n var file = vfile(doc)\n\n pipeline.run(processor, {file: file}, done)\n\n function done(error) {\n if (error) {\n reject(error)\n } else if (resolve) {\n resolve(file)\n } else {\n cb(null, file)\n }\n }\n }\n }\n\n // Process the given document (in string or vfile representation), sync.\n function processSync(doc) {\n var file\n var complete\n\n freeze()\n assertParser('processSync', processor.Parser)\n assertCompiler('processSync', processor.Compiler)\n file = vfile(doc)\n\n process(file, done)\n\n assertDone('processSync', 'process', complete)\n\n return file\n\n function done(error) {\n complete = true\n bail(error)\n }\n }\n}", "function unified() {\n var attachers = []\n var transformers = trough()\n var namespace = {}\n var frozen = false\n var freezeIndex = -1\n\n // Data management.\n processor.data = data\n\n // Lock.\n processor.freeze = freeze\n\n // Plugins.\n processor.attachers = attachers\n processor.use = use\n\n // API.\n processor.parse = parse\n processor.stringify = stringify\n processor.run = run\n processor.runSync = runSync\n processor.process = process\n processor.processSync = processSync\n\n // Expose.\n return processor\n\n // Create a new processor based on the processor in the current scope.\n function processor() {\n var destination = unified()\n var length = attachers.length\n var index = -1\n\n while (++index < length) {\n destination.use.apply(null, attachers[index])\n }\n\n destination.data(extend(true, {}, namespace))\n\n return destination\n }\n\n // Freeze: used to signal a processor that has finished configuration.\n //\n // For example, take unified itself: it’s frozen.\n // Plugins should not be added to it.\n // Rather, it should be extended, by invoking it, before modifying it.\n //\n // In essence, always invoke this when exporting a processor.\n function freeze() {\n var values\n var plugin\n var options\n var transformer\n\n if (frozen) {\n return processor\n }\n\n while (++freezeIndex < attachers.length) {\n values = attachers[freezeIndex]\n plugin = values[0]\n options = values[1]\n transformer = null\n\n if (options === false) {\n continue\n }\n\n if (options === true) {\n values[1] = undefined\n }\n\n transformer = plugin.apply(processor, values.slice(1))\n\n if (typeof transformer === 'function') {\n transformers.use(transformer)\n }\n }\n\n frozen = true\n freezeIndex = Infinity\n\n return processor\n }\n\n // Data management.\n // Getter / setter for processor-specific informtion.\n function data(key, value) {\n if (typeof key === 'string') {\n // Set `key`.\n if (arguments.length === 2) {\n assertUnfrozen('data', frozen)\n\n namespace[key] = value\n\n return processor\n }\n\n // Get `key`.\n return (own.call(namespace, key) && namespace[key]) || null\n }\n\n // Set space.\n if (key) {\n assertUnfrozen('data', frozen)\n namespace = key\n return processor\n }\n\n // Get space.\n return namespace\n }\n\n // Plugin management.\n //\n // Pass it:\n // * an attacher and options,\n // * a preset,\n // * a list of presets, attachers, and arguments (list of attachers and\n // options).\n function use(value) {\n var settings\n\n assertUnfrozen('use', frozen)\n\n if (value === null || value === undefined) {\n // Empty.\n } else if (typeof value === 'function') {\n addPlugin.apply(null, arguments)\n } else if (typeof value === 'object') {\n if ('length' in value) {\n addList(value)\n } else {\n addPreset(value)\n }\n } else {\n throw new Error('Expected usable value, not `' + value + '`')\n }\n\n if (settings) {\n namespace.settings = extend(namespace.settings || {}, settings)\n }\n\n return processor\n\n function addPreset(result) {\n addList(result.plugins)\n\n if (result.settings) {\n settings = extend(settings || {}, result.settings)\n }\n }\n\n function add(value) {\n if (typeof value === 'function') {\n addPlugin(value)\n } else if (typeof value === 'object') {\n if ('length' in value) {\n addPlugin.apply(null, value)\n } else {\n addPreset(value)\n }\n } else {\n throw new Error('Expected usable value, not `' + value + '`')\n }\n }\n\n function addList(plugins) {\n var length\n var index\n\n if (plugins === null || plugins === undefined) {\n // Empty.\n } else if (typeof plugins === 'object' && 'length' in plugins) {\n length = plugins.length\n index = -1\n\n while (++index < length) {\n add(plugins[index])\n }\n } else {\n throw new Error('Expected a list of plugins, not `' + plugins + '`')\n }\n }\n\n function addPlugin(plugin, value) {\n var entry = find(plugin)\n\n if (entry) {\n if (plain(entry[1]) && plain(value)) {\n value = extend(entry[1], value)\n }\n\n entry[1] = value\n } else {\n attachers.push(slice.call(arguments))\n }\n }\n }\n\n function find(plugin) {\n var length = attachers.length\n var index = -1\n var entry\n\n while (++index < length) {\n entry = attachers[index]\n\n if (entry[0] === plugin) {\n return entry\n }\n }\n }\n\n // Parse a file (in string or vfile representation) into a unist node using\n // the `Parser` on the processor.\n function parse(doc) {\n var file = vfile(doc)\n var Parser\n\n freeze()\n Parser = processor.Parser\n assertParser('parse', Parser)\n\n if (newable(Parser, 'parse')) {\n return new Parser(String(file), file).parse()\n }\n\n return Parser(String(file), file) // eslint-disable-line new-cap\n }\n\n // Run transforms on a unist node representation of a file (in string or\n // vfile representation), async.\n function run(node, file, cb) {\n assertNode(node)\n freeze()\n\n if (!cb && typeof file === 'function') {\n cb = file\n file = null\n }\n\n if (!cb) {\n return new Promise(executor)\n }\n\n executor(null, cb)\n\n function executor(resolve, reject) {\n transformers.run(node, vfile(file), done)\n\n function done(err, tree, file) {\n tree = tree || node\n if (err) {\n reject(err)\n } else if (resolve) {\n resolve(tree)\n } else {\n cb(null, tree, file)\n }\n }\n }\n }\n\n // Run transforms on a unist node representation of a file (in string or\n // vfile representation), sync.\n function runSync(node, file) {\n var complete = false\n var result\n\n run(node, file, done)\n\n assertDone('runSync', 'run', complete)\n\n return result\n\n function done(err, tree) {\n complete = true\n bail(err)\n result = tree\n }\n }\n\n // Stringify a unist node representation of a file (in string or vfile\n // representation) into a string using the `Compiler` on the processor.\n function stringify(node, doc) {\n var file = vfile(doc)\n var Compiler\n\n freeze()\n Compiler = processor.Compiler\n assertCompiler('stringify', Compiler)\n assertNode(node)\n\n if (newable(Compiler, 'compile')) {\n return new Compiler(node, file).compile()\n }\n\n return Compiler(node, file) // eslint-disable-line new-cap\n }\n\n // Parse a file (in string or vfile representation) into a unist node using\n // the `Parser` on the processor, then run transforms on that node, and\n // compile the resulting node using the `Compiler` on the processor, and\n // store that result on the vfile.\n function process(doc, cb) {\n freeze()\n assertParser('process', processor.Parser)\n assertCompiler('process', processor.Compiler)\n\n if (!cb) {\n return new Promise(executor)\n }\n\n executor(null, cb)\n\n function executor(resolve, reject) {\n var file = vfile(doc)\n\n pipeline.run(processor, {file: file}, done)\n\n function done(err) {\n if (err) {\n reject(err)\n } else if (resolve) {\n resolve(file)\n } else {\n cb(null, file)\n }\n }\n }\n }\n\n // Process the given document (in string or vfile representation), sync.\n function processSync(doc) {\n var complete = false\n var file\n\n freeze()\n assertParser('processSync', processor.Parser)\n assertCompiler('processSync', processor.Compiler)\n file = vfile(doc)\n\n process(file, done)\n\n assertDone('processSync', 'process', complete)\n\n return file\n\n function done(err) {\n complete = true\n bail(err)\n }\n }\n}", "function unified$1() {\n var attachers = [];\n var transformers = trough();\n var namespace = {};\n var freezeIndex = -1;\n var frozen;\n\n // Data management.\n processor.data = data;\n\n // Lock.\n processor.freeze = freeze;\n\n // Plugins.\n processor.attachers = attachers;\n processor.use = use;\n\n // API.\n processor.parse = parse;\n processor.stringify = stringify;\n processor.run = run;\n processor.runSync = runSync;\n processor.process = process;\n processor.processSync = processSync;\n\n // Expose.\n return processor\n\n // Create a new processor based on the processor in the current scope.\n function processor() {\n var destination = unified$1();\n var index = -1;\n\n while (++index < attachers.length) {\n destination.use.apply(null, attachers[index]);\n }\n\n destination.data(extend$1(true, {}, namespace));\n\n return destination\n }\n\n // Freeze: used to signal a processor that has finished configuration.\n //\n // For example, take unified itself: it’s frozen.\n // Plugins should not be added to it.\n // Rather, it should be extended, by invoking it, before modifying it.\n //\n // In essence, always invoke this when exporting a processor.\n function freeze() {\n var values;\n var transformer;\n\n if (frozen) {\n return processor\n }\n\n while (++freezeIndex < attachers.length) {\n values = attachers[freezeIndex];\n\n if (values[1] === false) {\n continue\n }\n\n if (values[1] === true) {\n values[1] = undefined;\n }\n\n transformer = values[0].apply(processor, values.slice(1));\n\n if (typeof transformer === 'function') {\n transformers.use(transformer);\n }\n }\n\n frozen = true;\n freezeIndex = Infinity;\n\n return processor\n }\n\n // Data management.\n // Getter / setter for processor-specific informtion.\n function data(key, value) {\n if (typeof key === 'string') {\n // Set `key`.\n if (arguments.length === 2) {\n assertUnfrozen('data', frozen);\n namespace[key] = value;\n return processor\n }\n\n // Get `key`.\n return (own$b.call(namespace, key) && namespace[key]) || null\n }\n\n // Set space.\n if (key) {\n assertUnfrozen('data', frozen);\n namespace = key;\n return processor\n }\n\n // Get space.\n return namespace\n }\n\n // Plugin management.\n //\n // Pass it:\n // * an attacher and options,\n // * a preset,\n // * a list of presets, attachers, and arguments (list of attachers and\n // options).\n function use(value) {\n var settings;\n\n assertUnfrozen('use', frozen);\n\n if (value === null || value === undefined) ; else if (typeof value === 'function') {\n addPlugin.apply(null, arguments);\n } else if (typeof value === 'object') {\n if ('length' in value) {\n addList(value);\n } else {\n addPreset(value);\n }\n } else {\n throw new Error('Expected usable value, not `' + value + '`')\n }\n\n if (settings) {\n namespace.settings = extend$1(namespace.settings || {}, settings);\n }\n\n return processor\n\n function addPreset(result) {\n addList(result.plugins);\n\n if (result.settings) {\n settings = extend$1(settings || {}, result.settings);\n }\n }\n\n function add(value) {\n if (typeof value === 'function') {\n addPlugin(value);\n } else if (typeof value === 'object') {\n if ('length' in value) {\n addPlugin.apply(null, value);\n } else {\n addPreset(value);\n }\n } else {\n throw new Error('Expected usable value, not `' + value + '`')\n }\n }\n\n function addList(plugins) {\n var index = -1;\n\n if (plugins === null || plugins === undefined) ; else if (typeof plugins === 'object' && 'length' in plugins) {\n while (++index < plugins.length) {\n add(plugins[index]);\n }\n } else {\n throw new Error('Expected a list of plugins, not `' + plugins + '`')\n }\n }\n\n function addPlugin(plugin, value) {\n var entry = find(plugin);\n\n if (entry) {\n if (plain(entry[1]) && plain(value)) {\n value = extend$1(true, entry[1], value);\n }\n\n entry[1] = value;\n } else {\n attachers.push(slice$1.call(arguments));\n }\n }\n }\n\n function find(plugin) {\n var index = -1;\n\n while (++index < attachers.length) {\n if (attachers[index][0] === plugin) {\n return attachers[index]\n }\n }\n }\n\n // Parse a file (in string or vfile representation) into a unist node using\n // the `Parser` on the processor.\n function parse(doc) {\n var file = vfile(doc);\n var Parser;\n\n freeze();\n Parser = processor.Parser;\n assertParser('parse', Parser);\n\n if (newable(Parser, 'parse')) {\n return new Parser(String(file), file).parse()\n }\n\n return Parser(String(file), file) // eslint-disable-line new-cap\n }\n\n // Run transforms on a unist node representation of a file (in string or\n // vfile representation), async.\n function run(node, file, cb) {\n assertNode(node);\n freeze();\n\n if (!cb && typeof file === 'function') {\n cb = file;\n file = null;\n }\n\n if (!cb) {\n return new Promise(executor)\n }\n\n executor(null, cb);\n\n function executor(resolve, reject) {\n transformers.run(node, vfile(file), done);\n\n function done(error, tree, file) {\n tree = tree || node;\n if (error) {\n reject(error);\n } else if (resolve) {\n resolve(tree);\n } else {\n cb(null, tree, file);\n }\n }\n }\n }\n\n // Run transforms on a unist node representation of a file (in string or\n // vfile representation), sync.\n function runSync(node, file) {\n var result;\n var complete;\n\n run(node, file, done);\n\n assertDone('runSync', 'run', complete);\n\n return result\n\n function done(error, tree) {\n complete = true;\n result = tree;\n bail(error);\n }\n }\n\n // Stringify a unist node representation of a file (in string or vfile\n // representation) into a string using the `Compiler` on the processor.\n function stringify(node, doc) {\n var file = vfile(doc);\n var Compiler;\n\n freeze();\n Compiler = processor.Compiler;\n assertCompiler('stringify', Compiler);\n assertNode(node);\n\n if (newable(Compiler, 'compile')) {\n return new Compiler(node, file).compile()\n }\n\n return Compiler(node, file) // eslint-disable-line new-cap\n }\n\n // Parse a file (in string or vfile representation) into a unist node using\n // the `Parser` on the processor, then run transforms on that node, and\n // compile the resulting node using the `Compiler` on the processor, and\n // store that result on the vfile.\n function process(doc, cb) {\n freeze();\n assertParser('process', processor.Parser);\n assertCompiler('process', processor.Compiler);\n\n if (!cb) {\n return new Promise(executor)\n }\n\n executor(null, cb);\n\n function executor(resolve, reject) {\n var file = vfile(doc);\n\n pipeline.run(processor, {file: file}, done);\n\n function done(error) {\n if (error) {\n reject(error);\n } else if (resolve) {\n resolve(file);\n } else {\n cb(null, file);\n }\n }\n }\n }\n\n // Process the given document (in string or vfile representation), sync.\n function processSync(doc) {\n var file;\n var complete;\n\n freeze();\n assertParser('processSync', processor.Parser);\n assertCompiler('processSync', processor.Compiler);\n file = vfile(doc);\n\n process(file, done);\n\n assertDone('processSync', 'process', complete);\n\n return file\n\n function done(error) {\n complete = true;\n bail(error);\n }\n }\n}", "function unified() {\n var attachers = [];\n var transformers = trough();\n var namespace = {};\n var frozen = false;\n var freezeIndex = -1;\n\n /* Data management. */\n processor.data = data;\n\n /* Lock. */\n processor.freeze = freeze;\n\n /* Plug-ins. */\n processor.attachers = attachers;\n processor.use = use;\n\n /* API. */\n processor.parse = parse;\n processor.stringify = stringify;\n processor.run = run;\n processor.runSync = runSync;\n processor.process = process;\n processor.processSync = processSync;\n\n /* Expose. */\n return processor;\n\n /* Create a new processor based on the processor\n * in the current scope. */\n function processor() {\n var destination = unified();\n var length = attachers.length;\n var index = -1;\n\n while (++index < length) {\n destination.use.apply(null, attachers[index]);\n }\n\n destination.data(extend(true, {}, namespace));\n\n return destination;\n }\n\n /* Freeze: used to signal a processor that has finished\n * configuration.\n *\n * For example, take unified itself. It’s frozen.\n * Plug-ins should not be added to it. Rather, it should\n * be extended, by invoking it, before modifying it.\n *\n * In essence, always invoke this when exporting a\n * processor. */\n function freeze() {\n var values;\n var plugin;\n var options;\n var transformer;\n\n if (frozen) {\n return processor;\n }\n\n while (++freezeIndex < attachers.length) {\n values = attachers[freezeIndex];\n plugin = values[0];\n options = values[1];\n transformer = null;\n\n if (options === false) {\n continue;\n }\n\n if (options === true) {\n values[1] = undefined;\n }\n\n transformer = plugin.apply(processor, values.slice(1));\n\n if (func(transformer)) {\n transformers.use(transformer);\n }\n }\n\n frozen = true;\n freezeIndex = Infinity;\n\n return processor;\n }\n\n /* Data management.\n * Getter / setter for processor-specific informtion. */\n function data(key, value) {\n if (string(key)) {\n /* Set `key`. */\n if (arguments.length === 2) {\n assertUnfrozen('data', frozen);\n\n namespace[key] = value;\n\n return processor;\n }\n\n /* Get `key`. */\n return (own.call(namespace, key) && namespace[key]) || null;\n }\n\n /* Set space. */\n if (key) {\n assertUnfrozen('data', frozen);\n namespace = key;\n return processor;\n }\n\n /* Get space. */\n return namespace;\n }\n\n /* Plug-in management.\n *\n * Pass it:\n * * an attacher and options,\n * * a preset,\n * * a list of presets, attachers, and arguments (list\n * of attachers and options). */\n function use(value) {\n var settings;\n\n assertUnfrozen('use', frozen);\n\n if (value === null || value === undefined) {\n /* Empty */\n } else if (func(value)) {\n addPlugin.apply(null, arguments);\n } else if (typeof value === 'object') {\n if ('length' in value) {\n addList(value);\n } else {\n addPreset(value);\n }\n } else {\n throw new Error('Expected usable value, not `' + value + '`');\n }\n\n if (settings) {\n namespace.settings = extend(namespace.settings || {}, settings);\n }\n\n return processor;\n\n function addPreset(result) {\n addList(result.plugins);\n\n if (result.settings) {\n settings = extend(settings || {}, result.settings);\n }\n }\n\n function add(value) {\n if (func(value)) {\n addPlugin(value);\n } else if (typeof value === 'object') {\n if ('length' in value) {\n addPlugin.apply(null, value);\n } else {\n addPreset(value);\n }\n } else {\n throw new Error('Expected usable value, not `' + value + '`');\n }\n }\n\n function addList(plugins) {\n var length;\n var index;\n\n if (plugins === null || plugins === undefined) {\n /* Empty */\n } else if (typeof plugins === 'object' && 'length' in plugins) {\n length = plugins.length;\n index = -1;\n\n while (++index < length) {\n add(plugins[index]);\n }\n } else {\n throw new Error('Expected a list of plugins, not `' + plugins + '`');\n }\n }\n\n function addPlugin(plugin, value) {\n var entry = find(plugin);\n\n if (entry) {\n if (plain(entry[1]) && plain(value)) {\n value = extend(entry[1], value);\n }\n\n entry[1] = value;\n } else {\n attachers.push(slice.call(arguments));\n }\n }\n }\n\n function find(plugin) {\n var length = attachers.length;\n var index = -1;\n var entry;\n\n while (++index < length) {\n entry = attachers[index];\n\n if (entry[0] === plugin) {\n return entry;\n }\n }\n }\n\n /* Parse a file (in string or VFile representation)\n * into a Unist node using the `Parser` on the\n * processor. */\n function parse(doc) {\n var file = vfile(doc);\n var Parser;\n\n freeze();\n Parser = processor.Parser;\n assertParser('parse', Parser);\n\n if (newable(Parser)) {\n return new Parser(String(file), file).parse();\n }\n\n return Parser(String(file), file); // eslint-disable-line new-cap\n }\n\n /* Run transforms on a Unist node representation of a file\n * (in string or VFile representation), async. */\n function run(node, file, cb) {\n assertNode(node);\n freeze();\n\n if (!cb && func(file)) {\n cb = file;\n file = null;\n }\n\n if (!cb) {\n return new Promise(executor);\n }\n\n executor(null, cb);\n\n function executor(resolve, reject) {\n transformers.run(node, vfile(file), done);\n\n function done(err, tree, file) {\n tree = tree || node;\n if (err) {\n reject(err);\n } else if (resolve) {\n resolve(tree);\n } else {\n cb(null, tree, file);\n }\n }\n }\n }\n\n /* Run transforms on a Unist node representation of a file\n * (in string or VFile representation), sync. */\n function runSync(node, file) {\n var complete = false;\n var result;\n\n run(node, file, done);\n\n assertDone('runSync', 'run', complete);\n\n return result;\n\n function done(err, tree) {\n complete = true;\n bail(err);\n result = tree;\n }\n }\n\n /* Stringify a Unist node representation of a file\n * (in string or VFile representation) into a string\n * using the `Compiler` on the processor. */\n function stringify(node, doc) {\n var file = vfile(doc);\n var Compiler;\n\n freeze();\n Compiler = processor.Compiler;\n assertCompiler('stringify', Compiler);\n assertNode(node);\n\n if (newable(Compiler)) {\n return new Compiler(node, file).compile();\n }\n\n return Compiler(node, file); // eslint-disable-line new-cap\n }\n\n /* Parse a file (in string or VFile representation)\n * into a Unist node using the `Parser` on the processor,\n * then run transforms on that node, and compile the\n * resulting node using the `Compiler` on the processor,\n * and store that result on the VFile. */\n function process(doc, cb) {\n freeze();\n assertParser('process', processor.Parser);\n assertCompiler('process', processor.Compiler);\n\n if (!cb) {\n return new Promise(executor);\n }\n\n executor(null, cb);\n\n function executor(resolve, reject) {\n var file = vfile(doc);\n\n pipeline.run(processor, {file: file}, done);\n\n function done(err) {\n if (err) {\n reject(err);\n } else if (resolve) {\n resolve(file);\n } else {\n cb(null, file);\n }\n }\n }\n }\n\n /* Process the given document (in string or VFile\n * representation), sync. */\n function processSync(doc) {\n var complete = false;\n var file;\n\n freeze();\n assertParser('processSync', processor.Parser);\n assertCompiler('processSync', processor.Compiler);\n file = vfile(doc);\n\n process(file, done);\n\n assertDone('processSync', 'process', complete);\n\n return file;\n\n function done(err) {\n complete = true;\n bail(err);\n }\n }\n}", "createProducer (structureType, tile) {\n var sType = this.checkStructureType(structureType)\n\n var producer = sType.type === 'refinery'\n ? this.createRefiner(sType.buysFrom, sType.multiplier, sType.reach, tile)\n : this.createPrimaryProducer(sType, tile)\n\n return new AllDecorator({producer: producer, tile: tile})\n }", "register(processType) { this.register_(processType) }", "onCreatedPreProcessor(preprocessor) {}", "__init3() {this._numProcessing = 0;}", "__init3() {this._numProcessing = 0;}", "__init3() {this._numProcessing = 0;}", "createFirstPage(architect) {\n let pageEllipsis = this.createPageEllipsis(architect);\n this.createPageNumber(architect, {\n condition: this.getShowNumbers && this.addFirstPage,\n current: this.isFirstPage\n });\n architect.addChild(\n pageEllipsis,\n this.getShowNumbers && this.addFirstPage\n );\n }", "function CreateStreamProcessorCommand(input) {\n var _this = \n // Start section: command_constructor\n _super.call(this) || this;\n _this.input = input;\n return _this;\n // End section: command_constructor\n }", "function Proc() {}", "peek() {\n // console.log(\"This is the peek\", this.processes[0]);\n if (this.processes[0] !== undefined) {\n\n return this.processes[0];\n };\n\n return this.processes[0];\n }", "function startProcessingHandler(noTimer) {\n\tlet processor = child.spawn(\"node\", [\"processor.js\"], {});\n\tprocessor.stdout.on('data', (data) => {\n\t\tconsole.log(`Processor: ${data}`);\n\t});\n\n\tprocessor.stderr.on('data', (data) => {\n\t\tconsole.error(`Processor: ${data}`);\n\t});\n\n\tprocessor.on('close', (code) => {\n\t\tconsole.log(`Processor exited: ${code}`);\n\t\tif (code === 255 || code === -1) {\n\t\t\t// Start Processing again in 5 minutes.\n\t\t\tconsole.log(\"Processor Exited with failed to download, restarting download in 5 minutes.\")\n\t\t\tsetTimeout(() => {startProcessingHandler(true); }, 5*60*1000);\n\t\t}\n\t});\n\n\tif (noTimer === true) {\n\t\treturn;\n\t}\n\t// Figure out the next timestamp to run the next processing run\n\tlet tomorrow = new Date();\n\ttomorrow.setMinutes(60);\n\ttomorrow.setSeconds(0);\n\tif (tomorrow.getHours() > 3) {\n\t\t// Next Day\n\t\ttomorrow.setHours(24);\n\t\ttomorrow.setHours(3);\n\t} else {\n\t\t// Today\n\t\ttomorrow.setHours(3);\n\t}\n\tlet nextTimeStamp = (tomorrow.getTime()-Date.now());\n\tconsole.log(\"Setting next Processing Run for\", nextTimeStamp/1000);\n\n\tsetTimeout(startProcessingHandler, nextTimeStamp);\n}", "function Process(){}", "function ProcessController() {}", "function StartStreamProcessorCommand(input) {\n var _this = \n // Start section: command_constructor\n _super.call(this) || this;\n _this.input = input;\n return _this;\n // End section: command_constructor\n }", "parse(parser) {\n this._processor = this._process(parser);\n this._processor.next();\n }", "function Processor(proc, host){\n var processes = proc || [], locked = 0, i = 0,\n\n /* Functional methods to manipulate DataBus processing workflow */\n fns = {\n /* Continue processing with @data */\n $continue: function(data){\n return self.tick(data);\n },\n /* Break processing */\n $break: function(){\n return self.tick({}, 1);\n },\n /* Locks DataBus evaluation */\n $lock: function(){\n return locked = 1;\n },\n /* Unlocks DataBus evaluation */\n $unlock: function(){\n return locked = 0;\n },\n $update: function(){\n host.update();\n },\n /* Returns current DataBus */\n $host: function(){\n return host;\n }\n };\n \n var self = {\n /* Add process if @p exists or return all processes of this Processor */\n process : function(p){\n return Utils.is.exist(p) ? processes.push(p) : processes;\n },\n\n /* Start processing */\n start : function(event, context, fin){\n self.ctx = context;\n self.fin = fin; \n \n i = locked ? 0 : i;\n \n if(i==processes.length){\n i = 0;\n return fin(event);\n }\n\n this.tick(event);\n },\n\n /* Ticking processor to the next process */\n tick : function(event, breaked){ \n if(breaked){\n return i = 0;\n }\n \n if(i==processes.length){\n i = 0;\n return self.fin(event);\n }\n\n i++; \n processes[i-1].apply(self.ctx, [event, fns]);\n \n }\n }\n return self;\n }", "compute (name /*, ...processors */) {\n let processors = toArray(arguments, 1)\n\n return pipeline(this.lookup(name)(), processors, this.state)\n }", "function\trunProcessing() {\n initProcessing();\n}", "static defaultStart (component) {\n store.commit('START_PROCESS', 'vk')\n component.loading = true\n component.result = []\n }", "firstRun() { }", "function startProcessInstances() {\n getProcessDefinitionsAndThen(startProcessInstancesFromDefinitions);\n}", "function ProcessPackageOne(){\r this.name = \"ProcessPackageOne\";\r this.xpath = \"//device[@type = 'VCO']/package[1]\";\t\r this.apply = function(myElement, myRuleProcessor){\r with(myElement){\r __skipChildren(myRuleProcessor);\r var myNewElement = myContainerElement.xmlElements.item(-1).xmlElements.add(app.documents.item(0).xmlTags.item(\"Column\"));\r myElement.move(LocationOptions.atBeginning, myContainerElement.xmlElements.item(-1).xmlElements.item(-1));\r }\r return true;\r }\t\t\r}", "process() {}", "process() {}", "produce() {}", "function processorIDRegister() // ./common/cpu.js:290\n{ // ./common/cpu.js:291\n\t// all fields are read only by software // ./common/cpu.js:292\n\tthis.R = 0; // bits 31:24 // ./common/cpu.js:293\n\tthis.companyID = 1; // bits 23:16 // ./common/cpu.js:294\n\tthis.processorID = 128; // bits 15:8, (128 for 4kc) // ./common/cpu.js:295\n\tthis.revision = 11; // bits 7:0, latest version according to manual // ./common/cpu.js:296\n // ./common/cpu.js:297\n\tthis.asUInt32 = function() // ./common/cpu.js:298\n\t{ // ./common/cpu.js:299\n\t\treturn ((this.R << 24) + (this.companyID << 16) + (this.processorID << 8) + this.revision); // ./common/cpu.js:300\n\t} // ./common/cpu.js:301\n // ./common/cpu.js:302\n\tthis.putUInt32 = function(value) // ./common/cpu.js:303\n\t{ // ./common/cpu.js:304\n\t\treturn; // ./common/cpu.js:305\n\t} // ./common/cpu.js:306\n} // ./common/cpu.js:307", "function start_pipeline(){\n var commands = [\n ['xsltproc', [meta_xslt, '-'] ],\n ['xsltproc', ['-', tmpfile] ]\n ];\n logger.log(tmpfile);\n var transform = create_pipeline( commands, response );\n transform.on( 'finish', clean_tmp_file);\n\n request.pipe( transform );\n }", "async start() {\n\t\tawait this.#preprocessor.execQueue();\n\t\tawait this.#pageGen.generatePages();\n\n\t\tthis.#emitter.emit('end');\n\t}", "function startProcessor(i, renderedRowsToProcess) {\n // Get the processor at 'i'\n var processor = self.rowsProcessors[i].processor;\n\n // Call the processor, passing in the rows to process and the current columns\n // (note: it's wrapped in $q.when() in case the processor does not return a promise)\n return $q.when( processor.call(self, renderedRowsToProcess, self.columns) )\n .then(function handleProcessedRows(processedRows) {\n // Check for errors\n if (!processedRows) {\n throw \"Processor at index \" + i + \" did not return a set of renderable rows\";\n }\n\n if (!angular.isArray(processedRows)) {\n throw \"Processor at index \" + i + \" did not return an array\";\n }\n\n // Processor is done, increment the counter\n i++;\n\n // If we're not done with the processors, call the next one\n if (i <= self.rowsProcessors.length - 1) {\n return startProcessor(i, processedRows);\n }\n // We're done! Resolve the 'finished' promise\n else {\n finished.resolve(processedRows);\n }\n });\n }", "function CommandProcessor(controller) {\n this.controller = controller;\n}", "processInit() {\n // if worker not use require it may not have setExecuteFn\n if (this.service.setExecuteFn) {\n this.service.setExecuteFn(this.proxyUpcomingExecute)\n }\n // HACK simplify states\n this.state = WORKERS_STATES.ready\n return this\n }", "createProcesses() {\n Object.keys(this.workers).forEach(type => {\n const env = {\n 'type': type,\n 'verbose': config.verbose,\n };\n this.workers[type] = this.fork(type, env);\n });\n }", "init() {\n //Maintain a Hash Map of all the running processes\n this.processMap = {}\n\n Utilities.initializeLineReader(\n (line) => {\n this.toggleProcess(line)\n },() => {\n const processes = Object.keys(this.processMap)\n if(processes.length === 0) {\n console.log('0')\n return\n }\n processes.map((pid) => {\n console.log(pid)\n })\n }\n )\n }", "initCore() {\n this.memory = new Memory(this);\n this.cpu = new CPU(this);\n this.apu = new APU(this);\n this.ppu = new PPU(this);\n\n this.loadCartridge(this.cartridge);\n }", "function startProcessor(i, renderedColumnsToProcess) {\n // Get the processor at 'i'\n var processor = self.columnsProcessors[i].processor;\n\n // Call the processor, passing in the rows to process and the current columns\n // (note: it's wrapped in $q.when() in case the processor does not return a promise)\n return $q.when( processor.call(self, renderedColumnsToProcess, self.rows) )\n .then(function handleProcessedRows(processedColumns) {\n // Check for errors\n if (!processedColumns) {\n throw \"Processor at index \" + i + \" did not return a set of renderable rows\";\n }\n\n if (!angular.isArray(processedColumns)) {\n throw \"Processor at index \" + i + \" did not return an array\";\n }\n\n // Processor is done, increment the counter\n i++;\n\n // If we're not done with the processors, call the next one\n if (i <= self.columnsProcessors.length - 1) {\n return startProcessor(i, myRenderableColumns);\n }\n // We're done! Resolve the 'finished' promise\n else {\n finished.resolve(myRenderableColumns);\n }\n });\n }", "makeStart() {\n this.type = Node.START;\n this.state = null;\n }", "start(){\n let _this = this;\n // run the main sequence every process_frequency seconds\n _this.logger.info('starting work');\n _this.execute = true;\n _this.run();\n }", "on_assign_processor() {\n }", "_preload() {\n const preloader = new Preloader();\n preloader.run().then(() => {\n this._start();\n });\n }", "init(kernel) {\n logger.log(this.name, \"init\");\n let test = new testProc(\"test\");\n kernel.startProcess(test);\n }", "function constructPipeline() {\n // console.log($rootScope.CSVdelim);\n // var separator = $rootScope.CSVdelim?$rootScope.CSVdelim:'\\\\,';\n var readDatasetFunct = new jsedn.List([\n new jsedn.sym('read-dataset'),\n new jsedn.sym('data-file')\n ]);\n\n pipeline = null;\n\n pipeline = new jsedn.List([\n jsedn.sym('defpipe'),\n jsedn.sym('my-pipe'),\n 'Grafter pipeline for data clean-up and preparation.',\n new jsedn.Vector([new jsedn.sym('data-file')]),\n new jsedn.List([jsedn.sym('->'), readDatasetFunct])\n ]);\n\n pipelineFunctions.map(function (arg) {\n pipeline.val[4].val.push(arg);\n });\n\n //(read-dataset data-file :format :csv)\n pipelineFunctions = new jsedn.List([]);\n return pipeline;\n}", "function setupScriptProcessor() {\n recorderNode = createRecorderScriptProcessor();\n recorderNode.port.postMessage({ sampleRate, });\n recorderNode.port.onmessage = (data) => {\n switch (data) {\n\n case 'startCapturing':\n dispatch(getActions().recordStart());\n break;\n\n default:\n captureAudio({data});\n }\n };\n source.connect(recorderNode);\n recorderNode.connect(getAudioContext().destination);\n}", "function startProcessor(i, renderedRowsToProcess) {\n // Get the processor at 'i'\n var processor = self.rowsProcessors[i];\n\n // Call the processor, passing in the rows to process and the current columns\n // (note: it's wrapped in $q.when() in case the processor does not return a promise)\n return $q.when( processor.call(self, renderedRowsToProcess, self.columns) )\n .then(function handleProcessedRows(processedRows) {\n // Check for errors\n if (!processedRows) {\n throw \"Processor at index \" + i + \" did not return a set of renderable rows\";\n }\n\n if (!angular.isArray(processedRows)) {\n throw \"Processor at index \" + i + \" did not return an array\";\n }\n\n // Processor is done, increment the counter\n i++;\n\n // If we're not done with the processors, call the next one\n if (i <= self.rowsProcessors.length - 1) {\n return startProcessor(i, processedRows);\n }\n // We're done! Resolve the 'finished' promise\n else {\n finished.resolve(processedRows);\n }\n });\n }", "function makeSwiper() {\n _this.calcSlides();\n if (params.loader.slides.length > 0 && _this.slides.length === 0) {\n _this.loadSlides();\n }\n if (params.loop) {\n _this.createLoop();\n }\n _this.init();\n initEvents();\n if (params.pagination) {\n _this.createPagination(true);\n }\n\n if (params.loop || params.initialSlide > 0) {\n _this.swipeTo(params.initialSlide, 0, false);\n }\n else {\n _this.updateActiveSlide(0);\n }\n if (params.autoplay) {\n _this.startAutoplay();\n }\n /**\n * Set center slide index.\n *\n * @author Tomaz Lovrec <tomaz.lovrec@gmail.com>\n */\n _this.centerIndex = _this.activeIndex;\n\n // Callbacks\n if (params.onSwiperCreated) _this.fireCallback(params.onSwiperCreated, _this);\n _this.callPlugins('onSwiperCreated');\n }", "initialize() {\n this._forkProcess();\n }", "function makeComputer(maker, Processor, Ram, HardDisc) {\n return {\n\t\tmaker : maker,\n\t\tProcessor : Processor,\n\t\tRam : Ram,\n\t\tHardDisc : HardDisc\n\t};\n}", "function makeSwiper() {\n _this.calcSlides();\n if (params.loader.slides.length > 0 && _this.slides.length === 0) {\n _this.loadSlides();\n }\n if (params.loop) {\n _this.createLoop();\n }\n _this.init();\n initEvents();\n if (params.pagination) {\n _this.createPagination(true);\n }\n\n if (params.loop || params.initialSlide > 0) {\n _this.swipeTo(params.initialSlide, 0, false);\n }\n else {\n _this.updateActiveSlide(0);\n }\n if (params.autoplay) {\n _this.startAutoplay();\n }\n /**\n * Set center slide index.\n *\n * @author Tomaz Lovrec <tomaz.lovrec@gmail.com>\n */\n _this.centerIndex = _this.activeIndex;\n\n // Callbacks\n if (params.onSwiperCreated) _this.fireCallback(params.onSwiperCreated, _this);\n _this.callPlugins('onSwiperCreated');\n }", "function startProcessor(i, renderedColumnsToProcess) {\n // Get the processor at 'i'\n var processor = self.columnsProcessors[i];\n\n // Call the processor, passing in the rows to process and the current columns\n // (note: it's wrapped in $q.when() in case the processor does not return a promise)\n return $q.when( processor.call(self, renderedColumnsToProcess, self.rows) )\n .then(function handleProcessedRows(processedColumns) {\n // Check for errors\n if (!processedColumns) {\n throw \"Processor at index \" + i + \" did not return a set of renderable rows\";\n }\n\n if (!angular.isArray(processedColumns)) {\n throw \"Processor at index \" + i + \" did not return an array\";\n }\n\n // Processor is done, increment the counter\n i++;\n\n // If we're not done with the processors, call the next one\n if (i <= self.columnsProcessors.length - 1) {\n return startProcessor(i, myRenderableColumns);\n }\n // We're done! Resolve the 'finished' promise\n else {\n finished.resolve(myRenderableColumns);\n }\n });\n }", "function build_processor_config(el){\n\n var select \t\t\t= $(el),\n templ\t\t\t= $('#' + select.val() + '-tmpl').length ? $('#' + select.val() + '-tmpl').html() : '',\n parent\t\t\t= select.closest('.caldera-editor-processor-config-wrapper'),\n target\t\t\t= parent.find('.caldera-config-processor-setup'),\n template \t\t= Handlebars.compile(templ),\n config\t\t\t= parent.find('.processor_config_string').val(),\n current_type\t= select.data('type');\n\n // Be sure to load the processors preset when switching back to the initial processor type.\n if(config.length && current_type === select.val() ){\n config = JSON.parse(config);\n }else{\n // default config\n config = processor_defaults[select.val() + '_cfg'];\n }\n\n // build template\n if(!config){\n config = {};\n }\n\n config._id = parent.prop('id');\n config._name = 'config[processors][' + parent.prop('id') + '][config]';\n\n\n\n\n template = $('<div>').html( template( config ) );\n\n // send to target\n target.html( template.html() );\n\n // check for init function\n if( typeof window[select.val() + '_init'] === 'function' ){\n window[select.val() + '_init'](parent.prop('id'), target);\n }\n\n // check if conditions are allowed\n if(parent.find('.no-conditions').length){\n // conditions are not supported - remove them\n parent.find('.toggle_option_tab').remove();\n }\n\n\n rebuild_field_binding();\n baldrickTriggers();\n\n // initialise baldrick triggers\n $('.wp-baldrick').baldrick({\n request : cfAdminAJAX,\n method : 'POST',\n before\t\t: function(el){\n\n var tr = $(el);\n\n if( tr.data('addNode') && !tr.data('request') ){\n tr.data('request', 'cf_get_default_setting');\n }\n }\n });\n\n }", "function processor() {\n var resource = resourceArray.pop();\n // console.log(\"Assessing demand \", resource);\n\n if(typeof(resource) === 'undefined') {\n console.log('All demands met');\n next();\n } else {\n var predicate = authorisationTypes[resource];\n\n if(!predicate) {\n throw \"Undefined resource demand: \"+resource;\n }\n\n predicate(req, res, processor);\n }\n }", "start() {\n const { creator, conf } = this;\n const upStreaming = conf.getVal('upStreaming');\n\n if (upStreaming) {\n this.liveOutput();\n } else if (ScenesUtil.isSingle(creator)) {\n this.mvOutput();\n } else {\n if (ScenesUtil.hasTransition(creator)) {\n ScenesUtil.fillTransition(creator);\n this.addXfadeInput();\n } else {\n this.addConcatInput();\n }\n\n this.addAudio();\n this.addOutputOptions();\n this.addCommandEvents();\n this.addOutput();\n this.command.run();\n }\n }", "function init(templateProcessors, templates, defaultOpts, helpers, basePath) {\n function processTemplate(templateName, templateVariables, opts) {\n if (templates.has(templateName)) {\n const templateObject = templates.get(templateName);\n for (const [processorName, processor] of templateProcessors.entries()) {\n const extIndex = processor.extensions.indexOf(templateObject.ext);\n if (extIndex !== -1) {\n const mergedOptions = Object.assign(\n { filenameWithPath: `${basePath}/${defaultOpts.common.path}/${templateName}${templateObject.ext}` },\n defaultOpts.common,\n defaultOpts[processorName],\n opts\n );\n return processor.process(templateName, templateObject.template, mergedOptions, templateVariables, helpers);\n }\n }\n throw new Error(`No template processor found for extension: ${templateObject.ext}.`);\n } else {\n throw Error(`Template: \"${templateName}\" does not exist`);\n }\n }\n\n // Offer direct access to individual processors\n for (const [name, fn] of templateProcessors.entries()) {\n processTemplate[name] = fn.process;\n }\n\n return processTemplate;\n}", "start () {\n return testPF(this.m, this.p0, this.q, this.r)\n }", "function InlineWorkerFactory(){\n\t}", "async generateOne() {\n return await this.dagObj.generateOne();\n }", "function createNextTask() {\n if (taskId >= ctx.instance.renderers.length) {\n done();\n return;\n }\n\n var task = {\n consumerId: ctx.instance.consumerId,\n batchId: ctx.instance.batchId,\n renderer: ctx.instance.renderers[taskId],\n message: ctx.instance.message\n };\n taskId++;\n\n PreviewTask.create(task, function(err, obj) {\n if (err) {\n console.log('Failed to create new task', task, err);\n // Is there a better way to report this failure?\n done();\n }\n else {\n createNextTask();\n }\n });\n }", "function Waiter(processor) {\n let completed = 0;\n let size = 0;\n\n this.execute = function(input) {\n return new Promise((resolve) => {\n size = input.length;\n\n if (size === 0) {\n resolve()\n return;\n }\n\n for (let x = 0; x < size; x++) {\n processor(input[x], completion);\n }\n\n function completion() {\n completed += 1;\n\n if (completed === size) {\n resolve()\n }\n }\n });\n };\n}", "function startQueueProcessor() {\n\n if ( typeof( processInfo ) === 'undefined' ) processInfo = 'Process ' + processFromStatus + ' to ' + processToStatus\n if ( typeof( pollInterval ) === 'undefined' ) pollInterval = 2000\n\n log.i( '' );\n log.i( '----- DLINK JDE PDF Queue Processor Started - ' + processInfo ); \n log.i( '' ); \n log.i( 'JDE Environment : ' + jdeEnv );\n log.i( 'JDE Database : ' + jdeEnvDb );\n log.i( '' ); \n log.i( 'Polling Interval : ' + pollInterval);\n log.i( '' ); \n log.i( 'Pick up Queued PDF files at status ' + processFromStatus + ' - process then - move to status ' + processToStatus ); \n log.i( '' );\n\n // Handle process exit from DOCKER STOP, system interrupts, uncaughtexceptions or CTRL-C \n ondeath( endMonitorProcess );\n\n // First need to establish an oracle DB connection pool to work with\n establishPool();\n\n}", "static register(type) {\n if(OS.kernel) OS.kernel.register(type);\n else processTypes.push(type);\n }", "createContinuousProducer (turnipYield) {\n return new ContinuousProducer({\n turnipYield: turnipYield\n })\n }", "process (filepath) {\n\t\tlet {\n\t\t\tchassis,\n\t\t\tgenerateNamespacedSelector,\n\t\t\tisNamespaced,\n\t\t\tnamespaceSelectors,\n\t\t\tprocessImports,\n\t\t\tprocessNesting,\n\t\t\tprocessAtRules,\n\t\t\tprocessMixins,\n\t\t\tprocessNot,\n\t\t\tprocessFunctions,\n\t\t\tstoreAtRules,\n\t\t\ttypographyEngineIsInitialized\n\t\t} = this\n\n\t\tlet {\n\t\t\tatRules,\n\t\t\tpost,\n\t\t\tsettings,\n\t\t\tutils\n\t\t} = chassis\n\n\t\tlet tasks = new NGN.Tasks()\n\t\tlet sourceMap\n\n\t\ttasks.add('Processing Imports', next => {\n\t\t\tif (typographyEngineIsInitialized) {\n\t\t\t\tthis.tree.walkAtRules('import', atRule => {\n\t\t\t\t\tchassis.imports.push(atRule.params)\n\t\t\t\t\tatRule.remove()\n\t\t\t\t})\n\t\t\t}\n\n\t\t\tprocessImports()\n\t\t\tprocessNesting()\n\t\t\tnext()\n\t\t})\n\n\t\ttasks.add('Processing Mixins', next => {\n\t\t\tprocessMixins()\n\t\t\tprocessNot()\n\t\t\tprocessNesting()\n\n\t\t\tnext()\n\t\t})\n\n\t\ttasks.add('Processing Functions', next => {\n\t\t\tprocessFunctions()\n\t\t\tnext()\n\t\t})\n\n\t\ttasks.add('Namespacing Selectors', next => {\n\t\t\tnamespaceSelectors()\n\t\t\tnext()\n\t\t})\n\n\t\tif (typographyEngineIsInitialized) {\n\t\t\ttasks.add('Initializing Typography Engine', next => {\n\t\t\t\tthis.tree = this.core.css.append(this.tree)\n\t\t\t\tnext()\n\t\t\t})\n\t\t}\n\n\t\ttasks.add('Running Post-Processing Routines', next => {\n\t\t\tthis.tree.walkAtRules('chassis-post', atRule => {\n\t\t\t\tlet data = Object.assign({\n\t\t\t\t\troot: this.tree,\n\t\t\t\t\tatRule\n\t\t\t\t}, atRules.getProperties(atRule))\n\n\t\t\t\tpost.process(data)\n\t\t\t})\n\n\t\t\tnext()\n\t\t})\n\n\t\ttasks.add('Processing CSS4 Syntax', next => {\n\t\t\tenv.process(this.tree, {from: filepath}, settings.envCfg).then(processed => {\n\t\t\t\tthis.tree = processed.root\n\t\t\t\tnext()\n\t\t\t}, err => console.error(err))\n\t\t})\n\n\t\t// tasks.add('Merging matching adjacent rules...', next => {\n\t\t// \toutput = mergeAdjacentRules.process(output.toString())\n\t\t// \tnext()\n\t\t// })\n\n\t\ttasks.add('Beautifying Output', next => {\n\t\t\tremoveComments.process(this.tree).then(result => {\n\t\t\t\tperfectionist.process(result.css).then(result => {\n\t\t\t\t\tthis.tree = result.root\n\n\t\t\t\t\t// Remove empty rulesets\n\t\t\t\t\tthis.tree.walkRules(rule => {\n\t\t\t\t\t\tif (rule.nodes.length === 0) {\n\t\t\t\t\t\t\trule.remove()\n\t\t\t\t\t\t\treturn\n\t\t\t\t\t\t}\n\t\t\t\t\t})\n\n\t\t\t\t\tnext()\n\t\t\t\t}, () => {\n\t\t\t\t\tthis.emit('processing.error', new Error('Error Beautifying Output'))\n\t\t\t\t})\n\t\t\t}, () => {\n\t\t\t\tthis.emit('processing.error', new Error('Error Removing Comments'))\n\t\t\t})\n\t\t})\n\n\t\tif (settings.minify) {\n\t\t\tlet minified\n\n\t\t\ttasks.add('Minifying Output', next => {\n\t\t\t\tminified = new CleanCss({\n\t\t\t\t\tsourceMap: settings.sourceMap\n\t\t\t\t}).minify(this.tree.toString())\n\n\t\t\t\tthis.tree = minified.styles\n\t\t\t\tnext()\n\t\t\t})\n\n\t\t\tif (settings.sourceMap) {\n\t\t\t\ttasks.add('Generating source map', next => {\n\t\t\t\t\tsourceMap = minified.sourceMap.toString()\n\t\t\t\t\tnext()\n\t\t\t\t})\n\t\t\t}\n\t\t}\n\n\t\t// tasks.on('taskstart', evt => console.log(`${evt.name}...`))\n\t\t// tasks.on('taskcomplete', evt => console.log('Done.'))\n\n\t\ttasks.on('complete', () => this.emit('processing.complete', {\n\t\t\tcss: this.tree.toString(),\n\t\t\tsourceMap\n\t\t}))\n\n\t\tthis.emit('processing')\n\t\ttasks.run(true)\n\t}", "core(name, priority, type, memory) {\n if(!isNaN(name)) throw new OSError('Core processes must be named');\n if(this.exists_(name)) return;\n this.runCore_(name, priority, type, memory, 0);\n }", "create() {\n\t}", "preload () {}", "preStart() {\n }", "configureProprocessor(name, options) {\n this.config[name] = Object.assign({}, this.config[name], options)\n return this\n }", "function construct() { }", "function startPipeline() {\n // In this way we read one block while we decode and play another.\n if (state.state == STATE.PLAYING) {\n processState();\n }\n processState();\n }", "function start() {\n\n gw_job_process.UI();\n gw_job_process.procedure();\n gw_com_module.startPage();\n\n //processRetrieve({});\n\n }", "spawnNewGameObjectAtStart(type) {\n\t\tlet xy = this.getRandomCoordinateAtStart();\n\t\tthis.spawnNewGameObject(type, xy.x, xy.y);\n\t}", "preload() {\n \n }", "function create() {\n if (gameState === \"Menu\") {\n menuGroupSetup();\n } else if (gameState === \"Playing\") {\n game.world.removeAll();\n stageGroupSetup();\n entityGroupSetup();\n guiGroupSetup();\n game.sound.setDecodedCallback([monsterLaugh, mainTheme], playIntro);\n } else if (gameState === \"GameOver\") {\n gameOverGroupSetup();\n } else if (gameState === \"Win\") {\n gameWinGroupSetup();\n }\n\n game.input.mouse.capture = true;\n cursors = game.input.keyboard.createCursorKeys();\n }", "start() {\n\t\t\tif (this._running) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tthis._scheduler = new Scheduler();\n\t\t\tthis._running = true;\n\n\t\t\tprocessBuffer.call(this);\n\t\t}", "function start ()\n{\n if (typeof (webphone_api.plhandler) === 'undefined' || webphone_api.plhandler === null)\n {\n return webphone_api.addtoqueue('Start', [parameters, true]);\n }\n else\n return webphone_api.plhandler.Start(parameters, true);\n}", "create () {}", "create () {}", "createModule(factory) {\n try {\n if (!factory) {\n new Message(faust.getErrorMessage());\n Utilitary.hideFullPageLoading();\n return;\n }\n var module = new ModuleClass(Utilitary.idX++, this.tempModuleX, this.tempModuleY, this.tempModuleName, document.getElementById(\"modules\"), (module) => { this.removeModule(module); }, this.compileFaust);\n module.moduleFaust.setSource(this.tempModuleSourceCode);\n module.createDSP(factory, () => {\n module.patchID = this.tempPatchId;\n if (this.tempParams) {\n for (var i = 0; i < this.tempParams.sliders.length; i++) {\n var slider = this.tempParams.sliders[i];\n module.addInterfaceParam(slider.path, parseFloat(slider.value));\n }\n }\n module.moduleFaust.recallInputsSource = this.arrayRecalScene[0].inputs.source;\n module.moduleFaust.recallOutputsDestination = this.arrayRecalScene[0].outputs.destination;\n this.arrayRecalledModule.push(module);\n module.recallInterfaceParams();\n module.setFaustInterfaceControles();\n module.createFaustInterface();\n module.addInputOutputNodes();\n if (factory.isMidi) {\n module.isMidi = true;\n module.addMidiControlNode();\n }\n this.addModule(module);\n //next module\n this.arrayRecalScene.shift();\n this.launchModuleCreation();\n });\n }\n catch (e) {\n console.log(e);\n new Message(Utilitary.messageRessource.errorCreateModuleRecall);\n //next module\n this.arrayRecalScene.shift();\n this.launchModuleCreation();\n }\n }", "peek() { // gives the process a reference number; only dequeues the process once it's done or have to be moved to the next priority queue \n return this.processes[0]; // 0 index references/points to the process that was recently added \n }", "create() {}", "create() {}", "get_processor_kwargs() {\n return {}\n }", "preload() {\n\n }", "function createCiteproc(citeprocJSONObject, citeprocSys, citeprocStyle){\n\t\tvar defaultCiteprocSys = {\n\t\t retrieveItem: function(id){\n\t\t return citeprocJSONObject.citationItems[id];\n\t\t },\n\t\t retrieveLocale: function(lang){\n\t\t return defaultLocale[lang];\n\t\t }\n\t\t}\n\t\tif (!citeprocSys)\n\t\t\tciteprocSys = defaultCiteprocSys;\n\t\tif (!citeprocStyle)\n\t\t\tciteprocStyle = styleChigcagoAD;\t\t\n\t\treturn new CSL.Engine( citeprocSys, citeprocStyle );\n\t}", "constructor() { \n \n ProcessDefinitionDto.initialize(this);\n }", "function createProcess(process) {\n return ProcessModel.create(process);\n}", "function ProcessDevice(){\r this.name = \"ProcessDevice\";\r this.xpath = \"//device[@type = 'VCO']\";\t\r this.apply = function(myElement, myRuleProcessor){\r var myNewElement = myContainerElement.xmlElements.add(app.documents.item(0).xmlTags.item(\"Row\"));\r return true;\r }\t\t\r}", "assign_processor(processor_id) {\n this.processor_id = processor_id\n\n this._refresh_source_icon()\n\n this.on_assign_processor()\n\n // Now that we have a processor/source, refresh\n this.viewer.refresh_widget(this)\n }", "function preload() {\n // Step 1.1 code goes here\n\n // Step 8.1 code goes here\n}" ]
[ "0.5809372", "0.5809372", "0.5809372", "0.5585237", "0.5585237", "0.5574443", "0.54788613", "0.540701", "0.5396681", "0.5302397", "0.5262711", "0.51745176", "0.51745176", "0.51745176", "0.51702476", "0.50886375", "0.50736797", "0.50652015", "0.5063161", "0.50562364", "0.5053004", "0.50193924", "0.49992272", "0.4991912", "0.49345878", "0.48930374", "0.48871502", "0.48804575", "0.48768133", "0.4841312", "0.48404524", "0.48404524", "0.48374844", "0.48129857", "0.48120093", "0.48108202", "0.4797959", "0.4790197", "0.47786373", "0.4772132", "0.47679973", "0.47478637", "0.47473618", "0.473664", "0.47054818", "0.47047096", "0.46911946", "0.46879083", "0.4656295", "0.46542573", "0.4647876", "0.46430615", "0.46194664", "0.46173894", "0.4607682", "0.4604713", "0.45852607", "0.45758894", "0.45720786", "0.45613703", "0.45373246", "0.45257148", "0.45055348", "0.4497785", "0.44945908", "0.44862467", "0.44847205", "0.44808233", "0.44685388", "0.44604516", "0.44593185", "0.44486806", "0.4442839", "0.44422725", "0.44414046", "0.4440236", "0.44258234", "0.44238454", "0.4418488", "0.44133663", "0.4410928", "0.44107828", "0.4408193", "0.4408193", "0.44060037", "0.44021085", "0.440139", "0.440139", "0.43951166", "0.43948978", "0.43923008", "0.4386242", "0.43761322", "0.43741354", "0.43732613", "0.43667823" ]
0.5477166
11
Create a new processor based on the processor in the current scope.
function processor() { var destination = unified() var length = attachers.length var index = -1 while (++index < length) { destination.use.apply(null, attachers[index]) } destination.data(extend(true, {}, namespace)) return destination }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function unified() {\n var attachers = []\n var transformers = trough()\n var namespace = {}\n var freezeIndex = -1\n var frozen\n\n // Data management.\n processor.data = data\n\n // Lock.\n processor.freeze = freeze\n\n // Plugins.\n processor.attachers = attachers\n processor.use = use\n\n // API.\n processor.parse = parse\n processor.stringify = stringify\n processor.run = run\n processor.runSync = runSync\n processor.process = process\n processor.processSync = processSync\n\n // Expose.\n return processor\n\n // Create a new processor based on the processor in the current scope.\n function processor() {\n var destination = unified()\n var index = -1\n\n while (++index < attachers.length) {\n destination.use.apply(null, attachers[index])\n }\n\n destination.data(extend(true, {}, namespace))\n\n return destination\n }\n\n // Freeze: used to signal a processor that has finished configuration.\n //\n // For example, take unified itself: it’s frozen.\n // Plugins should not be added to it.\n // Rather, it should be extended, by invoking it, before modifying it.\n //\n // In essence, always invoke this when exporting a processor.\n function freeze() {\n var values\n var transformer\n\n if (frozen) {\n return processor\n }\n\n while (++freezeIndex < attachers.length) {\n values = attachers[freezeIndex]\n\n if (values[1] === false) {\n continue\n }\n\n if (values[1] === true) {\n values[1] = undefined\n }\n\n transformer = values[0].apply(processor, values.slice(1))\n\n if (typeof transformer === 'function') {\n transformers.use(transformer)\n }\n }\n\n frozen = true\n freezeIndex = Infinity\n\n return processor\n }\n\n // Data management.\n // Getter / setter for processor-specific informtion.\n function data(key, value) {\n if (typeof key === 'string') {\n // Set `key`.\n if (arguments.length === 2) {\n assertUnfrozen('data', frozen)\n namespace[key] = value\n return processor\n }\n\n // Get `key`.\n return (own.call(namespace, key) && namespace[key]) || null\n }\n\n // Set space.\n if (key) {\n assertUnfrozen('data', frozen)\n namespace = key\n return processor\n }\n\n // Get space.\n return namespace\n }\n\n // Plugin management.\n //\n // Pass it:\n // * an attacher and options,\n // * a preset,\n // * a list of presets, attachers, and arguments (list of attachers and\n // options).\n function use(value) {\n var settings\n\n assertUnfrozen('use', frozen)\n\n if (value === null || value === undefined) {\n // Empty.\n } else if (typeof value === 'function') {\n addPlugin.apply(null, arguments)\n } else if (typeof value === 'object') {\n if ('length' in value) {\n addList(value)\n } else {\n addPreset(value)\n }\n } else {\n throw new Error('Expected usable value, not `' + value + '`')\n }\n\n if (settings) {\n namespace.settings = extend(namespace.settings || {}, settings)\n }\n\n return processor\n\n function addPreset(result) {\n addList(result.plugins)\n\n if (result.settings) {\n settings = extend(settings || {}, result.settings)\n }\n }\n\n function add(value) {\n if (typeof value === 'function') {\n addPlugin(value)\n } else if (typeof value === 'object') {\n if ('length' in value) {\n addPlugin.apply(null, value)\n } else {\n addPreset(value)\n }\n } else {\n throw new Error('Expected usable value, not `' + value + '`')\n }\n }\n\n function addList(plugins) {\n var index = -1\n\n if (plugins === null || plugins === undefined) {\n // Empty.\n } else if (typeof plugins === 'object' && 'length' in plugins) {\n while (++index < plugins.length) {\n add(plugins[index])\n }\n } else {\n throw new Error('Expected a list of plugins, not `' + plugins + '`')\n }\n }\n\n function addPlugin(plugin, value) {\n var entry = find(plugin)\n\n if (entry) {\n if (plain(entry[1]) && plain(value)) {\n value = extend(true, entry[1], value)\n }\n\n entry[1] = value\n } else {\n attachers.push(slice.call(arguments))\n }\n }\n }\n\n function find(plugin) {\n var index = -1\n\n while (++index < attachers.length) {\n if (attachers[index][0] === plugin) {\n return attachers[index]\n }\n }\n }\n\n // Parse a file (in string or vfile representation) into a unist node using\n // the `Parser` on the processor.\n function parse(doc) {\n var file = vfile(doc)\n var Parser\n\n freeze()\n Parser = processor.Parser\n assertParser('parse', Parser)\n\n if (newable(Parser, 'parse')) {\n return new Parser(String(file), file).parse()\n }\n\n return Parser(String(file), file) // eslint-disable-line new-cap\n }\n\n // Run transforms on a unist node representation of a file (in string or\n // vfile representation), async.\n function run(node, file, cb) {\n assertNode(node)\n freeze()\n\n if (!cb && typeof file === 'function') {\n cb = file\n file = null\n }\n\n if (!cb) {\n return new Promise(executor)\n }\n\n executor(null, cb)\n\n function executor(resolve, reject) {\n transformers.run(node, vfile(file), done)\n\n function done(error, tree, file) {\n tree = tree || node\n if (error) {\n reject(error)\n } else if (resolve) {\n resolve(tree)\n } else {\n cb(null, tree, file)\n }\n }\n }\n }\n\n // Run transforms on a unist node representation of a file (in string or\n // vfile representation), sync.\n function runSync(node, file) {\n var result\n var complete\n\n run(node, file, done)\n\n assertDone('runSync', 'run', complete)\n\n return result\n\n function done(error, tree) {\n complete = true\n result = tree\n bail(error)\n }\n }\n\n // Stringify a unist node representation of a file (in string or vfile\n // representation) into a string using the `Compiler` on the processor.\n function stringify(node, doc) {\n var file = vfile(doc)\n var Compiler\n\n freeze()\n Compiler = processor.Compiler\n assertCompiler('stringify', Compiler)\n assertNode(node)\n\n if (newable(Compiler, 'compile')) {\n return new Compiler(node, file).compile()\n }\n\n return Compiler(node, file) // eslint-disable-line new-cap\n }\n\n // Parse a file (in string or vfile representation) into a unist node using\n // the `Parser` on the processor, then run transforms on that node, and\n // compile the resulting node using the `Compiler` on the processor, and\n // store that result on the vfile.\n function process(doc, cb) {\n freeze()\n assertParser('process', processor.Parser)\n assertCompiler('process', processor.Compiler)\n\n if (!cb) {\n return new Promise(executor)\n }\n\n executor(null, cb)\n\n function executor(resolve, reject) {\n var file = vfile(doc)\n\n pipeline.run(processor, {file: file}, done)\n\n function done(error) {\n if (error) {\n reject(error)\n } else if (resolve) {\n resolve(file)\n } else {\n cb(null, file)\n }\n }\n }\n }\n\n // Process the given document (in string or vfile representation), sync.\n function processSync(doc) {\n var file\n var complete\n\n freeze()\n assertParser('processSync', processor.Parser)\n assertCompiler('processSync', processor.Compiler)\n file = vfile(doc)\n\n process(file, done)\n\n assertDone('processSync', 'process', complete)\n\n return file\n\n function done(error) {\n complete = true\n bail(error)\n }\n }\n}", "function unified() {\n var attachers = []\n var transformers = trough()\n var namespace = {}\n var freezeIndex = -1\n var frozen\n\n // Data management.\n processor.data = data\n\n // Lock.\n processor.freeze = freeze\n\n // Plugins.\n processor.attachers = attachers\n processor.use = use\n\n // API.\n processor.parse = parse\n processor.stringify = stringify\n processor.run = run\n processor.runSync = runSync\n processor.process = process\n processor.processSync = processSync\n\n // Expose.\n return processor\n\n // Create a new processor based on the processor in the current scope.\n function processor() {\n var destination = unified()\n var index = -1\n\n while (++index < attachers.length) {\n destination.use.apply(null, attachers[index])\n }\n\n destination.data(extend(true, {}, namespace))\n\n return destination\n }\n\n // Freeze: used to signal a processor that has finished configuration.\n //\n // For example, take unified itself: it’s frozen.\n // Plugins should not be added to it.\n // Rather, it should be extended, by invoking it, before modifying it.\n //\n // In essence, always invoke this when exporting a processor.\n function freeze() {\n var values\n var transformer\n\n if (frozen) {\n return processor\n }\n\n while (++freezeIndex < attachers.length) {\n values = attachers[freezeIndex]\n\n if (values[1] === false) {\n continue\n }\n\n if (values[1] === true) {\n values[1] = undefined\n }\n\n transformer = values[0].apply(processor, values.slice(1))\n\n if (typeof transformer === 'function') {\n transformers.use(transformer)\n }\n }\n\n frozen = true\n freezeIndex = Infinity\n\n return processor\n }\n\n // Data management.\n // Getter / setter for processor-specific informtion.\n function data(key, value) {\n if (typeof key === 'string') {\n // Set `key`.\n if (arguments.length === 2) {\n assertUnfrozen('data', frozen)\n namespace[key] = value\n return processor\n }\n\n // Get `key`.\n return (own.call(namespace, key) && namespace[key]) || null\n }\n\n // Set space.\n if (key) {\n assertUnfrozen('data', frozen)\n namespace = key\n return processor\n }\n\n // Get space.\n return namespace\n }\n\n // Plugin management.\n //\n // Pass it:\n // * an attacher and options,\n // * a preset,\n // * a list of presets, attachers, and arguments (list of attachers and\n // options).\n function use(value) {\n var settings\n\n assertUnfrozen('use', frozen)\n\n if (value === null || value === undefined) {\n // Empty.\n } else if (typeof value === 'function') {\n addPlugin.apply(null, arguments)\n } else if (typeof value === 'object') {\n if ('length' in value) {\n addList(value)\n } else {\n addPreset(value)\n }\n } else {\n throw new Error('Expected usable value, not `' + value + '`')\n }\n\n if (settings) {\n namespace.settings = extend(namespace.settings || {}, settings)\n }\n\n return processor\n\n function addPreset(result) {\n addList(result.plugins)\n\n if (result.settings) {\n settings = extend(settings || {}, result.settings)\n }\n }\n\n function add(value) {\n if (typeof value === 'function') {\n addPlugin(value)\n } else if (typeof value === 'object') {\n if ('length' in value) {\n addPlugin.apply(null, value)\n } else {\n addPreset(value)\n }\n } else {\n throw new Error('Expected usable value, not `' + value + '`')\n }\n }\n\n function addList(plugins) {\n var index = -1\n\n if (plugins === null || plugins === undefined) {\n // Empty.\n } else if (typeof plugins === 'object' && 'length' in plugins) {\n while (++index < plugins.length) {\n add(plugins[index])\n }\n } else {\n throw new Error('Expected a list of plugins, not `' + plugins + '`')\n }\n }\n\n function addPlugin(plugin, value) {\n var entry = find(plugin)\n\n if (entry) {\n if (plain(entry[1]) && plain(value)) {\n value = extend(true, entry[1], value)\n }\n\n entry[1] = value\n } else {\n attachers.push(slice.call(arguments))\n }\n }\n }\n\n function find(plugin) {\n var index = -1\n\n while (++index < attachers.length) {\n if (attachers[index][0] === plugin) {\n return attachers[index]\n }\n }\n }\n\n // Parse a file (in string or vfile representation) into a unist node using\n // the `Parser` on the processor.\n function parse(doc) {\n var file = vfile(doc)\n var Parser\n\n freeze()\n Parser = processor.Parser\n assertParser('parse', Parser)\n\n if (newable(Parser, 'parse')) {\n return new Parser(String(file), file).parse()\n }\n\n return Parser(String(file), file) // eslint-disable-line new-cap\n }\n\n // Run transforms on a unist node representation of a file (in string or\n // vfile representation), async.\n function run(node, file, cb) {\n assertNode(node)\n freeze()\n\n if (!cb && typeof file === 'function') {\n cb = file\n file = null\n }\n\n if (!cb) {\n return new Promise(executor)\n }\n\n executor(null, cb)\n\n function executor(resolve, reject) {\n transformers.run(node, vfile(file), done)\n\n function done(error, tree, file) {\n tree = tree || node\n if (error) {\n reject(error)\n } else if (resolve) {\n resolve(tree)\n } else {\n cb(null, tree, file)\n }\n }\n }\n }\n\n // Run transforms on a unist node representation of a file (in string or\n // vfile representation), sync.\n function runSync(node, file) {\n var result\n var complete\n\n run(node, file, done)\n\n assertDone('runSync', 'run', complete)\n\n return result\n\n function done(error, tree) {\n complete = true\n result = tree\n bail(error)\n }\n }\n\n // Stringify a unist node representation of a file (in string or vfile\n // representation) into a string using the `Compiler` on the processor.\n function stringify(node, doc) {\n var file = vfile(doc)\n var Compiler\n\n freeze()\n Compiler = processor.Compiler\n assertCompiler('stringify', Compiler)\n assertNode(node)\n\n if (newable(Compiler, 'compile')) {\n return new Compiler(node, file).compile()\n }\n\n return Compiler(node, file) // eslint-disable-line new-cap\n }\n\n // Parse a file (in string or vfile representation) into a unist node using\n // the `Parser` on the processor, then run transforms on that node, and\n // compile the resulting node using the `Compiler` on the processor, and\n // store that result on the vfile.\n function process(doc, cb) {\n freeze()\n assertParser('process', processor.Parser)\n assertCompiler('process', processor.Compiler)\n\n if (!cb) {\n return new Promise(executor)\n }\n\n executor(null, cb)\n\n function executor(resolve, reject) {\n var file = vfile(doc)\n\n pipeline.run(processor, {file: file}, done)\n\n function done(error) {\n if (error) {\n reject(error)\n } else if (resolve) {\n resolve(file)\n } else {\n cb(null, file)\n }\n }\n }\n }\n\n // Process the given document (in string or vfile representation), sync.\n function processSync(doc) {\n var file\n var complete\n\n freeze()\n assertParser('processSync', processor.Parser)\n assertCompiler('processSync', processor.Compiler)\n file = vfile(doc)\n\n process(file, done)\n\n assertDone('processSync', 'process', complete)\n\n return file\n\n function done(error) {\n complete = true\n bail(error)\n }\n }\n}", "function unified() {\n var attachers = []\n var transformers = trough()\n var namespace = {}\n var frozen = false\n var freezeIndex = -1\n\n // Data management.\n processor.data = data\n\n // Lock.\n processor.freeze = freeze\n\n // Plugins.\n processor.attachers = attachers\n processor.use = use\n\n // API.\n processor.parse = parse\n processor.stringify = stringify\n processor.run = run\n processor.runSync = runSync\n processor.process = process\n processor.processSync = processSync\n\n // Expose.\n return processor\n\n // Create a new processor based on the processor in the current scope.\n function processor() {\n var destination = unified()\n var length = attachers.length\n var index = -1\n\n while (++index < length) {\n destination.use.apply(null, attachers[index])\n }\n\n destination.data(extend(true, {}, namespace))\n\n return destination\n }\n\n // Freeze: used to signal a processor that has finished configuration.\n //\n // For example, take unified itself: it’s frozen.\n // Plugins should not be added to it.\n // Rather, it should be extended, by invoking it, before modifying it.\n //\n // In essence, always invoke this when exporting a processor.\n function freeze() {\n var values\n var plugin\n var options\n var transformer\n\n if (frozen) {\n return processor\n }\n\n while (++freezeIndex < attachers.length) {\n values = attachers[freezeIndex]\n plugin = values[0]\n options = values[1]\n transformer = null\n\n if (options === false) {\n continue\n }\n\n if (options === true) {\n values[1] = undefined\n }\n\n transformer = plugin.apply(processor, values.slice(1))\n\n if (typeof transformer === 'function') {\n transformers.use(transformer)\n }\n }\n\n frozen = true\n freezeIndex = Infinity\n\n return processor\n }\n\n // Data management.\n // Getter / setter for processor-specific informtion.\n function data(key, value) {\n if (typeof key === 'string') {\n // Set `key`.\n if (arguments.length === 2) {\n assertUnfrozen('data', frozen)\n\n namespace[key] = value\n\n return processor\n }\n\n // Get `key`.\n return (own.call(namespace, key) && namespace[key]) || null\n }\n\n // Set space.\n if (key) {\n assertUnfrozen('data', frozen)\n namespace = key\n return processor\n }\n\n // Get space.\n return namespace\n }\n\n // Plugin management.\n //\n // Pass it:\n // * an attacher and options,\n // * a preset,\n // * a list of presets, attachers, and arguments (list of attachers and\n // options).\n function use(value) {\n var settings\n\n assertUnfrozen('use', frozen)\n\n if (value === null || value === undefined) {\n // Empty.\n } else if (typeof value === 'function') {\n addPlugin.apply(null, arguments)\n } else if (typeof value === 'object') {\n if ('length' in value) {\n addList(value)\n } else {\n addPreset(value)\n }\n } else {\n throw new Error('Expected usable value, not `' + value + '`')\n }\n\n if (settings) {\n namespace.settings = extend(namespace.settings || {}, settings)\n }\n\n return processor\n\n function addPreset(result) {\n addList(result.plugins)\n\n if (result.settings) {\n settings = extend(settings || {}, result.settings)\n }\n }\n\n function add(value) {\n if (typeof value === 'function') {\n addPlugin(value)\n } else if (typeof value === 'object') {\n if ('length' in value) {\n addPlugin.apply(null, value)\n } else {\n addPreset(value)\n }\n } else {\n throw new Error('Expected usable value, not `' + value + '`')\n }\n }\n\n function addList(plugins) {\n var length\n var index\n\n if (plugins === null || plugins === undefined) {\n // Empty.\n } else if (typeof plugins === 'object' && 'length' in plugins) {\n length = plugins.length\n index = -1\n\n while (++index < length) {\n add(plugins[index])\n }\n } else {\n throw new Error('Expected a list of plugins, not `' + plugins + '`')\n }\n }\n\n function addPlugin(plugin, value) {\n var entry = find(plugin)\n\n if (entry) {\n if (plain(entry[1]) && plain(value)) {\n value = extend(entry[1], value)\n }\n\n entry[1] = value\n } else {\n attachers.push(slice.call(arguments))\n }\n }\n }\n\n function find(plugin) {\n var length = attachers.length\n var index = -1\n var entry\n\n while (++index < length) {\n entry = attachers[index]\n\n if (entry[0] === plugin) {\n return entry\n }\n }\n }\n\n // Parse a file (in string or vfile representation) into a unist node using\n // the `Parser` on the processor.\n function parse(doc) {\n var file = vfile(doc)\n var Parser\n\n freeze()\n Parser = processor.Parser\n assertParser('parse', Parser)\n\n if (newable(Parser, 'parse')) {\n return new Parser(String(file), file).parse()\n }\n\n return Parser(String(file), file) // eslint-disable-line new-cap\n }\n\n // Run transforms on a unist node representation of a file (in string or\n // vfile representation), async.\n function run(node, file, cb) {\n assertNode(node)\n freeze()\n\n if (!cb && typeof file === 'function') {\n cb = file\n file = null\n }\n\n if (!cb) {\n return new Promise(executor)\n }\n\n executor(null, cb)\n\n function executor(resolve, reject) {\n transformers.run(node, vfile(file), done)\n\n function done(err, tree, file) {\n tree = tree || node\n if (err) {\n reject(err)\n } else if (resolve) {\n resolve(tree)\n } else {\n cb(null, tree, file)\n }\n }\n }\n }\n\n // Run transforms on a unist node representation of a file (in string or\n // vfile representation), sync.\n function runSync(node, file) {\n var complete = false\n var result\n\n run(node, file, done)\n\n assertDone('runSync', 'run', complete)\n\n return result\n\n function done(err, tree) {\n complete = true\n bail(err)\n result = tree\n }\n }\n\n // Stringify a unist node representation of a file (in string or vfile\n // representation) into a string using the `Compiler` on the processor.\n function stringify(node, doc) {\n var file = vfile(doc)\n var Compiler\n\n freeze()\n Compiler = processor.Compiler\n assertCompiler('stringify', Compiler)\n assertNode(node)\n\n if (newable(Compiler, 'compile')) {\n return new Compiler(node, file).compile()\n }\n\n return Compiler(node, file) // eslint-disable-line new-cap\n }\n\n // Parse a file (in string or vfile representation) into a unist node using\n // the `Parser` on the processor, then run transforms on that node, and\n // compile the resulting node using the `Compiler` on the processor, and\n // store that result on the vfile.\n function process(doc, cb) {\n freeze()\n assertParser('process', processor.Parser)\n assertCompiler('process', processor.Compiler)\n\n if (!cb) {\n return new Promise(executor)\n }\n\n executor(null, cb)\n\n function executor(resolve, reject) {\n var file = vfile(doc)\n\n pipeline.run(processor, {file: file}, done)\n\n function done(err) {\n if (err) {\n reject(err)\n } else if (resolve) {\n resolve(file)\n } else {\n cb(null, file)\n }\n }\n }\n }\n\n // Process the given document (in string or vfile representation), sync.\n function processSync(doc) {\n var complete = false\n var file\n\n freeze()\n assertParser('processSync', processor.Parser)\n assertCompiler('processSync', processor.Compiler)\n file = vfile(doc)\n\n process(file, done)\n\n assertDone('processSync', 'process', complete)\n\n return file\n\n function done(err) {\n complete = true\n bail(err)\n }\n }\n}", "function unified() {\n var attachers = []\n var transformers = trough()\n var namespace = {}\n var frozen = false\n var freezeIndex = -1\n\n /* Data management. */\n processor.data = data\n\n /* Lock. */\n processor.freeze = freeze\n\n /* Plug-ins. */\n processor.attachers = attachers\n processor.use = use\n\n /* API. */\n processor.parse = parse\n processor.stringify = stringify\n processor.run = run\n processor.runSync = runSync\n processor.process = process\n processor.processSync = processSync\n\n /* Expose. */\n return processor\n\n /* Create a new processor based on the processor\n * in the current scope. */\n function processor() {\n var destination = unified()\n var length = attachers.length\n var index = -1\n\n while (++index < length) {\n destination.use.apply(null, attachers[index])\n }\n\n destination.data(extend(true, {}, namespace))\n\n return destination\n }\n\n /* Freeze: used to signal a processor that has finished\n * configuration.\n *\n * For example, take unified itself. It’s frozen.\n * Plug-ins should not be added to it. Rather, it should\n * be extended, by invoking it, before modifying it.\n *\n * In essence, always invoke this when exporting a\n * processor. */\n function freeze() {\n var values\n var plugin\n var options\n var transformer\n\n if (frozen) {\n return processor\n }\n\n while (++freezeIndex < attachers.length) {\n values = attachers[freezeIndex]\n plugin = values[0]\n options = values[1]\n transformer = null\n\n if (options === false) {\n continue\n }\n\n if (options === true) {\n values[1] = undefined\n }\n\n transformer = plugin.apply(processor, values.slice(1))\n\n if (typeof transformer === 'function') {\n transformers.use(transformer)\n }\n }\n\n frozen = true\n freezeIndex = Infinity\n\n return processor\n }\n\n /* Data management.\n * Getter / setter for processor-specific informtion. */\n function data(key, value) {\n if (string(key)) {\n /* Set `key`. */\n if (arguments.length === 2) {\n assertUnfrozen('data', frozen)\n\n namespace[key] = value\n\n return processor\n }\n\n /* Get `key`. */\n return (own.call(namespace, key) && namespace[key]) || null\n }\n\n /* Set space. */\n if (key) {\n assertUnfrozen('data', frozen)\n namespace = key\n return processor\n }\n\n /* Get space. */\n return namespace\n }\n\n /* Plug-in management.\n *\n * Pass it:\n * * an attacher and options,\n * * a preset,\n * * a list of presets, attachers, and arguments (list\n * of attachers and options). */\n function use(value) {\n var settings\n\n assertUnfrozen('use', frozen)\n\n if (value === null || value === undefined) {\n /* Empty */\n } else if (typeof value === 'function') {\n addPlugin.apply(null, arguments)\n } else if (typeof value === 'object') {\n if ('length' in value) {\n addList(value)\n } else {\n addPreset(value)\n }\n } else {\n throw new Error('Expected usable value, not `' + value + '`')\n }\n\n if (settings) {\n namespace.settings = extend(namespace.settings || {}, settings)\n }\n\n return processor\n\n function addPreset(result) {\n addList(result.plugins)\n\n if (result.settings) {\n settings = extend(settings || {}, result.settings)\n }\n }\n\n function add(value) {\n if (typeof value === 'function') {\n addPlugin(value)\n } else if (typeof value === 'object') {\n if ('length' in value) {\n addPlugin.apply(null, value)\n } else {\n addPreset(value)\n }\n } else {\n throw new Error('Expected usable value, not `' + value + '`')\n }\n }\n\n function addList(plugins) {\n var length\n var index\n\n if (plugins === null || plugins === undefined) {\n /* Empty */\n } else if (typeof plugins === 'object' && 'length' in plugins) {\n length = plugins.length\n index = -1\n\n while (++index < length) {\n add(plugins[index])\n }\n } else {\n throw new Error('Expected a list of plugins, not `' + plugins + '`')\n }\n }\n\n function addPlugin(plugin, value) {\n var entry = find(plugin)\n\n if (entry) {\n if (plain(entry[1]) && plain(value)) {\n value = extend(entry[1], value)\n }\n\n entry[1] = value\n } else {\n attachers.push(slice.call(arguments))\n }\n }\n }\n\n function find(plugin) {\n var length = attachers.length\n var index = -1\n var entry\n\n while (++index < length) {\n entry = attachers[index]\n\n if (entry[0] === plugin) {\n return entry\n }\n }\n }\n\n /* Parse a file (in string or VFile representation)\n * into a Unist node using the `Parser` on the\n * processor. */\n function parse(doc) {\n var file = vfile(doc)\n var Parser\n\n freeze()\n Parser = processor.Parser\n assertParser('parse', Parser)\n\n if (newable(Parser)) {\n return new Parser(String(file), file).parse()\n }\n\n return Parser(String(file), file) // eslint-disable-line new-cap\n }\n\n /* Run transforms on a Unist node representation of a file\n * (in string or VFile representation), async. */\n function run(node, file, cb) {\n assertNode(node)\n freeze()\n\n if (!cb && typeof file === 'function') {\n cb = file\n file = null\n }\n\n if (!cb) {\n return new Promise(executor)\n }\n\n executor(null, cb)\n\n function executor(resolve, reject) {\n transformers.run(node, vfile(file), done)\n\n function done(err, tree, file) {\n tree = tree || node\n if (err) {\n reject(err)\n } else if (resolve) {\n resolve(tree)\n } else {\n cb(null, tree, file)\n }\n }\n }\n }\n\n /* Run transforms on a Unist node representation of a file\n * (in string or VFile representation), sync. */\n function runSync(node, file) {\n var complete = false\n var result\n\n run(node, file, done)\n\n assertDone('runSync', 'run', complete)\n\n return result\n\n function done(err, tree) {\n complete = true\n bail(err)\n result = tree\n }\n }\n\n /* Stringify a Unist node representation of a file\n * (in string or VFile representation) into a string\n * using the `Compiler` on the processor. */\n function stringify(node, doc) {\n var file = vfile(doc)\n var Compiler\n\n freeze()\n Compiler = processor.Compiler\n assertCompiler('stringify', Compiler)\n assertNode(node)\n\n if (newable(Compiler)) {\n return new Compiler(node, file).compile()\n }\n\n return Compiler(node, file) // eslint-disable-line new-cap\n }\n\n /* Parse a file (in string or VFile representation)\n * into a Unist node using the `Parser` on the processor,\n * then run transforms on that node, and compile the\n * resulting node using the `Compiler` on the processor,\n * and store that result on the VFile. */\n function process(doc, cb) {\n freeze()\n assertParser('process', processor.Parser)\n assertCompiler('process', processor.Compiler)\n\n if (!cb) {\n return new Promise(executor)\n }\n\n executor(null, cb)\n\n function executor(resolve, reject) {\n var file = vfile(doc)\n\n pipeline.run(processor, {file: file}, done)\n\n function done(err) {\n if (err) {\n reject(err)\n } else if (resolve) {\n resolve(file)\n } else {\n cb(null, file)\n }\n }\n }\n }\n\n /* Process the given document (in string or VFile\n * representation), sync. */\n function processSync(doc) {\n var complete = false\n var file\n\n freeze()\n assertParser('processSync', processor.Parser)\n assertCompiler('processSync', processor.Compiler)\n file = vfile(doc)\n\n process(file, done)\n\n assertDone('processSync', 'process', complete)\n\n return file\n\n function done(err) {\n complete = true\n bail(err)\n }\n }\n}", "function unified() {\n var attachers = []\n var transformers = trough()\n var namespace = {}\n var frozen = false\n var freezeIndex = -1\n\n /* Data management. */\n processor.data = data\n\n /* Lock. */\n processor.freeze = freeze\n\n /* Plug-ins. */\n processor.attachers = attachers\n processor.use = use\n\n /* API. */\n processor.parse = parse\n processor.stringify = stringify\n processor.run = run\n processor.runSync = runSync\n processor.process = process\n processor.processSync = processSync\n\n /* Expose. */\n return processor\n\n /* Create a new processor based on the processor\n * in the current scope. */\n function processor() {\n var destination = unified()\n var length = attachers.length\n var index = -1\n\n while (++index < length) {\n destination.use.apply(null, attachers[index])\n }\n\n destination.data(extend(true, {}, namespace))\n\n return destination\n }\n\n /* Freeze: used to signal a processor that has finished\n * configuration.\n *\n * For example, take unified itself. It’s frozen.\n * Plug-ins should not be added to it. Rather, it should\n * be extended, by invoking it, before modifying it.\n *\n * In essence, always invoke this when exporting a\n * processor. */\n function freeze() {\n var values\n var plugin\n var options\n var transformer\n\n if (frozen) {\n return processor\n }\n\n while (++freezeIndex < attachers.length) {\n values = attachers[freezeIndex]\n plugin = values[0]\n options = values[1]\n transformer = null\n\n if (options === false) {\n continue\n }\n\n if (options === true) {\n values[1] = undefined\n }\n\n transformer = plugin.apply(processor, values.slice(1))\n\n if (typeof transformer === 'function') {\n transformers.use(transformer)\n }\n }\n\n frozen = true\n freezeIndex = Infinity\n\n return processor\n }\n\n /* Data management.\n * Getter / setter for processor-specific informtion. */\n function data(key, value) {\n if (string(key)) {\n /* Set `key`. */\n if (arguments.length === 2) {\n assertUnfrozen('data', frozen)\n\n namespace[key] = value\n\n return processor\n }\n\n /* Get `key`. */\n return (own.call(namespace, key) && namespace[key]) || null\n }\n\n /* Set space. */\n if (key) {\n assertUnfrozen('data', frozen)\n namespace = key\n return processor\n }\n\n /* Get space. */\n return namespace\n }\n\n /* Plug-in management.\n *\n * Pass it:\n * * an attacher and options,\n * * a preset,\n * * a list of presets, attachers, and arguments (list\n * of attachers and options). */\n function use(value) {\n var settings\n\n assertUnfrozen('use', frozen)\n\n if (value === null || value === undefined) {\n /* Empty */\n } else if (typeof value === 'function') {\n addPlugin.apply(null, arguments)\n } else if (typeof value === 'object') {\n if ('length' in value) {\n addList(value)\n } else {\n addPreset(value)\n }\n } else {\n throw new Error('Expected usable value, not `' + value + '`')\n }\n\n if (settings) {\n namespace.settings = extend(namespace.settings || {}, settings)\n }\n\n return processor\n\n function addPreset(result) {\n addList(result.plugins)\n\n if (result.settings) {\n settings = extend(settings || {}, result.settings)\n }\n }\n\n function add(value) {\n if (typeof value === 'function') {\n addPlugin(value)\n } else if (typeof value === 'object') {\n if ('length' in value) {\n addPlugin.apply(null, value)\n } else {\n addPreset(value)\n }\n } else {\n throw new Error('Expected usable value, not `' + value + '`')\n }\n }\n\n function addList(plugins) {\n var length\n var index\n\n if (plugins === null || plugins === undefined) {\n /* Empty */\n } else if (typeof plugins === 'object' && 'length' in plugins) {\n length = plugins.length\n index = -1\n\n while (++index < length) {\n add(plugins[index])\n }\n } else {\n throw new Error('Expected a list of plugins, not `' + plugins + '`')\n }\n }\n\n function addPlugin(plugin, value) {\n var entry = find(plugin)\n\n if (entry) {\n if (plain(entry[1]) && plain(value)) {\n value = extend(entry[1], value)\n }\n\n entry[1] = value\n } else {\n attachers.push(slice.call(arguments))\n }\n }\n }\n\n function find(plugin) {\n var length = attachers.length\n var index = -1\n var entry\n\n while (++index < length) {\n entry = attachers[index]\n\n if (entry[0] === plugin) {\n return entry\n }\n }\n }\n\n /* Parse a file (in string or VFile representation)\n * into a Unist node using the `Parser` on the\n * processor. */\n function parse(doc) {\n var file = vfile(doc)\n var Parser\n\n freeze()\n Parser = processor.Parser\n assertParser('parse', Parser)\n\n if (newable(Parser)) {\n return new Parser(String(file), file).parse()\n }\n\n return Parser(String(file), file) // eslint-disable-line new-cap\n }\n\n /* Run transforms on a Unist node representation of a file\n * (in string or VFile representation), async. */\n function run(node, file, cb) {\n assertNode(node)\n freeze()\n\n if (!cb && typeof file === 'function') {\n cb = file\n file = null\n }\n\n if (!cb) {\n return new Promise(executor)\n }\n\n executor(null, cb)\n\n function executor(resolve, reject) {\n transformers.run(node, vfile(file), done)\n\n function done(err, tree, file) {\n tree = tree || node\n if (err) {\n reject(err)\n } else if (resolve) {\n resolve(tree)\n } else {\n cb(null, tree, file)\n }\n }\n }\n }\n\n /* Run transforms on a Unist node representation of a file\n * (in string or VFile representation), sync. */\n function runSync(node, file) {\n var complete = false\n var result\n\n run(node, file, done)\n\n assertDone('runSync', 'run', complete)\n\n return result\n\n function done(err, tree) {\n complete = true\n bail(err)\n result = tree\n }\n }\n\n /* Stringify a Unist node representation of a file\n * (in string or VFile representation) into a string\n * using the `Compiler` on the processor. */\n function stringify(node, doc) {\n var file = vfile(doc)\n var Compiler\n\n freeze()\n Compiler = processor.Compiler\n assertCompiler('stringify', Compiler)\n assertNode(node)\n\n if (newable(Compiler)) {\n return new Compiler(node, file).compile()\n }\n\n return Compiler(node, file) // eslint-disable-line new-cap\n }\n\n /* Parse a file (in string or VFile representation)\n * into a Unist node using the `Parser` on the processor,\n * then run transforms on that node, and compile the\n * resulting node using the `Compiler` on the processor,\n * and store that result on the VFile. */\n function process(doc, cb) {\n freeze()\n assertParser('process', processor.Parser)\n assertCompiler('process', processor.Compiler)\n\n if (!cb) {\n return new Promise(executor)\n }\n\n executor(null, cb)\n\n function executor(resolve, reject) {\n var file = vfile(doc)\n\n pipeline.run(processor, {file: file}, done)\n\n function done(err) {\n if (err) {\n reject(err)\n } else if (resolve) {\n resolve(file)\n } else {\n cb(null, file)\n }\n }\n }\n }\n\n /* Process the given document (in string or VFile\n * representation), sync. */\n function processSync(doc) {\n var complete = false\n var file\n\n freeze()\n assertParser('processSync', processor.Parser)\n assertCompiler('processSync', processor.Compiler)\n file = vfile(doc)\n\n process(file, done)\n\n assertDone('processSync', 'process', complete)\n\n return file\n\n function done(err) {\n complete = true\n bail(err)\n }\n }\n}", "function unified() {\n var attachers = []\n var transformers = trough()\n var namespace = {}\n var frozen = false\n var freezeIndex = -1\n\n /* Data management. */\n processor.data = data\n\n /* Lock. */\n processor.freeze = freeze\n\n /* Plug-ins. */\n processor.attachers = attachers\n processor.use = use\n\n /* API. */\n processor.parse = parse\n processor.stringify = stringify\n processor.run = run\n processor.runSync = runSync\n processor.process = process\n processor.processSync = processSync\n\n /* Expose. */\n return processor\n\n /* Create a new processor based on the processor\n * in the current scope. */\n function processor() {\n var destination = unified()\n var length = attachers.length\n var index = -1\n\n while (++index < length) {\n destination.use.apply(null, attachers[index])\n }\n\n destination.data(extend(true, {}, namespace))\n\n return destination\n }\n\n /* Freeze: used to signal a processor that has finished\n * configuration.\n *\n * For example, take unified itself. It’s frozen.\n * Plug-ins should not be added to it. Rather, it should\n * be extended, by invoking it, before modifying it.\n *\n * In essence, always invoke this when exporting a\n * processor. */\n function freeze() {\n var values\n var plugin\n var options\n var transformer\n\n if (frozen) {\n return processor\n }\n\n while (++freezeIndex < attachers.length) {\n values = attachers[freezeIndex]\n plugin = values[0]\n options = values[1]\n transformer = null\n\n if (options === false) {\n continue\n }\n\n if (options === true) {\n values[1] = undefined\n }\n\n transformer = plugin.apply(processor, values.slice(1))\n\n if (typeof transformer === 'function') {\n transformers.use(transformer)\n }\n }\n\n frozen = true\n freezeIndex = Infinity\n\n return processor\n }\n\n /* Data management.\n * Getter / setter for processor-specific informtion. */\n function data(key, value) {\n if (string(key)) {\n /* Set `key`. */\n if (arguments.length === 2) {\n assertUnfrozen('data', frozen)\n\n namespace[key] = value\n\n return processor\n }\n\n /* Get `key`. */\n return (own.call(namespace, key) && namespace[key]) || null\n }\n\n /* Set space. */\n if (key) {\n assertUnfrozen('data', frozen)\n namespace = key\n return processor\n }\n\n /* Get space. */\n return namespace\n }\n\n /* Plug-in management.\n *\n * Pass it:\n * * an attacher and options,\n * * a preset,\n * * a list of presets, attachers, and arguments (list\n * of attachers and options). */\n function use(value) {\n var settings\n\n assertUnfrozen('use', frozen)\n\n if (value === null || value === undefined) {\n /* Empty */\n } else if (typeof value === 'function') {\n addPlugin.apply(null, arguments)\n } else if (typeof value === 'object') {\n if ('length' in value) {\n addList(value)\n } else {\n addPreset(value)\n }\n } else {\n throw new Error('Expected usable value, not `' + value + '`')\n }\n\n if (settings) {\n namespace.settings = extend(namespace.settings || {}, settings)\n }\n\n return processor\n\n function addPreset(result) {\n addList(result.plugins)\n\n if (result.settings) {\n settings = extend(settings || {}, result.settings)\n }\n }\n\n function add(value) {\n if (typeof value === 'function') {\n addPlugin(value)\n } else if (typeof value === 'object') {\n if ('length' in value) {\n addPlugin.apply(null, value)\n } else {\n addPreset(value)\n }\n } else {\n throw new Error('Expected usable value, not `' + value + '`')\n }\n }\n\n function addList(plugins) {\n var length\n var index\n\n if (plugins === null || plugins === undefined) {\n /* Empty */\n } else if (typeof plugins === 'object' && 'length' in plugins) {\n length = plugins.length\n index = -1\n\n while (++index < length) {\n add(plugins[index])\n }\n } else {\n throw new Error('Expected a list of plugins, not `' + plugins + '`')\n }\n }\n\n function addPlugin(plugin, value) {\n var entry = find(plugin)\n\n if (entry) {\n if (plain(entry[1]) && plain(value)) {\n value = extend(entry[1], value)\n }\n\n entry[1] = value\n } else {\n attachers.push(slice.call(arguments))\n }\n }\n }\n\n function find(plugin) {\n var length = attachers.length\n var index = -1\n var entry\n\n while (++index < length) {\n entry = attachers[index]\n\n if (entry[0] === plugin) {\n return entry\n }\n }\n }\n\n /* Parse a file (in string or VFile representation)\n * into a Unist node using the `Parser` on the\n * processor. */\n function parse(doc) {\n var file = vfile(doc)\n var Parser\n\n freeze()\n Parser = processor.Parser\n assertParser('parse', Parser)\n\n if (newable(Parser)) {\n return new Parser(String(file), file).parse()\n }\n\n return Parser(String(file), file) // eslint-disable-line new-cap\n }\n\n /* Run transforms on a Unist node representation of a file\n * (in string or VFile representation), async. */\n function run(node, file, cb) {\n assertNode(node)\n freeze()\n\n if (!cb && typeof file === 'function') {\n cb = file\n file = null\n }\n\n if (!cb) {\n return new Promise(executor)\n }\n\n executor(null, cb)\n\n function executor(resolve, reject) {\n transformers.run(node, vfile(file), done)\n\n function done(err, tree, file) {\n tree = tree || node\n if (err) {\n reject(err)\n } else if (resolve) {\n resolve(tree)\n } else {\n cb(null, tree, file)\n }\n }\n }\n }\n\n /* Run transforms on a Unist node representation of a file\n * (in string or VFile representation), sync. */\n function runSync(node, file) {\n var complete = false\n var result\n\n run(node, file, done)\n\n assertDone('runSync', 'run', complete)\n\n return result\n\n function done(err, tree) {\n complete = true\n bail(err)\n result = tree\n }\n }\n\n /* Stringify a Unist node representation of a file\n * (in string or VFile representation) into a string\n * using the `Compiler` on the processor. */\n function stringify(node, doc) {\n var file = vfile(doc)\n var Compiler\n\n freeze()\n Compiler = processor.Compiler\n assertCompiler('stringify', Compiler)\n assertNode(node)\n\n if (newable(Compiler)) {\n return new Compiler(node, file).compile()\n }\n\n return Compiler(node, file) // eslint-disable-line new-cap\n }\n\n /* Parse a file (in string or VFile representation)\n * into a Unist node using the `Parser` on the processor,\n * then run transforms on that node, and compile the\n * resulting node using the `Compiler` on the processor,\n * and store that result on the VFile. */\n function process(doc, cb) {\n freeze()\n assertParser('process', processor.Parser)\n assertCompiler('process', processor.Compiler)\n\n if (!cb) {\n return new Promise(executor)\n }\n\n executor(null, cb)\n\n function executor(resolve, reject) {\n var file = vfile(doc)\n\n pipeline.run(processor, {file: file}, done)\n\n function done(err) {\n if (err) {\n reject(err)\n } else if (resolve) {\n resolve(file)\n } else {\n cb(null, file)\n }\n }\n }\n }\n\n /* Process the given document (in string or VFile\n * representation), sync. */\n function processSync(doc) {\n var complete = false\n var file\n\n freeze()\n assertParser('processSync', processor.Parser)\n assertCompiler('processSync', processor.Compiler)\n file = vfile(doc)\n\n process(file, done)\n\n assertDone('processSync', 'process', complete)\n\n return file\n\n function done(err) {\n complete = true\n bail(err)\n }\n }\n}", "function unified() {\n var attachers = []\n var transformers = trough()\n var namespace = {}\n var frozen = false\n var freezeIndex = -1\n\n /* Data management. */\n processor.data = data\n\n /* Lock. */\n processor.freeze = freeze\n\n /* Plug-ins. */\n processor.attachers = attachers\n processor.use = use\n\n /* API. */\n processor.parse = parse\n processor.stringify = stringify\n processor.run = run\n processor.runSync = runSync\n processor.process = process\n processor.processSync = processSync\n\n /* Expose. */\n return processor\n\n /* Create a new processor based on the processor\n * in the current scope. */\n function processor() {\n var destination = unified()\n var length = attachers.length\n var index = -1\n\n while (++index < length) {\n destination.use.apply(null, attachers[index])\n }\n\n destination.data(extend(true, {}, namespace))\n\n return destination\n }\n\n /* Freeze: used to signal a processor that has finished\n * configuration.\n *\n * For example, take unified itself. It’s frozen.\n * Plug-ins should not be added to it. Rather, it should\n * be extended, by invoking it, before modifying it.\n *\n * In essence, always invoke this when exporting a\n * processor. */\n function freeze() {\n var values\n var plugin\n var options\n var transformer\n\n if (frozen) {\n return processor\n }\n\n while (++freezeIndex < attachers.length) {\n values = attachers[freezeIndex]\n plugin = values[0]\n options = values[1]\n transformer = null\n\n if (options === false) {\n continue\n }\n\n if (options === true) {\n values[1] = undefined\n }\n\n transformer = plugin.apply(processor, values.slice(1))\n\n if (typeof transformer === 'function') {\n transformers.use(transformer)\n }\n }\n\n frozen = true\n freezeIndex = Infinity\n\n return processor\n }\n\n /* Data management.\n * Getter / setter for processor-specific informtion. */\n function data(key, value) {\n if (string(key)) {\n /* Set `key`. */\n if (arguments.length === 2) {\n assertUnfrozen('data', frozen)\n\n namespace[key] = value\n\n return processor\n }\n\n /* Get `key`. */\n return (own.call(namespace, key) && namespace[key]) || null\n }\n\n /* Set space. */\n if (key) {\n assertUnfrozen('data', frozen)\n namespace = key\n return processor\n }\n\n /* Get space. */\n return namespace\n }\n\n /* Plug-in management.\n *\n * Pass it:\n * * an attacher and options,\n * * a preset,\n * * a list of presets, attachers, and arguments (list\n * of attachers and options). */\n function use(value) {\n var settings\n\n assertUnfrozen('use', frozen)\n\n if (value === null || value === undefined) {\n /* Empty */\n } else if (typeof value === 'function') {\n addPlugin.apply(null, arguments)\n } else if (typeof value === 'object') {\n if ('length' in value) {\n addList(value)\n } else {\n addPreset(value)\n }\n } else {\n throw new Error('Expected usable value, not `' + value + '`')\n }\n\n if (settings) {\n namespace.settings = extend(namespace.settings || {}, settings)\n }\n\n return processor\n\n function addPreset(result) {\n addList(result.plugins)\n\n if (result.settings) {\n settings = extend(settings || {}, result.settings)\n }\n }\n\n function add(value) {\n if (typeof value === 'function') {\n addPlugin(value)\n } else if (typeof value === 'object') {\n if ('length' in value) {\n addPlugin.apply(null, value)\n } else {\n addPreset(value)\n }\n } else {\n throw new Error('Expected usable value, not `' + value + '`')\n }\n }\n\n function addList(plugins) {\n var length\n var index\n\n if (plugins === null || plugins === undefined) {\n /* Empty */\n } else if (typeof plugins === 'object' && 'length' in plugins) {\n length = plugins.length\n index = -1\n\n while (++index < length) {\n add(plugins[index])\n }\n } else {\n throw new Error('Expected a list of plugins, not `' + plugins + '`')\n }\n }\n\n function addPlugin(plugin, value) {\n var entry = find(plugin)\n\n if (entry) {\n if (plain(entry[1]) && plain(value)) {\n value = extend(entry[1], value)\n }\n\n entry[1] = value\n } else {\n attachers.push(slice.call(arguments))\n }\n }\n }\n\n function find(plugin) {\n var length = attachers.length\n var index = -1\n var entry\n\n while (++index < length) {\n entry = attachers[index]\n\n if (entry[0] === plugin) {\n return entry\n }\n }\n }\n\n /* Parse a file (in string or VFile representation)\n * into a Unist node using the `Parser` on the\n * processor. */\n function parse(doc) {\n var file = vfile(doc)\n var Parser\n\n freeze()\n Parser = processor.Parser\n assertParser('parse', Parser)\n\n if (newable(Parser)) {\n return new Parser(String(file), file).parse()\n }\n\n return Parser(String(file), file) // eslint-disable-line new-cap\n }\n\n /* Run transforms on a Unist node representation of a file\n * (in string or VFile representation), async. */\n function run(node, file, cb) {\n assertNode(node)\n freeze()\n\n if (!cb && typeof file === 'function') {\n cb = file\n file = null\n }\n\n if (!cb) {\n return new Promise(executor)\n }\n\n executor(null, cb)\n\n function executor(resolve, reject) {\n transformers.run(node, vfile(file), done)\n\n function done(err, tree, file) {\n tree = tree || node\n if (err) {\n reject(err)\n } else if (resolve) {\n resolve(tree)\n } else {\n cb(null, tree, file)\n }\n }\n }\n }\n\n /* Run transforms on a Unist node representation of a file\n * (in string or VFile representation), sync. */\n function runSync(node, file) {\n var complete = false\n var result\n\n run(node, file, done)\n\n assertDone('runSync', 'run', complete)\n\n return result\n\n function done(err, tree) {\n complete = true\n bail(err)\n result = tree\n }\n }\n\n /* Stringify a Unist node representation of a file\n * (in string or VFile representation) into a string\n * using the `Compiler` on the processor. */\n function stringify(node, doc) {\n var file = vfile(doc)\n var Compiler\n\n freeze()\n Compiler = processor.Compiler\n assertCompiler('stringify', Compiler)\n assertNode(node)\n\n if (newable(Compiler)) {\n return new Compiler(node, file).compile()\n }\n\n return Compiler(node, file) // eslint-disable-line new-cap\n }\n\n /* Parse a file (in string or VFile representation)\n * into a Unist node using the `Parser` on the processor,\n * then run transforms on that node, and compile the\n * resulting node using the `Compiler` on the processor,\n * and store that result on the VFile. */\n function process(doc, cb) {\n freeze()\n assertParser('process', processor.Parser)\n assertCompiler('process', processor.Compiler)\n\n if (!cb) {\n return new Promise(executor)\n }\n\n executor(null, cb)\n\n function executor(resolve, reject) {\n var file = vfile(doc)\n\n pipeline.run(processor, {file: file}, done)\n\n function done(err) {\n if (err) {\n reject(err)\n } else if (resolve) {\n resolve(file)\n } else {\n cb(null, file)\n }\n }\n }\n }\n\n /* Process the given document (in string or VFile\n * representation), sync. */\n function processSync(doc) {\n var complete = false\n var file\n\n freeze()\n assertParser('processSync', processor.Parser)\n assertCompiler('processSync', processor.Compiler)\n file = vfile(doc)\n\n process(file, done)\n\n assertDone('processSync', 'process', complete)\n\n return file\n\n function done(err) {\n complete = true\n bail(err)\n }\n }\n}", "function unified() {\n var attachers = []\n var transformers = trough()\n var namespace = {}\n var frozen = false\n var freezeIndex = -1\n\n /* Data management. */\n processor.data = data\n\n /* Lock. */\n processor.freeze = freeze\n\n /* Plug-ins. */\n processor.attachers = attachers\n processor.use = use\n\n /* API. */\n processor.parse = parse\n processor.stringify = stringify\n processor.run = run\n processor.runSync = runSync\n processor.process = process\n processor.processSync = processSync\n\n /* Expose. */\n return processor\n\n /* Create a new processor based on the processor\n * in the current scope. */\n function processor() {\n var destination = unified()\n var length = attachers.length\n var index = -1\n\n while (++index < length) {\n destination.use.apply(null, attachers[index])\n }\n\n destination.data(extend(true, {}, namespace))\n\n return destination\n }\n\n /* Freeze: used to signal a processor that has finished\n * configuration.\n *\n * For example, take unified itself. It’s frozen.\n * Plug-ins should not be added to it. Rather, it should\n * be extended, by invoking it, before modifying it.\n *\n * In essence, always invoke this when exporting a\n * processor. */\n function freeze() {\n var values\n var plugin\n var options\n var transformer\n\n if (frozen) {\n return processor\n }\n\n while (++freezeIndex < attachers.length) {\n values = attachers[freezeIndex]\n plugin = values[0]\n options = values[1]\n transformer = null\n\n if (options === false) {\n continue\n }\n\n if (options === true) {\n values[1] = undefined\n }\n\n transformer = plugin.apply(processor, values.slice(1))\n\n if (typeof transformer === 'function') {\n transformers.use(transformer)\n }\n }\n\n frozen = true\n freezeIndex = Infinity\n\n return processor\n }\n\n /* Data management.\n * Getter / setter for processor-specific informtion. */\n function data(key, value) {\n if (string(key)) {\n /* Set `key`. */\n if (arguments.length === 2) {\n assertUnfrozen('data', frozen)\n\n namespace[key] = value\n\n return processor\n }\n\n /* Get `key`. */\n return (own.call(namespace, key) && namespace[key]) || null\n }\n\n /* Set space. */\n if (key) {\n assertUnfrozen('data', frozen)\n namespace = key\n return processor\n }\n\n /* Get space. */\n return namespace\n }\n\n /* Plug-in management.\n *\n * Pass it:\n * * an attacher and options,\n * * a preset,\n * * a list of presets, attachers, and arguments (list\n * of attachers and options). */\n function use(value) {\n var settings\n\n assertUnfrozen('use', frozen)\n\n if (value === null || value === undefined) {\n /* Empty */\n } else if (typeof value === 'function') {\n addPlugin.apply(null, arguments)\n } else if (typeof value === 'object') {\n if ('length' in value) {\n addList(value)\n } else {\n addPreset(value)\n }\n } else {\n throw new Error('Expected usable value, not `' + value + '`')\n }\n\n if (settings) {\n namespace.settings = extend(namespace.settings || {}, settings)\n }\n\n return processor\n\n function addPreset(result) {\n addList(result.plugins)\n\n if (result.settings) {\n settings = extend(settings || {}, result.settings)\n }\n }\n\n function add(value) {\n if (typeof value === 'function') {\n addPlugin(value)\n } else if (typeof value === 'object') {\n if ('length' in value) {\n addPlugin.apply(null, value)\n } else {\n addPreset(value)\n }\n } else {\n throw new Error('Expected usable value, not `' + value + '`')\n }\n }\n\n function addList(plugins) {\n var length\n var index\n\n if (plugins === null || plugins === undefined) {\n /* Empty */\n } else if (typeof plugins === 'object' && 'length' in plugins) {\n length = plugins.length\n index = -1\n\n while (++index < length) {\n add(plugins[index])\n }\n } else {\n throw new Error('Expected a list of plugins, not `' + plugins + '`')\n }\n }\n\n function addPlugin(plugin, value) {\n var entry = find(plugin)\n\n if (entry) {\n if (plain(entry[1]) && plain(value)) {\n value = extend(entry[1], value)\n }\n\n entry[1] = value\n } else {\n attachers.push(slice.call(arguments))\n }\n }\n }\n\n function find(plugin) {\n var length = attachers.length\n var index = -1\n var entry\n\n while (++index < length) {\n entry = attachers[index]\n\n if (entry[0] === plugin) {\n return entry\n }\n }\n }\n\n /* Parse a file (in string or VFile representation)\n * into a Unist node using the `Parser` on the\n * processor. */\n function parse(doc) {\n var file = vfile(doc)\n var Parser\n\n freeze()\n Parser = processor.Parser\n assertParser('parse', Parser)\n\n if (newable(Parser)) {\n return new Parser(String(file), file).parse()\n }\n\n return Parser(String(file), file) // eslint-disable-line new-cap\n }\n\n /* Run transforms on a Unist node representation of a file\n * (in string or VFile representation), async. */\n function run(node, file, cb) {\n assertNode(node)\n freeze()\n\n if (!cb && typeof file === 'function') {\n cb = file\n file = null\n }\n\n if (!cb) {\n return new Promise(executor)\n }\n\n executor(null, cb)\n\n function executor(resolve, reject) {\n transformers.run(node, vfile(file), done)\n\n function done(err, tree, file) {\n tree = tree || node\n if (err) {\n reject(err)\n } else if (resolve) {\n resolve(tree)\n } else {\n cb(null, tree, file)\n }\n }\n }\n }\n\n /* Run transforms on a Unist node representation of a file\n * (in string or VFile representation), sync. */\n function runSync(node, file) {\n var complete = false\n var result\n\n run(node, file, done)\n\n assertDone('runSync', 'run', complete)\n\n return result\n\n function done(err, tree) {\n complete = true\n bail(err)\n result = tree\n }\n }\n\n /* Stringify a Unist node representation of a file\n * (in string or VFile representation) into a string\n * using the `Compiler` on the processor. */\n function stringify(node, doc) {\n var file = vfile(doc)\n var Compiler\n\n freeze()\n Compiler = processor.Compiler\n assertCompiler('stringify', Compiler)\n assertNode(node)\n\n if (newable(Compiler)) {\n return new Compiler(node, file).compile()\n }\n\n return Compiler(node, file) // eslint-disable-line new-cap\n }\n\n /* Parse a file (in string or VFile representation)\n * into a Unist node using the `Parser` on the processor,\n * then run transforms on that node, and compile the\n * resulting node using the `Compiler` on the processor,\n * and store that result on the VFile. */\n function process(doc, cb) {\n freeze()\n assertParser('process', processor.Parser)\n assertCompiler('process', processor.Compiler)\n\n if (!cb) {\n return new Promise(executor)\n }\n\n executor(null, cb)\n\n function executor(resolve, reject) {\n var file = vfile(doc)\n\n pipeline.run(processor, {file: file}, done)\n\n function done(err) {\n if (err) {\n reject(err)\n } else if (resolve) {\n resolve(file)\n } else {\n cb(null, file)\n }\n }\n }\n }\n\n /* Process the given document (in string or VFile\n * representation), sync. */\n function processSync(doc) {\n var complete = false\n var file\n\n freeze()\n assertParser('processSync', processor.Parser)\n assertCompiler('processSync', processor.Compiler)\n file = vfile(doc)\n\n process(file, done)\n\n assertDone('processSync', 'process', complete)\n\n return file\n\n function done(err) {\n complete = true\n bail(err)\n }\n }\n}", "function unified$1() {\n var attachers = [];\n var transformers = trough();\n var namespace = {};\n var freezeIndex = -1;\n var frozen;\n\n // Data management.\n processor.data = data;\n\n // Lock.\n processor.freeze = freeze;\n\n // Plugins.\n processor.attachers = attachers;\n processor.use = use;\n\n // API.\n processor.parse = parse;\n processor.stringify = stringify;\n processor.run = run;\n processor.runSync = runSync;\n processor.process = process;\n processor.processSync = processSync;\n\n // Expose.\n return processor\n\n // Create a new processor based on the processor in the current scope.\n function processor() {\n var destination = unified$1();\n var index = -1;\n\n while (++index < attachers.length) {\n destination.use.apply(null, attachers[index]);\n }\n\n destination.data(extend$1(true, {}, namespace));\n\n return destination\n }\n\n // Freeze: used to signal a processor that has finished configuration.\n //\n // For example, take unified itself: it’s frozen.\n // Plugins should not be added to it.\n // Rather, it should be extended, by invoking it, before modifying it.\n //\n // In essence, always invoke this when exporting a processor.\n function freeze() {\n var values;\n var transformer;\n\n if (frozen) {\n return processor\n }\n\n while (++freezeIndex < attachers.length) {\n values = attachers[freezeIndex];\n\n if (values[1] === false) {\n continue\n }\n\n if (values[1] === true) {\n values[1] = undefined;\n }\n\n transformer = values[0].apply(processor, values.slice(1));\n\n if (typeof transformer === 'function') {\n transformers.use(transformer);\n }\n }\n\n frozen = true;\n freezeIndex = Infinity;\n\n return processor\n }\n\n // Data management.\n // Getter / setter for processor-specific informtion.\n function data(key, value) {\n if (typeof key === 'string') {\n // Set `key`.\n if (arguments.length === 2) {\n assertUnfrozen('data', frozen);\n namespace[key] = value;\n return processor\n }\n\n // Get `key`.\n return (own$b.call(namespace, key) && namespace[key]) || null\n }\n\n // Set space.\n if (key) {\n assertUnfrozen('data', frozen);\n namespace = key;\n return processor\n }\n\n // Get space.\n return namespace\n }\n\n // Plugin management.\n //\n // Pass it:\n // * an attacher and options,\n // * a preset,\n // * a list of presets, attachers, and arguments (list of attachers and\n // options).\n function use(value) {\n var settings;\n\n assertUnfrozen('use', frozen);\n\n if (value === null || value === undefined) ; else if (typeof value === 'function') {\n addPlugin.apply(null, arguments);\n } else if (typeof value === 'object') {\n if ('length' in value) {\n addList(value);\n } else {\n addPreset(value);\n }\n } else {\n throw new Error('Expected usable value, not `' + value + '`')\n }\n\n if (settings) {\n namespace.settings = extend$1(namespace.settings || {}, settings);\n }\n\n return processor\n\n function addPreset(result) {\n addList(result.plugins);\n\n if (result.settings) {\n settings = extend$1(settings || {}, result.settings);\n }\n }\n\n function add(value) {\n if (typeof value === 'function') {\n addPlugin(value);\n } else if (typeof value === 'object') {\n if ('length' in value) {\n addPlugin.apply(null, value);\n } else {\n addPreset(value);\n }\n } else {\n throw new Error('Expected usable value, not `' + value + '`')\n }\n }\n\n function addList(plugins) {\n var index = -1;\n\n if (plugins === null || plugins === undefined) ; else if (typeof plugins === 'object' && 'length' in plugins) {\n while (++index < plugins.length) {\n add(plugins[index]);\n }\n } else {\n throw new Error('Expected a list of plugins, not `' + plugins + '`')\n }\n }\n\n function addPlugin(plugin, value) {\n var entry = find(plugin);\n\n if (entry) {\n if (plain(entry[1]) && plain(value)) {\n value = extend$1(true, entry[1], value);\n }\n\n entry[1] = value;\n } else {\n attachers.push(slice$1.call(arguments));\n }\n }\n }\n\n function find(plugin) {\n var index = -1;\n\n while (++index < attachers.length) {\n if (attachers[index][0] === plugin) {\n return attachers[index]\n }\n }\n }\n\n // Parse a file (in string or vfile representation) into a unist node using\n // the `Parser` on the processor.\n function parse(doc) {\n var file = vfile(doc);\n var Parser;\n\n freeze();\n Parser = processor.Parser;\n assertParser('parse', Parser);\n\n if (newable(Parser, 'parse')) {\n return new Parser(String(file), file).parse()\n }\n\n return Parser(String(file), file) // eslint-disable-line new-cap\n }\n\n // Run transforms on a unist node representation of a file (in string or\n // vfile representation), async.\n function run(node, file, cb) {\n assertNode(node);\n freeze();\n\n if (!cb && typeof file === 'function') {\n cb = file;\n file = null;\n }\n\n if (!cb) {\n return new Promise(executor)\n }\n\n executor(null, cb);\n\n function executor(resolve, reject) {\n transformers.run(node, vfile(file), done);\n\n function done(error, tree, file) {\n tree = tree || node;\n if (error) {\n reject(error);\n } else if (resolve) {\n resolve(tree);\n } else {\n cb(null, tree, file);\n }\n }\n }\n }\n\n // Run transforms on a unist node representation of a file (in string or\n // vfile representation), sync.\n function runSync(node, file) {\n var result;\n var complete;\n\n run(node, file, done);\n\n assertDone('runSync', 'run', complete);\n\n return result\n\n function done(error, tree) {\n complete = true;\n result = tree;\n bail(error);\n }\n }\n\n // Stringify a unist node representation of a file (in string or vfile\n // representation) into a string using the `Compiler` on the processor.\n function stringify(node, doc) {\n var file = vfile(doc);\n var Compiler;\n\n freeze();\n Compiler = processor.Compiler;\n assertCompiler('stringify', Compiler);\n assertNode(node);\n\n if (newable(Compiler, 'compile')) {\n return new Compiler(node, file).compile()\n }\n\n return Compiler(node, file) // eslint-disable-line new-cap\n }\n\n // Parse a file (in string or vfile representation) into a unist node using\n // the `Parser` on the processor, then run transforms on that node, and\n // compile the resulting node using the `Compiler` on the processor, and\n // store that result on the vfile.\n function process(doc, cb) {\n freeze();\n assertParser('process', processor.Parser);\n assertCompiler('process', processor.Compiler);\n\n if (!cb) {\n return new Promise(executor)\n }\n\n executor(null, cb);\n\n function executor(resolve, reject) {\n var file = vfile(doc);\n\n pipeline.run(processor, {file: file}, done);\n\n function done(error) {\n if (error) {\n reject(error);\n } else if (resolve) {\n resolve(file);\n } else {\n cb(null, file);\n }\n }\n }\n }\n\n // Process the given document (in string or vfile representation), sync.\n function processSync(doc) {\n var file;\n var complete;\n\n freeze();\n assertParser('processSync', processor.Parser);\n assertCompiler('processSync', processor.Compiler);\n file = vfile(doc);\n\n process(file, done);\n\n assertDone('processSync', 'process', complete);\n\n return file\n\n function done(error) {\n complete = true;\n bail(error);\n }\n }\n}", "function unified() {\n var attachers = [];\n var transformers = trough();\n var namespace = {};\n var frozen = false;\n var freezeIndex = -1;\n\n /* Data management. */\n processor.data = data;\n\n /* Lock. */\n processor.freeze = freeze;\n\n /* Plug-ins. */\n processor.attachers = attachers;\n processor.use = use;\n\n /* API. */\n processor.parse = parse;\n processor.stringify = stringify;\n processor.run = run;\n processor.runSync = runSync;\n processor.process = process;\n processor.processSync = processSync;\n\n /* Expose. */\n return processor;\n\n /* Create a new processor based on the processor\n * in the current scope. */\n function processor() {\n var destination = unified();\n var length = attachers.length;\n var index = -1;\n\n while (++index < length) {\n destination.use.apply(null, attachers[index]);\n }\n\n destination.data(extend(true, {}, namespace));\n\n return destination;\n }\n\n /* Freeze: used to signal a processor that has finished\n * configuration.\n *\n * For example, take unified itself. It’s frozen.\n * Plug-ins should not be added to it. Rather, it should\n * be extended, by invoking it, before modifying it.\n *\n * In essence, always invoke this when exporting a\n * processor. */\n function freeze() {\n var values;\n var plugin;\n var options;\n var transformer;\n\n if (frozen) {\n return processor;\n }\n\n while (++freezeIndex < attachers.length) {\n values = attachers[freezeIndex];\n plugin = values[0];\n options = values[1];\n transformer = null;\n\n if (options === false) {\n continue;\n }\n\n if (options === true) {\n values[1] = undefined;\n }\n\n transformer = plugin.apply(processor, values.slice(1));\n\n if (func(transformer)) {\n transformers.use(transformer);\n }\n }\n\n frozen = true;\n freezeIndex = Infinity;\n\n return processor;\n }\n\n /* Data management.\n * Getter / setter for processor-specific informtion. */\n function data(key, value) {\n if (string(key)) {\n /* Set `key`. */\n if (arguments.length === 2) {\n assertUnfrozen('data', frozen);\n\n namespace[key] = value;\n\n return processor;\n }\n\n /* Get `key`. */\n return (own.call(namespace, key) && namespace[key]) || null;\n }\n\n /* Set space. */\n if (key) {\n assertUnfrozen('data', frozen);\n namespace = key;\n return processor;\n }\n\n /* Get space. */\n return namespace;\n }\n\n /* Plug-in management.\n *\n * Pass it:\n * * an attacher and options,\n * * a preset,\n * * a list of presets, attachers, and arguments (list\n * of attachers and options). */\n function use(value) {\n var settings;\n\n assertUnfrozen('use', frozen);\n\n if (value === null || value === undefined) {\n /* Empty */\n } else if (func(value)) {\n addPlugin.apply(null, arguments);\n } else if (typeof value === 'object') {\n if ('length' in value) {\n addList(value);\n } else {\n addPreset(value);\n }\n } else {\n throw new Error('Expected usable value, not `' + value + '`');\n }\n\n if (settings) {\n namespace.settings = extend(namespace.settings || {}, settings);\n }\n\n return processor;\n\n function addPreset(result) {\n addList(result.plugins);\n\n if (result.settings) {\n settings = extend(settings || {}, result.settings);\n }\n }\n\n function add(value) {\n if (func(value)) {\n addPlugin(value);\n } else if (typeof value === 'object') {\n if ('length' in value) {\n addPlugin.apply(null, value);\n } else {\n addPreset(value);\n }\n } else {\n throw new Error('Expected usable value, not `' + value + '`');\n }\n }\n\n function addList(plugins) {\n var length;\n var index;\n\n if (plugins === null || plugins === undefined) {\n /* Empty */\n } else if (typeof plugins === 'object' && 'length' in plugins) {\n length = plugins.length;\n index = -1;\n\n while (++index < length) {\n add(plugins[index]);\n }\n } else {\n throw new Error('Expected a list of plugins, not `' + plugins + '`');\n }\n }\n\n function addPlugin(plugin, value) {\n var entry = find(plugin);\n\n if (entry) {\n if (plain(entry[1]) && plain(value)) {\n value = extend(entry[1], value);\n }\n\n entry[1] = value;\n } else {\n attachers.push(slice.call(arguments));\n }\n }\n }\n\n function find(plugin) {\n var length = attachers.length;\n var index = -1;\n var entry;\n\n while (++index < length) {\n entry = attachers[index];\n\n if (entry[0] === plugin) {\n return entry;\n }\n }\n }\n\n /* Parse a file (in string or VFile representation)\n * into a Unist node using the `Parser` on the\n * processor. */\n function parse(doc) {\n var file = vfile(doc);\n var Parser;\n\n freeze();\n Parser = processor.Parser;\n assertParser('parse', Parser);\n\n if (newable(Parser)) {\n return new Parser(String(file), file).parse();\n }\n\n return Parser(String(file), file); // eslint-disable-line new-cap\n }\n\n /* Run transforms on a Unist node representation of a file\n * (in string or VFile representation), async. */\n function run(node, file, cb) {\n assertNode(node);\n freeze();\n\n if (!cb && func(file)) {\n cb = file;\n file = null;\n }\n\n if (!cb) {\n return new Promise(executor);\n }\n\n executor(null, cb);\n\n function executor(resolve, reject) {\n transformers.run(node, vfile(file), done);\n\n function done(err, tree, file) {\n tree = tree || node;\n if (err) {\n reject(err);\n } else if (resolve) {\n resolve(tree);\n } else {\n cb(null, tree, file);\n }\n }\n }\n }\n\n /* Run transforms on a Unist node representation of a file\n * (in string or VFile representation), sync. */\n function runSync(node, file) {\n var complete = false;\n var result;\n\n run(node, file, done);\n\n assertDone('runSync', 'run', complete);\n\n return result;\n\n function done(err, tree) {\n complete = true;\n bail(err);\n result = tree;\n }\n }\n\n /* Stringify a Unist node representation of a file\n * (in string or VFile representation) into a string\n * using the `Compiler` on the processor. */\n function stringify(node, doc) {\n var file = vfile(doc);\n var Compiler;\n\n freeze();\n Compiler = processor.Compiler;\n assertCompiler('stringify', Compiler);\n assertNode(node);\n\n if (newable(Compiler)) {\n return new Compiler(node, file).compile();\n }\n\n return Compiler(node, file); // eslint-disable-line new-cap\n }\n\n /* Parse a file (in string or VFile representation)\n * into a Unist node using the `Parser` on the processor,\n * then run transforms on that node, and compile the\n * resulting node using the `Compiler` on the processor,\n * and store that result on the VFile. */\n function process(doc, cb) {\n freeze();\n assertParser('process', processor.Parser);\n assertCompiler('process', processor.Compiler);\n\n if (!cb) {\n return new Promise(executor);\n }\n\n executor(null, cb);\n\n function executor(resolve, reject) {\n var file = vfile(doc);\n\n pipeline.run(processor, {file: file}, done);\n\n function done(err) {\n if (err) {\n reject(err);\n } else if (resolve) {\n resolve(file);\n } else {\n cb(null, file);\n }\n }\n }\n }\n\n /* Process the given document (in string or VFile\n * representation), sync. */\n function processSync(doc) {\n var complete = false;\n var file;\n\n freeze();\n assertParser('processSync', processor.Parser);\n assertCompiler('processSync', processor.Compiler);\n file = vfile(doc);\n\n process(file, done);\n\n assertDone('processSync', 'process', complete);\n\n return file;\n\n function done(err) {\n complete = true;\n bail(err);\n }\n }\n}", "register(processType) { this.register_(processType) }", "onCreatedPreProcessor(preprocessor) {}", "function CreateStreamProcessorCommand(input) {\n var _this = \n // Start section: command_constructor\n _super.call(this) || this;\n _this.input = input;\n return _this;\n // End section: command_constructor\n }", "function DeviceProcessor() {\n\tvar builder = new processor.Chain();\n\tbuilder.Add(save_flags);\n\tbuilder.Add(strip_syslog_priority);\n\tbuilder.Add(chain1);\n\tbuilder.Add(populate_fields);\n\tbuilder.Add(restore_flags);\n\tvar chain = builder.Build();\n\treturn {\n\t\tprocess: chain.Run,\n\t}\n}", "function DeviceProcessor() {\n\tvar builder = new processor.Chain();\n\tbuilder.Add(save_flags);\n\tbuilder.Add(strip_syslog_priority);\n\tbuilder.Add(chain1);\n\tbuilder.Add(populate_fields);\n\tbuilder.Add(restore_flags);\n\tvar chain = builder.Build();\n\treturn {\n\t\tprocess: chain.Run,\n\t}\n}", "function DeviceProcessor() {\n\tvar builder = new processor.Chain();\n\tbuilder.Add(save_flags);\n\tbuilder.Add(strip_syslog_priority);\n\tbuilder.Add(chain1);\n\tbuilder.Add(populate_fields);\n\tbuilder.Add(restore_flags);\n\tvar chain = builder.Build();\n\treturn {\n\t\tprocess: chain.Run,\n\t}\n}", "on_assign_processor() {\n }", "function CommandProcessor(controller) {\n this.controller = controller;\n}", "configureProprocessor(name, options) {\n this.config[name] = Object.assign({}, this.config[name], options)\n return this\n }", "function ProcessController() {}", "assign_processor(processor_id) {\n this.processor_id = processor_id\n\n this._refresh_source_icon()\n\n this.on_assign_processor()\n\n // Now that we have a processor/source, refresh\n this.viewer.refresh_widget(this)\n }", "function processor() {\n var destination = unified()\n var index = -1\n\n while (++index < attachers.length) {\n destination.use.apply(null, attachers[index])\n }\n\n destination.data(extend(true, {}, namespace))\n\n return destination\n }", "function processor() {\n var destination = unified()\n var index = -1\n\n while (++index < attachers.length) {\n destination.use.apply(null, attachers[index])\n }\n\n destination.data(extend(true, {}, namespace))\n\n return destination\n }", "function createProcess(process) {\n return ProcessModel.create(process);\n}", "function processor() {\n var destination = unified$1();\n var index = -1;\n\n while (++index < attachers.length) {\n destination.use.apply(null, attachers[index]);\n }\n\n destination.data(extend$1(true, {}, namespace));\n\n return destination\n }", "createProducer (structureType, tile) {\n var sType = this.checkStructureType(structureType)\n\n var producer = sType.type === 'refinery'\n ? this.createRefiner(sType.buysFrom, sType.multiplier, sType.reach, tile)\n : this.createPrimaryProducer(sType, tile)\n\n return new AllDecorator({producer: producer, tile: tile})\n }", "compute (name /*, ...processors */) {\n let processors = toArray(arguments, 1)\n\n return pipeline(this.lookup(name)(), processors, this.state)\n }", "function Processor(proc, host){\n var processes = proc || [], locked = 0, i = 0,\n\n /* Functional methods to manipulate DataBus processing workflow */\n fns = {\n /* Continue processing with @data */\n $continue: function(data){\n return self.tick(data);\n },\n /* Break processing */\n $break: function(){\n return self.tick({}, 1);\n },\n /* Locks DataBus evaluation */\n $lock: function(){\n return locked = 1;\n },\n /* Unlocks DataBus evaluation */\n $unlock: function(){\n return locked = 0;\n },\n $update: function(){\n host.update();\n },\n /* Returns current DataBus */\n $host: function(){\n return host;\n }\n };\n \n var self = {\n /* Add process if @p exists or return all processes of this Processor */\n process : function(p){\n return Utils.is.exist(p) ? processes.push(p) : processes;\n },\n\n /* Start processing */\n start : function(event, context, fin){\n self.ctx = context;\n self.fin = fin; \n \n i = locked ? 0 : i;\n \n if(i==processes.length){\n i = 0;\n return fin(event);\n }\n\n this.tick(event);\n },\n\n /* Ticking processor to the next process */\n tick : function(event, breaked){ \n if(breaked){\n return i = 0;\n }\n \n if(i==processes.length){\n i = 0;\n return self.fin(event);\n }\n\n i++; \n processes[i-1].apply(self.ctx, [event, fns]);\n \n }\n }\n return self;\n }", "function processor() {\n var destination = unified();\n var length = attachers.length;\n var index = -1;\n\n while (++index < length) {\n destination.use.apply(null, attachers[index]);\n }\n\n destination.data(extend(true, {}, namespace));\n\n return destination;\n }", "function StartStreamProcessorCommand(input) {\n var _this = \n // Start section: command_constructor\n _super.call(this) || this;\n _this.input = input;\n return _this;\n // End section: command_constructor\n }", "function Proc() {}", "function handleNewProcess(channel, peerUuid){\n debugProcesses(\"New Process\", peerUuid);\n processes[peerUuid] = new Process(peerUuid);\n}", "setProc(proc) {\nthis._proc = proc;\nreturn this;\n}", "function InlineWorkerFactory(){\n\t}", "getProc(token, proc, procExpression, procIdentifier) {\nif (procExpression === t.LEXEME_SUPER) {\nif (!this._scope.getSuper()) {\nthrow errors.createError(err.NO_SUPER_PROC_FOUND, token, 'No super proc found.');\n}\nreturn this._scope.getSuper();\n}\nif (proc instanceof Proc) {\nreturn proc;\n}\nif ((procIdentifier instanceof Var) && procIdentifier.getAssignedProc()) {\nreturn procIdentifier.getAssignedProc();\n}\nlet program = this._program;\nlet codeUsed = program.getCodeUsed();\nprogram.setCodeUsed(false);\nthis._varExpression.compileExpressionToRegister({\nidentifier: procIdentifier,\nexpression: procExpression,\nreg: $.REG_PTR\n});\nprogram.setCodeUsed(codeUsed);\nreturn this._varExpression.getLastProcField();\n}", "static create(params) {\n return {type: `${this.prefix}${this.name}`, _instance: new this(params)}; //eslint-disable-line\n }", "static register(type) {\n if(OS.kernel) OS.kernel.register(type);\n else processTypes.push(type);\n }", "createProcesses() {\n Object.keys(this.workers).forEach(type => {\n const env = {\n 'type': type,\n 'verbose': config.verbose,\n };\n this.workers[type] = this.fork(type, env);\n });\n }", "useDefaultPostProcessor(){\n this._postProcessor = new UrlProcessor();\n return this;\n }", "function createCiteproc(citeprocJSONObject, citeprocSys, citeprocStyle){\n\t\tvar defaultCiteprocSys = {\n\t\t retrieveItem: function(id){\n\t\t return citeprocJSONObject.citationItems[id];\n\t\t },\n\t\t retrieveLocale: function(lang){\n\t\t return defaultLocale[lang];\n\t\t }\n\t\t}\n\t\tif (!citeprocSys)\n\t\t\tciteprocSys = defaultCiteprocSys;\n\t\tif (!citeprocStyle)\n\t\t\tciteprocStyle = styleChigcagoAD;\t\t\n\t\treturn new CSL.Engine( citeprocSys, citeprocStyle );\n\t}", "newInstance() {\r\n\t\t\t\t\tvar base, ref1;\r\n\t\t\t\t\tbase = ((ref1 = this.variable) != null ? ref1.base : void 0) || this.variable;\r\n\t\t\t\t\tif (base instanceof Call && !base.isNew) {\r\n\t\t\t\t\t\tbase.newInstance();\r\n\t\t\t\t\t} else {\r\n\t\t\t\t\t\tthis.isNew = true;\r\n\t\t\t\t\t}\r\n\t\t\t\t\tthis.needsUpdatedStartLocation = true;\r\n\t\t\t\t\treturn this;\r\n\t\t\t\t}", "parse(parser) {\n this._processor = this._process(parser);\n this._processor.next();\n }", "processInit() {\n // if worker not use require it may not have setExecuteFn\n if (this.service.setExecuteFn) {\n this.service.setExecuteFn(this.proxyUpcomingExecute)\n }\n // HACK simplify states\n this.state = WORKERS_STATES.ready\n return this\n }", "addProcess(process) {\n if (this.processes.has(process.processName)) {\n throw Error('Process with name: ' + process.processName + ' already defined.');\n } else {\n this.processes.set(process.processName, process);\n }\n return process;\n }", "create(props){\n const obj = {type: this.name};\n\n Object.keys(this.props).forEach((prop) => {\n obj[prop] = props[prop];\n\n // If not primitive type\n // if(this.props[prop].rel !== undefined){\n // types[this.props[prop].type].create(props[prop]);\n // }\n // // Create new instance of type and add relationship\n // this.props[prop].create = (obj) => types[prop.type].create(obj);\n //\n // // Fetch existing instance of type and add relationship\n // this.props[prop].link = (obj) => types[prop.type].link(obj);\n // }\n });\n\n return obj;\n }", "constructor() { \n \n ProcessDefinitionDto.initialize(this);\n }", "function makeComputer(maker, Processor, Ram, HardDisc) {\n return {\n\t\tmaker : maker,\n\t\tProcessor : Processor,\n\t\tRam : Ram,\n\t\tHardDisc : HardDisc\n\t};\n}", "function build_processor_config(el){\n\n var select \t\t\t= $(el),\n templ\t\t\t= $('#' + select.val() + '-tmpl').length ? $('#' + select.val() + '-tmpl').html() : '',\n parent\t\t\t= select.closest('.caldera-editor-processor-config-wrapper'),\n target\t\t\t= parent.find('.caldera-config-processor-setup'),\n template \t\t= Handlebars.compile(templ),\n config\t\t\t= parent.find('.processor_config_string').val(),\n current_type\t= select.data('type');\n\n // Be sure to load the processors preset when switching back to the initial processor type.\n if(config.length && current_type === select.val() ){\n config = JSON.parse(config);\n }else{\n // default config\n config = processor_defaults[select.val() + '_cfg'];\n }\n\n // build template\n if(!config){\n config = {};\n }\n\n config._id = parent.prop('id');\n config._name = 'config[processors][' + parent.prop('id') + '][config]';\n\n\n\n\n template = $('<div>').html( template( config ) );\n\n // send to target\n target.html( template.html() );\n\n // check for init function\n if( typeof window[select.val() + '_init'] === 'function' ){\n window[select.val() + '_init'](parent.prop('id'), target);\n }\n\n // check if conditions are allowed\n if(parent.find('.no-conditions').length){\n // conditions are not supported - remove them\n parent.find('.toggle_option_tab').remove();\n }\n\n\n rebuild_field_binding();\n baldrickTriggers();\n\n // initialise baldrick triggers\n $('.wp-baldrick').baldrick({\n request : cfAdminAJAX,\n method : 'POST',\n before\t\t: function(el){\n\n var tr = $(el);\n\n if( tr.data('addNode') && !tr.data('request') ){\n tr.data('request', 'cf_get_default_setting');\n }\n }\n });\n\n }", "static _fromCloudFormation(scope, id, resourceAttributes, options) {\n resourceAttributes = resourceAttributes || {};\n const resourceProperties = options.parser.parseValue(resourceAttributes.Properties);\n const propsResult = CfnPipelinePropsFromCloudFormation(resourceProperties);\n const ret = new CfnPipeline(scope, id, propsResult.value);\n for (const [propKey, propVal] of Object.entries(propsResult.extraProperties)) {\n ret.addPropertyOverride(propKey, propVal);\n }\n options.parser.handleAttributes(ret, resourceAttributes, id);\n return ret;\n }", "static _fromCloudFormation(scope, id, resourceAttributes, options) {\n resourceAttributes = resourceAttributes || {};\n const resourceProperties = options.parser.parseValue(resourceAttributes.Properties);\n const propsResult = CfnPipelinePropsFromCloudFormation(resourceProperties);\n const ret = new CfnPipeline(scope, id, propsResult.value);\n for (const [propKey, propVal] of Object.entries(propsResult.extraProperties)) {\n ret.addPropertyOverride(propKey, propVal);\n }\n options.parser.handleAttributes(ret, resourceAttributes, id);\n return ret;\n }", "function VMFactory() {}", "function ProcessingTypeViewerFactory(EntityViewer) {\n\n function ProcessingTypeViewer(processingType) {\n var entityViewer = new EntityViewer(processingType, 'Processing Type');\n\n entityViewer.addAttribute('Name', processingType.name);\n entityViewer.addAttribute('Description', processingType.description);\n entityViewer.addAttribute('Enabled', processingType.enabled ? 'Yes' : 'No');\n\n entityViewer.showModal();\n }\n\n return ProcessingTypeViewer;\n }", "createResolver(props) {\n return new resolver_1.Resolver(this, `${props.typeName}${props.fieldName}Resolver`, {\n api: this,\n ...props,\n });\n }", "create (key) {\n if (_cores.has(key)) {\n return _cores.get(key)\n } else {\n _cores.set(key, new Map())\n return _cores.get(key)\n }\n }", "async createNewInstance() {\n const adapters = this.processAdapters();\n const datastores = this.api.config.models.datastores;\n const models = await this.loadModels();\n\n const ormStart = promisify(Waterline.start);\n\n this.waterline = await ormStart({\n adapters,\n datastores,\n models,\n });\n }", "function processorIDRegister() // ./common/cpu.js:290\n{ // ./common/cpu.js:291\n\t// all fields are read only by software // ./common/cpu.js:292\n\tthis.R = 0; // bits 31:24 // ./common/cpu.js:293\n\tthis.companyID = 1; // bits 23:16 // ./common/cpu.js:294\n\tthis.processorID = 128; // bits 15:8, (128 for 4kc) // ./common/cpu.js:295\n\tthis.revision = 11; // bits 7:0, latest version according to manual // ./common/cpu.js:296\n // ./common/cpu.js:297\n\tthis.asUInt32 = function() // ./common/cpu.js:298\n\t{ // ./common/cpu.js:299\n\t\treturn ((this.R << 24) + (this.companyID << 16) + (this.processorID << 8) + this.revision); // ./common/cpu.js:300\n\t} // ./common/cpu.js:301\n // ./common/cpu.js:302\n\tthis.putUInt32 = function(value) // ./common/cpu.js:303\n\t{ // ./common/cpu.js:304\n\t\treturn; // ./common/cpu.js:305\n\t} // ./common/cpu.js:306\n} // ./common/cpu.js:307", "function Process(){}", "process (filepath) {\n\t\tlet {\n\t\t\tchassis,\n\t\t\tgenerateNamespacedSelector,\n\t\t\tisNamespaced,\n\t\t\tnamespaceSelectors,\n\t\t\tprocessImports,\n\t\t\tprocessNesting,\n\t\t\tprocessAtRules,\n\t\t\tprocessMixins,\n\t\t\tprocessNot,\n\t\t\tprocessFunctions,\n\t\t\tstoreAtRules,\n\t\t\ttypographyEngineIsInitialized\n\t\t} = this\n\n\t\tlet {\n\t\t\tatRules,\n\t\t\tpost,\n\t\t\tsettings,\n\t\t\tutils\n\t\t} = chassis\n\n\t\tlet tasks = new NGN.Tasks()\n\t\tlet sourceMap\n\n\t\ttasks.add('Processing Imports', next => {\n\t\t\tif (typographyEngineIsInitialized) {\n\t\t\t\tthis.tree.walkAtRules('import', atRule => {\n\t\t\t\t\tchassis.imports.push(atRule.params)\n\t\t\t\t\tatRule.remove()\n\t\t\t\t})\n\t\t\t}\n\n\t\t\tprocessImports()\n\t\t\tprocessNesting()\n\t\t\tnext()\n\t\t})\n\n\t\ttasks.add('Processing Mixins', next => {\n\t\t\tprocessMixins()\n\t\t\tprocessNot()\n\t\t\tprocessNesting()\n\n\t\t\tnext()\n\t\t})\n\n\t\ttasks.add('Processing Functions', next => {\n\t\t\tprocessFunctions()\n\t\t\tnext()\n\t\t})\n\n\t\ttasks.add('Namespacing Selectors', next => {\n\t\t\tnamespaceSelectors()\n\t\t\tnext()\n\t\t})\n\n\t\tif (typographyEngineIsInitialized) {\n\t\t\ttasks.add('Initializing Typography Engine', next => {\n\t\t\t\tthis.tree = this.core.css.append(this.tree)\n\t\t\t\tnext()\n\t\t\t})\n\t\t}\n\n\t\ttasks.add('Running Post-Processing Routines', next => {\n\t\t\tthis.tree.walkAtRules('chassis-post', atRule => {\n\t\t\t\tlet data = Object.assign({\n\t\t\t\t\troot: this.tree,\n\t\t\t\t\tatRule\n\t\t\t\t}, atRules.getProperties(atRule))\n\n\t\t\t\tpost.process(data)\n\t\t\t})\n\n\t\t\tnext()\n\t\t})\n\n\t\ttasks.add('Processing CSS4 Syntax', next => {\n\t\t\tenv.process(this.tree, {from: filepath}, settings.envCfg).then(processed => {\n\t\t\t\tthis.tree = processed.root\n\t\t\t\tnext()\n\t\t\t}, err => console.error(err))\n\t\t})\n\n\t\t// tasks.add('Merging matching adjacent rules...', next => {\n\t\t// \toutput = mergeAdjacentRules.process(output.toString())\n\t\t// \tnext()\n\t\t// })\n\n\t\ttasks.add('Beautifying Output', next => {\n\t\t\tremoveComments.process(this.tree).then(result => {\n\t\t\t\tperfectionist.process(result.css).then(result => {\n\t\t\t\t\tthis.tree = result.root\n\n\t\t\t\t\t// Remove empty rulesets\n\t\t\t\t\tthis.tree.walkRules(rule => {\n\t\t\t\t\t\tif (rule.nodes.length === 0) {\n\t\t\t\t\t\t\trule.remove()\n\t\t\t\t\t\t\treturn\n\t\t\t\t\t\t}\n\t\t\t\t\t})\n\n\t\t\t\t\tnext()\n\t\t\t\t}, () => {\n\t\t\t\t\tthis.emit('processing.error', new Error('Error Beautifying Output'))\n\t\t\t\t})\n\t\t\t}, () => {\n\t\t\t\tthis.emit('processing.error', new Error('Error Removing Comments'))\n\t\t\t})\n\t\t})\n\n\t\tif (settings.minify) {\n\t\t\tlet minified\n\n\t\t\ttasks.add('Minifying Output', next => {\n\t\t\t\tminified = new CleanCss({\n\t\t\t\t\tsourceMap: settings.sourceMap\n\t\t\t\t}).minify(this.tree.toString())\n\n\t\t\t\tthis.tree = minified.styles\n\t\t\t\tnext()\n\t\t\t})\n\n\t\t\tif (settings.sourceMap) {\n\t\t\t\ttasks.add('Generating source map', next => {\n\t\t\t\t\tsourceMap = minified.sourceMap.toString()\n\t\t\t\t\tnext()\n\t\t\t\t})\n\t\t\t}\n\t\t}\n\n\t\t// tasks.on('taskstart', evt => console.log(`${evt.name}...`))\n\t\t// tasks.on('taskcomplete', evt => console.log('Done.'))\n\n\t\ttasks.on('complete', () => this.emit('processing.complete', {\n\t\t\tcss: this.tree.toString(),\n\t\t\tsourceMap\n\t\t}))\n\n\t\tthis.emit('processing')\n\t\ttasks.run(true)\n\t}", "function m(b,a,c){a=void 0===a?{}:a;c=void 0===c?!1:c;\"function\"===typeof a?(q(\"Legacy constructor was used. See README for latest usage.\",r),a={listener:a,l:c,m:!0,h:{}}):a={listener:a.listener||function(){},l:a.listenToPast||!1,m:void 0===a.processNow?!0:a.processNow,h:a.commandProcessors||{}};this.a=b;this.s=a.listener;this.o=a.l;this.g=this.j=!1;this.c={};this.f=[];this.b=a.h;this.i=t(this);a.m&&this.process()}", "createInstance(type, props, rootContainerInstance, hostContext) {\n return createInstance(type, props, rootContainerInstance, hostContext);\n }", "getExtractor(extractorName) {\n try {\n let Extractor = require('./' + extractorName);\n return new Extractor();\n } catch (e) {\n let BaseExtractor = require('./baseExtractor/BaseExtractor');\n return new BaseExtractor();\n }\n }", "instantiateParser() {\n return new this.ParserClass(this.config);\n }", "function setupScriptProcessor() {\n recorderNode = createRecorderScriptProcessor();\n recorderNode.port.postMessage({ sampleRate, });\n recorderNode.port.onmessage = (data) => {\n switch (data) {\n\n case 'startCapturing':\n dispatch(getActions().recordStart());\n break;\n\n default:\n captureAudio({data});\n }\n };\n source.connect(recorderNode);\n recorderNode.connect(getAudioContext().destination);\n}", "createRuntimeCatalogue() {\n\n let _this = this;\n let factory = {\n createHttpRequest: function() {\n return _this.createHttpRequest();\n }\n };\n\n return new RuntimeCatalogueLocal(factory);\n\n }", "function create(c) {\n return new c();\n}", "function create(c) {\n return new c();\n}", "function create(c) {\n return new c();\n}", "function create(c) {\n return new c();\n}", "function getProcessorMap() {\r\n adminFactory.getprocessors().then(function(res) {\r\n console.log(\"processors res.data\", res.data);\r\n $scope.watchtaskfilter = \"none\";\r\n $scope.processors = res.data;\r\n $scope.nop = Object.keys($scope.processors).length;\r\n }, function(res) {\r\n //error\r\n console.log(\"Failed to get proccessors info error:\", res.data.error);\r\n });\r\n }", "function createPlatform(injector) {\n if (_inPlatformCreate) {\n throw new exceptions_1.BaseException('Already creating a platform...');\n }\n if (lang_1.isPresent(_platform) && !_platform.disposed) {\n throw new exceptions_1.BaseException(\"There can be only one platform. Destroy the previous one to create a new one.\");\n }\n lang_1.lockMode();\n _inPlatformCreate = true;\n try {\n _platform = injector.get(PlatformRef);\n } finally {\n _inPlatformCreate = false;\n }\n return _platform;\n}", "static _fromCloudFormation(scope, id, resourceAttributes, options) {\n resourceAttributes = resourceAttributes || {};\n const resourceProperties = options.parser.parseValue(resourceAttributes.Properties);\n const propsResult = CfnPhoneNumberPropsFromCloudFormation(resourceProperties);\n const ret = new CfnPhoneNumber(scope, id, propsResult.value);\n for (const [propKey, propVal] of Object.entries(propsResult.extraProperties)) {\n ret.addPropertyOverride(propKey, propVal);\n }\n options.parser.handleAttributes(ret, resourceAttributes, id);\n return ret;\n }", "static create () {}", "function Factory() {\r\n this.createProduct = function(type) {\r\n let product;\r\n if (type === \"Phone\") {\r\n product = new Phone();\r\n } else if (type === \"Smartphone\") {\r\n product = new Smartphone();\r\n } else if (type === \"Tablet\") {\r\n product = new Tablet();\r\n } else if (type === \"Notebook\") {\r\n product = new Notebook();\r\n } else if (type === \"Desktop\") {\r\n product = new Desktop();\r\n }\r\n product.type = type\r\n product.info = function () {\r\n return this.type + \" will be build in \" + this.hours + \" hours.\"\r\n }\r\n return product\r\n }\r\n}", "function createPlatform(injector) {\n if (_platform && !_platform.destroyed && !_platform.injector.get(ALLOW_MULTIPLE_PLATFORMS, false)) {\n throw new Error('There can be only one platform. Destroy the previous one to create a new one.');\n }\n\n publishDefaultGlobalUtils$1();\n _platform = injector.get(PlatformRef);\n var inits = injector.get(PLATFORM_INITIALIZER, null);\n if (inits) inits.forEach(function (init) {\n return init();\n });\n return _platform;\n }", "function createPlatform(injector){if(_platform&&!_platform.destroyed&&!_platform.injector.get(ALLOW_MULTIPLE_PLATFORMS,false)){throw new Error('There can be only one platform. Destroy the previous one to create a new one.');}_platform=injector.get(PlatformRef);var inits=injector.get(PLATFORM_INITIALIZER,null);if(inits)inits.forEach(function(init){return init();});return _platform;}", "[types.PROCESS_INSTANCE_PUSH] (state, {instance, id}) {\n // extract stream\n let {stream, ...rest} = instance\n state.instances[id].push(rest)\n // put stream in volatile so changes don't trigger watchers\n volatile.streams[rest.pid] = stream\n }", "static _fromCloudFormation(scope, id, resourceAttributes, options) {\n resourceAttributes = resourceAttributes || {};\n const resourceProperties = options.parser.parseValue(resourceAttributes.Properties);\n const propsResult = CfnContactFlowModulePropsFromCloudFormation(resourceProperties);\n const ret = new CfnContactFlowModule(scope, id, propsResult.value);\n for (const [propKey, propVal] of Object.entries(propsResult.extraProperties)) {\n ret.addPropertyOverride(propKey, propVal);\n }\n options.parser.handleAttributes(ret, resourceAttributes, id);\n return ret;\n }", "create() {\n\t}", "get_processor_kwargs() {\n return {}\n }", "function constructPipeline() {\n // console.log($rootScope.CSVdelim);\n // var separator = $rootScope.CSVdelim?$rootScope.CSVdelim:'\\\\,';\n var readDatasetFunct = new jsedn.List([\n new jsedn.sym('read-dataset'),\n new jsedn.sym('data-file')\n ]);\n\n pipeline = null;\n\n pipeline = new jsedn.List([\n jsedn.sym('defpipe'),\n jsedn.sym('my-pipe'),\n 'Grafter pipeline for data clean-up and preparation.',\n new jsedn.Vector([new jsedn.sym('data-file')]),\n new jsedn.List([jsedn.sym('->'), readDatasetFunct])\n ]);\n\n pipelineFunctions.map(function (arg) {\n pipeline.val[4].val.push(arg);\n });\n\n //(read-dataset data-file :format :csv)\n pipelineFunctions = new jsedn.List([]);\n return pipeline;\n}", "static create(msg) {\n // Use `this` instead of `Frisby` so this does the right thing when\n // composed with mixins.\n return new this(msg)\n }", "static async create() {\n let comp = Reflect.construct(this, arguments);\n // build default required components\n await Promise.all(resolveRequiredComponents(comp)\n .map(c => comp.addComponent(c)));\n return comp;\n }", "function makeSwiper() {\n _this.calcSlides();\n if (params.loader.slides.length > 0 && _this.slides.length === 0) {\n _this.loadSlides();\n }\n if (params.loop) {\n _this.createLoop();\n }\n _this.init();\n initEvents();\n if (params.pagination) {\n _this.createPagination(true);\n }\n\n if (params.loop || params.initialSlide > 0) {\n _this.swipeTo(params.initialSlide, 0, false);\n }\n else {\n _this.updateActiveSlide(0);\n }\n if (params.autoplay) {\n _this.startAutoplay();\n }\n /**\n * Set center slide index.\n *\n * @author Tomaz Lovrec <tomaz.lovrec@gmail.com>\n */\n _this.centerIndex = _this.activeIndex;\n\n // Callbacks\n if (params.onSwiperCreated) _this.fireCallback(params.onSwiperCreated, _this);\n _this.callPlugins('onSwiperCreated');\n }", "function ProcessDevice(){\r this.name = \"ProcessDevice\";\r this.xpath = \"//device[@type = 'VCO']\";\t\r this.apply = function(myElement, myRuleProcessor){\r var myNewElement = myContainerElement.xmlElements.add(app.documents.item(0).xmlTags.item(\"Row\"));\r return true;\r }\t\t\r}", "init(kernel) {\n logger.log(this.name, \"init\");\n let test = new testProc(\"test\");\n kernel.startProcess(test);\n }", "function createInjector(defType,parent,additionalProviders){if(parent===void 0){parent=null;}if(additionalProviders===void 0){additionalProviders=null;}parent=parent||getNullInjector();return new R3Injector(defType,additionalProviders,parent);}", "function createPlatform(injector) {\n if (_platform && !_platform.destroyed &&\n !_platform.injector.get(ALLOW_MULTIPLE_PLATFORMS, false)) {\n throw new Error('There can be only one platform. Destroy the previous one to create a new one.');\n }\n _platform = injector.get(PlatformRef);\n var inits = injector.get(PLATFORM_INITIALIZER, null);\n if (inits)\n inits.forEach(function (init) { return init(); });\n return _platform;\n}", "function createPlatform(injector) {\n if (_platform && !_platform.destroyed &&\n !_platform.injector.get(ALLOW_MULTIPLE_PLATFORMS, false)) {\n throw new Error('There can be only one platform. Destroy the previous one to create a new one.');\n }\n _platform = injector.get(PlatformRef);\n var inits = injector.get(PLATFORM_INITIALIZER, null);\n if (inits)\n inits.forEach(function (init) { return init(); });\n return _platform;\n}", "function createPlatform(injector) {\n if (_platform && !_platform.destroyed &&\n !_platform.injector.get(ALLOW_MULTIPLE_PLATFORMS, false)) {\n throw new Error('There can be only one platform. Destroy the previous one to create a new one.');\n }\n _platform = injector.get(PlatformRef);\n var inits = injector.get(PLATFORM_INITIALIZER, null);\n if (inits)\n inits.forEach(function (init) { return init(); });\n return _platform;\n}", "function createPlatform(injector) {\n if (_platform && !_platform.destroyed &&\n !_platform.injector.get(ALLOW_MULTIPLE_PLATFORMS, false)) {\n throw new Error('There can be only one platform. Destroy the previous one to create a new one.');\n }\n _platform = injector.get(PlatformRef);\n var inits = injector.get(PLATFORM_INITIALIZER, null);\n if (inits)\n inits.forEach(function (init) { return init(); });\n return _platform;\n}", "function transpilerFactory(options, injector) {\n if (options.transpilers.length) {\n return injector.injectClass(ChildProcessTranspiler_1.ChildProcessTranspiler);\n }\n else {\n return {\n transpile(files) {\n return Promise.resolve(files);\n },\n dispose() {\n // noop\n },\n };\n }\n}", "function fromProcess(init) {\n if (init === void 0) { init = {}; }\n return function () {\n return parseKnownFiles(init).then(function (profiles) { return resolveProcessCredentials(getMasterProfileName(init), profiles); });\n };\n}", "function instantiateMiddleware (next, middleware) {\n // If the middleware is a nested pipeline, we\n // create a fork in the pipeline.\n if (middleware instanceof Pipeline) {\n return fork(next, middleware)\n }\n\n // First, we assume that the middleware is a function style\n // middleware. If running it as a function throws a [TypeError]\n // it is probably a class style middleware.\n try {\n return middleware(next)\n } catch (e) {\n // If the error isn't a [TypeError], we should rethrow it\n if (!(e instanceof TypeError)) {\n throw e\n }\n\n // At this point, we can assume that the middleware is a\n // class, so we instantiate it.\n return instantiateClassMiddleware(next, middleware)\n }\n}", "function createPlatform(injector) {\n if (_platform && !_platform.destroyed &&\n !_platform.injector.get(ALLOW_MULTIPLE_PLATFORMS, false)) {\n throw new Error('There can be only one platform. Destroy the previous one to create a new one.');\n }\n publishDefaultGlobalUtils$1();\n _platform = injector.get(PlatformRef);\n const inits = injector.get(PLATFORM_INITIALIZER, null);\n if (inits)\n inits.forEach((init) => init());\n return _platform;\n}", "function createPlatform(injector) {\n if (_platform && !_platform.destroyed &&\n !_platform.injector.get(ALLOW_MULTIPLE_PLATFORMS, false)) {\n throw new Error('There can be only one platform. Destroy the previous one to create a new one.');\n }\n publishDefaultGlobalUtils$1();\n _platform = injector.get(PlatformRef);\n const inits = injector.get(PLATFORM_INITIALIZER, null);\n if (inits)\n inits.forEach((init) => init());\n return _platform;\n}" ]
[ "0.6117301", "0.6117301", "0.60486126", "0.5904408", "0.5904408", "0.5904408", "0.5904408", "0.5904408", "0.58828163", "0.5800185", "0.5721235", "0.56447303", "0.5328679", "0.52514666", "0.52514666", "0.52514666", "0.5194525", "0.51114035", "0.51101834", "0.51099145", "0.5081827", "0.50024855", "0.50024855", "0.49716735", "0.4956815", "0.49201465", "0.491992", "0.48840997", "0.48746064", "0.48345613", "0.47531995", "0.47516713", "0.47219577", "0.47208402", "0.47160685", "0.46538782", "0.4629294", "0.46219748", "0.4611517", "0.46008545", "0.45952055", "0.4581441", "0.45651895", "0.45420104", "0.45188734", "0.4503669", "0.44936916", "0.4474103", "0.44710454", "0.44710454", "0.44700417", "0.4457001", "0.44260597", "0.44043374", "0.43998432", "0.4396617", "0.43852097", "0.4380724", "0.43723214", "0.43393198", "0.43314838", "0.43242446", "0.4303566", "0.42670602", "0.4247376", "0.4247376", "0.4247376", "0.4247376", "0.42453915", "0.4243683", "0.42333812", "0.42321095", "0.42294303", "0.4229272", "0.4223107", "0.42135486", "0.42045647", "0.42028788", "0.41877374", "0.41867372", "0.41832525", "0.41799456", "0.41750512", "0.4171652", "0.4167612", "0.41567767", "0.41537157", "0.41537157", "0.41537157", "0.41537157", "0.41498613", "0.4148133", "0.41466206", "0.41429758", "0.41429758" ]
0.48947236
31
Data management. Getter / setter for processorspecific informtion.
function data(key, value) { if (string(key)) { /* Set `key`. */ if (arguments.length === 2) { assertUnfrozen('data', frozen) namespace[key] = value return processor } /* Get `key`. */ return (own.call(namespace, key) && namespace[key]) || null } /* Set space. */ if (key) { assertUnfrozen('data', frozen) namespace = key return processor } /* Get space. */ return namespace }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "get data() {\n\t\treturn this.__data;\n\t}", "function processedSFData() {\n\t\tthis.moteid = idMote;\n\t\tthis.sensorType = sensorType;\n\t\tthis.lastTimestamp = lastTimeStamp;\n\t\tthis.lastValue = lastValue;\n\t\tthis.arrayValuesDay = valuesDay;\n\t\tthis.populationDay = populationDay;\n\t\tthis.arrayValuesWeek = valuesWeek;\n\t\tthis.populationWeek = populationWeek;\n\t\tthis.platform = platform;\n\t\tthis.unit = unit;\n\t}", "function processedGFData() {\n\t\tthis.moteid = idMote;\n\t\tthis.sensorType = sensorType;\n\t\tthis.lastTimestamp = lastTimeStamp;\n\t\tthis.lastValue = lastValue;\n\t\tthis.arrayValuesDay = valuesDay;\n\t\tthis.populationDay = populationDay;\n\t\tthis.arrayValuesWeek = valuesWeek;\n\t\tthis.populationWeek = populationWeek;\n\t\tthis.platform = platform;\n\t\tthis.unit= unit;\n\t}", "get data () {return this._data;}", "get Data () {\n return this._data\n }", "get Data() {\n return this._data;\n }", "get data() {\n return this.getData();\n }", "function processedFFData() {\n\t\tthis.moteid = idMote;\n\t\tthis.sensorType = sensorType;\n\t\tthis.lastTimestamp = lastTimeStamp;\n\t\tthis.lastValue = lastValue;\n\t\tthis.arrayValuesDay = valuesDay;\n\t\tthis.populationDay = populationDay;\n\t\tthis.arrayValuesWeek = valuesWeek;\n\t\tthis.populationWeek = populationWeek;\n\t\tthis.platform = platform;\n\t\tthis.unit = unit;\n\t}", "get data() {\n return this._data;\n }", "get data() {\n return this._data;\n }", "get data() {\n return this._data;\n }", "get data() { return this._data.value; }", "SetData() {}", "constructor() {\n this.data = this._loadData();\n }", "prepareData() {\n super.prepareData();\n\n const actorData = this.data;\n const data = actorData.data;\n const flags = actorData.flags;\n\n // Make separate methods for each Actor type (character, npc, etc.) to keep\n // things organized.\n if (actorData.type === 'character') this._prepareCharacterData(actorData);\n if (actorData.type === 'pokemon') this._preparePokemonData(actorData);\n }", "getData () {\n if (data) {\n this.data = data;\n this.emit('change', this.data);\n }\n }", "set(data) {\n this.internalData = data;\n }", "set data(data) {\n // prevent error message - setters invoked in initialization of class\n if (data == null) { return }\n \n // destructuring of data sent from Data class. reassign to Class scope\n let { title, question } = data;\n this.type = title;\n this.question = question;\n\n }", "get data(){\n return this._data;\n }", "getData(){}", "processData() {\n for (const item of this.unprocessedData) {\n this.addToData(buildOrInfer(item));\n }\n this.unprocessedData.clear();\n }", "function getData() {\n return {\n ergReps: ergReps,\n bikeReps: bikeReps,\n repRate: repRate,\n totTime: totTime,\n Distance: Distance\n }\n }", "get data(){\r\n\t\treturn this.__data \r\n\t\t\t?? (this.__data = idb.createStore(this.__db__, this.__store__)) }", "getData() {\n return this.data;\n }", "getData() {\n return this.data;\n }", "prepareData () {\n super.prepareData()\n\n const actorData = this.data\n const data = actorData.data\n const flags = actorData.flags\n\n // Make separate methods for each Actor type (character, npc, etc.) to keep\n // things organized.\n if (actorData.type === 'character' || actorData.type === 'creature') {\n this._prepareCharacterData(actorData)\n }\n }", "setData() {}", "resolveData() {\n return {\n metaTable: this.getMetaTable(),\n plugins: this.getPlugins(),\n rules: this.getRules(),\n transformers: this.transformers,\n };\n }", "_handleData() {\n // Pull out what we need from props\n const {\n _data,\n _dataOptions = {},\n } = this.props;\n\n // Pull out what we need from context\n const {\n settings = {},\n } = this.context;\n\n // Pull the 'getData' method that all modules which need data fetching\n // must implement\n const {\n getData = (() => Promise.resolve({ crap: 5 })),\n } = this.constructor;\n\n /**\n * Check if data was loaded server-side.\n * If not - we fetch the data client-side\n * and update the state\n *\n * We'll also add add the global settings to\n * the request implicitely\n */\n if (!_data) {\n getData(Object.assign({}, { __settings: settings }, _dataOptions))\n .then(_data => this.setState({ ['__data']: _data }))\n .catch(_data => this.setState({ ['__error']: _data }));\n }\n }", "getData() {\n const data = super.getData();\n data.labels = this.item.labels;\n \n // Include CONFIG values\n data.config = CONFIG.SFRPG;\n \n // Item Type, Status, and Details\n data.itemType = data.item.type.titleCase();\n data.itemStatus = this._getItemStatus(data.item);\n data.itemProperties = this._getItemProperties(data.item);\n data.isPhysical = data.item.data.hasOwnProperty(\"quantity\");\n data.hasLevel = data.item.data.hasOwnProperty(\"level\") && data.item.type !== \"spell\";\n data.hasHands = data.item.data.hasOwnProperty(\"hands\");\n data.hasCapacity = data.item.data.hasOwnProperty(\"capacity\");\n\n // Armor specific details\n data.isPowerArmor = data.item.data.hasOwnProperty(\"armor\") && data.item.data.armor.type === 'power';\n \n // Action Details\n data.hasAttackRoll = this.item.hasAttack;\n data.isHealing = data.item.data.actionType === \"heal\";\n \n // Spell-specific data\n if ( data.item.type === \"spell\" ) {\n let save = data.item.data.save;\n if ( this.item.isOwned && (save.type && !save.dc) ) {\n let actor = this.item.actor;\n let abl = actor.data.data.attributes.keyability || \"int\";\n save.dc = 10 + data.item.data.level + actor.data.data.abilities[abl].mod;\n }\n }\n\n data.modifiers = this.item.data.data.modifiers;\n \n return data;\n }", "getData () {\n }", "function initData(){\n o_data = user.original_musics;\n d_data = user.derivative_musics;\n c_data = user.collected_musics;\n}", "getData() {\n return this._data;\n }", "setData(data){\n this.hasSavedValues = false,\n this.publicoAlvoSim= data.publicoAlvoSim,\n this.publicoAlvoNao= data.publicoAlvoNao,\n this.publicoAlvoALVA= data.publicoAlvoNao,\n this.XER= data.XER,\n this.COP= data.COP,\n this.listaPrefixos= data.listaPrefixos,\n this.operacaoNaoVinculada= data.operacaoNaoVinculada,\n this.operacaoVinculada= data.operacaoVinculada,\n this.operacaoVinculadaEmOutroNPJ= data.operacaoVinculadaEmOutroNPJ,\n this.acordoRegPortalSim= data.acordoRegPortalSim,\n this.acordoRegPortalNao= data.acordoRegPortalNao,\n //this.acordoRegPortalDuplicados= data.acordoRegPortalDuplicados,\n this.totaisEstoque = data.totaisEstoque,\n this.totaisFluxo = data.totaisFluxo,\n this.estoqueNumber= data.estoqueNumber,\n this.fluxoNumber= data.fluxoNumber,\n this.duplicadoSimNao = data.duplicadoSimNao,\n this.analisadoSimNao = data.analisadoSimNao\n }", "prepareData() {\n super.prepareData();\n\n const actorData = this.data;\n const data = actorData.data;\n const flags = actorData.flags;\n }", "get() {\n return this.data\n }", "get data() {\n return getIn(privateDataMap.get(this).currentData, this.path);\n }", "get data() {\n return this.combinedData;\n }", "function Data() { }", "data() {\n\n let data = super.data();\n\n if (!data.zoom) {\n data.zoom = larabelt.coords.zoom ? larabelt.coords.zoom : 15;\n }\n\n if (this._location) {\n data._location = this._location;\n }\n\n if (this._geocode) {\n data._geocode = this._geocode;\n }\n\n return data;\n }", "get data() {\n return this[data];\n }", "get data() {return this[VALUE];}", "data () {\n let data = {}\n\n for (let property in this.originalData) {\n data[property] = this[property]\n }\n\n return data\n }", "function ProviderData() { }", "function ProviderData() { }", "prepareData() {\n let img = CONST.DEFAULT_TOKEN;\n switch (this.data.type) {\n case \"character\":\n img = \"/systems/hitos/assets/icons/character.svg\";\n break;\n case \"npc\":\n img = \"/systems/hitos/assets/icons/npc.svg\";\n break;\n case \"organization\":\n img = \"/systems/hitos/assets/icons/organization.svg\";\n break;\n case \"vehicle\":\n img = \"/systems/hitos/assets/icons/vehicle.svg\";\n break;\n }\n if (!this.data.img) this.data.img = img;\n\n super.prepareData();\n const actorData = this.data;\n const data = actorData.data;\n const flags = actorData.flags;\n\n // Make separate methods for each Actor type (character, npc, etc.) to keep\n // things organized.\n if (actorData.type === \"npc\" || actorData.type === \"character\") {\n this._prepareCharacterData();\n this._calculateRD();\n this._calculateDefense();\n }\n }", "function store (){\n\t\tthis.sensor =senType;\n\t\tthis.unit = thisUnit;\n\t\tthis.reading=maxRead;\n\t\tthis.moteId = idMote;\n\t}", "function store (){\n\t\tthis.sensor =senType;\n\t\tthis.unit = thisUnit;\n\t\tthis.reading=maxRead;\n\t\tthis.moteId = idMote;\n\t}", "function store (){\n\t\tthis.sensor =senType;\n\t\tthis.unit = thisUnit;\n\t\tthis.reading=maxRead;\n\t\tthis.moteId = idMote;\n\t}", "get data() {\n return this.getStringAttribute('data');\n }", "set data(data) {\n this.props.variant = data.variant;\n this.props.iconUrl = data.iconUrl;\n this.props.size = data.size || \"MEDIUM\" /* MEDIUM */;\n this.setDisabledProperty(data.disabled || false);\n ComponentHelpers.ScheduledRender.scheduleRender(this, this.boundRender);\n }", "GetData() {}", "set data(d){\n if (d instanceof Data) {\n d = d.data;\n }\n this._data = d || {};\n delete this._id;\n return this._data;\n }", "assign (data) {\n this.reset()\n\n if (data == null) {\n return\n }\n\n if (this.vm.hasOwnProperty(this.options.property) === false) {\n console.warn(`Instance does not have an input property named \"${this.options.property}\"`)\n return\n }\n\n let props = this.vm[this.options.property]\n\n Object.keys(props).forEach(key => {\n if (data.hasOwnProperty(key)) {\n props[key] = data[key]\n }\n })\n }", "function ProviderData() {}", "function ProviderData() {}", "function ProviderData() {}", "getData() {\n \n return {\n \n } \n }", "resetData() {\n\t\t\tthis.initFlags();\n\t\t\tthis.initMetadata();\n\t\t}", "set data(val) {\n this._data = val;\n }", "get userData() {}", "fetchData() {\n this.initLoading();\n let qs = this.setAndGetQuerySetFromSandBox(this.view, this.qs_url);\n this.data.instance = qs.cache = qs.model.getInstance({}, qs);\n this.setLoadingSuccessful();\n this.getParentInstancesForPath();\n }", "fetchData() {\n this.initLoading();\n let qs = this.setAndGetQuerySetFromSandBox(this.view, this.qs_url);\n this.data.instance = qs.cache = qs.model.getInstance({}, qs);\n this.setLoadingSuccessful();\n this.getParentInstancesForPath();\n }", "prepareData() {\n super.prepareData();\n\n // Get the Item's data\n const itemData = this.data;\n const actorData = this.actor ? this.actor.data : {};\n const data = itemData.data;\n\n // console.log(itemData);\n\n if (itemData.type === 'melee weapon') this._prepareMeleeData(itemData, actorData);\n if (itemData.data.mechanika) this._prepareMechanikaData(itemData);\n if (itemData.type === 'mechanika ranged weapon') this._prepareMrwData(itemData, actorData);\n // if (itemData.type === 'grid') this._prepareGrid(itemData, actorData);\n }", "_cleanAndSetData() {\n const propertySearchLocationPath = 'page.attributes.propertySearchLocation';\n const propertySearchLocation = get(this.digitalData, propertySearchLocationPath);\n if (propertySearchLocation === undefined) {\n this._set(propertySearchLocationPath, '');\n }\n\n const propertySearchDateInfoPath = 'page.attributes.propertySearchDateInfo';\n const propertySearchDateInfo = get(this.digitalData, propertySearchDateInfoPath);\n if (propertySearchDateInfo === undefined) {\n this._set(propertySearchDateInfoPath, '00:00:00:00');\n }\n\n const productIDPath = 'product[0].productInfo.productID';\n const productID = get(this.digitalData, productIDPath);\n if (productID === undefined) {\n this._set('product', [{ productInfo: { productId: '' } }]);\n }\n\n window.digitalData = this.digitalData;\n }", "constructor () {\n this.data = {}\n }", "getData() {\n \n}", "getMpsData()\r\n {\r\n return this.mpsData;\r\n }", "function Data()\n{\n //parameters\n this.total = 0;\n this.domestic = 0;\n this.transborder = 0;\n this.other = 0;\n}", "function makeDataFor() {\n\t\t// move the getter function aside\n\t\tdelete Element.prototype.data;\n\t\t// assign a new data ListMap to this object\n\t\tthis.data = new ListMap();\n\t\t// set an attribute on the element so we know to clear its data object later\n\t\tthis.setAttribute(\"data\",\"y\");\n\t\t// restore the getter function\n\t\tElement.prototype.__defineGetter__(\"data\", makeDataFor);\n\t\treturn this.data;\n\t}", "function get_data() {}", "getData() {\n return this._cachedData;\n }", "get data() {\n return {};\n }", "getData() {\n return this.globalData;\n }", "set data(value) {\n this.setData(value);\n }", "get data() {\n return this.combinedData;\n }", "set_data(data) {\n this.wasmInstance.exports.opa_heap_ptr_set(this.baseHeapPtr);\n this.wasmInstance.exports.opa_heap_top_set(this.baseHeapTop);\n this.dataAddr = _loadJSON(this.wasmInstance, this.mem, data);\n this.dataHeapPtr = this.wasmInstance.exports.opa_heap_ptr_get();\n this.dataHeapTop = this.wasmInstance.exports.opa_heap_top_get();\n }", "getData(){\n\t\treturn this;\n\t}", "constructor() {\n super();\n this.data = new Data();\n }", "getData()\n {\n let data = {};\n\n for (let field in this.__.originalData)\n {\n data[field] = this[field];\n }\n\n return data;\n }", "static parse(data) {\r\n const parsedData = super.parse(data)\r\n\r\n parsedData.name = data.name\r\n parsedData.identificationNumber = data.identification_number\r\n parsedData.description = data.description\r\n\r\n parsedData.isService = 'is_service' in data ? data.is_service : data.price === null\r\n parsedData.qty = Number(data.qty)\r\n\r\n const currency = CurrencyRepository.findByKey(data.currency_code)\r\n\r\n parsedData.currency = currency\r\n parsedData.price = Money.create({\r\n amount: data.price,\r\n currency\r\n })\r\n\r\n return parsedData\r\n }", "function processDataFromDocusky() {\n\tparseDocInfo();\n\ttoolSetting();\n}", "get data() {\n return this.state.data;\n }", "constructor( data ){\n this._emitter = new EventTarget();\n this._converters = new Map();\n this._dynamicProperties = false;\n this._data = data;\n }", "function ProviderData(){}", "function consumptionMapData() {\n /* eslint-disable no-undef */\n emit(this.id, { \n litresConsumed: this.litresConsumed, \n kilometersTravelled: this.kilometersTravellled,\n litrosTanque: this.litrosTanque, \n kilometraje: this.kilometraje,\n processed: this.processed \n });\n /* eslint-enable no-undef */\n}", "getData() {\n return {};\n }", "function processComponentData(item)\n\t\t\t{\n\t\t\t\tslot = $(this).attr('data-slot');\n\t\t\t\ttype = $(this).attr('data-type');\n\n\t\t\t\tcomponent_data['id'] = component_id; // if id key is undefined, it will be omitted\n\n\t\t\t\tswitch(type)\n\t\t\t\t{\n\t\t\t\t\tcase 'image':\n\t\t\t\t\t\tcomponent_data[slot] = $(this).attr('src');\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase 'custom':\n\t\t\t\t\t\tcomponent_data[slot] = $(this).attr('data-custom');\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase 'input':\n\t\t\t\t\t\tcomponent_data[slot] = $(this).val();\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase 'array':\n\t\t\t\t\t\twrapper = $(this).attr('data-wrapper');\n\t\t\t\t\t\tsub_data = new Array();\n\t\t\t\t\t\t$(this).find(wrapper).each(function()\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tsub_data.push($(this).html());\n\t\t\t\t\t\t});\n\t\t\t\t\t\tcomponent_data[slot] = sub_data;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase 'style':\n\t\t\t\t\t\tcomponent_data[slot] = $(this).attr('style');\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tdefault:\n\t\t\t\t\t\tcomponent_data[slot] = CKEDITOR.instances[$(this).attr('id')].getData();\n\t\t\t\t\t\tbreak;\n\t\t\t\t}\n\n\t\t\t}", "loadData() {\n let key = this.Key;\n let tmp = [];\n\n if (key === \"department\") {\n getDepartment().done((res) => {\n res.forEach(({ DepartmentId, DepartmentName }) =>\n tmp.push({\n id: DepartmentId,\n label: DepartmentName,\n })\n );\n\n this.Data = tmp;\n });\n } else if (key === \"position\") {\n getPosition().done((res) => {\n res.forEach(({ PositionId, PositionName }) =>\n tmp.push({\n id: PositionId,\n label: PositionName,\n })\n );\n\n this.Data = tmp;\n });\n } else this.Data = formData[key];\n }", "loadData() {\r\n\t\t// load the current tracker type data from localStorage\r\n\t\tlet currentData = localStorage.getItem( this.type );\r\n\r\n\t\t// parse it into an object if it exists\r\n\t\tif ( currentData ) {\r\n\t\t\tthis.data = JSON.parse(currentData);\r\n\t\t} else {\r\n\t\t\tthis.data = {};\r\n\t\t}\r\n\t}", "preprocessData(type) {\n if (type == \"Genomes\")\n this.preprocessGenomes();\n else if (type == \"Paired-end Reads\")\n this.preprocessPairedReads();\n else if (type == \"Single-end Reads\")\n this.preprocessSingleReads();\n else if (type == \"Interleaved Paired-end Reads\")\n this.preprocessSingleReads();\n }", "get data() {\n\t\treturn this._tableData;\n\t}", "_resetData () {\n this.data = {}\n }", "get dataRequirement() {\n\t\treturn this.__dataRequirement;\n\t}", "setData (data) {\n this.processData(data);\n this.trigger('update', data);\n }", "_data(data) {\n this.displayData = data;\n }", "constructor() {\n this.data = {};\n }", "constructor() {\n this.data = {};\n }", "initData(data) {\n this.status = data.status;\n this.id = data.id;\n }", "get data() { return this.item.data; }", "processData(apiData){\n this.setNextPage(apiData.next_page)\n this.setPreviousPage(apiData.previous_page)\n this.setTicketCount(apiData.count)\n }" ]
[ "0.68809307", "0.68432516", "0.6731611", "0.6641427", "0.6595986", "0.6528188", "0.6495358", "0.64899683", "0.64805365", "0.64805365", "0.64805365", "0.6422238", "0.6342294", "0.63204193", "0.6317152", "0.6309514", "0.62412494", "0.62303525", "0.6220492", "0.62105477", "0.6192825", "0.6185568", "0.6178671", "0.61724687", "0.61724687", "0.6160282", "0.6159029", "0.61389375", "0.6132602", "0.611702", "0.61075103", "0.605243", "0.6051478", "0.6050397", "0.6048928", "0.60433805", "0.6040668", "0.6039977", "0.60070014", "0.60044724", "0.6002103", "0.5990933", "0.598658", "0.5964912", "0.5964912", "0.59485114", "0.5937298", "0.5937298", "0.5937298", "0.59362245", "0.5903475", "0.582766", "0.5821178", "0.5809459", "0.5809078", "0.5809078", "0.5809078", "0.5803743", "0.58023727", "0.5796138", "0.5794818", "0.5786594", "0.5786594", "0.5784872", "0.578409", "0.5769005", "0.5763732", "0.5762041", "0.57616365", "0.57596844", "0.57571226", "0.5744927", "0.57274777", "0.57240826", "0.5721461", "0.57103544", "0.5696548", "0.5693998", "0.56881815", "0.56807894", "0.56711096", "0.56687754", "0.5663445", "0.5661514", "0.566131", "0.5652759", "0.5648809", "0.564678", "0.5644262", "0.5639414", "0.5638127", "0.5628713", "0.56250525", "0.5622314", "0.56084496", "0.55998695", "0.55992013", "0.55992013", "0.55843884", "0.5582184", "0.55819523" ]
0.0
-1
Plugin management. Pass it: an attacher and options, a preset, a list of presets, attachers, and arguments (list of attachers and options).
function use(value) { var settings assertUnfrozen('use', frozen) if (value === null || value === undefined) { /* Empty */ } else if (typeof value === 'function') { addPlugin.apply(null, arguments) } else if (typeof value === 'object') { if ('length' in value) { addList(value) } else { addPreset(value) } } else { throw new Error('Expected usable value, not `' + value + '`') } if (settings) { namespace.settings = extend(namespace.settings || {}, settings) } return processor function addPreset(result) { addList(result.plugins) if (result.settings) { settings = extend(settings || {}, result.settings) } } function add(value) { if (typeof value === 'function') { addPlugin(value) } else if (typeof value === 'object') { if ('length' in value) { addPlugin.apply(null, value) } else { addPreset(value) } } else { throw new Error('Expected usable value, not `' + value + '`') } } function addList(plugins) { var length var index if (plugins === null || plugins === undefined) { /* Empty */ } else if (typeof plugins === 'object' && 'length' in plugins) { length = plugins.length index = -1 while (++index < length) { add(plugins[index]) } } else { throw new Error('Expected a list of plugins, not `' + plugins + '`') } } function addPlugin(plugin, value) { var entry = find(plugin) if (entry) { if (plain(entry[1]) && plain(value)) { value = extend(entry[1], value) } entry[1] = value } else { attachers.push(slice.call(arguments)) } } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function registerPresets(newPresets) {\n Object.keys(newPresets).forEach(function (name) {\n return registerPreset(name, newPresets[name]);\n });\n } // All the plugins we should bundle", "function handlePlugins$1(inputs, calendar) {\n calendar.addPluginInputs(inputs); // will gracefully handle duplicates\n }", "function init() {\n var _this = this;\n\n this._get('options').plugins.forEach(function (plugin) {\n // check if plugin definition is string or object\n var Plugin = undefined;\n var pluginName = undefined;\n var pluginOptions = {};\n if (typeof plugin === 'string') {\n pluginName = plugin;\n } else if ((typeof plugin === 'undefined' ? 'undefined' : babelHelpers.typeof(plugin)) === 'object') {\n pluginName = plugin.name;\n pluginOptions = plugin.options || {};\n }\n\n Plugin = find(pluginName);\n _this._get('plugins')[plugin] = new Plugin(_this, pluginOptions);\n\n addClass(_this._get('$container'), pluginClass(pluginName));\n });\n }", "function handlePlugins(inputs, calendar) {\n calendar.addPluginInputs(inputs); // will gracefully handle duplicates\n }", "function handlePlugins(inputs, calendar) {\n calendar.addPluginInputs(inputs); // will gracefully handle duplicates\n }", "function handlePlugins(inputs, calendar) {\n calendar.addPluginInputs(inputs); // will gracefully handle duplicates\n }", "_initPlugins() {\n this.plugins.forEach(plugin => {\n if (plugin === 'ubiety-custom-texture' && !this.customTextureModule) {\n this.customTextureModule = new UbietyCustomTexture('ubiety-custom-texture', this, 'umjs-texture-factory');\n }\n else if (plugin === 'ubiety-text-editor' && !this.customTextEditorModule) {\n this.customTextEditorModule = new UbietyCustomTexture('ubiety-text-editor', this, 'umjs-text-image-factory');\n }\n else {\n console.error('Ubiety:: Either a plugin can\\'t be recognised, or it already exists.');\n }\n });\n }", "function Plugin(element, options) {\r\n this.element = element;\r\n this.settings = options;\r\n\r\n this._defaults = defaults;\r\n this._name = pluginName;\r\n this._uploader = null;\r\n this.init();\r\n }", "function handlePlugins(inputs, calendar) {\n calendar.addPluginInputs(inputs); // will gracefully handle duplicates\n}", "initPlugins() {}", "initPlugins() {}", "function Plugin(element, options) {\r\n\r\n\t\tthis.element = element;\r\n\t\tthis.$element = $(this.element);\r\n\t\tthis._name = pluginName;\r\n\t\tthis._defaults = $.fn[pluginName].defaults;\r\n\t\tthis.settings = $.extend(true, {}, this._defaults, options);\r\n\t\tthis.loadDependencies();\r\n\t\t\r\n\t}", "addPlugins(...plugins) {\n InstancePlugin.initPlugins(this, ...plugins);\n }", "function Plugin( element, options )\n {\n \n this.element = element;\n\n this.options = $.extend( {}, defaults, options );\n\n this._defaults = defaults;\n this._name = pluginName;\n\n this.init();\n }", "function Plugin( element, options ) {\n\t\tthis.$element = $(element);\n this.element = element;\n this.options = $.extend( {}, defaults, options) ;\n this._defaults = defaults;\n this._name = pluginName;\n \n this.init();\n }", "function Plugin( element, options ) {\n tabElement = $(element);\n switchElement = $(options.target);\n eventType = options.eventType || \"click\";\n actClassName = options.actClassName;\n callback = options.callback;\n // jQuery has an extend method which merges the contents of two or \n // more objects, storing the result in the first object. The first object\n // is generally empty as we don't want to alter the default options for\n // future instances of the plugin\n me = this;\n me.element = element;\n me.options = $.extend( {}, defaults, options) ;\n \n me._defaults = defaults;\n me._name = pluginName;\n \n me.init();\n }", "function make(useopts) {\n // Default options, overidden by caller supplied options.\n useopts = Object.assign(\n {\n prefix: 'plugin-',\n builtin: '../plugin/',\n module: module.parent,\n errmsgprefix: true,\n system_modules: intern.make_system_modules(),\n merge_defaults: true,\n gubu: true,\n },\n useopts\n )\n\n // Setup error messages, see msgmap function below for text.\n const eraro = Eraro({\n package: 'use-plugin',\n msgmap: msgmap(),\n module: module,\n prefix: useopts.errmsgprefix,\n })\n\n // This is the function that loads plugins.\n // It is returned for use by the framework calling code.\n // Parameters:\n //\n // * _plugin_ : (Object or Function or String); plugin definition\n // * if Object: provide a partial or complete definition with same properties as return value\n // * if Function: assumed to be plugin _init_ function; plugin name taken from function name, if defined\n // * if String: base for _require_ search; assumes module defines an _init_ function\n // * _options_ : (Object, ...); plugin options, if not an object, constructs an object of form {value$:options}\n // * _callback_ : (Function); callback function, possibly to be called by framework after init function completes\n //\n // Returns: A plugin description object is returned, with properties:\n //\n // * _name_ : String; the plugin name, either supplied by calling code, or derived from definition\n // * _init_ : Function; the plugin init function, the resolution of which is the point of this module!\n // * _options_ : Object; plugin options, if supplied\n // * _search_ : Array[{type,name}]; list of require search paths; applied to each module up the parent chain until something is found\n // * _found_ : Object{type,name}; search entry that found something\n // * _requirepath_ : String; the argument to require that found something\n // * _modulepath_ : String; the Node.js API module.id whose require found something\n // * _tag_ : String; the tag value of the plugin name (format: name$tag), if any, allows loading of same plugin multiple times\n // * _err_ : Error; plugin load error, if any\n function use() {\n const args = Norma(\n '{plugin:o|f|s, options:o|s|n|b?, callback:f?}',\n arguments\n )\n return use_plugin_desc(\n build_plugin_desc(args, useopts, eraro),\n useopts,\n eraro\n )\n }\n\n // use.Optioner = Optioner\n // use.Joi = Optioner.Joi\n\n use.use_plugin_desc = function (plugin_desc) {\n return use_plugin_desc(plugin_desc, useopts, eraro)\n }\n\n use.build_plugin_desc = function () {\n const args = Norma(\n '{plugin:o|f|s, options:o|s|n|b?, callback:f?}',\n arguments\n )\n return build_plugin_desc(args, useopts, eraro)\n }\n\n return use\n}", "function Plugin( element, options ) {\n this.element = element;\n this.options = $.extend( {}, defaults, options) ;\n \n this._defaults = defaults;\n this._name = pluginName;\n\n this.init();\n }", "function Plugin( element, options ) {\n this.ele = element; \n this.$ele = $(element); \n this.options = $.extend( {}, defaults, options) ; \n \n this._defaults = defaults; \n this._name = pgn; \n\n this.init(); \n }", "function Plugin($element, $options) \n\t{\n\t\tthis.element \t\t\t\t\t= $element;\n\t\tthis.settings \t\t\t\t\t= $.extend({}, $defaults, $options);\n\t\tthis._defaults \t\t\t\t\t= $defaults;\n\t\tthis._name \t\t\t\t\t\t= $contextplate;\n\n\t\t// Initilize plugin\n\t\tthis.init();\n\t}", "function use(value) {\n var settings;\n\n assertUnfrozen('use', frozen);\n\n if (value === null || value === undefined) ; else if (typeof value === 'function') {\n addPlugin.apply(null, arguments);\n } else if (typeof value === 'object') {\n if ('length' in value) {\n addList(value);\n } else {\n addPreset(value);\n }\n } else {\n throw new Error('Expected usable value, not `' + value + '`')\n }\n\n if (settings) {\n namespace.settings = extend$1(namespace.settings || {}, settings);\n }\n\n return processor\n\n function addPreset(result) {\n addList(result.plugins);\n\n if (result.settings) {\n settings = extend$1(settings || {}, result.settings);\n }\n }\n\n function add(value) {\n if (typeof value === 'function') {\n addPlugin(value);\n } else if (typeof value === 'object') {\n if ('length' in value) {\n addPlugin.apply(null, value);\n } else {\n addPreset(value);\n }\n } else {\n throw new Error('Expected usable value, not `' + value + '`')\n }\n }\n\n function addList(plugins) {\n var index = -1;\n\n if (plugins === null || plugins === undefined) ; else if (typeof plugins === 'object' && 'length' in plugins) {\n while (++index < plugins.length) {\n add(plugins[index]);\n }\n } else {\n throw new Error('Expected a list of plugins, not `' + plugins + '`')\n }\n }\n\n function addPlugin(plugin, value) {\n var entry = find(plugin);\n\n if (entry) {\n if (plain(entry[1]) && plain(value)) {\n value = extend$1(true, entry[1], value);\n }\n\n entry[1] = value;\n } else {\n attachers.push(slice$1.call(arguments));\n }\n }\n }", "function Plugin ( element, options ) {\n this.element = element;\n\t\t\t this.options = $.extend( {}, defaults, options) ;\n this._defaults = defaults;\n this._name = pluginName;\n this.init();\n }", "function use(value) {\n var settings;\n\n assertUnfrozen('use', frozen);\n\n if (value === null || value === undefined) {\n /* Empty */\n } else if (func(value)) {\n addPlugin.apply(null, arguments);\n } else if (typeof value === 'object') {\n if ('length' in value) {\n addList(value);\n } else {\n addPreset(value);\n }\n } else {\n throw new Error('Expected usable value, not `' + value + '`');\n }\n\n if (settings) {\n namespace.settings = extend(namespace.settings || {}, settings);\n }\n\n return processor;\n\n function addPreset(result) {\n addList(result.plugins);\n\n if (result.settings) {\n settings = extend(settings || {}, result.settings);\n }\n }\n\n function add(value) {\n if (func(value)) {\n addPlugin(value);\n } else if (typeof value === 'object') {\n if ('length' in value) {\n addPlugin.apply(null, value);\n } else {\n addPreset(value);\n }\n } else {\n throw new Error('Expected usable value, not `' + value + '`');\n }\n }\n\n function addList(plugins) {\n var length;\n var index;\n\n if (plugins === null || plugins === undefined) {\n /* Empty */\n } else if (typeof plugins === 'object' && 'length' in plugins) {\n length = plugins.length;\n index = -1;\n\n while (++index < length) {\n add(plugins[index]);\n }\n } else {\n throw new Error('Expected a list of plugins, not `' + plugins + '`');\n }\n }\n\n function addPlugin(plugin, value) {\n var entry = find(plugin);\n\n if (entry) {\n if (plain(entry[1]) && plain(value)) {\n value = extend(entry[1], value);\n }\n\n entry[1] = value;\n } else {\n attachers.push(slice.call(arguments));\n }\n }\n }", "function Plugin(element, options) {\n this.element = element;\n this.rangerin = {};\n this.$element = $(this.element);\n this.options = options;\n this.metadata = this.$element.data('options');\n this.settings = $.extend({}, defaults, this.options, this.metadata);\n this.init();\n }", "function Plugin(element, options) {\n this.element = element;\n this.init();\n }", "addPlugins(...plugins) {\n InstancePlugin.initPlugins(this, ...plugins);\n }", "function pluginInit( patternlab ) {\n\n // Create a helper for cleaner console logging.\n const log = (type, ...messages) => console[type](`${pluginName}:`, ...messages);\n\n // Exit if patterlab not set.\n if ( !patternlab ) {\n\n // Report error.\n log('error', 'patternlab object not provided to plugin-init');\n\n // Exit.\n process.exit(1);\n\n }\n\n // Get default plugin configurations.\n var pluginConfig = getPluginFrontendConfig();\n\n // Get project-specific plugin configurations.\n pluginConfig.tabsToAdd = patternlab.config.plugins[pluginName].options.tabsToAdd;\n\n // Write the plugin JSON to the `public/patternlab-components`.\n writeConfigToOutput(patternlab, pluginConfig);\n\n // Get the output path.\n var pluginConfigPathName = path.resolve(patternlab.config.paths.public.root, 'patternlab-components', 'packages');\n\n // Output configurations as JSON.\n try {\n\n fs.outputFileSync(pluginConfigPathName + '/' + pluginName + '.json', JSON.stringify(pluginConfig, null, 2));\n\n } catch (ex) {\n\n log('trace', 'Error occurred while writing pluginFile configuration');\n log('log', ex);\n\n }\n\n // Initialize patternlab plugins if no other plugins have been registered already.\n if( !patternlab.plugins ) patternlab.plugins = [];\n\n // Add the plugin configurations to the patternlab object.\n patternlab.plugins.push(pluginConfig);\n\n // Find plugin files.\n var pluginFiles = glob.sync(path.join(__dirname, '/dist/**/*'));\n\n // Identity component files.\n var componentFiles = [\n 'markup-templating'\n ];\n\n // Load the plugin.\n if( pluginFiles && pluginFiles.length > 0 ) {\n\n // Get JS snippet.\n let tab_frontend_snippet = fs.readFileSync(path.resolve(__dirname + '/src/snippet.js'), 'utf8');\n\n // Load each plugin file.\n pluginFiles.forEach((pluginFile) => {\n\n // Make sure the file exists.\n if ( fs.existsSync(pluginFile) && fs.statSync(pluginFile).isFile() ) {\n\n // Get file paths.\n let relativePath = path.relative(__dirname, pluginFile).replace('dist', '');\n let writePath = path.join(patternlab.config.paths.public.root, 'patternlab-components', 'pattern-lab', pluginName, relativePath);\n\n // A message to future plugin authors:\n // Depending on your plugin's job, you might need to alter the dist file instead of copying.\n // If you are simply copying `dist` files, you can probably do the below:\n // fs.copySync(pluginFile, writePath);\n\n // In this case, we need to alter the `dist` file to loop through our tabs to load as defined in the `package.json`.\n // We are also being a bit lazy here, since we only expect one file.\n let tabJSFileContents = fs.readFileSync(pluginFile, 'utf8');\n\n // Initialize an empty string of parsed JS snippets.\n let snippetString = '';\n\n // Initialize an empty object for loading languages.\n let prismLanguages = {};\n\n // Initialize an empty array for loading components.\n let prismComponents = [];\n\n // Make sure some tabs should be parsed.\n if( pluginConfig.tabsToAdd && pluginConfig.tabsToAdd.length > 0 ) {\n\n // Parse the JS snippet for each tab.\n pluginConfig.tabsToAdd.forEach((lang) => {\n\n // Parse the snippet.\n let tabSnippetLocal = tab_frontend_snippet.replace(/<<type>>/g, lang).replace(/<<typeUC>>/g, lang.toUpperCase());\n\n // Save the snippet.\n snippetString += tabSnippetLocal + EOL;\n\n // Find the language.\n let tabLanguageLocal = loadPrismLanguage(lang);\n\n // Save the language.\n if( !prismLanguages[lang] && tabLanguageLocal ) prismLanguages[lang] = tabLanguageLocal;\n\n });\n\n // Load each component file.\n componentFiles.forEach((componentFile) => {\n\n // Attempt to load the component file.\n const component = loadPrismComponent(componentFile);\n\n // Generate the output file.\n if( component ) prismComponents.push(component);\n\n });\n\n // Generate the output file.\n tabJSFileContents = tabJSFileContents.replace('/*SNIPPETS*/', snippetString).replace('/*LANGUAGES*/', Object.values(prismLanguages).join(EOL)).replace('/*COMPONENTS*/', prismComponents.join('\\n'));\n\n // Save the output file for use in the browser.\n fs.outputFileSync(writePath, tabJSFileContents);\n\n }\n\n }\n\n });\n\n }\n\n // Setup listeners if not already active. We also enable and set the plugin as initialized.\n if( !patternlab.config.plugins ) patternlab.config.plugins = {};\n\n // Attempt to only register events once.\n if( patternlab.config.plugins[pluginName] !== undefined && patternlab.config.plugins[pluginName].enabled && !patternlab.config.plugins[pluginName].initialized ) {\n\n // Register events.\n registerEvents(patternlab);\n\n // Set the plugin initialized flag to `true` to indicate it is installed and ready.\n patternlab.config.plugins[pluginName].initialized = true;\n\n }\n\n}", "function Plugin(element, options) {\n\t\tthis.element = element;\n\t\tthis.options = $.extend({}, defaults, options);\n\t\tthis._defaults = defaults;\n\t\tthis._name = pluginName;\n\n this.init();\n\n\t}", "function parseAndGivePlugins(pluginMeta, container) {\n\t//Build the buffer animation\n\tbuildLoader = \"\\\n\t\t<div id='loadingSign'>\\\n\t\t\t<img src='http://blogy.co/Library/images/loadSign_white.gif'/>\\\n\t\t</div>\\\n\t\";\n\t$(container).append(buildLoader);\n\n\tpluginName = pluginMeta.split(\"~\")[0];\n\tpluginSlug = pluginMeta.split(\"~\")[1];\n\tpluginAuthor = pluginMeta.split(\"~\")[2];\n\n\tvar requestType;\n\tif (window.XMLHttpRequest) {\n\t\trequestType = new XMLHttpRequest();\n\t} else {\n\t\trequestType = new ActiveXObject(\"Microsoft.XMLHTTP\");\n\t}\n\trequestType.open(\"POST\", \"giveMePlugin.php\", true);\n\trequestType.setRequestHeader(\"Content-type\",\"application/x-www-form-urlencoded\");\n\trequestType.send(\"pluginName=\"+pluginName+\"&pluginSlug=\"+pluginSlug+\"&pluginAuthor=\"+pluginAuthor);\n\n\trequestType.onreadystatechange = function() {\n\t\tif (requestType.readyState == 4 && requestType.status == 200) {\n\t\t\t$(container).children(\"#loadingSign\").remove();\n\t\t\t$(container+\" #\"+pluginSlug).remove();\n\t\t\t$(container).append(requestType.responseText);\n\t\t}\n\t}\n}", "function Plugin( element, options, names) {\n this.element = element;\n \n this.last = null;\n \n options = options || function(){console.log('Test');return {};};\n\n this.options = $.extend( {}, defaults, options) ;\n\n this.names = $.extend( {}, team, names) ;\n \n this._defaults = defaults;\n\n this._name = pluginName;\n \n this.init();\n }", "function use(value) {\n var settings\n\n assertUnfrozen('use', frozen)\n\n if (value === null || value === undefined) {\n // Empty.\n } else if (typeof value === 'function') {\n addPlugin.apply(null, arguments)\n } else if (typeof value === 'object') {\n if ('length' in value) {\n addList(value)\n } else {\n addPreset(value)\n }\n } else {\n throw new Error('Expected usable value, not `' + value + '`')\n }\n\n if (settings) {\n namespace.settings = extend(namespace.settings || {}, settings)\n }\n\n return processor\n\n function addPreset(result) {\n addList(result.plugins)\n\n if (result.settings) {\n settings = extend(settings || {}, result.settings)\n }\n }\n\n function add(value) {\n if (typeof value === 'function') {\n addPlugin(value)\n } else if (typeof value === 'object') {\n if ('length' in value) {\n addPlugin.apply(null, value)\n } else {\n addPreset(value)\n }\n } else {\n throw new Error('Expected usable value, not `' + value + '`')\n }\n }\n\n function addList(plugins) {\n var length\n var index\n\n if (plugins === null || plugins === undefined) {\n // Empty.\n } else if (typeof plugins === 'object' && 'length' in plugins) {\n length = plugins.length\n index = -1\n\n while (++index < length) {\n add(plugins[index])\n }\n } else {\n throw new Error('Expected a list of plugins, not `' + plugins + '`')\n }\n }\n\n function addPlugin(plugin, value) {\n var entry = find(plugin)\n\n if (entry) {\n if (plain(entry[1]) && plain(value)) {\n value = extend(entry[1], value)\n }\n\n entry[1] = value\n } else {\n attachers.push(slice.call(arguments))\n }\n }\n }", "function Plugin ( element, options ) {\n this.element = element;\n this.settings = $.extend( {}, defaults, options );\n this._name = pluginName;\n this.init();\n }", "use(pluginFn, options) {\n this.plugins.push({\n fn: pluginFn,\n options,\n });\n return this;\n }", "function use(value) {\n var settings\n\n assertUnfrozen('use', frozen)\n\n if (value === null || value === undefined) {\n // Empty.\n } else if (typeof value === 'function') {\n addPlugin.apply(null, arguments)\n } else if (typeof value === 'object') {\n if ('length' in value) {\n addList(value)\n } else {\n addPreset(value)\n }\n } else {\n throw new Error('Expected usable value, not `' + value + '`')\n }\n\n if (settings) {\n namespace.settings = extend(namespace.settings || {}, settings)\n }\n\n return processor\n\n function addPreset(result) {\n addList(result.plugins)\n\n if (result.settings) {\n settings = extend(settings || {}, result.settings)\n }\n }\n\n function add(value) {\n if (typeof value === 'function') {\n addPlugin(value)\n } else if (typeof value === 'object') {\n if ('length' in value) {\n addPlugin.apply(null, value)\n } else {\n addPreset(value)\n }\n } else {\n throw new Error('Expected usable value, not `' + value + '`')\n }\n }\n\n function addList(plugins) {\n var index = -1\n\n if (plugins === null || plugins === undefined) {\n // Empty.\n } else if (typeof plugins === 'object' && 'length' in plugins) {\n while (++index < plugins.length) {\n add(plugins[index])\n }\n } else {\n throw new Error('Expected a list of plugins, not `' + plugins + '`')\n }\n }\n\n function addPlugin(plugin, value) {\n var entry = find(plugin)\n\n if (entry) {\n if (plain(entry[1]) && plain(value)) {\n value = extend(true, entry[1], value)\n }\n\n entry[1] = value\n } else {\n attachers.push(slice.call(arguments))\n }\n }\n }", "function use(value) {\n var settings\n\n assertUnfrozen('use', frozen)\n\n if (value === null || value === undefined) {\n // Empty.\n } else if (typeof value === 'function') {\n addPlugin.apply(null, arguments)\n } else if (typeof value === 'object') {\n if ('length' in value) {\n addList(value)\n } else {\n addPreset(value)\n }\n } else {\n throw new Error('Expected usable value, not `' + value + '`')\n }\n\n if (settings) {\n namespace.settings = extend(namespace.settings || {}, settings)\n }\n\n return processor\n\n function addPreset(result) {\n addList(result.plugins)\n\n if (result.settings) {\n settings = extend(settings || {}, result.settings)\n }\n }\n\n function add(value) {\n if (typeof value === 'function') {\n addPlugin(value)\n } else if (typeof value === 'object') {\n if ('length' in value) {\n addPlugin.apply(null, value)\n } else {\n addPreset(value)\n }\n } else {\n throw new Error('Expected usable value, not `' + value + '`')\n }\n }\n\n function addList(plugins) {\n var index = -1\n\n if (plugins === null || plugins === undefined) {\n // Empty.\n } else if (typeof plugins === 'object' && 'length' in plugins) {\n while (++index < plugins.length) {\n add(plugins[index])\n }\n } else {\n throw new Error('Expected a list of plugins, not `' + plugins + '`')\n }\n }\n\n function addPlugin(plugin, value) {\n var entry = find(plugin)\n\n if (entry) {\n if (plain(entry[1]) && plain(value)) {\n value = extend(true, entry[1], value)\n }\n\n entry[1] = value\n } else {\n attachers.push(slice.call(arguments))\n }\n }\n }", "function Plugin(element, options) {\r\n this.element = element;\r\n\r\n this.settings = $.extend({}, defaults, options);\r\n this._defaults = defaults;\r\n this._name = pluginName;\r\n\r\n\r\n this.init();\r\n }", "function Plugin (element, options) {\n this.element = element;\n this.settings = $.extend({}, defaults, options);\n this._defaults = defaults;\n this._name = pluginName;\n this.init();\n }", "function Plugin(element, options) {\n this.$element = $(element);\n this.$submit = this.$element.find('button[type=\"submit\"]');\n // jQuery has an extend method that merges the\n // contents of two or more objects, storing the\n // result in the first object. The first object\n // is generally empty because we don't want to alter\n // the default options for future instances of the plugin\n var metadata = this.$element.data();\n this.options = $.extend({}, defaults, options, metadata);\n //\n this._defaults = defaults;\n this._name = pluginName;\n\n //\n this.init();\n }", "function Plugin ( element, options ) {\n\t\t\t\tthis.element = element;\n\t\t\t\tthis.settings = $.extend( {}, defaults, options );\n\t\t\t\tthis._defaults = defaults;\n\t\t\t\tthis._name = pluginName;\n\t\t\t\tthis.init();\n\t\t\t\t\n\n\t\t\t\t\t\t\t\n\t\t}", "function Plugin(element, options) {\r\n this.element = element;\r\n\r\n this.settings = $.extend({}, defaults, options);\r\n this._defaults = defaults;\r\n this._name = pluginName;\r\n this._currentUserId = window.currentUserId;\r\n this._currentCompanyId = window.currentCompanyId;\r\n this._uploadmgrContainer = null;//上传容器\r\n this._contactAttachList = [];//关联合同-上传的合同附件\r\n this._attachList = null;//查询的合同列表\r\n\r\n this._title = '收款';\r\n if(this.settings.doType==1){//付款\r\n this.settings.title = '添加付款计划';\r\n this._title = '付款';\r\n }\r\n\r\n this.init();\r\n }", "function addPreset(name,definition){definition=definition||{};definition.methods=definition.methods||[];definition.options=definition.options||function(){return{};};if(/^cancel|hide|show$/.test(name)){throw new Error(\"Preset '\"+name+\"' in \"+interimFactoryName+\" is reserved!\");}if(definition.methods.indexOf('_options')>-1){throw new Error(\"Method '_options' in \"+interimFactoryName+\" is reserved!\");}providerConfig.presets[name]={methods:definition.methods.concat(EXPOSED_METHODS),optionsFactory:definition.options,argOption:definition.argOption};return provider;}", "function Plugin( element, options ) {\n this.element = element;\n\n this.options = $.extend({ done: function(){} }, defaults, options);\n\n this._defaults = defaults;\n this._name = pluginName;\n\n this.start();\n }", "function Plugin(element, options) {\r\r\n this.element = element;\r\r\n this.options = $.extend({}, defaults, options);\r\r\n this._defaults = defaults;\r\r\n this._name = pluginName;\r\r\n this.init();\r\r\n }", "function Plugin ( element, options ) {\n\t\t\tthis.element = element;\n\t\t\tthis.settings = $.extend( {}, defaults, options );\n\t\t\tthis._defaults = defaults;\n\t\t\tthis._name = pluginName;\n\t\t\tthis.init();\n\t\t}", "function Plugin ( element, options ) {\n\t\t\tthis.element = element;\n\t\t\tthis.settings = $.extend( {}, defaults, options );\n\t\t\tthis._defaults = defaults;\n\t\t\tthis._name = pluginName;\n\t\t\tthis.init();\n\t\t}", "function Plugin ( element, options ) {\n\t\tthis.element = element;\n\t\tthis.settings = $.extend( {}, defaults, options );\n\t\tthis._defaults = defaults;\n\t\tthis._name = pluginName;\n\t\tthis.init();\n\t}", "function Plugin ( element, options ) {\n\t\tthis.element = element;\n\t\tthis.settings = $.extend( {}, defaults, options );\n\t\tthis._defaults = defaults;\n\t\tthis._name = pluginName;\n\t\tthis.init();\n\t}", "function Plugin (element, options) {\n\t\t\tthis.element = element;\n\t\t\tthis.settings = $.extend({}, defaults, options);\n\t\t\tthis._defaults = defaults;\n\t\t\tthis._name = pluginName;\n\t\t\tthis.init();\n\t\t}", "function Plugin(element, options) {\n if (typeof options === \"string\") {\n this.methods[options](this, element, options);\n return;\n }\n\n this.options = $.extend({}, defaults, options);\n this._defaults = defaults;\n this._name = pluginName;\n this.init(element);\n }", "function Plugin ( element, options ) {\r\n\t\t\t\t//Nome do plugin\r\n\t\t\t\tthis._name = pluginName;\r\n\t\t\t\t//Valores padroes de configuraçoes\r\n\t\t\t\tthis._defaults = defaults;\r\n\t\t\t\t//Elemento passado na chamada do plugin pelo seletor JQuery\r\n\t\t\t\tthis.element = element;\r\n\t\t\t\t//Container, objeto externo que envolve o formulario\r\n\t\t\t\tthis._container = $(element).parent();\r\n\r\n\t\t\t\t// jQuery has an extend method which merges the contents of two or\r\n\t\t\t\t// more objects, storing the result in the first object. The first object\r\n\t\t\t\t// is generally empty as we don't want to alter the default options for\r\n\t\t\t\t// future instances of the plugin\r\n\t\t\t\t//pega dois ou mais objetos como argumentos e une seus conteúdos dentro do primeiro objeto.\r\n\t\t\t\tthis.settings = $.extend( {}, defaults, options );\r\n\t\t\t\t//Inicia o plugin\r\n\t\t\t\tthis.init();\r\n\t\t}", "function Plugin ( element, options ) {\n this.element = element;\n this.settings = $.extend( {}, defaults, options );\n this._defaults = defaults;\n\n this._name = pluginName;\n this.init();\n }", "function Plugin( element, options ) {\n this.element = element;\n this.options = $.extend( {}, defaults, options );\n this._defaults = defaults;\n this._name = pluginName;\n this.init();\n }", "function Plugin( element, options ) {\n\n //SET OPTIONS\n this.options = $.extend( {}, defaults, options );\n this._defaults = defaults;\n this._name = pluginName;\n\n //REGISTER ELEMENT\n this.$element = $(element);\n\n //INITIALIZE\n this.init();\n }", "function Plugin(element, options) {\n this.element = element;\n this.options = $.extend({}, defaults, options);\n this._defaults = defaults;\n this._name = pluginName;\n\n this.init();\n }", "function Plugin( element, options ) {\n\t\tthis.element = element;\n\t\tthis.$el = $(element);\n\n\t\tthis.options = $.extend( {}, defaults, options) ;\n\n\t\tthis._defaults = defaults;\n\t\tthis._name = pluginName;\n\n\t\tthis.init();\n\t}", "function Plugin ( element, options ) {\n\t\t\t\tthis.element = element;\n\t\t\t\tthis.settings = $.extend( {}, defaults, options );\n\t\t\t\tthis._defaults = defaults;\n\t\t\t\tthis._name = pluginName;\n\t\t\t\tthis.init();\n\t\t}", "function Plugin ( element, options ) {\n\t\t\t\tthis.element = element;\n\t\t\t\tthis.settings = $.extend( {}, defaults, options );\n\t\t\t\tthis._defaults = defaults;\n\t\t\t\tthis._name = pluginName;\n\t\t\t\tthis.init();\n\t\t}", "_setPlugins() {\n this.config.plugins = {\n // Systems\n global: [\n { key: 'RoomSystem', plugin: Systems.RoomSystem, start: false, mapping: 'rooms' },\n { key: 'CursorSystem', plugin: Systems.CursorSystem, start: false, mapping: 'cursors' }\n ],\n // Managers\n scene: [\n { key: 'UpdateManager', plugin: Managers.UpdateManager, mapping: 'updates' },\n { key: 'LightSourceManager', plugin: Managers.LightSourceManager, mapping: 'lightSources' },\n { key: 'LayerManager', plugin: Managers.LayerManager, mapping: 'layers' }\n ]\n };\n }", "function Plugin( element, options ) {\n this.element = element;\n\n // jQuery has an extend method that merges the\n // contents of two or more objects, storing the\n // result in the first object. The first object\n // is generally empty because we don't want to alter\n // the default options for future instances of the plugin\n this.options = $.extend( {}, defaults, options) ;\n\n this._defaults = defaults;\n this._name = pluginName;\n this._filters = {};\n\n this.init();\n }", "function Plugin ( element, options ) {\n\n\t\tthis.element = element;\n\t\tthis.$elem = $(this.element);\n\n\t\tthis.settings = $.extend( {}, defaults, options );\n\t\tthis._defaults = defaults;\n\t\tthis._name = pluginName;\n\n\t\tthis.init();\n\n\t}", "function Plugin ( element, options ) {\n\t\tthis.element = element;\n\t\t// jQuery has an extend method which merges the contents of two or\n\t\t// more objects, storing the result in the first object. The first object\n\t\t// is generally empty as we don't want to alter the default options for\n\t\t// future instances of the plugin\n\t\tthis.settings = $.extend({}, defaults, options);\n \tthis.settings.sub = $(this.settings.sub);\n \tthis.settings.link = $(this.settings.link);\n\t\tthis._defaults = defaults;\n\t\tthis._name = pluginName;\n\t\tthis.init();\n\t}", "function Plugin( element, options ) {\n this.element = element;\n\n // jQuery has an extend method which merges the contents of two or \n // more objects, storing the result in the first object. The first object\n // is generally empty as we don't want to alter the default options for\n // future instances of the plugin\n this.options = $.extend( {}, defaults, options) ;\n \n this._defaults = defaults;\n this._name = pluginName;\n \n this.init();\n }", "function Plugin ( element, options ) {\n\t\t\t\tthis.element = element;\n\t\t\t\tthis.$element = $(element);\n\t\t\t\tthis.settings = $.extend( {}, defaults, options );\n\t\t\t\tthis._defaults = defaults;\n\t\t\t\tthis._name = pluginName;\n\t\t\t\tthis.init();\n\t\t}", "function Plugin (element, options) {\n this.element = element;\n // jQuery has an extend method which merges the contents of two or\n // more objects, storing the result in the first object. The first object\n // is generally empty as we don't want to alter the default options for\n // future instances of the plugin\n this.options = $.extend({}, defaults, options);\n this._defaults = defaults;\n this._name = pluginName;\n this.init();\n }", "function Plugin(element, options) {\n this.element = element;\n this.settings = $.extend({}, defaults, options);\n this._defaults = defaults;\n this._name = pluginName;\n this.init();\n }", "function Plugin(element, options) {\n this.element = element;\n this.settings = $.extend({}, defaults, options);\n this._defaults = defaults;\n this._name = pluginName;\n this.init();\n }", "function processOptions(options) {\n\t // Parse preset names\n\t var presets = (options.presets || []).map(function (presetName) {\n\t if (typeof presetName === 'string') {\n\t var preset = availablePresets[presetName];\n\t if (!preset) {\n\t throw new Error('Invalid preset specified in Babel options: \"' + presetName + '\"');\n\t }\n\t return preset;\n\t } else {\n\t // Could be an actual preset module\n\t return presetName;\n\t }\n\t });\n\n\t // Parse plugin names\n\t var plugins = (options.plugins || []).map(function (pluginName) {\n\t if (typeof pluginName === 'string') {\n\t var plugin = availablePlugins[pluginName];\n\t if (!plugin) {\n\t throw new Error('Invalid plugin specified in Babel options: \"' + pluginName + '\"');\n\t }\n\t return plugin;\n\t } else {\n\t // Could be an actual plugin module\n\t return pluginName;\n\t }\n\t });\n\n\t return _extends({}, options, {\n\t presets: presets,\n\t plugins: plugins\n\t });\n\t}", "function processOptions(options) {\n\t // Parse preset names\n\t var presets = (options.presets || []).map(function (presetName) {\n\t if (typeof presetName === 'string') {\n\t var preset = availablePresets[presetName];\n\t if (!preset) {\n\t throw new Error('Invalid preset specified in Babel options: \"' + presetName + '\"');\n\t }\n\t return preset;\n\t } else {\n\t // Could be an actual preset module\n\t return presetName;\n\t }\n\t });\n\n\t // Parse plugin names\n\t var plugins = (options.plugins || []).map(function (pluginName) {\n\t if (typeof pluginName === 'string') {\n\t var plugin = availablePlugins[pluginName];\n\t if (!plugin) {\n\t throw new Error('Invalid plugin specified in Babel options: \"' + pluginName + '\"');\n\t }\n\t return plugin;\n\t } else {\n\t // Could be an actual plugin module\n\t return pluginName;\n\t }\n\t });\n\n\t return _extends({}, options, {\n\t presets: presets,\n\t plugins: plugins\n\t });\n\t}", "addPlugin(pluginName, implementation) {\n this.loaderPlugins[pluginName] = implementation;\n }", "function Plugin( element, options ) {\n this.element = element;\n\n this.options = $.extend( {}, defaults, options );\n\n this._defaults = defaults;\n this._name = pluginName;\n\n this.init();\n }", "addPlugin(config, options) {\n this.plugins.push(plugin(config, options, this))\n return this\n }", "function Plugin( element, options ) {\n \n this.element = element;\n\n // jQuery has an extend method that merges the\n // contents of two or more objects, storing the\n // result in the first object. The first object\n // is generally empty because we don't want to alter\n // the default options for future instances of the plugin\n this.options = $.extend( {}, defaults, options) ;\n\n this._defaults = defaults;\n this._name = pluginName;\n\n this.init();\n }", "function Plugin ( element, options ) {\n\t\t\t\tthis.element = element;\n\t\t\t\t// jQuery has an extend method which merges the contents of two or\n\t\t\t\t// more objects, storing the result in the first object. The first object\n\t\t\t\t// is generally empty as we don't want to alter the default options for\n\t\t\t\t// future instances of the plugin\n\t\t\t\tthis.options = $.extend( {}, defaults, options );\n\t\t\t\tthis._defaults = defaults;\n\t\t\t\tthis._name = pluginName;\n\t\t\t\tthis.init();\n\t\t}", "function Plugin(element, options) {\n this.element = element;\n\n this.options = $.extend({}, defaults, options);\n\n this._defaults = defaults;\n this._name = pluginName;\n\n this.init();\n }", "function Plugin( element, options ) {\n\t\tthis.element = $(element);\n\n\t\tthis.options = $.extend( {}, defaults, options) ;\n\n\t\tthis._defaults = defaults;\n\t\tthis._name = pluginName;\n\n\t\tthis.init();\n\t}", "function Plugin(element, options) {\n this.element = element;\n this.$element = $(element);\n this.options = $.extend({}, defaults, options);\n this._defaults = defaults;\n this._name = pluginName;\n this.dataTemple = dataTemple;\n this.init();\n }", "function Plugin(element, options) {\n this.element = element;\n\n this.settings = $.extend({}, defaults, options);\n this._defaults = defaults;\n this._name = pluginName;\n this.init();\n }", "function Plugin(element, options) {\n this.element = element;\n\n this.settings = $.extend({}, defaults, options);\n this._defaults = defaults;\n this._name = pluginName;\n this.init();\n }", "function Plugin( element, options ) {\n this.$element = $(element);\n\n // jQuery has an extend method that merges the \n // contents of two or more objects, storing the \n // result in the first object. The first object \n // is generally empty because we don't want to alter \n // the default options for future instances of the plugin\n this.options = $.extend( {}, defaults, options);\n\n settings = $.extend( {}, defaults, options);\n \n this._defaults = defaults;\n this._name = camera;\n\n this.init();\n }", "function Plugin(element, options) {\r\n this.element = element;\r\n\r\n this.settings = $.extend({}, defaults, options);\r\n this._defaults = defaults;\r\n this._name = pluginName;\r\n this._projectProcess = null;\r\n this.init();\r\n }", "function Plugin(element, options) {\r\n this.element = element;\r\n\r\n this.settings = $.extend({}, defaults, options);\r\n this._defaults = defaults;\r\n this._name = pluginName;\r\n this.init();\r\n }", "function Plugin(element, options) {\r\n this.element = element;\r\n\r\n this.settings = $.extend({}, defaults, options);\r\n this._defaults = defaults;\r\n this._name = pluginName;\r\n this.init();\r\n }", "function Plugin ( element, options ) {\n\t\t\t\tthis.element = element;\n\t\t\t\t// jQuery has an extend method which merges the contents of two or\n\t\t\t\t// more objects, storing the result in the first object. The first object\n\t\t\t\t// is generally empty as we don't want to alter the default options for\n\t\t\t\t// future instances of the plugin\n\t\t\t\tthis.settings = $.extend( {}, defaults, options );\n\t\t\t\tthis._defaults = defaults;\n\t\t\t\tthis._name = pluginName;\n\t\t\t\tthis.init();\n\t\t}", "function Plugin ( element, options ) {\n\t\t\t\tthis.element = element;\n\t\t\t\t// jQuery has an extend method which merges the contents of two or\n\t\t\t\t// more objects, storing the result in the first object. The first object\n\t\t\t\t// is generally empty as we don't want to alter the default options for\n\t\t\t\t// future instances of the plugin\n\t\t\t\tthis.settings = $.extend( {}, defaults, options );\n\t\t\t\tthis._defaults = defaults;\n\t\t\t\tthis._name = pluginName;\n\t\t\t\tthis.init();\n\t\t}", "function Plugin ( element, options ) {\n\t\t\t\tthis.element = element;\n\t\t\t\t// jQuery has an extend method which merges the contents of two or\n\t\t\t\t// more objects, storing the result in the first object. The first object\n\t\t\t\t// is generally empty as we don't want to alter the default options for\n\t\t\t\t// future instances of the plugin\n\t\t\t\tthis.settings = $.extend( {}, defaults, options );\n\t\t\t\tthis._defaults = defaults;\n\t\t\t\tthis._name = pluginName;\n\t\t\t\tthis.init();\n\t\t}", "function Plugin ( element, options ) {\n\t\t\t\tthis.element = element;\n\t\t\t\t// jQuery has an extend method which merges the contents of two or\n\t\t\t\t// more objects, storing the result in the first object. The first object\n\t\t\t\t// is generally empty as we don't want to alter the default options for\n\t\t\t\t// future instances of the plugin\n\t\t\t\tthis.settings = $.extend( {}, defaults, options );\n\t\t\t\tthis._defaults = defaults;\n\t\t\t\tthis._name = pluginName;\n\t\t\t\tthis.init();\n\t\t}", "function Plugin ( element, options ) {\n this.element = element;\n this.settings = $.extend( {}, defaults, options );\n this._defaults = defaults;\n this._name = pluginName; \n this.init(this.settings.first_image, this.settings.first_section);\n }", "addPlugins() {\n const pm = PluginManager.getInstance();\n pm.addPlugin(new ElectronPlugin());\n }", "function Plugin( element, options, callback ) {\r\n $self = this;\r\n $self.element = element;\r\n\r\n $self.options = $.extend( {}, defaults, options) ;\r\n $self._name = pluginName;\r\n $self.callback = callback;\r\n $self.selectedElement = {};\r\n\r\n $self.init();\r\n }", "function Plugin ( element, options ) {\n this.element = element;\n // jQuery has an extend method which merges the contents of two or\n // more objects, storing the result in the first object. The first object\n // is generally empty as we don't want to alter the default options for\n // future instances of the plugin\n this.settings = $.extend( {}, defaults, options );\n this._defaults = defaults;\n this._name = pluginName;\n this.init();\n\n }", "function Plugin( element, options ) {\n this.element = element;\n\n // jQuery has an extend method which merges the contents of two or\n // more objects, storing the result in the first object. The first object\n // is generally empty as we don't want to alter the default options for\n // future instances of the plugin\n this.options = $.extend( {}, defaults, options) ;\n\n this._defaults = defaults;\n this._name = pluginName;\n\n this.init();\n }", "function Plugin(element, options) {\n this.element = $(element);\n this.settings = $.extend({}, defaults, options);\n this._defaults = defaults;\n this._name = pluginName;\n this._init();\n }", "function prePluginInit() {\n // Default options for the plug-in \n // Those can be pre defined or overridden in any of the following:\n // query string parameters in the script reference\n // hash tag parameters in the browser URL box\n // as the options parameter in the plug-in construction call\n // as meta tags in the enhanced element\n window.MI_defaults = {\n optimizeNames: true,\n useLinkTarget: false,\n useLinkTitle: false,\n mi_style: 'default',\n abtest: 'false',\n debug: 'false',\n tabs: ['mentions', 'photos', 'stats'],\n frameElements: ['statsPreview', 'mediaPreview', 'tags', 'shareLinks'],\n ex: [],\n includedSourceIds: [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, 103],\n widgetTextPosition: 'bottom',\n hidden: 'false',\n xOffset: 0,\n yOffset: 0,\n gaugeOrientation: 'left',\n vertical: 'all',\n inqa: false,\n RTL: false,\n lang: \"EN\",\n displayText: false,\n layout: 'inlinepanel',\n columnscount:2,\n allowExternalLinks: 'true',\n displayExternalLinksInline: 'true',\n collapseLines: 'true',\n displayShowMore: 'true',\n loadWhenInvisible: 'false',\n hover: false,\n doClientSide: false,\n template: 'RASTA',\n tabsType: \"TABS\",\n starsType: \"SMALL\",\n animationStyle: \"DEFAULT\",\n logo: \"//d34p6saz4aff9q.cloudfront.net/images/feelterfooter.png\",\n buttonType: \"DEFAULT\",\n lightbox: true\n\n };\n window.tempDictionary = window.tempDictionary ? window.tempDictionary : {\n socialItem: function(data, baseid) {\n var click = data.click;\n var si = data.modsi ? data.modsi : window.tempDictionary[window.MI_defaults.template].socialItem.normalItem.replace(\"@@@metaicon\", data.metaicon).replace(\"@@@cond\", (data.sourceURL == '' || window.MI_defaults.allowExternalLinks == 'false' ? 'style=\"cursor:default;direction:ltr!important;\"' : ' style=\"direction:ltr!important;\" onclick=\"' + click + '\"'))\n var item = window.tempDictionary[window.MI_defaults.template].socialItem.nonTimelineItem.replace(/@@@itemImageURL/g, data.itemImageURL);\n si = si.replace(\"@@@item\", item)\n\n si = si.replace(/@@@itemImageURL/g, data.itemImageURL)\n si = si.replace(/@@@itempublisher/g, (data.itemPublisher.length > 18 ? data.itemPublisher.substring(0, 17) + '...' : data.itemPublisher))\n si = si.replace(/@@@timeago/g, data.timeAgo)\n si = si.replace(/@@@itemDate/g, data.itemDate)\n si = si.replace(/@@@sourceURL/g, data.sourceURL != 'undefined' ? \"\" : data.sourceURL.replace('http://www.youtube.com/', ''))\n si = si.replace(/@@@sourceAvatar/g, item).replace(/@@@itemtext/g, data.moditemText)\n si = si.replace(/@@@itemWidth/g, (typeof data.itemTimeLine != 'undefined' ? '250' : '275') + 'px')\n si = si.replace(/@@@sourceSite/g, (data.source.replace('.com', '').replace('www.', '').replace('.', '').replace('.', '')).trim())\n if (data.regarding) si = si.replace('</th>', '<span style=\"position: inherit;margin-right: 3px;color: #ccc;\">On</span>' + data.regarding.capitalize() + '</th>');\n if (window.MI_defaults.lang != 'EN')\n si += '<div class=\"mi_translate\" onclick=\"window.MI_logUsage(\\'translate_clicked\\',\\'' + baseid + '\\',\\'' + window.MI_defaults.lang + '\\');jQuery.MidasInsight.translate(\\'' + data.ksid + '\\');event.stopPropagation();\" style=\"color: #49b7e6;font-size:12px;height:24px;float:left;\">' + window.langDictionary[window.MI_defaults.lang].translate + '</div>';\n if (data.itemContentImageURL && data.itemContentImageURL.indexOf('/') == -1) data.itemContentImageURL = '';\n if (data.itemContentImageURL && data.itemContentImageURL.indexOf('//') < 0) data.itemContentImageURL = '//' + data.itemContentImageURL;\n if (data.itemContentImageURL && data.itemContentImageURL.indexOf('.') > -1) {\n if (!jQuery.MidasInsight.ObjDictionary[baseid].gallery) jQuery.MidasInsight.ObjDictionary[baseid].gallery = [{\n href: '//d34p6saz4aff9q.cloudfront.net/img/feelter.png'\n }];\n //jQuery.MidasInsight.ObjDictionary[baseid].gallery.push({ href: data.itemContentImageURL, title: data.itemPublisher })\n //data.galleryindex = jQuery.MidasInsight.ObjDictionary[baseid].gallery.length - 1;\n //if (window.MI_defaults.lightbox == true && !(data.source.indexOf(\"facebook\") > -1)) {\n si += window.tempDictionary[window.MI_defaults.template].socialItem.lightboxContentImage.replace(/@@@itemcontentimage/g, data.itemContentImageURL).replace(/@@@ksid/g, data.ksid).replace(/@@@kfid/g, baseid);\n\n //} else {\n // si += window.tempDictionary[window.MI_defaults.template].socialItem.itemContentImage.replace(\"@@@itemcontentimage\", data.itemContentImageURL);\n\n //}\n }\n si += '</td></tr></table>'\n si += '</div>';\n si = si.replace(/@@@click/g, '');\n\n data.modsi = si;\n },\n socialItemneweggItem: function(data, baseid) {\n data.moditemText = data.moditemText.replace(/Pros:/g, '<span style=\"font-weight:bold\">Pros:</span>').replace(/Cons:/g, '<span style=\"font-weight:bold\">Cons:</span>').replace(/Other Thoughts:/g, '<span style=\"font-weight:bold\">Other Thoughts:</span>')\n window.tempDictionary.socialItem(data, baseid);\n },\n socialItemShowInPhotosTab: function(data, baseid) {\n data.click = ' ';\n window.tempDictionary.socialItem(data, baseid);\n },\n socialItemflickrItem: function(data, baseid) {\n window.tempDictionary.socialItemShowInPhotosTab(data, baseid);\n },\n socialIteminstagramItem: function(data, baseid) {\n data.click = ' ';\n data.modsi = window.tempDictionary[window.MI_defaults.template].socialItem.instagramItem.replace(\"@@@metaicon\", data.metaicon).replace(\"@@@cond\", (data.sourceURL == '' || window.MI_defaults.allowExternalLinks == 'false' ? 'style=\"cursor:default;direction:ltr!important;\"' : ' style=\"direction:ltr!important;\" onclick=\"' + data.click + '\"'))\n window.tempDictionary.socialItem(data, baseid);\n },\n socialItempinterestItem: function(data, baseid) {\n window.tempDictionary.socialItemShowInPhotosTab(data, baseid);\n },\n socialItemyoutubeItem: function(data, baseid) {\n //if (!jQuery.MidasInsight.ObjDictionary[baseid].gallery) jQuery.MidasInsight.ObjDictionary[baseid].gallery = [];\n var vurl = data.sourceURL.replace('http://www.youtube.com/', '//www.youtube.com/watch?v=');\n jQuery.MidasInsight.AddtoGallery(baseid, {\n href: vurl,\n title: data.itemPublisher\n });\n //jQuery.MidasInsight.ObjDictionary[baseid].gallery.push({ href: data.sourceURL.replace('http://www.youtube.com/', '//www.youtube.com/watch?v='), title: data.itemPublisher })\n var click = \"window.MI_logUsage('play_video','\" + baseid + \"','youtube'); jQuery.MidasInsight.ShowLightBoxURL('\" + vurl + \"','\" + baseid + \"')\";\n var item = window.tempDictionary[window.MI_defaults.template].socialItem.nonTimelineItem;\n item = item.replace(/@@@itemImageURL/g, data.itemImageURL)\n var si = window.tempDictionary[window.MI_defaults.template].socialItem.lightboxYoutubeItem\n .replace(/@@@youtubeid/g, data.sourceURL.split('/')[data.sourceURL.split('/').length - 1]);\n data.modsi = si.replace(/@@@itemDate/g, data.itemDate)\n .replace(/@@@click/g, click)\n .replace(/@@@itemImageURL/g, data.itemImageURL)\n .replace(/@@@itemPublisher/g, (data.itemPublisher.length > 18 ? data.itemPublisher.substring(0, 17) + '...' : data.itemPublisher))\n .replace(/@@@ksid/g, data.ksid)\n .replace(/@@@timeAgo/g, data.timeAgo)\n .replace(/@@@sourceURL/g, data.sourceURL.replace('http://www.youtube.com/', ''))\n .replace(/@@@sourceAvatar/g, item)\n .replace(/@@@itemText/g, data.moditemText)\n .replace(/@@@itemWidth/g, (typeof data.itemTimeLine != 'undefined' ? '250' : '275') + 'px')\n .replace(/@@@sourceSite/g, (data.source.replace('.com', '').replace('www.', '').replace('.', '').replace('.', '')).trim())\n },\n socialItemvimeoItem: function(data, baseid) {\n //debugger;\n //if (!jQuery.MidasInsight.ObjDictionary[baseid].gallery) jQuery.MidasInsight.ObjDictionary[baseid].gallery = [];\n var vurl = data.sourceURL;\n jQuery.MidasInsight.AddtoGallery(baseid, {\n href: vurl,\n title: data.itemPublisher\n });\n\n //jQuery.MidasInsight.ObjDictionary[baseid].gallery.push({\n // href: data.sourceURL//.replace('vimeo.com/', 'player.vimeo.com/video/')\n // , title: data.itemPublisher\n //})\n var click = \"window.MI_logUsage('play_video','\" + baseid + \"','vimeo'); jQuery.MidasInsight.ShowLightBoxURL('\" + vurl + \"','\" + baseid + \"')\";\n var item = window.tempDictionary[window.MI_defaults.template].socialItem.nonTimelineItem;\n item = item.replace(/@@@itemImageURL/g, data.itemImageURL)\n var si = window.tempDictionary[window.MI_defaults.template].socialItem.lightboxVimeoItem;\n data.modsi = si.replace(/@@@itemDate/g, data.itemDate)\n .replace(/@@@click/g, click)\n .replace(/@@@itemImageURL/g, data.itemImageURL)\n .replace(/@@@itemPublisher/g, (data.itemPublisher.length > 18 ? data.itemPublisher.substring(0, 17) + '...' : data.itemPublisher))\n .replace(/@@@ksid/g, data.ksid)\n .replace(/@@@timeAgo/g, data.timeAgo)\n .replace(/@@@sourceURL/g, data.sourceURL.replace('vimeo.com/', 'player.vimeo.com/video/'))\n .replace(/@@@sourceAvatar/g, item)\n .replace(/@@@itemContentImageURL/g, data.itemContentImageURL)\n .replace(/@@@itemText/g, data.moditemText)\n .replace(/@@@itemWidth/g, (typeof data.itemTimeLine != 'undefined' ? '250' : '275') + 'px')\n .replace(/@@@sourceSite/g, (data.source.replace('.com', '').replace('www.', '').replace('.', '').replace('.', '')).trim())\n\n },\n DEFAULT: {\n panelLayout: {\n header: [\"tabs\"],\n content: [\"stars\", \"photos\", \"tags\", \"mentions\"],\n footer: [\"share\"]\n },\n panel: {\n videoholder: '<div id=\"mi_videoholder_@@@baseid\" class=\"mi_singlevideocontainer mi_closeTopLeft\" onclick=\"jQuery.MidasInsight.MI_GetPhotos(\\'@@@baseid\\',false)\"><div class=\"mi_singlevideo\"></div></div>',\n containerHtml: '<div style=\"padding:5px;\" class=\"mi_panelBackground mikfpanel\" id=\"cpcnt_@@@kfid\" style=\"direction: ltr;@@@layout\"></div>',\n tabs: '<tr><td><div class=\"MI_tabs@@@orientation\" style=\"margin-left:-3px!important;display:inline-block;width:100%;padding-top:10px;\">@@@tabs</div></td></tr>',\n gauge: '<div class=\"mi_gradeselectgradbg\"></div><div class=\"mi_gradeselectmasknerrow' + (window.MI_defaults.RTL == 'true' ? ' mi_gradeselectmasknerrow_right' : '') + '\"></div><div class=\"mi_gradeselecthandlenerrow\"></div><div class=\"mi_gradeselectdigitsnerrow\" ' + (window.MI_defaults.RTL == 'true' ? 'style=\"direction:ltr!important;\"' : 'style=\"direction:ltr;\"') + '><span style=\"font-size: 48px;z-index: 3;color: #92c83e;font-family: \\'Source Sans Pro\\', Alef!important;\"></span><span class=\"mi_gradeselectdigitsnerrow_after\">/ 100</span></div><div class=\"mi_gradeselecttext\"></div>',\n tag: '<span onclick=\"jQuery.MidasInsight.tagClicked(\\'@@@kfid\\',\\'@@@atags\\')\" class=\\'mi_tag_@@@atagsreplace mi_tag\\'>@@@atagscap <span style=\"display:;color:@@@color;-webkit-font-smoothing: antialiased;padding: 0;margin-bottom: 0;margin-left: 0;margin-top: 3px;text-shadow: @@@color 0 0 0.3px,1px 1px 1px white;background-color: transparent;line-height: 10px;nobox-shadow:inset 1px 1px 2px -1px lightslategray;padding: 0px 2px 1px 3px;border-radius: 50%;left: 4px;position: relative;\">&#9733;</span></span>',\n slidercontainer: '<div id=\"mi_previewPhotosContainer_@@@kfid\" style=\"max-width: 465px;cursor:default;-moz-user-select:none;-webkit-user-select:none; -ms-user-select:none; user-select:none;\" unselectable=\"on\" onselectstart=\"return false;\"><table class=\"mi_previewPhotosContainer\" style=\"\" cellspacing=\"0\" onclick=\"jQuery.MidasInsight.MI_GetPhotos(\\'@@@kfid\\',false)\"><tr>',\n photopreview: '<tr ><td id=\"mi_photopreview_@@@kfid\" colspan=\"2\" style=\"width:100%;overflow:hidden;background-color:white;padding:5px 0 !important;border-bottom: 1px solid #DBDBDB !important;\"><div class=\"mi_thumbscontainer\">',\n tabswrapper: {\n header: '<div style=\"width: 152px;margin: 0 auto;background: #fefefe; /* Old browsers */background: -moz-linear-gradient(top, #fefefe 0%, #eeeeee 100%); /* FF3.6+ */background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#fefefe), color-stop(100%,#eeeeee)); /* Chrome,Safari4+ */background: -webkit-linear-gradient(top, #fefefe 0%,#eeeeee 100%); /* Chrome10+,Safari5.1+ */background: -o-linear-gradient(top, #fefefe 0%,#eeeeee 100%); /* Opera 11.10+ */background: -ms-linear-gradient(top, #fefefe 0%,#eeeeee 100%); /* IE10+ */background: linear-gradient(to bottom, #fefefe 0%,#eeeeee 100%); /* W3C */filter: progid:DXImageTransform.Microsoft.gradient( startColorstr=\\'#fefefe\\', endColorstr=\\'#eeeeee\\',GradientType=0 ); /* IE6-9 */-webkit-border-radius: 15px;-moz-border-radius: 15px;border-radius: 15px;border: 1px solid #cbcbcb;padding: 5px;\">',\n footer: '</div>'\n },\n starspanel: {\n header: '<tr><td><div class=\"mi_hover_starspanel\" style=\"border-bottom: 1px solid #dfdfdf !important;padding-bottom:5px;width:100%;overflow:hidden;border-top:1px solid #dfdfdf;padding-top:5px;background: #f7f7f7; /* Old browsers */background: -moz-linear-gradient(top, #f7f7f7 0%, #ffffff 100%); /* FF3.6+ */background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#f7f7f7), color-stop(100%,#ffffff)); /* Chrome,Safari4+ */background: -webkit-linear-gradient(top, #f7f7f7 0%,#ffffff 100%); /* Chrome10+,Safari5.1+ */background: -o-linear-gradient(top, #f7f7f7 0%,#ffffff 100%); /* Opera 11.10+ */background: -ms-linear-gradient(top, #f7f7f7 0%,#ffffff 100%); /* IE10+ */background: linear-gradient(to bottom, #f7f7f7 0%,#ffffff 100%); /* W3C */filter: progid:DXImageTransform.Microsoft.gradient( startColorstr=\\'#f7f7f7\\', endColorstr=\\'#ffffff\\',GradientType=0 ); /* IE6-9 */width: 396px;left: 0px;position: relative;\"><table style=\"position:relative\">',\n footer: '</tr></table></div></td></tr>'\n },\n footer: {\n header: '<div class=\"mi_footerwrapper\"><div class=\"mi_footerroot mi_footerroot_@@@kfid\" style=\"background-image: url(//d34p6saz4aff9q.cloudfront.net/images/footer/feelterfooternew.png);background-position: -120px 0px;background-repeat: no-repeat;\"><div class=\"mi_footercontainer\" id=\"mi_footercontainer_@@@kfid\" style=\"height:100%;position:static;\">' +\n '<div class=\"mi_footer\" style=\"height:auto;\"><div onclick=\"jQuery(\\'#cpcnt_@@@kfid\\').find(\\'.MI_tab_selected\\').removeClass(\\'MI_tab_selected\\');jQuery(\\'#mipct_scroll_@@@kfid\\').addClass(\\'mi_blured\\');jQuery(\\'#mipct_tblabout_@@@kfid\\').css(\\'max-height\\',jQuery(\\'#mipct_scroll_@@@kfid\\').height()+1).css(\\'height\\',jQuery(\\'#mipct_scroll_@@@kfid\\').height()+1).css(\\'top\\',jQuery(\\'#mipct_scroll_@@@kfid\\').position().top).fadeIn();\" style=\"z-index: 1;position: absolute;right: 0px;top: 5px;height: 25px;width:57px;background-size: contain;cursor: pointer;background-image: url(\\'@@@logo\\');background-repeat: no-repeat;\"></div></div>',\n share: '<div style=\"width: 100%;float:left;\"><div class=\"mi_footer_prompt\" style=\"margin-bottom:0;\">@@@ask</div>' +\n '<ul class=\"mi_share-buttons\"><li><a onclick=\"window.MI_logUsage(\\'mail\\');\" href=\"mailto:?subject={1}&body={2}: {0}\" target=\"_blank\" title=\"Email\"><img onload=\"this.style.opacity=1;this.style.top=0;\" src=\"//d34p6saz4aff9q.cloudfront.net/images/footer/Email.png\" style=\"opacity:0;\" style=\"opacity:0\"></a></li><li><a onclick=\"window.MI_logUsage(\\'share\\');\" href=\"https://www.facebook.com/sharer/sharer.php?u={0}\" target=\"_blank\"><img onload=\"this.style.opacity=1;this.style.top=0;\" src=\"//d34p6saz4aff9q.cloudfront.net/images/footer/Facebook.png\" style=\"opacity:0;\"></a></li><li><a onclick=\"window.MI_logUsage(\\'share\\');\" href=\"https://twitter.com/intent/tweet?source={0}&text={1}: {0}\" target=\"_blank\" title=\"Tweet\"><img onload=\"this.style.opacity=1;this.style.top=0;\" src=\"//d34p6saz4aff9q.cloudfront.net/images/footer/Twitter.png\" style=\"opacity:0\"></a></li><li style=\"display:none;\"><a onclick=\"window.MI_logUsage(\\'share\\');\" href=\"http://pinterest.com/pin/create/button/?url={0}&description={2}\" target=\"_blank\" title=\"Pin it\"><img onload=\"this.style.opacity=1;this.style.top=0;\" src=\"//d34p6saz4aff9q.cloudfront.net/images/footer/Pinterest.png\"></a></li><li><a onclick=\"window.MI_logUsage(\\'share\\');\" href=\"https://plus.google.com/share?url={0}\" target=\"_blank\" title=\"Share on Google+\"><img onload=\"this.style.opacity=1;this.style.top=0;this.style.top=0;\" src=\"//d34p6saz4aff9q.cloudfront.net/images/footer/Googleplus.png\" style=\"opacity:0;\"></a></li></ul></div>',\n callForActions: '<div id=\"cfa\" style=\"white-space:nowrap;padding-left:0;display:inline-block;\"><div onclick=\"alert(\\'call to add to favorites\\')\" style=\"cursor:pointer;border-radius: 7px;height: 27px;width: 187px;margin:5px;MARGIN-LEFT:0;display: inline-block;text-align: center;box-shadow: inset 0 -9px 37px -10px silver;vertical-align: middle;padding-top: 8px;border: 1px solid rgba(0,0,0,0.2);color: grey;\">Add to favorites</div><div onclick=\"alert(\\'call to book\\')\" style=\"cursor:pointer;border-radius: 7px;height: 27px;width: 187px;margin:5px;display: inline-block;text-align: center;box-shadow: inset 0 -9px 37px -10px rgb(3, 179, 12);vertical-align: middle;padding-top: 8px;border: 1px solid rgba(0,0,0,0.2);color: white;margin-left: 1px;background-color: rgb(161, 218, 101);\">BOOK</div></div>'\n },\n header: {\n header: '<table align=\"left\" class=\"mi_reset mi_greenredtitle\">' +\n '<div class=\"mi_green_close @@@orientation\" onclick=\"jQuery.MidasInsight.hidePanel(\\'@@@kfid\\');\" style=\"z-index:3;\"></div>' +\n '<tr><td class=\"mi_header_caption@@@gaugeOrientation>' +\n '<div class=\"mi_drag_area\" style=\"position: absolute;width: 100%;height: 60px;left:0;z-index: 2\"></div>' +\n '<div class=\"mi_gradselectroot @@@gaugeOrientation\" id=\"mi_gradselectroot_@@@kfid\" data-score=\"@@@grade\" style=\"z-idex:1;\"><div class=\"mi_gradeselect\" id=\"mi_gradeselect_@@@kfid\"></div></div>' +\n '<div class=\"mi_title\" style=\"@@@titleOrientation\">@@@displayText</div>' +\n '<div style=\"@@@optionsrtl\" class=\"mi_subtitle\">@@@count</div></td></tr>'\n /*if (count > 4) {\n p += '<div style=\"' + (options.RTL == 'true' ? '' : '') + '\" class=\"mi_subtitle ' + (options.RTL == 'true' ? 'mi_subtitle_rtl' : '') + '\">' + window.langDictionary[window.MI_defaults.lang].basedon.replace('%d', count);\n p += '</div>';\n */\n // tools tabs\n +\n '<div style=\"clear:both;height:0px;margin-bottom:0px;border-top:0px solid #DBDBDB!important;\"></div>',\n footer: '</table>'\n }\n\n ,\n closebutton: '<div class=\"mi_green_close@@@gaugeOrientation\" onclick=\"jQuery.MidasInsight.hidePanel(\\'@@@kfid\\');\"></div>'\n }\n\n ,\n scrollables: {\n header: '<div style=\"clear:both;height: px;margin-bottom:0px;border-top:1px solid #DBDBDB\"></div><div id=\"mipct_scroll_@@@kfid\" tabindex=\"-1\" style=\"heightdummy:0;outline:none;\" class=\"mi_scroll\">' +\n '<table align=\"left\" id=\"mipct_tbldefault_@@@kfid\" class=\"mi_results mi_scrolledcontent\">',\n footer: '</table></div>'\n },\n socialItem: {\n timelineItem: '<div class=\"mi_timeline\">@@@fullYear<br/>@@@month<br/>@@@date</div>',\n nonTimelineItem: '<img onerror=\"jQuery.MidasInsight.HandleMissingImage(\\'avatar\\',this)\" src=\"@@@itemImageURL\" valign=\"top\" class=\"mi_resultimage\"/>',\n youtubeItem: '<div style=\"position:relative;\"><div class=\\\"MI_SourceIcon MI_@@@sourceSite\\\" mi_data-tooltip=\\\"@@@sourceSite\\\"></div><table align=\"left\" class=\"mi_resultcontainer\" style=\"direction:ltr!important;cursor:default;\"><tr><td rowspan=\"4\" valign=\"top\" style=\"padding-right:15px;padding-left:3px;width: 65px;\"><div style=\"position:relative;height: 100%;display: block;\">' +\n '@@@sourceAvatar' +\n '</div></td><th style=\"vertical-align: middle;\" align=\"left\"><div class=\"mi_resultpublisher\" style=\"color:#838383;\">@@@itemPublisher<span class=\"mi_resulttimeago\" itemDate=\"@@@itemDate\">@@@timeAgo' +\n '</span></div></th></tr><tr><td style=\"padding-right:30px;\"></td></tr>' +\n '<tr><td colspan=\"2\" onclick=\"@@@click\" style=\"cursor: pointer; cursor: hand;\"><div style=\"padding-right:10px;overflow:hidden;position:relative;max-width: 275px;\"><img src=\"https://i.ytimg.com/vi/@@@sourceURL/mqdefault.jpg\" style=\"max-width: @@@itemWidth ;min-width:185px;margin-top: 15px;margin-bottom: 15px;box-shadow: 0px 0 10px 4px #eee;float: right;border-radius: 5px;display:inline;\"/><img src=\"//d34p6saz4aff9q.cloudfront.net/images/playvideow.png\" style=\"position:absolute;cursor: pointer;left: 50%!important;margin-top: 20%;display:inline;margin-left: -30px;\" onclick=\"window.MI_logUsage(\\'play_video\\',\\'@@@baseid\\');@@@click\" onerror=\"this.style.display=\\'none\\';\"/></div>' +\n '</td></tr></table></div>',\n lightboxYoutubeItem: '<div style=\"position:relative;\"><div class=\\\"MI_SourceIcon MI_@@@sourceSite\\\" mi_data-tooltip=\\\"@@@sourceSite\\\"></div><table align=\"left\" class=\"mi_resultcontainer\" style=\"direction:ltr!important;cursor:default;\"><tr><td rowspan=\"4\" valign=\"top\" style=\"padding-right:15px;padding-left:3px;width: 65px;\"><div style=\"position:relative;height: 100%;display: block;\">' +\n '@@@sourceAvatar' +\n '</div></td><th style=\"vertical-align: middle;\" align=\"left\"><div class=\"mi_resultpublisher\" style=\"color:#838383;\">@@@itemPublisher<span class=\"mi_resulttimeago\" itemDate=\"@@@itemDate\">@@@timeAgo' +\n '</span></div></th></tr><tr><td style=\"padding-right:30px;\"></td></tr>' +\n '<tr><td colspan=\"2\" onclick=\"@@@click\" style=\"cursor: pointer; cursor: hand;\"><div style=\"padding-right:10px;overflow:hidden;position:relative;max-width: 275px;\"><div id=\"#mi_image_lightbox_@@@ksid\" onclick=\" jQuery(mi_image_lightbox_@@@ksid).fadeIn();\"><img src=\"https://i.ytimg.com/vi/@@@sourceURL/mqdefault.jpg\" style=\"max-width: @@@itemWidth ;min-width:185px;margin-top: 15px;margin-bottom: 15px;box-shadow: 0px 0 10px 4px #eee;float: right;border-radius: 5px;display:inline;\"/><img src=\"//d34p6saz4aff9q.cloudfront.net/images/playvideow.png\" style=\"position:absolute;cursor: pointer;left: 50%!important;margin-top: 20%;display:inline;margin-left: -30px;\" onclick=\"window.MI_logUsage(\\'play_video\\',\\'@@@baseid\\');@@@click\" onerror=\"this.style.display=\\'none\\';\"/></div><div class=\"mi_lightbox\" id=\"mi_image_lightbox_@@@ksid\" onclick=\"jQuery.MidasInsight.StopYoutubeVideo(jQuery(\\'#mi_image_lightbox_@@@ksid iframe\\')[0]);jQuery(this).fadeOut();\"><iframe width=\"560\" height=\"315\" src=\"https://www.youtube.com/embed/@@@youtubeid?enablejsapi=1\" frameborder=\"0\" allowfullscreen></iframe></a></div>' +\n '</td></tr></table></div>',\n lightboxVimeoItem: '<div style=\"position:relative;\"><div class=\\\"MI_SourceIcon MI_@@@sourceSite\\\" mi_data-tooltip=\\\"@@@sourceSite\\\"></div><table align=\"left\" class=\"mi_resultcontainer\" style=\"direction:ltr!important;cursor:default;\"><tr><td rowspan=\"4\" valign=\"top\" style=\"padding-right:15px;padding-left:3px;width: 65px;\"><div style=\"position:relative;height: 100%;display: block;\">' +\n '@@@sourceAvatar' +\n '</div></td><th style=\"vertical-align: middle;\" align=\"left\"><div class=\"mi_resultpublisher\" style=\"color:#838383;\">@@@itemPublisher<span class=\"mi_resulttimeago\" itemDate=\"@@@itemDate\">@@@timeAgo' +\n '</span></div></th></tr><tr><td style=\"padding-right:30px;\"></td></tr>' +\n '<tr><td colspan=\"2\" onclick=\"@@@click\" style=\"cursor: pointer; cursor: hand;\"><div style=\"padding-right:10px;overflow:hidden;position:relative;max-width: 275px;\"><div id=\"#mi_image_lightbox_@@@ksid\" onclick=\" jQuery(mi_image_lightbox_@@@ksid).fadeIn();jQuery(\\'#mi_iframe_lightbox_@@@ksid\\').attr(\\'src\\',jQuery(\\'#mi_iframe_lightbox_@@@ksid\\').attr(\\'data-src\\'));\"><img src=\"@@@itemContentImageURL\" style=\"max-width: @@@itemWidth ;min-width:185px;margin-top: 15px;margin-bottom: 15px;nbox-shadow: 0px 0 10px 4px #eee;float: right!important;border-radius: 2px;display:inline;\"/><img src=\"//d34p6saz4aff9q.cloudfront.net/images/playvideow.png\" style=\"position:absolute;cursor: pointer;left: 50%!important;margin-top: 20%;display:inline;margin-left: -30px;\" nonclick=\"window.MI_logUsage(\\'play_video\\',\\'@@@baseid\\');@@@click\" onerror=\"this.style.display=\\'none\\';\"/></div><div class=\"mi_lightbox\" id=\"mi_image_lightbox_@@@ksid\" onclick=\"jQuery(\\'#mi_iframe_lightbox_@@@ksid\\').attr(\\'src\\',\\'\\');jQuery(this).fadeOut();\"><iframe id=\"mi_iframe_lightbox_@@@ksid\" data-src=\"@@@sourceURL?autoplay=1&title=0&byline=0&portrait=0\" width=\"500\" height=\"281\" frameborder=\"0\" webkitallowfullscreen mozallowfullscreen allowfullscreen></iframe></a></div>' +\n '</td></tr></table></div>',\n normalItem: '<div style=\"position:relative;\">@@@metaicon<table align=\"left\" class=\"mi_resultcontainer\" @@@cond onclick=\"@@@click\"><tr><td rowspan=\"4\" valign=\"top\" style=\"padding-right:15px;padding-left:3px;width: 65px;\"><div style=\"position:relative;height: 100%;display:block;\">' +\n '@@@item' +\n '</div></td><th style=\"vertical-align: middle;\" align=\"left\"><div class=\"mi_resultpublisher\" style=\"color:#838383;\">@@@itempublisher<span class=\"mi_resulttimeago\" itemDate=\"@@@itemDate\">@@@timeago' +\n '</span></div></th></tr><tr><td style=\"padding-right:30px;\"><div class=\"mi_resulttext\">@@@itemtext</div>',\n instagramItem: '<div style=\"position:relative;\">@@@metaicon<table align=\"left\" class=\"mi_resultcontainer\" @@@cond onclick=\"@@@click\"><tr><td rowspan=\"4\" valign=\"top\" style=\"padding-right:15px;padding-left:3px;width: 65px;\"><div style=\"position:relative;height: 100%;display:block;\">' +\n '@@@item' +\n '</div></td><th style=\"vertical-align: middle;\" align=\"left\"><div class=\"mi_resultpublisher\" style=\"color:#838383;\">@@@itempublisher<span class=\"mi_resulttimeago\" itemDate=\"@@@itemDate\">@@@timeago' +\n '</span></div></th></tr><tr><td style=\"padding-right:30px;\">'\n\n ,\n itemContentImage: '</td></tr><tr><td colspan=\"2\"><div style=\"padding-right:10px;overflow:hidden;\"><img onload=\"if (!jQuery.MidasInsight.imageIsGood(this)) jQuery.MidasInsight.HandleMissingImage(\\'preview\\',this);\" onerror=\"jQuery.MidasInsight.HandleMissingImage(\\'preview\\',this);\" src=\"@@@itemcontentimage\" style=\"max-width: 275px;margin-top: 0px;margin-bottom: 15px;box-shadow: 0px 0 10px 4px #eee;float: right;border-radius: 5px;\"/></div>',\n lightboxContentImage: '</td></tr><tr><td colspan=\"2\"><div style=\"padding-right:10px;overflow:hidden;\"><div id=\"#mi_image_lightbox_@@@ksid\" onclick=\" jQuery(mi_image_lightbox_@@@ksid).fadeIn();\"><img src=\"@@@itemcontentimage\" style=\"max-width: 275px;margin-top: 0px;margin-bottom: 15px;box-shadow: 0px 0 10px 4px #eee;float: right;border-radius: 5px;\"></div><div class=\"mi_lightbox\" id=\"mi_image_lightbox_@@@ksid\" onclick=\"jQuery(this).fadeOut();\"><img src=\"@@@itemcontentimage\" style=\"box-shadow: 0px 0 10px 4px #eee;border-radius: 5px;\" onload=\"jQuery(this).css(\\'position\\', \\'relative\\').css(\\'top\\',\\'50%\\').css(\\'margin-top\\',((this.height/2)*-1)+ \\'px\\').css(\\'top\\',\\'50%\\',\\'!important\\');\"/></div></div>'\n\n }\n },\n MODERN: {\n panelLayout: {\n header: [\"tabs\", \"stars\"],\n content: [\"tags\", \"mentions\"],\n footer: [\"photos\", \"callForActions\", \"share\"]\n },\n panel: {\n videoholder: '<div id=\"mi_videoholder_@@@baseid\" class=\"mi_singlevideocontainer mi_closeTopLeft\" onclick=\"jQuery.MidasInsight.MI_GetPhotos(\\'@@@baseid\\',false)\" style=\"margin-top: 74px;background-position: 10px 18px;\"><div class=\"mi_singlevideo\"></div></div>',\n containerHtml: '<div style=\"padding:5px;margin-top:25px;border: 1px solid #ccc !important;\" class=\"mi_panelBackground mikfpanel\" id=\"cpcnt_@@@kfid\" style=\"direction: ltr;margin-top: 20px;@@@layout\"></div>',\n tabs: '<tr><td><div class=\"MI_tabs@@@orientation\" style=\"margin-left:-10px !important;position:relative;z-index:30;box-shadow:none;left:0px;padding-top: 0 !important;\">@@@tabs</div></td></tr>',\n gauge: '<div class=\"mi_gradeselectgradbg\"></div><div class=\"mi_gradeselectmasknerrow' + (window.MI_defaults.RTL == 'true' ? ' mi_gradeselectmasknerrow_right' : '') + '\" style=\"background-image:url(\\'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAHIAAABQCAYAAADFuSFAAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAA25pVFh0WE1MOmNvbS5hZG9iZS54bXAAAAAAADw/eHBhY2tldCBiZWdpbj0i77u/IiBpZD0iVzVNME1wQ2VoaUh6cmVTek5UY3prYzlkIj8+IDx4OnhtcG1ldGEgeG1sbnM6eD0iYWRvYmU6bnM6bWV0YS8iIHg6eG1wdGs9IkFkb2JlIFhNUCBDb3JlIDUuNS1jMDIxIDc5LjE1NTc3MiwgMjAxNC8wMS8xMy0xOTo0NDowMCAgICAgICAgIj4gPHJkZjpSREYgeG1sbnM6cmRmPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5LzAyLzIyLXJkZi1zeW50YXgtbnMjIj4gPHJkZjpEZXNjcmlwdGlvbiByZGY6YWJvdXQ9IiIgeG1sbnM6eG1wTU09Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC9tbS8iIHhtbG5zOnN0UmVmPSJodHRwOi8vbnMuYWRvYmUuY29tL3hhcC8xLjAvc1R5cGUvUmVzb3VyY2VSZWYjIiB4bWxuczp4bXA9Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC8iIHhtcE1NOk9yaWdpbmFsRG9jdW1lbnRJRD0ieG1wLmRpZDoyODYzNTRkZS04NWY4LTg3NDEtYjNmOS02OGU4NGQzZjVjODkiIHhtcE1NOkRvY3VtZW50SUQ9InhtcC5kaWQ6OTM0QjUyMzEwQ0ZBMTFFNTlCQjg4NzExODFEM0Q0M0QiIHhtcE1NOkluc3RhbmNlSUQ9InhtcC5paWQ6OTM0QjUyMzAwQ0ZBMTFFNTlCQjg4NzExODFEM0Q0M0QiIHhtcDpDcmVhdG9yVG9vbD0iQWRvYmUgUGhvdG9zaG9wIENDIDIwMTQgKFdpbmRvd3MpIj4gPHhtcE1NOkRlcml2ZWRGcm9tIHN0UmVmOmluc3RhbmNlSUQ9InhtcC5paWQ6RDVFOTA3RTFFN0Y4MTFFNDkzNjJGQzdDNUEyRDA1MTYiIHN0UmVmOmRvY3VtZW50SUQ9InhtcC5kaWQ6RDVFOTA3RTJFN0Y4MTFFNDkzNjJGQzdDNUEyRDA1MTYiLz4gPC9yZGY6RGVzY3JpcHRpb24+IDwvcmRmOlJERj4gPC94OnhtcG1ldGE+IDw/eHBhY2tldCBlbmQ9InIiPz5NfkuaAAAX1klEQVR42uxdCZQdVZm+99by9u7Xr1+n926ykOASgQODS5gJijIGJQxbOM4IIosKKgoHZw7icubMAcHjuI3jCHJkNI4LGcEIKuoIozKj4uAIkTBEliyd3ve313bn++tVvby8vNd53R00CXVPbqrqVdWtW/93v3+5SzWXUrIgHfuJb9u2bUk3UgMIhUIsFosx27aZoigsn8+ztrY21t7ezvbu3csikYj7e7FYdO+JRqNM13U2OzvLUqkUE0Iwx3GYqqruNpPJuFsqo1JBzt3fDMNgiUSCzc/Pu+VS+T09PfT88NDQUE9ra2tnOBweRJn9uGcFbm1HDqOeKo5t7JvIczieQN6POu+ZmZnZj3qMo05Te/bscetNdaE60jvRs6mO1e9M9bAsy30XOucTga4tFAru/ZRzuRwzTdP9vaWlhWWzWfe9qN6opys3kg29G+Xp6Wk2OTnpXr+UpI6NjS3pRno4CZQqSS9NlSchU6KKTkxMuIKnytILUiIhEPhUabqeztG9mqa55UGwFWD9RMKia6iR0D41AgiyG8c9AD4NQZ6M3AehpXC+G2V2IrdhvxW3h5AVnHewtbDNovwZlDeOMkaxP4G6TaKh7YCg96Lek7juOQjZKZVKbv0oVzcoapQEEAHoA0HnKFNDpHehhkCyoPel3+m6ubm5yrtTI6D7/Pvp/ej30dHRSlmLBtKv6KKp7FXQb5W09Y+rz/nZB6U2+/f65/2t39Jpi/KiAHc9Dl+LxnEGGtDa9evXnwChtUE4YtWqVYeUWyMQApNeNATBtSOvIQFS2dTICBwwOguARsGknbjv97j25yjnSVwz4pflM7S6/Ebnaq+r/b1aLtXyWzKQR5OepxfyWyheJo58OgC8CHlDOp0eBIApUkmkCah1L/WlqxNpDa/RxMHSNQB1DcDcDICvx/4E8mOo0w9wzU8IVLr2aPQrjhogCUAiOlrmyVBNmwDehfF4/HQSNIFH6mip2qMZ7UKJ1CJleiYBC/UaB6groSYvhSofg6r8d/z+IPKvAOZsAGQNC4mBSG+Bs/E2qLhzkdvI9r6Y4DWTiPWUyTEDqJ0A9b2w0dfB3v0c7N2GxncvLpt4SQPpMRAEFOdBWO8BcH8Bry5Knp1vK46m5IOaTCY52LkRzslGAHotWPp11PVOvMfMSwpIzwbi3flrYOs+AgA3gYkcAvqTsq/ZRE4JVL6bAegrpqamPgGWXgWG3o53uw8aZua4BbI6FgR4L+vu7r5xxYoVlwNAnQCsDjeOpUSqnzJU7xoAejdAfAfe8xNoqD/8YztEfxQJel4ox0u/H6rzxo6OjkGyOxRvLcO6MgoPORdjUvK845jcKY0rQqhPKuHO79e8m4Nrw6X8c1sY07vVUJetKOT1Ulhi9yE6WZYm9z1pvNufj4+PnwaG3osCbwGYw8cNkB6IrxwcHLwVDNwMEH2vcNFOEXhdcGxzhDvGDqnEfmUWRwt6OHU/UyLTjm0xszDCVTVSBJBmnZqwUu6Ff2Y8qjElJYWgvgKLFwoTl4RCXSkmi+uB9gZVDSepVwgNZNEql94LjTU6OTl5BfKG4eHhj+DUvccskNW9ID09PZfBntwOddpDjgy594sC0LH2AcVfAsAnpZ3dAdB+zsz5WUWNESkPfq7QkBu9EoJxJVSUTC/W0O8rdGxaBTyGeoOstbZtnYufNmpqbD3nSrpxmYcmsvOdnZ1kQ0+Exvl2Npt9NTxesp8TxxSQJBTqi8RLJMDA27q6uq6FPVQWw0KoQUMacy84kv8rVyPf49L+A3AwmYMwRQFTuHIQQLWANQKy0bXl3iNioJjDf7+Buv2NYWbaTDu7FtecpWvJ81U1erLgSnQx6pZ6nMDMG4eGhjZAHu8FmI8fE0CSQAhEbFf29/d/qa+v7xxSpeS2N2PzHLOYl1buF0wJfdopzj4GEGeZBtlJ7p5nJGxkTr0rnLrx8Cy7CFxDXveXiuMsk9Y0MIngWt2Fiq5znAx2TEZYlEEjG2t6dtYr3wO3XJYC75P/2nHsXwPUL0BUvY5T+jtVCV+kqKFWznjT7ASIrx4ZGfk+nL13Qz7bXwxHSBzJwrwO5D8D+7bDJp5DoxPNgCjNgm3O7nnAmn7mIsfIvRnS/jGEPesCV5Gv4gqdOQZz8CO35qGmE0xmfgdtOMtULQyBRZlwplEegLQLLnBkG5lTApmzwAL102z3OinnEOTvxn6CGdYwzhcAjeoBLMvthtQxNRyu5LC/y3Gsq/LF0XPmss99oWTONa0qyaRAHp1g6VZ46e/zG/1RxUjf3pA9ROs7e2BgYCtY2J1Opw8b1Eur5Nj5ifsdI/tVaRs/4lCpZOcOUn0u8+AwWTkmiFGFIfgrvYwZU0yJDjAbIgYNq+pDrFXL7KX7padS3d8Ah/S1B93joDHEWCH7NADtQ1uxXDCFsKBZ5KGKmNNAgPpYsTT1mGUXt9oh82pdS2xRlVBrM6oWskmAnf8EJ6gDzPz4kez4OCKMpPgQLW3L6tWr7zvhhBO6SZ0uWEEaebDMR6A+N8nC9F9DvA9woRvMU3menQSZSoyZc6TmGDemvcrKso2kTNe49pI3o7lrnCO6R/HsI5wkprgXUENQNJ3poTjaAFQyM8sNqUpUAo0C9pLAfHfRmH21ZRa+gvo6zfQOwdyw3t7ej4XD4c9Bg/EjxUx1uWz0QLwAhv1OVLCF+kgXMKKQvTlnZ8a+xLTY33OhFOBKukxh8oCkuevOk3ChCq0S4+F2CNUDrNJAvK1jHkBI2hqTxkrmse1gFG08wkDcaO7HwXxZhVpVZcmDnB+hqC7TbQkVjTpaMgsoFRyzKluqSORnbCnflS+MPBrVU7cgPl29UOhCLCQwIbvrx8bGVNM0byAu/MmA9EGEOj0PLNwKEGMLgkiiLWV/4uQn78DdP60A4gvGMVw2CEV3277U4KyQl0oXEPMqcvYAd8w2bFNchN8CSafxo8n19Clg78lMbQO5wxW20r5gbSwcOUnlPLQLP/436VrO1d+jjEfhxBTBqEle47i5gIKtmhJmJXuCKTzCpGu2HZQnDjhJnNlcinvyxtwvVUX/UDSUuvJwMSfkRbvXjY6OmjBLH1wuMxcNpO+Z0ig5PNM3AcSvoYXFFgovpAlbODf0HRZpoxfMsmq1S4OrYJUbhxt5nFI9Z8PL3ENQWjCWvAdt+gKwYECGUhcAi7BIntbr2j/3bZLYTdZpdQqiFp0pqtvQBpHfpKrUt9tioqzRcGjAFCLyX1Ch3+dc/lC6jK1mc9nxKdnzLKJ1sIjSwTKw1VEnDJDjFfspmf1/2L06W5zcrSmhD4e0RPhwYOJdPwBmGlCzf0type7KpYCqLhZECuipfzQSiZwCdfplBPrJBUG0rXlp5N7nZMa3KvEOvKznhBCAZpEJNY6M8EHRKPwos69aiFJ2oSWczPTkFUzRzxVaf4sbgrBYBaSluge87Fn1h/QeetYqsPIytKp9kssHHdt8yJH2DodZL1RUqVt3h4XQCKbFs+VoiPuW2/G8XE0WzKl/cBzjIU2NfRNe7+qFwCTPHsz+0Nzc3DAA/aw/k+BFB5J0PDzSPlTgqwj0B1tbGztsTnYqB3AuF5GW7QDBY1jZznFyLEyrrD7hBEhybKrjdinTQPgaxJIXAayTeaTjRe5OdG0eWbF+lanXSiV0LcDZZTvF/7ClcTfY+r8H5GC59pI83iJi1rBMMQ1xq+PaXOmGLPBuf1MycpsdWfpOLJw+qSEAYGBXVxeNd96GMGV3JpP5LkUAiwVTXQyNSZ3C84oCvLtSqdSrFgoxnKm9GXP46cuUvvXbK94oriUh8HmEiIUc4wk4MaWcx0JeBtWx07j0vTyUuJgJ/ZWMC/bHT2VQQ2p6LSq31nJyF5aY+JZpTt4Flj7N3GYoXYZKDnupcDZVepZpLM6S6uABx4YrO2fyIxcXrNnvpONr1jV6Gmk5qNkIsLgLIA7T9BLycIk0zeKjNtfrwly76HU7fRQtaBP1WDQC0Z54IWPufOQqnuoFE9UDahKaTOB1ZR7BuRat8hjJmXFiYO3l8GZv5nqs/+gZrEJkKeJdqh7/oCIi1+CHm21p/RsYOu2yD8xUuM7GzKfw4ipri6zCb+qBUEZoT41ln7oUrL6vM/HyVY2eQqMnCNs68vn8lwHeGyYnJ6eImc2O0TYNJIEGAP8KQe0NUKkHzfc8iInT+\\/PWEz++jGvqdq7pHoDCVavcQCihRplNndC+x+\\/21jhnMi18s4ilz3XDkaM0hdV2MsyfN+zMFoD0ebBy2wEbFWaWsNiY8RQL2TEW1XoqHRSqiDwxnH3yPGiX+zvjJ61tVD75HtB6r4Ine8euXbuuBZgmTS1thpUqzcVsZigKAK5G/iLUaYgKr2tDZ8cyxlM/uxye33amhbyQAWqoiHBRg0dJMXNVLwxSC+Loa0S07WbYwXZ2lE3vaJR0JXFmV+y016KFrsqZY3ccUKUaA8hs3hlGaJZnXeFXuA4QkUDl+s6x7NMX495tbZHehmqWzBVYeQUigl/Bft7tTQddvrNDdhH01trb2/+Rut4aOTeymMuZ+56+hkv7u+B52bEhVxr2kKGxiI7eKhbaFJL0iGjyDiXc8nYmjr0ZApqIK2Dk7SEluQle7tthO4fIrgIwt7/sycwDLG/Ns3Z1oNwdyEkNix2zhf2XxtTUfboWWdVI88FsKSDPbTj8z/n5+WebmUGhEp0PZxsB4NUIM95Ko/oN0rSTz7wTCH3PVaOGiZJpC5c8N44mHCrHg9xzaNTQWXB0vswUbQ1T2DGbiG0JvWejI80f4sU+5kh5v3Q7/jRydNg4HKA25QQWVtrgVUbdGFnlkScyxcnLW5WuR1RRf3CWNB5k3QFtSeHIJYZhFA7HSuX888+vrD+ozTRtHi7xIBycrwHIlnoqFXEicyaHbpWZmbulUXSHmCgm5HDNhYiXmQlbyaMJmrSK641zRKrnW6JlRR87ThKYuCKurbikYM3Bi2O/pJhy3hwFgEnWFz4VwLawCCxHRLQzjUdgquSodMQGXaPuPN6wXxasXF0oFKhL8XGSvT/vtl5WG9k7n+ZQpR9B6+imWWN1VWp29kHr+R2fYwQeqYBQsjxmWBmC8vtBHfyTrxeJ9q8zPZJmx1mKa13ihMSGT40Un2QlK/dpv5NACJ1FlRAzHaPSTxxSmGXb1j1gWgmAnVtv8IJkD3upQLXehP2HQKo9C7FS1GMiOTekUsHCNyJf3Uj9ymJ+j5ybfg+PtmR5BA6dhkaBcMON6X0Q3Q5xihPlWTyWuBcgdrDjNIWUBO+NnPpJhek3mk4BMuBljxPWlNo1dRhIZmNrUxD6TdxyHvInFxotgVlbAx/lJlrdRetUGmV1amqqrl3UdT28du3aj5MXVTdEkbJgT4x8WM5N7uehmNcfSr01BXeYqjL6YJZgE/U380Tqq1wLpdlxnjQRVQbjZ3xiqPCELDm5z/gzCfxwzakZ7cLxHWDaXyKf2igkgVa8Gp7sPXA8f9so7BP1VkhRAhO3wFM9s3qt4kEVmBx5SM5NfYOrYYQVzLONpFoR6EcSlczbe/qVvjWf46HoCvYSSWGlVT81dcmnYmrbDaZTFOXBbVZZoeYvxfOC/VnqOHcHExp04SFuD8O0fZSmlDaKKdV6MSPsZhvimOtp4Wddvew4IyjvSpFoc0OMigolF9TvibDhudpOXHQP3ArbuZa9xFJKHxSJ1IpPGoaVgyq9y++rJiBpPm/NsrpfIH8bsr6qXlk0PAhmnlMsFjfRyrBaTNwGUk+tdnV1vRW6+TTqkqvLxpnJzwDMWdg8xkNgJLEPal/OzzA5O8Xk9AQFoIzHWz7ABb+MvUSTJiJqVI/fpKiiq9rDJCD9Rb6UPb/kX4idjZxO4BEFHjQMGPZ/45xXVo6rvs6mH6nQSCQS7u3tvZ4C/3r6WGbnn7NH993LFdIY7lg+o7BDzs0QA2keBEA0mOhbdbbSlr6JvcQTGvKJGteuhJxvqx1JqlaT3lTJh2k5YV2vGFEDmLkZseXpsJWP+iD6S+XFunXrKqtpCUjo481wcE6vy0Z6+MjQN3g+t4cV4cTk8wzBJlgZYUq6iyldfdh2M5HuHlTaO79ItpoFidKtyK+rZVntMa0bYQ2mfdB5mDoN7Hs3LWOnbxLQMnxitvvdgoGBAXeH1q8DUAVq9Tp/7f8hOGbmn7czc3dy6kctj6qSTw0nRy/35HjzMZTewQt5S3JtgN8BECDbO2C2LsXhQutBHgeZvgnZv6PeSSIXzY8C4OtQ5jNULo2akDl040h4qG6fKtIZxMYGI/7Syc1t5fHEftYCorW0gu8tzAErrb0vMGtoN7P3PM/s4X2vYeHoLQF8h4B5JsB8Z3V0UGc6pASQX5Hy4JGFaqcmlUrFoEpp1ZcLrN8PKwzDINSSoG0bTrwdejhWd32GZU5zVf+S6IDqTLYz0Z52mcj1MBOtKSYSADcSZcrAyo9zXW8PoKsLxN8AuJ56H5DwvyCCfVrW/t1GZZAHi+u24JougNkCNiaxn6Rv0NxfKpUUhBscJ05t5Knae3f/j7N/zwTXveEpcoRUjVUGjmFfRTh2ttLde1YAWcP0MsibQPhstdqt+aiFgfPfwnYzOb6HeMLlOVMrcc1DOJz0Q0gOoyl9D4poSjq3TtyYs/e+sFkW8g+7A78EYi6LUGOOSd+WlkphZfWJ25SVq94a4NU4Qc7Pg0WvBXDj1Wq1JtDvA+t+hPMvr1cGmUGaPVAdVVBPwTQxthzNN0iF/ONOJrOJK8qEO1cFLHQnVjvywCRvx3olb2n7KQ+FVgRwLZwAxM3Y3H4YL/YbAPNtTRZpeHMTD9OKiqVHwLgJSZ8iQ7jhwO11xseZMzPNnOlpZo9PkLp9QwBicwmabwvYxGu7RWvYuXUxZR5+ihrNSy3mHnbXJdIDSZVqqmsTWcko52IxBZreEEDUtAc7iLzxICBqvpIFMH8Hn+UPRw5IyfYjJvwZb00yjpBDJFqYNK2ybdQ1F1Qej60X6XRvAFHzXbEAbEOto1PjzY5i+1jTLD/cBc7Y2HPO+BjnIW8eDkIchyvueCPN6ZQIRpV0+wX1PKwgLZjO9oawrKpuumpbKSnoh52UzZi/wzKSp1KPKitX5kRfHxP9A0xGEXYWCmClWc6FfCfU7RuPlRlwR1Gi8cczawP+6gxWfo8i+OUz0jTzcnx8V7VHxamDtrvLa0LSfbqS7ugPcFm0nUwCqBW1Tk71wDOONX8Mc3lAquo+3tGx3VWp7uw4gxk7d5BzU57qCEaKaPQKZUVnS8DHJcWUFyJvpyi8TixJ6WkA/gNsz18ekI5UuR4qL0GiB2k6C53xmvJybn9toOP0cEUJUFlal12nh0GpwSU55NFlq1Z7/76wMzLM3Fnj3iopu5j3VlVhY5i6duK6lOgOHNalJKjRpGVZbWBdboHLos18m0gsrMfZnUxwqzJiZRrMoQFlFCxJtdJXjTl/QwDJktMpAPGURmGIt/8ANvllMVL0Dz6LfODYsplqW+VZAMyd8mhwVTECPJaW6vXq1ElDyPRR+Ohy4siDBiaFqtBX0AMEjjCehzlPc3SUpTOSZoYXS7Kyypi2CD34MfpJzqM4Zet4swcdLm81lg0gZ2dYZaojfeUx1e5NfwzSkUq2bZ+E/HD1XxyonWbTDJCiMSFt5uQzyNlyLuSZzB3SeBx2yDcag7RIz/Vd/jINykv9TEtDetHKKRGJ2O4nxAgtw2Cl3c8wXVOY0urN5HBskwnFCeBYVir5Ix/+4L6/vxiyNNaTqsZEZ0/J7b0Jh5k9jrjUMtw5qw5iSWt+hqmxxEYRTfQF/axLTwCu0qtT7++Y4Li0bI9JWuZ11uhQD7Os8hJyeggApqXkxZ2/Wy8deYu7ejNIS04Aiv7C0MUN/jAMeazvYuUZHMvoENBCrxMtSfq+6GoocxXA6rTFqdPCq9Y9qMRbBgMolp2SAPMe5Pdjn9b1a56mpG/zfAH5ymbCD+79eYPEYS7e6cxM/tYc3hPS+lcZIpHciKbUF2Bw5JLHxl8j7waoDo7fhG2zyxCNZoH0n8YCe3hUpkUCGaQAyCAFQAYpADIAMkgBkEEKgAxSAGQAZABkAGSQAiCDFAAZpADI4xxI+qi593nHIB2jySIg6ftn9B1PEcjj2AXy/wUYACIPOMIobjzuAAAAAElFTkSuQmCC\\');width:100%;background-repeat: no-repeat;background-position: 15px 6px;\"></div><div class=\"mi_gradeselecthandlenerrow\"></div><div class=\"mi_gradeselectdigitsnerrow\" ' + (window.MI_defaults.RTL == 'true' ? 'style=\"direction:ltr!important;\"' : 'style=\"direction:ltr; LEFT: -4PX;TOP: 30PX;\"') + '><span style=\"font-size: 43px;z-index: 3;color: #92c83e;font-family: \\'Source Sans Pro\\', Alef!important;\"></span></div><div class=\"mi_gradeselecttext\" ' + (window.MI_defaults.RTL == 'true' ? 'style=\"top:77px;direction:rtl;color:#b8b8b8;\"' : 'style=\"top:77px;direction:ltr;color:#b8b8b8;\"') + '></div>',\n starspanel: {\n header: '<tr><td><div class=\"mi_hover_starspanel\" style=\"border-bottom: 1px solid #dfdfdf !important;padding-bottom:5px;width:387px;;overflow:hidden;border-top:1px solid #dfdfdf; padding-top: 20px;margin-top: -17px;background: #f7f7f7; /* Old browsers */background: -moz-linear-gradient(top, #f7f7f7 0%, #ffffff 100%); /* FF3.6+ */background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#f7f7f7), color-stop(100%,#ffffff)); /* Chrome,Safari4+ */background: -webkit-linear-gradient(top, #f7f7f7 0%,#ffffff 100%); /* Chrome10+,Safari5.1+ */background: -o-linear-gradient(top, #f7f7f7 0%,#ffffff 100%); /* Opera 11.10+ */background: -ms-linear-gradient(top, #f7f7f7 0%,#ffffff 100%); /* IE10+ */background: linear-gradient(to bottom, #f7f7f7 0%,#ffffff 100%); /* W3C */filter: progid:DXImageTransform.Microsoft.gradient( startColorstr=\\'#f7f7f7\\', endColorstr=\\'#ffffff\\',GradientType=0 ); /* IE6-9 */width: 396px;left: -5px;position: relative;\"><table style=\"position:relative\">',\n footer: '</tr></table></div></td></tr>'\n },\n tag: '<span onclick=\"jQuery.MidasInsight.tagClicked(\\'@@@kfid\\',\\'@@@atags\\')\" class=\"mi_tag_@@@atagsreplace mi_tag\">@@@atagscap</span>',\n slidercontainer: '<div id=\"mi_previewPhotosContainer_@@@kfid\" style=\"height:65px;cursor:default;-moz-user-select: none; -webkit-user-select: none; -ms-user-select:none; user-select:none;\" unselectable=\"on\" onselectstart=\"return false;\"><table class=\"mi_previewPhotosContainer\" style=\"\" cellspacing=\"0\"><tr>',\n photopreview: '<tr ><td id=\"mi_photopreview_@@@kfid\" onclick=\"jQuery(\\'.mi_thumbscontainer\\').hide();jQuery.MidasInsight.resize(\\'@@@kfid\\');jQuery.MidasInsight.MI_GetPhotos(\\'@@@kfid\\',false);\" colspan=\"2\" style=\"width: 100%;overflow: hidden;background-color:white;\"><div class=\"mi_thumbscontainer\" style=\"margin:0 auto;overflow:hidden;width:386px;padding-top: 3px;border-top: 1px solid rgba(0,0,0,0.2);\">',\n tabswrapper: {\n header: '<div style=\"width: 152px;margin: 0 auto;background: #fefefe; /* Old browsers */background: -moz-linear-gradient(top, #fefefe 0%, #eeeeee 100%); /* FF3.6+ */background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#fefefe), color-stop(100%,#eeeeee)); /* Chrome,Safari4+ */background: -webkit-linear-gradient(top, #fefefe 0%,#eeeeee 100%); /* Chrome10+,Safari5.1+ */background: -o-linear-gradient(top, #fefefe 0%,#eeeeee 100%); /* Opera 11.10+ */background: -ms-linear-gradient(top, #fefefe 0%,#eeeeee 100%); /* IE10+ */background: linear-gradient(to bottom, #fefefe 0%,#eeeeee 100%); /* W3C */filter: progid:DXImageTransform.Microsoft.gradient( startColorstr=\\'#fefefe\\', endColorstr=\\'#eeeeee\\',GradientType=0 ); /* IE6-9 */-webkit-border-radius: 15px;-moz-border-radius: 15px;border-radius: 15px;border: 1px solid #cbcbcb;padding: 5px;\">',\n footer: '</div>'\n },\n footer: {\n header: '<div class=\"mi_footerwrapper\" style=\"background-color:#fff;\"><div class=\"mi_footerroot\" style=\"top:2px;\"><div class=\"mi_footercontainer\" id=\"mi_footercontainer_@@@kfid\" style=\"height:100%;position:static;\">' +\n '<div class=\"mi_footer\" style=\"background-image:none;height:auto;margin-top:2px;\"><div onclick=\"jQuery(\\'#cpcnt_@@@kfid\\').find(\\'.MI_tab_selected\\').removeClass(\\'MI_tab_selected\\');jQuery(\\'#mipct_scroll_@@@kfid\\').addClass(\\'mi_blured\\');jQuery(\\'#mipct_tblabout_@@@kfid\\').css(\\'max-height\\',jQuery(\\'#mipct_scroll_@@@kfid\\').height()+1).css(\\'height\\',jQuery(\\'#mipct_scroll_@@@kfid\\').height()+1).css(\\'top\\',jQuery(\\'#mipct_scroll_@@@kfid\\').position().top).fadeIn();\" style=\"z-index: 1;position: absolute;right: 0px;top: 5px;height: 25px;width: 65px;cursor: pointer;\"></div>',\n share: '<div class=\"mi_footer_prompt\" style=\"color:#59a3e8;top:auto;border-top:none;position:static;float:left;margin-bottom:0;padding: 7px;\">@@@ask</div>' +\n '<div><ul class=\"mi_share-buttons\" style=\"padding:0;margin: -5px 0 0 0;\"><li><a onclick=\"window.MI_logUsage(\\'mail\\');\" href=\"mailto:?subject={1}&body={2}: {0}\" target=\"_blank\" title=\"Email\" ><div style=\"background-image: url(\\'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAJgAAAAxCAYAAAAm0WAHAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAyZpVFh0WE1MOmNvbS5hZG9iZS54bXAAAAAAADw/eHBhY2tldCBiZWdpbj0i77u/IiBpZD0iVzVNME1wQ2VoaUh6cmVTek5UY3prYzlkIj8+IDx4OnhtcG1ldGEgeG1sbnM6eD0iYWRvYmU6bnM6bWV0YS8iIHg6eG1wdGs9IkFkb2JlIFhNUCBDb3JlIDUuNS1jMDIxIDc5LjE1NTc3MiwgMjAxNC8wMS8xMy0xOTo0NDowMCAgICAgICAgIj4gPHJkZjpSREYgeG1sbnM6cmRmPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5LzAyLzIyLXJkZi1zeW50YXgtbnMjIj4gPHJkZjpEZXNjcmlwdGlvbiByZGY6YWJvdXQ9IiIgeG1sbnM6eG1wPSJodHRwOi8vbnMuYWRvYmUuY29tL3hhcC8xLjAvIiB4bWxuczp4bXBNTT0iaHR0cDovL25zLmFkb2JlLmNvbS94YXAvMS4wL21tLyIgeG1sbnM6c3RSZWY9Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC9zVHlwZS9SZXNvdXJjZVJlZiMiIHhtcDpDcmVhdG9yVG9vbD0iQWRvYmUgUGhvdG9zaG9wIENDIDIwMTQgKFdpbmRvd3MpIiB4bXBNTTpJbnN0YW5jZUlEPSJ4bXAuaWlkOjQxOTgzOUY2RjMxMjExRTQ4RDc1QkNENzc1ODE3OTkzIiB4bXBNTTpEb2N1bWVudElEPSJ4bXAuZGlkOjQxOTgzOUY3RjMxMjExRTQ4RDc1QkNENzc1ODE3OTkzIj4gPHhtcE1NOkRlcml2ZWRGcm9tIHN0UmVmOmluc3RhbmNlSUQ9InhtcC5paWQ6NDE5ODM5RjRGMzEyMTFFNDhENzVCQ0Q3NzU4MTc5OTMiIHN0UmVmOmRvY3VtZW50SUQ9InhtcC5kaWQ6NDE5ODM5RjVGMzEyMTFFNDhENzVCQ0Q3NzU4MTc5OTMiLz4gPC9yZGY6RGVzY3JpcHRpb24+IDwvcmRmOlJERj4gPC94OnhtcG1ldGE+IDw/eHBhY2tldCBlbmQ9InIiPz5SFpoiAAAe+klEQVR42uxdeXBd1Xn/3r5ptWTJki3bsrzbeMcOm9kNCRCghKWEpFkIkFCSIaShpO1MOmkzmTZJZ2hT2gYCTKCUBEiAYQlJiMHYGLzIeMEL3hfJkmWt7+nt9/b3O+9e6erpbZKeRP7gzly9d5d3zvc73/6dc69suq7LJ9sn23htTuvB1q1bh91gs9nUJwUx/Tt3fjeE1I5Pv9Pp9GiaVm232+fgegP2MlzzYI/gei/2E7j+Ea6fSSQScVwPsUmzLeun2ddoNyuN5rFJL/ofhgv0uHE+gHM+fDZgb8K1GuwB/hx7GNfasB9OJpNHcD6Iz5jD4YhiF3wfMjbmZu0/34axKQgb6TfbtY6b0Qb54MZxJe6bjWszsFfikg97HOf7sJ8y+HAauGM43497EtYxs46XFZOF50O2VatW5Raw0WwgshSdVbnd7ktcLtfl+Gzw+Xx+bAGPx1OFcyUgzIl74gASjEQiZ/v7+0PhcDgUi8WOx+PxN/D5Du7pRHPBQphQzI0DBQy1GOhG0H416L0In9WBQMAGDCX4Xg5m+XHdhvtCwNANDB2hUKgPO5XkEATrZXwewPU+MunjsBTo2wcs5aD3PNB7JXDMBP0VwFECPkzCuVIoAZU/ST5Eo9Eu8gF7GONPIVuPzzfQRjuwdheLLptVEkdiwQiGVgrE3+H1ei+cNGlSTXl5eYNpGXIJikXT9J6enqOdnZ1nIHBvg3FP4/Qh/LZvIiwY+p+OcxeB/i9DKeYDQ3lpaWnJSDBAuPq6u7v3dHV1HQGGV4HhDfyuA8zUJsKCUbBwOB0YbgGGSysrK6dWVFQ04rqrUAz87O3tPQ0+dEDgtkL4nkS7u4Dh7Fgt2IgFDJ/U5EUAdCcEal1NTc10AAtkIz4b49M3MKevvb39CIC+ju+PY4D2WYWjmAIG+ivw/XJguB8YzgGGMiiKjBUDLNq+tra2Hfj8FQTtLTCoc7wEjG1BuGcAw19CKW6ora2dDYtVNVYMoDsOPrSAD+vx/RGcasYemxABo0/HoF1fUlLyjbq6usUA5hurlUnvJ4ittbX1g76+vv/AAL6O893FFDC0uRAYvlVWVnbzlClTKoFFiowhCav8ITC8AUEjg45QboopYLRacHlr4f6+CQxroCRVxeYDaE8Cw0cQtJ/DfT6DMWsdjYA5vv/97w8ctLS0ZO0QoKbBvz8ETblv6tSp82C1XByMYmWhJtGwJG4wn8nBCpjqSQC3ly5zLAJmYczlaP9hMOX6+vp6H7RfxgGDHWNTCwwLOGbA0A2hbgEdyUIELB8taHMS4qu7Jk+e/O1p06adxxhrnPhgBwYma6uBoRF82IPvZ3P9FmM6OgEDgFno8IcNDQ13ANgkSDPdpIxHQM522T4sSyX6XIKYoA6JwA701TMGAbOj3RsgUD8BU5ZVV1ebMdi4YYAQ+MCgucBSB5ffDwzH0Gd8LAKGdmswJn8DBb8bit7kYKA3vnwQ8MFHPgDDAgjaDmBoK6qAoSP6+X+bPn365xBAuoplivMNMgcNlsCDvhfAXE8Bg7aNVMhMAYMFUcIFDHMQAGc18eOAwQkLMwPCVg9F6TRKG4nRCBj4MBmM/h6U/CtVVVXVRllo3DFwAx8E4zcLGBaDD1uAob1QAbPnkeI6gPpHaMxnwRjbRDAm3VQjvvDA6twEOh4CPVNMocm0Z8FwMX77I2BoRFvyMWBwQzE/hZj1TsRN5+PYWYhSWHdgKIOQ3gMG3gE+VNANZ8JgU78vwp6BD7DGgjG8CGP5E9Azu9AxyGXBAjCRd8EU3w2XwqKdbaKr/hYNouWkBjFt3jmCWtNsYPgvYFgCrZ9Q4UrD4ASGabFYzA9X02zU/AoSMP4WbulahCYPINutS7dcvMdhZ9nCpoQDCMdMM9tSlRp9aEBPS4atCR7FgXPvo+/+fBYslzZdgCzxHjAmkJ5tfhxCBjoqkWDe29XVtR1Cs6GAtLscv2W2uJrCNRGuPY+79CK5uA6pfysys382Sxj5SgewFnOA4X4IV2O6cFEIYglN3j0UleYTUekMaaKNESN/7oSALZnmlsvn+yXggQXVh/CBGebnwYf3cO6plBgWOFVkAVUPaf1baD7jh4JrM+PJINBhAz1zwKAHsB+CVrfkYg7inbWIG74EzRe4pqJiSHcjYoyylbcmKeY5IzMrAYarYMk2AsNLwJDIhQE0l+M390IwVwK/3YqBVqsjmJRfbw3J+gNhOYPv0bguYw33dcPVbjkakbMQ2C9+qlQJsm4IGQN/CHsF6H8QgrYNGD4ckYChESYn1yFeWeP3+9X8WrYBVma82MJkTt+k6QXSZGY0jAXWIptZi3ueRf96lsp0DTDcj3ClJBcGu0G/lqG/jK7DZinWGsJjM4Ifm6TaG0KLan+wbWIA/SyI3goGvYNT7Xms3gpgvga724qB3cSTurywPSTPbe+TKWVOuf3cEplR5VR0jMWG8fd7W+Pywo6gvLm3X5ZMdcuqmR5JaAMzF8IxhXwsAh9uxvG/gM7wSASsnloDU+jLpr0caFhmSeJPsZ0O23Y6UnFFUhueOoOuir6+vq8jlnkL2tOaScBw36XAcMmkSZNy9kX3wnFzoz/2m0vITOE6dCYmGw9F5MOWuHT1J0GnTaZWOGXldLec1+SVUo9djnclZPPhiFT67bKm0SvlPru1bQ8swHLEk+vAoGezlS44FQcMrHdNS3ftDtC792RcNoOOxmqX3HdpuSyod4vLXoTxR9uL6hNyuCMu+07HZXdLVM5t9AwTfo4t+PA17M9hXPYUJGCsDeHmCyGhMwFuWNxlWq7jZxPyxt6wbD8Wld6INqDBY/f9CBTBrEvne+XCJp/4XDZJ6kOBwe1xEvocMGcZTrVmyNrKYb2+AK23cfonU9zFGOODk1F5ZkufnA3q8hcr/HLlAr/qP5HBk/J8BM7s1V1BefGDfmnvTSrFshtZ10kI1DaMxe8/DMu0SofsAPM7Q0l1/Uwf3Mx5JaJrKYxUEtDPuuI1wPAKmunKEos1IkxZg92ZiQ9toKEHY3/D8oAsbXAb5Ri9KC6kMmCX2TUu2XkyJn1hfRhzSY/b7SaOWijKlTg+gP7jeQUM5o6rB26B+SvJlHGRMc0nYvLohl45BAn3QWUcNsOuFgFbBPvulpjsPhWT/dCev4L/D3iZpg+9D66vFIHyTYhlNkApgmnNzEDMdQnT6kwYyBwqxfPbg7LpYFS8EOLH3ukTN7BdPM+rrGciMZiLOVQgLbg/JP/7fhDfdZlb65KL53plXo0b8V1KwDZ8FFEM2Qu6fW4b3JZDWnuSsr8tBiFOSoV/iBVzAEMTrPB8uM3NVldv0OwChhtwz+SMma9uuHVmdi6Oj54xrBhWMrCLsrgDAqPTS+hDPAUvJSCoVCoxs9Is2TfG2NHT03ML3P3/cdlPXgFDI5Oh/RdwqUom4k73poLK/W1xaLxPPrPYJ1PKnUOC2bEEzgS2A0wiM1/bHZZaxBY3nxtQA2hlAOhzQhHWxePxKq7JspKJ61eBObglkLEfFwZ456moHDyTUBnSjcsC8v7RqDz8Zq/0RjW5ArjK6NKSqcGny9gE4fltc0gF0Z9Z7Jfb15RIbaljICBeOMUl58/yyvr9ETkIxVuDmKWtNyGPbQzKYfSzCwpzyXyfam8gxS0vn9fe3n4NlKQZzIlYvQgwBIDhWk4D5YqVVPyoFTb2KUXRlVuPJwdDkQCUgUqWyaOY/WSLEWHBbKBzBZUae34Bg3AthQtymstV0v0+XeIe+OR6CNW6hT5ZMsOT0qZkMSZZsaOPGmg+0+1H3uqV5uNRuXiORyaDmUO0DDdDwLwwzyz4HbM0w4WClzAItS7ISy8tH4OL7+7XEL845dolfhVj/DsEjH0ebI/L9UsD0gBX5/c5pA+u7l3EOi3dSbkMrvtWCHxdhSNl5XQj6wLtFNZPn+MDQ3xyoisJoY1AQRyI2eJyFP2l0kpricFeBuaQfpdhvK34piJrrMjEh9FsFK6+qC6v7+qXV7C3wlD43HbEiDa5CS523UK/uJ3DY9789TI7a2M6+HAuaN4ixqR+riB/NRfZZTTLGKDWngTciy4h+Iyn3gsqjVyO4JZmN54YfYmP40jLchZa/4e9EcQ5IaVdFDS6GbqbRFpxkYsa4SZXI6Z5yyy84rsXTFuaLfYytxBcZBT0VpU41MCumOGW+68oV5je3BeW945EYaG9ctFsr7LadHulPpucN8sj06ocEosOTW5UbGUwMpFMTY+safSoOKkzZJeZyO50y4S0pXA5Gcwp4wpTy6ICMm4FrJffPM4UJw2Otm5pN4viYoA3HwrLk5uDKuFYWOdW3iIU11Q2qumGsuiD5Qizfd1oONt4AoMXhmkNXP0TOAzms2CLYBlc2dZh0bTGIVQcsAPQ9B/9rkduWxWAW/EiMMTAx0cuZE57ijH7WmPyXHM/3ExUKsDMagSaHAQKbqYNljYAOhdwKoZhg3GaaSOzL8m6lgz88rqYOUKroSwUCBK9qN4p37myTF7bE5ZNsFi/aQ7Lb3b0K4acDWoyY5JDWS7+PhtGWoBU9qvJq3Dx247H5Y41AbhMt7J4GZjDhKQJse8pi4A58H0+VwMXKyuPQiGOdSakP6aDHp98bkUA2DVV5yrxpDLoQes1Mg4y2IdCLGQhOa+A4aZZLEpmnlJRFSrFkE8j9uLl57b3yyNv9ykXcP0yv8ytcSqNKNTUup02FddsOsyMLqSElvELtX/rsZi09CQGNHRYwgE6yRyuozenLMAcLvOxZ8eQKkVUw3KVeu1ytCOhCpR15XYlAHQZn18dkAtmuWXzkZiKNZkxEnOJx64SAdGyazOVpT8m8hqyyfdhBW9Y6pdrMVZOhwyJv0wrDCHiOvkmtPeODK4Zc2Jv4pr6rLMPlqqunsWC8SsTMKfTZrhyZODgNt22B0LlQYJWXWJXcZlpwcw2rH3qup7TgnGs+eyFoeh562BVrNTmnABnDQTW6sqFXqlBbESr89LOsBKyW1b65VNwIy4giyf1nPGWB8AZ17y+h5YiDMuoyXVLfHIrtCsA5m8/HsupTEZJpRq7w1L9ruVxrtiFt/bHNDWw/RDuF0F/NWLpmlK7UaKghXapNJ1aTlynulmWsKm6VkLLPVFNHHTtTZNdKgli9phtLDDWXFlbw3leE4OBpzofHwqJu8KwWIehRPQ8XSFNYSeWw1DkCK7RelWBl1SA0SZpxlgzrHIVkkW6s64tslBgjtdl8z1K+1/6ICx/RAb18J/6YIqTcpUSPjvinMGpB7MJh+ESKUCsKW04GEUbDrlxaYnKTMuhVafOJgsF5pWhK0LKUgV1W04BO92jSU9YlwV1LhVbMbas9LvUJC9pZBhAprAAuwAZ4uJ612CIkMy9/opuPQjBpBtm0TWhYihbNoFkMdtnrI5IGud4cyDnGq8ChIG0H+qOy49/36dcIEszxMdaHecuKfSrEHt+boU/pTijFDCDTpvBi7wWTDdXR2aqvQwRNuzUgnm1Lrl7rUPqEZ88/X6\\/\\/PK9kMrSbljqk8VTXco1mN7BBatFq7D+QFTFN0chSLMnO+VrF5XIKiQLnI5IJvShZl8yL9E1HxFLx2usuc++ckIXpbkeIKfL4ACrgq6mDyvnaSpDTglWphmDTPFOBFaRicH0SqcS3lSJJesaL7al57iWsS8zGB8I+DO4SM2oj3qAzS5G/Qs301oRuypT2AdDn3QXaY2mc61CyTfHmy5g0Uzzdrkmrsx5vGAkRXwSVusP+yJyEqn6ZfM8CJ5dSkOoMSdhnpmhvXUgBvekpSrnyZSgaiMMLw1gYWiQZtGm7tSl7KAZHzZCqJlB7mtLyHEEv+fDrUcThc1H5qpLcWOdie5odaNDJRKRHOOPsSb9fB5Rs1gsUhEc6+Q8kyN6hgeuKMV3kRcRxrwJL3PFfJ9cPNej3CdrYH53brdfCB8gfFp6qSWbgJ1F0Dw1mwXTDYdnBn4UEPr0p97rV8Q3Iru8cblP1X5e2R2Vx99NyHSk9XQVtBDtfRqELCFN1S65a3lATnQl4CYj8rO3+qQDTPn0Io/YHdYAdlB70unhxDHOdZiuxdhO4RiXEp5sWsfBXoyMsRF0UQleQPxXD0aw7hVL6mOIRVIxDyeKWbicCyFOJHOvP4vH43zouAPuXrNkkUk+m2jgy27BRB9mXay3MoxhnNs02aESqXJvyv1PRgjSUO2QZCylUPQaVlnW9YEOhpRBsuEw6AwWNFXEJ5ZjsdiSfOumbEbB8gAG88nNIVilmIpnvnp+iayc7kJ84wYT3bLlWCoTY7bmQk91yGDWLSxRvn9BrVOCUU1lZ89s6Zcn3w3id0m5bZU/tdjNlnv5DuikBTjEOWvLpZPUpmg0qmb8syUpLIMwAGe8yFiQmfBnkWAsgUtn/W00QkYX1BVKygbEN9WIPxfVOYdljukY+PAxMVjdJBWE54AhHggEXGOxYsQaBdtpnc0QQK2KwHE0UZxlChxr0HwcAhYrZC5ydyQSuTbjsl5LKMH0t/lYXH6+MSh7WlKlhS+fnypTROD6/DC9a2e7laXoDSNjM6YmGOtUBexqro7BMj9vXOZV2vX45n55dms/rIDIJXPdMiBjWSwYmBODtvOJo6jFRfbgHJ+8Ls2lJJxbpCJMRdx4HFasq19TlX1+MnUXfWTuWtWRgHHnqbicgNBevcgLF2xTFizXBgwY8uQxa80O1owW+QCfuq6srKzIVM/T9KGBWK5C60DxNBWh5i07DJQp0mOyLPdjrGl19+B6uBAXuQWgdfOJkvRGecQ4i1pKd3cAMcxVC7xy+7l+aZjkUFqhG1NHtPi0FFUB54AxMk0yA+FUPKQLQgBZt8AjpRCyRzemSh5MrZkMpJYAZ9Z+AsMnH0BIWgQsAtqbgaEhG4bBbFaXOTUO+eCUDZZUpB7WlcJvzzTfkbdYbJMzQU1+i2yatTTGnvmsIOmCe+k03Et6XLODlsHE8Oe6kT5DwLZAMfozKl8a6A8Aupc/ylg9hwXyu+yy9XhcWnqScstKn9x5AYUrVbAbmJowxovBI4UuYuyxZMrvWx8w4M9soOKi2R759uUlMhtWcA9c7xFkorR43PW0tJj0gc4OfD+YRiJBvoJrejYMZo2Ifa+b75U5iFE4pfPs9rDK/sSWecVqVuFypDC+sjuirOHaOR4V32l56mWwUP2gc2P6unZDIfhiksNQlD9b4TL5gDiSL1N5L1s2nG7BOgD6j729vbcwhrH+htXsmZWs/tqktVeT21ZyysEnlbBSsYQ+ptUUKnEF05c3kByfPLIhJPtOp+Ygp1Zwykgb0j7oI7AXQd+ZdMMA4OvhdoJ9fX2l6RhMd0Y3zCyrxCPIqjzS2qOpeJFTJ5fNc8vKBrfUoV9bAcLFrJRZMS3vPMSV1yz2FrR0pgcbxvoVaH44A/P6cO03wLkUGBxZyxTGilnl8vK4SEmbu8zlIjV9cA2YnqNMgTGmom8ChmMFlSlwYwia8zyU6xYG0VyPPxi36LKswaUCdGor59nKfVz3ZBdt5FNYGQugyaRNdiGmO9mlKcE6f5YLbtY+JCCFYFH7MQb6y+lm2RiEVmB4PRQK3ZyOIbXkSIMwRGUfkg9mWcz8QrHUylYG/a8i+w3h3LUQlDKvLaOgcOxdYDtjy42HYvKLTf0yyW+XL6724dOWmt/MsYEuWtiDoPdguns0jhPA8Cos2IPAyzV6GRXFLLuYa+Y1vVjWKf9yHYMPdI/P53ri25lBe97hGiUo2HI+MDGwDBkfrJvctNyrhG0rsq+nt4SVYGWLlUa06YPpPoX22nM8EDD3gOs1Bx90kUF/wvftGaZelGKB5sdwz024127FQIFaD2vz8q6IKrFU+FMumJaSrn9erUPOQ5+z4Ta5uiOdYTbDatG2dSJ5eXM/51DDShDvutCvLFhCyz0WxNDd3c1XVz2e7QFW476DuOcl3Ht7TU3NsCC/BmNEBW8+GZfVjW6ZVZVaGZLeOcs+g0XVVIXfxvqXnrk8wGp/byQpp7oT6t4y7/CsmhjoRRAnHsfhG0YdrGABa4FU/gwN/E9JSYmd728wGcSK9pRSm9xzoU+aT7hkd2tqhr4YT64bz0go4Vo1wyVN1Y4hD2OYPh90xeECH8v1CDvu3QYMr+De60pLS8VcvmOT1FQPk4wyn8j8WlhkZJOzqp3YHcoqMXZin0kzqzPW4qeWU3PBnq5mIF7eFZUtULKZlU758nleWTrNOWTWIlfcEgwG94O+N1n/ynFvL+55FBg+y1dKDeWDLrNB7/kQrF83h+WRt0Jy1UKPGrt0Z8KMn5a2I0j8NlX7238iJuFEZstMvHtPJ2TbibjUBFLlloQ2GKJY+ED3+HNgOJLTGlpN77Zt2wYmjXH+ibKysqvr6uqGLX2xWwL58djMLNkKiv23tbVR+5/H8b043ZZlftLcLsIAvMQnoadMmTIgJKzeP9eccvEUtIUYwAua3DIPGSWX5tBKp6ZSbErAqVRh3McFe5ycf/9YXK20YN3rXM7lLfPITFiPpJ57wtjE0Nra2gfm3IvjpwoILPhik38qLy\\/\\/FjFYF1Gm5hd1eXFnRDYcjCGL1XPW3TTDhdptg+41432SUjIul6IXuRkeS2ymARjCh9249SaWVMzf5n190/bt263xzOVo8Jnq6urJfIIkW1A4Ho+tZXErcubMGVrXW+nGC2jKD0v3d3Cb36ObrKysTD1fCSFrC2qy/qOYbIewHOnkuqikWr7TVMU5VbuK+9TafE5cRzWl/UdgtViK4MDThTI+ZObrdw+fq8wmYF1dXcTwNDA8gOO2bOWLtOMFwPBCVVXVfPPpdKuiU2h2tyRUDY70JbQsPDEy43zJmGbMACyd6lQYXU7bEEU3+NCLsb0Hp56x/javgFksGDcfGvkm3MsPEAO46Gom+tF78/F5uBRqTT9ikgf5KgAZXGCYb+K1AfsTCPQvq62tVc9VcvLZbtPVkiJOc+04lZCP2hMqM+4M6WoRYiSRWtNGYfTCopVxWUuJXSUenIFYhmy30mc3VoOOCMNuxC2fhyXaOcKhuMnpdPIVCNXp7zOzyeDDHPYiajvDASYrusU7IHGS06dPM/b6CfjwA9DQk0/AnDm0J4xGfwGmzoHEfpUdmA9STISQmYwhKPSfBB2PgoZnOJUygjZO4Df347dPtbe3n8P2iIHkMzOtZTJR6YGguFWpoq1Pk+5wqhCsBAwxGWclWDDmNFdNqU0FwbECp1qsGNA/p+G+OwrhYhuvIWv7KcbhH7jExypkulFvTGj6uPKBGSMwMMHiE+kPpwtXQTFYpjccYuODnz+FJbuZrobgxtuSWbW+o6ODQeUvcfxdyfLkSq52jPeArcX+nwiUF/HdYOkYzBeIOGzD40sz/afAJfXClcuKAYJxClr/XUNBRjtwfKvO34MP94EP7onkgylcwMDnH+5Gn/sz3T+qNxyyrolGNyNgnhwOh5cYS31lvN4GbQaS9PVnz57VAeoJnPt7kjeatoyN8307YQWWA0NdJgymENEaxJODu3qCXRtZjSkNw1Fo/UMQrl+NYhZqyLQf2t0KPtiAYSVLccRQrCePsmFgWQgKQuH6Hdzifbi0L9tvRvUCOouQbeLMLKzJMq6DZwGT67GL5TJNbeEcHJhC5rDSzfce/HCkliu9TWM7Dma8DwgzwaDZXGYyXhiYxnd2dpI52yHU30G/L4xRuAbCFrT/HjCcRR9LgIGPvg0Uk4vNB2IAH5LAwJrdg7j8Ua7fZhKwQlyktXMu72Vq+hC0ZyHNNIP/sQC0/BMEVVuhSwG4D3Dqh7jG6aDoWAcr7S3PM+Euv4FzX+fbbkh/sTCwum1gYMzIV7L/GNd25coSR4mLHfKR/e+53e6LjZfCFI0PnALibhRS/xXXnkabXfleLT+qt0xnIgK/WYj9SzCZdwJUJV9MxuCZxcCRmGxmfdQUBsH082BQB7Tzv1kjwr5vrAzJ8Z58L74zLvtr0Hud8Z4FtY8GAy0W6ecOwdrEeA9tvIZ+OtNDiWJaGbTViL5uQ1/3AMP00fLBXJ1i4QPXETE0edScMSnkv68UU8BMa8bnEm8GmNshbNNprhkXcKc2cerGePonNW+WTKqdmk7B4s6VDzh3FANFoXoB+15arYn4Rwz4rMXplej7Kzj+DOj15cJgrvfPgIGzC2/jGpOR9diPpTNlnARMhTn4nIv9OtD5BT7bCgy2QvnA+Vpi4Hec6wCGZ3HL07h/t/WB4I9DwAbe3IdTdSBsOY6vBJiLcW6m8fiV3TDnqRpfatOMyVz+v5+3AeR3OOZrMVtwLTaR/6vIgmMSdi4VvxC3XY1ra3C+3KA/HYNmYOC6+R3Y1+P773HL0fTi6QQJmNkPJ2Lr6V1A0xXgwyXAMZ/JgIkjnQ9cbo6dxeuNOM\\/\\/ScAXLXPZeSgTHz4uAbMOng/HXE1ayocx+dJeptec8pDU/yGiyziN6yf50hJqCJerZPqnThMsYNY+y7EHQHsljqfzhTDY+Tic01i7dQa/Pc5/imX8Iy9OricyZdUTLGAD10C7h3zAJ/8tDstMdVQigw9cHtTNN0TyH5MZfOET2aH08S+6gH2yfbIVe7N/MgSfbOO5/b8AAwDCB5vdkkgX5QAAAABJRU5ErkJggg==\\');height:50px;width:50px;height: 30px;width: 30px;background-size: cover;\"></div></a></li><li><a onclick=\"window.MI_logUsage(\\'share\\');\" href=\"https://www.facebook.com/sharer/sharer.php?u={0}\" target=\"_blank\"><div style=\"background-image: url(\\'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAJgAAAAxCAYAAAAm0WAHAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAyZpVFh0WE1MOmNvbS5hZG9iZS54bXAAAAAAADw/eHBhY2tldCBiZWdpbj0i77u/IiBpZD0iVzVNME1wQ2VoaUh6cmVTek5UY3prYzlkIj8+IDx4OnhtcG1ldGEgeG1sbnM6eD0iYWRvYmU6bnM6bWV0YS8iIHg6eG1wdGs9IkFkb2JlIFhNUCBDb3JlIDUuNS1jMDIxIDc5LjE1NTc3MiwgMjAxNC8wMS8xMy0xOTo0NDowMCAgICAgICAgIj4gPHJkZjpSREYgeG1sbnM6cmRmPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5LzAyLzIyLXJkZi1zeW50YXgtbnMjIj4gPHJkZjpEZXNjcmlwdGlvbiByZGY6YWJvdXQ9IiIgeG1sbnM6eG1wPSJodHRwOi8vbnMuYWRvYmUuY29tL3hhcC8xLjAvIiB4bWxuczp4bXBNTT0iaHR0cDovL25zLmFkb2JlLmNvbS94YXAvMS4wL21tLyIgeG1sbnM6c3RSZWY9Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC9zVHlwZS9SZXNvdXJjZVJlZiMiIHhtcDpDcmVhdG9yVG9vbD0iQWRvYmUgUGhvdG9zaG9wIENDIDIwMTQgKFdpbmRvd3MpIiB4bXBNTTpJbnN0YW5jZUlEPSJ4bXAuaWlkOjQxOTgzOUY2RjMxMjExRTQ4RDc1QkNENzc1ODE3OTkzIiB4bXBNTTpEb2N1bWVudElEPSJ4bXAuZGlkOjQxOTgzOUY3RjMxMjExRTQ4RDc1QkNENzc1ODE3OTkzIj4gPHhtcE1NOkRlcml2ZWRGcm9tIHN0UmVmOmluc3RhbmNlSUQ9InhtcC5paWQ6NDE5ODM5RjRGMzEyMTFFNDhENzVCQ0Q3NzU4MTc5OTMiIHN0UmVmOmRvY3VtZW50SUQ9InhtcC5kaWQ6NDE5ODM5RjVGMzEyMTFFNDhENzVCQ0Q3NzU4MTc5OTMiLz4gPC9yZGY6RGVzY3JpcHRpb24+IDwvcmRmOlJERj4gPC94OnhtcG1ldGE+IDw/eHBhY2tldCBlbmQ9InIiPz5SFpoiAAAe+klEQVR42uxdeXBd1Xn/3r5ptWTJki3bsrzbeMcOm9kNCRCghKWEpFkIkFCSIaShpO1MOmkzmTZJZ2hT2gYCTKCUBEiAYQlJiMHYGLzIeMEL3hfJkmWt7+nt9/b3O+9e6erpbZKeRP7gzly9d5d3zvc73/6dc69suq7LJ9sn23htTuvB1q1bh91gs9nUJwUx/Tt3fjeE1I5Pv9Pp9GiaVm232+fgegP2MlzzYI/gei/2E7j+Ea6fSSQScVwPsUmzLeun2ddoNyuN5rFJL/ofhgv0uHE+gHM+fDZgb8K1GuwB/hx7GNfasB9OJpNHcD6Iz5jD4YhiF3wfMjbmZu0/34axKQgb6TfbtY6b0Qb54MZxJe6bjWszsFfikg97HOf7sJ8y+HAauGM43497EtYxs46XFZOF50O2VatW5Raw0WwgshSdVbnd7ktcLtfl+Gzw+Xx+bAGPx1OFcyUgzIl74gASjEQiZ/v7+0PhcDgUi8WOx+PxN/D5Du7pRHPBQphQzI0DBQy1GOhG0H416L0In9WBQMAGDCX4Xg5m+XHdhvtCwNANDB2hUKgPO5XkEATrZXwewPU+MunjsBTo2wcs5aD3PNB7JXDMBP0VwFECPkzCuVIoAZU/ST5Eo9Eu8gF7GONPIVuPzzfQRjuwdheLLptVEkdiwQiGVgrE3+H1ei+cNGlSTXl5eYNpGXIJikXT9J6enqOdnZ1nIHBvg3FP4/Qh/LZvIiwY+p+OcxeB/i9DKeYDQ3lpaWnJSDBAuPq6u7v3dHV1HQGGV4HhDfyuA8zUJsKCUbBwOB0YbgGGSysrK6dWVFQ04rqrUAz87O3tPQ0+dEDgtkL4nkS7u4Dh7Fgt2IgFDJ/U5EUAdCcEal1NTc10AAtkIz4b49M3MKevvb39CIC+ju+PY4D2WYWjmAIG+ivw/XJguB8YzgGGMiiKjBUDLNq+tra2Hfj8FQTtLTCoc7wEjG1BuGcAw19CKW6ora2dDYtVNVYMoDsOPrSAD+vx/RGcasYemxABo0/HoF1fUlLyjbq6usUA5hurlUnvJ4ittbX1g76+vv/AAL6O893FFDC0uRAYvlVWVnbzlClTKoFFiowhCav8ITC8AUEjg45QboopYLRacHlr4f6+CQxroCRVxeYDaE8Cw0cQtJ/DfT6DMWsdjYA5vv/97w8ctLS0ZO0QoKbBvz8ETblv6tSp82C1XByMYmWhJtGwJG4wn8nBCpjqSQC3ly5zLAJmYczlaP9hMOX6+vp6H7RfxgGDHWNTCwwLOGbA0A2hbgEdyUIELB8taHMS4qu7Jk+e/O1p06adxxhrnPhgBwYma6uBoRF82IPvZ3P9FmM6OgEDgFno8IcNDQ13ANgkSDPdpIxHQM522T4sSyX6XIKYoA6JwA701TMGAbOj3RsgUD8BU5ZVV1ebMdi4YYAQ+MCgucBSB5ffDwzH0Gd8LAKGdmswJn8DBb8bit7kYKA3vnwQ8MFHPgDDAgjaDmBoK6qAoSP6+X+bPn365xBAuoplivMNMgcNlsCDvhfAXE8Bg7aNVMhMAYMFUcIFDHMQAGc18eOAwQkLMwPCVg9F6TRKG4nRCBj4MBmM/h6U/CtVVVXVRllo3DFwAx8E4zcLGBaDD1uAob1QAbPnkeI6gPpHaMxnwRjbRDAm3VQjvvDA6twEOh4CPVNMocm0Z8FwMX77I2BoRFvyMWBwQzE/hZj1TsRN5+PYWYhSWHdgKIOQ3gMG3gE+VNANZ8JgU78vwp6BD7DGgjG8CGP5E9Azu9AxyGXBAjCRd8EU3w2XwqKdbaKr/hYNouWkBjFt3jmCWtNsYPgvYFgCrZ9Q4UrD4ASGabFYzA9X02zU/AoSMP4WbulahCYPINutS7dcvMdhZ9nCpoQDCMdMM9tSlRp9aEBPS4atCR7FgXPvo+/+fBYslzZdgCzxHjAmkJ5tfhxCBjoqkWDe29XVtR1Cs6GAtLscv2W2uJrCNRGuPY+79CK5uA6pfysys382Sxj5SgewFnOA4X4IV2O6cFEIYglN3j0UleYTUekMaaKNESN/7oSALZnmlsvn+yXggQXVh/CBGebnwYf3cO6plBgWOFVkAVUPaf1baD7jh4JrM+PJINBhAz1zwKAHsB+CVrfkYg7inbWIG74EzRe4pqJiSHcjYoyylbcmKeY5IzMrAYarYMk2AsNLwJDIhQE0l+M390IwVwK/3YqBVqsjmJRfbw3J+gNhOYPv0bguYw33dcPVbjkakbMQ2C9+qlQJsm4IGQN/CHsF6H8QgrYNGD4ckYChESYn1yFeWeP3+9X8WrYBVma82MJkTt+k6QXSZGY0jAXWIptZi3ueRf96lsp0DTDcj3ClJBcGu0G/lqG/jK7DZinWGsJjM4Ifm6TaG0KLan+wbWIA/SyI3goGvYNT7Xms3gpgvga724qB3cSTurywPSTPbe+TKWVOuf3cEplR5VR0jMWG8fd7W+Pywo6gvLm3X5ZMdcuqmR5JaAMzF8IxhXwsAh9uxvG/gM7wSASsnloDU+jLpr0caFhmSeJPsZ0O23Y6UnFFUhueOoOuir6+vq8jlnkL2tOaScBw36XAcMmkSZNy9kX3wnFzoz/2m0vITOE6dCYmGw9F5MOWuHT1J0GnTaZWOGXldLec1+SVUo9djnclZPPhiFT67bKm0SvlPru1bQ8swHLEk+vAoGezlS44FQcMrHdNS3ftDtC792RcNoOOxmqX3HdpuSyod4vLXoTxR9uL6hNyuCMu+07HZXdLVM5t9AwTfo4t+PA17M9hXPYUJGCsDeHmCyGhMwFuWNxlWq7jZxPyxt6wbD8Wld6INqDBY/f9CBTBrEvne+XCJp/4XDZJ6kOBwe1xEvocMGcZTrVmyNrKYb2+AK23cfonU9zFGOODk1F5ZkufnA3q8hcr/HLlAr/qP5HBk/J8BM7s1V1BefGDfmnvTSrFshtZ10kI1DaMxe8/DMu0SofsAPM7Q0l1/Uwf3Mx5JaJrKYxUEtDPuuI1wPAKmunKEos1IkxZg92ZiQ9toKEHY3/D8oAsbXAb5Ri9KC6kMmCX2TUu2XkyJn1hfRhzSY/b7SaOWijKlTg+gP7jeQUM5o6rB26B+SvJlHGRMc0nYvLohl45BAn3QWUcNsOuFgFbBPvulpjsPhWT/dCev4L/D3iZpg+9D66vFIHyTYhlNkApgmnNzEDMdQnT6kwYyBwqxfPbg7LpYFS8EOLH3ukTN7BdPM+rrGciMZiLOVQgLbg/JP/7fhDfdZlb65KL53plXo0b8V1KwDZ8FFEM2Qu6fW4b3JZDWnuSsr8tBiFOSoV/iBVzAEMTrPB8uM3NVldv0OwChhtwz+SMma9uuHVmdi6Oj54xrBhWMrCLsrgDAqPTS+hDPAUvJSCoVCoxs9Is2TfG2NHT03ML3P3/cdlPXgFDI5Oh/RdwqUom4k73poLK/W1xaLxPPrPYJ1PKnUOC2bEEzgS2A0wiM1/bHZZaxBY3nxtQA2hlAOhzQhHWxePxKq7JspKJ61eBObglkLEfFwZ456moHDyTUBnSjcsC8v7RqDz8Zq/0RjW5ArjK6NKSqcGny9gE4fltc0gF0Z9Z7Jfb15RIbaljICBeOMUl58/yyvr9ETkIxVuDmKWtNyGPbQzKYfSzCwpzyXyfam8gxS0vn9fe3n4NlKQZzIlYvQgwBIDhWk4D5YqVVPyoFTb2KUXRlVuPJwdDkQCUgUqWyaOY/WSLEWHBbKBzBZUae34Bg3AthQtymstV0v0+XeIe+OR6CNW6hT5ZMsOT0qZkMSZZsaOPGmg+0+1H3uqV5uNRuXiORyaDmUO0DDdDwLwwzyz4HbM0w4WClzAItS7ISy8tH4OL7+7XEL845dolfhVj/DsEjH0ebI/L9UsD0gBX5/c5pA+u7l3EOi3dSbkMrvtWCHxdhSNl5XQj6wLtFNZPn+MDQ3xyoisJoY1AQRyI2eJyFP2l0kpricFeBuaQfpdhvK34piJrrMjEh9FsFK6+qC6v7+qXV7C3wlD43HbEiDa5CS523UK/uJ3DY9789TI7a2M6+HAuaN4ixqR+riB/NRfZZTTLGKDWngTciy4h+Iyn3gsqjVyO4JZmN54YfYmP40jLchZa/4e9EcQ5IaVdFDS6GbqbRFpxkYsa4SZXI6Z5yyy84rsXTFuaLfYytxBcZBT0VpU41MCumOGW+68oV5je3BeW945EYaG9ctFsr7LadHulPpucN8sj06ocEosOTW5UbGUwMpFMTY+safSoOKkzZJeZyO50y4S0pXA5Gcwp4wpTy6ICMm4FrJffPM4UJw2Otm5pN4viYoA3HwrLk5uDKuFYWOdW3iIU11Q2qumGsuiD5Qizfd1oONt4AoMXhmkNXP0TOAzms2CLYBlc2dZh0bTGIVQcsAPQ9B/9rkduWxWAW/EiMMTAx0cuZE57ijH7WmPyXHM/3ExUKsDMagSaHAQKbqYNljYAOhdwKoZhg3GaaSOzL8m6lgz88rqYOUKroSwUCBK9qN4p37myTF7bE5ZNsFi/aQ7Lb3b0K4acDWoyY5JDWS7+PhtGWoBU9qvJq3Dx247H5Y41AbhMt7J4GZjDhKQJse8pi4A58H0+VwMXKyuPQiGOdSakP6aDHp98bkUA2DVV5yrxpDLoQes1Mg4y2IdCLGQhOa+A4aZZLEpmnlJRFSrFkE8j9uLl57b3yyNv9ykXcP0yv8ytcSqNKNTUup02FddsOsyMLqSElvELtX/rsZi09CQGNHRYwgE6yRyuozenLMAcLvOxZ8eQKkVUw3KVeu1ytCOhCpR15XYlAHQZn18dkAtmuWXzkZiKNZkxEnOJx64SAdGyazOVpT8m8hqyyfdhBW9Y6pdrMVZOhwyJv0wrDCHiOvkmtPeODK4Zc2Jv4pr6rLMPlqqunsWC8SsTMKfTZrhyZODgNt22B0LlQYJWXWJXcZlpwcw2rH3qup7TgnGs+eyFoeh562BVrNTmnABnDQTW6sqFXqlBbESr89LOsBKyW1b65VNwIy4giyf1nPGWB8AZ17y+h5YiDMuoyXVLfHIrtCsA5m8/HsupTEZJpRq7w1L9ruVxrtiFt/bHNDWw/RDuF0F/NWLpmlK7UaKghXapNJ1aTlynulmWsKm6VkLLPVFNHHTtTZNdKgli9phtLDDWXFlbw3leE4OBpzofHwqJu8KwWIehRPQ8XSFNYSeWw1DkCK7RelWBl1SA0SZpxlgzrHIVkkW6s64tslBgjtdl8z1K+1/6ICx/RAb18J/6YIqTcpUSPjvinMGpB7MJh+ESKUCsKW04GEUbDrlxaYnKTMuhVafOJgsF5pWhK0LKUgV1W04BO92jSU9YlwV1LhVbMbas9LvUJC9pZBhAprAAuwAZ4uJ612CIkMy9/opuPQjBpBtm0TWhYihbNoFkMdtnrI5IGud4cyDnGq8ChIG0H+qOy49/36dcIEszxMdaHecuKfSrEHt+boU/pTijFDCDTpvBi7wWTDdXR2aqvQwRNuzUgnm1Lrl7rUPqEZ88/X6\\/\\/PK9kMrSbljqk8VTXco1mN7BBatFq7D+QFTFN0chSLMnO+VrF5XIKiQLnI5IJvShZl8yL9E1HxFLx2usuc++ckIXpbkeIKfL4ACrgq6mDyvnaSpDTglWphmDTPFOBFaRicH0SqcS3lSJJesaL7al57iWsS8zGB8I+DO4SM2oj3qAzS5G/Qs301oRuypT2AdDn3QXaY2mc61CyTfHmy5g0Uzzdrkmrsx5vGAkRXwSVusP+yJyEqn6ZfM8CJ5dSkOoMSdhnpmhvXUgBvekpSrnyZSgaiMMLw1gYWiQZtGm7tSl7KAZHzZCqJlB7mtLyHEEv+fDrUcThc1H5qpLcWOdie5odaNDJRKRHOOPsSb9fB5Rs1gsUhEc6+Q8kyN6hgeuKMV3kRcRxrwJL3PFfJ9cPNej3CdrYH53brdfCB8gfFp6qSWbgJ1F0Dw1mwXTDYdnBn4UEPr0p97rV8Q3Iru8cblP1X5e2R2Vx99NyHSk9XQVtBDtfRqELCFN1S65a3lATnQl4CYj8rO3+qQDTPn0Io/YHdYAdlB70unhxDHOdZiuxdhO4RiXEp5sWsfBXoyMsRF0UQleQPxXD0aw7hVL6mOIRVIxDyeKWbicCyFOJHOvP4vH43zouAPuXrNkkUk+m2jgy27BRB9mXay3MoxhnNs02aESqXJvyv1PRgjSUO2QZCylUPQaVlnW9YEOhpRBsuEw6AwWNFXEJ5ZjsdiSfOumbEbB8gAG88nNIVilmIpnvnp+iayc7kJ84wYT3bLlWCoTY7bmQk91yGDWLSxRvn9BrVOCUU1lZ89s6Zcn3w3id0m5bZU/tdjNlnv5DuikBTjEOWvLpZPUpmg0qmb8syUpLIMwAGe8yFiQmfBnkWAsgUtn/W00QkYX1BVKygbEN9WIPxfVOYdljukY+PAxMVjdJBWE54AhHggEXGOxYsQaBdtpnc0QQK2KwHE0UZxlChxr0HwcAhYrZC5ydyQSuTbjsl5LKMH0t/lYXH6+MSh7WlKlhS+fnypTROD6/DC9a2e7laXoDSNjM6YmGOtUBexqro7BMj9vXOZV2vX45n55dms/rIDIJXPdMiBjWSwYmBODtvOJo6jFRfbgHJ+8Ls2lJJxbpCJMRdx4HFasq19TlX1+MnUXfWTuWtWRgHHnqbicgNBevcgLF2xTFizXBgwY8uQxa80O1owW+QCfuq6srKzIVM/T9KGBWK5C60DxNBWh5i07DJQp0mOyLPdjrGl19+B6uBAXuQWgdfOJkvRGecQ4i1pKd3cAMcxVC7xy+7l+aZjkUFqhG1NHtPi0FFUB54AxMk0yA+FUPKQLQgBZt8AjpRCyRzemSh5MrZkMpJYAZ9Z+AsMnH0BIWgQsAtqbgaEhG4bBbFaXOTUO+eCUDZZUpB7WlcJvzzTfkbdYbJMzQU1+i2yatTTGnvmsIOmCe+k03Et6XLODlsHE8Oe6kT5DwLZAMfozKl8a6A8Aupc/ylg9hwXyu+yy9XhcWnqScstKn9x5AYUrVbAbmJowxovBI4UuYuyxZMrvWx8w4M9soOKi2R759uUlMhtWcA9c7xFkorR43PW0tJj0gc4OfD+YRiJBvoJrejYMZo2Ifa+b75U5iFE4pfPs9rDK/sSWecVqVuFypDC+sjuirOHaOR4V32l56mWwUP2gc2P6unZDIfhiksNQlD9b4TL5gDiSL1N5L1s2nG7BOgD6j729vbcwhrH+htXsmZWs/tqktVeT21ZyysEnlbBSsYQ+ptUUKnEF05c3kByfPLIhJPtOp+Ygp1Zwykgb0j7oI7AXQd+ZdMMA4OvhdoJ9fX2l6RhMd0Y3zCyrxCPIqjzS2qOpeJFTJ5fNc8vKBrfUoV9bAcLFrJRZMS3vPMSV1yz2FrR0pgcbxvoVaH44A/P6cO03wLkUGBxZyxTGilnl8vK4SEmbu8zlIjV9cA2YnqNMgTGmom8ChmMFlSlwYwia8zyU6xYG0VyPPxi36LKswaUCdGor59nKfVz3ZBdt5FNYGQugyaRNdiGmO9mlKcE6f5YLbtY+JCCFYFH7MQb6y+lm2RiEVmB4PRQK3ZyOIbXkSIMwRGUfkg9mWcz8QrHUylYG/a8i+w3h3LUQlDKvLaOgcOxdYDtjy42HYvKLTf0yyW+XL6724dOWmt/MsYEuWtiDoPdguns0jhPA8Cos2IPAyzV6GRXFLLuYa+Y1vVjWKf9yHYMPdI/P53ri25lBe97hGiUo2HI+MDGwDBkfrJvctNyrhG0rsq+nt4SVYGWLlUa06YPpPoX22nM8EDD3gOs1Bx90kUF/wvftGaZelGKB5sdwz024127FQIFaD2vz8q6IKrFU+FMumJaSrn9erUPOQ5+z4Ta5uiOdYTbDatG2dSJ5eXM/51DDShDvutCvLFhCyz0WxNDd3c1XVz2e7QFW476DuOcl3Ht7TU3NsCC/BmNEBW8+GZfVjW6ZVZVaGZLeOcs+g0XVVIXfxvqXnrk8wGp/byQpp7oT6t4y7/CsmhjoRRAnHsfhG0YdrGABa4FU/gwN/E9JSYmd728wGcSK9pRSm9xzoU+aT7hkd2tqhr4YT64bz0go4Vo1wyVN1Y4hD2OYPh90xeECH8v1CDvu3QYMr+De60pLS8VcvmOT1FQPk4wyn8j8WlhkZJOzqp3YHcoqMXZin0kzqzPW4qeWU3PBnq5mIF7eFZUtULKZlU758nleWTrNOWTWIlfcEgwG94O+N1n/ynFvL+55FBg+y1dKDeWDLrNB7/kQrF83h+WRt0Jy1UKPGrt0Z8KMn5a2I0j8NlX7238iJuFEZstMvHtPJ2TbibjUBFLlloQ2GKJY+ED3+HNgOJLTGlpN77Zt2wYmjXH+ibKysqvr6uqGLX2xWwL58djMLNkKiv23tbVR+5/H8b043ZZlftLcLsIAvMQnoadMmTIgJKzeP9eccvEUtIUYwAua3DIPGSWX5tBKp6ZSbErAqVRh3McFe5ycf/9YXK20YN3rXM7lLfPITFiPpJ57wtjE0Nra2gfm3IvjpwoILPhik38qLy\\/\\/FjFYF1Gm5hd1eXFnRDYcjCGL1XPW3TTDhdptg+41432SUjIul6IXuRkeS2ymARjCh9249SaWVMzf5n190/bt263xzOVo8Jnq6urJfIIkW1A4Ho+tZXErcubMGVrXW+nGC2jKD0v3d3Cb36ObrKysTD1fCSFrC2qy/qOYbIewHOnkuqikWr7TVMU5VbuK+9TafE5cRzWl/UdgtViK4MDThTI+ZObrdw+fq8wmYF1dXcTwNDA8gOO2bOWLtOMFwPBCVVXVfPPpdKuiU2h2tyRUDY70JbQsPDEy43zJmGbMACyd6lQYXU7bEEU3+NCLsb0Hp56x/javgFksGDcfGvkm3MsPEAO46Gom+tF78/F5uBRqTT9ikgf5KgAZXGCYb+K1AfsTCPQvq62tVc9VcvLZbtPVkiJOc+04lZCP2hMqM+4M6WoRYiSRWtNGYfTCopVxWUuJXSUenIFYhmy30mc3VoOOCMNuxC2fhyXaOcKhuMnpdPIVCNXp7zOzyeDDHPYiajvDASYrusU7IHGS06dPM/b6CfjwA9DQk0/AnDm0J4xGfwGmzoHEfpUdmA9STISQmYwhKPSfBB2PgoZnOJUygjZO4Df347dPtbe3n8P2iIHkMzOtZTJR6YGguFWpoq1Pk+5wqhCsBAwxGWclWDDmNFdNqU0FwbECp1qsGNA/p+G+OwrhYhuvIWv7KcbhH7jExypkulFvTGj6uPKBGSMwMMHiE+kPpwtXQTFYpjccYuODnz+FJbuZrobgxtuSWbW+o6ODQeUvcfxdyfLkSq52jPeArcX+nwiUF/HdYOkYzBeIOGzD40sz/afAJfXClcuKAYJxClr/XUNBRjtwfKvO34MP94EP7onkgylcwMDnH+5Gn/sz3T+qNxyyrolGNyNgnhwOh5cYS31lvN4GbQaS9PVnz57VAeoJnPt7kjeatoyN8307YQWWA0NdJgymENEaxJODu3qCXRtZjSkNw1Fo/UMQrl+NYhZqyLQf2t0KPtiAYSVLccRQrCePsmFgWQgKQuH6Hdzifbi0L9tvRvUCOouQbeLMLKzJMq6DZwGT67GL5TJNbeEcHJhC5rDSzfce/HCkliu9TWM7Dma8DwgzwaDZXGYyXhiYxnd2dpI52yHU30G/L4xRuAbCFrT/HjCcRR9LgIGPvg0Uk4vNB2IAH5LAwJrdg7j8Ua7fZhKwQlyktXMu72Vq+hC0ZyHNNIP/sQC0/BMEVVuhSwG4D3Dqh7jG6aDoWAcr7S3PM+Euv4FzX+fbbkh/sTCwum1gYMzIV7L/GNd25coSR4mLHfKR/e+53e6LjZfCFI0PnALibhRS/xXXnkabXfleLT+qt0xnIgK/WYj9SzCZdwJUJV9MxuCZxcCRmGxmfdQUBsH082BQB7Tzv1kjwr5vrAzJ8Z58L74zLvtr0Hud8Z4FtY8GAy0W6ecOwdrEeA9tvIZ+OtNDiWJaGbTViL5uQ1/3AMP00fLBXJ1i4QPXETE0edScMSnkv68UU8BMa8bnEm8GmNshbNNprhkXcKc2cerGePonNW+WTKqdmk7B4s6VDzh3FANFoXoB+15arYn4Rwz4rMXplej7Kzj+DOj15cJgrvfPgIGzC2/jGpOR9diPpTNlnARMhTn4nIv9OtD5BT7bCgy2QvnA+Vpi4Hec6wCGZ3HL07h/t/WB4I9DwAbe3IdTdSBsOY6vBJiLcW6m8fiV3TDnqRpfatOMyVz+v5+3AeR3OOZrMVtwLTaR/6vIgmMSdi4VvxC3XY1ra3C+3KA/HYNmYOC6+R3Y1+P773HL0fTi6QQJmNkPJ2Lr6V1A0xXgwyXAMZ/JgIkjnQ9cbo6dxeuNOM\\/\\/ScAXLXPZeSgTHz4uAbMOng/HXE1ayocx+dJeptec8pDU/yGiyziN6yf50hJqCJerZPqnThMsYNY+y7EHQHsljqfzhTDY+Tic01i7dQa/Pc5/imX8Iy9OricyZdUTLGAD10C7h3zAJ/8tDstMdVQigw9cHtTNN0TyH5MZfOET2aH08S+6gH2yfbIVe7N/MgSfbOO5/b8AAwDCB5vdkkgX5QAAAABJRU5ErkJggg==\\');height:50px;width:50px;height: 30px;width: 30px;background-size: cover;background-position-x: 32px;;background-position: 32px;\"></div></a></li><li><a onclick=\"window.MI_logUsage(\\'share\\');\" href=\"https://twitter.com/intent/tweet?source={0}&text={1}: {0}\" target=\"_blank\" title=\"Tweet\"><div style=\"background-image: url(\\'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAJgAAAAxCAYAAAAm0WAHAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAyZpVFh0WE1MOmNvbS5hZG9iZS54bXAAAAAAADw/eHBhY2tldCBiZWdpbj0i77u/IiBpZD0iVzVNME1wQ2VoaUh6cmVTek5UY3prYzlkIj8+IDx4OnhtcG1ldGEgeG1sbnM6eD0iYWRvYmU6bnM6bWV0YS8iIHg6eG1wdGs9IkFkb2JlIFhNUCBDb3JlIDUuNS1jMDIxIDc5LjE1NTc3MiwgMjAxNC8wMS8xMy0xOTo0NDowMCAgICAgICAgIj4gPHJkZjpSREYgeG1sbnM6cmRmPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5LzAyLzIyLXJkZi1zeW50YXgtbnMjIj4gPHJkZjpEZXNjcmlwdGlvbiByZGY6YWJvdXQ9IiIgeG1sbnM6eG1wPSJodHRwOi8vbnMuYWRvYmUuY29tL3hhcC8xLjAvIiB4bWxuczp4bXBNTT0iaHR0cDovL25zLmFkb2JlLmNvbS94YXAvMS4wL21tLyIgeG1sbnM6c3RSZWY9Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC9zVHlwZS9SZXNvdXJjZVJlZiMiIHhtcDpDcmVhdG9yVG9vbD0iQWRvYmUgUGhvdG9zaG9wIENDIDIwMTQgKFdpbmRvd3MpIiB4bXBNTTpJbnN0YW5jZUlEPSJ4bXAuaWlkOjQxOTgzOUY2RjMxMjExRTQ4RDc1QkNENzc1ODE3OTkzIiB4bXBNTTpEb2N1bWVudElEPSJ4bXAuZGlkOjQxOTgzOUY3RjMxMjExRTQ4RDc1QkNENzc1ODE3OTkzIj4gPHhtcE1NOkRlcml2ZWRGcm9tIHN0UmVmOmluc3RhbmNlSUQ9InhtcC5paWQ6NDE5ODM5RjRGMzEyMTFFNDhENzVCQ0Q3NzU4MTc5OTMiIHN0UmVmOmRvY3VtZW50SUQ9InhtcC5kaWQ6NDE5ODM5RjVGMzEyMTFFNDhENzVCQ0Q3NzU4MTc5OTMiLz4gPC9yZGY6RGVzY3JpcHRpb24+IDwvcmRmOlJERj4gPC94OnhtcG1ldGE+IDw/eHBhY2tldCBlbmQ9InIiPz5SFpoiAAAe+klEQVR42uxdeXBd1Xn/3r5ptWTJki3bsrzbeMcOm9kNCRCghKWEpFkIkFCSIaShpO1MOmkzmTZJZ2hT2gYCTKCUBEiAYQlJiMHYGLzIeMEL3hfJkmWt7+nt9/b3O+9e6erpbZKeRP7gzly9d5d3zvc73/6dc69suq7LJ9sn23htTuvB1q1bh91gs9nUJwUx/Tt3fjeE1I5Pv9Pp9GiaVm232+fgegP2MlzzYI/gei/2E7j+Ea6fSSQScVwPsUmzLeun2ddoNyuN5rFJL/ofhgv0uHE+gHM+fDZgb8K1GuwB/hx7GNfasB9OJpNHcD6Iz5jD4YhiF3wfMjbmZu0/34axKQgb6TfbtY6b0Qb54MZxJe6bjWszsFfikg97HOf7sJ8y+HAauGM43497EtYxs46XFZOF50O2VatW5Raw0WwgshSdVbnd7ktcLtfl+Gzw+Xx+bAGPx1OFcyUgzIl74gASjEQiZ/v7+0PhcDgUi8WOx+PxN/D5Du7pRHPBQphQzI0DBQy1GOhG0H416L0In9WBQMAGDCX4Xg5m+XHdhvtCwNANDB2hUKgPO5XkEATrZXwewPU+MunjsBTo2wcs5aD3PNB7JXDMBP0VwFECPkzCuVIoAZU/ST5Eo9Eu8gF7GONPIVuPzzfQRjuwdheLLptVEkdiwQiGVgrE3+H1ei+cNGlSTXl5eYNpGXIJikXT9J6enqOdnZ1nIHBvg3FP4/Qh/LZvIiwY+p+OcxeB/i9DKeYDQ3lpaWnJSDBAuPq6u7v3dHV1HQGGV4HhDfyuA8zUJsKCUbBwOB0YbgGGSysrK6dWVFQ04rqrUAz87O3tPQ0+dEDgtkL4nkS7u4Dh7Fgt2IgFDJ/U5EUAdCcEal1NTc10AAtkIz4b49M3MKevvb39CIC+ju+PY4D2WYWjmAIG+ivw/XJguB8YzgGGMiiKjBUDLNq+tra2Hfj8FQTtLTCoc7wEjG1BuGcAw19CKW6ora2dDYtVNVYMoDsOPrSAD+vx/RGcasYemxABo0/HoF1fUlLyjbq6usUA5hurlUnvJ4ittbX1g76+vv/AAL6O893FFDC0uRAYvlVWVnbzlClTKoFFiowhCav8ITC8AUEjg45QboopYLRacHlr4f6+CQxroCRVxeYDaE8Cw0cQtJ/DfT6DMWsdjYA5vv/97w8ctLS0ZO0QoKbBvz8ETblv6tSp82C1XByMYmWhJtGwJG4wn8nBCpjqSQC3ly5zLAJmYczlaP9hMOX6+vp6H7RfxgGDHWNTCwwLOGbA0A2hbgEdyUIELB8taHMS4qu7Jk+e/O1p06adxxhrnPhgBwYma6uBoRF82IPvZ3P9FmM6OgEDgFno8IcNDQ13ANgkSDPdpIxHQM522T4sSyX6XIKYoA6JwA701TMGAbOj3RsgUD8BU5ZVV1ebMdi4YYAQ+MCgucBSB5ffDwzH0Gd8LAKGdmswJn8DBb8bit7kYKA3vnwQ8MFHPgDDAgjaDmBoK6qAoSP6+X+bPn365xBAuoplivMNMgcNlsCDvhfAXE8Bg7aNVMhMAYMFUcIFDHMQAGc18eOAwQkLMwPCVg9F6TRKG4nRCBj4MBmM/h6U/CtVVVXVRllo3DFwAx8E4zcLGBaDD1uAob1QAbPnkeI6gPpHaMxnwRjbRDAm3VQjvvDA6twEOh4CPVNMocm0Z8FwMX77I2BoRFvyMWBwQzE/hZj1TsRN5+PYWYhSWHdgKIOQ3gMG3gE+VNANZ8JgU78vwp6BD7DGgjG8CGP5E9Azu9AxyGXBAjCRd8EU3w2XwqKdbaKr/hYNouWkBjFt3jmCWtNsYPgvYFgCrZ9Q4UrD4ASGabFYzA9X02zU/AoSMP4WbulahCYPINutS7dcvMdhZ9nCpoQDCMdMM9tSlRp9aEBPS4atCR7FgXPvo+/+fBYslzZdgCzxHjAmkJ5tfhxCBjoqkWDe29XVtR1Cs6GAtLscv2W2uJrCNRGuPY+79CK5uA6pfysys382Sxj5SgewFnOA4X4IV2O6cFEIYglN3j0UleYTUekMaaKNESN/7oSALZnmlsvn+yXggQXVh/CBGebnwYf3cO6plBgWOFVkAVUPaf1baD7jh4JrM+PJINBhAz1zwKAHsB+CVrfkYg7inbWIG74EzRe4pqJiSHcjYoyylbcmKeY5IzMrAYarYMk2AsNLwJDIhQE0l+M390IwVwK/3YqBVqsjmJRfbw3J+gNhOYPv0bguYw33dcPVbjkakbMQ2C9+qlQJsm4IGQN/CHsF6H8QgrYNGD4ckYChESYn1yFeWeP3+9X8WrYBVma82MJkTt+k6QXSZGY0jAXWIptZi3ueRf96lsp0DTDcj3ClJBcGu0G/lqG/jK7DZinWGsJjM4Ifm6TaG0KLan+wbWIA/SyI3goGvYNT7Xms3gpgvga724qB3cSTurywPSTPbe+TKWVOuf3cEplR5VR0jMWG8fd7W+Pywo6gvLm3X5ZMdcuqmR5JaAMzF8IxhXwsAh9uxvG/gM7wSASsnloDU+jLpr0caFhmSeJPsZ0O23Y6UnFFUhueOoOuir6+vq8jlnkL2tOaScBw36XAcMmkSZNy9kX3wnFzoz/2m0vITOE6dCYmGw9F5MOWuHT1J0GnTaZWOGXldLec1+SVUo9djnclZPPhiFT67bKm0SvlPru1bQ8swHLEk+vAoGezlS44FQcMrHdNS3ftDtC792RcNoOOxmqX3HdpuSyod4vLXoTxR9uL6hNyuCMu+07HZXdLVM5t9AwTfo4t+PA17M9hXPYUJGCsDeHmCyGhMwFuWNxlWq7jZxPyxt6wbD8Wld6INqDBY/f9CBTBrEvne+XCJp/4XDZJ6kOBwe1xEvocMGcZTrVmyNrKYb2+AK23cfonU9zFGOODk1F5ZkufnA3q8hcr/HLlAr/qP5HBk/J8BM7s1V1BefGDfmnvTSrFshtZ10kI1DaMxe8/DMu0SofsAPM7Q0l1/Uwf3Mx5JaJrKYxUEtDPuuI1wPAKmunKEos1IkxZg92ZiQ9toKEHY3/D8oAsbXAb5Ri9KC6kMmCX2TUu2XkyJn1hfRhzSY/b7SaOWijKlTg+gP7jeQUM5o6rB26B+SvJlHGRMc0nYvLohl45BAn3QWUcNsOuFgFbBPvulpjsPhWT/dCev4L/D3iZpg+9D66vFIHyTYhlNkApgmnNzEDMdQnT6kwYyBwqxfPbg7LpYFS8EOLH3ukTN7BdPM+rrGciMZiLOVQgLbg/JP/7fhDfdZlb65KL53plXo0b8V1KwDZ8FFEM2Qu6fW4b3JZDWnuSsr8tBiFOSoV/iBVzAEMTrPB8uM3NVldv0OwChhtwz+SMma9uuHVmdi6Oj54xrBhWMrCLsrgDAqPTS+hDPAUvJSCoVCoxs9Is2TfG2NHT03ML3P3/cdlPXgFDI5Oh/RdwqUom4k73poLK/W1xaLxPPrPYJ1PKnUOC2bEEzgS2A0wiM1/bHZZaxBY3nxtQA2hlAOhzQhHWxePxKq7JspKJ61eBObglkLEfFwZ456moHDyTUBnSjcsC8v7RqDz8Zq/0RjW5ArjK6NKSqcGny9gE4fltc0gF0Z9Z7Jfb15RIbaljICBeOMUl58/yyvr9ETkIxVuDmKWtNyGPbQzKYfSzCwpzyXyfam8gxS0vn9fe3n4NlKQZzIlYvQgwBIDhWk4D5YqVVPyoFTb2KUXRlVuPJwdDkQCUgUqWyaOY/WSLEWHBbKBzBZUae34Bg3AthQtymstV0v0+XeIe+OR6CNW6hT5ZMsOT0qZkMSZZsaOPGmg+0+1H3uqV5uNRuXiORyaDmUO0DDdDwLwwzyz4HbM0w4WClzAItS7ISy8tH4OL7+7XEL845dolfhVj/DsEjH0ebI/L9UsD0gBX5/c5pA+u7l3EOi3dSbkMrvtWCHxdhSNl5XQj6wLtFNZPn+MDQ3xyoisJoY1AQRyI2eJyFP2l0kpricFeBuaQfpdhvK34piJrrMjEh9FsFK6+qC6v7+qXV7C3wlD43HbEiDa5CS523UK/uJ3DY9789TI7a2M6+HAuaN4ixqR+riB/NRfZZTTLGKDWngTciy4h+Iyn3gsqjVyO4JZmN54YfYmP40jLchZa/4e9EcQ5IaVdFDS6GbqbRFpxkYsa4SZXI6Z5yyy84rsXTFuaLfYytxBcZBT0VpU41MCumOGW+68oV5je3BeW945EYaG9ctFsr7LadHulPpucN8sj06ocEosOTW5UbGUwMpFMTY+safSoOKkzZJeZyO50y4S0pXA5Gcwp4wpTy6ICMm4FrJffPM4UJw2Otm5pN4viYoA3HwrLk5uDKuFYWOdW3iIU11Q2qumGsuiD5Qizfd1oONt4AoMXhmkNXP0TOAzms2CLYBlc2dZh0bTGIVQcsAPQ9B/9rkduWxWAW/EiMMTAx0cuZE57ijH7WmPyXHM/3ExUKsDMagSaHAQKbqYNljYAOhdwKoZhg3GaaSOzL8m6lgz88rqYOUKroSwUCBK9qN4p37myTF7bE5ZNsFi/aQ7Lb3b0K4acDWoyY5JDWS7+PhtGWoBU9qvJq3Dx247H5Y41AbhMt7J4GZjDhKQJse8pi4A58H0+VwMXKyuPQiGOdSakP6aDHp98bkUA2DVV5yrxpDLoQes1Mg4y2IdCLGQhOa+A4aZZLEpmnlJRFSrFkE8j9uLl57b3yyNv9ykXcP0yv8ytcSqNKNTUup02FddsOsyMLqSElvELtX/rsZi09CQGNHRYwgE6yRyuozenLMAcLvOxZ8eQKkVUw3KVeu1ytCOhCpR15XYlAHQZn18dkAtmuWXzkZiKNZkxEnOJx64SAdGyazOVpT8m8hqyyfdhBW9Y6pdrMVZOhwyJv0wrDCHiOvkmtPeODK4Zc2Jv4pr6rLMPlqqunsWC8SsTMKfTZrhyZODgNt22B0LlQYJWXWJXcZlpwcw2rH3qup7TgnGs+eyFoeh562BVrNTmnABnDQTW6sqFXqlBbESr89LOsBKyW1b65VNwIy4giyf1nPGWB8AZ17y+h5YiDMuoyXVLfHIrtCsA5m8/HsupTEZJpRq7w1L9ruVxrtiFt/bHNDWw/RDuF0F/NWLpmlK7UaKghXapNJ1aTlynulmWsKm6VkLLPVFNHHTtTZNdKgli9phtLDDWXFlbw3leE4OBpzofHwqJu8KwWIehRPQ8XSFNYSeWw1DkCK7RelWBl1SA0SZpxlgzrHIVkkW6s64tslBgjtdl8z1K+1/6ICx/RAb18J/6YIqTcpUSPjvinMGpB7MJh+ESKUCsKW04GEUbDrlxaYnKTMuhVafOJgsF5pWhK0LKUgV1W04BO92jSU9YlwV1LhVbMbas9LvUJC9pZBhAprAAuwAZ4uJ612CIkMy9/opuPQjBpBtm0TWhYihbNoFkMdtnrI5IGud4cyDnGq8ChIG0H+qOy49/36dcIEszxMdaHecuKfSrEHt+boU/pTijFDCDTpvBi7wWTDdXR2aqvQwRNuzUgnm1Lrl7rUPqEZ88/X6\\/\\/PK9kMrSbljqk8VTXco1mN7BBatFq7D+QFTFN0chSLMnO+VrF5XIKiQLnI5IJvShZl8yL9E1HxFLx2usuc++ckIXpbkeIKfL4ACrgq6mDyvnaSpDTglWphmDTPFOBFaRicH0SqcS3lSJJesaL7al57iWsS8zGB8I+DO4SM2oj3qAzS5G/Qs301oRuypT2AdDn3QXaY2mc61CyTfHmy5g0Uzzdrkmrsx5vGAkRXwSVusP+yJyEqn6ZfM8CJ5dSkOoMSdhnpmhvXUgBvekpSrnyZSgaiMMLw1gYWiQZtGm7tSl7KAZHzZCqJlB7mtLyHEEv+fDrUcThc1H5qpLcWOdie5odaNDJRKRHOOPsSb9fB5Rs1gsUhEc6+Q8kyN6hgeuKMV3kRcRxrwJL3PFfJ9cPNej3CdrYH53brdfCB8gfFp6qSWbgJ1F0Dw1mwXTDYdnBn4UEPr0p97rV8Q3Iru8cblP1X5e2R2Vx99NyHSk9XQVtBDtfRqELCFN1S65a3lATnQl4CYj8rO3+qQDTPn0Io/YHdYAdlB70unhxDHOdZiuxdhO4RiXEp5sWsfBXoyMsRF0UQleQPxXD0aw7hVL6mOIRVIxDyeKWbicCyFOJHOvP4vH43zouAPuXrNkkUk+m2jgy27BRB9mXay3MoxhnNs02aESqXJvyv1PRgjSUO2QZCylUPQaVlnW9YEOhpRBsuEw6AwWNFXEJ5ZjsdiSfOumbEbB8gAG88nNIVilmIpnvnp+iayc7kJ84wYT3bLlWCoTY7bmQk91yGDWLSxRvn9BrVOCUU1lZ89s6Zcn3w3id0m5bZU/tdjNlnv5DuikBTjEOWvLpZPUpmg0qmb8syUpLIMwAGe8yFiQmfBnkWAsgUtn/W00QkYX1BVKygbEN9WIPxfVOYdljukY+PAxMVjdJBWE54AhHggEXGOxYsQaBdtpnc0QQK2KwHE0UZxlChxr0HwcAhYrZC5ydyQSuTbjsl5LKMH0t/lYXH6+MSh7WlKlhS+fnypTROD6/DC9a2e7laXoDSNjM6YmGOtUBexqro7BMj9vXOZV2vX45n55dms/rIDIJXPdMiBjWSwYmBODtvOJo6jFRfbgHJ+8Ls2lJJxbpCJMRdx4HFasq19TlX1+MnUXfWTuWtWRgHHnqbicgNBevcgLF2xTFizXBgwY8uQxa80O1owW+QCfuq6srKzIVM/T9KGBWK5C60DxNBWh5i07DJQp0mOyLPdjrGl19+B6uBAXuQWgdfOJkvRGecQ4i1pKd3cAMcxVC7xy+7l+aZjkUFqhG1NHtPi0FFUB54AxMk0yA+FUPKQLQgBZt8AjpRCyRzemSh5MrZkMpJYAZ9Z+AsMnH0BIWgQsAtqbgaEhG4bBbFaXOTUO+eCUDZZUpB7WlcJvzzTfkbdYbJMzQU1+i2yatTTGnvmsIOmCe+k03Et6XLODlsHE8Oe6kT5DwLZAMfozKl8a6A8Aupc/ylg9hwXyu+yy9XhcWnqScstKn9x5AYUrVbAbmJowxovBI4UuYuyxZMrvWx8w4M9soOKi2R759uUlMhtWcA9c7xFkorR43PW0tJj0gc4OfD+YRiJBvoJrejYMZo2Ifa+b75U5iFE4pfPs9rDK/sSWecVqVuFypDC+sjuirOHaOR4V32l56mWwUP2gc2P6unZDIfhiksNQlD9b4TL5gDiSL1N5L1s2nG7BOgD6j729vbcwhrH+htXsmZWs/tqktVeT21ZyysEnlbBSsYQ+ptUUKnEF05c3kByfPLIhJPtOp+Ygp1Zwykgb0j7oI7AXQd+ZdMMA4OvhdoJ9fX2l6RhMd0Y3zCyrxCPIqjzS2qOpeJFTJ5fNc8vKBrfUoV9bAcLFrJRZMS3vPMSV1yz2FrR0pgcbxvoVaH44A/P6cO03wLkUGBxZyxTGilnl8vK4SEmbu8zlIjV9cA2YnqNMgTGmom8ChmMFlSlwYwia8zyU6xYG0VyPPxi36LKswaUCdGor59nKfVz3ZBdt5FNYGQugyaRNdiGmO9mlKcE6f5YLbtY+JCCFYFH7MQb6y+lm2RiEVmB4PRQK3ZyOIbXkSIMwRGUfkg9mWcz8QrHUylYG/a8i+w3h3LUQlDKvLaOgcOxdYDtjy42HYvKLTf0yyW+XL6724dOWmt/MsYEuWtiDoPdguns0jhPA8Cos2IPAyzV6GRXFLLuYa+Y1vVjWKf9yHYMPdI/P53ri25lBe97hGiUo2HI+MDGwDBkfrJvctNyrhG0rsq+nt4SVYGWLlUa06YPpPoX22nM8EDD3gOs1Bx90kUF/wvftGaZelGKB5sdwz024127FQIFaD2vz8q6IKrFU+FMumJaSrn9erUPOQ5+z4Ta5uiOdYTbDatG2dSJ5eXM/51DDShDvutCvLFhCyz0WxNDd3c1XVz2e7QFW476DuOcl3Ht7TU3NsCC/BmNEBW8+GZfVjW6ZVZVaGZLeOcs+g0XVVIXfxvqXnrk8wGp/byQpp7oT6t4y7/CsmhjoRRAnHsfhG0YdrGABa4FU/gwN/E9JSYmd728wGcSK9pRSm9xzoU+aT7hkd2tqhr4YT64bz0go4Vo1wyVN1Y4hD2OYPh90xeECH8v1CDvu3QYMr+De60pLS8VcvmOT1FQPk4wyn8j8WlhkZJOzqp3YHcoqMXZin0kzqzPW4qeWU3PBnq5mIF7eFZUtULKZlU758nleWTrNOWTWIlfcEgwG94O+N1n/ynFvL+55FBg+y1dKDeWDLrNB7/kQrF83h+WRt0Jy1UKPGrt0Z8KMn5a2I0j8NlX7238iJuFEZstMvHtPJ2TbibjUBFLlloQ2GKJY+ED3+HNgOJLTGlpN77Zt2wYmjXH+ibKysqvr6uqGLX2xWwL58djMLNkKiv23tbVR+5/H8b043ZZlftLcLsIAvMQnoadMmTIgJKzeP9eccvEUtIUYwAua3DIPGSWX5tBKp6ZSbErAqVRh3McFe5ycf/9YXK20YN3rXM7lLfPITFiPpJ57wtjE0Nra2gfm3IvjpwoILPhik38qLy//FjFYF1Gm5hd1eXFnRDYcjCGL1XPW3TTDhdptg+41432SUjIul6IXuRkeS2ymARjCh9249SaWVMzf5n190/bt263xzOVo8Jnq6urJfIIkW1A4Ho+tZXErcubMGVrXW+nGC2jKD0v3d3Cb36ObrKysTD1fCSFrC2qy/qOYbIewHOnkuqikWr7TVMU5VbuK+9TafE5cRzWl/UdgtViK4MDThTI+ZObrdw+fq8wmYF1dXcTwNDA8gOO2bOWLtOMFwPBCVVXVfPPpdKuiU2h2tyRUDY70JbQsPDEy43zJmGbMACyd6lQYXU7bEEU3+NCLsb0Hp56x/javgFksGDcfGvkm3MsPEAO46Gom+tF78/F5uBRqTT9ikgf5KgAZXGCYb+K1AfsTCPQvq62tVc9VcvLZbtPVkiJOc+04lZCP2hMqM+4M6WoRYiSRWtNGYfTCopVxWUuJXSUenIFYhmy30mc3VoOOCMNuxC2fhyXaOcKhuMnpdPIVCNXp7zOzyeDDHPYiajvDASYrusU7IHGS06dPM/b6CfjwA9DQk0/AnDm0J4xGfwGmzoHEfpUdmA9STISQmYwhKPSfBB2PgoZnOJUygjZO4Df347dPtbe3n8P2iIHkMzOtZTJR6YGguFWpoq1Pk+5wqhCsBAwxGWclWDDmNFdNqU0FwbECp1qsGNA/p+G+OwrhYhuvIWv7KcbhH7jExypkulFvTGj6uPKBGSMwMMHiE+kPpwtXQTFYpjccYuODnz+FJbuZrobgxtuSWbW+o6ODQeUvcfxdyfLkSq52jPeArcX+nwiUF/HdYOkYzBeIOGzD40sz/afAJfXClcuKAYJxClr/XUNBRjtwfKvO34MP94EP7onkgylcwMDnH+5Gn/sz3T+qNxyyrolGNyNgnhwOh5cYS31lvN4GbQaS9PVnz57VAeoJnPt7kjeatoyN8307YQWWA0NdJgymENEaxJODu3qCXRtZjSkNw1Fo/UMQrl+NYhZqyLQf2t0KPtiAYSVLccRQrCePsmFgWQgKQuH6Hdzifbi0L9tvRvUCOouQbeLMLKzJMq6DZwGT67GL5TJNbeEcHJhC5rDSzfce/HCkliu9TWM7Dma8DwgzwaDZXGYyXhiYxnd2dpI52yHU30G/L4xRuAbCFrT/HjCcRR9LgIGPvg0Uk4vNB2IAH5LAwJrdg7j8Ua7fZhKwQlyktXMu72Vq+hC0ZyHNNIP/sQC0/BMEVVuhSwG4D3Dqh7jG6aDoWAcr7S3PM+Euv4FzX+fbbkh/sTCwum1gYMzIV7L/GNd25coSR4mLHfKR/e+53e6LjZfCFI0PnALibhRS/xXXnkabXfleLT+qt0xnIgK/WYj9SzCZdwJUJV9MxuCZxcCRmGxmfdQUBsH082BQB7Tzv1kjwr5vrAzJ8Z58L74zLvtr0Hud8Z4FtY8GAy0W6ecOwdrEeA9tvIZ+OtNDiWJaGbTViL5uQ1/3AMP00fLBXJ1i4QPXETE0edScMSnkv68UU8BMa8bnEm8GmNshbNNprhkXcKc2cerGePonNW+WTKqdmk7B4s6VDzh3FANFoXoB+15arYn4Rwz4rMXplej7Kzj+DOj15cJgrvfPgIGzC2/jGpOR9diPpTNlnARMhTn4nIv9OtD5BT7bCgy2QvnA+Vpi4Hec6wCGZ3HL07h/t/WB4I9DwAbe3IdTdSBsOY6vBJiLcW6m8fiV3TDnqRpfatOMyVz+v5+3AeR3OOZrMVtwLTaR/6vIgmMSdi4VvxC3XY1ra3C+3KA/HYNmYOC6+R3Y1+P773HL0fTi6QQJmNkPJ2Lr6V1A0xXgwyXAMZ/JgIkjnQ9cbo6dxeuNOM//ScAXLXPZeSgTHz4uAbMOng/HXE1ayocx+dJeptec8pDU/yGiyziN6yf50hJqCJerZPqnThMsYNY+y7EHQHsljqfzhTDY+Tic01i7dQa/Pc5/imX8Iy9OricyZdUTLGAD10C7h3zAJ/8tDstMdVQigw9cHtTNN0TyH5MZfOET2aH08S+6gH2yfbIVe7N/MgSfbOO5/b8AAwDCB5vdkkgX5QAAAABJRU5ErkJggg==\\');height:50px;width:50px;height: 30px;width: 30px;background-size: cover;background-position-x: 62px;;background-position: 62px;\"></div></a></li><li style=\"display:none;\"><a onclick=\"window.MI_logUsage(\\'share\\');\" href=\"http://pinterest.com/pin/create/button/?url={0}&description={2}\" target=\"_blank\" title=\"Pin it\"><img onload=\"this.style.opacity=1;this.style.top=0;\" src=\"//d34p6saz4aff9q.cloudfront.net/images/footer/Pinterest.png\" style=\"opacity:0\"></a></li><li><a onclick=\"window.MI_logUsage(\\'share\\');\" href=\"https://plus.google.com/share?url={0}\" target=\"_blank\" title=\"Share on Google+\"><div style=\"background-image: url(\\'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABcAAAAXCAYAAADgKtSgAAAD4klEQVRIDY1VzW8bVRD/7Xq9teOPtElDHdlupSIFKEqUhH5AI7WNBCeQuHAqlEPpASHgyA3hf4ALHwckGoFAHBGIA5zapoiCEUpCEiGFUlHJTkCyiePEXjter5f5rf2CWTuBkcZvPB+/eW/evFkNB9DKysrpVqt1NRgMpoWPmqYZbzQa27ZtF4Vzuq7PjY+P/3QARK9pYWHh4urq6s2trS2r2Wy6kqCHqaedfsvLyxd7UfpolpaW5jY3N7ccx3H/L5dKpS2Je0/gtD6QnkpbXFyctyzLVqDcHWWu/8XVatVmfF9wZqaDkKuYgJQVsJL3szOeJ1cJvGOwZslk8stYLDaoaRpc120fpSMXKi6+Xqnim18sWLstDEUCuDQWxotPROH3LwttbGw8OzExMa8TRW49Q2DKCljJ9wpNfPhtGU+eCuOtZ44gFtLx+MmQB6x8uJIYG4/HB4nH/zrbLZFInKOhH3/24w6OxXWMCo89YGD2oRBurdWwXXMY37MZ6ohHXF0u7KVIJBKm0k8szh9lB9v1dpmY/NSoCdtxhQFpUQ/890IDdrPlhVNHPL4P3TCMlKpbz87FcSIZxJ17dayXbC94s+rgsROHcHjgn677JFv1EhJYUSAQSBt8eQTdjy6fjcBquPjo+yoSUppyzcXLF6KsB37O28je30Wu1MT17yowDQ3XZiIeFHF1Pmm1Y2q7E1GOmBpen43itdkYbqzVpTuAqNn2G4poePiYgXBQw5isjyQML55xUpG4wVmhAP2rSrZebuFPqX3ysIHbd+vSijounxmQ/wGPF+UEMydNhCSJInkb24Y8iKJS+Ffe0adZC6zkmeMmXrkQwY1fd/HFkoUTR3TMPChHELp2fgBmgN3WPhHvkLiGdEuOF0GFnz7+wcLquo23nxvcGxpXzoZR3HGwLHoFfshoR6qTE4+40u/6XKVSqdHg55truwgEJGnHRgj6JAYDOD7Urq/SdcfKGKgRV+c8LhaLWeWkVjq/8VQUf1UcvHPLwt2C43XF7d8aqNstzI4F6er1uid0/RQKhSxxvecvQBnZfdnv/OhoAJmnY9ipO3jzqx28P1+FIRHPnw4jJKVQfc1VMXGk3hli7RWa0yyVSl2R/uxUkOZ/E0+jHhwtSlb3JaDNfD7/weTk5KuevTtcvkDz6XT6vPS+l8AP1u3rlwmcy+XuTE9PXxKb9yr3dt5x5gfj3ZGRkRdkPuyNX7Wz/ZLJBZalzp9PTU1d7U7qB/dsnW9iZnh4+FwoFArLzXfHeDITyVerJp9ENkOG89vv1BdcOXFscmrKEEoJH+WT5ssTXVE4L7rrB339/wYDDxkPEF5efgAAAABJRU5ErkJggg==\\'); background-size: 29px;width:30px;height:30px;background-repeat: no-repeat;\"></div></a></li></ul></div>',\n callForActions: '<tr><td><div id=\"cfa\" style=\"white-space:nowrap;border-top: solid 1px #c5c5c5 !important;padding-left:0;\"><div onclick=\"alert(\\'call to add to favorites\\')\" style=\"cursor:pointer;border-radius: 7px;height: 27px;width: 187px;margin:5px;MARGIN-LEFT:0;display: inline-block;text-align: center;box-shadow: inset 0 -9px 37px -10px silver;vertical-align: middle;padding-top: 8px;border: 1px solid rgba(0,0,0,0.2);color: grey;\">Add to favorites</div><div onclick=\"alert(\\'call to book\\')\" style=\"cursor:pointer;border-radius: 7px;height: 27px;width: 187px;margin:5px;display: inline-block;text-align: center;box-shadow: inset 0 -9px 37px -10px rgb(3, 179, 12);vertical-align: middle;padding-top: 8px;border: 1px solid rgba(0,0,0,0.2);color: white;margin-left: 1px;background-color: rgb(161, 218, 101);\">BOOK</div></div></td></tr>'\n },\n header: {\n header: '<table align=\"left\" class=\"mi_reset mi_greenredtitle\"><tr><td class=\"mi_header_caption@@@gaugeOrientation\" style=\"padding:0 !important;\">' +\n '<div class=\"mi_drag_area\" style=\"position: absolute;width: 100%;height:125px;left:0;z-index: 2\"></div>' +\n '<div class=\"mi_green_close@@@gaugeOrientation\" onclick=\"jQuery.MidasInsight.hidePanel(\\'@@@kfid\\');\" style=\"z-index:3;\"></div>'\n // score gauge\n +\n '<div class=\"mi_gradselectroot @@@gaugeOrientation\" id=\"mi_gradselectroot_@@@kfid\" data-score=\"@@@grade\" style=\"left:123px;top:-48px;\"><div class=\"mi_gradeselect\" id=\"mi_gradeselect_@@@kfid\"></div></div>' +\n '<div class=\"mi_title\" style=\"@@@titleOrientation;margin-top:40px;width:240px;float: left;height:38px\" >@@@displayText</div>' +\n '<div style=\"float:left !important;\" class=\"mi_subtitle\" >@@@count</div>' +\n '<div class=\"mi_preview_images\" style=\"z-index:3;width: 100px;height: 75px;border: 1px solid #ababab;position: absolute;right: 18px;top: 33px;padding: 1px 3px 3px 1px;cursor: pointer; cursor: hand;\" onclick=\"jQuery.MidasInsight.MI_GetPhotos(\\'@@@kfid\\',false);\"><div style=\"border: 1px solid #ababab;width:100%;height:100%;background-image:url(@@@previewimgsrc); background-size: cover;\"></div></div>'\n\n // tools tabs\n +\n '<div style=\"clear:both;height:0px;margin-bottom:0px;border-top:0px solid #DBDBDB!important;\"></div>' +\n '</td></tr>',\n footer: '</table>'\n }\n },\n scrollables: {\n header: '<div style=\"clear:both;height: px;margin-bottom:0px;border-top:1px solid #DBDBDB\"></div><div id=\"mipct_scroll_@@@kfid\" tabindex=\"-1\" style=\"heightdummy:0;outline:none;max-height:auto;\" class=\"mi_scroll\">' +\n '<table align=\"left\" id=\"mipct_tbldefault_@@@kfid\" class=\"mi_results mi_scrolledcontent\">',\n footer: '</table></div>'\n },\n socialItem: {\n timelineItem: '<div class=\"mi_timeline\">@@@fullYear<br/>@@@month<br/>@@@date</div>',\n nonTimelineItem: '<img onerror=\"jQuery.MidasInsight.HandleMissingImage(\\'avatar\\',this)\" src=\"@@@itemImageURL\" valign=\"top\" class=\"mi_resultimage\">',\n youtubeItem: '<div style=\"position:relative;\"><div class=\\\"MI_SourceIcon MI_@@@sourceSite\\\" mi_data-tooltip=\\\"@@@sourceSite\\\"></div><table align=\"left\" class=\"mi_resultcontainer\" style=\"direction:ltr!important;cursor:default;\"><tr><td rowspan=\"4\" valign=\"top\" style=\"padding-right:15px;padding-left:3px;width: 65px;\"><div style=\"position:relative;height: 100%;display: block;\">' +\n '@@@sourceAvatar' +\n '</div></td><th style=\"vertical-align: middle;\" align=\"left\"><div class=\"mi_resultpublisher\">@@@itemPublisher<span class=\"mi_resulttimeago\">@@@timeAgo' +\n '</div></span></th></tr><tr><td style=\"padding-right:30px;\">' +\n '</td></tr><tr><td colspan=\"2\"><div style=\"padding-right:10px;overflow:hidden;position:relative;max-width: 275px;\"><img src=\"https://i.ytimg.com/vi/@@@sourceURL/mqdefault.jpg\" style=\"max-width: @@@itemWidth ;min-width:185px;margin-top: 15px;margin-bottom: 15px;box-shadow: 0px 0 10px 4px #eee;border-radius: 5px;display:inline;\"/><img src=\"//d34p6saz4aff9q.cloudfront.net/images/playvideow.png\" style=\"position:absolute;cursor: pointer;left: 50%!important;margin-top: 20%;display:inline;margin-left: -30px;\" onclick=\"window.MI_logUsage(\\'play_video\\',\\'@@@baseid\\');@@@click\" onerror=\"this.style.display=\\'none\\';\"/></div>' +\n '</div></td></tr></table></div>',\n lightboxYoutubeItem: '<div style=\"position:relative;\"><div class=\\\"MI_SourceIcon MI_@@@sourceSite\\\" mi_data-tooltip=\\\"@@@sourceSite\\\"></div><table align=\"left\" class=\"mi_resultcontainer\" style=\"direction:ltr!important;cursor:default;\"><tr><td rowspan=\"4\" valign=\"top\" style=\"padding-right:15px;padding-left:3px;width: 65px;\"><div style=\"position:relative;height: 100%;display: block;\">' +\n '@@@sourceAvatar' +\n '</div></td><th style=\"vertical-align: middle;\" align=\"left\"><div class=\"mi_resultpublisher\" style=\"color:#838383;\">@@@itemPublisher<span class=\"mi_resulttimeago\" itemDate=\"@@@itemDate\">@@@timeAgo' +\n '</span></div></th></tr><tr><td style=\"padding-right:30px;\"></td></tr>' +\n '<tr><td colspan=\"2\" onclick=\"@@@click\" style=\"cursor: pointer; cursor: hand;\"><div style=\"padding-right:10px;overflow:hidden;position:relative;max-width: 275px;\"><div id=\"#mi_image_lightbox_@@@ksid\" onclick=\" jQuery(mi_image_lightbox_@@@ksid).fadeIn();\"><img src=\"https://i.ytimg.com/vi/@@@sourceURL/mqdefault.jpg\" style=\"max-width: @@@itemWidth ;min-width:185px;margin-top: 15px;margin-bottom: 15px;box-shadow: 0px 0 10px 4px #eee;float: right;border-radius: 5px;display:inline;\"/><img src=\"//d34p6saz4aff9q.cloudfront.net/images/playvideow.png\" style=\"position:absolute;cursor: pointer;left: 50%!important;margin-top: 20%;display:inline;margin-left: -30px;\" onclick=\"window.MI_logUsage(\\'play_video\\',\\'@@@baseid\\');@@@click\" onerror=\"this.style.display=\\'none\\';\"/></div><div class=\"mi_lightbox\" id=\"mi_image_lightbox_@@@ksid\" onclick=\"jQuery.MidasInsight.StopYoutubeVideo(jQuery(\\'#mi_image_lightbox_@@@ksid iframe\\')[0]);jQuery(this).fadeOut();\"><iframe width=\"560\" height=\"315\" src=\"https://www.youtube.com/embed/@@@youtubeid?enablejsapi=1\" frameborder=\"0\" allowfullscreen></iframe></a></div>' +\n '</td></tr></table></div>',\n lightboxVimeoItem: '<div style=\"position:relative;\"><div class=\\\"MI_SourceIcon MI_@@@sourceSite\\\" mi_data-tooltip=\\\"@@@sourceSite\\\"></div><table align=\"left\" class=\"mi_resultcontainer\" style=\"direction:ltr!important;cursor:default;\"><tr><td rowspan=\"4\" valign=\"top\" style=\"padding-right:15px;padding-left:3px;width: 65px;\"><div style=\"position:relative;height: 100%;display: block;\">' +\n '@@@sourceAvatar' +\n '</div></td><th style=\"vertical-align: middle;\" align=\"left\"><div class=\"mi_resultpublisher\" style=\"color:#838383;\">@@@itemPublisher<span class=\"mi_resulttimeago\" itemDate=\"@@@itemDate\">@@@timeAgo' +\n '</span></div></th></tr><tr><td style=\"padding-right:30px;\"></td></tr>' +\n '<tr><td colspan=\"2\" onclick=\"@@@click\" style=\"cursor: pointer; cursor: hand;\"><div style=\"padding-right:10px;overflow:hidden;position:relative;max-width: 275px;\"><div id=\"#mi_image_lightbox_@@@ksid\" onclick=\" jQuery(mi_image_lightbox_@@@ksid).fadeIn();jQuery(\\'#mi_iframe_lightbox_@@@ksid\\').attr(\\'src\\',jQuery(\\'#mi_iframe_lightbox_@@@ksid\\').attr(\\'data-src\\'));\"><img src=\"@@@itemContentImageURL\" style=\"max-width: @@@itemWidth ;min-width:185px;margin-top: 15px;margin-bottom: 15px;nbox-shadow: 0px 0 10px 4px #eee;float: right!important;border-radius: 2px;display:inline;\"/><img src=\"//d34p6saz4aff9q.cloudfront.net/images/playvideow.png\" style=\"position:absolute;cursor: pointer;left: 50%!important;margin-top: 20%;display:inline;margin-left: -30px;\" nonclick=\"window.MI_logUsage(\\'play_video\\',\\'@@@baseid\\');@@@click\" onerror=\"this.style.display=\\'none\\';\"/></div><div class=\"mi_lightbox\" id=\"mi_image_lightbox_@@@ksid\" onclick=\"jQuery(\\'#mi_iframe_lightbox_@@@ksid\\').attr(\\'src\\',\\'\\');jQuery(this).fadeOut();\"><iframe id=\"mi_iframe_lightbox_@@@ksid\" data-src=\"@@@sourceURL?autoplay=1&title=0&byline=0&portrait=0\" width=\"500\" height=\"281\" frameborder=\"0\" webkitallowfullscreen mozallowfullscreen allowfullscreen></iframe></a></div>' +\n '</td></tr></table></div>',\n normalItem: '<div style=\"position:relative;\">@@@metaicon<table align=\"left\" class=\"mi_resultcontainer\" @@@cond onclick=\"@@@click\"><tr><td rowspan=\"4\" valign=\"top\" style=\"padding-right:15px;padding-left:3px;width: 65px;\"><div style=\"position:relative;height: 100%;display:block;\">' +\n '@@@item' +\n '</div></td><th style=\"vertical-align: middle;\" align=\"left\"><div class=\"mi_resultpublisher\">@@@itempublisher<span class=\"mi_resulttimeago\"> @@@timeago' +\n '</div></span></th></tr><tr><td style=\"padding-right:30px;\"><div class=\"mi_resulttext\">@@@itemtext',\n instagramItem: '<div style=\"position:relative;\">@@@metaicon<table align=\"left\" class=\"mi_resultcontainer\" @@@cond onclick=\"@@@click\"><tr><td rowspan=\"4\" valign=\"top\" style=\"padding-right:15px;padding-left:3px;width: 65px;\"><div style=\"position:relative;height: 100%;display:block;\">' +\n '@@@item' +\n '</div></td><th style=\"vertical-align: middle;\" align=\"left\"><div class=\"mi_resultpublisher\" style=\"color:#838383;\">@@@itempublisher<span class=\"mi_resulttimeago\"> @@@timeago' +\n '</div></span></th></tr><tr><td style=\"padding-right:30px;\"><div class=\"mi_resulttext\">',\n itemContentImage: '</td></tr><tr><td colspan=\"2\"><div style=\"padding-right:10px;overflow:hidden;\"><img onload=\"if (!jQuery.MidasInsight.imageIsGood(this)) jQuery.MidasInsight.HandleMissingImage(\\'preview\\',this);\" onerror=\"jQuery.MidasInsight.HandleMissingImage(\\'preview\\',this);\" src=\"@@@itemcontentimage\" style=\"max-width: 275px;margin-top: 0px;margin-bottom: 15px;box-shadow: 0px 0 10px 4px #eee;float: right;border-radius: 5px;\"/></div>',\n lightboxContentImage: '</td></tr><tr><td colspan=\"2\"><div style=\"padding-right:10px;overflow:hidden;\"><div id=\"#mi_image_lightbox_@@@ksid\" onclick=\" jQuery(mi_image_lightbox_@@@ksid).fadeIn();\"><img src=\"@@@itemcontentimage\" style=\"max-width: 275px;margin-top: 0px;margin-bottom: 15px;box-shadow: 0px 0 10px 4px #eee;float: right;border-radius: 5px;\"></div><div class=\"mi_lightbox\" id=\"mi_image_lightbox_@@@ksid\" onclick=\"jQuery(this).fadeOut();\"><img src=\"@@@itemcontentimage\" style=\"nbox-shadow: 0px 0 10px 4px #eee;border-radius: 5px;\" onload=\"jQuery(this).css(\\'position\\', \\'relative\\').css(\\'top\\',\\'50%\\').css(\\'margin-top\\',((this.height/2)*-1)+ \\'px\\').css(\\'top\\',\\'50%\\',\\'!important\\');\"/></div></div>'\n }\n },\n RASTA: {\n panelLayout: {\n header: [\"tabs\", \"stars\"],\n content: [\"photos\", \"tags\", \"mentions\"],\n footer: [\"share\"]\n },\n panel: {\n videoholder: '<div id=\"mi_videoholder_@@@baseid\" class=\"mi_singlevideocontainer mi_closeTopLeft\" onclick=\"jQuery.MidasInsight.MI_GetPhotos(\\'@@@baseid\\',false)\" style=\"margin-top: 74px;background-position: 10px 18px;\"><div class=\"mi_singlevideo\"></div></div>',\n containerHtml: '<div style=\"padding:0px;margin-top:25px;border: 1px solid #ccc;\" class=\"mi_panelBackground mikfpanel mi_rasta\" id=\"cpcnt_@@@kfid\" style=\"direction: ltr;margin-top: 20px;@@@layout\"></div>',\n tabs: '<tr><td><div class=\"MI_tabs@@@orientation\" style=\"margin-left:0px !important;position:relative;z-index:30;box-shadow:none;left:0px;padding-top: 0 !important;\">@@@tabs</div></td></tr>',\n gauge: '<div class=\"mi_gradeselectgradbg\"></div><div class=\"mi_gradeselectmasknerrow' + (window.MI_defaults.RTL == 'true' ? ' mi_gradeselectmasknerrow_right' : '') + '\" style=\"background-image:url(\\'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAHIAAABQCAYAAADFuSFAAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAA25pVFh0WE1MOmNvbS5hZG9iZS54bXAAAAAAADw/eHBhY2tldCBiZWdpbj0i77u/IiBpZD0iVzVNME1wQ2VoaUh6cmVTek5UY3prYzlkIj8+IDx4OnhtcG1ldGEgeG1sbnM6eD0iYWRvYmU6bnM6bWV0YS8iIHg6eG1wdGs9IkFkb2JlIFhNUCBDb3JlIDUuNS1jMDIxIDc5LjE1NTc3MiwgMjAxNC8wMS8xMy0xOTo0NDowMCAgICAgICAgIj4gPHJkZjpSREYgeG1sbnM6cmRmPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5LzAyLzIyLXJkZi1zeW50YXgtbnMjIj4gPHJkZjpEZXNjcmlwdGlvbiByZGY6YWJvdXQ9IiIgeG1sbnM6eG1wTU09Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC9tbS8iIHhtbG5zOnN0UmVmPSJodHRwOi8vbnMuYWRvYmUuY29tL3hhcC8xLjAvc1R5cGUvUmVzb3VyY2VSZWYjIiB4bWxuczp4bXA9Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC8iIHhtcE1NOk9yaWdpbmFsRG9jdW1lbnRJRD0ieG1wLmRpZDoyODYzNTRkZS04NWY4LTg3NDEtYjNmOS02OGU4NGQzZjVjODkiIHhtcE1NOkRvY3VtZW50SUQ9InhtcC5kaWQ6OTM0QjUyMzEwQ0ZBMTFFNTlCQjg4NzExODFEM0Q0M0QiIHhtcE1NOkluc3RhbmNlSUQ9InhtcC5paWQ6OTM0QjUyMzAwQ0ZBMTFFNTlCQjg4NzExODFEM0Q0M0QiIHhtcDpDcmVhdG9yVG9vbD0iQWRvYmUgUGhvdG9zaG9wIENDIDIwMTQgKFdpbmRvd3MpIj4gPHhtcE1NOkRlcml2ZWRGcm9tIHN0UmVmOmluc3RhbmNlSUQ9InhtcC5paWQ6RDVFOTA3RTFFN0Y4MTFFNDkzNjJGQzdDNUEyRDA1MTYiIHN0UmVmOmRvY3VtZW50SUQ9InhtcC5kaWQ6RDVFOTA3RTJFN0Y4MTFFNDkzNjJGQzdDNUEyRDA1MTYiLz4gPC9yZGY6RGVzY3JpcHRpb24+IDwvcmRmOlJERj4gPC94OnhtcG1ldGE+IDw/eHBhY2tldCBlbmQ9InIiPz5NfkuaAAAX1klEQVR42uxdCZQdVZm+99by9u7Xr1+n926ykOASgQODS5gJijIGJQxbOM4IIosKKgoHZw7icubMAcHjuI3jCHJkNI4LGcEIKuoIozKj4uAIkTBEliyd3ve313bn++tVvby8vNd53R00CXVPbqrqVdWtW/93v3+5SzWXUrIgHfuJb9u2bUk3UgMIhUIsFosx27aZoigsn8+ztrY21t7ezvbu3csikYj7e7FYdO+JRqNM13U2OzvLUqkUE0Iwx3GYqqruNpPJuFsqo1JBzt3fDMNgiUSCzc/Pu+VS+T09PfT88NDQUE9ra2tnOBweRJn9uGcFbm1HDqOeKo5t7JvIczieQN6POu+ZmZnZj3qMo05Te/bscetNdaE60jvRs6mO1e9M9bAsy30XOucTga4tFAru/ZRzuRwzTdP9vaWlhWWzWfe9qN6opys3kg29G+Xp6Wk2OTnpXr+UpI6NjS3pRno4CZQqSS9NlSchU6KKTkxMuIKnytILUiIhEPhUabqeztG9mqa55UGwFWD9RMKia6iR0D41AgiyG8c9AD4NQZ6M3AehpXC+G2V2IrdhvxW3h5AVnHewtbDNovwZlDeOMkaxP4G6TaKh7YCg96Lek7juOQjZKZVKbv0oVzcoapQEEAHoA0HnKFNDpHehhkCyoPel3+m6ubm5yrtTI6D7/Pvp/ej30dHRSlmLBtKv6KKp7FXQb5W09Y+rz/nZB6U2+/f65/2t39Jpi/KiAHc9Dl+LxnEGGtDa9evXnwChtUE4YtWqVYeUWyMQApNeNATBtSOvIQFS2dTICBwwOguARsGknbjv97j25yjnSVwz4pflM7S6/Ebnaq+r/b1aLtXyWzKQR5OepxfyWyheJo58OgC8CHlDOp0eBIApUkmkCah1L/WlqxNpDa/RxMHSNQB1DcDcDICvx/4E8mOo0w9wzU8IVLr2aPQrjhogCUAiOlrmyVBNmwDehfF4/HQSNIFH6mip2qMZ7UKJ1CJleiYBC/UaB6groSYvhSofg6r8d/z+IPKvAOZsAGQNC4mBSG+Bs/E2qLhzkdvI9r6Y4DWTiPWUyTEDqJ0A9b2w0dfB3v0c7N2GxncvLpt4SQPpMRAEFOdBWO8BcH8Bry5Knp1vK46m5IOaTCY52LkRzslGAHotWPp11PVOvMfMSwpIzwbi3flrYOs+AgA3gYkcAvqTsq/ZRE4JVL6bAegrpqamPgGWXgWG3o53uw8aZua4BbI6FgR4L+vu7r5xxYoVlwNAnQCsDjeOpUSqnzJU7xoAejdAfAfe8xNoqD/8YztEfxQJel4ox0u/H6rzxo6OjkGyOxRvLcO6MgoPORdjUvK845jcKY0rQqhPKuHO79e8m4Nrw6X8c1sY07vVUJetKOT1Ulhi9yE6WZYm9z1pvNufj4+PnwaG3osCbwGYw8cNkB6IrxwcHLwVDNwMEH2vcNFOEXhdcGxzhDvGDqnEfmUWRwt6OHU/UyLTjm0xszDCVTVSBJBmnZqwUu6Ff2Y8qjElJYWgvgKLFwoTl4RCXSkmi+uB9gZVDSepVwgNZNEql94LjTU6OTl5BfKG4eHhj+DUvccskNW9ID09PZfBntwOddpDjgy594sC0LH2AcVfAsAnpZ3dAdB+zsz5WUWNESkPfq7QkBu9EoJxJVSUTC/W0O8rdGxaBTyGeoOstbZtnYufNmpqbD3nSrpxmYcmsvOdnZ1kQ0+Exvl2Npt9NTxesp8TxxSQJBTqi8RLJMDA27q6uq6FPVQWw0KoQUMacy84kv8rVyPf49L+A3AwmYMwRQFTuHIQQLWANQKy0bXl3iNioJjDf7+Buv2NYWbaTDu7FtecpWvJ81U1erLgSnQx6pZ6nMDMG4eGhjZAHu8FmI8fE0CSQAhEbFf29/d/qa+v7xxSpeS2N2PzHLOYl1buF0wJfdopzj4GEGeZBtlJ7p5nJGxkTr0rnLrx8Cy7CFxDXveXiuMsk9Y0MIngWt2Fiq5znAx2TEZYlEEjG2t6dtYr3wO3XJYC75P/2nHsXwPUL0BUvY5T+jtVCV+kqKFWznjT7ASIrx4ZGfk+nL13Qz7bXwxHSBzJwrwO5D8D+7bDJp5DoxPNgCjNgm3O7nnAmn7mIsfIvRnS/jGEPesCV5Gv4gqdOQZz8CO35qGmE0xmfgdtOMtULQyBRZlwplEegLQLLnBkG5lTApmzwAL102z3OinnEOTvxn6CGdYwzhcAjeoBLMvthtQxNRyu5LC/y3Gsq/LF0XPmss99oWTONa0qyaRAHp1g6VZ46e/zG/1RxUjf3pA9ROs7e2BgYCtY2J1Opw8b1Eur5Nj5ifsdI/tVaRs/4lCpZOcOUn0u8+AwWTkmiFGFIfgrvYwZU0yJDjAbIgYNq+pDrFXL7KX7padS3d8Ah/S1B93joDHEWCH7NADtQ1uxXDCFsKBZ5KGKmNNAgPpYsTT1mGUXt9oh82pdS2xRlVBrM6oWskmAnf8EJ6gDzPz4kez4OCKMpPgQLW3L6tWr7zvhhBO6SZ0uWEEaebDMR6A+N8nC9F9DvA9woRvMU3menQSZSoyZc6TmGDemvcrKso2kTNe49pI3o7lrnCO6R/HsI5wkprgXUENQNJ3poTjaAFQyM8sNqUpUAo0C9pLAfHfRmH21ZRa+gvo6zfQOwdyw3t7ej4XD4c9Bg/EjxUx1uWz0QLwAhv1OVLCF+kgXMKKQvTlnZ8a+xLTY33OhFOBKukxh8oCkuevOk3ChCq0S4+F2CNUDrNJAvK1jHkBI2hqTxkrmse1gFG08wkDcaO7HwXxZhVpVZcmDnB+hqC7TbQkVjTpaMgsoFRyzKluqSORnbCnflS+MPBrVU7cgPl29UOhCLCQwIbvrx8bGVNM0byAu/MmA9EGEOj0PLNwKEGMLgkiiLWV/4uQn78DdP60A4gvGMVw2CEV3277U4KyQl0oXEPMqcvYAd8w2bFNchN8CSafxo8n19Clg78lMbQO5wxW20r5gbSwcOUnlPLQLP/436VrO1d+jjEfhxBTBqEle47i5gIKtmhJmJXuCKTzCpGu2HZQnDjhJnNlcinvyxtwvVUX/UDSUuvJwMSfkRbvXjY6OmjBLH1wuMxcNpO+Z0ig5PNM3AcSvoYXFFgovpAlbODf0HRZpoxfMsmq1S4OrYJUbhxt5nFI9Z8PL3ENQWjCWvAdt+gKwYECGUhcAi7BIntbr2j/3bZLYTdZpdQqiFp0pqtvQBpHfpKrUt9tioqzRcGjAFCLyX1Ch3+dc/lC6jK1mc9nxKdnzLKJ1sIjSwTKw1VEnDJDjFfspmf1/2L06W5zcrSmhD4e0RPhwYOJdPwBmGlCzf0type7KpYCqLhZECuipfzQSiZwCdfplBPrJBUG0rXlp5N7nZMa3KvEOvKznhBCAZpEJNY6M8EHRKPwos69aiFJ2oSWczPTkFUzRzxVaf4sbgrBYBaSluge87Fn1h/QeetYqsPIytKp9kssHHdt8yJH2DodZL1RUqVt3h4XQCKbFs+VoiPuW2/G8XE0WzKl/cBzjIU2NfRNe7+qFwCTPHsz+0Nzc3DAA/aw/k+BFB5J0PDzSPlTgqwj0B1tbGztsTnYqB3AuF5GW7QDBY1jZznFyLEyrrD7hBEhybKrjdinTQPgaxJIXAayTeaTjRe5OdG0eWbF+lanXSiV0LcDZZTvF/7ClcTfY+r8H5GC59pI83iJi1rBMMQ1xq+PaXOmGLPBuf1MycpsdWfpOLJw+qSEAYGBXVxeNd96GMGV3JpP5LkUAiwVTXQyNSZ3C84oCvLtSqdSrFgoxnKm9GXP46cuUvvXbK94oriUh8HmEiIUc4wk4MaWcx0JeBtWx07j0vTyUuJgJ/ZWMC/bHT2VQQ2p6LSq31nJyF5aY+JZpTt4Flj7N3GYoXYZKDnupcDZVepZpLM6S6uABx4YrO2fyIxcXrNnvpONr1jV6Gmk5qNkIsLgLIA7T9BLycIk0zeKjNtfrwly76HU7fRQtaBP1WDQC0Z54IWPufOQqnuoFE9UDahKaTOB1ZR7BuRat8hjJmXFiYO3l8GZv5nqs/+gZrEJkKeJdqh7/oCIi1+CHm21p/RsYOu2yD8xUuM7GzKfw4ipri6zCb+qBUEZoT41ln7oUrL6vM/HyVY2eQqMnCNs68vn8lwHeGyYnJ6eImc2O0TYNJIEGAP8KQe0NUKkHzfc8iInT+\\/PWEz++jGvqdq7pHoDCVavcQCihRplNndC+x+\\/21jhnMi18s4ilz3XDkaM0hdV2MsyfN+zMFoD0ebBy2wEbFWaWsNiY8RQL2TEW1XoqHRSqiDwxnH3yPGiX+zvjJ61tVD75HtB6r4Ine8euXbuuBZgmTS1thpUqzcVsZigKAK5G/iLUaYgKr2tDZ8cyxlM/uxye33amhbyQAWqoiHBRg0dJMXNVLwxSC+Loa0S07WbYwXZ2lE3vaJR0JXFmV+y016KFrsqZY3ccUKUaA8hs3hlGaJZnXeFXuA4QkUDl+s6x7NMX495tbZHehmqWzBVYeQUigl/Bft7tTQddvrNDdhH01trb2/+Rut4aOTeymMuZ+56+hkv7u+B52bEhVxr2kKGxiI7eKhbaFJL0iGjyDiXc8nYmjr0ZApqIK2Dk7SEluQle7tthO4fIrgIwt7/sycwDLG/Ns3Z1oNwdyEkNix2zhf2XxtTUfboWWdVI88FsKSDPbTj8z/n5+WebmUGhEp0PZxsB4NUIM95Ko/oN0rSTz7wTCH3PVaOGiZJpC5c8N44mHCrHg9xzaNTQWXB0vswUbQ1T2DGbiG0JvWejI80f4sU+5kh5v3Q7/jRydNg4HKA25QQWVtrgVUbdGFnlkScyxcnLW5WuR1RRf3CWNB5k3QFtSeHIJYZhFA7HSuX888+vrD+ozTRtHi7xIBycrwHIlnoqFXEicyaHbpWZmbulUXSHmCgm5HDNhYiXmQlbyaMJmrSK641zRKrnW6JlRR87ThKYuCKurbikYM3Bi2O/pJhy3hwFgEnWFz4VwLawCCxHRLQzjUdgquSodMQGXaPuPN6wXxasXF0oFKhL8XGSvT/vtl5WG9k7n+ZQpR9B6+imWWN1VWp29kHr+R2fYwQeqYBQsjxmWBmC8vtBHfyTrxeJ9q8zPZJmx1mKa13ihMSGT40Un2QlK/dpv5NACJ1FlRAzHaPSTxxSmGXb1j1gWgmAnVtv8IJkD3upQLXehP2HQKo9C7FS1GMiOTekUsHCNyJf3Uj9ymJ+j5ybfg+PtmR5BA6dhkaBcMON6X0Q3Q5xihPlWTyWuBcgdrDjNIWUBO+NnPpJhek3mk4BMuBljxPWlNo1dRhIZmNrUxD6TdxyHvInFxotgVlbAx/lJlrdRetUGmV1amqqrl3UdT28du3aj5MXVTdEkbJgT4x8WM5N7uehmNcfSr01BXeYqjL6YJZgE/U380Tqq1wLpdlxnjQRVQbjZ3xiqPCELDm5z/gzCfxwzakZ7cLxHWDaXyKf2igkgVa8Gp7sPXA8f9so7BP1VkhRAhO3wFM9s3qt4kEVmBx5SM5NfYOrYYQVzLONpFoR6EcSlczbe/qVvjWf46HoCvYSSWGlVT81dcmnYmrbDaZTFOXBbVZZoeYvxfOC/VnqOHcHExp04SFuD8O0fZSmlDaKKdV6MSPsZhvimOtp4Wddvew4IyjvSpFoc0OMigolF9TvibDhudpOXHQP3ArbuZa9xFJKHxSJ1IpPGoaVgyq9y++rJiBpPm/NsrpfIH8bsr6qXlk0PAhmnlMsFjfRyrBaTNwGUk+tdnV1vRW6+TTqkqvLxpnJzwDMWdg8xkNgJLEPal/OzzA5O8Xk9AQFoIzHWz7ABb+MvUSTJiJqVI/fpKiiq9rDJCD9Rb6UPb/kX4idjZxO4BEFHjQMGPZ/45xXVo6rvs6mH6nQSCQS7u3tvZ4C/3r6WGbnn7NH993LFdIY7lg+o7BDzs0QA2keBEA0mOhbdbbSlr6JvcQTGvKJGteuhJxvqx1JqlaT3lTJh2k5YV2vGFEDmLkZseXpsJWP+iD6S+XFunXrKqtpCUjo481wcE6vy0Z6+MjQN3g+t4cV4cTk8wzBJlgZYUq6iyldfdh2M5HuHlTaO79ItpoFidKtyK+rZVntMa0bYQ2mfdB5mDoN7Hs3LWOnbxLQMnxitvvdgoGBAXeH1q8DUAVq9Tp/7f8hOGbmn7czc3dy6kctj6qSTw0nRy/35HjzMZTewQt5S3JtgN8BECDbO2C2LsXhQutBHgeZvgnZv6PeSSIXzY8C4OtQ5jNULo2akDl040h4qG6fKtIZxMYGI/7Syc1t5fHEftYCorW0gu8tzAErrb0vMGtoN7P3PM/s4X2vYeHoLQF8h4B5JsB8Z3V0UGc6pASQX5Hy4JGFaqcmlUrFoEpp1ZcLrN8PKwzDINSSoG0bTrwdejhWd32GZU5zVf+S6IDqTLYz0Z52mcj1MBOtKSYSADcSZcrAyo9zXW8PoKsLxN8AuJ56H5DwvyCCfVrW/t1GZZAHi+u24JougNkCNiaxn6Rv0NxfKpUUhBscJ05t5Knae3f/j7N/zwTXveEpcoRUjVUGjmFfRTh2ttLde1YAWcP0MsibQPhstdqt+aiFgfPfwnYzOb6HeMLlOVMrcc1DOJz0Q0gOoyl9D4poSjq3TtyYs/e+sFkW8g+7A78EYi6LUGOOSd+WlkphZfWJ25SVq94a4NU4Qc7Pg0WvBXDj1Wq1JtDvA+t+hPMvr1cGmUGaPVAdVVBPwTQxthzNN0iF/ONOJrOJK8qEO1cFLHQnVjvywCRvx3olb2n7KQ+FVgRwLZwAxM3Y3H4YL/YbAPNtTRZpeHMTD9OKiqVHwLgJSZ8iQ7jhwO11xseZMzPNnOlpZo9PkLp9QwBicwmabwvYxGu7RWvYuXUxZR5+ihrNSy3mHnbXJdIDSZVqqmsTWcko52IxBZreEEDUtAc7iLzxICBqvpIFMH8Hn+UPRw5IyfYjJvwZb00yjpBDJFqYNK2ybdQ1F1Qej60X6XRvAFHzXbEAbEOto1PjzY5i+1jTLD/cBc7Y2HPO+BjnIW8eDkIchyvueCPN6ZQIRpV0+wX1PKwgLZjO9oawrKpuumpbKSnoh52UzZi/wzKSp1KPKitX5kRfHxP9A0xGEXYWCmClWc6FfCfU7RuPlRlwR1Gi8cczawP+6gxWfo8i+OUz0jTzcnx8V7VHxamDtrvLa0LSfbqS7ugPcFm0nUwCqBW1Tk71wDOONX8Mc3lAquo+3tGx3VWp7uw4gxk7d5BzU57qCEaKaPQKZUVnS8DHJcWUFyJvpyi8TixJ6WkA/gNsz18ekI5UuR4qL0GiB2k6C53xmvJybn9toOP0cEUJUFlal12nh0GpwSU55NFlq1Z7/76wMzLM3Fnj3iopu5j3VlVhY5i6duK6lOgOHNalJKjRpGVZbWBdboHLos18m0gsrMfZnUxwqzJiZRrMoQFlFCxJtdJXjTl/QwDJktMpAPGURmGIt/8ANvllMVL0Dz6LfODYsplqW+VZAMyd8mhwVTECPJaW6vXq1ElDyPRR+Ohy4siDBiaFqtBX0AMEjjCehzlPc3SUpTOSZoYXS7Kyypi2CD34MfpJzqM4Zet4swcdLm81lg0gZ2dYZaojfeUx1e5NfwzSkUq2bZ+E/HD1XxyonWbTDJCiMSFt5uQzyNlyLuSZzB3SeBx2yDcag7RIz/Vd/jINykv9TEtDetHKKRGJ2O4nxAgtw2Cl3c8wXVOY0urN5HBskwnFCeBYVir5Ix/+4L6/vxiyNNaTqsZEZ0/J7b0Jh5k9jrjUMtw5qw5iSWt+hqmxxEYRTfQF/axLTwCu0qtT7++Y4Li0bI9JWuZ11uhQD7Os8hJyeggApqXkxZ2/Wy8deYu7ejNIS04Aiv7C0MUN/jAMeazvYuUZHMvoENBCrxMtSfq+6GoocxXA6rTFqdPCq9Y9qMRbBgMolp2SAPMe5Pdjn9b1a56mpG/zfAH5ymbCD+79eYPEYS7e6cxM/tYc3hPS+lcZIpHciKbUF2Bw5JLHxl8j7waoDo7fhG2zyxCNZoH0n8YCe3hUpkUCGaQAyCAFQAYpADIAMkgBkEEKgAxSAGQAZABkAGSQAiCDFAAZpADI4xxI+qi593nHIB2jySIg6ftn9B1PEcjj2AXy/wUYACIPOMIobjzuAAAAAElFTkSuQmCC\\');width:100%;background-repeat: no-repeat;background-position: 15px 6px;\"></div><div class=\"mi_gradeselecthandlenerrow\"></div><div class=\"mi_gradeselectdigitsnerrow\" ' + (window.MI_defaults.RTL == 'true' ? 'style=\"direction:ltr!important;\"' : 'style=\"direction:ltr; LEFT: -4PX;TOP: 30PX;\"') + '><span style=\"font-size: 43px;z-index: 3;color: #92c83e;font-family: \\'Source Sans Pro\\', Alef!important;\"></span></div><div class=\"mi_gradeselecttext\" ' + (window.MI_defaults.RTL == 'true' ? 'style=\"top:77px;direction:rtl;color:#b8b8b8;\"' : 'style=\"top:77px;direction:ltr;color:#b8b8b8;\"') + '></div>',\n starspanel: {\n header: '<tr><td style=\" border-top: 1px solid #DFDFDF;\"><div class=\"mi_hover_starspanel\" style=\"border-bottom: 1px solid #dfdfdf !important;padding-bottom:5px;;overflow:hidden;border-top:1px solid transparent; padding-top: 20px;margin-top: -17px;background: #f7f7f7; /* Old browsers */background: -moz-linear-gradient(top, #f7f7f7 0%, #ffffff 100%); /* FF3.6+ */background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#f7f7f7), color-stop(100%,#ffffff)); /* Chrome,Safari4+ */background: -webkit-linear-gradient(top, #f7f7f7 0%,#ffffff 100%); /* Chrome10+,Safari5.1+ */background: -o-linear-gradient(top, #f7f7f7 0%,#ffffff 100%); /* Opera 11.10+ */background: -ms-linear-gradient(top, #f7f7f7 0%,#ffffff 100%); /* IE10+ */background: linear-gradient(to bottom, #f7f7f7 0%,#ffffff 100%); /* W3C */filter: progid:DXImageTransform.Microsoft.gradient( startColorstr=\\'#f7f7f7\\', endColorstr=\\'#ffffff\\',GradientType=0 ); /* IE6-9 */width: @@@widthpx;left: -0px;position: relative; height: 30px;\"><table style=\"position:relative\">',\n footer: '</tr></table></div></td></tr>'\n },\n tag: '<span onclick=\"jQuery.MidasInsight.tagClicked(\\'@@@kfid\\',\\'@@@atags\\')\" class=\"mi_tag_@@@atagsreplace mi_tag\">@@@atagscap<span style=\"display:inline-block;background-color:@@@color;-webkit-font-smoothing: antialiased;padding: 0;margin-bottom: 0;margin-left: 0;margin-top: 5px;left: 4px;position: relative;width:6px;height:6px;border-radius:50%; box-shadow: inset 0 0 10px 10px rgba(0,0,0,0.2);\"></span></span>',\n slidercontainer: '<div id=\"mi_previewPhotosContainer_@@@kfid\" style=\"height:65px;cursor:default;-moz-user-select: none; -webkit-user-select: none; -ms-user-select:none; user-select:none;\" unselectable=\"on\" onselectstart=\"return false;\"><table class=\"mi_previewPhotosContainer\" style=\"\" cellspacing=\"0\"><tr>',\n photopreview: '<tr ><td id=\"mi_photopreview_@@@kfid\" onclick=\"window.MI_logUsage(\\'photo_preview_clicked\\',\\'@@@kfid\\');if(jQuery.inArray(\\'photos\\', jQuery.MidasInsight.ObjDictionary[\\'@@@kfid\\'].options.tabs) ==-1) return;jQuery(this).find(\\'.mi_thumbscontainer\\').hide();jQuery.MidasInsight.MI_GetPhotos(\\'@@@kfid\\',false);\" colspan=\"2\" style=\"width: 100%;overflow: hidden;background-color:white;\"><div class=\"mi_thumbscontainer\" style=\"margin:0 auto;overflow:hidden;width:@@@widthpx;padding-top: 3px;border-top: 0px solid rgba(0,0,0,0.2);\">',\n tabswrapper: {\n header: '<div style=\"width: 152px;margin: 0 auto;background: #fefefe; /* Old browsers */background: -moz-linear-gradient(top, #fefefe 0%, #eeeeee 100%); /* FF3.6+ */background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#fefefe), color-stop(100%,#eeeeee)); /* Chrome,Safari4+ */background: -webkit-linear-gradient(top, #fefefe 0%,#eeeeee 100%); /* Chrome10+,Safari5.1+ */background: -o-linear-gradient(top, #fefefe 0%,#eeeeee 100%); /* Opera 11.10+ */background: -ms-linear-gradient(top, #fefefe 0%,#eeeeee 100%); /* IE10+ */background: linear-gradient(to bottom, #fefefe 0%,#eeeeee 100%); /* W3C */filter: progid:DXImageTransform.Microsoft.gradient( startColorstr=\\'#fefefe\\', endColorstr=\\'#eeeeee\\',GradientType=0 ); /* IE6-9 */-webkit-border-radius: 15px;-moz-border-radius: 15px;border-radius: 15px;border: 1px solid #cbcbcb;padding: 5px;\">',\n footer: '</div>'\n },\n footer: {\n header: '<div class=\"mi_footerwrapper\" style=\"background-color:#fff;\"><div class=\"mi_footerroot\" style=\"top:2px;\"><div class=\"mi_footercontainer\" id=\"mi_footercontainer_@@@kfid\" nstyle=\"height:100%;position:static;\">' +\n '<div class=\"mi_footer\" style=\"background-image:none;height:auto;margin-top:2px;\"><div onclick=\"jQuery(\\'#cpcnt_@@@kfid\\').find(\\'.MI_tab_selected\\').removeClass(\\'MI_tab_selected\\');jQuery(\\'#mipct_scroll_@@@kfid\\').addClass(\\'mi_blured\\');jQuery(\\'#mipct_tblabout_@@@kfid\\').css(\\'max-height\\',jQuery(\\'#mipct_scroll_@@@kfid\\').height()+1).css(\\'height\\',jQuery(\\'#mipct_scroll_@@@kfid\\').height()+1).css(\\'top\\',jQuery(\\'#mipct_scroll_@@@kfid\\').position().top).fadeIn();\" style=\"z-index: 1;position: absolute;right: 0px;top: 5px;height: 25px;width: 65px;cursor: pointer;display:none;\"></div>',\n share: '<div><ul class=\"mi_share-buttons\" style=\"padding:0; margin: 0 10px 5px;;\"><li><a onclick=\"window.MI_logUsage(\\'share\\');\" href=\"https://www.facebook.com/sharer/sharer.php?u={0}\" target=\"_blank\"><div style=\"margin-right: -6px;background-image: url(//d34p6saz4aff9q.cloudfront.net/img/f.png);height: 30px;width: 30px;\"></div></a></li>' +\n ' <li><a onclick=\"window.MI_logUsage(\\'share\\');\" href=\"https://twitter.com/intent/tweet?url={0}&text={1}:\" target=\"_blank\" title=\"Tweet\"><div style=\"background-image:url(//d34p6saz4aff9q.cloudfront.net/img/t.png);height: 30px;width: 30px;\"></div></a></li><li style=\"display:none;\"><a onclick=\"window.MI_logUsage(\\'share\\');\" href=\"http://pinterest.com/pin/create/button/?url={0}&description={2}\" target=\"_blank\" title=\"Pin it\"><img onload=\"this.style.opacity=1;this.style.top=0;\" src=\"//d34p6saz4aff9q.cloudfront.net/images/footer/Pinterest.png\" style=\"opacity:0\"></a></li>' +\n '<li><a onclick=\"window.MI_logUsage(\\'share\\');\" href=\"https://plus.google.com/share?url={0}\" target=\"_blank\" title=\"Share on Google+\"><div style=\"background-image: url(//d34p6saz4aff9q.cloudfront.net/img/g.png); ;width:30px;height:30px;background-repeat: no-repeat;\"></div></a></li></ul></div>' +\n '<div class=\"mi_footer_prompt\" style=\"color:#59a3e8;top:auto;border-top:none;position:static;float:left;margin-bottom:0;padding: 7px;\">@@@ask</div>',\n callForActions: '<tr><td><div id=\"cfa\" style=\"white-space:nowrap;padding: 0;margin-top: -2px;\"><div onclick=\"alert(\\'call to add to favorites\\')\" style=\"cursor:pointer;height: 21px;width: 50%;margin: 0;display: inline-block;text-align: center;vertical-align: middle;padding-top: 7px;border: 1px solid rgb(239, 239, 239);border-left: none;font-size: 12px;color: #111;border-top: none;\">+Add to Favorites</div><div onclick=\"alert(\\'call to book\\')\" style=\"cursor: pointer;height: 21px;width: 50%;margin: 0;display: inline-block;text-align: center;vertical-align: middle;padding-top: 7px;border: 1px solid rgb(239, 239, 239);border-left: none;font-size: 12px;color: #111;border-top: none;background-color: #31b444;color: white;\">Book</div></div></td></tr>'\n },\n header: {\n header: '<div class=\"mi_panelheader\" style=\" max-width: @@@widthpx;overflow: hidden;display: block;\"><table class=\"mi_rasta\" align=\"left\" class=\"mi_reset mi_greenredtitle\" style=\" max-width: @@@widthpx;overflow: hidden;display: block;\"><tr><td class=\"mi_header_caption@@@gaugeOrientation\" style=\"padding:0 !important;@@@exttrastyle\">' +\n '<div class=\"mi_drag_area\" style=\"position: absolute;width: 100%;height:125px;left:0;z-index: 2\"></div>' +\n '<div class=\"mi_green_close@@@gaugeOrientation\" onclick=\"jQuery.MidasInsight.hidePanel(\\'@@@kfid\\');\" style=\"z-index:3;cursor:pointer;display:none;\">✕</div>'\n // score gauge\n +\n '<div class=\"oi_gauge oi_gauge_@@@clsgrade mi_gradselectroot @@@gaugeOrientation\" id=\"mi_gradselectroot_@@@kfid\" data-score=\"@@@decgrade\" ></div>' +\n '<div class=\"mi_titlescore oi_color_@@@clsgrade\" style=\"@@@titleOrientation;text-align: left;margin-top: 16px;width: 240px;font-size: 25px;height: 0px;margin-left: 105px;\" >@@@textgrade</div>' +\n '<div class=\"mi_title\" style=\"@@@titleOrientation;margin-top: 22px;width: 240px;float: left;height: 41px;margin-left: 102px;color: #030303;\" >@@@displayText</div>' +\n '<div style=\"float:left !important;margin-left:102px;color: #A0A0A0; margin-top: -5px; nmargin-left: 0!important;npadding-left: 0!important;\" class=\"mi_subtitle\" >@@@count</div>' +\n '<div class=\"mi_preview_images\" style=\"z-index: 3;width: 100px;height: 60px;border: 0px solid #ababab;position: absolute;right: 18px;top: 33px;padding: 0px 0px 0px 0px;cursor: pointer;\" onclick=\"if(jQuery.inArray(\\'photos\\', jQuery.MidasInsight.ObjDictionary[\\'@@@kfid\\'].options.tabs) ==-1) return; jQuery.MidasInsight.MI_GetPhotos(\\'@@@kfid\\',false);\"><div style=\"border: 0px solid #ababab;width:100%;height:100%;background-image:url(@@@previewimgsrc); background-size: contain;background-repeat: no-repeat;background-position: center top;\"></div></div>'\n\n // tools tabs\n +\n '<div style=\"clear:both;height:0px;margin-bottom:0px;border-top:0px solid #DBDBDB!important;\"></div>' +\n '</td></tr>',\n footer: '</table></div>'\n }\n },\n scrollables: {\n header: '<div style=\"clear:both;height: px;margin-bottom:0px;border-top:0px solid #DBDBDB\"></div><div id=\"mipct_scroll_@@@kfid\" tabindex=\"-1\" style=\"heightdummy:0;outline:none;max-height:none;\" class=\"mi_scroll\">' +\n '<table align=\"left\" id=\"mipct_tbldefault_@@@kfid\" class=\"mi_results mi_scrolledcontent\">',\n footer: '</table></div>'\n },\n socialItem: {\n timelineItem: '<div class=\"mi_timeline\">@@@fullYear<br/>@@@month<br/>@@@date</div>',\n metaIcon: function(data, baseid) {\n return \"<div style=\\\"left:auto;position: absolute;right: 24px;-moz-transform:none;-moz-filter:grayscale(100%);filter: grayscale(100%);zoom: 1;-webkit-filter: grayscale(1);top: 5px;\\\" class=\\\"mi_widget_social_icon_small mi_widget_social_icon_small_\" + (data.source.replace('.com', '').replace('www.', '').replace('.', '').replace('.', '')).trim().capitalize() + \"\\\" mi_data-tooltip=\\\"\" + (data.source.replace('.com', '').replace('www.', '').replace('mi.google.reviews', 'Google Reviews').replace('plus.google', 'Google+')) + \"\\\"></div>\";\n },\n nonTimelineItem: '<img data-source=\"@@@sourceSite\" onerror=\"jQuery.MidasInsight.HandleMissingImage(\\'avatar\\',this)\" src=\"@@@itemImageURL\" valign=\"top\" class=\"mi_resultimage\">',\n youtubeItem: '<div style=\"position:relative;\"><div class=\\\"MI_SourceIcon MI_@@@sourceSite\\\" mi_data-tooltip=\\\"@@@sourceSite\\\"></div><table align=\"left\" class=\"mi_resultcontainer\" style=\"direction:ltr!important;cursor:default;\"><tr><td rowspan=\"4\" valign=\"top\" style=\"padding-right:15px;padding-left:3px;width: 65px;\"><div style=\"position:relative;height: 100%;display: block;\">' +\n '@@@sourceAvatar' +\n '</div></td><th style=\"vertical-align: middle;\" align=\"left\"><div class=\"mi_resultpublisher\">@@@itemPublisher<span class=\"mi_resulttimeago\">@@@timeAgo' +\n '</div></span></th></tr><tr><td style=\"padding-right:30px;\">' +\n '</td></tr><tr><td colspan=\"2\"><div style=\"padding-right:10px;overflow:hidden;position:relative;max-width: 275px;\" class=\"mi_imgcontainer\"><img src=\"https://i.ytimg.com/vi/@@@sourceURL/mqdefault.jpg\" style=\"max-width: @@@itemWidth ;min-width:185px;margin-top: 15px;margin-bottom: 15px;box-shadow: 0px 0 10px 4px #eee;border-radius: 5px;display:inline;\"/><img src=\"//d34p6saz4aff9q.cloudfront.net/images/playvideow.png\" style=\"position:absolute;cursor: pointer;left: 50%!important;margin-top: 20%;display:inline;margin-left: -30px;\" onclick=\"window.MI_logUsage(\\'play_video\\',\\'@@@baseid\\');@@@click\" onerror=\"this.style.display=\\'none\\';\"/></div>' +\n '</div></td></tr></table></div>',\n lightboxYoutubeItem: '<div style=\"position:relative;\"><div class=\\\"MI_SourceIcon MI_@@@sourceSite\\\" mi_data-tooltip=\\\"@@@sourceSite\\\"></div><table align=\"left\" class=\"mi_resultcontainer\" style=\"direction:ltr!important;cursor:default;\"><tr><td rowspan=\"4\" valign=\"top\" style=\"padding-right:15px;padding-left:3px;width: 65px;\"><div style=\"position:relative;height: 100%;display: block;\">' +\n '@@@sourceAvatar' +\n '</div></td><th style=\"vertical-align: middle;\" align=\"left\"><div class=\"mi_resultpublisher\" style=\"color:#838383;\">@@@itemPublisher<span class=\"mi_resulttimeago\" itemDate=\"@@@itemDate\">@@@timeAgo' +\n '</span></div></th></tr><tr><td style=\"padding-right:30px;\"></td></tr>' +\n '<tr><td colspan=\"2\" onclick=\"@@@click\" style=\"cursor: pointer; cursor: hand;\"><div style=\"padding-right:10px;overflow:hidden;position:relative;max-width: 275px;\" class=\"mi_imgcontainer\">' +\n '<div id=\"#mi_image_lightbox_@@@ksid\" >' +\n '<img src=\"https://i.ytimg.com/vi/@@@sourceURL/mqdefault.jpg\" style=\"max-width: @@@itemWidth ;min-width:185px;margin-top: 15px;margin-bottom: 15px;nbox-shadow: 0px 0 10px 4px #eee;float: right!important;border-radius: 2px;display:inline;\"/>' +\n '<img src=\"//d34p6saz4aff9q.cloudfront.net/images/playvideow.png\" style=\"position:absolute;cursor: pointer;left: 50%!important;margin-top: 20%;display:inline;margin-left: -30px;\" '\n //+'onclick=\"window.MI_logUsage(\\'play_video\\',\\'@@@baseid\\');@@@click\" '\n +\n 'onerror=\"this.style.display=\\'none\\';\"/></div>'\n //+'<div class=\"mi_lightbox\" id=\"mi_image_lightbox_@@@ksid\" onclick=\"jQuery.MidasInsight.StopYoutubeVideo(jQuery(\\'#mi_image_lightbox_@@@ksid iframe\\')[0]);jQuery(this).fadeOut();\"><iframe width=\"560\" height=\"315\" src=\"https://www.youtube.com/embed/@@@youtubeid?enablejsapi=1\" frameborder=\"0\" allowfullscreen></iframe></a></div>'\n +\n '</td></tr></table></div>',\n lightboxVimeoItem: '<div style=\"position:relative;\"><div class=\\\"MI_SourceIcon MI_@@@sourceSite\\\" mi_data-tooltip=\\\"@@@sourceSite\\\"></div><table align=\"left\" class=\"mi_resultcontainer\" style=\"direction:ltr!important;cursor:default;\"><tr><td rowspan=\"4\" valign=\"top\" style=\"padding-right:15px;padding-left:3px;width: 65px;\"><div style=\"position:relative;height: 100%;display: block;\">' +\n '@@@sourceAvatar' +\n '</div></td><th style=\"vertical-align: middle;\" align=\"left\"><div class=\"mi_resultpublisher\" style=\"color:#838383;\">@@@itemPublisher<span class=\"mi_resulttimeago\" itemDate=\"@@@itemDate\">@@@timeAgo' +\n '</span></div></th></tr><tr><td style=\"padding-right:30px;\"></td></tr>' +\n '<tr><td colspan=\"2\" onclick=\"@@@click\" style=\"cursor: pointer; cursor: hand;\"><div style=\"padding-right:10px;overflow:hidden;position:relative;max-width: 275px;\" class=\"mi_imgcontainer\">' +\n '<div id=\"#mi_image_lightbox_@@@ksid\" '\n //+'onclick=\" jQuery(mi_image_lightbox_@@@ksid).fadeIn();jQuery(\\'#mi_iframe_lightbox_@@@ksid\\').attr(\\'src\\',jQuery(\\'#mi_iframe_lightbox_@@@ksid\\').attr(\\'data-src\\'));\"'\n +\n '><img src=\"@@@itemContentImageURL\" style=\"max-width: @@@itemWidth ;min-width:185px;margin-top: 15px;margin-bottom: 15px;nbox-shadow: 0px 0 10px 4px #eee;float: right!important;border-radius: 2px;display:inline;\"/>' +\n '<img src=\"//d34p6saz4aff9q.cloudfront.net/images/playvideow.png\" style=\"position:absolute;cursor: pointer;left: 50%!important;margin-top: 20%;display:inline;margin-left: -30px;\" '\n //+'nonclick=\"window.MI_logUsage(\\'play_video\\',\\'@@@baseid\\');@@@click\" onerror=\"this.style.display=\\'none\\';\"\n +\n '/></div>'\n //+'<div class=\"mi_lightbox\" id=\"mi_image_lightbox_@@@ksid\" onclick=\"jQuery(\\'#mi_iframe_lightbox_@@@ksid\\').attr(\\'src\\',\\'\\');jQuery(this).fadeOut();\"><iframe id=\"mi_iframe_lightbox_@@@ksid\" data-src=\"@@@sourceURL?autoplay=1&title=0&byline=0&portrait=0\" width=\"500\" height=\"281\" frameborder=\"0\" webkitallowfullscreen mozallowfullscreen allowfullscreen></iframe>'\n //+'</a></div>'\n +\n '</td></tr></table></div>',\n normalItem: '<div style=\"position:relative;\">@@@metaicon<table align=\"left\" class=\"mi_resultcontainer\" @@@cond onclick=\"@@@click\"><tr><td rowspan=\"4\" valign=\"top\" style=\"padding-right:15px;padding-left:3px;width: 65px;\"><div style=\"position:relative;height: 100%;display:block;\">' +\n '@@@item' +\n '</div></td><th style=\"vertical-align: middle;\" align=\"left\"><div class=\"mi_resultpublisher\">@@@itempublisher<span class=\"mi_resulttimeago\" style=\"\"> @@@timeago' +\n '</div></span></th></tr><tr><td style=\"padding-right:30px;\"><div class=\"mi_resulttext\">@@@itemtext',\n instagramItem: '<div style=\"position:relative;\">@@@metaicon<table align=\"left\" class=\"mi_resultcontainer\" @@@cond onclick=\"@@@click\"><tr><td rowspan=\"4\" valign=\"top\" style=\"padding-right:15px;padding-left:3px;width: 65px;\"><div style=\"position:relative;height: 100%;display:block;\">' +\n '@@@item' +\n '</div></td><th style=\"vertical-align: middle;\" align=\"left\"><div class=\"mi_resultpublisher\" style=\"color:#838383;\">@@@itempublisher<span class=\"mi_resulttimeago\"> @@@timeago' +\n '</div></span></th></tr><tr><td style=\"padding-right:30px;\"><div class=\"mi_resulttext\">',\n itemContentImage: '</td></tr><tr><td colspan=\"2\"><div style=\"padding-right:10px;overflow:hidden;\"><img nonload=\"if (!jQuery.MidasInsight.imageIsGood(this)) jQuery.MidasInsight.HandleMissingImage(\\'preview\\',this);\" onerror=\"jQuery.MidasInsight.HandleMissingImage(\\'preview\\',this);\" src=\"@@@itemcontentimage\" style=\"max-width: 275px;margin-top: 0px;margin-bottom: 15px;nbox-shadow: 0px 0 10px 4px #eee;float: right;border-radius: 5px;\"/></div>',\n lightboxContentImage: '</td></tr><tr><td colspan=\"2\"><div style=\"padding-right:10px;overflow:hidden;\"><div id=\"#mi_image_lightbox_@@@ksid\" ><img src=\"@@@itemcontentimage\" style=\"max-width: 275px;margin-top: 0px;margin-bottom: 15px;nbox-shadow: 0px 0 10px 4px #eee; border-radius: 2px;float: left!important;cursor:pointer;\" nonerror=\"jQuery.MidasInsight.HandleMissingImage(\\'preview\\',this);\" nonload=\"if (!jQuery.MidasInsight.imageIsGood(this)) jQuery.MidasInsight.HandleMissingImage(\\'preview\\',this); else ' +\n '{jQuery.MidasInsight.AddtoGallery(\\'@@@kfid\\', { href: \\'@@@itemcontentimage\\', title:\\'\\' });' +\n ' jQuery(this).parent().attr(\\'onclick\\',\\'jQuery.MidasInsight.ShowLightBoxURL(\\\\\\'@@@itemcontentimage\\\\\\',\\\\\\'@@@kfid\\\\\\')\\');}\"></div></div>'\n //<div class=\"mi_lightbox\" id=\"mi_image_lightbox_@@@ksid\" onclick=\"jQuery(this).fadeOut();\"><img src=\"@@@itemcontentimage\" style=\"nbox-shadow: 0px 0 10px 4px #eee;border-radius: 5px;\" onload=\"jQuery(this).css(\\'position\\', \\'relative\\').css(\\'top\\',\\'50%\\').css(\\'margin-top\\',((this.height/2)*-1)+ \\'px\\').css(\\'top\\',\\'50%\\',\\'!important\\');\"/></div></div>'\n }\n }\n }\n\n var langDictionary = {\n EN: {\n scores: ['Lame', 'Fair', 'Okay', 'Good', 'Great!'],\n basedon: 'Based on %d Reviews & Mentions ',\n ask: 'Ask friends for their opinion',\n mentions: 'Mentions <br/>&&nbsp;Reviews',\n media: 'Photos <br/>&&nbsp;Videos',\n facebook: 'Facebook',\n feelter: 'Social <br/>Insights',\n comment: 'Comment',\n back: 'Back',\n insights: 'Insights',\n clickhere: \"CLICK HERE\",\n hoverbuttontext: 'REVIEWS, MENTIONS & PHOTOS',\n rating: 'Rating <span style=\"font-family: \\'Source Sans Pro\\'\">%d</span> Reviews & Mentions',\n translate: 'Translate'\n },\n FR: {\n scores: ['Boiteux', 'Juste', 'Bien', 'Bon', 'Grand!'],\n basedon: 'Basé sur %d Critiques et Mentions ',\n ask: 'Demandez à vos amis pour leur opinion',\n mentions: 'Mentions & Commentaires',\n media: 'Photos & Vidéos',\n facebook: 'Facebook',\n feelter: 'Insights sociaux',\n comment: 'Commentaire',\n back: 'Arrière',\n insights: 'Insights',\n clickhere: \"CLIQUEZ ICI\",\n hoverbuttontext: 'CRITIQUES, MENTIONS ET PHOTOS',\n rating: ' Rating %d Critiques & Commentaires'\n },\n IT: {\n scores: ['Zoppo', 'Fiera', 'Bene', 'Buono', 'Grande!'],\n basedon: 'Sulla base %d Recensioni e Menzioni',\n ask: 'Chiedi amici per il loro parere',\n mentions: 'Menzioni & Recensioni',\n media: 'Foto & Video',\n facebook: 'Facebook',\n feelter: 'Insights Sociali',\n comment: 'Commento',\n back: 'Indietro',\n insights: 'Insights',\n clickhere: \"CLICK HERE\",\n hoverbuttontext: 'REVIEWS, MENTIONS & PHOTOS',\n rating: 'Rating %d Reviews & Mentions'\n },\n DE: {\n scores: ['lahm', 'Messe', 'Okay', 'gut', 'Na Toll!'],\n basedon: 'Basierend auf %d Bewertungen & Mentions ',\n ask: 'Fragen Sie Freunde nach ihrer Meinung',\n mentions: 'Erwähnungen & Reviews',\n media: 'Fotos & Videos',\n facebook: 'Facebook',\n feelter: 'Social Insights',\n comment: 'Kommentar',\n back: 'Der Rücken',\n insights: 'Insights',\n clickhere: \"HIER KLICKEN\",\n hoverbuttontext: 'REZENSIONEN, ERWÄHNUNGEN UND FOTOS',\n rating: 'Bewertung %d Rezensionen und Erwähnungen'\n },\n ES: {\n scores: ['Cojos', 'Justo', 'Bien', 'Bueno', 'Excelente!'],\n basedon: 'Basado en %d Comentarios y Menciones ',\n ask: 'Pregunte a sus amigos para su opinión ',\n mentions: 'Menciones',\n media: 'Medios',\n facebook: 'Facebook',\n feelter: 'Feelter',\n comment: 'comentario',\n back: 'Back',\n clickhere: \"CLIC AQUÍ\",\n hoverbuttontext: ' COMENTARIOS, MENCIONCES Y FOTOS',\n rating: 'Puntuación %d Comentarios Y Menciones'\n },\n HE: {\n scores: ['גרוע', 'סביר', 'טוב', 'טוב מאוד', '!מעולה'],\n basedon: 'מבוסס על %d חוות דעת ',\n ask: 'שתף את החברים ',\n mentions: 'חוות&nbsp;דעת',\n media: '×ª×ž×•× ×•×ª ווידאו',\n facebook: 'פייסבוק',\n feelter: 'Feelter',\n comment: 'תגובה',\n moreInfo: 'מידע × ×•×¡×£',\n back: 'סגור',\n insights: '×ª×•×‘× ×•×ª',\n clickhere: \"לחץ כאן\",\n hoverbuttontext: 'ביקורות, איזכורים ×•×ª×ž×•× ×•×ª',\n rating: 'הדירוג מבוסס על <span style=\"font-family: \\'Source Sans Pro\\'\"> %d </span>ביקורות ואיזכורים',\n translate: 'תרגם'\n },\n CN: {\n scores: ['拉梅', '公平', '好吧', '好', '太好了!'],\n basedon: '基于%d个评论与说起 ',\n ask: '问朋友他们的意见 ',\n mentions: '说起 ',\n media: '媒体 ',\n facebook: 'Facebookçš„ ',\n feelter: 'Feelter',\n comment: '评论}',\n back: 'Back',\n clickhere: \"CLICK HERE\",\n hoverbuttontext: 'REVIEWS, MENTIONS & PHOTOS',\n rating: 'Rating %d Reviews & Mentions'\n },\n AR: {\n scores: ['عرجاء', 'معرض', 'حسنا،', 'جيدة', 'عظيم!'],\n basedon: 'استنادا %d الآراء Ùˆ التنويهات ',\n ask: ' نسأل الاصدقاء عن رأيهم ',\n mentions: ' يذكر ',\n media: ' الصور ',\n facebook: ' الفيسبوك ',\n feelter: ' Feelter ',\n comment: ' تعليق',\n back: 'Back',\n clickhere: \"CLICK HERE\",\n hoverbuttontext: 'REVIEWS, MENTIONS & PHOTOS',\n rating: 'Rating %d Reviews & Mentions'\n },\n CS: {\n scores: ['Příšerné', 'Uspokojivé', 'PrůmÄ›rné', 'Dobré', 'Vynikající'],\n basedon: 'Na základÄ› %d hodnocení a zmínek',\n ask: 'Zeptej se přítele na jeho názor',\n mentions: 'Hodnocení a zmínky',\n media: 'Fotky a videa ',\n facebook: 'Facebook',\n feelter: ' Feelter ',\n comment: 'Komentář',\n back: 'ZpÄ›t',\n clickhere: \"Klikni zde\",\n hoverbuttontext: 'Názory, zmínky a fotky',\n rating: 'Hodnocení %d názory a zmínky',\n translate: 'pÅ™eložit'\n },\n PL: {\n scores: ['Okropnie', 'Źle', 'Åšredni', 'Bardzo Dobrze', 'Doskonale'],\n basedon: 'Bazowane na %d Opiniach',\n ask: 'Zapytaj znajomych o opiniÄ™',\n mentions: 'Wzmianki i Opinie',\n media: 'Filmy i ZdjÄ™cia',\n facebook: 'Facebook',\n feelter: ' Feelter',\n comment: 'komentarz',\n back: 'z powrotem',\n clickhere: \"kliknij tutaj\",\n hoverbuttontext: 'Opinie, Wzmianki i ZdjÄ™cia',\n rating: 'Ranking %d Wzmianek i Opini',\n translate: 'tÅ‚umaczyć'\n },\n SK: {\n scores: ['Hrozné', 'Uspokojivé', 'Priemerné', 'Dobré', 'Výborné'],\n basedon: 'Na základe %d hodnotení a zmienok',\n ask: 'Spýtaj sa priateľa na jeho názor',\n mentions: 'Zmienky a hodnotenia',\n media: 'Fotky a videá',\n facebook: 'Facebook',\n feelter: ' Feelter',\n comment: 'Komentár',\n back: 'Späť',\n clickhere: \"Klikni tu\",\n hoverbuttontext: 'Opinie, Wzmianki i ZdjÄ™cia',\n rating: 'Hodnotenie %d názory a zmienky',\n translate: 'PreložiÅ¥'\n }\n };\n\n window.langDictionary = langDictionary;\n\n\n // Constructs an object from a query string\n // in the format of key=value&key2=value2\n function parseQuery(query) {\n var Params = new Object();\n if (!query) return Params; // return empty object\n var Pairs = unescape(query).split('&');\n for (var i = 0; i < Pairs.length; i++) {\n if (Pairs[i].indexOf('=') == -1) continue;\n var key = Pairs[i].substr(0, Pairs[i].indexOf('='));\n var val = Pairs[i].substr(Pairs[i].indexOf('=') + 1);\n val = val.replace(/\\+/g, ' ');\n Params[key] = val;\n }\n return Params;\n }\n\n // parse parameters from script source\n var myScript = req.url;\n var queryString = req.query;//(typeof myScript == 'undefined' || typeof myScript.src == 'undefined') ? '' : myScript.src.replace(/^[^\\?]+\\??/, '');\n\n var params = parseQuery(queryString);\n //res.write('zzzz'+queryString+' '+ JSON.stringify(queryString));\n \n window.MI_defaults = extend({}, window.MI_defaults, queryString)\n if (typeof window.MI_defaults.feedback != 'undefined') window.MI_defaults.inqa = window.MI_defaults.feedback;\n\n //get template from html if availasble\n if (!(typeof mi_template === \"undefined\")) {\n window.tempDictionary[window.MI_defaults.template].panelLayout = mi_template.panelLayout;\n }\n if (typeof window.MI_defaults.panelLayout == \"string\") try {\n window.MI_defaults.panelLayout = JSON.parse(window.MI_defaults.panelLayout.replace(/'/g, '\"'));\n }\n catch (e) {}\n if (!(typeof window.MI_defaults.panelLayout === \"undefined\")) {\n window.tempDictionary[window.MI_defaults.template].panelLayout = window.MI_defaults.panelLayout;\n }\n if (typeof window.MI_defaults.frameElements == \"string\") try {\n window.MI_defaults.frameElements = JSON.parse(window.MI_defaults.frameElements.replace(/'/g, '\"'));\n }\n catch (e) {}\n if (typeof window.MI_defaults.tabs == \"string\") try {\n window.MI_defaults.tabs = JSON.parse(window.MI_defaults.tabs.replace(/'/g, '\"'));\n }\n catch (e) {}\n if (typeof window.MI_defaults.ex == \"string\") try {\n window.MI_defaults.ex = JSON.parse(window.MI_defaults.ex.replace(/'/g, '\"'));\n }\n catch (e) {}\n if (typeof window.MI_defaults.panelLayout == 'undefined') window.MI_defaults.panelLayout = {};\n if (typeof window.MI_defaults.panelLayout.flags == 'undefined') window.MI_defaults.panelLayout.flags = [];\n if (typeof window.MI_defaults.panelLayout.flags == \"string\") try {\n window.MI_defaults.panelLayout.flags = JSON.parse(window.MI_defaults.panelLayout.flags.replace(/'/g, '\"'));\n }\n catch (e) {}\n if (typeof window.langDictionary[window.MI_defaults.lang] == 'undefined') window.MI_defaults.lang = 'EN';\n\n if (typeof window.langDictionary[window.MI_defaults.lang] == 'undefined')\n window.langDictionary[window.MI_defaults.lang] = extend({}, langDictionary['EN'], window.langDictionary[window.MI_defaults.lang]);\n\n //exclude tripadvisor\n if (typeof window.MI_defaults.ex == 'undefined') {\n window.MI_defaults.ex = [];\n }\n window.MI_defaults.ex.push(3);\n window.MI_defaults.ex.push(24);\n switch (window.MI_defaults.lang) {\n case 'AR':\n window.MI_defaults.RTL = 'true';\n window.MI_defaults.gaugeOrientation = 'right';\n break;\n }\n window.MI_defaults.minPanelWidth = window.MI_defaults.layout == \"inlinepanel\" ? 750 : 485;\n window.MI_defaults.panelWidth = window.MI_defaults.template == 'RASTA' ? window.MI_defaults.minPanelWidth : 386;\n\n if (typeof String.prototype.camelCase !== 'function') {\n String.prototype.camelCase = function() {\n return this.toLowerCase().replace(/-(.)/g, function(match, group1) {\n return group1.toUpperCase();\n });\n }\n }\n if (typeof String.prototype.trim !== 'function') {\n String.prototype.trim = function() {\n return this.replace(/^\\s+|\\s+$/g, '');\n }\n }\n\n if (typeof String.prototype.trim !== 'function') {\n String.prototype.trim = function() {\n return this.replace(/^\\s+|\\s+$/g, '');\n }\n }\n String.prototype.capitalize = function() {\n return this.replace(/((?:^|\\s(?!and)(?!or)(?!of)(?!the)(?!\\bat\\b))\\S)/g, function(a) {\n return a.toUpperCase();\n }).replace(/\\b\\S\\S$/g, function(a) {\n return a.toUpperCase();\n });\n };\n\n if (!Object.keys) {\n Object.keys = function(obj) {\n var keys = [];\n\n for (var i in obj) {\n if (obj.hasOwnProperty(i)) {\n keys.push(i);\n }\n }\n return keys;\n };\n }\n if (typeof console == \"undefined\") {\n this.console = {\n log: function() {}\n };\n }\n\n if (!Array.prototype.map) {\n Array.prototype.map = function(fun) {\n var t = Object(this);\n var len = t.length >>> 0;\n var res = new Array(len);\n var thisArg = arguments.length >= 2 ? arguments[1] : void 0;\n for (var i = 0; i < len; i++) {\n if (i in t)\n res[i] = fun.call(thisArg, t[i], i, t);\n }\n return res;\n };\n }\n\n Array.maxProp = function(array, prop) {\n var values = array.map(function(el) {\n return el[prop];\n });\n return Math.max.apply(Math, values);\n };\n Array.minProp = function(array, prop) {\n var values = array.map(function(el) {\n return el[prop];\n });\n return Math.min.apply(Math, values);\n };\n String.prototype.format = function() {\n var formatted = this;\n for (var i = 0; i < arguments.length; i++) {\n var regexp = new RegExp('\\\\{' + i + '\\\\}', 'gi');\n formatted = formatted.replace(regexp, arguments[i]);\n }\n return formatted;\n };\n\n\n // initiate logging parameters and create \n // on-screen log if in debug mode\n window.MI_logState = '';\n window.MI_logDetails = '';\n window.MI_logKey = '';\n window.MI_logLast = new Date();\n window.MI_scrollLast = new Date(1970, 1, 1);\n window.MI_queuedLoggingEvents = '';\n if (typeof(window.MI_defaults.debug) != 'undefined' && window.MI_defaults.debug == 'true') {\n jQuery('<div id=\"MI_onScreenLog\" style=\"padding:5px;overflow:hidden;z-index:999;position:fixed;right:10px;top:10px;width:200px;bottom:10px;border-radius:5px;border:1px solid #333;background:#aaa;background:rgba(0,0,0,0.5);color:white;\"><div class=\"mi-logCaption\" style=\"background:#aaa;margin:-10px -10px 10px -10px;padding:10px;color:#333;\" ><strong style=\"color: white;\">Debug-Mode Log</strong><br><div style=\"box-shadow: 0px 0px 5px gray;background-color: white;border: 1px solid #7D7D7D;border-radius: 4px;padding: 5px;margin-top: 5px;font-size: 11px;color: #999;\">This log is only displayed on debug mode.To stop showing It, Remove the \"debug=true\" parameter from your script reference or hash tag.</div></div>').appendTo(\"body\");\n }\n else if (typeof(window.MI_defaults.hidden) != 'undefined' && window.MI_defaults.hidden == 'true') {\n return;\n }\n\n window.misstimer = 0;\n }", "static Setup(options) {\n return Part_1.Part.Setup(options);\n }", "static Setup(options) {\n return Part_1.Part.Setup(options);\n }", "function Plugin( element, options ) {\n this.element = element;\n // jQuery has an extend method that merges the\n // contents of two or more objects, storing the\n // result in the first object. The first object\n // is generally empty because we don't want to alter\n // the default options for future instances of the plugin\n this.options = $.extend( {}, defaults, options) ;\n this._defaults = defaults;\n this._name = pluginName;\n this.init();\n }" ]
[ "0.55730325", "0.55157", "0.54918987", "0.547899", "0.547899", "0.547899", "0.544979", "0.5436934", "0.5427202", "0.5412018", "0.5412018", "0.5381513", "0.53796583", "0.5375553", "0.5360351", "0.5357939", "0.5339359", "0.5329402", "0.53237975", "0.52955747", "0.5291243", "0.52892834", "0.5286038", "0.527981", "0.52794284", "0.52761614", "0.5275803", "0.5275356", "0.5273848", "0.5271795", "0.5264981", "0.5264719", "0.52568626", "0.52557635", "0.52557635", "0.5255334", "0.52525526", "0.5250537", "0.52407026", "0.52301973", "0.5221058", "0.5220199", "0.5216657", "0.52145046", "0.52145046", "0.52139294", "0.52139294", "0.5209374", "0.5206348", "0.52053547", "0.5202971", "0.5196445", "0.51918745", "0.5191793", "0.51916045", "0.51905864", "0.51905864", "0.518448", "0.51834613", "0.5182867", "0.51729345", "0.5170595", "0.5167687", "0.51560545", "0.51505953", "0.51505953", "0.5150044", "0.5150044", "0.5147719", "0.51445436", "0.5141204", "0.5138338", "0.51381433", "0.51321125", "0.51293886", "0.51281065", "0.5121573", "0.5121573", "0.51183254", "0.51145715", "0.5113934", "0.5113934", "0.51128995", "0.51128995", "0.51128995", "0.51128995", "0.5112509", "0.5107516", "0.5103753", "0.5101706", "0.5099874", "0.5098153", "0.5096488", "0.50931513", "0.50931513", "0.50904334" ]
0.52915937
24
Parse a file (in string or VFile representation) into a Unist node using the `Parser` on the processor.
function parse(doc) { var file = vfile(doc) var Parser freeze() Parser = processor.Parser assertParser('parse', Parser) if (newable(Parser)) { return new Parser(String(file), file).parse() } return Parser(String(file), file) // eslint-disable-line new-cap }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function Parser(doc, file) {\n this.file = file;\n this.offset = {};\n this.options = xtend(this.options);\n this.setOptions({});\n\n this.inList = false;\n this.inBlock = false;\n this.inLink = false;\n this.atStart = true;\n\n this.toOffset = vfileLocation(file).toOffset;\n this.unescape = unescape(this, 'escape');\n this.decode = decode(this);\n}", "function parse( file ) {\n\t\treturn __awaiter( this, void 0, void 0, function () {\n\t\t\treturn __generator( this, function ( _a ) {\n\t\t\t\treturn [\n\t\t\t\t\t2,\n\t\t\t\t\t/*return*/\n\t\t\t\t\tnew Promise( function ( resolve, reject ) {\n\t\t\t\t\t\tfs.readFile( file, 'utf8', function ( err, data ) {\n\t\t\t\t\t\t\tif ( err ) {\n\t\t\t\t\t\t\t\treject( err );\n\t\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\tresolve( parseString( data ) );\n\t\t\t\t\t\t} );\n\t\t\t\t\t} ),\n\t\t\t\t];\n\t\t\t} );\n\t\t} );\n\t}", "function parse() {\n var self = this\n var value = String(self.file)\n var start = {line: 1, column: 1, offset: 0}\n var content = xtend(start)\n var node\n\n // Clean non-unix newlines: `\\r\\n` and `\\r` are all changed to `\\n`.\n // This should not affect positional information.\n value = value.replace(lineBreaksExpression, lineFeed)\n\n // BOM.\n if (value.charCodeAt(0) === 0xfeff) {\n value = value.slice(1)\n\n content.column++\n content.offset++\n }\n\n node = {\n type: 'root',\n children: self.tokenizeBlock(value, content),\n position: {start: start, end: self.eof || xtend(start)}\n }\n\n if (!self.options.position) {\n removePosition(node, true)\n }\n\n return node\n}", "function parse(file) {\n return __awaiter(this, void 0, void 0, function () {\n return __generator(this, function (_a) {\n return [2\n /*return*/\n , new Promise(function (resolve, reject) {\n fs.readFile(file, 'utf8', function (err, data) {\n if (err) {\n reject(err);\n return;\n }\n\n resolve(parseString(data));\n });\n })];\n });\n });\n }", "function parse(doc) {\n var file = vfile(doc)\n var Parser\n\n freeze()\n Parser = processor.Parser\n assertParser('parse', Parser)\n\n if (newable(Parser, 'parse')) {\n return new Parser(String(file), file).parse()\n }\n\n return Parser(String(file), file) // eslint-disable-line new-cap\n }", "function parse(doc) {\n var file = vfile(doc)\n var Parser\n\n freeze()\n Parser = processor.Parser\n assertParser('parse', Parser)\n\n if (newable(Parser, 'parse')) {\n return new Parser(String(file), file).parse()\n }\n\n return Parser(String(file), file) // eslint-disable-line new-cap\n }", "function parse(doc) {\n var file = vfile(doc)\n var Parser\n\n freeze()\n Parser = processor.Parser\n assertParser('parse', Parser)\n\n if (newable(Parser, 'parse')) {\n return new Parser(String(file), file).parse()\n }\n\n return Parser(String(file), file) // eslint-disable-line new-cap\n }", "function parse(doc) {\n var file = vfile(doc);\n var Parser;\n\n freeze();\n Parser = processor.Parser;\n assertParser('parse', Parser);\n\n if (newable(Parser, 'parse')) {\n return new Parser(String(file), file).parse()\n }\n\n return Parser(String(file), file) // eslint-disable-line new-cap\n }", "function parse(doc) {\n var file = vfile(doc);\n var Parser;\n\n freeze();\n Parser = processor.Parser;\n assertParser('parse', Parser);\n\n if (newable(Parser)) {\n return new Parser(String(file), file).parse();\n }\n\n return Parser(String(file), file); // eslint-disable-line new-cap\n }", "function parse() {\n var self = this;\n var value = String(self.file);\n var start = {line: 1, column: 1, offset: 0};\n var content = xtend(start);\n var node;\n\n /* Clean non-unix newlines: `\\r\\n` and `\\r` are all\n * changed to `\\n`. This should not affect positional\n * information. */\n value = value.replace(EXPRESSION_LINE_BREAKS, C_NEWLINE);\n\n if (value.charCodeAt(0) === 0xFEFF) {\n value = value.slice(1);\n\n content.column++;\n content.offset++;\n }\n\n node = {\n type: 'root',\n children: self.tokenizeBlock(value, content),\n position: {\n start: start,\n end: self.eof || xtend(start)\n }\n };\n\n if (!self.options.position) {\n removePosition(node, true);\n }\n\n return node;\n}", "function parse() {\n var self = this;\n var value = String(self.file);\n var start = {line: 1, column: 1, offset: 0};\n var content = xtend(start);\n var node;\n\n /* Clean non-unix newlines: `\\r\\n` and `\\r` are all\n * changed to `\\n`. This should not affect positional\n * information. */\n value = value.replace(EXPRESSION_LINE_BREAKS, C_NEWLINE);\n\n if (value.charCodeAt(0) === 0xFEFF) {\n value = value.slice(1);\n\n content.column++;\n content.offset++;\n }\n\n node = {\n type: 'root',\n children: self.tokenizeBlock(value, content),\n position: {\n start: start,\n end: self.eof || xtend(start)\n }\n };\n\n if (!self.options.position) {\n removePosition(node, true);\n }\n\n return node;\n}", "function parse() {\n var self = this;\n var value = String(self.file);\n var start = {line: 1, column: 1, offset: 0};\n var content = xtend(start);\n var node;\n\n /* Clean non-unix newlines: `\\r\\n` and `\\r` are all\n * changed to `\\n`. This should not affect positional\n * information. */\n value = value.replace(EXPRESSION_LINE_BREAKS, C_NEWLINE);\n\n if (value.charCodeAt(0) === 0xFEFF) {\n value = value.slice(1);\n\n content.column++;\n content.offset++;\n }\n\n node = {\n type: 'root',\n children: self.tokenizeBlock(value, content),\n position: {\n start: start,\n end: self.eof || xtend(start)\n }\n };\n\n if (!self.options.position) {\n removePosition(node, true);\n }\n\n return node;\n}", "function parse() {\n var self = this;\n var value = String(self.file);\n var start = {line: 1, column: 1, offset: 0};\n var content = xtend(start);\n var node;\n\n /* Clean non-unix newlines: `\\r\\n` and `\\r` are all\n * changed to `\\n`. This should not affect positional\n * information. */\n value = value.replace(EXPRESSION_LINE_BREAKS, C_NEWLINE);\n\n if (value.charCodeAt(0) === 0xFEFF) {\n value = value.slice(1);\n\n content.column++;\n content.offset++;\n }\n\n node = {\n type: 'root',\n children: self.tokenizeBlock(value, content),\n position: {\n start: start,\n end: self.eof || xtend(start)\n }\n };\n\n if (!self.options.position) {\n removePosition(node, true);\n }\n\n return node;\n}", "function parse() {\n var self = this;\n var value = String(self.file);\n var start = {line: 1, column: 1, offset: 0};\n var content = xtend(start);\n var node;\n\n /* Clean non-unix newlines: `\\r\\n` and `\\r` are all\n * changed to `\\n`. This should not affect positional\n * information. */\n value = value.replace(EXPRESSION_LINE_BREAKS, C_NEWLINE);\n\n if (value.charCodeAt(0) === 0xFEFF) {\n value = value.slice(1);\n\n content.column++;\n content.offset++;\n }\n\n node = {\n type: 'root',\n children: self.tokenizeBlock(value, content),\n position: {\n start: start,\n end: self.eof || xtend(start)\n }\n };\n\n if (!self.options.position) {\n removePosition(node, true);\n }\n\n return node;\n}", "function parse() {\n var self = this;\n var value = String(self.file);\n var start = {line: 1, column: 1, offset: 0};\n var content = xtend(start);\n var node;\n\n /* Clean non-unix newlines: `\\r\\n` and `\\r` are all\n * changed to `\\n`. This should not affect positional\n * information. */\n value = value.replace(EXPRESSION_LINE_BREAKS, C_NEWLINE);\n\n if (value.charCodeAt(0) === 0xFEFF) {\n value = value.slice(1);\n\n content.column++;\n content.offset++;\n }\n\n node = {\n type: 'root',\n children: self.tokenizeBlock(value, content),\n position: {\n start: start,\n end: self.eof || xtend(start)\n }\n };\n\n if (!self.options.position) {\n removePosition(node, true);\n }\n\n return node;\n}", "function parse(file: string): ParserReturn {\n if (file.match(/\\.tsx?$/)) {\n return TypeScriptParser.parse(file);\n } else {\n return babylonParser(file);\n }\n}", "function treeForFile (file) {\n var contents = null\n try {\n contents = fs.readFileSync(file).toString()\n } catch (err) {\n if (err.code === 'ENOENT') {\n logger.error(\"File not found: \"+file)\n process.exit(1)\n }\n throw err\n }\n var name = path.basename(file),\n parser = new Parser()\n\n parser.file = name\n // Parse and type-check the file; catch and report any errors\n try {\n var tree = parser.parse(contents),\n typesystem = new TypeSystem()\n typesystem.walk(tree)\n } catch (err) {\n reportError(err)\n process.exit(1)\n }\n return tree\n}// treeForFile", "function parse(context, file) {\n var message\n\n if (stats(file).fatal) {\n return\n }\n\n if (context.treeIn) {\n debug('Not parsing already parsed document')\n\n try {\n context.tree = json(file.toString())\n } catch (error) {\n message = file.message(\n new Error('Cannot read file as JSON\\n' + error.message)\n )\n message.fatal = true\n }\n\n // Add the preferred extension to ensure the file, when serialized, is\n // correctly recognised.\n // Only add it if there is a path — not if the file is for example stdin.\n if (file.path) {\n file.extname = context.extensions[0]\n }\n\n file.contents = ''\n\n return\n }\n\n debug('Parsing `%s`', file.path)\n\n context.tree = context.processor.parse(file)\n\n debug('Parsed document')\n}", "function parseFile(fileToParse){\n var fs = require('fs');\n var decodedFile = {};\n\n var toDecode = fs.readFileSync(fileToParse);\n\n // pass the byte array into _parse for decoding\n decodedFile = _parse(toDecode).result;\n\n return decodedFile;\n}", "function decodeFile(input) {\n let ondata = (evt, cb) => {\n if (evt.data[0] == 0) {\n cb({raw: evt.data.subarray(1), links: [], data: evt.data.subarray(1)})\n } else if (evt.data[0] == 1) {\n try {\n let node = dagPB.util.deserialize(evt.data.subarray(1))\n\n let file = Unixfs.unmarshal(node.Data)\n if (file.type != \"raw\" && file.type != \"file\") {\n throw new Error(\"got unexpected file type, wanted raw or file\")\n }\n if (file.data == null) {\n file.data = Buffer.alloc(0)\n }\n\n cb({raw: evt.data.subarray(1), links: node.Links, data: file.data})\n } catch (err) {\n cb(null, err)\n }\n } else {\n cb(null, new Error(\"failed to decode a chunk of file data\"))\n }\n }\n\n return asynchronous(input, ondata)\n}", "function Parser(f) {\n this.parse = f;\n }", "function parseFile(file, successCallback, errorCallback) {\n let r = new FileReader();\n\n r.onload = e => {\n // load the contents of the file into `contents`\n let contents = e.target.result;\n successCallback(contents);\n };\n\n r.onerror = errorCallback;\n\n r.readAsText(file);\n}", "function parse$a(context, file) {\n var message;\n\n if (stats$5(file).fatal) {\n return\n }\n\n if (context.treeIn) {\n debug$8('Not parsing already parsed document');\n\n try {\n context.tree = json$1(file.toString());\n } catch (error) {\n message = file.message(\n new Error('Cannot read file as JSON\\n' + error.message)\n );\n message.fatal = true;\n }\n\n // Add the preferred extension to ensure the file, when serialized, is\n // correctly recognised.\n // Only add it if there is a path — not if the file is for example stdin.\n if (file.path) {\n file.extname = context.extensions[0];\n }\n\n file.contents = '';\n\n return\n }\n\n debug$8('Parsing `%s`', file.path);\n\n context.tree = context.processor.parse(file);\n\n debug$8('Parsed document');\n}", "function parseDocument(file) {\n const inputString = fs.readFileSync(file, 'utf-8');\n return DocumentParser.parse(inputString);\n}", "function parseLine(line) {\n const groups = line.match(RE_LINE);\n if (groups === null) {\n return undefined;\n }\n const name = groups[5];\n if (name === \".\" || name === \"..\") { // Ignore parent directory links\n return undefined;\n }\n const file = new FileInfo_1.FileInfo(name);\n const fileType = groups[3];\n if (fileType === \"<DIR>\") {\n file.type = FileInfo_1.FileType.Directory;\n file.size = 0;\n }\n else {\n file.type = FileInfo_1.FileType.File;\n file.size = parseInt(groups[4], 10);\n }\n file.rawModifiedAt = groups[1] + \" \" + groups[2];\n return file;\n}", "function parseFile(file) {\n\n if (window.File && window.FileReader && Window.FileList && window.Blob) {\n alert(\"File Reader APIs not up to date on current browser.\")\n return\n }\n \n //create file reader \n var reader = new FileReader()\n\n\n if(file.files && file.files[0]) {\n reader.onload = function (e) {\n parseInput(e.target.result)\n }\n\n reader.readAsText(file.files[0])\n }\n else {\n alert(\"Error reading file.\")\n }\n\n}", "function parseLine(line) {\n const groups = line.match(RE_LINE);\n if (groups === null) {\n return undefined;\n }\n const name = groups[21];\n if (name === \".\" || name === \"..\") { // Ignore parent directory links\n return undefined;\n }\n const file = new FileInfo_1.FileInfo(name);\n file.size = parseInt(groups[18], 10);\n file.user = groups[16];\n file.group = groups[17];\n file.hardLinkCount = parseInt(groups[15], 10);\n file.rawModifiedAt = groups[19] + \" \" + groups[20];\n file.permissions = {\n user: parseMode(groups[4], groups[5], groups[6]),\n group: parseMode(groups[8], groups[9], groups[10]),\n world: parseMode(groups[12], groups[13], groups[14]),\n };\n // Set file type\n switch (groups[1].charAt(0)) {\n case \"d\":\n file.type = FileInfo_1.FileType.Directory;\n break;\n case \"e\": // NET-39 => z/OS external link\n file.type = FileInfo_1.FileType.SymbolicLink;\n break;\n case \"l\":\n file.type = FileInfo_1.FileType.SymbolicLink;\n break;\n case \"b\":\n case \"c\":\n file.type = FileInfo_1.FileType.File; // TODO change this if DEVICE_TYPE implemented\n break;\n case \"f\":\n case \"-\":\n file.type = FileInfo_1.FileType.File;\n break;\n default:\n // A 'whiteout' file is an ARTIFICIAL entry in any of several types of\n // 'translucent' filesystems, of which a 'union' filesystem is one.\n file.type = FileInfo_1.FileType.Unknown;\n }\n // Separate out the link name for symbolic links\n if (file.isSymbolicLink) {\n const end = name.indexOf(\" -> \");\n if (end !== -1) {\n file.name = name.substring(0, end);\n file.link = name.substring(end + 4);\n }\n }\n return file;\n}", "function LevelParser(filename) {\n //Engine.Object.call(this);\n this.filename = filename;\n }", "function SceneFileParser(sceneFilePath, type) {\n if (type === \"XML\") {\n this.mScene = gEngine.ResourceMap.retrieveAsset(sceneFilePath);\n }\n if (type === \"JSON\") {\n var jsonString = gEngine.ResourceMap.retrieveAsset(sceneFilePath);\n var sceneInfo = JSON.parse(jsonString);\n this.mScene = sceneInfo;\n }\n if (type === \"SMALL\") {\n var jsonString = gEngine.ResourceMap.retrieveAsset(sceneFilePath);\n var sceneInfo = JSON.parse(jsonString);\n this.mScene = sceneInfo; \n }\n}", "function BinaryParser() {}", "function BinaryParser() {}", "function BinaryParser() {}", "function BinaryParser() {}", "function BinaryParser() {}", "function file_load(file, callback) {\n\tif (!file) return; // No file found.\n\n\tlet reader = new FileReader();\n\n\treader.onload = event => callback(sched_parse(\n\t\tevent.target.result\n\t), file.path);\n\n\treader.readAsText(file);\n}", "parseFlsFile(baseFile) {\r\n this.extension.logger.addLogMessage('Parse fls file.');\r\n const rootDir = path.dirname(baseFile);\r\n const outDir = this.getOutDir(baseFile);\r\n const flsFile = path.resolve(rootDir, path.join(outDir, path.basename(baseFile, '.tex') + '.fls'));\r\n if (!fs.existsSync(flsFile)) {\r\n this.extension.logger.addLogMessage(`Cannot find fls file: ${flsFile}`);\r\n return;\r\n }\r\n this.extension.logger.addLogMessage(`Fls file found: ${flsFile}`);\r\n const ioFiles = this.parseFlsContent(fs.readFileSync(flsFile).toString(), rootDir);\r\n ioFiles.input.forEach((inputFile) => {\r\n // Drop files that are also listed as OUTPUT or should be ignored\r\n if (ioFiles.output.includes(inputFile) ||\r\n this.isExcluded(inputFile) ||\r\n !fs.existsSync(inputFile)) {\r\n return;\r\n }\r\n // Drop the current rootFile often listed as INPUT and drop any file that is already in the texFileTree\r\n if (baseFile === inputFile || inputFile in this.cachedContent) {\r\n return;\r\n }\r\n if (path.extname(inputFile) === '.tex') {\r\n // Parse tex files as imported subfiles.\r\n this.cachedContent[baseFile].children.push({\r\n index: Number.MAX_VALUE,\r\n file: inputFile\r\n });\r\n this.parseFileAndSubs(inputFile);\r\n }\r\n else if (this.fileWatcher && !this.filesWatched.includes(inputFile)) {\r\n // Watch non-tex files.\r\n this.fileWatcher.add(inputFile);\r\n this.filesWatched.push(inputFile);\r\n }\r\n });\r\n ioFiles.output.forEach((outputFile) => {\r\n if (path.extname(outputFile) === '.aux' && fs.existsSync(outputFile)) {\r\n this.parseAuxFile(fs.readFileSync(outputFile).toString(), path.dirname(outputFile).replace(outDir, rootDir));\r\n }\r\n });\r\n }", "function Parser(filename, scene) {\n this.loadedOk = null;\n\n // Establish bidirectional references between scene and graph\n this.scene = scene;\n scene.graph = this;\n\n this.nodes = [];\n\n this.idRoot = null; // The id of the root element.\n\n this.axisCoords = [];\n this.axisCoords['x'] = [1, 0, 0];\n this.axisCoords['y'] = [0, 1, 0];\n this.axisCoords['z'] = [0, 0, 1];\n\n // File reading\n this.reader = new CGFXMLreader();\n\n /*\n * Read the contents of the xml file, and refer to this class for loading and error handlers.\n * After the file is read, the reader calls onXMLReady on this object.\n * If any error occurs, the reader calls onXMLError on this object, with an error message\n */\n\n this.reader.open('scenes/' + filename, this);\n}", "function parseFile(path, cvt, cb) {\n if (cvt == null) cvt = adapter;\n fs.readFile(path, (err, data) => {\n if (err) return cb(err);\n xml2js.parseString(data, (err, data) => {\n if (err) return cb(err);\n if (! data) return cb(null, null);\n const key = Object.keys(data)[0];\n if (! key) return cb(null, null);\n cb(null, cvt(data[key], key));\n });\n });\n}", "parseFileAndSubs(file, onChange = false) {\r\n if (this.isExcluded(file)) {\r\n this.extension.logger.addLogMessage(`Ignoring ${file}`);\r\n return;\r\n }\r\n this.extension.logger.addLogMessage(`Parsing ${file}`);\r\n if (this.fileWatcher && !this.filesWatched.includes(file)) {\r\n // The file is first time considered by the extension.\r\n this.fileWatcher.add(file);\r\n this.filesWatched.push(file);\r\n }\r\n const content = this.getDirtyContent(file, onChange);\r\n this.cachedContent[file].children = [];\r\n this.cachedContent[file].bibs = [];\r\n this.cachedFullContent = undefined;\r\n this.parseInputFiles(content, file);\r\n this.parseBibFiles(content, file);\r\n // We need to parse the fls to discover file dependencies when defined by TeX macro\r\n // It happens a lot with subfiles, https://tex.stackexchange.com/questions/289450/path-of-figures-in-different-directories-with-subfile-latex\r\n this.parseFlsFile(file);\r\n }", "async processXmlFile(xmlFile) {\n const response = await fetch(xmlFile);\n const xmlData = await response.text();\n\n const parser = new DOMParser();\n const doc = parser.parseFromString(xmlData, \"text/xml\");\n\n this.processDoc(xmlFile, doc);\n }", "function readFile() {\n\t\tlet reader = new FileReader();\n\t\treader.addEventListener('loadend', () => {\n\t\t\tparseFile(reader.result);\n\t\t});\n\t\treader.readAsText(this.files[0]);\n\t}", "function makeParser(filename, style)\n{\n if (style === undefined) style = \"file_input\";\n var p = new Parser(SkulptParseTables);\n p.setup(SkulptParseTables.symbol2number[style]);\n var curIndex = 0;\n var lineno = 1;\n var column = 0;\n var prefix = \"\";\n var tokenizer = new Tokenizer(filename, function(type, value, start, end, line)\n {\n //print(JSON.stringify([type, value, start, end, line]));\n var s_lineno = start[0];\n var s_column = start[1];\n /*\n if (s_lineno !== lineno && s_column !== column)\n {\n // todo; update prefix and line/col\n }\n */\n if (type === T_COMMENT || type === T_NL)\n {\n prefix += value;\n lineno = end[0];\n column = end[1];\n if (value[value.length - 1] === \"\\n\")\n {\n lineno += 1;\n column = 0;\n }\n return undefined;\n }\n if (type === T_OP)\n {\n type = SkulptOpMap[value];\n }\n if (p.addtoken(type, value, [start, end, line]))\n {\n return true;\n }\n });\n return function(line)\n {\n var ret = tokenizer.generateTokens(line);\n //print(\"tok:\"+ret);\n if (ret)\n {\n if (ret !== \"done\")\n throw \"ParseError: incomplete input\";\n return p.rootnode;\n }\n return false;\n };\n}", "function parse(file) {\n let names = [];\n let parts = file.split(':');\n parts[0].split('\\n').forEach(function(line) {\n if (line !== '') {\n names.push(line.split(',')[0]);\n }\n });\n let n = -1;\n parts[1].split('\\n').forEach(function(line) {\n if (n >= 0) {\n data[names[n]] = line;\n }\n n++;\n });\n}", "function parseFile(filePath) {\n return new Promise((resolve, reject) => {\n fs.readFile(filePath, 'utf8', (err, data) => {\n if (err) {\n reject(err.toString());\n return;\n }\n if (!frontMatter.test(data)) {\n resolve();\n return;\n }\n const matter = frontMatter(data);\n matter.attributes.__src = filePath;\n resolve(matter);\n });\n });\n}", "function parseFile(fileUpload) {\n\n //Add error handling here.\n var status = 'good';\n \n \n //TODO: Insert parsing code here\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n //TODO: Insert parsing code here\n let glFile = csvGenerator(),\n wideFile = csvGenerator(),\n longFile = csvGenerator()\n \n if (status === 'good') {\n return {\n GL: glFile,\n Workorders_Wide: wideFile,\n Workorders_Long: longFile\n };\n } else {\n return null;\n }\n \n}", "static fromFile(file){\n return new IteratorFlow(FlowFactory.createIteratorFromFileSystem(file));\n }", "function parseFile(fileType, e) {\n var content = e.target.result;\n if (fileType.match('text/html')) {\n var dummy = document.createElement('div');\n dummy.innerHTML = content;\n appendContent(dummy.querySelector('.slides').innerHTML);\n } else {\n var img = new Image();\n img.src = e.target.result;\n document.querySelector('.present').appendChild(img); // FIXME\n }\n}", "function parseFile(fileType, e) {\n var content = e.target.result;\n if (fileType.match('text/html')) {\n var dummy = document.createElement('div');\n dummy.innerHTML = content;\n appendContent(dummy.querySelector('.slides').innerHTML);\n } else {\n var img = new Image();\n img.src = e.target.result;\n document.querySelector('.present').appendChild(img); // FIXME\n }\n}", "async load (filename) {\n const xml = await fs.readFile(filename, { encoding: \"utf8\" })\n this.options.log(2, `loading XML file ${chalk.blue(filename)}: ${xml.length} bytes`)\n const dom = slimdomSAX.sync(xml, { position: false })\n let m\n if ((m = xml.match(/^(<\\?xml.+?\\?>\\r?\\n)/)) !== null)\n dom.PI = m[1]\n return dom\n }", "function processFile(lvfs, fi, thenDo) {\n var rootDir = lvfs.getRootDirectory();\n fs.readFile(path.join(rootDir, fi.path), handleReadResult);\n function handleReadResult(err, content) {\n if (!err) {\n lvfs.createVersionRecord({\n path: fi.path,\n stat: fi.stat,\n content: content\n }, thenDo);\n } else {\n console.error('error reading file %s:', fi.path, err);\n thenDo(err);\n }\n }\n}", "function BinaryParser() { }", "function parseFile(err, contents) {\r\n const output = parse(contents, {\r\n columns: true,\r\n skip_empty_lines: true\r\n });\r\n\r\n // Call build function. Interpret and construct Org Chart\r\n buildOutput(output);\r\n}", "parse(parser) {\n this._processor = this._process(parser);\n this._processor.next();\n }", "function parse(filename, callback) { \n //run the command\n exec('alpr -j -c us '+ filename, function(error, stdout, stderr) {\n // if null, bad things\n if(error != null)\n {\n // if error, bad things\n console.log('oh no');\n }\n output = JSON.parse(stdout);\n callback(output.results[0]);\n });\n}", "async parse(options = {}) {\n if (!this.file.path) {\n throw new Error(`Missing underlying file component with a path.`)\n }\n\n const { code, ast, meta } = await require('@skypager/helpers-mdx')(this.content, {\n filePath: this.file.path,\n ...options,\n rehypePlugins: [\n () => tree => {\n this.state.set('rehypeAst', tree)\n return tree\n },\n ],\n babel: false,\n })\n\n this.state.set('parsed', true)\n this.state.set('parsedContent', code)\n\n return { ast, code, meta }\n }", "constructor(file) {\n this._file = file\n this.size = file.size\n }", "function parseVastSource(source){\n\t\tvar xdoc, parser;\n\t\t\n\t\tparser = new DOMParser();\n\t\txdoc = parser.parseFromString(source, 'text/xml');\n\t\t\n\t\treturn new VastDoc(xdoc);\n\t\n\t}", "function parseQML(src, file) {\n loadParser();\n QmlWeb.parse.nowParsingFile = file;\n var parsetree = QmlWeb.parse(src, QmlWeb.parse.QmlDocument);\n return convertToEngine(parsetree);\n}", "function Parser() {\n var nodeFactory = arguments.length <= 0 || arguments[0] === undefined ? new _nodeFactory.NodeFactory() : arguments[0];\n\n _classCallCheck(this, Parser);\n\n this.nodeFactory = nodeFactory;\n }", "function parseLiveFile(e) {\n if (e.document.isUntitled) {\n return;\n }\n if (e.document.languageId !== 'go') {\n return;\n }\n if (!goLiveErrorsEnabled()) {\n return;\n }\n if (runner != null) {\n clearTimeout(runner);\n }\n runner = setTimeout(() => {\n processFile(e);\n runner = null;\n }, config_1.getGoConfig(e.document.uri)['liveErrors']['delay']);\n}", "function Parser() {\n}", "function Parser() {\n}", "function parse(src) {\n return new recast.types.NodePath(recast.parse(stringify(src)).program);\n}", "async load (filePath) {\n console.log(`Deserializing from ${filePath}`)\n this.data = this.formatStrategy.deserialize(\n await fs.readFile(filePath, 'utf-8')\n )\n }", "function parseFile(event) {\n Papa.parse(event.target.files[0], {\n complete: function (results) {\n console.log(results.data)\n setParse(results.data);\n setIsReady(true)\n }\n })\n }", "function TorrentParser() {\n ModelParser.call(this);\n\n this.on('string', function(string) {\n\t\tif (!this.infoHasher &&\n\t\t string.length == 4 && // avoid converting long buffers to strings\n\t\t string.toString() == 'info') {\n\t\t // Start infoHash\n\t\t this.infoStart = this.pos + 1;\n\t\t this.levels = 0;\n\t\t this.infoHasher = new crypto.createHash('sha1');\n\t\t}\n\t });\n this.on('list', function() {\n\t\tif (this.levels !== undefined)\n\t\t this.levels++;\n\t });\n this.on('dict', function() {\n\t\tif (this.levels !== undefined)\n\t\t this.levels++;\n\t });\n this.on('up', function() {\n\t\tif (this.levels !== undefined) {\n\t\t this.levels--;\n\n\t\t if (this.levels == 0) {\n\t\t\t// Finalize infoHash\n\t\t\tthis.infoHasher.update(this.currentBuffer.slice(this.infoStart, this.pos + 1));\n\t\t\tvar infoHex = this.infoHasher.digest('hex');\n\t\t\tthis.emit('infoHex', infoHex);\n\n\t\t\tdelete this.levels;\n\t\t\tdelete this.infoHasher;\n\t\t\tdelete this.infoStart;\n\t\t }\n\t\t}\n\t });\n this.on('parsed', function(pos) {\n\t\tthis.pos = pos;\n\t });\n}", "constructor( parser ){ \n super()\n this.parser = parser \n }", "async load(path) {\n\t\tlet file = await vfile.read({ path, cwd: this.options.cwd }, 'utf8');\n\n\t\tfile.data.frontmatter = {};\n\n\t\t// Load frontmatter from external file\n\t\tlet fm_path = resolve(this.options.cwd, this.options.frontmatter_path);\n\t\tif (await exists(fm_path)) {\n\t\t\tfile.data.frontmatter = JSON.parse(await readFile(fm_path, 'utf8'));\n\t\t}\n\n\t\t// Load file stats\n\t\tlet stats = await stat(resolve(file.cwd, file.path));\n\t\tfile.data.stats = {\n\t\t\tdate: new Date(stats.birthtimeMs),\n\t\t\tupdated: new Date(stats.mtimeMs)\n\t\t};\n\n\t\tthis.file = file;\n\n\t\t__posts__.set(this.file.path, this);\n\t}", "parseU() {\n\t\tif (this.tid === Parser.OP_ADD) {\n\t\t\tthis.lex();\n\t\t\treturn this.parseV();\n\t\t}\n\t\telse if (this.tid === Parser.OP_SUB) {\n\t\t\tthis.lex();\n\t\t\treturn -this.parseV();\n\t\t}\n\t\telse {\n\t\t\treturn this.parseV();\n\t\t}\n\t}", "function parse(input, options) {\n return Parser.parse(input, options)\n }", "function parse(input, options) {\n return Parser.parse(input, options)\n }", "function parse(input, options) {\n return Parser.parse(input, options)\n }", "constructor( filename )\r\n { super( \"position\", \"normal\", \"texture_coord\" );\r\n // Begin downloading the mesh. Once that completes, return\r\n // control to our parse_into_mesh function.\r\n this.load_file( filename );\r\n }", "parseFile(file) {\r\n this._lines = [];\r\n this._currentLine = -1;\r\n this._resetStates();\r\n\r\n lineReader.eachLine(file, (line) => {\r\n this._lines.push(ParseUtil.clearCRLF(line));\r\n }).then(()=>{\r\n this._linesGenerator = this.lineReader();\r\n this._readNextLine();\r\n });\r\n }", "function VFile(options) {\n var prop;\n var index;\n var length;\n\n if (!options) {\n options = {};\n } else if (typeof options === 'string' || buffer(options)) {\n options = {contents: options};\n } else if ('message' in options && 'messages' in options) {\n return options;\n }\n\n if (!(this instanceof VFile)) {\n return new VFile(options);\n }\n\n this.data = {};\n this.messages = [];\n this.history = [];\n this.cwd = process.cwd();\n\n /* Set path related properties in the correct order. */\n index = -1;\n length = order.length;\n\n while (++index < length) {\n prop = order[index];\n\n if (own.call(options, prop)) {\n this[prop] = options[prop];\n }\n }\n\n /* Set non-path related properties. */\n for (prop in options) {\n if (order.indexOf(prop) === -1) {\n this[prop] = options[prop];\n }\n }\n}", "function VFile(options) {\n var prop;\n var index;\n var length;\n\n if (!options) {\n options = {};\n } else if (typeof options === 'string' || buffer(options)) {\n options = {contents: options};\n } else if ('message' in options && 'messages' in options) {\n return options;\n }\n\n if (!(this instanceof VFile)) {\n return new VFile(options);\n }\n\n this.data = {};\n this.messages = [];\n this.history = [];\n this.cwd = process.cwd();\n\n /* Set path related properties in the correct order. */\n index = -1;\n length = order.length;\n\n while (++index < length) {\n prop = order[index];\n\n if (own.call(options, prop)) {\n this[prop] = options[prop];\n }\n }\n\n /* Set non-path related properties. */\n for (prop in options) {\n if (order.indexOf(prop) === -1) {\n this[prop] = options[prop];\n }\n }\n}", "function VFile(options) {\n var prop;\n var index;\n var length;\n\n if (!options) {\n options = {};\n } else if (typeof options === 'string' || buffer(options)) {\n options = {contents: options};\n } else if ('message' in options && 'messages' in options) {\n return options;\n }\n\n if (!(this instanceof VFile)) {\n return new VFile(options);\n }\n\n this.data = {};\n this.messages = [];\n this.history = [];\n this.cwd = process.cwd();\n\n /* Set path related properties in the correct order. */\n index = -1;\n length = order.length;\n\n while (++index < length) {\n prop = order[index];\n\n if (own.call(options, prop)) {\n this[prop] = options[prop];\n }\n }\n\n /* Set non-path related properties. */\n for (prop in options) {\n if (order.indexOf(prop) === -1) {\n this[prop] = options[prop];\n }\n }\n}", "function VFile(options) {\n var prop;\n var index;\n var length;\n\n if (!options) {\n options = {};\n } else if (typeof options === 'string' || buffer(options)) {\n options = {contents: options};\n } else if ('message' in options && 'messages' in options) {\n return options;\n }\n\n if (!(this instanceof VFile)) {\n return new VFile(options);\n }\n\n this.data = {};\n this.messages = [];\n this.history = [];\n this.cwd = process.cwd();\n\n /* Set path related properties in the correct order. */\n index = -1;\n length = order.length;\n\n while (++index < length) {\n prop = order[index];\n\n if (own.call(options, prop)) {\n this[prop] = options[prop];\n }\n }\n\n /* Set non-path related properties. */\n for (prop in options) {\n if (order.indexOf(prop) === -1) {\n this[prop] = options[prop];\n }\n }\n}", "function VFile(options) {\n var prop;\n var index;\n var length;\n\n if (!options) {\n options = {};\n } else if (typeof options === 'string' || buffer(options)) {\n options = {contents: options};\n } else if ('message' in options && 'messages' in options) {\n return options;\n }\n\n if (!(this instanceof VFile)) {\n return new VFile(options);\n }\n\n this.data = {};\n this.messages = [];\n this.history = [];\n this.cwd = process.cwd();\n\n /* Set path related properties in the correct order. */\n index = -1;\n length = order.length;\n\n while (++index < length) {\n prop = order[index];\n\n if (own.call(options, prop)) {\n this[prop] = options[prop];\n }\n }\n\n /* Set non-path related properties. */\n for (prop in options) {\n if (order.indexOf(prop) === -1) {\n this[prop] = options[prop];\n }\n }\n}", "function VFile(options) {\n var prop;\n var index;\n var length;\n\n if (!options) {\n options = {};\n } else if (typeof options === 'string' || buffer(options)) {\n options = {contents: options};\n } else if ('message' in options && 'messages' in options) {\n return options;\n }\n\n if (!(this instanceof VFile)) {\n return new VFile(options);\n }\n\n this.data = {};\n this.messages = [];\n this.history = [];\n this.cwd = process.cwd();\n\n /* Set path related properties in the correct order. */\n index = -1;\n length = order.length;\n\n while (++index < length) {\n prop = order[index];\n\n if (own.call(options, prop)) {\n this[prop] = options[prop];\n }\n }\n\n /* Set non-path related properties. */\n for (prop in options) {\n if (order.indexOf(prop) === -1) {\n this[prop] = options[prop];\n }\n }\n}", "function IniFile(parent, file) {\n this.parent = parent;\n this.file = file;\n this.saving = false;\n this.savingCb = null;\n\n let fileContent = \"\";\n try {\n fileContent = fs.readFileSync(file, \"utf8\");\n } catch (ex) {}\n let rawLines = fileContent.split(\"\\n\");\n let head = this.head = new IniLine(this);\n let tail = this.tail = new IniLine(this);\n head.next = tail;\n tail.prev = head;\n\n // Each group keeps its own list of lines\n let group = new IniGroup(this, \"_\");\n let groups = this.groups = {_: group};\n\n // Now read it all in\n while (rawLines.length) {\n let lineParts = getLine(rawLines);\n let rawLine = lineParts.rawLine;\n let line = lineParts.line;\n let il;\n let res;\n\n if (rawLine === \"\" && rawLines.length === 0)\n break;\n\n if ((res = headerRE.exec(line)) !== null) {\n // It's a group header\n if (res[1] in groups) {\n group = groups[res[1]];\n } else {\n group = groups[res[1]] = new IniGroup(this, res[1]);\n }\n\n il = new IniLine(this, rawLine, res[1]);\n\n } else if ((res = entryRE.exec(line)) !== null) {\n // It's an entry\n il = new IniLine(this, rawLine, (res[1].length?res[2]:null), res[4], res[5], res[7]);\n\n } else {\n // Unknown/other\n il = new IniLine(this, rawLine);\n\n }\n\n group.push(il);\n this.push(il);\n }\n}", "static deserialize(fileString)\n {\n // split head and data parts\n let m = fileString.match(/[^\\n]*\\n/)\n if (m === null)\n throw new Error(\"File has bad format - head not found.\")\n let head = m[0]\n let data = fileString.slice(head.length)\n\n // check file version\n if (head != \"v1.0.0\\n\")\n throw new Error(\"File version is not compatible.\")\n\n // parse data\n data = JSON.parse(data)\n\n // load the file\n let file = new File()\n\n file.meta = data.meta\n file.accounts = data.accounts.map(x => Account.deserialize(x))\n file.transactions = data.transactions.map(\n x => Transaction.deserialize(x, file.getAccount.bind(file))\n )\n\n return file\n }", "function load() {\n // Get the file selected by user through file opening dialog\n let file = document.getElementById(\"fileLoader\").files[0];\n // Convert file to stream then put its content in \"editor\" div\n file.text().then(text => {\n editor.innerText = text;\n parse();\n }); \n}", "load(file) {\n this._loading = file;\n\n // Read file and split into lines\n const map = {};\n\n const content = fs.readFileSync(file, 'ascii');\n const lines = content.split(/[\\r\\n]+/);\n\n lines.forEach(line => {\n // Clean up whitespace/comments, and split into fields\n const fields = line.replace(/\\s*#.*|^\\s*|\\s*$/g, '').split(/\\s+/);\n map[fields.shift()] = fields;\n });\n\n this.define(map);\n\n this._loading = null;\n }", "function parseFile(str) {\n\n\t\t// Verifying str type\n\t\tif (typeof str !== 'string') {\n\t\t\talert('Sorry... we had a uhh... error parsing?');\n\t\t\treturn;\n\t\t}\n\n\t\t// RegEx is a blast -_-\n\t\tlet newParsedArr = str.match(/['\"].*?['\"]/g).map(item => {\n\t\t\treturn item.replace(/['\"]/g, \"\");\n\t\t});\n\t\tformatPaths(newParsedArr);\n\t}", "function VFile(options) {\n var prop\n var index\n\n if (!options) {\n options = {}\n } else if (typeof options === 'string' || buffer(options)) {\n options = {contents: options}\n } else if ('message' in options && 'messages' in options) {\n return options\n }\n\n if (!(this instanceof VFile)) {\n return new VFile(options)\n }\n\n this.data = {}\n this.messages = []\n this.history = []\n this.cwd = proc.cwd()\n\n // Set path related properties in the correct order.\n index = -1\n\n while (++index < order.length) {\n prop = order[index]\n\n if (own.call(options, prop)) {\n this[prop] = options[prop]\n }\n }\n\n // Set non-path related properties.\n for (prop in options) {\n if (order.indexOf(prop) < 0) {\n this[prop] = options[prop]\n }\n }\n}", "function VFile(options) {\n var prop\n var index\n\n if (!options) {\n options = {}\n } else if (typeof options === 'string' || buffer(options)) {\n options = {contents: options}\n } else if ('message' in options && 'messages' in options) {\n return options\n }\n\n if (!(this instanceof VFile)) {\n return new VFile(options)\n }\n\n this.data = {}\n this.messages = []\n this.history = []\n this.cwd = proc.cwd()\n\n // Set path related properties in the correct order.\n index = -1\n\n while (++index < order.length) {\n prop = order[index]\n\n if (own.call(options, prop)) {\n this[prop] = options[prop]\n }\n }\n\n // Set non-path related properties.\n for (prop in options) {\n if (order.indexOf(prop) < 0) {\n this[prop] = options[prop]\n }\n }\n}", "function Parser(text) {\n if (typeof text !== 'string') {\n throw new Error('not a string');\n }\n this.text = text.trim();\n this.level = 0;\n this.place = 0;\n this.root = null;\n this.stack = [];\n this.currentObject = null;\n this.state = NEUTRAL;\n}", "function Parser(text) {\n if (typeof text !== 'string') {\n throw new Error('not a string');\n }\n this.text = text.trim();\n this.level = 0;\n this.place = 0;\n this.root = null;\n this.stack = [];\n this.currentObject = null;\n this.state = NEUTRAL;\n}", "function Parser(text) {\n if (typeof text !== 'string') {\n throw new Error('not a string');\n }\n this.text = text.trim();\n this.level = 0;\n this.place = 0;\n this.root = null;\n this.stack = [];\n this.currentObject = null;\n this.state = NEUTRAL;\n}", "function Parser(text) {\n if (typeof text !== 'string') {\n throw new Error('not a string');\n }\n this.text = text.trim();\n this.level = 0;\n this.place = 0;\n this.root = null;\n this.stack = [];\n this.currentObject = null;\n this.state = NEUTRAL;\n}", "function VFile(options) {\n var prop\n var index\n var length\n\n if (!options) {\n options = {}\n } else if (typeof options === 'string' || buffer(options)) {\n options = {contents: options}\n } else if ('message' in options && 'messages' in options) {\n return options\n }\n\n if (!(this instanceof VFile)) {\n return new VFile(options)\n }\n\n this.data = {}\n this.messages = []\n this.history = []\n this.cwd = process.cwd()\n\n // Set path related properties in the correct order.\n index = -1\n length = order.length\n\n while (++index < length) {\n prop = order[index]\n\n if (own.call(options, prop)) {\n this[prop] = options[prop]\n }\n }\n\n // Set non-path related properties.\n for (prop in options) {\n if (order.indexOf(prop) === -1) {\n this[prop] = options[prop]\n }\n }\n}", "function process(file, enc, callback) {\n /*jshint validthis:true*/\n\n // Do nothing if no contents\n if (file.isNull()) {\n return callback();\n }\n if (file.isStream()) {\n this.emit(\"error\",\n new gutil.PluginError(PLUGIN_NAME, \"Stream content is not supported\"));\n return callback();\n }\n // check if file.contents is a `Buffer`\n if (file.isBuffer() || file.isFile()) {\n var parser = imagesize.Parser();\n\n var retStatus = parser.parse(file.contents);\n if (imagesize.Parser.DONE === retStatus) {\n var result = parser.getResult();\n result.file = libpath.relative(file.base, file.path)\n list.push(result);\n }\n }\n return callback();\n }", "function Parser()\n{\n this.pathArray = [];\n \n this.onopentag = function(path, node) { }\n this.onclosetag = function(path) { }\n this.ontext = function(path, text) { }\n \n this.parse = function(xmlSource) {\n this.pathArray = [];\n this.path = '';\n \n var parser = sax.parser(true);\n \n parser.onopentag = function(node) {\n this.pathArray.push(node.name);\n this.path = this.pathArray.join(\".\");\n \n this.onopentag(this.path, node);\n }.bind(this);\n \n parser.ontext = function(text) {\n this.ontext(this.path, text);\n }.bind(this);\n \n parser.onclosetag = function() {\n this.onclosetag(this.path);\n this.pathArray.pop();\n this.path = this.pathArray.join(\".\");\n }.bind(this);\n \n parser.write(xmlSource).close();\n }\n}", "function VFile$1(options) {\n var prop;\n var index;\n\n if (!options) {\n options = {};\n } else if (typeof options === 'string' || buffer$1(options)) {\n options = {contents: options};\n } else if ('message' in options && 'messages' in options) {\n return options\n }\n\n if (!(this instanceof VFile$1)) {\n return new VFile$1(options)\n }\n\n this.data = {};\n this.messages = [];\n this.history = [];\n this.cwd = proc$1.cwd();\n\n // Set path related properties in the correct order.\n index = -1;\n\n while (++index < order$3.length) {\n prop = order$3[index];\n\n if (own$c.call(options, prop)) {\n this[prop] = options[prop];\n }\n }\n\n // Set non-path related properties.\n for (prop in options) {\n if (order$3.indexOf(prop) < 0) {\n this[prop] = options[prop];\n }\n }\n}", "function parse(input, options) {\n return Parser.parse(input, options)\n}" ]
[ "0.6036263", "0.59983784", "0.59361374", "0.5816456", "0.5761662", "0.5761662", "0.5761662", "0.56939125", "0.5656537", "0.5630632", "0.5630632", "0.5630632", "0.5630632", "0.5630632", "0.5630632", "0.56050044", "0.55566186", "0.53403527", "0.52543056", "0.5195248", "0.5108459", "0.50767225", "0.5067721", "0.503794", "0.50218284", "0.49453864", "0.49321043", "0.48646608", "0.48555344", "0.48252273", "0.48252273", "0.48252273", "0.48252273", "0.48252273", "0.48200566", "0.48177654", "0.4812005", "0.48000044", "0.47344592", "0.46998313", "0.46902162", "0.4680229", "0.4673885", "0.46557516", "0.4647582", "0.4635368", "0.46243808", "0.46243808", "0.46157664", "0.45879832", "0.45848453", "0.45836142", "0.45707124", "0.45495057", "0.45478988", "0.4523948", "0.45231694", "0.4519029", "0.4518578", "0.45035642", "0.45020202", "0.45020202", "0.44989353", "0.4476513", "0.4470842", "0.44702402", "0.44645983", "0.44505605", "0.4429821", "0.44183573", "0.44183573", "0.44183573", "0.4416115", "0.4415466", "0.44108927", "0.44108927", "0.44108927", "0.44108927", "0.44108927", "0.44108927", "0.44010672", "0.4395715", "0.43955973", "0.4392666", "0.4382489", "0.43813086", "0.43813086", "0.4376621", "0.4376621", "0.4376621", "0.4376621", "0.43708837", "0.43659088", "0.436558", "0.43590617", "0.43535817" ]
0.5760103
11
Run transforms on a Unist node representation of a file (in string or VFile representation), async.
function run(node, file, cb) { assertNode(node) freeze() if (!cb && typeof file === 'function') { cb = file file = null } if (!cb) { return new Promise(executor) } executor(null, cb) function executor(resolve, reject) { transformers.run(node, vfile(file), done) function done(err, tree, file) { tree = tree || node if (err) { reject(err) } else if (resolve) { resolve(tree) } else { cb(null, tree, file) } } } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function run(node, file, cb) {\n assertNode(node)\n freeze()\n\n if (!cb && typeof file === 'function') {\n cb = file\n file = null\n }\n\n if (!cb) {\n return new Promise(executor)\n }\n\n executor(null, cb)\n\n function executor(resolve, reject) {\n transformers.run(node, vfile(file), done)\n\n function done(error, tree, file) {\n tree = tree || node\n if (error) {\n reject(error)\n } else if (resolve) {\n resolve(tree)\n } else {\n cb(null, tree, file)\n }\n }\n }\n }", "function run(node, file, cb) {\n assertNode(node)\n freeze()\n\n if (!cb && typeof file === 'function') {\n cb = file\n file = null\n }\n\n if (!cb) {\n return new Promise(executor)\n }\n\n executor(null, cb)\n\n function executor(resolve, reject) {\n transformers.run(node, vfile(file), done)\n\n function done(error, tree, file) {\n tree = tree || node\n if (error) {\n reject(error)\n } else if (resolve) {\n resolve(tree)\n } else {\n cb(null, tree, file)\n }\n }\n }\n }", "function run(node, file, cb) {\n assertNode(node);\n freeze();\n\n if (!cb && typeof file === 'function') {\n cb = file;\n file = null;\n }\n\n if (!cb) {\n return new Promise(executor)\n }\n\n executor(null, cb);\n\n function executor(resolve, reject) {\n transformers.run(node, vfile(file), done);\n\n function done(error, tree, file) {\n tree = tree || node;\n if (error) {\n reject(error);\n } else if (resolve) {\n resolve(tree);\n } else {\n cb(null, tree, file);\n }\n }\n }\n }", "function run(node, file, cb) {\n assertNode(node);\n freeze();\n\n if (!cb && func(file)) {\n cb = file;\n file = null;\n }\n\n if (!cb) {\n return new Promise(executor);\n }\n\n executor(null, cb);\n\n function executor(resolve, reject) {\n transformers.run(node, vfile(file), done);\n\n function done(err, tree, file) {\n tree = tree || node;\n if (err) {\n reject(err);\n } else if (resolve) {\n resolve(tree);\n } else {\n cb(null, tree, file);\n }\n }\n }\n }", "function transform(context, file, fileSet, next) {\n if (stats(file).fatal) {\n next()\n } else {\n debug('Transforming document `%s`', file.path)\n context.processor.run(context.tree, file, onrun)\n }\n\n function onrun(error, node) {\n debug('Transformed document (error: %s)', error)\n context.tree = node\n next(error)\n }\n}", "_transformFiles(files, done) {\n let transformedFiles = [];\n // Clumsy way of handling asynchronous calls, until I get to add a proper Future library.\n let doneCounter = 0;\n for(let i = 0; i < files.length; i++)this.options.transformFile.call(this, files[i], (transformedFile)=>{\n transformedFiles[i] = transformedFile;\n if (++doneCounter === files.length) done(transformedFiles);\n });\n }", "function transform(file, cb) {\n gutil.log('Preprocessing:', file.path);\n // read and modify file contents\n var fileContents = String(file.contents);\n fileContents = fileContents.replace(/^\\s*(import .*?)(?:;|$)/gm,\n function(str, group1) {\n return 'jsio(\"' + group1 + '\");';\n });\n file.contents = new Buffer(fileContents);\n\n // if there was some error, just pass as the first parameter here\n cb(null, file);\n }", "async function main() {\n const resolvedPaths = globby.sync(files as string[])\n const transformationModule = loadTransformationModule(transformationName)\n\n log(`Processing ${resolvedPaths.length} files…`)\n\n for (const p of resolvedPaths) {\n debug(`Processing ${p}…`)\n const fileInfo = {\n path: p,\n source: fs.readFileSync(p).toString(),\n }\n try {\n const result = runTransformation(\n fileInfo,\n transformationModule,\n params as object\n )\n fs.writeFileSync(p, result)\n } catch (e) {\n console.error(e)\n }\n }\n}", "function transformFileSync(filename) {\n\t var opts = arguments.length <= 1 || arguments[1] === undefined ? {} : arguments[1];\n\n\t opts.filename = filename;\n\t return _transformation2[\"default\"](_fs2[\"default\"].readFileSync(filename, \"utf8\"), opts);\n\t}", "function transformFileSync(filename) {\n\t var opts = arguments.length <= 1 || arguments[1] === undefined ? {} : arguments[1];\n\n\t opts.filename = filename;\n\t return _transformation2[\"default\"](_fs2[\"default\"].readFileSync(filename, \"utf8\"), opts);\n\t}", "function tjs_gulp_transformFile(file) {\n\t// console.log(file)\n\treturn `gulp.task('${file.file}', function() {\n\tlet pipe = gulp.src('${file.file}', { base: __dirname })\n\n\t// pre-piping\n\tif (typeof __t.start == 'function')\n\t\tpipe = pipe.pipe(__t.start.bind(pipe)())\n\n\t${file.transforms.length == 0 ? `if (typeof __t.blank == 'function') pipe = __t.blank.bind(pipe)()` : ''}\n\n\t${file.transforms.map(t => `// pipe setup for ${t.name}\n\tpipe = __t.${t.name}.bind(pipe)${t.argsTuple}\n\tif (typeof __t.each == 'function') pipe = pipe.pipe(__t.each.bind(pipe)())`).join('\\n\\t')}\n\n\t// post-piping\n\tif (typeof __t.finish == 'function')\n\t\tpipe = pipe.pipe(__t.finish.bind(pipe)())\n\t\n\treturn pipe\n})`\n}", "function transformFileSync(filename) {\n var opts = arguments.length <= 1 || arguments[1] === undefined ? {} : arguments[1];\n\n opts.filename = filename;\n return _transformation2[\"default\"](_fs2[\"default\"].readFileSync(filename, \"utf8\"), opts);\n}", "async transform(mode) {\n // console.log('Mode:', mode, '->');\n try {\n const buffer = await readFile(`${this.file}`);\n\n // console.log('buffer argument:', buffer);\n\n let transformed;\n switch (mode) {\n // case 'soRandom':\n // case 'random':\n // transformed = await soRandom(buffer);\n // break;\n case 'shave':\n transformed = await shave(buffer);\n break;\n case 'angelOfMusic':\n case 'phantom':\n transformed = await angelOfMusic(buffer);\n break;\n case 'grayscale':\n case 'greyscale':\n transformed = await greyscale(buffer);\n break;\n // case 'randomlyPastel':\n // case 'pastel':\n // transformed = await randomlyPastel(buffer);\n // break;\n default:\n // console.log(`Something is wrong. Output not modified.`);\n transformed = buffer;\n break;\n }\n\n writeFile(`${__dirname}/transformations/${transformed.output}`, transformed.buffer);\n console.log(transformed.message);\n } catch (err) {\n console.error('There was an error transforming your file:', err);\n }\n }", "function transform(src, filename, options) {\n validateArguments(src, filename);\n return new Promise((resolve, reject) => {\n try {\n const res = transformSync(src, filename, options);\n resolve(res);\n }\n catch (error) {\n reject(error);\n }\n });\n}", "function transform$5(context, file, fileSet, next) {\n if (stats$4(file).fatal) {\n next();\n } else {\n debug$7('Transforming document `%s`', file.path);\n context.processor.run(context.tree, file, onrun);\n }\n\n function onrun(error, node) {\n debug$7('Transformed document (error: %s)', error);\n context.tree = node;\n next(error);\n }\n}", "transformFile(data, filePath) {\n this.updateBabelConfig(filePath);\n return babel.transformSync(data, this.babelConfig.options);\n }", "runTransformation(input) {\n return this.transform(input)\n }", "function process(doc, cb) {\n freeze()\n assertParser('process', processor.Parser)\n assertCompiler('process', processor.Compiler)\n\n if (!cb) {\n return new Promise(executor)\n }\n\n executor(null, cb)\n\n function executor(resolve, reject) {\n var file = vfile(doc)\n\n pipeline.run(processor, {file: file}, done)\n\n function done(err) {\n if (err) {\n reject(err)\n } else if (resolve) {\n resolve(file)\n } else {\n cb(null, file)\n }\n }\n }\n }", "function process(doc, cb) {\n freeze()\n assertParser('process', processor.Parser)\n assertCompiler('process', processor.Compiler)\n\n if (!cb) {\n return new Promise(executor)\n }\n\n executor(null, cb)\n\n function executor(resolve, reject) {\n var file = vfile(doc)\n\n pipeline.run(processor, {file: file}, done)\n\n function done(err) {\n if (err) {\n reject(err)\n } else if (resolve) {\n resolve(file)\n } else {\n cb(null, file)\n }\n }\n }\n }", "function process(doc, cb) {\n freeze()\n assertParser('process', processor.Parser)\n assertCompiler('process', processor.Compiler)\n\n if (!cb) {\n return new Promise(executor)\n }\n\n executor(null, cb)\n\n function executor(resolve, reject) {\n var file = vfile(doc)\n\n pipeline.run(processor, {file: file}, done)\n\n function done(err) {\n if (err) {\n reject(err)\n } else if (resolve) {\n resolve(file)\n } else {\n cb(null, file)\n }\n }\n }\n }", "function process(doc, cb) {\n freeze()\n assertParser('process', processor.Parser)\n assertCompiler('process', processor.Compiler)\n\n if (!cb) {\n return new Promise(executor)\n }\n\n executor(null, cb)\n\n function executor(resolve, reject) {\n var file = vfile(doc)\n\n pipeline.run(processor, {file: file}, done)\n\n function done(err) {\n if (err) {\n reject(err)\n } else if (resolve) {\n resolve(file)\n } else {\n cb(null, file)\n }\n }\n }\n }", "function process(doc, cb) {\n freeze()\n assertParser('process', processor.Parser)\n assertCompiler('process', processor.Compiler)\n\n if (!cb) {\n return new Promise(executor)\n }\n\n executor(null, cb)\n\n function executor(resolve, reject) {\n var file = vfile(doc)\n\n pipeline.run(processor, {file: file}, done)\n\n function done(err) {\n if (err) {\n reject(err)\n } else if (resolve) {\n resolve(file)\n } else {\n cb(null, file)\n }\n }\n }\n }", "function process(doc, cb) {\n freeze()\n assertParser('process', processor.Parser)\n assertCompiler('process', processor.Compiler)\n\n if (!cb) {\n return new Promise(executor)\n }\n\n executor(null, cb)\n\n function executor(resolve, reject) {\n var file = vfile(doc)\n\n pipeline.run(processor, {file: file}, done)\n\n function done(err) {\n if (err) {\n reject(err)\n } else if (resolve) {\n resolve(file)\n } else {\n cb(null, file)\n }\n }\n }\n }", "function process(doc, cb) {\n freeze();\n assertParser('process', processor.Parser);\n assertCompiler('process', processor.Compiler);\n\n if (!cb) {\n return new Promise(executor)\n }\n\n executor(null, cb);\n\n function executor(resolve, reject) {\n var file = vfile(doc);\n\n pipeline.run(processor, {file: file}, done);\n\n function done(error) {\n if (error) {\n reject(error);\n } else if (resolve) {\n resolve(file);\n } else {\n cb(null, file);\n }\n }\n }\n }", "function process(doc, cb) {\n freeze()\n assertParser('process', processor.Parser)\n assertCompiler('process', processor.Compiler)\n\n if (!cb) {\n return new Promise(executor)\n }\n\n executor(null, cb)\n\n function executor(resolve, reject) {\n var file = vfile(doc)\n\n pipeline.run(processor, {file: file}, done)\n\n function done(error) {\n if (error) {\n reject(error)\n } else if (resolve) {\n resolve(file)\n } else {\n cb(null, file)\n }\n }\n }\n }", "function process(doc, cb) {\n freeze()\n assertParser('process', processor.Parser)\n assertCompiler('process', processor.Compiler)\n\n if (!cb) {\n return new Promise(executor)\n }\n\n executor(null, cb)\n\n function executor(resolve, reject) {\n var file = vfile(doc)\n\n pipeline.run(processor, {file: file}, done)\n\n function done(error) {\n if (error) {\n reject(error)\n } else if (resolve) {\n resolve(file)\n } else {\n cb(null, file)\n }\n }\n }\n }", "function process(doc, cb) {\n freeze();\n assertParser('process', processor.Parser);\n assertCompiler('process', processor.Compiler);\n\n if (!cb) {\n return new Promise(executor);\n }\n\n executor(null, cb);\n\n function executor(resolve, reject) {\n var file = vfile(doc);\n\n pipeline.run(processor, {file: file}, done);\n\n function done(err) {\n if (err) {\n reject(err);\n } else if (resolve) {\n resolve(file);\n } else {\n cb(null, file);\n }\n }\n }\n }", "function transformFile(filename, opts, callback) {\n\t if (_lodashLangIsFunction2[\"default\"](opts)) {\n\t callback = opts;\n\t opts = {};\n\t }\n\n\t opts.filename = filename;\n\n\t _fs2[\"default\"].readFile(filename, function (err, code) {\n\t if (err) return callback(err);\n\n\t var result;\n\n\t try {\n\t result = _transformation2[\"default\"](code, opts);\n\t } catch (err) {\n\t return callback(err);\n\t }\n\n\t callback(null, result);\n\t });\n\t}", "function transformFile(filename, opts, callback) {\n\t if (_lodashLangIsFunction2[\"default\"](opts)) {\n\t callback = opts;\n\t opts = {};\n\t }\n\n\t opts.filename = filename;\n\n\t _fs2[\"default\"].readFile(filename, function (err, code) {\n\t if (err) return callback(err);\n\n\t var result;\n\n\t try {\n\t result = _transformation2[\"default\"](code, opts);\n\t } catch (err) {\n\t return callback(err);\n\t }\n\n\t callback(null, result);\n\t });\n\t}", "async function transform(file, dir = 'lib') {\n const dest = file.replace('/src/', `/${dir}/`)\n await fs.ensureDir(path.dirname(dest))\n\n if (fs.statSync(file).isDirectory()) return\n\n if (file.endsWith('.svelte')) {\n const source = await fs.readFile(file, 'utf8')\n const item = await preprocess(\n source,\n autoprocessor({\n typescript: {\n tsconfigFile: path.resolve(rootDir, 'tsconfig-base.json'),\n },\n // https://github.com/sveltejs/svelte/issues/189#issuecomment-586142198\n replace: [\n [/(>)[\\s]*([<{])/g, '$1$2'],\n [/({[/:][a-z]+})[\\s]*([<{])/g, '$1$2'],\n [/({[#:][a-z]+ .+?})[\\s]*([<{])/g, '$1$2'],\n [/([>}])[\\s]+(<|{[/#:][a-z][^}]*})/g, '$1$2'],\n ],\n }),\n {\n filename: file,\n }\n )\n await fs.writeFile(\n dest,\n item.code.replace('<script lang=\"ts\">', '<script>')\n )\n } else {\n await fs.copyFile(file, dest)\n }\n}", "function parse(file) {\n return __awaiter(this, void 0, void 0, function () {\n return __generator(this, function (_a) {\n return [2\n /*return*/\n , new Promise(function (resolve, reject) {\n fs.readFile(file, 'utf8', function (err, data) {\n if (err) {\n reject(err);\n return;\n }\n\n resolve(parseString(data));\n });\n })];\n });\n });\n }", "async function treeify(forEachFile) {\n const treeRoot = process.cwd()\n const ignorePattern = await _ignore()\n const tree = gl.baseCase\n\n if (await fs.pathExists(treeRoot)) {\n await Promise.all((await rget(treeRoot, ignorePattern)).map(file => forEachFile(tree, file)))\n }\n return tree\n}", "async processFile(hndl) {\n }", "async processFile(hndl) {\n }", "async function image(file) {\n const decoded = tf.node.decodeImage(file);\n const casted = decoded.toFloat();\n const result = casted.expandDims(0);\n decoded.dispose();\n casted.dispose();\n return result;\n}", "function transformSync(src, filename, options) {\n validateArguments(src, filename);\n const normalizedOptions = options_1.validateTransformOptions(options);\n return transformFile(src, filename, normalizedOptions);\n}", "static transform() {}", "function transform(file, cb) {\n // read and modify file contents\n console.log(file.history[0]);\n var lines = String(file.contents).replace(/\\r\\n/g, '\\n').split('\\n');\n var files = [];\n var found = false;\n\n for (var i = 0; i < lines.length; i++) {\n lines[i] = lines[i].replace(/http:\\/\\/www\\.iobroker\\.net\\/wp-content\\/uploads\\/\\//g, 'http://iobroker.net/wp-content/uploads/');\n lines[i] = lines[i].replace(/http:\\/\\/www\\.iobroker\\.net\\/wp-content\\/uploads\\//g, 'http://iobroker.net/wp-content/uploads/');\n lines[i] = lines[i].replace(/http:\\/\\/iobroker\\.net\\/wp-content\\/uploads\\/\\//g, 'http://iobroker.net/wp-content/uploads/');\n // [![](http://www.iobroker.net/wp-content/uploads//email_set.png)](http://www.iobroker.net/wp-content/uploads//email_set.png)]\n var m = lines[i].match(/(\\[caption[^\\]]*\\])?\\!\\[[^\\]]*\\]\\(http:\\/\\/iobroker\\.net\\/[^\\)]+\\)(\\]\\([^\\)]*\\))?\\]?(.*\\[\\/caption\\])?/g);\n if (m) {\n for (var j = 0; j < m.length; j++) {\n found = true;\n // try to extract caption\n var caption = m[j].match(/\\)\\]?(.+)\\[\\/caption\\]/);\n if (caption) {\n caption = caption[1].trim();\n }\n\n // change it to \\n![](img/filename_oldf_filename)\\n\n var mm = m[j].split('](')[1];\n mm = mm.replace(/\\).*$/, '');\n // noe we have \"http://www.iobroker.net/wp-content/uploads/email_set.png\"\n var fileName = mm.split('/').pop();\n var mdPath = file.history[0].replace(/\\\\/g, '/');\n var parts = mdPath.split('/');\n var mdFileName = parts.pop().replace(/\\.md$/, '');\n mdPath = parts.join('/');\n\n var task = {url: mm, name: mdPath + '/img/' + mdFileName + '_' + fileName, relative: 'img/' + mdFileName + '_' + fileName};\n bigTasks.push(task);\n lines[i] = lines[i].replace(m[j], '\\n![' + (caption || '') + '](' + task.relative + ')\\n');\n }\n }\n }\n /*downloadFiles(files, [], function (err) {\n if (found && (!err || !err.length)) {\n console.log('Write modified ' + file.history[0]);\n //file.contents = new Buffer(lines.join('\\n'));\n }\n\n // if there was some error, just pass as the first parameter here\n cb(null, file);\n });*/\n cb(null, file);\n }", "async transform() {\n if (this.options.minify) {\n await uglify(this);\n }\n }", "function Transform() {}", "function Transform() {}", "function Transform() {}", "function Transform() {}", "function Transform() {}", "function parse( file ) {\n\t\treturn __awaiter( this, void 0, void 0, function () {\n\t\t\treturn __generator( this, function ( _a ) {\n\t\t\t\treturn [\n\t\t\t\t\t2,\n\t\t\t\t\t/*return*/\n\t\t\t\t\tnew Promise( function ( resolve, reject ) {\n\t\t\t\t\t\tfs.readFile( file, 'utf8', function ( err, data ) {\n\t\t\t\t\t\t\tif ( err ) {\n\t\t\t\t\t\t\t\treject( err );\n\t\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\tresolve( parseString( data ) );\n\t\t\t\t\t\t} );\n\t\t\t\t\t} ),\n\t\t\t\t];\n\t\t\t} );\n\t\t} );\n\t}", "function applyTransform(path, data, callback) {\n if(typeof data === \"function\") {\n callback = data;\n data = null;\n }\n\n var transform = getTransform(path);\n if(!transform) {\n return callback(null);\n }\n\n function _applyTransform(path, data) {\n transform.transform(path, data, function(err, transformed) {\n if(err) {\n console.error(\"[Bramble Error] unable to transform file\", path, err);\n return callback(err);\n }\n\n var transformedPath = transform.rewritePath(path);\n\n _fs.writeFile(transformedPath, transformed, function(err) {\n if(err) {\n console.error(\"[Bramble Error] unable to write transformed file\", transformedPath, err);\n return callback(err);\n }\n\n Handlers.handleFile(transformedPath, data, function(err) {\n if(err) {\n console.error(\"[Bramble Error] unable to rewrite URL for transformed file\", transformedPath, err);\n return callback(err);\n }\n\n // Refresh the file tree so this new file shows up.\n CommandManager.execute(Commands.FILE_REFRESH).always(callback);\n });\n });\n });\n }\n\n if(!data) {\n _fs.readFile(path, \"utf8\", function(err, data) {\n if(err) {\n if(err.code === \"ENOENT\") {\n // File is being created (not written yet) use empty string\n data = \"\";\n } else {\n // Some other error, send it back\n return callback(err);\n }\n }\n\n _applyTransform(path, data);\n });\n } else {\n _applyTransform(path, data);\n }\n }", "function run(transformer, options) {\n return runFile(process.argv[2], transformer, options);\n}", "function transformFile(filename, opts, callback) {\n if (_lodashLangIsFunction2[\"default\"](opts)) {\n callback = opts;\n opts = {};\n }\n\n opts.filename = filename;\n\n _fs2[\"default\"].readFile(filename, function (err, code) {\n if (err) return callback(err);\n\n var result;\n\n try {\n result = _transformation2[\"default\"](code, opts);\n } catch (err) {\n return callback(err);\n }\n\n callback(null, result);\n });\n}", "function transformerAsync() {\n switch (arguments.length) {\n case 0:\n throw new Error('transformer error: no arguments.')\n case 1: // loading\n return Loader(arguments[0]);\n default: // find conversions\n return transformerAsync.compose(_.toArray(arguments))\n }\n}", "function decodeFile(input) {\n let ondata = (evt, cb) => {\n if (evt.data[0] == 0) {\n cb({raw: evt.data.subarray(1), links: [], data: evt.data.subarray(1)})\n } else if (evt.data[0] == 1) {\n try {\n let node = dagPB.util.deserialize(evt.data.subarray(1))\n\n let file = Unixfs.unmarshal(node.Data)\n if (file.type != \"raw\" && file.type != \"file\") {\n throw new Error(\"got unexpected file type, wanted raw or file\")\n }\n if (file.data == null) {\n file.data = Buffer.alloc(0)\n }\n\n cb({raw: evt.data.subarray(1), links: node.Links, data: file.data})\n } catch (err) {\n cb(null, err)\n }\n } else {\n cb(null, new Error(\"failed to decode a chunk of file data\"))\n }\n }\n\n return asynchronous(input, ondata)\n}", "function processFile (inputLoc, out, replacements) {\n var file = urlRegex.test(inputLoc) ?\n hyperquest(inputLoc) :\n fs.createReadStream(inputLoc, encoding)\n\n file.pipe(bl(function (err, data) {\n if (err) throw err\n\n data = data.toString()\n replacements.forEach(function (replacement) {\n data = data.replace.apply(data, replacement)\n })\n if (inputLoc.slice(-3) === '.js') {\n const transformed = babel.transform(data, {\n plugins: [\n 'transform-es2015-parameters',\n 'transform-es2015-arrow-functions',\n 'transform-es2015-block-scoping',\n 'transform-es2015-template-literals',\n 'transform-es2015-shorthand-properties',\n 'transform-es2015-for-of',\n 'transform-es2015-destructuring'\n ]\n })\n data = transformed.code\n }\n fs.writeFile(out, data, encoding, function (err) {\n if (err) throw err\n\n console.log('Wrote', out)\n })\n }))\n}", "function run(transformer, options) {\n\t return runFile(process.argv[2], transformer, options);\n\t}", "function processSVGImage(i, inputFile, outputFile) {\n console.log(\"processSVGImage:\" + i + \",\" + inputFile + \",output:\" + outputFile);\n\n // pretty print the input file first\n xmlFormat(tempDir + \"/\" + inputFile + \".svg\");\n // var processBg = new transform();\n // processBg._transform = function (data, encoding, cb) {\n // // do transformation\n // cb(null, tools.processData(data,processBgImg));\n // };\n\n var removeBd = new transform();\n removeBd._transform = function (data, encoding, cb) {\n // do transformation\n cb(null, tools.processData(data, removeBdTag));\n };\n var removeXMLSpacePreserve = new transform();\n removeXMLSpacePreserve._transform = function (data, encoding, cb) {\n // do transformation\n cb(null, tools.processData(data, removeXMLSpacePreserveTag));\n };\n var processNt = new transform();\n processNt._transform = function (data, encoding, cb) {\n // do transformation\n cb(null, tools.processData(data, processNtTag));\n };\n\n var processTextLine = new transform();\n processTextLine._transform = function (data, encoding, cb) {\n // do transformation\n cb(null, tools.processData(data, processTextTag));\n };\n\n var processImageLine = new transform();\n processImageLine._transform = function (data, encoding, cb) {\n // do transformation\n cb(null, tools.processData(data, processImageTag));\n };\n\n // var getFonts = new transform();\n // getFonts._transform = function (data, encoding, cb) {\n // // do transformation\n // cb(null, tools.processData(data, getFontsList));\n // };\n var addFonts = new transform();\n addFonts._transform = function (data, encoding, cb) {\n // do transformation\n // console.log(\"transform:\" + fontList[i]);\n cb(null, tools.processData(data, addFontsLine, fontList[i]));\n };\n\n var inputPath = tempDir + \"/\" + inputFile + \".svg\";\n var inputStream1 = fs.createReadStream(inputPath);\n var outputPath = tempDir + \"/\" + outputFile + \".svg\";\n var outputStream1 = fs.createWriteStream(outputPath);\n inputStream1\n .pipe(removeBd)\n .pipe(removeXMLSpacePreserve)\n .pipe(processNt)\n .pipe(processTextLine)\n .pipe(processImageLine)\n .pipe(addFonts)\n .pipe(outputStream1);\n\n setTimeout(function () {\n xmlFormat(outputPath)\n }, 2000);\n // delay 2 seconds for the first round is over\n // setTimeout(function () {\n // console.log(\"start second round\");\n // var inputStream2 = fs.createReadStream(outputPath);\n // outputPath = tempDir + \"/\" + outputFile + \".svg\";\n // var outputStream2 = fs.createWriteStream(outputPath);\n // inputStream2\n // .pipe(addFonts)\n // .pipe(outputStream2);\n // }, 2000);\n\n}", "async transform(chunk, encoding, cb) {\n\n // DRY method for handling each chunk as it comes in\n const do_transform = () => {\n // Write data to our fork stream. If it fails,\n // emit a 'drain' event\n if (!this._fork_stream.write(chunk)) {\n this._fork_stream.once('drain', () => {\n cb(null, chunk);\n });\n } else {\n // Push data back out to whatever is listening (if anything)\n // and let Node know we're ready for more data\n cb(null, chunk);\n }\n };\n\n // DRY method for handling errors when the arise from the\n // ClamAV Socket connection\n const handle_error = (err, is_infected=null, result=null) => {\n this._fork_stream.unpipe();\n this._fork_stream.destroy();\n this._clamav_transform.destroy();\n clear_scan_benchmark();\n\n // Finding an infected file isn't really an error...\n if (is_infected === true) {\n if (_scan_complete === false) {\n _scan_complete = true;\n this.emit('scan-complete', result);\n }\n this.emit('stream-infected', result); // just another way to catch an infected stream\n } else {\n this.emit('error', err);\n }\n };\n\n // If we haven't initialized a socket connection to ClamAV yet,\n // now is the time...\n if (!this._clamav_socket) {\n // We're using a PassThrough stream as a middle man to fork the input\n // into two paths... (1) ClamAV and (2) The final destination.\n this._fork_stream = new PassThrough();\n // Instantiate our custom Transform stream that coddles\n // chunks into the correct format for the ClamAV socket.\n this._clamav_transform = new NodeClamTransform({}, me.settings.debug_mode);\n // Setup an array to collect the responses from ClamAV\n this._clamav_response_chunks = [];\n\n try {\n // Get a connection to the ClamAV Socket\n this._clamav_socket = await me._init_socket('passthrough');\n if (me.settings.debug_mode) console.log(`${me.debug_label}: ClamAV Socket Initialized...`);\n\n // Setup a pipeline that will pass chunks through our custom Tranform and on to ClamAV\n this._fork_stream.pipe(this._clamav_transform).pipe(this._clamav_socket);\n\n // When the CLamAV socket connection is closed (could be after 'end' or because of an error)...\n this._clamav_socket.on('close', hadError => {\n if (me.settings.debug_mode) console.log(`${me.debug_label}: ClamAV socket has been closed! Because of Error:`, hadError);\n })\n // When the ClamAV socket connection ends (receives chunk)\n .on('end', () => {\n if (me.settings.debug_mode) console.log(`${me.debug_label}: ClamAV socket has received the last chunk!`);\n // Process the collected chunks\n const response = Buffer.concat(this._clamav_response_chunks);\n const result = me._process_result(response.toString('utf8'), null);\n this._clamav_response_chunks = [];\n if (me.settings.debug_mode) {\n console.log(`${me.debug_label}: Result of scan:`, result);\n console.log(`${me.debug_label}: It took ${_av_scan_time} seconds to scan the file(s).`);\n clear_scan_benchmark();\n }\n\n // NOTE: \"scan-complete\" could be called by the `handle_error` method.\n // We don't want to to double-emit this message.\n if (_scan_complete === false) {\n _scan_complete = true;\n this.emit('scan-complete', result);\n }\n })\n // If connection timesout.\n .on('timeout', () => {\n this.emit('timeout', new Error('Connection to host/socket has timed out'));\n if (me.settings.debug_mode) console.log(`${me.debug_label}: Connection to host/socket has timed out`);\n })\n // When the ClamAV socket is ready to receive packets (this will probably never fire here)\n .on('ready', () => {\n if (me.settings.debug_mode) console.log(`${me.debug_label}: ClamAV socket ready to receive`);\n })\n // When we are officially connected to the ClamAV socket (probably will never fire here)\n .on('connect', () => {\n if (me.settings.debug_mode) console.log(`${me.debug_label}: Connected to ClamAV socket`);\n })\n // If an error is emitted from the ClamAV socket\n .on('error', err => {\n console.error(`${me.debug_label}: Error emitted from ClamAV socket: `, err);\n handle_error(err);\n })\n // If ClamAV is sending stuff to us (ie, an \"OK\", \"Virus FOUND\", or \"ERROR\")\n .on('data', cv_chunk => {\n // Push this chunk to our results collection array\n this._clamav_response_chunks.push(cv_chunk);\n if (me.settings.debug_mode) console.log(`${me.debug_label}: Got result!`, cv_chunk.toString());\n\n // Parse what we've gotten back from ClamAV so far...\n const response = Buffer.concat(this._clamav_response_chunks);\n const result = me._process_result(response.toString(), null);\n\n // If there's an error supplied or if we detect a virus, stop stream immediately.\n if (result instanceof NodeClamError || (typeof result === 'object' && 'is_infected' in result && result.is_infected === true)) {\n // If a virus is detected...\n if (typeof result === 'object' && 'is_infected' in result && result.is_infected === true) {\n // handle_error(new NodeClamError(result, `Virus(es) found! ${'viruses' in result && Array.isArray(result.viruses) ? `Suspects: ${result.viruses.join(', ')}` : ''}`));\n handle_error(null, true, result);\n }\n // If any other kind of error is detected...\n else {\n handle_error(result);\n }\n }\n // For debugging purposes, spit out what was processed (if anything).\n else {\n if (me.settings.debug_mode) console.log(`${me.debug_label}: Processed Result: `, result, response.toString());\n }\n });\n\n if (me.settings.debug_mode) console.log(`${me.debug_label}: Doing initial transform!`);\n // Handle the chunk\n do_transform();\n } catch (err) {\n // If there's an issue connecting to the ClamAV socket, this is where that's handled\n if (me.settings.debug_mode) console.error(`${me.debug_label}: Error initiating socket to ClamAV: `, err);\n handle_error(err);\n }\n } else {\n //if (me.settings.debug_mode) console.log(`${me.debug_label}: Doing transform: ${++counter}`);\n // Handle the chunk\n do_transform();\n }\n }", "function makeTransform(registry) {\n\n return function(filename, options) {\n options = options || {};\n\n var registry = registry || registryFromOptions(options);\n\n return aggregate(function(src) {\n try {\n src = jstransform(src);\n } catch(err) {\n return this.emit('error', err);\n }\n this.queue(src);\n this.queue(null);\n });\n }\n}", "function _transform(node, callback) {\n return node.map(function (child, path, parent) {\n var replacement = callback(child, path, parent);\n return _transform(replacement, callback);\n });\n }", "function _transform (node, callback) {\n return node.map(function(child, path, parent) {\n var replacement = callback(child, path, parent);\n return _transform(replacement, callback);\n });\n }", "function _transform (node, callback) {\n return node.map(function(child, path, parent) {\n var replacement = callback(child, path, parent);\n return _transform(replacement, callback);\n });\n }", "async function uploadFile(file) {\r\n return new Promise((resolve, reject) => {\r\n const reader = new FileReader()\r\n reader.onloadend = () => {\r\n const buffer = Buffer.from(reader.result)\r\n ipfs.add(buffer)\r\n .then(files => {\r\n resolve(files)\r\n })\r\n .catch(error => reject(error))\r\n }\r\n reader.readAsArrayBuffer(file)\r\n })\r\n}", "function test_transform() {\n var f = function(x) {\n return Number($(x)) + 1;\n };\n\n\n var plan1 = tasks(\"ns:identity\").plan({\n x: [0, 1]\n });\n\n var plan2 = tasks(\"ns:mult\").plan({\n x: transform(f, plan1),\n y: [3, 5]\n });\n\n // Optimize and run\n // Should be an array of XML values 3, 6, 5, 10\n var result = plan2.run();\n check_array(result, [3, 5, 6, 10]);\n}", "function Transform() { // eslint-disable-line no-unused-vars\n\n var request = new XMLHttpRequest();\n\n setLocalStorageItem('code', cppEditor.getValue());\n setLocalStorageItem('insightsOptions', getInsightsOptions());\n\n request.onreadystatechange = function() {\n if (this.readyState == 4 && this.status == 200) {\n var response = JSON.parse(this.responseText);\n cppOutEditor.setValue(response.stdout);\n stdErrEditor.setValue(response.stderr);\n SetRunListeners();\n } else if (this.readyState == 4 && this.status != 200) {\n stdErrEditor.setValue('Sorry, your request failed');\n SetRunListeners();\n }\n };\n\n stdErrEditor.setValue('Waiting for response...');\n\n var url = buildURL('/api/v1/transform');\n\n request.open('POST', url, true);\n request.setRequestHeader('Content-Type', 'application/json;charset=UTF-8');\n\n var data = {};\n\n data.insightsOptions = getInsightsOptions();\n data.code = cppEditor.getValue();\n\n SetWaitForResultListeners();\n request.send(JSON.stringify(data));\n}", "async function run() {\n\t\t\t\tlet mdast = markdownToMdast(article.content);\n\t\t\t\ttransformRelativeImages(mdast, articleBaseUrl);\n\t\t\t\tlet hast = mdastToHast(mdast);\n\t\t\t\thastHighlight(hast);\n\t\t\t\tlet children = hastToReact(hast);\n\t\t\t\tsetPreview(children);\n\t\t\t}", "function transform(filename) {\n if (shouldStub(filename)) {\n return reactStub;\n } else {\n var content = fs.readFileSync(filename, 'utf8');\n return ReactTools.transform(content, {harmony: true});\n }\n}", "function runSync(node, file) {\n var result\n var complete\n\n run(node, file, done)\n\n assertDone('runSync', 'run', complete)\n\n return result\n\n function done(error, tree) {\n complete = true\n result = tree\n bail(error)\n }\n }", "function runSync(node, file) {\n var result\n var complete\n\n run(node, file, done)\n\n assertDone('runSync', 'run', complete)\n\n return result\n\n function done(error, tree) {\n complete = true\n result = tree\n bail(error)\n }\n }", "async function uploadFile(file) {\n return new Promise((resolve, reject) => {\n const reader = new FileReader()\n reader.onloadend = () => {\n const buffer = Buffer.from(reader.result)\n ipfs.add(buffer)\n .then(files => {\n resolve(files)\n })\n .catch(error => reject(error))\n }\n reader.readAsArrayBuffer(file)\n })\n}", "async processXmlFile(xmlFile) {\n const response = await fetch(xmlFile);\n const xmlData = await response.text();\n\n const parser = new DOMParser();\n const doc = parser.parseFromString(xmlData, \"text/xml\");\n\n this.processDoc(xmlFile, doc);\n }", "function convert (src, filter) {\n return new Promise((resolve, reject) => {\n fs.readFile(path.join(__dirname, 'uploads', src), (err, buffer) => {\n if (err) return reject(err)\n\n const result = effects.apply(buffer, filter, {})\n resolve(result)\n })\n })\n}", "function runSync(node, file) {\n var result;\n var complete;\n\n run(node, file, done);\n\n assertDone('runSync', 'run', complete);\n\n return result\n\n function done(error, tree) {\n complete = true;\n result = tree;\n bail(error);\n }\n }", "function transmorph( xslSrc, file, filterKey, filterValue )\r\n{\r\n var result = transform( xslSrc, filterKey, filterValue );\r\n saveFile( result, file );\r\n}", "async load () {}", "function runSync(node, file) {\n var complete = false\n var result\n\n run(node, file, done)\n\n assertDone('runSync', 'run', complete)\n\n return result\n\n function done(err, tree) {\n complete = true\n bail(err)\n result = tree\n }\n }", "function runSync(node, file) {\n var complete = false\n var result\n\n run(node, file, done)\n\n assertDone('runSync', 'run', complete)\n\n return result\n\n function done(err, tree) {\n complete = true\n bail(err)\n result = tree\n }\n }", "function runSync(node, file) {\n var complete = false\n var result\n\n run(node, file, done)\n\n assertDone('runSync', 'run', complete)\n\n return result\n\n function done(err, tree) {\n complete = true\n bail(err)\n result = tree\n }\n }", "function runSync(node, file) {\n var complete = false\n var result\n\n run(node, file, done)\n\n assertDone('runSync', 'run', complete)\n\n return result\n\n function done(err, tree) {\n complete = true\n bail(err)\n result = tree\n }\n }", "function runSync(node, file) {\n var complete = false\n var result\n\n run(node, file, done)\n\n assertDone('runSync', 'run', complete)\n\n return result\n\n function done(err, tree) {\n complete = true\n bail(err)\n result = tree\n }\n }", "function runSync(node, file) {\n var complete = false\n var result\n\n run(node, file, done)\n\n assertDone('runSync', 'run', complete)\n\n return result\n\n function done(err, tree) {\n complete = true\n bail(err)\n result = tree\n }\n }", "function processSync(doc) {\n var file;\n var complete;\n\n freeze();\n assertParser('processSync', processor.Parser);\n assertCompiler('processSync', processor.Compiler);\n file = vfile(doc);\n\n process(file, done);\n\n assertDone('processSync', 'process', complete);\n\n return file\n\n function done(error) {\n complete = true;\n bail(error);\n }\n }", "process (filepath) {\n\t\tlet {\n\t\t\tchassis,\n\t\t\tgenerateNamespacedSelector,\n\t\t\tisNamespaced,\n\t\t\tnamespaceSelectors,\n\t\t\tprocessImports,\n\t\t\tprocessNesting,\n\t\t\tprocessAtRules,\n\t\t\tprocessMixins,\n\t\t\tprocessNot,\n\t\t\tprocessFunctions,\n\t\t\tstoreAtRules,\n\t\t\ttypographyEngineIsInitialized\n\t\t} = this\n\n\t\tlet {\n\t\t\tatRules,\n\t\t\tpost,\n\t\t\tsettings,\n\t\t\tutils\n\t\t} = chassis\n\n\t\tlet tasks = new NGN.Tasks()\n\t\tlet sourceMap\n\n\t\ttasks.add('Processing Imports', next => {\n\t\t\tif (typographyEngineIsInitialized) {\n\t\t\t\tthis.tree.walkAtRules('import', atRule => {\n\t\t\t\t\tchassis.imports.push(atRule.params)\n\t\t\t\t\tatRule.remove()\n\t\t\t\t})\n\t\t\t}\n\n\t\t\tprocessImports()\n\t\t\tprocessNesting()\n\t\t\tnext()\n\t\t})\n\n\t\ttasks.add('Processing Mixins', next => {\n\t\t\tprocessMixins()\n\t\t\tprocessNot()\n\t\t\tprocessNesting()\n\n\t\t\tnext()\n\t\t})\n\n\t\ttasks.add('Processing Functions', next => {\n\t\t\tprocessFunctions()\n\t\t\tnext()\n\t\t})\n\n\t\ttasks.add('Namespacing Selectors', next => {\n\t\t\tnamespaceSelectors()\n\t\t\tnext()\n\t\t})\n\n\t\tif (typographyEngineIsInitialized) {\n\t\t\ttasks.add('Initializing Typography Engine', next => {\n\t\t\t\tthis.tree = this.core.css.append(this.tree)\n\t\t\t\tnext()\n\t\t\t})\n\t\t}\n\n\t\ttasks.add('Running Post-Processing Routines', next => {\n\t\t\tthis.tree.walkAtRules('chassis-post', atRule => {\n\t\t\t\tlet data = Object.assign({\n\t\t\t\t\troot: this.tree,\n\t\t\t\t\tatRule\n\t\t\t\t}, atRules.getProperties(atRule))\n\n\t\t\t\tpost.process(data)\n\t\t\t})\n\n\t\t\tnext()\n\t\t})\n\n\t\ttasks.add('Processing CSS4 Syntax', next => {\n\t\t\tenv.process(this.tree, {from: filepath}, settings.envCfg).then(processed => {\n\t\t\t\tthis.tree = processed.root\n\t\t\t\tnext()\n\t\t\t}, err => console.error(err))\n\t\t})\n\n\t\t// tasks.add('Merging matching adjacent rules...', next => {\n\t\t// \toutput = mergeAdjacentRules.process(output.toString())\n\t\t// \tnext()\n\t\t// })\n\n\t\ttasks.add('Beautifying Output', next => {\n\t\t\tremoveComments.process(this.tree).then(result => {\n\t\t\t\tperfectionist.process(result.css).then(result => {\n\t\t\t\t\tthis.tree = result.root\n\n\t\t\t\t\t// Remove empty rulesets\n\t\t\t\t\tthis.tree.walkRules(rule => {\n\t\t\t\t\t\tif (rule.nodes.length === 0) {\n\t\t\t\t\t\t\trule.remove()\n\t\t\t\t\t\t\treturn\n\t\t\t\t\t\t}\n\t\t\t\t\t})\n\n\t\t\t\t\tnext()\n\t\t\t\t}, () => {\n\t\t\t\t\tthis.emit('processing.error', new Error('Error Beautifying Output'))\n\t\t\t\t})\n\t\t\t}, () => {\n\t\t\t\tthis.emit('processing.error', new Error('Error Removing Comments'))\n\t\t\t})\n\t\t})\n\n\t\tif (settings.minify) {\n\t\t\tlet minified\n\n\t\t\ttasks.add('Minifying Output', next => {\n\t\t\t\tminified = new CleanCss({\n\t\t\t\t\tsourceMap: settings.sourceMap\n\t\t\t\t}).minify(this.tree.toString())\n\n\t\t\t\tthis.tree = minified.styles\n\t\t\t\tnext()\n\t\t\t})\n\n\t\t\tif (settings.sourceMap) {\n\t\t\t\ttasks.add('Generating source map', next => {\n\t\t\t\t\tsourceMap = minified.sourceMap.toString()\n\t\t\t\t\tnext()\n\t\t\t\t})\n\t\t\t}\n\t\t}\n\n\t\t// tasks.on('taskstart', evt => console.log(`${evt.name}...`))\n\t\t// tasks.on('taskcomplete', evt => console.log('Done.'))\n\n\t\ttasks.on('complete', () => this.emit('processing.complete', {\n\t\t\tcss: this.tree.toString(),\n\t\t\tsourceMap\n\t\t}))\n\n\t\tthis.emit('processing')\n\t\ttasks.run(true)\n\t}", "function processEach(params, file, done) {\r\n console.log(\"Parsing file: \", file);\r\n parseUtils\r\n .parseFile(file)\r\n .then(function(parseResult) {\r\n // save the original source code.\r\n params.sourceStore[file] = parseResult.src;\r\n\r\n // adapt our block ID generator for this file.\r\n var blockIDGen = function(blockInfo) {\r\n return params.idGenerator.newID({\r\n script: file,\r\n func: blockInfo.func\r\n });\r\n };\r\n\r\n // instrument the code.\r\n var result = instrument(\r\n parseResult.src,\r\n parseResult.ast,\r\n blockIDGen,\r\n params\r\n );\r\n\r\n // write the modified code back to the original file.\r\n fs.writeFileSync(file, result.result, \"utf8\");\r\n\r\n // just return the block & function data.\r\n done(null, {\r\n blocks: result.blocks,\r\n functions: result.functions\r\n });\r\n })\r\n .catch(function(e) {\r\n // don't kill the whole process.\r\n console.error(\"Problem instrumenting file. \", e, \" in file: \", file);\r\n done(null, { blocks: [], functions: [] });\r\n })\r\n .done();\r\n}", "function processSync(doc) {\n var file\n var complete\n\n freeze()\n assertParser('processSync', processor.Parser)\n assertCompiler('processSync', processor.Compiler)\n file = vfile(doc)\n\n process(file, done)\n\n assertDone('processSync', 'process', complete)\n\n return file\n\n function done(error) {\n complete = true\n bail(error)\n }\n }", "function processSync(doc) {\n var file\n var complete\n\n freeze()\n assertParser('processSync', processor.Parser)\n assertCompiler('processSync', processor.Compiler)\n file = vfile(doc)\n\n process(file, done)\n\n assertDone('processSync', 'process', complete)\n\n return file\n\n function done(error) {\n complete = true\n bail(error)\n }\n }", "function file_load(file, callback) {\n\tif (!file) return; // No file found.\n\n\tlet reader = new FileReader();\n\n\treader.onload = event => callback(sched_parse(\n\t\tevent.target.result\n\t), file.path);\n\n\treader.readAsText(file);\n}", "transform(filePath, fileContent, dependencies = {}) {\n\t\t\tif (filePath === textureList) {\n\t\t\t\t/**\n\t\t\t\t * The \"dependencies\" object always contains the files that were\n\t\t\t\t * required earlier. Structure: { [filePath]: fileContent }\n\t\t\t\t * We're only interested in the file paths in this case\n\t\t\t\t */\n\t\t\t\treturn Object.keys(dependencies).map((dep) => {\n\t\t\t\t\tconst parts = dep.split('.')\n\t\t\t\t\tparts.pop() // Removes the file extension\n\t\t\t\t\treturn parts.join('.')\n\t\t\t\t})\n\t\t\t}\n\t\t}", "function process(file, enc, callback) {\n /*jshint validthis:true*/\n\n // Do nothing if no contents\n if (file.isNull()) {\n return callback();\n }\n if (file.isStream()) {\n this.emit(\"error\",\n new gutil.PluginError(PLUGIN_NAME, \"Stream content is not supported\"));\n return callback();\n }\n // check if file.contents is a `Buffer`\n if (file.isBuffer() || file.isFile()) {\n var parser = imagesize.Parser();\n\n var retStatus = parser.parse(file.contents);\n if (imagesize.Parser.DONE === retStatus) {\n var result = parser.getResult();\n result.file = libpath.relative(file.base, file.path)\n list.push(result);\n }\n }\n return callback();\n }", "loadFile(file, module, x, y) {\n var dsp_code;\n var reader = new FileReader();\n var ext = file.name.toString().split('.').pop();\n var filename = file.name.toString().split('.').shift();\n var type;\n if (ext == \"dsp\") {\n type = \"dsp\";\n reader.readAsText(file);\n }\n else if (ext == \"json\") {\n type = \"json\";\n reader.readAsText(file);\n }\n else if (ext == \"jfaust\") {\n type = \"jfaust\";\n reader.readAsText(file);\n }\n else if (ext == \".polydsp\") {\n type = \"poly\";\n reader.readAsText(file);\n }\n else {\n throw new Error(Utilitary.messageRessource.errorObjectNotFaustCompatible);\n }\n reader.onloadend = (e) => {\n dsp_code = \"process = vgroup(\\\"\" + filename + \"\\\",environment{\" + reader.result + \"}.process);\";\n if (!module) {\n if (type == \"dsp\") {\n this.compileFaust({ isMidi: false, name: filename, sourceCode: dsp_code, x: x, y: y, callback: (factory) => { this.createModule(factory); } });\n }\n else if (type == \"jfaust\") {\n Utilitary.currentScene.recallScene(reader.result);\n }\n else if (type == \"poly\") {\n this.compileFaust({ isMidi: true, name: filename, sourceCode: dsp_code, x: x, y: y, callback: (factory) => { this.createModule(factory); } });\n }\n }\n else {\n if (type == \"dsp\") {\n module.isMidi = false;\n module.update(filename, dsp_code);\n }\n else if (type == \"jfaust\") {\n Utilitary.currentScene.recallScene(reader.result);\n }\n else if (type == \"poly\") {\n module.isMidi = true;\n module.update(filename, dsp_code);\n }\n }\n };\n }", "async function translate(file_path, book_id, trans_langs) {\n var arguments = [];\n arguments.push(file_path);\n arguments.push(book_id);\n for (var i = 0; i < trans_langs.length; i++) {\n arguments.push(trans_langs[i]);\n }\n console.log(arguments);\n let options = {\n mode: \"text\",\n executable: \"python3.9\",\n pythonOptions: [\"-u\"], // get print results in real-time\n scriptPath:\n \"./public/translation\",\n args: arguments, //An argument which can be accessed in the script using sys.argv[1]\n };\n console.log(\"entered the async\")\n try{\n await PythonShell.run(\n \"ParseAndTranslate.py\",\n options,\n function (err, result) {\n if (err) throw err;\n //result is an array consisting of messages collected\n //during execution of script.\n console.log(\"result: \", result.toString());\n for(var i = 0 ; i < trans_langs.length ; i++){\n console.log(\"doing something in this loop for downloads\");\n uploadTranslatedBook(book_id, trans_langs[i]);\n }\n }\n );console.log(\"ok this is it\")} catch (error){\n console.log(\"ded\")\n console.log(error)\n }\n console.log(\"exiting the async\")\n \n}", "function processSync(doc) {\n var complete = false\n var file\n\n freeze()\n assertParser('processSync', processor.Parser)\n assertCompiler('processSync', processor.Compiler)\n file = vfile(doc)\n\n process(file, done)\n\n assertDone('processSync', 'process', complete)\n\n return file\n\n function done(err) {\n complete = true\n bail(err)\n }\n }", "function processSync(doc) {\n var complete = false\n var file\n\n freeze()\n assertParser('processSync', processor.Parser)\n assertCompiler('processSync', processor.Compiler)\n file = vfile(doc)\n\n process(file, done)\n\n assertDone('processSync', 'process', complete)\n\n return file\n\n function done(err) {\n complete = true\n bail(err)\n }\n }", "function processSync(doc) {\n var complete = false\n var file\n\n freeze()\n assertParser('processSync', processor.Parser)\n assertCompiler('processSync', processor.Compiler)\n file = vfile(doc)\n\n process(file, done)\n\n assertDone('processSync', 'process', complete)\n\n return file\n\n function done(err) {\n complete = true\n bail(err)\n }\n }", "function processSync(doc) {\n var complete = false\n var file\n\n freeze()\n assertParser('processSync', processor.Parser)\n assertCompiler('processSync', processor.Compiler)\n file = vfile(doc)\n\n process(file, done)\n\n assertDone('processSync', 'process', complete)\n\n return file\n\n function done(err) {\n complete = true\n bail(err)\n }\n }", "function processSync(doc) {\n var complete = false\n var file\n\n freeze()\n assertParser('processSync', processor.Parser)\n assertCompiler('processSync', processor.Compiler)\n file = vfile(doc)\n\n process(file, done)\n\n assertDone('processSync', 'process', complete)\n\n return file\n\n function done(err) {\n complete = true\n bail(err)\n }\n }", "function processSync(doc) {\n var complete = false\n var file\n\n freeze()\n assertParser('processSync', processor.Parser)\n assertCompiler('processSync', processor.Compiler)\n file = vfile(doc)\n\n process(file, done)\n\n assertDone('processSync', 'process', complete)\n\n return file\n\n function done(err) {\n complete = true\n bail(err)\n }\n }", "function runSync(node, file) {\n var complete = false;\n var result;\n\n run(node, file, done);\n\n assertDone('runSync', 'run', complete);\n\n return result;\n\n function done(err, tree) {\n complete = true;\n bail(err);\n result = tree;\n }\n }", "transformFile (file, done) {\n if ((this.options.resizeWidth || this.options.resizeHeight) && file.type.match(/image.*/)) return this.resizeImage(file, this.options.resizeWidth, this.options.resizeHeight, this.options.resizeMethod, done);\n else return done(file);\n }" ]
[ "0.65098184", "0.65098184", "0.64999324", "0.62945503", "0.57289356", "0.5724962", "0.5722019", "0.56828", "0.549961", "0.549961", "0.5451992", "0.54037726", "0.53396654", "0.5319687", "0.52944106", "0.5294002", "0.52616453", "0.5174298", "0.5174298", "0.5174298", "0.5174298", "0.5174298", "0.5174298", "0.51657706", "0.51657623", "0.51657623", "0.51654565", "0.50930834", "0.50930834", "0.50915104", "0.5078763", "0.50743836", "0.5070862", "0.5070862", "0.5046486", "0.503776", "0.50298136", "0.49931455", "0.49865487", "0.4959635", "0.4959635", "0.4959635", "0.4959635", "0.4959635", "0.49431336", "0.49183393", "0.49100354", "0.48838702", "0.48686874", "0.48360172", "0.47798392", "0.47788447", "0.4775452", "0.47648108", "0.47609827", "0.47537547", "0.47478893", "0.47478893", "0.47268388", "0.47220805", "0.47162214", "0.4714042", "0.47121868", "0.47072375", "0.47072375", "0.47013038", "0.470046", "0.46989667", "0.46751875", "0.4656168", "0.46499643", "0.4645081", "0.4645081", "0.4645081", "0.4645081", "0.4645081", "0.4645081", "0.46379733", "0.46324635", "0.46202937", "0.46132275", "0.46132275", "0.4592882", "0.4591724", "0.45837256", "0.45674625", "0.45563996", "0.4553172", "0.4553172", "0.4553172", "0.4553172", "0.4553172", "0.4553172", "0.45504704", "0.45486853" ]
0.648857
8
Run transforms on a Unist node representation of a file (in string or VFile representation), sync.
function runSync(node, file) { var complete = false var result run(node, file, done) assertDone('runSync', 'run', complete) return result function done(err, tree) { complete = true bail(err) result = tree } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function run(node, file, cb) {\n assertNode(node)\n freeze()\n\n if (!cb && typeof file === 'function') {\n cb = file\n file = null\n }\n\n if (!cb) {\n return new Promise(executor)\n }\n\n executor(null, cb)\n\n function executor(resolve, reject) {\n transformers.run(node, vfile(file), done)\n\n function done(error, tree, file) {\n tree = tree || node\n if (error) {\n reject(error)\n } else if (resolve) {\n resolve(tree)\n } else {\n cb(null, tree, file)\n }\n }\n }\n }", "function run(node, file, cb) {\n assertNode(node)\n freeze()\n\n if (!cb && typeof file === 'function') {\n cb = file\n file = null\n }\n\n if (!cb) {\n return new Promise(executor)\n }\n\n executor(null, cb)\n\n function executor(resolve, reject) {\n transformers.run(node, vfile(file), done)\n\n function done(error, tree, file) {\n tree = tree || node\n if (error) {\n reject(error)\n } else if (resolve) {\n resolve(tree)\n } else {\n cb(null, tree, file)\n }\n }\n }\n }", "function run(node, file, cb) {\n assertNode(node)\n freeze()\n\n if (!cb && typeof file === 'function') {\n cb = file\n file = null\n }\n\n if (!cb) {\n return new Promise(executor)\n }\n\n executor(null, cb)\n\n function executor(resolve, reject) {\n transformers.run(node, vfile(file), done)\n\n function done(err, tree, file) {\n tree = tree || node\n if (err) {\n reject(err)\n } else if (resolve) {\n resolve(tree)\n } else {\n cb(null, tree, file)\n }\n }\n }\n }", "function run(node, file, cb) {\n assertNode(node)\n freeze()\n\n if (!cb && typeof file === 'function') {\n cb = file\n file = null\n }\n\n if (!cb) {\n return new Promise(executor)\n }\n\n executor(null, cb)\n\n function executor(resolve, reject) {\n transformers.run(node, vfile(file), done)\n\n function done(err, tree, file) {\n tree = tree || node\n if (err) {\n reject(err)\n } else if (resolve) {\n resolve(tree)\n } else {\n cb(null, tree, file)\n }\n }\n }\n }", "function run(node, file, cb) {\n assertNode(node)\n freeze()\n\n if (!cb && typeof file === 'function') {\n cb = file\n file = null\n }\n\n if (!cb) {\n return new Promise(executor)\n }\n\n executor(null, cb)\n\n function executor(resolve, reject) {\n transformers.run(node, vfile(file), done)\n\n function done(err, tree, file) {\n tree = tree || node\n if (err) {\n reject(err)\n } else if (resolve) {\n resolve(tree)\n } else {\n cb(null, tree, file)\n }\n }\n }\n }", "function run(node, file, cb) {\n assertNode(node)\n freeze()\n\n if (!cb && typeof file === 'function') {\n cb = file\n file = null\n }\n\n if (!cb) {\n return new Promise(executor)\n }\n\n executor(null, cb)\n\n function executor(resolve, reject) {\n transformers.run(node, vfile(file), done)\n\n function done(err, tree, file) {\n tree = tree || node\n if (err) {\n reject(err)\n } else if (resolve) {\n resolve(tree)\n } else {\n cb(null, tree, file)\n }\n }\n }\n }", "function run(node, file, cb) {\n assertNode(node)\n freeze()\n\n if (!cb && typeof file === 'function') {\n cb = file\n file = null\n }\n\n if (!cb) {\n return new Promise(executor)\n }\n\n executor(null, cb)\n\n function executor(resolve, reject) {\n transformers.run(node, vfile(file), done)\n\n function done(err, tree, file) {\n tree = tree || node\n if (err) {\n reject(err)\n } else if (resolve) {\n resolve(tree)\n } else {\n cb(null, tree, file)\n }\n }\n }\n }", "function run(node, file, cb) {\n assertNode(node)\n freeze()\n\n if (!cb && typeof file === 'function') {\n cb = file\n file = null\n }\n\n if (!cb) {\n return new Promise(executor)\n }\n\n executor(null, cb)\n\n function executor(resolve, reject) {\n transformers.run(node, vfile(file), done)\n\n function done(err, tree, file) {\n tree = tree || node\n if (err) {\n reject(err)\n } else if (resolve) {\n resolve(tree)\n } else {\n cb(null, tree, file)\n }\n }\n }\n }", "function run(node, file, cb) {\n assertNode(node);\n freeze();\n\n if (!cb && typeof file === 'function') {\n cb = file;\n file = null;\n }\n\n if (!cb) {\n return new Promise(executor)\n }\n\n executor(null, cb);\n\n function executor(resolve, reject) {\n transformers.run(node, vfile(file), done);\n\n function done(error, tree, file) {\n tree = tree || node;\n if (error) {\n reject(error);\n } else if (resolve) {\n resolve(tree);\n } else {\n cb(null, tree, file);\n }\n }\n }\n }", "function run(node, file, cb) {\n assertNode(node);\n freeze();\n\n if (!cb && func(file)) {\n cb = file;\n file = null;\n }\n\n if (!cb) {\n return new Promise(executor);\n }\n\n executor(null, cb);\n\n function executor(resolve, reject) {\n transformers.run(node, vfile(file), done);\n\n function done(err, tree, file) {\n tree = tree || node;\n if (err) {\n reject(err);\n } else if (resolve) {\n resolve(tree);\n } else {\n cb(null, tree, file);\n }\n }\n }\n }", "function transformFileSync(filename) {\n\t var opts = arguments.length <= 1 || arguments[1] === undefined ? {} : arguments[1];\n\n\t opts.filename = filename;\n\t return _transformation2[\"default\"](_fs2[\"default\"].readFileSync(filename, \"utf8\"), opts);\n\t}", "function transformFileSync(filename) {\n\t var opts = arguments.length <= 1 || arguments[1] === undefined ? {} : arguments[1];\n\n\t opts.filename = filename;\n\t return _transformation2[\"default\"](_fs2[\"default\"].readFileSync(filename, \"utf8\"), opts);\n\t}", "function transformFileSync(filename) {\n var opts = arguments.length <= 1 || arguments[1] === undefined ? {} : arguments[1];\n\n opts.filename = filename;\n return _transformation2[\"default\"](_fs2[\"default\"].readFileSync(filename, \"utf8\"), opts);\n}", "function transform(file, cb) {\n gutil.log('Preprocessing:', file.path);\n // read and modify file contents\n var fileContents = String(file.contents);\n fileContents = fileContents.replace(/^\\s*(import .*?)(?:;|$)/gm,\n function(str, group1) {\n return 'jsio(\"' + group1 + '\");';\n });\n file.contents = new Buffer(fileContents);\n\n // if there was some error, just pass as the first parameter here\n cb(null, file);\n }", "function transform(context, file, fileSet, next) {\n if (stats(file).fatal) {\n next()\n } else {\n debug('Transforming document `%s`', file.path)\n context.processor.run(context.tree, file, onrun)\n }\n\n function onrun(error, node) {\n debug('Transformed document (error: %s)', error)\n context.tree = node\n next(error)\n }\n}", "function tjs_gulp_transformFile(file) {\n\t// console.log(file)\n\treturn `gulp.task('${file.file}', function() {\n\tlet pipe = gulp.src('${file.file}', { base: __dirname })\n\n\t// pre-piping\n\tif (typeof __t.start == 'function')\n\t\tpipe = pipe.pipe(__t.start.bind(pipe)())\n\n\t${file.transforms.length == 0 ? `if (typeof __t.blank == 'function') pipe = __t.blank.bind(pipe)()` : ''}\n\n\t${file.transforms.map(t => `// pipe setup for ${t.name}\n\tpipe = __t.${t.name}.bind(pipe)${t.argsTuple}\n\tif (typeof __t.each == 'function') pipe = pipe.pipe(__t.each.bind(pipe)())`).join('\\n\\t')}\n\n\t// post-piping\n\tif (typeof __t.finish == 'function')\n\t\tpipe = pipe.pipe(__t.finish.bind(pipe)())\n\t\n\treturn pipe\n})`\n}", "function transformSync(src, filename, options) {\n validateArguments(src, filename);\n const normalizedOptions = options_1.validateTransformOptions(options);\n return transformFile(src, filename, normalizedOptions);\n}", "_transformFiles(files, done) {\n let transformedFiles = [];\n // Clumsy way of handling asynchronous calls, until I get to add a proper Future library.\n let doneCounter = 0;\n for(let i = 0; i < files.length; i++)this.options.transformFile.call(this, files[i], (transformedFile)=>{\n transformedFiles[i] = transformedFile;\n if (++doneCounter === files.length) done(transformedFiles);\n });\n }", "async function main() {\n const resolvedPaths = globby.sync(files as string[])\n const transformationModule = loadTransformationModule(transformationName)\n\n log(`Processing ${resolvedPaths.length} files…`)\n\n for (const p of resolvedPaths) {\n debug(`Processing ${p}…`)\n const fileInfo = {\n path: p,\n source: fs.readFileSync(p).toString(),\n }\n try {\n const result = runTransformation(\n fileInfo,\n transformationModule,\n params as object\n )\n fs.writeFileSync(p, result)\n } catch (e) {\n console.error(e)\n }\n }\n}", "transformFile(data, filePath) {\n this.updateBabelConfig(filePath);\n return babel.transformSync(data, this.babelConfig.options);\n }", "function transform$5(context, file, fileSet, next) {\n if (stats$4(file).fatal) {\n next();\n } else {\n debug$7('Transforming document `%s`', file.path);\n context.processor.run(context.tree, file, onrun);\n }\n\n function onrun(error, node) {\n debug$7('Transformed document (error: %s)', error);\n context.tree = node;\n next(error);\n }\n}", "function runSync(node, file) {\n var result\n var complete\n\n run(node, file, done)\n\n assertDone('runSync', 'run', complete)\n\n return result\n\n function done(error, tree) {\n complete = true\n result = tree\n bail(error)\n }\n }", "function runSync(node, file) {\n var result\n var complete\n\n run(node, file, done)\n\n assertDone('runSync', 'run', complete)\n\n return result\n\n function done(error, tree) {\n complete = true\n result = tree\n bail(error)\n }\n }", "function runSync(node, file) {\n var result;\n var complete;\n\n run(node, file, done);\n\n assertDone('runSync', 'run', complete);\n\n return result\n\n function done(error, tree) {\n complete = true;\n result = tree;\n bail(error);\n }\n }", "runTransformation(input) {\n return this.transform(input)\n }", "function Transform() {}", "function Transform() {}", "function Transform() {}", "function Transform() {}", "function Transform() {}", "async function transform(file, dir = 'lib') {\n const dest = file.replace('/src/', `/${dir}/`)\n await fs.ensureDir(path.dirname(dest))\n\n if (fs.statSync(file).isDirectory()) return\n\n if (file.endsWith('.svelte')) {\n const source = await fs.readFile(file, 'utf8')\n const item = await preprocess(\n source,\n autoprocessor({\n typescript: {\n tsconfigFile: path.resolve(rootDir, 'tsconfig-base.json'),\n },\n // https://github.com/sveltejs/svelte/issues/189#issuecomment-586142198\n replace: [\n [/(>)[\\s]*([<{])/g, '$1$2'],\n [/({[/:][a-z]+})[\\s]*([<{])/g, '$1$2'],\n [/({[#:][a-z]+ .+?})[\\s]*([<{])/g, '$1$2'],\n [/([>}])[\\s]+(<|{[/#:][a-z][^}]*})/g, '$1$2'],\n ],\n }),\n {\n filename: file,\n }\n )\n await fs.writeFile(\n dest,\n item.code.replace('<script lang=\"ts\">', '<script>')\n )\n } else {\n await fs.copyFile(file, dest)\n }\n}", "async function treeify(forEachFile) {\n const treeRoot = process.cwd()\n const ignorePattern = await _ignore()\n const tree = gl.baseCase\n\n if (await fs.pathExists(treeRoot)) {\n await Promise.all((await rget(treeRoot, ignorePattern)).map(file => forEachFile(tree, file)))\n }\n return tree\n}", "function transmorph( xslSrc, file, filterKey, filterValue )\r\n{\r\n var result = transform( xslSrc, filterKey, filterValue );\r\n saveFile( result, file );\r\n}", "function runSync(node, file) {\n var complete = false;\n var result;\n\n run(node, file, done);\n\n assertDone('runSync', 'run', complete);\n\n return result;\n\n function done(err, tree) {\n complete = true;\n bail(err);\n result = tree;\n }\n }", "static transform() {}", "function processSync(doc) {\n var file;\n var complete;\n\n freeze();\n assertParser('processSync', processor.Parser);\n assertCompiler('processSync', processor.Compiler);\n file = vfile(doc);\n\n process(file, done);\n\n assertDone('processSync', 'process', complete);\n\n return file\n\n function done(error) {\n complete = true;\n bail(error);\n }\n }", "function processSync(doc) {\n var file\n var complete\n\n freeze()\n assertParser('processSync', processor.Parser)\n assertCompiler('processSync', processor.Compiler)\n file = vfile(doc)\n\n process(file, done)\n\n assertDone('processSync', 'process', complete)\n\n return file\n\n function done(error) {\n complete = true\n bail(error)\n }\n }", "function processSync(doc) {\n var file\n var complete\n\n freeze()\n assertParser('processSync', processor.Parser)\n assertCompiler('processSync', processor.Compiler)\n file = vfile(doc)\n\n process(file, done)\n\n assertDone('processSync', 'process', complete)\n\n return file\n\n function done(error) {\n complete = true\n bail(error)\n }\n }", "async transform(mode) {\n // console.log('Mode:', mode, '->');\n try {\n const buffer = await readFile(`${this.file}`);\n\n // console.log('buffer argument:', buffer);\n\n let transformed;\n switch (mode) {\n // case 'soRandom':\n // case 'random':\n // transformed = await soRandom(buffer);\n // break;\n case 'shave':\n transformed = await shave(buffer);\n break;\n case 'angelOfMusic':\n case 'phantom':\n transformed = await angelOfMusic(buffer);\n break;\n case 'grayscale':\n case 'greyscale':\n transformed = await greyscale(buffer);\n break;\n // case 'randomlyPastel':\n // case 'pastel':\n // transformed = await randomlyPastel(buffer);\n // break;\n default:\n // console.log(`Something is wrong. Output not modified.`);\n transformed = buffer;\n break;\n }\n\n writeFile(`${__dirname}/transformations/${transformed.output}`, transformed.buffer);\n console.log(transformed.message);\n } catch (err) {\n console.error('There was an error transforming your file:', err);\n }\n }", "function applyTransform(path, data, callback) {\n if(typeof data === \"function\") {\n callback = data;\n data = null;\n }\n\n var transform = getTransform(path);\n if(!transform) {\n return callback(null);\n }\n\n function _applyTransform(path, data) {\n transform.transform(path, data, function(err, transformed) {\n if(err) {\n console.error(\"[Bramble Error] unable to transform file\", path, err);\n return callback(err);\n }\n\n var transformedPath = transform.rewritePath(path);\n\n _fs.writeFile(transformedPath, transformed, function(err) {\n if(err) {\n console.error(\"[Bramble Error] unable to write transformed file\", transformedPath, err);\n return callback(err);\n }\n\n Handlers.handleFile(transformedPath, data, function(err) {\n if(err) {\n console.error(\"[Bramble Error] unable to rewrite URL for transformed file\", transformedPath, err);\n return callback(err);\n }\n\n // Refresh the file tree so this new file shows up.\n CommandManager.execute(Commands.FILE_REFRESH).always(callback);\n });\n });\n });\n }\n\n if(!data) {\n _fs.readFile(path, \"utf8\", function(err, data) {\n if(err) {\n if(err.code === \"ENOENT\") {\n // File is being created (not written yet) use empty string\n data = \"\";\n } else {\n // Some other error, send it back\n return callback(err);\n }\n }\n\n _applyTransform(path, data);\n });\n } else {\n _applyTransform(path, data);\n }\n }", "function processSync(doc) {\n var complete = false\n var file\n\n freeze()\n assertParser('processSync', processor.Parser)\n assertCompiler('processSync', processor.Compiler)\n file = vfile(doc)\n\n process(file, done)\n\n assertDone('processSync', 'process', complete)\n\n return file\n\n function done(err) {\n complete = true\n bail(err)\n }\n }", "function processSync(doc) {\n var complete = false\n var file\n\n freeze()\n assertParser('processSync', processor.Parser)\n assertCompiler('processSync', processor.Compiler)\n file = vfile(doc)\n\n process(file, done)\n\n assertDone('processSync', 'process', complete)\n\n return file\n\n function done(err) {\n complete = true\n bail(err)\n }\n }", "function processSync(doc) {\n var complete = false\n var file\n\n freeze()\n assertParser('processSync', processor.Parser)\n assertCompiler('processSync', processor.Compiler)\n file = vfile(doc)\n\n process(file, done)\n\n assertDone('processSync', 'process', complete)\n\n return file\n\n function done(err) {\n complete = true\n bail(err)\n }\n }", "function processSync(doc) {\n var complete = false\n var file\n\n freeze()\n assertParser('processSync', processor.Parser)\n assertCompiler('processSync', processor.Compiler)\n file = vfile(doc)\n\n process(file, done)\n\n assertDone('processSync', 'process', complete)\n\n return file\n\n function done(err) {\n complete = true\n bail(err)\n }\n }", "function processSync(doc) {\n var complete = false\n var file\n\n freeze()\n assertParser('processSync', processor.Parser)\n assertCompiler('processSync', processor.Compiler)\n file = vfile(doc)\n\n process(file, done)\n\n assertDone('processSync', 'process', complete)\n\n return file\n\n function done(err) {\n complete = true\n bail(err)\n }\n }", "function processSync(doc) {\n var complete = false\n var file\n\n freeze()\n assertParser('processSync', processor.Parser)\n assertCompiler('processSync', processor.Compiler)\n file = vfile(doc)\n\n process(file, done)\n\n assertDone('processSync', 'process', complete)\n\n return file\n\n function done(err) {\n complete = true\n bail(err)\n }\n }", "function processSync(doc) {\n var complete = false;\n var file;\n\n freeze();\n assertParser('processSync', processor.Parser);\n assertCompiler('processSync', processor.Compiler);\n file = vfile(doc);\n\n process(file, done);\n\n assertDone('processSync', 'process', complete);\n\n return file;\n\n function done(err) {\n complete = true;\n bail(err);\n }\n }", "function transform(file, cb) {\n // read and modify file contents\n console.log(file.history[0]);\n var lines = String(file.contents).replace(/\\r\\n/g, '\\n').split('\\n');\n var files = [];\n var found = false;\n\n for (var i = 0; i < lines.length; i++) {\n lines[i] = lines[i].replace(/http:\\/\\/www\\.iobroker\\.net\\/wp-content\\/uploads\\/\\//g, 'http://iobroker.net/wp-content/uploads/');\n lines[i] = lines[i].replace(/http:\\/\\/www\\.iobroker\\.net\\/wp-content\\/uploads\\//g, 'http://iobroker.net/wp-content/uploads/');\n lines[i] = lines[i].replace(/http:\\/\\/iobroker\\.net\\/wp-content\\/uploads\\/\\//g, 'http://iobroker.net/wp-content/uploads/');\n // [![](http://www.iobroker.net/wp-content/uploads//email_set.png)](http://www.iobroker.net/wp-content/uploads//email_set.png)]\n var m = lines[i].match(/(\\[caption[^\\]]*\\])?\\!\\[[^\\]]*\\]\\(http:\\/\\/iobroker\\.net\\/[^\\)]+\\)(\\]\\([^\\)]*\\))?\\]?(.*\\[\\/caption\\])?/g);\n if (m) {\n for (var j = 0; j < m.length; j++) {\n found = true;\n // try to extract caption\n var caption = m[j].match(/\\)\\]?(.+)\\[\\/caption\\]/);\n if (caption) {\n caption = caption[1].trim();\n }\n\n // change it to \\n![](img/filename_oldf_filename)\\n\n var mm = m[j].split('](')[1];\n mm = mm.replace(/\\).*$/, '');\n // noe we have \"http://www.iobroker.net/wp-content/uploads/email_set.png\"\n var fileName = mm.split('/').pop();\n var mdPath = file.history[0].replace(/\\\\/g, '/');\n var parts = mdPath.split('/');\n var mdFileName = parts.pop().replace(/\\.md$/, '');\n mdPath = parts.join('/');\n\n var task = {url: mm, name: mdPath + '/img/' + mdFileName + '_' + fileName, relative: 'img/' + mdFileName + '_' + fileName};\n bigTasks.push(task);\n lines[i] = lines[i].replace(m[j], '\\n![' + (caption || '') + '](' + task.relative + ')\\n');\n }\n }\n }\n /*downloadFiles(files, [], function (err) {\n if (found && (!err || !err.length)) {\n console.log('Write modified ' + file.history[0]);\n //file.contents = new Buffer(lines.join('\\n'));\n }\n\n // if there was some error, just pass as the first parameter here\n cb(null, file);\n });*/\n cb(null, file);\n }", "function transform(src, filename, options) {\n validateArguments(src, filename);\n return new Promise((resolve, reject) => {\n try {\n const res = transformSync(src, filename, options);\n resolve(res);\n }\n catch (error) {\n reject(error);\n }\n });\n}", "function transformFile(filename, opts, callback) {\n\t if (_lodashLangIsFunction2[\"default\"](opts)) {\n\t callback = opts;\n\t opts = {};\n\t }\n\n\t opts.filename = filename;\n\n\t _fs2[\"default\"].readFile(filename, function (err, code) {\n\t if (err) return callback(err);\n\n\t var result;\n\n\t try {\n\t result = _transformation2[\"default\"](code, opts);\n\t } catch (err) {\n\t return callback(err);\n\t }\n\n\t callback(null, result);\n\t });\n\t}", "function transformFile(filename, opts, callback) {\n\t if (_lodashLangIsFunction2[\"default\"](opts)) {\n\t callback = opts;\n\t opts = {};\n\t }\n\n\t opts.filename = filename;\n\n\t _fs2[\"default\"].readFile(filename, function (err, code) {\n\t if (err) return callback(err);\n\n\t var result;\n\n\t try {\n\t result = _transformation2[\"default\"](code, opts);\n\t } catch (err) {\n\t return callback(err);\n\t }\n\n\t callback(null, result);\n\t });\n\t}", "async transform() {\n if (this.options.minify) {\n await uglify(this);\n }\n }", "function _transform (node, callback) {\n return node.map(function(child, path, parent) {\n var replacement = callback(child, path, parent);\n return _transform(replacement, callback);\n });\n }", "function _transform (node, callback) {\n return node.map(function(child, path, parent) {\n var replacement = callback(child, path, parent);\n return _transform(replacement, callback);\n });\n }", "function _transform(node, callback) {\n return node.map(function (child, path, parent) {\n var replacement = callback(child, path, parent);\n return _transform(replacement, callback);\n });\n }", "fileNormalizeSync(fileNames){\n // If filenames is one filename, resolve it and return it's normalized value\n if (typeof fileNames === 'string' || fileNames instanceof String)\n return this._system.normalizeSync.call(this._system, this._preNormalize(fileNames));\n // If filenames is array, resolve all normalize promises\n fileNames = fileNames.map(this._preNormalize);\n return fileNames.map( fileName => this._system.normalizeSync.call(this._system, fileName), this)\n }", "set transform(value) {}", "set transform(value) {}", "set transform(value) {}", "set transform(value) {}", "updateLocalTransform()\n {\n // empty\n }", "transform(filePath, fileContent, dependencies = {}) {\n\t\t\tif (filePath === textureList) {\n\t\t\t\t/**\n\t\t\t\t * The \"dependencies\" object always contains the files that were\n\t\t\t\t * required earlier. Structure: { [filePath]: fileContent }\n\t\t\t\t * We're only interested in the file paths in this case\n\t\t\t\t */\n\t\t\t\treturn Object.keys(dependencies).map((dep) => {\n\t\t\t\t\tconst parts = dep.split('.')\n\t\t\t\t\tparts.pop() // Removes the file extension\n\t\t\t\t\treturn parts.join('.')\n\t\t\t\t})\n\t\t\t}\n\t\t}", "async function copyAndTransform(file, ampRuntimeVersion) {\n const originalHtml = await readFile(file);\n const ampFile = file.substring(1, file.length)\n .replace('.html', '.amp.html');\n const allTransformationsFile = file.substring(1, file.length)\n .replace('.html', '.all.html');\n const validTransformationsFile = file.substring(1, file.length)\n .replace('.html', '.valid.html');\n\n // Transform into valid optimized AMP\n ampOptimizer.setConfig({\n validAmp: true,\n verbose: true,\n });\n const validOptimizedHtml = await ampOptimizer.transformHtml(originalHtml);\n\n // Run all optimizations including versioned AMP runtime URLs\n ampOptimizer.setConfig({\n validAmp: false,\n verbose: true,\n });\n // The transformer needs the path to the original AMP document\n // to correctly setup AMP to canonical linking\n const optimizedHtml = await ampOptimizer.transformHtml(originalHtml, {\n ampUrl: ampFile,\n ampRuntimeVersion: ampRuntimeVersion,\n });\n writeFile(allTransformationsFile, optimizedHtml);\n writeFile(validTransformationsFile, validOptimizedHtml);\n // We change the path of the original AMP file to match the new\n // amphtml link and make the canonical link point to the transformed version.\n writeFile(ampFile, originalHtml);\n}", "async transform(chunk, encoding, cb) {\n\n // DRY method for handling each chunk as it comes in\n const do_transform = () => {\n // Write data to our fork stream. If it fails,\n // emit a 'drain' event\n if (!this._fork_stream.write(chunk)) {\n this._fork_stream.once('drain', () => {\n cb(null, chunk);\n });\n } else {\n // Push data back out to whatever is listening (if anything)\n // and let Node know we're ready for more data\n cb(null, chunk);\n }\n };\n\n // DRY method for handling errors when the arise from the\n // ClamAV Socket connection\n const handle_error = (err, is_infected=null, result=null) => {\n this._fork_stream.unpipe();\n this._fork_stream.destroy();\n this._clamav_transform.destroy();\n clear_scan_benchmark();\n\n // Finding an infected file isn't really an error...\n if (is_infected === true) {\n if (_scan_complete === false) {\n _scan_complete = true;\n this.emit('scan-complete', result);\n }\n this.emit('stream-infected', result); // just another way to catch an infected stream\n } else {\n this.emit('error', err);\n }\n };\n\n // If we haven't initialized a socket connection to ClamAV yet,\n // now is the time...\n if (!this._clamav_socket) {\n // We're using a PassThrough stream as a middle man to fork the input\n // into two paths... (1) ClamAV and (2) The final destination.\n this._fork_stream = new PassThrough();\n // Instantiate our custom Transform stream that coddles\n // chunks into the correct format for the ClamAV socket.\n this._clamav_transform = new NodeClamTransform({}, me.settings.debug_mode);\n // Setup an array to collect the responses from ClamAV\n this._clamav_response_chunks = [];\n\n try {\n // Get a connection to the ClamAV Socket\n this._clamav_socket = await me._init_socket('passthrough');\n if (me.settings.debug_mode) console.log(`${me.debug_label}: ClamAV Socket Initialized...`);\n\n // Setup a pipeline that will pass chunks through our custom Tranform and on to ClamAV\n this._fork_stream.pipe(this._clamav_transform).pipe(this._clamav_socket);\n\n // When the CLamAV socket connection is closed (could be after 'end' or because of an error)...\n this._clamav_socket.on('close', hadError => {\n if (me.settings.debug_mode) console.log(`${me.debug_label}: ClamAV socket has been closed! Because of Error:`, hadError);\n })\n // When the ClamAV socket connection ends (receives chunk)\n .on('end', () => {\n if (me.settings.debug_mode) console.log(`${me.debug_label}: ClamAV socket has received the last chunk!`);\n // Process the collected chunks\n const response = Buffer.concat(this._clamav_response_chunks);\n const result = me._process_result(response.toString('utf8'), null);\n this._clamav_response_chunks = [];\n if (me.settings.debug_mode) {\n console.log(`${me.debug_label}: Result of scan:`, result);\n console.log(`${me.debug_label}: It took ${_av_scan_time} seconds to scan the file(s).`);\n clear_scan_benchmark();\n }\n\n // NOTE: \"scan-complete\" could be called by the `handle_error` method.\n // We don't want to to double-emit this message.\n if (_scan_complete === false) {\n _scan_complete = true;\n this.emit('scan-complete', result);\n }\n })\n // If connection timesout.\n .on('timeout', () => {\n this.emit('timeout', new Error('Connection to host/socket has timed out'));\n if (me.settings.debug_mode) console.log(`${me.debug_label}: Connection to host/socket has timed out`);\n })\n // When the ClamAV socket is ready to receive packets (this will probably never fire here)\n .on('ready', () => {\n if (me.settings.debug_mode) console.log(`${me.debug_label}: ClamAV socket ready to receive`);\n })\n // When we are officially connected to the ClamAV socket (probably will never fire here)\n .on('connect', () => {\n if (me.settings.debug_mode) console.log(`${me.debug_label}: Connected to ClamAV socket`);\n })\n // If an error is emitted from the ClamAV socket\n .on('error', err => {\n console.error(`${me.debug_label}: Error emitted from ClamAV socket: `, err);\n handle_error(err);\n })\n // If ClamAV is sending stuff to us (ie, an \"OK\", \"Virus FOUND\", or \"ERROR\")\n .on('data', cv_chunk => {\n // Push this chunk to our results collection array\n this._clamav_response_chunks.push(cv_chunk);\n if (me.settings.debug_mode) console.log(`${me.debug_label}: Got result!`, cv_chunk.toString());\n\n // Parse what we've gotten back from ClamAV so far...\n const response = Buffer.concat(this._clamav_response_chunks);\n const result = me._process_result(response.toString(), null);\n\n // If there's an error supplied or if we detect a virus, stop stream immediately.\n if (result instanceof NodeClamError || (typeof result === 'object' && 'is_infected' in result && result.is_infected === true)) {\n // If a virus is detected...\n if (typeof result === 'object' && 'is_infected' in result && result.is_infected === true) {\n // handle_error(new NodeClamError(result, `Virus(es) found! ${'viruses' in result && Array.isArray(result.viruses) ? `Suspects: ${result.viruses.join(', ')}` : ''}`));\n handle_error(null, true, result);\n }\n // If any other kind of error is detected...\n else {\n handle_error(result);\n }\n }\n // For debugging purposes, spit out what was processed (if anything).\n else {\n if (me.settings.debug_mode) console.log(`${me.debug_label}: Processed Result: `, result, response.toString());\n }\n });\n\n if (me.settings.debug_mode) console.log(`${me.debug_label}: Doing initial transform!`);\n // Handle the chunk\n do_transform();\n } catch (err) {\n // If there's an issue connecting to the ClamAV socket, this is where that's handled\n if (me.settings.debug_mode) console.error(`${me.debug_label}: Error initiating socket to ClamAV: `, err);\n handle_error(err);\n }\n } else {\n //if (me.settings.debug_mode) console.log(`${me.debug_label}: Doing transform: ${++counter}`);\n // Handle the chunk\n do_transform();\n }\n }", "function test_transform() {\n var f = function(x) {\n return Number($(x)) + 1;\n };\n\n\n var plan1 = tasks(\"ns:identity\").plan({\n x: [0, 1]\n });\n\n var plan2 = tasks(\"ns:mult\").plan({\n x: transform(f, plan1),\n y: [3, 5]\n });\n\n // Optimize and run\n // Should be an array of XML values 3, 6, 5, 10\n var result = plan2.run();\n check_array(result, [3, 5, 6, 10]);\n}", "function Transform() { // eslint-disable-line no-unused-vars\n\n var request = new XMLHttpRequest();\n\n setLocalStorageItem('code', cppEditor.getValue());\n setLocalStorageItem('insightsOptions', getInsightsOptions());\n\n request.onreadystatechange = function() {\n if (this.readyState == 4 && this.status == 200) {\n var response = JSON.parse(this.responseText);\n cppOutEditor.setValue(response.stdout);\n stdErrEditor.setValue(response.stderr);\n SetRunListeners();\n } else if (this.readyState == 4 && this.status != 200) {\n stdErrEditor.setValue('Sorry, your request failed');\n SetRunListeners();\n }\n };\n\n stdErrEditor.setValue('Waiting for response...');\n\n var url = buildURL('/api/v1/transform');\n\n request.open('POST', url, true);\n request.setRequestHeader('Content-Type', 'application/json;charset=UTF-8');\n\n var data = {};\n\n data.insightsOptions = getInsightsOptions();\n data.code = cppEditor.getValue();\n\n SetWaitForResultListeners();\n request.send(JSON.stringify(data));\n}", "function process(doc, cb) {\n freeze()\n assertParser('process', processor.Parser)\n assertCompiler('process', processor.Compiler)\n\n if (!cb) {\n return new Promise(executor)\n }\n\n executor(null, cb)\n\n function executor(resolve, reject) {\n var file = vfile(doc)\n\n pipeline.run(processor, {file: file}, done)\n\n function done(err) {\n if (err) {\n reject(err)\n } else if (resolve) {\n resolve(file)\n } else {\n cb(null, file)\n }\n }\n }\n }", "function process(doc, cb) {\n freeze()\n assertParser('process', processor.Parser)\n assertCompiler('process', processor.Compiler)\n\n if (!cb) {\n return new Promise(executor)\n }\n\n executor(null, cb)\n\n function executor(resolve, reject) {\n var file = vfile(doc)\n\n pipeline.run(processor, {file: file}, done)\n\n function done(err) {\n if (err) {\n reject(err)\n } else if (resolve) {\n resolve(file)\n } else {\n cb(null, file)\n }\n }\n }\n }", "function process(doc, cb) {\n freeze()\n assertParser('process', processor.Parser)\n assertCompiler('process', processor.Compiler)\n\n if (!cb) {\n return new Promise(executor)\n }\n\n executor(null, cb)\n\n function executor(resolve, reject) {\n var file = vfile(doc)\n\n pipeline.run(processor, {file: file}, done)\n\n function done(err) {\n if (err) {\n reject(err)\n } else if (resolve) {\n resolve(file)\n } else {\n cb(null, file)\n }\n }\n }\n }", "function process(doc, cb) {\n freeze()\n assertParser('process', processor.Parser)\n assertCompiler('process', processor.Compiler)\n\n if (!cb) {\n return new Promise(executor)\n }\n\n executor(null, cb)\n\n function executor(resolve, reject) {\n var file = vfile(doc)\n\n pipeline.run(processor, {file: file}, done)\n\n function done(err) {\n if (err) {\n reject(err)\n } else if (resolve) {\n resolve(file)\n } else {\n cb(null, file)\n }\n }\n }\n }", "function process(doc, cb) {\n freeze()\n assertParser('process', processor.Parser)\n assertCompiler('process', processor.Compiler)\n\n if (!cb) {\n return new Promise(executor)\n }\n\n executor(null, cb)\n\n function executor(resolve, reject) {\n var file = vfile(doc)\n\n pipeline.run(processor, {file: file}, done)\n\n function done(err) {\n if (err) {\n reject(err)\n } else if (resolve) {\n resolve(file)\n } else {\n cb(null, file)\n }\n }\n }\n }", "function process(doc, cb) {\n freeze()\n assertParser('process', processor.Parser)\n assertCompiler('process', processor.Compiler)\n\n if (!cb) {\n return new Promise(executor)\n }\n\n executor(null, cb)\n\n function executor(resolve, reject) {\n var file = vfile(doc)\n\n pipeline.run(processor, {file: file}, done)\n\n function done(err) {\n if (err) {\n reject(err)\n } else if (resolve) {\n resolve(file)\n } else {\n cb(null, file)\n }\n }\n }\n }", "function process(doc, cb) {\n freeze();\n assertParser('process', processor.Parser);\n assertCompiler('process', processor.Compiler);\n\n if (!cb) {\n return new Promise(executor);\n }\n\n executor(null, cb);\n\n function executor(resolve, reject) {\n var file = vfile(doc);\n\n pipeline.run(processor, {file: file}, done);\n\n function done(err) {\n if (err) {\n reject(err);\n } else if (resolve) {\n resolve(file);\n } else {\n cb(null, file);\n }\n }\n }\n }", "function process(doc, cb) {\n freeze()\n assertParser('process', processor.Parser)\n assertCompiler('process', processor.Compiler)\n\n if (!cb) {\n return new Promise(executor)\n }\n\n executor(null, cb)\n\n function executor(resolve, reject) {\n var file = vfile(doc)\n\n pipeline.run(processor, {file: file}, done)\n\n function done(error) {\n if (error) {\n reject(error)\n } else if (resolve) {\n resolve(file)\n } else {\n cb(null, file)\n }\n }\n }\n }", "function process(doc, cb) {\n freeze()\n assertParser('process', processor.Parser)\n assertCompiler('process', processor.Compiler)\n\n if (!cb) {\n return new Promise(executor)\n }\n\n executor(null, cb)\n\n function executor(resolve, reject) {\n var file = vfile(doc)\n\n pipeline.run(processor, {file: file}, done)\n\n function done(error) {\n if (error) {\n reject(error)\n } else if (resolve) {\n resolve(file)\n } else {\n cb(null, file)\n }\n }\n }\n }", "function process(doc, cb) {\n freeze();\n assertParser('process', processor.Parser);\n assertCompiler('process', processor.Compiler);\n\n if (!cb) {\n return new Promise(executor)\n }\n\n executor(null, cb);\n\n function executor(resolve, reject) {\n var file = vfile(doc);\n\n pipeline.run(processor, {file: file}, done);\n\n function done(error) {\n if (error) {\n reject(error);\n } else if (resolve) {\n resolve(file);\n } else {\n cb(null, file);\n }\n }\n }\n }", "function processSVGImage(i, inputFile, outputFile) {\n console.log(\"processSVGImage:\" + i + \",\" + inputFile + \",output:\" + outputFile);\n\n // pretty print the input file first\n xmlFormat(tempDir + \"/\" + inputFile + \".svg\");\n // var processBg = new transform();\n // processBg._transform = function (data, encoding, cb) {\n // // do transformation\n // cb(null, tools.processData(data,processBgImg));\n // };\n\n var removeBd = new transform();\n removeBd._transform = function (data, encoding, cb) {\n // do transformation\n cb(null, tools.processData(data, removeBdTag));\n };\n var removeXMLSpacePreserve = new transform();\n removeXMLSpacePreserve._transform = function (data, encoding, cb) {\n // do transformation\n cb(null, tools.processData(data, removeXMLSpacePreserveTag));\n };\n var processNt = new transform();\n processNt._transform = function (data, encoding, cb) {\n // do transformation\n cb(null, tools.processData(data, processNtTag));\n };\n\n var processTextLine = new transform();\n processTextLine._transform = function (data, encoding, cb) {\n // do transformation\n cb(null, tools.processData(data, processTextTag));\n };\n\n var processImageLine = new transform();\n processImageLine._transform = function (data, encoding, cb) {\n // do transformation\n cb(null, tools.processData(data, processImageTag));\n };\n\n // var getFonts = new transform();\n // getFonts._transform = function (data, encoding, cb) {\n // // do transformation\n // cb(null, tools.processData(data, getFontsList));\n // };\n var addFonts = new transform();\n addFonts._transform = function (data, encoding, cb) {\n // do transformation\n // console.log(\"transform:\" + fontList[i]);\n cb(null, tools.processData(data, addFontsLine, fontList[i]));\n };\n\n var inputPath = tempDir + \"/\" + inputFile + \".svg\";\n var inputStream1 = fs.createReadStream(inputPath);\n var outputPath = tempDir + \"/\" + outputFile + \".svg\";\n var outputStream1 = fs.createWriteStream(outputPath);\n inputStream1\n .pipe(removeBd)\n .pipe(removeXMLSpacePreserve)\n .pipe(processNt)\n .pipe(processTextLine)\n .pipe(processImageLine)\n .pipe(addFonts)\n .pipe(outputStream1);\n\n setTimeout(function () {\n xmlFormat(outputPath)\n }, 2000);\n // delay 2 seconds for the first round is over\n // setTimeout(function () {\n // console.log(\"start second round\");\n // var inputStream2 = fs.createReadStream(outputPath);\n // outputPath = tempDir + \"/\" + outputFile + \".svg\";\n // var outputStream2 = fs.createWriteStream(outputPath);\n // inputStream2\n // .pipe(addFonts)\n // .pipe(outputStream2);\n // }, 2000);\n\n}", "function transformFile(filename, opts, callback) {\n if (_lodashLangIsFunction2[\"default\"](opts)) {\n callback = opts;\n opts = {};\n }\n\n opts.filename = filename;\n\n _fs2[\"default\"].readFile(filename, function (err, code) {\n if (err) return callback(err);\n\n var result;\n\n try {\n result = _transformation2[\"default\"](code, opts);\n } catch (err) {\n return callback(err);\n }\n\n callback(null, result);\n });\n}", "loadObjects (state, file) {\n const loader = new FileLoader(file)\n loader.loadSync()\n Vue.set(state, file, loader.objects)\n }", "function run(transformer, options) {\n return runFile(process.argv[2], transformer, options);\n}", "function makeTransform(registry) {\n\n return function(filename, options) {\n options = options || {};\n\n var registry = registry || registryFromOptions(options);\n\n return aggregate(function(src) {\n try {\n src = jstransform(src);\n } catch(err) {\n return this.emit('error', err);\n }\n this.queue(src);\n this.queue(null);\n });\n }\n}", "runUserUpload() {\n\t\tconst input = document.createElement(\"input\");\n\t\tinput.type = \"file\";\n\t\tinput.onchange = (evt) => {\n\t\t\tconst reader = new FileReader();\n\t\t\treader.onloadend = (evt) => {\n\t\t\t\tthis.loadStoredCircuit(JSON.parse(evt.target.result));\n\t\t\t};\n\t\t\treader.readAsText(evt.target.files[0]);\n\t\t};\n\t\tinput.click();\n\t}", "function processFile (inputLoc, out, replacements) {\n var file = urlRegex.test(inputLoc) ?\n hyperquest(inputLoc) :\n fs.createReadStream(inputLoc, encoding)\n\n file.pipe(bl(function (err, data) {\n if (err) throw err\n\n data = data.toString()\n replacements.forEach(function (replacement) {\n data = data.replace.apply(data, replacement)\n })\n if (inputLoc.slice(-3) === '.js') {\n const transformed = babel.transform(data, {\n plugins: [\n 'transform-es2015-parameters',\n 'transform-es2015-arrow-functions',\n 'transform-es2015-block-scoping',\n 'transform-es2015-template-literals',\n 'transform-es2015-shorthand-properties',\n 'transform-es2015-for-of',\n 'transform-es2015-destructuring'\n ]\n })\n data = transformed.code\n }\n fs.writeFile(out, data, encoding, function (err) {\n if (err) throw err\n\n console.log('Wrote', out)\n })\n }))\n}", "parseFlsFile(baseFile) {\r\n this.extension.logger.addLogMessage('Parse fls file.');\r\n const rootDir = path.dirname(baseFile);\r\n const outDir = this.getOutDir(baseFile);\r\n const flsFile = path.resolve(rootDir, path.join(outDir, path.basename(baseFile, '.tex') + '.fls'));\r\n if (!fs.existsSync(flsFile)) {\r\n this.extension.logger.addLogMessage(`Cannot find fls file: ${flsFile}`);\r\n return;\r\n }\r\n this.extension.logger.addLogMessage(`Fls file found: ${flsFile}`);\r\n const ioFiles = this.parseFlsContent(fs.readFileSync(flsFile).toString(), rootDir);\r\n ioFiles.input.forEach((inputFile) => {\r\n // Drop files that are also listed as OUTPUT or should be ignored\r\n if (ioFiles.output.includes(inputFile) ||\r\n this.isExcluded(inputFile) ||\r\n !fs.existsSync(inputFile)) {\r\n return;\r\n }\r\n // Drop the current rootFile often listed as INPUT and drop any file that is already in the texFileTree\r\n if (baseFile === inputFile || inputFile in this.cachedContent) {\r\n return;\r\n }\r\n if (path.extname(inputFile) === '.tex') {\r\n // Parse tex files as imported subfiles.\r\n this.cachedContent[baseFile].children.push({\r\n index: Number.MAX_VALUE,\r\n file: inputFile\r\n });\r\n this.parseFileAndSubs(inputFile);\r\n }\r\n else if (this.fileWatcher && !this.filesWatched.includes(inputFile)) {\r\n // Watch non-tex files.\r\n this.fileWatcher.add(inputFile);\r\n this.filesWatched.push(inputFile);\r\n }\r\n });\r\n ioFiles.output.forEach((outputFile) => {\r\n if (path.extname(outputFile) === '.aux' && fs.existsSync(outputFile)) {\r\n this.parseAuxFile(fs.readFileSync(outputFile).toString(), path.dirname(outputFile).replace(outDir, rootDir));\r\n }\r\n });\r\n }", "_updateTransform() {\n this._applyTransform(this._transform)\n this.redraw()\n if (this.callbacks.didUpdateTransform) {\n this.callbacks.didUpdateTransform(this._transform)\n }\n }", "function LGraphTransform()\r\n\t{\r\n\t\tthis.properties = {node_id:\"\"};\r\n\t\tif(LGraphSceneNode._current_node_id)\r\n\t\t\tthis.properties.node_id = LGraphSceneNode._current_node_id;\r\n\t\tthis.addInput(\"Transform\",\"Transform\");\r\n\t\tthis.addOutput(\"Position\",\"vec3\");\r\n\t}", "function process(file, enc, callback) {\n /*jshint validthis:true*/\n\n // Do nothing if no contents\n if (file.isNull()) {\n return callback();\n }\n if (file.isStream()) {\n this.emit(\"error\",\n new gutil.PluginError(PLUGIN_NAME, \"Stream content is not supported\"));\n return callback();\n }\n // check if file.contents is a `Buffer`\n if (file.isBuffer() || file.isFile()) {\n var parser = imagesize.Parser();\n\n var retStatus = parser.parse(file.contents);\n if (imagesize.Parser.DONE === retStatus) {\n var result = parser.getResult();\n result.file = libpath.relative(file.base, file.path)\n list.push(result);\n }\n }\n return callback();\n }", "transformVertices(transformFunction) {\n this.checkVertices();\n var vert = this.verts;\n\n for (let i = 0; i < vert.length; i += 3) {\n let transform = transformFunction(vert[i], vert[i + 1], vert[i + 2]);\n if (transform) {\n vert[i] += transform[0];\n vert[i + 1] += transform[1];\n vert[i + 2] += transform[2];\n }\n }\n this.verts = vert;\n }", "async function handleUploadedFiles() {\n if (!this.files.length) {\n console.log(`no files selected`)\n // fileList.innerHTML = \"<p>No files selected!</p>\";\n } else {\n\n const contents = await this.files[0].text()\n uploadedData = JSON.parse(contents)\n // initializeTree(\"filemodelTree\", uploadedData, \"upload\", (uploadedData) => {\n\n // console.log(`uploaded data has arrived ${JSON.stringify(uploadedData)}`)\n // data.model = Object.assign(data.model, uploadedData.model)\n // data.templates = data.templates.concat(uploadedData.templates)\n // data.viewpoints = data.viewpoints.concat(uploadedData.viewpoints)\n // // set id values on all ratings and objects that currently do not have them\n // // probably temporary function until all data sets have id values\n // // add uuid to objects and ratings - just to be sure\n // data.viewpoints.forEach((viewpoint) => addUUIDtoBlips(viewpoint.blips))\n // if (uploadedData.objects != null && uploadedData.objects.length > 0) {\n // // merge the arrays of uploaded objects in with the existing objects per object type\n // for (let i = 0; i < Object.keys(uploadedData.objects).length; i++) {\n // data.objects[Object.keys(uploadedData.objects)[i]] =\n // uploadedData.objects[Object.keys(uploadedData.objects)[i]].\n // concat(data.objects[Object.keys(uploadedData.objects)[i]])\n\n // data.objects[Object.keys(uploadedData.objects)[i]].forEach((object) => { if (object.id == null) { object.id = uuidv4() } })\n // }\n // }\n\n // publishRefreshRadar()\n // }, data.model)\n // TODO serialize data\n const deserializedData = deserialize(uploadedData)\n data = deserializedData\n calculateDerivedProperties()\n\n publishRefreshRadar()\n\n }\n}", "function run(transformer, options) {\n\t return runFile(process.argv[2], transformer, options);\n\t}", "loadFile(file, module, x, y) {\n var dsp_code;\n var reader = new FileReader();\n var ext = file.name.toString().split('.').pop();\n var filename = file.name.toString().split('.').shift();\n var type;\n if (ext == \"dsp\") {\n type = \"dsp\";\n reader.readAsText(file);\n }\n else if (ext == \"json\") {\n type = \"json\";\n reader.readAsText(file);\n }\n else if (ext == \"jfaust\") {\n type = \"jfaust\";\n reader.readAsText(file);\n }\n else if (ext == \".polydsp\") {\n type = \"poly\";\n reader.readAsText(file);\n }\n else {\n throw new Error(Utilitary.messageRessource.errorObjectNotFaustCompatible);\n }\n reader.onloadend = (e) => {\n dsp_code = \"process = vgroup(\\\"\" + filename + \"\\\",environment{\" + reader.result + \"}.process);\";\n if (!module) {\n if (type == \"dsp\") {\n this.compileFaust({ isMidi: false, name: filename, sourceCode: dsp_code, x: x, y: y, callback: (factory) => { this.createModule(factory); } });\n }\n else if (type == \"jfaust\") {\n Utilitary.currentScene.recallScene(reader.result);\n }\n else if (type == \"poly\") {\n this.compileFaust({ isMidi: true, name: filename, sourceCode: dsp_code, x: x, y: y, callback: (factory) => { this.createModule(factory); } });\n }\n }\n else {\n if (type == \"dsp\") {\n module.isMidi = false;\n module.update(filename, dsp_code);\n }\n else if (type == \"jfaust\") {\n Utilitary.currentScene.recallScene(reader.result);\n }\n else if (type == \"poly\") {\n module.isMidi = true;\n module.update(filename, dsp_code);\n }\n }\n };\n }", "function processEach(params, file, done) {\r\n console.log(\"Parsing file: \", file);\r\n parseUtils\r\n .parseFile(file)\r\n .then(function(parseResult) {\r\n // save the original source code.\r\n params.sourceStore[file] = parseResult.src;\r\n\r\n // adapt our block ID generator for this file.\r\n var blockIDGen = function(blockInfo) {\r\n return params.idGenerator.newID({\r\n script: file,\r\n func: blockInfo.func\r\n });\r\n };\r\n\r\n // instrument the code.\r\n var result = instrument(\r\n parseResult.src,\r\n parseResult.ast,\r\n blockIDGen,\r\n params\r\n );\r\n\r\n // write the modified code back to the original file.\r\n fs.writeFileSync(file, result.result, \"utf8\");\r\n\r\n // just return the block & function data.\r\n done(null, {\r\n blocks: result.blocks,\r\n functions: result.functions\r\n });\r\n })\r\n .catch(function(e) {\r\n // don't kill the whole process.\r\n console.error(\"Problem instrumenting file. \", e, \" in file: \", file);\r\n done(null, { blocks: [], functions: [] });\r\n })\r\n .done();\r\n}", "function transformToUmd(files, dest) {\n return eventStream.merge(files.map((file) => { // eslint-disable-line\n return gulp.src(file)\n .pipe(babel({\n presets: ['es2015'],\n moduleId: `ss.${path.parse(file).name}`,\n plugins: ['transform-es2015-modules-umd'],\n comments: false,\n }))\n .on('error', notify.onError({\n message: 'Error: <%= error.message %>',\n }))\n .pipe(gulp.dest(dest));\n }));\n}", "function fileToObject(file) {\n return __WEBPACK_IMPORTED_MODULE_0_babel_runtime_helpers_extends___default()({}, file, { lastModified: file.lastModified, lastModifiedDate: file.lastModifiedDate, name: file.name, size: file.size, type: file.type, uid: file.uid, percent: 0, originFileObj: file });\n}", "process (filepath) {\n\t\tlet {\n\t\t\tchassis,\n\t\t\tgenerateNamespacedSelector,\n\t\t\tisNamespaced,\n\t\t\tnamespaceSelectors,\n\t\t\tprocessImports,\n\t\t\tprocessNesting,\n\t\t\tprocessAtRules,\n\t\t\tprocessMixins,\n\t\t\tprocessNot,\n\t\t\tprocessFunctions,\n\t\t\tstoreAtRules,\n\t\t\ttypographyEngineIsInitialized\n\t\t} = this\n\n\t\tlet {\n\t\t\tatRules,\n\t\t\tpost,\n\t\t\tsettings,\n\t\t\tutils\n\t\t} = chassis\n\n\t\tlet tasks = new NGN.Tasks()\n\t\tlet sourceMap\n\n\t\ttasks.add('Processing Imports', next => {\n\t\t\tif (typographyEngineIsInitialized) {\n\t\t\t\tthis.tree.walkAtRules('import', atRule => {\n\t\t\t\t\tchassis.imports.push(atRule.params)\n\t\t\t\t\tatRule.remove()\n\t\t\t\t})\n\t\t\t}\n\n\t\t\tprocessImports()\n\t\t\tprocessNesting()\n\t\t\tnext()\n\t\t})\n\n\t\ttasks.add('Processing Mixins', next => {\n\t\t\tprocessMixins()\n\t\t\tprocessNot()\n\t\t\tprocessNesting()\n\n\t\t\tnext()\n\t\t})\n\n\t\ttasks.add('Processing Functions', next => {\n\t\t\tprocessFunctions()\n\t\t\tnext()\n\t\t})\n\n\t\ttasks.add('Namespacing Selectors', next => {\n\t\t\tnamespaceSelectors()\n\t\t\tnext()\n\t\t})\n\n\t\tif (typographyEngineIsInitialized) {\n\t\t\ttasks.add('Initializing Typography Engine', next => {\n\t\t\t\tthis.tree = this.core.css.append(this.tree)\n\t\t\t\tnext()\n\t\t\t})\n\t\t}\n\n\t\ttasks.add('Running Post-Processing Routines', next => {\n\t\t\tthis.tree.walkAtRules('chassis-post', atRule => {\n\t\t\t\tlet data = Object.assign({\n\t\t\t\t\troot: this.tree,\n\t\t\t\t\tatRule\n\t\t\t\t}, atRules.getProperties(atRule))\n\n\t\t\t\tpost.process(data)\n\t\t\t})\n\n\t\t\tnext()\n\t\t})\n\n\t\ttasks.add('Processing CSS4 Syntax', next => {\n\t\t\tenv.process(this.tree, {from: filepath}, settings.envCfg).then(processed => {\n\t\t\t\tthis.tree = processed.root\n\t\t\t\tnext()\n\t\t\t}, err => console.error(err))\n\t\t})\n\n\t\t// tasks.add('Merging matching adjacent rules...', next => {\n\t\t// \toutput = mergeAdjacentRules.process(output.toString())\n\t\t// \tnext()\n\t\t// })\n\n\t\ttasks.add('Beautifying Output', next => {\n\t\t\tremoveComments.process(this.tree).then(result => {\n\t\t\t\tperfectionist.process(result.css).then(result => {\n\t\t\t\t\tthis.tree = result.root\n\n\t\t\t\t\t// Remove empty rulesets\n\t\t\t\t\tthis.tree.walkRules(rule => {\n\t\t\t\t\t\tif (rule.nodes.length === 0) {\n\t\t\t\t\t\t\trule.remove()\n\t\t\t\t\t\t\treturn\n\t\t\t\t\t\t}\n\t\t\t\t\t})\n\n\t\t\t\t\tnext()\n\t\t\t\t}, () => {\n\t\t\t\t\tthis.emit('processing.error', new Error('Error Beautifying Output'))\n\t\t\t\t})\n\t\t\t}, () => {\n\t\t\t\tthis.emit('processing.error', new Error('Error Removing Comments'))\n\t\t\t})\n\t\t})\n\n\t\tif (settings.minify) {\n\t\t\tlet minified\n\n\t\t\ttasks.add('Minifying Output', next => {\n\t\t\t\tminified = new CleanCss({\n\t\t\t\t\tsourceMap: settings.sourceMap\n\t\t\t\t}).minify(this.tree.toString())\n\n\t\t\t\tthis.tree = minified.styles\n\t\t\t\tnext()\n\t\t\t})\n\n\t\t\tif (settings.sourceMap) {\n\t\t\t\ttasks.add('Generating source map', next => {\n\t\t\t\t\tsourceMap = minified.sourceMap.toString()\n\t\t\t\t\tnext()\n\t\t\t\t})\n\t\t\t}\n\t\t}\n\n\t\t// tasks.on('taskstart', evt => console.log(`${evt.name}...`))\n\t\t// tasks.on('taskcomplete', evt => console.log('Done.'))\n\n\t\ttasks.on('complete', () => this.emit('processing.complete', {\n\t\t\tcss: this.tree.toString(),\n\t\t\tsourceMap\n\t\t}))\n\n\t\tthis.emit('processing')\n\t\ttasks.run(true)\n\t}" ]
[ "0.6458939", "0.6458939", "0.6441855", "0.6441855", "0.6441855", "0.6441855", "0.6441855", "0.6441855", "0.64324313", "0.6189576", "0.6004485", "0.6004485", "0.5857711", "0.5753894", "0.5723392", "0.56320477", "0.5556542", "0.5508055", "0.5497592", "0.5380607", "0.5358036", "0.53538567", "0.53538567", "0.5300946", "0.51949155", "0.5165718", "0.5165718", "0.5165718", "0.5165718", "0.5165718", "0.5158855", "0.5148594", "0.51194495", "0.5097911", "0.5089568", "0.5062284", "0.506186", "0.506186", "0.50547063", "0.50180584", "0.49556753", "0.49556753", "0.49556753", "0.49556753", "0.49556753", "0.49556753", "0.4931681", "0.49097726", "0.49089006", "0.49046856", "0.49046856", "0.4897944", "0.48479563", "0.48479563", "0.484569", "0.47784168", "0.47746778", "0.47746778", "0.47746778", "0.47746778", "0.4759613", "0.47365892", "0.47214243", "0.46994227", "0.46881428", "0.46824718", "0.46722433", "0.46722433", "0.46722433", "0.46722433", "0.46722433", "0.46722433", "0.4663936", "0.46622628", "0.46622628", "0.46608695", "0.46565276", "0.46549717", "0.46522802", "0.46203813", "0.46129948", "0.4612288", "0.4599748", "0.45884022", "0.45780623", "0.45758852", "0.45644", "0.4562467", "0.4556216", "0.45506003", "0.45320165", "0.4525736", "0.45256415", "0.4518104", "0.45109034" ]
0.5192558
29
Stringify a Unist node representation of a file (in string or VFile representation) into a string using the `Compiler` on the processor.
function stringify(node, doc) { var file = vfile(doc) var Compiler freeze() Compiler = processor.Compiler assertCompiler('stringify', Compiler) assertNode(node) if (newable(Compiler)) { return new Compiler(node, file).compile() } return Compiler(node, file) // eslint-disable-line new-cap }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function stringify(node, doc) {\n var file = vfile(doc)\n var Compiler\n\n freeze()\n Compiler = processor.Compiler\n assertCompiler('stringify', Compiler)\n assertNode(node)\n\n if (newable(Compiler, 'compile')) {\n return new Compiler(node, file).compile()\n }\n\n return Compiler(node, file) // eslint-disable-line new-cap\n }", "function stringify(node, doc) {\n var file = vfile(doc)\n var Compiler\n\n freeze()\n Compiler = processor.Compiler\n assertCompiler('stringify', Compiler)\n assertNode(node)\n\n if (newable(Compiler, 'compile')) {\n return new Compiler(node, file).compile()\n }\n\n return Compiler(node, file) // eslint-disable-line new-cap\n }", "function stringify(node, doc) {\n var file = vfile(doc)\n var Compiler\n\n freeze()\n Compiler = processor.Compiler\n assertCompiler('stringify', Compiler)\n assertNode(node)\n\n if (newable(Compiler, 'compile')) {\n return new Compiler(node, file).compile()\n }\n\n return Compiler(node, file) // eslint-disable-line new-cap\n }", "function stringify(node, doc) {\n var file = vfile(doc);\n var Compiler;\n\n freeze();\n Compiler = processor.Compiler;\n assertCompiler('stringify', Compiler);\n assertNode(node);\n\n if (newable(Compiler, 'compile')) {\n return new Compiler(node, file).compile()\n }\n\n return Compiler(node, file) // eslint-disable-line new-cap\n }", "function stringify(node, doc) {\n var file = vfile(doc);\n var Compiler;\n\n freeze();\n Compiler = processor.Compiler;\n assertCompiler('stringify', Compiler);\n assertNode(node);\n\n if (newable(Compiler)) {\n return new Compiler(node, file).compile();\n }\n\n return Compiler(node, file); // eslint-disable-line new-cap\n }", "function _node2string(node) {\n return node.source || stringify(node);\n}", "function nodeToString(typeNode) {\n return LineFeedPrinter_1.lineFeedPrinter.printNode(typescript_1.EmitHint.Unspecified, typeNode, typeNode.getSourceFile());\n}", "toString() {\n return `UnaryOperationNode { this.op = ${TypesRegistar.getUnaryOperationString(this.op)}, param = ${this.param} }`;\n }", "async _serializeGraph(file) {\n const graph = await this.reader.readFileGraph(file);\n const serializer = serializers.find(OUTPUT_TYPE);\n return new Promise((resolve, reject) => {\n let result = '';\n serializer.import(graph.toStream())\n .on('error', reject)\n .on('data', d => { result += d.toString(); })\n .on('end', () => resolve(result));\n });\n }", "dumpTree(filename) {\n const config = this.getConfigFor(filename);\n const resolved = config.resolve();\n const source = resolved.transformFilename(filename);\n const engine = new Engine(resolved, Parser);\n return engine.dumpTree(source);\n }", "function toString(file, options) {\n let contents = file[options.contentProp] || file.content || file.contents;\n const str = contents.toString();\n return options.trim ? str.trim() : str;\n}", "function treeForFile (file) {\n var contents = null\n try {\n contents = fs.readFileSync(file).toString()\n } catch (err) {\n if (err.code === 'ENOENT') {\n logger.error(\"File not found: \"+file)\n process.exit(1)\n }\n throw err\n }\n var name = path.basename(file),\n parser = new Parser()\n\n parser.file = name\n // Parse and type-check the file; catch and report any errors\n try {\n var tree = parser.parse(contents),\n typesystem = new TypeSystem()\n typesystem.walk(tree)\n } catch (err) {\n reportError(err)\n process.exit(1)\n }\n return tree\n}// treeForFile", "function loadFileToString(file) {\n let frawin = Cc[\"@mozilla.org/network/file-input-stream;1\"]\n .createInstance(Ci.nsIFileInputStream);\n frawin.init(file, -1, 0, 0);\n let fin = Cc[\"@mozilla.org/scriptableinputstream;1\"]\n .createInstance(Ci.nsIScriptableInputStream);\n fin.init(frawin);\n let data = \"\";\n let str = fin.read(4096);\n while (str.length > 0) {\n data += str;\n str = fin.read(4096);\n }\n fin.close();\n\n return data;\n}", "function Node(value) {\n this.value = './';\n this.path = undefined;\n this.extension = undefined;\n this.type = undefined;\n this.name = undefined;\n this.sons = [];\n\n if(value !== undefined) {\n this.value = value;\n }\n}", "function stringify(node) {\n let string = '';\n\n while (node) {\n string += node.next === null ? node.val : node.val + ' -> ' ;\n node = node.next;\n }\n\n return string;\n}", "function toString(file, options) {\n var str = (file.content || file.contents || '').toString();\n return options.trim ? str.trim() : str;\n}", "toString() {\n return `NodeMessage<${this.id}>`;\n }", "function emitSerializedTypeReferenceNode(node) {\n var location = node.parent;\n while (ts.isDeclaration(location) || ts.isTypeNode(location)) {\n location = location.parent;\n }\n // Clone the type name and parent it to a location outside of the current declaration.\n var typeName = ts.cloneEntityName(node.typeName, location);\n var result = resolver.getTypeReferenceSerializationKind(typeName);\n switch (result) {\n case ts.TypeReferenceSerializationKind.Unknown:\n var temp = createAndRecordTempVariable(0 /* Auto */);\n write(\"(typeof (\");\n emitNodeWithoutSourceMap(temp);\n write(\" = \");\n emitEntityNameAsExpression(typeName, /*useFallback*/ true);\n write(\") === 'function' && \");\n emitNodeWithoutSourceMap(temp);\n write(\") || Object\");\n break;\n case ts.TypeReferenceSerializationKind.TypeWithConstructSignatureAndValue:\n emitEntityNameAsExpression(typeName, /*useFallback*/ false);\n break;\n case ts.TypeReferenceSerializationKind.VoidType:\n write(\"void 0\");\n break;\n case ts.TypeReferenceSerializationKind.BooleanType:\n write(\"Boolean\");\n break;\n case ts.TypeReferenceSerializationKind.NumberLikeType:\n write(\"Number\");\n break;\n case ts.TypeReferenceSerializationKind.StringLikeType:\n write(\"String\");\n break;\n case ts.TypeReferenceSerializationKind.ArrayLikeType:\n write(\"Array\");\n break;\n case ts.TypeReferenceSerializationKind.ESSymbolType:\n if (languageVersion < 2 /* ES6 */) {\n write(\"typeof Symbol === 'function' ? Symbol : Object\");\n }\n else {\n write(\"Symbol\");\n }\n break;\n case ts.TypeReferenceSerializationKind.TypeWithCallSignature:\n write(\"Function\");\n break;\n case ts.TypeReferenceSerializationKind.ObjectType:\n write(\"Object\");\n break;\n }\n }", "function file_to_string(path) {\n const fs = require('fs') \n\treturn fs.readFileSync(path, 'utf8');\n}", "function compileFile(file, basepath) {\n var filepath = path.join(basepath || test_dir, file);\n var ast;\n try {\n ast = RapydScript.parse(fs.readFileSync(filepath, \"utf-8\"), {\n filename: file,\n es6: argv.ecmascript6,\n toplevel: ast,\n readfile: fs.readFileSync,\n basedir: test_dir,\n libdir: path.join(src_path, 'lib'),\n });\n } catch(ex) {\n console.log(file + \":\\t\" + ex + \"\\n\");\n return;\n }\n // generate output\n var output = RapydScript.OutputStream({\n baselib: baselib,\n beautify: true\n });\n ast.print(output);\n return output;\n }", "function printValue(path) {\n if (path.node.start == null) {\n try {\n const nodeCopy = {\n ...path.node,\n };\n // `estree-to-babel` expects the `comments` property to exist on the top-level node\n if (!nodeCopy.comments) {\n nodeCopy.comments = [];\n }\n return (0, generator_1.default)((0, estree_to_babel_1.default)(nodeCopy), {\n comments: false,\n concise: true,\n }).code;\n }\n catch (err) {\n throw new Error(`Cannot print raw value for type '${path.node.type}'. Please report this with an example at https://github.com/reactjs/react-docgen/issues.\n\nOriginal error:\n${err.stack}`);\n }\n }\n const src = getSrcFromAst(path);\n return deindent(src.slice(path.node.start, path.node.end));\n}", "function printValue(path) {\n if (path.node.start == null) {\n try {\n const nodeCopy = { ...path.node\n }; // `estree-to-babel` expects the `comments` property to exist on the top-level node\n\n if (!nodeCopy.comments) {\n nodeCopy.comments = [];\n }\n\n return (0, _generator.default)((0, _estreeToBabel.default)(nodeCopy), {\n comments: false,\n concise: true\n }).code;\n } catch (err) {\n throw new Error(`Cannot print raw value for type '${path.node.type}'. Please report this with an example at https://github.com/reactjs/react-docgen/issues.\n\nOriginal error:\n${err.stack}`);\n }\n }\n\n const src = getSrcFromAst(path);\n return deindent(src.slice(path.node.start, path.node.end));\n}", "function printFile(fileName) {\n if (!fileName) {\n // tslint:disable-next-line\n console.log('Usage:\\n' + green('drcp run @dr-core/ng-app-builder/dist/utils/ts-ast-query --file <ts file>'));\n return;\n }\n new Selector(fs.readFileSync(fileName, 'utf8'), fileName).printAll();\n}", "function parse(src) {\n return new recast.types.NodePath(recast.parse(stringify(src)).program);\n}", "fileString() {\n return this.id + \" \" + this.type + \" \" + this.note + \" \" + this.amount;\n }", "stringify(node) {\n let string = \"\";\n if (!node.getData()) {\n let children = node.getChildren();\n string += \"(\";\n\n for (let i = 0; i < children.length; i++) {\n string += (i != 0) ? \" \" : \"\";\n string += this.stringify(children[i]);\n }\n string += \")\";\n } else {\n string += node.getData().data;\n }\n\n return string;\n }", "toString() {\n return `${ this.constructor.name }<${ \n this.sourceAttribute } -> ${ this.destinationAttribute \n }> {\\n loaded: ${ \n this.loaded \n },\\n host: ${ \n (this.host + '').replace(/\\n/g, '\\n ') \n }\\n}`;\n }", "toString(idt = '', name = this.constructor.name) {\r\n\t\t\t\t\tvar tree;\r\n\t\t\t\t\ttree = '\\n' + idt + name;\r\n\t\t\t\t\tif (this.soak) {\r\n\t\t\t\t\t\ttree += '?';\r\n\t\t\t\t\t}\r\n\t\t\t\t\tthis.eachChild(function(node) {\r\n\t\t\t\t\t\treturn tree += node.toString(idt + TAB);\r\n\t\t\t\t\t});\r\n\t\t\t\t\treturn tree;\r\n\t\t\t\t}", "function tagFile() {\n\n // TODO: sort by further fields, too\n tags.sort(function(x,y){ return x.name > y.name ? 1 : x.name == y.name ? 0 : -1 });\n\n var tagFile = [];\n\n tagFile.push('!_TAG_FILE_SORTED\\t1\\t');\n tagFile.push('!_TAG_PROGRAM_AUTHOR\\tClaus Reinke\\t');\n tagFile.push('!_TAG_PROGRAM_NAME\\testr\\t');\n tagFile.push('!_TAG_PROGRAM_URL\\thttps://github.com/clausreinke/estr\\t');\n tagFile.push('!_TAG_PROGRAM_VERSION\\t0.0\\t');\n\n function encode_field(fld_str) {\n return fld_str.split('\\t').join(' ');\n }\n\n tags.forEach(function(tag){\n def_symbol = tag.def_symbol ? (\"\\tdef_symbol:\"+tag.def_symbol) : \"\";\n tag_id = tag.tag_id ? (\"\\ttag_id:\"+tag.tag_id) : \"\";\n class_id = tag.class_id ? (\"\\tclass_id:\"+tag.class_id) : \"\";\n children_scope = tag.children_scope ? (\"\\tchildren_scope:\"+tag.children_scope) : \"\"; \n dispinfo = tag.dispinfo ? (\"\\tdispinfo:\"+encode_field(tag.dispinfo)) : \"\";\n tagFile.push(tag.name+\"\\t\"+tag.file+\"\\t\"+tag.addr+\";\\\"\\t\"+tag.kind\n +\"\\tlineno:\"+tag.lineno+\"\\tscope:\"+tag.scope + def_symbol + tag_id + class_id + children_scope + dispinfo);\n });\n\n return tagFile;\n}", "function fileToString(filePath){\n try{\n return fs.readFileSync(filePath, 'utf8');\n }catch(e){\n console.log(colors.bgRed('There was an error reading the file: '+ filePath))\n console.log(color.bgRed(e));\n return \"\";\n }\n}", "dump() {\n let s;\n\n for (let v of this.vertexes) {\n if (v.pos) {\n s = v.value + ' (' + v.pos.x + ',' + v.pos.y + '):';\n } else {\n s = v.value + ':';\n }\n\n for (let e of v.edges) {\n s += ` ${e.destination.value}`;\n }\n console.log(s);\n }\n }", "dump() {\n let s;\n\n for (let v of this.vertexes) {\n if (v.pos) {\n s = v.value + ' (' + v.pos.x + ',' + v.pos.y + '):';\n } else {\n s = v.value + ':';\n }\n\n for (let e of v.edges) {\n s += ` ${e.destination.value}`;\n }\n console.log(s);\n }\n }", "function printFunctionSourceCode(f) {\n return String(f);\n}", "function Compiler(tree, file) {\n this.inLink = false;\n this.inTable = false;\n this.tree = tree;\n this.file = file;\n this.options = xtend(this.options);\n this.setOptions({});\n}", "function print(node) {\n\t if (node.kind === 'Fragment') {\n\t return 'fragment ' + node.name + ' on ' + String(node.type) + printFragmentArgumentDefinitions(node.argumentDefinitions) + printDirectives(node.directives) + printSelections(node, '') + '\\n';\n\t } else if (node.kind === 'Root') {\n\t return node.operation + ' ' + node.name + printArgumentDefinitions(node.argumentDefinitions) + printDirectives(node.directives) + printSelections(node, '') + '\\n';\n\t } else {\n\t __webpack_require__(1)(false, 'RelayPrinter: Unsupported IR node `%s`.', node.kind);\n\t }\n\t}", "function nodePosToString(node) {\n var file = getSourceFileOfNode(node);\n var loc = ts.getLineAndCharacterOfPosition(file, node.pos);\n return file.fileName + \"(\" + (loc.line + 1) + \",\" + (loc.character + 1) + \")\";\n }", "stringify() {\n if (this.value === undefined) {\n const parser = new UCFGParser(this.output);\n\n if (parser.parse() === undefined) {\n throw new SyntaxError();\n }\n\n const out = this.output;\n delete this.output;\n return out;\n } else {\n this.stringifySection (this.value, 0);\n delete this.value;\n return this.output;\n }\n}", "function getObjString() {\n\tlet objString = \"# cube.obj\\r\\n#\\r\\n\\r\\nmtllib \" + fileName + \".mtl\\r\\n\\r\\ng cube\\r\\n\\r\\n\";\n\tfor (let v=0;v<objVertices.length;v++) {\n\t\tlet vert = objVertices[v];\n\t\tobjString += `v ${vert[0]} ${vert[1]} ${vert[2]}\\r\\n`;\n\t}\n\tfor (let m=0;m<objMtl.length;m++)\n\t{\n\t\tobjString += `g ${objMtl[m][1]}\\r\\nusemtl ${objMtl[m][1]}\\r\\n`;\n\t\tfor (let p=0;p<objMtl[m][2].length;p++)\n\t\t{\n\t\t\tlet offset = objMtl[m][2][p];\n\t\t\tfor (let side=0;side<6;side++)\n\t\t\t{\n\t\t\t\tlet face = objFaces[offset+side];\n\t\t\t\tobjString += `f ${face[0]} ${face[1]} ${face[2]} ${face[3]}\\r\\n`;\n\t\t\t}\n\t\t}\n\t}\n\treturn objString;\n}", "function dump(n) {\n strip(n)\n fs.writeFileSync('dump.json', JSON.stringify(n), 'utf8')\n}", "function getNodeAsString()\n\t{\n\t\treturn this.n;\n\t}", "toString(){\n let currentNode = this.head;\n let string = '';\n\n while(currentNode){\n string += `${currentNode.value}`;\n currentNode = currentNode.next;\n }\n return string;\n }", "dumpSource(filename) {\n const config = this.getConfigFor(filename);\n const resolved = config.resolve();\n const sources = resolved.transformFilename(filename);\n return sources.reduce((result, source) => {\n result.push(`Source ${source.filename}@${source.line}:${source.column} (offset: ${source.offset})`);\n if (source.transformedBy) {\n result.push(\"Transformed by:\");\n result = result.concat(source.transformedBy.reverse().map((name) => ` - ${name}`));\n }\n if (source.hooks && Object.keys(source.hooks).length > 0) {\n result.push(\"Hooks\");\n for (const [key, present] of Object.entries(source.hooks)) {\n if (present) {\n result.push(` - ${key}`);\n }\n }\n }\n result.push(\"---\");\n result = result.concat(source.data.split(\"\\n\"));\n result.push(\"---\");\n return result;\n }, []);\n }", "function outSource(x) {\n if (x.toSource) { return x.toSource(); }\n else if (JSON && JSON.stringify) { return JSON.stringify(x); }\n else { return x.toString(); }\n}", "toString()\n\t{\n\t\treturn this.toStringRecursion(this.octree);\n\t}", "function getRootNode(file) {\n return ts.createSourceFile(file, fs.readFileSync(file).toString(), ts.ScriptTarget.Latest, true);\n}", "function print_file_tree(entries)\n{\n (debug?console.log(\"\\n________________________________________\\n\\tgenerateTree\\n\"):null);\n // entries obtained with sakura.apis.operator.get_file_tree()\n // are either:\n // - a directory: { 'name': <dirname>,\n // 'is_dir': true,\n // 'dir_entries': [ <entry>, <entry>, <entry>, ... ]\n // }\n // - a regular file: { 'name': <filename>,\n // 'is_dir': false\n // }\n // recursively, directory entries follow the same format.\n\n // treeHtmlString contains the lines of the tree\n var treeHtmlString = [];\n treeHtmlString.push(\"<div id='tree' class='tree'><ul>\");\n treeHtmlString.push(\"<li data-type='dir' data-path='/' data-jstree=\\\"{ 'opened' : true }\\\">/<ul>\");\n //call the recursive function\n print_dir(entries, treeHtmlString);\n treeHtmlString.push(\"</ul></li>\");\n treeHtmlString.push(\"</ul></li></div>\");\n var str = \"\";\n for(var i = 0 ; i < treeHtmlString.length ; i++) {\n str += treeHtmlString[i];\n }\n (debug?console.log(str):null);\n $(\"#treeDiv\").append(str);\n\n //Creates the jstree using #tree element, sorts alphabetically with folders on top\n setJsTree();\n\n $('#tree').bind('ready.jstree', function() {\n $('#tree').jstree(\"open_all\");\n });\n (debug?console.log(\"________________________________________\\n\"):null);\n}", "function toTNodeTypeAsString(tNodeType) {\n var text = '';\n tNodeType & 1\n /* Text */\n && (text += '|Text');\n tNodeType & 2\n /* Element */\n && (text += '|Element');\n tNodeType & 4\n /* Container */\n && (text += '|Container');\n tNodeType & 8\n /* ElementContainer */\n && (text += '|ElementContainer');\n tNodeType & 16\n /* Projection */\n && (text += '|Projection');\n tNodeType & 32\n /* Icu */\n && (text += '|IcuContainer');\n tNodeType & 64\n /* Placeholder */\n && (text += '|Placeholder');\n return text.length > 0 ? text.substring(1) : text;\n} // Note: This hack is necessary so we don't erroneously get a circular dependency", "dump() {\n\t\tlet s;\n\n\t\tfor (let v of this.vertexes) {\n\t\t\tif (v.pos) {\n\t\t\t\ts = v.value + ' (' + v.pos.x + ',' + v.pos.y + '):';\n\t\t\t} else {\n\t\t\t\ts = v.value + ':';\n\t\t\t}\n\n\t\t\tfor (let e of v.edges) {\n\t\t\t\ts += ` ${e.destination.value}`;\n\t\t\t}\n\t\t\tconsole.log(s);\n\t\t}\n\t}", "toString(showTree=0, label=0) {\n\t\tif (!label) label = (u => this.x2s(u) + ':' + this.key(u));\n\t\tif (!showTree || this.m <= 1) {\n\t\t\tlet s = '[';\n\t\t\tfor (let i = 1; i <= this.m; i++) {\n\t\t\t\tlet lab = label(this.itemAt(i));\n\t\t\t\ts += (i > 1 && lab ? ' ' : '') + lab;\n\t\t\t}\n\t\t\treturn s + ']';\n\t\t}\n\t\tif (this.m == 1) return '[' + label(this.itemAt(1)) + ']';\n\t\tlet f = new Forest(this.n);\n\t\tfor (let x = 2; x <= this.m; x++) {\n\t\t\tf.link(this.itemAt(x),this.itemAt(this.p(x)));\n\t\t}\n\t\treturn f.toString((showTree ? 0x4 : 0), label).slice(1,-1);\n\t}", "function binaryExpressionToString(toParse) {\n switch (toParse['type']) {\n case 'Identifier':\n return toParse['name'];\n case 'Literal':\n return toParse['value'];\n case 'MemberExpression':\n return (\n toParse['object']['name'] +\n `[${binaryExpressionToString(toParse['property'])}]`\n );\n case 'UnaryExpression':\n return (\n toParse['operator'] + binaryExpressionToString(toParse['argument'])\n );\n default:\n return handleBinary(toParse);\n }\n}", "function stringifyNode(node)\n{\n\tvar result = \"<\"+node.nodeName;\n\tvar numAttrs = node.attrs.length;\n\t\n\tfor (var i=0; i<numAttrs; i++)\n\t{\n\t\tresult += \" \"+ node.attrs[i].name +'=\"'+ node.attrs[i].value +'\"';\n\t}\n\t\n\tresult += \">\";\n\t\n\treturn result;\n}", "function uglifyString(content) {\n\t\tvar ast = uglifyjs.parse(content);\n\t\tast.figure_out_scope();\n\t\tvar compressor = uglifyjs.Compressor();\n\t\tast = ast.transform(compressor);\n\t\tast.figure_out_scope();\n\t\tast.compute_char_frequency();\n\t\tast.mangle_names();\n\t\treturn ast.print_to_string();\n\t}", "toStringify() {\n let current = this.head;\n let string = \"\";\n\n while (current) {\n string += current.data + (current.next ? \"\\n\" : \"\");\n current = current.next;\n }\n return string;\n }", "function dump() {\n if ( noDump ) {\n return;\n }\n\n function toStr( node ) {\n if ( node === null ) {\n return \"()\";\n }\n else {\n return \"(\" +\n (node.red ? \"R\" : \"B\") + \" \" +\n node.data +\n ( node.left === null && node.right === null ? \"\" :\n \" \" + toStr(node.left) + \" \" + toStr(node.right) ) +\n \")\";\n }\n }\n\n console.log(\"CMP \" + toStr(tree._root))\n}", "function CallSiteToString() {\n var fileName;\n var fileLocation = \"\";\n if (this.isNative()) {\n fileLocation = \"native\";\n } else {\n fileName = this.getScriptNameOrSourceURL();\n if (!fileName && this.isEval()) {\n fileLocation = this.getEvalOrigin();\n fileLocation += \", \"; // Expecting source position to follow.\n }\n\n if (fileName) {\n fileLocation += fileName;\n } else {\n // Source code does not originate from a file and is not native, but we\n // can still get the source position inside the source string, e.g. in\n // an eval string.\n fileLocation += \"<anonymous>\";\n }\n var lineNumber = this.getLineNumber();\n if (lineNumber != null) {\n fileLocation += \":\" + lineNumber;\n var columnNumber = this.getColumnNumber();\n if (columnNumber) {\n fileLocation += \":\" + columnNumber;\n }\n }\n }\n\n var line = \"\";\n var functionName = this.getFunctionName();\n var addSuffix = true;\n var isConstructor = this.isConstructor();\n var isMethodCall = !(this.isToplevel() || isConstructor);\n if (isMethodCall) {\n var typeName = this.getTypeName();\n // Fixes shim to be backward compatable with Node v0 to v4\n if (typeName === \"[object Object]\") {\n typeName = \"null\";\n }\n var methodName = this.getMethodName();\n if (functionName) {\n if (typeName && functionName.indexOf(typeName) != 0) {\n line += typeName + \".\";\n }\n line += functionName;\n if (methodName && functionName.indexOf(\".\" + methodName) != functionName.length - methodName.length - 1) {\n line += \" [as \" + methodName + \"]\";\n }\n } else {\n line += typeName + \".\" + (methodName || \"<anonymous>\");\n }\n } else if (isConstructor) {\n line += \"new \" + (functionName || \"<anonymous>\");\n } else if (functionName) {\n line += functionName;\n } else {\n line += fileLocation;\n addSuffix = false;\n }\n if (addSuffix) {\n line += \" (\" + fileLocation + \")\";\n }\n return line;\n}", "function CallSiteToString() {\n var fileName;\n var fileLocation = \"\";\n if (this.isNative()) {\n fileLocation = \"native\";\n } else {\n fileName = this.getScriptNameOrSourceURL();\n if (!fileName && this.isEval()) {\n fileLocation = this.getEvalOrigin();\n fileLocation += \", \"; // Expecting source position to follow.\n }\n\n if (fileName) {\n fileLocation += fileName;\n } else {\n // Source code does not originate from a file and is not native, but we\n // can still get the source position inside the source string, e.g. in\n // an eval string.\n fileLocation += \"<anonymous>\";\n }\n var lineNumber = this.getLineNumber();\n if (lineNumber != null) {\n fileLocation += \":\" + lineNumber;\n var columnNumber = this.getColumnNumber();\n if (columnNumber) {\n fileLocation += \":\" + columnNumber;\n }\n }\n }\n\n var line = \"\";\n var functionName = this.getFunctionName();\n var addSuffix = true;\n var isConstructor = this.isConstructor();\n var isMethodCall = !(this.isToplevel() || isConstructor);\n if (isMethodCall) {\n var typeName = this.getTypeName();\n // Fixes shim to be backward compatable with Node v0 to v4\n if (typeName === \"[object Object]\") {\n typeName = \"null\";\n }\n var methodName = this.getMethodName();\n if (functionName) {\n if (typeName && functionName.indexOf(typeName) != 0) {\n line += typeName + \".\";\n }\n line += functionName;\n if (methodName && functionName.indexOf(\".\" + methodName) != functionName.length - methodName.length - 1) {\n line += \" [as \" + methodName + \"]\";\n }\n } else {\n line += typeName + \".\" + (methodName || \"<anonymous>\");\n }\n } else if (isConstructor) {\n line += \"new \" + (functionName || \"<anonymous>\");\n } else if (functionName) {\n line += functionName;\n } else {\n line += fileLocation;\n addSuffix = false;\n }\n if (addSuffix) {\n line += \" (\" + fileLocation + \")\";\n }\n return line;\n}", "function CallSiteToString() {\n var fileName;\n var fileLocation = \"\";\n if (this.isNative()) {\n fileLocation = \"native\";\n } else {\n fileName = this.getScriptNameOrSourceURL();\n if (!fileName && this.isEval()) {\n fileLocation = this.getEvalOrigin();\n fileLocation += \", \"; // Expecting source position to follow.\n }\n\n if (fileName) {\n fileLocation += fileName;\n } else {\n // Source code does not originate from a file and is not native, but we\n // can still get the source position inside the source string, e.g. in\n // an eval string.\n fileLocation += \"<anonymous>\";\n }\n var lineNumber = this.getLineNumber();\n if (lineNumber != null) {\n fileLocation += \":\" + lineNumber;\n var columnNumber = this.getColumnNumber();\n if (columnNumber) {\n fileLocation += \":\" + columnNumber;\n }\n }\n }\n\n var line = \"\";\n var functionName = this.getFunctionName();\n var addSuffix = true;\n var isConstructor = this.isConstructor();\n var isMethodCall = !(this.isToplevel() || isConstructor);\n if (isMethodCall) {\n var typeName = this.getTypeName();\n // Fixes shim to be backward compatable with Node v0 to v4\n if (typeName === \"[object Object]\") {\n typeName = \"null\";\n }\n var methodName = this.getMethodName();\n if (functionName) {\n if (typeName && functionName.indexOf(typeName) != 0) {\n line += typeName + \".\";\n }\n line += functionName;\n if (methodName && functionName.indexOf(\".\" + methodName) != functionName.length - methodName.length - 1) {\n line += \" [as \" + methodName + \"]\";\n }\n } else {\n line += typeName + \".\" + (methodName || \"<anonymous>\");\n }\n } else if (isConstructor) {\n line += \"new \" + (functionName || \"<anonymous>\");\n } else if (functionName) {\n line += functionName;\n } else {\n line += fileLocation;\n addSuffix = false;\n }\n if (addSuffix) {\n line += \" (\" + fileLocation + \")\";\n }\n return line;\n}", "function CallSiteToString() {\n var fileName;\n var fileLocation = \"\";\n if (this.isNative()) {\n fileLocation = \"native\";\n } else {\n fileName = this.getScriptNameOrSourceURL();\n if (!fileName && this.isEval()) {\n fileLocation = this.getEvalOrigin();\n fileLocation += \", \"; // Expecting source position to follow.\n }\n\n if (fileName) {\n fileLocation += fileName;\n } else {\n // Source code does not originate from a file and is not native, but we\n // can still get the source position inside the source string, e.g. in\n // an eval string.\n fileLocation += \"<anonymous>\";\n }\n var lineNumber = this.getLineNumber();\n if (lineNumber != null) {\n fileLocation += \":\" + lineNumber;\n var columnNumber = this.getColumnNumber();\n if (columnNumber) {\n fileLocation += \":\" + columnNumber;\n }\n }\n }\n\n var line = \"\";\n var functionName = this.getFunctionName();\n var addSuffix = true;\n var isConstructor = this.isConstructor();\n var isMethodCall = !(this.isToplevel() || isConstructor);\n if (isMethodCall) {\n var typeName = this.getTypeName();\n // Fixes shim to be backward compatable with Node v0 to v4\n if (typeName === \"[object Object]\") {\n typeName = \"null\";\n }\n var methodName = this.getMethodName();\n if (functionName) {\n if (typeName && functionName.indexOf(typeName) != 0) {\n line += typeName + \".\";\n }\n line += functionName;\n if (methodName && functionName.indexOf(\".\" + methodName) != functionName.length - methodName.length - 1) {\n line += \" [as \" + methodName + \"]\";\n }\n } else {\n line += typeName + \".\" + (methodName || \"<anonymous>\");\n }\n } else if (isConstructor) {\n line += \"new \" + (functionName || \"<anonymous>\");\n } else if (functionName) {\n line += functionName;\n } else {\n line += fileLocation;\n addSuffix = false;\n }\n if (addSuffix) {\n line += \" (\" + fileLocation + \")\";\n }\n return line;\n}", "function CallSiteToString() {\n var fileName;\n var fileLocation = \"\";\n if (this.isNative()) {\n fileLocation = \"native\";\n } else {\n fileName = this.getScriptNameOrSourceURL();\n if (!fileName && this.isEval()) {\n fileLocation = this.getEvalOrigin();\n fileLocation += \", \"; // Expecting source position to follow.\n }\n\n if (fileName) {\n fileLocation += fileName;\n } else {\n // Source code does not originate from a file and is not native, but we\n // can still get the source position inside the source string, e.g. in\n // an eval string.\n fileLocation += \"<anonymous>\";\n }\n var lineNumber = this.getLineNumber();\n if (lineNumber != null) {\n fileLocation += \":\" + lineNumber;\n var columnNumber = this.getColumnNumber();\n if (columnNumber) {\n fileLocation += \":\" + columnNumber;\n }\n }\n }\n\n var line = \"\";\n var functionName = this.getFunctionName();\n var addSuffix = true;\n var isConstructor = this.isConstructor();\n var isMethodCall = !(this.isToplevel() || isConstructor);\n if (isMethodCall) {\n var typeName = this.getTypeName();\n // Fixes shim to be backward compatable with Node v0 to v4\n if (typeName === \"[object Object]\") {\n typeName = \"null\";\n }\n var methodName = this.getMethodName();\n if (functionName) {\n if (typeName && functionName.indexOf(typeName) != 0) {\n line += typeName + \".\";\n }\n line += functionName;\n if (methodName && functionName.indexOf(\".\" + methodName) != functionName.length - methodName.length - 1) {\n line += \" [as \" + methodName + \"]\";\n }\n } else {\n line += typeName + \".\" + (methodName || \"<anonymous>\");\n }\n } else if (isConstructor) {\n line += \"new \" + (functionName || \"<anonymous>\");\n } else if (functionName) {\n line += functionName;\n } else {\n line += fileLocation;\n addSuffix = false;\n }\n if (addSuffix) {\n line += \" (\" + fileLocation + \")\";\n }\n return line;\n}", "function string_src(filename, str) {\n\tvar src = require(\"stream\").Readable({ objectMode: true });\n\n\tsrc._read = function () {\n\t\tthis.push(new gutil.File({ cwd: \"\", base: \"\", path: filename, contents: new Buffer(str) }));\n\t\tthis.push(null);\n\t};\n\n\treturn src;\n}", "toString() {\n return fast_safe_stringify_1.default(this.serialize(), stringifyReplacer, 2);\n }", "function repr(value)\n{\n if (typeof value === 'string')\n return \"'\" + value + \"'\";\n else if (typeof value === 'undefined')\n return 'undefined';\n else if (value === null)\n return 'null';\n else if (typeof value === 'object') {\n if (isState(value))\n return \"state<\" + value.toString() + \">\";\n else if (isSymbol(value))\n return \"symbol<\" + value.toString() + \">\";\n else if (isMotion(value))\n return \"motion<\" + value.toString() + \">\";\n else if (isInstrTuple(value))\n return \"instruction<\" + value.toString() + \">\";\n else if (isPosition(value))\n return \"position<\" + value.toString() + \">\";\n else if (value.isProgram)\n return \"program<count=\" + value.count() + \">\";\n else if (value.isTape)\n return \"tape<\" + value.toHumanString() + \">\";\n else {\n var count_props = 0;\n for (var prop in value)\n count_props += 1;\n if (count_props < 5)\n return \"object<\" + JSON.stringify(value) + \">\";\n else if (!value.toString().match(/Object/))\n return \"object<\" + value.toString() + \">\";\n else\n return \"object\";\n }\n }\n else if (typeof value === 'boolean')\n return \"bool<\" + value + \">\";\n else if (typeof value === 'number')\n return \"\" + value;\n else if (typeof value === 'symbol')\n return \"symbol<\" + value + \">\";\n else if (typeof value === 'function') {\n if (value.name === \"\")\n return \"anonymous function\";\n else\n return \"function<\" + value.name + \">\";\n } else\n return \"unknown value: \" + value;\n}", "static async compileFile (fromFileRelative, toDirRelative, data, options) {\n const { name, dir } = path.parse(fromFileRelative)\n let subDir = options.base ? dir.split(options.base).pop() : ''\n subDir = subDir.startsWith('/') ? subDir.slice(1) : subDir\n const toFileAbsolute = path.resolve(toDirRelative, subDir, name + options.ext)\n const fromFileAbsolute = path.resolve(fromFileRelative)\n const result = await CompileEjsTask.renderFile(fromFileAbsolute, data, options)\n fs.outputFileSync(toFileAbsolute, result)\n }", "function makeFile(info) {\n const { comment, upstream, config } = info\n return (\n `// ${comment}\\n` +\n '//\\n' +\n `// Auto-generated by ${packageJson.name}\\n` +\n `// based on rules from ${upstream}\\n` +\n '\\n' +\n '\"use strict\";\\n' +\n '\\n' +\n `module.exports = ${JSON.stringify(sortJson(config), null, 2)};\\n`\n )\n}", "function toTNodeTypeAsString(tNodeType) {\n var text = '';\n tNodeType & 1\n /* Text */\n && (text += '|Text');\n tNodeType & 2\n /* Element */\n && (text += '|Element');\n tNodeType & 4\n /* Container */\n && (text += '|Container');\n tNodeType & 8\n /* ElementContainer */\n && (text += '|ElementContainer');\n tNodeType & 16\n /* Projection */\n && (text += '|Projection');\n tNodeType & 32\n /* Icu */\n && (text += '|IcuContainer');\n tNodeType & 64\n /* Placeholder */\n && (text += '|Placeholder');\n return text.length > 0 ? text.substring(1) : text;\n } // Note: This hack is necessary so we don't erroneously get a circular dependency", "function rfs(file) {\n return fs.readFileSync(path.join(__dirname, file), 'utf-8').replace(/\\r\\n/g, '\\n');\n}", "function generateFile(data) {\n FileReader.writeFile(\"compiled.js\", data, (err) => {\n if (err) {\n console.log(\"File write err\");\n }\n });\n}", "function compile_fun() {\n exec(\"mi \" + sourceFile + ' > ' + __dirname +'/webpage/js/data-source.js', (error, stdout, stderr) => {\n\tif (error) {\n\t fs.readFile(__dirname +'/webpage/js/data-source.js', function(err, buf) {\n\t\tfs.writeFile(__dirname +'/webpage/js/data-source.js',\n\t\t\t \"let inputModel = '\" + buf.toString().replace(/(\\r\\n|\\n|\\r)/gm, \"\")\n\t\t\t + \"';\" , function (err) {if (err) return console.log(err);});});return;}\n\tif (stderr) {\n console.log(`stderr: ${stderr}`);\n return;\n\t}\n });\n}", "toString() {\n this.path\n }", "function dump(obj, filename){\n let data_str = JSON.stringify(obj);\n fs.writeFileSync(filename, data_str)\n}", "dumpTokens(filename) {\n const config = this.getConfigFor(filename);\n const resolved = config.resolve();\n const source = resolved.transformFilename(filename);\n const engine = new Engine(resolved, Parser);\n return engine.dumpTokens(source);\n }", "function toNlcst(tree, file, Parser) {\n var parser\n var location\n var results\n var doc\n\n // Warn for invalid parameters.\n if (!tree || !tree.type) {\n throw new Error('hast-util-to-nlcst expected node')\n }\n\n if (!file || !file.messages) {\n throw new Error('hast-util-to-nlcst expected file')\n }\n\n // Construct parser.\n if (!Parser) {\n throw new Error('hast-util-to-nlcst expected parser')\n }\n\n if (!position.start(tree).line || !position.start(tree).column) {\n throw new Error('hast-util-to-nlcst expected position on nodes')\n }\n\n doc = String(file)\n location = vfileLocation(doc)\n parser = 'parse' in Parser ? Parser : new Parser()\n\n // Transform hast to nlcst, and pass these into `parser.parse` to insert\n // sentences, paragraphs where needed.\n results = []\n\n find(tree)\n\n return {\n type: 'RootNode',\n children: results,\n position: {start: location.toPoint(0), end: location.toPoint(doc.length)}\n }\n\n function find(node) {\n if (node.type === 'root') {\n findAll(node.children)\n } else if (node.type === 'element' && !ignore(node)) {\n if (explicit(node)) {\n // Explicit paragraph.\n add(node)\n } else if (flowAccepting(node)) {\n // Slightly simplified version of: <https://html.spec.whatwg.org/#paragraphs>.\n implicit(flattenAll(node.children))\n } else {\n // Dig deeper.\n findAll(node.children)\n }\n }\n }\n\n function findAll(children) {\n var index = -1\n\n while (++index < children.length) {\n find(children[index])\n }\n }\n\n function flattenAll(children) {\n var results = []\n var index = -1\n\n while (++index < children.length) {\n if (unravelInParagraph(children[index])) {\n push.apply(results, flattenAll(children[index].children))\n } else {\n results.push(children[index])\n }\n }\n\n return results\n }\n\n function add(node) {\n var result = ('length' in node ? all : one)(node)\n\n if (result.length) {\n results.push(parser.tokenizeParagraph(result))\n }\n }\n\n function implicit(children) {\n var index = -1\n var start = -1\n var viable\n var child\n\n while (++index <= children.length) {\n child = children[index]\n\n if (child && phrasing(child)) {\n if (start === -1) start = index\n\n if (!viable && !embedded(child) && !whitespace(child)) {\n viable = true\n }\n } else if (child && start === -1) {\n find(child)\n start = index + 1\n } else if (start !== -1) {\n ;(viable ? add : findAll)(children.slice(start, index))\n\n if (child) {\n find(child)\n }\n\n viable = null\n start = -1\n }\n }\n }\n\n // Convert `node` (hast) to nlcst.\n function one(node) {\n var replacement\n var change\n\n if (node.type === 'text') {\n replacement = parser.tokenize(node.value)\n change = true\n } else if (node.type === 'element' && !ignore(node)) {\n if (node.tagName === 'wbr') {\n replacement = [parser.tokenizeWhiteSpace(' ')]\n change = true\n } else if (node.tagName === 'br') {\n replacement = [parser.tokenizeWhiteSpace('\\n')]\n change = true\n } else if (source(node)) {\n replacement = [parser.tokenizeSource(textContent(node))]\n change = true\n } else {\n replacement = all(node.children)\n }\n }\n\n return change\n ? patch(replacement, location, location.toOffset(position.start(node)))\n : replacement\n }\n\n // Convert all `children` (hast) to nlcst.\n function all(children) {\n var results = []\n var index = -1\n\n while (++index < children.length) {\n push.apply(results, one(children[index]) || [])\n }\n\n return results\n }\n\n // Patch a position on each node in `nodes`.\n // `offset` is the offset in `file` this run of content starts at.\n //\n // Note that nlcst nodes are concrete, meaning that their starting and ending\n // positions can be inferred from their content.\n function patch(nodes, location, offset) {\n var index = -1\n var start = offset\n var end\n var node\n\n while (++index < nodes.length) {\n node = nodes[index]\n\n if (node.children) {\n patch(node.children, location, start)\n }\n\n end = start + toString(node).length\n\n node.position = {\n start: location.toPoint(start),\n end: location.toPoint(end)\n }\n\n start = end\n }\n\n return nodes\n }\n}", "function buildTargetString(_member){\n var filename = '';\n var target = null;\n var targetString = '';\n for(var file in _member.targets){\n filename = file;\n\n if(_member.targets[file].add == true){\n targetString += filename;\n \n if(_member.targets[file].compress == false){\n targetString += '-u';\n }\n \n targetString += ',';\n \n }\n \n \n }\n /*cut off trailing comma*/\n if(targetString != '')\n targetString = targetString.substr(0, targetString.length - 1);\n \n console.log('TARGET STRING: ' + targetString);\n return targetString;\n }", "function makeText(node, stat) {\n switch (typeof node) {\n case 'object':\n //return JSON.stringify(node);\n //node = removeNumberedIndices(node);\n return breakout(node, stat);\n break;\n case 'undefined':\n return '0';\n break;\n default:\n return node.toString();\n }\n }", "convert(node) {\n let result = this._write_node(node);\n\n if (!result.startsWith('\\n\\n')) result = this.escape_block(result);\n\n return result.replace(/^\\n+|\\n+$/g, '') + '\\n';\n }", "getHeader() {\n return `/**\n * IN2 Logic Tree File\n *\n * This file has been generated by an IN2 compiler.\n */\\n/*eslint-disable-line*/function run(isDryRun){\\n/* global player, core, engine */\nconst files = {};\nconst scope = {};\nconst CURRENT_NODE_VAR = '${CURRENT_NODE_VAR}';\nconst CURRENT_FILE_VAR = '${CURRENT_FILE_VAR}';\nconst LAST_FILE_VAR = '${LAST_FILE_VAR}';`;\n }", "function serializeText(nodeStr, funName, text)\n {\n // Try to keep \"document.write\" in inline-script from being preserved,\n // because document.write blows away the document in other contexts.\n text = text.replace(/document\\.write/g, \"tnemucod.write\");\n\n if (!splitTextNodes) {\n cs.push(nodeStr + \" = document.\" + funName + \"(\" + simpleSource(text) + \");\");\n } else {\n cs.push(nodeStr + \" = document.\" + funName + \"(\\\"\\\");\");\n for (var i = 0; i < text.length; ++i) {\n cs.push(nodeStr + \".data += \" + simpleSource(text[i]) + \";\");\n }\n }\n }", "function renderToString($, indent, level) {\n let attrs = getAttrs($.node.props);\n let s1 = `<${$.node.type}${renderAttrsToString(attrs)}>`;\n if (Tools.isVoidElement($.node.type)) {\n return Tools.format(s1, indent, level);\n }\n let s3 = `</${$.node.type}>`;\n if ($.node.children.length === 0) {\n return Tools.format(s1 + s3, indent, level);\n }\n let s2;\n if ($.node.children.length === 1 && $.node.children[0].type === \"#\") {\n s2 = $.childWraps[0].renderToString(0, 0);\n return Tools.format(s1 + s2 + s3, indent, level);\n }\n s1 = Tools.format(s1, indent, level);\n s2 = $.childWraps.map(x => x.renderToString(indent, level + 1)).join(\"\");\n s3 = Tools.format(s3, indent, level);\n return s1 + s2 + s3;\n}", "function compileFile(filename, options) {\n fs.readFile(filename, \"utf-8\", (error, sourceCode) => {\n if (error) {\n console.error(error);\n return;\n }\n console.log(compile(sourceCode, options));\n });\n}", "function church_ast_to_string(ast) {\n\tif (util.is_leaf(ast)) {\n\t\treturn ast.text;\n\t} else {\n\t\treturn \"(\" + ast.children.map(function(x) {return church_ast_to_string(x)}).join(\" \") + \")\"\n\t}\n}", "toString(callback) {\n return this.toArray((node) => node.toString(callback)).toString();\n }", "vlist2string(vlist, label) {\n\t\tlet s = '';\n\t\tfor (let u of vlist) {\n\t\t\tif (s.length > 0) s += ' ';\n\t\t\ts += this.x2s(e, label);\n\t\t}\n\t\treturn '[' + s + ']';\n\t}", "function toTNodeTypeAsString(tNodeType) {\n let text = '';\n (tNodeType & 1 /* Text */) && (text += '|Text');\n (tNodeType & 2 /* Element */) && (text += '|Element');\n (tNodeType & 4 /* Container */) && (text += '|Container');\n (tNodeType & 8 /* ElementContainer */) && (text += '|ElementContainer');\n (tNodeType & 16 /* Projection */) && (text += '|Projection');\n (tNodeType & 32 /* Icu */) && (text += '|IcuContainer');\n (tNodeType & 64 /* Placeholder */) && (text += '|Placeholder');\n return text.length > 0 ? text.substring(1) : text;\n}", "function toTNodeTypeAsString(tNodeType) {\n let text = '';\n (tNodeType & 1 /* Text */) && (text += '|Text');\n (tNodeType & 2 /* Element */) && (text += '|Element');\n (tNodeType & 4 /* Container */) && (text += '|Container');\n (tNodeType & 8 /* ElementContainer */) && (text += '|ElementContainer');\n (tNodeType & 16 /* Projection */) && (text += '|Projection');\n (tNodeType & 32 /* Icu */) && (text += '|IcuContainer');\n (tNodeType & 64 /* Placeholder */) && (text += '|Placeholder');\n return text.length > 0 ? text.substring(1) : text;\n}", "function toTNodeTypeAsString(tNodeType) {\n let text = '';\n (tNodeType & 1 /* Text */) && (text += '|Text');\n (tNodeType & 2 /* Element */) && (text += '|Element');\n (tNodeType & 4 /* Container */) && (text += '|Container');\n (tNodeType & 8 /* ElementContainer */) && (text += '|ElementContainer');\n (tNodeType & 16 /* Projection */) && (text += '|Projection');\n (tNodeType & 32 /* Icu */) && (text += '|IcuContainer');\n (tNodeType & 64 /* Placeholder */) && (text += '|Placeholder');\n return text.length > 0 ? text.substring(1) : text;\n}", "function toTNodeTypeAsString(tNodeType) {\n let text = '';\n (tNodeType & 1 /* Text */) && (text += '|Text');\n (tNodeType & 2 /* Element */) && (text += '|Element');\n (tNodeType & 4 /* Container */) && (text += '|Container');\n (tNodeType & 8 /* ElementContainer */) && (text += '|ElementContainer');\n (tNodeType & 16 /* Projection */) && (text += '|Projection');\n (tNodeType & 32 /* Icu */) && (text += '|IcuContainer');\n (tNodeType & 64 /* Placeholder */) && (text += '|Placeholder');\n return text.length > 0 ? text.substring(1) : text;\n}", "function toTNodeTypeAsString(tNodeType) {\n let text = '';\n (tNodeType & 1 /* Text */) && (text += '|Text');\n (tNodeType & 2 /* Element */) && (text += '|Element');\n (tNodeType & 4 /* Container */) && (text += '|Container');\n (tNodeType & 8 /* ElementContainer */) && (text += '|ElementContainer');\n (tNodeType & 16 /* Projection */) && (text += '|Projection');\n (tNodeType & 32 /* Icu */) && (text += '|IcuContainer');\n (tNodeType & 64 /* Placeholder */) && (text += '|Placeholder');\n return text.length > 0 ? text.substring(1) : text;\n}", "function toTNodeTypeAsString(tNodeType) {\n let text = '';\n (tNodeType & 1 /* Text */) && (text += '|Text');\n (tNodeType & 2 /* Element */) && (text += '|Element');\n (tNodeType & 4 /* Container */) && (text += '|Container');\n (tNodeType & 8 /* ElementContainer */) && (text += '|ElementContainer');\n (tNodeType & 16 /* Projection */) && (text += '|Projection');\n (tNodeType & 32 /* Icu */) && (text += '|IcuContainer');\n (tNodeType & 64 /* Placeholder */) && (text += '|Placeholder');\n return text.length > 0 ? text.substring(1) : text;\n}", "function to_s(ast) {\n return Serializer.to_s(ast);\n}", "function toString$9(encoding) {\n return (this.contents || '').toString(encoding)\n}", "toString() {\n let result = 'root';\n let current = this.root;\n while(current) {\n result += ' -> ' + current.value;\n current = current.next;\n }\n return result + ' -> null';\n }", "function nomoduleloaderTranspiler() {\n // var allExports = {};\n // return through2.obj(function (file, enc, cb) {\n // var content = file.contents.toString();\n // var newContent = '';\n\n // var arr = content.split('\\n');\n // // abandon 'define' scope\n // var result = /function \\(require, exports(,\\s(\\w+?))*\\)/.exec(arr[0]);\n\n // for (var i = 1; i < arr.length - 1; i++) {\n // if (i == 2) continue;\n // arr[i] = arr[i].substr(4, arr[i].length - 4);\n // if (!arr[i].startsWith('exports.')) {\n // if (result[2] == undefined) {\n // newContent += arr[i] + '\\n';\n // }\n // else {\n // var exports = usedExports(result, arr[i]);\n // var s = arr[i];\n // exports.forEach(v => {\n // s = s.replace(v + '.', '');\n // });\n // newContent += s + '\\n';\n // }\n // }\n // }\n\n // file.contents = Buffer.from(newContent);\n // console.log(newContent);\n // console.log(content);\n // this.push(file);\n // cb();\n // });\n}", "function toString$6(encoding) {\n return (this.contents || '').toString(encoding)\n}", "function tnfToString(tnf) {\n var value = tnf;\n\n switch (tnf) {\n case ndef.TNF_EMPTY:\n value = \"Empty\";\n break;\n case ndef.TNF_WELL_KNOWN:\n value = \"Well Known\";\n break;\n case ndef.TNF_MIME_MEDIA:\n value = \"Mime Media\";\n break;\n case ndef.TNF_ABSOLUTE_URI:\n value = \"Absolute URI\";\n break;\n case ndef.TNF_EXTERNAL_TYPE:\n value = \"External\";\n break;\n case ndef.TNF_UNKNOWN:\n value = \"Unknown\";\n break;\n case ndef.TNF_UNCHANGED:\n value = \"Unchanged\";\n break;\n case ndef.TNF_RESERVED:\n value = \"Reserved\";\n break;\n }\n return value;\n}", "function icuCreateOpCodesToString(opcodes) {\n var parser = new OpCodeParser(opcodes || (Array.isArray(this) ? this : []));\n var lines = [];\n\n function consumeOpCode(opCode) {\n var parent = getParentFromIcuCreateOpCode(opCode);\n var ref = getRefFromIcuCreateOpCode(opCode);\n\n switch (getInstructionFromIcuCreateOpCode(opCode)) {\n case 0\n /* AppendChild */\n :\n return \"(lView[\".concat(parent, \"] as Element).appendChild(lView[\").concat(lastRef, \"])\");\n\n case 1\n /* Attr */\n :\n return \"(lView[\".concat(ref, \"] as Element).setAttribute(\\\"\").concat(parser.consumeString(), \"\\\", \\\"\").concat(parser.consumeString(), \"\\\")\");\n }\n\n throw new Error('Unexpected OpCode: ' + getInstructionFromIcuCreateOpCode(opCode));\n }\n\n var lastRef = -1;\n\n while (parser.hasMore()) {\n var value = parser.consumeNumberStringOrMarker();\n\n if (value === ICU_MARKER) {\n var text = parser.consumeString();\n lastRef = parser.consumeNumber();\n lines.push(\"lView[\".concat(lastRef, \"] = document.createComment(\\\"\").concat(text, \"\\\")\"));\n } else if (value === ELEMENT_MARKER) {\n var _text = parser.consumeString();\n\n lastRef = parser.consumeNumber();\n lines.push(\"lView[\".concat(lastRef, \"] = document.createElement(\\\"\").concat(_text, \"\\\")\"));\n } else if (typeof value === 'string') {\n lastRef = parser.consumeNumber();\n lines.push(\"lView[\".concat(lastRef, \"] = document.createTextNode(\\\"\").concat(value, \"\\\")\"));\n } else if (typeof value === 'number') {\n var line = consumeOpCode(value);\n line && lines.push(line);\n } else {\n throw new Error('Unexpected value');\n }\n }\n\n return lines;\n}", "function toString(encoding) {\n return (this.contents || '').toString(encoding)\n}" ]
[ "0.5808315", "0.5808315", "0.5808315", "0.58024615", "0.57930595", "0.57202554", "0.55628264", "0.51197964", "0.4944126", "0.4939946", "0.49377835", "0.48916206", "0.48902163", "0.47794235", "0.4768549", "0.4749499", "0.47492388", "0.4656568", "0.46530744", "0.4642199", "0.46282354", "0.46267152", "0.4620966", "0.45831713", "0.45825985", "0.45725337", "0.45710328", "0.45564672", "0.4555462", "0.4507171", "0.44983062", "0.44983062", "0.44949836", "0.44888297", "0.44736713", "0.4462455", "0.44406995", "0.44198617", "0.43994159", "0.43946415", "0.43889526", "0.43688554", "0.43644136", "0.43560866", "0.4348247", "0.43281066", "0.4310852", "0.43108007", "0.43090254", "0.4293523", "0.42811093", "0.42671698", "0.4266057", "0.42630944", "0.42519304", "0.42519304", "0.42519304", "0.42519304", "0.42519304", "0.42412525", "0.4234481", "0.4225588", "0.42140666", "0.42107975", "0.4201908", "0.4195829", "0.41942194", "0.4184892", "0.41789317", "0.41762656", "0.41754317", "0.41741243", "0.41680014", "0.41677108", "0.4164252", "0.4139536", "0.41305286", "0.41275686", "0.4125534", "0.41222218", "0.41149065", "0.4110083", "0.41032943", "0.41032943", "0.41032943", "0.41032943", "0.41032943", "0.41032943", "0.41007277", "0.4097722", "0.40877408", "0.40874958", "0.40853062", "0.408305", "0.4081461", "0.40811622" ]
0.5798683
8
Parse a file (in string or VFile representation) into a Unist node using the `Parser` on the processor, then run transforms on that node, and compile the resulting node using the `Compiler` on the processor, and store that result on the VFile.
function process(doc, cb) { freeze() assertParser('process', processor.Parser) assertCompiler('process', processor.Compiler) if (!cb) { return new Promise(executor) } executor(null, cb) function executor(resolve, reject) { var file = vfile(doc) pipeline.run(processor, {file: file}, done) function done(err) { if (err) { reject(err) } else if (resolve) { resolve(file) } else { cb(null, file) } } } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function run(node, file, cb) {\n assertNode(node)\n freeze()\n\n if (!cb && typeof file === 'function') {\n cb = file\n file = null\n }\n\n if (!cb) {\n return new Promise(executor)\n }\n\n executor(null, cb)\n\n function executor(resolve, reject) {\n transformers.run(node, vfile(file), done)\n\n function done(error, tree, file) {\n tree = tree || node\n if (error) {\n reject(error)\n } else if (resolve) {\n resolve(tree)\n } else {\n cb(null, tree, file)\n }\n }\n }\n }", "function run(node, file, cb) {\n assertNode(node)\n freeze()\n\n if (!cb && typeof file === 'function') {\n cb = file\n file = null\n }\n\n if (!cb) {\n return new Promise(executor)\n }\n\n executor(null, cb)\n\n function executor(resolve, reject) {\n transformers.run(node, vfile(file), done)\n\n function done(error, tree, file) {\n tree = tree || node\n if (error) {\n reject(error)\n } else if (resolve) {\n resolve(tree)\n } else {\n cb(null, tree, file)\n }\n }\n }\n }", "function run(node, file, cb) {\n assertNode(node)\n freeze()\n\n if (!cb && typeof file === 'function') {\n cb = file\n file = null\n }\n\n if (!cb) {\n return new Promise(executor)\n }\n\n executor(null, cb)\n\n function executor(resolve, reject) {\n transformers.run(node, vfile(file), done)\n\n function done(err, tree, file) {\n tree = tree || node\n if (err) {\n reject(err)\n } else if (resolve) {\n resolve(tree)\n } else {\n cb(null, tree, file)\n }\n }\n }\n }", "function run(node, file, cb) {\n assertNode(node)\n freeze()\n\n if (!cb && typeof file === 'function') {\n cb = file\n file = null\n }\n\n if (!cb) {\n return new Promise(executor)\n }\n\n executor(null, cb)\n\n function executor(resolve, reject) {\n transformers.run(node, vfile(file), done)\n\n function done(err, tree, file) {\n tree = tree || node\n if (err) {\n reject(err)\n } else if (resolve) {\n resolve(tree)\n } else {\n cb(null, tree, file)\n }\n }\n }\n }", "function run(node, file, cb) {\n assertNode(node)\n freeze()\n\n if (!cb && typeof file === 'function') {\n cb = file\n file = null\n }\n\n if (!cb) {\n return new Promise(executor)\n }\n\n executor(null, cb)\n\n function executor(resolve, reject) {\n transformers.run(node, vfile(file), done)\n\n function done(err, tree, file) {\n tree = tree || node\n if (err) {\n reject(err)\n } else if (resolve) {\n resolve(tree)\n } else {\n cb(null, tree, file)\n }\n }\n }\n }", "function run(node, file, cb) {\n assertNode(node)\n freeze()\n\n if (!cb && typeof file === 'function') {\n cb = file\n file = null\n }\n\n if (!cb) {\n return new Promise(executor)\n }\n\n executor(null, cb)\n\n function executor(resolve, reject) {\n transformers.run(node, vfile(file), done)\n\n function done(err, tree, file) {\n tree = tree || node\n if (err) {\n reject(err)\n } else if (resolve) {\n resolve(tree)\n } else {\n cb(null, tree, file)\n }\n }\n }\n }", "function run(node, file, cb) {\n assertNode(node)\n freeze()\n\n if (!cb && typeof file === 'function') {\n cb = file\n file = null\n }\n\n if (!cb) {\n return new Promise(executor)\n }\n\n executor(null, cb)\n\n function executor(resolve, reject) {\n transformers.run(node, vfile(file), done)\n\n function done(err, tree, file) {\n tree = tree || node\n if (err) {\n reject(err)\n } else if (resolve) {\n resolve(tree)\n } else {\n cb(null, tree, file)\n }\n }\n }\n }", "function run(node, file, cb) {\n assertNode(node)\n freeze()\n\n if (!cb && typeof file === 'function') {\n cb = file\n file = null\n }\n\n if (!cb) {\n return new Promise(executor)\n }\n\n executor(null, cb)\n\n function executor(resolve, reject) {\n transformers.run(node, vfile(file), done)\n\n function done(err, tree, file) {\n tree = tree || node\n if (err) {\n reject(err)\n } else if (resolve) {\n resolve(tree)\n } else {\n cb(null, tree, file)\n }\n }\n }\n }", "function run(node, file, cb) {\n assertNode(node);\n freeze();\n\n if (!cb && typeof file === 'function') {\n cb = file;\n file = null;\n }\n\n if (!cb) {\n return new Promise(executor)\n }\n\n executor(null, cb);\n\n function executor(resolve, reject) {\n transformers.run(node, vfile(file), done);\n\n function done(error, tree, file) {\n tree = tree || node;\n if (error) {\n reject(error);\n } else if (resolve) {\n resolve(tree);\n } else {\n cb(null, tree, file);\n }\n }\n }\n }", "function process(doc, cb) {\n freeze()\n assertParser('process', processor.Parser)\n assertCompiler('process', processor.Compiler)\n\n if (!cb) {\n return new Promise(executor)\n }\n\n executor(null, cb)\n\n function executor(resolve, reject) {\n var file = vfile(doc)\n\n pipeline.run(processor, {file: file}, done)\n\n function done(error) {\n if (error) {\n reject(error)\n } else if (resolve) {\n resolve(file)\n } else {\n cb(null, file)\n }\n }\n }\n }", "function process(doc, cb) {\n freeze()\n assertParser('process', processor.Parser)\n assertCompiler('process', processor.Compiler)\n\n if (!cb) {\n return new Promise(executor)\n }\n\n executor(null, cb)\n\n function executor(resolve, reject) {\n var file = vfile(doc)\n\n pipeline.run(processor, {file: file}, done)\n\n function done(error) {\n if (error) {\n reject(error)\n } else if (resolve) {\n resolve(file)\n } else {\n cb(null, file)\n }\n }\n }\n }", "function process(doc, cb) {\n freeze();\n assertParser('process', processor.Parser);\n assertCompiler('process', processor.Compiler);\n\n if (!cb) {\n return new Promise(executor);\n }\n\n executor(null, cb);\n\n function executor(resolve, reject) {\n var file = vfile(doc);\n\n pipeline.run(processor, {file: file}, done);\n\n function done(err) {\n if (err) {\n reject(err);\n } else if (resolve) {\n resolve(file);\n } else {\n cb(null, file);\n }\n }\n }\n }", "function process(doc, cb) {\n freeze();\n assertParser('process', processor.Parser);\n assertCompiler('process', processor.Compiler);\n\n if (!cb) {\n return new Promise(executor)\n }\n\n executor(null, cb);\n\n function executor(resolve, reject) {\n var file = vfile(doc);\n\n pipeline.run(processor, {file: file}, done);\n\n function done(error) {\n if (error) {\n reject(error);\n } else if (resolve) {\n resolve(file);\n } else {\n cb(null, file);\n }\n }\n }\n }", "function transform(context, file, fileSet, next) {\n if (stats(file).fatal) {\n next()\n } else {\n debug('Transforming document `%s`', file.path)\n context.processor.run(context.tree, file, onrun)\n }\n\n function onrun(error, node) {\n debug('Transformed document (error: %s)', error)\n context.tree = node\n next(error)\n }\n}", "function run(node, file, cb) {\n assertNode(node);\n freeze();\n\n if (!cb && func(file)) {\n cb = file;\n file = null;\n }\n\n if (!cb) {\n return new Promise(executor);\n }\n\n executor(null, cb);\n\n function executor(resolve, reject) {\n transformers.run(node, vfile(file), done);\n\n function done(err, tree, file) {\n tree = tree || node;\n if (err) {\n reject(err);\n } else if (resolve) {\n resolve(tree);\n } else {\n cb(null, tree, file);\n }\n }\n }\n }", "function parse( file ) {\n\t\treturn __awaiter( this, void 0, void 0, function () {\n\t\t\treturn __generator( this, function ( _a ) {\n\t\t\t\treturn [\n\t\t\t\t\t2,\n\t\t\t\t\t/*return*/\n\t\t\t\t\tnew Promise( function ( resolve, reject ) {\n\t\t\t\t\t\tfs.readFile( file, 'utf8', function ( err, data ) {\n\t\t\t\t\t\t\tif ( err ) {\n\t\t\t\t\t\t\t\treject( err );\n\t\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\tresolve( parseString( data ) );\n\t\t\t\t\t\t} );\n\t\t\t\t\t} ),\n\t\t\t\t];\n\t\t\t} );\n\t\t} );\n\t}", "function parse(file) {\n return __awaiter(this, void 0, void 0, function () {\n return __generator(this, function (_a) {\n return [2\n /*return*/\n , new Promise(function (resolve, reject) {\n fs.readFile(file, 'utf8', function (err, data) {\n if (err) {\n reject(err);\n return;\n }\n\n resolve(parseString(data));\n });\n })];\n });\n });\n }", "function parse(file: string): ParserReturn {\n if (file.match(/\\.tsx?$/)) {\n return TypeScriptParser.parse(file);\n } else {\n return babylonParser(file);\n }\n}", "function treeForFile (file) {\n var contents = null\n try {\n contents = fs.readFileSync(file).toString()\n } catch (err) {\n if (err.code === 'ENOENT') {\n logger.error(\"File not found: \"+file)\n process.exit(1)\n }\n throw err\n }\n var name = path.basename(file),\n parser = new Parser()\n\n parser.file = name\n // Parse and type-check the file; catch and report any errors\n try {\n var tree = parser.parse(contents),\n typesystem = new TypeSystem()\n typesystem.walk(tree)\n } catch (err) {\n reportError(err)\n process.exit(1)\n }\n return tree\n}// treeForFile", "function parse(doc) {\n var file = vfile(doc)\n var Parser\n\n freeze()\n Parser = processor.Parser\n assertParser('parse', Parser)\n\n if (newable(Parser, 'parse')) {\n return new Parser(String(file), file).parse()\n }\n\n return Parser(String(file), file) // eslint-disable-line new-cap\n }", "function parse(doc) {\n var file = vfile(doc)\n var Parser\n\n freeze()\n Parser = processor.Parser\n assertParser('parse', Parser)\n\n if (newable(Parser, 'parse')) {\n return new Parser(String(file), file).parse()\n }\n\n return Parser(String(file), file) // eslint-disable-line new-cap\n }", "function parse(doc) {\n var file = vfile(doc)\n var Parser\n\n freeze()\n Parser = processor.Parser\n assertParser('parse', Parser)\n\n if (newable(Parser, 'parse')) {\n return new Parser(String(file), file).parse()\n }\n\n return Parser(String(file), file) // eslint-disable-line new-cap\n }", "function parse(doc) {\n var file = vfile(doc)\n var Parser\n\n freeze()\n Parser = processor.Parser\n assertParser('parse', Parser)\n\n if (newable(Parser)) {\n return new Parser(String(file), file).parse()\n }\n\n return Parser(String(file), file) // eslint-disable-line new-cap\n }", "function parse(doc) {\n var file = vfile(doc)\n var Parser\n\n freeze()\n Parser = processor.Parser\n assertParser('parse', Parser)\n\n if (newable(Parser)) {\n return new Parser(String(file), file).parse()\n }\n\n return Parser(String(file), file) // eslint-disable-line new-cap\n }", "function parse(doc) {\n var file = vfile(doc)\n var Parser\n\n freeze()\n Parser = processor.Parser\n assertParser('parse', Parser)\n\n if (newable(Parser)) {\n return new Parser(String(file), file).parse()\n }\n\n return Parser(String(file), file) // eslint-disable-line new-cap\n }", "function parse(doc) {\n var file = vfile(doc)\n var Parser\n\n freeze()\n Parser = processor.Parser\n assertParser('parse', Parser)\n\n if (newable(Parser)) {\n return new Parser(String(file), file).parse()\n }\n\n return Parser(String(file), file) // eslint-disable-line new-cap\n }", "function parse(doc) {\n var file = vfile(doc)\n var Parser\n\n freeze()\n Parser = processor.Parser\n assertParser('parse', Parser)\n\n if (newable(Parser)) {\n return new Parser(String(file), file).parse()\n }\n\n return Parser(String(file), file) // eslint-disable-line new-cap\n }", "function transform(file, cb) {\n gutil.log('Preprocessing:', file.path);\n // read and modify file contents\n var fileContents = String(file.contents);\n fileContents = fileContents.replace(/^\\s*(import .*?)(?:;|$)/gm,\n function(str, group1) {\n return 'jsio(\"' + group1 + '\");';\n });\n file.contents = new Buffer(fileContents);\n\n // if there was some error, just pass as the first parameter here\n cb(null, file);\n }", "function parse(doc) {\n var file = vfile(doc);\n var Parser;\n\n freeze();\n Parser = processor.Parser;\n assertParser('parse', Parser);\n\n if (newable(Parser, 'parse')) {\n return new Parser(String(file), file).parse()\n }\n\n return Parser(String(file), file) // eslint-disable-line new-cap\n }", "process (filepath) {\n\t\tlet {\n\t\t\tchassis,\n\t\t\tgenerateNamespacedSelector,\n\t\t\tisNamespaced,\n\t\t\tnamespaceSelectors,\n\t\t\tprocessImports,\n\t\t\tprocessNesting,\n\t\t\tprocessAtRules,\n\t\t\tprocessMixins,\n\t\t\tprocessNot,\n\t\t\tprocessFunctions,\n\t\t\tstoreAtRules,\n\t\t\ttypographyEngineIsInitialized\n\t\t} = this\n\n\t\tlet {\n\t\t\tatRules,\n\t\t\tpost,\n\t\t\tsettings,\n\t\t\tutils\n\t\t} = chassis\n\n\t\tlet tasks = new NGN.Tasks()\n\t\tlet sourceMap\n\n\t\ttasks.add('Processing Imports', next => {\n\t\t\tif (typographyEngineIsInitialized) {\n\t\t\t\tthis.tree.walkAtRules('import', atRule => {\n\t\t\t\t\tchassis.imports.push(atRule.params)\n\t\t\t\t\tatRule.remove()\n\t\t\t\t})\n\t\t\t}\n\n\t\t\tprocessImports()\n\t\t\tprocessNesting()\n\t\t\tnext()\n\t\t})\n\n\t\ttasks.add('Processing Mixins', next => {\n\t\t\tprocessMixins()\n\t\t\tprocessNot()\n\t\t\tprocessNesting()\n\n\t\t\tnext()\n\t\t})\n\n\t\ttasks.add('Processing Functions', next => {\n\t\t\tprocessFunctions()\n\t\t\tnext()\n\t\t})\n\n\t\ttasks.add('Namespacing Selectors', next => {\n\t\t\tnamespaceSelectors()\n\t\t\tnext()\n\t\t})\n\n\t\tif (typographyEngineIsInitialized) {\n\t\t\ttasks.add('Initializing Typography Engine', next => {\n\t\t\t\tthis.tree = this.core.css.append(this.tree)\n\t\t\t\tnext()\n\t\t\t})\n\t\t}\n\n\t\ttasks.add('Running Post-Processing Routines', next => {\n\t\t\tthis.tree.walkAtRules('chassis-post', atRule => {\n\t\t\t\tlet data = Object.assign({\n\t\t\t\t\troot: this.tree,\n\t\t\t\t\tatRule\n\t\t\t\t}, atRules.getProperties(atRule))\n\n\t\t\t\tpost.process(data)\n\t\t\t})\n\n\t\t\tnext()\n\t\t})\n\n\t\ttasks.add('Processing CSS4 Syntax', next => {\n\t\t\tenv.process(this.tree, {from: filepath}, settings.envCfg).then(processed => {\n\t\t\t\tthis.tree = processed.root\n\t\t\t\tnext()\n\t\t\t}, err => console.error(err))\n\t\t})\n\n\t\t// tasks.add('Merging matching adjacent rules...', next => {\n\t\t// \toutput = mergeAdjacentRules.process(output.toString())\n\t\t// \tnext()\n\t\t// })\n\n\t\ttasks.add('Beautifying Output', next => {\n\t\t\tremoveComments.process(this.tree).then(result => {\n\t\t\t\tperfectionist.process(result.css).then(result => {\n\t\t\t\t\tthis.tree = result.root\n\n\t\t\t\t\t// Remove empty rulesets\n\t\t\t\t\tthis.tree.walkRules(rule => {\n\t\t\t\t\t\tif (rule.nodes.length === 0) {\n\t\t\t\t\t\t\trule.remove()\n\t\t\t\t\t\t\treturn\n\t\t\t\t\t\t}\n\t\t\t\t\t})\n\n\t\t\t\t\tnext()\n\t\t\t\t}, () => {\n\t\t\t\t\tthis.emit('processing.error', new Error('Error Beautifying Output'))\n\t\t\t\t})\n\t\t\t}, () => {\n\t\t\t\tthis.emit('processing.error', new Error('Error Removing Comments'))\n\t\t\t})\n\t\t})\n\n\t\tif (settings.minify) {\n\t\t\tlet minified\n\n\t\t\ttasks.add('Minifying Output', next => {\n\t\t\t\tminified = new CleanCss({\n\t\t\t\t\tsourceMap: settings.sourceMap\n\t\t\t\t}).minify(this.tree.toString())\n\n\t\t\t\tthis.tree = minified.styles\n\t\t\t\tnext()\n\t\t\t})\n\n\t\t\tif (settings.sourceMap) {\n\t\t\t\ttasks.add('Generating source map', next => {\n\t\t\t\t\tsourceMap = minified.sourceMap.toString()\n\t\t\t\t\tnext()\n\t\t\t\t})\n\t\t\t}\n\t\t}\n\n\t\t// tasks.on('taskstart', evt => console.log(`${evt.name}...`))\n\t\t// tasks.on('taskcomplete', evt => console.log('Done.'))\n\n\t\ttasks.on('complete', () => this.emit('processing.complete', {\n\t\t\tcss: this.tree.toString(),\n\t\t\tsourceMap\n\t\t}))\n\n\t\tthis.emit('processing')\n\t\ttasks.run(true)\n\t}", "function parse(context, file) {\n var message\n\n if (stats(file).fatal) {\n return\n }\n\n if (context.treeIn) {\n debug('Not parsing already parsed document')\n\n try {\n context.tree = json(file.toString())\n } catch (error) {\n message = file.message(\n new Error('Cannot read file as JSON\\n' + error.message)\n )\n message.fatal = true\n }\n\n // Add the preferred extension to ensure the file, when serialized, is\n // correctly recognised.\n // Only add it if there is a path — not if the file is for example stdin.\n if (file.path) {\n file.extname = context.extensions[0]\n }\n\n file.contents = ''\n\n return\n }\n\n debug('Parsing `%s`', file.path)\n\n context.tree = context.processor.parse(file)\n\n debug('Parsed document')\n}", "function parse(doc) {\n var file = vfile(doc);\n var Parser;\n\n freeze();\n Parser = processor.Parser;\n assertParser('parse', Parser);\n\n if (newable(Parser)) {\n return new Parser(String(file), file).parse();\n }\n\n return Parser(String(file), file); // eslint-disable-line new-cap\n }", "function parse() {\n var self = this;\n var value = String(self.file);\n var start = {line: 1, column: 1, offset: 0};\n var content = xtend(start);\n var node;\n\n /* Clean non-unix newlines: `\\r\\n` and `\\r` are all\n * changed to `\\n`. This should not affect positional\n * information. */\n value = value.replace(EXPRESSION_LINE_BREAKS, C_NEWLINE);\n\n if (value.charCodeAt(0) === 0xFEFF) {\n value = value.slice(1);\n\n content.column++;\n content.offset++;\n }\n\n node = {\n type: 'root',\n children: self.tokenizeBlock(value, content),\n position: {\n start: start,\n end: self.eof || xtend(start)\n }\n };\n\n if (!self.options.position) {\n removePosition(node, true);\n }\n\n return node;\n}", "function parse() {\n var self = this;\n var value = String(self.file);\n var start = {line: 1, column: 1, offset: 0};\n var content = xtend(start);\n var node;\n\n /* Clean non-unix newlines: `\\r\\n` and `\\r` are all\n * changed to `\\n`. This should not affect positional\n * information. */\n value = value.replace(EXPRESSION_LINE_BREAKS, C_NEWLINE);\n\n if (value.charCodeAt(0) === 0xFEFF) {\n value = value.slice(1);\n\n content.column++;\n content.offset++;\n }\n\n node = {\n type: 'root',\n children: self.tokenizeBlock(value, content),\n position: {\n start: start,\n end: self.eof || xtend(start)\n }\n };\n\n if (!self.options.position) {\n removePosition(node, true);\n }\n\n return node;\n}", "function parse() {\n var self = this;\n var value = String(self.file);\n var start = {line: 1, column: 1, offset: 0};\n var content = xtend(start);\n var node;\n\n /* Clean non-unix newlines: `\\r\\n` and `\\r` are all\n * changed to `\\n`. This should not affect positional\n * information. */\n value = value.replace(EXPRESSION_LINE_BREAKS, C_NEWLINE);\n\n if (value.charCodeAt(0) === 0xFEFF) {\n value = value.slice(1);\n\n content.column++;\n content.offset++;\n }\n\n node = {\n type: 'root',\n children: self.tokenizeBlock(value, content),\n position: {\n start: start,\n end: self.eof || xtend(start)\n }\n };\n\n if (!self.options.position) {\n removePosition(node, true);\n }\n\n return node;\n}", "function parse() {\n var self = this;\n var value = String(self.file);\n var start = {line: 1, column: 1, offset: 0};\n var content = xtend(start);\n var node;\n\n /* Clean non-unix newlines: `\\r\\n` and `\\r` are all\n * changed to `\\n`. This should not affect positional\n * information. */\n value = value.replace(EXPRESSION_LINE_BREAKS, C_NEWLINE);\n\n if (value.charCodeAt(0) === 0xFEFF) {\n value = value.slice(1);\n\n content.column++;\n content.offset++;\n }\n\n node = {\n type: 'root',\n children: self.tokenizeBlock(value, content),\n position: {\n start: start,\n end: self.eof || xtend(start)\n }\n };\n\n if (!self.options.position) {\n removePosition(node, true);\n }\n\n return node;\n}", "function parse() {\n var self = this;\n var value = String(self.file);\n var start = {line: 1, column: 1, offset: 0};\n var content = xtend(start);\n var node;\n\n /* Clean non-unix newlines: `\\r\\n` and `\\r` are all\n * changed to `\\n`. This should not affect positional\n * information. */\n value = value.replace(EXPRESSION_LINE_BREAKS, C_NEWLINE);\n\n if (value.charCodeAt(0) === 0xFEFF) {\n value = value.slice(1);\n\n content.column++;\n content.offset++;\n }\n\n node = {\n type: 'root',\n children: self.tokenizeBlock(value, content),\n position: {\n start: start,\n end: self.eof || xtend(start)\n }\n };\n\n if (!self.options.position) {\n removePosition(node, true);\n }\n\n return node;\n}", "function parse() {\n var self = this;\n var value = String(self.file);\n var start = {line: 1, column: 1, offset: 0};\n var content = xtend(start);\n var node;\n\n /* Clean non-unix newlines: `\\r\\n` and `\\r` are all\n * changed to `\\n`. This should not affect positional\n * information. */\n value = value.replace(EXPRESSION_LINE_BREAKS, C_NEWLINE);\n\n if (value.charCodeAt(0) === 0xFEFF) {\n value = value.slice(1);\n\n content.column++;\n content.offset++;\n }\n\n node = {\n type: 'root',\n children: self.tokenizeBlock(value, content),\n position: {\n start: start,\n end: self.eof || xtend(start)\n }\n };\n\n if (!self.options.position) {\n removePosition(node, true);\n }\n\n return node;\n}", "function parse() {\n var self = this\n var value = String(self.file)\n var start = {line: 1, column: 1, offset: 0}\n var content = xtend(start)\n var node\n\n // Clean non-unix newlines: `\\r\\n` and `\\r` are all changed to `\\n`.\n // This should not affect positional information.\n value = value.replace(lineBreaksExpression, lineFeed)\n\n // BOM.\n if (value.charCodeAt(0) === 0xfeff) {\n value = value.slice(1)\n\n content.column++\n content.offset++\n }\n\n node = {\n type: 'root',\n children: self.tokenizeBlock(value, content),\n position: {start: start, end: self.eof || xtend(start)}\n }\n\n if (!self.options.position) {\n removePosition(node, true)\n }\n\n return node\n}", "function processEach(params, file, done) {\r\n console.log(\"Parsing file: \", file);\r\n parseUtils\r\n .parseFile(file)\r\n .then(function(parseResult) {\r\n // save the original source code.\r\n params.sourceStore[file] = parseResult.src;\r\n\r\n // adapt our block ID generator for this file.\r\n var blockIDGen = function(blockInfo) {\r\n return params.idGenerator.newID({\r\n script: file,\r\n func: blockInfo.func\r\n });\r\n };\r\n\r\n // instrument the code.\r\n var result = instrument(\r\n parseResult.src,\r\n parseResult.ast,\r\n blockIDGen,\r\n params\r\n );\r\n\r\n // write the modified code back to the original file.\r\n fs.writeFileSync(file, result.result, \"utf8\");\r\n\r\n // just return the block & function data.\r\n done(null, {\r\n blocks: result.blocks,\r\n functions: result.functions\r\n });\r\n })\r\n .catch(function(e) {\r\n // don't kill the whole process.\r\n console.error(\"Problem instrumenting file. \", e, \" in file: \", file);\r\n done(null, { blocks: [], functions: [] });\r\n })\r\n .done();\r\n}", "function compileFile(file, basepath) {\n var filepath = path.join(basepath || test_dir, file);\n var ast;\n try {\n ast = RapydScript.parse(fs.readFileSync(filepath, \"utf-8\"), {\n filename: file,\n es6: argv.ecmascript6,\n toplevel: ast,\n readfile: fs.readFileSync,\n basedir: test_dir,\n libdir: path.join(src_path, 'lib'),\n });\n } catch(ex) {\n console.log(file + \":\\t\" + ex + \"\\n\");\n return;\n }\n // generate output\n var output = RapydScript.OutputStream({\n baselib: baselib,\n beautify: true\n });\n ast.print(output);\n return output;\n }", "async function transform(file, dir = 'lib') {\n const dest = file.replace('/src/', `/${dir}/`)\n await fs.ensureDir(path.dirname(dest))\n\n if (fs.statSync(file).isDirectory()) return\n\n if (file.endsWith('.svelte')) {\n const source = await fs.readFile(file, 'utf8')\n const item = await preprocess(\n source,\n autoprocessor({\n typescript: {\n tsconfigFile: path.resolve(rootDir, 'tsconfig-base.json'),\n },\n // https://github.com/sveltejs/svelte/issues/189#issuecomment-586142198\n replace: [\n [/(>)[\\s]*([<{])/g, '$1$2'],\n [/({[/:][a-z]+})[\\s]*([<{])/g, '$1$2'],\n [/({[#:][a-z]+ .+?})[\\s]*([<{])/g, '$1$2'],\n [/([>}])[\\s]+(<|{[/#:][a-z][^}]*})/g, '$1$2'],\n ],\n }),\n {\n filename: file,\n }\n )\n await fs.writeFile(\n dest,\n item.code.replace('<script lang=\"ts\">', '<script>')\n )\n } else {\n await fs.copyFile(file, dest)\n }\n}", "function Parser(doc, file) {\n this.file = file;\n this.offset = {};\n this.options = xtend(this.options);\n this.setOptions({});\n\n this.inList = false;\n this.inBlock = false;\n this.inLink = false;\n this.atStart = true;\n\n this.toOffset = vfileLocation(file).toOffset;\n this.unescape = unescape(this, 'escape');\n this.decode = decode(this);\n}", "function transform$5(context, file, fileSet, next) {\n if (stats$4(file).fatal) {\n next();\n } else {\n debug$7('Transforming document `%s`', file.path);\n context.processor.run(context.tree, file, onrun);\n }\n\n function onrun(error, node) {\n debug$7('Transformed document (error: %s)', error);\n context.tree = node;\n next(error);\n }\n}", "parseFlsFile(baseFile) {\r\n this.extension.logger.addLogMessage('Parse fls file.');\r\n const rootDir = path.dirname(baseFile);\r\n const outDir = this.getOutDir(baseFile);\r\n const flsFile = path.resolve(rootDir, path.join(outDir, path.basename(baseFile, '.tex') + '.fls'));\r\n if (!fs.existsSync(flsFile)) {\r\n this.extension.logger.addLogMessage(`Cannot find fls file: ${flsFile}`);\r\n return;\r\n }\r\n this.extension.logger.addLogMessage(`Fls file found: ${flsFile}`);\r\n const ioFiles = this.parseFlsContent(fs.readFileSync(flsFile).toString(), rootDir);\r\n ioFiles.input.forEach((inputFile) => {\r\n // Drop files that are also listed as OUTPUT or should be ignored\r\n if (ioFiles.output.includes(inputFile) ||\r\n this.isExcluded(inputFile) ||\r\n !fs.existsSync(inputFile)) {\r\n return;\r\n }\r\n // Drop the current rootFile often listed as INPUT and drop any file that is already in the texFileTree\r\n if (baseFile === inputFile || inputFile in this.cachedContent) {\r\n return;\r\n }\r\n if (path.extname(inputFile) === '.tex') {\r\n // Parse tex files as imported subfiles.\r\n this.cachedContent[baseFile].children.push({\r\n index: Number.MAX_VALUE,\r\n file: inputFile\r\n });\r\n this.parseFileAndSubs(inputFile);\r\n }\r\n else if (this.fileWatcher && !this.filesWatched.includes(inputFile)) {\r\n // Watch non-tex files.\r\n this.fileWatcher.add(inputFile);\r\n this.filesWatched.push(inputFile);\r\n }\r\n });\r\n ioFiles.output.forEach((outputFile) => {\r\n if (path.extname(outputFile) === '.aux' && fs.existsSync(outputFile)) {\r\n this.parseAuxFile(fs.readFileSync(outputFile).toString(), path.dirname(outputFile).replace(outDir, rootDir));\r\n }\r\n });\r\n }", "function tjs_gulp_transformFile(file) {\n\t// console.log(file)\n\treturn `gulp.task('${file.file}', function() {\n\tlet pipe = gulp.src('${file.file}', { base: __dirname })\n\n\t// pre-piping\n\tif (typeof __t.start == 'function')\n\t\tpipe = pipe.pipe(__t.start.bind(pipe)())\n\n\t${file.transforms.length == 0 ? `if (typeof __t.blank == 'function') pipe = __t.blank.bind(pipe)()` : ''}\n\n\t${file.transforms.map(t => `// pipe setup for ${t.name}\n\tpipe = __t.${t.name}.bind(pipe)${t.argsTuple}\n\tif (typeof __t.each == 'function') pipe = pipe.pipe(__t.each.bind(pipe)())`).join('\\n\\t')}\n\n\t// post-piping\n\tif (typeof __t.finish == 'function')\n\t\tpipe = pipe.pipe(__t.finish.bind(pipe)())\n\t\n\treturn pipe\n})`\n}", "function parse$a(context, file) {\n var message;\n\n if (stats$5(file).fatal) {\n return\n }\n\n if (context.treeIn) {\n debug$8('Not parsing already parsed document');\n\n try {\n context.tree = json$1(file.toString());\n } catch (error) {\n message = file.message(\n new Error('Cannot read file as JSON\\n' + error.message)\n );\n message.fatal = true;\n }\n\n // Add the preferred extension to ensure the file, when serialized, is\n // correctly recognised.\n // Only add it if there is a path — not if the file is for example stdin.\n if (file.path) {\n file.extname = context.extensions[0];\n }\n\n file.contents = '';\n\n return\n }\n\n debug$8('Parsing `%s`', file.path);\n\n context.tree = context.processor.parse(file);\n\n debug$8('Parsed document');\n}", "async function preprocessSvelte(filePath) {\n const srcCode = await fs.readFile(filePath, { encoding: \"utf-8\" });\n let { code } = await svelte.preprocess(\n srcCode,\n sveltePreprocess({\n // unfortunately, sourcemap on .svelte files sometimes comments out the </script> tag\n // so we need to disable sourcemapping for them\n sourceMap: false,\n typescript: {\n compilerOptions: {\n sourceMap: false,\n },\n },\n }),\n {\n filename: filePath,\n }\n );\n\n // remove lang=ts from processed .svelte files\n code = code.replace(/script lang=\"ts\"/g, \"script\");\n\n const relativePath = filePath.split(srcPath)[1];\n const destination = path.join(distPath, filePath.split(srcPath)[1]);\n\n // write preprocessed svelte file to /dist\n await fs.ensureFile(destination);\n await fs.writeFile(destination, code, { encoding: \"utf-8\" });\n\n // write the unprocessed svelte component to /dist/ts/ so we can have correct types for ts users\n const tsDest = path.join(distPath, \"ts\", relativePath);\n await fs.ensureFile(tsDest);\n await fs.writeFile(tsDest, srcCode, {\n encoding: \"utf-8\",\n });\n}", "async parse(options = {}) {\n if (!this.file.path) {\n throw new Error(`Missing underlying file component with a path.`)\n }\n\n const { code, ast, meta } = await require('@skypager/helpers-mdx')(this.content, {\n filePath: this.file.path,\n ...options,\n rehypePlugins: [\n () => tree => {\n this.state.set('rehypeAst', tree)\n return tree\n },\n ],\n babel: false,\n })\n\n this.state.set('parsed', true)\n this.state.set('parsedContent', code)\n\n return { ast, code, meta }\n }", "transformFile(data, filePath) {\n this.updateBabelConfig(filePath);\n return babel.transformSync(data, this.babelConfig.options);\n }", "function transformFile(filename, opts, callback) {\n\t if (_lodashLangIsFunction2[\"default\"](opts)) {\n\t callback = opts;\n\t opts = {};\n\t }\n\n\t opts.filename = filename;\n\n\t _fs2[\"default\"].readFile(filename, function (err, code) {\n\t if (err) return callback(err);\n\n\t var result;\n\n\t try {\n\t result = _transformation2[\"default\"](code, opts);\n\t } catch (err) {\n\t return callback(err);\n\t }\n\n\t callback(null, result);\n\t });\n\t}", "function transformFile(filename, opts, callback) {\n\t if (_lodashLangIsFunction2[\"default\"](opts)) {\n\t callback = opts;\n\t opts = {};\n\t }\n\n\t opts.filename = filename;\n\n\t _fs2[\"default\"].readFile(filename, function (err, code) {\n\t if (err) return callback(err);\n\n\t var result;\n\n\t try {\n\t result = _transformation2[\"default\"](code, opts);\n\t } catch (err) {\n\t return callback(err);\n\t }\n\n\t callback(null, result);\n\t });\n\t}", "async processXmlFile(xmlFile) {\n const response = await fetch(xmlFile);\n const xmlData = await response.text();\n\n const parser = new DOMParser();\n const doc = parser.parseFromString(xmlData, \"text/xml\");\n\n this.processDoc(xmlFile, doc);\n }", "loadFile(file, module, x, y) {\n var dsp_code;\n var reader = new FileReader();\n var ext = file.name.toString().split('.').pop();\n var filename = file.name.toString().split('.').shift();\n var type;\n if (ext == \"dsp\") {\n type = \"dsp\";\n reader.readAsText(file);\n }\n else if (ext == \"json\") {\n type = \"json\";\n reader.readAsText(file);\n }\n else if (ext == \"jfaust\") {\n type = \"jfaust\";\n reader.readAsText(file);\n }\n else if (ext == \".polydsp\") {\n type = \"poly\";\n reader.readAsText(file);\n }\n else {\n throw new Error(Utilitary.messageRessource.errorObjectNotFaustCompatible);\n }\n reader.onloadend = (e) => {\n dsp_code = \"process = vgroup(\\\"\" + filename + \"\\\",environment{\" + reader.result + \"}.process);\";\n if (!module) {\n if (type == \"dsp\") {\n this.compileFaust({ isMidi: false, name: filename, sourceCode: dsp_code, x: x, y: y, callback: (factory) => { this.createModule(factory); } });\n }\n else if (type == \"jfaust\") {\n Utilitary.currentScene.recallScene(reader.result);\n }\n else if (type == \"poly\") {\n this.compileFaust({ isMidi: true, name: filename, sourceCode: dsp_code, x: x, y: y, callback: (factory) => { this.createModule(factory); } });\n }\n }\n else {\n if (type == \"dsp\") {\n module.isMidi = false;\n module.update(filename, dsp_code);\n }\n else if (type == \"jfaust\") {\n Utilitary.currentScene.recallScene(reader.result);\n }\n else if (type == \"poly\") {\n module.isMidi = true;\n module.update(filename, dsp_code);\n }\n }\n };\n }", "function processFile (inputLoc, out, replacements) {\n var file = urlRegex.test(inputLoc) ?\n hyperquest(inputLoc) :\n fs.createReadStream(inputLoc, encoding)\n\n file.pipe(bl(function (err, data) {\n if (err) throw err\n\n data = data.toString()\n replacements.forEach(function (replacement) {\n data = data.replace.apply(data, replacement)\n })\n if (inputLoc.slice(-3) === '.js') {\n const transformed = babel.transform(data, {\n plugins: [\n 'transform-es2015-parameters',\n 'transform-es2015-arrow-functions',\n 'transform-es2015-block-scoping',\n 'transform-es2015-template-literals',\n 'transform-es2015-shorthand-properties',\n 'transform-es2015-for-of',\n 'transform-es2015-destructuring'\n ]\n })\n data = transformed.code\n }\n fs.writeFile(out, data, encoding, function (err) {\n if (err) throw err\n\n console.log('Wrote', out)\n })\n }))\n}", "async compile(statement, filename) {\n if (this.tsCompiler) {\n statement = await this.compileTypescript(statement, filename);\n }\n return this.processAwait(statement);\n }", "function parseQML(src, file) {\n loadParser();\n QmlWeb.parse.nowParsingFile = file;\n var parsetree = QmlWeb.parse(src, QmlWeb.parse.QmlDocument);\n return convertToEngine(parsetree);\n}", "function file_load(file, callback) {\n\tif (!file) return; // No file found.\n\n\tlet reader = new FileReader();\n\n\treader.onload = event => callback(sched_parse(\n\t\tevent.target.result\n\t), file.path);\n\n\treader.readAsText(file);\n}", "function gulpPlugin(options) {\n\toptions = options || {};\n\toptions.metadata = options.metadata === undefined ? true : options.metadata;\n\toptions.warning_as_error = options.warning_as_error === undefined ? true : options.warning_as_error;\n const filepaths = options.stylesheet === undefined ? [] : [options.stylesheet];\n\tlet processor = xsltproc(options);\n function XsltProcPlugin(file, encoding, done) {\n\t\tif (file.contents.indexOf('xml-stylesheet') === -1 && !options.stylesheet) {\n\t\t\tconsole.log('skipping', file.path);\n\t\t\treturn done();\n\t\t}\n\t\tconst processorFilepaths = filepaths.concat(file.path);\n\t\tprocessor.transform(processorFilepaths, options)\n\t\t.then((data) => {\n\t\t\tfile.contents = Buffer.from(data.result);\n\t\t\tif (options.warning_as_error && data.metadata !== undefined && data.metadata.message !== '') {\n\t\t\t\tthis.emit('error', new PluginError({\n\t\t\t\t\tplugin: 'XsltProc',\n\t\t\t\t\tmessage: `warning transforming ${file.path}\\n${data.metadata.message}`\n\t\t\t\t}));\n\t\t\t\treturn done();\n\t\t\t}\n\t\t\tdata.file = path.relative(file.base, file.path);\n\t\t\tthis.push(file); // don't move this line higher in the code as value of file changes after that line\n\t\t\tif (options.metadata) {\n let metadata = new Vinyl({\n base: file.base,\n path: `${file.path}.json`,\n contents: Buffer.from(JSON.stringify(data.metadata))\n });\n\t\t\t\tthis.push(metadata);\n\t\t\t}\n\t\t\treturn done();\n\t\t})\n\t\t.catch((error) => {\n\t\t\tconsole.error(error);\n\t\t\tthis.emit('error', new PluginError({\n\t\t\t\tplugin: 'XsltProc',\n\t\t\t\tmessage: `error transforming ${file.path}\\n${error.message}`\n\t\t\t}));\n\t\t\treturn done();\n\t\t});\n\t}\n\treturn through.obj(XsltProcPlugin);\n}", "function runFile (inFile, outFile) {\n const currentTest = new NameParser(inFile, outFile)\n currentTest.uniqueFullNameCount()\n currentTest.uniqueLastNameCount()\n currentTest.uniqueFirstNameCount()\n currentTest.commonLastNames()\n currentTest.commonFirstNames()\n currentTest.modifiedNames(25)\n}", "function parseFile(err, contents) {\r\n const output = parse(contents, {\r\n columns: true,\r\n skip_empty_lines: true\r\n });\r\n\r\n // Call build function. Interpret and construct Org Chart\r\n buildOutput(output);\r\n}", "function process(file, enc, callback) {\n /*jshint validthis:true*/\n\n // Do nothing if no contents\n if (file.isNull()) {\n return callback();\n }\n if (file.isStream()) {\n this.emit(\"error\",\n new gutil.PluginError(PLUGIN_NAME, \"Stream content is not supported\"));\n return callback();\n }\n // check if file.contents is a `Buffer`\n if (file.isBuffer() || file.isFile()) {\n var parser = imagesize.Parser();\n\n var retStatus = parser.parse(file.contents);\n if (imagesize.Parser.DONE === retStatus) {\n var result = parser.getResult();\n result.file = libpath.relative(file.base, file.path)\n list.push(result);\n }\n }\n return callback();\n }", "_parseFile(requireName, filepath, cache, ifStoreSrc, fakeCode, coreModules) {\n let code, e;\n if (filepath in cache) { return cache[filepath]; }\n const isCore = (coreModules && (Array.from(coreModules).includes(requireName))) || !/[\\\\\\/]/.test(filepath);\n const isBinary = /\\.node$/i.test(filepath);\n const unit = {\n isCore, // built-in nodejs modules\n isBinary, // binary modules, \".node\" extension\n fpath: isCore ? requireName : filepath, // the file path\n mpath: '', // the path of module that contains this file\n mname: '', // the module name\n src: \"\",\n requires: [], // array of dependencies, each element is {node, unit}\n // node is the parded ast tree node\n // unit is another unit\n warnings: [],\n // if set, then this file is the \"main\" file of a node module, as defined by nodejs\n package: undefined,\n };\n cache[filepath] = unit;\n if (isCore || isBinary) { return unit; }\n if (path.extname(filepath).toLowerCase() === \".json\") {\n if (ifStoreSrc) { unit.src = fs.readFileSync(filepath).toString(); }\n return unit;\n }\n\n // determine if parameter filepath itself represents a module, if so, mark the module by setting the\n // package member\n (function() {\n const detail = bna.identify(filepath);\n\n unit.mname = detail.mname;\n unit.mpath = detail.mpath;\n unit._detailPackage = detail.package;\n const mainfiles = [path.join(detail.mpath, \"index.js\"), path.join(detail.mpath, \"index.node\")];\n if (detail.package) {\n detail.package.name = detail.mname; // ensure correct package name\n if (detail.package.main) {\n const main = path.resolve(detail.mpath, detail.package.main);\n mainfiles.push(main);\n // append .js .node variations as well\n if (path.extname(main) === '') { mainfiles.push(...Array.from([`${main}.js`, `${main}.node`] || [])); }\n }\n }\n if (Array.from(mainfiles).includes(unit.fpath)) {\n return unit.package = detail.package || { name: detail.mname, version: 'x' }; // construct default package if no package.json\n }\n })();\n\n // do first pass without parsing location info (makes parsing 3x slower), if bad require is detected,\n // then we do another pass with location info, for user-friendly warnings\n try {\n let src;\n if (fakeCode) {\n src = fakeCode;\n } else { src = fs.readFileSync(filepath).toString().replace(/^#![^\\n]*\\n/, ''); } // remove shell script marker\n\n if (ifStoreSrc) { unit.src = src; }\n code = jsParse(src);\n } catch (error) {\n e = error;\n log((`Ignoring ${filepath}, failed to parse due to: ${e}`));\n return unit;\n }\n // 1st pass, traverse ast tree, resolve all const-string requires if possible\n const dynLocs = []; // store dynamic require locations\n ast.traverse(code, [ast.isRequire], function(node) {\n if (!node.loc) {\n node.loc = { file: filepath, line: '?' };\n } else {\n node.loc.file = filepath;\n node.loc.line = node.loc.start.line;\n }\n const arg = node.arguments[0];\n if (arg && (arg.type === 'Literal')) { // require a string\n let fullpath;\n const modulename = arg.value;\n\n e = undefined;\n try {\n fullpath = resolver.sync(modulename, {\n extensions: ['.js', '.node', '.json'],\n basedir: path.dirname(filepath)\n });\n } catch (error1) {\n e = error1;\n unit.warnings.push({\n node,\n reason: \"resolve\"\n });\n }\n\n if (!e) {\n const runit = bna._parseFile(modulename, fullpath, cache, ifStoreSrc, null, coreModules);\n return unit.requires.push({\n name: modulename,\n node,\n unit: runit\n });\n }\n } else {\n return dynLocs.push(node.loc);\n }\n });\n\n // resolving dynamic require trick: evaluate js once, record all required modules....\n if (dynLocs.length > 0) {\n (() => {\n let dynamicModules = bna.detectDynamicRequires(unit);\n // filter out already required string modules, and nulls\n dynamicModules = (Array.from(dynamicModules).filter((m) => m && !_(unit.requires).find(e => e.name === m)).map((m) => m));\n\n for (let modulename of Array.from(dynamicModules)) {\n // filter out required modules that are already parsed\n var node;\n e = undefined;\n let fullpath = ''; // catch block needs this too\n try {\n fullpath = resolver.sync(modulename, {\n extensions: ['.js', '.node', '.json'],\n basedir: path.dirname(filepath)\n });\n // only if resolved ok\n node = { loc: { file: fullpath, line: '?' } }; //\n const runit = bna._parseFile(modulename, fullpath, cache, ifStoreSrc, null, coreModules);\n unit.requires.push({\n name: modulename,\n node,\n unit: runit\n });\n } catch (error1) {\n e = error1;\n unit.warnings.push({\n node: { loc: { file: filepath, line: '?' } },\n reason: \"dynamicResolveError\",\n error: e\n });\n }\n }\n\n return unit.warnings.push({\n locs: dynLocs,\n modules: dynamicModules,\n reason: \"nonconst\"\n });\n })();\n }\n\n return unit;\n }", "function compile() {\n fs.readFile(src, 'utf8', function(err, str){\n if (err) {\n next(err);\n } else {\n compiler.compile(str, function(err, str){\n if (err) {\n next(err);\n } else {\n fs.writeFile(dest, str, 'utf8', function(err){\n next(err);\n });\n }\n });\n }\n });\n }", "parse(parser) {\n this._processor = this._process(parser);\n this._processor.next();\n }", "function transformFile(filename, opts, callback) {\n if (_lodashLangIsFunction2[\"default\"](opts)) {\n callback = opts;\n opts = {};\n }\n\n opts.filename = filename;\n\n _fs2[\"default\"].readFile(filename, function (err, code) {\n if (err) return callback(err);\n\n var result;\n\n try {\n result = _transformation2[\"default\"](code, opts);\n } catch (err) {\n return callback(err);\n }\n\n callback(null, result);\n });\n}", "parseFileAndSubs(file, onChange = false) {\r\n if (this.isExcluded(file)) {\r\n this.extension.logger.addLogMessage(`Ignoring ${file}`);\r\n return;\r\n }\r\n this.extension.logger.addLogMessage(`Parsing ${file}`);\r\n if (this.fileWatcher && !this.filesWatched.includes(file)) {\r\n // The file is first time considered by the extension.\r\n this.fileWatcher.add(file);\r\n this.filesWatched.push(file);\r\n }\r\n const content = this.getDirtyContent(file, onChange);\r\n this.cachedContent[file].children = [];\r\n this.cachedContent[file].bibs = [];\r\n this.cachedFullContent = undefined;\r\n this.parseInputFiles(content, file);\r\n this.parseBibFiles(content, file);\r\n // We need to parse the fls to discover file dependencies when defined by TeX macro\r\n // It happens a lot with subfiles, https://tex.stackexchange.com/questions/289450/path-of-figures-in-different-directories-with-subfile-latex\r\n this.parseFlsFile(file);\r\n }", "_readAndParseCompileResultOrNull(filename) {\n const raw = this._readFileOrNull(filename);\n return this.parseCompileResult(raw);\n }", "async function main() {\n const resolvedPaths = globby.sync(files as string[])\n const transformationModule = loadTransformationModule(transformationName)\n\n log(`Processing ${resolvedPaths.length} files…`)\n\n for (const p of resolvedPaths) {\n debug(`Processing ${p}…`)\n const fileInfo = {\n path: p,\n source: fs.readFileSync(p).toString(),\n }\n try {\n const result = runTransformation(\n fileInfo,\n transformationModule,\n params as object\n )\n fs.writeFileSync(p, result)\n } catch (e) {\n console.error(e)\n }\n }\n}", "function transform(filename) {\n if (shouldStub(filename)) {\n return reactStub;\n } else {\n var content = fs.readFileSync(filename, 'utf8');\n return ReactTools.transform(content, {harmony: true});\n }\n}", "transform(program) {\n var options = AsxFormatter.options(this.file.ast);\n //DefaultFormatter.prototype.transform.apply(this, arguments);\n\n var locals = [];\n var definitions = [];\n var body = [];\n program.body.forEach(item=>{\n switch(item.type){\n case 'ExpressionStatement':\n var exp = item.expression;\n if(exp.type=='Literal' && exp.value.toLowerCase()=='use strict'){\n return;\n }\n break;\n case 'VariableDeclaration':\n item.declarations.forEach(d=>{\n locals.push(d.id);\n });\n break;\n case 'FunctionDeclaration':\n if(item.id.name=='module'){\n item.body.body.forEach(s=>{\n body.push(s);\n })\n return;\n }else\n if(item._class){\n item.id =t.identifier('c$'+item._class);\n body.push(t.expressionStatement(t.callExpression(\n t.memberExpression(\n t.identifier('asx'),\n t.identifier('c$')\n ),[item])));\n return;\n }else{\n locals.push(item.id);\n }\n break;\n }\n body.push(item);\n });\n\n var definer = [];\n\n\n\n if(Object.keys(this.imports).length){\n\n Object.keys(this.imports).forEach(key=>{\n var items = this.imports[key];\n if(items['*'] && typeof items['*']=='string'){\n this.imports[key]=items['*'];\n }\n });\n definer.push(t.property('init',\n t.identifier('imports'),\n t.valueToNode(this.imports)\n ))\n }\n var exports;\n if(this.exports['*']){\n exports = this.exports['*'];\n delete this.exports['*'];\n }\n if(Object.keys(this.exports).length){\n definer.push(t.property('init',\n t.identifier('exports'),\n t.valueToNode(this.exports)\n ))\n }\n if(body.length){\n if(exports){\n var ret = [];\n Object.keys(exports).forEach(key=>{\n var val = exports[key];\n if(typeof val=='string') {\n ret.push(t.property('init',\n t.literal(key), t.identifier(val == '*' ? key : val)\n ))\n }else{\n ret.push(t.property('init',\n t.literal(key), val\n ))\n }\n });\n body.push(t.returnStatement(\n t.objectExpression(ret)\n ));\n }\n var initializer = t.functionExpression(null, [t.identifier('asx')], t.blockStatement(body));\n definer.push(t.property('init',\n t.identifier('execute'),\n initializer\n ))\n }\n definitions.forEach(item=>{\n\n if(item._class){\n definer.push(t.property('init',\n t.literal('.'+item._class),\n item\n ))\n }else{\n definer.push(t.property('init',\n t.literal(':'+item.id.name),\n item\n ))\n }\n\n })\n definer = t.objectExpression(definer);\n\n\n\n /*\n var definer = t.functionExpression(null, [t.identifier(\"module\")], t.blockStatement(body));\n if(options.bind){\n definer = t.callExpression(\n t.memberExpression(\n definer,\n t.identifier(\"bind\")\n ),[\n t.callExpression(t.identifier(\"eval\"),[t.literal(\"this.global=this\")])\n ]\n );\n }*/\n var body = [];\n var definer = util.template(\"asx-module\",{\n MODULE_NAME: t.literal(this.getModuleName()),\n MODULE_BODY: definer\n });\n if(options.runtime){\n var rt = util.template(\"asx-runtime\")\n //rt._compact = true;\n body.push(t.expressionStatement(rt));\n }\n body.push(t.expressionStatement(definer))\n program.body = body;\n }", "function transformIvySourceFile(compilation, context, file) {\n var importManager = new translator_1.ImportManager();\n // Recursively scan through the AST and perform any updates requested by the IvyCompilation.\n var sf = visitNode(file);\n // Generate the import statements to prepend.\n var imports = importManager.getAllImports().map(function (i) { return ts.createImportDeclaration(undefined, undefined, ts.createImportClause(undefined, ts.createNamespaceImport(ts.createIdentifier(i.as))), ts.createLiteral(i.name)); });\n // Prepend imports if needed.\n if (imports.length > 0) {\n sf.statements = ts.createNodeArray(tslib_1.__spread(imports, sf.statements));\n }\n return sf;\n // Helper function to process a class declaration.\n function visitClassDeclaration(node) {\n // Determine if this class has an Ivy field that needs to be added, and compile the field\n // to an expression if so.\n var res = compilation.compileIvyFieldFor(node);\n if (res !== undefined) {\n // There is a field to add. Translate the initializer for the field into TS nodes.\n var exprNode = translator_1.translateExpression(res.initializer, importManager);\n // Create a static property declaration for the new field.\n var property = ts.createProperty(undefined, [ts.createToken(ts.SyntaxKind.StaticKeyword)], res.field, undefined, undefined, exprNode);\n // Replace the class declaration with an updated version.\n node = ts.updateClassDeclaration(node, \n // Remove the decorator which triggered this compilation, leaving the others alone.\n maybeFilterDecorator(node.decorators, compilation.ivyDecoratorFor(node)), node.modifiers, node.name, node.typeParameters, node.heritageClauses || [], tslib_1.__spread(node.members, [property]));\n }\n // Recurse into the class declaration in case there are nested class declarations.\n return ts.visitEachChild(node, function (child) { return visitNode(child); }, context);\n }\n function visitNode(node) {\n if (ts.isClassDeclaration(node)) {\n return visitClassDeclaration(node);\n }\n else {\n return ts.visitEachChild(node, function (child) { return visitNode(child); }, context);\n }\n }\n }", "function transformFileSync(filename) {\n\t var opts = arguments.length <= 1 || arguments[1] === undefined ? {} : arguments[1];\n\n\t opts.filename = filename;\n\t return _transformation2[\"default\"](_fs2[\"default\"].readFileSync(filename, \"utf8\"), opts);\n\t}", "function transformFileSync(filename) {\n\t var opts = arguments.length <= 1 || arguments[1] === undefined ? {} : arguments[1];\n\n\t opts.filename = filename;\n\t return _transformation2[\"default\"](_fs2[\"default\"].readFileSync(filename, \"utf8\"), opts);\n\t}", "function Compiler(tree, file) {\n this.inLink = false;\n this.inTable = false;\n this.tree = tree;\n this.file = file;\n this.options = xtend(this.options);\n this.setOptions({});\n}", "static fromFile(file){\n return new IteratorFlow(FlowFactory.createIteratorFromFileSystem(file));\n }", "function build(files, options, callback) {\n if (!Array.isArray(files) || files.length === 0) {\n return callback(new Error('missing input files'))\n }\n\n // make the options argument optional\n if (typeof options === 'function') {\n callback = options\n options = {}\n }\n\n options.scan = options.scan || scan\n options.load = options.load || load\n options.minify = options.minify || false\n\n // validate the input, and calculate each file's hash\n for (var i = 0; i < files.length; i++) {\n var file = files[i]\n if (file.src == null) {\n return callback(new Error('missing file source'))\n }\n\n file.src = file.src.toString('utf8')\n file.hash = sha1(file.src)\n }\n\n // walk over the input files\n walk(files, options, function (err, files) {\n if (err != null) {\n return callback(err)\n }\n\n if (!(files = sort(files))) {\n return callback(new Error('input contains circular dependency'))\n }\n\n var payload = pack(files)\n\n // minify the output if we've been asked to\n if (options.minify) {\n try {\n payload = uglify.minify(payload, { fromString: true }).code\n } catch (err) {\n return callback(err)\n }\n }\n\n callback(null, payload)\n })\n}", "function processSync(doc) {\n var file;\n var complete;\n\n freeze();\n assertParser('processSync', processor.Parser);\n assertCompiler('processSync', processor.Compiler);\n file = vfile(doc);\n\n process(file, done);\n\n assertDone('processSync', 'process', complete);\n\n return file\n\n function done(error) {\n complete = true;\n bail(error);\n }\n }", "async traverse(filePath, context, callback) {\n let tempContext = context;\n if (!tempContext) tempContext = new TraverseContext();\n if (tempContext.metFiles.has(filePath)) return;\n tempContext.metFiles.add(filePath);\n let file = this.getFile(filePath);\n\n if (file.cacheIsUpToDate()) {\n tempContext.cachedEntriesLoaded++;\n } else {\n tempContext.rebuiltEntries++;\n }\n\n if (callback) {\n let result = callback(filePath, file, context);\n\n if (result instanceof Promise) {\n await result;\n }\n } // getDependencies method tries to use the most\n // efficient method to fetch file dependencies,\n // but it will rebuild each modified file\n // automatically. See getDependencies\n // documentation\n\n\n for (let [name, absolute] of Object.entries(file.getDependencies())) {\n if (!this.shouldWalkFile(name)) continue;\n if (tempContext.onlyCompilableFiles && !this.getFile(absolute).shouldBeCompiled) continue;\n await this.traverse(absolute, tempContext, callback);\n }\n\n return tempContext;\n }", "function index () {\r\n return {\r\n name: 'transform-import-meta',\r\n visitor: {\r\n Program: function (path) {\r\n var metas = [];\r\n path.traverse({\r\n MemberExpression: function (memberExpPath) {\r\n var node = memberExpPath.node;\r\n if (node.object.type === 'MetaProperty' &&\r\n node.object.meta.name === 'import' &&\r\n node.object.property.name === 'meta' &&\r\n node.property.type === 'Identifier' &&\r\n node.property.name === 'url') {\r\n metas.push(memberExpPath);\r\n }\r\n }\r\n });\r\n if (metas.length === 0) {\r\n return;\r\n }\r\n for (var _i = 0, metas_1 = metas; _i < metas_1.length; _i++) {\r\n var meta = metas_1[_i];\r\n meta.replaceWith(ast(templateObject_1 || (templateObject_1 = __makeTemplateObject([\"require('url').pathToFileURL(__filename).toString()\"], [\"require('url').pathToFileURL(__filename).toString()\"]))));\r\n }\r\n }\r\n }\r\n };\r\n}", "function transmorph( xslSrc, file, filterKey, filterValue )\r\n{\r\n var result = transform( xslSrc, filterKey, filterValue );\r\n saveFile( result, file );\r\n}", "function compileFile(filename, options) {\n fs.readFile(filename, \"utf-8\", (error, sourceCode) => {\n if (error) {\n console.error(error);\n return;\n }\n console.log(compile(sourceCode, options));\n });\n}", "async function compile(filename) {\n const basename = path.basename(filename);\n const filenameAbs = path.join(config.source, filename);\n\n const code = await fs.readFileAsync(path.join(config.source, filename), 'utf8');\n\n await Promise.all(config.builds.map(async function (build) {\n const outFilenameAbs = path.join(build.dir, filename);\n const outDirname = path.dirname(outFilenameAbs);\n\n let result;\n const options = assign({\n ast: false,\n sourceMap: true,\n sourceMapName: basename,\n sourceFileName: filename,\n sourceRoot: path.relative(outDirname, config.source),\n }, build.options);\n\n try {\n result = transform(code, options);\n }\n catch (err) {\n console.error('Multiform: Failed to compile file', filenameAbs);\n console.error('to', outFilenameAbs);\n console.error('with options', options);\n throw err;\n }\n\n const output = result.code + '\\n\\n//# sourceMappingURL=' + basename + '.map\\n';\n\n delete result.map.names;\n delete result.map.sourcesContent;\n\n\n // save the output file and sourcemap\n await cleaned;\n await ensureDirExists(outDirname);\n await Promise.all([\n fs.writeFileAsync(outFilenameAbs, output),\n fs.writeFileAsync(outFilenameAbs + '.map', JSON.stringify(result.map, null, 2)),\n ]);\n }));\n}", "function process(filename, source) {\n try {\n if (util.isString(source) && source.charAt(0) === \"{\")\n source = JSON.parse(source);\n if (!util.isString(source))\n self.setOptions(source.options).addJSON(source.nested);\n else {\n parse.filename = filename;\n var parsed = parse(source, self, options),\n resolved,\n i = 0;\n if (parsed.imports)\n for (; i < parsed.imports.length; ++i)\n if (resolved = self.resolvePath(filename, parsed.imports[i]))\n fetch(resolved);\n if (parsed.weakImports)\n for (i = 0; i < parsed.weakImports.length; ++i)\n if (resolved = self.resolvePath(filename, parsed.weakImports[i]))\n fetch(resolved, true);\n }\n } catch (err) {\n finish(err);\n }\n if (!sync && !queued)\n finish(null, self); // only once anyway\n }", "function process(filename, source) {\n try {\n if (util.isString(source) && source.charAt(0) === \"{\")\n source = JSON.parse(source);\n if (!util.isString(source))\n self.setOptions(source.options).addJSON(source.nested);\n else {\n parse.filename = filename;\n var parsed = parse(source, self, options),\n resolved,\n i = 0;\n if (parsed.imports)\n for (; i < parsed.imports.length; ++i)\n if (resolved = self.resolvePath(filename, parsed.imports[i]))\n fetch(resolved);\n if (parsed.weakImports)\n for (i = 0; i < parsed.weakImports.length; ++i)\n if (resolved = self.resolvePath(filename, parsed.weakImports[i]))\n fetch(resolved, true);\n }\n } catch (err) {\n finish(err);\n }\n if (!sync && !queued)\n finish(null, self); // only once anyway\n }", "static process_file(filename)\r\n {\r\n if (fs === null)\r\n {\r\n throw new Error(\"Not in node.js : module fs not defined. Aborting.\");\r\n }\r\n if (DEBUG)\r\n {\r\n console.log('Processing file:', filename);\r\n console.log('--------------------------------------------------------------------------');\r\n }\r\n let data = Hamill.read_file(filename);\r\n let doc = this.process_string(data);\r\n doc.set_name(filename);\r\n return doc;\r\n }", "function processFile(content, cpu, onComplete) {\n // Pointer to the memory address in the CPU that we're\n // loading a value into:\n let curAddr = 0;\n \n // Split the lines of the content up by newline\n const lines = content.split('\\n');\n\n // Loop through each line of machine code\n\n for (let line of lines) {\n const comment = line.indexOf('#');\n\n // If we found one, cut off everything after\n if (comment != -1) {\n line = line.substr(0, comment);\n }\n\n // Remove whitespace from either end\n line = line.trim();\n\n if (line === '') {\n // Line was blank or only a comment\n continue;\n }\n\n // At this point, the line should just be the 1s and 0s\n\n // Convert from binary string to number\n const binValue = parseInt(line, 2); // Base 2 == binary\n\n // Check to see if the parsing failed\n if (isNaN(binValue)) {\n console.error('Invalid binary number: ' + line);\n process.exit(1);\n }\n\n // Ok, we have a good value, so store it into memory:\n //console.log(`storing ${binValue}, ${line}`);\n cpu.poke(curAddr, binValue);\n \n curAddr++;\n }\n\n onComplete(cpu);\n}", "function process(filename, source) {\n try {\n if (util.isString(source) && source.charAt(0) === \"{\")\n source = JSON.parse(source);\n if (!util.isString(source))\n self.setOptions(source.options).addJSON(source.nested);\n else {\n parse.filename = filename;\n var parsed = parse(source, self, options),\n resolved,\n i = 0;\n if (parsed.imports)\n for (; i < parsed.imports.length; ++i)\n if (resolved = getBundledFileName(parsed.imports[i]) || self.resolvePath(filename, parsed.imports[i]))\n fetch(resolved);\n if (parsed.weakImports)\n for (i = 0; i < parsed.weakImports.length; ++i)\n if (resolved = getBundledFileName(parsed.weakImports[i]) || self.resolvePath(filename, parsed.weakImports[i]))\n fetch(resolved, true);\n }\n } catch (err) {\n finish(err);\n }\n if (!sync && !queued)\n finish(null, self); // only once anyway\n }", "function process(filename, source) {\n try {\n if (util.isString(source) && source.charAt(0) === \"{\")\n source = JSON.parse(source);\n if (!util.isString(source))\n self.setOptions(source.options).addJSON(source.nested);\n else {\n parse.filename = filename;\n var parsed = parse(source, self, options),\n resolved,\n i = 0;\n if (parsed.imports)\n for (; i < parsed.imports.length; ++i)\n if (resolved = getBundledFileName(parsed.imports[i]) || self.resolvePath(filename, parsed.imports[i]))\n fetch(resolved);\n if (parsed.weakImports)\n for (i = 0; i < parsed.weakImports.length; ++i)\n if (resolved = getBundledFileName(parsed.weakImports[i]) || self.resolvePath(filename, parsed.weakImports[i]))\n fetch(resolved, true);\n }\n } catch (err) {\n finish(err);\n }\n if (!sync && !queued)\n finish(null, self); // only once anyway\n }", "static async compileFile (fromFileRelative, toDirRelative, data, options) {\n const { name, dir } = path.parse(fromFileRelative)\n let subDir = options.base ? dir.split(options.base).pop() : ''\n subDir = subDir.startsWith('/') ? subDir.slice(1) : subDir\n const toFileAbsolute = path.resolve(toDirRelative, subDir, name + options.ext)\n const fromFileAbsolute = path.resolve(fromFileRelative)\n const result = await CompileEjsTask.renderFile(fromFileAbsolute, data, options)\n fs.outputFileSync(toFileAbsolute, result)\n }", "function transformFileSync(filename) {\n var opts = arguments.length <= 1 || arguments[1] === undefined ? {} : arguments[1];\n\n opts.filename = filename;\n return _transformation2[\"default\"](_fs2[\"default\"].readFileSync(filename, \"utf8\"), opts);\n}", "function loadTest (filename) {\n var content = fs.readFileSync(filename) + '';\n var parts = content.split(/\\n-----*\\n/);\n\n return {\n source: parts[0],\n compiled: parts[1],\n ast: parts[2],\n transformed: parts[3]\n };\n}", "function Parser(f) {\n this.parse = f;\n }", "function processSync(doc) {\n var file\n var complete\n\n freeze()\n assertParser('processSync', processor.Parser)\n assertCompiler('processSync', processor.Compiler)\n file = vfile(doc)\n\n process(file, done)\n\n assertDone('processSync', 'process', complete)\n\n return file\n\n function done(error) {\n complete = true\n bail(error)\n }\n }", "function processSync(doc) {\n var file\n var complete\n\n freeze()\n assertParser('processSync', processor.Parser)\n assertCompiler('processSync', processor.Compiler)\n file = vfile(doc)\n\n process(file, done)\n\n assertDone('processSync', 'process', complete)\n\n return file\n\n function done(error) {\n complete = true\n bail(error)\n }\n }" ]
[ "0.57834154", "0.57834154", "0.5767879", "0.5767879", "0.5767879", "0.5767879", "0.5767879", "0.5767879", "0.57348526", "0.5524738", "0.5524738", "0.55165803", "0.55116695", "0.54946184", "0.54631734", "0.54183316", "0.5407739", "0.5353386", "0.53467375", "0.5325736", "0.5325736", "0.5325736", "0.5301865", "0.5301865", "0.5301865", "0.5301865", "0.5301865", "0.52834433", "0.52408", "0.52105194", "0.52002615", "0.51901007", "0.51858", "0.51858", "0.51858", "0.51858", "0.51858", "0.51858", "0.5168489", "0.5129894", "0.5124696", "0.51241446", "0.5110779", "0.50693935", "0.49702054", "0.4968776", "0.49389327", "0.4935591", "0.48951015", "0.4873091", "0.4849761", "0.4849761", "0.48341674", "0.48084325", "0.48024926", "0.47974747", "0.47807539", "0.474833", "0.47364983", "0.47333542", "0.47268027", "0.47012836", "0.47001684", "0.46927106", "0.46807265", "0.46739885", "0.46669105", "0.46586367", "0.46398652", "0.4623572", "0.4599636", "0.45873797", "0.45838052", "0.45838052", "0.45806873", "0.4569583", "0.45690328", "0.45640078", "0.45578226", "0.45562348", "0.4552353", "0.4547676", "0.4543285", "0.45418802", "0.45418802", "0.45372605", "0.45331815", "0.45311856", "0.45311856", "0.45251092", "0.45208007", "0.45109224", "0.45084435", "0.45059425", "0.45059425" ]
0.5542097
13
Process the given document (in string or VFile representation), sync.
function processSync(doc) { var complete = false var file freeze() assertParser('processSync', processor.Parser) assertCompiler('processSync', processor.Compiler) file = vfile(doc) process(file, done) assertDone('processSync', 'process', complete) return file function done(err) { complete = true bail(err) } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function processSync(doc) {\n var file;\n var complete;\n\n freeze();\n assertParser('processSync', processor.Parser);\n assertCompiler('processSync', processor.Compiler);\n file = vfile(doc);\n\n process(file, done);\n\n assertDone('processSync', 'process', complete);\n\n return file\n\n function done(error) {\n complete = true;\n bail(error);\n }\n }", "function processSync(doc) {\n var complete = false;\n var file;\n\n freeze();\n assertParser('processSync', processor.Parser);\n assertCompiler('processSync', processor.Compiler);\n file = vfile(doc);\n\n process(file, done);\n\n assertDone('processSync', 'process', complete);\n\n return file;\n\n function done(err) {\n complete = true;\n bail(err);\n }\n }", "function processSync(doc) {\n var file\n var complete\n\n freeze()\n assertParser('processSync', processor.Parser)\n assertCompiler('processSync', processor.Compiler)\n file = vfile(doc)\n\n process(file, done)\n\n assertDone('processSync', 'process', complete)\n\n return file\n\n function done(error) {\n complete = true\n bail(error)\n }\n }", "function processSync(doc) {\n var file\n var complete\n\n freeze()\n assertParser('processSync', processor.Parser)\n assertCompiler('processSync', processor.Compiler)\n file = vfile(doc)\n\n process(file, done)\n\n assertDone('processSync', 'process', complete)\n\n return file\n\n function done(error) {\n complete = true\n bail(error)\n }\n }", "function process(doc, cb) {\n freeze();\n assertParser('process', processor.Parser);\n assertCompiler('process', processor.Compiler);\n\n if (!cb) {\n return new Promise(executor);\n }\n\n executor(null, cb);\n\n function executor(resolve, reject) {\n var file = vfile(doc);\n\n pipeline.run(processor, {file: file}, done);\n\n function done(err) {\n if (err) {\n reject(err);\n } else if (resolve) {\n resolve(file);\n } else {\n cb(null, file);\n }\n }\n }\n }", "function process(doc, cb) {\n freeze();\n assertParser('process', processor.Parser);\n assertCompiler('process', processor.Compiler);\n\n if (!cb) {\n return new Promise(executor)\n }\n\n executor(null, cb);\n\n function executor(resolve, reject) {\n var file = vfile(doc);\n\n pipeline.run(processor, {file: file}, done);\n\n function done(error) {\n if (error) {\n reject(error);\n } else if (resolve) {\n resolve(file);\n } else {\n cb(null, file);\n }\n }\n }\n }", "function process(doc, cb) {\n freeze()\n assertParser('process', processor.Parser)\n assertCompiler('process', processor.Compiler)\n\n if (!cb) {\n return new Promise(executor)\n }\n\n executor(null, cb)\n\n function executor(resolve, reject) {\n var file = vfile(doc)\n\n pipeline.run(processor, {file: file}, done)\n\n function done(err) {\n if (err) {\n reject(err)\n } else if (resolve) {\n resolve(file)\n } else {\n cb(null, file)\n }\n }\n }\n }", "function process(doc, cb) {\n freeze()\n assertParser('process', processor.Parser)\n assertCompiler('process', processor.Compiler)\n\n if (!cb) {\n return new Promise(executor)\n }\n\n executor(null, cb)\n\n function executor(resolve, reject) {\n var file = vfile(doc)\n\n pipeline.run(processor, {file: file}, done)\n\n function done(err) {\n if (err) {\n reject(err)\n } else if (resolve) {\n resolve(file)\n } else {\n cb(null, file)\n }\n }\n }\n }", "function process(doc, cb) {\n freeze()\n assertParser('process', processor.Parser)\n assertCompiler('process', processor.Compiler)\n\n if (!cb) {\n return new Promise(executor)\n }\n\n executor(null, cb)\n\n function executor(resolve, reject) {\n var file = vfile(doc)\n\n pipeline.run(processor, {file: file}, done)\n\n function done(err) {\n if (err) {\n reject(err)\n } else if (resolve) {\n resolve(file)\n } else {\n cb(null, file)\n }\n }\n }\n }", "function process(doc, cb) {\n freeze()\n assertParser('process', processor.Parser)\n assertCompiler('process', processor.Compiler)\n\n if (!cb) {\n return new Promise(executor)\n }\n\n executor(null, cb)\n\n function executor(resolve, reject) {\n var file = vfile(doc)\n\n pipeline.run(processor, {file: file}, done)\n\n function done(err) {\n if (err) {\n reject(err)\n } else if (resolve) {\n resolve(file)\n } else {\n cb(null, file)\n }\n }\n }\n }", "function process(doc, cb) {\n freeze()\n assertParser('process', processor.Parser)\n assertCompiler('process', processor.Compiler)\n\n if (!cb) {\n return new Promise(executor)\n }\n\n executor(null, cb)\n\n function executor(resolve, reject) {\n var file = vfile(doc)\n\n pipeline.run(processor, {file: file}, done)\n\n function done(err) {\n if (err) {\n reject(err)\n } else if (resolve) {\n resolve(file)\n } else {\n cb(null, file)\n }\n }\n }\n }", "function process(doc, cb) {\n freeze()\n assertParser('process', processor.Parser)\n assertCompiler('process', processor.Compiler)\n\n if (!cb) {\n return new Promise(executor)\n }\n\n executor(null, cb)\n\n function executor(resolve, reject) {\n var file = vfile(doc)\n\n pipeline.run(processor, {file: file}, done)\n\n function done(err) {\n if (err) {\n reject(err)\n } else if (resolve) {\n resolve(file)\n } else {\n cb(null, file)\n }\n }\n }\n }", "function process(doc, cb) {\n freeze()\n assertParser('process', processor.Parser)\n assertCompiler('process', processor.Compiler)\n\n if (!cb) {\n return new Promise(executor)\n }\n\n executor(null, cb)\n\n function executor(resolve, reject) {\n var file = vfile(doc)\n\n pipeline.run(processor, {file: file}, done)\n\n function done(error) {\n if (error) {\n reject(error)\n } else if (resolve) {\n resolve(file)\n } else {\n cb(null, file)\n }\n }\n }\n }", "function process(doc, cb) {\n freeze()\n assertParser('process', processor.Parser)\n assertCompiler('process', processor.Compiler)\n\n if (!cb) {\n return new Promise(executor)\n }\n\n executor(null, cb)\n\n function executor(resolve, reject) {\n var file = vfile(doc)\n\n pipeline.run(processor, {file: file}, done)\n\n function done(error) {\n if (error) {\n reject(error)\n } else if (resolve) {\n resolve(file)\n } else {\n cb(null, file)\n }\n }\n }\n }", "function process () {\n if (!processed) {\n var editor = EditorManager.getCurrentFullEditor();\n var currentDocument = editor.document;\n var originalText = currentDocument.getText();\n var processedText = Processor.process(originalText);\n var cursorPos = editor.getCursorPos();\n var scrollPos = editor.getScrollPos();\n\n // Bail if processing was unsuccessful.\n if (processedText === false) {\n return;\n }\n\n // Replace text.\n currentDocument.setText(processedText);\n\n // Restore cursor and scroll positons.\n editor.setCursorPos(cursorPos);\n editor.setScrollPos(scrollPos.x, scrollPos.y);\n\n // Save file.\n CommandManager.execute(Commands.FILE_SAVE);\n\n // Prevent file from being processed multiple times.\n processed = true;\n } else {\n processed = false;\n }\n }", "async parseDocument(doc)\n {\n // dumb helper function \n function isString (obj) {\n return (Object.prototype.toString.call(obj) === '[object String]');\n }\n\n if (isString(doc))\n doc = JSON.parse(doc)\n \n if (doc.hasOwnProperty('text_snippet') && \n doc.text_snippet.hasOwnProperty('content'))\n {\n var splitOptions = {\n SeparatorParser: {\n // separatorCharacters: ['\\n','.','?','!']\n }\n }\n \n console.log(\"*****Reparsing data from file****\")\n // first split the sentence\n let sentencesSplit = split(doc.text_snippet.content, splitOptions)\n let actualSplit = []\n\n // next we need to get the child nodes if any and flatten. basically we are cleaning up a funky artifact of sentence-splitter library\n // when you use split options, things come out in sentencesSplit[i].children\n for(var i =0;i<sentencesSplit.length;i++) {\n if (sentencesSplit[i].children) {\n actualSplit.push(...sentencesSplit[i].children)\n } else {\n actualSplit.push(sentencesSplit[i])\n }\n }\n console.log(actualSplit)\n \n // Now we have these wierd punctuation nodes seperate from our sentance.\n // if punctuation is not the first token in the document, \n // then append the punctuation to the previous token, and update the offsets.\n // this has the effect of creating a overlapping token so we will need to ignore \n // the punctionation token later on in RenderSentence::render()\n for(var i =0 ; i<actualSplit.length ; i++) {\n var sentence = actualSplit[i];\n\n if (sentence.type == \"Punctuation\" && i>0) {\n actualSplit[i-1].range[1]=sentence.range[1]\n actualSplit[i-1].value+= sentence.value\n actualSplit[i-1].raw+= sentence.raw\n }\n }\n \n return {\n documentData: doc,\n sentenceData: actualSplit \n }\n }\n else\n throw new Error(\"Schema Validation Error: \"+ JSON.stringify(doc).substr(0,500)+\" ... \");\n }", "function processDocument() {\n // process the document.\n let body = DocumentApp.getActiveDocument().getBody();\n let bodyText = body.editAsText();\n let text = body.editAsText().getText();\n\n // store all distinct words found in the doc\n let wordList = {};\n\n let words = getWords(text);\n let totalWords = words.length;\n let sentences = getSentences(text);\n let totalSentences = sentences.length;\n let totalSyllables = getNumSyllables(text);\n\n let avgSentenceLength = totalWords / totalSentences;\n let avgSyllablesWord = totalSyllables / totalWords;\n\n // count the number of distinct words\n words.forEach((word) => {\n if(!wordList[word]) {\n wordList[word] = 1;\n }\n })\n\n let distinctWords = Object.keys(wordList).length;\n\n let freqResult = getFrequencies(bodyText, words);\n\n underlineSentences(bodyText, sentences);\n\n let kincaid = 0.39 * (avgSentenceLength) + 11.8 * (avgSyllablesWord) - 15.59;\n\n let reading = 206.835 - 1.015 * (avgSentenceLength) - 84.6 * (avgSyllablesWord);\n\n let output = {\n word_count: totalWords,\n original_doc: text,\n sentence_count: totalSentences,\n syllable_count: totalSyllables,\n syllables_word: avgSyllablesWord,\n flesch_kincaid: kincaid,\n flesch_reading: reading,\n type_token: distinctWords / totalWords,\n frequencies: freqResult.frequency,\n avg_sentence: avgSentenceLength\n }\n return output;\n\n // optional code for testing\n \n}", "static async modifyDocument (id, document) {\n if (typeof document !== 'object') {\n throw new Error('Bad Parameter');\n }\n const db = await Mongo.instance().getDb();\n const isValid = await Document.isDocument(document);\n if (isValid.valid) {\n // Create a new document\n // Uploaded document with new informations.\n const res = await db.collection(Document.COLLECTION).updateOne(\n {\n _id: ObjectId(id)\n },\n {\n $set: {\n ...document,\n updatedAt: moment().toDate()\n }\n }\n );\n return res;\n } else {\n log.debug('Warning - couldn\\'t modify document \\n', document);\n return null;\n }\n }", "function processDoc(object, mimeType, root) {\r\n var doc;\r\n\r\n // clueless? assume HTML\r\n if(!mimeType) {\r\n mimeType=\"text/html\";\r\n }\r\n\r\n // dispatch to requested representor \r\n switch(mimeType.toLowerCase()) {\r\n case \"application/json\":\r\n doc = json(object, root);\r\n break;\r\n case \"application/hal+json\":\r\n doc = halj(object, root);\r\n break;\r\n case \"text/html\":\r\n case \"application/html\":\r\n default:\r\n doc = html(object, root);\r\n break;\r\n }\r\n\r\n return doc;\r\n}", "onDocumentOpenOrContentChanged(document) {\n if (!this.startDataLoaded) {\n return;\n }\n // No need to handle file opening because we have preloaded all the files.\n // Open and changed event will be distinguished by document version later.\n if (this.shouldTrackFile(vscode_uri_1.URI.parse(document.uri).fsPath)) {\n this.trackOpenedDocument(document);\n }\n }", "async function extractDocumentFile(input, output) {\n input.text = (await mammoth.extractRawText({\n arrayBuffer: input.arrayBuffer\n })).value;\n}", "function processFileTXT(doc){\n content = doc.body;\n // FILTER: remove tabs\n content = content.replace(/\\t/g, ' ');\n // FILTER: fix smart quotes and m dash with unicode\n content = textPretty(content);\n // FILTER replace meta blocks with comments\n content = content.replace(/=================================/, '<!--');\n content = content.replace(/=================================/, '-->');\n // FILTER replace old page markers <p#> and <c:#>\n content = content.replace(/<p([0-9]+)>/g, \"<span id='pg_$1'></span>\");\n // FILTER: markdown\n md.setOptions({\n gfm: false, tables: false, breaks: false, pedantic: false,\n sanitize: false, smartLists: false, smartypants: false\n });\n content = md(content);\n content = content.replace(/<\\/p>/g, \"\\n\\n\");\n // FILTER add consistent header\n doc.header = HTMLHeaderTemplate(doc.meta);\n // FILTER: Number Paragraphs\n content = numberPars(content, doc.meta);\n doc.body = content;\n // FILTER: HTML5 template into HTML document\n doc.html = HTML5Template(doc);\n return doc;\n}", "onChange(document) {\n if (fspath.basename(document.uri.fsPath) == \"property.json\") {\t\t\n this.refreshProperty.updateFolder(serve.opeParam.rootPath,serve.opeParam.workspacePath,document.uri.fsPath);\n this.refreshProperty.updatePrjInfo(serve.opeParam.rootPath,document.uri.fsPath);\n return;\n }\n if (!this.getHDLDocumentType(document)) {\n return;\n }\n else if (this.getHDLDocumentType(document) == 1 ) {\n this.HDLparam = this.parser.removeCurrentFileParam(document, this.HDLparam);\n this.parser.get_HDLfileparam(document, null, 0, null, this.HDLparam);\n this.parser.get_instModulePath(this.HDLparam);\n this.refresh();\n }\n }", "static process_file(filename)\r\n {\r\n if (fs === null)\r\n {\r\n throw new Error(\"Not in node.js : module fs not defined. Aborting.\");\r\n }\r\n if (DEBUG)\r\n {\r\n console.log('Processing file:', filename);\r\n console.log('--------------------------------------------------------------------------');\r\n }\r\n let data = Hamill.read_file(filename);\r\n let doc = this.process_string(data);\r\n doc.set_name(filename);\r\n return doc;\r\n }", "function processFileHTML(doc){\n // parse out into blocks\n // re-assemble with new paragraph numbering\n // add style sheet\n // move assets to the assets folder\n return doc;\n}", "textDocumentDidSave(params) {\n return __awaiter(this, void 0, void 0, function* () {\n const uri = util_1.normalizeUri(params.textDocument.uri);\n // Ensure files needed to suggest completions are fetched\n yield this.projectManager.ensureReferencedFiles(uri).toPromise();\n this.projectManager.didSave(uri);\n });\n }", "function main()\n{\n\n var nodeRef = json.get(\"nodeRef\");\n var version = json.get(\"version\");\n var majorVersion = json.get(\"majorVersion\") == \"true\";\n var description = json.get(\"description\");\n\n // allow for content to be loaded from id\n if (nodeRef != null && version != null)\n {\n\n var workingCopy = search.findNode(nodeRef);\n\n var versions = null;\n if (workingCopy != null)\n {\n if (workingCopy.isLocked)\n {\n // We cannot revert a locked document\n status.code = 404;\n status.message = \"error.nodeLocked\";\n status.redirect = true;\n return;\n }\n\n versions = [];\n var versionHistory = workingCopy.versionHistory;\n if (versionHistory != null)\n {\n for (i = 0; i < versionHistory.length; i++)\n {\n var v = versionHistory[i];\n if (v.label.equals(version))\n { \n if (!workingCopy.hasAspect(\"cm:workingcopy\"))\n {\n // Ensure the original file is versionable - may have been uploaded via different route\n if (!workingCopy.hasAspect(\"cm:versionable\"))\n {\n // We cannot revert a non versionable document\n status.code = 404;\n status.message = \"error.nodeNotVersionable\";\n status.redirect = true;\n return;\n }\n\n // It's not a working copy, do a check out to get the actual working copy\n workingCopy = workingCopy.checkout();\n }\n\n // Update the working copy content\n workingCopy.properties.content.write(v.node.properties.content);\n workingCopy.properties.content.mimetype = v.node.properties.content.mimetype;\n workingCopy.properties.content.encoding = v.node.properties.content.encoding;\n\n // check it in again, with supplied version history note\n workingCopy = workingCopy.checkin(description, majorVersion);\n\n model.document = workingCopy;\n return;\n }\n }\n }\n\n // Could not find the version\n status.code = 404;\n status.message = \"error.versionNotFound\";\n status.redirect = true;\n return;\n }\n else\n {\n // Could not find a document for the nodeRef\n status.code = 404;\n status.message = \"error.nodeNotFound\";\n status.redirect = true;\n return;\n }\n }\n}", "parseDocument(doc) {\n // split the document to words\n const words = normalize(doc);\n // process each word individually\n words.map(word => {\n if (this.stopWords.find(stopWord => word === stopWord) !== undefined) {\n // do nothing, it's a stop word, and it doesn't add any meaning\n } else if (this.dictionary[word] !== undefined) {\n this.dictionary[word].push(this.documentCount)\n } else {\n this.dictionary[word] = [this.documentCount];\n }\n })\n this.documentCount++\n this.docs.push(doc)\n }", "function acceptDocument(data) {\n var names = documentNames\n names.push(data.name)\n setDocumentNames(names)\n\n var uris = documentURIs\n uris.push(data.uri)\n setDocumentURIs(uris)\n\n confirmData(classification, orderTask, ontologyTask, commentTask, comment, uris, names)\n }", "populateDocument(_docId, event) {\n event.preventDefault();\n const { contractInst } = this.props;\n //condition for docid\n if (_docId) {\n //calling blockchain method to find document by id\n contractInst.methods.findById(_docId).call()\n .then(res => {\n if (res) {\n res.size = FORMATBYTES(parseInt(res.size), 2);\n this.setState({ document: res, show: true });\n }\n }).catch(err => {\n console.error(\"---Error while populating document---\".err);\n });\n\n }\n }", "documentUpload(e) {\n let file = e.target.files[0];\n let fileSize = file.size / 1024 / 1024;\n let fileType = file.type;\n let fileName = file.name;\n let validDocFormat = false;\n let docFormat = fileName.split('.')[1];\n if(docFormat === 'doc'|| docFormat === 'docx' || docFormat === 'xls' || docFormat === 'xlsx'|| docFormat === 'pdf')validDocFormat= true;\n this.setState({ fileType: file.type, fileName: file.name, fileSize: fileSize });\n this.getCentralLibrary();\n if (this.state.totalLibrarySize < 50) {\n let fileExists = this.checkIfFileAlreadyExists(file.name, \"document\");\n let typeShouldBe = _.compact(fileType.split('/'));\n if (file && typeShouldBe && typeShouldBe[0] !== \"image\" && typeShouldBe[0] !== \"video\" && validDocFormat) {\n if (!fileExists) {\n let data = { moduleName: \"PROFILE\", actionName: \"UPDATE\" }\n let response = multipartASyncFormHandler(data, file, 'registration', this.onFileUploadCallBack.bind(this, \"document\"));\n } else {\n toastr.error(\"Document with the same file name already exists in your library\")\n }\n } else {\n toastr.error(\"Please select a Document Format\")\n }\n } else {\n toastr.error(\"Allotted library limit exceeded\");\n }\n }", "function processDocuments(log, config, job, documentList, callback) {\n let metastampRecords = [];\n let icn = idUtil.extractIcnFromPid(job.patientIdentifier.value, config);\n let jobsToPublish = [];\n\n log.debug('vler-das-doc-retrieve-handler.processDocuments: entered method');\n async.eachSeries(documentList, function(document, asyncCallback) {\n //decode xml from Base 64\n let documentContent = _.first(_.get(document, 'content'));\n let xmlDoc = Buffer.from(_.get(documentContent, 'attachment.Data') || '', 'base64').toString();\n\n determineKind(log, xmlDoc, function(kind) {\n if (kind === 'unsupportedFormat') {\n log.debug('vler-das-doc-retrieve-handler.processDocuments: ignoring document that is in unsupported format');\n return asyncCallback();\n }\n\n let record = {\n xmlDoc: xmlDoc,\n kind: kind,\n resource: _.get(document, 'resource'),\n pid: job.patientIdentifier.value,\n uid: uidUtils.getUidForDomain('vlerdocument', 'VLER', icn, uuid.v4())\n };\n metastampRecords.push(record);\n\n // Create meta object for job information for all new VlerDasXformVpr jobs.\n // This shouldn't contain a jobId, as the jobUtil will create one for us.\n let meta = {\n jpid: job.jpid,\n rootJobId: job.rootJobId,\n priority: job.priority\n };\n\n if (job.referenceInfo) {\n meta.referenceInfo = job.referenceInfo;\n }\n\n jobsToPublish.push(jobUtil.createVlerDasXformVpr(job.patientIdentifier, record, job.requestStampTime, meta));\n asyncCallback();\n });\n }, function() {\n //create metastamp\n let domainMetastamp = metastampUtils.metastampDomain({\n data: {\n items: metastampRecords\n }\n }, job.requestStampTime, null);\n\n log.debug('vler-das-doc-retrieve-handler.processDocuments: completed');\n callback(domainMetastamp, jobsToPublish);\n });\n}", "parseDocument(doc) {\n // split the document to words\n const words = normalize(doc);\n // process each word individually\n words.map(word => {\n if (this.stopWords.find(stopWord => word === stopWord) !== undefined) {\n\t // do nothing, it's a stop word, and it doesn't add any meaning\n } else if (this.dictionary[word] !== undefined) {\n this.dictionary[word].push(this.documentCount)\n } else {\n this.dictionary[word] = [this.documentCount];\n\t\t\t}\n })\n this.documentCount++\n this.docs.push(doc)\n }", "change(docId, doc) {\n const cleanedDoc = this._getCleanedObject(doc);\n let storedDoc = this.store[docId];\n deepExtend(storedDoc, cleanedDoc);\n\n let changedData = {};\n _.each(cleanedDoc, (value, key) => {\n changedData[key] = storedDoc[key];\n });\n\n this.send('changed', docId, changedData);\n }", "async loadDocumentContent (documentPath) {\n const doc = await this.fetch(`/load_document?d=${documentPath}`) \n return this.parseDocument(doc);\n }", "function processDataFromDocusky() {\n\tparseDocInfo();\n\ttoolSetting();\n}", "function parse(doc) {\n var file = vfile(doc);\n var Parser;\n\n freeze();\n Parser = processor.Parser;\n assertParser('parse', Parser);\n\n if (newable(Parser, 'parse')) {\n return new Parser(String(file), file).parse()\n }\n\n return Parser(String(file), file) // eslint-disable-line new-cap\n }", "function indexDocument(document) {\n\t\tvar text = document[me.indexField];\n\t\tvar docId = document[me.objectStore.keyPath];\n\n\t\t// tokenize string\n\t\tvar tokens = Object.keys(Lucy.tokenize(text, {disableStemming: true}).tokens);\n\t\t\n\t\tif (me.mode == \"suffix\") {\n\t\t\ttokens = tokens.map(function (token) { return reverse(token); });\n\t\t}\n\t\t\n\t\ttokens.forEach(function(token) {\n\t\t\tvar child = null;\n\t\t\t\n\t\t\t// Add prefixes for every letter in the token\n\t\t\t// We start from the entire token and progressively chop off its last character\n\t\t\twhile (token.length > 0) {\n\t\t\t\taddNode(token, docId, child);\n\t\t\t\t\n\t\t\t\tchild = token[token.length - 1];\n\t\t\t\ttoken = token.slice(0, token.length - 1);\n\t\t\t}\n\t\t});\n\t}", "listen(connection) {\r\n connection.__textDocumentSync = vscode_languageserver_protocol_1.TextDocumentSyncKind.Full;\r\n connection.onDidOpenTextDocument((event) => {\r\n let td = event.textDocument;\r\n let document = this._configuration.create(td.uri, td.languageId, td.version, td.text);\r\n this._documents[td.uri] = document;\r\n let toFire = Object.freeze({ document });\r\n this._onDidOpen.fire(toFire);\r\n this._onDidChangeContent.fire(toFire);\r\n });\r\n connection.onDidChangeTextDocument((event) => {\r\n let td = event.textDocument;\r\n let changes = event.contentChanges;\r\n if (changes.length === 0) {\r\n return;\r\n }\r\n let document = this._documents[td.uri];\r\n const { version } = td;\r\n if (version === null || version === void 0) {\r\n throw new Error(`Received document change event for ${td.uri} without valid version identifier`);\r\n }\r\n document = this._configuration.update(document, changes, version);\r\n this._documents[td.uri] = document;\r\n this._onDidChangeContent.fire(Object.freeze({ document }));\r\n });\r\n connection.onDidCloseTextDocument((event) => {\r\n let document = this._documents[event.textDocument.uri];\r\n if (document) {\r\n delete this._documents[event.textDocument.uri];\r\n this._onDidClose.fire(Object.freeze({ document }));\r\n }\r\n });\r\n connection.onWillSaveTextDocument((event) => {\r\n let document = this._documents[event.textDocument.uri];\r\n if (document) {\r\n this._onWillSave.fire(Object.freeze({ document, reason: event.reason }));\r\n }\r\n });\r\n connection.onWillSaveTextDocumentWaitUntil((event, token) => {\r\n let document = this._documents[event.textDocument.uri];\r\n if (document && this._willSaveWaitUntil) {\r\n return this._willSaveWaitUntil(Object.freeze({ document, reason: event.reason }), token);\r\n }\r\n else {\r\n return [];\r\n }\r\n });\r\n connection.onDidSaveTextDocument((event) => {\r\n let document = this._documents[event.textDocument.uri];\r\n if (document) {\r\n this._onDidSave.fire(Object.freeze({ document }));\r\n }\r\n });\r\n }", "listen(connection) {\r\n connection.__textDocumentSync = vscode_languageserver_protocol_1.TextDocumentSyncKind.Full;\r\n connection.onDidOpenTextDocument((event) => {\r\n let td = event.textDocument;\r\n let document = this._configuration.create(td.uri, td.languageId, td.version, td.text);\r\n this._documents[td.uri] = document;\r\n let toFire = Object.freeze({ document });\r\n this._onDidOpen.fire(toFire);\r\n this._onDidChangeContent.fire(toFire);\r\n });\r\n connection.onDidChangeTextDocument((event) => {\r\n let td = event.textDocument;\r\n let changes = event.contentChanges;\r\n if (changes.length === 0) {\r\n return;\r\n }\r\n let document = this._documents[td.uri];\r\n const { version } = td;\r\n if (version === null || version === void 0) {\r\n throw new Error(`Received document change event for ${td.uri} without valid version identifier`);\r\n }\r\n document = this._configuration.update(document, changes, version);\r\n this._documents[td.uri] = document;\r\n this._onDidChangeContent.fire(Object.freeze({ document }));\r\n });\r\n connection.onDidCloseTextDocument((event) => {\r\n let document = this._documents[event.textDocument.uri];\r\n if (document) {\r\n delete this._documents[event.textDocument.uri];\r\n this._onDidClose.fire(Object.freeze({ document }));\r\n }\r\n });\r\n connection.onWillSaveTextDocument((event) => {\r\n let document = this._documents[event.textDocument.uri];\r\n if (document) {\r\n this._onWillSave.fire(Object.freeze({ document, reason: event.reason }));\r\n }\r\n });\r\n connection.onWillSaveTextDocumentWaitUntil((event, token) => {\r\n let document = this._documents[event.textDocument.uri];\r\n if (document && this._willSaveWaitUntil) {\r\n return this._willSaveWaitUntil(Object.freeze({ document, reason: event.reason }), token);\r\n }\r\n else {\r\n return [];\r\n }\r\n });\r\n connection.onDidSaveTextDocument((event) => {\r\n let document = this._documents[event.textDocument.uri];\r\n if (document) {\r\n this._onDidSave.fire(Object.freeze({ document }));\r\n }\r\n });\r\n }", "function parse(doc) {\n var file = vfile(doc);\n var Parser;\n\n freeze();\n Parser = processor.Parser;\n assertParser('parse', Parser);\n\n if (newable(Parser)) {\n return new Parser(String(file), file).parse();\n }\n\n return Parser(String(file), file); // eslint-disable-line new-cap\n }", "parseWordDocxFile(files) {\n\n this.setState({ converting: true });\n var current = this;\n //console.log(files);\n var file = files[0];\n\n var reader = new FileReader();\n reader.onloadend = function (event) {\n var arrayBuffer = reader.result;\n\n mammoth.convertToHtml({ arrayBuffer: arrayBuffer }).then(\n function (resultObject) {\n \n const newDoc = document.implementation.createHTMLDocument('title');\n newDoc.body.innerHTML = resultObject.value;\n const converting = setTimeout(() => {\n current.setState({ html: resultObject.value, newFile: { name: file.name, file: newDoc }, converting: false });\n }, 2000);\n\n return () => clearTimeout(converting);\n\n\n });\n };\n reader.readAsArrayBuffer(file);\n }", "function parse(doc) {\n var file = vfile(doc)\n var Parser\n\n freeze()\n Parser = processor.Parser\n assertParser('parse', Parser)\n\n if (newable(Parser, 'parse')) {\n return new Parser(String(file), file).parse()\n }\n\n return Parser(String(file), file) // eslint-disable-line new-cap\n }", "function parse(doc) {\n var file = vfile(doc)\n var Parser\n\n freeze()\n Parser = processor.Parser\n assertParser('parse', Parser)\n\n if (newable(Parser, 'parse')) {\n return new Parser(String(file), file).parse()\n }\n\n return Parser(String(file), file) // eslint-disable-line new-cap\n }", "function parse(doc) {\n var file = vfile(doc)\n var Parser\n\n freeze()\n Parser = processor.Parser\n assertParser('parse', Parser)\n\n if (newable(Parser, 'parse')) {\n return new Parser(String(file), file).parse()\n }\n\n return Parser(String(file), file) // eslint-disable-line new-cap\n }", "function update(document, changes, version) {\n if (document instanceof FullTextDocument) {\n document.update(changes, version);\n return document;\n }\n else {\n throw new Error('TextDocument.update: document must be created by TextDocument.create');\n }\n }", "function parse(doc) {\n var file = vfile(doc)\n var Parser\n\n freeze()\n Parser = processor.Parser\n assertParser('parse', Parser)\n\n if (newable(Parser)) {\n return new Parser(String(file), file).parse()\n }\n\n return Parser(String(file), file) // eslint-disable-line new-cap\n }", "function parse(doc) {\n var file = vfile(doc)\n var Parser\n\n freeze()\n Parser = processor.Parser\n assertParser('parse', Parser)\n\n if (newable(Parser)) {\n return new Parser(String(file), file).parse()\n }\n\n return Parser(String(file), file) // eslint-disable-line new-cap\n }", "function parse(doc) {\n var file = vfile(doc)\n var Parser\n\n freeze()\n Parser = processor.Parser\n assertParser('parse', Parser)\n\n if (newable(Parser)) {\n return new Parser(String(file), file).parse()\n }\n\n return Parser(String(file), file) // eslint-disable-line new-cap\n }", "function parse(doc) {\n var file = vfile(doc)\n var Parser\n\n freeze()\n Parser = processor.Parser\n assertParser('parse', Parser)\n\n if (newable(Parser)) {\n return new Parser(String(file), file).parse()\n }\n\n return Parser(String(file), file) // eslint-disable-line new-cap\n }", "function parse(doc) {\n var file = vfile(doc)\n var Parser\n\n freeze()\n Parser = processor.Parser\n assertParser('parse', Parser)\n\n if (newable(Parser)) {\n return new Parser(String(file), file).parse()\n }\n\n return Parser(String(file), file) // eslint-disable-line new-cap\n }", "function update(document, changes, version) {\n if (document instanceof FullTextDocument) {\n document.update(changes, version);\n return document;\n }\n else {\n throw new Error('TextDocument.update: document must be created by TextDocument.create');\n }\n }", "function _uploadDocument(req, res) {\n if (req && req.file) {\n var absolutePath = path.join(path.dirname(require.main.filename), req.file.path);\n req.file.absolutePath = absolutePath;\n var saveDocument = new Document({\n docPath: absolutePath,\n docName: req.file.filename\n });\n saveDocument.save(function(err, docs) {\n if (err) {\n resultObj.status = FAIL;\n resultObj.result = err;\n res.send(resultObj);\n } else {\n resultObj.status = OK;\n resultObj.result = docs;\n res.send(resultObj);\n }\n });\n } else {\n resultObj.status = FAIL;\n resultObj.result = 'Server Error';\n res.send(resultObj);\n }\n}", "function main() {\n\n // Sets AsciiDoc file from url query string \n const params = new URLSearchParams(location.search);\n let aDocName = params.get('aDoc');\n if (aDocName === null || aDocName === '') {\n aDocName = 'indice';\n }\n aDoc = aDocs.find(aDoc => aDoc.name === aDocName);\n \n // Updates UI with HTML content from AsciiDoc file\n updateDocContents(aDoc);\n}", "function read_in_document_text()\n{\n var content = fs.readFileSync(\"filtered_merged_file.json\");\n content = JSON.parse(content);\n var count = 0;\n \n for(var i = 0; i < content.length; i++)\n {\n var current = content[i];\n for(var j = 0; j < current.length; j++)\n {\n var this_doc = current[j];\n var data = {};\n data.date = this_doc[\"date\"];\n data.text = this_doc[\"body\"];\n data.url = this_doc[\"link\"];\n data.title = this_doc[\"title\"];\n document_text[count] = data;\n count++;\n }\n }\n}", "async function jobCallback(id, task, con) {\n info(`Processing vdoc resource ${id}`);\n const vdocpath = `/resources/${id}`;\n let vdoc = false;\n let vdocmeta = false;\n try {\n let r = await con.get({ path: vdocpath });\n vdoc = _.cloneDeep(r.data);\n // Get our own meta to make sure we don't mess with our own parent's vdoc link\n // (i.e. when recursing through the `unmask` key)\n r = await con.get({ path: `${vdocpath}/_meta` });\n vdocmeta = _.cloneDeep(r.data);\n } catch (e) {\n error(`Could not retrieve vdoc ${vdocpath} or it's _meta, err = %O`, e);\n throw new Error(`Could not retrieve vdoc ${vdocpath}`);\n }\n if (!vdoc) {\n warn(`WARNING: vdoc for ${vdocpath} was empty!`);\n return; // nothing to do, but not really an error\n }\n // save the _meta in the vdoc for recursiveAddVdocLinksToKeys\n vdoc._meta = vdocmeta;\n\n // Recurse through all keys\n // if any key has an _id, it is a link, so put ourselves at it's vdoc.\n // This recursion will handle top-level links in the vdoc as well as things like audits/*\n await recursiveAddVdocLinksToKeys(vdoc,vdocpath, vdoc, con);\n return { success: true };\n}", "scanFile(document) {\n if (document.languageId === 'sass') {\n const text = document.getText();\n const pathBasename = path_1.basename(document.fileName);\n let variables = {};\n variables = this.scanFileHandleGetVars(text, pathBasename, variables);\n variables = this.scanFileHandleGetMixin(text, pathBasename, variables);\n this.context.workspaceState.update(path_1.normalize(document.fileName), variables);\n }\n }", "function validateTextDocument(textDocument) {\n return __awaiter(this, void 0, void 0, function* () {\n const pathStr = path.resolve(fileUriToPath_1.default(textDocument.uri));\n const folder = pathStr.substring(0, pathStr.lastIndexOf(\"/\") + 1);\n const parentDir = path.resolve(`${folder}../`);\n let thisTemplateLogic = templateLogics[parentDir];\n if (!thisTemplateLogic) {\n thisTemplateLogic = new ergo_compiler_1.TemplateLogic('cicero');\n templateLogics[parentDir] = thisTemplateLogic;\n }\n const thisModelManager = thisTemplateLogic.getModelManager();\n let diagnostics = [];\n try {\n // Find all cto files in ./ relative to this file or in the parent director\n // if this is a Cicero template.\n let newModels = false;\n const modelFiles = glob_1.glob.sync(`{${folder},${parentDir}/models/}**/*.cto`);\n for (const file of modelFiles) {\n connection.console.log(file);\n const contents = fs.readFileSync(file, 'utf8');\n const modelFile = new composer_concerto_1.ModelFile(thisModelManager, contents, file);\n if (!thisModelManager.getModelFile(modelFile.getNamespace())) {\n // only add if not existing\n thisModelManager.addModelFile(contents, file, true);\n newModels = true;\n }\n }\n // Only pull external models if a new file was added to the model manager\n if (newModels) {\n yield thisModelManager.updateExternalModels();\n }\n try {\n // Find all ergo files in ./ relative to this file\n const ergoFiles = glob_1.glob.sync(`{${folder},${parentDir}/lib/}**/*.ergo`);\n for (const file of ergoFiles) {\n if (file === pathStr) {\n // Update the current file being edited\n thisTemplateLogic.updateLogic(textDocument.getText(), pathStr);\n }\n else {\n connection.console.log(file);\n const contents = fs.readFileSync(file, 'utf8');\n thisTemplateLogic.updateLogic(contents, file);\n }\n }\n const compiled = yield thisTemplateLogic.compileLogic(true);\n }\n catch (error) {\n const descriptor = error.descriptor;\n if (descriptor.kind === 'CompilationError' || descriptor.kind === 'TypeError') {\n const range = {\n start: { line: 0, character: 0 },\n end: { line: 0, character: 0 },\n };\n if (descriptor.locstart.line > 0) {\n range.start = { line: descriptor.locstart.line - 1, character: descriptor.locstart.character };\n range.end = range.start;\n }\n if (descriptor.locend.line > 0) {\n range.end = { line: descriptor.locend.line - 1, character: descriptor.locend.character };\n }\n diagnostics.push({\n severity: vscode_languageserver_1.DiagnosticSeverity.Error,\n range,\n message: descriptor.message,\n source: 'ergo'\n });\n }\n else {\n diagnostics.push({\n severity: vscode_languageserver_1.DiagnosticSeverity.Error,\n range: {\n start: { line: descriptor.locstart.line - 1, character: descriptor.locstart.character },\n end: { line: descriptor.locend.line - 1, character: descriptor.locend.character },\n },\n message: descriptor.message,\n source: 'ergo'\n });\n }\n }\n }\n catch (error) {\n connection.console.error(error.message);\n connection.console.error(error.stack);\n }\n connection.sendDiagnostics({ uri: textDocument.uri, diagnostics });\n });\n}", "function ReceiveUpdate(doc) {\n myDoc = doc;\n for (i = 0; i < functionQueue.length; i++) {\n var t = functionQueue[i];\n t[0](myDoc, t[1]);\n }\n Render(doc);\n}", "async uploadDocumentToIPFS() {\n const formData = new FormData();\n const files = Array.from(document.querySelector(\"#document\").files);\n if (files.length > 0) {\n if (this.approveFileType(files[0])) {\n formData.set(\"document\", files[0]);\n const { IpfsHash } = await fetch(\"http://localhost:3000/upload\", {\n method: \"POST\",\n body: formData,\n }).then((response) => response.json());\n return IpfsHash;\n } else {\n new Alert(\n \"#alert-container\",\n \"alert\",\n \"danger\",\n \"File type is not approved\"\n );\n }\n } else {\n return \"\";\n }\n }", "function editAndCommit(oDocument, sContent, sCommitMessage) {\n\t\t\treturn oDocument.setContent(sContent).then(function () {\n\t\t\t\treturn oDocument.save().then(function () {\n\t\t\t\t\treturn stageFilesAndCommit([oDocument.getEntity().getName()], sCommitMessage);\n\t\t\t\t});\n\t\t\t});\n\t\t}", "processDoc(xmlFile, xmlDoc) {\n\n const work = {\n url: new URL(xmlFile, window.location),\n xmlDoc,\n title: \"\",\n descr: \"\",\n versions: [],\n facsimiles: []\n };\n\n\n try {\n work.title = this.runXPath(xmlDoc, \"/tei:teiCorpus/tei:teiHeader//tei:title\", xmlDoc).iterateNext().textContent;\n } catch (e) {\n console.error(\"No teiCorpus found!\");\n return;\n }\n\n // get more descriptive metadata from TEI header\n\n try {\n work.descr = this.runXPath(xmlDoc, \"/tei:teiCorpus/tei:teiHeader//tei:sourceDesc\", xmlDoc).iterateNext().innerHTML;\n } catch (e) {\n work.descr = \"info to be added\"\n }\n\n const teiResult = this.runXPath(xmlDoc, \"/tei:teiCorpus/tei:TEI\", xmlDoc);\n for (let a = teiResult.iterateNext(); a; a = teiResult.iterateNext()) {\n work.versions.push(a);\n\n const language = this.runXPath(xmlDoc, \".//tei:language\", a).iterateNext().textContent;\n const facsimileResult = this.runXPath(xmlDoc, \".//tei:facsimile//tei:graphic\", a);\n const facsimile = { language, images: [] };\n for (let i = facsimileResult.iterateNext(); i; i = facsimileResult.iterateNext()) {\n facsimile.images.push(i.getAttribute(\"url\"));\n }\n work.facsimiles.push(facsimile);\n }\n\n this.works.push(work);\n }", "function doDocument() {\n\n // This function is called when the document is ready by\n // virtue of $(document).ready call right at the bottom\n // of this script. We call Crimson's default handler,\n // bind the input button, and start the tag update process.\n\n doSession();\n\n $(\"#commit\").on(\"click\", function (e) { submitData(); });\n\n sendRead();\n}", "static async find(directory, document, filename, edit = false) {\n\n\t\tlet path = `${config.api}/directories/${directory}/documents/${document}/files/${filename}`;\n\n\t\t// if we need the uncompiled markdown (for loading the editor), amend '/edit' to the path\n\t\tif (edit) {\n\t\t\tpath = [path, \"edit\"].join(\"/\");\n\t\t};\n\n\t\tlet response = await fetch(path, {headers: store.state.auth.authHeader()})\n\n\t\tif (!checkResponse(response.status)) {\n\t\t\tconsole.error(\"Document cannot be retrieved\", response);\n\t\t\treturn;\n\t\t}\n\n\t\tlet file = await response.json()\n\t\tlet doc = new CMSFile(file);\n\t\tstore.state.activeDocument = doc;\n\n\t\tawait store.commit(\"setLatestRevision\", file.repository_info.latest_revision);\n\n\t\tdoc.fetchAttachments();\n\t\treturn doc;\n\n\t}", "function postDoc(username,fileName, fileType, doc){\n UserAccountService.postDoc(username, fileName, fileType, doc)\n .then(\n function(d) {\n vm.cancelModal();\n },\n function(errResponse){\n console.error('Error while updating doc');\n }\n );\n }", "function processPDF() {\n\t// lock process and prevent user resubmission\n\tprocessing = true;\n\tvar progress = $(\"#progressDisplay\");\n\t$(\"#uploadPDFDiv\").addClass(\"disableButtons\");\n\t\n\t// convert file to text\n\tvar file = document.getElementById(\"pdfInput\").files[0];\n\tif(file == null || !(\"name\" in file) || !file.name.endsWith(\".pdf\")) {\n\t\tprogress.text(\"No file selected or invalid format\");\n\t}\n\tprogress.text(\"Converting file to text\");\n\tPdf2TextClass().convertPDF(file, function(page, total) {}, function(pages) {\n\t\t// called when the pdf is fully converted to text. Finds all unique words\n\t\t\n\t\tprogress.text(\"finding unique words and chapters\");\n\t\tvar start = $(\"#startPageNumber\").val();\n\t\tvar end = $(\"#endPageNumber\").val();\n\t\tvar auto = $(\"#autoChidCheck\").prop(\"checked\");\n\t\tvar prefix = $(\"#prefixInput\").val();\n\t\t\n\t\t// check for bad ch_id prefix\n\t\tif(!prefix.match(/^([1-8]((M|N|S|SS|EN)([0-9][0-9]\\.)?([0-9][0-9])?)?)?$/)) {\n\t\t\tprogress.text(\"chapter prefix isn't formatted correctly\");\n\t\t\tfinishProcessingPDF();\n\t\t\treturn;\n\t\t}\n\t\t\n\t\t\n\t\tvar words = findUniqueWordsFromString(pages, auto, $(\"#chapInput\").val(), prefix,\n\t\t\t\t\t\t\t\t\t\t\tstart, end);\n\t\tif(words === false) {\n\t\t\tprogress.text(\"You can't autogenerate ch_ids if you specify 'start' and 'end'\");\n\t\t\tfinishProcessingPDF();\n\t\t\treturn;\n\t\t}\n\t\t\n\t\t\n\t\t\n\t\tupdateContext(pages, start, end);\n\t\t\n\t\t\n\t\tprogress.text(\"uploading...\");\n\t\t\n\t\tmaxProgress = 0;\n\t\t// uploads the words to the backend to be added to the dictionary\n\t\t$.post(\"backend.php\",\n\t\t\t\t{'loginInfo': {\"allowed\": true, 'user': 'me'},\n\t\t\t\t'wordList': JSON.stringify(words)},\n\t\t\t\tfunction(data, status, jqXHR) {\n\t\t\t\t\t// called when the post request returns (whether successful or not)\n\t\t\t\t\tif('status' in data && data['status']['type'] == 'error') {\n\t\t\t\t\t\t// after a non-fatal error\n\t\t\t\t\t\tprogress.text(\"Failed with error: \" + data['status']['value']);\n\t\t\t\t\t} else {\n\t\t\t\t\t\tprogress.html(\"Done!<br>Success: \" + (data['success'] || \"\")\n\t\t\t\t\t\t\t+ \"<br>Fully skipped for unknown reason: \" + (data['fullSkip'] || \"\")\n\t\t\t\t\t\t\t+ \"<br>Some definitions skipped for unknown reason: \" + (data['partSkip'] || \"\")\n\t\t\t\t\t\t\t+ \"<br>Some definitions missing vital data: \" + (data['partMissing'] || \"\")\n\t\t\t\t\t\t\t+ \"<br>Already Existed: \" + (data['exists'] || \"\")\n\t\t\t\t\t\t\t+ \"<br>Connection error: \" + (data[\"noCon\"] || \"\")\n\t\t\t\t\t\t\t+ \"<br>Canceled: \" + (data['canceled'] || \"\"));\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\t// show the first instance of the word in context\n\t\t\t\t\tmoveContext(0);\n\t\t\t\t\t\n\t\t\t\t\tfinishProcessingPDF();\n\t\t\t\t\t\n\t\t\t\t}, \"json\").fail(function(){\n\t\t\t\t\t\t// called after a fatal error\n\t\t\t\t\t\tprogress.text(\"Network or Internal Error while connecting to server. Check with the developers!\");\n\t\t\t\t\t\tfinishProcessingPDF();\n\t\t\t\t\t});\n\t\t\n\t\t// start allowing cancelation\n\t\t$(\"#cancelUploadButton\").show();\n\t\t\n\t\t// start updating the progress bar\n\t\tprogressTimer = setInterval(function() {\n\t\t\t$.get(\"backend.php\",\n\t\t\t\t\t{'loginInfo': {\"allowed\": true, 'user': 'me'}, \"progress\": true},\n\t\t\t\t\tfunction(data, status, jqXHR) {\n\t\t\t\t\t\tvar output = data['progress'];\n\t\t\t\t\t\tif(!output || output[\"position\"] < maxProgress) {\n\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tmaxProgress = output[\"position\"];\n\t\t\t\t\t\tprogress.text(\"Adding definition: \" + output[\"position\"] + \" / \" + output['length']);\n\t\t\t\t\t}, \"json\");\n\t\t}, 1000);\n\t});\n}", "static mapDocument(document) {\n if (!document.exists) {\n return null;\n }\n\n const item = Object.assign({}, document.data(), {\n id: document.id,\n });\n\n this.replaceAllTimestampToDate(item);\n\n return item;\n }", "function onDocumentSaved(event, document) {\n\n\t\t// check if the document was truly saved\n\t\tif (document.file.isDirty) {\n\t\t\treturn;\n\t\t}\n\n\t\t// check if it was a .less document\n\t\tvar path = document.file.fullPath;\n\t\tif (path.substr(path.length - 5, 5) === \".less\") {\n\n\t\t\t// connect to the node server\n\t\t\tloadNodeModule(\"LessCompiler\", function (err, compiler) {\n\t\t\t\tif (err) {\n\t\t\t\t\tconsole.error(err);\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\tcompiler.compile(path).done(onCompileSuccess).fail(onCompileError);\n\t\t\t});\n\n\t\t}\n\t}", "function enqueueDocument(doc, cb) {\n var message = {\n \"requestType\": constants.queues.action.GET_DOCUMENT,\n \"data\": {\n \"docId\": doc.docId,\n \"sourceId\": doc.sourceId\n }\n };\n\n return queueOut.sendMessage(message, function (err) {\n if (error) {\n console.error('There was an error queuing a document.');\n return cb(err);\n }\n\n // Test Dependency:\n // The following message is used as part of E2E testing\n console.info('Queued document %s from source %s', doc.docId, doc.sourceId)\n return cb();\n });\n }", "function parseDoc(doc, newEdits) {\n\n var nRevNum;\n var newRevId;\n var revInfo;\n var opts = {status: 'available'};\n if (doc._deleted) {\n opts.deleted = true;\n }\n\n if (newEdits) {\n if (!doc._id) {\n doc._id = uuid();\n }\n newRevId = uuid(32, 16).toLowerCase();\n if (doc._rev) {\n revInfo = parseRevisionInfo(doc._rev);\n if (revInfo.error) {\n return revInfo;\n }\n doc._rev_tree = [{\n pos: revInfo.prefix,\n ids: [revInfo.id, {status: 'missing'}, [[newRevId, opts, []]]]\n }];\n nRevNum = revInfo.prefix + 1;\n } else {\n doc._rev_tree = [{\n pos: 1,\n ids : [newRevId, opts, []]\n }];\n nRevNum = 1;\n }\n } else {\n if (doc._revisions) {\n doc._rev_tree = makeRevTreeFromRevisions(doc._revisions, opts);\n nRevNum = doc._revisions.start;\n newRevId = doc._revisions.ids[0];\n }\n if (!doc._rev_tree) {\n revInfo = parseRevisionInfo(doc._rev);\n if (revInfo.error) {\n return revInfo;\n }\n nRevNum = revInfo.prefix;\n newRevId = revInfo.id;\n doc._rev_tree = [{\n pos: nRevNum,\n ids: [newRevId, opts, []]\n }];\n }\n }\n\n invalidIdError(doc._id);\n\n doc._rev = nRevNum + '-' + newRevId;\n\n var result = {metadata : {}, data : {}};\n for (var key in doc) {\n /* istanbul ignore else */\n if (Object.prototype.hasOwnProperty.call(doc, key)) {\n var specialKey = key[0] === '_';\n if (specialKey && !reservedWords[key]) {\n var error = createError(DOC_VALIDATION, key);\n error.message = DOC_VALIDATION.message + ': ' + key;\n throw error;\n } else if (specialKey && !dataWords[key]) {\n result.metadata[key.slice(1)] = doc[key];\n } else {\n result.data[key] = doc[key];\n }\n }\n }\n return result;\n}", "function parseDoc(doc, newEdits) {\n\n var nRevNum;\n var newRevId;\n var revInfo;\n var opts = {status: 'available'};\n if (doc._deleted) {\n opts.deleted = true;\n }\n\n if (newEdits) {\n if (!doc._id) {\n doc._id = uuid();\n }\n newRevId = uuid(32, 16).toLowerCase();\n if (doc._rev) {\n revInfo = parseRevisionInfo(doc._rev);\n if (revInfo.error) {\n return revInfo;\n }\n doc._rev_tree = [{\n pos: revInfo.prefix,\n ids: [revInfo.id, {status: 'missing'}, [[newRevId, opts, []]]]\n }];\n nRevNum = revInfo.prefix + 1;\n } else {\n doc._rev_tree = [{\n pos: 1,\n ids : [newRevId, opts, []]\n }];\n nRevNum = 1;\n }\n } else {\n if (doc._revisions) {\n doc._rev_tree = makeRevTreeFromRevisions(doc._revisions, opts);\n nRevNum = doc._revisions.start;\n newRevId = doc._revisions.ids[0];\n }\n if (!doc._rev_tree) {\n revInfo = parseRevisionInfo(doc._rev);\n if (revInfo.error) {\n return revInfo;\n }\n nRevNum = revInfo.prefix;\n newRevId = revInfo.id;\n doc._rev_tree = [{\n pos: nRevNum,\n ids: [newRevId, opts, []]\n }];\n }\n }\n\n invalidIdError(doc._id);\n\n doc._rev = nRevNum + '-' + newRevId;\n\n var result = {metadata : {}, data : {}};\n for (var key in doc) {\n /* istanbul ignore else */\n if (Object.prototype.hasOwnProperty.call(doc, key)) {\n var specialKey = key[0] === '_';\n if (specialKey && !reservedWords[key]) {\n var error = createError(DOC_VALIDATION, key);\n error.message = DOC_VALIDATION.message + ': ' + key;\n throw error;\n } else if (specialKey && !dataWords[key]) {\n result.metadata[key.slice(1)] = doc[key];\n } else {\n result.data[key] = doc[key];\n }\n }\n }\n return result;\n}", "function parseDoc(doc, newEdits) {\n\n var nRevNum;\n var newRevId;\n var revInfo;\n var opts = {status: 'available'};\n if (doc._deleted) {\n opts.deleted = true;\n }\n\n if (newEdits) {\n if (!doc._id) {\n doc._id = uuid();\n }\n newRevId = uuid(32, 16).toLowerCase();\n if (doc._rev) {\n revInfo = parseRevisionInfo(doc._rev);\n if (revInfo.error) {\n return revInfo;\n }\n doc._rev_tree = [{\n pos: revInfo.prefix,\n ids: [revInfo.id, {status: 'missing'}, [[newRevId, opts, []]]]\n }];\n nRevNum = revInfo.prefix + 1;\n } else {\n doc._rev_tree = [{\n pos: 1,\n ids : [newRevId, opts, []]\n }];\n nRevNum = 1;\n }\n } else {\n if (doc._revisions) {\n doc._rev_tree = makeRevTreeFromRevisions(doc._revisions, opts);\n nRevNum = doc._revisions.start;\n newRevId = doc._revisions.ids[0];\n }\n if (!doc._rev_tree) {\n revInfo = parseRevisionInfo(doc._rev);\n if (revInfo.error) {\n return revInfo;\n }\n nRevNum = revInfo.prefix;\n newRevId = revInfo.id;\n doc._rev_tree = [{\n pos: nRevNum,\n ids: [newRevId, opts, []]\n }];\n }\n }\n\n invalidIdError(doc._id);\n\n doc._rev = nRevNum + '-' + newRevId;\n\n var result = {metadata : {}, data : {}};\n for (var key in doc) {\n /* istanbul ignore else */\n if (Object.prototype.hasOwnProperty.call(doc, key)) {\n var specialKey = key[0] === '_';\n if (specialKey && !reservedWords[key]) {\n var error = createError(DOC_VALIDATION, key);\n error.message = DOC_VALIDATION.message + ': ' + key;\n throw error;\n } else if (specialKey && !dataWords[key]) {\n result.metadata[key.slice(1)] = doc[key];\n } else {\n result.data[key] = doc[key];\n }\n }\n }\n return result;\n}", "function parseDoc(doc, newEdits) {\n\n var nRevNum;\n var newRevId;\n var revInfo;\n var opts = {status: 'available'};\n if (doc._deleted) {\n opts.deleted = true;\n }\n\n if (newEdits) {\n if (!doc._id) {\n doc._id = uuid();\n }\n newRevId = uuid(32, 16).toLowerCase();\n if (doc._rev) {\n revInfo = parseRevisionInfo(doc._rev);\n if (revInfo.error) {\n return revInfo;\n }\n doc._rev_tree = [{\n pos: revInfo.prefix,\n ids: [revInfo.id, {status: 'missing'}, [[newRevId, opts, []]]]\n }];\n nRevNum = revInfo.prefix + 1;\n } else {\n doc._rev_tree = [{\n pos: 1,\n ids : [newRevId, opts, []]\n }];\n nRevNum = 1;\n }\n } else {\n if (doc._revisions) {\n doc._rev_tree = makeRevTreeFromRevisions(doc._revisions, opts);\n nRevNum = doc._revisions.start;\n newRevId = doc._revisions.ids[0];\n }\n if (!doc._rev_tree) {\n revInfo = parseRevisionInfo(doc._rev);\n if (revInfo.error) {\n return revInfo;\n }\n nRevNum = revInfo.prefix;\n newRevId = revInfo.id;\n doc._rev_tree = [{\n pos: nRevNum,\n ids: [newRevId, opts, []]\n }];\n }\n }\n\n invalidIdError(doc._id);\n\n doc._rev = nRevNum + '-' + newRevId;\n\n var result = {metadata : {}, data : {}};\n for (var key in doc) {\n /* istanbul ignore else */\n if (Object.prototype.hasOwnProperty.call(doc, key)) {\n var specialKey = key[0] === '_';\n if (specialKey && !reservedWords[key]) {\n var error = createError(DOC_VALIDATION, key);\n error.message = DOC_VALIDATION.message + ': ' + key;\n throw error;\n } else if (specialKey && !dataWords[key]) {\n result.metadata[key.slice(1)] = doc[key];\n } else {\n result.data[key] = doc[key];\n }\n }\n }\n return result;\n}", "function parseDoc(doc, newEdits) {\n\n var nRevNum;\n var newRevId;\n var revInfo;\n var opts = {status: 'available'};\n if (doc._deleted) {\n opts.deleted = true;\n }\n\n if (newEdits) {\n if (!doc._id) {\n doc._id = uuid();\n }\n newRevId = uuid(32, 16).toLowerCase();\n if (doc._rev) {\n revInfo = parseRevisionInfo(doc._rev);\n if (revInfo.error) {\n return revInfo;\n }\n doc._rev_tree = [{\n pos: revInfo.prefix,\n ids: [revInfo.id, {status: 'missing'}, [[newRevId, opts, []]]]\n }];\n nRevNum = revInfo.prefix + 1;\n } else {\n doc._rev_tree = [{\n pos: 1,\n ids : [newRevId, opts, []]\n }];\n nRevNum = 1;\n }\n } else {\n if (doc._revisions) {\n doc._rev_tree = makeRevTreeFromRevisions(doc._revisions, opts);\n nRevNum = doc._revisions.start;\n newRevId = doc._revisions.ids[0];\n }\n if (!doc._rev_tree) {\n revInfo = parseRevisionInfo(doc._rev);\n if (revInfo.error) {\n return revInfo;\n }\n nRevNum = revInfo.prefix;\n newRevId = revInfo.id;\n doc._rev_tree = [{\n pos: nRevNum,\n ids: [newRevId, opts, []]\n }];\n }\n }\n\n invalidIdError(doc._id);\n\n doc._rev = nRevNum + '-' + newRevId;\n\n var result = {metadata : {}, data : {}};\n for (var key in doc) {\n /* istanbul ignore else */\n if (Object.prototype.hasOwnProperty.call(doc, key)) {\n var specialKey = key[0] === '_';\n if (specialKey && !reservedWords[key]) {\n var error = createError(DOC_VALIDATION, key);\n error.message = DOC_VALIDATION.message + ': ' + key;\n throw error;\n } else if (specialKey && !dataWords[key]) {\n result.metadata[key.slice(1)] = doc[key];\n } else {\n result.data[key] = doc[key];\n }\n }\n }\n return result;\n}", "function parseDoc(doc, newEdits) {\n\n var nRevNum;\n var newRevId;\n var revInfo;\n var opts = {status: 'available'};\n if (doc._deleted) {\n opts.deleted = true;\n }\n\n if (newEdits) {\n if (!doc._id) {\n doc._id = uuid();\n }\n newRevId = uuid(32, 16).toLowerCase();\n if (doc._rev) {\n revInfo = parseRevisionInfo(doc._rev);\n if (revInfo.error) {\n return revInfo;\n }\n doc._rev_tree = [{\n pos: revInfo.prefix,\n ids: [revInfo.id, {status: 'missing'}, [[newRevId, opts, []]]]\n }];\n nRevNum = revInfo.prefix + 1;\n } else {\n doc._rev_tree = [{\n pos: 1,\n ids : [newRevId, opts, []]\n }];\n nRevNum = 1;\n }\n } else {\n if (doc._revisions) {\n doc._rev_tree = makeRevTreeFromRevisions(doc._revisions, opts);\n nRevNum = doc._revisions.start;\n newRevId = doc._revisions.ids[0];\n }\n if (!doc._rev_tree) {\n revInfo = parseRevisionInfo(doc._rev);\n if (revInfo.error) {\n return revInfo;\n }\n nRevNum = revInfo.prefix;\n newRevId = revInfo.id;\n doc._rev_tree = [{\n pos: nRevNum,\n ids: [newRevId, opts, []]\n }];\n }\n }\n\n invalidIdError(doc._id);\n\n doc._rev = nRevNum + '-' + newRevId;\n\n var result = {metadata : {}, data : {}};\n for (var key in doc) {\n /* istanbul ignore else */\n if (Object.prototype.hasOwnProperty.call(doc, key)) {\n var specialKey = key[0] === '_';\n if (specialKey && !reservedWords[key]) {\n var error = createError(DOC_VALIDATION, key);\n error.message = DOC_VALIDATION.message + ': ' + key;\n throw error;\n } else if (specialKey && !dataWords[key]) {\n result.metadata[key.slice(1)] = doc[key];\n } else {\n result.data[key] = doc[key];\n }\n }\n }\n return result;\n}", "function DbRemoteDocument(\n /**\r\n * Set to an instance of DbUnknownDocument if the data for a document is\r\n * not known, but it is known that a document exists at the specified\r\n * version (e.g. it had a successful update applied to it)\r\n */\n unknownDocument,\n /**\r\n * Set to an instance of a DbNoDocument if it is known that no document\r\n * exists.\r\n */\n noDocument,\n /**\r\n * Set to an instance of a Document if there's a cached version of the\r\n * document.\r\n */\n document,\n /**\r\n * Documents that were written to the remote document store based on\r\n * a write acknowledgment are marked with `hasCommittedMutations`. These\r\n * documents are potentially inconsistent with the backend's copy and use\r\n * the write's commit version as their document version.\r\n */\n hasCommittedMutations,\n /**\r\n * When the document was read from the backend. Undefined for data written\r\n * prior to schema version 9.\r\n */\n readTime,\n /**\r\n * The path of the collection this document is part of. Undefined for data\r\n * written prior to schema version 9.\r\n */\n parentPath) {\n this.unknownDocument = unknownDocument;\n this.noDocument = noDocument;\n this.document = document;\n this.hasCommittedMutations = hasCommittedMutations;\n this.readTime = readTime;\n this.parentPath = parentPath;\n }", "function sync() {\n syncDocuments({\n uri: {\n fsPath: path.join(rootPath, dir)\n }\n });\n }", "function DocumentCreated(doc) {\n ReceiveUpdate(doc);\n}", "static createDocumentWithBlob(parentDoc, docParams, file) {\n\n let properties = this.properties;\n\n return new Promise(\n function(resolve, reject) {\n\n let uploadedBlob = null;\n\n // If file not empty, process blob and upload\n if (file) {\n let blob = new Nuxeo.Blob({\n content: file,\n name: file.name,\n mimeType: file.type,\n size: file.size\n });\n\n properties.client\n .batchUpload()\n .upload(blob)\n .then((res) => {\n if (res) {\n // Create document\n properties.client\n .operation('Document.Create')\n .params(docParams)\n .input(parentDoc)\n .execute()\n .then((newDoc) => {\n // If blob uploaded, attach to created document\n if (res != null) {\n properties.client.operation('Blob.AttachOnDocument')\n .param('document', newDoc.uid)\n .input(res.blob)\n .execute({ schemas: ['dublincore', 'file']});\n\n // Finally, resolve create document\n resolve(newDoc);\n }\n })\n .catch((error) => { reject('Could not create document.'); } );\n } else {\n reject('No ' + type +' found');\n }\n }).catch((error) => { reject('Could not upload file.'); } );\n }\n });\n }", "function vlerDasDocumentToVPR(document, fullHtml, vlerDocType, requestStampTime, compressed) {\n var vprVlerDocument = {};\n vprVlerDocument.kind = vlerDocType;\n vprVlerDocument.name = _.get(document, 'resource.description');\n vprVlerDocument.uid = document.uid;\n vprVlerDocument.summary = _.get(document, 'resource.description');\n vprVlerDocument.pid = document.pid;\n vprVlerDocument.documentUniqueId = _.get(document, 'resource.masterIdentifier.Value');\n vprVlerDocument.homeCommunityId = _.get(document, 'resource.masterIdentifier.system');\n vprVlerDocument.stampTime = requestStampTime;\n vprVlerDocument.fullHtml = fullHtml;\n if (compressed) {\n vprVlerDocument.compressed = compressed;\n }\n\n //Drop timezone offset from creationTime\n let creationTimeWithOffset = _.get(document, 'resource.created', '');\n vprVlerDocument.creationTime = moment(creationTimeWithOffset, 'YYYYMMDDHHmmss[ZZ]').format('YYYYMMDDHHmmss');\n\n vprVlerDocument.authorList = getAuthorListFromFHIRContainedResources(document);\n\n return vprVlerDocument;\n}", "textDocumentDidChange(params) {\n return __awaiter(this, void 0, void 0, function* () {\n const uri = util_1.normalizeUri(params.textDocument.uri);\n let text;\n for (const change of params.contentChanges) {\n if (change.range || change.rangeLength) {\n throw new Error('incremental updates in textDocument/didChange not supported for file ' + uri);\n }\n text = change.text;\n }\n if (!text) {\n return;\n }\n this.projectManager.didChange(uri, text);\n yield new Promise(resolve => setTimeout(resolve, 200));\n this._publishDiagnostics(uri);\n });\n }", "function docTrack() {\n var response = {};\n // If a new doc is loaded\n if (getFileId() != currentDoc) {\n currentDoc = getFileId();\n currentTags = getTags();\n response['doc_load'] = true;\n response['status'] = getTags();\n response['file_id'] = getFileId();\n response['timestamp'] = new Date().getTime();\n response['project_id'] = getProjectId();\n } else {\n // If there is no change in the doc tags\n if (currentTags === getTags()) {\n // do nothing if tags don't change\n } else {\n // Else the document is the same but the tags have changed\n\n // variables to store tag changes\n var tag_added = [];\n var tag_removed = [];\n\n // Compares the tags on the doc to the last recorded set of tags for this doc to find what tags were added\n getTags().filter(function(tag) {\n if (currentTags.indexOf(tag) < 0) {\n tag_added.push(tag);\n }\n });\n\n // Compares the last recorded tags for this doc to the tags on the doc to find what tags were removed \n currentTags.filter(function(tag){\n if (getTags().indexOf(tag) < 0) {\n tag_removed.push(tag);\n }\n });\n\n // Logs what tags were added/removed\n if (tag_added.length > 0) {\n response['tag_added'] = tag_added;\n };\n\n if (tag_removed.length > 0) {\n response['tag_removed'] = tag_removed;\n };\n\n response['status'] = getTags();\n response['file_id'] = getFileId();\n response['timestamp'] = new Date().getTime();\n response['project_id'] = getProjectId();\n };\n };\n if (response.hasOwnProperty('file_id') > 0) {\n storeLog(JSON.stringify(response));\n console.log(JSON.stringify(response));\n }\n currentTags = getTags();\n}", "function parseDoc(doc, newEdits) {\n\t\n\t var nRevNum;\n\t var newRevId;\n\t var revInfo;\n\t var opts = {status: 'available'};\n\t if (doc._deleted) {\n\t opts.deleted = true;\n\t }\n\t\n\t if (newEdits) {\n\t if (!doc._id) {\n\t doc._id = uuid();\n\t }\n\t newRevId = uuid(32, 16).toLowerCase();\n\t if (doc._rev) {\n\t revInfo = parseRevisionInfo(doc._rev);\n\t if (revInfo.error) {\n\t return revInfo;\n\t }\n\t doc._rev_tree = [{\n\t pos: revInfo.prefix,\n\t ids: [revInfo.id, {status: 'missing'}, [[newRevId, opts, []]]]\n\t }];\n\t nRevNum = revInfo.prefix + 1;\n\t } else {\n\t doc._rev_tree = [{\n\t pos: 1,\n\t ids : [newRevId, opts, []]\n\t }];\n\t nRevNum = 1;\n\t }\n\t } else {\n\t if (doc._revisions) {\n\t doc._rev_tree = makeRevTreeFromRevisions(doc._revisions, opts);\n\t nRevNum = doc._revisions.start;\n\t newRevId = doc._revisions.ids[0];\n\t }\n\t if (!doc._rev_tree) {\n\t revInfo = parseRevisionInfo(doc._rev);\n\t if (revInfo.error) {\n\t return revInfo;\n\t }\n\t nRevNum = revInfo.prefix;\n\t newRevId = revInfo.id;\n\t doc._rev_tree = [{\n\t pos: nRevNum,\n\t ids: [newRevId, opts, []]\n\t }];\n\t }\n\t }\n\t\n\t invalidIdError(doc._id);\n\t\n\t doc._rev = nRevNum + '-' + newRevId;\n\t\n\t var result = {metadata : {}, data : {}};\n\t for (var key in doc) {\n\t /* istanbul ignore else */\n\t if (Object.prototype.hasOwnProperty.call(doc, key)) {\n\t var specialKey = key[0] === '_';\n\t if (specialKey && !reservedWords[key]) {\n\t var error = createError(DOC_VALIDATION, key);\n\t error.message = DOC_VALIDATION.message + ': ' + key;\n\t throw error;\n\t } else if (specialKey && !dataWords[key]) {\n\t result.metadata[key.slice(1)] = doc[key];\n\t } else {\n\t result.data[key] = doc[key];\n\t }\n\t }\n\t }\n\t return result;\n\t}", "function analyze_document(document) {\n add_form_buttons(document);\n document_submit_catcher(document);\n }", "function UploadProcess(serverIP, fileName, dbObj) {\r\n\r\n\t// Delete the doc before insert\r\n\tDBOperationRemoveDocByNode(serverIP, fileName, dbObj);\r\n\r\n\t// Parse the doc to MongoD\r\n\tDBOperationParseETLToMongoD(serverIP, fileName, dbObj);\r\n\r\n\t//Query count\r\n\t//DBOperationFindDoc(serverIP, fileName, dbObj);\r\n}", "function updateDoc(cm, from, to, newText, selUpdate, origin) {\n // Possibly split or suppress the update based on the presence\n // of read-only spans in its range.\n var split = sawReadOnlySpans &&\n removeReadOnlyRanges(cm.view.doc, from, to);\n if (split) {\n for (var i = split.length - 1; i >= 1; --i)\n updateDocInner(cm, split[i].from, split[i].to, [\"\"], origin);\n if (split.length)\n return updateDocInner(cm, split[0].from, split[0].to, newText, selUpdate, origin);\n } else {\n return updateDocInner(cm, from, to, newText, selUpdate, origin);\n }\n }", "function updateDoc(cm, from, to, newText, selUpdate, origin) {\n // Possibly split or suppress the update based on the presence\n // of read-only spans in its range.\n var split = sawReadOnlySpans &&\n removeReadOnlyRanges(cm.view.doc, from, to);\n if (split) {\n for (var i = split.length - 1; i >= 1; --i)\n updateDocInner(cm, split[i].from, split[i].to, [\"\"], origin);\n if (split.length)\n return updateDocInner(cm, split[0].from, split[0].to, newText, selUpdate, origin);\n } else {\n return updateDocInner(cm, from, to, newText, selUpdate, origin);\n }\n }", "function updateDoc(cm, from, to, newText, selUpdate, origin) {\n // Possibly split or suppress the update based on the presence\n // of read-only spans in its range.\n var split = sawReadOnlySpans &&\n removeReadOnlyRanges(cm.view.doc, from, to);\n if (split) {\n for (var i = split.length - 1; i >= 1; --i)\n updateDocInner(cm, split[i].from, split[i].to, [\"\"], origin);\n if (split.length)\n return updateDocInner(cm, split[0].from, split[0].to, newText, selUpdate, origin);\n } else {\n return updateDocInner(cm, from, to, newText, selUpdate, origin);\n }\n }", "function tryUpdate(document) {\r\n\r\n // DocumentDB supports optimistic concurrency control via HTTP ETag.\r\n var requestOptions = {etag: document._etag};\r\n\r\n // Update operators.\r\n inc(document, update);\r\n mul(document, update);\r\n rename(document, update);\r\n set(document, update);\r\n unset(document, update);\r\n min(document, update);\r\n max(document, update);\r\n currentDate(document, update);\r\n addToSet(document, update);\r\n pop(document, update);\r\n push(document, update);\r\n\r\n // Update the document.\r\n var isAccepted = collection.replaceDocument(document._self, document, requestOptions, function (err, updatedDocument, responseOptions) {\r\n if (err) throw err;\r\n\r\n // If we have successfully updated the document - return it in the response body.\r\n response.setBody(updatedDocument);\r\n });\r\n\r\n // If we hit execution bounds - throw an exception.\r\n if (!isAccepted) {\r\n throw new Error(\"The stored procedure timed out.\");\r\n }\r\n }", "ProcessDocChanges(documents) {\n // process document changes to build a list of documents for us to fetch in batches\n const docRequest = [];\n\n documents.forEach((doc) => {\n if (doc.deleted) {\n // TODO - remove document from database?\n\n // emit document deleted event\n this.emit('deleted', doc);\n } else if (doc.changes !== undefined && doc.changes.length) {\n let AlreadyHaveChange = false;\n docRequest.forEach((docRequested) => {\n if (docRequested.id === doc.id) {\n AlreadyHaveChange = true;\n\n // compare revision numbers\n if (RevisionToInt(doc.changes[0].rev) > RevisionToInt(docRequested.rev)) {\n // if this revision is greater than our existing one, replace\n docRequested.rev = doc.changes[0].rev;\n }\n\n // don't break out of for-loop in case there are even more revision in the changelist\n }\n });\n\n // push new change if we haven't already got one for this document ID in our list\n if (!AlreadyHaveChange) {\n docRequest.push({\n atts_since: null,\n rev: doc.changes[0].rev,\n id: doc.id,\n });\n }\n }\n });\n\n if (docRequest.length === 0) {\n this.Log('Extracted 0 document changes, skipping fetch');\n\n return Promise.resolve();\n }\n this.Log(`Extracted ${docRequest.length} document changes to fetch`);\n\n // filter out document revisions we already have\n return this.FilterAlreadyGotRevisions(docRequest).then((filteredDocRequest) => {\n this.Log(`After filtering on already-got revisions, left with ${filteredDocRequest.length} documents to fetch`);\n\n // split document requests into batches of docFetchBatchSize size\n const batches = [];\n while (filteredDocRequest.length > 0) {\n batches.push(filteredDocRequest.splice(0, Math.min(docFetchBatchSize, filteredDocRequest.length)));\n }\n\n this.Log(`Split document changes into ${batches.length} batches`);\n\n // resolve promises with each batch in order\n return batches.reduce((prev, cur) => prev.then(() => this.ProcessDocChangeBatch(cur)), Promise.resolve()).then(() => Promise.resolve());\n });\n }", "trackOpenedDocument(document) {\n let uri = document.uri;\n let item = this.map.get(uri);\n if (item) {\n let fileChanged = document.version > item.version;\n item.document = document;\n item.version = document.version;\n item.opened = true;\n if (fileChanged) {\n this.makeFileExpire(uri, item);\n }\n }\n else {\n item = {\n document,\n version: document.version,\n opened: true,\n fresh: false,\n updatePromise: null\n };\n this.map.set(uri, item);\n this.afterTrackedFile(uri, item);\n }\n }", "function parseDoc(doc, newEdits) {\n\n var nRevNum;\n var newRevId;\n var revInfo;\n var opts = {status: 'available'};\n if (doc._deleted) {\n opts.deleted = true;\n }\n\n if (newEdits) {\n if (!doc._id) {\n doc._id = uuid();\n }\n newRevId = rev();\n if (doc._rev) {\n revInfo = parseRevisionInfo(doc._rev);\n if (revInfo.error) {\n return revInfo;\n }\n doc._rev_tree = [{\n pos: revInfo.prefix,\n ids: [revInfo.id, {status: 'missing'}, [[newRevId, opts, []]]]\n }];\n nRevNum = revInfo.prefix + 1;\n } else {\n doc._rev_tree = [{\n pos: 1,\n ids : [newRevId, opts, []]\n }];\n nRevNum = 1;\n }\n } else {\n if (doc._revisions) {\n doc._rev_tree = makeRevTreeFromRevisions(doc._revisions, opts);\n nRevNum = doc._revisions.start;\n newRevId = doc._revisions.ids[0];\n }\n if (!doc._rev_tree) {\n revInfo = parseRevisionInfo(doc._rev);\n if (revInfo.error) {\n return revInfo;\n }\n nRevNum = revInfo.prefix;\n newRevId = revInfo.id;\n doc._rev_tree = [{\n pos: nRevNum,\n ids: [newRevId, opts, []]\n }];\n }\n }\n\n invalidIdError(doc._id);\n\n doc._rev = nRevNum + '-' + newRevId;\n\n var result = {metadata : {}, data : {}};\n for (var key in doc) {\n /* istanbul ignore else */\n if (Object.prototype.hasOwnProperty.call(doc, key)) {\n var specialKey = key[0] === '_';\n if (specialKey && !reservedWords[key]) {\n var error = createError(DOC_VALIDATION, key);\n error.message = DOC_VALIDATION.message + ': ' + key;\n throw error;\n } else if (specialKey && !dataWords[key]) {\n result.metadata[key.slice(1)] = doc[key];\n } else {\n result.data[key] = doc[key];\n }\n }\n }\n return result;\n}", "function parseDoc(doc, newEdits) {\n\n var nRevNum;\n var newRevId;\n var revInfo;\n var opts = {status: 'available'};\n if (doc._deleted) {\n opts.deleted = true;\n }\n\n if (newEdits) {\n if (!doc._id) {\n doc._id = uuid();\n }\n newRevId = rev();\n if (doc._rev) {\n revInfo = parseRevisionInfo(doc._rev);\n if (revInfo.error) {\n return revInfo;\n }\n doc._rev_tree = [{\n pos: revInfo.prefix,\n ids: [revInfo.id, {status: 'missing'}, [[newRevId, opts, []]]]\n }];\n nRevNum = revInfo.prefix + 1;\n } else {\n doc._rev_tree = [{\n pos: 1,\n ids : [newRevId, opts, []]\n }];\n nRevNum = 1;\n }\n } else {\n if (doc._revisions) {\n doc._rev_tree = makeRevTreeFromRevisions(doc._revisions, opts);\n nRevNum = doc._revisions.start;\n newRevId = doc._revisions.ids[0];\n }\n if (!doc._rev_tree) {\n revInfo = parseRevisionInfo(doc._rev);\n if (revInfo.error) {\n return revInfo;\n }\n nRevNum = revInfo.prefix;\n newRevId = revInfo.id;\n doc._rev_tree = [{\n pos: nRevNum,\n ids: [newRevId, opts, []]\n }];\n }\n }\n\n invalidIdError(doc._id);\n\n doc._rev = nRevNum + '-' + newRevId;\n\n var result = {metadata : {}, data : {}};\n for (var key in doc) {\n /* istanbul ignore else */\n if (Object.prototype.hasOwnProperty.call(doc, key)) {\n var specialKey = key[0] === '_';\n if (specialKey && !reservedWords[key]) {\n var error = createError(DOC_VALIDATION, key);\n error.message = DOC_VALIDATION.message + ': ' + key;\n throw error;\n } else if (specialKey && !dataWords[key]) {\n result.metadata[key.slice(1)] = doc[key];\n } else {\n result.data[key] = doc[key];\n }\n }\n }\n return result;\n}", "function handlePOObject(filename, po) {\n // Remove previous results\n $(\"#results\").empty();\n // Go through PO file and try to auto-translate untranslated strings.\n let newPO = handleTranslations(po);\n let autoTranslatedCount = newPO.translations[''].length;\n $(\"#progressMsg\").text(`Auto-translated ${autoTranslatedCount} strings`)\n // Export to new PO\n downloadFile(new POExporter(newPO).compile(),\n filename + \".translated.po\",\n 'text/x-gettext-translation')\n}", "analyzeIdDocumentAsync(...args) {\n let operationSpec;\n let operationArguments;\n if (args[0] === \"application/pdf\" ||\n args[0] === \"image/bmp\" ||\n args[0] === \"image/jpeg\" ||\n args[0] === \"image/png\" ||\n args[0] === \"image/tiff\") {\n operationSpec = analyzeIdDocumentAsync$binaryOperationSpec;\n operationArguments = {\n contentType: args[0],\n fileStream: args[1],\n options: args[2]\n };\n }\n else if (args[0] === \"application/json\") {\n operationSpec = analyzeIdDocumentAsync$jsonOperationSpec;\n operationArguments = { contentType: args[0], options: args[1] };\n }\n else {\n throw new TypeError(`\"contentType\" must be a valid value but instead was \"${args[0]}\".`);\n }\n operationArguments.options = coreHttp.operationOptionsToRequestOptionsBase(operationArguments.options || {});\n return this.sendOperationRequest(operationArguments, operationSpec);\n }" ]
[ "0.7181027", "0.71268046", "0.70949113", "0.70949113", "0.65690374", "0.6545865", "0.65238076", "0.65238076", "0.65238076", "0.65238076", "0.65238076", "0.65238076", "0.6499528", "0.6499528", "0.58608776", "0.53824717", "0.537839", "0.5259523", "0.5124504", "0.5109611", "0.5096787", "0.50617844", "0.5047029", "0.5046043", "0.5032744", "0.50087035", "0.49979407", "0.4983537", "0.49826384", "0.49812096", "0.49676412", "0.49576008", "0.49457097", "0.4922188", "0.49208447", "0.48935854", "0.4890603", "0.4885721", "0.48735064", "0.48735064", "0.48604536", "0.48126552", "0.4812276", "0.4812276", "0.4812276", "0.4801647", "0.47820294", "0.47820294", "0.47820294", "0.47820294", "0.47820294", "0.478033", "0.47746253", "0.47664282", "0.4766407", "0.47662264", "0.47494644", "0.47480774", "0.47422335", "0.47390163", "0.47198832", "0.47124833", "0.4688307", "0.46753743", "0.4672227", "0.46564257", "0.46461955", "0.46304172", "0.4624763", "0.461827", "0.461827", "0.461827", "0.461827", "0.461827", "0.461827", "0.46070883", "0.4601455", "0.46006075", "0.45978725", "0.45915288", "0.45888007", "0.45884174", "0.45688576", "0.45603907", "0.45560107", "0.4554513", "0.4554513", "0.4554513", "0.45386854", "0.4538531", "0.45362902", "0.4533723", "0.4533723", "0.4531298", "0.4523432" ]
0.70455825
9
Check if `func` is a constructor.
function newable(value) { return typeof value === 'function' && keys(value.prototype) }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function isConstructor(name, func) {\n return name[0] == name[0].toUpperCase();\n }", "function isCtor(constr) {\n return constr && !!constr.CONSTRUCTOR___;\n }", "function IsConstructor(o) {\n // Hacks for Safari 7 TypedArray XXXConstructor objects\n if (/Constructor/.test(Object.prototype.toString.call(o))) return true;\n if (/Function/.test(Object.prototype.toString.call(o))) return true;\n // TODO: Can this be improved on?\n return typeof o === 'function';\n }", "function isConstructor(node) {\n var _a;\n return (((_a = node) === null || _a === void 0 ? void 0 : _a.type) === experimental_utils_1.AST_NODE_TYPES.MethodDefinition &&\n node.kind === 'constructor');\n}", "function getConstructorClassCheck(obj) {\n var ctorStr = String(obj);\n return function(obj) {\n return String(obj.constructor) === ctorStr;\n };\n }", "function getConstructorClassCheck(obj) {\n var ctorStr = String(obj);\n return function(obj) {\n return String(obj.constructor) === ctorStr;\n };\n }", "function isConstructor(node) {\n return ((node === null || node === void 0 ? void 0 : node.type) === ts_estree_1.AST_NODE_TYPES.MethodDefinition &&\n node.kind === 'constructor');\n}", "function IsConstructor(argument) { // eslint-disable-line no-unused-vars\n\t// 1. If Type(argument) is not Object, return false.\n\tif (Type(argument) !== 'object') {\n\t\treturn false;\n\t}\n\t// 2. If argument has a [[Construct]] internal method, return true.\n\t// 3. Return false.\n\n\t// Polyfill.io - `new argument` is the only way to truly test if a function is a constructor.\n\t// We choose to not use`new argument` because the argument could have side effects when called.\n\t// Instead we check to see if the argument is a function and if it has a prototype.\n\t// Arrow functions do not have a [[Construct]] internal method, nor do they have a prototype.\n\treturn typeof argument === 'function' && !!argument.prototype;\n}", "static isConstructor(structure) {\r\n return structure.kind === StructureKind_1.StructureKind.Constructor;\r\n }", "function IsConstructor(argument) { // eslint-disable-line no-unused-vars\n\t\t// 1. If Type(argument) is not Object, return false.\n\t\tif (Type(argument) !== 'object') {\n\t\t\treturn false;\n\t\t}\n\t\t// 2. If argument has a [[Construct]] internal method, return true.\n\t\t// 3. Return false.\n\n\t\t// Polyfill.io - `new argument` is the only way to truly test if a function is a constructor.\n\t\t// We choose to not use`new argument` because the argument could have side effects when called.\n\t\t// Instead we check to see if the argument is a function and if it has a prototype.\n\t\t// Arrow functions do not have a [[Construct]] internal method, nor do they have a prototype.\n\t\treturn typeof argument === 'function' && !!argument.prototype;\n\t}", "function IsConstructor(argument) { // eslint-disable-line no-unused-vars\n // 1. If Type(argument) is not Object, return false.\n if (Type(argument) !== 'object') {\n return false;\n }\n // 2. If argument has a [[Construct]] internal method, return true.\n // 3. Return false.\n\n // Polyfill.io - `new argument` is the only way to truly test if a function is a constructor.\n // We choose to not use`new argument` because the argument could have side effects when called.\n // Instead we check to see if the argument is a function and if it has a prototype.\n // Arrow functions do not have a [[Construct]] internal method, nor do they have a prototype.\n return typeof argument === 'function' && !!argument.prototype;\n }", "function asCtorOnly(constr) {\n if (isCtor(constr) || isFunc(constr)) {\n return constr;\n }\n enforceType(constr, 'function');\n fail(\"Untamed functions can't be called as constructors: \", constr);\n }", "function isConstructor(value) {\n if (typeof value !== \"function\") {\n return false;\n }\n\n try {\n const P = new Proxy(value, {\n construct() {\n return {};\n }\n });\n\n // eslint-disable-next-line no-new\n new P();\n\n return true;\n } catch {\n return false;\n }\n}", "function isConstructor(parent) {\n return (parent.type === typescript_estree_1.AST_NODE_TYPES.MethodDefinition &&\n parent.kind === 'constructor');\n }", "function isDirectInstanceOf(obj, ctor) {\n var constr = directConstructor(obj);\n if (constr === void 0) { return false; }\n return getFuncCategory(constr) === getFuncCategory(ctor);\n }", "function is_func(func) {\n return Object.prototype.toString.call(func) == \"[object Function]\";\n }", "function is_func(func) { return Object.prototype.toString.call(func) == \"[object Function]\"; }", "function isComponentConstructor(ctor) {\n if (!isFunction$1(ctor)) {\n return false;\n } // Fast path: LightningElement is part of the prototype chain of the constructor.\n\n\n if (ctor.prototype instanceof LightningElement) {\n return true;\n } // Slow path: LightningElement is not part of the prototype chain of the constructor, we need\n // climb up the constructor prototype chain to check in case there are circular dependencies\n // to resolve.\n\n\n let current = ctor;\n\n do {\n if (isCircularModuleDependency(current)) {\n const circularResolved = resolveCircularModuleDependency(current); // If the circular function returns itself, that's the signal that we have hit the end\n // of the proto chain, which must always be a valid base constructor.\n\n if (circularResolved === current) {\n return true;\n }\n\n current = circularResolved;\n }\n\n if (current === LightningElement) {\n return true;\n }\n } while (!isNull(current) && (current = getPrototypeOf$2(current))); // Finally return false if the LightningElement is not part of the prototype chain.\n\n\n return false;\n }", "function isComponentConstructor(ctor) {\n if (!isFunction(ctor)) {\n return false;\n } // Fast path: LightningElement is part of the prototype chain of the constructor.\n\n\n if (ctor.prototype instanceof BaseLightningElement) {\n return true;\n } // Slow path: LightningElement is not part of the prototype chain of the constructor, we need\n // climb up the constructor prototype chain to check in case there are circular dependencies\n // to resolve.\n\n\n let current = ctor;\n\n do {\n if (isCircularModuleDependency(current)) {\n const circularResolved = resolveCircularModuleDependency(current); // If the circular function returns itself, that's the signal that we have hit the end\n // of the proto chain, which must always be a valid base constructor.\n\n if (circularResolved === current) {\n return true;\n }\n\n current = circularResolved;\n }\n\n if (current === BaseLightningElement) {\n return true;\n }\n } while (!isNull(current) && (current = getPrototypeOf(current))); // Finally return false if the LightningElement is not part of the prototype chain.\n\n\n return false;\n }", "function isComponentConstructor$1(ctor) {\n if (!isFunction$2(ctor)) {\n return false;\n } // Fast path: LightningElement is part of the prototype chain of the constructor.\n\n\n if (ctor.prototype instanceof BaseLightningElement$1) {\n return true;\n } // Slow path: LightningElement is not part of the prototype chain of the constructor, we need\n // climb up the constructor prototype chain to check in case there are circular dependencies\n // to resolve.\n\n\n let current = ctor;\n\n do {\n if (isCircularModuleDependency$1(current)) {\n const circularResolved = resolveCircularModuleDependency$1(current); // If the circular function returns itself, that's the signal that we have hit the end of the proto chain,\n // which must always be a valid base constructor.\n\n if (circularResolved === current) {\n return true;\n }\n\n current = circularResolved;\n }\n\n if (current === BaseLightningElement$1) {\n return true;\n }\n } while (!isNull$1(current) && (current = getPrototypeOf$3(current))); // Finally return false if the LightningElement is not part of the prototype chain.\n\n\n return false;\n }", "function isFunction(func) {\n return (typeof func) === 'function';\n }", "function isFunc(cf) {\r\n return typeof cf === \"function\";\r\n}", "function isDelegateCtor(typeStr){return DELEGATE_CTOR.test(typeStr)||INHERITED_CLASS_WITH_DELEGATE_CTOR.test(typeStr)||INHERITED_CLASS.test(typeStr)&&!INHERITED_CLASS_WITH_CTOR.test(typeStr)}", "function isNative (Ctor) {\n return typeof Ctor === 'function' && /native code/.test(Ctor.toString())\n}", "function isNative (Ctor) {\n return typeof Ctor === 'function' && /native code/.test(Ctor.toString())\n}", "function isDelegateCtor(typeStr) {\n return ES5_DELEGATE_CTOR.test(typeStr) || ES2015_INHERITED_CLASS_WITH_DELEGATE_CTOR.test(typeStr) || ES2015_INHERITED_CLASS.test(typeStr) && !ES2015_INHERITED_CLASS_WITH_CTOR.test(typeStr);\n }", "function isFunction(func) {\n return (typeof func) === 'function';\n}", "function isFunction(func) {\n return (typeof func) === 'function';\n}", "function isDelegateCtor(typeStr) {\n return DELEGATE_CTOR.test(typeStr) || INHERITED_CLASS_WITH_DELEGATE_CTOR.test(typeStr) || INHERITED_CLASS.test(typeStr) && !INHERITED_CLASS_WITH_CTOR.test(typeStr);\n }", "function isDelegateCtor(typeStr) {\n return DELEGATE_CTOR.test(typeStr) || INHERITED_CLASS_WITH_DELEGATE_CTOR.test(typeStr) || INHERITED_CLASS.test(typeStr) && !INHERITED_CLASS_WITH_CTOR.test(typeStr);\n }", "function isDelegateCtor(typeStr) {\n return DELEGATE_CTOR.test(typeStr) || INHERITED_CLASS_WITH_DELEGATE_CTOR.test(typeStr) || INHERITED_CLASS.test(typeStr) && !INHERITED_CLASS_WITH_CTOR.test(typeStr);\n }", "function isInstanceOf(victim, constructor) {\n return victim instanceof constructor;\n}", "function getType(ctor) {\r\n const match = ctor && ctor.toString().match(/^\\s*function (\\w+)/);\r\n return match ? match[1] : '';\r\n}", "function getType(ctor) {\r\n const match = ctor && ctor.toString().match(/^\\s*function (\\w+)/);\r\n return match ? match[1] : '';\r\n}", "function getType(ctor) {\r\n const match = ctor && ctor.toString().match(/^\\s*function (\\w+)/);\r\n return match ? match[1] : '';\r\n}", "function isSynthesizedConstructor(constructor) {\n if (!constructor.body)\n return false;\n const firstStatement = constructor.body.statements[0];\n if (!firstStatement || !ts.isExpressionStatement(firstStatement))\n return false;\n return isSynthesizedSuperCall(firstStatement.expression);\n}", "function isFunction(func) {\n return typeof func === \"function\";\n}", "function isDelegateCtor(typeStr) {\n return ES5_DELEGATE_CTOR.test(typeStr) ||\n ES2015_INHERITED_CLASS_WITH_DELEGATE_CTOR.test(typeStr) ||\n (ES2015_INHERITED_CLASS.test(typeStr) && !ES2015_INHERITED_CLASS_WITH_CTOR.test(typeStr));\n}", "function isDelegateCtor(typeStr) {\n return ES5_DELEGATE_CTOR.test(typeStr) ||\n ES2015_INHERITED_CLASS_WITH_DELEGATE_CTOR.test(typeStr) ||\n (ES2015_INHERITED_CLASS.test(typeStr) && !ES2015_INHERITED_CLASS_WITH_CTOR.test(typeStr));\n}", "function isDelegateCtor(typeStr) {\n return ES5_DELEGATE_CTOR.test(typeStr) ||\n ES2015_INHERITED_CLASS_WITH_DELEGATE_CTOR.test(typeStr) ||\n (ES2015_INHERITED_CLASS.test(typeStr) && !ES2015_INHERITED_CLASS_WITH_CTOR.test(typeStr));\n}", "function isDelegateCtor(typeStr) {\n return ES5_DELEGATE_CTOR.test(typeStr) ||\n ES2015_INHERITED_CLASS_WITH_DELEGATE_CTOR.test(typeStr) ||\n (ES2015_INHERITED_CLASS.test(typeStr) && !ES2015_INHERITED_CLASS_WITH_CTOR.test(typeStr));\n}", "function isDelegateCtor(typeStr) {\n return ES5_DELEGATE_CTOR.test(typeStr) ||\n ES2015_INHERITED_CLASS_WITH_DELEGATE_CTOR.test(typeStr) ||\n (ES2015_INHERITED_CLASS.test(typeStr) && !ES2015_INHERITED_CLASS_WITH_CTOR.test(typeStr));\n}", "function isDelegateCtor(typeStr) {\n return ES5_DELEGATE_CTOR.test(typeStr) ||\n ES2015_INHERITED_CLASS_WITH_DELEGATE_CTOR.test(typeStr) ||\n (ES2015_INHERITED_CLASS.test(typeStr) && !ES2015_INHERITED_CLASS_WITH_CTOR.test(typeStr));\n}", "function isDelegateCtor(typeStr) {\n return ES5_DELEGATE_CTOR.test(typeStr) || ES2015_INHERITED_CLASS_WITH_DELEGATE_CTOR.test(typeStr) || ES2015_INHERITED_CLASS.test(typeStr) && !ES2015_INHERITED_CLASS_WITH_CTOR.test(typeStr);\n}", "function getSuperCtor(func) {\n enforceType(func, 'function');\n if (isCtor(func) || isFunc(func)) {\n var result = directConstructor(func.prototype);\n if (isCtor(result) || isFunc(result)) {\n return result;\n }\n }\n return void 0;\n }", "function instanceOf(ctor) {\n // https://github.com/Microsoft/TypeScript/issues/5101#issuecomment-145693151\n return (function (x) { return x instanceof ctor; });\n}", "function getType(ctor) {\n const match = ctor && ctor.toString().match(/^\\s*function (\\w+)/);\n return match ? match[1] : '';\n}", "function getType(ctor) {\n const match = ctor && ctor.toString().match(/^\\s*function (\\w+)/);\n return match ? match[1] : '';\n}", "function getType(ctor) {\n const match = ctor && ctor.toString().match(/^\\s*function (\\w+)/);\n return match ? match[1] : '';\n}", "function isDelegateCtor(typeStr) {\n return DELEGATE_CTOR.test(typeStr) || INHERITED_CLASS_WITH_DELEGATE_CTOR.test(typeStr) ||\n (INHERITED_CLASS.test(typeStr) && !INHERITED_CLASS_WITH_CTOR.test(typeStr));\n}", "function isDelegateCtor(typeStr) {\n return DELEGATE_CTOR.test(typeStr) || INHERITED_CLASS_WITH_DELEGATE_CTOR.test(typeStr) ||\n (INHERITED_CLASS.test(typeStr) && !INHERITED_CLASS_WITH_CTOR.test(typeStr));\n}", "function isDelegateCtor(typeStr) {\n return DELEGATE_CTOR.test(typeStr) || INHERITED_CLASS_WITH_DELEGATE_CTOR.test(typeStr) ||\n (INHERITED_CLASS.test(typeStr) && !INHERITED_CLASS_WITH_CTOR.test(typeStr));\n}", "function getType(ctor) {\n const match = ctor && ctor.toString().match(/^\\s*function (\\w+)/);\n return match ? match[1] : ctor === null ? 'null' : '';\n}", "function getType(ctor) {\n const match = ctor && ctor.toString().match(/^\\s*function (\\w+)/);\n return match ? match[1] : ctor === null ? 'null' : '';\n}", "function getType(ctor) {\n const match = ctor && ctor.toString().match(/^\\s*function (\\w+)/);\n return match ? match[1] : ctor === null ? 'null' : '';\n}", "function getType(ctor) {\n const match = ctor && ctor.toString().match(/^\\s*function (\\w+)/);\n return match ? match[1] : ctor === null ? 'null' : '';\n}", "function getType(ctor) {\n const match = ctor && ctor.toString().match(/^\\s*function (\\w+)/);\n return match ? match[1] : ctor === null ? 'null' : '';\n}", "function getType(ctor) {\n const match = ctor && ctor.toString().match(/^\\s*function (\\w+)/);\n return match ? match[1] : '';\n}", "function getType$1(ctor) {\n const match = ctor && ctor.toString().match(/^\\s*function (\\w+)/);\n return match ? match[1] : ctor === null ? 'null' : '';\n}", "function hasConstructor(obj) {\n if (typeof obj !== 'object' || obj === null) {\n return false;\n }\n\n return obj.constructor !== Object && obj.constructor !== Array;\n}", "function isClass(fn) {\n try {\n if (typeof fn === \"function\") {\n var keys = Object.getOwnPropertyNames(fn.prototype);\n\n let hasMethods = keys.length > 1;\n let hasMethodsOtherThanConstructor = keys.length > 0 && !(keys.length === 1 && keys[0] === 'constructor');\n let hasThisAssignmentAndStaticMethods = THIS_ASSIGNMENT_PATTERN.test(fn + \"\") && Object.getOwnPropertyNames(fn).length > 0;\n\n if (hasMethods || hasMethodsOtherThanConstructor ||\n hasThisAssignmentAndStaticMethods) {\n return true;\n }\n }\n return false;\n } catch (e) {\n return false;\n }\n}", "function isFunction(func)\n\t{\n//\t\t//trace(\"in isfunction parse with \" + func);\n\n\t\t// I believe switch ends up as a bunch of compares. Using a hash would probably be faster.\n\t\tswitch(func)\n\t\t{\n\t\t\tcase \"nroot\":\n\t\t\tcase \"mix\":\n\t\t\tcase \"sin\":\n\t\t\tcase \"cos\":\n\t\t\tcase \"tan\":\n\t\t\tcase \"cot\":\n\t\t\tcase \"sec\":\n\t\t\tcase \"csc\":\n\t\t\tcase \"pow\":\n\t\t\tcase \"sqrt\":\n\t\t\tcase \"sub\":\n\t\t\tcase \"abs\":\n\t\t\tcase \"div\":\n\t\t\tcase \"sigma\":\n\t\t\tcase \"log\":\n\t\t\tcase \"ln\":\n\t\t\t\treturn true;\n\t\t\tdefault:\n\t\t\t\treturn false;\n\t\t}\n\t}", "function checkIfFunction(func) {\n return typeof func === \"function\";\n}", "function isFunc(f) {\n return typeof f === \"function\";\n}", "function isInstanceOf(obj, ctor) {\n if (obj instanceof ctor) { return true; }\n if (isDirectInstanceOf(obj, ctor)) { return true; }\n // BUG TODO(erights): walk prototype chain.\n // In the meantime, this will fail should it encounter a\n // cross-frame instance of a \"subclass\" of ctor.\n return false;\n }", "function isFunction(obj) {\n return typeof obj === \"function\";\n}", "function isFunction(obj) {\n return typeof obj === \"function\";\n}", "function isFunction(obj) {\n return typeof obj === 'function';\n}", "function isFunction(obj) {\n return typeof obj === 'function';\n}", "function isFunction( obj ){\n return Object.prototype.toString.call( obj ) == \"[object Function]\";\n }", "static isConstructorDeclarationOverload(structure) {\r\n return structure.kind === StructureKind_1.StructureKind.ConstructorOverload;\r\n }", "function isFunction(fun) {\n return fun && {}.toString.call(fun) === '[object Function]';\n}", "function isFunction(obj) {\n return typeof obj === 'function';\n}", "function isFunction(obj) {\n return (typeof obj === \"function\");\n}", "function isFunction(obj) {\n return typeof obj === 'function';\n }", "function isFunction(obj) {\n return typeof obj === 'function';\n }", "function isFunction(object) { return typeof object === 'function'; }", "function markCtor(constr, opt_Sup, opt_name) {\n enforceType(constr, 'function', opt_name);\n if (isFunc(constr)) {\n fail(\"Simple functions can't be constructors: \", constr);\n }\n if (isXo4aFunc(constr)) {\n fail(\"Exophoric functions can't be constructors: \", constr);\n }\n constr.CONSTRUCTOR___ = true;\n if (opt_Sup) {\n derive(constr, opt_Sup);\n } else if (constr !== Object) {\n fail('Only \"Object\" has no super: ', constr);\n }\n if (opt_name) {\n constr.NAME___ = String(opt_name);\n }\n if (constr !== Object && constr !== Array) {\n // Iff constr is not Object nor Array, then any object inheriting from\n // constr.prototype is a constructed object which therefore tames to\n // itself by default. We do this with AS_TAMED___ and AS_FERAL___\n // methods on the prototype so it can be overridden either by overriding\n // these methods or by pre-taming with ___.tamesTo or ___.tamesToSelf.\n constr.prototype.AS_TAMED___ =\n constr.prototype.AS_FERAL___ = function() {\n return this;\n };\n }\n return constr; // translator freezes constructor later\n }", "function isFunction(obj) {\n return typeof obj === 'function';\n }", "function isFunction(obj) {\n return typeof obj === 'function';\n }", "function TestConstructor(type, lanes) {\n var simdFn = SIMD[type];\n var instance = createInstance(type);\n\n assertFalse(Object === simdFn.prototype.constructor)\n assertFalse(simdFn === Object.prototype.constructor)\n assertSame(simdFn, simdFn.prototype.constructor)\n\n assertSame(simdFn, instance.__proto__.constructor)\n assertSame(simdFn, Object(instance).__proto__.constructor)\n assertSame(simdFn.prototype, instance.__proto__)\n assertSame(simdFn.prototype, Object(instance).__proto__)\n}", "function isTypeResolver(\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nfn) {\n // 1. A type provider must be a function\n if (typeof fn !== 'function')\n return false;\n // 2. A class constructor is not a type provider\n if (/^class/.test(fn.toString()))\n return false;\n // 3. Built-in types like Date & Array are not type providers\n if (isBuiltinType(fn))\n return false;\n // TODO(bajtos): support model classes defined via ES5 constructor function\n return true;\n}", "function asCtor(constr) {\n return primFreeze(asCtorOnly(constr));\n }", "function isFunction(obj) {\n return (typeof obj == \"function\");\n }", "function isFunction(input){return\"undefined\"!=typeof Function&&input instanceof Function||\"[object Function]\"===Object.prototype.toString.call(input)}", "static isFunctionLike(structure) {\r\n switch (structure.kind) {\r\n case StructureKind_1.StructureKind.Constructor:\r\n case StructureKind_1.StructureKind.GetAccessor:\r\n case StructureKind_1.StructureKind.Method:\r\n case StructureKind_1.StructureKind.SetAccessor:\r\n case StructureKind_1.StructureKind.Function:\r\n return true;\r\n default:\r\n return false;\r\n }\r\n }", "function isInstance(object, targetTypeConstructor) {\n return (targetTypeConstructor && typeof targetTypeConstructor === 'function' && object instanceof targetTypeConstructor);\n}", "function isFunc(it) {\n return it instanceof Function || typeof it === \"function\";\n }", "function isFunction(input) {\n return (\n typeof Function !== 'undefined' && input instanceof Function ||\n Object.prototype.toString.call(input) === '[object Function]');\n\n }", "function isClass(obj) {\n return isFunction(obj) && (obj.prototype && obj === obj.prototype.constructor);\n }", "function isFunction(input) {\n\t return (\n\t (typeof Function !== 'undefined' && input instanceof Function) ||\n\t Object.prototype.toString.call(input) === '[object Function]'\n\t );\n\t }", "function isFunction(a) {\n return getTypeString(a) === '[object Function]';\n }", "function isFunction (obj) {\n return !!(obj && obj.constructor && obj.call && obj.apply)\n}", "function isFunction(input) {\n return typeof Function !== 'undefined' && input instanceof Function || Object.prototype.toString.call(input) === '[object Function]';\n }", "function logged(constructorFn) {\n console.log(constructorFn);\n}", "function logged(constructorFn) {\n console.log(constructorFn);\n}", "function isFunction(value) { return typeof value === \"function\" || value instanceof Function; }", "function isFn (x) { return typeof x === 'function' }", "static isConstructSignature(structure) {\r\n return structure.kind === StructureKind_1.StructureKind.ConstructSignature;\r\n }", "function isFunction(input) {\n return (\n (typeof Function !== 'undefined' && input instanceof Function) ||\n Object.prototype.toString.call(input) === '[object Function]'\n );\n }", "function isFunction(input) {\n return (\n (typeof Function !== 'undefined' && input instanceof Function) ||\n Object.prototype.toString.call(input) === '[object Function]'\n );\n }" ]
[ "0.78565264", "0.77827024", "0.7296092", "0.72123635", "0.7098049", "0.708506", "0.7060057", "0.7031812", "0.70308506", "0.6960493", "0.69367325", "0.6911832", "0.67534906", "0.6687986", "0.6606467", "0.6507036", "0.64318717", "0.6380909", "0.63796014", "0.625006", "0.6194024", "0.6191627", "0.610851", "0.6106229", "0.6106229", "0.6073734", "0.6071542", "0.6071542", "0.6033503", "0.6033503", "0.6033503", "0.60104173", "0.59992206", "0.59992206", "0.59992206", "0.5993506", "0.5980023", "0.5979874", "0.5979874", "0.5979874", "0.5979874", "0.5979874", "0.5979874", "0.5975771", "0.59703887", "0.59393567", "0.5931542", "0.5931542", "0.5931542", "0.5929123", "0.5929123", "0.5929123", "0.5900201", "0.5900201", "0.5900201", "0.5900201", "0.5900201", "0.58988976", "0.5870282", "0.58456475", "0.578208", "0.5636008", "0.56062686", "0.5582163", "0.5574203", "0.5563554", "0.5563554", "0.55493253", "0.55493253", "0.55467373", "0.5546321", "0.55208224", "0.55034614", "0.5474942", "0.54430187", "0.54430187", "0.5437598", "0.54259837", "0.54084724", "0.54084724", "0.5385897", "0.5370431", "0.5350879", "0.53344476", "0.53222483", "0.53153914", "0.53039634", "0.53034335", "0.5301954", "0.5300037", "0.5279581", "0.52651453", "0.5246445", "0.5222441", "0.52180046", "0.52180046", "0.5217643", "0.5217105", "0.52138853", "0.52124655", "0.52124655" ]
0.0
-1
Check if `value` is an object with keys.
function keys(value) { var key for (key in value) { return true } return false }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function isObject(value) {\n var type = typeof value;\n return !!value && (type == 'object');\n }", "function isKey(value, object) {\n if (Array.isArray(value)) {\n return false;\n }\n const type = typeof value;\n if (\n type === \"number\" ||\n type === \"boolean\" ||\n value == null ||\n isSymbol(value)\n ) {\n return true;\n }\n return (\n reIsPlainProp.test(value) ||\n !reIsDeepProp.test(value) ||\n (object != null && value in Object(object))\n );\n}", "function isObject(value) {\n\n\t if (typeof value === 'object' && value !== null &&\n\t !(value instanceof Boolean) &&\n\t !(value instanceof Date) &&\n\t !(value instanceof Number) &&\n\t !(value instanceof RegExp) &&\n\t !(value instanceof String)) {\n\n\t return true;\n\t }\n\n\t return false;\n\t }", "function isObject(value) {\n return value && typeof value === 'object';\n}", "function isObject(value) {\n var type = typeof value;\n return !!value && (type == 'object' || type == 'function');\n }", "__is_object(value) {\n return value && typeof value === 'object' && value.constructor === Object;\n }", "function isObject(value) {\n return value && typeof value === 'object' && value.constructor === Object;\n}", "function isObject(value) {\n\treturn value && typeof value === 'object' && value.constructor === Object;\n}", "function keys(value) {\n var key;\n for (key in value) {\n return true;\n }\n return false;\n}", "function keys(value) {\n var key;\n for (key in value) {\n return true\n }\n\n return false\n}", "function isObject(value) {\n\n if (typeof value === 'object' && value !== null &&\n !(value instanceof Boolean) &&\n !(value instanceof Date) &&\n !(value instanceof Number) &&\n !(value instanceof RegExp) &&\n !(value instanceof String)) {\n\n return true;\n }\n\n return false;\n }", "function isObject(value) {\n\n if (typeof value === 'object' && value !== null &&\n !(value instanceof Boolean) &&\n !(value instanceof Date) &&\n !(value instanceof Number) &&\n !(value instanceof RegExp) &&\n !(value instanceof String)) {\n\n return true;\n }\n\n return false;\n }", "function isObject(value) {\n\n if (typeof value === 'object' && value !== null &&\n !(value instanceof Boolean) &&\n !(value instanceof Date) &&\n !(value instanceof Number) &&\n !(value instanceof RegExp) &&\n !(value instanceof String)) {\n\n return true;\n }\n\n return false;\n }", "function isObject(value) {\n\n if (typeof value === 'object' && value !== null &&\n !(value instanceof Boolean) &&\n !(value instanceof Date) &&\n !(value instanceof Number) &&\n !(value instanceof RegExp) &&\n !(value instanceof String)) {\n\n return true;\n }\n\n return false;\n }", "function isObject(value) {\n\n if (typeof value === 'object' && value !== null &&\n !(value instanceof Boolean) &&\n !(value instanceof Date) &&\n !(value instanceof Number) &&\n !(value instanceof RegExp) &&\n !(value instanceof String)) {\n\n return true;\n }\n\n return false;\n }", "function isObject(value) {\n\n if (typeof value === 'object' && value !== null &&\n !(value instanceof Boolean) &&\n !(value instanceof Date) &&\n !(value instanceof Number) &&\n !(value instanceof RegExp) &&\n !(value instanceof String)) {\n\n return true;\n }\n\n return false;\n }", "function isObject(value) {\n\n if (typeof value === 'object' && value !== null &&\n !(value instanceof Boolean) &&\n !(value instanceof Date) &&\n !(value instanceof Number) &&\n !(value instanceof RegExp) &&\n !(value instanceof String)) {\n\n return true;\n }\n\n return false;\n }", "function isObject(value) {\n\n if (typeof value === 'object' && value !== null &&\n !(value instanceof Boolean) &&\n !(value instanceof Date) &&\n !(value instanceof Number) &&\n !(value instanceof RegExp) &&\n !(value instanceof String)) {\n\n return true;\n }\n\n return false;\n }", "function isObject(value) {\n\n if (typeof value === 'object' && value !== null &&\n !(value instanceof Boolean) &&\n !(value instanceof Date) &&\n !(value instanceof Number) &&\n !(value instanceof RegExp) &&\n !(value instanceof String)) {\n\n return true;\n }\n\n return false;\n }", "function isObject(value) {\n\n if (typeof value === 'object' && value !== null &&\n !(value instanceof Boolean) &&\n !(value instanceof Date) &&\n !(value instanceof Number) &&\n !(value instanceof RegExp) &&\n !(value instanceof String)) {\n\n return true;\n }\n\n return false;\n }", "function isObject(value) {\n\n if (typeof value === 'object' && value !== null &&\n !(value instanceof Boolean) &&\n !(value instanceof Date) &&\n !(value instanceof Number) &&\n !(value instanceof RegExp) &&\n !(value instanceof String)) {\n\n return true;\n }\n\n return false;\n }", "function isObject(value) {\n\n if (typeof value === 'object' && value !== null &&\n !(value instanceof Boolean) &&\n !(value instanceof Date) &&\n !(value instanceof Number) &&\n !(value instanceof RegExp) &&\n !(value instanceof String)) {\n\n return true;\n }\n\n return false;\n }", "function isObject(value) {\n return typeof value === 'object' && !!value;\n}", "function isObject(value) { return typeof value === \"object\" && value !== null; }", "function keys(value) {\n var key\n for (key in value) {\n return true\n }\n\n return false\n}", "function keys(value) {\n var key\n for (key in value) {\n return true\n }\n\n return false\n}", "function keys(value) {\n var key\n for (key in value) {\n return true\n }\n\n return false\n}", "function isObject(value) {\n return typeof value === 'object' && value !== null && !isArray(value);\n}", "function isObject$2(value) {\n return (\n typeof value === \"object\" &&\n value !== null &&\n // none of these are collection objects, so we can return false\n !(value instanceof Boolean) &&\n !(value instanceof Date) &&\n !(value instanceof Error) &&\n !(value instanceof Number) &&\n !(value instanceof RegExp) &&\n !(value instanceof String)\n );\n}", "function isObject$2(value) {\n return (\n typeof value === \"object\" &&\n value !== null &&\n // none of these are collection objects, so we can return false\n !(value instanceof Boolean) &&\n !(value instanceof Date) &&\n !(value instanceof Error) &&\n !(value instanceof Number) &&\n !(value instanceof RegExp) &&\n !(value instanceof String)\n );\n}", "function isObjectObject(value) {\n return typeof value === 'object' && value !== null && ObjectToString(value) === '[object Object]';\n}", "function isObject(value) {\n return (\n typeof value === \"object\" &&\n value !== null &&\n // none of these are collection objects, so we can return false\n !(value instanceof Boolean) &&\n !(value instanceof Date) &&\n !(value instanceof Error) &&\n !(value instanceof Number) &&\n !(value instanceof RegExp) &&\n !(value instanceof String)\n );\n}", "function isObject(value) {\n return (\n typeof value === \"object\" &&\n value !== null &&\n // none of these are collection objects, so we can return false\n !(value instanceof Boolean) &&\n !(value instanceof Date) &&\n !(value instanceof Error) &&\n !(value instanceof Number) &&\n !(value instanceof RegExp) &&\n !(value instanceof String)\n );\n}", "function isObject(value) {\n return (\n typeof value === \"object\" &&\n value !== null &&\n // none of these are collection objects, so we can return false\n !(value instanceof Boolean) &&\n !(value instanceof Date) &&\n !(value instanceof Error) &&\n !(value instanceof Number) &&\n !(value instanceof RegExp) &&\n !(value instanceof String)\n );\n}", "function isObject(value) {\n return (\n typeof value === \"object\" &&\n value !== null &&\n // none of these are collection objects, so we can return false\n !(value instanceof Boolean) &&\n !(value instanceof Date) &&\n !(value instanceof Error) &&\n !(value instanceof Number) &&\n !(value instanceof RegExp) &&\n !(value instanceof String)\n );\n}", "function isObject(value) {\n return value !== null && typeof value === 'object' && !Array.isArray(value);\n}", "function isObject(value) {\n return typeof value === \"object\" && value !== null || typeof value === \"function\";\n}", "function isObject(value) {\n return typeof value === \"object\" && value !== null || typeof value === \"function\";\n}", "function isObject(value) {\n return typeof value === \"object\" && value !== null || typeof value === \"function\";\n}", "function isObject(value) {\n return value != null && (typeof value === 'object' || typeof value === 'function') && !Array.isArray(value);\n}", "function isObject$1(value) {\n return _typeof_1(value) === \"object\" && value !== null;\n}", "function isObject$1(value) {\n return _typeof_1(value) === \"object\" && value !== null;\n}", "function isObject(value) {\n return typeof value === \"object\" && value != null;\n}", "function isObject$1(value) {\n return typeof value === 'object' && value !== null || typeof value === 'function';\n }", "function isObject(value) {\n\t\treturn value !== null && Object.prototype.toString.call(value) === '[object Object]';\n\t}", "function isObject(value) {\n return (typeof value === \"object\" && value !== null) || typeof value === \"function\";\n}", "function isObject ( value ) {\n return angular.isObject ( value );\n }", "function objectHasEnumerableKeys(value) {\n for (const _ in value) return true;\n return false;\n}", "function isObj(value) {\n var type = typeof value;\n return value !== null && (type === 'object' || type === 'function');\n}", "function _is_json_value(value) {\n\tif (value === undefined) return false;\n\tif (value === null) return true;\n\treturn ([Object, Array, String, Number, Boolean].indexOf(value.constructor) !== -1);\n}", "function isObject(val) {\n return kindOf$3(val) === 'object';\n}", "function isObjectLike(value) {\n return typeof value === \"object\" && !!value;\n}", "function nodesAsObject(value) {\r\n return !!value && typeof value === 'object';\r\n}", "function isPlainObject(value) {\n return !!value && typeof value === 'object' && value.constructor === Object;\n}", "function is(value) {\n var candidate = value;\n return Is.objectLiteral(candidate) && Position.is(candidate.start) && Position.is(candidate.end);\n }", "function is(value) {\n var candidate = value;\n return Is.objectLiteral(candidate) && Position.is(candidate.start) && Position.is(candidate.end);\n }", "function is(value) {\n var candidate = value;\n return Is.objectLiteral(candidate) && Position.is(candidate.start) && Position.is(candidate.end);\n }", "function is(value) {\n var candidate = value;\n return Is.objectLiteral(candidate) && Position.is(candidate.start) && Position.is(candidate.end);\n }", "function is(value) {\r\n var candidate = value;\r\n return Is.objectLiteral(candidate) && Position.is(candidate.start) && Position.is(candidate.end);\r\n }", "function is(value) {\r\n var candidate = value;\r\n return Is.objectLiteral(candidate) && Position.is(candidate.start) && Position.is(candidate.end);\r\n }", "function is(value) {\r\n var candidate = value;\r\n return Is.objectLiteral(candidate) && Position.is(candidate.start) && Position.is(candidate.end);\r\n }", "function is(value) {\r\n var candidate = value;\r\n return Is.objectLiteral(candidate) && Position.is(candidate.start) && Position.is(candidate.end);\r\n }", "function isObjectLike(value) {\n return _typeof$1(value) == 'object' && value !== null;\n }", "function isObjectLike(value) {\n return value != null && (typeof value === \"function\" || typeof value === \"object\");\n}", "function is(value) {\r\n var candidate = value;\r\n return Is.objectLiteral(candidate) && Position.is(candidate.start) && Position.is(candidate.end);\r\n }", "function is(value) {\r\n var candidate = value;\r\n return Is.objectLiteral(candidate) && Position.is(candidate.start) && Position.is(candidate.end);\r\n }", "function isObject(val) {\n return typeOf(val) === 'object';\n}", "function isObject(val) {\n return typeOf(val) === 'object';\n}", "function isObject(val) {\n return typeOf(val) === 'object';\n}", "function isObject(val) {\n return typeOf(val) === 'object';\n}", "function isObjectLike(value) {\n return _typeof(value) == 'object' && value !== null;\n}", "function isObjectLike(value) {\n return _typeof(value) == 'object' && value !== null;\n}", "function isObjectLike(value) {\n return _typeof(value) == 'object' && value !== null;\n}", "function isObjectLike(value) {\n return _typeof(value) == 'object' && value !== null;\n}", "function isObjectLike(value) {\n return _typeof(value) == 'object' && value !== null;\n}", "function isObjectLike(value) {\n return _typeof(value) == 'object' && value !== null;\n}", "function isObjectLike(value) {\n return _typeof(value) == 'object' && value !== null;\n}", "function isObjectLike(value) {\n return _typeof(value) == 'object' && value !== null;\n}", "function isObjectLike(value) {\n return _typeof(value) == 'object' && value !== null;\n}", "function isObjectLike(value) {\n return _typeof(value) == 'object' && value !== null;\n}", "function isObjectLike(value) {\n return _typeof(value) == 'object' && value !== null;\n}", "function isObjectLike(value) {\n return _typeof(value) == 'object' && value !== null;\n}", "function isObject(v) {\n return v instanceof Object;\n }", "function wkt_is_object(val) {\n return !!val && typeof val == 'object' && !Array.isArray(val);\n}", "function is(value) {\n var candidate = value;\n return Is.objectLiteral(candidate) && Is.uinteger(candidate.line) && Is.uinteger(candidate.character);\n }", "function isObjectLike$a(value) {\n return typeof value == 'object' && value !== null;\n}", "function isObject(val) {\n return val && typeof val == \"object\";\n}", "function is(value) {\n var candidate = value;\n return Is.objectLiteral(candidate) && Is.number(candidate.line) && Is.number(candidate.character);\n }", "function is(value) {\n var candidate = value;\n return Is.objectLiteral(candidate) && Is.number(candidate.line) && Is.number(candidate.character);\n }", "function is(value) {\r\n var candidate = value;\r\n return Is.objectLiteral(candidate) && Is.number(candidate.line) && Is.number(candidate.character);\r\n }", "function is(value) {\r\n var candidate = value;\r\n return Is.objectLiteral(candidate) && Is.number(candidate.line) && Is.number(candidate.character);\r\n }", "function is(value) {\r\n var candidate = value;\r\n return Is.objectLiteral(candidate) && Is.number(candidate.line) && Is.number(candidate.character);\r\n }", "function is(value) {\r\n var candidate = value;\r\n return Is.objectLiteral(candidate) && Is.number(candidate.line) && Is.number(candidate.character);\r\n }", "function isPlainObject(value) {\n return (!!value && typeof value === 'object' &&\n value.constructor === Object);\n }", "function isPlainObject(value) {\n return (!!value && typeof value === 'object' &&\n value.constructor === Object);\n }", "function is(value) {\n var candidate = value;\n return Is.objectLiteral(candidate) && Is.number(candidate.line) && Is.number(candidate.character);\n }" ]
[ "0.71962214", "0.7146194", "0.71439165", "0.71217006", "0.7090814", "0.70249754", "0.7002017", "0.69980055", "0.6948843", "0.6938903", "0.6933717", "0.6933717", "0.6933717", "0.6933717", "0.6933717", "0.6933717", "0.6933717", "0.6933717", "0.6933717", "0.6933717", "0.6933717", "0.6933717", "0.6913437", "0.69007903", "0.6872998", "0.6872998", "0.6872998", "0.6854357", "0.68293446", "0.68293446", "0.6799836", "0.6782779", "0.6782779", "0.6782779", "0.6782779", "0.6764904", "0.6755821", "0.6755821", "0.6755821", "0.67518723", "0.67511255", "0.67511255", "0.6745341", "0.6741922", "0.6724725", "0.66614306", "0.6649315", "0.6615613", "0.65968376", "0.65502757", "0.65407604", "0.65396464", "0.6523399", "0.6472741", "0.6469985", "0.6451813", "0.6451813", "0.6451813", "0.6450234", "0.6450234", "0.6450234", "0.6450234", "0.6431236", "0.6428003", "0.6426241", "0.6426241", "0.64073414", "0.64073414", "0.64073414", "0.64073414", "0.6397057", "0.6397057", "0.6397057", "0.6397057", "0.6397057", "0.6397057", "0.6397057", "0.6397057", "0.6397057", "0.6397057", "0.6397057", "0.6397057", "0.63968295", "0.6339287", "0.633282", "0.6323592", "0.63020796", "0.62989986", "0.62989986", "0.6297201", "0.6297201", "0.6297201", "0.6297201", "0.6292502", "0.6292502", "0.6291048" ]
0.6882035
28
Assert a parser is available.
function assertParser(name, Parser) { if (typeof Parser !== 'function') { throw new Error('Cannot `' + name + '` without `Parser`') } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function assertParser(name, Parser) {\n if (!func(Parser)) {\n throw new Error('Cannot `' + name + '` without `Parser`');\n }\n}", "async ensureParser() {\n if (!this.parser) {\n this.parser = await ASTParser.importASTParser();\n }\n }", "function _checkParser() {\n eval(Processing(canvas, parserTest.body));\n _pass();\n}", "function tryParse(callback) {\n return speculationHelper(callback, /*isLookAhead*/ false);\n }", "function check_parse_error (txt) {\n try {\n eval (txt)\n assert (false)\n } catch (e) {\n assert (e instanceof SyntaxError)\n }\n}", "function loadParser (parserName) {\n var parser = parsers[parserName]\n\n if (parser !== undefined) {\n return parser\n }\n\n // this uses a switch for static require analysis\n switch (parserName) {\n case 'json':\n parser = __nccwpck_require__(20859)\n break\n case 'raw':\n parser = __nccwpck_require__(49609)\n break\n case 'text':\n parser = __nccwpck_require__(26382)\n break\n case 'urlencoded':\n parser = __nccwpck_require__(76100)\n break\n }\n\n // store to prevent invoking require()\n return (parsers[parserName] = parser)\n}", "function Parser() {\n}", "function Parser() {\n}", "function loadParser (parserName) {\n var parser = parsers[parserName]\n\n if (parser !== undefined) {\n return parser\n }\n\n // this uses a switch for static require analysis\n switch (parserName) {\n case 'json':\n parser = __webpack_require__(558)\n break\n case 'raw':\n parser = __webpack_require__(591)\n break\n case 'text':\n parser = __webpack_require__(592)\n break\n case 'urlencoded':\n parser = __webpack_require__(593)\n break\n }\n\n // store to prevent invoking require()\n return (parsers[parserName] = parser)\n}", "function Parser() {\n var errors = this.errors = [];\n var warnings = this.warnings = [];\n}", "function loadParser (parserName) {\n var parser = parsers[parserName]\n\n if (parser !== undefined) {\n return parser\n }\n\n // this uses a switch for static require analysis\n switch (parserName) {\n case 'json':\n parser = __webpack_require__(212)\n break\n case 'raw':\n parser = __webpack_require__(242)\n break\n case 'text':\n parser = __webpack_require__(243)\n break\n case 'urlencoded':\n parser = __webpack_require__(244)\n break\n }\n\n // store to prevent invoking require()\n return (parsers[parserName] = parser)\n}", "function loadParser (parserName) {\n var parser = parsers[parserName]\n\n if (parser !== undefined) {\n return parser\n }\n\n // this uses a switch for static require analysis\n switch (parserName) {\n case 'json':\n parser = require('./lib/types/json')\n break\n case 'raw':\n parser = require('./lib/types/raw')\n break\n case 'text':\n parser = require('./lib/types/text')\n break\n case 'urlencoded':\n parser = require('./lib/types/urlencoded')\n break\n }\n\n // store to prevent invoking require()\n return (parsers[parserName] = parser)\n}", "function loadParser (parserName) {\n var parser = parsers[parserName]\n\n if (parser !== undefined) {\n return parser\n }\n\n // this uses a switch for static require analysis\n switch (parserName) {\n case 'json':\n parser = require('./lib/types/json')\n break\n case 'raw':\n parser = require('./lib/types/raw')\n break\n case 'text':\n parser = require('./lib/types/text')\n break\n case 'urlencoded':\n parser = require('./lib/types/urlencoded')\n break\n }\n\n // store to prevent invoking require()\n return (parsers[parserName] = parser)\n}", "function loadParser (parserName) {\n var parser = parsers[parserName]\n\n if (parser !== undefined) {\n return parser\n }\n\n // this uses a switch for static require analysis\n switch (parserName) {\n case 'json':\n parser = require('./lib/types/json')\n break\n case 'raw':\n parser = require('./lib/types/raw')\n break\n case 'text':\n parser = require('./lib/types/text')\n break\n case 'urlencoded':\n parser = require('./lib/types/urlencoded')\n break\n }\n\n // store to prevent invoking require()\n return (parsers[parserName] = parser)\n}", "function loadParser (parserName) {\n var parser = parsers[parserName]\n\n if (parser !== undefined) {\n return parser\n }\n\n // this uses a switch for static require analysis\n switch (parserName) {\n case 'json':\n parser = require('./lib/types/json')\n break\n case 'raw':\n parser = require('./lib/types/raw')\n break\n case 'text':\n parser = require('./lib/types/text')\n break\n case 'urlencoded':\n parser = require('./lib/types/urlencoded')\n break\n }\n\n // store to prevent invoking require()\n return (parsers[parserName] = parser)\n}", "function loadParser (parserName) {\n var parser = parsers[parserName]\n\n if (parser !== undefined) {\n return parser\n }\n\n // this uses a switch for static require analysis\n switch (parserName) {\n case 'json':\n parser = __webpack_require__(/*! ./lib/types/json */ \"./node_modules/body-parser/lib/types/json.js\")\n break\n case 'raw':\n parser = __webpack_require__(/*! ./lib/types/raw */ \"./node_modules/body-parser/lib/types/raw.js\")\n break\n case 'text':\n parser = __webpack_require__(/*! ./lib/types/text */ \"./node_modules/body-parser/lib/types/text.js\")\n break\n case 'urlencoded':\n parser = __webpack_require__(/*! ./lib/types/urlencoded */ \"./node_modules/body-parser/lib/types/urlencoded.js\")\n break\n }\n\n // store to prevent invoking require()\n return (parsers[parserName] = parser)\n}", "function loadParser (parserName) {\n var parser = parsers[parserName]\n\n if (parser !== undefined) {\n return parser\n }\n\n // this uses a switch for static require analysis\n switch (parserName) {\n case 'json':\n parser = __webpack_require__(/*! ./lib/types/json */ \"./node_modules/body-parser/lib/types/json.js\")\n break\n case 'raw':\n parser = __webpack_require__(/*! ./lib/types/raw */ \"./node_modules/body-parser/lib/types/raw.js\")\n break\n case 'text':\n parser = __webpack_require__(/*! ./lib/types/text */ \"./node_modules/body-parser/lib/types/text.js\")\n break\n case 'urlencoded':\n parser = __webpack_require__(/*! ./lib/types/urlencoded */ \"./node_modules/body-parser/lib/types/urlencoded.js\")\n break\n }\n\n // store to prevent invoking require()\n return (parsers[parserName] = parser)\n}", "function loadParser (parserName) {\n var parser = parsers[parserName]\n\n if (parser !== undefined) {\n return parser\n }\n\n // this uses a switch for static require analysis\n switch (parserName) {\n case 'json':\n parser = __webpack_require__(/*! ./lib/types/json */ \"./node_modules/body-parser/lib/types/json.js\")\n break\n case 'raw':\n parser = __webpack_require__(/*! ./lib/types/raw */ \"./node_modules/body-parser/lib/types/raw.js\")\n break\n case 'text':\n parser = __webpack_require__(/*! ./lib/types/text */ \"./node_modules/body-parser/lib/types/text.js\")\n break\n case 'urlencoded':\n parser = __webpack_require__(/*! ./lib/types/urlencoded */ \"./node_modules/body-parser/lib/types/urlencoded.js\")\n break\n }\n\n // store to prevent invoking require()\n return (parsers[parserName] = parser)\n}", "function loadParser (parserName) {\n var parser = parsers[parserName]\n\n if (parser !== undefined) {\n return parser\n }\n\n // this uses a switch for static require analysis\n switch (parserName) {\n case 'json':\n parser = __webpack_require__(/*! ./lib/types/json */ \"./node_modules/body-parser/lib/types/json.js\")\n break\n case 'raw':\n parser = __webpack_require__(/*! ./lib/types/raw */ \"./node_modules/body-parser/lib/types/raw.js\")\n break\n case 'text':\n parser = __webpack_require__(/*! ./lib/types/text */ \"./node_modules/body-parser/lib/types/text.js\")\n break\n case 'urlencoded':\n parser = __webpack_require__(/*! ./lib/types/urlencoded */ \"./node_modules/body-parser/lib/types/urlencoded.js\")\n break\n }\n\n // store to prevent invoking require()\n return (parsers[parserName] = parser)\n}", "function loadParser (parserName) {\n var parser = parsers[parserName]\n\n if (parser !== undefined) {\n return parser\n }\n\n // this uses a switch for static require analysis\n switch (parserName) {\n case 'json':\n parser = __webpack_require__(22)\n break\n case 'raw':\n parser = __webpack_require__(28)\n break\n case 'text':\n parser = __webpack_require__(29)\n break\n case 'urlencoded':\n parser = __webpack_require__(30)\n break\n }\n\n // store to prevent invoking require()\n return (parsers[parserName] = parser)\n}", "function loadParser (parserName) {\n var parser = parsers[parserName]\n\n if (parser !== undefined) {\n return parser\n }\n\n // this uses a switch for static require analysis\n switch (parserName) {\n case 'json':\n parser = __webpack_require__(455)\n break\n case 'raw':\n parser = __webpack_require__(486)\n break\n case 'text':\n parser = __webpack_require__(487)\n break\n case 'urlencoded':\n parser = __webpack_require__(488)\n break\n }\n\n // store to prevent invoking require()\n return (parsers[parserName] = parser)\n}", "function loadParser (parserName) {\n var parser = parsers[parserName]\n\n if (parser !== undefined) {\n return parser\n }\n\n // this uses a switch for static require analysis\n switch (parserName) {\n case 'json':\n parser = __webpack_require__(441)\n break\n case 'raw':\n parser = __webpack_require__(460)\n break\n case 'text':\n parser = __webpack_require__(461)\n break\n case 'urlencoded':\n parser = __webpack_require__(462)\n break\n }\n\n // store to prevent invoking require()\n return (parsers[parserName] = parser)\n}", "function loadParser (parserName) {\n var parser = parsers[parserName]\n\n if (parser !== undefined) {\n return parser\n }\n\n // this uses a switch for static require analysis\n switch (parserName) {\n case 'json':\n parser = __webpack_require__(373)\n break\n case 'raw':\n parser = __webpack_require__(395)\n break\n case 'text':\n parser = __webpack_require__(396)\n break\n case 'urlencoded':\n parser = __webpack_require__(397)\n break\n }\n\n // store to prevent invoking require()\n return (parsers[parserName] = parser)\n}", "function loadParser(parserName) {\n var parser = parsers[parserName];\n\n if (parser !== undefined) {\n return parser;\n } // this uses a switch for static require analysis\n\n\n switch (parserName) {\n case 'json':\n parser = __webpack_require__(/*! ./lib/types/json */ \"./node_modules/body-parser/lib/types/json.js\");\n break;\n\n case 'raw':\n parser = __webpack_require__(/*! ./lib/types/raw */ \"./node_modules/body-parser/lib/types/raw.js\");\n break;\n\n case 'text':\n parser = __webpack_require__(/*! ./lib/types/text */ \"./node_modules/body-parser/lib/types/text.js\");\n break;\n\n case 'urlencoded':\n parser = __webpack_require__(/*! ./lib/types/urlencoded */ \"./node_modules/body-parser/lib/types/urlencoded.js\");\n break;\n } // store to prevent invoking require()\n\n\n return parsers[parserName] = parser;\n}", "static canParse(testName) {\n const benchmarkParserKey = Utils.getBenchmarkParserKey(testName);\n if (benchmarkParserKey) {\n return true;\n }\n return false;\n }", "function loadParser (parserName) {\n var parser = parsers[parserName]\n\n if (parser !== undefined) {\n return parser\n }\n\n // this uses a switch for static require analysis\n switch (parserName) {\n case 'json':\n parser = __webpack_require__(273)\n break\n case 'raw':\n parser = __webpack_require__(307)\n break\n case 'text':\n parser = __webpack_require__(308)\n break\n case 'urlencoded':\n parser = __webpack_require__(309)\n break\n }\n\n // store to prevent invoking require()\n return (parsers[parserName] = parser)\n}", "function testParserInsertedDidNotRun(description) {\n test(() => assert_false(window.ran),\n \"Script shouldn't run with \" + description + \" (parser-inserted)\");\n window.ran = false;\n}", "function _getParser(options){\r\n return (options && options.parser) || setDefaultParser();\r\n}", "get parser() {\r\n return this._parser;\r\n }", "constructor( parser ){ \n super()\n this.parser = parser \n }", "function expect(parser, kind) {\n var token = parser.token;\n if (token.kind === kind) {\n advance(parser);\n return token;\n }\n throw (0, _error.syntaxError)(parser.source, token.start, 'Expected ' + (0, _lexer.getTokenKindDesc)(kind) + ', found ' + (0, _lexer.getTokenDesc)(token));\n}", "function def(source, result) {\n\treturn function () {\n\t var actualResult = undefined;\n\t var exception = undefined;\n\t expectAsserts(1);\n try {\n\t\tactualResult = MicroXML.parse(source);\n }\n catch (e) {\n\t\texception = e;\n }\n if (result === undefined) {\n\t\tassertInstanceOf(\"non-conformance not detected:\", MicroXML.ParseError, exception);\n }\n else {\n\t\tassertEquals(\"incorrect parse result:\", result, actualResult);\n }\n\t};\n }", "function Parser() {\n\n}", "function expect(parser, kind) {\n\t var token = parser.token;\n\t if (token.kind === kind) {\n\t advance(parser);\n\t return token;\n\t }\n\t throw (0, _error.syntaxError)(parser.source, token.start, 'Expected ' + (0, _lexer.getTokenKindDesc)(kind) + ', found ' + (0, _lexer.getTokenDesc)(token));\n\t}", "function caml_set_parser_trace() { return 0; }", "async function checkExecution() {\n await (async () => {\n const m = new Module('import { nonexistent } from \"module\";');\n await m.link(common.mustCall(() => new Module('')));\n\n // There is no code for this exception since it is thrown by the JavaScript\n // engine.\n assert.throws(() => {\n m.instantiate();\n }, SyntaxError);\n })();\n\n await (async () => {\n const m = new Module('throw new Error();');\n await m.link(common.mustNotCall());\n m.instantiate();\n const evaluatePromise = m.evaluate();\n await evaluatePromise.catch(() => {});\n assert.strictEqual(m.status, 'errored');\n try {\n await evaluatePromise;\n } catch (err) {\n assert.strictEqual(m.error, err);\n return;\n }\n assert.fail('Missing expected exception');\n })();\n}", "instantiateParser() {\n return new this.ParserClass(this.config);\n }", "function _isSupported() {\n _state = 1;\n if (typeof chai !== \"undefined\") {\n _chai = chai;\n assert = _chai.assert;\n\n } else {\n _cat.core.log.info(\"Chai library is not supported, skipping annotation 'assert', consider adding it to the .catproject dependencies\");\n }\n }", "function parseXML(){\n\tdescribe(\"Parse XML\", function(){\n\t\tit(\"Game XML should parse without errors\", function(done){\n\n\t\t\tparser.parseString(xmlString, function(err, result){\n\n\t\t\t\tif (err) throw err;\n\n\t\t\t\txmlData = result.math;\n\n\t\t\t\tdone();\n\t\t\t});\n\t\t});\n\t});\n}", "function parseXML(){\n\tdescribe(\"Parse XML\", function(){\n\t\tit(\"Game XML should parse without errors\", function(done){\n\n\t\t\tparser.parseString(xmlString, function(err, result){\n\n\t\t\t\tif (err) throw err;\n\n\t\t\t\txmlData = result.math;\n\n\t\t\t\tdone();\n\t\t\t});\n\t\t});\n\t});\n}", "constructor(type, parser) { \n this.parser = parser\n this.type = type\n }", "parse() {\n if (this._readable === undefined) {\n log.error(\"No Readable: Cannot find stream for the scanner to work against.\");\n return;\n }\n log.verbose(\"<system goal>\");\n this._systemGoal();\n return this._parseSuccess;\n }", "init(parser, reporter, severity, meta) {\n this.parser = parser;\n this.reporter = reporter;\n this.severity = severity;\n this.meta = meta;\n }", "function assertCompiler(name, Compiler) {\n if (!func(Compiler)) {\n throw new Error('Cannot `' + name + '` without `Compiler`');\n }\n}", "function Parser() {\n if(false === (this instanceof Parser)) {\n return new Parser();\n }\n\n events.EventEmitter.call(this);\n}", "function assertCompiler(name, Compiler) {\n if (typeof Compiler !== 'function') {\n throw new Error('Cannot `' + name + '` without `Compiler`')\n }\n}", "function assertCompiler(name, Compiler) {\n if (typeof Compiler !== 'function') {\n throw new Error('Cannot `' + name + '` without `Compiler`')\n }\n}", "function assertCompiler(name, Compiler) {\n if (typeof Compiler !== 'function') {\n throw new Error('Cannot `' + name + '` without `Compiler`')\n }\n}", "function assertCompiler(name, Compiler) {\n if (typeof Compiler !== 'function') {\n throw new Error('Cannot `' + name + '` without `Compiler`')\n }\n}", "function assertCompiler(name, Compiler) {\n if (typeof Compiler !== 'function') {\n throw new Error('Cannot `' + name + '` without `Compiler`')\n }\n}", "function assertCompiler(name, Compiler) {\n if (typeof Compiler !== 'function') {\n throw new Error('Cannot `' + name + '` without `Compiler`')\n }\n}", "function assertCompiler(name, Compiler) {\n if (typeof Compiler !== 'function') {\n throw new Error('Cannot `' + name + '` without `Compiler`')\n }\n}", "function assertCompiler(name, Compiler) {\n if (typeof Compiler !== 'function') {\n throw new Error('Cannot `' + name + '` without `Compiler`')\n }\n}", "function assertCompiler(name, Compiler) {\n if (typeof Compiler !== 'function') {\n throw new Error('Cannot `' + name + '` without `Compiler`')\n }\n}", "function assertValidSDL(documentAST) {\n var errors = validateSDL(documentAST);\n\n if (errors.length !== 0) {\n throw new Error(errors.map(function (error) {\n return error.message;\n }).join('\\n\\n'));\n }\n}", "function assertValidSDL(documentAST) {\n var errors = validateSDL(documentAST);\n\n if (errors.length !== 0) {\n throw new Error(errors.map(function (error) {\n return error.message;\n }).join('\\n\\n'));\n }\n}", "function assertValidSDL(documentAST) {\n var errors = validateSDL(documentAST);\n\n if (errors.length !== 0) {\n throw new Error(errors.map(function (error) {\n return error.message;\n }).join('\\n\\n'));\n }\n}", "function assertValidSDL(documentAST) {\n var errors = validateSDL(documentAST);\n\n if (errors.length !== 0) {\n throw new Error(errors.map(function (error) {\n return error.message;\n }).join('\\n\\n'));\n }\n}", "function assertValidSDL(documentAST) {\n var errors = validateSDL(documentAST);\n\n if (errors.length !== 0) {\n throw new Error(errors.map(function (error) {\n return error.message;\n }).join('\\n\\n'));\n }\n}", "function assertValidSDL(documentAST) {\n var errors = validateSDL(documentAST);\n\n if (errors.length !== 0) {\n throw new Error(errors.map(function (error) {\n return error.message;\n }).join('\\n\\n'));\n }\n}", "function parser(p) {\n return new Parser(p);\n }", "constructor( parser, embeded=parser ) { \n super(new GeneratorTokenizer(embeded), parser?GeneratorParser.full_rules():GeneratorParser.rules(), \n parser?GeneratorConstants.LANG:GeneratorConstants.EXP) \n this.matcher = new Matcher(\"matcher-inner\", embeded)\n }", "validate(input) {\r\n return new Promise((resolve, reject) => {\r\n SwaggerParser.validate(input+'.yaml').then((api) => {\r\n resolve(true);\r\n }).catch((err) => {\r\n \t\t console.log(err);\r\n resolve('You must provide an existing OpenAPI spec (yaml file in working directory) and the spec MUST be valid');\r\n });\r\n });\r\n }", "function assert(bool, message) {\n\tif (!bool) {\n\t\tthrow new ParseException(message);\n\t}\n}", "initParsers() {\n this.parserRegistry = new ParserRegistry();\n }", "function assertValidXMLResponse(responseXML) {\n assert(!responseXML.isAbsent(), Const_1.EMPTY_RESPONSE, Const_1.PHASE_PROCESS_RESPONSE);\n assert(!responseXML.isXMLParserError(), responseXML.parserErrorText(Const_1.EMPTY_STR), Const_1.PHASE_PROCESS_RESPONSE);\n assert(responseXML.querySelectorAll(Const_1.XML_TAG_PARTIAL_RESP).isPresent(), Const_1.ERR_NO_PARTIAL_RESPONSE, Const_1.PHASE_PROCESS_RESPONSE);\n }", "function isDOMRequired() { \n\treturn true;\n}", "function ConditionParser() {}", "function Parser() {\r\n this.lexer = new zz.Lexer();\r\n }", "function Parser() {\n var nodeFactory = arguments.length <= 0 || arguments[0] === undefined ? new _nodeFactory.NodeFactory() : arguments[0];\n\n _classCallCheck(this, Parser);\n\n this.nodeFactory = nodeFactory;\n }", "function isDOMRequired()\n{\n\treturn true;\n}", "function peek(parser, kind) {\n return parser.token.kind === kind;\n}", "function parseAndAssertThrows() {\n var args = arguments;\n assertThrows(function() {\n parseHtmlSubset.apply(null, args);\n });\n}", "function _setupParser(){\n\t\t//Extend the parser with the local displayError function\n\t\tparser.displayError = displayError;\n\n\t\t$('html')\n\t\t\t.fileDragAndDrop(function(fileCollection){\n\t\t\t\t_resetUI();\n\n\t\t\t\t//Reset lists\n\t\t\t\tparser.errorList = [];\n\t\t\t\tparser.songList = [];\n\n\t\t\t\t//Loop through each file and parse it\n\t\t\t\t$.each(fileCollection, parser.parseFile);\n\n\t\t\t\t//Parsing complete, run the display/output functions\n\t\t\t\tparser.complete($output);\n\n\t\t\t\t//Update the total converted song count\n\t\t\t\t_updateSongCount(parser.songList.length);\n\t\t\t\t\n\t\t\t\t//Also display errors if there are any\n\t\t\t\tif(parser.errorList.length){\n\n\t\t\t\t\tvar errorTitle = parser.errorList.length == 1 ? \"One song ran into an error and could not be converted\": \"We ran into errors with \" + parser.errorList.length + \" of the songs, and they were not converted\";\n\n\t\t\t\t\t//Join all the error messages together\n\t\t\t\t\tdisplayError(parser.errorList.join(\"<br/>\"), errorTitle);\n\t\t\t\t}\n\n\t\t\t});\n\t}", "function Parser(grammar) {\n _classCallCheck(this, Parser);\n\n this.grammar = grammar;\n } // Parse `line` using current grammar. Returns {success: true} if the", "function validateLoaderOptions(loaderOptions) {\n const loaderOptionKeys = Object.keys(loaderOptions);\n for (let i = 0; i < loaderOptionKeys.length; i++) {\n const option = loaderOptionKeys[i];\n const isUnexpectedOption = validLoaderOptions.indexOf(option) === -1;\n if (isUnexpectedOption) {\n throw new Error(`ts-loader was supplied with an unexpected loader option: ${option}\n\nPlease take a look at the options you are supplying; the following are valid options:\n${validLoaderOptions.join(' / ')}\n`);\n }\n }\n if (loaderOptions.context !== undefined &&\n !path.isAbsolute(loaderOptions.context)) {\n throw new Error(`Option 'context' has to be an absolute path. Given '${loaderOptions.context}'.`);\n }\n}", "function checkReady() {\r\n\tvar isReady = (domContentLoaded && (xhrDug.readyState == xhrDug.DONE && xhrBuried.readyState == xhrBuried.DONE) || DBG_FAKE_RESPONSE);\r\n\tDBG && win.console.info('checkReady', isReady);\r\n\tif (isReady) {\r\n\t\tonReady();\r\n\t}\r\n}", "static parse(parseTokens) {\n let isParsed = false;\n CSTTree = new mackintosh.CST();\n ASTTree = new mackintosh.CST();\n tokenPointer = 0;\n _Functions.log(\"\\n\");\n _Functions.log(\"\\n\");\n _Functions.log(\"PARSER - Parsing Program \" + (programCount - 1));\n //Check if there are tokens in the token stream.\n if (parseTokens.length == 0) {\n _Functions.log(\"PARSER ERROR - There are no tokens to be parsed.\");\n parseErrCount++;\n }\n //Begin parse.\n else {\n //Use try catch to check for parse failures and output them.\n try {\n this.parseProgram(parseTokens);\n _Functions.log(\"PARSER - Parse completed with \" + parseErrCount + \" errors and \" +\n parseWarnCount + \" warnings\");\n //Prints the CST if there are no more errors.\n if (parseErrCount <= 0) {\n isParsed = true;\n _Functions.log(\"\\n\");\n _Functions.log(\"\\n\");\n _Functions.log(\"PARSER - Program \" + (programCount - 1) + \" CST:\");\n _Functions.log(CSTTree.toString());\n _Functions.log(\"\\n\");\n _Functions.log(\"\\n\");\n _Functions.log(\"PARSER - Program \" + (programCount - 1) + \" AST:\");\n _Functions.log(ASTTree.toString());\n }\n else {\n isParsed = false;\n _Functions.log(\"\\n\");\n _Functions.log(\"\\n\");\n _Functions.log(\"PARSER - CST and AST not displayed due to parse errors.\");\n }\n }\n catch (error) {\n _Functions.log(error);\n _Functions.log(\"PARSER - Error caused parse to end.\");\n parseErrCount++;\n }\n }\n return isParsed;\n }", "function GherkinParser() {\n if (!(this instanceof GherkinParser))\n return new GherkinParser();\n\n this.matchers_ = [\n {name: 'assertionFailed', re: /Assertion Failed/},\n {name: 'summaryError', re: /[1-9]0* failed/},\n {name: 'failingScenariosStart', re: /Failing scenarios:/}\n ]\n}", "function sanityCheck() {\n const errors = [];\n // Webworkers\n if (!window.Worker) errors.push(\"WebWorkers\");\n // IndexedDB\n if (!window.indexedDB) errors.push(\"IndexedDB\");\n // Notifications\n if (!window.Notification) errors.push(\"Notifications\");\n\n errors.length > 0 ? showErrors(errors) : setUp();\n}", "function getDOMParser() {\n domParser = domParser || new DOMParser();\n return domParser;\n }", "function parseDebug(parser) {\n const elems = parser.elems;\n if (elems.length === 0) {\n return {'error': 'expected `true` or `false` value, found nothing'};\n } else if (elems.length !== 1 || elems[0].kind !== 'boolean') {\n return {'error': `expected \\`true\\` or \\`false\\` value, found \\`${parser.getRawArgs()}\\``};\n }\n return {\n 'instructions': [\n 'if (arg && arg.debug_log && arg.debug_log.setDebugEnabled) {\\n' +\n `arg.debug_log.setDebugEnabled(${elems[0].getRaw()});\\n` +\n '} else {\\n' +\n 'throw \"`debug` command needs an object with a `debug_log` field of `Debug` type!\";\\n' +\n '}',\n ],\n 'wait': false,\n };\n}", "function detectCustomBeaconLayout(parser: number): Promise<any> {\n return new Promise((resolve, reject) => {\n BeaconsManager.addParser(parser, resolve, reject);\n });\n}", "function TextParser() {}", "function TextParser() {}", "function peek(parser, kind) {\n\t return parser.token.kind === kind;\n\t}", "function SpecParser() {\n this.result = {};\n }", "function Parser(input) {\n // Make a new lexer\n this.lexer = new Lexer(input);\n}", "parseXMLFile(rootElement) {\n console.log(rootElement);\n\n window.yasxml = rootElement;\n\n try {\n this.yas = new XMLYas(rootElement);\n console.log(this.yas);\n return true;\n } catch (e) {\n console.error(e);\n return false;\n }\n }", "constructor(type) { \n this.type = type \n this.parser = null\n }", "_assertEmitterExists(method = '') {\n if (!exists(this.emitter)) {\n throw new Error(\n `${this.name}.${method} : No emitter found, check if initEmittable() has been called`\n );\n }\n }", "static load() {\n throw new Error(\"`EmberExamMochaTestLoader` doesn't support `load()`.\");\n }" ]
[ "0.7156789", "0.6624209", "0.6299487", "0.5044321", "0.48598248", "0.48455465", "0.48403692", "0.48403692", "0.4722353", "0.47192177", "0.47176996", "0.47054106", "0.47054106", "0.47054106", "0.47054106", "0.47034496", "0.47034496", "0.47034496", "0.47034496", "0.4699272", "0.46885732", "0.4687649", "0.46853155", "0.467367", "0.4668967", "0.46632686", "0.46592963", "0.46478423", "0.46294218", "0.45627686", "0.45307517", "0.44946212", "0.44540766", "0.4434482", "0.44325194", "0.43986455", "0.43707314", "0.43697023", "0.43640807", "0.43640807", "0.4333349", "0.43267092", "0.4320485", "0.4307932", "0.42979303", "0.42921233", "0.42921233", "0.42921233", "0.42921233", "0.42921233", "0.42921233", "0.42921233", "0.42921233", "0.42921233", "0.42848304", "0.42848304", "0.42848304", "0.42848304", "0.42848304", "0.42848304", "0.42515495", "0.42506412", "0.42245954", "0.42122692", "0.41925478", "0.4182584", "0.41606265", "0.4158335", "0.4140698", "0.41295636", "0.411458", "0.41052106", "0.4100681", "0.4082066", "0.4076257", "0.406063", "0.40511826", "0.4041623", "0.40396228", "0.40213606", "0.40156126", "0.4012961", "0.40107408", "0.39984456", "0.39984456", "0.39816818", "0.3978289", "0.39769652", "0.39734626", "0.3969671", "0.3968162", "0.39645147" ]
0.7231419
7
Assert a compiler is available.
function assertCompiler(name, Compiler) { if (typeof Compiler !== 'function') { throw new Error('Cannot `' + name + '` without `Compiler`') } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function assertCompiler(name, Compiler) {\n if (!func(Compiler)) {\n throw new Error('Cannot `' + name + '` without `Compiler`');\n }\n}", "function startMyCompiler() {\n throw new Error('You have no compiler!');\n}", "function _isSupported() {\n _state = 1;\n if (typeof chai !== \"undefined\") {\n _chai = chai;\n assert = _chai.assert;\n\n } else {\n _cat.core.log.info(\"Chai library is not supported, skipping annotation 'assert', consider adding it to the .catproject dependencies\");\n }\n }", "function ensure() {\n let platform = _os.platform();\n\n if (0 > SUPPORTED_PLATFORMS.indexOf(platform)) {\n throw _dev.createError('Environment PHP does not support the ' + platform.toUpperCase() + ' platform.');\n }\n }", "function checkCliDependency() {\n checkIfChcpInstalled(function(err) {\n if (err) {\n suggestCliInstallation();\n }\n\n logEnd();\n });\n}", "apply(compiler) {\n compiler.hooks.invalid.tap('invalid', () => {\n this.stdout('compiling...');\n });\n\n compiler.hooks.done.tap('done', stats => {\n // don't care about module messages\n // just warnings + errors\n const statsData = stats.toJson({\n all: false,\n warnings: true,\n errors: true\n });\n\n const wasSuccessful =\n !statsData.errors.length && !statsData.warnings.length;\n if (wasSuccessful) {\n this.stdout('success!');\n }\n\n if (statsData.errors.length) {\n const error = statsData.errors[0];\n return this.stdout(formatErrorMessage(error));\n }\n\n if (statsData.warnings.length) {\n this.stdout(statsData.warnings.join('\\n\\n'));\n }\n });\n }", "function cnc_check_if_loaded() {\n try {\n if (typeof qx != 'undefined') {\n a = qx.core.Init.getApplication(); // application\n if (a) {\n cncopt_create();\n } else {\n window.setTimeout(cnc_check_if_loaded, 1000);\n }\n } else {\n window.setTimeout(cnc_check_if_loaded, 1000);\n }\n } catch (e) {\n if (typeof console != 'undefined') console.log(e);\n else if (window.opera) opera.postError(e);\n else console.log(e);\n }\n }", "function sanityCheck() {\n const errors = [];\n // Webworkers\n if (!window.Worker) errors.push(\"WebWorkers\");\n // IndexedDB\n if (!window.indexedDB) errors.push(\"IndexedDB\");\n // Notifications\n if (!window.Notification) errors.push(\"Notifications\");\n\n errors.length > 0 ? showErrors(errors) : setUp();\n}", "function cnc_check_if_loaded() {\n try {\n if (typeof qx != 'undefined') {\n a = qx.core.Init.getApplication(); // application\n if (a) {\n cncopt_create();\n } else {\n window.setTimeout(cnc_check_if_loaded, 1000);\n }\n } else {\n window.setTimeout(cnc_check_if_loaded, 1000);\n }\n } catch (e) {\n if (typeof console != 'undefined') console.log(e);\n else if (window.opera) opera.postError(e);\n else GM_log(e);\n }\n }", "async checkIfConfigured () {\r\n this.path = await this._getToolPath()\r\n return this.path != null\r\n }", "async checkIfConfigured () {\r\n this.path = await this._getToolPath()\r\n return this.path != null\r\n }", "function assert(condition, message) {\n if ((0, _devtoolsEnvironment.isDevelopment)() && !condition) {\n throw new Error(`Assertion failure: ${message}`);\n }\n}", "function areDependenciesAvailable() {}", "checkDependencies() {\n if(os.platform() === \"linux\") {\n Helpers.isPackageInstalled(\"wmctrl\")\n .catch((error) => {\n var message = \"This tool uses <strong>wmctrl</strong> to focus the Path of Exile window. It is recommended to install it for an optimal experience.\";\n new TextEntry(\"Missing dependency\", message, {icon: \"fa-exclamation-triangle yellow\"}).add();\n });\n }\n }", "async assertImplementation() {\n if (_env.env.EXPO_NO_TYPESCRIPT_SETUP) {\n Log.warn(\"Skipping TypeScript setup: EXPO_NO_TYPESCRIPT_SETUP is enabled.\");\n return;\n }\n debug(\"Ensuring TypeScript support is setup\");\n const tsConfigPath = _path.default.join(this.projectRoot, \"tsconfig.json\");\n // Ensure the project is TypeScript before continuing.\n const intent = await this._getSetupRequirements();\n if (!intent) {\n return;\n }\n // Ensure TypeScript packages are installed\n await this._ensureDependenciesInstalledAsync();\n // Update the config\n await (0, _updateTSConfig).updateTSConfigAsync({\n tsConfigPath,\n isBootstrapping: intent.isBootstrapping\n });\n }", "function detectCompilerInfo(decoded) {\n if (typeof decoded !== \"object\" || decoded === null) {\n return undefined;\n }\n //cbor sometimes returns maps and sometimes objects,\n //so let's make things consistent by converting to a map\n //(although see note above?)\n if (!(decoded instanceof Map)) {\n decoded = new Map(Object.entries(decoded));\n }\n if (!decoded.has(\"solc\")) {\n //return undefined if the solc version field is not present\n //(this occurs if version <0.5.9)\n //currently no other language attaches cbor info, so, yeah\n return undefined;\n }\n const rawVersion = decoded.get(\"solc\");\n if (typeof rawVersion === \"string\") {\n //for prerelease versions, the version is stored as a string.\n return {\n name: \"solc\",\n version: rawVersion\n };\n }\n else if (rawVersion instanceof Uint8Array && rawVersion.length === 3) {\n //for release versions, it's stored as a bytestring of length 3, with the\n //bytes being major, minor, patch. so we just join them with \".\" to form\n //a version string (although it's missing precise commit & etc).\n return {\n name: \"solc\",\n version: rawVersion.join(\".\")\n };\n }\n else {\n //return undefined on anything else\n return undefined;\n }\n}", "function ensureReady(vm, cb) {\n if (!vm.$compiler.init) return cb();\n vm.$once('hook:ready', cb);\n}", "async function checkExecution() {\n await (async () => {\n const m = new Module('import { nonexistent } from \"module\";');\n await m.link(common.mustCall(() => new Module('')));\n\n // There is no code for this exception since it is thrown by the JavaScript\n // engine.\n assert.throws(() => {\n m.instantiate();\n }, SyntaxError);\n })();\n\n await (async () => {\n const m = new Module('throw new Error();');\n await m.link(common.mustNotCall());\n m.instantiate();\n const evaluatePromise = m.evaluate();\n await evaluatePromise.catch(() => {});\n assert.strictEqual(m.status, 'errored');\n try {\n await evaluatePromise;\n } catch (err) {\n assert.strictEqual(m.error, err);\n return;\n }\n assert.fail('Missing expected exception');\n })();\n}", "function main () {\n if (process.platform === 'win32') {\n console.error('Sorry, check-deps only works on Mac and Linux')\n return\n }\n\n var usedDeps = findUsedDeps()\n var packageDeps = findPackageDeps()\n\n var missingDeps = usedDeps.filter(\n (dep) => !includes(packageDeps, dep) && !includes(BUILT_IN_DEPS, dep)\n )\n var unusedDeps = packageDeps.filter(\n (dep) => !includes(usedDeps, dep) && !includes(EXECUTABLE_DEPS, dep)\n )\n\n if (missingDeps.length > 0) {\n console.error('Missing package dependencies: ' + missingDeps)\n }\n if (unusedDeps.length > 0) {\n console.error('Unused package dependencies: ' + unusedDeps)\n }\n if (missingDeps.length + unusedDeps.length > 0) {\n process.exitCode = 1\n }\n}", "function _check_modules(){\n // ADD MODULES CHECKS BELOW\n _checkModule('Chrome_serial');\n _checkModule('serial_console'); // check that the neatFramework \"serial_console\" module is present\n }", "function assert(condition, message) {\n if (!condition) {\n throw new Error(message || 'loader assertion failed.');\n }\n}", "function assert(condition, message) {\n if (!condition) {\n throw new Error(message || 'loader assertion failed.');\n }\n}", "function assert(condition, message) {\n if (!condition) {\n throw new Error(message || 'loader assertion failed.');\n }\n}", "function assert(condition, message) {\n if (!condition) {\n throw new Error(message || 'loader assertion failed.');\n }\n}", "function cnc_check_if_loaded() {\n\t\t\t\t\ttry {\n\t\t\t\t\t\tif (typeof qx != 'undefined') {\n\t\t\t\t\t\t\ta = qx.core.Init.getApplication(); // application\n\t\t\t\t\t\t\tif (a) {\n\t\t\t\t\t\t\t\tcnctaopt_create();\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\twindow.setTimeout(cnc_check_if_loaded, 1000);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\twindow.setTimeout(cnc_check_if_loaded, 1000);\n\t\t\t\t\t\t}\n\t\t\t\t\t} catch (e) {\n\t\t\t\t\t\tif (typeof console != 'undefined') console.log(e);\n\t\t\t\t\t\telse if (window.opera) opera.postError(e);\n\t\t\t\t\t\telse GM_log(e);\n\t\t\t\t\t}\n\t\t\t\t}", "function VersionCompiler() {\n}", "function Compiler() {\n}", "function cnc_check_if_loaded() {\n\t\ttry {\n\t\t\tif (typeof qx != 'undefined') {\n\t\t\t\ta = qx.core.Init.getApplication(); // application\n\t\t\t\tif (a) {\n\t\t\t\t\tcncloot_create();\n\t\t\t\t} else {\n\t\t\t\t\twindow.setTimeout(cnc_check_if_loaded, 1000);\n }\n\t\t\t} else {\n\t\t\t\twindow.setTimeout(cnc_check_if_loaded, 1000);\n\t\t\t}\n\t\t} catch (e) {\n\t\t\tif (typeof console != 'undefined') console.log(e);\n\t\t\telse if (window.opera) opera.postError(e);\n\t\t\telse GM_log(e);\n\t\t}\n\t}", "apply(compiler) {\n // Specify the event hook to attach to\n compiler.hooks.done.tap(\n 'BailPlugin',\n (stats) => {\n if (IS_DEV_SERVER === false && stats.hasErrors() === true) {\n throw new Error(stats.compilation.errors.map((err) => err.message || err));\n }\n }\n );\n }", "_checkConfigured() {\n if (typeof ngDevMode === 'undefined' || ngDevMode) {\n if (!this._pointerTracker) {\n throwMissingPointerFocusTracker();\n }\n if (!this._menu) {\n throwMissingMenuReference();\n }\n }\n }", "function assert(cond) {\n if (!cond) {\n throw new Error(\"assertion error\");\n }\n}", "function checkToolchain () {\n return new Promise((resolve, reject) => {\n const toolBinPath = getToolBinPath()\n exec(`${toolBinPath} toolchain list`).then((results) => {\n const { stdout } = results;\n const matches = (/^(?=nightly)(.*)$/mi).exec(stdout);\n\n // If found, we're done\n if (matches) {\n return resolve(matches[0])\n }\n\n // If not found, install it\n // Ask to install\n atomPrompt(\"`rustup` missing nightly toolchain\", {\n detail: \"rustup toolchain install nightly\",\n }, [\"Install\"]).then((response) => {\n if (response === \"Install\") {\n installNightly().then(checkToolchain).then(resolve).catch(reject)\n } else {\n reject();\n }\n })\n }).catch(() => {\n // Missing rustup\n // Ask to install\n atomPrompt(\"`rustup` is not available\", {\n description: \"From https://www.rustup.rs/\",\n detail: \"curl https://sh.rustup.rs -sSf | sh\",\n }, [\"Install\"]).then((response) => {\n if (response === \"Install\") {\n // Install rustup and try again\n installRustup().then(checkToolchain).then(resolve).catch(reject)\n } else {\n reject();\n }\n })\n })\n })\n}", "compile() {\n if (this.currentProgram.isExecutable()) {\n this.messageBox.message = \"Erfolgreich übersetzt!\\nProgramm kann ausgeführt werden.\"\n } else if (this.currentProgram.isNotExecutable()) {\n this.messageBox.message = \"Übersetzungsfehler!\\n\" + this.currentProgram.errorMessage;\n } else if (this.currentProgram.isUnknown()) {\n this.messageBox.message = \"Backend ist noch nicht implementiert.\\nSelbst geschriebene Programme können noch nicht übersetzt werden.\\nBitte verwende ein Beispielprogramm.\";\n } else {\n console.error(\"Unbekannter Status in currentProgram.\");\n }\n }", "isToolchainInstalled(toolchain) {\r\n return this.toolchains.find(t => t.equals(toolchain)) !== undefined;\r\n }", "function assert(cond) {\n if (!cond) throw new Error('Assertion error');\n }", "function checkInit() {\n if (glEnums == null) {\n throw 'WebGLDebugUtils.init(ctx) not called';\n }\n}", "function checkInit() {\n if (glEnums == null) {\n throw 'WebGLDebugUtils.init(ctx) not called';\n }\n}", "function checkError(status) { // fn beep if compilation errors\n if (status.compilation.errors.length > 0) {\n gutil.beep();\n }\n }", "function makeCompiler() {\n\tif (!config) {\n\t\tmakeConfig();\n\t}\n\n\tcompiler = webpack(config);\n\tif (options.useMemoryFs)\n\t\tmemoryFileSystem = compiler.outputFileSystem = getOutputFileSystem();\n\n\tlog('webpack: First compilation');\n\tcompiler.run(makeWebpackCallback(false));\n\tlog('webpack: Watching');\n\tcompiler.watch({},makeWebpackCallback(true));\n\n\n\tcompiler.plugin(\"invalid\", invalidPlugin);\n\tcompiler.plugin(\"watch-run\", invalidAsyncPlugin);\n\tcompiler.plugin(\"run\", invalidAsyncPlugin);\n\n\n\n\n\n\tcompiler.plugin(\"done\", stats => {\n\t\t// We are now on valid state\n\t\tstate = true;\n\n\n\t\tfunction continueBecauseBundleAvailable(cb) {\n\t\t\tcb();\n\t\t}\n\n\t\tfunction readyCallback() {\n\t\t\t// check if still in valid state\n\t\t\tif(!state) return;\n\n\t\t\tlog(`webpack compiled ${stats.toString(config.stats || {})}`)\n\n\t\t\t// print webpack output\n\t\t\tlet displayStats = (!options.quiet && config.stats !== false) ||\n\t\t\t\tstats.hasErrors() || stats.hasWarnings()\n\n\t\t\tif(displayStats)\n\t\t\t\tlog(stats.toString(options.stats));\n\n\t\t\t// if (!options.noInfo && !options.quiet)\n\t\t\tlog(\"webpack: bundle is now VALID.\");\n\n\t\t\t// execute callback that are delayed\n\t\t\tvar cbs = compilationCallbacks;\n\t\t\tcompilationCallbacks = [];\n\t\t\tcbs.forEach(continueBecauseBundleAvailable);\n\t\t}\n\n\t\t// Do the stuff in nextTick, because bundle may be invalidated\n\t\t// if a change happened while compiling\n\t\tprocess.nextTick(readyCallback);\n\n\t\t// In lazy mode, we may issue another rebuild\n\t\tif(forceRebuild) {\n\t\t\tforceRebuild = false;\n\t\t\trebuild();\n\t\t}\n\t});\n}", "function assertPlatform(requiredToken){var platform=getPlatform();if(!platform){throw new Error('No platform exists!');}if(!platform.injector.get(requiredToken,null)){throw new Error('A platform with a different configuration has been created. Please destroy it first.');}return platform;}", "function createAotCompiler(compilerHost,options,errorCollector){var translations=options.translations||'';var urlResolver=createAotUrlResolver(compilerHost);var symbolCache=new StaticSymbolCache();var summaryResolver=new AotSummaryResolver(compilerHost,symbolCache);var symbolResolver=new StaticSymbolResolver(compilerHost,symbolCache,summaryResolver);var staticReflector=new StaticReflector(summaryResolver,symbolResolver,[],[],errorCollector);var htmlParser;if(!!options.enableIvy){// Ivy handles i18n at the compiler level so we must use a regular parser\nhtmlParser=new HtmlParser();}else{htmlParser=new I18NHtmlParser(new HtmlParser(),translations,options.i18nFormat,options.missingTranslation,console);}var config=new CompilerConfig({defaultEncapsulation:ViewEncapsulation.Emulated,useJit:false,missingTranslation:options.missingTranslation,preserveWhitespaces:options.preserveWhitespaces,strictInjectionParameters:options.strictInjectionParameters});var normalizer=new DirectiveNormalizer({get:function get(url){return compilerHost.loadResource(url);}},urlResolver,htmlParser,config);var expressionParser=new Parser(new Lexer());var elementSchemaRegistry=new DomElementSchemaRegistry();var tmplParser=new TemplateParser(config,staticReflector,expressionParser,elementSchemaRegistry,htmlParser,console,[]);var resolver=new CompileMetadataResolver(config,htmlParser,new NgModuleResolver(staticReflector),new DirectiveResolver(staticReflector),new PipeResolver(staticReflector),summaryResolver,elementSchemaRegistry,normalizer,console,symbolCache,staticReflector,errorCollector);// TODO(vicb): do not pass options.i18nFormat here\nvar viewCompiler=new ViewCompiler(staticReflector);var typeCheckCompiler=new TypeCheckCompiler(options,staticReflector);var compiler=new AotCompiler(config,options,compilerHost,staticReflector,resolver,tmplParser,new StyleCompiler(urlResolver),viewCompiler,typeCheckCompiler,new NgModuleCompiler(staticReflector),new InjectableCompiler(staticReflector,!!options.enableIvy),new TypeScriptEmitter(),summaryResolver,symbolResolver);return{compiler:compiler,reflector:staticReflector};}", "async function compiler() {\n\ttry {\n\t await electronInstaller.createWindowsInstaller({\n\t appDirectory: '/var/www/nicoldesktop/release-builds/Insurance-win32-ia32',\n\t outputDirectory: '/var/www/nicoldesktop/release-builds/Insurance-win32-ia32/installer',\n\t authors: 'NICOL Devs',\n\t exe: 'Insurance.exe',\n\t iconUrl: '/var/www/nicoldesktop/assets/icons/win/icon.ico', \n\t setupIcon: '/var/www/nicoldesktop/assets/icons/win/icon.ico',\n\t setupExe: 'NICOL.exe',\n\t setupMsi: 'NICOL.exe'\n\t });\n\t console.log('It worked!');\n\t} catch (e) {\n\t console.log(`No dice: ${e.message}`);\n\t}\n}", "function assertPlatform(requiredToken) {\n var platform = getPlatform();\n if (!platform) {\n throw new Error('No platform exists!');\n }\n if (!platform.injector.get(requiredToken, null)) {\n throw new Error('A platform with a different configuration has been created. Please destroy it first.');\n }\n return platform;\n}", "function assertPlatform(requiredToken) {\n var platform = getPlatform();\n if (!platform) {\n throw new Error('No platform exists!');\n }\n if (!platform.injector.get(requiredToken, null)) {\n throw new Error('A platform with a different configuration has been created. Please destroy it first.');\n }\n return platform;\n}", "function assertPlatform(requiredToken) {\n var platform = getPlatform();\n if (!platform) {\n throw new Error('No platform exists!');\n }\n if (!platform.injector.get(requiredToken, null)) {\n throw new Error('A platform with a different configuration has been created. Please destroy it first.');\n }\n return platform;\n}", "function assertPlatform(requiredToken) {\n var platform = getPlatform();\n if (!platform) {\n throw new Error('No platform exists!');\n }\n if (!platform.injector.get(requiredToken, null)) {\n throw new Error('A platform with a different configuration has been created. Please destroy it first.');\n }\n return platform;\n}", "function assertPlatform(requiredToken) {\n var platform = getPlatform();\n if (!platform) {\n throw new Error('No platform exists!');\n }\n if (!platform.injector.get(requiredToken, null)) {\n throw new Error('A platform with a different configuration has been created. Please destroy it first.');\n }\n return platform;\n}", "function assertPlatform(requiredToken) {\n const platform = getPlatform();\n if (!platform) {\n throw new Error('No platform exists!');\n }\n if (!platform.injector.get(requiredToken, null)) {\n throw new Error('A platform with a different configuration has been created. Please destroy it first.');\n }\n return platform;\n}", "function assertPlatform(requiredToken) {\n const platform = getPlatform();\n if (!platform) {\n throw new Error('No platform exists!');\n }\n if (!platform.injector.get(requiredToken, null)) {\n throw new Error('A platform with a different configuration has been created. Please destroy it first.');\n }\n return platform;\n}", "function assertPlatform(requiredToken) {\n const platform = getPlatform();\n if (!platform) {\n throw new Error('No platform exists!');\n }\n if (!platform.injector.get(requiredToken, null)) {\n throw new Error('A platform with a different configuration has been created. Please destroy it first.');\n }\n return platform;\n}", "function assertPlatform(requiredToken) {\n const platform = getPlatform();\n if (!platform) {\n throw new Error('No platform exists!');\n }\n if (!platform.injector.get(requiredToken, null)) {\n throw new Error('A platform with a different configuration has been created. Please destroy it first.');\n }\n return platform;\n}", "function assertPlatform(requiredToken) {\n const platform = getPlatform();\n if (!platform) {\n throw new Error('No platform exists!');\n }\n if (!platform.injector.get(requiredToken, null)) {\n throw new Error('A platform with a different configuration has been created. Please destroy it first.');\n }\n return platform;\n}", "function required() { }", "function test_code_generator_checkIfImplementations() {\n var workspace = create_typed_workspace();\n try {\n var prototypes = Object.keys(Blockly.Blocks);\n var blocks = [];\n for (var i = 0, type; type = prototypes[i]; i++) {\n if (!type.match(/\\w+_typed/)) {\n continue;\n }\n blocks.push(workspace.newBlock(type));\n }\n var code = Blockly.TypedLang.workspaceToCode(workspace);\n assertTrue(goog.isString(code));\n } finally {\n workspace.dispose();\n }\n}", "function assertPlatform(requiredToken) {\n var platform = getPlatform();\n if (lang_1.isBlank(platform)) {\n throw new exceptions_1.BaseException('Not platform exists!');\n }\n if (lang_1.isPresent(platform) && lang_1.isBlank(platform.injector.get(requiredToken, null))) {\n throw new exceptions_1.BaseException('A platform with a different configuration has been created. Please destroy it first.');\n }\n return platform;\n}", "function createAotCompiler(compilerHost, options, errorCollector) {\n let translations = options.translations || '';\n const urlResolver = createAotUrlResolver(compilerHost);\n const symbolCache = new StaticSymbolCache();\n const summaryResolver = new AotSummaryResolver(compilerHost, symbolCache);\n const symbolResolver = new StaticSymbolResolver(compilerHost, symbolCache, summaryResolver);\n const staticReflector = new StaticReflector(summaryResolver, symbolResolver, [], [], errorCollector);\n let htmlParser;\n if (!!options.enableIvy) {\n // Ivy handles i18n at the compiler level so we must use a regular parser\n htmlParser = new HtmlParser();\n }\n else {\n htmlParser = new I18NHtmlParser(new HtmlParser(), translations, options.i18nFormat, options.missingTranslation, console);\n }\n const config = new CompilerConfig({\n defaultEncapsulation: ViewEncapsulation.Emulated,\n useJit: false,\n missingTranslation: options.missingTranslation,\n preserveWhitespaces: options.preserveWhitespaces,\n strictInjectionParameters: options.strictInjectionParameters,\n });\n const normalizer = new DirectiveNormalizer({ get: (url) => compilerHost.loadResource(url) }, urlResolver, htmlParser, config);\n const expressionParser = new Parser$1(new Lexer());\n const elementSchemaRegistry = new DomElementSchemaRegistry();\n const tmplParser = new TemplateParser(config, staticReflector, expressionParser, elementSchemaRegistry, htmlParser, console, []);\n const resolver = new CompileMetadataResolver(config, htmlParser, new NgModuleResolver(staticReflector), new DirectiveResolver(staticReflector), new PipeResolver(staticReflector), summaryResolver, elementSchemaRegistry, normalizer, console, symbolCache, staticReflector, errorCollector);\n // TODO(vicb): do not pass options.i18nFormat here\n const viewCompiler = new ViewCompiler(staticReflector);\n const typeCheckCompiler = new TypeCheckCompiler(options, staticReflector);\n const compiler = new AotCompiler(config, options, compilerHost, staticReflector, resolver, tmplParser, new StyleCompiler(urlResolver), viewCompiler, typeCheckCompiler, new NgModuleCompiler(staticReflector), new InjectableCompiler(staticReflector, !!options.enableIvy), new TypeScriptEmitter(), summaryResolver, symbolResolver);\n return { compiler, reflector: staticReflector };\n}", "function createAotCompiler(compilerHost, options, errorCollector) {\n let translations = options.translations || '';\n const urlResolver = createAotUrlResolver(compilerHost);\n const symbolCache = new StaticSymbolCache();\n const summaryResolver = new AotSummaryResolver(compilerHost, symbolCache);\n const symbolResolver = new StaticSymbolResolver(compilerHost, symbolCache, summaryResolver);\n const staticReflector = new StaticReflector(summaryResolver, symbolResolver, [], [], errorCollector);\n let htmlParser;\n if (!!options.enableIvy) {\n // Ivy handles i18n at the compiler level so we must use a regular parser\n htmlParser = new HtmlParser();\n }\n else {\n htmlParser = new I18NHtmlParser(new HtmlParser(), translations, options.i18nFormat, options.missingTranslation, console);\n }\n const config = new CompilerConfig({\n defaultEncapsulation: ViewEncapsulation.Emulated,\n useJit: false,\n missingTranslation: options.missingTranslation,\n preserveWhitespaces: options.preserveWhitespaces,\n strictInjectionParameters: options.strictInjectionParameters,\n });\n const normalizer = new DirectiveNormalizer({ get: (url) => compilerHost.loadResource(url) }, urlResolver, htmlParser, config);\n const expressionParser = new Parser$1(new Lexer());\n const elementSchemaRegistry = new DomElementSchemaRegistry();\n const tmplParser = new TemplateParser(config, staticReflector, expressionParser, elementSchemaRegistry, htmlParser, console, []);\n const resolver = new CompileMetadataResolver(config, htmlParser, new NgModuleResolver(staticReflector), new DirectiveResolver(staticReflector), new PipeResolver(staticReflector), summaryResolver, elementSchemaRegistry, normalizer, console, symbolCache, staticReflector, errorCollector);\n // TODO(vicb): do not pass options.i18nFormat here\n const viewCompiler = new ViewCompiler(staticReflector);\n const typeCheckCompiler = new TypeCheckCompiler(options, staticReflector);\n const compiler = new AotCompiler(config, options, compilerHost, staticReflector, resolver, tmplParser, new StyleCompiler(urlResolver), viewCompiler, typeCheckCompiler, new NgModuleCompiler(staticReflector), new InjectableCompiler(staticReflector, !!options.enableIvy), new TypeScriptEmitter(), summaryResolver, symbolResolver);\n return { compiler, reflector: staticReflector };\n}", "function createAotCompiler(compilerHost, options, errorCollector) {\n let translations = options.translations || '';\n const urlResolver = createAotUrlResolver(compilerHost);\n const symbolCache = new StaticSymbolCache();\n const summaryResolver = new AotSummaryResolver(compilerHost, symbolCache);\n const symbolResolver = new StaticSymbolResolver(compilerHost, symbolCache, summaryResolver);\n const staticReflector = new StaticReflector(summaryResolver, symbolResolver, [], [], errorCollector);\n let htmlParser;\n if (!!options.enableIvy) {\n // Ivy handles i18n at the compiler level so we must use a regular parser\n htmlParser = new HtmlParser();\n }\n else {\n htmlParser = new I18NHtmlParser(new HtmlParser(), translations, options.i18nFormat, options.missingTranslation, console);\n }\n const config = new CompilerConfig({\n defaultEncapsulation: ViewEncapsulation.Emulated,\n useJit: false,\n missingTranslation: options.missingTranslation,\n preserveWhitespaces: options.preserveWhitespaces,\n strictInjectionParameters: options.strictInjectionParameters,\n });\n const normalizer = new DirectiveNormalizer({ get: (url) => compilerHost.loadResource(url) }, urlResolver, htmlParser, config);\n const expressionParser = new Parser$1(new Lexer());\n const elementSchemaRegistry = new DomElementSchemaRegistry();\n const tmplParser = new TemplateParser(config, staticReflector, expressionParser, elementSchemaRegistry, htmlParser, console, []);\n const resolver = new CompileMetadataResolver(config, htmlParser, new NgModuleResolver(staticReflector), new DirectiveResolver(staticReflector), new PipeResolver(staticReflector), summaryResolver, elementSchemaRegistry, normalizer, console, symbolCache, staticReflector, errorCollector);\n // TODO(vicb): do not pass options.i18nFormat here\n const viewCompiler = new ViewCompiler(staticReflector);\n const typeCheckCompiler = new TypeCheckCompiler(options, staticReflector);\n const compiler = new AotCompiler(config, options, compilerHost, staticReflector, resolver, tmplParser, new StyleCompiler(urlResolver), viewCompiler, typeCheckCompiler, new NgModuleCompiler(staticReflector), new InjectableCompiler(staticReflector, !!options.enableIvy), new TypeScriptEmitter(), summaryResolver, symbolResolver);\n return { compiler, reflector: staticReflector };\n}", "function createAotCompiler(compilerHost, options, errorCollector) {\n let translations = options.translations || '';\n const urlResolver = createAotUrlResolver(compilerHost);\n const symbolCache = new StaticSymbolCache();\n const summaryResolver = new AotSummaryResolver(compilerHost, symbolCache);\n const symbolResolver = new StaticSymbolResolver(compilerHost, symbolCache, summaryResolver);\n const staticReflector = new StaticReflector(summaryResolver, symbolResolver, [], [], errorCollector);\n let htmlParser;\n if (!!options.enableIvy) {\n // Ivy handles i18n at the compiler level so we must use a regular parser\n htmlParser = new HtmlParser();\n }\n else {\n htmlParser = new I18NHtmlParser(new HtmlParser(), translations, options.i18nFormat, options.missingTranslation, console);\n }\n const config = new CompilerConfig({\n defaultEncapsulation: ViewEncapsulation.Emulated,\n useJit: false,\n missingTranslation: options.missingTranslation,\n preserveWhitespaces: options.preserveWhitespaces,\n strictInjectionParameters: options.strictInjectionParameters,\n });\n const normalizer = new DirectiveNormalizer({ get: (url) => compilerHost.loadResource(url) }, urlResolver, htmlParser, config);\n const expressionParser = new Parser$1(new Lexer());\n const elementSchemaRegistry = new DomElementSchemaRegistry();\n const tmplParser = new TemplateParser(config, staticReflector, expressionParser, elementSchemaRegistry, htmlParser, console, []);\n const resolver = new CompileMetadataResolver(config, htmlParser, new NgModuleResolver(staticReflector), new DirectiveResolver(staticReflector), new PipeResolver(staticReflector), summaryResolver, elementSchemaRegistry, normalizer, console, symbolCache, staticReflector, errorCollector);\n // TODO(vicb): do not pass options.i18nFormat here\n const viewCompiler = new ViewCompiler(staticReflector);\n const typeCheckCompiler = new TypeCheckCompiler(options, staticReflector);\n const compiler = new AotCompiler(config, options, compilerHost, staticReflector, resolver, tmplParser, new StyleCompiler(urlResolver), viewCompiler, typeCheckCompiler, new NgModuleCompiler(staticReflector), new InjectableCompiler(staticReflector, !!options.enableIvy), new TypeScriptEmitter(), summaryResolver, symbolResolver);\n return { compiler, reflector: staticReflector };\n}", "function assertNodeEnv() {\r\n return assert(isNode, 'This feature is only available in NodeJS environments');\r\n }", "isMultiCompiler() {\n return this.projectConfig.files.length > 1;\n }", "static startCompile() {\n //Set compilation flag to true.\n isCompiling = true;\n _Functions.log('INFO: Beginning Compilation...');\n //Get source code from text area input.\n let code = document.getElementById(\"inputCode\").value;\n //code = mackintosh.compilerFunctions.trim(code);\n _Lexer.populateProgram(code);\n _Lexer.lex();\n //Check if there is a $ at the end of the program, if not display warning.\n if (program[program.length - 1] != '$') {\n _Functions.log('LEXER WARNING: End of Program $ Not Found.');\n warnCount++;\n }\n return isCompiling;\n }", "function assertPlatform(requiredToken) {\n var platform = getPlatform();\n\n if (!platform) {\n throw new Error('No platform exists!');\n }\n\n if (!platform.injector.get(requiredToken, null)) {\n throw new Error('A platform with a different configuration has been created. Please destroy it first.');\n }\n\n return platform;\n}", "function tryAssertHas(ctx, types)\n{\n try {\n assertHas(ctx,types);\n return true;\n } catch(e) {\n return false;\n }\n}", "assert(condition) {\n if (!condition) {\n throw \"Assert failed!\"\n }\n }", "function testSimpleCompilation() {\n RunTests([\n E([1, 2, 3], [1, 2, 3]),\n E(true, true),\n E(false, false),\n E(ccc.NIL, ccc.NIL),\n E(42, 42),\n E(new String('Ello'), new String('Ello')),\n ]);\n}", "function assertBrowserEnv() {\r\n return assert(isBrowser, 'This feature is only available in browser environments');\r\n }", "checkInit() {\n if (!this.cfgObj) {\n throw new Error(\"Project Config not initialized\");\n }\n }", "function check() {}", "function checkCode(){\n try {\n var checks = {\n mustContain: function(){return api.mustContain(editor.getValue(), document.getElementById('mustContain').value.replace(/ /g, '').split(','))},\n cantContain: function(){return api.cantContain(editor.getValue(), document.getElementById('cantContain').value.replace(/ /g, '').split(','))},\n matchesStructure: function(){return api.matchesStructure(editor.getValue(), matchesStructureInput.getValue())}\n };\n for(var key in checks) {\n //Reset the status indicator\n document.getElementById(key+'Status').className = 'resultIndicator';\n //Only run the tests for this constraint if it's not empty\n if(checks.hasOwnProperty(key) && document.getElementById(key).value !== '') {\n //If the code passed for this constraint\n if(checks[key]()) {\n document.getElementById(key+'Status').className += ' passing';\n }\n else {\n document.getElementById(key+'Status').className += ' failing';\n }\n }\n }\n } catch (e) {\n console.log(e);\n }\n}", "function cordovaJSCheck() {\n\tvar hasCordovaDotJS = (document.querySelector(\"script[src*='cordova.js']\")!=null);\n\tif(!hasCordovaDotJS){\n\t\tvar scr=document.createElement('script');\n\t\tscr.src='cordova.js';\n\t\tdocument.head.appendChild(scr);\n\t}\n}", "function assertPlatform(requiredToken) {\n const platform = getPlatform();\n if (!platform) {\n const errorMessage = (typeof ngDevMode === 'undefined' || ngDevMode) ? 'No platform exists!' : '';\n throw new RuntimeError(401 /* PLATFORM_NOT_FOUND */, errorMessage);\n }\n if ((typeof ngDevMode === 'undefined' || ngDevMode) &&\n !platform.injector.get(requiredToken, null)) {\n throw new RuntimeError(400 /* MULTIPLE_PLATFORMS */, 'A platform with a different configuration has been created. Please destroy it first.');\n }\n return platform;\n}", "function assert(cond) {\n if(!cond) {\n console.log(\"assertion failed\");\n } else {\n console.log(\"assertion passed\");\n }\n}", "function checkForDependency(cb) {\n var ajax = new XMLHttpRequest();\n ajax.onreadystatechange = function () {\n // noinspection EqualityComparisonWithCoercionJS\n if (this.readyState == 4 && this.status == 200) {\n // noinspection EqualityComparisonWithCoercionJS\n if (ajax.responseText == \"1\") {\n cb();\n } else {\n alert(\"wrtbwmon is not installed!\");\n }\n }\n };\n ajax.open('GET', basePath + '/check_dependency', true);\n ajax.send();\n }", "function createAotCompiler(compilerHost, options, errorCollector) {\n var translations = options.translations || '';\n var urlResolver = createAotUrlResolver(compilerHost);\n var symbolCache = new StaticSymbolCache();\n var summaryResolver = new AotSummaryResolver(compilerHost, symbolCache);\n var symbolResolver = new StaticSymbolResolver(compilerHost, symbolCache, summaryResolver);\n var staticReflector = new StaticReflector(summaryResolver, symbolResolver, [], [], errorCollector);\n var htmlParser;\n if (!!options.enableIvy) {\n // Ivy handles i18n at the compiler level so we must use a regular parser\n htmlParser = new HtmlParser();\n }\n else {\n htmlParser = new I18NHtmlParser(new HtmlParser(), translations, options.i18nFormat, options.missingTranslation, console);\n }\n var config = new CompilerConfig({\n defaultEncapsulation: ViewEncapsulation.Emulated,\n useJit: false,\n missingTranslation: options.missingTranslation,\n preserveWhitespaces: options.preserveWhitespaces,\n strictInjectionParameters: options.strictInjectionParameters,\n });\n var normalizer = new DirectiveNormalizer({ get: function (url) { return compilerHost.loadResource(url); } }, urlResolver, htmlParser, config);\n var expressionParser = new Parser$1(new Lexer());\n var elementSchemaRegistry = new DomElementSchemaRegistry();\n var tmplParser = new TemplateParser(config, staticReflector, expressionParser, elementSchemaRegistry, htmlParser, console, []);\n var resolver = new CompileMetadataResolver(config, htmlParser, new NgModuleResolver(staticReflector), new DirectiveResolver(staticReflector), new PipeResolver(staticReflector), summaryResolver, elementSchemaRegistry, normalizer, console, symbolCache, staticReflector, errorCollector);\n // TODO(vicb): do not pass options.i18nFormat here\n var viewCompiler = new ViewCompiler(staticReflector);\n var typeCheckCompiler = new TypeCheckCompiler(options, staticReflector);\n var compiler = new AotCompiler(config, options, compilerHost, staticReflector, resolver, tmplParser, new StyleCompiler(urlResolver), viewCompiler, typeCheckCompiler, new NgModuleCompiler(staticReflector), new InjectableCompiler(staticReflector, !!options.enableIvy), new TypeScriptEmitter(), summaryResolver, symbolResolver);\n return { compiler: compiler, reflector: staticReflector };\n}", "function createAotCompiler(compilerHost, options, errorCollector) {\n var translations = options.translations || '';\n var urlResolver = createAotUrlResolver(compilerHost);\n var symbolCache = new StaticSymbolCache();\n var summaryResolver = new AotSummaryResolver(compilerHost, symbolCache);\n var symbolResolver = new StaticSymbolResolver(compilerHost, symbolCache, summaryResolver);\n var staticReflector = new StaticReflector(summaryResolver, symbolResolver, [], [], errorCollector);\n var htmlParser;\n if (!!options.enableIvy) {\n // Ivy handles i18n at the compiler level so we must use a regular parser\n htmlParser = new HtmlParser();\n }\n else {\n htmlParser = new I18NHtmlParser(new HtmlParser(), translations, options.i18nFormat, options.missingTranslation, console);\n }\n var config = new CompilerConfig({\n defaultEncapsulation: ViewEncapsulation.Emulated,\n useJit: false,\n missingTranslation: options.missingTranslation,\n preserveWhitespaces: options.preserveWhitespaces,\n strictInjectionParameters: options.strictInjectionParameters,\n });\n var normalizer = new DirectiveNormalizer({ get: function (url) { return compilerHost.loadResource(url); } }, urlResolver, htmlParser, config);\n var expressionParser = new Parser(new Lexer());\n var elementSchemaRegistry = new DomElementSchemaRegistry();\n var tmplParser = new TemplateParser(config, staticReflector, expressionParser, elementSchemaRegistry, htmlParser, console, []);\n var resolver = new CompileMetadataResolver(config, htmlParser, new NgModuleResolver(staticReflector), new DirectiveResolver(staticReflector), new PipeResolver(staticReflector), summaryResolver, elementSchemaRegistry, normalizer, console, symbolCache, staticReflector, errorCollector);\n // TODO(vicb): do not pass options.i18nFormat here\n var viewCompiler = new ViewCompiler(staticReflector);\n var typeCheckCompiler = new TypeCheckCompiler(options, staticReflector);\n var compiler = new AotCompiler(config, options, compilerHost, staticReflector, resolver, tmplParser, new StyleCompiler(urlResolver), viewCompiler, typeCheckCompiler, new NgModuleCompiler(staticReflector), new InjectableCompiler(staticReflector, !!options.enableIvy), new TypeScriptEmitter(), summaryResolver, symbolResolver);\n return { compiler: compiler, reflector: staticReflector };\n}", "function createAotCompiler(compilerHost, options, errorCollector) {\n var translations = options.translations || '';\n var urlResolver = createAotUrlResolver(compilerHost);\n var symbolCache = new StaticSymbolCache();\n var summaryResolver = new AotSummaryResolver(compilerHost, symbolCache);\n var symbolResolver = new StaticSymbolResolver(compilerHost, symbolCache, summaryResolver);\n var staticReflector = new StaticReflector(summaryResolver, symbolResolver, [], [], errorCollector);\n var htmlParser;\n if (!!options.enableIvy) {\n // Ivy handles i18n at the compiler level so we must use a regular parser\n htmlParser = new HtmlParser();\n }\n else {\n htmlParser = new I18NHtmlParser(new HtmlParser(), translations, options.i18nFormat, options.missingTranslation, console);\n }\n var config = new CompilerConfig({\n defaultEncapsulation: ViewEncapsulation.Emulated,\n useJit: false,\n missingTranslation: options.missingTranslation,\n preserveWhitespaces: options.preserveWhitespaces,\n strictInjectionParameters: options.strictInjectionParameters,\n });\n var normalizer = new DirectiveNormalizer({ get: function (url) { return compilerHost.loadResource(url); } }, urlResolver, htmlParser, config);\n var expressionParser = new Parser(new Lexer());\n var elementSchemaRegistry = new DomElementSchemaRegistry();\n var tmplParser = new TemplateParser(config, staticReflector, expressionParser, elementSchemaRegistry, htmlParser, console, []);\n var resolver = new CompileMetadataResolver(config, htmlParser, new NgModuleResolver(staticReflector), new DirectiveResolver(staticReflector), new PipeResolver(staticReflector), summaryResolver, elementSchemaRegistry, normalizer, console, symbolCache, staticReflector, errorCollector);\n // TODO(vicb): do not pass options.i18nFormat here\n var viewCompiler = new ViewCompiler(staticReflector);\n var typeCheckCompiler = new TypeCheckCompiler(options, staticReflector);\n var compiler = new AotCompiler(config, options, compilerHost, staticReflector, resolver, tmplParser, new StyleCompiler(urlResolver), viewCompiler, typeCheckCompiler, new NgModuleCompiler(staticReflector), new InjectableCompiler(staticReflector, !!options.enableIvy), new TypeScriptEmitter(), summaryResolver, symbolResolver);\n return { compiler: compiler, reflector: staticReflector };\n}", "function __JUAssert(){;}", "async run(): Promise<bool> {\n let deps = await this.getDeps()\n console.log(`Starting search for ${deps.length} deps.\\n`)\n\n let successes:TypeResult[] = []\n for (let dep of deps) {\n let typings = await this.checkDefinitelyTyped(dep)\n if (typings.status) {\n console.log(`found Typings for ${dep}`)\n successes.push(typings)\n }\n }\n\n if (successes) {\n let names = successes.map((result: TypeResult) => { return \"@types/\" + result.dep })\n console.log(\"\\nYou can install the following types:\")\n console.log(`\\n $ npm install ${names.join(\" \")} --save --only=dev`)\n } else {\n console.log(\"Could not find any types\")\n }\n\n return true\n }", "function createAotCompiler(compilerHost, options, errorCollector) {\n var translations = options.translations || '';\n var urlResolver = createAotUrlResolver(compilerHost);\n var symbolCache = new StaticSymbolCache();\n var summaryResolver = new AotSummaryResolver(compilerHost, symbolCache);\n var symbolResolver = new StaticSymbolResolver(compilerHost, symbolCache, summaryResolver);\n var staticReflector = new StaticReflector(summaryResolver, symbolResolver, [], [], errorCollector);\n var htmlParser;\n\n if (!!options.enableIvy) {\n // Ivy handles i18n at the compiler level so we must use a regular parser\n htmlParser = new HtmlParser();\n } else {\n htmlParser = new I18NHtmlParser(new HtmlParser(), translations, options.i18nFormat, options.missingTranslation, console);\n }\n\n var config = new CompilerConfig({\n defaultEncapsulation: ViewEncapsulation.Emulated,\n useJit: false,\n missingTranslation: options.missingTranslation,\n preserveWhitespaces: options.preserveWhitespaces,\n strictInjectionParameters: options.strictInjectionParameters\n });\n var normalizer = new DirectiveNormalizer({\n get: function get(url) {\n return compilerHost.loadResource(url);\n }\n }, urlResolver, htmlParser, config);\n var expressionParser = new Parser$1(new Lexer());\n var elementSchemaRegistry = new DomElementSchemaRegistry();\n var tmplParser = new TemplateParser(config, staticReflector, expressionParser, elementSchemaRegistry, htmlParser, console, []);\n var resolver = new CompileMetadataResolver(config, htmlParser, new NgModuleResolver(staticReflector), new DirectiveResolver(staticReflector), new PipeResolver(staticReflector), summaryResolver, elementSchemaRegistry, normalizer, console, symbolCache, staticReflector, errorCollector); // TODO(vicb): do not pass options.i18nFormat here\n\n var viewCompiler = new ViewCompiler(staticReflector);\n var typeCheckCompiler = new TypeCheckCompiler(options, staticReflector);\n var compiler = new AotCompiler(config, options, compilerHost, staticReflector, resolver, tmplParser, new StyleCompiler(urlResolver), viewCompiler, typeCheckCompiler, new NgModuleCompiler(staticReflector), new InjectableCompiler(staticReflector, !!options.enableIvy), new TypeScriptEmitter(), summaryResolver, symbolResolver);\n return {\n compiler: compiler,\n reflector: staticReflector\n };\n}", "function checkBuildMode() {\n\tconst browser = process.argv[2]\n\ttestMode = process.argv[3] === 'test' ? true : false\n\n\tif (!buildTargets.includes(browser)) {\n\t\terror(`Invalid build mode requested: expected one of [${buildTargets}] but received '${browser}'`)\n\t}\n\n\tif (testMode && browser !== 'chrome') {\n\t\terror('Test build requested for browser(s) other than Chrome. This is not advisable: e.g. for Firefox, a version number such as \"2.1.0alpha1\" can be set instead and the extension uploaded to the beta channel. Only Chrome needs a separate extension listing for test versions.')\n\t}\n\n\treturn browser === 'all' ? validBrowsers : [browser]\n}", "function check() {\n\n console.log(chalk.cyan('Checking if requiresafe installed...'));\n exec('requiresafe', function(err, stdout, stderr) {\n // Check if there were any errors\n if ( err ) {\n process.stderr.write(chalk.red('requiresafe not found, please make sure it is installed before proceding.\\nError: ', err, '\\n\\n'));\n process.exit(1);\n }\n\n else if ( stdout.length ) {\n console.log('requiresafe found!\\n');\n console.log(chalk.cyan('Checking if authenticated with requiresafe...'));\n if ( config && config.token ) {\n console.log('it would appear you have authenticated with requiresafe.\\n');\n console.log(chalk.green('Check Successful!'));\n process.exit();\n }\n else {\n process.stderr.write(chalk.red('you have not authenticated with requiresafe, please run: requiresafe login\\n\\n'));\n process.exit(1);\n }\n }\n });\n}", "function bfCheckLibConfiguration() {\n\n //check that the names of mandatory HTML elements are defined\n if (typeof elementDebugText === 'undefined' || bfIsInvalidElement(elementDebugText))\n alert(\"Debug text element (elementDebugText) is not defined\");\n\n if (typeof elementOutputText === 'undefined' || bfIsInvalidElement(elementOutputText))\n alert(\"Output text element (elementOutputText) is not defined\");\n\n if (typeof elementSpinDiv === 'undefined' || bfIsInvalidElement(elementSpinDiv))\n alert(\"Spin div element is not defined\");\n\n //check that various variables are properly declared and defined\n if (typeof apiKey === 'undefined' || bfIsInvalidStr(apiKey))\n alert(\"API key (apiKey) is not defined\");\n\n if (typeof containerPrefix === 'undefined' || bfIsInvalidStr(containerPrefix))\n alert(\"Container prefix (containerPrefix) is not defined\");\n\n //empty container name is OK\n if (typeof containerName === 'undefined')\n alert(\"Container name variable (containerPrefix) is not declared\");\n\n if (typeof testrigName === 'undefined' || bfIsInvalidStr(testrigName))\n alert(\"Testrig name (testrigName) is not defined\");\n\n if (typeof envName === 'undefined' || bfIsInvalidStr(envName))\n alert(\"Environment name (envName) is not defined\");\n\n if (typeof diffEnvName === 'undefined')\n alert(\"Differential environment name (diffEnvName) is not declared\");\n\n if (typeof testrigZip === 'undefined')\n alert(\"Testrig zip variable (testrigZip) is not declared\");\n\n}", "function Compiler () {\n this.importPath = []\n this.entryFile = null\n this.typeSystem = new TypeSystem()\n this.parser = new Parser()\n // Setup the default import path\n var extDir = path.join(path.dirname(__filename), '..', 'ext')\n this.importPath.push(extDir)\n}", "function checkCode(code)\n{\n\tlet result = TScript.parse(code);\n\tif (result.hasOwnProperty(\"errors\") && result.errors.length > 0) throw result.errors[0].message;\n\tlet interpreter = new TScript.Interpreter(result.program);\n\tinterpreter.reset();\n\tinterpreter.service.message = function(msg) { throw msg; }\n\tinterpreter.service.documentation_mode = true;\n\twhile (interpreter.status == \"running\" || interpreter.status == \"waiting\") interpreter.exec_step();\n\tif (interpreter.status != \"finished\") alert(\"code sample failed to run:\\n\" + code);\n}", "function createClosureModeGuard() {\n return typeofExpr(variable(NG_I18N_CLOSURE_MODE)).notIdentical(literal('undefined', STRING_TYPE)).and(variable(NG_I18N_CLOSURE_MODE));\n}", "get compilerObject() {\r\n return this._compilerObject;\r\n }", "_isValidContext() {\n const isNode = (typeof process !== 'undefined')\n && (typeof process.release !== 'undefined')\n && (process.release.name === 'node');\n return isNode;\n }", "function assertUint8ArrayAvailable() {\n if (typeof Uint8Array === 'undefined') {\n throw new __WEBPACK_IMPORTED_MODULE_2__util_error__[\"a\" /* FirestoreError */](__WEBPACK_IMPORTED_MODULE_2__util_error__[\"b\" /* Code */].UNIMPLEMENTED, 'Uint8Arrays are not available in this environment.');\n }\n}", "function assertUint8ArrayAvailable() {\n if (typeof Uint8Array === 'undefined') {\n throw new __WEBPACK_IMPORTED_MODULE_2__util_error__[\"a\" /* FirestoreError */](__WEBPACK_IMPORTED_MODULE_2__util_error__[\"b\" /* Code */].UNIMPLEMENTED, 'Uint8Arrays are not available in this environment.');\n }\n}", "function warnIfUnsupported () {\n const [major, minor] = process.versions.node.split('.').map(Number)\n if (\n major < 16 ||\n (major === 16 && minor < 17) ||\n (major === 18 && minor < 7)) {\n console.error('WARNING: Esbuild support isn\\'t available for older versions of Node.js.')\n console.error(`Expected: Node.js >=v16.17 or >=v18.7. Actual: Node.js = ${process.version}.`)\n console.error('This application may build properly with this version of Node.js, but unless a')\n console.error('more recent version is used at runtime, third party packages won\\'t be instrumented.')\n }\n}", "check (cb) {\n if (this.checked) return cb()\n binWrapper.run(['version'], (err) => {\n // The binary is ok if no error poped up\n this.checked = !err\n return cb(err)\n })\n }" ]
[ "0.7280039", "0.6609343", "0.5701623", "0.55071414", "0.5359753", "0.5310645", "0.5287135", "0.5255695", "0.5185235", "0.51780653", "0.51780653", "0.510953", "0.50870246", "0.5071456", "0.5061714", "0.50458944", "0.50141674", "0.49524596", "0.49390462", "0.4907709", "0.4905424", "0.4905424", "0.4905424", "0.4905424", "0.48802313", "0.48529014", "0.48484248", "0.48188427", "0.4784693", "0.47592968", "0.47391728", "0.4736301", "0.47219598", "0.47135553", "0.47067124", "0.4666223", "0.4666223", "0.4663273", "0.46576327", "0.46484098", "0.4645288", "0.46386406", "0.46380222", "0.46380222", "0.46380222", "0.46380222", "0.46380222", "0.46373263", "0.46373263", "0.46373263", "0.46373263", "0.46373263", "0.4633518", "0.46310878", "0.46282828", "0.46204954", "0.46204954", "0.46204954", "0.46204954", "0.46161446", "0.46141553", "0.46083316", "0.46036398", "0.46006322", "0.4593826", "0.45894998", "0.45855418", "0.45686185", "0.45563954", "0.45532265", "0.45527393", "0.45490214", "0.45406464", "0.4535439", "0.45335978", "0.45302135", "0.45302135", "0.4522191", "0.45170924", "0.45022547", "0.4464877", "0.44618702", "0.44573712", "0.4456806", "0.4456008", "0.4441731", "0.4440812", "0.44373223", "0.4435697", "0.4435697", "0.44347328", "0.44280195" ]
0.7297869
7
Assert the processor is not frozen.
function assertUnfrozen(name, frozen) { if (frozen) { throw new Error( [ 'Cannot invoke `' + name + '` on a frozen processor.\nCreate a new ', 'processor first, by invoking it: use `processor()` instead of ', '`processor`.' ].join('') ) } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function assertUnfrozen(name, frozen) {\n if (frozen) {\n throw new Error(\n 'Cannot invoke `' + name + '` on a frozen processor.\\n' +\n 'Create a new processor first, by invoking it: ' +\n 'use `processor()` instead of `processor`.'\n );\n }\n}", "function assertUnfrozen(name, frozen) {\n if (frozen) {\n throw new Error(\n 'Cannot invoke `' +\n name +\n '` on a frozen processor.\\nCreate a new processor first, by invoking it: use `processor()` instead of `processor`.'\n )\n }\n}", "function assertUnfrozen(name, frozen) {\n if (frozen) {\n throw new Error(\n 'Cannot invoke `' +\n name +\n '` on a frozen processor.\\nCreate a new processor first, by invoking it: use `processor()` instead of `processor`.'\n )\n }\n}", "function assertUnfrozen(name, frozen) {\n if (frozen) {\n throw new Error(\n 'Cannot invoke `' +\n name +\n '` on a frozen processor.\\nCreate a new processor first, by invoking it: use `processor()` instead of `processor`.'\n )\n }\n}", "function assertUnfrozen(name, frozen) {\n if (frozen) {\n throw new Error(\n 'Cannot invoke `' +\n name +\n '` on a frozen processor.\\nCreate a new processor first, by invoking it: use `processor()` instead of `processor`.'\n )\n }\n}", "function freeze() {\n _isFrozen = true;\n }", "didFreeze() {\n Ember.debug('didFreeze', arguments);\n this.set('isFrozen', true);\n }", "freeze() {\n\t\tthis._isFrozen = true\n\t}", "function skipWaiting() {\n // Just call self.skipWaiting() directly.\n // See https://github.com/GoogleChrome/workbox/issues/2525\n if (process.env.NODE_ENV !== 'production') {\n logger.warn(`skipWaiting() from workbox-core is no longer recommended ` +\n `and will be removed in Workbox v7. Using self.skipWaiting() instead ` +\n `is equivalent.`);\n }\n void self.skipWaiting();\n}", "function warnIfUnmockedScheduler(fiber) {\n {\n if (didWarnAboutUnmockedScheduler === false && Scheduler.unstable_flushAllWithoutAsserting === undefined) {\n if (fiber.mode & BlockingMode || fiber.mode & ConcurrentMode) {\n didWarnAboutUnmockedScheduler = true;\n error('In Concurrent or Sync modes, the \"scheduler\" module needs to be mocked ' + 'to guarantee consistent behaviour across tests and browsers. ' + 'For example, with jest: \\n' + \"jest.mock('scheduler', () => require('scheduler/unstable_mock'));\\n\\n\" + 'For more info, visit https://fb.me/react-mock-scheduler');\n }\n }\n }\n }", "function warnIfUnmockedScheduler(fiber) {\n {\n if (didWarnAboutUnmockedScheduler === false && Scheduler.unstable_flushAllWithoutAsserting === undefined) {\n if (fiber.mode & BlockingMode || fiber.mode & ConcurrentMode) {\n didWarnAboutUnmockedScheduler = true;\n error('In Concurrent or Sync modes, the \"scheduler\" module needs to be mocked ' + 'to guarantee consistent behaviour across tests and browsers. ' + 'For example, with jest: \\n' + \"jest.mock('scheduler', () => require('scheduler/unstable_mock'));\\n\\n\" + 'For more info, visit https://fb.me/react-mock-scheduler');\n }\n }\n }\n }", "function warnIfUnmockedScheduler(fiber) {\n {\n if (didWarnAboutUnmockedScheduler === false && Scheduler.unstable_flushAllWithoutAsserting === undefined) {\n if (fiber.mode & BlockingMode || fiber.mode & ConcurrentMode) {\n didWarnAboutUnmockedScheduler = true;\n error('In Concurrent or Sync modes, the \"scheduler\" module needs to be mocked ' + 'to guarantee consistent behaviour across tests and browsers. ' + 'For example, with jest: \\n' + \"jest.mock('scheduler', () => require('scheduler/unstable_mock'));\\n\\n\" + 'For more info, visit https://fb.me/react-mock-scheduler');\n }\n }\n }\n }", "function warnIfUnmockedScheduler(fiber) {\n {\n if (didWarnAboutUnmockedScheduler === false && Scheduler.unstable_flushAllWithoutAsserting === undefined) {\n if (fiber.mode & BlockingMode || fiber.mode & ConcurrentMode) {\n didWarnAboutUnmockedScheduler = true;\n error('In Concurrent or Sync modes, the \"scheduler\" module needs to be mocked ' + 'to guarantee consistent behaviour across tests and browsers. ' + 'For example, with jest: \\n' + \"jest.mock('scheduler', () => require('scheduler/unstable_mock'));\\n\\n\" + 'For more info, visit https://fb.me/react-mock-scheduler');\n }\n }\n }\n }", "function warnIfUnmockedScheduler(fiber) {\n {\n if (didWarnAboutUnmockedScheduler === false && Scheduler.unstable_flushAllWithoutAsserting === undefined) {\n if (fiber.mode & BlockingMode || fiber.mode & ConcurrentMode) {\n didWarnAboutUnmockedScheduler = true;\n error('In Concurrent or Sync modes, the \"scheduler\" module needs to be mocked ' + 'to guarantee consistent behaviour across tests and browsers. ' + 'For example, with jest: \\n' + \"jest.mock('scheduler', () => require('scheduler/unstable_mock'));\\n\\n\" + 'For more info, visit https://fb.me/react-mock-scheduler');\n }\n }\n }\n }", "function warnIfUnmockedScheduler(fiber) {\n {\n if (didWarnAboutUnmockedScheduler === false && Scheduler.unstable_flushAllWithoutAsserting === undefined) {\n if (fiber.mode & BlockingMode || fiber.mode & ConcurrentMode) {\n didWarnAboutUnmockedScheduler = true;\n error('In Concurrent or Sync modes, the \"scheduler\" module needs to be mocked ' + 'to guarantee consistent behaviour across tests and browsers. ' + 'For example, with jest: \\n' + \"jest.mock('scheduler', () => require('scheduler/unstable_mock'));\\n\\n\" + 'For more info, visit https://fb.me/react-mock-scheduler');\n }\n }\n }\n }", "function warnIfUnmockedScheduler(fiber) {\n {\n if (didWarnAboutUnmockedScheduler === false && Scheduler.unstable_flushAllWithoutAsserting === undefined) {\n if (fiber.mode & BlockingMode || fiber.mode & ConcurrentMode) {\n didWarnAboutUnmockedScheduler = true;\n error('In Concurrent or Sync modes, the \"scheduler\" module needs to be mocked ' + 'to guarantee consistent behaviour across tests and browsers. ' + 'For example, with jest: \\n' + // Break up requires to avoid accidentally parsing them as dependencies.\n \"jest.mock('scheduler', () => require\" + \"('scheduler/unstable_mock'));\\n\\n\" + 'For more info, visit https://reactjs.org/link/mock-scheduler');\n }\n }\n }\n }", "function warnIfUnmockedScheduler(fiber) {\n {\n if (didWarnAboutUnmockedScheduler === false && Scheduler.unstable_flushAllWithoutAsserting === undefined) {\n if (fiber.mode & BlockingMode || fiber.mode & ConcurrentMode) {\n didWarnAboutUnmockedScheduler = true;\n error('In Concurrent or Sync modes, the \"scheduler\" module needs to be mocked ' + 'to guarantee consistent behaviour across tests and browsers. ' + 'For example, with jest: \\n' + // Break up requires to avoid accidentally parsing them as dependencies.\n \"jest.mock('scheduler', () => require\" + \"('scheduler/unstable_mock'));\\n\\n\" + 'For more info, visit https://reactjs.org/link/mock-scheduler');\n }\n }\n }\n }", "function warnIfUnmockedScheduler(fiber) {\n {\n if (didWarnAboutUnmockedScheduler === false && Scheduler.unstable_flushAllWithoutAsserting === undefined) {\n if (fiber.mode & BlockingMode || fiber.mode & ConcurrentMode) {\n didWarnAboutUnmockedScheduler = true;\n error('In Concurrent or Sync modes, the \"scheduler\" module needs to be mocked ' + 'to guarantee consistent behaviour across tests and browsers. ' + 'For example, with jest: \\n' + // Break up requires to avoid accidentally parsing them as dependencies.\n \"jest.mock('scheduler', () => require\" + \"('scheduler/unstable_mock'));\\n\\n\" + 'For more info, visit https://reactjs.org/link/mock-scheduler');\n }\n }\n }\n }", "function warnIfUnmockedScheduler(fiber) {\n {\n if (didWarnAboutUnmockedScheduler === false && Scheduler.unstable_flushAllWithoutAsserting === undefined) {\n if (fiber.mode & BlockingMode || fiber.mode & ConcurrentMode) {\n didWarnAboutUnmockedScheduler = true;\n error('In Concurrent or Sync modes, the \"scheduler\" module needs to be mocked ' + 'to guarantee consistent behaviour across tests and browsers. ' + 'For example, with jest: \\n' + // Break up requires to avoid accidentally parsing them as dependencies.\n \"jest.mock('scheduler', () => require\" + \"('scheduler/unstable_mock'));\\n\\n\" + 'For more info, visit https://reactjs.org/link/mock-scheduler');\n }\n }\n }\n }", "function warnIfUnmockedScheduler(fiber) {\n {\n if (didWarnAboutUnmockedScheduler === false && Scheduler.unstable_flushAllWithoutAsserting === undefined) {\n if (fiber.mode & BlockingMode || fiber.mode & ConcurrentMode) {\n didWarnAboutUnmockedScheduler = true;\n error('In Concurrent or Sync modes, the \"scheduler\" module needs to be mocked ' + 'to guarantee consistent behaviour across tests and browsers. ' + 'For example, with jest: \\n' + // Break up requires to avoid accidentally parsing them as dependencies.\n \"jest.mock('scheduler', () => require\" + \"('scheduler/unstable_mock'));\\n\\n\" + 'For more info, visit https://reactjs.org/link/mock-scheduler');\n }\n }\n }\n }", "function warnIfUnmockedScheduler(fiber) {\n if (didWarnAboutUnmockedScheduler === false && Scheduler.unstable_flushAllWithoutAsserting === undefined) {\n if (fiber.mode & BlockingMode || fiber.mode & ConcurrentMode) {\n didWarnAboutUnmockedScheduler = true;\n error(\"In Concurrent or Sync modes, the \\\"scheduler\\\" module needs to be mocked to guarantee consistent behaviour across tests and browsers. For example, with jest: \\njest.mock('scheduler', () => require('scheduler/unstable_mock'));\\n\\nFor more info, visit https://reactjs.org/link/mock-scheduler\");\n }\n }\n }", "function warnIfUnmockedScheduler(fiber) {\n {\n if (didWarnAboutUnmockedScheduler === false && Scheduler.unstable_flushAllWithoutAsserting === undefined) {\n if (fiber.mode & BlockingMode || fiber.mode & ConcurrentMode) {\n didWarnAboutUnmockedScheduler = true;\n\n error('In Concurrent or Sync modes, the \"scheduler\" module needs to be mocked ' + 'to guarantee consistent behaviour across tests and browsers. ' + 'For example, with jest: \\n' + \"jest.mock('scheduler', () => require('scheduler/unstable_mock'));\\n\\n\" + 'For more info, visit https://fb.me/react-mock-scheduler');\n }\n }\n }\n}", "function warnIfUnmockedScheduler(fiber) {\n {\n if (didWarnAboutUnmockedScheduler === false && Scheduler.unstable_flushAllWithoutAsserting === undefined) {\n if (fiber.mode & BlockingMode || fiber.mode & ConcurrentMode) {\n didWarnAboutUnmockedScheduler = true;\n\n error('In Concurrent or Sync modes, the \"scheduler\" module needs to be mocked ' + 'to guarantee consistent behaviour across tests and browsers. ' + 'For example, with jest: \\n' + \"jest.mock('scheduler', () => require('scheduler/unstable_mock'));\\n\\n\" + 'For more info, visit https://fb.me/react-mock-scheduler');\n }\n }\n }\n}", "function warnIfUnmockedScheduler(fiber) {\n {\n if (didWarnAboutUnmockedScheduler === false && Scheduler.unstable_flushAllWithoutAsserting === undefined) {\n if (fiber.mode & BlockingMode || fiber.mode & ConcurrentMode) {\n didWarnAboutUnmockedScheduler = true;\n\n error('In Concurrent or Sync modes, the \"scheduler\" module needs to be mocked ' + 'to guarantee consistent behaviour across tests and browsers. ' + 'For example, with jest: \\n' + \"jest.mock('scheduler', () => require('scheduler/unstable_mock'));\\n\\n\" + 'For more info, visit https://fb.me/react-mock-scheduler');\n }\n }\n }\n}", "function warnIfUnmockedScheduler(fiber) {\n {\n if (didWarnAboutUnmockedScheduler === false && Scheduler.unstable_flushAllWithoutAsserting === undefined) {\n if (fiber.mode & BlockingMode || fiber.mode & ConcurrentMode) {\n didWarnAboutUnmockedScheduler = true;\n\n error('In Concurrent or Sync modes, the \"scheduler\" module needs to be mocked ' + 'to guarantee consistent behaviour across tests and browsers. ' + 'For example, with jest: \\n' + \"jest.mock('scheduler', () => require('scheduler/unstable_mock'));\\n\\n\" + 'For more info, visit https://fb.me/react-mock-scheduler');\n }\n }\n }\n}", "function warnIfUnmockedScheduler(fiber) {\n {\n if (didWarnAboutUnmockedScheduler === false && Scheduler.unstable_flushAllWithoutAsserting === undefined) {\n if (fiber.mode & BlockingMode || fiber.mode & ConcurrentMode) {\n didWarnAboutUnmockedScheduler = true;\n\n error('In Concurrent or Sync modes, the \"scheduler\" module needs to be mocked ' + 'to guarantee consistent behaviour across tests and browsers. ' + 'For example, with jest: \\n' + \"jest.mock('scheduler', () => require('scheduler/unstable_mock'));\\n\\n\" + 'For more info, visit https://fb.me/react-mock-scheduler');\n }\n }\n }\n}", "function warnIfUnmockedScheduler(fiber) {\n {\n if (didWarnAboutUnmockedScheduler === false && Scheduler.unstable_flushAllWithoutAsserting === undefined) {\n if (fiber.mode & BlockingMode || fiber.mode & ConcurrentMode) {\n didWarnAboutUnmockedScheduler = true;\n\n error('In Concurrent or Sync modes, the \"scheduler\" module needs to be mocked ' + 'to guarantee consistent behaviour across tests and browsers. ' + 'For example, with jest: \\n' + \"jest.mock('scheduler', () => require('scheduler/unstable_mock'));\\n\\n\" + 'For more info, visit https://fb.me/react-mock-scheduler');\n }\n }\n }\n}", "function warnIfUnmockedScheduler(fiber) {\n {\n if (didWarnAboutUnmockedScheduler === false && Scheduler.unstable_flushAllWithoutAsserting === undefined) {\n if (fiber.mode & BlockingMode || fiber.mode & ConcurrentMode) {\n didWarnAboutUnmockedScheduler = true;\n\n error('In Concurrent or Sync modes, the \"scheduler\" module needs to be mocked ' + 'to guarantee consistent behaviour across tests and browsers. ' + 'For example, with jest: \\n' + \"jest.mock('scheduler', () => require('scheduler/unstable_mock'));\\n\\n\" + 'For more info, visit https://fb.me/react-mock-scheduler');\n }\n }\n }\n}", "function warnIfUnmockedScheduler(fiber) {\n {\n if (didWarnAboutUnmockedScheduler === false && Scheduler.unstable_flushAllWithoutAsserting === undefined) {\n if (fiber.mode & BlockingMode || fiber.mode & ConcurrentMode) {\n didWarnAboutUnmockedScheduler = true;\n\n error('In Concurrent or Sync modes, the \"scheduler\" module needs to be mocked ' + 'to guarantee consistent behaviour across tests and browsers. ' + 'For example, with jest: \\n' + \"jest.mock('scheduler', () => require('scheduler/unstable_mock'));\\n\\n\" + 'For more info, visit https://fb.me/react-mock-scheduler');\n }\n }\n }\n}", "function warnIfUnmockedScheduler(fiber) {\n {\n if (didWarnAboutUnmockedScheduler === false && Scheduler.unstable_flushAllWithoutAsserting === undefined) {\n if (fiber.mode & BlockingMode || fiber.mode & ConcurrentMode) {\n didWarnAboutUnmockedScheduler = true;\n\n error('In Concurrent or Sync modes, the \"scheduler\" module needs to be mocked ' + 'to guarantee consistent behaviour across tests and browsers. ' + 'For example, with jest: \\n' + \"jest.mock('scheduler', () => require('scheduler/unstable_mock'));\\n\\n\" + 'For more info, visit https://fb.me/react-mock-scheduler');\n }\n }\n }\n}", "function warnIfUnmockedScheduler(fiber) {\n {\n if (didWarnAboutUnmockedScheduler === false && Scheduler.unstable_flushAllWithoutAsserting === undefined) {\n if (fiber.mode & BlockingMode || fiber.mode & ConcurrentMode) {\n didWarnAboutUnmockedScheduler = true;\n\n error('In Concurrent or Sync modes, the \"scheduler\" module needs to be mocked ' + 'to guarantee consistent behaviour across tests and browsers. ' + 'For example, with jest: \\n' + \"jest.mock('scheduler', () => require('scheduler/unstable_mock'));\\n\\n\" + 'For more info, visit https://fb.me/react-mock-scheduler');\n }\n }\n }\n}", "function warnIfUnmockedScheduler(fiber) {\n {\n if (didWarnAboutUnmockedScheduler === false && Scheduler.unstable_flushAllWithoutAsserting === undefined) {\n if (fiber.mode & BlockingMode || fiber.mode & ConcurrentMode) {\n didWarnAboutUnmockedScheduler = true;\n\n error('In Concurrent or Sync modes, the \"scheduler\" module needs to be mocked ' + 'to guarantee consistent behaviour across tests and browsers. ' + 'For example, with jest: \\n' + \"jest.mock('scheduler', () => require('scheduler/unstable_mock'));\\n\\n\" + 'For more info, visit https://fb.me/react-mock-scheduler');\n }\n }\n }\n}", "function warnIfUnmockedScheduler(fiber) {\n {\n if (didWarnAboutUnmockedScheduler === false && Scheduler.unstable_flushAllWithoutAsserting === undefined) {\n if (fiber.mode & BlockingMode || fiber.mode & ConcurrentMode) {\n didWarnAboutUnmockedScheduler = true;\n\n error('In Concurrent or Sync modes, the \"scheduler\" module needs to be mocked ' + 'to guarantee consistent behaviour across tests and browsers. ' + 'For example, with jest: \\n' + \"jest.mock('scheduler', () => require('scheduler/unstable_mock'));\\n\\n\" + 'For more info, visit https://fb.me/react-mock-scheduler');\n }\n }\n }\n}", "function warnIfUnmockedScheduler(fiber) {\n {\n if (didWarnAboutUnmockedScheduler === false && Scheduler.unstable_flushAllWithoutAsserting === undefined) {\n if (fiber.mode & BlockingMode || fiber.mode & ConcurrentMode) {\n didWarnAboutUnmockedScheduler = true;\n\n error('In Concurrent or Sync modes, the \"scheduler\" module needs to be mocked ' + 'to guarantee consistent behaviour across tests and browsers. ' + 'For example, with jest: \\n' + \"jest.mock('scheduler', () => require('scheduler/unstable_mock'));\\n\\n\" + 'For more info, visit https://fb.me/react-mock-scheduler');\n }\n }\n }\n}", "function warnIfUnmockedScheduler(fiber) {\n {\n if (didWarnAboutUnmockedScheduler === false && Scheduler.unstable_flushAllWithoutAsserting === undefined) {\n if (fiber.mode & BlockingMode || fiber.mode & ConcurrentMode) {\n didWarnAboutUnmockedScheduler = true;\n\n error('In Concurrent or Sync modes, the \"scheduler\" module needs to be mocked ' + 'to guarantee consistent behaviour across tests and browsers. ' + 'For example, with jest: \\n' + \"jest.mock('scheduler', () => require('scheduler/unstable_mock'));\\n\\n\" + 'For more info, visit https://fb.me/react-mock-scheduler');\n }\n }\n }\n}", "function warnIfUnmockedScheduler(fiber) {\n {\n if (didWarnAboutUnmockedScheduler === false && Scheduler.unstable_flushAllWithoutAsserting === undefined) {\n if (fiber.mode & BlockingMode || fiber.mode & ConcurrentMode) {\n didWarnAboutUnmockedScheduler = true;\n\n error('In Concurrent or Sync modes, the \"scheduler\" module needs to be mocked ' + 'to guarantee consistent behaviour across tests and browsers. ' + 'For example, with jest: \\n' + \"jest.mock('scheduler', () => require('scheduler/unstable_mock'));\\n\\n\" + 'For more info, visit https://fb.me/react-mock-scheduler');\n }\n }\n }\n}", "function warnIfUnmockedScheduler(fiber) {\n {\n if (didWarnAboutUnmockedScheduler === false && Scheduler.unstable_flushAllWithoutAsserting === undefined) {\n if (fiber.mode & BlockingMode || fiber.mode & ConcurrentMode) {\n didWarnAboutUnmockedScheduler = true;\n\n error('In Concurrent or Sync modes, the \"scheduler\" module needs to be mocked ' + 'to guarantee consistent behaviour across tests and browsers. ' + 'For example, with jest: \\n' + \"jest.mock('scheduler', () => require('scheduler/unstable_mock'));\\n\\n\" + 'For more info, visit https://fb.me/react-mock-scheduler');\n }\n }\n }\n}", "function warnIfUnmockedScheduler(fiber) {\n {\n if (didWarnAboutUnmockedScheduler === false && Scheduler.unstable_flushAllWithoutAsserting === undefined) {\n if (fiber.mode & BlockingMode || fiber.mode & ConcurrentMode) {\n didWarnAboutUnmockedScheduler = true;\n\n error('In Concurrent or Sync modes, the \"scheduler\" module needs to be mocked ' + 'to guarantee consistent behaviour across tests and browsers. ' + 'For example, with jest: \\n' + \"jest.mock('scheduler', () => require('scheduler/unstable_mock'));\\n\\n\" + 'For more info, visit https://fb.me/react-mock-scheduler');\n }\n }\n }\n}", "function warnIfUnmockedScheduler(fiber) {\n {\n if (didWarnAboutUnmockedScheduler === false && Scheduler.unstable_flushAllWithoutAsserting === undefined) {\n if (fiber.mode & BlockingMode || fiber.mode & ConcurrentMode) {\n didWarnAboutUnmockedScheduler = true;\n\n error('In Concurrent or Sync modes, the \"scheduler\" module needs to be mocked ' + 'to guarantee consistent behaviour across tests and browsers. ' + 'For example, with jest: \\n' + \"jest.mock('scheduler', () => require('scheduler/unstable_mock'));\\n\\n\" + 'For more info, visit https://fb.me/react-mock-scheduler');\n }\n }\n }\n}", "function warnIfUnmockedScheduler(fiber) {\n {\n if (didWarnAboutUnmockedScheduler === false && Scheduler.unstable_flushAllWithoutAsserting === undefined) {\n if (fiber.mode & BlockingMode || fiber.mode & ConcurrentMode) {\n didWarnAboutUnmockedScheduler = true;\n\n error('In Concurrent or Sync modes, the \"scheduler\" module needs to be mocked ' + 'to guarantee consistent behaviour across tests and browsers. ' + 'For example, with jest: \\n' + \"jest.mock('scheduler', () => require('scheduler/unstable_mock'));\\n\\n\" + 'For more info, visit https://fb.me/react-mock-scheduler');\n }\n }\n }\n}", "function warnIfUnmockedScheduler(fiber) {\n {\n if (didWarnAboutUnmockedScheduler === false && Scheduler.unstable_flushAllWithoutAsserting === undefined) {\n if (fiber.mode & BlockingMode || fiber.mode & ConcurrentMode) {\n didWarnAboutUnmockedScheduler = true;\n\n error('In Concurrent or Sync modes, the \"scheduler\" module needs to be mocked ' + 'to guarantee consistent behaviour across tests and browsers. ' + 'For example, with jest: \\n' + \"jest.mock('scheduler', () => require('scheduler/unstable_mock'));\\n\\n\" + 'For more info, visit https://fb.me/react-mock-scheduler');\n }\n }\n }\n}", "function warnIfUnmockedScheduler(fiber) {\n {\n if (didWarnAboutUnmockedScheduler === false && Scheduler.unstable_flushAllWithoutAsserting === undefined) {\n if (fiber.mode & BlockingMode || fiber.mode & ConcurrentMode) {\n didWarnAboutUnmockedScheduler = true;\n\n error('In Concurrent or Sync modes, the \"scheduler\" module needs to be mocked ' + 'to guarantee consistent behaviour across tests and browsers. ' + 'For example, with jest: \\n' + \"jest.mock('scheduler', () => require('scheduler/unstable_mock'));\\n\\n\" + 'For more info, visit https://fb.me/react-mock-scheduler');\n }\n }\n }\n}", "function warnIfUnmockedScheduler(fiber) {\n {\n if (didWarnAboutUnmockedScheduler === false && Scheduler.unstable_flushAllWithoutAsserting === undefined) {\n if (fiber.mode & BlockingMode || fiber.mode & ConcurrentMode) {\n didWarnAboutUnmockedScheduler = true;\n\n error('In Concurrent or Sync modes, the \"scheduler\" module needs to be mocked ' + 'to guarantee consistent behaviour across tests and browsers. ' + 'For example, with jest: \\n' + \"jest.mock('scheduler', () => require('scheduler/unstable_mock'));\\n\\n\" + 'For more info, visit https://fb.me/react-mock-scheduler');\n }\n }\n }\n}", "function warnIfUnmockedScheduler(fiber) {\n {\n if (didWarnAboutUnmockedScheduler === false && Scheduler.unstable_flushAllWithoutAsserting === undefined) {\n if (fiber.mode & BlockingMode || fiber.mode & ConcurrentMode) {\n didWarnAboutUnmockedScheduler = true;\n\n error('In Concurrent or Sync modes, the \"scheduler\" module needs to be mocked ' + 'to guarantee consistent behaviour across tests and browsers. ' + 'For example, with jest: \\n' + \"jest.mock('scheduler', () => require('scheduler/unstable_mock'));\\n\\n\" + 'For more info, visit https://fb.me/react-mock-scheduler');\n }\n }\n }\n}", "function warnIfUnmockedScheduler(fiber) {\n {\n if (\n didWarnAboutUnmockedScheduler === false &&\n Scheduler.unstable_flushAllWithoutAsserting === undefined\n ) {\n if (\n fiber.mode & BlockingMode ||\n fiber.mode & ConcurrentMode\n ) {\n didWarnAboutUnmockedScheduler = true;\n\n error(\n 'In Concurrent or Sync modes, the \"scheduler\" module needs to be mocked ' +\n 'to guarantee consistent behaviour across tests and browsers. ' +\n 'For example, with jest: \\n' +\n \"jest.mock('scheduler', () => require('scheduler/unstable_mock'));\\n\\n\" +\n 'For more info, visit https://fb.me/react-mock-scheduler',\n );\n }\n }\n }\n }", "function warnIfUnmockedScheduler(fiber) {\n {\n if (didWarnAboutUnmockedScheduler === false && Scheduler.unstable_flushAllWithoutAsserting === undefined) {\n if (fiber.mode & BlockingMode || fiber.mode & ConcurrentMode) {\n didWarnAboutUnmockedScheduler = true;\n\n error('In Concurrent or Sync modes, the \"scheduler\" module needs to be mocked ' + 'to guarantee consistent behaviour across tests and browsers. ' + 'For example, with jest: \\n' + // Break up requires to avoid accidentally parsing them as dependencies.\n \"jest.mock('scheduler', () => require\" + \"('scheduler/unstable_mock'));\\n\\n\" + 'For more info, visit https://reactjs.org/link/mock-scheduler');\n }\n }\n }\n}", "function warnIfUnmockedScheduler(fiber) {\n {\n if (didWarnAboutUnmockedScheduler === false && Scheduler.unstable_flushAllWithoutAsserting === undefined) {\n if (fiber.mode & BlockingMode || fiber.mode & ConcurrentMode) {\n didWarnAboutUnmockedScheduler = true;\n\n error('In Concurrent or Sync modes, the \"scheduler\" module needs to be mocked ' + 'to guarantee consistent behaviour across tests and browsers. ' + 'For example, with jest: \\n' + // Break up requires to avoid accidentally parsing them as dependencies.\n \"jest.mock('scheduler', () => require\" + \"('scheduler/unstable_mock'));\\n\\n\" + 'For more info, visit https://reactjs.org/link/mock-scheduler');\n }\n }\n }\n}", "function warnIfUnmockedScheduler(fiber) {\n {\n if (didWarnAboutUnmockedScheduler === false && Scheduler.unstable_flushAllWithoutAsserting === undefined) {\n if (fiber.mode & BlockingMode || fiber.mode & ConcurrentMode) {\n didWarnAboutUnmockedScheduler = true;\n\n error('In Concurrent or Sync modes, the \"scheduler\" module needs to be mocked ' + 'to guarantee consistent behaviour across tests and browsers. ' + 'For example, with jest: \\n' + // Break up requires to avoid accidentally parsing them as dependencies.\n \"jest.mock('scheduler', () => require\" + \"('scheduler/unstable_mock'));\\n\\n\" + 'For more info, visit https://reactjs.org/link/mock-scheduler');\n }\n }\n }\n}", "function warnIfUnmockedScheduler(fiber) {\n {\n if (didWarnAboutUnmockedScheduler === false && Scheduler.unstable_flushAllWithoutAsserting === undefined) {\n if (fiber.mode & BlockingMode || fiber.mode & ConcurrentMode) {\n didWarnAboutUnmockedScheduler = true;\n\n error('In Concurrent or Sync modes, the \"scheduler\" module needs to be mocked ' + 'to guarantee consistent behaviour across tests and browsers. ' + 'For example, with jest: \\n' + // Break up requires to avoid accidentally parsing them as dependencies.\n \"jest.mock('scheduler', () => require\" + \"('scheduler/unstable_mock'));\\n\\n\" + 'For more info, visit https://reactjs.org/link/mock-scheduler');\n }\n }\n }\n}", "function warnIfUnmockedScheduler(fiber) {\n {\n if (didWarnAboutUnmockedScheduler === false && Scheduler.unstable_flushAllWithoutAsserting === undefined) {\n if (fiber.mode & BlockingMode || fiber.mode & ConcurrentMode) {\n didWarnAboutUnmockedScheduler = true;\n\n error('In Concurrent or Sync modes, the \"scheduler\" module needs to be mocked ' + 'to guarantee consistent behaviour across tests and browsers. ' + 'For example, with jest: \\n' + // Break up requires to avoid accidentally parsing them as dependencies.\n \"jest.mock('scheduler', () => require\" + \"('scheduler/unstable_mock'));\\n\\n\" + 'For more info, visit https://reactjs.org/link/mock-scheduler');\n }\n }\n }\n}", "function warnIfUnmockedScheduler(fiber) {\n {\n if (didWarnAboutUnmockedScheduler === false && Scheduler.unstable_flushAllWithoutAsserting === undefined) {\n if (fiber.mode & BlockingMode || fiber.mode & ConcurrentMode) {\n didWarnAboutUnmockedScheduler = true;\n\n error('In Concurrent or Sync modes, the \"scheduler\" module needs to be mocked ' + 'to guarantee consistent behaviour across tests and browsers. ' + 'For example, with jest: \\n' + // Break up requires to avoid accidentally parsing them as dependencies.\n \"jest.mock('scheduler', () => require\" + \"('scheduler/unstable_mock'));\\n\\n\" + 'For more info, visit https://reactjs.org/link/mock-scheduler');\n }\n }\n }\n}", "function warnIfUnmockedScheduler(fiber) {\n {\n if (didWarnAboutUnmockedScheduler === false && Scheduler.unstable_flushAllWithoutAsserting === undefined) {\n if (fiber.mode & BlockingMode || fiber.mode & ConcurrentMode) {\n didWarnAboutUnmockedScheduler = true;\n\n error('In Concurrent or Sync modes, the \"scheduler\" module needs to be mocked ' + 'to guarantee consistent behaviour across tests and browsers. ' + 'For example, with jest: \\n' + // Break up requires to avoid accidentally parsing them as dependencies.\n \"jest.mock('scheduler', () => require\" + \"('scheduler/unstable_mock'));\\n\\n\" + 'For more info, visit https://reactjs.org/link/mock-scheduler');\n }\n }\n }\n}", "function warnIfUnmockedScheduler(fiber) {\n {\n if (didWarnAboutUnmockedScheduler === false && Scheduler.unstable_flushAllWithoutAsserting === undefined) {\n if (fiber.mode & BlockingMode || fiber.mode & ConcurrentMode) {\n didWarnAboutUnmockedScheduler = true;\n\n error('In Concurrent or Sync modes, the \"scheduler\" module needs to be mocked ' + 'to guarantee consistent behaviour across tests and browsers. ' + 'For example, with jest: \\n' + // Break up requires to avoid accidentally parsing them as dependencies.\n \"jest.mock('scheduler', () => require\" + \"('scheduler/unstable_mock'));\\n\\n\" + 'For more info, visit https://reactjs.org/link/mock-scheduler');\n }\n }\n }\n}", "function warnIfUnmockedScheduler(fiber) {\n {\n if (didWarnAboutUnmockedScheduler === false && Scheduler.unstable_flushAllWithoutAsserting === undefined) {\n if (fiber.mode & BlockingMode || fiber.mode & ConcurrentMode) {\n didWarnAboutUnmockedScheduler = true;\n\n error('In Concurrent or Sync modes, the \"scheduler\" module needs to be mocked ' + 'to guarantee consistent behaviour across tests and browsers. ' + 'For example, with jest: \\n' + // Break up requires to avoid accidentally parsing them as dependencies.\n \"jest.mock('scheduler', () => require\" + \"('scheduler/unstable_mock'));\\n\\n\" + 'For more info, visit https://reactjs.org/link/mock-scheduler');\n }\n }\n }\n}", "function warnIfUnmockedScheduler(fiber) {\n {\n if (didWarnAboutUnmockedScheduler === false && Scheduler.unstable_flushAllWithoutAsserting === undefined) {\n if (fiber.mode & BlockingMode || fiber.mode & ConcurrentMode) {\n didWarnAboutUnmockedScheduler = true;\n\n error('In Concurrent or Sync modes, the \"scheduler\" module needs to be mocked ' + 'to guarantee consistent behaviour across tests and browsers. ' + 'For example, with jest: \\n' + // Break up requires to avoid accidentally parsing them as dependencies.\n \"jest.mock('scheduler', () => require\" + \"('scheduler/unstable_mock'));\\n\\n\" + 'For more info, visit https://reactjs.org/link/mock-scheduler');\n }\n }\n }\n}", "function warnIfUnmockedScheduler(fiber) {\n {\n if (didWarnAboutUnmockedScheduler === false && Scheduler.unstable_flushAllWithoutAsserting === undefined) {\n if (fiber.mode & BlockingMode || fiber.mode & ConcurrentMode) {\n didWarnAboutUnmockedScheduler = true;\n\n error('In Concurrent or Sync modes, the \"scheduler\" module needs to be mocked ' + 'to guarantee consistent behaviour across tests and browsers. ' + 'For example, with jest: \\n' + // Break up requires to avoid accidentally parsing them as dependencies.\n \"jest.mock('scheduler', () => require\" + \"('scheduler/unstable_mock'));\\n\\n\" + 'For more info, visit https://reactjs.org/link/mock-scheduler');\n }\n }\n }\n}", "function warnIfUnmockedScheduler(fiber) {\n {\n if (didWarnAboutUnmockedScheduler === false && Scheduler.unstable_flushAllWithoutAsserting === undefined) {\n if (fiber.mode & BlockingMode || fiber.mode & ConcurrentMode) {\n didWarnAboutUnmockedScheduler = true;\n\n error('In Concurrent or Sync modes, the \"scheduler\" module needs to be mocked ' + 'to guarantee consistent behaviour across tests and browsers. ' + 'For example, with jest: \\n' + // Break up requires to avoid accidentally parsing them as dependencies.\n \"jest.mock('scheduler', () => require\" + \"('scheduler/unstable_mock'));\\n\\n\" + 'For more info, visit https://reactjs.org/link/mock-scheduler');\n }\n }\n }\n}", "function warnIfUnmockedScheduler(fiber) {\n {\n if (didWarnAboutUnmockedScheduler === false && Scheduler.unstable_flushAllWithoutAsserting === undefined) {\n if (fiber.mode & BlockingMode || fiber.mode & ConcurrentMode) {\n didWarnAboutUnmockedScheduler = true;\n\n error('In Concurrent or Sync modes, the \"scheduler\" module needs to be mocked ' + 'to guarantee consistent behaviour across tests and browsers. ' + 'For example, with jest: \\n' + // Break up requires to avoid accidentally parsing them as dependencies.\n \"jest.mock('scheduler', () => require\" + \"('scheduler/unstable_mock'));\\n\\n\" + 'For more info, visit https://reactjs.org/link/mock-scheduler');\n }\n }\n }\n}", "function warnIfUnmockedScheduler(fiber) {\n {\n if (didWarnAboutUnmockedScheduler === false && Scheduler.unstable_flushAllWithoutAsserting === undefined) {\n if (fiber.mode & BlockingMode || fiber.mode & ConcurrentMode) {\n didWarnAboutUnmockedScheduler = true;\n\n error('In Concurrent or Sync modes, the \"scheduler\" module needs to be mocked ' + 'to guarantee consistent behaviour across tests and browsers. ' + 'For example, with jest: \\n' + // Break up requires to avoid accidentally parsing them as dependencies.\n \"jest.mock('scheduler', () => require\" + \"('scheduler/unstable_mock'));\\n\\n\" + 'For more info, visit https://reactjs.org/link/mock-scheduler');\n }\n }\n }\n}", "function warnIfUnmockedScheduler(fiber) {\n {\n if (didWarnAboutUnmockedScheduler === false && Scheduler.unstable_flushAllWithoutAsserting === undefined) {\n if (fiber.mode & BlockingMode || fiber.mode & ConcurrentMode) {\n didWarnAboutUnmockedScheduler = true;\n\n error('In Concurrent or Sync modes, the \"scheduler\" module needs to be mocked ' + 'to guarantee consistent behaviour across tests and browsers. ' + 'For example, with jest: \\n' + // Break up requires to avoid accidentally parsing them as dependencies.\n \"jest.mock('scheduler', () => require\" + \"('scheduler/unstable_mock'));\\n\\n\" + 'For more info, visit https://reactjs.org/link/mock-scheduler');\n }\n }\n }\n}", "function warnIfUnmockedScheduler(fiber) {\n {\n if (didWarnAboutUnmockedScheduler === false && Scheduler.unstable_flushAllWithoutAsserting === undefined) {\n if (fiber.mode & BlockingMode || fiber.mode & ConcurrentMode) {\n didWarnAboutUnmockedScheduler = true;\n\n error('In Concurrent or Sync modes, the \"scheduler\" module needs to be mocked ' + 'to guarantee consistent behaviour across tests and browsers. ' + 'For example, with jest: \\n' + // Break up requires to avoid accidentally parsing them as dependencies.\n \"jest.mock('scheduler', () => require\" + \"('scheduler/unstable_mock'));\\n\\n\" + 'For more info, visit https://reactjs.org/link/mock-scheduler');\n }\n }\n }\n}", "function warnIfUnmockedScheduler(fiber){{if(didWarnAboutUnmockedScheduler===false&&Scheduler.unstable_flushAllWithoutAsserting===undefined){if(fiber.mode&BlockingMode||fiber.mode&ConcurrentMode){didWarnAboutUnmockedScheduler=true;error('In Concurrent or Sync modes, the \"scheduler\" module needs to be mocked '+'to guarantee consistent behaviour across tests and browsers. '+'For example, with jest: \\n'+// Break up requires to avoid accidentally parsing them as dependencies.\n\"jest.mock('scheduler', () => require\"+\"('scheduler/unstable_mock'));\\n\\n\"+'For more info, visit https://reactjs.org/link/mock-scheduler');}}}}", "function warnIfUnmockedScheduler(fiber){{if(didWarnAboutUnmockedScheduler===false&&Scheduler.unstable_flushAllWithoutAsserting===undefined){if(fiber.mode&BlockingMode||fiber.mode&ConcurrentMode){didWarnAboutUnmockedScheduler=true;error('In Concurrent or Sync modes, the \"scheduler\" module needs to be mocked '+'to guarantee consistent behaviour across tests and browsers. '+'For example, with jest: \\n'+// Break up requires to avoid accidentally parsing them as dependencies.\n\"jest.mock('scheduler', () => require\"+\"('scheduler/unstable_mock'));\\n\\n\"+'For more info, visit https://reactjs.org/link/mock-scheduler');}}}}", "function unfreeze() {\n _isFrozen = false;\n }", "function warnIfUnmockedScheduler(fiber){{if(didWarnAboutUnmockedScheduler===false&&Scheduler.unstable_flushAllWithoutAsserting===undefined){if(fiber.mode&BlockingMode||fiber.mode&ConcurrentMode){didWarnAboutUnmockedScheduler=true;error('In Concurrent or Sync modes, the \"scheduler\" module needs to be mocked '+'to guarantee consistent behaviour across tests and browsers. '+'For example, with jest: \\n'+\"jest.mock('scheduler', () => require('scheduler/unstable_mock'));\\n\\n\"+'For more info, visit https://fb.me/react-mock-scheduler');}}}}", "function warnIfUnmockedScheduler(fiber){{if(didWarnAboutUnmockedScheduler===false&&Scheduler.unstable_flushAllWithoutAsserting===undefined){if(fiber.mode&BlockingMode||fiber.mode&ConcurrentMode){didWarnAboutUnmockedScheduler=true;error('In Concurrent or Sync modes, the \"scheduler\" module needs to be mocked '+'to guarantee consistent behaviour across tests and browsers. '+'For example, with jest: \\n'+\"jest.mock('scheduler', () => require('scheduler/unstable_mock'));\\n\\n\"+'For more info, visit https://fb.me/react-mock-scheduler');}}}}", "function warnIfUnmockedScheduler(fiber){{if(didWarnAboutUnmockedScheduler===false&&Scheduler.unstable_flushAllWithoutAsserting===undefined){if(fiber.mode&BlockingMode||fiber.mode&ConcurrentMode){didWarnAboutUnmockedScheduler=true;error('In Concurrent or Sync modes, the \"scheduler\" module needs to be mocked '+'to guarantee consistent behaviour across tests and browsers. '+'For example, with jest: \\n'+\"jest.mock('scheduler', () => require('scheduler/unstable_mock'));\\n\\n\"+'For more info, visit https://fb.me/react-mock-scheduler');}}}}", "function warnIfUnmockedScheduler(fiber) {\n {\n if (didWarnAboutUnmockedScheduler === false && Scheduler.unstable_flushAllWithoutAsserting === undefined) {\n if (fiber.mode & BlockingMode || fiber.mode & ConcurrentMode) {\n didWarnAboutUnmockedScheduler = true;\n warningWithoutStack$1(false, 'In Concurrent or Sync modes, the \"scheduler\" module needs to be mocked ' + 'to guarantee consistent behaviour across tests and browsers. ' + 'For example, with jest: \\n' + \"jest.mock('scheduler', () => require('scheduler/unstable_mock'));\\n\\n\" + 'For more info, visit https://fb.me/react-mock-scheduler');\n } else if (warnAboutUnmockedScheduler === true) {\n didWarnAboutUnmockedScheduler = true;\n warningWithoutStack$1(false, 'Starting from React v17, the \"scheduler\" module will need to be mocked ' + 'to guarantee consistent behaviour across tests and browsers. ' + 'For example, with jest: \\n' + \"jest.mock('scheduler', () => require('scheduler/unstable_mock'));\\n\\n\" + 'For more info, visit https://fb.me/react-mock-scheduler');\n }\n }\n }\n}", "function warnIfUnmockedScheduler(fiber) {\n {\n if (didWarnAboutUnmockedScheduler === false && Scheduler.unstable_flushAllWithoutAsserting === undefined) {\n if (fiber.mode & BlockingMode || fiber.mode & ConcurrentMode) {\n didWarnAboutUnmockedScheduler = true;\n warningWithoutStack$1(false, 'In Concurrent or Sync modes, the \"scheduler\" module needs to be mocked ' + 'to guarantee consistent behaviour across tests and browsers. ' + 'For example, with jest: \\n' + \"jest.mock('scheduler', () => require('scheduler/unstable_mock'));\\n\\n\" + 'For more info, visit https://fb.me/react-mock-scheduler');\n } else if (warnAboutUnmockedScheduler === true) {\n didWarnAboutUnmockedScheduler = true;\n warningWithoutStack$1(false, 'Starting from React v17, the \"scheduler\" module will need to be mocked ' + 'to guarantee consistent behaviour across tests and browsers. ' + 'For example, with jest: \\n' + \"jest.mock('scheduler', () => require('scheduler/unstable_mock'));\\n\\n\" + 'For more info, visit https://fb.me/react-mock-scheduler');\n }\n }\n }\n}", "function warnIfUnmockedScheduler(fiber) {\n {\n if (didWarnAboutUnmockedScheduler === false && Scheduler.unstable_flushAllWithoutAsserting === undefined) {\n if (fiber.mode & BlockingMode || fiber.mode & ConcurrentMode) {\n didWarnAboutUnmockedScheduler = true;\n warningWithoutStack$1(false, 'In Concurrent or Sync modes, the \"scheduler\" module needs to be mocked ' + 'to guarantee consistent behaviour across tests and browsers. ' + 'For example, with jest: \\n' + \"jest.mock('scheduler', () => require('scheduler/unstable_mock'));\\n\\n\" + 'For more info, visit https://fb.me/react-mock-scheduler');\n } else if (warnAboutUnmockedScheduler === true) {\n didWarnAboutUnmockedScheduler = true;\n warningWithoutStack$1(false, 'Starting from React v17, the \"scheduler\" module will need to be mocked ' + 'to guarantee consistent behaviour across tests and browsers. ' + 'For example, with jest: \\n' + \"jest.mock('scheduler', () => require('scheduler/unstable_mock'));\\n\\n\" + 'For more info, visit https://fb.me/react-mock-scheduler');\n }\n }\n }\n}", "function warnIfUnmockedScheduler(fiber) {\n {\n if (didWarnAboutUnmockedScheduler === false && Scheduler.unstable_flushAllWithoutAsserting === undefined) {\n if (fiber.mode & BatchedMode || fiber.mode & ConcurrentMode) {\n didWarnAboutUnmockedScheduler = true;\n warningWithoutStack$1(false, 'In Concurrent or Sync modes, the \"scheduler\" module needs to be mocked ' + 'to guarantee consistent behaviour across tests and browsers. ' + 'For example, with jest: \\n' + \"jest.mock('scheduler', () => require('scheduler/unstable_mock'));\\n\\n\" + 'For more info, visit https://fb.me/react-mock-scheduler');\n } else if (warnAboutUnmockedScheduler === true) {\n didWarnAboutUnmockedScheduler = true;\n warningWithoutStack$1(false, 'Starting from React v17, the \"scheduler\" module will need to be mocked ' + 'to guarantee consistent behaviour across tests and browsers. ' + 'For example, with jest: \\n' + \"jest.mock('scheduler', () => require('scheduler/unstable_mock'));\\n\\n\" + 'For more info, visit https://fb.me/react-mock-scheduler');\n }\n }\n }\n }", "function skipWaiting() {\n\n self.skipWaiting();\n }", "function warnIfUnmockedScheduler(fiber) {\n {\n if (didWarnAboutUnmockedScheduler === false && Scheduler.unstable_flushAllWithoutAsserting === undefined) {\n if (fiber.mode & BatchedMode || fiber.mode & ConcurrentMode) {\n didWarnAboutUnmockedScheduler = true;\n warningWithoutStack$1(false, 'In Concurrent or Sync modes, the \"scheduler\" module needs to be mocked ' + 'to guarantee consistent behaviour across tests and browsers. ' + 'For example, with jest: \\n' + \"jest.mock('scheduler', () => require('scheduler/unstable_mock'));\\n\\n\" + 'For more info, visit https://fb.me/react-mock-scheduler');\n } else if (warnAboutUnmockedScheduler === true) {\n didWarnAboutUnmockedScheduler = true;\n warningWithoutStack$1(false, 'Starting from React v17, the \"scheduler\" module will need to be mocked ' + 'to guarantee consistent behaviour across tests and browsers. ' + 'For example, with jest: \\n' + \"jest.mock('scheduler', () => require('scheduler/unstable_mock'));\\n\\n\" + 'For more info, visit https://fb.me/react-mock-scheduler');\n }\n }\n }\n}", "function warnIfUnmockedScheduler(fiber) {\n {\n if (didWarnAboutUnmockedScheduler === false && Scheduler.unstable_flushAllWithoutAsserting === undefined) {\n if (fiber.mode & BatchedMode || fiber.mode & ConcurrentMode) {\n didWarnAboutUnmockedScheduler = true;\n warningWithoutStack$1(false, 'In Concurrent or Sync modes, the \"scheduler\" module needs to be mocked ' + 'to guarantee consistent behaviour across tests and browsers. ' + 'For example, with jest: \\n' + \"jest.mock('scheduler', () => require('scheduler/unstable_mock'));\\n\\n\" + 'For more info, visit https://fb.me/react-mock-scheduler');\n } else if (warnAboutUnmockedScheduler === true) {\n didWarnAboutUnmockedScheduler = true;\n warningWithoutStack$1(false, 'Starting from React v17, the \"scheduler\" module will need to be mocked ' + 'to guarantee consistent behaviour across tests and browsers. ' + 'For example, with jest: \\n' + \"jest.mock('scheduler', () => require('scheduler/unstable_mock'));\\n\\n\" + 'For more info, visit https://fb.me/react-mock-scheduler');\n }\n }\n }\n}", "function warnIfUnmockedScheduler(fiber) {\n {\n if (didWarnAboutUnmockedScheduler === false && Scheduler.unstable_flushAllWithoutAsserting === undefined) {\n if (fiber.mode & BatchedMode || fiber.mode & ConcurrentMode) {\n didWarnAboutUnmockedScheduler = true;\n warningWithoutStack$1(false, 'In Concurrent or Sync modes, the \"scheduler\" module needs to be mocked ' + 'to guarantee consistent behaviour across tests and browsers. ' + 'For example, with jest: \\n' + \"jest.mock('scheduler', () => require('scheduler/unstable_mock'));\\n\\n\" + 'For more info, visit https://fb.me/react-mock-scheduler');\n } else if (warnAboutUnmockedScheduler === true) {\n didWarnAboutUnmockedScheduler = true;\n warningWithoutStack$1(false, 'Starting from React v17, the \"scheduler\" module will need to be mocked ' + 'to guarantee consistent behaviour across tests and browsers. ' + 'For example, with jest: \\n' + \"jest.mock('scheduler', () => require('scheduler/unstable_mock'));\\n\\n\" + 'For more info, visit https://fb.me/react-mock-scheduler');\n }\n }\n }\n}", "function warnIfUnmockedScheduler(fiber) {\n {\n if (didWarnAboutUnmockedScheduler === false && Scheduler.unstable_flushAllWithoutAsserting === undefined) {\n if (fiber.mode & BatchedMode || fiber.mode & ConcurrentMode) {\n didWarnAboutUnmockedScheduler = true;\n warningWithoutStack$1(false, 'In Concurrent or Sync modes, the \"scheduler\" module needs to be mocked ' + 'to guarantee consistent behaviour across tests and browsers. ' + 'For example, with jest: \\n' + \"jest.mock('scheduler', () => require('scheduler/unstable_mock'));\\n\\n\" + 'For more info, visit https://fb.me/react-mock-scheduler');\n } else if (warnAboutUnmockedScheduler === true) {\n didWarnAboutUnmockedScheduler = true;\n warningWithoutStack$1(false, 'Starting from React v17, the \"scheduler\" module will need to be mocked ' + 'to guarantee consistent behaviour across tests and browsers. ' + 'For example, with jest: \\n' + \"jest.mock('scheduler', () => require('scheduler/unstable_mock'));\\n\\n\" + 'For more info, visit https://fb.me/react-mock-scheduler');\n }\n }\n }\n}", "function warnIfUnmockedScheduler(fiber) {\n {\n if (didWarnAboutUnmockedScheduler === false && Scheduler.unstable_flushAllWithoutAsserting === undefined) {\n if (fiber.mode & BatchedMode || fiber.mode & ConcurrentMode) {\n didWarnAboutUnmockedScheduler = true;\n warningWithoutStack$1(false, 'In Concurrent or Sync modes, the \"scheduler\" module needs to be mocked ' + 'to guarantee consistent behaviour across tests and browsers. ' + 'For example, with jest: \\n' + \"jest.mock('scheduler', () => require('scheduler/unstable_mock'));\\n\\n\" + 'For more info, visit https://fb.me/react-mock-scheduler');\n } else if (warnAboutUnmockedScheduler === true) {\n didWarnAboutUnmockedScheduler = true;\n warningWithoutStack$1(false, 'Starting from React v17, the \"scheduler\" module will need to be mocked ' + 'to guarantee consistent behaviour across tests and browsers. ' + 'For example, with jest: \\n' + \"jest.mock('scheduler', () => require('scheduler/unstable_mock'));\\n\\n\" + 'For more info, visit https://fb.me/react-mock-scheduler');\n }\n }\n }\n}", "function unless_(self, b, __trace) {\n return (0, _core.suspend)(() => b() ? _core.unit : (0, _asUnit.asUnit)(self), __trace);\n}", "function isFrozen(obj) {\n if (!obj) { return true; }\n // TODO(erights): Object(<primitive>) wrappers should also be\n // considered frozen.\n if (obj.FROZEN___ === obj) { return true; }\n var t = typeof obj;\n return t !== 'object' && t !== 'function';\n }", "_ensureEmptyStackBarrier() {\n if (!this._emptyStackBarrier) {\n this._emptyStackBarrier = scheduleNextPossibleRun(this._executeEmptyStackBarrier);\n }\n }", "function specOnlyIsInstructionStateEmpty() {\n return instructionState.lFrame.parent === null;\n}", "function assert(){\n called = true;\n }", "function specOnlyIsInstructionStateEmpty() {\n return instructionState.lFrame.parent === null;\n}", "function specOnlyIsInstructionStateEmpty() {\n return instructionState.lFrame.parent === null;\n}", "function specOnlyIsInstructionStateEmpty() {\n return instructionState.lFrame.parent === null;\n}", "function specOnlyIsInstructionStateEmpty() {\n return instructionState.lFrame.parent === null;\n}", "function specOnlyIsInstructionStateEmpty() {\n return instructionState.lFrame.parent === null;\n}", "function specOnlyIsInstructionStateEmpty() {\n return instructionState.lFrame.parent === null;\n}", "function specOnlyIsInstructionStateEmpty() {\n return instructionState.lFrame.parent === null;\n }", "unabledOrDisableFreezeGraph() {\n this.frozen = !this.frozen;\n this.nodes.forEach(d => d.fixed = this.frozen);\n }", "function objectFrozen(obj){if(!Object.isFrozen){return false;}return Object.isFrozen(obj);}", "function unless(b, __trace) {\n return self => (0, _core.suspend)(() => b() ? _core.unit : (0, _asUnit.asUnit)(self), __trace);\n}", "static get NOT_READY () {return 0}", "get executionInvariant() {\n return this.state.executionCount < 4;\n }", "function $deny_frozen_access(obj) {\n if (obj.$$frozen) {\n $raise(Opal.FrozenError, \"can't modify frozen \" + (obj.$class()) + \": \" + (obj), Opal.hash2([\"receiver\"], {\"receiver\": obj}));\n }\n }", "function assertRunning() {\r\n assert(testCase.debugContext.started, \" Command is only valid in a running script.\");\r\n}" ]
[ "0.76341915", "0.7626436", "0.7626436", "0.7626436", "0.7626436", "0.62275994", "0.6100189", "0.59010684", "0.5881789", "0.57037205", "0.57037205", "0.57037205", "0.57037205", "0.57037205", "0.57037205", "0.5658851", "0.5658851", "0.5658851", "0.5658851", "0.5658851", "0.56508046", "0.56489", "0.56489", "0.56489", "0.56489", "0.56489", "0.56489", "0.56489", "0.56489", "0.56489", "0.56489", "0.56489", "0.56489", "0.56489", "0.56489", "0.56489", "0.56489", "0.56489", "0.56489", "0.56489", "0.56489", "0.56489", "0.56489", "0.56489", "0.56197804", "0.5613006", "0.5613006", "0.5613006", "0.5613006", "0.5613006", "0.5613006", "0.5613006", "0.5613006", "0.5613006", "0.5613006", "0.5613006", "0.5613006", "0.5613006", "0.5613006", "0.5613006", "0.5613006", "0.56043285", "0.56043285", "0.55779535", "0.55667007", "0.55667007", "0.55667007", "0.5406957", "0.5406957", "0.5406957", "0.5400463", "0.54002434", "0.5358426", "0.5358426", "0.5358426", "0.5358426", "0.5358426", "0.5273751", "0.5265973", "0.52475107", "0.52343976", "0.52328646", "0.520063", "0.520063", "0.520063", "0.520063", "0.520063", "0.520063", "0.52005595", "0.5190854", "0.51897836", "0.5114228", "0.50926244", "0.508281", "0.50817007", "0.4990692" ]
0.752398
9
Assert `node` is a Unist node.
function assertNode(node) { if (!node || !string(node.type)) { throw new Error('Expected node, got `' + node + '`') } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function assertNode(node) {\n if (!node || !string(node.type)) {\n throw new Error('Expected node, got `' + node + '`');\n }\n}", "function assertNode(node) {\n if (!node || typeof node.type !== 'string') {\n throw new Error('Expected node, got `' + node + '`')\n }\n}", "function assertNode(node) {\n if (!node || typeof node.type !== 'string') {\n throw new Error('Expected node, got `' + node + '`')\n }\n}", "function assertNode(node) {\n if (!node || typeof node.type !== 'string') {\n throw new Error('Expected node, got `' + node + '`')\n }\n}", "function assertNode(node) {\n if (!node || typeof node.type !== 'string') {\n throw new Error('Expected node, got `' + node + '`')\n }\n}", "function _assertUnremoved() {\n if (this.removed) {\n throw this.errorWithNode(\"NodePath has been removed so is read-only.\");\n }\n}", "function _assertUnremoved() {\n if (this.removed) {\n throw this.errorWithNode(\"NodePath has been removed so is read-only.\");\n }\n}", "function _assertUnremoved() {\n\t if (this.removed) {\n\t throw this.errorWithNode(\"NodePath has been removed so is read-only.\");\n\t }\n\t}", "function _assertUnremoved() {\n\t if (this.removed) {\n\t throw this.errorWithNode(\"NodePath has been removed so is read-only.\");\n\t }\n\t}", "function assertNodeType(node, type) {\n var typedNode = checkNodeType(node, type);\n\n if (!typedNode) {\n throw new Error(\"Expected node of type \" + type + \", but got \" + (node ? \"node of type \" + node.type : String(node)));\n } // $FlowFixMe: Unsure why.\n\n\n return typedNode;\n}", "function assertNodeType(node, type) {\n var typedNode = checkNodeType(node, type);\n\n if (!typedNode) {\n throw new Error(\"Expected node of type \" + type + \", but got \" + (node ? \"node of type \" + node.type : String(node)));\n } // $FlowFixMe: Unsure why.\n\n\n return typedNode;\n}", "function assertNodeType(node, type) {\n var typedNode = checkNodeType(node, type);\n\n if (!typedNode) {\n throw new Error(\"Expected node of type \" + type + \", but got \" + (node ? \"node of type \" + node.type : String(node)));\n } // $FlowFixMe: Unsure why.\n\n\n return typedNode;\n}", "function uunodehas(node, // @param Node: child node\r\n context) { // @param Node: context(parent) node\r\n // @return Boolean:\r\n for (var c = node; c && c !== context;) {\r\n c = c.parentNode;\r\n }\r\n return node !== context && c === context;\r\n}", "function isNode(x) {\n return x !== null && typeof x === \"object\" && typeof x.type === \"string\";\n}", "function assertListContent(node) {\n if (!isListContent(node)) {\n throw new Error('Node is not a ListContent');\n }\n}", "static canInflect (node) {\n return false\n }", "static canInflect (node) {\n return false\n }", "static canInflect (node) {\n return false\n }", "static canInflect (node) {\n return false\n }", "static canInflect (node) {\n return true\n }", "static canInflect (node) {\n return true\n }", "static isNode(n) {\n return n && typeof n === \"object\" && typeof n.type === \"string\";\n }", "function U(t,e){return typeof t===e}", "function checkTypeAnnotationAsExpression(node) {\n checkTypeNodeAsExpression(node.type);\n }", "function isNode(node) {\r\n return node && node.nodeType && node.nodeName &&\r\n toString.call(node) === '[object Node]';\r\n }", "function hc_nodeelementnodename() {\n var success;\n var doc;\n var elementNode;\n var elementName;\n doc = load(\"hc_staff\");\n elementNode = doc.documentElement;\n\n elementName = elementNode.nodeName;\n\n \n\tif(\n\t\n\t(builder.contentType == \"image/svg+xml\")\n\n\t) {\n\tassertEquals(\"svgNodeName\",\"svg\",elementName);\n \n\t}\n\t\n\t\telse {\n\t\t\tassertEqualsAutoCase(\"element\", \"nodeName\",\"html\",elementName);\n \n\t\t}\n\t\n}", "function assertAtomFamily(node, family) {\n var typedNode = checkAtomFamily(node, family);\n\n if (!typedNode) {\n throw new Error(\"Expected node of type \\\"atom\\\" and family \\\"\" + family + \"\\\", but got \" + (node ? node.type === \"atom\" ? \"atom of family \" + node.family : \"node of type \" + node.type : String(node)));\n }\n\n return typedNode;\n}", "function assertAtomFamily(node, family) {\n var typedNode = checkAtomFamily(node, family);\n\n if (!typedNode) {\n throw new Error(\"Expected node of type \\\"atom\\\" and family \\\"\" + family + \"\\\", but got \" + (node ? node.type === \"atom\" ? \"atom of family \" + node.family : \"node of type \" + node.type : String(node)));\n }\n\n return typedNode;\n}", "function assertAtomFamily(node, family) {\n var typedNode = checkAtomFamily(node, family);\n\n if (!typedNode) {\n throw new Error(\"Expected node of type \\\"atom\\\" and family \\\"\" + family + \"\\\", but got \" + (node ? node.type === \"atom\" ? \"atom of family \" + node.family : \"node of type \" + node.type : String(node)));\n }\n\n return typedNode;\n}", "function isTypeAssertion(node) {\n if (!node) {\n return false;\n }\n return (node.type === ts_estree_1.AST_NODE_TYPES.TSAsExpression ||\n node.type === ts_estree_1.AST_NODE_TYPES.TSTypeAssertion);\n}", "function TNode(){}", "function assertNodeDetails(convertedNode, jenkinsNode) {\n assert.equal(convertedNode.name, jenkinsNode.displayName, 'name');\n assert.equal(convertedNode.id, jenkinsNode.id, 'id');\n}", "function checkSubtree() {\n \n}", "function isHTMLElement(node) {\n var OwnElement = getWindow(node).HTMLElement;\n return node instanceof OwnElement;\n }", "function validateNode(node) {\n return [\n node.type === \"Literal\" && typeof node.value === \"string\"\n ];\n}", "function node(){}", "function uunodeidremove(node) { // @param Node:\r\n // @return Node: removed node\r\n node.uuguid && (uunodeid._db[node.uuguid] = null, node.uuguid = null);\r\n return node;\r\n}", "function isElement(node) {\n var OwnElement = getWindow(node).Element;\n return node instanceof OwnElement;\n }", "function _crossCheck (node) {\n if (!ecma.util.isa(node, CNode)) {\n throw new Error('child is not a data node');\n }\n if (node.parentNode !== this) {\n throw new Error('child belongs to another parent');\n }\n }", "function checkIfAncestorElement(element, node) {\n if (!element.contains(node)) {\n hideElement(element);\n }\n}", "function unflowedTest( node){\n\tconst open= openTest( node)\n\tif( !open){\n\t\treturn false\n\t}\n\n\tconst tag= lastTag= open[ 1];\n\tlet closeTest= closeTests[ tag]\n\tif( !closeTest){\n\t\tconst re= new RegExp( `</\\s*${open[ 1]}\\s*>\\s*$`)\n\t\tcloseTest= closeTests[ tag]= makeNodeTest( re)\n\t}\n\n\t// check to see if this node closes\n\tif( closeTest(node.value)){\n\t\treturn false\n\t}\n\n\t// return the tester to find the closing pair\n\treturn closeTest\n}", "function isTypeAssertion(node) {\n if (!node) {\n return false;\n }\n return (node.type === experimental_utils_1.AST_NODE_TYPES.TSAsExpression ||\n node.type === experimental_utils_1.AST_NODE_TYPES.TSTypeAssertion);\n}", "function _verifyNodeList(nodes) {\n\t if (nodes.constructor !== Array) {\n\t nodes = [nodes];\n\t }\n\n\t for (var i = 0; i < nodes.length; i++) {\n\t var node = nodes[i];\n\t if (!node) {\n\t throw new Error(\"Node list has falsy node with the index of \" + i);\n\t } else if (typeof node !== \"object\") {\n\t throw new Error(\"Node list contains a non-object node with the index of \" + i);\n\t } else if (!node.type) {\n\t throw new Error(\"Node list contains a node without a type with the index of \" + i);\n\t } else if (node instanceof _index2[\"default\"]) {\n\t nodes[i] = node.node;\n\t }\n\t }\n\n\t return nodes;\n\t}", "function _verifyNodeList(nodes) {\n\t if (nodes.constructor !== Array) {\n\t nodes = [nodes];\n\t }\n\n\t for (var i = 0; i < nodes.length; i++) {\n\t var node = nodes[i];\n\t if (!node) {\n\t throw new Error(\"Node list has falsy node with the index of \" + i);\n\t } else if (typeof node !== \"object\") {\n\t throw new Error(\"Node list contains a non-object node with the index of \" + i);\n\t } else if (!node.type) {\n\t throw new Error(\"Node list contains a node without a type with the index of \" + i);\n\t } else if (node instanceof _index2[\"default\"]) {\n\t nodes[i] = node.node;\n\t }\n\t }\n\n\t return nodes;\n\t}", "function _verifyNodeList(nodes) {\n if (nodes.constructor !== Array) {\n nodes = [nodes];\n }\n\n for (var i = 0; i < nodes.length; i++) {\n var node = nodes[i];\n if (!node) {\n throw new Error(\"Node list has falsy node with the index of \" + i);\n } else if (typeof node !== \"object\") {\n throw new Error(\"Node list contains a non-object node with the index of \" + i);\n } else if (!node.type) {\n throw new Error(\"Node list contains a node without a type with the index of \" + i);\n } else if (node instanceof _index2[\"default\"]) {\n nodes[i] = node.node;\n }\n }\n\n return nodes;\n}", "function hasBlacklistedType(node, parent, scope, state) {\n if (node.type === state.type) {\n state.has = true;\n this.skip();\n }\n}", "static isOfMyType(node) {\n return true; // default implementation: if the tagname matches, it's mine.\n }", "function uid2node(uid) { // @param String: unique id\r\n // @return Node/undefined:\r\n return _uid2node[uid];\r\n}", "function assertDefinition(node) {\n if (!isDefinition(node)) {\n throw new Error('Node is not a Definition');\n }\n}", "function isHTMLElement(node) {\n var OwnElement = getWindow(node).HTMLElement;\n return node instanceof OwnElement || node instanceof HTMLElement;\n }", "function hasBlacklistedType(node, parent, scope, state) {\n\t if (node.type === state.type) {\n\t state.has = true;\n\t this.skip();\n\t }\n\t}", "function hasBlacklistedType(node, parent, scope, state) {\n\t if (node.type === state.type) {\n\t state.has = true;\n\t this.skip();\n\t }\n\t}", "function TNode() {}", "function TNode() {}", "function TNode() {}", "function isHTMLElement(node) {\n var OwnElement = getWindow(node).HTMLElement;\n return node instanceof OwnElement || node instanceof HTMLElement;\n}", "function isHTMLElement(node) {\n var OwnElement = getWindow(node).HTMLElement;\n return node instanceof OwnElement || node instanceof HTMLElement;\n}", "function isHTMLElement(node) {\n var OwnElement = getWindow(node).HTMLElement;\n return node instanceof OwnElement || node instanceof HTMLElement;\n}", "function isHTMLElement(node) {\n var OwnElement = getWindow(node).HTMLElement;\n return node instanceof OwnElement || node instanceof HTMLElement;\n}", "function isHTMLElement(node) {\n var OwnElement = getWindow(node).HTMLElement;\n return node instanceof OwnElement || node instanceof HTMLElement;\n}", "function isHTMLElement(node) {\n var OwnElement = getWindow(node).HTMLElement;\n return node instanceof OwnElement || node instanceof HTMLElement;\n}", "function notAlreadyMarked(node) {\n \"use strict\";\n return ($(node).closest(\"a.gloss\").length === 0);\n}", "expectItemType() {\n cy.log('Common.Editor.expectItemType');\n this.element.find(this.itemIcon)\n .should('exist');\n }", "function isElement(node) {\n var OwnElement = getWindow(node).Element;\n return node instanceof OwnElement || node instanceof Element;\n}", "function isElement(node) {\n var OwnElement = getWindow(node).Element;\n return node instanceof OwnElement || node instanceof Element;\n}", "function isUsableNode(node){\r\n\t\tvar tgN = node.tagName,\r\n\t\t\tinputNodeType, data, retVal;\r\n\t\t\t\r\n\t\tif(!node.dataset) node.dataset = {};\r\n\t\t\r\n\t\tdata = node.dataset;\r\n\t\t\r\n\t\tif(data && typeof data[CACHE_DATASET_STRING] !== \"undefined\")\r\n\t\t\tretVal = data[CACHE_DATASET_STRING] === \"true\";\r\n\t\t\r\n\t\telse if(isParent(node, null, [\"CodeMirror\", \"ace\"], 3))\r\n\t\t\tretVal = false;\r\n\t\t\r\n\t\telse if(tgN === \"TEXTAREA\" || isContentEditable(node))\r\n\t\t\tretVal = true;\r\n\t\t\r\n\t\telse if(tgN === \"INPUT\"){\r\n\t\t\tinputNodeType = node.getAttribute(\"type\");\r\n\t\t\tretVal = allowedInputElms.indexOf(inputNodeType) > -1;\r\n\t\t}\t\t\r\n\t\telse retVal = false;\r\n\t\t\r\n\t\tnode.dataset[CACHE_DATASET_STRING] = retVal;\r\n\t\t\r\n\t\treturn retVal;\r\n\t}", "function UntouchabilityChecker(elementDocument) {\n this.doc = elementDocument;\n // Node cache must be refreshed on every check, in case\n // the content of the element has changed. The cache contains tuples\n // mapping nodes to their boolean result.\n this.cache = [];\n}", "function UntouchabilityChecker(elementDocument) {\n this.doc = elementDocument;\n // Node cache must be refreshed on every check, in case\n // the content of the element has changed. The cache contains tuples\n // mapping nodes to their boolean result.\n this.cache = [];\n}", "function UntouchabilityChecker(elementDocument) {\n this.doc = elementDocument;\n // Node cache must be refreshed on every check, in case\n // the content of the element has changed. The cache contains tuples\n // mapping nodes to their boolean result.\n this.cache = [];\n}", "function UntouchabilityChecker(elementDocument) {\n this.doc = elementDocument;\n // Node cache must be refreshed on every check, in case\n // the content of the element has changed. The cache contains tuples\n // mapping nodes to their boolean result.\n this.cache = [];\n}", "function isNodeFromTemplate(node) {\n if (isFalse$3(node instanceof Node)) {\n return false;\n } // TODO [#1250]: skipping the shadowRoot instances itself makes no sense, we need to revisit\n // this with locker\n\n\n if (node instanceof ShadowRoot) {\n return false;\n }\n\n if (useSyntheticShadow) {\n // TODO [#1252]: old behavior that is still used by some pieces of the platform,\n // specifically, nodes inserted manually on places where `lwc:dom=\"manual\"` directive is not\n // used, will be considered global elements.\n if (isUndefined$4(node.$shadowResolver$)) {\n return false;\n }\n }\n\n const root = node.getRootNode();\n return root instanceof ShadowRoot;\n }", "function checkNode(node, prefix) {\n if (node instanceof Bucket) {\n var contacts = node.obtain();\n for (var i = 0; i < contacts.length; ++i) {\n for (var j = 0; j < prefix.length; ++j) {\n contacts[i].id.at(j).should.equal(prefix[j]);\n }\n }\n } else {\n checkNode(node.left, prefix.concat(false));\n checkNode(node.right, prefix.concat(true));\n }\n}", "function testType(d, type) {\n return node_by_id[d.source].type === type || node_by_id[d.target].type === type;\n } //A version that has to be used after the simulations have run", "function isNode(nodeImpl) {\n return Boolean(nodeImpl && \"nodeType\" in nodeImpl);\n}", "function isElement(node) {\n var OwnElement = getWindow(node).Element;\n return node instanceof OwnElement || node instanceof Element;\n }", "function _isNode(o){\n return (\n typeof Node === \"object\" ? o instanceof Node : \n o && typeof o === \"object\" && typeof o.nodeType === \"number\" && typeof o.nodeName===\"string\"\n );\n }", "function nodeTest(assert) { \n let name = nodeStore.address[assert.loc.toString()].name; \n let index = nodeStore.address[assert.loc.toString()].index; \n let result = `${oneSpace}expect(wrapper.find('${name}').at(${index}).props().${assert.property}).`;\n result += evalTest(assert); \n return result;\n}", "function isInferrable(node, init) {\n if (node.type !== typescript_estree_1.AST_NODE_TYPES.TSTypeAnnotation ||\n !node.typeAnnotation) {\n return false;\n }\n const annotation = node.typeAnnotation;\n if (annotation.type === typescript_estree_1.AST_NODE_TYPES.TSStringKeyword) {\n if (init.type === typescript_estree_1.AST_NODE_TYPES.Literal) {\n return typeof init.value === 'string';\n }\n return false;\n }\n if (annotation.type === typescript_estree_1.AST_NODE_TYPES.TSBooleanKeyword) {\n return init.type === typescript_estree_1.AST_NODE_TYPES.Literal;\n }\n if (annotation.type === typescript_estree_1.AST_NODE_TYPES.TSNumberKeyword) {\n // Infinity is special\n if ((init.type === typescript_estree_1.AST_NODE_TYPES.UnaryExpression &&\n init.operator === '-' &&\n init.argument.type === typescript_estree_1.AST_NODE_TYPES.Identifier &&\n init.argument.name === 'Infinity') ||\n (init.type === typescript_estree_1.AST_NODE_TYPES.Identifier && init.name === 'Infinity')) {\n return true;\n }\n return (init.type === typescript_estree_1.AST_NODE_TYPES.Literal && typeof init.value === 'number');\n }\n return false;\n }", "function isSpecialNode(nodeString)\n{\n return(nodeString[0] == '_');\n}", "function TypeofTypeAnnotation(node, print) {\n this.push(\"typeof \");\n print.plain(node.argument);\n}", "function isNodeOneOf(elem,nodeTypeArray){if(nodeTypeArray.indexOf(elem.nodeName)!==-1){return true;}}", "function TypeofTypeAnnotation(node, print) {\n\t this.push(\"typeof \");\n\t print.plain(node.argument);\n\t}", "function TypeofTypeAnnotation(node, print) {\n\t this.push(\"typeof \");\n\t print.plain(node.argument);\n\t}", "function isString(node) {\n return t.isLiteral(node) && typeof node.value === \"string\";\n}", "function isString(node) {\n return t.isLiteral(node) && typeof node.value === \"string\";\n}", "function isNode(obj) {\n return !!((typeof Node === 'undefined' ? 'undefined' : _typeof(Node)) === 'object' ? obj instanceof Node : obj && (typeof obj === 'undefined' ? 'undefined' : _typeof(obj)) === 'object' && typeof obj.nodeType === 'number' && typeof obj.nodeName === 'string');\n }", "function isNoNBTNode(node) {\n return isTypedNode(node) && node.type === \"no-nbt\";\n}", "function TElementNode(){}", "function Node(){}", "function isElement(domNode) {\n return domNode.nodeType !== undefined;\n}", "function assertExist () {\n var val = flag(this, 'object');\n this.assert(\n val !== null && val !== undefined\n , 'expected #{this} to exist'\n , 'expected #{this} to not exist'\n );\n }", "function removeNode(node) {\n if(Editor.writeAccess && node != null)\n socket.emit(\"node/remove\", node);\n}", "function nodesAsObject(value) {\r\n return !!value && typeof value === 'object';\r\n}", "function isNode(o){\n return (\n typeof Node === \"object\" ? o instanceof Node : \n o && typeof o === \"object\" && typeof o.nodeType === \"number\" && typeof o.nodeName===\"string\"\n );\n}", "static isNode(val) {\n return val instanceof Node;\n }", "function isString(node) {\n\t return t.isLiteral(node) && typeof node.value === \"string\";\n\t}" ]
[ "0.62222254", "0.613726", "0.613726", "0.613726", "0.613726", "0.5832463", "0.5832463", "0.5619087", "0.5619087", "0.55799454", "0.55799454", "0.55799454", "0.52485055", "0.52275956", "0.5198362", "0.50964975", "0.50964975", "0.50964975", "0.50964975", "0.5045456", "0.5045456", "0.49719268", "0.48225057", "0.47004262", "0.4673544", "0.46698132", "0.46643975", "0.46643975", "0.46643975", "0.46407026", "0.463807", "0.46312448", "0.46243796", "0.46110588", "0.46031356", "0.45969322", "0.4588229", "0.45851094", "0.45766473", "0.45754972", "0.45743018", "0.45715016", "0.45562693", "0.45562693", "0.45391586", "0.45277265", "0.451361", "0.4491336", "0.4487748", "0.44814977", "0.4475297", "0.4475297", "0.44697925", "0.44697925", "0.44697925", "0.44578984", "0.44578984", "0.44578984", "0.44578984", "0.44578984", "0.44578984", "0.44501787", "0.44449624", "0.44422123", "0.44422123", "0.44385555", "0.44273052", "0.44273052", "0.44273052", "0.44273052", "0.44139034", "0.44095883", "0.44066906", "0.4406253", "0.4405258", "0.43898544", "0.43855712", "0.43706873", "0.43687662", "0.43676034", "0.43632114", "0.43621156", "0.43621156", "0.4361274", "0.4361274", "0.43400657", "0.43344408", "0.4329484", "0.43292612", "0.43158042", "0.43126738", "0.43112198", "0.43104643", "0.43048775", "0.43002343", "0.42946187" ]
0.62290317
4
Assert that `complete` is `true`.
function assertDone(name, asyncName, complete) { if (!complete) { throw new Error( '`' + name + '` finished async. Use `' + asyncName + '` instead' ) } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function assertDone(name, asyncName, complete) {\n if (!complete) {\n throw new Error('`' + name + '` finished async. Use `' + asyncName + '` instead');\n }\n}", "isComplete() {\n return (this.title === this.titleComplete) &&\n (this.labo === this.laboComplete) &&\n (this.univ === this.univComplete) &&\n (this.coAuthor === this.coAuthorComplete)\n }", "function complete() {\n\tconsole.log('Completed');\n}", "get isCompleted() { return this.result.isDefined }", "get isComplete() {\n return self.step.isComplete(self.annotations)\n }", "function testComplete() {\n process.nextTick(function() {\n if (testQueue.length > 0) {\n testQueue.shift()();\n }\n else {\n t.equal(async, expectAsync, \"captured all expected async callbacks\");\n t.equal(testQueue.length, 0, \"all tests have been processed\");\n }\n });\n }", "function checkComplete() {\n if (listQuestion.length === Object.keys(listResult).length) {\n return true\n } else {\n return false\n }\n}", "complete() {}", "checkComplete() {\n let result = true;\n for (let i = 0; i < this.solution.length; i++) {\n result = result && this.solution[i] === this.inputGates[i];\n }\n let oldComplete = this.complete;\n this.complete = result;\n if ((this.complete !== oldComplete) && this.complete) {\n bing.play();\n }\n }", "function isComplete(flags) {\n return (flags & FLAGS.COMPLETE) === FLAGS.COMPLETE;\n }", "function checkIfComplete() {\r\n if(isComplete == false) { //here no car has won yet\r\n isComplete = true; //a car won either car1 or car2\r\n }\r\n else {\r\n place = 'second';\r\n }\r\n }", "isComplete() {\n if (!this.endTime) return false;\n if (this.now() > this.endTime) {\n return true;\n }\n else {\n return false;\n }\n \n }", "function checkIfComplete(){\n\t\tif(isComplete == false){\n\t\t\tisComplete = true;\n\t\t} else {\n\t\t\tplace = ' SEGUNDO ';\n\t\t}\n\t}", "allQuestCompleted() {\n return !this.incompleteQuests().length;\n }", "done() {\n assert_equals(this._state, TaskState.STARTED)\n this._state = TaskState.FINISHED;\n\n let message = '< [' + this._label + '] ';\n\n if (this._result) {\n message += 'All assertions passed. (total ' + this._totalAssertions +\n ' assertions)';\n _logPassed(message);\n } else {\n message += this._failedAssertions + ' out of ' + this._totalAssertions +\n ' assertions were failed.'\n _logFailed(message);\n }\n\n this._resolve();\n }", "function SetComplete (){\n\tstoreDataValue( \"cmi.completion_status\", \"completed\" );\n}", "_checkIfComplete() {\n\n\t\tif(this._matchedCards === this.rows*this.cols) {\n\n\t\t\t// Delay for the animations\n\t\t\tsetTimeout(() => {\n\n\t\t\t\talert(`You have scored ${this._score} points`);\n\n\t\t\t\tclearInterval(this._timer);\n\n\t\t\t\tthis.initGame();\n\t\t\t}, 400);\n\t\t}\n\t}", "function isCompleted() {\n return cards.length === matchedCards.length;\n}", "review() {\n if (this.complete) {\n this.complete = !this.complete;\n }\n }", "function complete() {\n Y.log('complete');\n }", "isComplete() {\n try {\n if (!validator.isPositiveNumber(this.cap)) {\n return false;\n } else if (!validator.isPositiveNumber(this.tokenPrice)) {\n return false;\n }\n return true;\n } catch (error) {\n return false;\n }\n }", "static allQuestCompleted() {\n for (let questCompleted of player.completedQuestList) {\n if (!questCompleted()) {\n return false;\n }\n }\n return true;\n }", "function IteratorComplete(iterResult) {\n console.assert(Type(iterResult) === 'object');\n return Boolean(iterResult.done);\n }", "function complete() {\n Y.log('complete');\n }", "function complete() {\n Y.log('complete');\n }", "function complete() {\n Y.log('complete');\n }", "function complete() {\n Y.log('complete');\n }", "get isCompleted() {\r\n return this._isResolved || this._isRejected;\r\n }", "function complete(){\n if(++count == 2) done()\n }", "function IteratorComplete(iterResult) { // eslint-disable-line no-unused-vars\n\t\t// 1. Assert: Type(iterResult) is Object.\n\t\tif (Type(iterResult) !== 'object') {\n\t\t\tthrow new Error(Object.prototype.toString.call(iterResult) + 'is not an Object.');\n\t\t}\n\t\t// 2. Return ToBoolean(? Get(iterResult, \"done\")).\n\t\treturn ToBoolean(Get(iterResult, \"done\"));\n\t}", "get is_complete() {\n return !!(this.flags & PaintVolumeFlags.IS_COMPLETE);\n }", "get completed() {\n return this.wizardSteps.every(step => step.completed || step.optional);\n }", "completeAll() {\n records.forEach(function (todo, index) {\n todo.completed = true\n });\n }", "function checkIfCompleted() {\n matchingCards++;\n\n if (matchingCards >= Math.floor(fieldSize / 2)) {\n gameCompleted = true;\n timerStop();\n gratulation();\n }\n }", "get done() {\n return Boolean(this._set);\n }", "setCompleted() {\nreturn this.isComplete = true;\n}", "function iteratorComplete(iterResult) {\n\t\t// 1. Assert: Type(iterResult) is Object.\n\t\tif (typeof iterResult !== 'object') {\n\t\t\tthrow new Error(Object.prototype.toString.call(iterResult) + 'is not an Object.');\n\t\t}\n\t\t// 2. Return ToBoolean(? Get(iterResult, \"done\")).\n\t\treturn Boolean(iterResult['done']);\n\t}", "function loadComplete() {\n if (++docsLoaded == 1) {\n setUpPageStatus = 'complete';\n }\n}", "function loadComplete() {\n if (++docsLoaded == 1) {\n setUpPageStatus = 'complete';\n }\n}", "function loadComplete() {\n if (++docsLoaded == 1) {\n setUpPageStatus = 'complete';\n }\n}", "function loadComplete() {\n if (++docsLoaded == 1) {\n setUpPageStatus = 'complete';\n }\n}", "function areAllTodosComplete(){\n for (var i = 0; i < todos.length; i++){\n if (todos[i].state === 'notComplete')\n return false\n }\n \n return true\n}", "isCompleted(wizardStep) {\n return wizardStep instanceof WizardCompletionStep && this.wizard.completed;\n }", "isCompleted(wizardStep) {\n return wizardStep instanceof WizardCompletionStep && this.wizard.completed;\n }", "function canComplete() {\n return state.accounts.data.email && state.accounts.data.personId;\n }", "function complete() {\n // Play the animation and audio effect after task completion.\n\n setProperty(\"isComplete\", true);\n\n // Set distanceProgress to be at most the distance for the mission, subtract the difference from the offset.\n if (getProperty(\"missionType\") === \"audit\") {\n var distanceOver = getProperty(\"distanceProgress\") - getProperty(\"distance\");\n var oldOffset = svl.missionContainer.getTasksMissionsOffset();\n var newOffset = oldOffset - distanceOver;\n svl.missionContainer.setTasksMissionsOffset(newOffset);\n }\n\n // Reset the label counter\n if ('labelCounter' in svl) {\n labelCountsAtCompletion = {\n \"CurbRamp\": svl.labelCounter.countLabel(\"CurbRamp\"),\n \"NoCurbRamp\": svl.labelCounter.countLabel(\"NoCurbRamp\"),\n \"Obstacle\": svl.labelCounter.countLabel(\"Obstacle\"),\n \"SurfaceProblem\": svl.labelCounter.countLabel(\"SurfaceProblem\"),\n \"NoSidewalk\": svl.labelCounter.countLabel(\"NoSidewalk\"),\n \"Other\": svl.labelCounter.countLabel(\"Other\")\n };\n svl.labelCounter.reset();\n }\n\n if (!svl.isOnboarding()){\n svl.storage.set('completedFirstMission', true);\n }\n }", "function complete() {\n /* jshint validthis:true */\n if (!this._isDisposed) {\n this._subject.complete();\n }\n}", "hasCompleted() {\n let completed = this.props.todos.filter(\n todo => todo.complete\n );\n return completed.length > 0 ? true : false;\n }", "isComplete() {\n for (let i = 0; i < this.rounds.length; i++) {\n for (let j = 0; j < this.rounds[i].length; j++) {\n if (this.rounds[i][j] == \"\") {\n return false;\n }\n }\n }\n return true;\n }", "function SetIncomplete (){\n\tretrieveDataValue( \"cmi.completion_status\" );\n\tif (status != \"completed\"){\n\t\tstoreDataValue( \"cmi.completion_status\", \"incomplete\" );\n\t}\n}", "function async_completed() {\n\tasync_completions += 1;\n\tD.log(\"completions: \" + async_completions + \" out of \" + async_completions_waiting);\n\tif ( async_completions == async_completions_waiting ) {\n\t completion();\n\t}\n }", "function checkDone() {\r\n\t\t\tif (todo===0) {\r\n\t\t\t\tresultCallback(unmarshalledTable);\r\n\t\t\t}\r\n\t\t}", "function test(done) {\n // always pass\n return done(null, true)\n}", "function stateSetComplete()\n\t\t{\n\t\t\t_cb();\n\t\t}", "function checkSuccessfullEnd(){\n successfullEnd = true;\n if(moves>0) successfullEnd = false;\n if (successfullEnd) alert(\"you won!\") \n}", "isFinished (){\n\t\treturn this.status !== null && this.finishDelay < 0;\n\t}", "function checkQuestCompletion(quest) {\n searchResult = _.findWhere(quest.objectives, {\"status\": constants.quest.status.INCOMPLETE});\n\n if (searchResult === undefined) {\n quest.status = constants.quest.status.COMPLETE;\n }\n }", "get isComplete() {\n return this.value === \"100\" ? true : false;\n }", "hasFinished() {\n return this.status === 'finished';\n }", "function checkIfDone() {\n var done = true;\n var hasResult = false;\n \n\n for ( i = 0; i < results.length; i++) {\n \tconsole.log('results[' + i + '].waiting: ' + results[i].waiting);\n \tconsole.log('results[' + i + '].geo_info.valid: ' + results[i].geo_info.valid);\n \tconsole.log('results[i]:');\n \tconsole.log(results[i]);\n if (results[i].waiting) {\n done = false;\n break;\n }\n if (results[i].geo_info.valid) {\n hasResult = true;\n }\n }\n\t\t\tconsole.log(done);\n if (done) {\n if (hasResult) {\n finish(true);\n } else {\n console.log('failed'); finish(false);\n }\n }//if (done)\n\n }", "function TestForCompletion() {\n if (test_complete && callback) {\n callback(\"Server successfully tested!\");\n } else {\n if (++retrys < retry_limit) {\n setTimeout(TestForCompletion, retry_interval);\n } else if (callback) {\n callback(\n \"Server test failed to complete after \" +\n (retry_limit * retry_interval) / 1000 +\n \" seconds\"\n );\n }\n }\n }", "isComplete() {\n return this.selection.start != null && this.selection.end != null;\n }", "isComplete() {\n return this.selection.start != null && this.selection.end != null;\n }", "checkRangeComplete(firstRequestedNumber, firstTransactionObtained, rangeFirstTransaction, expectedRangeComplete) {\n // If the first requested number is 0 then the range is complete\n if (firstRequestedNumber === 0) {\n return true;\n } else {\n // Check that first transaction id in range has been reached\n if (rangeFirstTransaction.id !== false) {\n return this.checkIdReached(rangeFirstTransaction.id, firstTransactionObtained.id);\n // First transaction id in range cannot be checked - so use expectation based on numbers\n } else {\n return expectedRangeComplete;\n }\n }\n }", "function ok(value,message){if(!value)fail(value,true,message,'==',assert.ok);}", "function ok(value,message){if(!value)fail(value,true,message,'==',assert.ok);}", "function ok(value,message){if(!value)fail(value,true,message,'==',assert.ok);}", "function ok(value,message){if(!value)fail(value,true,message,'==',assert.ok);}", "completeList(){\n this.isListComplete = true;\n alert(`You have completed all tasks!`);\n }", "static isTutorialCompleted() {\n var _a;\n return ((_a = App.game.quests.getQuestLine('Tutorial Quests')) === null || _a === void 0 ? void 0 : _a.state()) == QuestLineState.ended;\n }", "isDone(wizardStep) {\n return wizardStep.completed;\n }", "isDone(wizardStep) {\n return wizardStep.completed;\n }", "function assertResult(document) {\n if (!document.isTrashed) {\n console.log(\"The document is not in the trashed state.\");\n return false;\n }\n\n console.log('Congratulations, you have successfully completed this exercise.');\n}", "function onDone(event){\n\tconsole.log('done button clicked');\n\tif (validateContents() === true){ \n finishTest();\n }\n\telse {\n\t\trepeatTest();\n\t\treset();\n\t}\n}", "isComplete() {\n return this.selection != null;\n }", "isComplete() {\n return this.selection != null;\n }", "function afterEach () {\n this.allPassed = this.allPassed && (this.currentTest.state === 'passed');\n}", "function complete(number) {\n if (number >= list.length) {\n console.log(`\\nInvalid Number\\n`);\n view()\n } else {\n list[number].done = true\n console.log(`\\nCompleted ${list[number].task}\\n`)\n menu();\n }\n}", "function tryOnComplete() {\n if (numCallbacks == numComplete && allCallbacksCreated) {\n onComplete();\n }\n }", "function ok(test, desc) { expect(test).toBe(true); }", "static async checkOrderComplete(poId) {\n try {\n const incompleteOrderItems = await shopdb.poitem.findAll({\n where: { poId: poId, dateComplete: null }\n });\n\n if (incompleteOrderItems.length > 0) {\n return false;\n } else {\n return true;\n }\n } catch (error) {\n throw error;\n }\n }", "function loadComplete() {\n\thasLoaded = true;\n}", "async assertResultStatus(){\n\t\tawait t\n\t\t.expect(resultText.innerText).eql('You clicked: Ok', {timeout:10000})\n\t}", "function assert(){\n called = true;\n }", "function checkSucess() {\n setTimeout(function() {\n if (answered && authenticated) {\n done();\n } else {\n checkSucess();\n }\n }, asyncDelay);\n }", "isDone() {\n return this.single.length == 0 ? true : false\n }", "function checkComplete(intent,session,callback)\n{\n if ((session[\"d\"][\"size\"]) && (session[\"d\"][\"type\"]) && (session[\"d\"][\"drink\"]) && (session[\"d\"][\"quantity\"]))\n {\n return true;\n \n }\n return false;\n}", "function assertGuestJsCorrect(frame, div, result) {\n // TODO(kpreid): reenable or declare completion value unsupported\n //assertEquals(12, result);\n console.warn('JS completion value not yet supported by ES5 mode; '\n + 'not testing.');\n }", "get isComplete() {\n\t\treturn (this._status === this._gl.FRAMEBUFFER_COMPLETE);\n\t}", "function isComplete(area) {\n\tif (area.expert === undefined) area.expert = 0;\n\tif (area.advanced === undefined) area.advanced = 0;\n\tif (area.yearlySnowfall === undefined ) area.yearlySnowfall = 0;\n\treturn ( area.state && area.vertical && area.skiableAcres );\n}", "function checkCompletion() {\n\tif (levelCompleted()) {\n\t\tincreasePoints();\n\t\tinitLevel(currentLevel + 1);\n\t\tinitValues();\n\t\tinitCells();\n\t}\n}", "function testReady(task) {\n return (task.checks || []).reduce(function(memo, check) {\n return memo && check(pc, task);\n }, true);\n }" ]
[ "0.6449665", "0.6286795", "0.6109294", "0.60894686", "0.6087285", "0.6086767", "0.6079512", "0.6040161", "0.60169524", "0.59774095", "0.5938076", "0.5891999", "0.5833795", "0.5753793", "0.571018", "0.5595507", "0.55888605", "0.5581676", "0.5558898", "0.5555131", "0.55459714", "0.55425006", "0.55417836", "0.5518575", "0.5518575", "0.5518575", "0.5518575", "0.5512989", "0.5493681", "0.54425365", "0.54364395", "0.5419154", "0.5401876", "0.53916", "0.53910565", "0.53883344", "0.53612065", "0.5355457", "0.5355457", "0.5355457", "0.5355457", "0.5348925", "0.53483", "0.53483", "0.53440577", "0.5327098", "0.53231055", "0.53200006", "0.5313852", "0.5312817", "0.52843255", "0.5266584", "0.52657276", "0.52509755", "0.52468336", "0.5236158", "0.52271354", "0.52267075", "0.5223181", "0.5213667", "0.5202203", "0.51994497", "0.51994497", "0.51967424", "0.5193701", "0.5193701", "0.5193701", "0.5193701", "0.5192175", "0.51695484", "0.5154846", "0.5154846", "0.5151049", "0.5150096", "0.5147741", "0.5147741", "0.514725", "0.5132455", "0.5119582", "0.5115183", "0.5108481", "0.51027876", "0.50954956", "0.5093747", "0.50921285", "0.5090037", "0.5089427", "0.5088675", "0.50861365", "0.5084514", "0.5081605", "0.50778276" ]
0.64526296
7
Create a message with `reason` at `position`. When an error is passed in as `reason`, copies the stack.
function message(reason, position, origin) { var filePath = this.path; var message = new VMessage(reason, position, origin); if (filePath) { message.name = filePath + ':' + message.name; message.file = filePath; } message.fatal = false; this.messages.push(message); return message; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function message(reason, position, ruleId) {\n var filePath = this.path;\n var range = stringify(position) || '1:1';\n var location;\n var err;\n\n location = {\n start: {line: null, column: null},\n end: {line: null, column: null}\n };\n\n if (position && position.position) {\n position = position.position;\n }\n\n if (position) {\n /* Location. */\n if (position.start) {\n location = position;\n position = position.start;\n } else {\n /* Position. */\n location.start = position;\n }\n }\n\n err = new VMessage(reason.message || reason);\n\n err.name = (filePath ? filePath + ':' : '') + range;\n err.file = filePath || '';\n err.reason = reason.message || reason;\n err.line = position ? position.line : null;\n err.column = position ? position.column : null;\n err.location = location;\n err.ruleId = ruleId || null;\n err.source = null;\n err.fatal = false;\n\n if (reason.stack) {\n err.stack = reason.stack;\n }\n\n this.messages.push(err);\n\n return err;\n}", "function makeError (message) {\n const ret = Error(message);\n const stack = ret.stack.split(/\\n/)\n ret.stack = stack.slice(0, 2).join(\"\\n\");\n return ret;\n}", "function message(reason, position, origin) {\n var message = new VMessage(reason, position, origin)\n\n if (this.path) {\n message.name = this.path + ':' + message.name\n message.file = this.path\n }\n\n message.fatal = false\n\n this.messages.push(message)\n\n return message\n}", "function message(reason, position, origin) {\n var message = new VMessage(reason, position, origin)\n\n if (this.path) {\n message.name = this.path + ':' + message.name\n message.file = this.path\n }\n\n message.fatal = false\n\n this.messages.push(message)\n\n return message\n}", "function message(reason, position, origin) {\n var message = new VMessage(reason, position, origin)\n\n if (this.path) {\n message.name = this.path + ':' + message.name\n message.file = this.path\n }\n\n message.fatal = false\n\n this.messages.push(message)\n\n return message\n}", "function message(reason, position, origin) {\n var message = new VMessage(reason, position, origin);\n\n if (this.path) {\n message.name = this.path + ':' + message.name;\n message.file = this.path;\n }\n\n message.fatal = false;\n\n this.messages.push(message);\n\n return message\n}", "function createStackForSend() {\n try {\n throw Error(error);\n }\n catch (ex) {\n error = ex;\n\n // note we generated this stack for later\n error.generatedStack = true;\n\n // set the time when it was created\n error.timestamp = error.timestamp || now;\n\n impl.addError(error, via, source);\n }\n }", "function message(reason, position, origin) {\n var filePath = this.path\n var message = new VMessage(reason, position, origin)\n\n if (filePath) {\n message.name = filePath + ':' + message.name\n message.file = filePath\n }\n\n message.fatal = false\n\n this.messages.push(message)\n\n return message\n}", "function message$1(reason, position, origin) {\n var message = new VMessage$2(reason, position, origin);\n\n if (this.path) {\n message.name = this.path + ':' + message.name;\n message.file = this.path;\n }\n\n message.fatal = false;\n\n this.messages.push(message);\n\n return message\n}", "function syntaxError(message, pos) {\n let err = Error(message);\n err.name = \"SyntaxError\";\n err.pos = pos;\n return err;\n}", "raise ( message, pos ) {\n\t\tconst err = new Error( this.sourceLocation( pos ) + ': ' + message );\n\t\terr.pos = this.completePosition( this.createPosition() );\n\t\tthrow err;\n\t}", "function stackOverflow() {\n let error_msg = document.createElement(\"div\");\n error_msg.innerHTML = `<p class='error_content'>Stack Oveflow</p>`;\n error_msg.classList.add(\"error_msg\", \"stack_overflow\");\n stack_div.insertBefore(error_msg, stack_div.lastChild.nextSibling);\n}", "function PositionError() {\n this.code = null;\n this.message = \"\";\n}", "function stackUnderflow() {\n let error_msg = document.createElement(\"div\");\n error_msg.innerHTML = `<p class='error_content'>Stack Underflow</p>`;\n error_msg.classList.add(\"error_msg\", \"stack_underflow\");\n stack_div.insertBefore(error_msg, stack_div.firstChild);\n}", "function PositionError() {\n\tthis.code = null;\n\tthis.message = \"\";\n}", "function PositionError() {\n\tthis.code = null;\n\tthis.message = \"\";\n}", "function makeError(pnpCode, message, data = {}) {\n const code = MODULE_NOT_FOUND_ERRORS.has(pnpCode) ? `MODULE_NOT_FOUND` : pnpCode;\n return Object.assign(new Error(message), {\n code,\n pnpCode,\n data\n });\n}", "static wrapError(msg, cause) {\n if (msg === 'unknown error' && cause && cause.message === 'transaction finished') {\n return cause;\n }\n const error = new Error(msg);\n error.cause = cause;\n return error;\n }", "chain(type, pos, msg) {\n\t\tthrow new ParseError(type, pos, msg, this);\n\t}", "makeError(message) {\n var _a;\n let msg = (_a = this.fileName) !== null && _a !== void 0 ? _a : \"\";\n if (this.trackPosition) {\n if (msg.length > 0) {\n msg += \":\";\n }\n msg += `${this.line}:${this.column}`;\n }\n if (msg.length > 0) {\n msg += \": \";\n }\n return new Error(msg + message);\n }", "selectErrorAtPosition(position) {\n const {\n errors\n } = this.state;\n\n if (errors.length === 0) {\n return;\n }\n\n const selectedError = errors.find(error => position >= (error.offset || 0) && position <= (error.offset || 0) + (error.length || 0)) || null;\n this.setState({\n selectedError\n });\n }", "function unstack (msg) {\n var sep = msg.search(/\\n\\s*at\\s/)\n return {\n msg: msg.substr(0, sep)\n , stack: utils.trimLines(msg.substr(sep + 1))\n }\n}", "function createStack() {\n // somewhat nasty trick to get a stack trace in Moz\n var stack = undefined;\n try {notdefined()} catch(e) {stack = e.stack};\n if (stack) {\n stack = stack.split('\\n');\n stack.shift();\n stack.shift();\n };\n return stack ? stack.join('\\n') : '';\n}", "newMessage ({commit}, msg) {\n commit(NEW_MESSAGE, msg)\n }", "function makeError( code, msg )\n{\n const err = new Error( msg );\n err.code = code;\n return err;\n}", "unexpected(pos, messageOrType) {\n if (messageOrType == null) messageOrType = 'Unexpected token';\n if (typeof messageOrType !== 'string') messageOrType = `Unexpected token, expected \"${messageOrType.label}\"`;\n throw this.raise(pos != null ? pos : this.state.start, messageOrType);\n }", "function extendStack(newError, originalError) {\n let stackProp = Object.getOwnPropertyDescriptor(newError, \"stack\");\n if (isLazyStack(stackProp)) {\n lazyJoinStacks(stackProp, newError, originalError);\n }\n else if (isWritableStack(stackProp)) {\n newError.stack = joinStacks(newError, originalError);\n }\n}", "function getMatTooltipInvalidPositionError(position) {\n return Error(`Tooltip position \"${position}\" is invalid.`);\n}", "function popErrorMsg(element, message, pos) {\n pos = (typeof pos !== 'undefined') ? pos : 'top';\n\n $(element).popover({\n content: message,\n placement: pos\n });\n $(element).popover('show');\n setTimeout(function() {\n $(element).popover('hide'); }\n , 1000\n );\n setTimeout(function() {\n $(element).popover('destroy'); }\n , 1500\n );\n}", "function copyStackTrace(target, source) {\n target.stack = source.stack.replace(source.message, target.message)\n}", "function extendStack(newError, originalError) {\n let stackProp = Object.getOwnPropertyDescriptor(newError, \"stack\");\n if (stack_1.isLazyStack(stackProp)) {\n stack_1.lazyJoinStacks(stackProp, newError, originalError);\n }\n else if (stack_1.isWritableStack(stackProp)) {\n newError.stack = stack_1.joinStacks(newError, originalError);\n }\n}", "popAt(index) {\n if (this.stacks[index] === undefined) return new Error;\n this.stacks[index].pop();\n }", "function GraphQLError( // eslint-disable-line no-redeclare\nmessage, nodes, source, positions, path, originalError, extensions) {\n // Compute list of blame nodes.\n var _nodes = Array.isArray(nodes) ? nodes.length !== 0 ? nodes : undefined : nodes ? [nodes] : undefined; // Compute locations in the source for the given nodes/positions.\n\n\n var _source = source;\n\n if (!_source && _nodes) {\n var node = _nodes[0];\n _source = node && node.loc && node.loc.source;\n }\n\n var _positions = positions;\n\n if (!_positions && _nodes) {\n _positions = _nodes.reduce(function (list, node) {\n if (node.loc) {\n list.push(node.loc.start);\n }\n\n return list;\n }, []);\n }\n\n if (_positions && _positions.length === 0) {\n _positions = undefined;\n }\n\n var _locations;\n\n if (positions && source) {\n _locations = positions.map(function (pos) {\n return (0, _location.getLocation)(source, pos);\n });\n } else if (_nodes) {\n _locations = _nodes.reduce(function (list, node) {\n if (node.loc) {\n list.push((0, _location.getLocation)(node.loc.source, node.loc.start));\n }\n\n return list;\n }, []);\n }\n\n var _extensions = extensions || originalError && originalError.extensions;\n\n Object.defineProperties(this, {\n message: {\n value: message,\n // By being enumerable, JSON.stringify will include `message` in the\n // resulting output. This ensures that the simplest possible GraphQL\n // service adheres to the spec.\n enumerable: true,\n writable: true\n },\n locations: {\n // Coercing falsey values to undefined ensures they will not be included\n // in JSON.stringify() when not provided.\n value: _locations || undefined,\n // By being enumerable, JSON.stringify will include `locations` in the\n // resulting output. This ensures that the simplest possible GraphQL\n // service adheres to the spec.\n enumerable: Boolean(_locations)\n },\n path: {\n // Coercing falsey values to undefined ensures they will not be included\n // in JSON.stringify() when not provided.\n value: path || undefined,\n // By being enumerable, JSON.stringify will include `path` in the\n // resulting output. This ensures that the simplest possible GraphQL\n // service adheres to the spec.\n enumerable: Boolean(path)\n },\n nodes: {\n value: _nodes || undefined\n },\n source: {\n value: _source || undefined\n },\n positions: {\n value: _positions || undefined\n },\n originalError: {\n value: originalError\n },\n extensions: {\n // Coercing falsey values to undefined ensures they will not be included\n // in JSON.stringify() when not provided.\n value: _extensions || undefined,\n // By being enumerable, JSON.stringify will include `path` in the\n // resulting output. This ensures that the simplest possible GraphQL\n // service adheres to the spec.\n enumerable: Boolean(_extensions)\n }\n }); // Include (non-enumerable) stack trace.\n\n if (originalError && originalError.stack) {\n Object.defineProperty(this, 'stack', {\n value: originalError.stack,\n writable: true,\n configurable: true\n });\n } else if (Error.captureStackTrace) {\n Error.captureStackTrace(this, GraphQLError);\n } else {\n Object.defineProperty(this, 'stack', {\n value: Error().stack,\n writable: true,\n configurable: true\n });\n }\n}", "static renderCompileError(message) {\n const noCreate = !message\n const overlay = this.getErrorOverlay(noCreate)\n if (!overlay) return\n overlay.setCompileError(message)\n }", "function copyStackTrace(target, source) {\n // eslint-disable-next-line no-param-reassign\n target.stack = source.stack.replace(source.message, target.message);\n}", "function badVarPosMessage(varName, varType, expectedType) {\n return \"Variable \\\"$\".concat(varName, \"\\\" of type \\\"\").concat(varType, \"\\\" used in \") + \"position expecting type \\\"\".concat(expectedType, \"\\\".\");\n}", "function handleWarning(reason, position, code) {\n if (code === 3) {\n return;\n }\n\n ctx.file.message(reason, position);\n }", "function handleWarning(reason, position, code) {\n if (code === 3) {\n return;\n }\n\n ctx.file.message(reason, position);\n }", "function handleWarning(reason, position, code) {\n if (code === 3) {\n return;\n }\n\n ctx.file.message(reason, position);\n }", "function handleWarning(reason, position, code) {\n if (code === 3) {\n return;\n }\n\n ctx.file.message(reason, position);\n }", "function handleWarning(reason, position, code) {\n if (code === 3) {\n return;\n }\n\n ctx.file.message(reason, position);\n }", "function handleWarning(reason, position, code) {\n if (code === 3) {\n return;\n }\n\n ctx.file.message(reason, position);\n }", "function prepareStackTrace(error, stack) {\n if (emptyCacheBetweenOperations) {\n fileContentsCache = {};\n sourceMapCache = {};\n }\n\n var name = error.name || 'Error';\n var message = error.message || '';\n var errorString = name + \": \" + message;\n\n var state = { nextPosition: null, curPosition: null };\n var processedStack = [];\n for (var i = stack.length - 1; i >= 0; i--) {\n processedStack.push('\\n at ' + wrapCallSite(stack[i], state));\n state.nextPosition = state.curPosition;\n }\n state.curPosition = state.nextPosition = null;\n return errorString + processedStack.reverse().join('');\n}", "prepare(msg) {\n\t\tif (typeof msg === 'string') {\n\t\t\tmsg = {command: msg};\n\t\t}\n\t\tif (typeof msg.command !== 'string') {\n\t\t\tthrow new Error(`missing command: ${msg}`);\n\t\t}\n\t\tif (typeof msg.destination !== 'string') {\n\t\t\tlet dst = CMD_DST[msg.command];\n\t\t\tif (!dst) {\n\t\t\t\tthrow new Error(`unknown command destination: ${msg.command}`);\n\t\t\t}\n\t\t\tmsg.destination = dst;\n\t\t}\n\t\tif (typeof msg.request_id !== 'string') {\n\t\t\tmsg.request_id = advance(this.req_id).toString('hex');\n\t\t}\n\t\tmsg.origin = SERVICE_WALLET_UI;\n\t\tmsg.ack = false;\n\t\treturn msg;\n\t}", "function prepareBuffer(buffer, position) {\n var j;\n while (buffer[position] == undefined && buffer.length < getMaskLength()) {\n j = 0;\n while (getActiveBufferTemplate()[j] !== undefined) { //add a new buffer\n buffer.push(getActiveBufferTemplate()[j++]);\n }\n }\n\n return position;\n }", "function prepareBuffer(buffer, position) {\n var j;\n while (buffer[position] == undefined && buffer.length < getMaskLength()) {\n j = 0;\n while (getActiveBufferTemplate()[j] !== undefined) { //add a new buffer\n buffer.push(getActiveBufferTemplate()[j++]);\n }\n }\n\n return position;\n }", "function prepareBuffer(buffer, position) {\n var j;\n while (buffer[position] == undefined && buffer.length < getMaskLength()) {\n j = 0;\n while (getActiveBufferTemplate()[j] !== undefined) { //add a new buffer\n buffer.push(getActiveBufferTemplate()[j++]);\n }\n }\n\n return position;\n }", "function makeException(error, title, name, callerCls, callFunc, message) {\n var _a;\n return new Error((_a = message + (callerCls !== null && callerCls !== void 0 ? callerCls : nameSpace) + callFunc) !== null && _a !== void 0 ? _a : (Const_1.EMPTY_STR + arguments.caller.toString()));\n }", "function queueOverflow() {\n let error_msg = document.createElement(\"div\");\n error_msg.innerHTML = `<p class='error_content'>Queue Oveflow</p>`;\n error_msg.classList.add(\"error_msg\", \"query_overflow\");\n queue_div.insertBefore(error_msg, queue_div.lastChild.nextSibling);\n}", "function frameError(err, str) {\n var stringParts = [\n str.slice(0, err.pos),\n '<span class=\"error\">',\n str.slice(err.pos, err.pos + err.extent),\n '</span>',\n str.slice(err.pos + err.extent),\n ];\n return stringParts.join(\"\");\n}", "function withErrorStack(err, stack) {\n if (config.env === 'development') {\n // Asignamos stack al objeto error || Object.assign({}, err, stack) otra manera\n return {...err, stack};\n } else {\n return err\n }\n}", "function throwError(msg, loc, errorClass) {\n loc.source = loc.source || \"<unknown>\"; // FIXME -- we should have the source populated\n // rewrite a ColoredPart to match the format expected by the runtime\n function rewritePart(part){\n if(typeof(part) === 'string'){\n return part;\n } else if(part instanceof symbolExpr){\n return '[\"span\", [[\"class\", \"SchemeValue-Symbol\"]], '+part.val+']';\n return part.val;\n } else if(part.location !== undefined){\n return {text: part.text, type: 'ColoredPart', loc: part.location.toBytecode()\n , toString: function(){return part.text;}};\n } else if(part.locations !== undefined){\n return {text: part.text, type: 'MultiPart', solid: part.solid\n , locs: part.locations.map(function(l){return l.toBytecode()})\n , toString: function(){return part.text;}};\n }\n }\n \n msg.args = msg.args.map(rewritePart);\n \n var json = {type: \"moby-failure\"\n , \"dom-message\": [\"span\"\n ,[[\"class\", \"Error\"]]\n ,[\"span\"\n , [[\"class\", (errorClass || \"Message\")]]].concat(\n (errorClass? [[\"span\"\n , [[\"class\", \"Error.reason\"]]\n , msg.toString()]\n , [\"span\", [[\"class\", ((errorClass || \"message\")\n +((errorClass === \"Error-GenericReadError\")?\n \".locations\"\n :\".otherLocations\"))]]]]\n : msg.args.map(function(x){return x.toString();})))\n ,[\"br\", [], \"\"]\n ,[\"span\"\n , [[\"class\", \"Error.location\"]]\n , [\"span\"\n , [[\"class\", \"location-reference\"]\n , [\"style\", \"display:none\"]]\n , [\"span\", [[\"class\", \"location-offset\"]], (loc.offset+1).toString()]\n , [\"span\", [[\"class\", \"location-line\"]] , loc.sLine.toString()]\n , [\"span\", [[\"class\", \"location-column\"]], loc.sCol.toString()]\n , [\"span\", [[\"class\", \"location-span\"]] , loc.span.toString()]\n , [\"span\", [[\"class\", \"location-id\"]] , loc.source.toString()]\n ]\n ]\n ]\n , \"structured-error\": JSON.stringify({message: (errorClass? false : msg.args), location: loc.toBytecode() })\n };\n throw JSON.stringify(json);\n}", "popPosition(position) {\n\t\tthis.positionContainer.pop();\n\t}", "function GraphQLError( // eslint-disable-line no-redeclare\nmessage, nodes, source, positions, path, originalError, extensions) {\n // Compute list of blame nodes.\n var _nodes = Array.isArray(nodes) ? nodes.length !== 0 ? nodes : undefined : nodes ? [nodes] : undefined; // Compute locations in the source for the given nodes/positions.\n\n\n var _source = source;\n\n if (!_source && _nodes) {\n var node = _nodes[0];\n _source = node && node.loc && node.loc.source;\n }\n\n var _positions = positions;\n\n if (!_positions && _nodes) {\n _positions = _nodes.reduce(function (list, node) {\n if (node.loc) {\n list.push(node.loc.start);\n }\n\n return list;\n }, []);\n }\n\n if (_positions && _positions.length === 0) {\n _positions = undefined;\n }\n\n var _locations;\n\n if (positions && source) {\n _locations = positions.map(function (pos) {\n return Object(_language_location__WEBPACK_IMPORTED_MODULE_1__[\"getLocation\"])(source, pos);\n });\n } else if (_nodes) {\n _locations = _nodes.reduce(function (list, node) {\n if (node.loc) {\n list.push(Object(_language_location__WEBPACK_IMPORTED_MODULE_1__[\"getLocation\"])(node.loc.source, node.loc.start));\n }\n\n return list;\n }, []);\n }\n\n var _extensions = extensions || originalError && originalError.extensions;\n\n Object.defineProperties(this, {\n message: {\n value: message,\n // By being enumerable, JSON.stringify will include `message` in the\n // resulting output. This ensures that the simplest possible GraphQL\n // service adheres to the spec.\n enumerable: true,\n writable: true\n },\n locations: {\n // Coercing falsey values to undefined ensures they will not be included\n // in JSON.stringify() when not provided.\n value: _locations || undefined,\n // By being enumerable, JSON.stringify will include `locations` in the\n // resulting output. This ensures that the simplest possible GraphQL\n // service adheres to the spec.\n enumerable: Boolean(_locations)\n },\n path: {\n // Coercing falsey values to undefined ensures they will not be included\n // in JSON.stringify() when not provided.\n value: path || undefined,\n // By being enumerable, JSON.stringify will include `path` in the\n // resulting output. This ensures that the simplest possible GraphQL\n // service adheres to the spec.\n enumerable: Boolean(path)\n },\n nodes: {\n value: _nodes || undefined\n },\n source: {\n value: _source || undefined\n },\n positions: {\n value: _positions || undefined\n },\n originalError: {\n value: originalError\n },\n extensions: {\n // Coercing falsey values to undefined ensures they will not be included\n // in JSON.stringify() when not provided.\n value: _extensions || undefined,\n // By being enumerable, JSON.stringify will include `path` in the\n // resulting output. This ensures that the simplest possible GraphQL\n // service adheres to the spec.\n enumerable: Boolean(_extensions)\n }\n }); // Include (non-enumerable) stack trace.\n\n if (originalError && originalError.stack) {\n Object.defineProperty(this, 'stack', {\n value: originalError.stack,\n writable: true,\n configurable: true\n });\n } else if (Error.captureStackTrace) {\n Error.captureStackTrace(this, GraphQLError);\n } else {\n Object.defineProperty(this, 'stack', {\n value: Error().stack,\n writable: true,\n configurable: true\n });\n }\n}", "function GraphQLError( // eslint-disable-line no-redeclare\nmessage, nodes, source, positions, path, originalError, extensions) {\n // Compute list of blame nodes.\n var _nodes = Array.isArray(nodes) ? nodes.length !== 0 ? nodes : undefined : nodes ? [nodes] : undefined; // Compute locations in the source for the given nodes/positions.\n\n\n var _source = source;\n\n if (!_source && _nodes) {\n var node = _nodes[0];\n _source = node && node.loc && node.loc.source;\n }\n\n var _positions = positions;\n\n if (!_positions && _nodes) {\n _positions = _nodes.reduce(function (list, node) {\n if (node.loc) {\n list.push(node.loc.start);\n }\n\n return list;\n }, []);\n }\n\n if (_positions && _positions.length === 0) {\n _positions = undefined;\n }\n\n var _locations;\n\n if (positions && source) {\n _locations = positions.map(function (pos) {\n return Object(_language_location__WEBPACK_IMPORTED_MODULE_1__[\"getLocation\"])(source, pos);\n });\n } else if (_nodes) {\n _locations = _nodes.reduce(function (list, node) {\n if (node.loc) {\n list.push(Object(_language_location__WEBPACK_IMPORTED_MODULE_1__[\"getLocation\"])(node.loc.source, node.loc.start));\n }\n\n return list;\n }, []);\n }\n\n var _extensions = extensions || originalError && originalError.extensions;\n\n Object.defineProperties(this, {\n message: {\n value: message,\n // By being enumerable, JSON.stringify will include `message` in the\n // resulting output. This ensures that the simplest possible GraphQL\n // service adheres to the spec.\n enumerable: true,\n writable: true\n },\n locations: {\n // Coercing falsey values to undefined ensures they will not be included\n // in JSON.stringify() when not provided.\n value: _locations || undefined,\n // By being enumerable, JSON.stringify will include `locations` in the\n // resulting output. This ensures that the simplest possible GraphQL\n // service adheres to the spec.\n enumerable: Boolean(_locations)\n },\n path: {\n // Coercing falsey values to undefined ensures they will not be included\n // in JSON.stringify() when not provided.\n value: path || undefined,\n // By being enumerable, JSON.stringify will include `path` in the\n // resulting output. This ensures that the simplest possible GraphQL\n // service adheres to the spec.\n enumerable: Boolean(path)\n },\n nodes: {\n value: _nodes || undefined\n },\n source: {\n value: _source || undefined\n },\n positions: {\n value: _positions || undefined\n },\n originalError: {\n value: originalError\n },\n extensions: {\n // Coercing falsey values to undefined ensures they will not be included\n // in JSON.stringify() when not provided.\n value: _extensions || undefined,\n // By being enumerable, JSON.stringify will include `path` in the\n // resulting output. This ensures that the simplest possible GraphQL\n // service adheres to the spec.\n enumerable: Boolean(_extensions)\n }\n }); // Include (non-enumerable) stack trace.\n\n if (originalError && originalError.stack) {\n Object.defineProperty(this, 'stack', {\n value: originalError.stack,\n writable: true,\n configurable: true\n });\n } else if (Error.captureStackTrace) {\n Error.captureStackTrace(this, GraphQLError);\n } else {\n Object.defineProperty(this, 'stack', {\n value: Error().stack,\n writable: true,\n configurable: true\n });\n }\n}", "function pushError(){assert.throws(function(){r.push(new Buffer(1))})}", "function croak(msg) {\n //wow, we report location, it's amazing!\n throw new Error(msg + \" (\" + line + \":\" + col + \")\");\n }", "createError(rule, code, message) {\n return {\n code,\n message,\n tagName: rule.tagName\n };\n }", "function xb(a,b){if(Error.captureStackTrace)Error.captureStackTrace(this,xb);else{var c=Error().stack;c&&(this.stack=c)}a&&(this.message=String(a));void 0!==b&&(this.cause=b)}", "function makeError(type, id, message) {\n return {\n type: 'error',\n id,\n message: `${type} ${id}: ${message}`\n }\n}", "addAnalyzerIssueForPosition(messageId, messageText, sourceFile, pos, properties) {\n const lineAndCharacter = sourceFile.getLineAndCharacterOfPosition(pos);\n const options = {\n category: \"Extractor\" /* Extractor */,\n messageId,\n text: messageText,\n sourceFilePath: sourceFile.fileName,\n sourceFileLine: lineAndCharacter.line + 1,\n sourceFileColumn: lineAndCharacter.character + 1,\n properties\n };\n this._sourceMapper.updateExtractorMessageOptions(options);\n const extractorMessage = new ExtractorMessage_1.ExtractorMessage(options);\n this._messages.push(extractorMessage);\n return extractorMessage;\n }", "function createAfter(reference, message) {\n //create element to contain the error message\n let errorContent = document.createElement('span')\n //insert said message in the html\n errorContent.innerHTML = message\n reference.after(errorContent)\n }", "pushPosition(position) {\n\t\tthis.positionContainer.push(position);\n\t}", "createFailureAtNode(node, message) {\n const sourceFile = node.getSourceFile();\n this.failures.push({\n filePath: this.fileSystem.resolve(sourceFile.fileName),\n position: ts.getLineAndCharacterOfPosition(sourceFile, node.getStart()),\n message: message,\n });\n }", "convertStack(err) {\n let frames;\n\n if (type.array(err.stack)) {\n frames = err.stack.map((frame) => {\n if (type.string(frame)) return frame;\n else return frame.toString();\n });\n } else if (type.string(err.stack)) {\n frames = err.stack.split(/\\n/g);\n }\n\n return frames;\n }", "function ParseErr(message, str, indx) {\r\n var whitespace = str.slice(0, indx).split(/\\n/);\r\n var lineNo = whitespace.length;\r\n var colNo = whitespace[lineNo - 1].length + 1;\r\n message +=\r\n ' at line ' +\r\n lineNo +\r\n ' col ' +\r\n colNo +\r\n ':\\n\\n' +\r\n ' ' +\r\n str.split(/\\n/)[lineNo - 1] +\r\n '\\n' +\r\n ' ' +\r\n Array(colNo).join(' ') +\r\n '^';\r\n throw SqrlErr(message);\r\n}", "codeAroundError(startOfDef, problemIndex) {\n const range = 20;\n let before = Math.max(0, startOfDef-range);\n let after = Math.min(this.maxIndex+1, problemIndex);\n return `\"...${this.code.slice(before, after)}\"`;\n }", "function getErrorPopupTemplate\n(\n value,\n position\n)\n{\n var _popover;\n var _template = \"<div class=\\\"popover\\\"><div class=\\\"arrow\\\"></div>\";\n _template+=\"<div class=\\\"popover-inner\\\">\";\n _template+=\"<div class=\\\"popover-content\\\"><p></p></div></div></div>\";\n position = typeof(position) == undefined || position == null ? \"top\" : \n position; \n _popover = $(value.element).popover({\n trigger: \"manual\",\n placement: position,\n content: value.message,\n template: _template\n });\n _popover.data(\"popover\").options.content = value.message;\n return $(value.element).popover(\"show\");\n}", "function positionError(error) {\r\n var errorCode = error.code;\r\n var message = error.message;\r\n\r\n //alert(message);\r\n}", "function withErrorStack(error, stack) {\n // si estamos en desarrollo\n if (config.dev) {\n return { ...error, stack };\n }\n return error;\n}", "chatAddError(errorMessage, originalText) {\n // eslint-disable-next-line no-param-reassign\n errorMessage = UIUtil.escapeHtml(errorMessage);\n // eslint-disable-next-line no-param-reassign\n originalText = UIUtil.escapeHtml(originalText);\n\n $('#chatconversation').append(\n `${'<div class=\"errorMessage\"><b>Error: </b>Your message'}${\n originalText ? ` \"${originalText}\"` : ''\n } was not sent.${\n errorMessage ? ` Reason: ${errorMessage}` : ''}</div>`);\n $('#chatconversation').animate(\n { scrollTop: $('#chatconversation')[0].scrollHeight }, 1000);\n }", "function formatMessage(message, parentResult, options) {\n const type = message.severity === 2 ? kleur__default[\"default\"].red(\"error\") : kleur__default[\"default\"].yellow(\"warning\");\n const msg = `${kleur__default[\"default\"].bold(message.message.replace(/([^ ])\\.$/, \"$1\"))}`;\n const ruleId = kleur__default[\"default\"].dim(`(${message.ruleId})`);\n const filePath = formatFilePath(parentResult.filePath, message.line, message.column);\n const sourceCode = parentResult.source;\n /* istanbul ignore next: safety check from original implementation */\n const firstLine = [\n `${type}:`,\n `${msg}`,\n ruleId ? `${ruleId}` : \"\",\n sourceCode ? `at ${filePath}:` : `at ${filePath}`,\n ]\n .filter(String)\n .join(\" \");\n const result = [firstLine];\n /* istanbul ignore next: safety check from original implementation */\n if (sourceCode) {\n result.push(codeFrame.codeFrameColumns(sourceCode, {\n start: getStartLocation(message),\n end: getEndLocation(message, sourceCode),\n }, { highlightCode: false }));\n }\n if (options.showLink && message.ruleUrl) {\n result.push(`${kleur__default[\"default\"].bold(\"Details:\")} ${message.ruleUrl}`);\n }\n return result.join(\"\\n\");\n}", "newPosition(position) {\n this.position = position;\n }", "function insertMessage(message) {\n box = create_msg_bubble(\"left\", message);\n box.box.appendChild(box.text);\n $('.robot-content-top').stop().animate({scrollTop: msgContainer.height()}, 'slow');\n}", "function handleWarning(reason, position, code) {\n if (code !== 3) {\n ctx.file.message(reason, position)\n }\n }", "function errorFunction(position) {\n console.log('Error!');\n }", "createMessage(message) {\n\t\treturn this.query(knex.insert(util.filterKeys(MESSAGE_FIELDS, message)).into('message').toString()).catch(error => console.log(error, 'Message instert into database went wrong'));\n\t}", "ListsNetworkException (msg) {\n let error = new Error(msg);\n error.name = 'ListsNetworkException';\n //error.snappMessage = \"something?\";\n throw error;\n }", "makeError(msg, id) {\n const err = new Error(msg);\n err.id = id;\n return err;\n }", "function formatMessage(message, parentResult, options) {\n const type = message.severity === 2 ? kleur_1.default.red(\"error\") : kleur_1.default.yellow(\"warning\");\n const msg = `${kleur_1.default.bold(message.message.replace(/([^ ])\\.$/, \"$1\"))}`;\n const ruleId = kleur_1.default.dim(`(${message.ruleId})`);\n const filePath = formatFilePath(parentResult.filePath, message.line, message.column);\n const sourceCode = parentResult.source;\n /* istanbul ignore next: safety check from original implementation */\n const firstLine = [\n `${type}:`,\n `${msg}`,\n ruleId ? `${ruleId}` : \"\",\n sourceCode ? `at ${filePath}:` : `at ${filePath}`,\n ]\n .filter(String)\n .join(\" \");\n const result = [firstLine];\n /* istanbul ignore next: safety check from original implementation */\n if (sourceCode) {\n result.push(code_frame_1.codeFrameColumns(sourceCode, {\n start: getStartLocation(message),\n end: getEndLocation(message, sourceCode),\n }, { highlightCode: false }));\n }\n if (options.showLink && message.ruleUrl) {\n result.push(`${kleur_1.default.bold(\"Details:\")} ${message.ruleUrl}`);\n }\n return result.join(\"\\n\");\n}", "function createShellMessage(options, content, metadata, buffers) {\n if (content === void 0) { content = {}; }\n if (metadata === void 0) { metadata = {}; }\n if (buffers === void 0) { buffers = []; }\n var msg = createMessage(options, content, metadata, buffers);\n return msg;\n }", "function context (options, instance, stack = true) {\n // Attempt to use the options message as a `sprintf` format. Use the message\n // as is if `sprintf` fails.\n let message = options.message\n if (message == null) {\n message = instance.message = ''\n } else {\n message = instance.message = multiLine(message)\n try {\n instance.message = sprintf(message, options)\n message = instance.message.split('\\n').map((line, index) => index == 0 ? line : ` ${line}`).join('\\n')\n } catch (error) {\n instance.errors.push({\n code: Interrupt.Error.SPRINTF_ERROR,\n format: options.format,\n properties: options.properties,\n error: error\n })\n }\n }\n // The enumerable properties, if any, of the object using our special JSON.\n if (Object.keys(instance.displayed).length != 0) {\n message += '\\n\\n' + Interrupt.JSON.stringify(instance.displayed)\n }\n if (instance.errors.length != 0) {\n message += '\\n\\n' + Interrupt.JSON.stringify(instance.errors)\n }\n // **TODO** Without context messages we have more space. We could, if the\n // type is not an Error, serialize the cause as JSON. Parsing would be a\n // matter of detecting if it is an error, if not it is going to be JSON.\n // JSON will not look like an error, perhaps just plain `null` would be\n // confusing, but I doubt it.\n if (options.errors.length) {\n for (let i = 0, I = options.errors.length; i < I; i++) {\n const error = options.errors[i]\n const text = error instanceof Error ? Interrupt.stringify(error) : error.toString()\n const indented = text.replace(/^/gm, ' ')\n message += '\\n\\ncause:\\n\\n' + indented\n }\n }\n\n if (instance.tracers.length != 0) {\n message += `\\n\\ntrace:\\n\\n${\n instance.tracers.map(trace => ` at ${trace.file}:${trace.line}:${trace.column}`).join('\\n')\n }`\n }\n\n // A header for the stack trace unless the stack trace has been suppressed.\n if (stack && (options.$stack == null || options.$stack != 0)) {\n message += '\\n\\nstack:\\n'\n }\n\n return message\n}", "function generateError(message) {\n store.addNewBookmark = !store.addNewBookmark\n return `\n <section class='error-content'>\n <button id=\"cancel-error\">X</button>\n <p>${message}</p>\n </section>`\n}", "function appendMessage(data, position) {\n let messageElement = messageElementLi(data, position);\n messageContainer.appendChild(messageElement);\n\n // Scroll down\n messageContainer.scrollTop = messageContainer.scrollHeight;\n}", "function ParseErr(message, str, indx) {\r\n var whitespace = str.slice(0, indx).split(/\\n/);\r\n var lineNo = whitespace.length;\r\n var colNo = whitespace[lineNo - 1].length + 1;\r\n message +=\r\n ' at line ' +\r\n lineNo +\r\n ' col ' +\r\n colNo +\r\n ':\\n\\n' +\r\n ' ' +\r\n str.split(/\\n/)[lineNo - 1] +\r\n '\\n' +\r\n ' ' +\r\n Array(colNo).join(' ') +\r\n '^';\r\n throw EtaErr(message);\r\n}", "push(type, char){\n if(this.isempty()){\n if(type==1){ //No use of storing backspace operation for empty stack\n return;\n }\n this.stack.push([type,char]);\n this.size++;\n return;\n }\n let top=this.stack[this.size-1];\n if(type==top[0] && top[1].length<this.buffer){\n top=this.stack.pop();\n top=char+top[1]; //sequence is very imp because char+top[1] means most recent character at beginning\n //so if intially we had \"cba\" and push for 'd' is demanded then top will be \"dcba\" ..stack is \"dcba\" for \n //message typed as \"abcd\". this is required for delete operation.\n this.stack.push([type,top]);\n }\n else{\n this.stack.push([type,char]);\n this.size++;\n }\n return this.stack[this.size-1];\n }", "function withErrorStack(error,stack) {\n\n if (config.enviroment==='development') {\n return {...error,stack};\n }\n\n return error;\n\n}", "function assert(condition,message){\r\n\t\tif(!condition){\r\n\t\t\t//message//+=\" on line \"+lineNumber;\r\n\t\t\tconsole.log(message);\r\n\t\t\tvar error=new Error(message);\r\n\t\t\terror.name=\"ParseError\";\r\n\t\t\tthrow error;\r\n\t\t}\r\n\t}", "function posError(startPos, endPos, template) {\n var args = [];\n var i;\n for (i = 3; i < arguments.length; ++i)\n args.push(arguments[i]);\n throw new MicroXML.ParseError(source, startPos, endPos, template, args);\n }", "async handleNewPosition(position) {\n\t\ttry {\n\n\t\t\tlet entryOrders = [];\n\n\t\t\tfor (const entryNum in position.originalPosition.entries) {\n\t\t\t\tconst entry = position.originalPosition.entries[entryNum];\n\n\t\t\t\tLog.positions.debug(\n\t\t\t\t\t{\n\t\t\t\t\t\tmessage: \"Opening order for entry\",\n\t\t\t\t\t\tpositionId: position._id,\n\t\t\t\t\t\tentryNum: entryNum,\n\t\t\t\t\t\tentry: entry\n\t\t\t\t\t});\n\n\t\t\t\tconst orderSpec = {\n\t\t\t\t\texchange: position.originalPosition.exchange,\n\t\t\t\t\tpair: position.originalPosition.pair,\n\t\t\t\t\tdirection: position.originalPosition.direction,\n\t\t\t\t\tleverage: position.originalPosition.leverage,\n\t\t\t\t\tprice: entry.target,\n\t\t\t\t\tamount: entry.amount,\n\t\t\t\t\ttype: \"limit\",\n\t\t\t\t};\n\n\t\t\t\tconst orderId = await this.orderManager.createManagedOrder(orderSpec);\n\t\t\t\tentryOrders.push(orderId);\n\t\t\t}\n\n\t\t\t// update position status\n\t\t\tawait this.database.updateManagedPosition(\n\t\t\t\tposition._id,\n\t\t\t\t{\n\t\t\t\t\tentryOrders: entryOrders,\n\t\t\t\t\tstatus: Constants.PositionStatusEnum.ENTRIES_PLACED,\n\t\t\t\t});\n\n\t\t} catch(e) {\n\t\t\tLog.positions.error(\n\t\t\t\t{ \n\t\t\t\t\tmessage: \"Caught exception while trying to handle new position \"+ position._id,\n\t\t\t\t\tpositionId: position._id,\n\t\t\t\t\texception: e,\n\t\t\t\t});\n\t\t\t// TODO: here we may have created some but not all positions.\n\t\t\t// how should we clean up? should we retry?\n\t\t}\n\t}", "function crash(message) {\n throw new Error(`ERR (${state})/\"${buffer}\": ${message}`);\n }", "function crash(message) {\r\n throw new Error(`ERR (${state})/\"${buffer}\": ${message}`);\r\n }", "function crash(message) {\r\n throw new Error(`ERR (${state})/\"${buffer}\": ${message}`);\r\n }", "goToPosition(position) {\n\t\t//if we are already ina position clear the positionContainer\n\t\tif (this.presentPosition()) {\n\t\t\tthis.positionContainer.length = 0;\n\t\t}\n\t\t//if we find an 'entry' in a given position , we call it\n\t\tif (position.entry) {\n\t\t\tposition.entry(play);\n\t\t}\n\t\t//setting the current game position in the positionContainer\n\t\tthis.positionContainer.push(position);\n\t}", "function create(location, message) {\n return {\n location: location,\n message: message\n };\n }", "function create(location, message) {\n return {\n location: location,\n message: message\n };\n }" ]
[ "0.6382411", "0.58289903", "0.5818149", "0.5818149", "0.5818149", "0.5815182", "0.57655555", "0.56853163", "0.568013", "0.5445974", "0.5391876", "0.52233994", "0.52169865", "0.50570893", "0.5056932", "0.5056932", "0.5033515", "0.50259006", "0.50055903", "0.48889014", "0.4858071", "0.48302984", "0.4772665", "0.47392592", "0.47350478", "0.4720107", "0.4697785", "0.46836188", "0.46540934", "0.46095666", "0.4605955", "0.46016917", "0.45840266", "0.45813164", "0.45715618", "0.45531595", "0.45410177", "0.45410177", "0.45410177", "0.45410177", "0.45410177", "0.45410177", "0.45344427", "0.45329556", "0.45253336", "0.45253336", "0.45253336", "0.45216134", "0.4520636", "0.45115376", "0.4506905", "0.45009503", "0.44938746", "0.4484527", "0.4484527", "0.4482051", "0.4481533", "0.4476978", "0.44767308", "0.4451464", "0.4451089", "0.44256863", "0.44214234", "0.4412967", "0.4397984", "0.43901217", "0.4387175", "0.43815538", "0.4380607", "0.4378336", "0.43755454", "0.4370273", "0.436516", "0.43636203", "0.43605417", "0.4352277", "0.43444398", "0.4322664", "0.43076444", "0.4306744", "0.4306563", "0.4298342", "0.4296636", "0.42963487", "0.4293442", "0.4292735", "0.42813995", "0.42730805", "0.42707095", "0.42480928", "0.42425436", "0.4239582", "0.4239582", "0.4235511", "0.42321622", "0.42321622" ]
0.56972057
11
Fail. Creates a vmessage, associates it with the file, and throws it.
function fail() { var message = this.message.apply(this, arguments); message.fatal = true; throw message; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function fail(message) {\n throw new Error(message);\n }", "function fail(message) {\r\n\t throw new Error(message);\r\n\t}", "createFailureAtNode(node, message) {\n const sourceFile = node.getSourceFile();\n this.failures.push({\n filePath: this.fileSystem.resolve(sourceFile.fileName),\n position: ts.getLineAndCharacterOfPosition(sourceFile, node.getStart()),\n message: message,\n });\n }", "function fail(msg) { throw new Error(msg); }", "function fail(message) {\n throw new Error(message);\n}", "function fail(message) {\n throw new Error(message);\n}", "function fail() {\n var message = this.message.apply(this, arguments)\n\n message.fatal = true\n\n throw message\n}", "function fail() {\n var message = this.message.apply(this, arguments)\n\n message.fatal = true\n\n throw message\n}", "function fail() {\n var message = this.message.apply(this, arguments)\n\n message.fatal = true\n\n throw message\n}", "function fail() {\n var message = this.message.apply(this, arguments)\n\n message.fatal = true\n\n throw message\n}", "function fail() {\n var message = this.message.apply(this, arguments);\n\n message.fatal = true;\n\n throw message\n}", "function caml_failwith (msg) {\n caml_raise_with_string(caml_global_data[3], msg);\n}", "function fail$2() {\n var message = this.message.apply(this, arguments);\n\n message.fatal = true;\n\n throw message\n}", "function onFail(message) {\n }", "makeError(message) {\n var _a;\n let msg = (_a = this.fileName) !== null && _a !== void 0 ? _a : \"\";\n if (this.trackPosition) {\n if (msg.length > 0) {\n msg += \":\";\n }\n msg += `${this.line}:${this.column}`;\n }\n if (msg.length > 0) {\n msg += \": \";\n }\n return new Error(msg + message);\n }", "function message(reason, position, origin) {\n var filePath = this.path;\n var message = new VMessage(reason, position, origin);\n\n if (filePath) {\n message.name = filePath + ':' + message.name;\n message.file = filePath;\n }\n\n message.fatal = false;\n\n this.messages.push(message);\n\n return message;\n}", "function message(reason, position, origin) {\n var filePath = this.path;\n var message = new VMessage(reason, position, origin);\n\n if (filePath) {\n message.name = filePath + ':' + message.name;\n message.file = filePath;\n }\n\n message.fatal = false;\n\n this.messages.push(message);\n\n return message;\n}", "function message(reason, position, origin) {\n var filePath = this.path;\n var message = new VMessage(reason, position, origin);\n\n if (filePath) {\n message.name = filePath + ':' + message.name;\n message.file = filePath;\n }\n\n message.fatal = false;\n\n this.messages.push(message);\n\n return message;\n}", "function message(reason, position, origin) {\n var filePath = this.path;\n var message = new VMessage(reason, position, origin);\n\n if (filePath) {\n message.name = filePath + ':' + message.name;\n message.file = filePath;\n }\n\n message.fatal = false;\n\n this.messages.push(message);\n\n return message;\n}", "function message(reason, position, origin) {\n var filePath = this.path;\n var message = new VMessage(reason, position, origin);\n\n if (filePath) {\n message.name = filePath + ':' + message.name;\n message.file = filePath;\n }\n\n message.fatal = false;\n\n this.messages.push(message);\n\n return message;\n}", "function TestFail(message) {\n this.message = message || \"\";\n}", "function message(reason, position, origin) {\n var filePath = this.path\n var message = new VMessage(reason, position, origin)\n\n if (filePath) {\n message.name = filePath + ':' + message.name\n message.file = filePath\n }\n\n message.fatal = false\n\n this.messages.push(message)\n\n return message\n}", "function generateFailureMessage(msg, sentStr, receivedStr, sentChecksum, receivedChecksum) {\n return(\n `\n =========================\n ${msg} DETECTED\n input: ${sentStr} : ${sentChecksum}\n corrupted: ${receivedStr} : ${receivedChecksum}\n `);\n}", "function setFailed(message) {\r\n process.exitCode = ExitCode.Failure;\r\n error(message);\r\n}", "function setFailed(message) {\r\n process.exitCode = ExitCode.Failure;\r\n error(message);\r\n}", "function fail(message) {\n assert.fail(null, null, message);\n}", "function setFailed(message) {\n process.exitCode = ExitCode.Failure;\n error(message);\n }", "function bofError(msg) {\n throw new Error('Unsupported format, or corrupt file: ' + msg);\n }", "function setFailed(message) {\n process.exitCode = ExitCode.Failure;\n error(message);\n}", "function setFailed(message) {\n process.exitCode = ExitCode.Failure;\n error(message);\n}", "function setFailed(message) {\n process.exitCode = ExitCode.Failure;\n error(message);\n}", "function setFailed(message) {\n process.exitCode = ExitCode.Failure;\n error(message);\n}", "function setFailed(message) {\n process.exitCode = ExitCode.Failure;\n error(message);\n}", "function setFailed(message) {\n process.exitCode = ExitCode.Failure;\n error(message);\n}", "function setFailed(message) {\n process.exitCode = ExitCode.Failure;\n error(message);\n}", "function setFailed(message) {\n process.exitCode = ExitCode.Failure;\n error(message);\n}", "function setFailed(message) {\n process.exitCode = ExitCode.Failure;\n error(message);\n}", "function setFailed(message) {\n process.exitCode = ExitCode.Failure;\n error(message);\n}", "function setFailed(message) {\n process.exitCode = ExitCode.Failure;\n error(message);\n}", "function setFailed(message) {\n process.exitCode = ExitCode.Failure;\n error(message);\n}", "function setFailed(message) {\n process.exitCode = ExitCode.Failure;\n error(message);\n}", "function setFailed(message) {\n process.exitCode = ExitCode.Failure;\n error(message);\n}", "function setFailed(message) {\n process.exitCode = ExitCode.Failure;\n error(message);\n}", "function setFailed(message) {\n process.exitCode = ExitCode.Failure;\n error(message);\n}", "function setFailed(message) {\n process.exitCode = ExitCode.Failure;\n error(message);\n}", "function setFailed(message) {\n process.exitCode = ExitCode.Failure;\n error(message);\n}", "function setFailed(message) {\n process.exitCode = ExitCode.Failure;\n error(message);\n}", "function setFailed(message) {\n process.exitCode = ExitCode.Failure;\n error(message);\n}", "function setFailed(message) {\n process.exitCode = ExitCode.Failure;\n error(message);\n}", "function setFailed(message) {\n process.exitCode = ExitCode.Failure;\n error(message);\n}", "function setFailed(message) {\n process.exitCode = ExitCode.Failure;\n error(message);\n}", "function setFailed(message) {\n process.exitCode = ExitCode.Failure;\n error(message);\n}", "function setFailed(message) {\n process.exitCode = ExitCode.Failure;\n error(message);\n}", "function setFailed(message) {\n process.exitCode = ExitCode.Failure;\n error(message);\n}", "function setFailed(message) {\n process.exitCode = ExitCode.Failure;\n error(message);\n}", "function setFailed(message) {\n process.exitCode = ExitCode.Failure;\n error(message);\n}", "function setFailed(message) {\n process.exitCode = ExitCode.Failure;\n error(message);\n}", "function setFailed(message) {\n process.exitCode = ExitCode.Failure;\n error(message);\n}", "function setFailed(message) {\n process.exitCode = ExitCode.Failure;\n error(message);\n}", "function setFailed(message) {\n process.exitCode = ExitCode.Failure;\n error(message);\n}", "function setFailed(message) {\n process.exitCode = ExitCode.Failure;\n error(message);\n}", "function setFailed(message) {\n process.exitCode = ExitCode.Failure;\n error(message);\n}", "function setFailed(message) {\n process.exitCode = ExitCode.Failure;\n error(message);\n}", "function setFailed(message) {\n process.exitCode = ExitCode.Failure;\n error(message);\n}", "function setFailed(message) {\n process.exitCode = ExitCode.Failure;\n error(message);\n}", "function setFailed(message) {\n process.exitCode = ExitCode.Failure;\n error(message);\n}", "function setFailed(message) {\n process.exitCode = ExitCode.Failure;\n error(message);\n}", "function setFailed(message) {\n process.exitCode = ExitCode.Failure;\n error(message);\n}", "function setFailed(message) {\n process.exitCode = ExitCode.Failure;\n error(message);\n}", "function setFailed(message) {\n process.exitCode = ExitCode.Failure;\n error(message);\n}", "function setFailed(message) {\n process.exitCode = ExitCode.Failure;\n error(message);\n}", "function setFailed(message) {\n process.exitCode = ExitCode.Failure;\n error(message);\n}", "function setFailed(message) {\n process.exitCode = ExitCode.Failure;\n error(message);\n}", "function setFailed(message) {\n process.exitCode = ExitCode.Failure;\n error(message);\n}", "function setFailed(message) {\n process.exitCode = ExitCode.Failure;\n error(message);\n}", "function setFailed(message) {\n process.exitCode = ExitCode.Failure;\n error(message);\n}", "raise ( message, pos ) {\n\t\tconst err = new Error( this.sourceLocation( pos ) + ': ' + message );\n\t\terr.pos = this.completePosition( this.createPosition() );\n\t\tthrow err;\n\t}", "static fail(message) {\n return new StepResult(null, message);\n }", "function onFail(message) {\n console.log('Failed because: ' + message);\n }", "function buildVmFailHandler ({dispatch, vmName, msg, detailForNonexisting}) {\n return (data, exception) =>\n dispatch(vmActionFailed({\n name: vmName,\n detailForNonexisting, // used i.e. for failed Create VM\n connectionName: QEMU_SYSTEM,\n message: msg,\n detail: {\n data,\n exception: data ?\n (data.responseJSON && data.responseJSON.fault && data.responseJSON.fault.detail) ? data.responseJSON.fault.detail\n : ( data.responseJSON && data.responseJSON.detail ? data.responseJSON.detail\n : exception)\n : exception,\n }}));\n}", "function crash(message) {\r\n throw new Error(`ERR (${state})/\"${buffer}\": ${message}`);\r\n }", "function crash(message) {\r\n throw new Error(`ERR (${state})/\"${buffer}\": ${message}`);\r\n }", "function message(reason, position, origin) {\n var message = new VMessage(reason, position, origin)\n\n if (this.path) {\n message.name = this.path + ':' + message.name\n message.file = this.path\n }\n\n message.fatal = false\n\n this.messages.push(message)\n\n return message\n}", "function message(reason, position, origin) {\n var message = new VMessage(reason, position, origin)\n\n if (this.path) {\n message.name = this.path + ':' + message.name\n message.file = this.path\n }\n\n message.fatal = false\n\n this.messages.push(message)\n\n return message\n}", "function message(reason, position, origin) {\n var message = new VMessage(reason, position, origin)\n\n if (this.path) {\n message.name = this.path + ':' + message.name\n message.file = this.path\n }\n\n message.fatal = false\n\n this.messages.push(message)\n\n return message\n}", "function FAIL(message, resultCode) {\n LOG(message);\n throw Components.Exception(message, resultCode || Cr.NS_ERROR_INVALID_ARG);\n}", "function message(reason, position, origin) {\n var message = new VMessage(reason, position, origin);\n\n if (this.path) {\n message.name = this.path + ':' + message.name;\n message.file = this.path;\n }\n\n message.fatal = false;\n\n this.messages.push(message);\n\n return message\n}", "function crash(message) {\n throw new Error(`ERR (${state})/\"${buffer}\": ${message}`);\n }", "function putJobFailure(message) {\n console.error('job failure: ', message)\n codepipeline.putJobFailureResult({\n jobId,\n failureDetails: {\n message: JSON.stringify(message),\n type: 'JobFailed',\n externalExecutionId: context.invokeid\n }\n }, (err, data) => context.fail(message))\n }", "function message(reason, position, ruleId) {\n var filePath = this.path;\n var range = stringify(position) || '1:1';\n var location;\n var err;\n\n location = {\n start: {line: null, column: null},\n end: {line: null, column: null}\n };\n\n if (position && position.position) {\n position = position.position;\n }\n\n if (position) {\n /* Location. */\n if (position.start) {\n location = position;\n position = position.start;\n } else {\n /* Position. */\n location.start = position;\n }\n }\n\n err = new VMessage(reason.message || reason);\n\n err.name = (filePath ? filePath + ':' : '') + range;\n err.file = filePath || '';\n err.reason = reason.message || reason;\n err.line = position ? position.line : null;\n err.column = position ? position.column : null;\n err.location = location;\n err.ruleId = ruleId || null;\n err.source = null;\n err.fatal = false;\n\n if (reason.stack) {\n err.stack = reason.stack;\n }\n\n this.messages.push(err);\n\n return err;\n}", "function onFail (message) {\n\t\talert ('Error occured: ' + message);\n\t}", "function raiseError(txt) {\r\n\tAssertionResult.setFailureMessage(txt);\r\n\tAssertionResult.setFailure(true);\r\n}", "function vxlActorGroupException(messages){\n this.messages = messages;\n}", "async function fails () {\n throw new Error('Contrived Error');\n }", "onWriteError(err, fileId, file) {\n console.error(`ufs: cannot write file \"${ fileId }\" (${ err.message })`);\n }" ]
[ "0.6267297", "0.6253337", "0.6133076", "0.6082893", "0.59879756", "0.59879756", "0.5881531", "0.5881531", "0.5881531", "0.5881531", "0.5851264", "0.5730261", "0.571033", "0.55709696", "0.5532442", "0.5510065", "0.5510065", "0.5510065", "0.5510065", "0.5510065", "0.5498461", "0.5497291", "0.5488883", "0.54849124", "0.54849124", "0.54637474", "0.54562", "0.5430888", "0.54108983", "0.54108983", "0.54108983", "0.54108983", "0.54108983", "0.54108983", "0.54108983", "0.54108983", "0.54108983", "0.54108983", "0.54108983", "0.54108983", "0.54108983", "0.54108983", "0.54108983", "0.54108983", "0.54108983", "0.54108983", "0.54108983", "0.54108983", "0.54108983", "0.54108983", "0.54108983", "0.54108983", "0.54108983", "0.54108983", "0.54108983", "0.54108983", "0.54108983", "0.54108983", "0.54108983", "0.54108983", "0.54108983", "0.54108983", "0.54108983", "0.54108983", "0.54108983", "0.54108983", "0.54108983", "0.54108983", "0.54108983", "0.54108983", "0.54108983", "0.54108983", "0.54108983", "0.54108983", "0.54108983", "0.54108983", "0.5410253", "0.53834826", "0.5365286", "0.5350812", "0.5339782", "0.5339782", "0.5304382", "0.5304382", "0.5304382", "0.5292635", "0.52898276", "0.5277407", "0.5272076", "0.52553284", "0.5235561", "0.5230549", "0.52140206", "0.52057916", "0.52055264" ]
0.5795629
15
Info. Creates a vmessage, associates it with the file, and marks the fatality as null.
function info() { var message = this.message.apply(this, arguments); message.fatal = null; return message; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function info() {\n var message = this.message.apply(this, arguments)\n\n message.fatal = null\n\n return message\n}", "function info() {\n var message = this.message.apply(this, arguments)\n\n message.fatal = null\n\n return message\n}", "function info() {\n var message = this.message.apply(this, arguments)\n\n message.fatal = null\n\n return message\n}", "function info() {\n var message = this.message.apply(this, arguments)\n\n message.fatal = null\n\n return message\n}", "function info() {\n var message = this.message.apply(this, arguments);\n\n message.fatal = null;\n\n return message\n}", "function info$1() {\n var message = this.message.apply(this, arguments);\n\n message.fatal = null;\n\n return message\n}", "function message(reason, position, origin) {\n var filePath = this.path\n var message = new VMessage(reason, position, origin)\n\n if (filePath) {\n message.name = filePath + ':' + message.name\n message.file = filePath\n }\n\n message.fatal = false\n\n this.messages.push(message)\n\n return message\n}", "function message(reason, position, origin) {\n var filePath = this.path;\n var message = new VMessage(reason, position, origin);\n\n if (filePath) {\n message.name = filePath + ':' + message.name;\n message.file = filePath;\n }\n\n message.fatal = false;\n\n this.messages.push(message);\n\n return message;\n}", "function message(reason, position, origin) {\n var filePath = this.path;\n var message = new VMessage(reason, position, origin);\n\n if (filePath) {\n message.name = filePath + ':' + message.name;\n message.file = filePath;\n }\n\n message.fatal = false;\n\n this.messages.push(message);\n\n return message;\n}", "function message(reason, position, origin) {\n var filePath = this.path;\n var message = new VMessage(reason, position, origin);\n\n if (filePath) {\n message.name = filePath + ':' + message.name;\n message.file = filePath;\n }\n\n message.fatal = false;\n\n this.messages.push(message);\n\n return message;\n}", "function message(reason, position, origin) {\n var filePath = this.path;\n var message = new VMessage(reason, position, origin);\n\n if (filePath) {\n message.name = filePath + ':' + message.name;\n message.file = filePath;\n }\n\n message.fatal = false;\n\n this.messages.push(message);\n\n return message;\n}", "function message(reason, position, origin) {\n var filePath = this.path;\n var message = new VMessage(reason, position, origin);\n\n if (filePath) {\n message.name = filePath + ':' + message.name;\n message.file = filePath;\n }\n\n message.fatal = false;\n\n this.messages.push(message);\n\n return message;\n}", "function message(reason, position, origin) {\n var message = new VMessage(reason, position, origin)\n\n if (this.path) {\n message.name = this.path + ':' + message.name\n message.file = this.path\n }\n\n message.fatal = false\n\n this.messages.push(message)\n\n return message\n}", "function message(reason, position, origin) {\n var message = new VMessage(reason, position, origin)\n\n if (this.path) {\n message.name = this.path + ':' + message.name\n message.file = this.path\n }\n\n message.fatal = false\n\n this.messages.push(message)\n\n return message\n}", "function message(reason, position, origin) {\n var message = new VMessage(reason, position, origin)\n\n if (this.path) {\n message.name = this.path + ':' + message.name\n message.file = this.path\n }\n\n message.fatal = false\n\n this.messages.push(message)\n\n return message\n}", "function message(reason, position, origin) {\n var message = new VMessage(reason, position, origin);\n\n if (this.path) {\n message.name = this.path + ':' + message.name;\n message.file = this.path;\n }\n\n message.fatal = false;\n\n this.messages.push(message);\n\n return message\n}", "function message$1(reason, position, origin) {\n var message = new VMessage$2(reason, position, origin);\n\n if (this.path) {\n message.name = this.path + ':' + message.name;\n message.file = this.path;\n }\n\n message.fatal = false;\n\n this.messages.push(message);\n\n return message\n}", "function MvFile() {\r\n}", "function info(message) {\r\n\tnotify(\"Information\", message);\r\n}", "function createMessage(message, vm, parent) {\n // if (Vuetify.config.silent) return\n if (parent) {\n vm = {\n _isVue: true,\n $parent: parent,\n $options: vm\n };\n }\n\n if (vm) {\n // Only show each message once per instance\n vm.$_alreadyWarned = vm.$_alreadyWarned || [];\n if (vm.$_alreadyWarned.includes(message)) return;\n vm.$_alreadyWarned.push(message);\n }\n\n return \"[Vuetify] \".concat(message) + (vm ? generateComponentTrace(vm) : '');\n}", "function createMessage(message, vm, parent) {\n if (framework_Vuetify.config.silent) return;\n\n if (parent) {\n vm = {\n _isVue: true,\n $parent: parent,\n $options: vm\n };\n }\n\n if (vm) {\n // Only show each message once per instance\n vm.$_alreadyWarned = vm.$_alreadyWarned || [];\n if (vm.$_alreadyWarned.includes(message)) return;\n vm.$_alreadyWarned.push(message);\n }\n\n return `[Vuetify] ${message}` + (vm ? generateComponentTrace(vm) : '');\n}", "function createMessage(message, vm, parent) {\n if (framework_Vuetify.config.silent) return;\n\n if (parent) {\n vm = {\n _isVue: true,\n $parent: parent,\n $options: vm\n };\n }\n\n if (vm) {\n // Only show each message once per instance\n vm.$_alreadyWarned = vm.$_alreadyWarned || [];\n if (vm.$_alreadyWarned.includes(message)) return;\n vm.$_alreadyWarned.push(message);\n }\n\n return `[Vuetify] ${message}` + (vm ? generateComponentTrace(vm) : '');\n}", "info(message) {\n return this.sendMessage(MessageType.Info, message);\n }", "function createInfoAlert() {\n viewFactory.createErrorAlert('Information', infoMessage);\n}", "function info(message) {\n process.stdout.write(message + os.EOL);\n }", "function info(msg){if(PDFJS.verbosity>=PDFJS.VERBOSITY_LEVELS.infos){console.log('Info: '+msg);}} // Non-fatal warnings.", "function createMessage(message, vm, parent) {\n if (parent) {\n vm = {\n _isVue: true,\n $parent: parent,\n $options: vm\n };\n }\n\n if (vm) {\n // Only show each message once per instance\n vm.$_alreadyWarned = vm.$_alreadyWarned || [];\n if (vm.$_alreadyWarned.includes(message)) return;\n vm.$_alreadyWarned.push(message);\n }\n\n return `[Vuetify] ${message}` + (vm ? generateComponentTrace(vm) : '');\n}", "function info(msg) {\n if (PDFJS.verbosity >= PDFJS.VERBOSITY_LEVELS.infos) {\n console.log('Info: ' + msg);\n }\n}", "function info(msg) {\n if (PDFJS.verbosity >= PDFJS.VERBOSITY_LEVELS.infos) {\n console.log('Info: ' + msg);\n }\n}", "function info(msg) {\n if (verbosity >= VERBOSITY_LEVELS.infos) {\n console.log('Info: ' + msg);\n }\n }", "function info(message) {\r\n process.stdout.write(message + os.EOL);\r\n}", "function info(message) {\r\n process.stdout.write(message + os.EOL);\r\n}", "function info(message) {\n process.stdout.write(message + os.EOL);\n}", "function info(message) {\n process.stdout.write(message + os.EOL);\n}", "function info(message) {\n process.stdout.write(message + os.EOL);\n}", "function info(message) {\n process.stdout.write(message + os.EOL);\n}", "function info(message) {\n process.stdout.write(message + os.EOL);\n}", "function info(message) {\n process.stdout.write(message + os.EOL);\n}", "function info(message) {\n process.stdout.write(message + os.EOL);\n}", "function info(message) {\n process.stdout.write(message + os.EOL);\n}", "function info(message) {\n process.stdout.write(message + os.EOL);\n}", "function info(message) {\n process.stdout.write(message + os.EOL);\n}", "function info(message) {\n process.stdout.write(message + os.EOL);\n}", "function info(message) {\n process.stdout.write(message + os.EOL);\n}", "function info(message) {\n process.stdout.write(message + os.EOL);\n}", "function info(message) {\n process.stdout.write(message + os.EOL);\n}", "function info(message) {\n process.stdout.write(message + os.EOL);\n}", "function info(message) {\n process.stdout.write(message + os.EOL);\n}", "function info(message) {\n process.stdout.write(message + os.EOL);\n}", "function info(message) {\n process.stdout.write(message + os.EOL);\n}", "function info(message) {\n process.stdout.write(message + os.EOL);\n}", "function info(message) {\n process.stdout.write(message + os.EOL);\n}", "function info(message) {\n process.stdout.write(message + os.EOL);\n}", "function info(message) {\n process.stdout.write(message + os.EOL);\n}", "function info(message) {\n process.stdout.write(message + os.EOL);\n}", "function info(message) {\n process.stdout.write(message + os.EOL);\n}", "function info(message) {\n process.stdout.write(message + os.EOL);\n}", "function info(message) {\n process.stdout.write(message + os.EOL);\n}", "function info(message) {\n process.stdout.write(message + os.EOL);\n}", "function info(message) {\n process.stdout.write(message + os.EOL);\n}", "function info(message) {\n process.stdout.write(message + os.EOL);\n}", "function info(message) {\n process.stdout.write(message + os.EOL);\n}", "function info(message) {\n process.stdout.write(message + os.EOL);\n}", "function info(message) {\n process.stdout.write(message + os.EOL);\n}", "function info(message) {\n process.stdout.write(message + os.EOL);\n}", "function info(message) {\n process.stdout.write(message + os.EOL);\n}", "function info(message) {\n process.stdout.write(message + os.EOL);\n}", "function info(message) {\n process.stdout.write(message + os.EOL);\n}", "function info(message) {\n process.stdout.write(message + os.EOL);\n}", "function info(message) {\n process.stdout.write(message + os.EOL);\n}", "function info(message) {\n process.stdout.write(message + os.EOL);\n}", "function info(message) {\n process.stdout.write(message + os.EOL);\n}", "function info(message) {\n process.stdout.write(message + os.EOL);\n}", "function info(message) {\n process.stdout.write(message + os.EOL);\n}", "function info(message) {\n process.stdout.write(message + os.EOL);\n}", "function info(message) {\n process.stdout.write(message + os.EOL);\n}", "function info(message) {\n process.stdout.write(message + os.EOL);\n}", "function info(message) {\n process.stdout.write(message + os$1.EOL);\n}", "function info(message) {\n process.stdout.write(message + os$1.EOL);\n}", "function VFile(options) {\n var prop\n var index\n\n if (!options) {\n options = {}\n } else if (typeof options === 'string' || buffer(options)) {\n options = {contents: options}\n } else if ('message' in options && 'messages' in options) {\n return options\n }\n\n if (!(this instanceof VFile)) {\n return new VFile(options)\n }\n\n this.data = {}\n this.messages = []\n this.history = []\n this.cwd = proc.cwd()\n\n // Set path related properties in the correct order.\n index = -1\n\n while (++index < order.length) {\n prop = order[index]\n\n if (own.call(options, prop)) {\n this[prop] = options[prop]\n }\n }\n\n // Set non-path related properties.\n for (prop in options) {\n if (order.indexOf(prop) < 0) {\n this[prop] = options[prop]\n }\n }\n}", "function VFile(options) {\n var prop\n var index\n\n if (!options) {\n options = {}\n } else if (typeof options === 'string' || buffer(options)) {\n options = {contents: options}\n } else if ('message' in options && 'messages' in options) {\n return options\n }\n\n if (!(this instanceof VFile)) {\n return new VFile(options)\n }\n\n this.data = {}\n this.messages = []\n this.history = []\n this.cwd = proc.cwd()\n\n // Set path related properties in the correct order.\n index = -1\n\n while (++index < order.length) {\n prop = order[index]\n\n if (own.call(options, prop)) {\n this[prop] = options[prop]\n }\n }\n\n // Set non-path related properties.\n for (prop in options) {\n if (order.indexOf(prop) < 0) {\n this[prop] = options[prop]\n }\n }\n}", "function info(message) {\n log('INFO', message);\n}", "static info(message) {\n\t\tthis.log(Logger.Level.info, message)\n\t}", "function VFile(options) {\n var prop\n var index\n var length\n\n if (!options) {\n options = {}\n } else if (typeof options === 'string' || buffer(options)) {\n options = {contents: options}\n } else if ('message' in options && 'messages' in options) {\n return options\n }\n\n if (!(this instanceof VFile)) {\n return new VFile(options)\n }\n\n this.data = {}\n this.messages = []\n this.history = []\n this.cwd = process.cwd()\n\n // Set path related properties in the correct order.\n index = -1\n length = order.length\n\n while (++index < length) {\n prop = order[index]\n\n if (own.call(options, prop)) {\n this[prop] = options[prop]\n }\n }\n\n // Set non-path related properties.\n for (prop in options) {\n if (order.indexOf(prop) === -1) {\n this[prop] = options[prop]\n }\n }\n}", "info (msg : string, ...args : mixed[]) {\n\t\tthis._print(\"info\", msg, ...args)\n\t}", "setMessage(info) {\n this.showRestartTip = info.showRestartTip;\n this.header.setText(info.header);\n this.message.setText(info.message);\n\n let headerWidth = this.header.getWidth();\n let messageWidth = this.message.getWidth();\n let longer = Math.max(headerWidth, messageWidth);\n let margin = 15;\n this.box.x = ((SCREEN.WIDTH - longer) / 2) - margin;\n this.box.width = longer + margin * 2;\n }", "function VFile(options) {\n var prop;\n var index;\n var length;\n\n if (!options) {\n options = {};\n } else if (typeof options === 'string' || buffer(options)) {\n options = {contents: options};\n } else if ('message' in options && 'messages' in options) {\n return options;\n }\n\n if (!(this instanceof VFile)) {\n return new VFile(options);\n }\n\n this.data = {};\n this.messages = [];\n this.history = [];\n this.cwd = process.cwd();\n\n /* Set path related properties in the correct order. */\n index = -1;\n length = order.length;\n\n while (++index < length) {\n prop = order[index];\n\n if (own.call(options, prop)) {\n this[prop] = options[prop];\n }\n }\n\n /* Set non-path related properties. */\n for (prop in options) {\n if (order.indexOf(prop) === -1) {\n this[prop] = options[prop];\n }\n }\n}", "function VFile(options) {\n var prop;\n var index;\n var length;\n\n if (!options) {\n options = {};\n } else if (typeof options === 'string' || buffer(options)) {\n options = {contents: options};\n } else if ('message' in options && 'messages' in options) {\n return options;\n }\n\n if (!(this instanceof VFile)) {\n return new VFile(options);\n }\n\n this.data = {};\n this.messages = [];\n this.history = [];\n this.cwd = process.cwd();\n\n /* Set path related properties in the correct order. */\n index = -1;\n length = order.length;\n\n while (++index < length) {\n prop = order[index];\n\n if (own.call(options, prop)) {\n this[prop] = options[prop];\n }\n }\n\n /* Set non-path related properties. */\n for (prop in options) {\n if (order.indexOf(prop) === -1) {\n this[prop] = options[prop];\n }\n }\n}", "function VFile(options) {\n var prop;\n var index;\n var length;\n\n if (!options) {\n options = {};\n } else if (typeof options === 'string' || buffer(options)) {\n options = {contents: options};\n } else if ('message' in options && 'messages' in options) {\n return options;\n }\n\n if (!(this instanceof VFile)) {\n return new VFile(options);\n }\n\n this.data = {};\n this.messages = [];\n this.history = [];\n this.cwd = process.cwd();\n\n /* Set path related properties in the correct order. */\n index = -1;\n length = order.length;\n\n while (++index < length) {\n prop = order[index];\n\n if (own.call(options, prop)) {\n this[prop] = options[prop];\n }\n }\n\n /* Set non-path related properties. */\n for (prop in options) {\n if (order.indexOf(prop) === -1) {\n this[prop] = options[prop];\n }\n }\n}", "function VFile(options) {\n var prop;\n var index;\n var length;\n\n if (!options) {\n options = {};\n } else if (typeof options === 'string' || buffer(options)) {\n options = {contents: options};\n } else if ('message' in options && 'messages' in options) {\n return options;\n }\n\n if (!(this instanceof VFile)) {\n return new VFile(options);\n }\n\n this.data = {};\n this.messages = [];\n this.history = [];\n this.cwd = process.cwd();\n\n /* Set path related properties in the correct order. */\n index = -1;\n length = order.length;\n\n while (++index < length) {\n prop = order[index];\n\n if (own.call(options, prop)) {\n this[prop] = options[prop];\n }\n }\n\n /* Set non-path related properties. */\n for (prop in options) {\n if (order.indexOf(prop) === -1) {\n this[prop] = options[prop];\n }\n }\n}", "function VFile(options) {\n var prop;\n var index;\n var length;\n\n if (!options) {\n options = {};\n } else if (typeof options === 'string' || buffer(options)) {\n options = {contents: options};\n } else if ('message' in options && 'messages' in options) {\n return options;\n }\n\n if (!(this instanceof VFile)) {\n return new VFile(options);\n }\n\n this.data = {};\n this.messages = [];\n this.history = [];\n this.cwd = process.cwd();\n\n /* Set path related properties in the correct order. */\n index = -1;\n length = order.length;\n\n while (++index < length) {\n prop = order[index];\n\n if (own.call(options, prop)) {\n this[prop] = options[prop];\n }\n }\n\n /* Set non-path related properties. */\n for (prop in options) {\n if (order.indexOf(prop) === -1) {\n this[prop] = options[prop];\n }\n }\n}", "function VFile(options) {\n var prop;\n var index;\n var length;\n\n if (!options) {\n options = {};\n } else if (typeof options === 'string' || buffer(options)) {\n options = {contents: options};\n } else if ('message' in options && 'messages' in options) {\n return options;\n }\n\n if (!(this instanceof VFile)) {\n return new VFile(options);\n }\n\n this.data = {};\n this.messages = [];\n this.history = [];\n this.cwd = process.cwd();\n\n /* Set path related properties in the correct order. */\n index = -1;\n length = order.length;\n\n while (++index < length) {\n prop = order[index];\n\n if (own.call(options, prop)) {\n this[prop] = options[prop];\n }\n }\n\n /* Set non-path related properties. */\n for (prop in options) {\n if (order.indexOf(prop) === -1) {\n this[prop] = options[prop];\n }\n }\n}", "function outputFileCreationInfo(file)\n{\n // Add the build information and header to the output file\n ccdd.writeToFileLn(file, \"# Created : \" + ccdd.getDateAndTime() + \"\\n# User : \" + ccdd.getUser() + \"\\n# Project : \" + ccdd.getProject() + \"\\n# Script : \" + ccdd.getScriptName());\n\n // Check if any table is associated with the script\n if (ccdd.getTableNumRows() != 0)\n {\n ccdd.writeToFileLn(file, \"# Table(s): \" + [].slice.call(ccdd.getTableNames()).sort().join(\",\\n# \"));\n }\n\n // Check if any groups is associated with the script\n if (ccdd.getAssociatedGroupNames().length != 0)\n {\n ccdd.writeToFileLn(file, \"# Group(s): \" + [].slice.call(ccdd.getAssociatedGroupNames()).sort().join(\",\\n# \"));\n }\n\n ccdd.writeToFileLn(file, \"\");\n}", "function popUpInfo(message) {\n\tvar p = new PopUp({\n\t\t\"message\": message,\n\t\t\"ok\": true,\n\t\t\"cancel\": false,\n\t\t\"custom\": false,\n\t\t\"close\": true,\n\t\t\"icon\": \"📣\"\n\t});\n\tp.create().then((result) => { }).catch((err) => console.log(err));\n}", "function createInfoNotification(message, seconds){\n\tcreateNotification(message, \"info\", seconds);\n}", "function moveToNewFile(message) {\n console.log(message);\n}" ]
[ "0.6556722", "0.6556722", "0.6556722", "0.6556722", "0.6526714", "0.62738734", "0.61954087", "0.61925805", "0.61925805", "0.61925805", "0.61925805", "0.61925805", "0.6155595", "0.6155595", "0.6155595", "0.61103654", "0.5857036", "0.5676465", "0.55974704", "0.54965174", "0.5460986", "0.5460986", "0.542801", "0.5392865", "0.53887665", "0.53828377", "0.53643405", "0.5355563", "0.5355563", "0.5251372", "0.52122766", "0.52122766", "0.5194519", "0.5194519", "0.5194519", "0.5194519", "0.5194519", "0.5194519", "0.5194519", "0.5194519", "0.5194519", "0.5194519", "0.5194519", "0.5194519", "0.5194519", "0.5194519", "0.5194519", "0.5194519", "0.5194519", "0.5194519", "0.5194519", "0.5194519", "0.5194519", "0.5194519", "0.5194519", "0.5194519", "0.5194519", "0.5194519", "0.5194519", "0.5194519", "0.5194519", "0.5194519", "0.5194519", "0.5194519", "0.5194519", "0.5194519", "0.5194519", "0.5194519", "0.5194519", "0.5194519", "0.5194519", "0.5194519", "0.5194519", "0.5194519", "0.5194519", "0.5194519", "0.5194519", "0.5164704", "0.5164704", "0.5145687", "0.5145687", "0.51133364", "0.510985", "0.50693464", "0.5060036", "0.50587034", "0.5052928", "0.5052928", "0.5052928", "0.5052928", "0.5052928", "0.5052928", "0.50395554", "0.50253433", "0.50022453", "0.49956894" ]
0.64661753
9
Construct a new file.
function VFile(options) { var prop; var index; var length; if (!options) { options = {}; } else if (typeof options === 'string' || buffer(options)) { options = {contents: options}; } else if ('message' in options && 'messages' in options) { return options; } if (!(this instanceof VFile)) { return new VFile(options); } this.data = {}; this.messages = []; this.history = []; this.cwd = process.cwd(); /* Set path related properties in the correct order. */ index = -1; length = order.length; while (++index < length) { prop = order[index]; if (own.call(options, prop)) { this[prop] = options[prop]; } } /* Set non-path related properties. */ for (prop in options) { if (order.indexOf(prop) === -1) { this[prop] = options[prop]; } } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function createFile() {\n var e = new emitter();\n\n fs.readFile('newdocument.txt', function (err) {\n if (err) throw err;\n e.emit('theProcess');\n });\n\n return e;\n}", "function createNewFile() {\n file = {\n name: 'novo-arquivo.txt',\n content: '',\n saved: false,\n path: app.getPath('documents') + '/novo-arquivo.txt'\n }\n\n mainWindow.webContents.send('set-file', file)\n}", "open() {\n this.close()\n\n const file = path.normalize(this._filename)\n const opts = {\n flags: this._append ? 'a' : 'w',\n encoding: 'utf8',\n }\n\n ensureDirectoryExistence(file)\n this._writer = fs.createWriteStream(file, opts)\n }", "function fileFactory(arg) {\n\t// Files can be constructed from either a siapath or a status object\n\t// returned from /renter/files||downloads\n\tvar f = Object.create(file);\n\tif (typeof arg === 'object'){\n\t\tObject.assign(f, arg);\n\t\tf.path = arg.siapath;\n\t} else if (typeof arg === 'string') {\n\t\tf.path = arg;\n\t} else {\n\t\tconsole.error('Unrecognized constructur argument: ', arguments);\n\t}\n\n\treturn f;\n}", "create() {\n this.proc.args.file = null;\n\n this.emit('new-file');\n\n this.updateWindowTitle();\n }", "function File() {}", "static genEmptyFileObj() {\n return new FileObject();\n }", "function createFile(){\n if (projectType == \"Basic\") {\n internalReference = idAgency + \"-\" + padToFour(orderNumber) + \"-\" + padToTwo(version) + \"-\" + padToTwo(revision);\n updateListItem(fileId,internalReference,documentType,description,dateCreated,diffusionDate,externalReference,localization,form,status);\n //Internal Reference as Full\n } else if (projectType == \"Full\") {\n internalReference = documentType + \"-\" + padToFour(projectCode) + \"-\" + padToTwo(avenant) + \"-\" + idAgency + \"-\" + padToFour(orderNumber) + \"-\" + padToTwo(version) + \"-\" + padToTwo(revision);\n updateListItem(fileId, internalReference, documentType, description, dateCreated, diffusionDate, externalReference, localization, form, status);\n //Internal Reference as Full Without Project \n } else {\n\n internalReference = documentType + \"-\" + idAgency + \"-\" + padToFour(orderNumber) + \"-\" + padToTwo(version) + \"-\" + padToTwo(revision);\n updateListItem(fileId, internalReference, documentType, description, dateCreated, diffusionDate, externalReference, localization, form, status);\n }\n }", "createFile() {\n try {\n fse.ensureDirSync(this.directory);\n } catch(e) {\n if ( e.code != 'EEXIST' ) throw e;\n }\n\n if (!utils.fileExists(this.file)) {\n fs.writeFileSync(this.file, this.serialize(this.defaultConfig));\n log.d('Created the default config file in ' + this.file);\n }\n }", "createNewfile(state, options) {\n //Get desired filename\n let name;\n if(options !== undefined && options.name !== undefined)\n name = getDefaultName(options.name);\n else\n name = getDefaultName();\n\n //Insert empty rows to fill up to the desired well count\n state.plate = plates[\"MWP 24\"];\n var values = [];\n for (let i = 0; i < state.plate.wells; i++) {\n values.push([0, 0]);\n }\n\n state.file = {\n substances: [\n { name: \"Water\", color: \"#6699ff\" },\n { name: \"Sample 1\", color: \"#66ff33\" },\n ],\n\n name: name,\n values: values,\n };\n }", "function createFile(fullPathToFile, newFilePath, newFileName, newFileParentPath, timestamp, markAsPermanentlyNotRelevant) {\n\n //if this should be ignored due to the st-ignore.json file\n if(!ignoreThisFileOrDir(newFilePath)) {\n \n //create an id for this file\n var newFileId = \"fileId-\" + branchId + \"_\" + autoGeneratedFileId;\n \n //get the id ready for the next file/dir\n autoGeneratedFileId++;\n\n //create a new file object\n var newFile = {\n id: newFileId,\n parentId: getIdFromDirPath(newFileParentPath),\n currentName: newFileName,\n isDeleted: false\n };\n\n //add the file to the object of all files\n allFiles[newFileId] = newFile;\n\n //make a connection between the file path and an id \n addFilePathToIdMap(newFilePath, newFileId);\n \n //create a new empty 2D array to hold insert events for the default file\n allInsertEventsByFile[newFileId] = [];\n\n //create a new file event\n var createFileEvent = {\n id: \"ev_\" + branchId + \"_\" + autoGeneratedEventId, \n timestamp: timestamp,\n type: \"Create File\",\n initialName: newFileName,\n fileId: newFileId,\n parentDirectoryId: newFile.parentId,\n createdByDevGroupId: currentDeveloperGroup.id\n };\n \n //increase the id so the next event has a unique id\n autoGeneratedEventId++;\n \n //if the user wants to mark this file as NOT relevant (because it is an existing file\n //that is being reconciled in a new project)\n if(markAsPermanentlyNotRelevant === true) {\n\n //pre-mark the event as not even possible to become relevant\n createFileEvent.permanentRelevance = \"never relevant\";\n }\n\n //add the event to the collection of all events\n codeEvents.push(createFileEvent);\n\n //occassionally a new file has something in it, for example, if a tool has generated the file\n //if the file has anything in it, take the contents and make them events in the system\n\n //open the file and read the text\n var fileText = fs.readFileSync(fullPathToFile, \"utf8\");\n \n //if there is anything in the new file\n if(fileText !== \"\") {\n\n //add the text into \n insertText(newFilePath, fileText, 0, 0, false, [], new Date().getTime(), markAsPermanentlyNotRelevant);\n }\n }\t \n}", "function createFile() {\n var message = 'create file randomly',\n params = {\n message: message,\n committer: {\n name: 'yukihirai0505',\n email: 'hogehoge@gmail.com'\n },\n content: Utilities.base64Encode(message)\n },\n data = fetchJson(FILE_URL.replace(FILE_PATH_PLACEHOLDER, getRandomString()), 'PUT', params);\n Logger.log(data);\n}", "function makeTheFile(name, data){\n fs.writeFile('README.md', data, (err) => {\n if (err){\n console.log(err);\n }\n console.log(\"README has been successfully generated.\")\n })\n }", "function createFile(filename, content) {\n if (existsSync(filename)) return console.log(filename + ' already exists - exiting');\n const data = new Uint8Array(Buffer.from(content));\n writeFile(filename, data, (err) => {\n if (err) throw err;\n console.log(filename + ' created.');\n });\n}", "static createFile(evt, {path=null, str=\"\"}){\n // must have file path\n if(!path){\n let err = \"No file name provided (path is null).\";\n IpcResponder.respond(evt, \"file-create\", {err});\n return;\n }\n\n // figure file path data from file string \n let fileName = path.split(\"/\").pop();\n let dir = path.split(`/${fileName}`)[0];\n let knownFolder = FolderData.folderPaths.includes(path);\n\n // create the file \n FileUtils.createFile(path, str)\n .then(() => {\n // file created\n IpcResponder.respond(evt, \"file-create\", {dir, fileName, knownFolder});\n\n // update recent files \n FolderData.updateRecentFiles([path]);\n })\n .catch(err => {\n // error\n IpcResponder.respond(evt, \"file-create\", {err: err.message});\n });\n }", "function fileCreate(fileName, data) {\n fs.writeFile(fileName, data, err => {\n if (err) {\n return console.log(err);\n }\n console.log('Your readme has been generated!')\n});\n}", "function newFile() {\n\teditor.reset();\n\tpathToFileBeingEdited = undefined;\n\tparse();\n}", "constructor(filename) {\n if (!filename) {\n throw new Error(\"Creating a repository requires a new filename\");\n }\n this.filename = filename;\n //chek if the file exixts\n try {\n fs.accessSync(this.filename);\n //if not create a new file\n } catch (err) {\n fs.writeFileSync(this.filename, \"[]\");\n }\n }", "function createFile() {\r\n const iterator1 = stories[Symbol.iterator]();\r\n var combos = \"\";\r\n for (const item of iterator1) {\r\n combos = combos + item[0] + '\\n' + splitConstant + '\\n' + item[1] + '\\n' + splitConstant + '\\n';\r\n }\r\n var text = combos;\r\n var filename = 'stories.txt';\r\n var element = document.createElement('a');\r\n element.setAttribute('href', 'data:text/plain;charset=utf-8,' + encodeURIComponent(text));\r\n element.setAttribute('download', filename);\r\n element.style.display = 'none';\r\n document.body.appendChild(element);\r\n element.click();\r\n document.body.removeChild(element);\r\n}", "function createNewSketchFile (){\n var newFile = MSDocument.new();\n newFile.setFileName(context.document.fileName().replace('.sketch','') + \" Library.sketch\")\n newFile.saveDocumentAs(newFile)\n log(newFile.fileName())\n return newFile\n}", "function File() {\n _classCallCheck(this, File);\n\n File.initialize(this);\n }", "createFile(path) {\n touch.sync(path.absolute);\n }", "static init() {\n fs.writeFile(file, '{}');\n }", "function createFakeFile() {\n const owner = ld.sample(owners);\n const startedAt = faker.date.past().getTime();\n\n return {\n uploadId: uuid.v4(),\n status: ld.sample(statusValues),\n startedAt,\n uploadedAt: startedAt + 1000,\n name: faker.commerce.productName(),\n files: JSON.stringify([]), // can insert real files, but dont care\n contentLength: ld.random(1, 2132311),\n parts: ld.random(1, 4),\n [FILES_OWNER_FIELD]: owner,\n };\n }", "function create( src, dst, opts ) {\n\n if( !src || !src.length )\n throw { fluenterror: HMSTATUS.createNameMissing, quit: true };\n\n _.each( src, function( t ) {\n var safeFmt = opts.format.toUpperCase();\n this.stat( HMEVENT.beforeCreate, { fmt: safeFmt, file: t } );\n MKDIRP.sync( PATH.dirname( t ) ); // Ensure dest folder exists;\n var RezClass = require('../core/' + safeFmt.toLowerCase() + '-resume' );\n RezClass.default().save(t);\n this.stat( HMEVENT.afterCreate, { fmt: safeFmt, file: t } );\n }, this);\n\n }", "getByName(name) {\r\n const f = new File(this);\r\n f.concat(`('${name}')`);\r\n return f;\r\n }", "async createFile(filePath, contents, newFileName = \"Untitled.spell\", die) {\n if (!die) die = getDier(this, \"creating file\", { projectId: this.projectId, filePath })\n\n if (!filePath) filePath = prompt(\"Name for the new file?\", newFileName)\n if (!filePath) return undefined\n die.params.filePath = filePath\n\n await this.loadOrDie(die)\n if (this.getFile(filePath)) die(\"File already exists.\")\n\n // Tell the server to create the file, which returns updated index\n try {\n const newIndex = await $fetch({\n url: `/api/projects/create/file`,\n contents: {\n projectId: this.projectId,\n filePath,\n contents: contents ?? `## This space intentionally left blank`\n },\n requestFormat: \"json\",\n format: \"json\"\n })\n this.setContents(newIndex)\n } catch (e) {\n die(\"Server error creating file\", e)\n }\n\n // Return the file\n return this.getFile(filePath) || die(\"Server didn't create file.\")\n }", "async newFile(options){\n const self = this;\n const validateConfig = await ObjectValidator.validate({ object: options, against: \"File_Creation\", });\n\n if(validateConfig.success){\n if(validateConfig.object.folder !== \"\"){\n await this.makeLocalDir(`${self.config.basePath}${self.config.basePath === \"\" ? \"\" : \"/\"}${validateConfig.object.folder.replace(\"FILE_EXTENSION_WISE\", \"\")}`);\n }\n\n if(validateConfig.object.request){\n // If an Http request is provided.\n let requestFiles = await this.getFilesFromHttpRequest(validateConfig.object.request);\n let FCFiles = [];\n\n for(let requestFile of requestFiles){\n let { contents, contentType, contentLength, readStream } = await this.getLocalFileContents(requestFile.path, false, null); // contents & readStream are same since 2nd parameter, decrypt, is false. If decrypt is true, contents is a pipeline.\n let isStream = true;\n let doEncrypt = false;\n let didEncrypt = false;\n\n if(contents){\n let finalContents = contents;\n if(this.file_protector !== null && validateConfig.object.isEncrypted === false){\n // If a file protector is assigned & passed value of isEncrypted is not true, encrypt the contents.\n doEncrypt = true;\n // Encrypt contents while writing the file.\n }\n\n let requestFileName = requestFile.originalFilename;\n let ext_regex = /(?:\\.([^.]+))?$/;\n let requestFileExt = ext_regex.exec(requestFileName)[1];\n let folderPath = validateConfig.object.folder.replace(\"FILE_EXTENSION_WISE\", requestFileExt.toString().toLowerCase());\n let fullFolderPath = await this.beautifyPath(folderPath, true);\n\n await this.makeLocalDir(fullFolderPath);\n\n let newLocalFileCreated = await this.makeLocalFile(`${fullFolderPath}${fullFolderPath == \"\" ? \"\" : \"/\"}${requestFileName}`, finalContents, readStream, doEncrypt, isStream, contentLength, false);\n if(newLocalFileCreated === true){\n if(doEncrypt === true){ didEncrypt = true; }\n\n let obj = { name: requestFileName.replace(\".\"+requestFileExt, \"\"), ext: requestFileExt, folder: folderPath, handler: self, isEncrypted: validateConfig.object.isEncrypted === true ? true : didEncrypt, };\n let newFCFile = await self.newFCFile(obj); // Wrap file values in a FCFile instance.\n\n Logger.log(\"New LSfile created\");\n newFCFile ? FCFiles.push(newFCFile) : false;\n }\n }else{ }\n }\n\n return FCFiles.length > 0 ? FCFiles : null;\n }else{\n let folderPath = validateConfig.object.folder.replace(\"FILE_EXTENSION_WISE\", validateConfig.object.ext.toString().toLowerCase());\n let fullFolderPath = await this.beautifyPath(folderPath, true);\n\n await this.makeLocalDir(fullFolderPath);\n\n let finalContents = validateConfig.object.contents;\n let doEncrypt = false;\n let didEncrypt = false;\n if(this.file_protector !== null && validateConfig.object.isEncrypted === false){\n // If a file protector is assigned & passed value of isEncrypted is not true, encrypt the contents.\n doEncrypt = true;\n // Encrypt contents while writing the file.\n }\n\n let newLocalFileCreated = await this.makeLocalFile(\n `${fullFolderPath}${fullFolderPath == \"\" ? \"\" : \"/\"}${validateConfig.object.name}.${validateConfig.object.ext}`,\n finalContents,\n validateConfig.object.readStream !== null ? validateConfig.object.readStream : validateConfig.object.isStream === true ? finalContents : null,\n doEncrypt,\n validateConfig.object.isStream,\n validateConfig.object.isStream === true ? validateConfig.object.contentLength : finalContents.length,\n false\n );\n\n if(newLocalFileCreated === true){\n if(doEncrypt === true){ didEncrypt = true; }\n\n let obj = { name: validateConfig.object.name, ext: validateConfig.object.ext, folder: folderPath, handler: self, isEncrypted: validateConfig.object.isEncrypted === true ? true : didEncrypt, };\n let newFCFile = await self.newFCFile(obj); // Wrap file values in a FCFile instance.\n\n Logger.log(\"New LSfile created\");\n return newFCFile;\n }\n\n Logger.log(\"New LSfile creation failed\");\n }\n }else{ Logger.log(\"New LSfile creation failed\"); }\n\n return null;\n }", "async createFile(name) {\n let normalizedDir = this.fullPath;\n if (normalizedDir.charAt(normalizedDir.length - 1) === path_1.sep) {\n normalizedDir = normalizedDir.slice(0, -1);\n }\n const fd = await util_1.promisify(fs_1.open)(`${normalizedDir}${path_1.sep}${name}`, 'w');\n await util_1.promisify(fs_1.close)(fd);\n this.context.socketService.notifyRefresh(this.path.replace(/\\\\/g, '/').replace(/\\/$/, \"\"));\n return this.context.getHierarchyItem(this.path + name);\n }", "function makeFile(info) {\n const { comment, upstream, config } = info\n return (\n `// ${comment}\\n` +\n '//\\n' +\n `// Auto-generated by ${packageJson.name}\\n` +\n `// based on rules from ${upstream}\\n` +\n '\\n' +\n '\"use strict\";\\n' +\n '\\n' +\n `module.exports = ${JSON.stringify(sortJson(config), null, 2)};\\n`\n )\n}", "constructor (filename) {\n super()\n this.filename = filename\n }", "constructor (path) {\n const f = new IO(path, 'r');\n this.is_base = true;\n\n // copy as tempfile\n this.file = IO.temp('w+');\n let d = f.read(BUFFER_SIZE);\n while (d.length > 0) {\n this.file.write(d);\n d = f.read(BUFFER_SIZE);\n }\n\n f.close();\n if (!Base.surely_formatted(this.file)) {\n throw new Error('Unsupported file passed.');\n }\n\n // TODO: close and remove the Tempfile.\n this.frames = new Frames(this.file);\n }", "_save() {\n let content = this.input.getContent().split(\"</div>\").join(\"\")\n .split(\"<div>\").join(\"\\n\");\n this.file.setContent(content);\n\n // create new file\n if (this.createFile)\n this.parentDirectory.addChild(this.file);\n }", "function File() {\n\t/**\n\t * The data of a file.\n\t */\n\tthis.data = \"\";\n\t/**\n\t * The name of the file.\n\t */\n\tthis.name = \"\";\n}", "function File() {\n\t/**\n\t * The data of a file.\n\t */\n\tthis.data = \"\";\n\t/**\n\t * The name of the file.\n\t */\n\tthis.name = \"\";\n}", "function createNewFile(fullpath, contents, testExt) {\n function _getUntitledFileSuggestion(dir, baseFileName, fileExt, isFolder) {\n var result = new $.Deferred();\n var suggestedName = baseFileName + fileExt;\n var dirEntry = new NativeFileSystem.DirectoryEntry(dir);\n\n result.progress(function attemptNewName(suggestedName, nextIndexToUse) {\n if (nextIndexToUse > 99) {\n //we've tried this enough\n result.reject();\n return;\n }\n\n //check this name\n var successCallback = function (entry) {\n //file exists, notify to the next progress\n result.notify(baseFileName + \"-\" + nextIndexToUse + fileExt, nextIndexToUse + 1);\n };\n var errorCallback = function (error) {\n //most likely error is FNF, user is better equiped to handle the rest\n result.resolve(suggestedName);\n };\n \n if (isFolder) {\n dirEntry.getDirectory(\n suggestedName,\n {},\n successCallback,\n errorCallback\n );\n } else {\n dirEntry.getFile(\n suggestedName,\n {},\n successCallback,\n errorCallback\n );\n }\n });\n\n //kick it off\n result.notify(baseFileName + fileExt, 1);\n\n return result.promise();\n }\n var basedir = fullpath.substring(0, fullpath.lastIndexOf(\"/\")),\n name = fullpath.substring(fullpath.lastIndexOf(\"/\") + 1),\n testname = name.substring(0, name.lastIndexOf('.js')) + testExt;\n var deferred = _getUntitledFileSuggestion(basedir, testname, \".js\", false);\n var createWithSuggestedName = function (suggestedName) {\n var result = ProjectManager.createNewItem(basedir, suggestedName, true, false);\n result.done(function (entry) {\n DocumentManager.getDocumentForPath(entry.fullPath).done(function (doc) {\n doc.setText(contents);\n });\n });\n };\n\n deferred.done(createWithSuggestedName);\n return deferred;\n }", "function create(path, mode, callback) {\n console.log(\"TODO: Implement create\", arguments);\n }", "function createLog(){\n var a = \"log_\" + moment().format('YYMMDD-HHmm') + \".txt\";\n logName = a;\n fs.writeFile(a,\"Starting Log:\\n\",(err)=>{\n if(err) throw(err); \n });\n}", "function createFile(path, content) {\n fs.writeFileSync(path, content, { encoding: \"utf-8\" });\n}", "create (file,data) {\n fs.open(`${baseDir}/${file}.json`,'wx',(err,identifier)=>{\n if(!err && identifier){\n //Overide default to place objects inside of an array\n //let jsonArray = [];\n\n //jsonArray.push(data);\n\n let stringData = JSON.stringify(data,null,3);\n\n fs.writeFile(identifier,stringData,(err)=>{\n if(!err){\n fs.close(identifier,(err) =>{\n if(!err) console.log('no errors');\n else console.log(err);\n })\n } else console.log(err);\n })\n }\n else console.log(err);\n });\n }", "function createFVSObject (fileContents) {\n // a. Hash the contents of the file\n // b. Use the first two characters of the hash as the directory in .fvs/objects\n // c. Check if the directory already exists! Do you know how to check if a directory exists in node?\n // Hint: you'll need to use a try/catch block\n // Another hint: look up fs.statSync\n // d. Write a file whose name is the rest of the hash, and whose contents is the contents of the file\n // e. Return the hash!\n}", "constructor (filename) {\n \n // Obtém conteúdo da template.\n this.template = fs.readFileSync(filename).toString(); \n }", "function createFile(srcURL, destURL) {\n fs.appendFile(destURL, '', function (err) {\n if (err) throw err;\n console.log('File Saved');\n });\n fs.copyFile(srcURL, destURL, (error) => {\n // incase of any error\n if (error) {\n console.error(error);\n return;\n }\n\n console.log(\"File Copied\");\n });\n}", "function FakeFile(path)\n{\n this.path = path;\n}", "function File() {\n this.lastFileName = \"untitled.map\";\n}", "createFile(text){\n this.model.push({text});\n\n // This change event can be consumed by other components which\n // can listen to this event via componentWillMount method.\n this.emit(\"change\")\n }", "function createFile() {\n const renderedHTML = render(teamMembers);\n fs.writeFileSync(outputPath, renderedHTML);\n}", "function File(info) {\n this.name = info.name;\n this.kind = info.kind;\n this.genre = info.genre;\n this.size = info.size;\n this.last_revision = info.commit_revision;\n this.author = info.commit_author;\n this.last_date = info.commit_date;\n this.id = info.index;\n this.commit_history = {};\n this.comments = [];\n}", "function createFile(){\n\n var reader = new FileReader();\n \n reader.readAsDataURL(blob)\n\n reader.onloadend = function () {\n\n var base64String = reader.result;\n\n // Remove the additional data at the front of the string\n\n var base64Substring = base64String.substr(base64String.indexOf(',') + 1)\n\n // Upload to the CSV Creator element\n context.uploadContent( filename, base64Substring, uploadFile);\n\n }\n\n }", "function newfile() {\n let newFile = document.querySelector(\".add-file\");\n\n fileDiv = document.createElement(\"div\");\n fileDiv.classList.add(`file-div-${fileCounter}`);\n\n buttonRemoveFile = document.createElement(\"button\");\n buttonRemoveFile.classList.add(`file-div-${fileCounter}`);\n buttonRemoveFile.setAttribute(\"type\", \"button\");\n buttonRemoveFile.innerHTML = \"Remove File -\";\n\n labelFileComplete = document.createElement(\"label\");\n labelFileComplete.setAttribute(\"for\", \"completed-file\");\n labelFileComplete.innerHTML = \"Completed\"\n fileCompleteRadio = document.createElement(\"input\");\n fileCompleteRadio.setAttribute(\"type\", \"checkbox\");\n fileCompleteRadio.setAttribute(\"id\", \"completed-file\");\n fileCompleteRadio.setAttribute(\"name\", `file-name-${fileCounter}`);\n fileCompleteRadio.setAttribute(\"value\", \"completed\");\n fileCompleteRadio.classList.add(\"create-checkbox\");\n\n labelFileName = document.createElement(\"label\");\n labelFileName.setAttribute(\"for\", \"file-name\");\n labelFileName.classList.add(`label-filename`);\n labelFileName.innerHTML = \"File name: \";\n \n inputFileName = document.createElement(\"input\");\n inputFileName.setAttribute(\"type\", \"text\");\n inputFileName.setAttribute(\"id\", `file-name-${fileCounter}`);\n inputFileName.setAttribute(\"name\", `file-name-${fileCounter}`);\n inputFileName.setAttribute(\"size\", \"50.5\");\n\n labelFileDesc = document.createElement(\"label\");\n labelFileDesc.setAttribute(\"for\", \"file-desc\");\n labelFileDesc.classList.add(\"label-filedesc\");\n labelFileDesc.innerHTML = \"File Description: \";\n\n inputFileDesc = document.createElement(\"textarea\");\n inputFileDesc.setAttribute(\"id\", `file-desc`);\n inputFileDesc.setAttribute(\"name\", `file-name-${fileCounter}`);\n\n newBreak = document.createElement(\"br\");\n oneMoreBreak = document.createElement(\"br\");\n secMoreBreak = document.createElement(\"br\");\n\n inputFileName.append(newBreak);\n\n divAddClass = document.createElement(\"div\");\n divAddClass.classList.add(`add-class-${fileCounter}`, \"add-class\");\n \n buttonAddClass = document.createElement(\"button\");\n buttonAddClass.classList.add(`${fileCounter}`);\n buttonAddClass.classList.add(`add-class-button`);\n buttonAddClass.setAttribute(\"type\", \"button\");\n buttonAddClass.innerHTML = \"Add Class +\";\n\n divAddClass.append(buttonAddClass);\n divAddClass.append(newBreak);\n fileDiv.append(labelFileName);\n fileDiv.append(inputFileName);\n fileDiv.append(fileCompleteRadio);\n fileDiv.append(labelFileComplete);\n fileDiv.append(buttonRemoveFile);\n fileDiv.append(secMoreBreak);\n fileDiv.append(labelFileDesc);\n fileDiv.append(oneMoreBreak);\n fileDiv.append(inputFileDesc);\n fileDiv.append(divAddClass);\n fileDiv.append(newBreak);\n newFile.append(fileDiv);\n fileCounter = fileCounter + 1;\n}", "constructor (fh, filename) {\n //\"\"\" initalize. \"\"\"\n //if hasattr(filename, 'read'):\n // if not hasattr(filename, 'seek'):\n // raise ValueError(\n // 'File like object must have a seek method')\n \n var superblock = new SuperBlock(fh, 0);\n var offset = superblock.offset_to_dataobjects;\n var dataobjects = new DataObjects(fh, offset);\n super('/', dataobjects, null);\n this.parent = this;\n\n this._fh = fh\n this.filename = filename || '';\n\n this.file = this;\n this.mode = 'r';\n this.userblock_size = 0;\n }", "constructor(file) {\n this._file = file\n this.size = file.size\n }", "function create() {\n\t// make the overarching dir for ease of copying data around\n\tif(!fs.existsSync(\"instructions.md\")){\n\t\tconsole.log(\"ERR : No instructions.md file. Exiting without finishing...\");\n\t\treturn 1;\n\t}\n\tif(!fs.existsSync(\"tests\")){\n\t\tconsole.log(\"ERR : No tests file. Exiting without finishing... \");\n\t\treturn 1;\n\t}\n\tif(!fs.existsSync(project)){\n\t\tfs.mkdirSync(project);\n\t\tfullpath = project + \"/\";\n\t\tconsole.log(\"INFO : Project folder created\");\n\t}\n\tObject.keys(students).forEach(function (key) {\n\t\tvar err = genDir(students[key].login);\n\t\tif(err) {\n\t\t\tconsole.log(\"ERR : Error during creation of directory for : \" + students[key].login);\n\t\t} else {\n\t\t\tconsole.log(\"INFO : Directory created for : \" + students[key].login);\n\t\t}\n\t});\n}", "static create() {\n\t\tlet name, muts, tag, attr\n\n\t\tcl(`Creating new atom. \"Ctrl+c\" to exit`.gray);\n\n\t\trl.question(`Name » `.green, atomName => {\n\t\t\tname = atomName;\n\n\t\t\trl.question(`Mutates » `.green, atomMutate => {\n\t\t\t\tmuts = atomMutate.split(' ');\n\n\t\t\t\trl.question(`Tag » `.green, atomTag => {\n\t\t\t\t\ttag = atomTag;\n\n\t\t\t\t\trl.question(`Attributes » `.green, atomAttr => {\n\t\t\t\t\t\tattr = atomAttr.split(' ');\n\n\t\t\t\t\t\tvar atom = new Atom(name, muts, tag, attr);\n\n\t\t\t\t\t\tAtom.save(atom);\n\t\t\t\t\t\trl.close();\n\t\t\t\t\t});\n\t\t\t\t});\n\t\t\t});\n\t\t});\n\t}", "async makeLocalFile(path, contents, readStream, doEncrypt, isStream, contentLength, isReplacing = false){\n // isReplacing, when true, stores the contents in a temp file and writes them to the file at path. isReplacing must be true when reading and writing from and to the same file.\n // readStream is null when isStream is false.\n\n let self = this;\n try{\n var contentStream = contents;\n const uniqueIV = crypto.randomBytes(16).toString('hex');\n\n if(isStream === false){\n const readData = doEncrypt === true ? Buffer.concat([Buffer.from(`(${uniqueIV})`), Buffer.isBuffer(contents) ? contents : Buffer.from(contents)]) : Buffer.isBuffer(contents) ? contents : Buffer.from(contents);\n contentStream = self.createDataReadStream(readData, self.config.encryptingSpeed);\n }\n\n try{ contentStream.pause(); }catch(error){ Logger.log(error); }\n try{ readStream.pause(); }catch(error){ Logger.log(error); }\n\n contentStream.on('end', function(){ contentStream.destroy(); });\n contentStream.on('error', function(error){ Logger.log(error); contentStream.destroy(); });\n\n let random = Math.floor(Math.random()*1000000000000000000000)+100000000000000000000;\n let finalPath = isReplacing === true ? `${self.config.basePath}/temp/temp-${random}.temp` : path;\n\n if(isReplacing === true){ await self.makeLocalDir(`${self.config.basePath}/temp`); }\n\n if(doEncrypt === true){\n // This condition is true, when making a new encrypted file or when replacing contents of a decrypted file with encrypted ones.\n\n // WHEN contents IS A STREAM (isStream === true) contentLength does not needs to be increased for encryptStream by 34 for IV since uniqueIV is not pushed into contentStream instead it's pushed into writeStream...\n // ...therefore it will not be processed in the encryptStream, due to which encrypt stream will only need to the length of contents without IV length.\n let encryptStream = self.createEncryptStream(self.config.encryptingSpeed, contentStream, contentLength+(isStream === true ? 0 : 34), uniqueIV);\n let writeStream = fs.createWriteStream(finalPath, {flags: 'a', highWaterMark: self.config.encryptingSpeed, });\n if(isStream === true){\n // If contents is a stream, contentStream is set to contents and a manual creation of contentStream is not done therefore it is required to pass the uniqueIV.\n writeStream.write(`(${uniqueIV})`);\n }\n\n try{ contentStream.resume(); }catch(error){ Logger.log(error); }\n try{ readStream.resume(); }catch(error){ Logger.log(error); }\n\n await pipelineWithPromise(contentStream, encryptStream, writeStream).catch(error => { Logger.log(error); });\n }else{\n if(isReplacing === true){\n // doEncrypt false and isReplacing true proves that an encrypted file is being replaced, in other words, a file is being decrypted.\n // contentStream is a pipeline passed from getLocalFileContents()\n // isStream is TRUE\n\n try{ contentStream.resume(); }catch(error){ Logger.log(error); }\n try{ readStream.resume(); }catch(error){ Logger.log(error); }\n\n await pipelineWithPromise(contentStream, fs.createWriteStream(finalPath, {flags: 'a', highWaterMark: self.config.writingSpeed, })).catch(error => { Logger.log(error); });\n }else{\n // contentStream is a read stream\n\n try{ contentStream.resume(); }catch(error){ Logger.log(error); }\n try{ readStream.resume(); }catch(error){ Logger.log(error); }\n\n await pipelineWithPromise(contentStream, fs.createWriteStream(finalPath, {flags: 'a', highWaterMark: self.config.writingSpeed, })).catch(error => { Logger.log(error); });\n }\n }\n\n if(isReplacing === true){\n try{\n let doesTempFileExists = await self.doesLocalPathExists(finalPath);\n if(doesTempFileExists){\n await pipelineWithPromise(fs.createReadStream(finalPath, { highWaterMark: self.config.readingSpeed, }), fs.createWriteStream(path, { highWaterMark: self.config.writingSpeed, })).catch(error => { Logger.log(error); });\n await self.deleteLocalFile(finalPath);\n }\n }catch(error){ Logger.log(error); return false; }\n }\n\n return true;\n }catch(error){ Logger.log(error); }\n return false;\n }", "static create() {\n\t\tlet name, muts, atoms;\n\n\t\tcl(`Creating new molecule. \"Ctrl+c\" to exit`.gray);\n\n\t\trl.question(`Name » \\n`.green, molName => {\n\t\t\tname = molName;\n\n\t\t\trl.question(`Mutates (space separated)» \\n`.green, molMutate => {\n\t\t\t\tmuts = molMutate.split(' ');\n\n\t\t\t\trl.question(`Atoms » \\n`.green + `predefined:`.white + `${getAtomsList(MAINFILE)}\\n`.gray, molAtoms => {\n\t\t\t\t\tatoms = molAtoms.split(' ');\n\n\t\t\t\t\tvar molecule = new Molecule(name, muts, atoms);\n\n\t\t\t\t\tMolecule.save(molecule);\n\t\t\t\t});\n\t\t\t});\n\t\t});\n\n\t}", "function MyFile(name, size, ed2k){\n\tthis.find_crc = function(text){\n\t\tvar regx = /[\\[\\(]([a-f0-9]{8})[\\]\\)]/i;\n\t\tif(regx.test(text)) return (RegExp.$1).toLowerCase();\n\t\telse return('');\n\t}\n\tthis.find_version = function(text){\n\t\tvar regx = /(\\d)v(\\d)/;\n\t\tif(regx.test(text)) return (RegExp.$2)*1\n\t\telse return(1);\n\t}\n\tthis.find_filetype = function(text){\n\t\tvar regx = /\\.([a-z0-9]{2,5})$/i;\n\t\tif(regx.test(text)) return RegExp.$1.toLowerCase();\n\t}\n\tthis.find_group = function(text){\n\t\tvar regx = /(\\[|\\{)(.+?)(\\]|\\})(\\[|\\(|\\.|_).+$/i;\n\t\tif(regx.test(text)) return (RegExp.$2)\n\t\telse return('');\n\t}\n\tthis.crc = this.find_crc(name);\n\tthis.version = this.find_version(name);\n\tthis.filetype = this.find_filetype(name);\n\tthis.group = this.find_group(name);\n\tthis.size = size;\n}", "static Create(opts, cb) {\n cb(null, new EmscriptenFileSystem(opts.FS));\n }", "createFile() {\n const numberOfRepo = 30;\n const numberOfFollower = 3000;\n\n this.findHireableUsers(numberOfRepo, numberOfFollower, (hireableUsers) => {\n const content = {\n info: {\n followers: numberOfFollower,\n repo: numberOfRepo,\n },\n values: hireableUsers,\n };\n const wstream = fs.createWriteStream('hireableUsers.json');\n wstream.write(JSON.stringify(content, null, 2));\n wstream.end();\n\n const s = new Storage(this.credentials.username, this.credentials.token, 'aliens_client');\n s.publish('docs/data/hireableUsers.json', JSON.stringify(content, null, 2), 'new version of the file');\n });\n }", "function createNewFile() {\n winList.push(createWindow());\n}", "function writeFile(FPath, info, docName) {\n if ( $.os.search(/windows/i) !== -1 ) { // Detect line feed type\n fileLineFeed = \"Windows\";\n }\n else {\n fileLineFeed = \"Macintosh\";\n } \n try {\n var f = new File(FPath + \"/\" + docName + \".txt\");\n f.remove();\n f.open('a');\n f.lineFeed = fileLineFeed;\n f.write(info);\n f.close();\n }\n catch(e){}\n} //end function", "function File(contents, /*optional:*/ parent, name) {\n var file = this;\n\n // Link to the parent file.\n file.p = parent = parent || null;\n\n // The module object for this File, which will eventually boast an\n // .exports property when/if the file is evaluated.\n file.m = {\n // If this file was created with `name`, join it with `parent.m.id`\n // to generate a module identifier.\n id: name ? (parent && parent.m.id || \"\") + \"/\" + name : null\n };\n\n // Queue for tracking required modules with unmet dependencies,\n // inherited from the `parent`.\n file.q = parent && parent.q;\n\n // Each directory has its own bound version of the `require` function\n // that can resolve relative identifiers. Non-directory Files inherit\n // the require function of their parent directories, so we don't have\n // to create a new require function every time we evaluate a module.\n file.r = isObject(contents)\n ? makeRequire(file)\n : parent && parent.r;\n\n // Set the initial value of `file.c` (the \"contents\" of the File).\n fileMergeContents(file, contents);\n\n // When the file is a directory, `file.ready` is an object mapping\n // module identifiers to boolean ready statuses. This information can\n // be shared by all files in the directory, because module resolution\n // always has the same results for all files in a given directory.\n file.ready = fileIsDirectory(file) && {};\n }", "function _createLogFile(typeString) {\n var logFileDir = new Folder(_getDirString());\n if (!logFileDir.exists) {\n logFileDir.create();\n }\n\n var logFileName = typeString + \"_\" + _getDateString().replace(/[:]/g,'-')+ \".log\";\n var logFilePath = _getDirString() + logFileName;\n return new File(logFilePath);\n }", "function makeFile(exportBook){\n xlsx.writeFile(exportBook, __dirname + '/scouting.xlsx');\n}", "static new(callback) {\r\n FileWriterRemote.fileWriter.new(callback);\r\n }", "init() {\n fs.exists(this.filename, (exists) => {\n if (exists) {\n return;\n }\n // fs.appendFile('./url.csv', 'name,size,url\\n', 'utf8', (err) => {\n fs.appendFile('./url.csv', '', 'utf8', (err) => {\n if (err) throw err;\n logger.info('url.csv does not exist,create url.csv success!');\n });\n\n });\n return this;\n }", "createFile(dirname, filename, content, cb) {\n var mkdirp = require('mkdirp');\n //var asq = require(\"async\");\n\n mkdirp(dirname, function(err) {\n if (err) {\n console.error(\"err: \", err);\n if (typeof cb == 'function') {\n return cb(err);\n }\n } else {\n fs.writeFile(dirname + '/' + filename, content, function(err) {\n if (typeof cb == 'function') {\n return cb(err);\n }\n });\n }\n });\n }", "static txt ({ filepath, newFilepath, fileInfo }) {\n const info = '\\n\\nFile Info:\\n' +\n Object.keys(fileInfo)\n .map(k => `${k}: ${fileInfo[k]}`)\n .join('\\n')\n\n return fs.readFile(filepath)\n .then(file => fs.writeFile(newFilepath, file + info))\n }", "function File(stream) {\n this.stream = stream;\n this.closed = false;\n}", "async function makeFilePair(out, name, info) {\n const { comment, upstream, config } = info\n\n // Make normal version:\n out[`${name}.js`] = makeFile({\n comment: `${comment} for Standard.js`,\n upstream,\n config\n })\n\n // Make `lint` version:\n out[`lint/${name}.js`] = makeFile({\n comment: `${comment} for Standard.js (without style rules)`,\n upstream,\n config: filterStyleRules(config)\n })\n\n // Make `prettier` version:\n out[`prettier/${name}.js`] = makeFile({\n comment: `${comment} for Standard.js + Prettier`,\n upstream,\n config: filterStyleRules(config)\n })\n}", "createModelFile() {\n // check if the `users.js` file exists already\n if (!fs.existsSync(`${this.model}/users.js`)) {\n const file = path.join(__dirname, '../files/users.js')\n\n fs.readFile(file, \"utf-8\", (err, data) => {\n if (err) {\n console.log(err);\n return;\n }\n\n // write `userrs.js` file\n fs.writeFile(`${this.model}/users.js`, data, (err) => {\n if (err) {\n console.log('Error creating users.js file');\n return;\n }\n\n console.log(\"Successfully created users.js\");\n });\n });\n\n return;\n }\n\n console.log(`users.js already exists`);\n }", "function makeJobFile(config) {\n var job = {\"espruino\":{}};\n // assign commandline values\n for (var key in args) {\n switch (key) {\n case 'job': // remove job itself, and others set internally from the results\n case 'espruinoPrefix':\n case 'espruinoPostfix':\n break;\n default: job[key] = args[key]; // otherwise just output each key: value\n }\n // write fields of Espruino.Config passed as config\n for (var k in config) { if (typeof config[k]!=='function') job.espruino[k] = config[k]; };\n }\n // name job file same as code file with json ending or default and save.\n var jobFile = isNextValidJS(args.file) ? args.file.slice(0,args.file.lastIndexOf('.'))+'.json' : \"job.json\";\n\n if (!fs.existsSync(jobFile)) {\n log(\"Creating job file \"+JSON.stringify(jobFile));\n fs.writeFileSync(jobFile,JSON.stringify(job,null,2),{encoding:\"utf8\"});\n } else\n log(\"WARNING: File \"+JSON.stringify(jobFile)+\" already exists - not overwriting.\");\n}", "static fromDataTransferFile (dtFile) {\n return new File(dtFile.name, dtFile.path, dtFile.size,\n dtFile.lastModified, dtFile.lastModifiedDate)\n }", "constructor(formType) {\n this.buf = new Buffer(0);\n // file headder\n this._pushId('RIFF'); // magic\n this._pushUInt32(4); // size\n this._pushId(formType); // file type\n }", "function createFile(path) {\n if(!fs.existsSync(path)){\n log('creating file to :::', path);\n return fs.writeFileSync('./1-json.json', jsonBook);\n } \n else log('The file already exists');\n}", "function OutFile() {\r\n}", "createControllerFile() {\n // check if `auth.js` exists already in the controllers folder\n if (!fs.existsSync(`${this.controller}/auth.js`)) {\n const file = path.join(__dirname, '../files/auth.js');\n\n fs.readFile(file, \"utf-8\", (err, data) => {\n if (err) {\n console.log(err);\n return;\n }\n\n // write `auth.js` file\n fs.writeFile(`${this.controller}/auth.js`, data, (err) => {\n if (err) {\n console.log('Error creating auth.js file');\n return;\n }\n\n console.log(\"Successfully created auth.js\");\n });\n });\n\n return;\n }\n\n console.log(`auth.js already exists`);\n }", "function createConfig(p, c) {\n fs.writeFileSync(p, c, (err) => {\n if (err) {\n print(err);\n }\n print(\"The file was saved!\");\n });\n}", "static initialize(obj, file) {\n obj['file'] = file;\n }", "function File(filename,path){\n\tvar that=this;\n\tthis.filename = filename;\n\tthis.path = path;\n\tthis.created = Date.now();\n\tthis.last_run = null;\n\tthis.run_count = 0;\n\tfs.stat(path, function(err, stat) {\n\t\tif(err) {\n\t\t\tthrow err;\n\t\t}\n\t\tthat.size = stat.size;\n\t});\n\tfs.readFile(this.path, function (err, data) {\n\t\tthis.checksum = File.checksum(data);\n\t}.bind(this));\n}", "function recreateStoriesFile() {\r\n // deletes old file\r\n fs.unlink('stories.txt', function(err) {\r\n if (err) throw err;\r\n console.log('File successfully deleted!');\r\n });\r\n // iterate through hashtable with for each loop\r\n // where for each title (key) in the hashtable, we \r\n // add both the title and story (value) into a new file.\r\n for (let title of stories.keys()) {\r\n let story = stories.get(title);\r\n // the appendFile() method will create a new stories.txt file since the previous one was deleted.\r\n fs.appendFile('stories.txt', '\\n' + title + '\\n' + splitConstant + '\\n' + story + '\\n' + splitConstant, function(err) {\r\n if (err) {\r\n return console.error(err);\r\n }\r\n });\r\n }\r\n\r\n console.log('stories.txt file recreated!');\r\n}", "function createFile(path, fileName) {\n if (!isExists(path, fileName)) {\n aqFile.Create(path + fileName); \n }\n}", "function createElementFileFromTemplate(outputPath, context, name) {\n createFileFromTemplate(outputPath, context, figureElementPath(name))\n}", "function getNewFilePath() {\n //choose a name\n var fileName = getCurrentDateTime() + \".txt\";\n \n if (!folderLocation) {\n folderLocation = os.tmpdir();\n folderLocation = path.join(folderLocation, 'vslogcat');\n }\n\n var filePath = path.join(folderLocation, fileName);\n console.log(\"File path is \" + filePath);\n return filePath;\n\n}", "function createFiles(filename){\n // Date/Time in UTC\n var csvWriter = createCsvWriter({\n path: filename+'.csv',\n header: [\n {id: 'time', title: 'Time UTC (H/M/S)'},\n {id: 'temperature', title: 'Temperature'},\n {id: 'pressure', title: 'Pressure'},\n {id: 'altitude', title: 'Altitude'},\n {id: 'humidity', title: 'Humidity'},\n {id: 'magX', title: 'MagnetometerX'},\n {id: 'magY', title: 'MagnetometerY'},\n {id: 'magZ', title: 'MagnetometerZ'}\n ]\n });\n\n return csvWriter;\n}", "function addFile() {\n document.getElementById(\"chronovisor-converter-container\").appendChild(fileTemplate.cloneNode(true));\n maps.push(null);\n files.push(null);\n data.push(null);\n og_data.push(null);\n }", "createFile(user, repo, branch, path, content, accessToken) {\n debug(`${user}/${repo}: Creating file ${path} on branch ${branch}`)\n const url = API_URL_TEMPLATES.REPO_CONTENT\n .replace('${owner}', user)\n .replace('${repo}', repo) + `${path}`\n const message = `Create ${path}`\n const encodedContent = encode(content)\n return this.fetchPath('PUT', url, {message, branch, content: encodedContent}, accessToken)\n }", "function initEntryFile(){\n\n\tvar entries = [];\n\tfor(var i=0;i<2;i++){\n\t\tentries.push(gener.randomEntry());\n\t}\n\tvar data = { \"entries\": entries, \"tags\": [] };\n\tfs.writeFile('./SampleEntries.js', JSON.stringify(data, null, 2), function(err){ if(err){ console.log(\"Harness initEntryFile encountered err while writing.\");} });\n}", "function createFileWriter(fileEntry, callbackFunction) {\n\tfileEntry.createWriter(callbackFunction, fail);\n}", "function writeFile(fileObj, fileContent, encoding) {\n //var csvContent = 'data:text/csv;charset=utf-8,%EF%BB%BF'\n encoding = encoding || \"UTF-8\";\n var titleRow = [csvQuotes(\"Path\"),csvQuotes(\"Modified\"),csvQuotes(\"Office\"),csvQuotes(\"Project Name\"),csvQuotes(\"Project Number\"),csvQuotes(\"Location\"),csvQuotes(\"Practice Area\"),csvQuotes(\"Construction Type\"),csvQuotes(\"Size\"),csvQuotes(\"Estimated Cost\"),csvQuotes(\"Estimated Completion\"),csvQuotes(\"Sustainability\"),csvQuotes(\"Project Description\"),csvQuotes(\"Team\")];\n if (!fileObj.exists) fileContent2 = titleRow.toString() + \"\\n\" + fileContent;\n else fileContent2 = fileContent;\n \n fileObj = (fileObj instanceof File) ? fileObj : new File(fileObj); \n \n var parentFolder = fileObj.parent;\n if (!parentFolder.exists && !parentFolder.create()) \n throw new Error(\"Cannot create file in path \" + fileObj.fsName); \n \n fileObj.encoding = encoding; \n fileObj.open(\"a\"); \n fileObj.write(fileContent2); \n fileObj.close();\n \n return fileObj; \n}", "function makeTextFile(text) {\r\n var data = new Blob([text], { type: 'text/plain' });\r\n\r\n textFile = window.URL.createObjectURL(data);\r\n\r\n return textFile;\r\n}", "function File(moduleId, parent) {\n var file = this; // Link to the parent file.\n\n file.parent = parent = parent || null; // The module object for this File, which will eventually boast an\n // .exports property when/if the file is evaluated.\n\n file.module = new Module(moduleId);\n filesByModuleId[moduleId] = file; // The .contents of the file can be either (1) an object, if the file\n // represents a directory containing other files; (2) a factory\n // function, if the file represents a module that can be imported; (3)\n // a string, if the file is an alias for another file; or (4) null, if\n // the file's contents are not (yet) available.\n\n file.contents = null; // Set of module identifiers imported by this module. Note that this\n // set is not necessarily complete, so don't rely on it unless you\n // know what you're doing.\n\n file.deps = {};\n }", "function createObject(metadata) {\n\t return request.post(config.base + '/api/1/files/create_object/').set('Authorization', 'Token ' + config.token).send(metadata).then(processResponse);\n\t}", "function writeToFile(filetype, data) {\n fs.writeFile(filetype, data, (err) =>\n err ? console.log(err) : console.log('Created your README!')\n )\n}", "function writefile(){\n\t\t\tvar txtFile = \"c:/test.txt\";\n\t\t\tvar file = new File([\"\"],txtFile);\n\t\t\tvar str = \"My string of text\";\n\n\t\t\tfile.open(\"w\"); // open file with write access\n\t\t\tfile.writeln(\"First line of text\");\n\t\t\tfile.writeln(\"Second line of text \" + str);\n\t\t\tfile.write(str);\n\t\t\tfile.close();\n\t\t}", "constructor(dir, mainFileName) {\n this.dir = DIR + \"/\" + dir;\n this.file = mainFileName;\n }", "function FileHelper()\n{\n}", "get file() {\r\n return new File(this, \"file\");\r\n }", "function writeToFile(fileName, data) {\n\n fs.appendFile(\n fileName, \n generateMarkdown(data) ,\n function(err) {\n if(err) {\n return console.log(err);\n }\n \n console.log(\"Your README file is created successfully!\");\n })\n\n fs.appendFile(\n fileName, \n generateLicense(data) ,\n function(err) {\n if(err) {\n return console.log(err);\n }\n \n console.log(\"Your README file is created successfully!\");\n })\n\n \n\n \n}", "function createFile(params){\n if(checkFormat()){\n var filename = params[0].substr(0,60);\n var fileFound = false;\n var reachedEnd = false;\n var i = \"001\";\n while(!reachedEnd){\n if(sessionStorage.getItem(i)[0] === \"1\"){\n if (filename === sessionStorage.getItem(i).split(\"|\")[1].split(\"~\")[0]){\n fileFound = true;\n reachedEnd = true;\n }\n i = stringFormatAndInc(i);\n }\n else{\n reachedEnd = true;\n }\n }\n if(!fileFound){\n var dirSection = sessionStorage.getItem(MBR).substring(4,7);\n //var newDirSection = stringFormatAndInc(dirSection);\n \n var currentFileSection = sessionStorage.getItem(MBR).substring(8,11);\n //var newFileSection = stringFormatAndInc(currentFileSection);\n\n //regex to replace the amount of characters that filename will take up\n var re = new RegExp(\"^.{\"+filename.length+\"}\")\n var replacedData = sessionStorage.getItem(dirSection).substring(5).replace(re,filename);\n sessionStorage.setItem(currentFileSection,\"1---\"+FILE_DIVIDER+FILE_FILLER);\n sessionStorage.setItem(dirSection,\"1\"+currentFileSection+FILE_DIVIDER+replacedData);\n updateMBR();\n //sessionStorage.setItem(MBR,sessionStorage.getItem(MBR).replace(dirSection,newDirSection).replace(currentFileSection,newFileSection));\n \n \n _StdIn.putText(\"File Created!\");\n _StdIn.advanceLine();\n _OsShell.putPrompt();\n }\n else{\n if(params[3]){//FROM OS\n\n }else{\n _StdIn.putText(\"File Has Already Been Created!\");\n _StdIn.advanceLine();\n _OsShell.putPrompt();\n }\n }\n /*\n var data = params[1];\n var sections = Math.ceil(data.length/60);\n var dataSections = [];\n dataSections = data.match(/.{1,60}/g) || [];\n\n\n while(sections>0){\n if(sections === 1){\n fileSection = sessionStorage.getItem(MBR).substring(8,11);\n newSection = stringFormatAndInc(fileSection);\n sessionStorage.setItem(fileSection,\"1---|\"+data);\n sessionStorage.setItem(MBR,sessionStorage.getItem(MBR).replace(fileSection,newFileSection));\n }\n else{\n fileSection = sessionStorage.getItem(MBR).substring(8,11);\n newFileSection = stringFormatAndInc(fileSection);\n sessionStorage.setItem(fileSection,\"1\"+newFileSection+FILE_DIVIDER+data);\n sessionStorage.setItem(MBR,sessionStorage.getItem(MBR).replace(fileSection,newFileSection));\n }\n sections--;\n }*/\n\n /*for (var i=0; i<MAX_DIR_TRACK_LEN; i++) {\n for (var j=1; j<=MAX_BLOCK_LEN; j++) {\n if(j<=9){\n if(sessionStorage[\"00\"+j].substring(0,1)===\"0\"){\n sessionStorage[\"00\"+j] = \n }\n }\n else{\n if(sessionStorage[\"0\"+j].substring(0,1)===\"0\"){\n sessionStorage[\"0\"+j] = \n }\n }\n }\n }*/\n }\n}", "function createTextFile(fn, txt, server) {\n if (getTextFile(fn, server) !== null) {\n console.log(\"ERROR: createTextFile failed because the specified \" +\n \"server already has a text file with the same fn\");\n return;\n }\n var file = new TextFile(fn, txt);\n server.textFiles.push(file);\n return file;\n}" ]
[ "0.6731722", "0.6548481", "0.6368479", "0.6176685", "0.6128395", "0.6071327", "0.6071191", "0.60540265", "0.6018432", "0.60004294", "0.59618294", "0.5958048", "0.59438944", "0.58876985", "0.58862257", "0.58563334", "0.5832691", "0.5804447", "0.5785801", "0.5777083", "0.5753715", "0.57528746", "0.5689517", "0.56713563", "0.56579727", "0.56279767", "0.561877", "0.5583071", "0.55560094", "0.55377513", "0.5533128", "0.55045456", "0.55031997", "0.5481344", "0.5481344", "0.547476", "0.5473938", "0.5441338", "0.54407686", "0.54389256", "0.5435067", "0.54227215", "0.5279795", "0.52796954", "0.52794576", "0.5263583", "0.5244195", "0.5242404", "0.5224737", "0.519948", "0.51963526", "0.5182849", "0.51710916", "0.5166733", "0.51643443", "0.5160451", "0.5159072", "0.5151821", "0.51512074", "0.5146473", "0.5141269", "0.514083", "0.5132932", "0.5121691", "0.5114968", "0.51106495", "0.5108895", "0.50743014", "0.5065984", "0.5063075", "0.50441223", "0.5042104", "0.5034", "0.5032493", "0.50221163", "0.5016612", "0.5014225", "0.50140506", "0.5013238", "0.50105387", "0.5008794", "0.50069267", "0.50063527", "0.5006108", "0.49925038", "0.49902987", "0.49851787", "0.4981303", "0.4975476", "0.49694368", "0.49634168", "0.49582437", "0.4954537", "0.4948143", "0.49480313", "0.4938111", "0.4937929", "0.49344793", "0.49336058", "0.49329793", "0.49321777" ]
0.0
-1
Get the value of the file.
function toString(encoding) { var value = this.contents || ''; return buffer(value) ? value.toString(encoding) : String(value); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getFile(){\n\n\t\treturn this.file;\n\t}", "Get(filename)\n {\n return \"\";\n }", "getText() {\r\n return this.clone(File, \"$value\", false).get(new TextParser(), { headers: { \"binaryStringResponseBody\": \"true\" } });\r\n }", "get file () {\n return this._file\n }", "function _valuefile(__dirname) {\n return path.join(__dirname, 'value');\n}", "get file() {\r\n return new File(this, \"file\");\r\n }", "get file() {\n return this.args.file;\n }", "function _getDataFromFile(){\n\tvar fileData = _openFIle();\n\treturn fileData;\n}", "get() {\n return this.filePointer.get();\n }", "get() {\n return this.filePointer.get();\n }", "function get(path) {\n return files[toKey(path)];\n }", "function getFileURL() {\n return urlVars['file'];\n}", "read() {\n return fs.readFileSync(this.filepath).toString();\n }", "read(file) {\n return this[FILES][file] || null;\n }", "getContents() {\n return _fs.default.readFileSync(this.filePath, \"utf8\");\n }", "async getFile() {\n return await jsonStorage.getItem(plantPath).then(item => {\n return item;\n\n }).catch(() => {\n return null;\n });\n }", "function valueOf() {\n return this.files\n}", "get value() {}", "get value() {}", "GetPath() {return this.filePath;}", "getBlob() {\r\n return this.clone(File, \"$value\", false).get(new BlobParser(), { headers: { \"binaryStringResponseBody\": \"true\" } });\r\n }", "async function getFile(id) {\n var file = await db.readDataPromise('file', { id: id })\n return file[0];\n}", "getJSON() {\r\n return this.clone(File, \"$value\", false).get(new JSONParser(), { headers: { \"binaryStringResponseBody\": \"true\" } });\r\n }", "getFile(filePath) {\n return this.getFileInfo(filePath)?.file\n }", "function getValue(location){\n if (location === null){\n return null;\n }\n if (location[0] === 'F'){\n var idx = parseInt(location.substring(1));\n return (fpRegFile[idx] || 0);\n }\n if (location[0] === '$'){\n var idx = parseInt(location.substring(1));\n \n var v = (intRegFile[idx] || 0);\n return v;\n }\n if (location[0] === '#'){\n return parseInt(location.substring(1));\n }\n var parsedInput = location.match(/(\\d*)\\(\\$(\\d+)\\)/);\n if (parsedInput){\n index = parseInt(intRegFile[parsedInput[2]]);\n offset = parseInt(parsedInput[1]);\n return (parseInt(dataMem[index+offset]) || 0);\n }\n \n throw new Error(\"Could not obtain a value from \\\"\" + location +\n \"\\\". Check that is is formatted correctly (see README)\");\n}", "getFileName() {\n return this.filename;\n }", "function getValue(location){\n if (location === null){\n return null;\n }\n if (location[0] === 'F'){\n var idx = parseInt(location.substring(1));\n return (fpRegFile[idx] || 0);\n }\n if (location[0] === '$'){\n var idx = parseInt(location.substring(1));\n \n var v = (intRegFile[idx] || 0);\n return v;\n }\n if (location[0] === '#'){\n return parseInt(location.substring(1));\n }\n var parsedInput = location.match(/(\\d*)\\(\\$(\\d)\\)/);\n if (parsedInput){\n index = parseInt(intRegFile[parsedInput[2]]);\n offset = parseInt(parsedInput[1]);\n return (parseInt(dataMem[index+offset]) || 0);\n }\n \n throw (\"Could not obtain a value from \\\"\" + location +\n \"\\\". Check that is is formatted correctly (see README)\");\n}", "file () {\n try {\n const file = this.currentFile()\n\n if (!file) throw createError({ code: 'ENOENT', message: 'No file selected' })\n return file\n } catch (e) {\n throw new Error(e)\n }\n }", "function _get(key){\n\tvar ret = null;\n\n\n\t// Pull from cache or re-read from fs.\n\t//console.log('key: ' + key)\n\t//console.log('use_zcache_p: ' + use_zcache_p)\n\tif( use_zcache_p ){\n\t ret = zcache[key];\n\t\t// console.log('_get CACHED: ', key, ret.slice(0, 10));\n\t}else{\n\t ret = afs.read_file(path_cache[key]);\n\t\t// console.log('_get FILE: ', key, path_cache[key], ' Length: ', ret.length);\n\t}\n\n\treturn ret;\n }", "read() {\n this.assertNotDisposed();\n return this.val;\n }", "function GetOutputValue(/**string*/ key, /**string*/ defValue)\r\n{\r\n\treturn Global.GetProperty(key, defValue, \"%WORKDIR%\\\\Output.xlsx\");\r\n}", "function GetOutputValue(/**string*/ key, /**string*/ defValue)\r\n{\r\n\treturn Global.GetProperty(key, defValue, \"%WORKDIR%\\\\Output.xlsx\");\r\n}", "function getContents(file) {\n\t// Ensure that the file's name is not null.\n\tif(file === null) {\n\t\tself.fail(\"The File object is null.\");\n\t}\n\tif(! file.exists()) {\n\t\tself.fail(\"The file does not exist: \" + file);\n\t}\n\t\n\tvar fileReader;\n\ttry {\n\t\tfileReader = new FileReader(file);\n\t}\n\tcatch(e) {\n\t\tself.fail(\"Could not open the file: \" + e);\n\t\treturn;\n\t}\n\t\n\treturn new String(FileUtils.readFully(fileReader));\n}", "set file(value) { this._file = value; }", "getBuffer() {\r\n return this.clone(File, \"$value\", false).get(new BufferParser(), { headers: { \"binaryStringResponseBody\": \"true\" } });\r\n }", "get() { // get() es como voy a formatear el valor\n return `http://localhost:8001/files/${this.path}`;\n }", "async getFile() {\n let responseData = 'nothing happend';\n try {\n const fileData = await readFile(this.path);\n responseData = fileData.toString('utf8');\n } catch (e) {\n try {\n const dirData = await readdir(this.path);\n responseData = dirData;\n } catch (err) {\n responseData = `no such file found in ${this.path}`;\n }\n } finally {\n return responseData;\n }\n }", "function getFileContents(filename){\r\n\t\r\n\tvar contents;\r\n\tcontents = fs.readFileSync(filename);\r\n\treturn contents;\r\n}", "function getTextFile(theFilename){\n return new Promise($.async(function (resolve, reject) {\n try {\n $.fs.readFile(theFilename, 'utf8', function (err, theContent) {\n if (err) {\n resolve(\"\")\n } else {\n resolve(theContent);\n }\n });\n }\n catch (error) {\n resolve(\"\")\n }\n \n }));\n}", "value() {\n return this.buffer;\n }", "function ReadFile(path)\n{\n\treturn _fs.readFileSync(path, \"utf8\").toString();\n}", "async getFileInfo() {\n return this.fileInfo;\n }", "static io_getfile(filename, fcn) {\n if (window.Settings.enableLog)\n WebUtils.log(\"Web.io_getfile({0})\".format(filename));\n Database.getfile(filename, fcn);\n }", "function get() {\n // 'touch' file\n fs.openSync(fileName, 'a+', (err, fd) => {\n err ? console.log(err) : fs.close(fd);\n });\n const rawData = fs.readFileSync(fileName).toString();\n return JSON.parse(rawData);\n}", "getFile(filePath, options) {\n console.log('api.getFile: ', filePath);\n return this.sendRequest({\n type: 'loadFile',\n filePath: filePath,\n options: options\n })\n .then(function(fileInfo) {\n return {\n filePath: filePath,\n contents: fileInfo.payload.contents\n }\n })\n .catch(function(errorInfo) {\n return undefined;\n });\n }", "function getSampleFileContent(){\n var output = ''\n\n fs.readFile('Sample.txt', 'utf8', function(err, data){\n if(err){ //if there are any error\n \n output = err;\n //console.log('error block');\n console.log(err);\n }\n else{\n \n output = data;\n console.log('data block');\n console.log(data)\n }\n console.log('File read completed...')\n return output;\n })\n }", "function get_file (file){\n return path.resolve(temp_dir + '/' + file);\n }", "function get(path) {\n return String(xml.get(path))\n}", "function filesisip_getVal(){\n\n var batas = document.getElementById(\"tot_file\");\n var totBatas = batas.options[batas.selectedIndex].value;\n\n return totBatas;\n}", "getFileData(filePath) {\n let data = null;\n const dataFilePath = path.join(path.dirname(this._uri.fsPath), filePath);\n if (fs.existsSync(dataFilePath)) {\n data = fs.readFileSync(dataFilePath, 'utf8');\n }\n else {\n this._logger.logMessage(logger_1.LogLevel.Error, 'getFileData():', `${filePath} doesn't exist`);\n }\n return data;\n }", "getFile(response) {\n return paths.getJSONFile(this.path, response);\n }", "function readFile (fullpath){\n\tvar result=\"\";\n\t$.ajax({\n\t\turl: fullpath,\n\t\tasync: false,\n\t\tdataType: \"text\",\n\t\tsuccess: function (data) {\n\t\t\tresult = data;\n\t\t}\n\t});\n\treturn result;\n}", "function readTextFile(address_of_cell)\r\n{\r\nif(typeof require !== 'undefined') XLSX = require('xlsx');\r\nvar workbook = XLSX.readFile('users.xlsx');\r\nvar first_sheet_name = workbook.SheetNames[0];\r\nvar worksheet = workbook.Sheets[first_sheet_name];\r\nvar desired_cell = worksheet[address_of_cell];\r\nvar desired_value = desired_cell.v;\r\nreturn desired_value;\r\n}", "read() {\n return JSON.parse(\n new File(this.path).read()\n );\n }", "function file(tr) {\r\n\t\tif (!tr) tr = mTbB.find(\"tr.selected:first\");\r\n\t\treturn getPath().contents[$(tr).attr(\"id\")];\r\n\t}", "function read_file(path_to_file){\n var data = fs.readFileSync(path_to_file).toString();\n return data;\n}", "value() {\n return this.buffer.slice(0, this.size);\n }", "async getb6(file) {\n return await (new Response(file)).text();\n }", "get() {\n const value = this.properties[name].get_value();\n return value;\n }", "async ReadAsset(ctx, key) {\n const value = await ctx.stub.getState(key); // get the asset from chaincode state\n if (!value) {\n throw new Error(`The asset ${key} does not exist`);\n }\n return value;\n }", "static async getFile(context, path) {\n const filePath = EncodeUtil_1.EncodeUtil.decodeUrlPart(context.repositoryPath + path_1.sep + path);\n try {\n await util_1.promisify(fs_1.access)(filePath, constants_1.F_OK);\n }\n catch (err) {\n return null;\n }\n const file = await util_1.promisify(fs_1.stat)(filePath);\n // This code blocks vulnerability when \"%20\" folder can be injected into path and file.Exists returns 'true'.\n if (!file.isFile()) {\n return null;\n }\n const davFile = new DavFile(filePath, context, path, file);\n if (await ExtendedAttributesExtension_1.ExtendedAttributesExtension.hasExtendedAttribute(davFile.fullPath, \"SerialNumber\")) {\n davFile.serialNumber = Number(await ExtendedAttributesExtension_1.ExtendedAttributesExtension.getExtendedAttribute(davFile.fullPath, \"SerialNumber\"));\n }\n if (await ExtendedAttributesExtension_1.ExtendedAttributesExtension.hasExtendedAttribute(davFile.fullPath, \"TotalContentLength\")) {\n davFile.totalContentLength = Number(await ExtendedAttributesExtension_1.ExtendedAttributesExtension.getExtendedAttribute(davFile.fullPath, \"TotalContentLength\"));\n }\n return davFile;\n }", "function getConfigValue(file, key) {\r\n try {\r\n var defaultvars = {\r\n maxqueue: 4,\r\n maxarray: 1023,\r\n maxrunning: 3,\r\n toursignup: 200,\r\n tourdq: 180,\r\n subtime: 90,\r\n touractivity: 200,\r\n breaktime: 120,\r\n absbreaktime: 600,\r\n remindertime: 30,\r\n channel: \"Tournaments\",\r\n errchannel: \"Developer's Den\",\r\n tourbotcolour: \"#3DAA68\",\r\n minpercent: 5,\r\n minplayers: 3,\r\n decayrate: 10,\r\n decaytime: 2,\r\n norepeat: 7,\r\n decayglobalrate: 2,\r\n tourbot: \"\\u00B1\"+Config.tourneybot+\": \",\r\n debug: false,\r\n points: true,\r\n winmessages: true\r\n };\r\n var configkeys = sys.getValKeys(configDir+file);\r\n if (configkeys.indexOf(key) == -1) {\r\n sendChanAll(\"No tour config data detected for '\"+key+\"', getting default value\", tourschan);\r\n if (defaultvars.hasOwnProperty(key))\r\n return defaultvars[key];\r\n else\r\n throw \"Couldn't find the key!\";\r\n }\r\n else {\r\n return sys.getVal(configDir+file, key);\r\n }\r\n }\r\n catch (err) {\r\n sendChanAll(\"Error in getting config value '\"+key+\"': \"+err, tourserrchan);\r\n return null;\r\n }\r\n}", "fileString() {\n return this.id + \" \" + this.type + \" \" + this.note + \" \" + this.amount;\n }", "async readFile(fileName) {\n const bytes = await this.idb.get(fileName, this.store);\n return bytes;\n }", "function getFilePath() {\n $('input[type=file]').change(function () {\n var filePath = $('#fileUpload').val();\n });\n}", "function getFile(fileName) {\n return fs.readFileSync(path.resolve(__dirname, fileName), \"utf-8\");\n}", "function getFile (file) {\n fakeAjax(file, function (text) {\n fileReceived(file, text)\n })\n}", "function getValuesFromFile(fileName, callbackFn) {\n\t\tfileName = fileName || 'data/images.json';\n\t\thttp.get(fileName).success(function (dataObj) {\n\t\t\tif (dataObj instanceof Array) {\n\t\t\t\tif (dataObj.length > 0) {\n\t\t\t\t\tconsole.log(\"FILE RETRIEVED : \", dataObj.length);\n\t\t\t\t\tcallbackFn(dataObj);\n\t\t\t\t}\n\t\t\t}\n\t\t}).error(function (err) {\n\t\t\tconsole.log(\"ERROR >> \", err);\n\t\t});\n\t}", "function get() {\n return _value;\n }", "async read(filepath) {\n try {\n return await this.reader(filepath, 'utf-8');\n } catch (error) {\n return undefined;\n }\n }", "value() {\n return this.buffer;\n }", "value() {\n return this.buffer;\n }", "value() {\n return this.buffer;\n }", "value() {\n return this.buffer;\n }", "readFromFile(fileName) {\n const fs = require(\"fs\");\n try {\n const data = fs.readFileSync(\"uploads/\" + fileName, \"utf8\");\n console.log(data);\n return data;\n } catch (err) {\n console.error(err);\n }\n }", "get fileName() {\n return this._fileName;\n }", "function getGoogleDriveFile() {\n console.log('checking if google drive file exists');\n console.log(\"readin files\");\n access_token = gapi.auth2.getAuthInstance().currentUser.get().getAuthResponse().access_token;\n\n console.log(fileId); //fileId = null;//temporary \n // If fileId is null then call list files to get file id by title\n if (fileId === null) {\n // If fileId is not set then get fileId first\n setFileID().done(function () {\n console.log(\"function returned file id setting\");\n // For first time fileId will be null so no need to read url if file id is null\n if (fileId !== null) {\n getGoogleDriveURL();\n }\n });\n } else {\n // If already fileId is set then get URL\n getGoogleDriveURL();\n }\n }", "GetValue()\n\t{\n\t\treturn this.value;\n\t}", "function readUploadedFile(){\n\tvar uploadedFile = document.getElementById(\"uploadFile\");\n}", "get cahceFile() {\n return Url.join(CACHE_STORAGE, this.#id);\n }", "get(fileID) {\n return this.ready.then(db => {\n const transaction = db.transaction([STORE_NAME], 'readonly');\n const request = transaction.objectStore(STORE_NAME).get(this.key(fileID));\n return waitForRequest(request);\n }).then(result => ({\n id: result.data.fileID,\n data: result.data.data\n }));\n }", "fileCall(path) {\n var fileStream = require('fs');\n var f = fileStream.readFileSync(path, 'utf8');\n return f;\n // var arr= f.split('');\n // return arr;\n }", "function getFile(file) {\n fakeAjax(file, function (text) {\n fileReceived(file, text);\n });\n }", "function GetFileBody(file) {\n\treturn fs.readFileSync(InputDir + file).toString('utf-8');\n}", "getValue() {\n return this.node.value;\n }", "async function getFile(fileId) {\n return await $.ajax({\n url: domain + \"/file/\" + encodeURIComponent(fileId),\n method: \"GET\",\n });\n }", "function get_file(fid) {\n var phpCmd = \"\";\n var response = \"still_no_answer\";\n if ( fid == 'config' ) {\n phpCmd = 'read_config_file';\n }\n else {\n return null;\n }\n var myREQ = new XMLHttpRequest();\n myREQ.open(method=\"GET\", url=\"php/functions.php?command=\" + phpCmd, async=false);\n myREQ.send();\n return (myREQ.responseText);\n}", "function getCurrentAudioFileId()\n{\n return parseInt(currentAudioFile.getAttribute('data-id'));\n}", "_reading(path) {\n\t\tconst readResult = new Promise((resolve, reject) => {\n\t\t\tfs.stat(path, (error, file) => {\n\t\t\t\tresolve(file);\n\t\t\t\treject(error);\n\t\t\t});\n\t\t});\n\t\treturn readResult;\n\t}", "function read_file(name){\n const fs = require('fs');\n if(!fs.existsSync(name))\n return(undefined);\n try {\n const data = fs.readFileSync(name, 'utf8')\n return(data);\n } catch (err) {\n console.error(err);\n return(undefined);\n }\n}", "get filePath() {\n return this.doc.path;\n }", "async function getFileContent(filePath) {\n return (await filePath) ? readFile(filePath) : null;\n}", "_getValue() {\n return this._value;\n }", "function fileContents (filePath, file) {\n return file.contents.toString('utf8');\n}", "readFile(mfs, file) {\n try {\n return mfs.readFileSync(path.join(this.confClient.output.path, file), \"utf-8\")\n } catch (error) {}\n }", "function fileContents(filePath, file) {\n return file.contents.toString('utf8');\n}", "getValue() {\n return this.value;\n }", "function getFile(url){\n var req = request.get(url, function(err, res){\n if (err) throw err;\n console.log('Response ok:', res.ok);\n console.log('Response text:', res.text);\n return res.text;\n });\n}", "getData(){\n return fetch('../status_file.txt')\n .then((response) => {\n // console.log(response);\n return response.text();\n })\n }", "function getValue(params) {\n const { path, key, ipcEvent, options } = { path: './', key: '', ipcEvent: null, options: {}, ...params };\n const db = getOpenedDB(path, ipcEvent);\n if (!db) {\n return;\n }\n db.get(key, options, function(err, value) {\n if (err) {\n if (err.notFound) {\n if (ipcEvent) {\n ipcEvent.returnValue = {\n status: 'failed',\n message: `${key} is not in ${path}`\n };\n }\n return;\n }\n _handleError(err, ipcEvent);\n return;\n }\n\n if (ipcEvent) {\n ipcEvent.returnValue = {\n status: 'success',\n value\n };\n } else {\n console.log(`${path} -> ${key}: ${value}`);\n }\n });\n}", "getValue()\n {\n return this.value;\n }" ]
[ "0.711178", "0.68999565", "0.6691765", "0.66412055", "0.6439003", "0.64349145", "0.6405714", "0.637939", "0.6368529", "0.6368529", "0.6324943", "0.6303016", "0.6242697", "0.60756075", "0.59203756", "0.58928937", "0.58921486", "0.5867203", "0.5867203", "0.5792994", "0.5783152", "0.57761586", "0.5751999", "0.57385087", "0.5694448", "0.5688512", "0.5670347", "0.565412", "0.5556546", "0.5543148", "0.5527035", "0.5527035", "0.5514399", "0.5513336", "0.5492583", "0.54895693", "0.54887235", "0.5488215", "0.54817283", "0.54573584", "0.5454413", "0.54486895", "0.54407805", "0.5436563", "0.54363346", "0.5376923", "0.53757405", "0.5362463", "0.5351611", "0.53488845", "0.53450817", "0.5343603", "0.53318477", "0.53291124", "0.532369", "0.5304099", "0.5298691", "0.5297707", "0.5294776", "0.52915573", "0.52904683", "0.52898616", "0.52828", "0.5281878", "0.5276761", "0.5269233", "0.5265732", "0.525857", "0.5251226", "0.523737", "0.52340025", "0.52340025", "0.52340025", "0.52340025", "0.5232979", "0.52325886", "0.52270925", "0.52226746", "0.5212328", "0.5206766", "0.5191702", "0.51877457", "0.51808065", "0.5180243", "0.5178614", "0.5177167", "0.5176838", "0.5176135", "0.51749384", "0.51746494", "0.5172907", "0.5171608", "0.51705647", "0.51702523", "0.51517063", "0.5144347", "0.5140767", "0.51405805", "0.5138275", "0.5134133", "0.5115784" ]
0.0
-1
Assert that `part` is not a path (i.e., does not contain `path.sep`).
function assertPart(part, name) { if (part.indexOf(path.sep) !== -1) { throw new Error('`' + name + '` cannot be a path: did not expect `' + path.sep + '`'); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function assertPart(part, name) {\n if (part.indexOf(path.sep) !== -1) {\n throw new Error(\n '`' + name + '` cannot be a path: did not expect `' + path.sep + '`'\n )\n }\n}", "function assertPart(part, name) {\n if (part.indexOf(path.sep) !== -1) {\n throw new Error(\n '`' + name + '` cannot be a path: did not expect `' + path.sep + '`'\n );\n }\n}", "function assertPart(part, name) {\n if (part && part.indexOf(p.sep) > -1) {\n throw new Error(\n '`' + name + '` cannot be a path: did not expect `' + p.sep + '`'\n )\n }\n}", "function assertPart(part, name) {\n if (part && part.indexOf(p.sep) > -1) {\n throw new Error(\n '`' + name + '` cannot be a path: did not expect `' + p.sep + '`'\n )\n }\n}", "function assertPart(part, name) {\n if (part && part.indexOf(p.sep) > -1) {\n throw new Error(\n '`' + name + '` cannot be a path: did not expect `' + p.sep + '`'\n )\n }\n}", "function assertPart$1(part, name) {\n if (part && part.indexOf(p$1.sep) > -1) {\n throw new Error(\n '`' + name + '` cannot be a path: did not expect `' + p$1.sep + '`'\n )\n }\n}", "function assertNonEmpty(part, name) {\n if (!part) {\n throw new Error('`' + name + '` cannot be empty')\n }\n}", "function assertNonEmpty(part, name) {\n if (!part) {\n throw new Error('`' + name + '` cannot be empty')\n }\n}", "function assertNonEmpty(part, name) {\n if (!part) {\n throw new Error('`' + name + '` cannot be empty')\n }\n}", "function assertNonEmpty(part, name) {\n if (!part) {\n throw new Error('`' + name + '` cannot be empty')\n }\n}", "function assertNonEmpty(part, name) {\n if (!part) {\n throw new Error('`' + name + '` cannot be empty');\n }\n}", "function assertNonEmpty(part, name) {\n if (!part) {\n throw new Error('`' + name + '` cannot be empty');\n }\n}", "function assertNonEmpty(part, name) {\n if (!part) {\n throw new Error('`' + name + '` cannot be empty');\n }\n}", "function assertNonEmpty(part, name) {\n if (!part) {\n throw new Error('`' + name + '` cannot be empty');\n }\n}", "function assertNonEmpty(part, name) {\n if (!part) {\n throw new Error('`' + name + '` cannot be empty');\n }\n}", "function assertNonEmpty(part, name) {\n if (!part) {\n throw new Error('`' + name + '` cannot be empty');\n }\n}", "function assertNonEmpty(part, name) {\n if (!part) {\n throw new Error('`' + name + '` cannot be empty');\n }\n}", "function assertNonEmpty$1(part, name) {\n if (!part) {\n throw new Error('`' + name + '` cannot be empty')\n }\n}", "function ensureSlash(dep) {\n if (!_.startsWith(dep, '/')) dep = '/' + dep;\n return dep;\n}", "function assertPath(path) {\n if (typeof path !== 'string') {\n throw new TypeError('Path must be a string. Received ' + JSON.stringify(path));\n }\n}", "function assertPath(path) {\n if (typeof path !== 'string') {\n throw new TypeError('Path must be a string. Received ' + JSON.stringify(path));\n }\n}", "function assertPath(path) {\n if (typeof path !== 'string') {\n throw new TypeError('Path must be a string. Received ' + JSON.stringify(path));\n }\n}", "function assertPath(path) {\n if (typeof path !== 'string') {\n throw new TypeError('Path must be a string. Received ' + JSON.stringify(path));\n }\n}", "function assertPath(path) {\n if (typeof path !== 'string') {\n throw new TypeError('Path must be a string. Received ' + JSON.stringify(path));\n }\n}", "function isValidPath(p) {\n return isString(p) && /^\\/?[^\\/?#]*(\\/[^\\/?#]+)*\\/?(\\?[^#]*)?(#.*)?$/.test(p);\n }", "function assertPath(path) {\n if (typeof path !== \"string\") {\n throw new TypeError(\"Path must be a string. Received \" + JSON.stringify(path));\n }\n }", "function isValidPathStart(base) {\n if (!/^\\//.test(base)) {\n return false;\n }\n if ((base === '/') ||\n (base.length > 1 && base[1] !== '/' && base[1] !== '\\\\')) {\n return true;\n }\n throw new Error('The path start in the url is invalid.');\n}", "function relative(path) {\n const char = path.substr(0, 1);\n return char !== '/' && char !== '@';\n }", "function validateFields(validator, part, path) {\n if (_.has(part, 'fields')) {\n validator(part.fields, _.concat(path, 'fields'));\n }\n }", "function l(e,t){\"\"===e&&(e=\".\"),e=e.replace(/\\/$/,\"\");\n// XXX: It is possible to remove this block, and the tests still pass!\nvar n=o(e);return\"/\"==t.charAt(0)&&n&&\"/\"==n.path?t.slice(1):0===t.indexOf(e+\"/\")?t.substr(e.length+1):t}", "function checkArtifactFilePath(path) {\n if (!path) {\n throw new Error(`Artifact path: ${path}, is incorrectly provided`);\n }\n for (const invalidChar of invalidArtifactFilePathCharacters) {\n if (path.includes(invalidChar)) {\n throw new Error(`Artifact path is not valid: ${path}. Contains character: \"${invalidChar}\". Invalid characters include: ${invalidArtifactFilePathCharacters.toString()}.`);\n }\n }\n}", "function validatePath(relativePath, fileName){\n\n relativePath = unescape(relativePath);\n fileName = unescape(fileName);\n\n var fullPath = relativePath + fileName;\n // Check for .. in relative path\n var pathReg1 = /.*\\.\\..*/;\n // Check that the fileName doesn't contain / or \\\n var pathReg2 = /(.*(\\/|\\\\).*)/;\n // Further validation on the name mostly ensures characters are alphanumeric \n var pathReg3 = /^([a-zA-Z0-9_ .]|-)*$/;\n\n return !(pathReg1.exec(relativePath)\n || pathReg2.exec(fileName)\n || !pathReg3.exec(fileName)\n || pathReg1.exec(fullPath));\n}", "function prepareDebuggerPath(...parts) {\r\n return path.join(...parts)\r\n .replace('\\\\', '\\\\\\\\')\r\n .replace('.', '\\\\.');\r\n}", "function is_path(str) {\n let curr_char\n for (let i = 0; i < str.length; i ++) {\n curr_char = str.charCodeAt(i)\n if (!(curr_char == 95) &&\n !(curr_char > 45 && curr_char < 58) &&\n !(curr_char > 64 && curr_char < 91) &&\n !(curr_char > 96 && curr_char < 123)) {\n return false\n }\n }\n return true\n}", "function assertWellFormedAlbumPath(albumPath) {\n\tif (!albumPath.match(/^\\/(\\d\\d\\d\\d\\/(\\d\\d-\\d\\d\\/)?)?$/)) {\n\t\tthrow new BadRequestException(\"Malformed album path: '\" + albumPath + \"'\");\n\t}\n}", "function assertWellFormedAlbumPath(albumPath) {\n\tif (!albumPath.match(/^\\/(\\d\\d\\d\\d\\/(\\d\\d-\\d\\d\\/)?)?$/)) {\n\t\tthrow new BadRequestException(\"Malformed album path: '\" + albumPath + \"'\");\n\t}\n}", "function ensureTrailingDirectorySeparator(path) {\n if (path.charAt(path.length - 1) !== ts.directorySeparator) {\n return path + ts.directorySeparator;\n }\n return path;\n }", "function fromDotSeparatedString(path) {\n var found = path.search(RESERVED);\n if (found >= 0) {\n throw new __WEBPACK_IMPORTED_MODULE_1__util_error__[\"a\" /* FirestoreError */](__WEBPACK_IMPORTED_MODULE_1__util_error__[\"b\" /* Code */].INVALID_ARGUMENT, \"Invalid field path (\" + path + \"). Paths must not contain \" +\n \"'~', '*', '/', '[', or ']'\");\n }\n try {\n return new (FieldPath.bind.apply(FieldPath, [void 0].concat(path.split('.'))))();\n }\n catch (e) {\n throw new __WEBPACK_IMPORTED_MODULE_1__util_error__[\"a\" /* FirestoreError */](__WEBPACK_IMPORTED_MODULE_1__util_error__[\"b\" /* Code */].INVALID_ARGUMENT, \"Invalid field path (\" + path + \"). Paths must not be empty, \" +\n \"begin with '.', end with '.', or contain '..'\");\n }\n}", "function fromDotSeparatedString(path) {\n var found = path.search(RESERVED);\n if (found >= 0) {\n throw new __WEBPACK_IMPORTED_MODULE_1__util_error__[\"a\" /* FirestoreError */](__WEBPACK_IMPORTED_MODULE_1__util_error__[\"b\" /* Code */].INVALID_ARGUMENT, \"Invalid field path (\" + path + \"). Paths must not contain \" +\n \"'~', '*', '/', '[', or ']'\");\n }\n try {\n return new (FieldPath.bind.apply(FieldPath, [void 0].concat(path.split('.'))))();\n }\n catch (e) {\n throw new __WEBPACK_IMPORTED_MODULE_1__util_error__[\"a\" /* FirestoreError */](__WEBPACK_IMPORTED_MODULE_1__util_error__[\"b\" /* Code */].INVALID_ARGUMENT, \"Invalid field path (\" + path + \"). Paths must not be empty, \" +\n \"begin with '.', end with '.', or contain '..'\");\n }\n}", "function fromDotSeparatedString(path) {\n var found = path.search(RESERVED);\n if (found >= 0) {\n throw new __WEBPACK_IMPORTED_MODULE_1__util_error__[\"b\" /* FirestoreError */](__WEBPACK_IMPORTED_MODULE_1__util_error__[\"a\" /* Code */].INVALID_ARGUMENT, \"Invalid field path (\" + path + \"). Paths must not contain \" +\n \"'~', '*', '/', '[', or ']'\");\n }\n try {\n return new (FieldPath.bind.apply(FieldPath, [void 0].concat(path.split('.'))))();\n }\n catch (e) {\n throw new __WEBPACK_IMPORTED_MODULE_1__util_error__[\"b\" /* FirestoreError */](__WEBPACK_IMPORTED_MODULE_1__util_error__[\"a\" /* Code */].INVALID_ARGUMENT, \"Invalid field path (\" + path + \"). Paths must not be empty, \" +\n \"begin with '.', end with '.', or contain '..'\");\n }\n}", "function check_path(path) {\n if (escape_paths.length > 0) {\n for (let i = 0; i < escape_paths.length; i++) {\n if (path.includes(escape_paths[i])) {\n return true;\n }\n }\n return false;\n }\n return true;\n}", "function check_path(path) {\n if (escape_paths.length > 0) {\n for (let i = 0; i < escape_paths.length; i++) {\n if (path.includes(escape_paths[i])) {\n return true;\n }\n }\n return false;\n }\n return true;\n}", "function splitPath(p) {\n return p ? p.split(path.delimiter) : [];\n}", "function splitPath(p) {\n return p ? p.split(path.delimiter) : [];\n}", "function splitPath(p) {\n return p ? p.split(path.delimiter) : [];\n}", "function isRooted(p) {\n p = normalizeSeparators(p);\n if (!p) {\n throw new Error('isRooted() parameter \"p\" cannot be empty');\n }\n if (exports.IS_WINDOWS) {\n return (p.startsWith('\\\\') || /^[A-Z]:/i.test(p) // e.g. \\ or \\hello or \\\\hello\n ); // e.g. C: or C:\\hello\n }\n return p.startsWith('/');\n}", "function isRooted(p) {\n p = normalizeSeparators(p);\n if (!p) {\n throw new Error('isRooted() parameter \"p\" cannot be empty');\n }\n if (exports.IS_WINDOWS) {\n return (p.startsWith('\\\\') || /^[A-Z]:/i.test(p) // e.g. \\ or \\hello or \\\\hello\n ); // e.g. C: or C:\\hello\n }\n return p.startsWith('/');\n}", "function isRooted(p) {\n p = normalizeSeparators(p);\n if (!p) {\n throw new Error('isRooted() parameter \"p\" cannot be empty');\n }\n if (exports.IS_WINDOWS) {\n return (p.startsWith('\\\\') || /^[A-Z]:/i.test(p) // e.g. \\ or \\hello or \\\\hello\n ); // e.g. C: or C:\\hello\n }\n return p.startsWith('/');\n}", "function isRooted(p) {\n p = normalizeSeparators(p);\n if (!p) {\n throw new Error('isRooted() parameter \"p\" cannot be empty');\n }\n if (exports.IS_WINDOWS) {\n return (p.startsWith('\\\\') || /^[A-Z]:/i.test(p) // e.g. \\ or \\hello or \\\\hello\n ); // e.g. C: or C:\\hello\n }\n return p.startsWith('/');\n}", "function isRooted(p) {\n p = normalizeSeparators(p);\n if (!p) {\n throw new Error('isRooted() parameter \"p\" cannot be empty');\n }\n if (exports.IS_WINDOWS) {\n return (p.startsWith('\\\\') || /^[A-Z]:/i.test(p) // e.g. \\ or \\hello or \\\\hello\n ); // e.g. C: or C:\\hello\n }\n return p.startsWith('/');\n}", "function isRooted(p) {\n p = normalizeSeparators(p);\n if (!p) {\n throw new Error('isRooted() parameter \"p\" cannot be empty');\n }\n if (exports.IS_WINDOWS) {\n return (p.startsWith('\\\\') || /^[A-Z]:/i.test(p) // e.g. \\ or \\hello or \\\\hello\n ); // e.g. C: or C:\\hello\n }\n return p.startsWith('/');\n}", "function isRooted(p) {\n p = normalizeSeparators(p);\n if (!p) {\n throw new Error('isRooted() parameter \"p\" cannot be empty');\n }\n if (exports.IS_WINDOWS) {\n return (p.startsWith('\\\\') || /^[A-Z]:/i.test(p) // e.g. \\ or \\hello or \\\\hello\n ); // e.g. C: or C:\\hello\n }\n return p.startsWith('/');\n}", "function isRooted(p) {\n p = normalizeSeparators(p);\n if (!p) {\n throw new Error('isRooted() parameter \"p\" cannot be empty');\n }\n if (exports.IS_WINDOWS) {\n return (p.startsWith('\\\\') || /^[A-Z]:/i.test(p) // e.g. \\ or \\hello or \\\\hello\n ); // e.g. C: or C:\\hello\n }\n return p.startsWith('/');\n}", "function isRooted(p) {\n p = normalizeSeparators(p);\n if (!p) {\n throw new Error('isRooted() parameter \"p\" cannot be empty');\n }\n if (exports.IS_WINDOWS) {\n return (p.startsWith('\\\\') || /^[A-Z]:/i.test(p) // e.g. \\ or \\hello or \\\\hello\n ); // e.g. C: or C:\\hello\n }\n return p.startsWith('/');\n}", "function isRooted(p) {\n p = normalizeSeparators(p);\n if (!p) {\n throw new Error('isRooted() parameter \"p\" cannot be empty');\n }\n if (exports.IS_WINDOWS) {\n return (p.startsWith('\\\\') || /^[A-Z]:/i.test(p) // e.g. \\ or \\hello or \\\\hello\n ); // e.g. C: or C:\\hello\n }\n return p.startsWith('/');\n}", "function isRooted(p) {\n p = normalizeSeparators(p);\n if (!p) {\n throw new Error('isRooted() parameter \"p\" cannot be empty');\n }\n if (exports.IS_WINDOWS) {\n return (p.startsWith('\\\\') || /^[A-Z]:/i.test(p) // e.g. \\ or \\hello or \\\\hello\n ); // e.g. C: or C:\\hello\n }\n return p.startsWith('/');\n}", "function isFolder(path) {\n return path.substr(-1) === '/';\n }", "function endOfPath(input) {\n var lastSlash = input.lastIndexOf('/');\n if (lastSlash === -1 || lastSlash === input.length - 1) {\n // try to find the index using windows-style filesystem separators\n lastSlash = input.lastIndexOf('\\\\');\n if (lastSlash === -1 || lastSlash === input.length - 1) {\n return input;\n }\n }\n return input.substring(lastSlash + 1);\n}", "checkPath(expectedPath, path) {\n\t\tif (Array.isArray(expectedPath)) {\n\t\t\texpectedPath.forEach((chunk) => this.checkPath(chunk, path));\n\t\t} else {\n\t\t\tpath.should.contain(expectedPath);\n\t\t}\n\t}", "function partNode(node){\n if (node.isPart && node.childNodes.length == 1 && node.firstChild.nodeType == 3) {\n node.currentText = node.firstChild.nodeValue;\n return !/[\\n\\t\\r]/.test(node.currentText);\n }\n return false;\n }", "function isEmptyString(val) {\n return String(val) === '' || String(val) === './';\n}", "function isEmptyString(val) {\n return String(val) === '' || String(val) === './';\n}", "function isEmptyString(val) {\n return String(val) === '' || String(val) === './';\n}", "function isEmptyString(val) {\n return String(val) === '' || String(val) === './';\n}", "function checkPathInDeployOption(path) {\n if (path[path.length - 1] === '/') {\n logger.error('Error: option deploy does not support directories: ' + path);\n process.exit(1);\n }\n}", "function safeTrimTrailingSeparator(p) {\n // Short-circuit if empty\n if (!p) {\n return '';\n }\n // Normalize separators\n p = normalizeSeparators(p);\n // No trailing slash\n if (!p.endsWith(path.sep)) {\n return p;\n }\n // Check '/' on Linux/macOS and '\\' on Windows\n if (p === path.sep) {\n return p;\n }\n // On Windows check if drive root. E.g. C:\\\n if (IS_WINDOWS && /^[A-Z]:\\\\$/i.test(p)) {\n return p;\n }\n // Otherwise trim trailing slash\n return p.substr(0, p.length - 1);\n}", "function safeTrimTrailingSeparator(p) {\n // Short-circuit if empty\n if (!p) {\n return '';\n }\n // Normalize separators\n p = normalizeSeparators(p);\n // No trailing slash\n if (!p.endsWith(path.sep)) {\n return p;\n }\n // Check '/' on Linux/macOS and '\\' on Windows\n if (p === path.sep) {\n return p;\n }\n // On Windows check if drive root. E.g. C:\\\n if (IS_WINDOWS && /^[A-Z]:\\\\$/i.test(p)) {\n return p;\n }\n // Otherwise trim trailing slash\n return p.substr(0, p.length - 1);\n}", "function safeTrimTrailingSeparator(p) {\n // Short-circuit if empty\n if (!p) {\n return '';\n }\n // Normalize separators\n p = normalizeSeparators(p);\n // No trailing slash\n if (!p.endsWith(path.sep)) {\n return p;\n }\n // Check '/' on Linux/macOS and '\\' on Windows\n if (p === path.sep) {\n return p;\n }\n // On Windows check if drive root. E.g. C:\\\n if (IS_WINDOWS && /^[A-Z]:\\\\$/i.test(p)) {\n return p;\n }\n // Otherwise trim trailing slash\n return p.substr(0, p.length - 1);\n}", "function safeTrimTrailingSeparator(p) {\n // Short-circuit if empty\n if (!p) {\n return '';\n }\n // Normalize separators\n p = normalizeSeparators(p);\n // No trailing slash\n if (!p.endsWith(path.sep)) {\n return p;\n }\n // Check '/' on Linux/macOS and '\\' on Windows\n if (p === path.sep) {\n return p;\n }\n // On Windows check if drive root. E.g. C:\\\n if (IS_WINDOWS && /^[A-Z]:\\\\$/i.test(p)) {\n return p;\n }\n // Otherwise trim trailing slash\n return p.substr(0, p.length - 1);\n}", "function safeTrimTrailingSeparator(p) {\n // Short-circuit if empty\n if (!p) {\n return '';\n }\n // Normalize separators\n p = normalizeSeparators(p);\n // No trailing slash\n if (!p.endsWith(path.sep)) {\n return p;\n }\n // Check '/' on Linux/macOS and '\\' on Windows\n if (p === path.sep) {\n return p;\n }\n // On Windows check if drive root. E.g. C:\\\n if (IS_WINDOWS && /^[A-Z]:\\\\$/i.test(p)) {\n return p;\n }\n // Otherwise trim trailing slash\n return p.substr(0, p.length - 1);\n}", "function safeTrimTrailingSeparator(p) {\n // Short-circuit if empty\n if (!p) {\n return '';\n }\n // Normalize separators\n p = normalizeSeparators(p);\n // No trailing slash\n if (!p.endsWith(path.sep)) {\n return p;\n }\n // Check '/' on Linux/macOS and '\\' on Windows\n if (p === path.sep) {\n return p;\n }\n // On Windows check if drive root. E.g. C:\\\n if (IS_WINDOWS && /^[A-Z]:\\\\$/i.test(p)) {\n return p;\n }\n // Otherwise trim trailing slash\n return p.substr(0, p.length - 1);\n}", "function formatSubPath (path) {\n var trimmed = path.trim();\n // invalid leading 0\n if (path.charAt(0) === '0' && isNaN(path)) { return false }\n\n return isLiteral(trimmed) ? stripQuotes(trimmed) : '*' + trimmed\n}", "function formatSubPath (path) {\n var trimmed = path.trim();\n // invalid leading 0\n if (path.charAt(0) === '0' && isNaN(path)) { return false }\n\n return isLiteral(trimmed) ? stripQuotes(trimmed) : '*' + trimmed\n}", "function formatSubPath (path) {\n var trimmed = path.trim();\n // invalid leading 0\n if (path.charAt(0) === '0' && isNaN(path)) { return false }\n\n return isLiteral(trimmed) ? stripQuotes(trimmed) : '*' + trimmed\n}", "function formatSubPath (path) {\n var trimmed = path.trim();\n // invalid leading 0\n if (path.charAt(0) === '0' && isNaN(path)) { return false }\n\n return isLiteral(trimmed) ? stripQuotes(trimmed) : '*' + trimmed\n}", "function formatSubPath (path) {\n var trimmed = path.trim();\n // invalid leading 0\n if (path.charAt(0) === '0' && isNaN(path)) { return false }\n\n return isLiteral(trimmed) ? stripQuotes(trimmed) : '*' + trimmed\n}", "function formatSubPath (path) {\n var trimmed = path.trim();\n // invalid leading 0\n if (path.charAt(0) === '0' && isNaN(path)) { return false }\n\n return isLiteral(trimmed) ? stripQuotes(trimmed) : '*' + trimmed\n}", "function formatSubPath (path) {\n var trimmed = path.trim();\n // invalid leading 0\n if (path.charAt(0) === '0' && isNaN(path)) { return false }\n\n return isLiteral(trimmed) ? stripQuotes(trimmed) : '*' + trimmed\n}", "function formatSubPath (path) {\n var trimmed = path.trim();\n // invalid leading 0\n if (path.charAt(0) === '0' && isNaN(path)) { return false }\n\n return isLiteral(trimmed) ? stripQuotes(trimmed) : '*' + trimmed\n}", "function formatSubPath (path) {\n var trimmed = path.trim();\n // invalid leading 0\n if (path.charAt(0) === '0' && isNaN(path)) { return false }\n\n return isLiteral(trimmed) ? stripQuotes(trimmed) : '*' + trimmed\n}", "function formatSubPath (path) {\n var trimmed = path.trim();\n // invalid leading 0\n if (path.charAt(0) === '0' && isNaN(path)) { return false }\n\n return isLiteral(trimmed) ? stripQuotes(trimmed) : '*' + trimmed\n}", "function formatSubPath (path) {\n var trimmed = path.trim();\n // invalid leading 0\n if (path.charAt(0) === '0' && isNaN(path)) { return false }\n\n return isLiteral(trimmed) ? stripQuotes(trimmed) : '*' + trimmed\n}", "function formatSubPath (path) {\n var trimmed = path.trim();\n // invalid leading 0\n if (path.charAt(0) === '0' && isNaN(path)) { return false }\n\n return isLiteral(trimmed) ? stripQuotes(trimmed) : '*' + trimmed\n}", "function formatSubPath (path) {\n var trimmed = path.trim();\n // invalid leading 0\n if (path.charAt(0) === '0' && isNaN(path)) { return false }\n\n return isLiteral(trimmed) ? stripQuotes(trimmed) : '*' + trimmed\n}", "function formatSubPath (path) {\n var trimmed = path.trim();\n // invalid leading 0\n if (path.charAt(0) === '0' && isNaN(path)) { return false }\n\n return isLiteral(trimmed) ? stripQuotes(trimmed) : '*' + trimmed\n}", "function formatSubPath (path: string): boolean | string {\n const trimmed: string = path.trim()\n // invalid leading 0\n if (path.charAt(0) === '0' && isNaN(path)) { return false }\n\n return isLiteral(trimmed) ? stripQuotes(trimmed) : '*' + trimmed\n}", "function s(e,t){\"\"===e&&(e=\".\"),e=e.replace(/\\/$/,\"\");// XXX: It is possible to remove this block, and the tests still pass!\nvar n=r(e);return\"/\"==t.charAt(0)&&n&&\"/\"==n.path?t.slice(1):0===t.indexOf(e+\"/\")?t.substr(e.length+1):t}", "check(decl) {\n let value = decl.value\n return !value.includes('/') && !value.includes('span')\n }", "function getRoot(path, sep) {\n if (sep === void 0) { sep = '/'; }\n if (!path) {\n return '';\n }\n var len = path.length;\n var code = path.charCodeAt(0);\n if (code === 47 /* Slash */ || code === 92 /* Backslash */) {\n code = path.charCodeAt(1);\n if (code === 47 /* Slash */ || code === 92 /* Backslash */) {\n // UNC candidate \\\\localhost\\shares\\ddd\n // ^^^^^^^^^^^^^^^^^^^\n code = path.charCodeAt(2);\n if (code !== 47 /* Slash */ && code !== 92 /* Backslash */) {\n // eslint-disable-next-line @typescript-eslint/no-shadow\n var pos_1 = 3;\n var start = pos_1;\n for (; pos_1 < len; pos_1++) {\n code = path.charCodeAt(pos_1);\n if (code === 47 /* Slash */ || code === 92 /* Backslash */) {\n break;\n }\n }\n code = path.charCodeAt(pos_1 + 1);\n if (start !== pos_1 && code !== 47 /* Slash */ && code !== 92 /* Backslash */) {\n pos_1 += 1;\n for (; pos_1 < len; pos_1++) {\n code = path.charCodeAt(pos_1);\n if (code === 47 /* Slash */ || code === 92 /* Backslash */) {\n return path.slice(0, pos_1 + 1) // consume this separator\n .replace(/[\\\\/]/g, sep);\n }\n }\n }\n }\n }\n // /user/far\n // ^\n return sep;\n }\n else if ((code >= 65 /* A */ && code <= 90 /* Z */) || (code >= 97 /* a */ && code <= 122 /* z */)) {\n // check for windows drive letter c:\\ or c:\n if (path.charCodeAt(1) === 58 /* Colon */) {\n code = path.charCodeAt(2);\n if (code === 47 /* Slash */ || code === 92 /* Backslash */) {\n // C:\\fff\n // ^^^\n return path.slice(0, 2) + sep;\n }\n else {\n // C:\n // ^^\n return path.slice(0, 2);\n }\n }\n }\n // check for URI\n // scheme://authority/path\n // ^^^^^^^^^^^^^^^^^^^\n var pos = path.indexOf('://');\n if (pos !== -1) {\n pos += 3; // 3 -> \"://\".length\n for (; pos < len; pos++) {\n code = path.charCodeAt(pos);\n if (code === 47 /* Slash */ || code === 92 /* Backslash */) {\n return path.slice(0, pos + 1); // consume this separator\n }\n }\n }\n return '';\n}", "function getRoot(path, sep) {\n if (sep === void 0) { sep = '/'; }\n if (!path) {\n return '';\n }\n var len = path.length;\n var code = path.charCodeAt(0);\n if (code === 47 /* Slash */ || code === 92 /* Backslash */) {\n code = path.charCodeAt(1);\n if (code === 47 /* Slash */ || code === 92 /* Backslash */) {\n // UNC candidate \\\\localhost\\shares\\ddd\n // ^^^^^^^^^^^^^^^^^^^\n code = path.charCodeAt(2);\n if (code !== 47 /* Slash */ && code !== 92 /* Backslash */) {\n // eslint-disable-next-line @typescript-eslint/no-shadow\n var pos_1 = 3;\n var start = pos_1;\n for (; pos_1 < len; pos_1++) {\n code = path.charCodeAt(pos_1);\n if (code === 47 /* Slash */ || code === 92 /* Backslash */) {\n break;\n }\n }\n code = path.charCodeAt(pos_1 + 1);\n if (start !== pos_1 && code !== 47 /* Slash */ && code !== 92 /* Backslash */) {\n pos_1 += 1;\n for (; pos_1 < len; pos_1++) {\n code = path.charCodeAt(pos_1);\n if (code === 47 /* Slash */ || code === 92 /* Backslash */) {\n return path.slice(0, pos_1 + 1) // consume this separator\n .replace(/[\\\\/]/g, sep);\n }\n }\n }\n }\n }\n // /user/far\n // ^\n return sep;\n }\n else if ((code >= 65 /* A */ && code <= 90 /* Z */) || (code >= 97 /* a */ && code <= 122 /* z */)) {\n // check for windows drive letter c:\\ or c:\n if (path.charCodeAt(1) === 58 /* Colon */) {\n code = path.charCodeAt(2);\n if (code === 47 /* Slash */ || code === 92 /* Backslash */) {\n // C:\\fff\n // ^^^\n return path.slice(0, 2) + sep;\n }\n else {\n // C:\n // ^^\n return path.slice(0, 2);\n }\n }\n }\n // check for URI\n // scheme://authority/path\n // ^^^^^^^^^^^^^^^^^^^\n var pos = path.indexOf('://');\n if (pos !== -1) {\n pos += 3; // 3 -> \"://\".length\n for (; pos < len; pos++) {\n code = path.charCodeAt(pos);\n if (code === 47 /* Slash */ || code === 92 /* Backslash */) {\n return path.slice(0, pos + 1); // consume this separator\n }\n }\n }\n return '';\n}", "function checkArtifactFilePath(path) {\n if (!path) {\n throw new Error(`Artifact path: ${path}, is incorrectly provided`);\n }\n for (const [invalidCharacterKey, errorMessageForCharacter] of invalidArtifactFilePathCharacters) {\n if (path.includes(invalidCharacterKey)) {\n throw new Error(`Artifact path is not valid: ${path}. Contains the following character: ${errorMessageForCharacter}\n \nInvalid characters include: ${Array.from(invalidArtifactFilePathCharacters.values()).toString()}\n \nThe following characters are not allowed in files that are uploaded due to limitations with certain file systems such as NTFS. To maintain file system agnostic behavior, these characters are intentionally not allowed to prevent potential problems with downloads on different file systems.\n `);\n }\n }\n}", "function checkArtifactFilePath(path) {\n if (!path) {\n throw new Error(`Artifact path: ${path}, is incorrectly provided`);\n }\n for (const [invalidCharacterKey, errorMessageForCharacter] of invalidArtifactFilePathCharacters) {\n if (path.includes(invalidCharacterKey)) {\n throw new Error(`Artifact path is not valid: ${path}. Contains the following character: ${errorMessageForCharacter}\n \nInvalid characters include: ${Array.from(invalidArtifactFilePathCharacters.values()).toString()}\n \nThe following characters are not allowed in files that are uploaded due to limitations with certain file systems such as NTFS. To maintain file system agnostic behavior, these characters are intentionally not allowed to prevent potential problems with downloads on different file systems.\n `);\n }\n }\n}", "function fixPath(path) {\n \n \n if(path.startsWith('\\\\\\\\') === false) {\n \n console.log('Path does not starts with \\\\\\\\. Throw error');\n throw \"Path does not starts with \\\\\\\\\";\n \n } else {\n \n // storing path slash into variable\t \n var result = '\\\\\\\\';\n for(var i = 0; i < path.length; i++) {\n \n // Current character is back slash or not\n if(path.charAt(i) === '\\\\') {\n \n // Is result ends with back slash?\n if(result.endsWith('\\\\') === false) {\n result += '\\\\';\n }\n } else {\n result += path.charAt(i);\n }\n }\n return result;\n \n }\n \n}", "function removePathFromField(path) {\n return \"\".concat(splitAccessPath(path).join('.'));\n }", "function fromDotSeparatedString(path) {\n var found = path.search(RESERVED);\n if (found >= 0) {\n throw new FirestoreError(Code.INVALID_ARGUMENT, \"Invalid field path (\" + path + \"). Paths must not contain \" +\n \"'~', '*', '/', '[', or ']'\");\n }\n try {\n return new (FieldPath$1.bind.apply(FieldPath$1, [void 0].concat(path.split('.'))))();\n }\n catch (e) {\n throw new FirestoreError(Code.INVALID_ARGUMENT, \"Invalid field path (\" + path + \"). Paths must not be empty, \" +\n \"begin with '.', end with '.', or contain '..'\");\n }\n}" ]
[ "0.8634604", "0.8608681", "0.85808456", "0.85808456", "0.85808456", "0.83588463", "0.6666319", "0.6666319", "0.6666319", "0.6666319", "0.66645527", "0.66645527", "0.66645527", "0.66645527", "0.66645527", "0.66645527", "0.66645527", "0.66143674", "0.5684836", "0.5683896", "0.56726575", "0.56726575", "0.56726575", "0.56726575", "0.5542716", "0.5526767", "0.53755665", "0.53645456", "0.53222", "0.52932894", "0.51918286", "0.5124137", "0.51095486", "0.5102765", "0.5101878", "0.5101878", "0.50619936", "0.50166667", "0.50166667", "0.50060165", "0.4963454", "0.4963454", "0.49179927", "0.49179927", "0.49179927", "0.49155816", "0.49155816", "0.49155816", "0.49155816", "0.49155816", "0.49155816", "0.49155816", "0.49155816", "0.49155816", "0.49155816", "0.49155816", "0.4906153", "0.4893899", "0.4890033", "0.48650372", "0.485539", "0.485539", "0.485539", "0.485539", "0.48456174", "0.48398557", "0.48398557", "0.48398557", "0.48398557", "0.48398557", "0.48398557", "0.48306763", "0.48306763", "0.48306763", "0.48306763", "0.48306763", "0.48306763", "0.48306763", "0.48306763", "0.48306763", "0.48306763", "0.48306763", "0.48306763", "0.48306763", "0.48306763", "0.4817934", "0.4816651", "0.48162144", "0.480512", "0.480512", "0.47943237", "0.47943237", "0.4785825", "0.47786862", "0.47774586" ]
0.86381245
5
Assert that `part` is not empty.
function assertNonEmpty(part, name) { if (!part) { throw new Error('`' + name + '` cannot be empty'); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function assertNonEmpty(part, name) {\n if (!part) {\n throw new Error('`' + name + '` cannot be empty')\n }\n}", "function assertNonEmpty(part, name) {\n if (!part) {\n throw new Error('`' + name + '` cannot be empty')\n }\n}", "function assertNonEmpty(part, name) {\n if (!part) {\n throw new Error('`' + name + '` cannot be empty')\n }\n}", "function assertNonEmpty(part, name) {\n if (!part) {\n throw new Error('`' + name + '` cannot be empty')\n }\n}", "function assertNonEmpty$1(part, name) {\n if (!part) {\n throw new Error('`' + name + '` cannot be empty')\n }\n}", "function assertPart(part, name) {\n if (part.indexOf(path.sep) !== -1) {\n throw new Error('`' + name + '` cannot be a path: did not expect `' + path.sep + '`');\n }\n}", "function assertPart(part, name) {\n if (part.indexOf(path.sep) !== -1) {\n throw new Error('`' + name + '` cannot be a path: did not expect `' + path.sep + '`');\n }\n}", "function assertPart(part, name) {\n if (part.indexOf(path.sep) !== -1) {\n throw new Error('`' + name + '` cannot be a path: did not expect `' + path.sep + '`');\n }\n}", "function assertPart(part, name) {\n if (part.indexOf(path.sep) !== -1) {\n throw new Error('`' + name + '` cannot be a path: did not expect `' + path.sep + '`');\n }\n}", "function assertPart(part, name) {\n if (part.indexOf(path.sep) !== -1) {\n throw new Error('`' + name + '` cannot be a path: did not expect `' + path.sep + '`');\n }\n}", "function assertPart(part, name) {\n if (part.indexOf(path.sep) !== -1) {\n throw new Error('`' + name + '` cannot be a path: did not expect `' + path.sep + '`');\n }\n}", "function assertPart(part, name) {\n if (part.indexOf(path.sep) !== -1) {\n throw new Error(\n '`' + name + '` cannot be a path: did not expect `' + path.sep + '`'\n )\n }\n}", "function assertPart(part, name) {\n if (part.indexOf(path.sep) !== -1) {\n throw new Error(\n '`' + name + '` cannot be a path: did not expect `' + path.sep + '`'\n );\n }\n}", "function assertPart$1(part, name) {\n if (part && part.indexOf(p$1.sep) > -1) {\n throw new Error(\n '`' + name + '` cannot be a path: did not expect `' + p$1.sep + '`'\n )\n }\n}", "function assertPart(part, name) {\n if (part && part.indexOf(p.sep) > -1) {\n throw new Error(\n '`' + name + '` cannot be a path: did not expect `' + p.sep + '`'\n )\n }\n}", "function assertPart(part, name) {\n if (part && part.indexOf(p.sep) > -1) {\n throw new Error(\n '`' + name + '` cannot be a path: did not expect `' + p.sep + '`'\n )\n }\n}", "function assertPart(part, name) {\n if (part && part.indexOf(p.sep) > -1) {\n throw new Error(\n '`' + name + '` cannot be a path: did not expect `' + p.sep + '`'\n )\n }\n}", "notEmpty (value, msg) {\n assert(!lodash.isEmpty(value), msg || `params must be not empty, but got ${value}`);\n }", "function isBlank (thing) {\n return (!thing || thing.length === 0)\n}", "function isEmpty(param) {\n if (!param || param.length === 0) {\n console.log('isEmpty');\n } else {\n console.log('isNotEmpty');\n }\n}", "function present( thing ) {\n return !blank(thing);\n}", "cannotBeEmpty(){\n\t\treturn this.addTest((obj) => {\n return new Validity(!!obj,\n `${this.name} cannot be empty`);\n });\n\t}", "function checkNewContainer(container, part, nextPart, toDelete) {\n if (container[part] === undefined) {\n if (toDelete) return false;\n if (typeof nextPart === 'number') container[part] = [];else container[part] = {};\n }\n return true;\n}", "isEmpty(editor, element) {\n var {\n children\n } = element;\n var [first] = children;\n return children.length === 0 || children.length === 1 && Text.isText(first) && first.text === '' && !editor.isVoid(element);\n }", "isEmpty(editor, element) {\n var {\n children\n } = element;\n var [first] = children;\n return children.length === 0 || children.length === 1 && Text.isText(first) && first.text === '' && !editor.isVoid(element);\n }", "isEmpty (value, msg) {\n assert(lodash.isEmpty(value), msg || `params must be empty, but got ${value}`);\n }", "function empty () {\n return !line || !line.trim()\n }", "function checkNewContainer(container, part, nextPart, toDelete) {\n if(container[part] === undefined) {\n if(toDelete) return false;\n\n if(typeof nextPart === 'number') container[part] = [];\n else container[part] = {};\n }\n return true;\n}", "function checkNewContainer(container, part, nextPart, toDelete) {\n if(container[part] === undefined) {\n if(toDelete) return false;\n\n if(typeof nextPart === 'number') container[part] = [];\n else container[part] = {};\n }\n return true;\n}", "function expectSomething(thing) {\n expect(thing).toBeDefined();\n expect(thing).not.toBeNull();\n if (typeof thing !== 'undefined'\n && thing !== null\n && typeof thing.length !== 'undefined') {\n expect(thing.length).not.toBe(0);\n }\n }", "function isNotEmpty(parm){\n \treturn !isEmpty(parm);\n }", "function checkNewContainer(container, part, nextPart, toDelete) {\n\t if(container[part] === undefined) {\n\t if(toDelete) return false;\n\t\n\t if(typeof nextPart === 'number') container[part] = [];\n\t else container[part] = {};\n\t }\n\t return true;\n\t}", "function checkNewContainer(container, part, nextPart, toDelete) {\n\t if(container[part] === undefined) {\n\t if(toDelete) return false;\n\t\n\t if(typeof nextPart === 'number') container[part] = [];\n\t else container[part] = {};\n\t }\n\t return true;\n\t}", "function validateParts(parts) {\r\n\t\t\tfor (var i = 0; i < parts.length; ++i) {\r\n\t\t\t\tif (!gl.isPositiveInteger(parts[i])) {\r\n\t\t\t\t\treturn false;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\treturn true;\r\n\t\t}", "function isEmpty(elem)\n {\n /* getting the text */\n var str = elem.value;\n\n /* defining a regular expression for non-empty string */\n var regExp = /.+/;\n return !regExp.test(str);\n }", "function empty(elem){\n return !/\\w/.test(elem.text());\n}", "function segmentIsInvalid(segment) {\n return segment.subWordTextChunks.length === 0;\n }", "function validateParts(parts) {\n\t\tfor (let i = 0; i < parts.length; ++i) {\n\t\t\tif (!isPositiveInteger(parts[i])) {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\t\treturn true;\n\t}", "function isEmpty(){console.log(\"ERROR\");return (wordLen === 0)}", "function partNode(node){\n if (node.isPart && node.childNodes.length == 1 && node.firstChild.nodeType == 3) {\n node.currentText = node.firstChild.nodeValue;\n return !/[\\n\\t\\r]/.test(node.currentText);\n }\n return false;\n }", "function isBlocksEmpty(stringBlock){\n if (!stringBlock)\n return true;\n else\n return false;\n}", "function checkElem(elem) {\n return elem && elem.length > 0;\n}", "function checkElem(elem) {\n return elem && elem.length > 0;\n}", "function isEmpty(element) {\n return (element.textContent.trim() && element.childElementCount == 0);\n}", "function isNotEmpty(elem) {\n var x = elem.val();\n return (x != null && x.trim() != '');\n}", "isEmpty() {\n const actualLength = this.getLength();\n this._node.__setLastDiff({\n actual: actualLength.toString(),\n timeout: this._node.getTimeout(),\n });\n return actualLength === 0;\n }", "function checkEmpty(year){\r\n\tvar terms = year.terms;\r\n\r\n\tfor(var i=0; i<terms.length; i++){\r\n\t\tif(terms[i].courses.length != 0){\r\n\t\t\treturn false;\r\n\t\t}\t\t\r\n\t}\t\r\n\treturn true;\r\n}", "function isEmpty() {\n return this.toString().length === 0;\n }", "function validateRequiredAttributes(part, path) {\n _.each(appLib.appModel.metaschema, (val, key) => {\n if (val.required && !_.has(part, key)) {\n errors.push(`Attribute ${path.join('.')} doesn't have required property \"${key}\"`);\n }\n });\n }", "function isFull() {\n for(let i in square) {\n if(square[i] === '') {\n return false;\n }\n }\n return true;\n}", "is_empty()\n\t{\n\t\tconst { value } = this.props\n\t\treturn !value || !value.trim()\n\t}", "empty () { return this.length === 0 }", "function empty(writer, value) {\n return !value || !value.length;\n}", "function containsBlankNode(quad) {\n return quad.subject.termType === \"BlankNode\" || quad.object.termType === \"BlankNode\";\n}", "isEmpty() {\n console.log(this.size === 0);\n }", "function isEmpty(box){\n return !box.hasClass('box-filled-1') && !box.hasClass('box-filled-2');\n }", "function empty(v) {\n return !v || !v.length;\n}", "get empty() { return this.sections.length == 0 || this.sections.length == 2 && this.sections[1] < 0; }", "function FieldIsEmpty(strInput) {\n\treturn TrimString(strInput).length == 0;\n}", "function bs_isEmpty(theVar) {\n\tif (bs_isNull(theVar)) return true;\n\tif (theVar == '') return true;\n\treturn false;\n}", "isEmpty () {\n return (!this || this.length === 0 || !this.trim());\n }", "function checkIfItemIsEmpty(item) {\n if(item.trim().length == 0){\n return true;\n }\n else {\n return false;\n }\n}", "function compoundWriteIsEmpty(compoundWrite) {\n return compoundWrite.writeTree_.isEmpty();\n}", "function compoundWriteIsEmpty(compoundWrite) {\n return compoundWrite.writeTree_.isEmpty();\n}", "function empty(campo){\n\tif(campo === '' || campo === undefined || campo === null || campo === false){\n\t\treturn true;\n\t}\n\t\n\treturn false;\n}", "function isNotEmpty(array) {\n return (array && array.length > 0)\n }", "function validateFields(validator, part, path) {\n if (_.has(part, 'fields')) {\n validator(part.fields, _.concat(path, 'fields'));\n }\n }", "function checkFeed(element) {\n expect(element).toBeDefined(); // Element must be defined...\n expect((element).length).toBeGreaterThan(0); // and have a length greater than 0...\n expect(element).not.toBe(''); // and not be an empty string.\n }", "isEmpty() {\n const text = this.editorState.getCurrentContent().getPlainText();\n return !text || _.trim(text).length === 0;\n }", "empty () {\n return !(this.length >= 1);\n }", "isEmpty (param) {\n if (param == null || param === '') {\n return true\n }\n return false\n }", "function is_field_empty(field) {\n if (field == undefined || field == '')\n return true;\n else\n return false;\n}", "function isNonEmptyString(val) { \r\n\treturn new FunctionalAssertionResult(\r\n\t\tfunction(v) { return v != null && typeof v == \"string\"; },\r\n\t\t[val],\r\n\t\t\"non-null string\"\r\n\t)\r\n}", "function isNotEmpty(field){\n return field.trim() !== ''\n}", "isEmpty() {\n return this.length() < 1;\n }", "function isEmpty(node) {\n\t if (!node.canHaveSubselections()) {\n\t return node.isGenerated() && !node.isRefQueryDependency();\n\t } else {\n\t return node.getChildren().every(isEmpty);\n\t }\n\t}", "function isEmpty(node) {\n\t if (!node.canHaveSubselections()) {\n\t return node.isGenerated() && !node.isRefQueryDependency();\n\t } else {\n\t return node.getChildren().every(isEmpty);\n\t }\n\t}", "function isEmpty(node) {\n\t if (!node.canHaveSubselections()) {\n\t return node.isGenerated() && !node.isRefQueryDependency();\n\t } else {\n\t return node.getChildren().every(isEmpty);\n\t }\n\t}", "function isEmpty(check_me) {\n return (check_me == null || check_me == \"undefined\" || check_me.length == 0);\n }", "isEmpty() {\n return this.storage.length === 0;\n }", "function isBlank( element, index, array) {\n return (element === \"\" || undefined); \n }", "isEmpty() {\n\t\treturn this.#hiddenLevels.length === this.#hiddenSize;\n\t}", "function isEmpty(space) {\n return space === null;\n}", "isEmpty() {\n return this.length() === 0;\n }", "isBagEmpty() {\n return this.bag.length == 0\n }", "function isEmpty( element ) {\n\tif( element.length < 1 ) {\n\t\treturn \"This field is required.\";\n\t}\n\treturn \"\";\n}", "function isFull(){\r\n for (let i = 0; i < gameField.length; i++){\r\n for (let j = 0; j < gameField[i].length; j++){\r\n if (gameField[i][j] === \"\"){\r\n return false;\r\n }\r\n }\r\n }\r\n return true;\r\n}", "isEmpty() {\n return this.size === 0;\n }", "isEmpty() {\n return this.size === 0;\n }", "isEmpty() {\n return this.size === 0;\n }", "isEmpty() {\n return this.size === 0;\n }", "isEmpty() {\n return this.size === 0;\n }", "isAbsent() {\n return this.length == 0;\n }", "isAbsent() {\n return this.length == 0;\n }" ]
[ "0.8208551", "0.8208551", "0.8208551", "0.8208551", "0.8099163", "0.6485353", "0.6485353", "0.6485353", "0.6485353", "0.6485353", "0.6485353", "0.6470561", "0.64697224", "0.64425254", "0.64349556", "0.64349556", "0.64349556", "0.6220875", "0.60911965", "0.57816833", "0.5771906", "0.571342", "0.5623503", "0.55974394", "0.55974394", "0.5589361", "0.55845684", "0.5545753", "0.5545753", "0.5523934", "0.54354906", "0.54319334", "0.54319334", "0.5418015", "0.5387073", "0.5353622", "0.53519833", "0.5330852", "0.52856314", "0.52781504", "0.52767134", "0.5260713", "0.5260713", "0.5249148", "0.5241785", "0.52347696", "0.52180105", "0.52051467", "0.520499", "0.51975745", "0.5185684", "0.51747984", "0.51747173", "0.5174557", "0.5167604", "0.516081", "0.5154104", "0.514954", "0.513556", "0.5134626", "0.5132222", "0.5128778", "0.51282847", "0.51282847", "0.5125002", "0.5124135", "0.5123789", "0.5122631", "0.5119403", "0.5105076", "0.5092702", "0.5090135", "0.5087345", "0.50810534", "0.50771344", "0.50742704", "0.50742704", "0.50742704", "0.50710124", "0.50651306", "0.5051387", "0.50509375", "0.50436854", "0.50301176", "0.50290835", "0.5027547", "0.5026857", "0.5013461", "0.5013461", "0.5013461", "0.5013461", "0.5013461", "0.50045896", "0.50045896" ]
0.8207471
10
For Node v0.10 support. Remove this eventually.
function isSlowBuffer (obj) { return typeof obj.readFloatLE === 'function' && typeof obj.slice === 'function' && isBuffer(obj.slice(0, 0)) }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function _node_p(){\n\tvar ret = false;\n\tif( anchor.environment() == 'Node.js' ){ ret = true; }\n\treturn ret;\n }", "function node_error(err) {\r\n node.error(err, err);\r\n }", "private public function m246() {}", "function NodeFsHandler() {}", "function NodeFsHandler() {}", "static reset(){\n _NODE_UID = 0;\n }", "static final private internal function m106() {}", "private internal function m248() {}", "function NodeHandler() { }", "function _isNodeInternal (line) {\n return ~line.indexOf('(timers.js:') ||\n ~line.indexOf('(node.js:') ||\n ~line.indexOf('(module.js:') ||\n ~line.indexOf('_stream_readable.js') ||\n ~line.indexOf('process._tickDomainCallback') ||\n ~line.indexOf('GeneratorFunctionPrototype.next (native)') ||\n ~line.indexOf('GeneratorFunctionPrototype.throw (native)') ||\n // co\n ~line.indexOf('/co/index.js') ||\n // koa-router\n ~line.indexOf('Object.dispatch') ||\n // bluebird\n ~line.indexOf('Promise._settlePromise') ||\n ~line.indexOf('Async._drainQueues') ||\n ~line.indexOf('Immediate.Async.drainQueues') ||\n false;\n}", "function Node() {}", "transient private protected internal function m182() {}", "function runIfNewNode( task ) {\n\t\treturn nodeV16OrNewer ? task : \"print_old_node_message:\" + task;\n\t}", "function isNode(){\r\n\treturn typeof module !== 'undefined' && module.exports;\r\n}", "function node_enable() {\n if(typeof process === 'object' && process + '' === '[object process]'){\n return true;\n }\n else{\n return false;\n }\n}", "function RNode() {}", "function RNode() {}", "function RNode() {}", "function noOp(err) { if (err) { throw err; } }", "function isNode() {\n return (typeof module !== 'undefined' && this.module !== module);\n}", "protected internal function m252() {}", "function version(){ return \"0.13.0\" }", "function NodeLogger() {}", "function NodeLogger() {}", "function NodeLogger() {}", "getHostNode() {}", "function NodeLogger() { }", "function NodeLogger() { }", "getNode() {\n throw new Error(\"Must be implemented\");\n }", "transient private internal function m185() {}", "function NodeLogger(){}", "static final protected internal function m110() {}", "function getBasicNodeMethods(){return['get','post','put','head','delete','options','trace','copy','lock','mkcol','move','purge','propfind','proppatch','unlock','report','mkactivity','checkout','merge','m-search','notify','subscribe','unsubscribe','patch','search','connect'];}", "getAllNodes () {\n client.getAllNodes(this.host, 4369, function (err, nodes) {\n if (err) {\n console.error(err)\n return\n }\n console.log(nodes)\n })\n }", "extend(config, ctx) {\n config.node = {\n console: true,\n fs: 'empty',\n net: 'empty',\n tls: 'empty',\n }\n }", "function is_node() {\r\n if (is_node_ === null)\r\n is_node_ = typeof global === \"object\"\r\n && typeof global.process === \"object\"\r\n && typeof global.process.versions === \"object\"\r\n && typeof global.process.versions.node !== \"undefined\";\r\n return is_node_;\r\n}", "transient protected internal function m189() {}", "function assertNodeEnv() {\r\n return assert(isNode, 'This feature is only available in NodeJS environments');\r\n }", "upgrade() {}", "function RNode(){}", "function _detectNodeCrypto(fn) {\n\t return forge.util.isNodejs && typeof _crypto[fn] === 'function';\n\t}", "function TNode() {}", "function TNode() {}", "function TNode() {}", "_handleNodeError(newValue,oldValue){if(typeof oldValue!==typeof void 0&&null!=newValue&&0!=newValue.length){// @todo, need support for a failed to load state; could be useful\n// if we go into an offline capability in the future\nthis._responseList[this.active]=newValue;this.activeNodeResponse=this._responseList[this.active];// set available because we don't have a failed state\nthis.items[this.active].metadata.status=\"available\";this.set(\"items.\"+this.active+\".metadata.status\",\"available\");this.notifyPath(\"items.\"+this.active+\".metadata.status\");// fire an event that this isn't really available so we know an issue occured\nthis.dispatchEvent(new CustomEvent(\"node-load-failed\",{bubbles:!0,cancelable:!0,composed:!0,detail:this.items[this.active]}))}}", "_read () {}", "_read () {}", "_read () {}", "function DWRUtil() { }", "_isValidContext() {\n const isNode = (typeof process !== 'undefined')\n && (typeof process.release !== 'undefined')\n && (process.release.name === 'node');\n return isNode;\n }", "function NWTNode() {\n\t\n}", "function getBasicNodeMethods() {\n return ['get', 'post', 'put', 'head', 'delete', 'options', 'trace', 'copy', 'lock', 'mkcol', 'move', 'purge', 'propfind', 'proppatch', 'unlock', 'report', 'mkactivity', 'checkout', 'merge', 'm-search', 'notify', 'subscribe', 'unsubscribe', 'patch', 'search', 'connect'];\n}", "static transient final private protected internal function m40() {}", "_read() {}", "_read() {}", "function getSystemNodeVers(cb) {\n exec('node -v', function(err, stdout) {\n if (err) {\n return cb(err, null);\n }\n cb(null, stdout.slice(1).replace('\\n',''));\n });\n}", "function r() {}", "function r() {}", "function r() {}", "transient private protected public internal function m181() {}", "function Node(){}", "static isNode(n) {\n return n && typeof n === \"object\" && typeof n.type === \"string\";\n }", "async initialize()\n\t{ \n\t\tthrow new Error(\"initialize() method not implemented\");\n\t}", "static transient final protected public internal function m46() {}", "function r(){}", "function r(){}", "function r(){}", "function r(){}", "function r(){}", "function r(){}", "function r(){}", "function r(){}", "function r(){}", "function r(){}", "function r(){}", "function r(){}", "function r(){}", "extend (config, ctx) {\n config.node = {\n fs: 'empty'\n }\n }", "function isNode() {\n return typeof module !== 'undefined' &&\n module.exports &&\n typeof window === 'undefined';\n}", "initiator() {\n throw new Error('Not implemented');\n }", "static runningOnNode ()\n\t\t{ let ud = \"undefined\";\n\n\t\t\tif (typeof process === ud)\n\t\t\t{ return false;\n\t\t\t}\n\t\t\tif (! process )\n\t\t\t{ return false;\n\t\t\t}\n\t\t\tif (! process.versions )\n\t\t\t{ return false;\n\t\t\t}\n\t\t\tif (! process.versions.node )\n\t\t\t{ return false;\n\t\t\t}\n\t\t\tif (typeof __dirname === ud)\n\t\t\t{ return false;\n\t\t\t}\n\t\t\tif (typeof __filename === ud)\n\t\t\t{ return false;\n\t\t\t}\n\t\t\tif (typeof require === ud)\n\t\t\t{ return false;\n\t\t\t}\n\t\t\tif (require === null)\n\t\t\t{ return false;\n\t\t\t}\n\t\t\tif (! require.resolve)\n\t\t\t{ return false;\n\t\t\t}\n\t\t\tif (typeof module === ud)\n\t\t\t{ return false;\n\t\t\t}\n\t\t\treturn true;\n\t\t}", "async init( callback ) {\n throw \"implement me!\";\n }", "function node(){}", "constructor() {\n this.startTime = Date.now();\n this.attributes = {\n \"version\": 0.5, \n \"lang\": \"node.js\",\n \"startTime\": this.startTime\n };\n\n this.inspectedCPU = false;\n this.inspectedMemory = false;\n this.inspectedContainer = false;\n this.inspectedPlatform = false;\n this.inspectedLinux = false;\n }", "function Node() {\n}", "function noop(){}// No operation performed.", "function noop(){}// No operation performed.", "function noop(){}// No operation performed.", "function noop(){}// No operation performed.", "function noop(){}// No operation performed.", "function noop(){}// No operation performed.", "function noop(){}// No operation performed.", "function getLocalNodeVers(cb) {\n var nave_path = process.env.HOME + \"/.nave/installed/\";\n\n fs.readdir(nave_path, cb);\n}", "static get ERROR () { return 0 }", "static transient final private internal function m43() {}", "extend(config, {isDev, isClient}) {\n config.node = {\n fs: 'empty'\n }\n }", "static init() {\n\t\tprocess.on('unhandledRejection', (reason, p) => { throw reason });\n\t}", "static transient final protected internal function m47() {}", "_read() {\n }", "function getBasicNodeMethods() {\n return [\n 'get',\n 'post',\n 'put',\n 'head',\n 'delete',\n 'options',\n 'trace',\n 'copy',\n 'lock',\n 'mkcol',\n 'move',\n 'purge',\n 'propfind',\n 'proppatch',\n 'unlock',\n 'report',\n 'mkactivity',\n 'checkout',\n 'merge',\n 'm-search',\n 'notify',\n 'subscribe',\n 'unsubscribe',\n 'patch',\n 'search',\n 'connect'\n ];\n}", "function getBasicNodeMethods() {\n return [\n 'get',\n 'post',\n 'put',\n 'head',\n 'delete',\n 'options',\n 'trace',\n 'copy',\n 'lock',\n 'mkcol',\n 'move',\n 'purge',\n 'propfind',\n 'proppatch',\n 'unlock',\n 'report',\n 'mkactivity',\n 'checkout',\n 'merge',\n 'm-search',\n 'notify',\n 'subscribe',\n 'unsubscribe',\n 'patch',\n 'search',\n 'connect'\n ];\n}" ]
[ "0.58632374", "0.5703871", "0.56875104", "0.55532336", "0.55532336", "0.5445521", "0.54364026", "0.53833115", "0.5353622", "0.53282815", "0.5315332", "0.5206867", "0.5199046", "0.5156871", "0.51495963", "0.512485", "0.512485", "0.512485", "0.5111965", "0.50998896", "0.509248", "0.5089069", "0.50858474", "0.50858474", "0.50858474", "0.5078939", "0.507126", "0.507126", "0.50662655", "0.50591445", "0.5028109", "0.5020386", "0.50198406", "0.5010499", "0.4998484", "0.49915734", "0.49878", "0.49864435", "0.49826354", "0.49805823", "0.49696416", "0.49459964", "0.49459964", "0.49459964", "0.4926235", "0.4923761", "0.4923761", "0.4923761", "0.49235925", "0.49212617", "0.49134308", "0.48959422", "0.48765427", "0.48761836", "0.48761836", "0.48559716", "0.48524886", "0.48524886", "0.48524886", "0.4850069", "0.4844602", "0.48412973", "0.48396012", "0.4839108", "0.4833468", "0.4833468", "0.4833468", "0.4833468", "0.4833468", "0.4833468", "0.4833468", "0.4833468", "0.4833468", "0.4833468", "0.4833468", "0.4833468", "0.4833468", "0.48326653", "0.48304194", "0.48183206", "0.48173195", "0.48158374", "0.48131892", "0.48125976", "0.48040462", "0.47994447", "0.47994447", "0.47994447", "0.47994447", "0.47994447", "0.47994447", "0.47994447", "0.4796324", "0.47858268", "0.47789323", "0.47727305", "0.47708714", "0.4770103", "0.47659567", "0.47621733", "0.47621733" ]
0.0
-1
Run `fns`. Last argument must be a completion handler.
function run() { var index = -1 var input = slice.call(arguments, 0, -1) var done = arguments[arguments.length - 1] if (typeof done !== 'function') { throw new Error('Expected function as last argument, not ' + done) } next.apply(null, [null].concat(input)) // Run the next `fn`, if any. function next(err) { var fn = fns[++index] var params = slice.call(arguments, 0) var values = params.slice(1) var length = input.length var pos = -1 if (err) { done(err) return } // Copy non-nully input into values. while (++pos < length) { if (values[pos] === null || values[pos] === undefined) { values[pos] = input[pos] } } input = values // Next or done. if (fn) { wrap(fn, next).apply(null, input) } else { done.apply(null, [null].concat(input)) } } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function runAll(whenFn, fns, resolveIdx) {\n //var deferred = when.defer();\n return whenFn(fns)\n .then(\n function(results) {\n return results[resolveIdx];\n },\n function(err) {\n return when.reject(err);\n }\n );\n}", "function run() {\n var index = -1;\n var input = slice$3.call(arguments, 0, -1);\n var done = arguments[arguments.length - 1];\n\n if (typeof done !== 'function') {\n throw new Error('Expected function as last argument, not ' + done)\n }\n\n next.apply(null, [null].concat(input));\n\n // Run the next `fn`, if any.\n function next(err) {\n var fn = fns[++index];\n var params = slice$3.call(arguments, 0);\n var values = params.slice(1);\n var length = input.length;\n var pos = -1;\n\n if (err) {\n done(err);\n return\n }\n\n // Copy non-nully input into values.\n while (++pos < length) {\n if (values[pos] === null || values[pos] === undefined) {\n values[pos] = input[pos];\n }\n }\n\n input = values;\n\n // Next or done.\n if (fn) {\n wrap$2(fn, next).apply(null, input);\n } else {\n done.apply(null, [null].concat(input));\n }\n }\n }", "function run() {\n var index = -1\n var input = slice.call(arguments, 0, -1)\n var done = arguments[arguments.length - 1]\n\n if (typeof done !== 'function') {\n throw new Error('Expected function as last argument, not ' + done)\n }\n\n next.apply(null, [null].concat(input))\n\n /* Run the next `fn`, if any. */\n function next(err) {\n var fn = fns[++index]\n var params = slice.call(arguments, 0)\n var values = params.slice(1)\n var length = input.length\n var pos = -1\n\n if (err) {\n done(err)\n return\n }\n\n /* Copy non-nully input into values. */\n while (++pos < length) {\n if (values[pos] === null || values[pos] === undefined) {\n values[pos] = input[pos]\n }\n }\n\n input = values\n\n /* Next or done. */\n if (fn) {\n wrap(fn, next).apply(null, input)\n } else {\n done.apply(null, [null].concat(input))\n }\n }\n }", "function run() {\n var index = -1\n var input = slice.call(arguments, 0, -1)\n var done = arguments[arguments.length - 1]\n\n if (typeof done !== 'function') {\n throw new Error('Expected function as last argument, not ' + done)\n }\n\n next.apply(null, [null].concat(input))\n\n /* Run the next `fn`, if any. */\n function next(err) {\n var fn = fns[++index]\n var params = slice.call(arguments, 0)\n var values = params.slice(1)\n var length = input.length\n var pos = -1\n\n if (err) {\n done(err)\n return\n }\n\n /* Copy non-nully input into values. */\n while (++pos < length) {\n if (values[pos] === null || values[pos] === undefined) {\n values[pos] = input[pos]\n }\n }\n\n input = values\n\n /* Next or done. */\n if (fn) {\n wrap(fn, next).apply(null, input)\n } else {\n done.apply(null, [null].concat(input))\n }\n }\n }", "function executeValidateFns(fns, payload) {\n \n if (fns.length === 1) {\n return fns[0](payload);\n }\n\n const { error, value } = fns.pop()(payload);\n\n if (error) {\n return { error };\n }\n\n return executeValidateFns(fns, value);\n}", "function run(fn) {\n if (fn)\n fn(next);\n else\n callback(null, results);\n }", "function executeFunctions() {\n\t\tvar len = functions.length;\n\n\t\tfunctionsExecuted = true;\n\n\t\tfor ( var x = 0; x < len; x++ ) {\n\t\t\tfunctions[x]();\n\t\t}\n\n\t}", "function invoke(fns, value) {\n return fns.reduce(callWith, value);\n}", "function seq (_fns) {\n var fns = _fns.slice()\n var callCount = 0\n return function () {\n var next = fns.shift()\n callCount++\n if (!next) {\n throw new Error('Received too many calls. Expected ' + _fns.length + ' got ' + callCount)\n }\n return next.apply(this, arguments)\n }\n}", "function multiFunction(options, done) {\n // iterate inputs\n // load input\n // print input as header (after load in case input provides a name)\n // iterate functions\n // thrash next function with input\n // print thrash result with function's name as tail\n // repeat until all functions are used with input\n // repeat until all inputs are used with all functions\n\n try { // catches require() error\n\n // TODO: accept return result to check if we had an error?\n iterateFns(options)\n\n done()\n\n } catch(error) {\n done(error)\n }\n\n}", "function run(...input) {\n var index = -1\n var done = input.pop()\n\n if (typeof done !== 'function') {\n throw new TypeError('Expected function as last argument, not ' + done)\n }\n\n next(null, ...input)\n\n // Run the next `fn`, if any.\n function next(...values) {\n var fn = fns[++index]\n var error = values.shift()\n var pos = -1\n\n if (error) {\n done(error)\n return\n }\n\n // Copy non-nullish input into values.\n while (++pos < input.length) {\n if (values[pos] === null || values[pos] === undefined) {\n values[pos] = input[pos]\n }\n }\n\n // Next or done.\n if (fn) {\n wrap(fn, next)(...values)\n } else {\n done(null, ...values)\n }\n }\n }", "runCallbacks(callbacks, args) {\r\n for (let i = 0; i < callbacks.length; i++) {\r\n if (typeof callbacks[i] !== 'function') continue;\r\n callbacks[i].apply(null, args);\r\n }\r\n }", "function call(functions, scope) {\n\n // Allow the passing of an unwrapped function.\n // Leaves other code a more comprehensible.\n if (!$.isArray(functions)) {\n functions = [functions];\n }\n\n $.each(functions, function () {\n if (typeof this === 'function') {\n this.call(scope);\n }\n });\n }", "function next(err, result) {\n if (err)\n return callback(err, results);\n results.push(result);\n if (fns.length)\n run(fns.shift());\n else\n callback(null, results);\n }", "function routine (fn, sets, context) {\n const master = []\n\n if (typeof context === 'undefined') {\n context = fn\n }\n\n for (const args of sets) {\n master.push(fn.apply(context, Array.isArray(args) ? args : [args]))\n }\n\n return Promise.all(master)\n}", "function main(...fns) {return fns.reduce(pipe)}", "static async _runReturnHandlers(handlers) {\n for (const handler of handlers) {\n await new Promise((resolve, reject) => {\n handler((err) => (err ? reject(err) : resolve()));\n });\n }\n }", "function runSomeFunctionsWithCompose(...fns) {\n return fns.reduce(compose)\n}", "function pipe(...fns) {\n const fnArguments = Array(...fns)\n return function(x) {\n let result = null;\n console.log(fns)\n fnArguments.forEach(fn => {\n if(!result) {\n result = fn(x)\n } else {\n result = fn(result)\n }\n console.log(result)\n })\n\n return result\n }\n \n}", "function runHookFunctions (i, hooksList, data, doneAll){\n hooksList[i](data, function afterRunHookFN (err){\n if (err) return doneAll(err);\n // next hook indice\n i++;\n\n if (i < hooksList.length) {\n // run hook if have hooks\n runHookFunctions(i, hooksList, data, doneAll);\n } else {\n // done all\n doneAll();\n }\n });\n}", "function runFuns(funArr){\n for(let el of funArr){\n sep(); \n var label = el[0], f = el[1]; \n console.log('Running ' + label);\n f();\n }\n}", "function testFunctions()\n{\n let _count = 100;\n const _getFn = () =>\n {\n const _n = _count++;\n return (cb) => setTimeout(\n () => cb(null, _n),\n Math.random() * 50\n );\n };\n jfSync(\n [\n _getFn(),\n _getFn(),\n _getFn(),\n _getFn(),\n _getFn()\n ],\n (error, data) => checkData([100, 101, 102, 103, 104])\n );\n}", "function executeDeferChain(fns, args, d, i) {\n var returnObj;\n d = d || $q.defer();\n i = i || 0;\n if (i === 0) {\n fns = _.filter(fns, function (fn) {\n return !(_.isUndefined(fn) || _.isNull(fn));\n });\n }\n if (fns && i < fns.length) {\n try {\n returnObj = fns[i].apply(undefined, args);\n $q.when(returnObj, function () {\n executeDeferChain(fns, args, d, i + 1);\n }, d.reject);\n } catch (e) {\n d.reject(e);\n }\n } else {\n d.resolve();\n }\n return d.promise;\n }", "function doAll(/* args */){\n\t\tvar fn = Array.prototype.shift.call(arguments);\n\t\tif(!arguments.length) {\n\t\t\treturn fn();\n\t\t} else {\n\t\t\tfn();\n\t\t\treturn doAll.apply(null, arguments);\n\t\t}\n\t}", "function functionChain(successValue, failValue, fns) {\n for (var i = 0; i < fns.length; i++) {\n var o = fns[i][0][fns[i][1]].apply(fns[i][0], fns[i][2]);\n if (o === failValue) {\n return o;\n }\n }\n return successValue;\n }", "function runTasks(tasks) {\n debug('run tasks');\n var task; while (task = tasks.shift()) task();\n}", "function runTasks(tasks) {\n debug('run tasks');\n var task; while (task = tasks.shift()) task();\n}", "function pipe(...fns) {\n return arg => fns.reduce((fn1, fn2) => fn2(fn1), arg)\n}", "function runSomeFunctionsWithPipe(...fns) {\n return fns.reduce(pipe)\n}", "function executeFunctionsUntilMatch(functionMaps, keys, arg, context) {\n var e_1, _a, e_2, _b;\n keys = Array.isArray(keys) ? keys : [keys];\n try {\n for (var keys_1 = __values(keys), keys_1_1 = keys_1.next(); !keys_1_1.done; keys_1_1 = keys_1.next()) {\n var key = keys_1_1.value;\n var _loop_1 = function (functionMap) {\n var func = functionMap[key];\n if (func == null)\n return \"continue\";\n // Save a \"continue\" flag if necessary\n var shouldContinue = false;\n var result = func(arg, __assign(__assign({}, context), { emitContinue: function () {\n shouldContinue = true;\n } }));\n // Return a result if not undefined\n if (result != null) {\n return { value: { value: result, shouldContinue: shouldContinue } };\n }\n };\n try {\n // Loop through each function\n for (var functionMaps_1 = (e_2 = void 0, __values(functionMaps)), functionMaps_1_1 = functionMaps_1.next(); !functionMaps_1_1.done; functionMaps_1_1 = functionMaps_1.next()) {\n var functionMap = functionMaps_1_1.value;\n var state_1 = _loop_1(functionMap);\n if (typeof state_1 === \"object\")\n return state_1.value;\n }\n }\n catch (e_2_1) { e_2 = { error: e_2_1 }; }\n finally {\n try {\n if (functionMaps_1_1 && !functionMaps_1_1.done && (_b = functionMaps_1.return)) _b.call(functionMaps_1);\n }\n finally { if (e_2) throw e_2.error; }\n }\n }\n }\n catch (e_1_1) { e_1 = { error: e_1_1 }; }\n finally {\n try {\n if (keys_1_1 && !keys_1_1.done && (_a = keys_1.return)) _a.call(keys_1);\n }\n finally { if (e_1) throw e_1.error; }\n }\n return undefined;\n}", "function pipeline(args, callback)\n{\n\tvar funcs, uarg, rv, next;\n\n\tmod_assert.equal(typeof (args), 'object', '\"args\" must be an object');\n\tmod_assert.ok(Array.isArray(args['funcs']),\n\t '\"args.funcs\" must be specified and must be an array');\n\n\tfuncs = args['funcs'].slice(0);\n\tuarg = args['arg'];\n\n\trv = {\n\t 'operations': funcs.map(function (func) {\n\t\treturn ({\n\t\t 'func': func,\n\t\t 'funcname': func.name || '(anon)',\n\t\t 'status': 'waiting'\n\t\t});\n\t }),\n\t 'successes': [],\n\t 'ndone': 0,\n\t 'nerrors': 0\n\t};\n\n\tif (funcs.length === 0) {\n\t\tsetImmediate(function () { callback(null, rv); });\n\t\treturn (rv);\n\t}\n\n\tnext = function (err, result) {\n\t\tif (rv['nerrors'] > 0 ||\n\t\t rv['ndone'] >= rv['operations'].length) {\n\t\t\tthrow new mod_verror.VError('pipeline callback ' +\n\t\t\t 'invoked after the pipeline has already ' +\n\t\t\t 'completed (%j)', rv);\n\t\t}\n\n\t\tvar entry = rv['operations'][rv['ndone']++];\n\n\t\tmod_assert.equal(entry['status'], 'pending');\n\n\t\tentry['status'] = err ? 'fail' : 'ok';\n\t\tentry['err'] = err;\n\t\tentry['result'] = result;\n\n\t\tif (err)\n\t\t\trv['nerrors']++;\n\t\telse\n\t\t\trv['successes'].push(result);\n\n\t\tif (err || rv['ndone'] == funcs.length) {\n\t\t\tcallback(err, rv);\n\t\t} else {\n\t\t\tvar nextent = rv['operations'][rv['ndone']];\n\t\t\tnextent['status'] = 'pending';\n\n\t\t\t/*\n\t\t\t * We invoke the next function on the next tick so that\n\t\t\t * the caller (stage N) need not worry about the case\n\t\t\t * that the next stage (stage N + 1) runs in its own\n\t\t\t * context.\n\t\t\t */\n\t\t\tsetImmediate(function () {\n\t\t\t\tnextent['func'](uarg, next);\n\t\t\t});\n\t\t}\n\t};\n\n\trv['operations'][0]['status'] = 'pending';\n\tfuncs[0](uarg, next);\n\n\treturn (rv);\n}", "async addAll(functions, options) {\n return Promise.all(functions.map(async function_ => this.add(function_, options)));\n }", "function parallel(args, callback)\n{\n\tvar funcs, rv, doneOne, i;\n\n\tmod_assert.equal(typeof (args), 'object', '\"args\" must be an object');\n\tmod_assert.ok(Array.isArray(args['funcs']),\n\t '\"args.funcs\" must be specified and must be an array');\n\tmod_assert.equal(typeof (callback), 'function',\n\t 'callback argument must be specified and must be a function');\n\n\tfuncs = args['funcs'].slice(0);\n\n\trv = {\n\t 'operations': new Array(funcs.length),\n\t 'successes': [],\n\t 'ndone': 0,\n\t 'nerrors': 0\n\t};\n\n\tif (funcs.length === 0) {\n\t\tsetImmediate(function () { callback(null, rv); });\n\t\treturn (rv);\n\t}\n\n\tdoneOne = function (entry) {\n\t\treturn (function (err, result) {\n\t\t\tmod_assert.equal(entry['status'], 'pending');\n\n\t\t\tentry['err'] = err;\n\t\t\tentry['result'] = result;\n\t\t\tentry['status'] = err ? 'fail' : 'ok';\n\n\t\t\tif (err)\n\t\t\t\trv['nerrors']++;\n\t\t\telse\n\t\t\t\trv['successes'].push(result);\n\n\t\t\tif (++rv['ndone'] < funcs.length)\n\t\t\t\treturn;\n\n\t\t\tvar errors = rv['operations'].filter(function (ent) {\n\t\t\t\treturn (ent['status'] == 'fail');\n\t\t\t}).map(function (ent) { return (ent['err']); });\n\n\t\t\tif (errors.length > 0)\n\t\t\t\tcallback(new mod_verror.MultiError(errors), rv);\n\t\t\telse\n\t\t\t\tcallback(null, rv);\n\t\t});\n\t};\n\n\tfor (i = 0; i < funcs.length; i++) {\n\t\trv['operations'][i] = {\n\t\t\t'func': funcs[i],\n\t\t\t'funcname': funcs[i].name || '(anon)',\n\t\t\t'status': 'pending'\n\t\t};\n\n\t\tfuncs[i](doneOne(rv['operations'][i]));\n\t}\n\n\treturn (rv);\n}", "async addAll(functions, options) {\n return Promise.all(functions.map(async (function_) => this.add(function_, options)));\n }", "async addAll(functions, options) {\n return Promise.all(functions.map(async (function_) => this.add(function_, options)));\n }", "async function runHandlers(handlers) {\n try {\n await batchProcess(0, handlers)\n } catch (errs) {\n report('one or more errors occurred in change handlers', handlers, errs)\n }\n}", "function run (fun1) {\n fun1()\n}", "function oneAtATime(fns){\n fns = slice.call(fns);\n var fn = shift.call(fns);\n if(!fn) {\n return;\n }\n return fn().then(function(val){\n return fns.length\n ? oneAtATime(fns)\n : val;\n });\n}", "function run (fun) {\n fun() \n}", "executeFunction(fn, args) { return fn(...args); }", "executeFunction(fn, args) { return fn(...args); }", "function executeTasks() {\n var tasks = Array.prototype.concat.apply([], arguments);\n var task = tasks.shift();\n task(function() {\n if (tasks.length > 0) {\n executeTasks.apply(this, tasks);\n }\n });\n}", "function run(fun) {\n fun()\n}", "function run(fun) {\n fun()\n}", "function run(fun) {\n fun()\n}", "function run(fun){\n fun()\n}", "function run(fun){\n fun()\n}", "function run(fun){\n fun()\n}", "function call(fn, args) {\n if (args.length === 2) {\n return fn(args[0], args[1]);\n }\n\n if (args.length === 1) {\n return fn(args[0]);\n }\n\n return fn();\n}", "function _reversefns(fns, args) {\n\t\tif (fns)\n\t\t\t//we group methods together if their parents are the same\n\t\t\t//then we invoke them in the normal order (not reverse), s.t.,\n\t\t\t//child invokes firsd, but also superclass invoked first (first register, first call if same object)\n\t\t\tfor (var j = fns.length, k = j - 1, i, f, oldp, newp; j >= 0;) {\n\t\t\t\tif (--j < 0 || (oldp != (newp=fns[j][1].parent) && oldp)) {\n\t\t\t\t\tfor (i = j; ++i <= k;) {\n\t\t\t\t\t\tf = fns[i];\n\t\t\t\t\t\tf[0].apply(f[1], args);\n\t\t\t\t\t}\n\t\t\t\t\tk = j;\n\t\t\t\t}\n\t\t\t\toldp = newp;\n\t\t\t}\n\t}", "function myOtherrunFunctions(b,c){\r\n console.log(\"I'm another function that will run two other functions.\");\r\n b();\r\n c(); \r\n}", "executeFunction(fn, args) {\n return fn(...args);\n }", "executeFunction(fn, args) {\n return fn(...args);\n }", "step_func_done(func) { func(); }", "function sequence(...fns) {\n return function(...args) {\n return fns.reduce((prev, curr) => curr(prev), args);\n };\n}", "function runCmds(cmds) {\n if (cmds.length==1) return cmds[0]();\n return cmds[0]( runCmds(cmds.slice(1)) );\n }", "function run( str, fn, ret, args ){\n\t\t\t\treturn runFn( str, fn, ret, args || [], isAsync, reject, brackets );\n\t\t\t}", "function runFn( str, fn, returnHandle, args, isAsync, reject, brackets ){\n\t\t\tvar result,\n\t\t\t\t//custom resolve handle which updates the result variable to the resolved value\n\t\t\t\tresolveHandle = function( val ){\n\t\t\t\t\tresult = val;\n\t\t\t\t},\n\t\t\t\thasError = false,\n\t\t\t\t//custom reject handle to run the initial reject function and set hasError to true\n\t\t\t\trejectHandle = function( err ){\n\t\t\t\t\treject( err );\n\t\t\t\t\thasError = true;\n\t\t\t\t};\n\t\t\t\n\t\t\t//To run the given function with the given resolve and reject handles\n\t\t\tfunction run( resolve, reject ){\n\t\t\t\tvar close,\n\t\t\t\t\t//create a new extraction\n\t\t\t\t\tX = new Extraction( isAsync, reject, str, brackets );\n\t\t\t\t\n\t\t\t\t/*\n\t\t\t\tTo finish and resolve using the return handle\n\t\t\t\t\tInput :\n\t\t\t\t\t\t- content : handle string\n\t\t\t\t*/\n\t\t\t\tfunction finish( content ){\n\t\t\t\t\t//the nest is the Extraction base nest (or an empty nest if there is an error)\n\t\t\t\t\tvar nest = hasError ? new Nest() : X.Nest.public,\n\t\t\t\t\t\t//get the return value by running the returnHandle in the context of the nest with the handled string as the input argument\n\t\t\t\t\t\tvalue = returnHandle.call( nest, content);\n\t\t\t\t\t\t\n\t\t\t\t\t//resolve with the return value\n\t\t\t\t\tresolve( value );\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t//run the given function with the given arguments\n\t\t\t\tfn.apply( X, args );\n\t\t\t\t\n\t\t\t\t//try to close the Extraction\n\t\t\t\tclose = X.tryClose();\n\t\t\t\t\n\t\t\t\t//if Async, then 'close' is a Promise, so run the finish function when resolved\n\t\t\t\tif( isAsync ) close.then(finish,reject);\n\t\t\t\t//otherwise, finish using 'close' as the input argument\n\t\t\t\telse finish( close );\n\t\t\t}\n\t\t\n\t\t\t//if in async mode, then run the function inside a Promise\n\t\t\tif( isAsync ) return new Promise( run )\n\t\t\t//otherwise, run the function using the custom resolve and reject handles\n\t\t\trun( resolveHandle, rejectHandle );\n\t\t\t//and return the result\n\t\t\treturn result; \n\t\t}", "function normalizeFns(fns) {\n Object.keys(fns).forEach(function(key) {\n var handler = fns[key];\n if (typeof handler === 'function') {\n fns[key] = {\n enter: handler,\n leave: noop\n };\n }\n });\n}", "function _HandleFunctions(pstrTok, pStack, pdtFormat, parrVars)\n {\n var varTmp, varTerm, varTerm2, objTmp, varFormat;\n var objOp1, objOp2, objFormat;\n var arrArgs;\n var intCntr;\n\n\n\n if (!pstrTok.isFunction)\n throw \"Unsupported function token [\" + pstrTok.val + \"]\";\n\n varTmp = pstrTok.val;\n arrArgs = new Array();\n varTerm = Tokenizer.ARG_TERMINAL;\n while ( !pStack.IsEmpty() )\n {\n varTerm = pStack.Pop();\n if (!varTerm.isArgTerminal)\n arrArgs[arrArgs.length] = varTerm;\n else\n break;\n }\n\n // console.log( 'testing functions ', varTmp, arrArgs );\n\n switch (varTmp)\n {\n case \"ARRAY\" :\n var arrArray=new Array();\n \n objTmp = 0;\n intCntr = arrArgs.length;\n while (--intCntr >= 0)\n {\n varTerm = arrArgs[intCntr];\n if (varTerm.isVariable)\n {\n objTmp = parrVars[varTerm.val];\n if (objTmp == undefined || objTmp == null)\n throw \"Variable [\" + varTerm.val + \"] not defined\";\n else\n varTerm = objTmp;\n }\n arrArray=arrArray.concat(Tokenizer.toArray(varTerm.val));\n }\n pStack.Push(Tokenizer.makeToken(arrArray,Tokenizer.TOKEN_TYPE.ARRAY));\n break;\n case \"TODAY\" :\n pStack.Push(Tokenizer.makeToken(DateParser.currentDate(), Tokenizer.TOKEN_TYPE.DATE));\n break;\n case \"ACOS\" :\n case \"ASIN\" :\n case \"ATAN\" :\n throw \"Function [\" + varTmp + \"] is not implemented!\";\n break;\n case \"ABS\" :\n case \"CHR\" :\n case \"COS\" :\n case \"FIX\" :\n case \"HEX\" :\n case \"LOG\" :\n case \"RAND\" :\n case \"ROUND\" :\n case \"SIN\" :\n case \"SQRT\" :\n case \"TAN\" :\n\n if (varTmp != \"RAND\")\n {\n if (arrArgs.length < 1)\n throw varTmp + \" requires at least one argument!\";\n else if (arrArgs.length > 1)\n throw varTmp + \" requires only one argument!\";\n }\n else\n {\n if (arrArgs.length < 1)\n throw varTmp + \" requires at least one argument!\";\n else if (arrArgs.length > 2)\n throw varTmp + \" requires at most two arguments!\";\n }\n varTerm = arrArgs[0];\n if (varTerm.isVariable)\n {\n objTmp = parrVars[varTerm.val];\n if (objTmp == undefined || objTmp == null)\n throw \"Variable [\" + varTerm.val + \"] not defined\";\n else\n varTerm = objTmp;\n }\n \n objTmp = varTerm.val;\n\n if( varTerm.val !== 0 && !varTerm.val )\n throw varTmp + \" operates on numeric operands only!\";\n \n else if ( isNaN( +varTerm.val ) )\n throw varTmp + \" operates on numeric operands only!\";\n else\n {\n\n objTmp = Tokenizer.toNumber(varTerm.val);\n if (varTmp == \"RAND\")\n {\n rand_max=Math.floor(objTmp);\n if (arrArgs.length == 2)\n {\n varTerm = arrArgs[1];\n if (varTerm.isVariable)\n {\n objTmp = parrVars[varTerm.val];\n if (objTmp == undefined || objTmp == null)\n throw \"Variable [\" + varTerm.val + \"] not defined\";\n else\n varTerm = objTmp;\n }\n \n if (!varTerm.isNumber)\n throw varTmp + \" operates on numeric operands only!\";\n \n objTmp = Tokenizer.toNumber(varTerm.val);\n \n rand_min=Math.floor(objTmp);\n }\n }\n }\n \n if (varTmp == \"ABS\")\n pStack.Push(Tokenizer.makeToken(Math.abs(objTmp),Tokenizer.TOKEN_TYPE.NUMBER));\n else if (varTmp == \"CHR\"){\n // TODO check what happens when $objTmp is empty; what does fromCharCode() return?\n\n pStack.Push(Tokenizer.makeToken(String.fromCharCode(objTmp),Tokenizer.TOKEN_TYPE.STRING_LITERAL));\n }\n else if (varTmp == \"COS\")\n pStack.Push(Tokenizer.makeToken(Math.cos(objTmp),Tokenizer.TOKEN_TYPE.NUMBER));\n else if (varTmp == \"FIX\")\n pStack.Push(Tokenizer.makeToken(Math.floor(objTmp),Tokenizer.TOKEN_TYPE.NUMBER));\n else if (varTmp == \"HEX\")\n pStack.Push(Tokenizer.makeToken(objTmp.toString(16),Tokenizer.TOKEN_TYPE.STRING_LITERAL));\n else if (varTmp == \"LOG\")\n pStack.Push(Tokenizer.makeToken(Math.log(objTmp),Tokenizer.TOKEN_TYPE.NUMBER));\n else if (varTmp == \"RAND\")\n pStack.Push(Tokenizer.makeToken(Math.round(rand_min+(rand_max-rand_min)*Math.random()),Tokenizer.TOKEN_TYPE.NUMBER));\n else if (varTmp == \"ROUND\")\n pStack.Push(Tokenizer.makeToken(Math.round(objTmp),Tokenizer.TOKEN_TYPE.NUMBER));\n else if (varTmp == \"SIN\")\n pStack.Push(Tokenizer.makeToken(Math.sin(objTmp),Tokenizer.TOKEN_TYPE.NUMBER));\n else if (varTmp == \"SQRT\")\n pStack.Push(Tokenizer.makeToken(Math.sqrt(objTmp),Tokenizer.TOKEN_TYPE.NUMBER));\n else if (varTmp == \"TAN\")\n pStack.Push(Tokenizer.makeToken(Math.tan(objTmp),Tokenizer.TOKEN_TYPE.NUMBER));\n break;\n case \"STR\" :\n if (arrArgs.length < 1)\n throw varTmp + \" requires at least one argument!\";\n else if (arrArgs.length > 2)\n throw varTmp + \" requires at most two arguments!\";\n varTerm = arrArgs[arrArgs.length-1];\n if (varTerm.isVariable)\n {\n objTmp = parrVars[varTerm.val];\n if (objTmp == undefined || objTmp == null)\n throw \"Variable [\" + varTerm.val + \"] not defined\";\n else\n varTerm = objTmp;\n }\n // if date, output formated date string\n if (varTerm.isDate)\n {\n var format='';\n if (arrArgs.length==2)\n {\n varFormat = arrArgs[0];\n if (varFormat.isVariable)\n {\n objTmp = parrVars[varFormat.val];\n if (objTmp == undefined || objTmp == null)\n throw \"Variable [\" + varFormat.val + \"] not defined\";\n else\n varFormat = objTmp;\n }\n \n if (!varFormat.isStringLiteral)\n throw \"format argument for \" + varTmp + \" must be a string!\";\n format=varFormat.val;\n }\n pStack.Push(Tokenizer.makeToken(DateParser.formatDate(varTerm.val, format),Tokenizer.TOKEN_TYPE.STRING_LITERAL));\n }\n else // just convert to string\n pStack.Push(Tokenizer.makeToken(varTerm.val.toString(),Tokenizer.TOKEN_TYPE.STRING_LITERAL));\n break;\n case \"ASC\" :\n\n if (arrArgs.length > 1)\n throw varTmp + \" requires only one argument!\";\n else if (arrArgs.length < 1)\n throw varTmp + \" requires at least one argument!\";\n varTerm = arrArgs[0];\n if (varTerm.isVariable)\n {\n objTmp = parrVars[varTerm.val];\n if (objTmp == undefined || objTmp == null)\n throw \"Variable [\" + varTerm.val + \"] not defined\";\n else\n varTerm = objTmp;\n }\n if( varTerm.isNumber )\n {\n varTerm.val = varTerm.val.toString();\n varTerm.isStringLiteral = true;\n }\n\n if (!varTerm.isStringLiteral)\n throw varTmp + \" requires a string type operand!\";\n else\n {\n\t\t\t\t\t\tif ( varTerm.val ) {\n\t\t\t\t\t\t\tpStack.Push(Tokenizer.makeToken(varTerm.val.charCodeAt(0),Tokenizer.TOKEN_TYPE.NUMBER));\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tpStack.Push(Tokenizer.makeToken(0,Tokenizer.TOKEN_TYPE.NUMBER));\n\t\t\t\t\t\t}\n }\n break;\n case \"REGEX\" :\n if (arrArgs.length < 1)\n throw varTmp + \" requires at least one argument!\";\n else if (arrArgs.length > 2)\n throw varTmp + \" requires at most two arguments!\";\n \n varTerm = arrArgs[arrArgs.length-1];\n if (varTerm.isVariable)\n {\n objTmp = parrVars[varTerm.val];\n if (objTmp == undefined || objTmp == null)\n throw \"Variable [\" + varTerm.val + \"] not defined\";\n else\n varTerm = objTmp;\n }\n \n if (!varTerm.isStringLiteral)\n throw varTmp + \" operates on string type operands!\";\n \n var opts=Tokenizer.EMPTY_STRING;\n if (arrArgs.length==2)\n {\n opts = arrArgs[0];\n if (opts.isVariable)\n {\n objTmp = parrVars[opts.val];\n if (objTmp == undefined || objTmp == null)\n throw \"Variable [\" + opts.val + \"] not defined\";\n else\n opts = objTmp;\n }\n \n if (!opts.isStringLiteral)\n throw varTmp + \" operates on string type operands!\";\n }\n pStack.Push(Tokenizer.makeToken(Functions.Regex(varTerm.val.toString(), opts.val.toString()),Tokenizer.TOKEN_TYPE.REGEX));\n break;\n case \"LCASE\" :\n case \"UCASE\" :\n case \"NUM\" :\n\n if (arrArgs.length < 1)\n throw varTmp + \" requires at least one argument!\";\n else if (arrArgs.length > 1)\n throw varTmp + \" requires only one argument!\";\n\n varTerm = arrArgs[0];\n if (varTerm.isVariable)\n {\n objTmp = parrVars[varTerm.val];\n if (objTmp == undefined || objTmp == null)\n throw \"Variable [\" + varTerm.val + \"] not defined\";\n else\n varTerm = objTmp;\n }\n\n if( varTerm.isNumber )\n {\n varTerm.val = varTerm.val.toString();\n varTerm.isStringLiteral = true;\n }\n\n if (!varTerm.isStringLiteral && varTmp != \"NUM\")\n throw varTmp + \" requires a string type operand!\";\n else\n {\n if (varTmp == \"LCASE\")\n {\n pStack.Push(Tokenizer.makeToken(varTerm.val.toLowerCase(),Tokenizer.TOKEN_TYPE.STRING_LITERAL));\n }\n else if (varTmp == \"UCASE\")\n {\n pStack.Push(Tokenizer.makeToken(varTerm.val.toUpperCase(),Tokenizer.TOKEN_TYPE.STRING_LITERAL));\n }\n else if (varTmp == \"NUM\")\n {\n objTmp=Tokenizer.toNumber(varTerm.val)+0.0;\n if (isNaN(objTmp))\n throw varTmp + \" cannot convert [\" + varTerm.val + \"] to number!\";\n pStack.Push(Tokenizer.makeToken(objTmp,Tokenizer.TOKEN_TYPE.NUMBER));\n }\n }\n break;\n case \"LEN\" :\n if (arrArgs.length < 1)\n throw varTmp + \" requires at least one argument!\";\n else if (arrArgs.length > 1)\n throw varTmp + \" requires only one argument!\";\n\n varTerm = arrArgs[0];\n if (varTerm.isVariable)\n {\n objTmp = parrVars[varTerm.val];\n if (objTmp == undefined || objTmp == null)\n throw \"Variable [\" + varTerm.val + \"] not defined\";\n else\n varTerm = objTmp;\n }\n\n if (!varTerm.isArray && !varTerm.isStringLiteral)\n throw varTmp + \" requires a string or array type operand!\";\n else\n {\n pStack.Push(Tokenizer.makeToken(varTerm.val.length,Tokenizer.TOKEN_TYPE.NUMBER));\n }\n break;\n case \"USER\" :\n if (arrArgs.length < 1)\n throw varTmp + \" requires at least one argument!\";\n else if (arrArgs.length > 1)\n throw varTmp + \" requires only one argument!\";\n\n varTerm = arrArgs[0];\n if (varTerm.isVariable)\n {\n objTmp = parrVars[varTerm.val];\n if (objTmp == undefined || objTmp == null)\n throw \"Variable [\" + varTerm.val + \"] not defined\";\n else\n varTerm = objTmp;\n }\n\n if (!varTerm.isStringLiteral)\n throw varTmp + \" requires a string type operand!\";\n else\n {\n pStack.Push(Tokenizer.makeToken(Functions.User(varTerm.val),Tokenizer.TOKEN_TYPE.STRING_LITERAL));\n }\n break;\n case \"COOKIE\" :\n if (arrArgs.length < 1)\n throw varTmp + \" requires at least one argument!\";\n else if (arrArgs.length > 1)\n throw varTmp + \" requires only one argument!\";\n\n varTerm = arrArgs[0];\n if (varTerm.isVariable)\n {\n objTmp = parrVars[varTerm.val];\n if (objTmp == undefined || objTmp == null)\n throw \"Variable [\" + varTerm.val + \"] not defined\";\n else\n varTerm = objTmp;\n }\n\n if (!varTerm.isStringLiteral)\n throw varTmp + \" requires a string type operand!\";\n else\n {\n //console.log(varTerm.val,varTerm.val.length);\n pStack.Push(Tokenizer.makeToken(Functions.Cookie(varTerm.val),Tokenizer.TOKEN_TYPE.STRING_LITERAL));\n }\n break;\n case \"CONTAINS\" :\n // console.log( 'testing functions ', varTmp, arrArgs );\n if (arrArgs.length < 2)\n throw varTmp + \" requires at least two arguments!\";\n else if (arrArgs.length > 2)\n throw varTmp + \" requires only two arguments!\";\n\n varTerm = arrArgs[1];\n if (varTerm.isVariable)\n {\n objTmp = parrVars[varTerm.val];\n if (objTmp == undefined || objTmp == null)\n throw \"Variable [\" + varTerm.val + \"] not defined\";\n else\n varTerm = objTmp;\n }\n varTerm2 = arrArgs[0];\n if (varTerm2.isVariable)\n {\n objTmp = parrVars[varTerm2.val];\n if (objTmp == undefined || objTmp == null)\n throw \"Variable [\" + varTerm2.val + \"] not defined\";\n else\n varTerm2 = objTmp;\n }\n\n if ( !varTerm.isArray )\n throw varTmp + \" requires an array as first argument!\";\n else\n {\n var found=false;\n /*var ii=varTerm.val.length;\n while(--ii>=0)\n {\n if (varTerm.val[ii]==varTerm2.val)\n {\n found=true;\n break;\n }\n }*/\n found=Functions.Contains(varTerm.val, varTerm2.val);\n pStack.Push(Tokenizer.makeToken(found,Tokenizer.TOKEN_TYPE.BOOLEAN));\n }\n break;\n case \"DATE\" :\n if (arrArgs.length < 2)\n throw varTmp + \" requires at least two arguments!\";\n else if (arrArgs.length > 2)\n throw varTmp + \" requires only two arguments!\";\n\n varTerm = arrArgs[1];\n if (varTerm.isVariable)\n {\n objTmp = parrVars[varTerm.val];\n if (objTmp == undefined || objTmp == null)\n throw \"Variable [\" + varTerm.val + \"] not defined\";\n else\n varTerm = objTmp;\n }\n varFormat = arrArgs[0];\n if (varFormat.isVariable)\n {\n objFormat = parrVars[varFormat.val];\n if (objFormat == undefined || objFormat == null)\n throw \"Variable [\" + varFormat.val + \"] not defined\";\n else\n varFormat = objFormat;\n }\n\n var dateobj={};\n if (\n (!varTerm.isStringLiteral) || \n (!varFormat.isStringLiteral)\n )\n throw varTmp + \" requires string type operands!\";\n else if (!Tokenizer.isDate(varTerm.val, varFormat.val, dateobj))\n throw varTmp + \" can not convert [\" + varTerm.val + \"] to a valid date with format [\" + varFormat.val + \"]!\";\n else\n {\n if (dateobj.date)\n pStack.Push(Tokenizer.makeToken(dateobj.date,Tokenizer.TOKEN_TYPE.DATE));\n else\n throw varTmp + \" unknown error\";\n }\n break;\n case \"empty\":\n case \"EMPTY\":\n if (arrArgs.length < 1)\n throw varTmp + \" requires at least one arguments!\";\n else if (arrArgs.length > 1)\n throw varTmp + \" requires only one arguments!\";\n\n varFormat = arrArgs[0];\n\n\n if( varFormat.isEmpty === true )\n {\n pStack.Push( Tokenizer.makeToken(true,Tokenizer.TOKEN_TYPE.BOOLEAN) );\n }\n else if( varFormat.isArray === true && varFormat.val.length === 0 )\n {\n pStack.Push( Tokenizer.makeToken(true,Tokenizer.TOKEN_TYPE.BOOLEAN) );\n }\n else if( varFormat.isStringLiteral === true && varFormat.val === \"\" )\n {\n pStack.Push( Tokenizer.makeToken(true,Tokenizer.TOKEN_TYPE.BOOLEAN) );\n }\n else if( varFormat.isDate && !varFormat.val )\n {\n pStack.Push( Tokenizer.makeToken(true,Tokenizer.TOKEN_TYPE.BOOLEAN) );\n }\n else\n {\n pStack.Push( Tokenizer.makeToken(false,Tokenizer.TOKEN_TYPE.BOOLEAN) );\n }\n\n\n break;\n case \"LEFT\" :\n case \"RIGHT\" :\n if (arrArgs.length < 2)\n throw varTmp + \" requires at least two arguments!\";\n else if (arrArgs.length > 2)\n throw varTmp + \" requires only two arguments!\";\n\n for (intCntr = 0; intCntr < arrArgs.length; intCntr++)\n {\n varTerm = arrArgs[intCntr];\n if (varTerm.isVariable)\n {\n objTmp = parrVars[varTerm.val];\n if (objTmp == undefined || objTmp == null)\n throw \"Variable [\" + varTerm.val + \"] not defined\";\n else\n varTerm = objTmp;\n }\n\n if( varTerm.isNumber )\n {\n arrArgs[1].val = arrArgs[1].val.toString()\n varTerm.isStringLiteral = true;\n }\n\n if (intCntr == 0 && !varTerm.isNumber)\n throw varTmp + \" operator requires numeric length!\";\n else if (intCntr == 1 && !varTerm.isStringLiteral)\n throw varTmp + \" operator requires a string operand!\";\n arrArgs[intCntr] = varTerm;\n }\n varTerm = arrArgs[1].val.toString();\n objTmp = Tokenizer.toNumber(arrArgs[0].val);\n if (varTmp == \"LEFT\")\n {\n pStack.Push(Tokenizer.makeToken(varTerm.substring(0, objTmp),Tokenizer.TOKEN_TYPE.STRING_LITERAL));\n }\n else\n {\n pStack.Push(Tokenizer.makeToken(varTerm.substr((varTerm.length - objTmp), objTmp),Tokenizer.TOKEN_TYPE.STRING_LITERAL));\n }\n break;\n case \"MID\" :\n case \"IIF\" :\n\n if (arrArgs.length < 3)\n throw varTmp + \" requires at least three arguments!\";\n else if (arrArgs.length > 3)\n throw varTmp + \" requires only three arguments!\";\n\n\n\n for (intCntr = 0; intCntr < arrArgs.length; intCntr++)\n {\n varTerm = arrArgs[intCntr];\n if (varTerm.isVariable)\n {\n objTmp = parrVars[varTerm.val];\n if (objTmp == undefined || objTmp == null)\n throw \"Variable [\" + varTerm.val + \"] not defined\";\n else\n varTerm = objTmp;\n }\n\n if( varTerm.isNumber )\n {\n arrArgs[2].val = arrArgs[2].val.toString()\n varTerm.isStringLiteral = true;\n }\n\n if (varTmp == \"MID\" && intCntr <= 1 && !varTerm.isNumber)\n throw varTmp + \" operator requires numeric lengths!\";\n else if (varTmp == \"MID\" && intCntr == 2 && !varTerm.isStringLiteral)\n throw varTmp + \" operator requires a string input!\";\n //else if (varTmp == \"IIF\" && intCntr == 2 && !varTerm.isBoolean && !varTerm.isNumber)\n //throw varTmp + \" operator requires boolean condition!\";\n arrArgs[intCntr] = varTerm;\n }\n if (varTmp == \"MID\")\n {\n varTerm = arrArgs[2].val.toString();\n objOp1 = Tokenizer.toNumber(arrArgs[1].val);\n objOp2 = Tokenizer.toNumber(arrArgs[0].val);\n pStack.Push(Tokenizer.makeToken(varTerm.substring(objOp1, objOp2),Tokenizer.TOKEN_TYPE.STRING_LITERAL));\n }\n else\n {\n\n varTerm = Tokenizer.toBoolean(arrArgs[2].val);\n\n if (varTerm)\n {\n objOp1 = arrArgs[1];\n }\n\n else\n {\n objOp1 = arrArgs[0];\n }\n\n pStack.Push(objOp1);\n }\n break;\n case \"AVG\" :\n case \"MAX\" :\n case \"MIN\" :\n if (arrArgs.length < 1)\n throw varTmp + \" requires at least one operand!\";\n\n var _arr=[];\n intCntr = arrArgs.length;\n while (--intCntr>=0)\n {\n varTerm = arrArgs[intCntr];\n if (varTerm.isVariable)\n {\n objTmp = parrVars[varTerm.val];\n if (objTmp == undefined || objTmp == null)\n throw \"Variable [\" + varTerm.val + \"] not defined\";\n else\n varTerm = objTmp;\n }\n\n if( jQuery.isArray( varTerm.val ) )\n {\n varTerm.isArray = true;\n }\n else if( varTerm.val !== '' || isNaN( +varTerm.val ) === false )\n {\n varTerm.isNumber = true;\n }\n\n if (!varTerm.isNumber && !varTerm.isArray)\n throw varTmp + \" requires numeric or array operands only!\";\n\n if (!varTerm.isArray)\n _arr=_arr.concat(Tokenizer.toArray(Tokenizer.toNumber(varTerm.val)));\n else\n _arr=_arr.concat(varTerm.val);\n }\n intCntr = -1;\n objTmp = 0;\n while (++intCntr < _arr.length)\n {\n varTerm = _arr[intCntr];\n if (varTmp == \"AVG\")\n objTmp += varTerm;\n else if (varTmp == \"MAX\")\n {\n if (intCntr == 0) \n objTmp = varTerm;\n else if (objTmp < varTerm)\n objTmp = varTerm;\n }\n else if (varTmp == \"MIN\")\n {\n if (intCntr == 0) \n objTmp = varTerm;\n else if (objTmp > varTerm)\n objTmp = varTerm;\n }\n }\n if (varTmp == \"AVG\" && _arr.length)\n pStack.Push(Tokenizer.makeToken(objTmp/_arr.length,Tokenizer.TOKEN_TYPE.NUMBER));\n else if (varTmp == \"AVG\")\n pStack.Push(Tokenizer.makeToken(0,Tokenizer.TOKEN_TYPE.NUMBER));\n else\n pStack.Push(Tokenizer.makeToken(objTmp,Tokenizer.TOKEN_TYPE.NUMBER));\n break;\n }\n }", "function chain() {\n var functions = Array.prototype.slice.call(arguments, 0);\n if (functions.length > 0) {\n var firstFunction = functions.shift();\n var firstPromise = firstFunction.call();\n firstPromise.done(function () {\n chain.apply(null, functions);\n });\n }\n }", "function chain() {\n var functions = Array.prototype.slice.call(arguments, 0);\n if (functions.length > 0) {\n var firstFunction = functions.shift();\n var firstPromise = firstFunction.call();\n firstPromise.done(function () {\n chain.apply(null, functions);\n });\n }\n }", "function chain() {\n var functions = Array.prototype.slice.call(arguments, 0);\n if (functions.length > 0) {\n var firstFunction = functions.shift();\n var firstPromise = firstFunction.call();\n firstPromise.done(function () {\n chain.apply(null, functions);\n });\n }\n }", "function compose(...fns) {\n return (...args) => {\n return fns.reduceRight((leftFn, rightFn) => {\n return leftFn instanceof Promise\n ? Promise.resolve(leftFn).then(rightFn)\n : rightFn(leftFn);\n }, args[0]);\n };\n}", "function makeChainedCallback(i, fns, results, cb) {\n return function(err, result) {\n if (err) {\n return cb(err);\n }\n results[i] = result;\n if (fns[i + 1]) {\n return fns[i + 1](makeChainedCallback(i + 1, fns, results, cb));\n } else {\n return cb(null, results);\n }\n };\n }", "async function run(funsAndArgs) {\n console.log('😌');\n let result = false;\n try {\n for (const [fun, args] of funsAndArgs) {\n console.log(`🙋 ${fun.name} ${args.join(' ')}`);\n if (!await fun(args)) {\n console.log(`🙅 ${fun.name}`);\n return;\n }\n console.log(`🙆 ${fun.name}`);\n }\n result = true;\n } catch (e) {\n console.error(e);\n } finally {\n console.log(result ? `🎉 ${rot13('Nqinapr Nhfgenyvn!')} 🇳🇿` : '😱');\n }\n return result;\n}", "function invoke(itfn, title, fn) {\n return itfn.call(this, title, function(done) {\n var failure = null;\n\n try {\n var promise = fn.call(this);\n if (promise && (typeof(promise.then) === 'function')) {\n promise.then(function(success) {\n if (failure != null) done(failure);\n else if (success === successInstance) done();\n else done(new Error(\"Not notified of completion: call 'done()' on the last promise\"));\n }, function(failure) {\n console.warn(\"Rejected: \", failure);\n done(failure);\n })\n } else if (promise === successPromise) {\n done(new Error(\"The completion notification 'done()' must be called as a function\"));\n done();\n } else {\n done(new Error(\"Test did not return a Promise\"));\n }\n } catch (error) {\n console.warn(\"Failed:\", error);\n done(failure = error);\n }\n });\n }", "function executeHandlers(arg) {\n var i;\n for (i = 0; i < notifyHandlers.length; i++) {\n try {\n notifyHandlers[i](arg);\n } catch (err) {\n console.error('Error in promise notify handler');\n console.error(err);\n }\n }\n }", "function run(fun) {\n fun(); // Executa a funcao passada como parametro\n}", "function invokeConfigFn(tasks) {\n for(var i in tasks) {\n if(tasks.hasOwnProperty(i) && /^f/.test(typeof tasks[i])) {\n tasks[i](grunt);\n }\n }\n }", "function executeCallbacks() {\n while (callbacks.length > 0) {\n var callback = callbacks.shift();\n callback();\n }\n}", "function then(fn_done, fn_fail) {\r\n done(fn_done);\r\n fail(fn_fail);\r\n }", "function runCallbacks() {\n\n\t\tcallbacks.forEach(function (callback) {\n\t\t\tcallback();\n\t\t});\n\n\t\trunning = false;\n\t}", "step_func(func) { func(); }", "function callFunctions(){\n addition(10, 20);\n subtraction(30, 10);\n}", "function fuse(fn1, fn2, opt_excludeRetArgs) {\r\n var fns = slice(arguments), l = fns.length;\r\n opt_excludeRetArgs = typeOf(fns[l - 1], 'Function') ? 0 : (l--, fns.pop());\r\n return function() {\r\n for (var arrArgs = slice(arguments), extraArgs = [], me = this, i = 0, ret; i < l; i++) {\r\n ret = fns[i].apply(me, arrArgs.concat(extraArgs));\r\n if (!opt_excludeRetArgs) {\r\n extraArgs.push(ret);\r\n }\r\n }\r\n return ret;\r\n };\r\n }", "function runHandlers(queue, value) {\n\t\tfor (var i = 0; i < queue.length; i++) {\n\t\t\tqueue[i](value);\n\t\t}\n\t}", "function pipe(value, ...fns) {\n if (!arguments.length) {\n throw new Error('expected one value argument and least one function argument');\n }\n if (!fns.length) {\n throw new Error(\n 'expected at least one (and probably more) function arguments'\n );\n }\n\n var result = fns[0](value);\n var len = fns.length;\n for (var i = 1; i < len; i++) {\n result = fns[i](result);\n }\n return result;\n}", "function test() {\n console.log('TEST SUITE');\n for(let i=0; i < testFuncs.length; i++) {\n let test = testFuncs[i];\n try {\n test();\n console.log('(' + i + ')' + test.name + ': PASS')\n } catch(e) {\n console.log('(' + i + ')' + test.name + ': FAIL');\n console.log(e);\n }\n }\n}", "function compose(fns) {\n\n\n}", "function chain(client, fns, index) {\n if (index === fns.length) return;\n\n var client = arguments[0];\n var fns = arguments[1];\n var index = arguments[2];\n\n\n var callback = function(err, result) {\n var extras = []\n extras.push(client);\n extras.push(fns);\n extras.push(index+1);\n\n for (var j = 2 ; j < arguments.length ; j++) {\n extras.push(arguments[j]);\n }\n\n extras.push(err);\n extras.push(result);\n\n if (err) {\n console.log(err);\n } else {\n chain.apply(this, extras)\n }\n }\n\n var varArgs = [];\n varArgs.push(client);\n varArgs.push(callback);\n\n for (var j = 3 ; j < arguments.length ; j++) {\n varArgs.push(arguments[j]);\n }\n\n //console.log(index);\n fns[index].apply(this, varArgs);\n}", "function executeActions(actions, state, callback) {\n // console.log(\"executeActions\", actions);\n const action = actions.shift();\n action.on('result', (result) => {\n if (result.success) {\n // TODO update state\n if (actions.length > 0) {\n executeActions(actions, state, callback);\n } else {\n // we are done\n callback(null, {\n program: null,\n state: state,\n result: result.result\n });\n }\n } else {\n // an error happened; abort sequence\n callback({\n msg: 'action execution failed',\n action,\n error: result.error\n }, null);\n }\n });\n action.on('status', console.log);\n action.on('feedback', console.log);\n action.execute();\n}", "function _runner(dependencies){\n //check if attr 'success-function' exist and not empty\n if(typeof dependencies !== typeof undefined && dependencies !== false && dependencies !== \"\") {\n var classList = dependencies.split(/\\s+/);\n $.each(classList, function(index, item) {\n if( typeof item !== typeof undefined && typeof item === 'function'){\n window[item]();\n }\n });\n }\n\n }", "function inparallel(parallel_functions, final_function) {\n n = parallel_functions.length;\n for(i = 0; i < n; ++i) {\n parallel_functions[i](function() {\n n--;\n if(n == 0) { \n final_function();\n } \n });\n }\n}", "function _apply(f, thisArg, args) {\n\t\treturn Promise.all(args).then(function(args) {\n\t\t\treturn f.apply(thisArg, args);\n\t\t});\n\t}", "function _apply(f, thisArg, args) {\n\t\treturn Promise.all(args).then(function(args) {\n\t\t\treturn f.apply(thisArg, args);\n\t\t});\n\t}", "function _apply(f, thisArg, args) {\n\t\treturn Promise.all(args).then(function(args) {\n\t\t\treturn f.apply(thisArg, args);\n\t\t});\n\t}", "function _apply(f, thisArg, args) {\n\t\treturn Promise.all(args).then(function(args) {\n\t\t\treturn f.apply(thisArg, args);\n\t\t});\n\t}", "function bindFunctions (namespace, functions=[]) {\n let ns = getNamespace(namespace);\n functions.forEach(fnDef => {\n let { name: method, successCallbackIndex: success, failureCallbackIndex: failure } = fnDef;\n let name = `${namespace}.${method}`;\n exportFunction(JETPACK.RPC.bind(null, { name, success, failure }), ns, { defineAs: method });\n });\n}", "function thenRun() {\n\tconst args = Array.prototype.slice.call(arguments);\n\treturn () => run.apply(null, args);\n}", "function callJSFunctions (data) {\n\tvar calls = JSON.parse(data);\n\n\tfor (var i=0; i<calls.length; i++) {\n\t\tvar call = calls[i];\n\n\t\t// now call function, this avoids eval, which is evil!\n\t\tif (call.data) {\n\t\t\tvar fn = processFunctionScope(call.func);\n\t\t\tfn(call.data);\n\t\t} else if (call.args) {\n\t\t\tvar fn = processFunctionScope(call.func);\n\t\t\tfn.apply(this, call.args);\n\t\t} else {\n\t\t\tvar fn = processFunctionScope(call.func);\n\t\t\tfn();\n\t\t}\n\t}\n}", "function build(fns) {\n var maxlength = 0;\n for (var i = 0; i < fns.length; i++) {\n maxlength = Math.max(maxlength, fns[i].length);\n }\n\n // Build up parameter string.\n var paramArr = [];\n for (var i = 0; i < maxlength; i++) {\n paramArr.push('a' + i);\n }\n var params = paramArr.length ? ',' + paramArr.toString() : '';\n\n // Build code.\n var code = [];\n code.push('var result, tmp;');\n var call = '].call(self' + params + '); \\n' +\n 'result = tmp !== undefined ? tmp : result;';\n for (var i = 0; i < fns.length; i++) {\n code.push('tmp = fns[' + i + call);\n }\n code.push('return result');\n\n var result = Function('fns,self' + params, code.join('\\n'));\n return result.bind(null, fns);\n }", "function validate(t, tc, scheme, deadline) {\n var fns = scheme;\n var cursor = 0;\n var allEvents = [];\n var eventList = [];\n var timedOut = false;\n\n var timer = setTimeout(function() {\n timedOut = true;\n t.fail('timeout');\n tc.removeAllListeners('event');\n tc.removeAllListeners('sut-died');\n tc.shutdown();\n t.end();\n }, deadline);\n\n tc.on('sut-died', function(code) {\n clearTimeout(timer);\n t.fail('SUT crashed (code: ' + code + ')');\n tc.removeAllListeners('event');\n tc.removeAllListeners('sut-died');\n tc.shutdown();\n t.end();\n });\n\n // flatten so arrays gets expanded and fns becomes one-dimensional\n fns = _.flatten(fns, true);\n\n // try to run the fn that the cursor points to. The function indicates that it has\n // succeeded by yielding an updated eventList. If succeeded the cursor progresses\n // to the next function.\n var inProgress = false;\n var progressFromCursor = function() {\n if (timedOut) return;\n if (inProgress) return;\n inProgress = true;\n\n if(cursor >= fns.length) {\n progressionComplete();\n\n inProgress = false;\n return;\n }\n\n if(!fns[cursor].isPrinted) {\n fns[cursor].isPrinted = true;\n var name = fns[cursor].name || fns[cursor].callerName;\n console.log('* starting ' + name);\n }\n\n fns[cursor](eventList, function(result) {\n if (result === null) {\n //wait for more events\n inProgress = false;\n return;\n }\n\n eventList = result;\n cursor++;\n\n inProgress = false;\n progressFromCursor(true);\n });\n };\n\n tc.on('event', function(event) {\n eventList.push(event);\n allEvents.push(event);\n progressFromCursor();\n });\n\n function progressionComplete() {\n clearTimeout(timer);\n t.ok(true, 'validate done: all functions passed');\n tc.shutdown();\n tc.removeAllListeners('event');\n tc.removeAllListeners('sut-died');\n\n /* Validate all events */\n var jsonValidator = createEventValidator(t);\n _.each(allEvents, jsonValidator);\n\n t.end();\n }\n}", "function consecCall(fnArray) {\n\t\n\tvar prevDef = null;\n\t$.each(fnArray, function(index, fn) {\n\t\tvar def = $.Deferred();\n\t\t$.when( prevDef ).done( function() { return fn(def); });\n\t\tprevDef = def;\n\t});\n\treturn prevDef;\n}", "function executeUploaded() {\n console.log('Running acceptance test invocations');\n Promise.all(\n arns.map(arn => {\n return lambda\n .invoke({\n InvocationType: 'RequestResponse',\n FunctionName: arn,\n Payload: JSON.stringify({ test: true })\n })\n .promise();\n })\n )\n .then(([fn1, fn2, fn3, fn4]) => {\n const bool = every([\n fn1.StatusCode === 200,\n fn1.Payload === '\"callback\"',\n fn2.StatusCode === 200,\n fn2.Payload === '\"context.succeed\"',\n fn3.StatusCode === 200,\n fn3.FunctionError === 'Handled',\n fn3.Payload === JSON.stringify({ errorMessage: 'context.fail' }),\n fn4.StatusCode === 200,\n fn4.Payload === '\"context.done\"'\n ]);\n if (bool) {\n console.log('Acceptance test passed.');\n return process.exit(0);\n }\n console.error('Acceptance test failed.');\n console.error('Results: ', JSON.stringify([fn1, fn2, fn3, fn4]));\n return process.exit(1);\n })\n .catch(err => {\n console.error(err);\n process.exit(1);\n });\n}" ]
[ "0.68478644", "0.66488874", "0.65281355", "0.65281355", "0.6376086", "0.617489", "0.59881306", "0.5942612", "0.5926571", "0.58897847", "0.5781694", "0.57793677", "0.56860965", "0.56757015", "0.5613648", "0.5584616", "0.5568763", "0.5517414", "0.5515395", "0.5452807", "0.5437213", "0.54308164", "0.5423556", "0.53515863", "0.5347042", "0.53275377", "0.53275377", "0.53006756", "0.5231318", "0.5228111", "0.5227348", "0.5201284", "0.5192399", "0.5192207", "0.5192207", "0.517272", "0.5167116", "0.5166477", "0.5158815", "0.51575524", "0.51575524", "0.514877", "0.5134024", "0.5134024", "0.5134024", "0.5120629", "0.5120629", "0.5120629", "0.5115743", "0.51113045", "0.5110164", "0.5108302", "0.5108302", "0.5102119", "0.5092931", "0.50765926", "0.50590354", "0.5048933", "0.503767", "0.50334096", "0.5030472", "0.5030472", "0.5030472", "0.50257534", "0.5018845", "0.50173736", "0.49863172", "0.4958714", "0.4950149", "0.4943971", "0.4934699", "0.49126285", "0.49112105", "0.4907669", "0.49056676", "0.4905187", "0.4904545", "0.49025896", "0.48981032", "0.4878979", "0.4877693", "0.48716155", "0.48678774", "0.48627028", "0.48511094", "0.48511094", "0.48511094", "0.48511094", "0.4842265", "0.48296577", "0.48281065", "0.48129636", "0.48099804", "0.47970158", "0.47957516" ]
0.65061486
9
Run the next `fn`, if any.
function next(err) { var fn = fns[++index] var params = slice.call(arguments, 0) var values = params.slice(1) var length = input.length var pos = -1 if (err) { done(err) return } // Copy non-nully input into values. while (++pos < length) { if (values[pos] === null || values[pos] === undefined) { values[pos] = input[pos] } } input = values // Next or done. if (fn) { wrap(fn, next).apply(null, input) } else { done.apply(null, [null].concat(input)) } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function run(fn) {\n if (fn)\n fn(next);\n else\n callback(null, results);\n }", "function next(err, result) {\n if (err)\n return callback(err, results);\n results.push(result);\n if (fns.length)\n run(fns.shift());\n else\n callback(null, results);\n }", "function fx_run_next(fx) {\n var chain = fx.ch, next = chain.shift();\n if ((next = chain[0])) {\n next[1].$ch = true;\n next[1].start.apply(next[1], next[0]);\n }\n}", "function run() {\n var index = -1;\n var input = slice$3.call(arguments, 0, -1);\n var done = arguments[arguments.length - 1];\n\n if (typeof done !== 'function') {\n throw new Error('Expected function as last argument, not ' + done)\n }\n\n next.apply(null, [null].concat(input));\n\n // Run the next `fn`, if any.\n function next(err) {\n var fn = fns[++index];\n var params = slice$3.call(arguments, 0);\n var values = params.slice(1);\n var length = input.length;\n var pos = -1;\n\n if (err) {\n done(err);\n return\n }\n\n // Copy non-nully input into values.\n while (++pos < length) {\n if (values[pos] === null || values[pos] === undefined) {\n values[pos] = input[pos];\n }\n }\n\n input = values;\n\n // Next or done.\n if (fn) {\n wrap$2(fn, next).apply(null, input);\n } else {\n done.apply(null, [null].concat(input));\n }\n }\n }", "function run() {\n var index = -1\n var input = slice.call(arguments, 0, -1)\n var done = arguments[arguments.length - 1]\n\n if (typeof done !== 'function') {\n throw new Error('Expected function as last argument, not ' + done)\n }\n\n next.apply(null, [null].concat(input))\n\n /* Run the next `fn`, if any. */\n function next(err) {\n var fn = fns[++index]\n var params = slice.call(arguments, 0)\n var values = params.slice(1)\n var length = input.length\n var pos = -1\n\n if (err) {\n done(err)\n return\n }\n\n /* Copy non-nully input into values. */\n while (++pos < length) {\n if (values[pos] === null || values[pos] === undefined) {\n values[pos] = input[pos]\n }\n }\n\n input = values\n\n /* Next or done. */\n if (fn) {\n wrap(fn, next).apply(null, input)\n } else {\n done.apply(null, [null].concat(input))\n }\n }\n }", "function run() {\n var index = -1\n var input = slice.call(arguments, 0, -1)\n var done = arguments[arguments.length - 1]\n\n if (typeof done !== 'function') {\n throw new Error('Expected function as last argument, not ' + done)\n }\n\n next.apply(null, [null].concat(input))\n\n /* Run the next `fn`, if any. */\n function next(err) {\n var fn = fns[++index]\n var params = slice.call(arguments, 0)\n var values = params.slice(1)\n var length = input.length\n var pos = -1\n\n if (err) {\n done(err)\n return\n }\n\n /* Copy non-nully input into values. */\n while (++pos < length) {\n if (values[pos] === null || values[pos] === undefined) {\n values[pos] = input[pos]\n }\n }\n\n input = values\n\n /* Next or done. */\n if (fn) {\n wrap(fn, next).apply(null, input)\n } else {\n done.apply(null, [null].concat(input))\n }\n }\n }", "function run() {\n var index = -1\n var input = slice.call(arguments, 0, -1)\n var done = arguments[arguments.length - 1]\n\n if (typeof done !== 'function') {\n throw new Error('Expected function as last argument, not ' + done)\n }\n\n next.apply(null, [null].concat(input))\n\n // Run the next `fn`, if any.\n function next(err) {\n var fn = fns[++index]\n var params = slice.call(arguments, 0)\n var values = params.slice(1)\n var length = input.length\n var pos = -1\n\n if (err) {\n done(err)\n return\n }\n\n // Copy non-nully input into values.\n while (++pos < length) {\n if (values[pos] === null || values[pos] === undefined) {\n values[pos] = input[pos]\n }\n }\n\n input = values\n\n // Next or done.\n if (fn) {\n wrap(fn, next).apply(null, input)\n } else {\n done.apply(null, [null].concat(input))\n }\n }\n }", "function run() {\n var index = -1\n var input = slice.call(arguments, 0, -1)\n var done = arguments[arguments.length - 1]\n\n if (typeof done !== 'function') {\n throw new Error('Expected function as last argument, not ' + done)\n }\n\n next.apply(null, [null].concat(input))\n\n // Run the next `fn`, if any.\n function next(err) {\n var fn = fns[++index]\n var params = slice.call(arguments, 0)\n var values = params.slice(1)\n var length = input.length\n var pos = -1\n\n if (err) {\n done(err)\n return\n }\n\n // Copy non-nully input into values.\n while (++pos < length) {\n if (values[pos] === null || values[pos] === undefined) {\n values[pos] = input[pos]\n }\n }\n\n input = values\n\n // Next or done.\n if (fn) {\n wrap(fn, next).apply(null, input)\n } else {\n done.apply(null, [null].concat(input))\n }\n }\n }", "function run() {\n var index = -1\n var input = slice.call(arguments, 0, -1)\n var done = arguments[arguments.length - 1]\n\n if (typeof done !== 'function') {\n throw new Error('Expected function as last argument, not ' + done)\n }\n\n next.apply(null, [null].concat(input))\n\n // Run the next `fn`, if any.\n function next(err) {\n var fn = fns[++index]\n var params = slice.call(arguments, 0)\n var values = params.slice(1)\n var length = input.length\n var pos = -1\n\n if (err) {\n done(err)\n return\n }\n\n // Copy non-nully input into values.\n while (++pos < length) {\n if (values[pos] === null || values[pos] === undefined) {\n values[pos] = input[pos]\n }\n }\n\n input = values\n\n // Next or done.\n if (fn) {\n wrap(fn, next).apply(null, input)\n } else {\n done.apply(null, [null].concat(input))\n }\n }\n }", "function run() {\n var index = -1\n var input = slice.call(arguments, 0, -1)\n var done = arguments[arguments.length - 1]\n\n if (typeof done !== 'function') {\n throw new Error('Expected function as last argument, not ' + done)\n }\n\n next.apply(null, [null].concat(input))\n\n // Run the next `fn`, if any.\n function next(err) {\n var fn = fns[++index]\n var params = slice.call(arguments, 0)\n var values = params.slice(1)\n var length = input.length\n var pos = -1\n\n if (err) {\n done(err)\n return\n }\n\n // Copy non-nully input into values.\n while (++pos < length) {\n if (values[pos] === null || values[pos] === undefined) {\n values[pos] = input[pos]\n }\n }\n\n input = values\n\n // Next or done.\n if (fn) {\n wrap(fn, next).apply(null, input)\n } else {\n done.apply(null, [null].concat(input))\n }\n }\n }", "function run() {\n var index = -1\n var input = slice.call(arguments, 0, -1)\n var done = arguments[arguments.length - 1]\n\n if (typeof done !== 'function') {\n throw new Error('Expected function as last argument, not ' + done)\n }\n\n next.apply(null, [null].concat(input))\n\n // Run the next `fn`, if any.\n function next(err) {\n var fn = fns[++index]\n var params = slice.call(arguments, 0)\n var values = params.slice(1)\n var length = input.length\n var pos = -1\n\n if (err) {\n done(err)\n return\n }\n\n // Copy non-nully input into values.\n while (++pos < length) {\n if (values[pos] === null || values[pos] === undefined) {\n values[pos] = input[pos]\n }\n }\n\n input = values\n\n // Next or done.\n if (fn) {\n wrap(fn, next).apply(null, input)\n } else {\n done.apply(null, [null].concat(input))\n }\n }\n }", "function run() {\n var index = -1\n var input = slice.call(arguments, 0, -1)\n var done = arguments[arguments.length - 1]\n\n if (typeof done !== 'function') {\n throw new Error('Expected function as last argument, not ' + done)\n }\n\n next.apply(null, [null].concat(input))\n\n // Run the next `fn`, if any.\n function next(err) {\n var fn = fns[++index]\n var params = slice.call(arguments, 0)\n var values = params.slice(1)\n var length = input.length\n var pos = -1\n\n if (err) {\n done(err)\n return\n }\n\n // Copy non-nully input into values.\n while (++pos < length) {\n if (values[pos] === null || values[pos] === undefined) {\n values[pos] = input[pos]\n }\n }\n\n input = values\n\n // Next or done.\n if (fn) {\n wrap(fn, next).apply(null, input)\n } else {\n done.apply(null, [null].concat(input))\n }\n }\n }", "next() {}", "foreach(func){\n var data, _next;\n _next = this.next;\n this.next = null;\n\n while( (data = this.process()) != null )\n func(data);\n\n this.next = _next;\n }", "function wrap(fn, next) {\n return function () {\n fn(next);\n };\n}", "next () {}", "function next()\n {\n if(execute_index<execute_1by1.length)\n {\n execute_1by1[execute_index++].call(null, req, res, next);\n //execute_index+1 shouldn't do after call, because it's recursive call\n }\n }", "function next(err) {\n var fn = fns[++index];\n var params = slice$3.call(arguments, 0);\n var values = params.slice(1);\n var length = input.length;\n var pos = -1;\n\n if (err) {\n done(err);\n return\n }\n\n // Copy non-nully input into values.\n while (++pos < length) {\n if (values[pos] === null || values[pos] === undefined) {\n values[pos] = input[pos];\n }\n }\n\n input = values;\n\n // Next or done.\n if (fn) {\n wrap$2(fn, next).apply(null, input);\n } else {\n done.apply(null, [null].concat(input));\n }\n }", "function next(err) {\n var fn = fns[++index]\n var params = slice.call(arguments, 0)\n var values = params.slice(1)\n var length = input.length\n var pos = -1\n\n if (err) {\n done(err)\n return\n }\n\n /* Copy non-nully input into values. */\n while (++pos < length) {\n if (values[pos] === null || values[pos] === undefined) {\n values[pos] = input[pos]\n }\n }\n\n input = values\n\n /* Next or done. */\n if (fn) {\n wrap(fn, next).apply(null, input)\n } else {\n done.apply(null, [null].concat(input))\n }\n }", "function next(err) {\n var fn = fns[++index]\n var params = slice.call(arguments, 0)\n var values = params.slice(1)\n var length = input.length\n var pos = -1\n\n if (err) {\n done(err)\n return\n }\n\n /* Copy non-nully input into values. */\n while (++pos < length) {\n if (values[pos] === null || values[pos] === undefined) {\n values[pos] = input[pos]\n }\n }\n\n input = values\n\n /* Next or done. */\n if (fn) {\n wrap(fn, next).apply(null, input)\n } else {\n done.apply(null, [null].concat(input))\n }\n }", "step_func(func) { func(); }", "function next() {\n\t\t\tcounter = pending = 0;\n\t\t\t\n\t\t\t// Check if there are no steps left\n\t\t\tif (steps.length === 0) {\n\t\t\t\t// Throw uncaught errors\n\t\t\t\tif (arguments[0]) {\n\t\t\t\t\tthrow arguments[0];\n\t\t\t\t}\n\t\t\t\treturn;\n\t\t\t}\n\t\t\t\n\t\t\t// Get the next step to execute\n\t\t\tvar fn = steps.shift(), result;\n\t\t\tresults = [];\n\t\t\t\n\t\t\t// Run the step in a try..catch block so exceptions don't get out of hand.\n\t\t\ttry {\n\t\t\t\tlock = TRUE;\n\t\t\t\tresult = fn.apply(next, arguments);\n\t\t\t} catch (e) {\n\t\t\t\t// Pass any exceptions on through the next callback\n\t\t\t\tnext(e);\n\t\t\t}\n\t\t\t\n\t\t\tif (counter > 0 && pending == 0) {\n\t\t\t\t// If parallel() was called, and all parallel branches executed\n\t\t\t\t// synchronously, go on to the next step immediately.\n\t\t\t\tnext.apply(NULL, results);\n\t\t\t} else if (result !== undefined) {\n\t\t\t\t// If a synchronous return is used, pass it to the callback\n\t\t\t\tnext(undefined, result);\n\t\t\t}\n\t\t\tlock = FALSE;\n\t\t}", "function runNext() {\n var test = tests[at++];\n if (test) {\n setTimeout( function() {\n compare(test.func,\n window[test.func],\n window[test.func + \"_backported\"],\n test.driver);\n runNext();\n }, 20);\n }\n }", "Next() {}", "function next(...args) {\n\t\t// if the next function has been defined\n\t\tif (typeof utils.queue[utils.i + 1] !== 'undefined') {\n\t\t\targs.unshift(next);\n\t\t\tutils.i++;\n\t\t\treturn utils.queue[utils.i](...args);\n\t\t}\n\n\t\t// if there are no more function, next will re-init fang group\n\t\treturn init(args);\n\t}", "function doSth(fn) {\n fn(1);\n}", "function next(ctx) {\r\n ctx.current++\r\n if (ctx.current < ctx.mds.length) {\r\n\r\n ctx.mds[ctx.current](ctx,next)\r\n\r\n }\r\n else {\r\n ctx.f(ctx)\r\n }\r\n}", "function next() {\n\t\n\tif (currentTransformStep === transformSteps.length) {\n\t\tconsole.log('all transformations performed')\n\t}\n\telse\n\t\ttransformSteps[currentTransformStep++]()\n\t\t\n}", "function scheduleOne(fn) {\n if (!fn.scheduled) {\n fn.scheduled = 0;\n }\n else if (fn.scheduled > 0) {\n return\n }\n fn.scheduled += 1;\n rAF(function() {\n fn.scheduled -= 1;\n fn();\n });\n }", "function next() {\n counter = pending = 0;\n\n // Check if there are no steps left\n if (steps.length === 0) {\n // Throw uncaught errors\n if (arguments[0]) {\n throw arguments[0];\n }\n return;\n }\n\n // Get the next step to execute\n var fn = steps.shift();\n results = [];\n\n // Run the step in a try..catch block so exceptions don't get out of hand.\n try {\n lock = true;\n var result = fn.apply(next, arguments);\n } catch (e) {\n // Pass any exceptions on through the next callback\n next(e);\n }\n\n if (counter > 0 && pending == 0) {\n // If parallel() was called, and all parallel branches executed\n // synchronously, go on to the next step immediately.\n next.apply(null, results);\n } else if (result !== undefined) {\n // If a synchronous return is used, pass it to the callback\n next(undefined, result);\n }\n lock = false;\n }", "function fn() {}", "function step() {\n var f = script.shift();\n if(f) {\n f(stack, step);\n }\n else {\n return cb(null, stack.pop());\n }\n }", "function once(fn){\n\tvar firstExecution = true;\n\tvar result;\n\treturn function(){\n\t\tif(firstExecution){\n\t\t\tresult = fn();\n\t\t\tfirstExecution = false;\n\t\t\treturn result;\n\t\t} else {\n\t\t\treturn result;\n\t\t}\n\t}\n}", "step_func_done(func) { func(); }", "function run(...input) {\n var index = -1\n var done = input.pop()\n\n if (typeof done !== 'function') {\n throw new TypeError('Expected function as last argument, not ' + done)\n }\n\n next(null, ...input)\n\n // Run the next `fn`, if any.\n function next(...values) {\n var fn = fns[++index]\n var error = values.shift()\n var pos = -1\n\n if (error) {\n done(error)\n return\n }\n\n // Copy non-nullish input into values.\n while (++pos < input.length) {\n if (values[pos] === null || values[pos] === undefined) {\n values[pos] = input[pos]\n }\n }\n\n // Next or done.\n if (fn) {\n wrap(fn, next)(...values)\n } else {\n done(null, ...values)\n }\n }\n }", "function next(err, result) {\n console.log('**Run in next:' + typeof(result));\n// throw exception if task encounters an error.\n if (err) throw err;\n\n// Next task comes from array of task.\n var currentTask = tasks.shift();\n\n if (currentTask) {\n// Execute current task.\n currentTask(result);\n }\n}", "function next(...values) {\n var fn = fns[++index]\n var error = values.shift()\n var pos = -1\n\n if (error) {\n done(error)\n return\n }\n\n // Copy non-nullish input into values.\n while (++pos < input.length) {\n if (values[pos] === null || values[pos] === undefined) {\n values[pos] = input[pos]\n }\n }\n\n // Next or done.\n if (fn) {\n wrap(fn, next)(...values)\n } else {\n done(null, ...values)\n }\n }", "function forEach(iter, f) {\n if (iter.next) {\n try {while (true) {f(iter.next());}}\n catch (e) {if (e != StopIteration) {throw e;}}\n }\n else {\n for (var i = 0; i < iter.length; i++) {\n f(iter[i]);\n }\n }\n}", "function run (fun) {\n fun() \n}", "function run(fun) {\n fun()\n}", "function run(fun) {\n fun()\n}", "function run(fun) {\n fun()\n}", "function next(cb, name) {\n setTimeout(cb, 0);\n return 0;\n}", "advance() {\n\t\tlet f = this.actions.shift()\n\t\tif (f) f()\n\t}", "function nodeLoop(fn, nodes) {\n\t\tvar i;\n\t\t// Good idea to walk up the DOM\n\t\tfor (i = nodes.length - 1; i >= 0; i -= 1) {\n\t\t\tfn(nodes[i]);\n\t\t}\n\t}", "function forEach(seq,fn) { for (var i=0,n=seq&&seq.length;i<n;i++) fn(seq[i]); }", "function passThru (fn) {\n return fn();\n}", "function doFoo(fn) {\r\n return fn();\r\n}", "function run(fun){\n fun()\n}", "function run(fun){\n fun()\n}", "function run(fun){\n fun()\n}", "function run(genFn) {\n const it = genFn();\n\n function _next(err, val) {\n if (err) it.throw(err); //throw err to be caught in generator\n\n //get the generator object\n //a) the first time through val === undefined as yield returns what is returned from the thunk\n //b) next time through `val` will be the value passed as the second arg to the\n // node callback signature\n // - essentially this will \"dependency inject\" the async value from the `yield`\n const cont = it.next(val);\n\n if (cont.done) return;\n\n const cb = cont.value; //yielded function from Thunk that takes a callback as only arg\n\n //call the callback which exposes data inside the generator\n //the \"confusing\" part is that `_next` is the cb passed as the second arg to `fs.readFile`\n //so it will only be called again when `fs.readFile` calls it's cb\n //therefore, the generator is paused at the yield, until `_next` is called by `fs.readFile`\n //and therefore the generator object `.next` method is called advancing the\n //generator and resulting in generator obj `{value: ..., done: true}`\n cb(_next);\n }\n\n _next(); //start the generator\n}", "function each(collection, fn) {\n var i = 0,\n length = collection.length,\n cont;\n\n for(i; i < length; i++) {\n cont = fn(collection[i], i);\n if(cont === false) {\n break; //allow early exit\n }\n }\n }", "function each(collection, fn) {\n var i = 0,\n length = collection.length,\n cont;\n\n for(i; i < length; i++) {\n cont = fn(collection[i], i);\n if(cont === false) {\n break; //allow early exit\n }\n }\n }", "function each(collection, fn) {\n var i = 0,\n length = collection.length,\n cont;\n\n for(i; i < length; i++) {\n cont = fn(collection[i], i);\n if(cont === false) {\n break; //allow early exit\n }\n }\n }", "function each(collection, fn) {\n var i = 0,\n length = collection.length,\n cont;\n\n for(i; i < length; i++) {\n cont = fn(collection[i], i);\n if(cont === false) {\n break; //allow early exit\n }\n }\n }", "function each(collection, fn) {\n var i = 0,\n length = collection.length,\n cont;\n\n for(i; i < length; i++) {\n cont = fn(collection[i], i);\n if(cont === false) {\n break; //allow early exit\n }\n }\n }", "function each(collection, fn) {\n var i = 0,\n length = collection.length,\n cont;\n\n for(i; i < length; i++) {\n cont = fn(collection[i], i);\n if(cont === false) {\n break; //allow early exit\n }\n }\n }", "function next(o, a) {\n\t\t\tvar func = funcs.shift();\n\t\t\tif (func){\n\t\t\t\to.next = next;\n\t\t\t\tfunc(o, a);\n\t\t\t}\n\t\t}", "function next() {\n\t\t\t\tif (eventIDs.length) {\n\t\t\t\t\tsetTimeout(process, 1000);\n\t\t\t\t}\n\t\t\t}", "function next() {\n\t\t\t\tif (eventIDs.length) {\n\t\t\t\t\tsetTimeout(process, 1000);\n\t\t\t\t}\n\t\t\t}", "function next(){\n if(!debug){_next();}\n}", "nextstep(step) {}", "function next(){\n if(!debug){_next()};\n}", "function each(collection, fn) {\n var i = 0,\n length = collection.length,\n cont;\n\n for(i; i < length; i++) {\n cont = fn(collection[i], i);\n if(cont === false) {\n break; //allow early exit\n }\n }\n }", "function seq (_fns) {\n var fns = _fns.slice()\n var callCount = 0\n return function () {\n var next = fns.shift()\n callCount++\n if (!next) {\n throw new Error('Received too many calls. Expected ' + _fns.length + ' got ' + callCount)\n }\n return next.apply(this, arguments)\n }\n}", "function justInvoke(fn) {\n return fn();\n}", "function once (fn) {\n var done = false\n return function (err, val) {\n if(done) return\n done = true\n fn(err, val)\n }\n}", "function once (fn) {\n var done = false\n return function (err, val) {\n if(done) return\n done = true\n fn(err, val)\n }\n}", "function each(collection, fn) {\n\t var i = 0,\n\t length = collection.length,\n\t cont;\n\n\t for(i; i < length; i++) {\n\t cont = fn(collection[i], i);\n\t if(cont === false) {\n\t break; //allow early exit\n\t }\n\t }\n\t }", "function each(collection, fn) {\n\t var i = 0,\n\t length = collection.length,\n\t cont;\n\n\t for(i; i < length; i++) {\n\t cont = fn(collection[i], i);\n\t if(cont === false) {\n\t break; //allow early exit\n\t }\n\t }\n\t }", "function each(collection, fn) {\n\t var i = 0,\n\t length = collection.length,\n\t cont;\n\n\t for(i; i < length; i++) {\n\t cont = fn(collection[i], i);\n\t if(cont === false) {\n\t break; //allow early exit\n\t }\n\t }\n\t }", "function next() {\n\t\t\tif (aTests.length) {\n\t\t\t\treturn runTest(aTests.shift());\n\t\t\t} else if (!iRunningTests) {\n\t\t\t\toTotal.element.classList.remove(\"hidden\");\n\t\t\t\toTotal.element.firstChild.classList.add(\"running\");\n\t\t\t\tsummary(Date.now() - iStart);\n\t\t\t\tif (oFirstFailedTest) {\n\t\t\t\t\tselect(oFirstFailedTest);\n\t\t\t\t}\n\t\t\t}\n\t\t}", "function each(collection, fn) {\n var i = 0,\n length = collection.length,\n cont;\n\n for (i; i < length; i++) {\n cont = fn(collection[i], i);\n if (cont === false) {\n break; //allow early exit\n }\n }\n }", "next() {\n let item = this.rbIter.data();\n\n if (item) {\n let ret = {\n value: item,\n done: false\n };\n\n this.rbIter[this.nextFunc]();\n\n return ret;\n } else {\n return {\n done: true\n }\n }\n }", "function fn() {\n\t\t }", "function loaded(fn, goal) {\n var count = 0;\n\n return function () {\n count++;\n if (count === goal) {\n fn();\n }\n };\n }", "function each(collection, fn) {\n\t\t var i = 0,\n\t\t length = collection.length,\n\t\t cont;\n\t\t\n\t\t for(i; i < length; i++) {\n\t\t cont = fn(collection[i], i);\n\t\t if(cont === false) {\n\t\t break; //allow early exit\n\t\t }\n\t\t }\n\t\t }", "function runNextHandler(nextHandler, e) {\n\n //If e.cancel, then exit process\n if (e.cancel) return;\n\n //If e.delay, then wait\n else if (e.delay) {\n setTimeout(function () { nextHandler(e); }, e.delay);\n delete e.delay;\n }\n\n //Run normally\n else nextHandler(e);\n\n }", "function runFuns(funArr){\n for(let el of funArr){\n sep(); \n var label = el[0], f = el[1]; \n console.log('Running ' + label);\n f();\n }\n}", "function runFunctionIfPossible(funt){\n\tif(funt){funt();}\n}", "function myEach(arr, fn) {\n var tasksNo = arr.length;\n for (var i =0; i < tasksNo; i++){\n fn(arr[i]);\n }\n}", "function tryToRun(fn, times, onFailed) {\r\n times = ~~times || 5;\r\n var delayTime = 250;\r\n function nextCycle() {\r\n if (!times--) {\r\n if (onFailed)\r\n { onFailed(); }\r\n return;\r\n }\r\n try {\r\n if (fn())\r\n { return; }\r\n }\r\n catch (e) { }\r\n setTimeout(nextCycle, delayTime);\r\n delayTime *= 2;\r\n }\r\n setTimeout(nextCycle, 0);\r\n }", "function ejecutarFuncion( fn ){\n // se ejecuta la funcion\n if ( fn() === 1) {\n return true;\n } else {\n return false;\n }\n\n return true;\n}", "function handleOneNext() {\n var prevResult = arguments.length <= 0 || arguments[0] === undefined ? null : arguments[0];\n\n try {\n var yielded = genObj.next(prevResult); // may throw\n if (yielded.done) {\n if (yielded.value !== undefined) {\n // Something was explicitly returned:\n // Report the value as a result to the caller\n callbacks.success(yielded.value);\n }\n } else {\n setTimeout(runYieldedValue, 0, yielded.value);\n }\n }\n // Catch unforeseen errors in genObj\n catch (error) {\n if (callbacks) {\n callbacks.failure(error);\n } else {\n throw error;\n }\n }\n }", "function next() {\n subject = context.stack.tail.head;\n index = 0;\n test( subject );\n }", "function step() {\n\n // if there's more to do\n if (!result.done) {\n if (typeof result.value === \"function\") {\n result.value(function(err, data) {\n if (err) {\n result = task.throw(err);\n return;\n }\n\n result = task.next(data);\n step();\n });\n } else {\n result = task.next(result.value);\n step();\n }\n\n }\n }", "function each(collection, fn) {\n var i = 0,\n length = collection.length,\n cont;\n\n for (i; i < length; i++) {\n cont = fn(collection[i], i);\n\n if (cont === false) {\n break; //allow early exit\n }\n }\n}", "function each(collection, fn) {\n var i = 0,\n length = collection.length,\n cont;\n\n for (i; i < length; i++) {\n cont = fn(collection[i], i);\n\n if (cont === false) {\n break; //allow early exit\n }\n }\n}", "forEach(fn) {\n let node = this.head;\n while (node) {\n fn(node.value);\n node = node.next;\n }\n }", "function wrap(fn, callback) {\n var invoked\n\n return wrapped\n\n function wrapped() {\n var params = slice.call(arguments, 0)\n var callback = fn.length > params.length\n var result\n\n if (callback) {\n params.push(done)\n }\n\n try {\n result = fn.apply(null, params)\n } catch (error) {\n // Well, this is quite the pickle.\n // `fn` received a callback and invoked it (thus continuing the pipeline),\n // but later also threw an error.\n // We’re not about to restart the pipeline again, so the only thing left\n // to do is to throw the thing instead.\n if (callback && invoked) {\n throw error\n }\n\n return done(error)\n }\n\n if (!callback) {\n if (result && typeof result.then === 'function') {\n result.then(then, done)\n } else if (result instanceof Error) {\n done(result)\n } else {\n then(result)\n }\n }\n }\n\n // Invoke `next`, only once.\n function done() {\n if (!invoked) {\n invoked = true\n\n callback.apply(null, arguments)\n }\n }\n\n // Invoke `done` with one value.\n // Tracks if an error is passed, too.\n function then(value) {\n done(null, value)\n }\n}", "function wrap(fn, callback) {\n var invoked\n\n return wrapped\n\n function wrapped() {\n var params = slice.call(arguments, 0)\n var callback = fn.length > params.length\n var result\n\n if (callback) {\n params.push(done)\n }\n\n try {\n result = fn.apply(null, params)\n } catch (error) {\n // Well, this is quite the pickle.\n // `fn` received a callback and invoked it (thus continuing the pipeline),\n // but later also threw an error.\n // We’re not about to restart the pipeline again, so the only thing left\n // to do is to throw the thing instead.\n if (callback && invoked) {\n throw error\n }\n\n return done(error)\n }\n\n if (!callback) {\n if (result && typeof result.then === 'function') {\n result.then(then, done)\n } else if (result instanceof Error) {\n done(result)\n } else {\n then(result)\n }\n }\n }\n\n // Invoke `next`, only once.\n function done() {\n if (!invoked) {\n invoked = true\n\n callback.apply(null, arguments)\n }\n }\n\n // Invoke `done` with one value.\n // Tracks if an error is passed, too.\n function then(value) {\n done(null, value)\n }\n}", "function wrap(fn, callback) {\n var invoked\n\n return wrapped\n\n function wrapped() {\n var params = slice.call(arguments, 0)\n var callback = fn.length > params.length\n var result\n\n if (callback) {\n params.push(done)\n }\n\n try {\n result = fn.apply(null, params)\n } catch (error) {\n // Well, this is quite the pickle.\n // `fn` received a callback and invoked it (thus continuing the pipeline),\n // but later also threw an error.\n // We’re not about to restart the pipeline again, so the only thing left\n // to do is to throw the thing instead.\n if (callback && invoked) {\n throw error\n }\n\n return done(error)\n }\n\n if (!callback) {\n if (result && typeof result.then === 'function') {\n result.then(then, done)\n } else if (result instanceof Error) {\n done(result)\n } else {\n then(result)\n }\n }\n }\n\n // Invoke `next`, only once.\n function done() {\n if (!invoked) {\n invoked = true\n\n callback.apply(null, arguments)\n }\n }\n\n // Invoke `done` with one value.\n // Tracks if an error is passed, too.\n function then(value) {\n done(null, value)\n }\n}", "function wrap(fn, callback) {\n var invoked\n\n return wrapped\n\n function wrapped() {\n var params = slice.call(arguments, 0)\n var callback = fn.length > params.length\n var result\n\n if (callback) {\n params.push(done)\n }\n\n try {\n result = fn.apply(null, params)\n } catch (error) {\n // Well, this is quite the pickle.\n // `fn` received a callback and invoked it (thus continuing the pipeline),\n // but later also threw an error.\n // We’re not about to restart the pipeline again, so the only thing left\n // to do is to throw the thing instead.\n if (callback && invoked) {\n throw error\n }\n\n return done(error)\n }\n\n if (!callback) {\n if (result && typeof result.then === 'function') {\n result.then(then, done)\n } else if (result instanceof Error) {\n done(result)\n } else {\n then(result)\n }\n }\n }\n\n // Invoke `next`, only once.\n function done() {\n if (!invoked) {\n invoked = true\n\n callback.apply(null, arguments)\n }\n }\n\n // Invoke `done` with one value.\n // Tracks if an error is passed, too.\n function then(value) {\n done(null, value)\n }\n}", "function wrap(fn, callback) {\n var invoked\n\n return wrapped\n\n function wrapped() {\n var params = slice.call(arguments, 0)\n var callback = fn.length > params.length\n var result\n\n if (callback) {\n params.push(done)\n }\n\n try {\n result = fn.apply(null, params)\n } catch (error) {\n // Well, this is quite the pickle.\n // `fn` received a callback and invoked it (thus continuing the pipeline),\n // but later also threw an error.\n // We’re not about to restart the pipeline again, so the only thing left\n // to do is to throw the thing instead.\n if (callback && invoked) {\n throw error\n }\n\n return done(error)\n }\n\n if (!callback) {\n if (result && typeof result.then === 'function') {\n result.then(then, done)\n } else if (result instanceof Error) {\n done(result)\n } else {\n then(result)\n }\n }\n }\n\n // Invoke `next`, only once.\n function done() {\n if (!invoked) {\n invoked = true\n\n callback.apply(null, arguments)\n }\n }\n\n // Invoke `done` with one value.\n // Tracks if an error is passed, too.\n function then(value) {\n done(null, value)\n }\n}" ]
[ "0.7895341", "0.7258331", "0.6687143", "0.6568592", "0.6472725", "0.6472725", "0.6464374", "0.6464374", "0.6464374", "0.6464374", "0.6464374", "0.6464374", "0.6400427", "0.63742316", "0.6338885", "0.62767184", "0.6203823", "0.61728907", "0.61713886", "0.61713886", "0.610243", "0.60927", "0.6085344", "0.60760236", "0.6068794", "0.6005188", "0.58987343", "0.587469", "0.5866949", "0.5865055", "0.5816153", "0.58098197", "0.57844144", "0.57360977", "0.57069176", "0.56891775", "0.56791013", "0.5648892", "0.5648406", "0.5619246", "0.5619246", "0.5619246", "0.55821294", "0.55631125", "0.5545264", "0.5541189", "0.5539148", "0.55315614", "0.5529239", "0.5529239", "0.5529239", "0.55243206", "0.5514724", "0.5514724", "0.5514724", "0.5514724", "0.5514724", "0.5514724", "0.55057645", "0.5505251", "0.5505251", "0.5502277", "0.5501973", "0.5489263", "0.54875135", "0.54675466", "0.5456968", "0.54557663", "0.54557663", "0.5453061", "0.5453061", "0.5453061", "0.5451402", "0.545125", "0.5447772", "0.54475933", "0.54393685", "0.5433071", "0.5432053", "0.5429558", "0.54264575", "0.541638", "0.54163486", "0.54130566", "0.54056895", "0.53958803", "0.5381437", "0.5366896", "0.5366896", "0.5360951", "0.53556705", "0.53556705", "0.53556705", "0.53556705", "0.53556705" ]
0.6133581
25
Add `fn` to the list.
function use(fn) { if (typeof fn !== 'function') { throw new Error('Expected `fn` to be a function, not ' + fn) } fns.push(fn) return middleware }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function addWithFunction(list, item, hashFunction) {\n if (findWithFunction(list, hashFunction) === -1) {\n list.push(item);\n }\n }", "custom(fn) {\r\n\t\treturn this.push('fn', [...arguments]);\r\n\t}", "function addToQueue(fn) {\n if (working) {\n queue.push(fn);\n } else {\n fn();\n }\n}", "function __ (fn) {\n var self = this;\n var selfArguments = [].slice.apply(arguments).slice(1, arguments.length);\n\n this._ops.push({\n fn: fn,\n wait: this._lastWait || null,\n args: selfArguments\n });\n\n this._lastWait = null;\n }", "function addFunc(pNum){\n done.push(pNum);\n }", "subscribe (fn) {\n this.subscribers.push(fn);\n }", "subscribe(fn) {\n\t\tthis.subscribers.push(fn);\n\t}", "async add(fn, options = {}) {\n return new Promise((resolve, reject) => {\n const run = async () => {\n this._pendingCount++;\n this._intervalCount++;\n try {\n const operation = (this._timeout === undefined && options.timeout === undefined) ? fn() : p_timeout_1.default(Promise.resolve(fn()), (options.timeout === undefined ? this._timeout : options.timeout), () => {\n if (options.throwOnTimeout === undefined ? this._throwOnTimeout : options.throwOnTimeout) {\n reject(timeoutError);\n }\n return undefined;\n });\n resolve(await operation);\n }\n catch (error) {\n reject(error);\n }\n this._next();\n };\n this._queue.enqueue(run, options);\n this._tryToStartAnother();\n this.emit('add');\n });\n }", "registerOnChange(fn) {\n this._onChange.push(fn);\n }", "registerOnChange(fn) {\n this._onChange.push(fn);\n }", "registerOnChange(fn) {\n this._onChange.push(fn);\n }", "registerOnChange(fn) {\n this._onChange.push(fn);\n }", "registerOnChange(fn) {\n this._onChange.push(fn);\n }", "registerOnChange(fn) {\n this._onChange.push(fn);\n }", "registerOnChange(fn) {\n this._onChange.push(fn);\n }", "function addMessageHook(fn) {\r\n if (typeof(fn) !== \"function\") {\r\n throw \"addMessageHook expects a function\";\r\n }\r\n _hooks.push(fn);\r\n}", "function use(fn) {\n if (typeof fn !== 'function') {\n throw new TypeError('Expected `fn` to be a function, not ' + fn)\n }\n\n fns.push(fn)\n return middleware\n }", "async add(fn, options = {}) {\n return new Promise((resolve, reject) => {\n const run = async () => {\n this._pendingCount++;\n this._intervalCount++;\n try {\n const operation = (this._timeout === undefined && options.timeout === undefined) ? fn() : p_timeout_1.default(Promise.resolve(fn()), (options.timeout === undefined ? this._timeout : options.timeout), () => {\n if (options.throwOnTimeout === undefined ? this._throwOnTimeout : options.throwOnTimeout) {\n reject(timeoutError);\n }\n return undefined;\n });\n resolve(await operation);\n }\n catch (error) {\n reject(error);\n }\n this._next();\n };\n this._queue.enqueue(run, options);\n this._tryToStartAnother();\n });\n }", "addOnAfterItemCallback(fn) {\r\n this.onAfterItemCallbacks.push(fn);\r\n }", "function use(fn) {\n if (typeof fn !== 'function') {\n throw new Error('Expected `fn` to be a function, not ' + fn)\n }\n\n fns.push(fn);\n\n return middleware\n }", "function add() {}", "function addTwo(fn) {\n return fn() + 2;\n }", "add_hook(fn, sev=\"ALL\") {\n if (!this._assert_sev(sev)) { return false; }\n this._hooks[this._sev_value(sev)].push(fn);\n return true;\n }", "function addFn(x, y) {\n return x + y;\n}", "async add(fn, options = {}) {\n return new Promise((resolve, reject) => {\n const run = async () => {\n this._pendingCount++;\n this._intervalCount++;\n\n try {\n const operation = this._timeout === undefined && options.timeout === undefined ? fn() : p_timeout_1.default(Promise.resolve(fn()), options.timeout === undefined ? this._timeout : options.timeout, () => {\n if (options.throwOnTimeout === undefined ? this._throwOnTimeout : options.throwOnTimeout) {\n reject(timeoutError);\n }\n\n return undefined;\n });\n resolve((await operation));\n } catch (error) {\n reject(error);\n }\n\n this._next();\n };\n\n this._queue.enqueue(run, options);\n\n this._tryToStartAnother();\n });\n }", "registerOnChange(fn) {\n this._onChange.push(fn);\n }", "function _add(...args) {\n\t\t\tsequences = addToSequence(sequences, (s) => cancellableTimeout(s, 1), ...args)\n\t\t\tinputSequence.push({type:'function', data:args})\n\t\t}", "addRoute(route, fn) {\n this.routes.push({\n params: this._getParams(route),\n pattern: this._getPattern(route),\n route,\n fn\n })\n }", "function add_applied_functions() {\n var ul = jQuery('#calcfuncsul');\n jQuery.each(functions_applied, function(i,e) {\n jQuery( \"<li data-id=\\\"\" + e + \"\\\" data-coltype=\\\"function\\\"></li>\" )\n .html( remove_me + ' ' +e )\n .appendTo( ul );\n });\n }", "function add_applied_functions() {\n var ul = jQuery('#calcfuncsul');\n jQuery.each(functions_applied, function(i,e) {\n jQuery( \"<li data-id=\\\"\" + e + \"\\\" data-coltype=\\\"function\\\"></li>\" )\n .html( remove_me + ' ' +e )\n .appendTo( ul );\n });\n }", "function addUserFunction(userFunctionEdn) {\n userFunctions.push(userFunctionEdn);\n}", "function addNodeListEventListener(list, event, fn) {\n for (let i = 0; i < list.length; i++) {\n list[i].addEventListener(event, fn);\n }\n\t}", "addOnQueueLoadCallback(fn) {\r\n this.onQueueLoadCallbacks.push(fn);\r\n }", "function newFunction(fn) {\n if (typeof fn.original === \"function\") fn = fn.original;\n var index = table.length;\n table.grow(1);\n table.set(index, fn);\n return index;\n }", "function add (type, config, fn) {\n var r = phoenix.registry[type]\n if (!r) r = phoenix.registry[type] = []\n if (typeof config == 'function') {\n fn = config\n config = {}\n }\n config.id = r.length\n r.push({ config: config, fn: fn })\n}", "function _add() {\n\t\t\tfor (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) {\n\t\t\t\targs[_key] = arguments[_key];\n\t\t\t}\n\n\t\t\tsequences = addToSequence.apply(undefined, [sequences, function (s) {\n\t\t\t\treturn cancellableTimeout(s, 1);\n\t\t\t}].concat(args));\n\t\t\tinputSequence.push({ type: 'function', data: args });\n\t\t}", "function registerRunTimeFunction(fn) {\r\n\tif (isFunction(fn)) {\r\n\t\tif (typeof fn == 'object') {\r\n\t\t\trunTime = runTime.concat(fn);\r\n\t\t} else {\r\n\t\t\trunTime[runTime.length++] = fn;\r\n\t\t}\r\n\t}\r\n}", "subscribe(fn) {\r\n if (fn) {\r\n this._subscriptions.push(this.createSubscription(fn, false));\r\n }\r\n return () => {\r\n this.unsubscribe(fn);\r\n };\r\n }", "function myFunction() {\n todo.forEach(task => {\n addtask(task);\n });\n}", "function add_function() {\n var func = jQuery('#function_dropdown').val();\n if( func === '') {\n alert('No group by function chosen');\n return;\n }\n var col = jQuery('#columns_dropdown').val();\n var val;\n if(func === 'COUNT') {\n val = 'COUNT(*)';\n }\n else {\n if( col === '') {\n alert('Select a column for the function selected please');\n return;\n }\n val = func + '(' + col + ')';\n }\n if(functions_applied.indexOf(val) !== -1) {\n alert('This function has been already added');\n return;\n }\n\n functions_applied.push(val);\n var ul = jQuery('#calcfuncsul');\n jQuery( \"<li data-id=\\\"\" + val + \"\\\" data-coltype=\\\"function\\\"></li>\" )\n .html( remove_me + ' ' +val )\n .appendTo( ul );\n\n }", "function add_function() {\n var func = jQuery('#function_dropdown').val();\n if( func === '') {\n alert('No group by function chosen');\n return;\n }\n var col = jQuery('#columns_dropdown').val();\n var val;\n if(func === 'COUNT') {\n val = 'COUNT(*)';\n }\n else {\n if( col === '') {\n alert('Select a column for the function selected please');\n return;\n }\n val = func + '(' + col + ')';\n }\n if(functions_applied.indexOf(val) !== -1) {\n alert('This function has been already added');\n return;\n }\n\n functions_applied.push(val);\n var ul = jQuery('#calcfuncsul');\n jQuery( \"<li data-id=\\\"\" + val + \"\\\" data-coltype=\\\"function\\\"></li>\" )\n .html( remove_me + ' ' +val )\n .appendTo( ul );\n\n }", "function addTask(func){\n taskStack.push(func);\n tasksScanned++;\n}", "async addAll(functions, options) {\n return Promise.all(functions.map(async function_ => this.add(function_, options)));\n }", "function pushAdditional(fn) {\n\t var child = new this.constructor(this.client, this.tableCompiler, this.columnBuilder);\n\t fn.call(child, (0, _tail3.default)(arguments));\n\t this.sequence.additional = (this.sequence.additional || []).concat(child.sequence);\n\t}", "addOnItemErrorCallbacks(fn) {\r\n this.onItemErrorCallbacks.push(fn);\r\n }", "registerOnDisabledChange(fn) {\n this._onDisabledChange.push(fn);\n }", "registerOnDisabledChange(fn) {\n this._onDisabledChange.push(fn);\n }", "registerOnDisabledChange(fn) {\n this._onDisabledChange.push(fn);\n }", "registerOnDisabledChange(fn) {\n this._onDisabledChange.push(fn);\n }", "registerOnDisabledChange(fn) {\n this._onDisabledChange.push(fn);\n }", "registerOnDisabledChange(fn) {\n this._onDisabledChange.push(fn);\n }", "registerOnDisabledChange(fn) {\n this._onDisabledChange.push(fn);\n }", "async addAll(functions, options) {\n return Promise.all(functions.map(async (function_) => this.add(function_, options)));\n }", "async addAll(functions, options) {\n return Promise.all(functions.map(async (function_) => this.add(function_, options)));\n }", "function fn() {}", "add_filter(func, sev=\"ALL\") {\n if (!this._assert_sev(sev)) { return false; }\n this._filters[this._sev_value(sev)].push(func);\n }", "on(e, fn) {\n // After doing some research, I felt like a Set rather than an array would work better since it wouldnt allow duplicate function within a specific event. Basically this method is checking to see if the event already exists - and if it does it will add the function to that Set, otherwise create a new set where it contains the called function.\n\t\tif (this.events[e]) {\n\t\treturn this.event[e].add(fn);\n\t\t}\n\t\tthis.events[e] = new Set([fn]);\n\t}", "on(event, fn) {\n if (!this.eventMap[event]) {\n this.eventMap[event] = [];\n }\n\n this.eventMap[event].push(fn);\n return this\n }", "function add2(fn1, fn2) {\n return add(fn1(), fn2());\n}", "addToList() {\n list.push(this);\n }", "function add2(fn1, fn2) {\n return add(fn1(), fn2());\n}", "function add2(fn1, fn2) {\n return add(fn1(), fn2());\n}", "function addCallBackFunction(fn) {\n\t if(!_docReady) {\n\t _documentLoadedCallbacks.push(fn);\n\t }\n\t else {\n\t fn();\n\t }\n\t}", "function addCallBackFunction(fn) {\n if(!_docReady) {\n _documentLoadedCallbacks.push(fn);\n }\n else {\n fn();\n }\n}", "subscribe(fn) {\n if (fn) {\n this._subscriptions.push(this.createSubscription(fn, false));\n }\n\n return () => {\n this.unsubscribe(fn);\n };\n }", "add() {\n this.target.addEventListener(this.eventType, this.fn, false);\n }", "function add() { //add is returning function . that fuction is invoke\n return function() { \n console.log('returned function called')\n \n }\n\n}", "function addf(a) {\n return (b) => {\n return add(a, b);\n };\n}", "push(fn, onTimeout, timeout)\n {\n if (this.status !== SeqQueueManager.STATUS_IDLE && this.status !== SeqQueueManager.STATUS_BUSY)\n {\n // ignore invalid status\n return false;\n }\n\n if (typeof fn !== 'function')\n {\n throw new Error('fn should be a function.');\n }\n this.queue.push({\n fn : fn,\n ontimeout : onTimeout,\n timeout : timeout});\n\n if (this.status === SeqQueueManager.STATUS_IDLE)\n {\n this.status = SeqQueueManager.STATUS_BUSY;\n process.nextTick(this._next.bind(this), this.curId);\n }\n return true;\n }", "function addf(x) {\n return function(y) {\n return add(x, y);\n };\n}", "function on(eventName, fn) {\n events[eventName] = events[eventName] || [];\n events[eventName].push(fn);\n }", "function addFunctionWasm(func, sig) {\n var table = wasmTable;\n var ret = table.length;\n\n // Grow the table\n try {\n table.grow(1);\n } catch (err) {\n if (!(err instanceof RangeError)) {\n throw err;\n }\n throw 'Unable to grow wasm table. Use a higher value for RESERVED_FUNCTION_POINTERS or set ALLOW_TABLE_GROWTH.';\n }\n\n // Insert new element\n try {\n // Attempting to call this with JS function will cause of table.set() to fail\n table.set(ret, func);\n } catch (err) {\n if (!(err instanceof TypeError)) {\n throw err;\n }\n assert(typeof sig !== 'undefined', 'Missing signature argument to addFunction');\n var wrapped = convertJsFunctionToWasm(func, sig);\n table.set(ret, wrapped);\n }\n\n return ret;\n}", "function addFunction(func, sig) {\n\n return addFunctionWasm(func, sig);\n}", "async addDomainMatchingFunc(fn) {\n this.hasDomainPattern = true;\n this.domainMatchingFunc = fn;\n }", "addOnAfterItemLoadCallback(fn) {\r\n this.onAfterItemLoadCallbacks.push(fn);\r\n }", "function addFunction(func, sig) {\n assert(typeof func !== 'undefined');\n\n return addFunctionWasm(func, sig);\n}", "function addFunction(func, sig) {\n assert(typeof func !== 'undefined');\n\n return addFunctionWasm(func, sig);\n}", "function addFunctionWasm(func, sig) {\n var table = wasmTable;\n var ret = table.length;\n\n // Grow the table\n try {\n table.grow(1);\n } catch (err) {\n if (!err instanceof RangeError) {\n throw err;\n }\n throw 'Unable to grow wasm table. Use a higher value for RESERVED_FUNCTION_POINTERS or set ALLOW_TABLE_GROWTH.';\n }\n\n // Insert new element\n try {\n // Attempting to call this with JS function will cause of table.set() to fail\n table.set(ret, func);\n } catch (err) {\n if (!err instanceof TypeError) {\n throw err;\n }\n assert(typeof sig !== 'undefined', 'Missing signature argument to addFunction');\n var wrapped = convertJsFunctionToWasm(func, sig);\n table.set(ret, wrapped);\n }\n\n return ret;\n}", "function addFunctionWasm(func, sig) {\n var table = wasmTable;\n var ret = table.length;\n\n // Grow the table\n try {\n table.grow(1);\n } catch (err) {\n if (!err instanceof RangeError) {\n throw err;\n }\n throw 'Unable to grow wasm table. Use a higher value for RESERVED_FUNCTION_POINTERS or set ALLOW_TABLE_GROWTH.';\n }\n\n // Insert new element\n try {\n // Attempting to call this with JS function will cause of table.set() to fail\n table.set(ret, func);\n } catch (err) {\n if (!err instanceof TypeError) {\n throw err;\n }\n assert(typeof sig !== 'undefined', 'Missing signature argument to addFunction');\n var wrapped = convertJsFunctionToWasm(func, sig);\n table.set(ret, wrapped);\n }\n\n return ret;\n}", "addOnBeforeItemLoadCallback(fn) {\r\n this.onBeforeItemLoadCallbacks.push(fn);\r\n }", "onAddButtonClick(fn) { this.onAddButtonClickFn = fn }", "function addFunction(func, sig) {\n if (typeof sig === 'undefined') {\n err('warning: addFunction(): You should provide a wasm function signature string as a second argument. This is not necessary for asm.js and asm2wasm, but is required for the LLVM wasm backend, so it is recommended for full portability.');\n }\n var base = 0;\n for (var i = base; i < base + 0; i++) {\n if (!functionPointers[i]) {\n functionPointers[i] = func;\n return jsCallStartIndex + i;\n }\n }\n throw 'Finished up all reserved function pointers. Use a higher value for RESERVED_FUNCTION_POINTERS.';\n}", "function addFunction(func, sig) {\n if (typeof sig === 'undefined') {\n err('warning: addFunction(): You should provide a wasm function signature string as a second argument. This is not necessary for asm.js and asm2wasm, but is required for the LLVM wasm backend, so it is recommended for full portability.');\n }\n var base = 0;\n for (var i = base; i < base + 0; i++) {\n if (!functionPointers[i]) {\n functionPointers[i] = func;\n return jsCallStartIndex + i;\n }\n }\n throw 'Finished up all reserved function pointers. Use a higher value for RESERVED_FUNCTION_POINTERS.';\n}", "function addFunction(func, sig) {\n if (typeof sig === 'undefined') {\n err('warning: addFunction(): You should provide a wasm function signature string as a second argument. This is not necessary for asm.js and asm2wasm, but is required for the LLVM wasm backend, so it is recommended for full portability.');\n }\n var base = 0;\n for (var i = base; i < base + 0; i++) {\n if (!functionPointers[i]) {\n functionPointers[i] = func;\n return jsCallStartIndex + i;\n }\n }\n throw 'Finished up all reserved function pointers. Use a higher value for RESERVED_FUNCTION_POINTERS.';\n}", "function addFunction(func, sig) {\n if (typeof sig === 'undefined') {\n err('warning: addFunction(): You should provide a wasm function signature string as a second argument. This is not necessary for asm.js and asm2wasm, but is required for the LLVM wasm backend, so it is recommended for full portability.');\n }\n var base = 0;\n for (var i = base; i < base + 0; i++) {\n if (!functionPointers[i]) {\n functionPointers[i] = func;\n return jsCallStartIndex + i;\n }\n }\n throw 'Finished up all reserved function pointers. Use a higher value for RESERVED_FUNCTION_POINTERS.';\n}", "function add() {\n const result = [];\n return function () {\n if (arguments.length === 0) {\n return result.reduce(function (a, b) {\n return a + b;\n }, 0);\n }\n [].push.apply(result, [].slice.call(arguments));\n return arguments.callee;\n }\n }", "function addFunction(func, sig) {\n if (typeof sig === 'undefined') {\n err('warning: addFunction(): You should provide a wasm function signature string as a second argument. This is not necessary for asm.js and asm2wasm, but can be required for the LLVM wasm backend, so it is recommended for full portability.');\n }\n\n\n var base = 0;\n for (var i = base; i < base + 0; i++) {\n if (!functionPointers[i]) {\n functionPointers[i] = func;\n return jsCallStartIndex + i;\n }\n }\n throw 'Finished up all reserved function pointers. Use a higher value for RESERVED_FUNCTION_POINTERS.';\n\n}", "function addPlugin(useLevel, fn) {\n var pluginFn = fn;\n if (typeof fn === 'undefined' && typeof useLevel === 'function') {\n pluginFn = useLevel;\n }\n\n if (typeof pluginFn !== 'function') {\n throw new Error('Plugin must be a function!');\n }\n\n if (typeof useLevel === 'string') {\n pluginFn = function pluginFn(id, level, stats) {\n for (var _len10 = arguments.length, rest = Array(_len10 > 3 ? _len10 - 3 : 0), _key10 = 3; _key10 < _len10; _key10++) {\n rest[_key10 - 3] = arguments[_key10];\n }\n\n if (level === useLevel.toUpperCase()) {\n return fn.apply(undefined, [id, level, stats].concat(rest));\n }\n return [id, level, stats].concat(rest);\n };\n }\n\n plugins.push(pluginFn);\n}", "function addTaskToList(task, list){\r\n //What is the task? @parameter task\r\n //Where is the task going? @List Parameter\r\n //What order / priority? lowest on the bottom(push)\r\n return list.push({\r\n text: task, completed: false\r\n });\r\n}", "function on(eventName, fn) {\n events[eventName] = events[eventName] || [];\n events[eventName].push(fn);\n }", "function on(eventName, fn) {\n events[eventName] = events[eventName] || [];\n events[eventName].push(fn);\n }", "addMatchingFunc(name, fn) {\n return __awaiter(this, void 0, void 0, function* () {\n this.hasPattern = true;\n this.matchingFunc = fn;\n });\n }", "addFunctionToTag(mcfunction, tag, index) {\n const { namespace, fullPath, name } = this.getResourcePath(tag);\n const tickResource = this.resources.getOrAddResource('tags', {\n children: new Map(),\n isResource: true,\n path: [namespace, 'functions', ...fullPath],\n values: [],\n replace: false,\n });\n const { fullName } = this.getResourcePath(mcfunction);\n if (index === undefined) {\n tickResource.values.push(fullName);\n }\n else {\n // Insert at given index\n tickResource.values.splice(index, 0, fullName);\n }\n }" ]
[ "0.69391334", "0.6699876", "0.62224996", "0.6204581", "0.6065605", "0.60541385", "0.597551", "0.5913218", "0.5810012", "0.5810012", "0.5810012", "0.5810012", "0.5810012", "0.5810012", "0.5810012", "0.57788336", "0.5764707", "0.5738819", "0.5720906", "0.57197505", "0.56740576", "0.5668907", "0.56641406", "0.5608065", "0.5603541", "0.5598386", "0.55916023", "0.55894345", "0.55885446", "0.55885446", "0.55622244", "0.5546528", "0.55444026", "0.5540866", "0.5510056", "0.5501842", "0.5494543", "0.54903513", "0.5489886", "0.548684", "0.548684", "0.5481889", "0.5477791", "0.5458888", "0.5446502", "0.5436211", "0.5436211", "0.5436211", "0.5436211", "0.5436211", "0.5436211", "0.5436211", "0.5428785", "0.5428785", "0.54163766", "0.5375712", "0.5374492", "0.53667665", "0.5365222", "0.5354134", "0.5352436", "0.5352436", "0.5349705", "0.53488517", "0.5341042", "0.53392816", "0.5321338", "0.5314369", "0.53033584", "0.52989775", "0.52986974", "0.5287954", "0.52837497", "0.528287", "0.52821094", "0.52789", "0.52789", "0.52760416", "0.52760416", "0.52596545", "0.5258891", "0.52554303", "0.52554303", "0.52554303", "0.52554303", "0.52541393", "0.52532256", "0.5252977", "0.52528393", "0.5249352", "0.5249352", "0.52407485", "0.5233281" ]
0.57356536
24
Wrap `fn`. Can be sync or async; return a promise, receive a completion handler, return new values and errors.
function wrap(fn, callback) { var invoked return wrapped function wrapped() { var params = slice.call(arguments, 0) var callback = fn.length > params.length var result if (callback) { params.push(done) } try { result = fn.apply(null, params) } catch (error) { // Well, this is quite the pickle. // `fn` received a callback and invoked it (thus continuing the pipeline), // but later also threw an error. // We’re not about to restart the pipeline again, so the only thing left // to do is to throw the thing instead. if (callback && invoked) { throw error } return done(error) } if (!callback) { if (result && typeof result.then === 'function') { result.then(then, done) } else if (result instanceof Error) { done(result) } else { then(result) } } } // Invoke `next`, only once. function done() { if (!invoked) { invoked = true callback.apply(null, arguments) } } // Invoke `done` with one value. // Tracks if an error is passed, too. function then(value) { done(null, value) } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function wrap_sync (fn) {\n return function (params) {\n var val = fn(params)\n if (val && !isPromise(val)) throw val\n return val\n }\n}", "async function thenify(fn) {\n return await new Promise(function(resolve, reject) {\n function callback(err, res) {\n if (err) return reject(err);\n return resolve(res);\n }\n\n fn(callback);\n });\n}", "function wrapFunction(func, args) {\n return new Promise((resolve, reject) => {\n func(args, (success) => resolve(success), (error) => reject(error))\n })\n}", "function wrap(fn){\n\treturn Q().then(fn);\n}", "function wrap (fn) {\n\n\t\treturn function wrapper () {\n\n\t\t\treturn new Promise((res, rej) => {\n\n\t\t\t\tif (!db) {\n\t\t\t\t\trej('Database not open.');\n\t\t\t\t}\n\n\t\t\t\tfn(res, rej, ...arguments);\n\n\t\t\t});\n\n\t\t};\n\n\t}", "function promisify(fn) {\n var context = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : undefined;\n\n var boundFn = fn.bind(context);\n\n return function (data) {\n return new Promise(function (resolve, reject) {\n boundFn(data, function (err, resp) {\n if (err) {\n reject(err);\n } else {\n resolve(resp);\n }\n });\n });\n };\n}", "function promise(fn) {\n return new Promise(fn);\n }", "function wrap (fn) {\n var res\n\n // create anonymous resource\n if (asyncHooks.AsyncResource) {\n res = new asyncHooks.AsyncResource(fn.name || 'bound-anonymous-fn')\n }\n\n // incompatible node.js\n if (!res || !res.runInAsyncScope) {\n return fn\n }\n\n // return bound function\n return res.runInAsyncScope.bind(res, fn, null)\n}", "function wrap (fn) {\n var res\n\n // create anonymous resource\n if (asyncHooks.AsyncResource) {\n res = new asyncHooks.AsyncResource(fn.name || 'bound-anonymous-fn')\n }\n\n // incompatible node.js\n if (!res || !res.runInAsyncScope) {\n return fn\n }\n\n // return bound function\n return res.runInAsyncScope.bind(res, fn, null)\n}", "function wrapInPromise(func){\r\n var promise = new Promise((resolve, reject) => {\r\n resolve(func);\r\n });\r\n return promise;\r\n}", "function asPromised(fn) {\n const promiseWrappedHandler = Promise.method(fn);\n return function (msg, cb) {\n return promiseWrappedHandler.call(this, msg).catch(function (err) {\n console.error('io call error for msg=' + msg + ':\\n\\t' + (err.stack ? err.stack : err));\n return Promise.reject(err instanceof Error ? err.message : err);\n }).asCallback(cb);\n };\n}", "function isolate(fn, val) {\n var value, lastPromise;\n\n // Reset lastPromise for nested helpers\n Test.lastPromise = null;\n\n value = fn(val);\n\n lastPromise = Test.lastPromise;\n Test.lastPromise = null;\n\n // If the method returned a promise\n // return that promise. If not,\n // return the last async helper's promise\n if (value && value instanceof Test.Promise || !lastPromise) {\n return value;\n } else {\n return run(function () {\n return Test.resolve(lastPromise).then(function () {\n return value;\n });\n });\n }\n }", "function wrap(fn) {\n return function wrapper() {\n var cb = arguments[arguments.length - 1]\n try {\n var result = fn.apply(\n null,\n Array.prototype.slice.call(arguments, 0, arguments.length - 1)\n )\n cb(null, result)\n } catch (e) {\n cb(e)\n }\n }\n }", "function wrap(fn, callback) {\n var invoked\n\n return wrapped\n\n function wrapped() {\n var params = slice.call(arguments, 0)\n var callback = fn.length > params.length\n var result\n\n if (callback) {\n params.push(done)\n }\n\n try {\n result = fn.apply(null, params)\n } catch (err) {\n /* Well, this is quite the pickle. `fn` received\n * a callback and invoked it (thus continuing the\n * pipeline), but later also threw an error.\n * We’re not about to restart the pipeline again,\n * so the only thing left to do is to throw the\n * thing instea. */\n if (callback && invoked) {\n throw err\n }\n\n return done(err)\n }\n\n if (!callback) {\n if (result && typeof result.then === 'function') {\n result.then(then, done)\n } else if (result instanceof Error) {\n done(result)\n } else {\n then(result)\n }\n }\n }\n\n /* Invoke `next`, only once. */\n function done() {\n if (!invoked) {\n invoked = true\n\n callback.apply(null, arguments)\n }\n }\n\n /* Invoke `done` with one value.\n * Tracks if an error is passed, too. */\n function then(value) {\n done(null, value)\n }\n}", "function wrap(fn, callback) {\n var invoked\n\n return wrapped\n\n function wrapped() {\n var params = slice.call(arguments, 0)\n var callback = fn.length > params.length\n var result\n\n if (callback) {\n params.push(done)\n }\n\n try {\n result = fn.apply(null, params)\n } catch (err) {\n /* Well, this is quite the pickle. `fn` received\n * a callback and invoked it (thus continuing the\n * pipeline), but later also threw an error.\n * We’re not about to restart the pipeline again,\n * so the only thing left to do is to throw the\n * thing instea. */\n if (callback && invoked) {\n throw err\n }\n\n return done(err)\n }\n\n if (!callback) {\n if (result && typeof result.then === 'function') {\n result.then(then, done)\n } else if (result instanceof Error) {\n done(result)\n } else {\n then(result)\n }\n }\n }\n\n /* Invoke `next`, only once. */\n function done() {\n if (!invoked) {\n invoked = true\n\n callback.apply(null, arguments)\n }\n }\n\n /* Invoke `done` with one value.\n * Tracks if an error is passed, too. */\n function then(value) {\n done(null, value)\n }\n}", "function promisify(fn) {\n return () => {\n const { client } = this;\n const args = Array.prototype.slice.call(arguments);\n\n return new Promise((resolve, reject) => {\n args.push((err, result) => {\n if (err) reject(err);\n else resolve(result);\n });\n\n client[fn](...args);\n });\n };\n}", "function wrap(func) {\n return _.wrap(func, function(_func) {\n var args = Array.prototype.slice.call(arguments, 1);\n return Q()\n .then(function() {\n return _func.apply(null, args);\n });\n });\n}", "function promisify(fn) {\n return function(...args) {\n return new Promise( function(resolve, reject) {\n function cb(result) {\n resolve(result)\n }\n\n fn.apply(this, args.concat(cb))\n })\n }\n }", "function async(fn, onError) {\n\t return function () {\n\t var args = [];\n\t for (var _i = 0; _i < arguments.length; _i++) {\n\t args[_i] = arguments[_i];\n\t }\n\t _promise.PromiseImpl.resolve(true).then(function () {\n\t fn.apply(void 0, args);\n\t }).catch(function (error) {\n\t if (onError) {\n\t onError(error);\n\t }\n\t });\n\t };\n\t}", "function promisifyIt(originalFn, env) {\n return function (specName, fn, timeout) {\n if (!fn) {\n const spec = originalFn.call(env, specName);\n spec.pend('not implemented');\n return spec;\n }\n\n const hasDoneCallback = fn.length > 0;\n\n if (hasDoneCallback) {\n return originalFn.call(env, specName, fn, timeout);\n }\n\n const asyncFn = function (done) {\n const returnValue = fn.call({});\n\n if (isPromise(returnValue)) {\n returnValue.then(done, done.fail);\n } else if (returnValue === undefined) {\n done();\n } else {\n done.fail(\n new Error(\n 'Jest: `it` and `test` must return either a Promise or undefined.'));\n\n\n }\n };\n\n return originalFn.call(env, specName, asyncFn, timeout);\n };\n}", "function async(fn, onError) {\n return function () {\n var args = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n args[_i] = arguments[_i];\n }\n _promise.PromiseImpl.resolve(true).then(function () {\n fn.apply(void 0, args);\n }).catch(function (error) {\n if (onError) {\n onError(error);\n }\n });\n };\n}", "function async(fn, onError) {\n return function () {\n var args = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n args[_i] = arguments[_i];\n }\n _promise.PromiseImpl.resolve(true).then(function () {\n fn.apply(void 0, args);\n }).catch(function (error) {\n if (onError) {\n onError(error);\n }\n });\n };\n}", "function async(fn, onError) {\n return function () {\n for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) {\n args[_key] = arguments[_key];\n }\n\n LocalPromise.resolve(true).then(function () {\n fn.apply(undefined, args);\n }).catch(function (error) {\n if (onError) {\n onError(error);\n }\n });\n };\n}", "function async(fn, onError) {\n return function () {\n for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) {\n args[_key] = arguments[_key];\n }\n\n LocalPromise.resolve(true).then(function () {\n fn.apply(undefined, args);\n }).catch(function (error) {\n if (onError) {\n onError(error);\n }\n });\n };\n}", "function asyncHandler(fn) {\n return function(req, res, next) {\n return Promise.resolve(fn(req, res, next).catch(next));\n };\n}", "function promisify(fn) {\n //it must return a function\n //to let defer the execution\n return function() {\n //we need the arguments to feed fn when the time comes\n let args = Array.from(arguments);\n\n //we must return a Promise\n //because this is a promisification\n return new Promise(function(resolve, reject) {\n //call the callback-based function and let be notified\n //when it's finished\n //'this' belongs to the function call,\n //therefore it must be set explicitly.\n fn.call(null, ...args, (err, value) => {\n if (err) {\n reject(err);\n } else {\n resolve(value);\n }\n });\n });\n };\n}", "function async(fn, onError) {\r\n return (...args) => {\r\n Promise.resolve(true)\r\n .then(() => {\r\n fn(...args);\r\n })\r\n .catch((error) => {\r\n if (onError) {\r\n onError(error);\r\n }\r\n });\r\n };\r\n}", "function asynchronous(fn) {\n return function (done) {\n var returnValue = fn.call(this, done);\n returnValue\n .then(function () {\n done();\n })\n .catch(function (err) {\n done.fail(err);\n });\n $rootScope.$apply();\n return returnValue;\n };\n}", "function _asyncToGenerator(fn) { return function () { var gen = fn.apply(this, arguments); return new Promise(function (resolve, reject) { var callNext = step.bind(null, 'next'); var callThrow = step.bind(null, 'throw'); function step(key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { Promise.resolve(value).then(callNext, callThrow); } } callNext(); }); }; }", "function _asyncToGenerator(fn) { return function () { var gen = fn.apply(this, arguments); return new Promise(function (resolve, reject) { var callNext = step.bind(null, 'next'); var callThrow = step.bind(null, 'throw'); function step(key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { Promise.resolve(value).then(callNext, callThrow); } } callNext(); }); }; }", "function _asyncToGenerator(fn) { return function () { var gen = fn.apply(this, arguments); return new Promise(function (resolve, reject) { var callNext = step.bind(null, 'next'); var callThrow = step.bind(null, 'throw'); function step(key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { Promise.resolve(value).then(callNext, callThrow); } } callNext(); }); }; }", "function async(fn, onError) {\n return function () {\n var args = [];\n\n for (var _i = 0; _i < arguments.length; _i++) {\n args[_i] = arguments[_i];\n }\n\n Promise.resolve(true).then(function () {\n fn.apply(void 0, args);\n }).catch(function (error) {\n if (onError) {\n onError(error);\n }\n });\n };\n}", "function async(fn, onError) {\n return function () {\n var args = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n args[_i] = arguments[_i];\n }\n Promise.resolve(true)\n .then(function () {\n fn.apply(void 0, args);\n })\n .catch(function (error) {\n if (onError) {\n onError(error);\n }\n });\n };\n}", "function async(fn, onError) {\n return function () {\n var args = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n args[_i] = arguments[_i];\n }\n Promise.resolve(true)\n .then(function () {\n fn.apply(void 0, args);\n })\n .catch(function (error) {\n if (onError) {\n onError(error);\n }\n });\n };\n}", "function async(fn, onError) {\n return function () {\n var args = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n args[_i] = arguments[_i];\n }\n Promise.resolve(true)\n .then(function () {\n fn.apply(void 0, args);\n })\n .catch(function (error) {\n if (onError) {\n onError(error);\n }\n });\n };\n}", "function async(fn, onError) {\n return function () {\n var args = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n args[_i] = arguments[_i];\n }\n Promise.resolve(true)\n .then(function () {\n fn.apply(void 0, args);\n })\n .catch(function (error) {\n if (onError) {\n onError(error);\n }\n });\n };\n}", "function async(fn, onError) {\n return function () {\n var args = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n args[_i] = arguments[_i];\n }\n Promise.resolve(true)\n .then(function () {\n fn.apply(void 0, args);\n })\n .catch(function (error) {\n if (onError) {\n onError(error);\n }\n });\n };\n}", "function async(fn, onError) {\n return function () {\n var args = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n args[_i] = arguments[_i];\n }\n Promise.resolve(true)\n .then(function () {\n fn.apply(void 0, args);\n })\n .catch(function (error) {\n if (onError) {\n onError(error);\n }\n });\n };\n}", "function async(fn, onError) {\n return function () {\n var args = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n args[_i] = arguments[_i];\n }\n Promise.resolve(true)\n .then(function () {\n fn.apply(void 0, args);\n })\n .catch(function (error) {\n if (onError) {\n onError(error);\n }\n });\n };\n}", "function async(fn, onError) {\n return function () {\n var args = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n args[_i] = arguments[_i];\n }\n Promise.resolve(true)\n .then(function () {\n fn.apply(void 0, args);\n })\n .catch(function (error) {\n if (onError) {\n onError(error);\n }\n });\n };\n}", "function async(fn, onError) {\n return function () {\n var args = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n args[_i] = arguments[_i];\n }\n Promise.resolve(true)\n .then(function () {\n fn.apply(void 0, args);\n })\n .catch(function (error) {\n if (onError) {\n onError(error);\n }\n });\n };\n}", "function async(fn, onError) {\n return function () {\n var args = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n args[_i] = arguments[_i];\n }\n Promise.resolve(true)\n .then(function () {\n fn.apply(void 0, args);\n })\n .catch(function (error) {\n if (onError) {\n onError(error);\n }\n });\n };\n}", "function async(fn, onError) {\n return function () {\n var args = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n args[_i] = arguments[_i];\n }\n Promise.resolve(true)\n .then(function () {\n fn.apply(void 0, args);\n })\n .catch(function (error) {\n if (onError) {\n onError(error);\n }\n });\n };\n}", "function async(fn, onError) {\n return function () {\n var args = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n args[_i] = arguments[_i];\n }\n Promise.resolve(true)\n .then(function () {\n fn.apply(void 0, args);\n })\n .catch(function (error) {\n if (onError) {\n onError(error);\n }\n });\n };\n}", "function async(fn, onError) {\n return function () {\n var args = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n args[_i] = arguments[_i];\n }\n Promise.resolve(true)\n .then(function () {\n fn.apply(void 0, args);\n })\n .catch(function (error) {\n if (onError) {\n onError(error);\n }\n });\n };\n}", "function async(fn, onError) {\n return function () {\n var args = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n args[_i] = arguments[_i];\n }\n Promise.resolve(true)\n .then(function () {\n fn.apply(void 0, args);\n })\n .catch(function (error) {\n if (onError) {\n onError(error);\n }\n });\n };\n}", "function async(fn, onError) {\n return function () {\n var args = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n args[_i] = arguments[_i];\n }\n Promise.resolve(true)\n .then(function () {\n fn.apply(void 0, args);\n })\n .catch(function (error) {\n if (onError) {\n onError(error);\n }\n });\n };\n}", "function async(fn, onError) {\n return function () {\n var args = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n args[_i] = arguments[_i];\n }\n Promise.resolve(true)\n .then(function () {\n fn.apply(void 0, args);\n })\n .catch(function (error) {\n if (onError) {\n onError(error);\n }\n });\n };\n}", "function async(fn, onError) {\r\n return function () {\r\n var args = [];\r\n for (var _i = 0; _i < arguments.length; _i++) {\r\n args[_i] = arguments[_i];\r\n }\r\n Promise.resolve(true)\r\n .then(function () {\r\n fn.apply(void 0, args);\r\n })\r\n .catch(function (error) {\r\n if (onError) {\r\n onError(error);\r\n }\r\n });\r\n };\r\n}", "function async(fn, onError) {\r\n return function () {\r\n var args = [];\r\n for (var _i = 0; _i < arguments.length; _i++) {\r\n args[_i] = arguments[_i];\r\n }\r\n Promise.resolve(true)\r\n .then(function () {\r\n fn.apply(void 0, args);\r\n })\r\n .catch(function (error) {\r\n if (onError) {\r\n onError(error);\r\n }\r\n });\r\n };\r\n}", "function async(fn, onError) {\r\n return function () {\r\n var args = [];\r\n for (var _i = 0; _i < arguments.length; _i++) {\r\n args[_i] = arguments[_i];\r\n }\r\n Promise.resolve(true)\r\n .then(function () {\r\n fn.apply(void 0, args);\r\n })\r\n .catch(function (error) {\r\n if (onError) {\r\n onError(error);\r\n }\r\n });\r\n };\r\n}", "function async(fn, onError) {\r\n return function () {\r\n var args = [];\r\n for (var _i = 0; _i < arguments.length; _i++) {\r\n args[_i] = arguments[_i];\r\n }\r\n Promise.resolve(true)\r\n .then(function () {\r\n fn.apply(void 0, args);\r\n })\r\n .catch(function (error) {\r\n if (onError) {\r\n onError(error);\r\n }\r\n });\r\n };\r\n}", "function async(fn, onError) {\r\n return function () {\r\n var args = [];\r\n for (var _i = 0; _i < arguments.length; _i++) {\r\n args[_i] = arguments[_i];\r\n }\r\n Promise.resolve(true)\r\n .then(function () {\r\n fn.apply(void 0, args);\r\n })\r\n .catch(function (error) {\r\n if (onError) {\r\n onError(error);\r\n }\r\n });\r\n };\r\n}", "function async(fn, onError) {\r\n return function () {\r\n var args = [];\r\n for (var _i = 0; _i < arguments.length; _i++) {\r\n args[_i] = arguments[_i];\r\n }\r\n Promise.resolve(true)\r\n .then(function () {\r\n fn.apply(void 0, args);\r\n })\r\n .catch(function (error) {\r\n if (onError) {\r\n onError(error);\r\n }\r\n });\r\n };\r\n}", "function async(fn, onError) {\r\n return function () {\r\n var args = [];\r\n for (var _i = 0; _i < arguments.length; _i++) {\r\n args[_i] = arguments[_i];\r\n }\r\n Promise.resolve(true)\r\n .then(function () {\r\n fn.apply(void 0, args);\r\n })\r\n .catch(function (error) {\r\n if (onError) {\r\n onError(error);\r\n }\r\n });\r\n };\r\n}", "function async(fn, onError) {\r\n return function () {\r\n var args = [];\r\n for (var _i = 0; _i < arguments.length; _i++) {\r\n args[_i] = arguments[_i];\r\n }\r\n Promise.resolve(true)\r\n .then(function () {\r\n fn.apply(void 0, args);\r\n })\r\n .catch(function (error) {\r\n if (onError) {\r\n onError(error);\r\n }\r\n });\r\n };\r\n}", "function async(fn, onError) {\r\n return function () {\r\n var args = [];\r\n for (var _i = 0; _i < arguments.length; _i++) {\r\n args[_i] = arguments[_i];\r\n }\r\n Promise.resolve(true)\r\n .then(function () {\r\n fn.apply(void 0, args);\r\n })\r\n .catch(function (error) {\r\n if (onError) {\r\n onError(error);\r\n }\r\n });\r\n };\r\n}", "function async(fn, onError) {\n return function () {\n var args = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n args[_i] = arguments[_i];\n }\n Promise.resolve(true).then(function () {\n fn.apply(void 0, args);\n }).catch(function (error) {\n if (onError) {\n onError(error);\n }\n });\n };\n}", "function async(fn, onError) {\n return function () {\n var args = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n args[_i] = arguments[_i];\n }\n Promise.resolve(true).then(function () {\n fn.apply(void 0, args);\n }).catch(function (error) {\n if (onError) {\n onError(error);\n }\n });\n };\n}", "function wrap(fn) {\n return helpers.wrap(fn)();\n}", "function async(fn, onError) {\n return function () {\n var args = [];\n\n for (var _i = 0; _i < arguments.length; _i++) {\n args[_i] = arguments[_i];\n }\n\n Promise.resolve(true).then(function () {\n fn.apply(void 0, args);\n }).catch(function (error) {\n if (onError) {\n onError(error);\n }\n });\n };\n }", "function wrap$3(fn, callback) {\n var invoked;\n\n return wrapped\n\n function wrapped() {\n var params = slice$4.call(arguments, 0);\n var callback = fn.length > params.length;\n var result;\n\n if (callback) {\n params.push(done);\n }\n\n try {\n result = fn.apply(null, params);\n } catch (error) {\n // Well, this is quite the pickle.\n // `fn` received a callback and invoked it (thus continuing the pipeline),\n // but later also threw an error.\n // We’re not about to restart the pipeline again, so the only thing left\n // to do is to throw the thing instead.\n if (callback && invoked) {\n throw error\n }\n\n return done(error)\n }\n\n if (!callback) {\n if (result && typeof result.then === 'function') {\n result.then(then, done);\n } else if (result instanceof Error) {\n done(result);\n } else {\n then(result);\n }\n }\n }\n\n // Invoke `next`, only once.\n function done() {\n if (!invoked) {\n invoked = true;\n\n callback.apply(null, arguments);\n }\n }\n\n // Invoke `done` with one value.\n // Tracks if an error is passed, too.\n function then(value) {\n done(null, value);\n }\n}", "function wrap(fn) {\n\n return function () {\n try {\n return fn.apply(this, arguments);\n }\n catch (err) {\n log(err);\n }\n };\n}", "function wrap_cb (fn, P) {\n return function (params) {\n return new P(function (resolve, reject) {\n fn(params, function (err) { return !err ? resolve() : reject(err) })\n })\n }\n}", "function wrap(funct) {\n return function () {\n // return objects and throw errors\n var outcome = funct.apply(null, arguments).wait();\n if (outcome instanceof Error) {\n throw outcome;\n } else {\n return outcome;\n }\n };\n}", "function wrap(fn) {\n return function(cb) { fn.call(null, cb.bind(null, null)); };\n }", "function wrapInPromiseAsync(asyncFunc){\r\n var promise = new Promise(async((resolve, reject) => {\r\n resolve(await(asyncFunc()));\r\n }));\r\n return promise;\r\n}", "function promisifyLifeCycleFunction(originalFn, env) {return function (fn, timeout) {if (!fn) {return originalFn.call(env);}const hasDoneCallback = fn.length > 0;if (hasDoneCallback) {// Jasmine will handle it\n return originalFn.call(env, fn, timeout);\n }\n\n // We make *all* functions async and run `done` right away if they\n // didn't return a promise.\n const asyncFn = function (done) {\n const returnValue = fn.call({});\n\n if (isPromise(returnValue)) {\n returnValue.then(done, done.fail);\n } else {\n done();\n }\n };\n\n return originalFn.call(env, asyncFn, timeout);\n };\n}", "function _asyncToGenerator(fn) { return function () { var gen = fn.apply(this, arguments); return new Promise(function (resolve, reject) { function step(key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { return Promise.resolve(value).then(function (value) { step(\"next\", value); }, function (err) { step(\"throw\", err); }); } } return step(\"next\"); }); }; }", "function _asyncToGenerator(fn) { return function () { var gen = fn.apply(this, arguments); return new Promise(function (resolve, reject) { function step(key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { return Promise.resolve(value).then(function (value) { step(\"next\", value); }, function (err) { step(\"throw\", err); }); } } return step(\"next\"); }); }; }", "function ProgressivePromise(fn) {\n\tif (typeof Promise !== \"function\") {\n\t\tthrow new Error(\"Promise implementation not available in this environment.\");\n\t}\n\n\tvar progressCallbacks = [];\n\tvar progressHistory = [];\n\n\tfunction doProgress(value) {\n\t\tfor (var i = 0, l = progressCallbacks.length; i < l; ++i) {\n\t\t\tprogressCallbacks[i](value);\n\t\t}\n\n\t\tprogressHistory.push(value);\n\t}\n\n\tvar promise = new Promise(function(resolve, reject) {\n\t\tfn(resolve, reject, doProgress);\n\t});\n\n\tpromise.progress = function(cb) {\n\t\tif (typeof cb !== \"function\") {\n\t\t\tthrow new Error(\"cb is not a function.\");\n\t\t}\n\n\t\t// Report the previous progress history\n\t\tfor (var i = 0, l = progressHistory.length; i < l; ++i) {\n\t\t\tcb(progressHistory[i]);\n\t\t}\n\n\t\tprogressCallbacks.push(cb);\n\t\treturn promise;\n\t};\n\n\tvar origThen = promise.then;\n\n\tpromise.then = function(onSuccess, onFail, onProgress) {\n\t\torigThen.call(promise, onSuccess, onFail);\n\n\t\tif (onProgress !== undefined) {\n\t\t\tpromise.progress(onProgress);\n\t\t}\n\n\t\treturn promise;\n\t};\n\n\treturn promise;\n}", "function doResolve(fn, promise) {\n\t var done = false;\n\t var res = tryCallTwo(fn, function (value) {\n\t if (done) return;\n\t done = true;\n\t resolve(promise, value);\n\t }, function (reason) {\n\t if (done) return;\n\t done = true;\n\t reject(promise, reason);\n\t })\n\t if (!done && res === IS_ERROR) {\n\t done = true;\n\t reject(promise, LAST_ERROR);\n\t }\n\t}", "function doResolve(fn, promise) {\n\t var done = false;\n\t var res = tryCallTwo(fn, function (value) {\n\t if (done) return;\n\t done = true;\n\t resolve(promise, value);\n\t }, function (reason) {\n\t if (done) return;\n\t done = true;\n\t reject(promise, reason);\n\t })\n\t if (!done && res === IS_ERROR) {\n\t done = true;\n\t reject(promise, LAST_ERROR);\n\t }\n\t}", "function doResolve(fn, promise) {\n\t var done = false;\n\t var res = tryCallTwo(fn, function (value) {\n\t if (done) return;\n\t done = true;\n\t resolve(promise, value);\n\t }, function (reason) {\n\t if (done) return;\n\t done = true;\n\t reject(promise, reason);\n\t })\n\t if (!done && res === IS_ERROR) {\n\t done = true;\n\t reject(promise, LAST_ERROR);\n\t }\n\t}", "function doResolve(fn, promise) {\n\t var done = false;\n\t var res = tryCallTwo(fn, function (value) {\n\t if (done) return;\n\t done = true;\n\t resolve(promise, value);\n\t }, function (reason) {\n\t if (done) return;\n\t done = true;\n\t reject(promise, reason);\n\t })\n\t if (!done && res === IS_ERROR) {\n\t done = true;\n\t reject(promise, LAST_ERROR);\n\t }\n\t}", "function doResolve(fn, promise) {\n\t var done = false;\n\t var res = tryCallTwo(fn, function (value) {\n\t if (done) return;\n\t done = true;\n\t resolve(promise, value);\n\t }, function (reason) {\n\t if (done) return;\n\t done = true;\n\t reject(promise, reason);\n\t })\n\t if (!done && res === IS_ERROR) {\n\t done = true;\n\t reject(promise, LAST_ERROR);\n\t }\n\t}", "function doResolve(fn, promise) {\n\t var done = false;\n\t var res = tryCallTwo(fn, function (value) {\n\t if (done) return;\n\t done = true;\n\t resolve(promise, value);\n\t }, function (reason) {\n\t if (done) return;\n\t done = true;\n\t reject(promise, reason);\n\t })\n\t if (!done && res === IS_ERROR) {\n\t done = true;\n\t reject(promise, LAST_ERROR);\n\t }\n\t}", "function doResolve(fn, promise) {\n\t var done = false;\n\t var res = tryCallTwo(fn, function (value) {\n\t if (done) return;\n\t done = true;\n\t resolve(promise, value);\n\t }, function (reason) {\n\t if (done) return;\n\t done = true;\n\t reject(promise, reason);\n\t })\n\t if (!done && res === IS_ERROR) {\n\t done = true;\n\t reject(promise, LAST_ERROR);\n\t }\n\t}", "function doRunAsync(fn, ...args) {\n if (fn.length === args.length + 1) { //expects callback\n let executed,\n executedErr,\n reject = err => {\n executedErr = err;\n },\n resolve = () => {\n };\n \n const callback = err => {\n if (executed)\n return;\n executed = true;\n\n if (err)\n reject(err);\n else\n resolve();\n };\n \n let result;\n switch (args.length) {\n case 0:\n result = fn(callback);\n break;\n \n case 1:\n result = fn(args[0], callback);\n break;\n \n case 2:\n result = fn(args[0], args[1], callback);\n break;\n \n default:\n throw new Error(`missing support for ${args.length} args`);\n }\n \n if (executed) { //callback was executed synchronously\n if (executedErr)\n throw executedErr;\n \n return result;\n \n } else { //callback was not executed synchronously, so it must be asynchronous\n return new Bluebird((...args2) => {\n resolve = args2[0];\n reject = args2[1];\n });\n }\n }\n \n //no callback, so either synchronous or returns a Promise\n switch (args.length) {\n case 0:\n return fn();\n \n case 1:\n return fn(args[0]);\n \n case 2:\n return fn(args[0], args[1]);\n \n default:\n throw new Error(`missing support for ${args.length} args`);\n }\n}", "function doResolve(fn, promise) {\n var done = false;\n var res = tryCallTwo(fn, function (value) {\n if (done) return;\n done = true;\n resolve(promise, value);\n }, function (reason) {\n if (done) return;\n done = true;\n reject(promise, reason);\n });\n if (!done && res === IS_ERROR) {\n done = true;\n reject(promise, LAST_ERROR);\n }\n}", "function doResolve(fn, promise) {\n var done = false;\n var res = tryCallTwo(fn, function (value) {\n if (done) return;\n done = true;\n resolve(promise, value);\n }, function (reason) {\n if (done) return;\n done = true;\n reject(promise, reason);\n });\n if (!done && res === IS_ERROR) {\n done = true;\n reject(promise, LAST_ERROR);\n }\n}", "function doResolve(fn, promise) {\n var done = false;\n var res = tryCallTwo(fn, function (value) {\n if (done) return;\n done = true;\n resolve(promise, value);\n }, function (reason) {\n if (done) return;\n done = true;\n reject(promise, reason);\n });\n if (!done && res === IS_ERROR) {\n done = true;\n reject(promise, LAST_ERROR);\n }\n}", "function doResolve(fn, promise) {\n var done = false;\n var res = tryCallTwo(fn, function (value) {\n if (done) return;\n done = true;\n resolve(promise, value);\n }, function (reason) {\n if (done) return;\n done = true;\n reject(promise, reason);\n });\n if (!done && res === IS_ERROR) {\n done = true;\n reject(promise, LAST_ERROR);\n }\n}", "function doResolve(fn, promise) {\n var done = false;\n var res = tryCallTwo(fn, function (value) {\n if (done) return;\n done = true;\n resolve(promise, value);\n }, function (reason) {\n if (done) return;\n done = true;\n reject(promise, reason);\n });\n if (!done && res === IS_ERROR) {\n done = true;\n reject(promise, LAST_ERROR);\n }\n}", "function doResolve(fn, promise) {\n var done = false;\n var res = tryCallTwo(fn, function (value) {\n if (done) return;\n done = true;\n resolve(promise, value);\n }, function (reason) {\n if (done) return;\n done = true;\n reject(promise, reason);\n });\n if (!done && res === IS_ERROR) {\n done = true;\n reject(promise, LAST_ERROR);\n }\n}", "function doResolve(fn, promise) {\n var done = false;\n var res = tryCallTwo(fn, function (value) {\n if (done) return;\n done = true;\n resolve(promise, value);\n }, function (reason) {\n if (done) return;\n done = true;\n reject(promise, reason);\n });\n if (!done && res === IS_ERROR) {\n done = true;\n reject(promise, LAST_ERROR);\n }\n}", "function doResolve(fn, promise) {\n var done = false;\n var res = tryCallTwo(fn, function (value) {\n if (done) return;\n done = true;\n resolve(promise, value);\n }, function (reason) {\n if (done) return;\n done = true;\n reject(promise, reason);\n });\n if (!done && res === IS_ERROR) {\n done = true;\n reject(promise, LAST_ERROR);\n }\n}", "function doResolve(fn, promise) {\n var done = false;\n var res = tryCallTwo(fn, function (value) {\n if (done) return;\n done = true;\n resolve(promise, value);\n }, function (reason) {\n if (done) return;\n done = true;\n reject(promise, reason);\n });\n if (!done && res === IS_ERROR) {\n done = true;\n reject(promise, LAST_ERROR);\n }\n}", "function doResolve(fn, promise) {\n var done = false;\n var res = tryCallTwo(fn, function (value) {\n if (done) return;\n done = true;\n resolve(promise, value);\n }, function (reason) {\n if (done) return;\n done = true;\n reject(promise, reason);\n });\n if (!done && res === IS_ERROR) {\n done = true;\n reject(promise, LAST_ERROR);\n }\n}", "function doResolve(fn, promise) {\n var done = false;\n var res = tryCallTwo(fn, function (value) {\n if (done) return;\n done = true;\n resolve(promise, value);\n }, function (reason) {\n if (done) return;\n done = true;\n reject(promise, reason);\n });\n if (!done && res === IS_ERROR) {\n done = true;\n reject(promise, LAST_ERROR);\n }\n}", "function doResolve(fn, promise) {\n var done = false;\n var res = tryCallTwo(fn, function (value) {\n if (done) return;\n done = true;\n resolve(promise, value);\n }, function (reason) {\n if (done) return;\n done = true;\n reject(promise, reason);\n });\n if (!done && res === IS_ERROR) {\n done = true;\n reject(promise, LAST_ERROR);\n }\n}", "function doResolve(fn, promise) {\n var done = false;\n var res = tryCallTwo(fn, function (value) {\n if (done) return;\n done = true;\n resolve(promise, value);\n }, function (reason) {\n if (done) return;\n done = true;\n reject(promise, reason);\n });\n if (!done && res === IS_ERROR) {\n done = true;\n reject(promise, LAST_ERROR);\n }\n}", "function doResolve(fn, promise) {\n var done = false;\n var res = tryCallTwo(fn, function (value) {\n if (done) return;\n done = true;\n resolve(promise, value);\n }, function (reason) {\n if (done) return;\n done = true;\n reject(promise, reason);\n });\n if (!done && res === IS_ERROR) {\n done = true;\n reject(promise, LAST_ERROR);\n }\n}", "function doResolve(fn, promise) {\n var done = false;\n var res = tryCallTwo(fn, function (value) {\n if (done) return;\n done = true;\n resolve(promise, value);\n }, function (reason) {\n if (done) return;\n done = true;\n reject(promise, reason);\n });\n if (!done && res === IS_ERROR) {\n done = true;\n reject(promise, LAST_ERROR);\n }\n}", "function doResolve(fn, promise) {\n var done = false;\n var res = tryCallTwo(fn, function (value) {\n if (done) return;\n done = true;\n resolve(promise, value);\n }, function (reason) {\n if (done) return;\n done = true;\n reject(promise, reason);\n });\n if (!done && res === IS_ERROR) {\n done = true;\n reject(promise, LAST_ERROR);\n }\n}" ]
[ "0.75725514", "0.69479746", "0.6858928", "0.6830772", "0.6648563", "0.6574583", "0.65611124", "0.6463919", "0.6463919", "0.6435289", "0.63665336", "0.6268416", "0.6259378", "0.62556964", "0.62556964", "0.62530184", "0.6249934", "0.6212102", "0.6200447", "0.6200375", "0.6187334", "0.6187334", "0.61554337", "0.61554337", "0.61469793", "0.6095391", "0.60784304", "0.6012353", "0.60117126", "0.60117126", "0.60117126", "0.5998345", "0.5987714", "0.5987714", "0.5987714", "0.5987714", "0.5987714", "0.5987714", "0.5987714", "0.5987714", "0.5987714", "0.5987714", "0.5987714", "0.5987714", "0.5987714", "0.5987714", "0.5987714", "0.5987714", "0.5981126", "0.5981126", "0.5981126", "0.5981126", "0.5981126", "0.5981126", "0.5981126", "0.5981126", "0.5981126", "0.5968439", "0.5968439", "0.5967058", "0.59636223", "0.59547", "0.59112674", "0.5900606", "0.5871463", "0.5842846", "0.58389235", "0.5831996", "0.57930356", "0.57930356", "0.5779032", "0.5763667", "0.5763667", "0.5763667", "0.5763667", "0.5763667", "0.5763667", "0.5763667", "0.57618016", "0.5756912", "0.5756912", "0.5756912", "0.5756912", "0.5756912", "0.5756912", "0.5756912", "0.5756912", "0.5756912", "0.5756912", "0.5756912", "0.5756912", "0.5756912", "0.5756912", "0.5756912", "0.5756912" ]
0.6304468
16
Invoke `next`, only once.
function done() { if (!invoked) { invoked = true callback.apply(null, arguments) } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "next () {}", "next() {}", "next() {\n this._next();\n }", "Next() {}", "function next() {\n subject = context.stack.tail.head;\n index = 0;\n test( subject );\n }", "async next() {\n this._executing = false;\n await this._execute();\n }", "function _next() {\n\t\tif (queue.length > 0) {\n\t\t\tvar info = queue.shift();\n\t\t\t_getData(info.url, info.callback);\n\t\t} else {\n\t\t\tpaused = true;\n\t\t}\n\t}", "async next () {\n callTimes.push(Date.now() - startTime); // Record the time that next() was called\n await delay(100); // Each call to next() takes 100ms to resolve\n\n if (--this.length < 0) {\n return { done: true };\n }\n else {\n return { value: \"A\" };\n }\n }", "function next()\n {\n if(execute_index<execute_1by1.length)\n {\n execute_1by1[execute_index++].call(null, req, res, next);\n //execute_index+1 shouldn't do after call, because it's recursive call\n }\n }", "function cautiousNext() {\n depth++;\n if (depth > 100) {\n depth = 0;\n setImmediate(next);\n } else {\n next();\n }\n }", "function handleOneNext(prevResult = null){\n try{\n let yielded = genObj.next(prevResult);\n if (yielded.done){\n if (yielded.value !== undefined){\n callbacks.success(yielded.value);\n }\n }else{\n setTimeout(runYieldedValue, 0, yielded.value)\n }\n }\n catch(error){\n if(callbacks){\n callbacks.failure(error)\n }else{\n throw error;\n }\n }\n }", "function next() {\n\t\t\t\tif (eventIDs.length) {\n\t\t\t\t\tsetTimeout(process, 1000);\n\t\t\t\t}\n\t\t\t}", "function next() {\n\t\t\t\tif (eventIDs.length) {\n\t\t\t\t\tsetTimeout(process, 1000);\n\t\t\t\t}\n\t\t\t}", "function handleOneNext() {\n var prevResult = arguments.length <= 0 || arguments[0] === undefined ? null : arguments[0];\n\n try {\n var yielded = genObj.next(prevResult); // may throw\n if (yielded.done) {\n if (yielded.value !== undefined) {\n // Something was explicitly returned:\n // Report the value as a result to the caller\n callbacks.success(yielded.value);\n }\n } else {\n setTimeout(runYieldedValue, 0, yielded.value);\n }\n }\n // Catch unforeseen errors in genObj\n catch (error) {\n if (callbacks) {\n callbacks.failure(error);\n } else {\n throw error;\n }\n }\n }", "async next() {\n return iter.next();\n }", "async next() {\n return iter.next();\n }", "function fx_run_next(fx) {\n var chain = fx.ch, next = chain.shift();\n if ((next = chain[0])) {\n next[1].$ch = true;\n next[1].start.apply(next[1], next[0]);\n }\n}", "function next() {\n setValue(()=>{\n return checkValue(value+1)\n })\n }", "function intGoNext(){\n goNext(0);\n }", "function next() {\n\t\t\treturn go(current+1);\n\t\t}", "function next() {\n if (!events.hasNext()) {\n log('done');\n return;\n }\n const event = events.next();\n event.getAcl().done(function(acl) {\n const changesMade = acl.duplicateRules(rolePattern, roleReplace);\n if (changesMade) {\n // Store changes if there are changes\n event.setAcl(acl).done(function() {\n event.republishMetadata().done(function() {\n setTimeout(next, REPUBLISH_SCHEDULE_DELAY);\n }).fail(function() {\n // Oh no! (republishMetadata)\n next();\n });\n }).fail(function() {\n // Oh no! (setAcl)\n next();\n });\n } else {\n next();\n }\n }).fail(function() {\n // Oh no! (getAcl)\n next();\n });\n }", "function next(){\n if(!debug){_next()};\n}", "next() {\n this.updateTaskRunning();\n const next = this.queue.shift();\n next === null || next === void 0 ? void 0 : next.start();\n }", "next() {\n this.current = this.queue.shift();\n this.start();\n }", "_next() {\n if (this._stopped) return;\n\n if (this.tasks.length > 0) {\n this.__next.run();\n } else {\n this._complete();\n }\n }", "function next(...args) {\n\t\t// if the next function has been defined\n\t\tif (typeof utils.queue[utils.i + 1] !== 'undefined') {\n\t\t\targs.unshift(next);\n\t\t\tutils.i++;\n\t\t\treturn utils.queue[utils.i](...args);\n\t\t}\n\n\t\t// if there are no more function, next will re-init fang group\n\t\treturn init(args);\n\t}", "function next(cb, name) {\n setTimeout(cb, 0);\n return 0;\n}", "function next() {\n var tok = current;\n current = null;\n return tok || read_next();\n }", "function next() {\n\t\tactiveThreads--;\n\t\tif (tasks && tasks.length > 0) {\n\t\t\ttasks.shift()();\n\t\t}\n\t}", "function next(value) {\n /* jshint validthis:true */\n if (!this._isDisposed) {\n this._subject.next(value);\n }\n}", "function next(state) {\n state.index++;\n }", "function next(state) {\n state.index++;\n }", "next() {\n let item = this.rbIter.data();\n\n if (item) {\n let ret = {\n value: item,\n done: false\n };\n\n this.rbIter[this.nextFunc]();\n\n return ret;\n } else {\n return {\n done: true\n }\n }\n }", "next() {\n if (this.cache.get(this.id) !== null) {\n this.id++;\n }\n }", "async function handleNext() {\n setCounter(counter + 1);\n }", "function next(o, a) {\n\t\t\tvar func = funcs.shift();\n\t\t\tif (func){\n\t\t\t\to.next = next;\n\t\t\t\tfunc(o, a);\n\t\t\t}\n\t\t}", "function next(){\n console.log(\"\\n\\n fetch next ...\");\n if( !debug ){_next();}\n}", "function next(ctx) {\r\n ctx.current++\r\n if (ctx.current < ctx.mds.length) {\r\n\r\n ctx.mds[ctx.current](ctx,next)\r\n\r\n }\r\n else {\r\n ctx.f(ctx)\r\n }\r\n}", "next()\n {\n this._current = this._current.next;\n this._key++;\n }", "function next(){\n if(!debug){_next();}\n}", "function next(err, result) {\n if (err)\n return callback(err, results);\n results.push(result);\n if (fns.length)\n run(fns.shift());\n else\n callback(null, results);\n }", "get next() {\n return this._next;\n }", "get next() {\n return this._next;\n }", "once() {\n this.stop()\n this.step()\n }", "function recursivelyCallNextOnIterator(data) {\n var yielded = iterator.next.apply(iterator, arguments);\n // yielded = { value: Any, done: Boolean }\n\n if (yielded.done) {\n taskInstance.isIdle = true;\n taskInstance.isRunning = false;\n // call setState with the same state to trigger another render\n // so that you can use task properties like isIdle directly\n // in your render function\n component.setState(component.state);\n return;\n }\n\n if (isPromise(yielded.value)) {\n yielded.value.then(function (data) {\n if (component._isMounted) {\n recursivelyCallNextOnIterator(data);\n }\n }, function (e) {\n if (component._isMounted) {\n iterator.throw(e);\n }\n });\n }\n }", "next() {\n if (this.current == \"one\") {\n this.current = \"two\";\n return { done: false, value: \"one\" };\n } else if (this.current == \"two\") {\n this.current = \"\";\n return { done: false, value: \"two\" };\n }\n return { done: true };\n }", "next() {\n return this.items[this.index++];\n }", "next() {\n return iter.next();\n }", "next() {\n return iter.next();\n }", "next() {\n return iter.next();\n }", "next() {\n return iter.next();\n }", "next() {\n return iter.next();\n }", "next() {\n return iter.next();\n }", "next() {\n return iter.next();\n }", "next() {\n return iter.next();\n }", "next() {\n return iter.next();\n }", "next() {\n return iter.next();\n }", "next() {\n return iter.next();\n }", "next() {\n return iter.next();\n }", "run() {\n super.run();\n\n this._stopped = false;\n\n this._next();\n }", "next() {\n this.index++;\n }", "function handleNext() {\n if (isRunning) {\n handleStop();\n }\n update();\n }", "function next(viewer, callback, iterator) {\n let entry = iterator.next();\n\n if (entry.done) {\n callback(entry, iterator);\n } else {\n // Clear the viewer\n viewer.clear(true);\n\n // Replace Math.random with a custom seeded random function\n replaceMathRandom();\n\n // Run the test code\n entry.value[1](viewer);\n\n viewer.whenAllLoaded(() => {\n // Update the viewer once to make all of the changes appear\n viewer.updateAndRender();\n\n // Put back Math.random in its place\n resetMathRandom();\n\n callback(entry, iterator);\n });\n }\n }", "next(enter = true) { return this.move(1, enter); }", "function next() {\n state.tokens.push(new Token());\n nextToken();\n}", "next() {\n return __awaiter(this, void 0, void 0, function* () {\n if (!this.after || !this.after.length) {\n log_1.log.show('next(): Nothing more to search.');\n return;\n }\n const query = this.construct().replace(this.afterRegex, `after: \"${this.after}\"`);\n const result = yield this.run(query);\n return this.options.first === 1 ? (result.length ? result[0] : null) : result;\n });\n }", "next() {\n return queue.shift();\n }", "function next() {\n\t\n\tif (currentTransformStep === transformSteps.length) {\n\t\tconsole.log('all transformations performed')\n\t}\n\telse\n\t\ttransformSteps[currentTransformStep++]()\n\t\t\n}", "function next() {\n\t\t\tcounter = pending = 0;\n\t\t\t\n\t\t\t// Check if there are no steps left\n\t\t\tif (steps.length === 0) {\n\t\t\t\t// Throw uncaught errors\n\t\t\t\tif (arguments[0]) {\n\t\t\t\t\tthrow arguments[0];\n\t\t\t\t}\n\t\t\t\treturn;\n\t\t\t}\n\t\t\t\n\t\t\t// Get the next step to execute\n\t\t\tvar fn = steps.shift(), result;\n\t\t\tresults = [];\n\t\t\t\n\t\t\t// Run the step in a try..catch block so exceptions don't get out of hand.\n\t\t\ttry {\n\t\t\t\tlock = TRUE;\n\t\t\t\tresult = fn.apply(next, arguments);\n\t\t\t} catch (e) {\n\t\t\t\t// Pass any exceptions on through the next callback\n\t\t\t\tnext(e);\n\t\t\t}\n\t\t\t\n\t\t\tif (counter > 0 && pending == 0) {\n\t\t\t\t// If parallel() was called, and all parallel branches executed\n\t\t\t\t// synchronously, go on to the next step immediately.\n\t\t\t\tnext.apply(NULL, results);\n\t\t\t} else if (result !== undefined) {\n\t\t\t\t// If a synchronous return is used, pass it to the callback\n\t\t\t\tnext(undefined, result);\n\t\t\t}\n\t\t\tlock = FALSE;\n\t\t}", "function next () {\n return crontime.schedule().next()\n }", "function next () {\n let start = new Date()\n let buf = rnd(PING_LENGTH)\n shake.write(buf)\n shake.read(PING_LENGTH, (err, bufBack) => {\n let end = new Date()\n if (err || !buf.equals(bufBack)) {\n const err = new Error('Received wrong ping ack')\n return self.emit('error', err)\n }\n\n self.emit('ping', end - start)\n\n if (stop) {\n return\n }\n next()\n })\n }", "function next () {\n let start = new Date()\n let buf = rnd(PING_LENGTH)\n shake.write(buf)\n shake.read(PING_LENGTH, (err, bufBack) => {\n let end = new Date()\n if (err || !buf.equals(bufBack)) {\n const err = new Error('Received wrong ping ack')\n return self.emit('error', err)\n }\n\n self.emit('ping', end - start)\n\n if (stop) {\n return\n }\n next()\n })\n }", "advance() {\n\t\tlet f = this.actions.shift()\n\t\tif (f) f()\n\t}", "function next() {\n if (count >= reqProcessors.length) {\n return;\n }\n var reqProc = reqProcessors[count];\n count++;\n reqProc.request.oldPath = Router._loadedPath;\n var resp = reqProc.activate.call(null, reqProc.request, next);\n if (resp === true) {\n if (console && console.log) {\n console.log('\"return true\" is deprecated, use \"next()\" instead.');\n }\n next();\n }\n }", "first() {\n this.reset();\n return this.next();\n }", "function once(fn) {\n var first = true;\n return function(...args) {\n if (first) {\n first = false;\n return fn(...args);\n }\n }\n}", "nextstep(step) {}", "function once (fn) {\n\t var called = false;\n\t return function () {\n\t if (!called) {\n\t called = true;\n\t fn();\n\t }\n\t }\n\t}", "function once (fn) {\n\t var called = false;\n\t return function () {\n\t if (!called) {\n\t called = true;\n\t fn();\n\t }\n\t }\n\t}", "function once (fn) {\n\t var called = false;\n\t return function () {\n\t if (!called) {\n\t called = true;\n\t fn();\n\t }\n\t }\n\t}", "isNext() {\n return performance.now() > this.nextCursorTime;\n }", "function once(fn){var called=false;return function(){if(called){return;}called=true;return fn.apply(this,arguments);};}", "function next (nextState) {\n if (typeof nextState == \"function\") {\n status.state = getState(nextState.call(this));\n _visit(status.state);\n } else if (nextState in states) {\n status.state = getState(nextState);\n _visit(status.state);\n } else {\n _visit(null);\n }\n }", "function next() {\n\n if (hasNext()) {\n currentVideo++;\n changeSource(currentVideo);\n tableUIUpdate();\n }\n\n }", "function next()\n {\n var params = queue[0];\n\n // Replace or add the handler\n if(params.hasOwnProperty(\"success\")) callback = params.success;\n else callback = null;\n\n params.success = success;\n\n // Manage request timeout\n timeoutId = setTimeout(timeoutHandler, TIMEOUT);\n\n // Now we can perform the request\n $.ajax(params);\n }", "_nextButtonClickHandler() {\n const that = this;\n\n that.next();\n }", "foreach(func){\n var data, _next;\n _next = this.next;\n this.next = null;\n\n while( (data = this.process()) != null )\n func(data);\n\n this.next = _next;\n }", "function next() {\n _base.state.tokens.push(new Token());\n nextToken();\n}", "get next() { return this.$n++; }", "_next(value) {\n let result;\n\n try {\n result = this.project.call(this.thisArg, value, this.count++);\n } catch (err) {\n this.destination.error(err);\n return;\n }\n\n this.destination.next(result);\n }", "function once (fn) {\n var done = false\n return function (err, val) {\n if(done) return\n done = true\n fn(err, val)\n }\n}", "function once (fn) {\n var done = false\n return function (err, val) {\n if(done) return\n done = true\n fn(err, val)\n }\n}", "function next(list) {\n if (list._idleNext == list) return null;\n return list._idleNext;\n }", "function next() {\n slide(false, true);\n }", "function once(fn){var called=false;return function(){if(!called){called=true;fn.apply(this,arguments);}};}", "function once(fn){var called=false;return function(){if(!called){called=true;fn.apply(this,arguments);}};}", "next(item){\n observer.next(item);\n if(++count >= amount)\n observer.complete();\n }", "function one(callback) {\n ///<summary>Execute a callback only once</summary>\n callback = callback || noop;\n\n if (callback._done) {\n return;\n }\n\n callback();\n callback._done = 1;\n }", "function _next () {\n var that = this;\n if (this.data.progress >= 100) {\n this.setData({\n disabled: false\n });\n return true;\n }\n this.setData({\n progress: ++this.data.progress\n });\n setTimeout(function () {\n _next.call(that);\n }, 20);\n}", "function next() {\n counter = pending = 0;\n\n // Check if there are no steps left\n if (steps.length === 0) {\n // Throw uncaught errors\n if (arguments[0]) {\n throw arguments[0];\n }\n return;\n }\n\n // Get the next step to execute\n var fn = steps.shift();\n results = [];\n\n // Run the step in a try..catch block so exceptions don't get out of hand.\n try {\n lock = true;\n var result = fn.apply(next, arguments);\n } catch (e) {\n // Pass any exceptions on through the next callback\n next(e);\n }\n\n if (counter > 0 && pending == 0) {\n // If parallel() was called, and all parallel branches executed\n // synchronously, go on to the next step immediately.\n next.apply(null, results);\n } else if (result !== undefined) {\n // If a synchronous return is used, pass it to the callback\n next(undefined, result);\n }\n lock = false;\n }", "function once(fn){\n\tvar firstExecution = true;\n\tvar result;\n\treturn function(){\n\t\tif(firstExecution){\n\t\t\tresult = fn();\n\t\t\tfirstExecution = false;\n\t\t\treturn result;\n\t\t} else {\n\t\t\treturn result;\n\t\t}\n\t}\n}" ]
[ "0.78337926", "0.7766705", "0.742107", "0.7365195", "0.6899227", "0.6799684", "0.6630355", "0.6603183", "0.65826726", "0.6529928", "0.6470122", "0.6434803", "0.6434803", "0.6420854", "0.6374825", "0.6374825", "0.6349096", "0.63221407", "0.631236", "0.63065857", "0.63003343", "0.62961227", "0.62442935", "0.6241661", "0.6230015", "0.6228021", "0.62233144", "0.6214004", "0.62122256", "0.6210156", "0.61752766", "0.61752766", "0.6169041", "0.6165158", "0.615828", "0.61476773", "0.61439294", "0.6143558", "0.6127905", "0.61232924", "0.61182714", "0.60435843", "0.60435843", "0.6028314", "0.6016665", "0.6000711", "0.59834445", "0.5962309", "0.5962309", "0.5962309", "0.5962309", "0.5962309", "0.5962309", "0.5962309", "0.5962309", "0.5962309", "0.5962309", "0.5962309", "0.5962309", "0.5960535", "0.59592944", "0.59531325", "0.5945665", "0.591721", "0.5898443", "0.58901596", "0.58792925", "0.5872314", "0.5868275", "0.5864022", "0.58384037", "0.58384037", "0.5836122", "0.58349764", "0.5834009", "0.581027", "0.58075565", "0.5798402", "0.5798402", "0.5798402", "0.5788246", "0.57845485", "0.5778991", "0.5772248", "0.5770862", "0.5754168", "0.5752574", "0.57474434", "0.57441634", "0.57343006", "0.572979", "0.572979", "0.57210344", "0.5718094", "0.5704329", "0.5704329", "0.57033855", "0.56943303", "0.56877327", "0.56816304", "0.5675354" ]
0.0
-1
Invoke `done` with one value. Tracks if an error is passed, too.
function then(value) { done(null, value) }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function then(value) {\n done(null, value);\n }", "function finish (err) {\n if (!calledDone) {\n calledDone = true;\n done(err);\n }\n }", "function done() {}", "function done ( error ) {\n if (error) {\n that.error = error\n }\n if ( cb ) cb( error )\n }", "done() {}", "function test(done) {\n // always pass\n return done(null, true)\n}", "function done() {\n if (!invoked) {\n invoked = true\n\n callback.apply(null, arguments)\n }\n }", "function done() {\n if (!invoked) {\n invoked = true\n\n callback.apply(null, arguments)\n }\n }", "function done() {\n if (!invoked) {\n invoked = true\n\n callback.apply(null, arguments)\n }\n }", "function done() {\n if (!invoked) {\n invoked = true\n\n callback.apply(null, arguments)\n }\n }", "function done() {\n if (!invoked) {\n invoked = true\n\n callback.apply(null, arguments)\n }\n }", "function done() {\n if (!invoked) {\n invoked = true\n\n callback.apply(null, arguments)\n }\n }", "function done() {\n if (!invoked) {\n invoked = true\n\n callback.apply(null, arguments)\n }\n }", "function done() {\n if (!invoked) {\n invoked = true\n\n callback.apply(null, arguments)\n }\n }", "function done() {\n if (!invoked) {\n invoked = true;\n\n callback.apply(null, arguments);\n }\n }", "function then(fn_done, fn_fail) {\r\n done(fn_done);\r\n fail(fn_fail);\r\n }", "done () {}", "function step() {\n\n // if there's more to do\n if (!result.done) {\n if (typeof result.value === \"function\") {\n result.value(function(err, data) {\n if (err) {\n result = task.throw(err);\n return;\n }\n\n result = task.next(data);\n step();\n });\n } else {\n result = task.next(result.value);\n step();\n }\n\n }\n }", "function done() {\n if (!called) {\n called = true\n callback(...arguments)\n }\n }", "function done(x){\n console.log(\"Done\", x)\n}", "function done(doneItem){\n \n}", "function finish (err) {\n if (!calledDone) {\n calledDone = true;\n done(err || requestError);\n }\n }", "function done(err, result) {\n callback(err, result);\n }", "function done(err, result) {\n callback(err, result);\n }", "function check(done, fn) {\n\ttry {\n\t\tfn();\n\t\tdone();\n\t} catch (err) {\n\t\tdone(err);\n\t}\n}", "step_func_done(func) { func(); }", "function iterationDone(x) { return {value: x, done: true}; }", "function iterationDone(x) { return {value: x, done: true}; }", "function cbify (done) {\n return function (err, value) {\n if (err) {\n console.error(err.toString())\n process.exit(1)\n }\n\n return done.apply(this, Array.prototype.slice.call(arguments, 1))\n }\n}", "function checkDone() {\r\n\t\t\tif (todo===0) {\r\n\t\t\t\tresultCallback(unmarshalledTable);\r\n\t\t\t}\r\n\t\t}", "function validateDone(done)\n{\n const int = parseInt(done);\n if (isNaN(int))\n {\n return false;\n }\n else if (int == 0 || int == 1)\n {\n return int;\n }\n else\n {\n return false;\n }\n}", "function handleOneNext() {\n var prevResult = arguments.length <= 0 || arguments[0] === undefined ? null : arguments[0];\n\n try {\n var yielded = genObj.next(prevResult); // may throw\n if (yielded.done) {\n if (yielded.value !== undefined) {\n // Something was explicitly returned:\n // Report the value as a result to the caller\n callbacks.success(yielded.value);\n }\n } else {\n setTimeout(runYieldedValue, 0, yielded.value);\n }\n }\n // Catch unforeseen errors in genObj\n catch (error) {\n if (callbacks) {\n callbacks.failure(error);\n } else {\n throw error;\n }\n }\n }", "get done() {\n return Boolean(this._set);\n }", "function step() {\n\n // if there's more to do\n if (!result.done) {\n result = task.next();\n step();\n }\n }", "function run() {\n var index = -1;\n var input = slice$3.call(arguments, 0, -1);\n var done = arguments[arguments.length - 1];\n\n if (typeof done !== 'function') {\n throw new Error('Expected function as last argument, not ' + done)\n }\n\n next.apply(null, [null].concat(input));\n\n // Run the next `fn`, if any.\n function next(err) {\n var fn = fns[++index];\n var params = slice$3.call(arguments, 0);\n var values = params.slice(1);\n var length = input.length;\n var pos = -1;\n\n if (err) {\n done(err);\n return\n }\n\n // Copy non-nully input into values.\n while (++pos < length) {\n if (values[pos] === null || values[pos] === undefined) {\n values[pos] = input[pos];\n }\n }\n\n input = values;\n\n // Next or done.\n if (fn) {\n wrap$2(fn, next).apply(null, input);\n } else {\n done.apply(null, [null].concat(input));\n }\n }\n }", "function done(callback) {\n if(callback) { console.log(\"Error: \", callback); }\n}", "function IteratorStep( iterator, value ) {\n var result = IteratorNext(iterator, value);\n var done = result['done'];\n if (Boolean(done) === true) return false;\n return result;\n }", "function doneFunc(pParams){\n Util.exec(pParams.callback);\n \n var lNum = done.pop (pParams.number);\n if(!lNum){\n Util.exec(pCallback);\n }\n }", "function run() {\n var index = -1\n var input = slice.call(arguments, 0, -1)\n var done = arguments[arguments.length - 1]\n\n if (typeof done !== 'function') {\n throw new Error('Expected function as last argument, not ' + done)\n }\n\n next.apply(null, [null].concat(input))\n\n /* Run the next `fn`, if any. */\n function next(err) {\n var fn = fns[++index]\n var params = slice.call(arguments, 0)\n var values = params.slice(1)\n var length = input.length\n var pos = -1\n\n if (err) {\n done(err)\n return\n }\n\n /* Copy non-nully input into values. */\n while (++pos < length) {\n if (values[pos] === null || values[pos] === undefined) {\n values[pos] = input[pos]\n }\n }\n\n input = values\n\n /* Next or done. */\n if (fn) {\n wrap(fn, next).apply(null, input)\n } else {\n done.apply(null, [null].concat(input))\n }\n }\n }", "function run() {\n var index = -1\n var input = slice.call(arguments, 0, -1)\n var done = arguments[arguments.length - 1]\n\n if (typeof done !== 'function') {\n throw new Error('Expected function as last argument, not ' + done)\n }\n\n next.apply(null, [null].concat(input))\n\n /* Run the next `fn`, if any. */\n function next(err) {\n var fn = fns[++index]\n var params = slice.call(arguments, 0)\n var values = params.slice(1)\n var length = input.length\n var pos = -1\n\n if (err) {\n done(err)\n return\n }\n\n /* Copy non-nully input into values. */\n while (++pos < length) {\n if (values[pos] === null || values[pos] === undefined) {\n values[pos] = input[pos]\n }\n }\n\n input = values\n\n /* Next or done. */\n if (fn) {\n wrap(fn, next).apply(null, input)\n } else {\n done.apply(null, [null].concat(input))\n }\n }\n }", "finish() {\n this.done = true;\n }", "static get DONE() {\n return 3;\n }", "function doSomething (cb) {\n cb(null, 'success')\n}", "function doStep() {\n step(returnable(undefined, true));\n data = [];\n errors = [];\n }", "function run() {\n var index = -1\n var input = slice.call(arguments, 0, -1)\n var done = arguments[arguments.length - 1]\n\n if (typeof done !== 'function') {\n throw new Error('Expected function as last argument, not ' + done)\n }\n\n next.apply(null, [null].concat(input))\n\n // Run the next `fn`, if any.\n function next(err) {\n var fn = fns[++index]\n var params = slice.call(arguments, 0)\n var values = params.slice(1)\n var length = input.length\n var pos = -1\n\n if (err) {\n done(err)\n return\n }\n\n // Copy non-nully input into values.\n while (++pos < length) {\n if (values[pos] === null || values[pos] === undefined) {\n values[pos] = input[pos]\n }\n }\n\n input = values\n\n // Next or done.\n if (fn) {\n wrap(fn, next).apply(null, input)\n } else {\n done.apply(null, [null].concat(input))\n }\n }\n }", "function run() {\n var index = -1\n var input = slice.call(arguments, 0, -1)\n var done = arguments[arguments.length - 1]\n\n if (typeof done !== 'function') {\n throw new Error('Expected function as last argument, not ' + done)\n }\n\n next.apply(null, [null].concat(input))\n\n // Run the next `fn`, if any.\n function next(err) {\n var fn = fns[++index]\n var params = slice.call(arguments, 0)\n var values = params.slice(1)\n var length = input.length\n var pos = -1\n\n if (err) {\n done(err)\n return\n }\n\n // Copy non-nully input into values.\n while (++pos < length) {\n if (values[pos] === null || values[pos] === undefined) {\n values[pos] = input[pos]\n }\n }\n\n input = values\n\n // Next or done.\n if (fn) {\n wrap(fn, next).apply(null, input)\n } else {\n done.apply(null, [null].concat(input))\n }\n }\n }", "function run() {\n var index = -1\n var input = slice.call(arguments, 0, -1)\n var done = arguments[arguments.length - 1]\n\n if (typeof done !== 'function') {\n throw new Error('Expected function as last argument, not ' + done)\n }\n\n next.apply(null, [null].concat(input))\n\n // Run the next `fn`, if any.\n function next(err) {\n var fn = fns[++index]\n var params = slice.call(arguments, 0)\n var values = params.slice(1)\n var length = input.length\n var pos = -1\n\n if (err) {\n done(err)\n return\n }\n\n // Copy non-nully input into values.\n while (++pos < length) {\n if (values[pos] === null || values[pos] === undefined) {\n values[pos] = input[pos]\n }\n }\n\n input = values\n\n // Next or done.\n if (fn) {\n wrap(fn, next).apply(null, input)\n } else {\n done.apply(null, [null].concat(input))\n }\n }\n }", "function run() {\n var index = -1\n var input = slice.call(arguments, 0, -1)\n var done = arguments[arguments.length - 1]\n\n if (typeof done !== 'function') {\n throw new Error('Expected function as last argument, not ' + done)\n }\n\n next.apply(null, [null].concat(input))\n\n // Run the next `fn`, if any.\n function next(err) {\n var fn = fns[++index]\n var params = slice.call(arguments, 0)\n var values = params.slice(1)\n var length = input.length\n var pos = -1\n\n if (err) {\n done(err)\n return\n }\n\n // Copy non-nully input into values.\n while (++pos < length) {\n if (values[pos] === null || values[pos] === undefined) {\n values[pos] = input[pos]\n }\n }\n\n input = values\n\n // Next or done.\n if (fn) {\n wrap(fn, next).apply(null, input)\n } else {\n done.apply(null, [null].concat(input))\n }\n }\n }", "function run() {\n var index = -1\n var input = slice.call(arguments, 0, -1)\n var done = arguments[arguments.length - 1]\n\n if (typeof done !== 'function') {\n throw new Error('Expected function as last argument, not ' + done)\n }\n\n next.apply(null, [null].concat(input))\n\n // Run the next `fn`, if any.\n function next(err) {\n var fn = fns[++index]\n var params = slice.call(arguments, 0)\n var values = params.slice(1)\n var length = input.length\n var pos = -1\n\n if (err) {\n done(err)\n return\n }\n\n // Copy non-nully input into values.\n while (++pos < length) {\n if (values[pos] === null || values[pos] === undefined) {\n values[pos] = input[pos]\n }\n }\n\n input = values\n\n // Next or done.\n if (fn) {\n wrap(fn, next).apply(null, input)\n } else {\n done.apply(null, [null].concat(input))\n }\n }\n }", "function run() {\n var index = -1\n var input = slice.call(arguments, 0, -1)\n var done = arguments[arguments.length - 1]\n\n if (typeof done !== 'function') {\n throw new Error('Expected function as last argument, not ' + done)\n }\n\n next.apply(null, [null].concat(input))\n\n // Run the next `fn`, if any.\n function next(err) {\n var fn = fns[++index]\n var params = slice.call(arguments, 0)\n var values = params.slice(1)\n var length = input.length\n var pos = -1\n\n if (err) {\n done(err)\n return\n }\n\n // Copy non-nully input into values.\n while (++pos < length) {\n if (values[pos] === null || values[pos] === undefined) {\n values[pos] = input[pos]\n }\n }\n\n input = values\n\n // Next or done.\n if (fn) {\n wrap(fn, next).apply(null, input)\n } else {\n done.apply(null, [null].concat(input))\n }\n }\n }", "function doSomething (successCallback, failureCallback) {\n setTimeout(\n () => {\n console.log('doSomething is done')\n if (foo === true) return successCallback('DO_SOMETHING_RESULT')\n else failureCallback(new Error('DO_SOMETHING_ERROR'))\n },\n 0)\n}", "function one$1() {\n var self = this;\n\n self.actual++;\n\n if (self.actual >= self.expected) {\n self.emit('done');\n }\n}", "function done() {\n if (!(draining - 1)) _exit(code);\n }", "function testAsync(done, fn) {\n try {\n fn();\n done();\n } catch(err) {\n done(err);\n }\n}", "function finish (err) {\n if (!calledDone) {\n calledDone = true;\n finalize(err, resolve, reject, done);\n }\n }", "function doStep()\n\t\t\t\t{\n\t\t\t\t\tstep(returnable());\n\t\t\t\t\tdata = [];\n\t\t\t\t\terrors = [];\n\t\t\t\t}", "function finish (err) {\n if (!calledDone) {\n calledDone = true;\n finalize(err, resolve, reject, done);\n }\n }", "function copyDone (error)\n {\n if (!done) {\n done = true;\n copyCallback(error);\n }\n }", "function doStep()\n\t\t\t{\n\t\t\t\tstep(returnable());\n\t\t\t\tdata = [];\n\t\t\t\terrors = [];\n\t\t\t}", "function doStep()\n\t\t\t{\n\t\t\t\tstep(returnable());\n\t\t\t\tdata = [];\n\t\t\t\terrors = [];\n\t\t\t}", "function doStep()\n\t\t\t{\n\t\t\t\tstep(returnable());\n\t\t\t\tdata = [];\n\t\t\t\terrors = [];\n\t\t\t}", "completed(data) {}", "function getCallback(done) {\n return function(err, success){\n if (err) {\n grunt.log.error(err.message);\n return done(false);\n }\n grunt.log.writeln(success);\n done(true);\n }\n }", "function succeedTaskInTest(someTask, value) {\n return _runAndCaptureResult(someTask, function (_, s, _e) {\n return s(value);\n });\n}", "function isDone(self) {\n return Ex.fold_(self.exit, _ => O.isNone(C.flipCauseOption(_)), _ => false);\n}", "function onDone(event) {\r\n return () => {\r\n debug(event);\r\n done();\r\n };\r\n }", "function getCallback(done) {\n return function(err, success){\n if (err) {\n return grunt.log.error(err);\n } else if (success) {\n grunt.log.writeln(success);\n done();\n }\n }\n }", "function assertIteratorResult(value, done, result) {\n assertEquals({value: value, done: done}, result);\n}", "function doDone() {\r\n // in FF this is empty.\r\n\r\n }", "function doDone() {\r\n // in FF this is empty.\r\n\r\n }", "function onDone(event) {\r\n return () => {\r\n debug(event);\r\n done();\r\n };\r\n }", "function doStep() {\n step(returnable());\n data = [];\n errors = [];\n }", "done(program, state) {\n return true;\n }", "done() {\n return this.token == -1;\n }", "function inspect(val) {\n if (ignoreResult || shouldContinue(val)) {\n return iterate();\n } else {\n return next.cancel(val);\n }\n }", "function running(value, fn) {\n haproxy.running(function (err, running) {\n if (err) return done(err);\n\n expect(running).to.equal(value);\n another.running(function (err, running) {\n if (err) return done(err);\n\n expect(running).to.equal(value);\n fn();\n });\n });\n }", "function running(value, fn) {\n haproxy.running(function (err, running) {\n if (err) return done(err);\n\n expect(running).to.equal(value);\n another.running(function (err, running) {\n if (err) return done(err);\n\n expect(running).to.equal(value);\n fn();\n });\n });\n }", "function done (listener, onerror) {\n\t\tthen(listener, onerror || true);\n\t}", "function Do(gen) {\n function step(value) {\n const result = gen.next(value)\n if (result.done) {\n return result.value\n }\n return result.value.bind(step)\n }\n return step()\n }", "function doStep()\n\t\t\t{\n\t\t\t\tstep(returnable());\n\t\t\t\tdata = [], errors = [];\n\t\t\t}", "function doStep()\n\t\t\t{\n\t\t\t\tstep(returnable());\n\t\t\t\tdata = [], errors = [];\n\t\t\t}", "function doStep()\n\t\t\t{\n\t\t\t\tstep(returnable());\n\t\t\t\tdata = [], errors = [];\n\t\t\t}", "function doStep()\n\t\t\t{\n\t\t\t\tstep(returnable());\n\t\t\t\tdata = [], errors = [];\n\t\t\t}", "function doneTests(opt_failed) {\n endTests(!opt_failed);\n}", "function inspect(val) {\r\n if (ignoreResult || shouldContinue(val)) {\r\n return iterate();\r\n }\r\n return next.cancel(val);\r\n }", "function doResolve(fn, onFulfilled, onRejected) {\n var done = false;\n try {\n fn(function(value) {\n if (done) return\n done = true\n onFulfilled(value)\n }, function(reason) {\n if (done) return\n done = true\n onRejected(reason)\n })\n } catch (ex) {\n if (done) return\n done = true\n onRejected(ex)\n }\n }", "isDone(wizardStep) {\n return wizardStep.completed;\n }", "isDone(wizardStep) {\n return wizardStep.completed;\n }", "function next(err) {\n var fn = fns[++index];\n var params = slice$3.call(arguments, 0);\n var values = params.slice(1);\n var length = input.length;\n var pos = -1;\n\n if (err) {\n done(err);\n return\n }\n\n // Copy non-nully input into values.\n while (++pos < length) {\n if (values[pos] === null || values[pos] === undefined) {\n values[pos] = input[pos];\n }\n }\n\n input = values;\n\n // Next or done.\n if (fn) {\n wrap$2(fn, next).apply(null, input);\n } else {\n done.apply(null, [null].concat(input));\n }\n }", "function doResolve(fn, onFulfilled, onRejected) {\n\t\tvar done = false;\n\t\ttry {\n\t\t\tfn(function (value) {\n\t\t\t\tif (done) return;\n\t\t\t\tdone = true;\n\t\t\t\tonFulfilled(value);\n\t\t\t}, function (reason) {\n\t\t\t\tif (done) return;\n\t\t\t\tdone = true;\n\t\t\t\tonRejected(reason);\n\t\t\t});\n\t\t} catch (ex) {\n\t\t\tif (done) return;\n\t\t\tdone = true;\n\t\t\tonRejected(ex);\n\t\t}\n\t}", "function doResolve(fn, onFulfilled, onRejected) {\n\t\tvar done = false;\n\t\ttry {\n\t\t\tfn(function (value) {\n\t\t\t\tif (done) return;\n\t\t\t\tdone = true;\n\t\t\t\tonFulfilled(value);\n\t\t\t}, function (reason) {\n\t\t\t\tif (done) return;\n\t\t\t\tdone = true;\n\t\t\t\tonRejected(reason);\n\t\t\t});\n\t\t} catch (ex) {\n\t\t\tif (done) return;\n\t\t\tdone = true;\n\t\t\tonRejected(ex);\n\t\t}\n\t}", "function doResolve(fn, onFulfilled, onRejected) {\n\t\tvar done = false;\n\t\ttry {\n\t\t\tfn(function (value) {\n\t\t\t\tif (done) return;\n\t\t\t\tdone = true;\n\t\t\t\tonFulfilled(value);\n\t\t\t}, function (reason) {\n\t\t\t\tif (done) return;\n\t\t\t\tdone = true;\n\t\t\t\tonRejected(reason);\n\t\t\t});\n\t\t} catch (ex) {\n\t\t\tif (done) return;\n\t\t\tdone = true;\n\t\t\tonRejected(ex);\n\t\t}\n\t}" ]
[ "0.6572137", "0.64892197", "0.64739716", "0.64194715", "0.6381711", "0.6374475", "0.63663185", "0.63663185", "0.63663185", "0.63663185", "0.63663185", "0.63663185", "0.63663185", "0.63663185", "0.62876344", "0.62755406", "0.6242043", "0.6175674", "0.61732936", "0.6048527", "0.6043906", "0.5995073", "0.59932727", "0.59932727", "0.5980427", "0.59231377", "0.5811832", "0.5811832", "0.5810687", "0.5807871", "0.5782716", "0.5777222", "0.57326365", "0.5717071", "0.56913614", "0.5668486", "0.56605697", "0.5629544", "0.56013674", "0.56013674", "0.55760753", "0.5575615", "0.5560068", "0.5554799", "0.5553685", "0.5553685", "0.5553685", "0.5553685", "0.5553685", "0.5553685", "0.5519341", "0.5505276", "0.5491004", "0.5464882", "0.5458947", "0.5449695", "0.5447364", "0.542323", "0.53946114", "0.53946114", "0.53946114", "0.53785866", "0.53737146", "0.53727275", "0.5370487", "0.53697485", "0.53555393", "0.535513", "0.5354413", "0.5354413", "0.5349575", "0.53318465", "0.5327175", "0.5317508", "0.5310419", "0.5307193", "0.5307193", "0.53055215", "0.5304111", "0.5303981", "0.5303981", "0.5303981", "0.5303981", "0.5293238", "0.5289955", "0.52834815", "0.52806187", "0.52806187", "0.5278828", "0.5276257", "0.5276257", "0.5276257" ]
0.66370517
8
Create a custom constructor which can be modified without affecting the original class.
function unherit(Super) { var result var key var value inherits(Of, Super) inherits(From, Of) // Clone values. result = Of.prototype for (key in result) { value = result[key] if (value && typeof value === 'object') { result[key] = 'concat' in value ? value.concat() : xtend(value) } } return Of // Constructor accepting a single argument, which itself is an `arguments` // object. function From(parameters) { return Super.apply(this, parameters) } // Constructor accepting variadic arguments. function Of() { if (!(this instanceof Of)) { return new From(arguments) } return Super.apply(this, arguments) } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function temporaryConstructor() {}", "function Constructor() {}", "function Constructor() {}", "function Constructor() {}", "constructor() {\n copy(this, create());\n }", "new() {\n let newInstance = Object.create(this);\n\n newInstance.init(...arguments);\n\n return newInstance;\n }", "function tempCtor() {}", "constructur() {}", "_copy () {\n return new this.constructor()\n }", "_copy () {\n return new this.constructor()\n }", "function TempCtor() {}", "function TempCtor() {}", "function TempCtor() {}", "function TempCtor() {}", "function TempCtor() {}", "function TempCtor() {}", "clone() {\n return new this.constructor(this);\n }", "construct (target, args) {\n return new target(...args)\n }", "function HelperConstructor() {}", "function SpoofConstructor(name){\n this.name=\"I am \" + name;\n return {name:\"I am Deadpool\"};\n}", "function classCreate() {\n return function() {\n this.initialize.apply(this, arguments);\n }\n}", "function new_constructor(initializer, methods, extend) {\n var prototype = Object.create(typeof extend === 'function'\n ? extend.prototype\n : extend);\n if (methods) {\n methods.keys().forEach(function (key) {\n prototype[key] = methods[key];\n}); }\n function constructor() {\n var that = Object.create(prototype);\n if (typeof initializer === 'function') {\n initializer.apply(that, arguments);\n }\n return that;\n }\n constructor.prototype = prototype;\n prototype.constructor = constructor;\n return constructor;\n }", "copy({ type = this.type, value = this.value } = {}) {\n const { id, lbp, rules, unknown, ignored } = this;\n return new this.constructor(id, {\n lbp,\n rules,\n unknown,\n ignored,\n type,\n value,\n original: this,\n });\n }", "function make_class(){\n\tvar isInternal;\n\tvar constructor = function(args){\n if ( this instanceof constructor ) {\n\t\tif ( typeof this.init == \"function\" ) {\n this.init.apply( this, isInternal ? args : arguments );\n\t\t}\n } else {\n\t\tisInternal = true;\n\t\tvar instance = new constructor( arguments );\n\t\tisInternal = false;\n\t\treturn instance;\n }\n\t};\n\treturn constructor;\n }", "function make_class(){\n\tvar isInternal;\n\tvar constructor = function(args){\n if ( this instanceof constructor ) {\n\t\tif ( typeof this.init == \"function\" ) {\n this.init.apply( this, isInternal ? args : arguments );\n\t\t}\n } else {\n\t\tisInternal = true;\n\t\tvar instance = new constructor( arguments );\n\t\tisInternal = false;\n\t\treturn instance;\n }\n\t};\n\treturn constructor;\n }", "constructor( ) {}", "function Ctor() {}", "function construct(constructor, args) {\n var c = function () {\n return constructor.apply(this, args);\n };\n c.prototype = constructor.prototype;\n var instance = new c();\n instance['@Serializable.ModuleName'] = moduleName;\n instance['@Serializable.TypeName'] = original.name;\n return instance;\n }", "constructor(a, b, c) {\n super(a, b, c);\n }", "function new2() {\n const constructor = arguments[0];\n const args = [].slice.call(arguments, 1);\n const obj = new Object();\n obj.__proto__ = constructor.prototype;\n const ret = constructor.apply(obj, [...args]);\n if (ret && (typeof ret === 'object' || typeof ret === 'function')) {\n return ret;\n }\n return obj;\n}", "function Class() {\n \n if(!(this instanceof arguments.callee)) {\n //return new arguments.callee(options);\n throw new Error('Please used \"new\" keyword to create object!');\n }\n\n // All construction is actually done in the init method\n if (/* !initializing && */this.init )\n this.init.apply(this, arguments);\n }", "function createConstructor(name, opts) {\n\t var func = create.bind(null, name);\n\n\t // Assigning defaults gives a predictable definition and prevents us from\n\t // having to do defaults checks everywhere.\n\t assign(func, defaults);\n\n\t // Inherit all options. This takes into account object literals as well as\n\t // ES2015 classes that may have inherited static props which would not be\n\t // considered \"own\".\n\t utilDefineProperties(func, getAllPropertyDescriptors(opts));\n\n\t return func;\n\t}", "Constructor(args, returns, options = {}) {\r\n return { ...options, kind: exports.ConstructorKind, type: 'constructor', arguments: args, returns };\r\n }", "function makeObjectWithFakeCtor() {\n function fakeCtor() {\n }\n fakeCtor.prototype = ctor.prototype;\n return new fakeCtor();\n }", "constructor() {}", "constructor() {}", "constructor() {}", "constructor() {}", "constructor() {}", "constructor() {}", "constructor() {}", "constructor() {}", "constructor() {}", "constructor() {}", "constructor() {}", "constructor() {}", "constructor() {}", "constructor() {}", "constructor() {}", "constructor() {}", "constructor() {}", "constructor() {}", "constructor() {}", "constructor() {}", "constructor() {}", "constructor() {}", "constructor() {}", "constructor() {}", "constructor() {}", "constructor() {}", "constructor() {}", "constructor() {}", "constructor() {}", "constructor() {}", "constructor() {}", "constructor() {}", "constructor() {}", "constructor() {}", "constructor() {}", "function MyConstructor(){\n\t\tthis.prop1 = \"Maxsuel\";\n\t\tthis.prop2 = \"Storch\";\n\t}", "constructor(){}", "constructor(){}", "constructor(){}", "constructor(){}", "constructor(){}", "constructor(){}", "constructor(){}", "function construct(constructor, args) {\n var c = function () {\n return constructor.apply(this, args);\n };\n c.prototype = constructor.prototype;\n return new c();\n }", "function applyConstructor(ctor, args) {\n // http://stackoverflow.com/a/8843181/4137472\n return new (ctor.bind.apply(ctor, [null].concat(args)));\n }", "function JClass() {\n // only call 'init' when 'new' is invoked outside the 'extend' method\n if (!initializing && this[opts.ctorName])\n this[opts.ctorName].apply(this, arguments);\n }", "function construct(constructor, args) {\n var c = function () {\n return constructor.apply(this, args);\n };\n c.prototype = constructor.prototype;\n return new c();\n }", "function construct(constructor, args) {\n var c = function () {\n return constructor.apply(this, args);\n };\n c.prototype = constructor.prototype;\n return new c();\n }", "function construct(constructor, args) {\n var c = function () {\n return constructor.apply(this, args);\n };\n c.prototype = constructor.prototype;\n return new c();\n }", "constructor(args, opts) {\n super(args, opts);\n}", "function ctor() {\n this.constructor = ChildFunc;\n }", "function $new(ctor, k, args)\n{\n if($isTransformed(ctor))\n {\n if(!ctor.$blank)\n ctor.$blank = $makeBlank(ctor);\n\n var obj = new ctor.$blank;\n var augmentedK = $makeK(function(x) {\n if(x != null && x != undefined)\n return k(x);\n else\n return k(obj);\n });\n \n return ctor.apply(obj, [augmentedK].concat(args));\n }\n else\n {\n var privateCtor = function ()\n {\n return ctor.apply(this, args);\n };\n privateCtor.prototype = ctor.prototype;\n\n return k(new privateCtor);\n }\n}", "function Constructor() {\n // All construction is actually done in the init method.\n if (!initializing) {\n return this.constructor !== Constructor && arguments.length ?\n // We are being called without `new` or we are extending.\n arguments.callee.extend.apply(arguments.callee, arguments) :\n // We are being called with `new`.\n this.constructor.newInstance.apply(this.constructor, arguments);\n }\n }", "function _ctor() {\n\t}", "function construct(constructor, argList) {\r\n for (var argNames = '', i = argList.length; i--;) {\r\n argNames += (argNames ? ',a' : 'a') + i;\r\n }\r\n return Function(argNames, 'return new this(' + argNames + ')').apply(constructor, argList);\r\n }", "function constructorDecorator(...args) {\n const instance = new OriginalClass(...args);\n\n // Decorator for the defaultType property\n Object.defineProperty(instance, 'defaultType', {\n get: () => instance._defaultType,\n set: (type) => {\n if (!['box', 'box_by_4_points', 'points', 'polygon',\n 'polyline', 'auto_segmentation', 'cuboid'].includes(type)) {\n throw Error(`Unknown shape type found ${type}`);\n }\n instance._defaultType = type;\n },\n });\n\n // Decorator for finish method.\n const decoratedFinish = instance.finish;\n instance.finish = (result) => {\n if (instance._defaultType === 'auto_segmentation') {\n try {\n instance._defaultType = 'polygon';\n decoratedFinish.call(instance, result);\n } finally {\n instance._defaultType = 'auto_segmentation';\n }\n } else {\n decoratedFinish.call(instance, result);\n }\n };\n\n return instance;\n }", "function makeCtor(className) {\n function constructor() {\n // Opera has some problems returning from a constructor when Dragonfly isn't running.\n // The || null seems to be sufficient to stop it misbehaving. Known to be required\n // against 10.53, 11.51 and 11.61.\n return this.constructor.apply(this, arguments) || null;\n }\n if (className) {\n constructor.name = className;\n }\n return constructor;\n }", "function C() {\n C.superconstructor.apply(this, arguments);\n }", "function new_constructor(extend, initializer, methods){\n\t\t\tvar func,\n\t\t\t\tmethodsArr,\n\t\t\t\tmethodsLen,\n\t\t\t\tk,\n\t\t\t\tprototype = Object.create(extend && extend.prototype);\t// ES5, but backup function provided above\n\t\t\t\n\t\t\tif(methods){\n\t\t\t\tmethodsArr = Object.keys(methods);\t\t\t\t\t\t// ES5, but backup function provided above\n\t\t\t\tmethodsLen = methodsArr.length;\n\t\t\t\tfor(k = methodsLen; k--;){\n\t\t\t\t\tprototype[methodsArr[k]] = methods[methodsArr[k]];\t\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\tfunc = function(){\t\t\n\t\t\t\tvar that = Object.create(prototype);\t\t\t\t\t// ES5, but backup function provided above\n\t\t\t\tif(typeof initializer === \"function\"){\n\t\t\t\t\tinitializer.apply(that, arguments);\n\t\t\t\t}\n\t\t\t\treturn that;\n\t\t\t};\n\t\t\t\n\t\t\tfunc.prototype = prototype;\n\t\t\tprototype.constructor = func;\n\t\t\treturn func;\n\t\t}", "function construct() { }", "function constructor(spec){\n // 1. initialize own members from spec\n let {member} = spec;\n\n // 2. composition with other objects\n // you can select only the parts that you want to use\n // you only \"inherit\" the stuff that you need\n let {other} = other_constructor(spec);\n\n // 3. methods\n let method = function(){ // close over other methods, variables and spec };\n\n // 4. Expose public API\n // Note new ES6 that lets you define object properties like this:\n // {method, other}\n // instea of\n // { method : method, other : other}\n return Object.freeze({ // immutable (see https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/freeze)\n method,\n other\n });\n }\n}", "function makeClass(name, parentPrototype, constructor) {\n // jshint evil: true\n // this way we return a proper constructor where\n // CTOR.name === name\n var CTOR = new Function('ctor', 'return '\n + 'function ' + name + '(...args) {'\n + 'ctor.apply(this, args);'\n + '};'\n )(constructor);\n if(parentPrototype)\n CTOR.prototype = Object.create(parentPrototype);\n CTOR.prototype.constructor = CTOR;\n return CTOR;\n}", "constructor() {\n if (new.target === MatrixBase) {\n throw new TypeError('Cannot construct MatrixBase instances directly');\n }\n }", "constructor(...args) {\n super(...args);\n \n }", "function cheapNew(cls) {\n\t\t\t\tdisable_constructor = true;\n\t\t\t\tvar rv = new cls;\n\t\t\t\tdisable_constructor = false;\n\t\t\t\treturn rv;\n\t\t\t}", "function _new(Cls) {\n return new(Cls.bind.apply(Cls, arguments))();\n }", "function construct(constructor, args) {\n\t function F() {\n\t return constructor.apply(this, args);\n\t }\n\t F.prototype = constructor.prototype;\n\t return new F();\n\t}" ]
[ "0.7260429", "0.7071604", "0.7071604", "0.7071604", "0.7062483", "0.7026925", "0.6914832", "0.68617076", "0.67593026", "0.67593026", "0.6710411", "0.6710411", "0.6710411", "0.6710411", "0.6710411", "0.6710411", "0.6666424", "0.663215", "0.6617585", "0.6609436", "0.65504104", "0.6534507", "0.65261877", "0.64935124", "0.64935124", "0.6481542", "0.6441776", "0.639681", "0.6387736", "0.6377843", "0.6347072", "0.6334316", "0.63333744", "0.63259774", "0.6317369", "0.6317369", "0.6317369", "0.6317369", "0.6317369", "0.6317369", "0.6317369", "0.6317369", "0.6317369", "0.6317369", "0.6317369", "0.6317369", "0.6317369", "0.6317369", "0.6317369", "0.6317369", "0.6317369", "0.6317369", "0.6317369", "0.6317369", "0.6317369", "0.6317369", "0.6317369", "0.6317369", "0.6317369", "0.6317369", "0.6317369", "0.6317369", "0.6317369", "0.6317369", "0.6317369", "0.6317369", "0.6317369", "0.6317369", "0.6317369", "0.63154495", "0.62925076", "0.62925076", "0.62925076", "0.62925076", "0.62925076", "0.62925076", "0.62925076", "0.62774974", "0.6272086", "0.6260646", "0.6258349", "0.62418526", "0.62418526", "0.6238644", "0.62366754", "0.62310976", "0.62084216", "0.6179552", "0.61762863", "0.61631376", "0.61618793", "0.6148415", "0.6141382", "0.61372846", "0.6128958", "0.61252624", "0.61135334", "0.61127484", "0.61119187", "0.6101527", "0.60911524" ]
0.0
-1
Constructor accepting a single argument, which itself is an `arguments` object.
function From(parameters) { return Super.apply(this, parameters) }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function C(arg) {\n this.args = arguments;\n}", "constructor(args) {\n super(args);\n }", "constructor(args) {\n super(args);\n }", "constructor(args) {\n super();\n args = args || {}\n this.CONSTRUCTOR_ID = 0x99c1d49d;\n this.SUBCLASS_OF_ID = 0xeb9987b3;\n\n this.value = args.value;\n }", "constructor(args) {\n super();\n args = args || {}\n this.CONSTRUCTOR_ID = 0x09333afb;\n this.SUBCLASS_OF_ID = 0xf1163490;\n\n this.length = args.length;\n }", "constructor(args) {\n super();\n args = args || {}\n this.CONSTRUCTOR_ID = 0x4d4dc41e;\n this.SUBCLASS_OF_ID = 0xf1163490;\n\n this.length = args.length;\n }", "constructor(args) {\n super();\n args = args || {}\n this.CONSTRUCTOR_ID = 0x2be0dfa4;\n this.SUBCLASS_OF_ID = 0xeb9987b3;\n\n this.value = args.value;\n }", "constructor() {\n if (arguments.length === 1) {\n let arg1 = arguments[0];\n if (typeof arg1 === 'string') this.parseString(arg1);\n else {\n this.r = arg1.r;\n this.g = arg1.g;\n this.b = arg1.b;\n this.a = arg1.a;\n }\n }\n }", "constructor(args, opts) {\n super(args, opts);\n}", "constructor(args) {\n super();\n args = args || {}\n this.CONSTRUCTOR_ID = 0xb71e767a;\n this.SUBCLASS_OF_ID = 0xeb9987b3;\n\n this.value = args.value;\n }", "constructor(args) {\n super();\n args = args || {}\n this.CONSTRUCTOR_ID = 0xc7345e6a;\n this.SUBCLASS_OF_ID = 0xeb9987b3;\n\n this.value = args.value;\n }", "constructor(args) {\n super();\n args = args || {}\n this.CONSTRUCTOR_ID = 0x9b69e34b;\n this.SUBCLASS_OF_ID = 0xcf6419dc;\n\n this.offset = args.offset;\n this.length = args.length;\n }", "constructor(args) {\n super();\n args = args || {}\n this.CONSTRUCTOR_ID = 0xf7444763;\n this.SUBCLASS_OF_ID = 0xeb9987b3;\n\n this.value = args.value;\n }", "constructor(args) {\n super();\n args = args || {}\n this.CONSTRUCTOR_ID = 0x6cef8ac7;\n this.SUBCLASS_OF_ID = 0xcf6419dc;\n\n this.offset = args.offset;\n this.length = args.length;\n }", "javaArgs() { }", "constructor(args) {\n super();\n args = args || {}\n this.CONSTRUCTOR_ID = 0x28a20571;\n this.SUBCLASS_OF_ID = 0xcf6419dc;\n\n this.offset = args.offset;\n this.length = args.length;\n }", "constructor(args) {\n super();\n args = args || {}\n this.CONSTRUCTOR_ID = 0x6f635b0d;\n this.SUBCLASS_OF_ID = 0xcf6419dc;\n\n this.offset = args.offset;\n this.length = args.length;\n }", "constructor(args) {\n super();\n args = args || {}\n this.CONSTRUCTOR_ID = 0x9c4e7e8b;\n this.SUBCLASS_OF_ID = 0xcf6419dc;\n\n this.offset = args.offset;\n this.length = args.length;\n }", "constructor(args) {\n super();\n args = args || {}\n this.CONSTRUCTOR_ID = 0x020df5d0;\n this.SUBCLASS_OF_ID = 0xcf6419dc;\n\n this.offset = args.offset;\n this.length = args.length;\n }", "constructor(args) {\n super();\n args = args || {}\n this.CONSTRUCTOR_ID = 0x6ed02538;\n this.SUBCLASS_OF_ID = 0xcf6419dc;\n\n this.offset = args.offset;\n this.length = args.length;\n }", "constructor(args) {\n super();\n args = args || {}\n this.CONSTRUCTOR_ID = 0x4c4e743f;\n this.SUBCLASS_OF_ID = 0xcf6419dc;\n\n this.offset = args.offset;\n this.length = args.length;\n }", "Constructor(args, returns, options = {}) {\r\n return { ...options, kind: exports.ConstructorKind, type: 'constructor', arguments: args, returns };\r\n }", "constructor(args) {\n super();\n args = args || {}\n this.CONSTRUCTOR_ID = 0x64e475c2;\n this.SUBCLASS_OF_ID = 0xcf6419dc;\n\n this.offset = args.offset;\n this.length = args.length;\n }", "constructor(args) {\n super();\n args = args || {}\n this.CONSTRUCTOR_ID = 0x826f8b60;\n this.SUBCLASS_OF_ID = 0xcf6419dc;\n\n this.offset = args.offset;\n this.length = args.length;\n }", "constructor(args) {\n super();\n args = args || {}\n this.CONSTRUCTOR_ID = 0x1b0c841a;\n this.SUBCLASS_OF_ID = 0x33d47f45;\n\n this.date = args.date || null;\n }", "constructor(args) {\n super();\n args = args || {}\n this.CONSTRUCTOR_ID = 0xfa04579d;\n this.SUBCLASS_OF_ID = 0xcf6419dc;\n\n this.offset = args.offset;\n this.length = args.length;\n }", "constructor(args) {\n super();\n args = args || {}\n this.CONSTRUCTOR_ID = 0x0e17e23c;\n this.SUBCLASS_OF_ID = 0x17cc29d9;\n\n this.type = args.type;\n }", "constructor(args) {\n super();\n args = args || {}\n this.CONSTRUCTOR_ID = 0xbd610bc9;\n this.SUBCLASS_OF_ID = 0xcf6419dc;\n\n this.offset = args.offset;\n this.length = args.length;\n }", "constructor(args) {\n super();\n args = args || {}\n this.CONSTRUCTOR_ID = 0xbf0693d4;\n this.SUBCLASS_OF_ID = 0xcf6419dc;\n\n this.offset = args.offset;\n this.length = args.length;\n }", "constructor(args) {\n super();\n args = args || {}\n this.CONSTRUCTOR_ID = 0xbb92ba95;\n this.SUBCLASS_OF_ID = 0xcf6419dc;\n\n this.offset = args.offset;\n this.length = args.length;\n }", "constructor(args) {\n super();\n args = args || {}\n this.CONSTRUCTOR_ID = 0x7d748d04;\n this.SUBCLASS_OF_ID = 0xad0352e8;\n\n this.data = args.data;\n }", "construct (target, args) {\n return new target(...args)\n }", "constructor(args) {\n super();\n args = args || {}\n this.CONSTRUCTOR_ID = 0x73924be0;\n this.SUBCLASS_OF_ID = 0xcf6419dc;\n\n this.offset = args.offset;\n this.length = args.length;\n this.language = args.language;\n }", "function construct(constructor, argList) {\r\n for (var argNames = '', i = argList.length; i--;) {\r\n argNames += (argNames ? ',a' : 'a') + i;\r\n }\r\n return Function(argNames, 'return new this(' + argNames + ')').apply(constructor, argList);\r\n }", "constructor(args) {\n super();\n args = args || {}\n this.CONSTRUCTOR_ID = 0x1b287353;\n this.SUBCLASS_OF_ID = 0x8680d126;\n\n this.values = args.values;\n this.credentials = args.credentials;\n }", "constructor(args) {\n super();\n args = args || {}\n this.CONSTRUCTOR_ID = 0x8317c0c3;\n this.SUBCLASS_OF_ID = 0x9f89304e;\n\n this.data = args.data;\n }", "constructor(args) {\n super();\n args = args || {}\n this.CONSTRUCTOR_ID = 0x861cc8a0;\n this.SUBCLASS_OF_ID = 0x3da389aa;\n\n this.shortName = args.shortName;\n }", "constructor(args) {\n super();\n args = args || {}\n this.CONSTRUCTOR_ID = 0xce0d37b0;\n this.SUBCLASS_OF_ID = 0x1aca5644;\n\n this.name = args.name;\n }", "constructor(args) {\n super();\n args = args || {}\n this.CONSTRUCTOR_ID = 0x1427a5e1;\n this.SUBCLASS_OF_ID = 0xbf4e2753;\n\n this.q = args.q;\n }", "constructor(args) {\n super();\n args = args || {}\n this.CONSTRUCTOR_ID = 0xa3b54985;\n this.SUBCLASS_OF_ID = 0xbf4e2753;\n\n this.q = args.q;\n }", "constructor(args) {\n super();\n args = args || {}\n this.CONSTRUCTOR_ID = 0x4218a164;\n this.SUBCLASS_OF_ID = 0xf1163490;\n\n this.data = args.data;\n }", "constructor(args) {\n super();\n args = args || {}\n this.CONSTRUCTOR_ID = 0x0656ac4b;\n this.SUBCLASS_OF_ID = 0xbf4e2753;\n\n this.q = args.q;\n }", "constructor (command, ...args) {\n super(command, ...args)\n }", "constructor (command, ...args) {\n super(command, ...args)\n }", "function ArrayArgument() {\n this.args = [];\n}", "function ArrayArgument() {\n this.args = [];\n}", "constructor(args) {\n super();\n args = args || {}\n this.CONSTRUCTOR_ID = 0xf8b036af;\n this.SUBCLASS_OF_ID = 0x99d5cb14;\n\n this.byLocation = args.byLocation || null;\n this.checkLimit = args.checkLimit || null;\n }", "constructor(args) {\n super();\n args = args || {}\n this.CONSTRUCTOR_ID = 0x95d2ac92;\n this.SUBCLASS_OF_ID = 0x8680d126;\n\n this.title = args.title;\n }", "constructor(name = 'anonymous', age = 0) { // if there's no name - argmuent = 'anonymous'\n this.name = name; // 'this' referes to the class instance\n this.age = age;\n}", "constructor(args) {\n super();\n args = args || {}\n this.CONSTRUCTOR_ID = 0xbb6ae88d;\n this.SUBCLASS_OF_ID = 0xbf4e2753;\n\n this.q = args.q;\n }", "constructor(...args) {\n super(...args);\n \n }", "constructor(args) {\n super();\n args = args || {}\n this.CONSTRUCTOR_ID = 0xb5a1ce5a;\n this.SUBCLASS_OF_ID = 0x8680d126;\n\n this.title = args.title;\n }", "constructor(args) {\n super();\n args = args || {}\n this.CONSTRUCTOR_ID = 0xc27ac8c7;\n this.SUBCLASS_OF_ID = 0xe1e62c2;\n\n this.command = args.command;\n this.description = args.description;\n }", "constructor(args) {\n super();\n args = args || {}\n this.CONSTRUCTOR_ID = 0xeb1477e8;\n this.SUBCLASS_OF_ID = 0x55a97481;\n\n this.id = args.id;\n }", "constructor(args) {\n super();\n args = args || {}\n this.CONSTRUCTOR_ID = 0x1142bd56;\n this.SUBCLASS_OF_ID = 0x6db98c4;\n\n this.phone = args.phone;\n this.firstName = args.firstName;\n this.lastName = args.lastName;\n this.date = args.date;\n }", "constructor(args) {\n super();\n args = args || {}\n this.CONSTRUCTOR_ID = 0xb4a2e88d;\n this.SUBCLASS_OF_ID = 0x9f89304e;\n\n this.chat = args.chat;\n this.date = args.date;\n }", "constructor(args) {\n super();\n args = args || {}\n this.CONSTRUCTOR_ID = 0x2331b22d;\n this.SUBCLASS_OF_ID = 0xd576ab1c;\n\n this.id = args.id;\n }", "constructor() {\n super();\n if (arguments.length === 0) {\n this._constructorDefault();\n }\n else if (arguments.length === 2) {\n this._constructorValues(arguments[0], arguments[1]);\n }\n else if (arguments.length === 1) {\n this._constructorPoint(arguments[0]);\n }\n else {\n throw new Error('HPoint#constructor error: Invalid number of arguments.');\n }\n }", "constructor(args) {\n super();\n args = args || {}\n this.CONSTRUCTOR_ID = 0x16115a96;\n this.SUBCLASS_OF_ID = 0x1aca5644;\n\n this.title = args.title;\n this.articles = args.articles;\n }", "constructor(args) {\n super();\n args = args || {}\n this.CONSTRUCTOR_ID = 0x3c20629f;\n this.SUBCLASS_OF_ID = 0x82b1f73b;\n\n this.text = args.text;\n this.startParam = args.startParam;\n }", "constructor(args) {\n super();\n args = args || {}\n this.CONSTRUCTOR_ID = 0xbaafe5e0;\n this.SUBCLASS_OF_ID = 0x1aca5644;\n\n this.author = args.author;\n this.publishedDate = args.publishedDate;\n }", "function Argument (variable, expression){\n\tthis.variable = variable;\n\tthis.expression = expression;\t\n\t\n\tthis.toString = function(){\n\t\treturn this.variable + '=' + this.expression.toString();\n\t}\n}", "constructor(args) {\n super();\n args = args || {}\n this.CONSTRUCTOR_ID = 0xab0f6b1e;\n this.SUBCLASS_OF_ID = 0x9f89304e;\n\n this.phoneCall = args.phoneCall;\n }", "constructor(args) {\n super();\n args = args || {}\n this.CONSTRUCTOR_ID = 0x76a6d327;\n this.SUBCLASS_OF_ID = 0xcf6419dc;\n\n this.offset = args.offset;\n this.length = args.length;\n this.url = args.url;\n }", "constructor(args) {\n super();\n args = args || {}\n this.CONSTRUCTOR_ID = 0x5cc761bd;\n this.SUBCLASS_OF_ID = 0xd279c672;\n\n this.langCode = args.langCode;\n this.fromVersion = args.fromVersion;\n this.version = args.version;\n this.keywords = args.keywords;\n }", "constructor(args) {\n super();\n args = args || {}\n this.CONSTRUCTOR_ID = 0xab7ec0a0;\n this.SUBCLASS_OF_ID = 0x6d28a37a;\n\n this.id = args.id;\n }", "constructor(args) {\n super();\n args = args || {}\n this.CONSTRUCTOR_ID = 0xd95c6154;\n this.SUBCLASS_OF_ID = 0x8680d126;\n\n this.types = args.types;\n }", "constructor(args) {\n super();\n args = args || {}\n this.CONSTRUCTOR_ID = 0x9a8ae1e1;\n this.SUBCLASS_OF_ID = 0x1aca5644;\n\n this.items = args.items;\n }", "constructor(args) {\n super();\n args = args || {}\n this.CONSTRUCTOR_ID = 0x47a971e0;\n this.SUBCLASS_OF_ID = 0x8d4c94c0;\n\n this.url = args.url;\n }", "constructor(args) {\n super();\n args = args || {}\n this.CONSTRUCTOR_ID = 0xeea8e46e;\n this.SUBCLASS_OF_ID = 0xf5ccf928;\n\n this.requestToken = args.requestToken;\n }", "constructor(args) {\n super();\n args = args || {}\n this.CONSTRUCTOR_ID = 0x5e068047;\n this.SUBCLASS_OF_ID = 0xeeda0eb8;\n\n this.num = args.num;\n this.text = args.text;\n }", "constructor( args ) {\n\t\t\t\tsuper( args );\n\t\t\t}", "constructor(args) {\n super();\n args = args || {}\n this.CONSTRUCTOR_ID = 0x8953ad37;\n this.SUBCLASS_OF_ID = 0xd4eb2d74;\n\n this.id = args.id;\n }", "constructor(args) {\n super();\n args = args || {}\n this.CONSTRUCTOR_ID = 0x561bc879;\n this.SUBCLASS_OF_ID = 0xb12d7ac6;\n\n this.userId = args.userId;\n this.date = args.date;\n }", "constructor(args) {\n super();\n args = args || {}\n this.CONSTRUCTOR_ID = 0xf4108aa0;\n this.SUBCLASS_OF_ID = 0xe2e10ef2;\n\n this.singleUse = args.singleUse || null;\n this.selective = args.selective || null;\n }", "static create(...args /* :Array<*> */) {\n\t\treturn new this(...args)\n\t}", "constructor(args) {\n super();\n args = args || {}\n this.CONSTRUCTOR_ID = 0xc586da1c;\n this.SUBCLASS_OF_ID = 0x55a97481;\n\n this.id = args.id;\n this.date = args.date;\n }", "constructor(args) {\n super();\n args = args || {}\n this.CONSTRUCTOR_ID = 0x0a7f6bbb;\n this.SUBCLASS_OF_ID = 0x99d5cb14;\n\n this.id = args.id;\n }", "constructor(args) {\n super();\n args = args || {}\n this.CONSTRUCTOR_ID = 0x4a992157;\n this.SUBCLASS_OF_ID = 0x5146d99e;\n\n this.id = args.id;\n }", "constructor(args) {\n super();\n args = args || {}\n this.CONSTRUCTOR_ID = 0x15ebac1d;\n this.SUBCLASS_OF_ID = 0xd9c7fc18;\n\n this.userId = args.userId;\n this.date = args.date;\n }", "constructor(args) {\n super();\n args = args || {}\n this.CONSTRUCTOR_ID = 0xd33f43f3;\n this.SUBCLASS_OF_ID = 0xfaf846f4;\n\n this.id = args.id;\n }", "constructor(args) {\n super();\n args = args || {}\n this.CONSTRUCTOR_ID = 0x46e1d13d;\n this.SUBCLASS_OF_ID = 0x55a53079;\n\n this.url = args.url;\n }", "constructor(args) {\n super();\n args = args || {}\n this.CONSTRUCTOR_ID = 0x4843b0fd;\n this.SUBCLASS_OF_ID = 0xfaf846f4;\n\n this.url = args.url;\n this.q = args.q;\n }", "function Construct(target, thisArg, argsArray) {\n if(!(this instanceof Construct)) return new Construct(target, thisArg, argsArray);\n else Call.call(this, target);\n\n Object.defineProperties(this, {\n \"thisArg\": {\n value: thisArg\n },\n \"argsArray\": {\n value: argsArray\n }\n });\n }", "constructor(args) {\n super();\n args = args || {}\n this.CONSTRUCTOR_ID = 0xa676a322;\n this.SUBCLASS_OF_ID = 0x54b6bcc5;\n\n this.id = args.id;\n }", "constructor(args) {\n super();\n args = args || {}\n this.CONSTRUCTOR_ID = 0x027477b4;\n this.SUBCLASS_OF_ID = 0x7c7b420a;\n\n this.types = args.types;\n }", "constructor(args) {\n super();\n args = args || {}\n this.CONSTRUCTOR_ID = 0x8f8c0e4e;\n this.SUBCLASS_OF_ID = 0x7765cb1e;\n\n this.url = args.url;\n }", "constructor(args) {\n super();\n args = args || {}\n this.CONSTRUCTOR_ID = 0x46560264;\n this.SUBCLASS_OF_ID = 0x9f89304e;\n\n this.langCode = args.langCode;\n }", "constructor(args) {\n super();\n args = args || {}\n this.CONSTRUCTOR_ID = 0xa6638b9a;\n this.SUBCLASS_OF_ID = 0x8680d126;\n\n this.title = args.title;\n this.users = args.users;\n }", "function SuperArg(name){\n this.name = name\n}", "constructor(args) {\n super();\n args = args || {}\n this.CONSTRUCTOR_ID = 0xbad88395;\n this.SUBCLASS_OF_ID = 0x54b6bcc5;\n\n this.id = args.id;\n }", "constructor(args) {\n super();\n args = args || {}\n this.CONSTRUCTOR_ID = 0x5366c915;\n this.SUBCLASS_OF_ID = 0xc47f1bd1;\n\n this.id = args.id;\n }", "constructor(args) {\n super();\n args = args || {}\n this.CONSTRUCTOR_ID = 0xa384b779;\n this.SUBCLASS_OF_ID = 0xa962381e;\n\n this.id = args.id;\n this.flags = args.flags;\n }", "constructor(args) {\n super();\n args = args || {}\n this.CONSTRUCTOR_ID = 0x36f8c871;\n this.SUBCLASS_OF_ID = 0x211fe820;\n\n this.id = args.id;\n }", "constructor(args) {\n super();\n args = args || {}\n this.CONSTRUCTOR_ID = 0xedb93949;\n this.SUBCLASS_OF_ID = 0x5b0b743e;\n\n this.expires = args.expires;\n }", "constructor(args) {\n super();\n args = args || {}\n this.CONSTRUCTOR_ID = 0x200250ba;\n this.SUBCLASS_OF_ID = 0x2da17977;\n\n this.id = args.id;\n }", "constructor(args) {\n super();\n args = args || {}\n this.CONSTRUCTOR_ID = 0x0438865b;\n this.SUBCLASS_OF_ID = 0x5146d99e;\n\n this.id = args.id;\n }", "constructor(args) {\n super();\n args = args || {}\n this.CONSTRUCTOR_ID = 0xb055eaee;\n this.SUBCLASS_OF_ID = 0x8680d126;\n\n this.title = args.title;\n this.chatId = args.chatId;\n }", "constructor(args) {\n super();\n args = args || {}\n this.CONSTRUCTOR_ID = 0xbc0a57dc;\n this.SUBCLASS_OF_ID = 0x55a53079;\n\n this.url = args.url;\n this.set = args.set;\n }", "constructor(args) {\n super();\n args = args || {}\n this.CONSTRUCTOR_ID = 0xb3fb5361;\n this.SUBCLASS_OF_ID = 0xa48d04ee;\n\n this.langCode = args.langCode;\n }", "constructor(args) {\n super();\n args = args || {}\n this.CONSTRUCTOR_ID = 0xf385c1f6;\n this.SUBCLASS_OF_ID = 0x52662d55;\n\n this.langCode = args.langCode;\n this.fromVersion = args.fromVersion;\n this.version = args.version;\n this.strings = args.strings;\n }" ]
[ "0.6959179", "0.643698", "0.643698", "0.6311878", "0.62868017", "0.62729627", "0.6272085", "0.6236955", "0.6227004", "0.6225904", "0.62001526", "0.6163254", "0.6159827", "0.61476386", "0.6146458", "0.6134848", "0.6127441", "0.61070144", "0.6099203", "0.6095188", "0.6079402", "0.607718", "0.6058203", "0.6056445", "0.6046529", "0.6046346", "0.6039404", "0.6036819", "0.60117155", "0.6008827", "0.5994562", "0.5987323", "0.59829193", "0.59764946", "0.597606", "0.5974693", "0.5973758", "0.5967979", "0.5953729", "0.5949323", "0.59405965", "0.59405744", "0.59319997", "0.59319997", "0.5930992", "0.5930992", "0.5929133", "0.58951056", "0.5893852", "0.58841455", "0.58812314", "0.58811224", "0.58711994", "0.5865542", "0.5862599", "0.58622444", "0.5858156", "0.5854127", "0.5841712", "0.5839905", "0.58368945", "0.58334786", "0.58300006", "0.5828623", "0.58226234", "0.5815373", "0.5814856", "0.58099616", "0.5809672", "0.5808189", "0.58044183", "0.58038825", "0.5802781", "0.5801813", "0.57983094", "0.5797869", "0.57947415", "0.5794395", "0.5791736", "0.5790161", "0.578927", "0.57857186", "0.57810986", "0.57782984", "0.5778296", "0.5777428", "0.5774965", "0.5773585", "0.5773478", "0.5770663", "0.5770014", "0.5768743", "0.5767798", "0.57643014", "0.5760126", "0.57575816", "0.5757327", "0.57558244", "0.57514316", "0.574639", "0.5746066" ]
0.0
-1
Constructor accepting variadic arguments.
function Of() { if (!(this instanceof Of)) { return new From(arguments) } return Super.apply(this, arguments) }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "static create(...args /* :Array<*> */) {\n\t\treturn new this(...args)\n\t}", "construct (target, args) {\n return new target(...args)\n }", "constructor(args) {\n super();\n args = args || {}\n this.CONSTRUCTOR_ID = 0x09333afb;\n this.SUBCLASS_OF_ID = 0xf1163490;\n\n this.length = args.length;\n }", "constructor(args) {\n super(args);\n }", "constructor(args) {\n super(args);\n }", "constructor(args) {\n super();\n args = args || {}\n this.CONSTRUCTOR_ID = 0x4d4dc41e;\n this.SUBCLASS_OF_ID = 0xf1163490;\n\n this.length = args.length;\n }", "constructor(...args) {\n super(...args);\n \n }", "constructor(args, opts) {\n super(args, opts);\n}", "constructor(args) {\n super();\n args = args || {}\n this.CONSTRUCTOR_ID = 0x9b69e34b;\n this.SUBCLASS_OF_ID = 0xcf6419dc;\n\n this.offset = args.offset;\n this.length = args.length;\n }", "constructor(args) {\n super();\n args = args || {}\n this.CONSTRUCTOR_ID = 0x6cef8ac7;\n this.SUBCLASS_OF_ID = 0xcf6419dc;\n\n this.offset = args.offset;\n this.length = args.length;\n }", "constructor(args) {\n super();\n args = args || {}\n this.CONSTRUCTOR_ID = 0x6f635b0d;\n this.SUBCLASS_OF_ID = 0xcf6419dc;\n\n this.offset = args.offset;\n this.length = args.length;\n }", "constructor(args) {\n super();\n args = args || {}\n this.CONSTRUCTOR_ID = 0x9c4e7e8b;\n this.SUBCLASS_OF_ID = 0xcf6419dc;\n\n this.offset = args.offset;\n this.length = args.length;\n }", "constructor(args) {\n super();\n args = args || {}\n this.CONSTRUCTOR_ID = 0x6ed02538;\n this.SUBCLASS_OF_ID = 0xcf6419dc;\n\n this.offset = args.offset;\n this.length = args.length;\n }", "constructor(args) {\n super();\n args = args || {}\n this.CONSTRUCTOR_ID = 0x4c4e743f;\n this.SUBCLASS_OF_ID = 0xcf6419dc;\n\n this.offset = args.offset;\n this.length = args.length;\n }", "constructor(args) {\n super();\n args = args || {}\n this.CONSTRUCTOR_ID = 0x826f8b60;\n this.SUBCLASS_OF_ID = 0xcf6419dc;\n\n this.offset = args.offset;\n this.length = args.length;\n }", "constructor(args) {\n super();\n args = args || {}\n this.CONSTRUCTOR_ID = 0x64e475c2;\n this.SUBCLASS_OF_ID = 0xcf6419dc;\n\n this.offset = args.offset;\n this.length = args.length;\n }", "constructor(args) {\n super();\n args = args || {}\n this.CONSTRUCTOR_ID = 0x1b287353;\n this.SUBCLASS_OF_ID = 0x8680d126;\n\n this.values = args.values;\n this.credentials = args.credentials;\n }", "constructor(args) {\n super();\n args = args || {}\n this.CONSTRUCTOR_ID = 0x28a20571;\n this.SUBCLASS_OF_ID = 0xcf6419dc;\n\n this.offset = args.offset;\n this.length = args.length;\n }", "constructor(args) {\n super();\n args = args || {}\n this.CONSTRUCTOR_ID = 0x027477b4;\n this.SUBCLASS_OF_ID = 0x7c7b420a;\n\n this.types = args.types;\n }", "constructor(args) {\n super();\n args = args || {}\n this.CONSTRUCTOR_ID = 0xbd610bc9;\n this.SUBCLASS_OF_ID = 0xcf6419dc;\n\n this.offset = args.offset;\n this.length = args.length;\n }", "constructor(args) {\n super();\n args = args || {}\n this.CONSTRUCTOR_ID = 0xfa04579d;\n this.SUBCLASS_OF_ID = 0xcf6419dc;\n\n this.offset = args.offset;\n this.length = args.length;\n }", "constructor(args) {\n super();\n args = args || {}\n this.CONSTRUCTOR_ID = 0x020df5d0;\n this.SUBCLASS_OF_ID = 0xcf6419dc;\n\n this.offset = args.offset;\n this.length = args.length;\n }", "constructor(args) {\n super();\n args = args || {}\n this.CONSTRUCTOR_ID = 0x9a8ae1e1;\n this.SUBCLASS_OF_ID = 0x1aca5644;\n\n this.items = args.items;\n }", "constructor(args) {\n super();\n args = args || {}\n this.CONSTRUCTOR_ID = 0xbf0693d4;\n this.SUBCLASS_OF_ID = 0xcf6419dc;\n\n this.offset = args.offset;\n this.length = args.length;\n }", "constructor(args) {\n super();\n args = args || {}\n this.CONSTRUCTOR_ID = 0xd95c6154;\n this.SUBCLASS_OF_ID = 0x8680d126;\n\n this.types = args.types;\n }", "function construct(constructor, argList) {\r\n for (var argNames = '', i = argList.length; i--;) {\r\n argNames += (argNames ? ',a' : 'a') + i;\r\n }\r\n return Function(argNames, 'return new this(' + argNames + ')').apply(constructor, argList);\r\n }", "constructor(args) {\n super();\n args = args || {}\n this.CONSTRUCTOR_ID = 0xbb92ba95;\n this.SUBCLASS_OF_ID = 0xcf6419dc;\n\n this.offset = args.offset;\n this.length = args.length;\n }", "constructor(args) {\n super();\n args = args || {}\n this.CONSTRUCTOR_ID = 0x7e6260d7;\n this.SUBCLASS_OF_ID = 0xf1d0b479;\n\n this.texts = args.texts;\n }", "constructor(args) {\n super();\n args = args || {}\n this.CONSTRUCTOR_ID = 0x73924be0;\n this.SUBCLASS_OF_ID = 0xcf6419dc;\n\n this.offset = args.offset;\n this.length = args.length;\n this.language = args.language;\n }", "constructor(args) {\n super();\n args = args || {}\n this.CONSTRUCTOR_ID = 0xe725d44f;\n this.SUBCLASS_OF_ID = 0xf1163490;\n\n this.entries = args.entries;\n }", "constructor(args) {\n super();\n args = args || {}\n this.CONSTRUCTOR_ID = 0x7d861a08;\n this.SUBCLASS_OF_ID = 0x2024514;\n\n this.msgIds = args.msgIds;\n }", "constructor(args) {\n super();\n args = args || {}\n this.CONSTRUCTOR_ID = 0x8cc0d131;\n this.SUBCLASS_OF_ID = 0xfa8fcb54;\n\n this.msgIds = args.msgIds;\n this.info = args.info;\n }", "constructor(args) {\n super();\n args = args || {}\n this.CONSTRUCTOR_ID = 0x8317c0c3;\n this.SUBCLASS_OF_ID = 0x9f89304e;\n\n this.data = args.data;\n }", "constructor(...args) {\n this.length = 0;\n args.forEach(arg => {\n this.push(arg);\n })\n }", "constructor(args) {\n super();\n args = args || {}\n this.CONSTRUCTOR_ID = 0x0c7f49b7;\n this.SUBCLASS_OF_ID = 0xebb7f270;\n\n this.users = args.users;\n }", "constructor(args) {\n super();\n args = args || {}\n this.CONSTRUCTOR_ID = 0x62d6b459;\n this.SUBCLASS_OF_ID = 0x827677c4;\n\n this.msgIds = args.msgIds;\n }", "constructor(args) {\n super();\n args = args || {}\n this.CONSTRUCTOR_ID = 0x7d748d04;\n this.SUBCLASS_OF_ID = 0xad0352e8;\n\n this.data = args.data;\n }", "constructor(args) {\n super();\n args = args || {}\n this.CONSTRUCTOR_ID = 0x0e17e23c;\n this.SUBCLASS_OF_ID = 0x17cc29d9;\n\n this.type = args.type;\n }", "constructor(args) {\n super();\n args = args || {}\n this.CONSTRUCTOR_ID = 0xe4e88011;\n this.SUBCLASS_OF_ID = 0x1aca5644;\n\n this.items = args.items;\n }", "constructor(args) {\n super();\n args = args || {}\n this.CONSTRUCTOR_ID = 0x99c1d49d;\n this.SUBCLASS_OF_ID = 0xeb9987b3;\n\n this.value = args.value;\n }", "constructor(args) {\n super();\n args = args || {}\n this.CONSTRUCTOR_ID = 0x4d5bbe0c;\n this.SUBCLASS_OF_ID = 0xebb7f270;\n\n this.users = args.users;\n }", "constructor(args) {\n super();\n args = args || {}\n this.CONSTRUCTOR_ID = 0x2be0dfa4;\n this.SUBCLASS_OF_ID = 0xeb9987b3;\n\n this.value = args.value;\n }", "constructor(a, b, c) {\n super(a, b, c);\n }", "constructor(args) {\n super();\n args = args || {}\n this.CONSTRUCTOR_ID = 0xfb834291;\n this.SUBCLASS_OF_ID = 0x4aec930;\n\n this.category = args.category;\n this.count = args.count;\n this.peers = args.peers;\n }", "constructor(args) {\n super();\n args = args || {}\n this.CONSTRUCTOR_ID = 0x4218a164;\n this.SUBCLASS_OF_ID = 0xf1163490;\n\n this.data = args.data;\n }", "function construct(args) {\n args = args.map(deserialize);\n var constructor = args[0];\n\n // The following code solves the problem of invoking a JavaScript\n // constructor with an unknown number arguments.\n // First bind the constructor to the argument list using bind.apply().\n // The first argument to bind() is the binding of 'this', make it 'null'\n // After that, use the JavaScript 'new' operator which overrides any binding\n // of 'this' with the new instance.\n args[0] = null;\n var factoryFunction = constructor.bind.apply(constructor, args);\n return serialize(new factoryFunction());\n }", "constructor(args) {\n super();\n args = args || {}\n this.CONSTRUCTOR_ID = 0x488a7337;\n this.SUBCLASS_OF_ID = 0x8680d126;\n\n this.users = args.users;\n }", "constructor(args) {\n super();\n args = args || {}\n this.CONSTRUCTOR_ID = 0x68c13933;\n this.SUBCLASS_OF_ID = 0x9f89304e;\n\n this.messages = args.messages;\n this.pts = args.pts;\n this.ptsCount = args.ptsCount;\n }", "constructor(args) {\n super();\n args = args || {}\n this.CONSTRUCTOR_ID = 0xa20db0e5;\n this.SUBCLASS_OF_ID = 0x9f89304e;\n\n this.messages = args.messages;\n this.pts = args.pts;\n this.ptsCount = args.ptsCount;\n }", "constructor(args) {\n super();\n args = args || {}\n this.CONSTRUCTOR_ID = 0xaa2769ed;\n this.SUBCLASS_OF_ID = 0xad0352e8;\n\n this.customMethod = args.customMethod;\n this.params = args.params;\n }", "constructur() {}", "constructor(args) {\n super();\n args = args || {}\n this.CONSTRUCTOR_ID = 0xda69fb52;\n this.SUBCLASS_OF_ID = 0x18f01dd0;\n\n this.msgIds = args.msgIds;\n }", "constructor(args, opts) {\n // Calling the super constructor is important so our generator is correctly set up\n super(args, opts);\n }", "constructor(args) {\n super();\n args = args || {}\n this.CONSTRUCTOR_ID = 0x5cc761bd;\n this.SUBCLASS_OF_ID = 0xd279c672;\n\n this.langCode = args.langCode;\n this.fromVersion = args.fromVersion;\n this.version = args.version;\n this.keywords = args.keywords;\n }", "constructor(args) {\n super();\n args = args || {}\n this.CONSTRUCTOR_ID = 0x39a51dfb;\n this.SUBCLASS_OF_ID = 0x9f89304e;\n\n this.message = args.message;\n }", "constructor(args) {\n super();\n args = args || {}\n this.CONSTRUCTOR_ID = 0x131cc67f;\n this.SUBCLASS_OF_ID = 0x5a3b6b22;\n\n this.users = args.users;\n }", "constructor(args) {\n super();\n args = args || {}\n this.CONSTRUCTOR_ID = 0x90110467;\n this.SUBCLASS_OF_ID = 0x5a3b6b22;\n\n this.users = args.users;\n }", "constructor(args) {\n super();\n args = args || {}\n this.CONSTRUCTOR_ID = 0xc7345e6a;\n this.SUBCLASS_OF_ID = 0xeb9987b3;\n\n this.value = args.value;\n }", "constructor(args) {\n super();\n args = args || {}\n this.CONSTRUCTOR_ID = 0x16115a96;\n this.SUBCLASS_OF_ID = 0x1aca5644;\n\n this.title = args.title;\n this.articles = args.articles;\n }", "constructor(args) {\n super();\n args = args || {}\n this.CONSTRUCTOR_ID = 0x42e047bb;\n this.SUBCLASS_OF_ID = 0xb2b987f3;\n\n this.message = args.message;\n }", "constructor(args) {\n super();\n args = args || {}\n this.CONSTRUCTOR_ID = 0x76a6d327;\n this.SUBCLASS_OF_ID = 0xcf6419dc;\n\n this.offset = args.offset;\n this.length = args.length;\n this.url = args.url;\n }", "constructor(args) {\n super();\n args = args || {}\n this.CONSTRUCTOR_ID = 0xc37521c9;\n this.SUBCLASS_OF_ID = 0x9f89304e;\n\n this.channelId = args.channelId;\n this.messages = args.messages;\n this.pts = args.pts;\n this.ptsCount = args.ptsCount;\n }", "constructor(args) {\n super();\n args = args || {}\n this.CONSTRUCTOR_ID = 0x07761198;\n this.SUBCLASS_OF_ID = 0x9f89304e;\n\n this.participants = args.participants;\n }", "constructor(args) {\n super();\n args = args || {}\n this.CONSTRUCTOR_ID = 0x8f079643;\n this.SUBCLASS_OF_ID = 0xb2b987f3;\n\n this.message = args.message;\n }", "constructor(args) {\n super();\n args = args || {}\n this.CONSTRUCTOR_ID = 0x89893b45;\n this.SUBCLASS_OF_ID = 0x9f89304e;\n\n this.channelId = args.channelId;\n this.messages = args.messages;\n }", "constructor( args ) {\n\t\t\t\tsuper( args );\n\t\t\t}", "constructor(args) {\n super();\n args = args || {}\n this.CONSTRUCTOR_ID = 0x6c47ac9f;\n this.SUBCLASS_OF_ID = 0xdc179ab9;\n\n this.key = args.key;\n this.zeroValue = args.zeroValue || null;\n this.oneValue = args.oneValue || null;\n this.twoValue = args.twoValue || null;\n this.fewValue = args.fewValue || null;\n this.manyValue = args.manyValue || null;\n this.otherValue = args.otherValue;\n }", "constructor(args) {\n super();\n args = args || {}\n this.CONSTRUCTOR_ID = 0xfae69f56;\n this.SUBCLASS_OF_ID = 0x8680d126;\n\n this.message = args.message;\n }", "constructor(args) {\n super();\n args = args || {}\n this.CONSTRUCTOR_ID = 0x12bcbd9a;\n this.SUBCLASS_OF_ID = 0x9f89304e;\n\n this.message = args.message;\n this.qts = args.qts;\n }", "constructor(args) {\n super();\n args = args || {}\n this.CONSTRUCTOR_ID = 0xf7444763;\n this.SUBCLASS_OF_ID = 0xeb9987b3;\n\n this.value = args.value;\n }", "constructor(args) {\n super();\n args = args || {}\n this.CONSTRUCTOR_ID = 0x5a686d7c;\n this.SUBCLASS_OF_ID = 0x4561736;\n\n this.chat = args.chat;\n }", "constructor(args) {\n super();\n args = args || {}\n this.CONSTRUCTOR_ID = 0xb71e767a;\n this.SUBCLASS_OF_ID = 0xeb9987b3;\n\n this.value = args.value;\n }", "constructor(args) {\n super();\n args = args || {}\n this.CONSTRUCTOR_ID = 0xb4a2e88d;\n this.SUBCLASS_OF_ID = 0x9f89304e;\n\n this.chat = args.chat;\n this.date = args.date;\n }", "constructor(args) {\n super();\n args = args || {}\n this.CONSTRUCTOR_ID = 0xa03e5b85;\n this.SUBCLASS_OF_ID = 0xe2e10ef2;\n\n this.selective = args.selective || null;\n }", "constructor(args) {\n super();\n args = args || {}\n this.CONSTRUCTOR_ID = 0xa3b54985;\n this.SUBCLASS_OF_ID = 0xbf4e2753;\n\n this.q = args.q;\n }", "constructor(args) {\n super();\n args = args || {}\n this.CONSTRUCTOR_ID = 0x5e068047;\n this.SUBCLASS_OF_ID = 0xeeda0eb8;\n\n this.num = args.num;\n this.text = args.text;\n }", "constructor(args) {\n super();\n args = args || {}\n this.CONSTRUCTOR_ID = 0xe9e82c18;\n this.SUBCLASS_OF_ID = 0xb2b987f3;\n\n this.message = args.message;\n }", "constructor(args) {\n super();\n args = args || {}\n this.CONSTRUCTOR_ID = 0x1b0c841a;\n this.SUBCLASS_OF_ID = 0x33d47f45;\n\n this.date = args.date || null;\n }", "constructor(args) {\n super();\n args = args || {}\n this.CONSTRUCTOR_ID = 0x1f2b0afd;\n this.SUBCLASS_OF_ID = 0x9f89304e;\n\n this.message = args.message;\n this.pts = args.pts;\n this.ptsCount = args.ptsCount;\n }", "constructor(args) {\n super();\n args = args || {}\n this.CONSTRUCTOR_ID = 0x861cc8a0;\n this.SUBCLASS_OF_ID = 0x3da389aa;\n\n this.shortName = args.shortName;\n }", "constructor(args) {\n super();\n args = args || {}\n this.CONSTRUCTOR_ID = 0x1427a5e1;\n this.SUBCLASS_OF_ID = 0xbf4e2753;\n\n this.q = args.q;\n }", "constructor(args) {\n super();\n args = args || {}\n this.CONSTRUCTOR_ID = 0x1b3f4df7;\n this.SUBCLASS_OF_ID = 0x9f89304e;\n\n this.message = args.message;\n this.pts = args.pts;\n this.ptsCount = args.ptsCount;\n }", "constructor(args) {\n super();\n args = args || {}\n this.CONSTRUCTOR_ID = 0xcd77d957;\n this.SUBCLASS_OF_ID = 0x13336a56;\n\n this.excludeNewMessages = args.excludeNewMessages || null;\n this.ranges = args.ranges;\n }", "function construct(constructor, args) {\n var c = function () {\n return constructor.apply(this, args);\n };\n c.prototype = constructor.prototype;\n var instance = new c();\n instance._serviceUrl = serviceUrl;\n return instance;\n }", "constructor(...args) {\n super(() => null, ...args);\n }", "constructor(args) {\n super();\n args = args || {}\n this.CONSTRUCTOR_ID = 0x62ba04d9;\n this.SUBCLASS_OF_ID = 0x9f89304e;\n\n this.message = args.message;\n this.pts = args.pts;\n this.ptsCount = args.ptsCount;\n }", "constructor(args) {\n super();\n args = args || {}\n this.CONSTRUCTOR_ID = 0x3407e51b;\n this.SUBCLASS_OF_ID = 0x7f86e4e5;\n\n this.set = args.set;\n this.covers = args.covers;\n }", "constructor(args) {\n super();\n args = args || {}\n this.CONSTRUCTOR_ID = 0xbaafe5e0;\n this.SUBCLASS_OF_ID = 0x1aca5644;\n\n this.author = args.author;\n this.publishedDate = args.publishedDate;\n }", "constructor(args) {\n super();\n args = args || {}\n this.CONSTRUCTOR_ID = 0xa6638b9a;\n this.SUBCLASS_OF_ID = 0x8680d126;\n\n this.title = args.title;\n this.users = args.users;\n }", "constructor(args) {\n super();\n args = args || {}\n this.CONSTRUCTOR_ID = 0x0656ac4b;\n this.SUBCLASS_OF_ID = 0xbf4e2753;\n\n this.q = args.q;\n }", "function C(arg) {\n this.args = arguments;\n}", "constructor(args) {\n super();\n args = args || {}\n this.CONSTRUCTOR_ID = 0xf385c1f6;\n this.SUBCLASS_OF_ID = 0x52662d55;\n\n this.langCode = args.langCode;\n this.fromVersion = args.fromVersion;\n this.version = args.version;\n this.strings = args.strings;\n }", "constructor(args) {\n super();\n args = args || {}\n this.CONSTRUCTOR_ID = 0x199f3a6c;\n this.SUBCLASS_OF_ID = 0x8af52aac;\n\n this.channel = args.channel;\n this.users = args.users;\n }", "constructor(args) {\n super();\n args = args || {}\n this.CONSTRUCTOR_ID = 0x65a0fa4d;\n this.SUBCLASS_OF_ID = 0x1aca5644;\n\n this.items = args.items;\n this.caption = args.caption;\n }", "constructor(args) {\n super();\n args = args || {}\n this.CONSTRUCTOR_ID = 0xce0d37b0;\n this.SUBCLASS_OF_ID = 0x1aca5644;\n\n this.name = args.name;\n }", "function construct(constructor, args) {\n var c = function () {\n return constructor.apply(this, args);\n };\n c.prototype = constructor.prototype;\n return new c();\n }", "function construct(constructor, args) {\n var c = function () {\n return constructor.apply(this, args);\n };\n c.prototype = constructor.prototype;\n return new c();\n }", "constructor(args) {\n super();\n args = args || {}\n this.CONSTRUCTOR_ID = 0x74ae4240;\n this.SUBCLASS_OF_ID = 0x8af52aac;\n\n this.updates = args.updates;\n this.users = args.users;\n this.chats = args.chats;\n this.date = args.date;\n this.seq = args.seq;\n }", "constructor(args) {\n super();\n args = args || {}\n this.CONSTRUCTOR_ID = 0xa9f55f95;\n this.SUBCLASS_OF_ID = 0x41701377;\n\n this.pq = args.pq;\n this.p = args.p;\n this.q = args.q;\n this.nonce = args.nonce;\n this.serverNonce = args.serverNonce;\n this.newNonce = args.newNonce;\n this.dc = args.dc;\n }", "constructor(args) {\n super();\n args = args || {}\n this.CONSTRUCTOR_ID = 0x3c20629f;\n this.SUBCLASS_OF_ID = 0x82b1f73b;\n\n this.text = args.text;\n this.startParam = args.startParam;\n }", "constructor(args) {\n super();\n args = args || {}\n this.CONSTRUCTOR_ID = 0x3f460fed;\n this.SUBCLASS_OF_ID = 0x1fa89571;\n\n this.chatId = args.chatId;\n this.participants = args.participants;\n this.version = args.version;\n }" ]
[ "0.7136816", "0.6953033", "0.692598", "0.69021624", "0.69021624", "0.6878798", "0.6776414", "0.67102474", "0.6695473", "0.66910213", "0.6659877", "0.66535336", "0.6645595", "0.6640925", "0.6639501", "0.6638436", "0.66289335", "0.66243696", "0.66028565", "0.6594345", "0.65897083", "0.65757793", "0.6574542", "0.6567509", "0.65446997", "0.65349704", "0.6522741", "0.6518138", "0.64826894", "0.6474758", "0.64609015", "0.64560854", "0.6455335", "0.6454957", "0.64404494", "0.643794", "0.6436363", "0.6432503", "0.64323056", "0.6428695", "0.6420654", "0.6395082", "0.6394401", "0.6390547", "0.63866043", "0.638415", "0.63733834", "0.6370659", "0.6361882", "0.6338729", "0.6338513", "0.6334322", "0.6329979", "0.6326354", "0.6322696", "0.6321648", "0.63153595", "0.6311467", "0.6302679", "0.6301837", "0.6296556", "0.62944484", "0.62922657", "0.6291221", "0.6282507", "0.628007", "0.6279444", "0.6269089", "0.6268717", "0.62611276", "0.6252716", "0.62450397", "0.62447774", "0.6240598", "0.6236494", "0.62297755", "0.6227919", "0.6226262", "0.6223029", "0.6221429", "0.62173223", "0.6216982", "0.6215695", "0.6214495", "0.62135065", "0.62123394", "0.62111485", "0.6209792", "0.6199318", "0.6197479", "0.6191101", "0.61910665", "0.6189197", "0.6185471", "0.6184935", "0.6184302", "0.6183047", "0.6179478", "0.61776936", "0.61776626", "0.61774987" ]
0.0
-1
Get all keys in `value`.
function keys(value) { var result = []; var key; for (key in value) { result.push(key); } return result; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function keys(value) {\n var result = []\n var key\n\n for (key in value) {\n result.push(key)\n }\n\n return result\n}", "function keys(value) {\n var key\n for (key in value) {\n return true\n }\n return false\n}", "function keys(value) {\n var key\n for (key in value) {\n return true\n }\n return false\n}", "function keys(value) {\n var key\n for (key in value) {\n return true\n }\n return false\n}", "function keys(value) {\n var key\n for (key in value) {\n return true\n }\n return false\n}", "function keys(value) {\n var key\n for (key in value) {\n return true\n }\n return false\n}", "function keys(value) {\n var key;\n for (key in value) {\n return true;\n }\n return false;\n}", "function keys(value) {\n var key\n for (key in value) {\n return true\n }\n\n return false\n}", "function keys(value) {\n var key\n for (key in value) {\n return true\n }\n\n return false\n}", "function keys(value) {\n var key\n for (key in value) {\n return true\n }\n\n return false\n}", "function keys(value) {\n var key;\n for (key in value) {\n return true\n }\n\n return false\n}", "get keys() {}", "keys()\n\t{\n\t\tvar it = super.keys();\n\t\tvar res = new Runtime.Collection();\n\t\tvar next = it.next();\n\t\twhile (!next.done)\n\t\t{\n\t\t\tres.push( next.value );\n\t\t\tnext = it.next();\n\t\t}\n\t\treturn res;\n\t}", "function getFlagKeysFromString(value) {\n if (!value) return [];\n\n let result = value.split(key_value_delimiter);\n result = trimArray(result);\n\n return result;\n}", "keys() {\n const result = [];\n for (let i = 0; i < this.map.length; i += 1) {\n if (this.map[i] !== undefined) {\n for (let j = 0; j < this.map[i].length; j += 1) {\n const key = this.map[i][j][0];\n result.push(key);\n }\n }\n }\n\n return result;\n }", "keys() {\n return this.values();\n }", "values() {\n return Object.keys(this.dictionary);\n }", "values() {\n return Object.keys(this.dictionary);\n }", "allKeys() {\n return this.k2s.keys();\n }", "get keys() {\n return Object.keys(this._keyMap);\n }", "keys() {\n let result = []\n for (let i = 0; i<this.keyMap.length; i++) {\n if (!!this.keyMap[i]) {\n if (this.keyMap[i].length>0) {\n for (let j=0; j<this.keyMap[i].length; j++) {\n result.push(this.keyMap[i][j][0])\n }\n }\n }\n }\n return result\n }", "function keys(object) {\n var output = [];\n for (var key in object) {\n if (hasKey(object, key)) {\n output.push(key);\n }\n }\n return output;\n}", "*keys() {\n for (const i of this.#indexes()) {\n const k = this.#keyList[i];\n if (k !== undefined &&\n !this.#isBackgroundFetch(this.#valList[i])) {\n yield k;\n }\n }\n }", "values(){\n return Object.keys(this.items);\n\n /*\n var result;\n for (var key in this.items){\n if (this.items.hasOwnProperty(key)){\n result.push(key);\n }\n }\n return result;\n */\n }", "getKeys() {\n this._ensureUnpacked();\n if (this.unpackedArray) {\n return Array.from(this.unpackedArray.keys());\n } else if (this.unpackedAssocArray) {\n this._ensureAssocKeys();\n return Array.from(this.unpackedAssocKeys);\n }\n return [];\n }", "keys() {\n const ret = [];\n for (let i = 0; i < this.hashTable.length; ++i)\n for (let slot = this.hashTable[i]; slot; slot = slot.next)\n if (!slot.deleted)\n ret.push(slot.key);\n return ret;\n }", "async keys () {\n const results = await this.client.zRange(this.ZSET_KEY, 0, -1);\n return results.map(key => key.slice(`${this.namespace}`.length));\n }", "getKeys() {\n this.logger.trace(\"Retrieving all cache keys\");\n // read cache\n const cache = this.getCache();\n return [...Object.keys(cache)];\n }", "keys() {\n this.init();\n return Array.from(this.map.keys());\n }", "function ofAssoc(value) {\n return new mona_dish_2.Es2019Array(...Object.keys(value))\n .map(key => [key, value[key]]);\n }", "keys()\n {\n // Local variable dictionary\n let keys = new LinkedList();\n\n // Get the keys\n for (let counter = 0; counter < this.#table.getLength(); counter++)\n {\n // Get the index linked list\n let listIndex = this.#table.peekIndex(counter);\n\n // Get the keys in the list index\n for (let count = 0; count < listIndex.getLength(); count++)\n {\n // Get the key and value pair\n let hashEntry = listIndex.peekIndex(count);\n keys.append(hashEntry.key.key);\n }\n }\n\n // Return the keys\n return keys;\n }", "function keys() {\n return this.pluck('key');\n }", "keys() {\n this.init();\n return Array.from(this.map.keys());\n }", "keys() {\n this.init();\n return Array.from(this.map.keys());\n }", "keys() {\n this.init();\n return Array.from(this.map.keys());\n }", "keys() {\n this.init();\n return Array.from(this.map.keys());\n }", "keys() {\n this.init();\n return Array.from(this.map.keys());\n }", "getKeys() {\n errors.throwNotImplemented(\"returning the keys of a collection\");\n }", "function BOT_extractKeyNamesFromTagValue(topicid,tag,value) {\r\n\tvar t = eval(topicid);\r\n\tvar lres = [];\r\n\tvar ta,res;\r\n\tfor(var i in t) {\r\n\t\tta = t[i];\r\n\t\tfor(var j in ta) {\r\n\t\t\ttagval = ta[j];\r\n\t\t\tif(tagval[0] == tag && tagval[1] == value) { \r\n\t\t\t\tres = BOT_getTopicAttributeTagValue(ta,\"KEY\");\r\n\t\t\t\tif(res) lres = lres.concat(res);\r\n\t\t\t\tbreak;\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\treturn lres\r\n}", "keys() {\n return this.hashMap.keys();\n }", "keys() {\n let keysArr = [];\n for (let i = 0; i < this.keyMap.length; i++) {\n if (this.keyMap[i]) {\n for (let j = 0; j < this.keyMap[i].length; i++) {\n if (!keysArr.includes(this.keyMap[i][j][1])) {\n keysArr.push(this.keyMap[i][j][1]);\n }\n }\n }\n }\n return keysArr;\n }", "* keys() {\n\t\tfor (const [key] of this) {\n\t\t\tyield key;\n\t\t}\n\t}", "keys() {\n\t\treturn createHeadersIterator$1(this, 'key');\n\t}", "keys() {\n const keysArray = [];\n for (let i = 0; i < this.data.length; i++) {\n if (this.data[i]) {\n keysArray.push(this.data[i][0][0]);\n }\n }\n return keysArray;\n }", "keys() {\n\t\treturn createHeadersIterator(this, 'key');\n\t}", "keys() {\n\t\treturn createHeadersIterator(this, 'key');\n\t}", "keys() {\n\t\treturn createHeadersIterator(this, 'key');\n\t}", "keys() {\n\t\treturn createHeadersIterator(this, 'key');\n\t}", "keys() {\n\t\treturn createHeadersIterator(this, 'key');\n\t}", "keys() {\n\t\treturn createHeadersIterator(this, 'key');\n\t}", "keys() {\n\t\treturn createHeadersIterator(this, 'key');\n\t}", "keys() {\n\t\treturn createHeadersIterator(this, 'key');\n\t}", "keys() {\n\t\treturn createHeadersIterator(this, 'key');\n\t}", "keys() {\n\t\treturn createHeadersIterator(this, 'key');\n\t}", "keys() {\n\t\treturn createHeadersIterator(this, 'key');\n\t}", "keys() {\n\t\treturn createHeadersIterator(this, 'key');\n\t}", "keys() {\n\t\treturn createHeadersIterator(this, 'key');\n\t}", "keys() {\n\t\treturn createHeadersIterator(this, 'key');\n\t}", "keys() {\n\t\treturn createHeadersIterator(this, 'key');\n\t}", "keys() {\n\t\treturn createHeadersIterator(this, 'key');\n\t}", "keys() {\n\t\treturn createHeadersIterator(this, 'key');\n\t}", "keys() {\n\t\treturn createHeadersIterator(this, 'key');\n\t}", "keys() {\n\t\treturn createHeadersIterator(this, 'key');\n\t}", "keys() {\n\t\treturn createHeadersIterator(this, 'key');\n\t}", "keys() {\n\t\treturn createHeadersIterator(this, 'key');\n\t}", "keys() {\n\t\treturn createHeadersIterator(this, 'key');\n\t}", "keys() {\n\t\treturn createHeadersIterator(this, 'key');\n\t}", "keys() {\n\t\treturn createHeadersIterator(this, 'key');\n\t}", "keys() {\n\t\treturn createHeadersIterator(this, 'key');\n\t}", "keys() {\n\t\treturn createHeadersIterator(this, 'key');\n\t}", "keys() {\n\t\treturn createHeadersIterator(this, 'key');\n\t}", "keys() {\n\t\treturn createHeadersIterator(this, 'key');\n\t}", "keys() {\n\t\treturn createHeadersIterator(this, 'key');\n\t}", "keys() {\n\t\treturn createHeadersIterator(this, 'key');\n\t}", "keys() {\n\t\treturn createHeadersIterator(this, 'key');\n\t}", "function ks(vals) {\n var result = []\n vals.forEach(function(val, i) { result.push('key_' + (i+1)) })\n return result\n}", "function getKeys(obj, val) {\n var objects = [];\n for (var i in obj) {\n if (!obj.hasOwnProperty(i)) continue;\n if (typeof obj[i] == 'object') {\n objects = objects.concat(getKeys(obj[i], val));\n } else if (obj[i] == val) {\n objects.push(i);\n }\n }\n return objects;\n}", "function getKeys(obj, val) {\n var objects = [];\n for (var i in obj) {\n if (!obj.hasOwnProperty(i)) continue;\n if (typeof obj[i] == 'object') {\n objects = objects.concat(getKeys(obj[i], val));\n } else if (obj[i] == val) {\n objects.push(i);\n }\n }\n return objects;\n}", "function getKeys(obj, val) {\n var objects = [];\n for (var i in obj) {\n if (!obj.hasOwnProperty(i)) continue;\n if (typeof obj[i] == 'object') {\n objects = objects.concat(getKeys(obj[i], val));\n } else if (obj[i] == val) {\n objects.push(i);\n }\n }\n return objects;\n}", "function getKeys(obj, val) {\n var objects = [];\n for (var i in obj) {\n if (!obj.hasOwnProperty(i)) continue;\n if (typeof obj[i] == 'object') {\n objects = objects.concat(getKeys(obj[i], val));\n } else if (obj[i] == val) {\n objects.push(i);\n }\n }\n return objects;\n}", "getKeysByPrefix(prefix) {\n const keys = []\n\n store.each((value, key) => {\n if (key && key.indexOf(prefix) === 0) {\n keys.push(key)\n }\n })\n\n return keys\n }", "keys() {\n let keysArray = [];\n for (let i = 0; i < this.keyMap.length; i++) {\n if (this.keyMap[i]) {\n for (let j = 0; j < this.keyMap[i].length; j++) {\n if (!keysArray.includes(this.keyMap[i][j][0])) {\n keysArray.push(this.keyMap[i][j][0]);\n }\n }\n }\n }\n return keysArray;\n }", "values() {\n\t\treturn createHeadersIterator$1(this, 'value');\n\t}", "keys() {\n\t\tif (!this.data.length) {\n\t\t\treturn undefined;\n\t\t}\n\t\tconst keysArray = [];\n\t\tfor (let i = 0; i < this.data.length; i++) {\n\t\t\t// if data at index i exists push it to the array\n\t\t\tif (this.data[i]) {\n\t\t\t\t// when data at i lengh is greater than 1, then probably here hash collision had happened\n\t\t\t\t// need to loop over this array to get all the values\n\t\t\t\tif (this.data[i].length > 1) {\n\t\t\t\t\tfor (let j = 0; j < this.data[i].length; j++) {\n\t\t\t\t\t\tkeysArray.push(this.data[i][j][0]);\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\t// else, just push first value in that array\n\t\t\t\t\tkeysArray.push(this.data[i][0][0]);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn keysArray;\n\t}", "values() {\n let valuesArr = [];\n for (let i = 0; i < this.keyMap.length; i++) {\n if (this.keyMap[i]) {\n for (let j = 0; j < this.keyMap[i].length; i++) {\n if (!valuesArr.includes(this.keyMap[i][j][1])) {\n valuesArr.push(this.keyMap[i][j][1]);\n }\n }\n }\n }\n return valuesArr;\n }", "function getHalfCheckedKeys(valueList, valueEntities) {\n var values = {}; // Fill checked keys\n\n valueList.forEach(function (_ref6) {\n var value = _ref6.value;\n values[value] = false;\n }); // Fill half checked keys\n\n valueList.forEach(function (_ref7) {\n var value = _ref7.value;\n var current = valueEntities[value];\n\n while (current && current.parent) {\n var parentValue = current.parent.value;\n if (parentValue in values) break;\n values[parentValue] = true;\n current = current.parent;\n }\n }); // Get half keys\n\n return Object.keys(values).filter(function (value) {\n return values[value];\n }).map(function (value) {\n return valueEntities[value].key;\n });\n}", "function getHalfCheckedKeys(valueList, valueEntities) {\n var values = {}; // Fill checked keys\n\n valueList.forEach(function (_ref6) {\n var value = _ref6.value;\n values[value] = false;\n }); // Fill half checked keys\n\n valueList.forEach(function (_ref7) {\n var value = _ref7.value;\n var current = valueEntities[value];\n\n while (current && current.parent) {\n var parentValue = current.parent.value;\n if (parentValue in values) break;\n values[parentValue] = true;\n current = current.parent;\n }\n }); // Get half keys\n\n return Object.keys(values).filter(function (value) {\n return values[value];\n }).map(function (value) {\n return valueEntities[value].key;\n });\n}", "function getHalfCheckedKeys(valueList, valueEntities) {\n var values = {}; // Fill checked keys\n\n valueList.forEach(function (_ref6) {\n var value = _ref6.value;\n values[value] = false;\n }); // Fill half checked keys\n\n valueList.forEach(function (_ref7) {\n var value = _ref7.value;\n var current = valueEntities[value];\n\n while (current && current.parent) {\n var parentValue = current.parent.value;\n if (parentValue in values) break;\n values[parentValue] = true;\n current = current.parent;\n }\n }); // Get half keys\n\n return Object.keys(values).filter(function (value) {\n return values[value];\n }).map(function (value) {\n return valueEntities[value].key;\n });\n}", "function getHalfCheckedKeys(valueList, valueEntities) {\n var values = {}; // Fill checked keys\n\n valueList.forEach(function (_ref6) {\n var value = _ref6.value;\n values[value] = false;\n }); // Fill half checked keys\n\n valueList.forEach(function (_ref7) {\n var value = _ref7.value;\n var current = valueEntities[value];\n\n while (current && current.parent) {\n var parentValue = current.parent.value;\n if (parentValue in values) break;\n values[parentValue] = true;\n current = current.parent;\n }\n }); // Get half keys\n\n return Object.keys(values).filter(function (value) {\n return values[value];\n }).map(function (value) {\n return valueEntities[value].key;\n });\n}", "keys() {\n const keyArr = [];\n for (let i = 0; i < this.data.length; i++) {\n if (this.data[i]) {\n for (let j = 0; j < this.data[i].length; j++) {\n keyArr.push(this.data[i][j][0]);\n }\n }\n }\n return keyArr;\n }", "function getKeys(object) {\n var keys = [];\n for (var key in object) {\n if (object.hasOwnProperty(key)) {\n keys.push(key);\n }\n }\n return keys;\n }", "function keys(o){\n var tmp = new Array();\n for (k in o) tmp.push(k);\n return tmp;\n}", "keys () {\n\t\treturn this.cache.keys();\n\t}", "set keys(value) {}" ]
[ "0.836424", "0.6576043", "0.6576043", "0.6576043", "0.6576043", "0.6576043", "0.6545341", "0.65157515", "0.65157515", "0.65157515", "0.64387435", "0.6329179", "0.62270236", "0.61529833", "0.6023055", "0.59515864", "0.57830095", "0.57830095", "0.5691123", "0.56526494", "0.5624918", "0.56018466", "0.5557215", "0.55538845", "0.55465657", "0.5544968", "0.55421", "0.5527222", "0.55197996", "0.5518794", "0.55041987", "0.55000037", "0.5492287", "0.5492287", "0.5492287", "0.5492287", "0.5492287", "0.54920375", "0.54837936", "0.54829514", "0.54758215", "0.5458031", "0.5450577", "0.54494894", "0.543647", "0.543647", "0.543647", "0.543647", "0.543647", "0.543647", "0.543647", "0.543647", "0.543647", "0.543647", "0.543647", "0.543647", "0.543647", "0.543647", "0.543647", "0.543647", "0.543647", "0.543647", "0.543647", "0.543647", "0.543647", "0.543647", "0.543647", "0.543647", "0.543647", "0.543647", "0.543647", "0.543647", "0.543647", "0.543647", "0.543647", "0.5432393", "0.5420654", "0.5420654", "0.5420654", "0.5420654", "0.54052824", "0.53982043", "0.5377436", "0.5368169", "0.53438383", "0.534195", "0.534195", "0.534195", "0.534195", "0.53323936", "0.5308641", "0.5300134", "0.52741456", "0.52692837" ]
0.8278659
7
Construct a state `toggler`: a function which inverses `property` in context based on its current value. The by `toggler` returned function restores that value.
function factory(key, state, ctx) { return enter function enter() { var context = ctx || this var current = context[key] context[key] = !state return exit function exit() { context[key] = current } } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function toggleable_factory(prop = 'value', event = 'input') {\n return external_commonjs_vue_commonjs2_vue_root_Vue_default.a.extend({\n name: 'toggleable',\n model: {\n prop,\n event\n },\n props: {\n [prop]: {\n required: false\n }\n },\n\n data() {\n return {\n isActive: !!this[prop]\n };\n },\n\n watch: {\n [prop](val) {\n this.isActive = !!val;\n },\n\n isActive(val) {\n !!val !== this[prop] && this.$emit(event, val);\n }\n\n }\n });\n}", "function toggleable_factory(prop = 'value', event = 'input') {\n return external_commonjs_vue_commonjs2_vue_root_Vue_default.a.extend({\n name: 'toggleable',\n model: {\n prop,\n event\n },\n props: {\n [prop]: {\n required: false\n }\n },\n\n data() {\n return {\n isActive: !!this[prop]\n };\n },\n\n watch: {\n [prop](val) {\n this.isActive = !!val;\n },\n\n isActive(val) {\n !!val !== this[prop] && this.$emit(event, val);\n }\n\n }\n });\n}", "function toggleable_factory(prop = 'value', event = 'input') {\n return external_commonjs_vue_commonjs2_vue_root_Vue_default.a.extend({\n name: 'toggleable',\n model: {\n prop,\n event\n },\n props: {\n [prop]: {\n required: false\n }\n },\n\n data() {\n return {\n isActive: !!this[prop]\n };\n },\n\n watch: {\n [prop](val) {\n this.isActive = !!val;\n },\n\n isActive(val) {\n !!val !== this[prop] && this.$emit(event, val);\n }\n\n }\n });\n}", "function toggleable_factory(prop = 'value', event = 'input') {\n return external_Vue_default.a.extend({\n name: 'toggleable',\n model: {\n prop,\n event\n },\n props: {\n [prop]: {\n required: false\n }\n },\n\n data() {\n return {\n isActive: !!this[prop]\n };\n },\n\n watch: {\n [prop](val) {\n this.isActive = !!val;\n },\n\n isActive(val) {\n !!val !== this[prop] && this.$emit(event, val);\n }\n\n }\n });\n}", "value(state, action, target) { throw 'Not implemented' }", "function generate_toggle(propertyname,on,off){\n return function(){\n var textarea=$(this).parent().parent().parent().children(\".text\");\n var flag=textarea.css(propertyname);\n if(flag==on){\n textarea.css(propertyname,off);\n }\n else{\n textarea.css(propertyname,on);\n }\n }\n}", "valuator(trigger, options, callback) {\n const env = { inject: this.get_('eval.env') };\n const valuator = new Valuator(Object.assign({ trigger, env }, options));\n const flyout = this.flyout(trigger, valuator, { context: 'quick', type: 'Manual' });\n valuator.destroyWith(flyout);\n valuator.on('destroying', () => { this.placehold(trigger); });\n\n valuator.get('result').react(false, (result) => { // no point in reactTo\n callback(result);\n valuator.destroy();\n });\n return valuator;\n }", "trigger(event) {\r\n\r\n var temp = this.config.states[this.state].transitions[event];\r\n this.changeState(temp);\r\n }", "trigger(event) {\r\n if (!this.config.states[this.state].transitions.hasOwnProperty(event)) {\r\n throw new Error();\r\n }\r\n\r\n switch (event) {\r\n\r\n case 'study' :\r\n this.changeState('busy');\r\n this.prev = (this.prev) ? 'normal' : false;\r\n this.next.pop();\r\n this.possibleRedoCount++;\r\n break;\r\n\r\n case 'get_tired' :\r\n this.changeState('sleeping');\r\n this.prev = 'busy';\r\n this.next.pop();\r\n this.possibleRedoCount++;\r\n break;\r\n\r\n case 'get_hungry' :\r\n this.changeState('hungry');\r\n this.prev = (this.prev == 'busy') ? 'busy' : 'sleeping';\r\n this.next.pop();\r\n this.possibleRedoCount++;\r\n break;\r\n\r\n case 'eat' :\r\n case 'get up' :\r\n this.changeState('normal');\r\n this.next.pop();\r\n this.possibleRedoCount++;\r\n break;\r\n }\r\n }", "function accessor(property) {\n\t\tvar fn = function() {\n\t\t\treturn this[arguments.length ? \"set\" : \"get\"](property, arguments[0]);\n\t\t};\n\n\t\t// Set a flag to later prevent set() to call fn() indefinitely\n\t\tfn.accessor = true;\n\t\treturn fn;\n\t}", "set property(){}", "set actuatorState(value) { this._actuatorState = value; }", "function onPropertyChange(e, property) {\n\t\tif (!isEditMode) return e.preventDefault();\n\t\treturn onChange(e, 'properties', { [property]: !properties[property] });\n\t}", "of(value) { return new StateEffect(this, value); }", "function toggleValue(event) {\n const toggle = event.target\n const current_wrapper = toggle.closest(Selectors._toggle)\n const value_element = current_wrapper.querySelector(Selectors._value)\n\n _assignValue(toggle, value_element)\n }", "@action\n setProp(property, newVal) {\n this.set(property, newVal);\n }", "function changeProperty() {\n var thisControl = event.target.id;\t\t\t\t// what did you click on?\n var thisLight = event.target.parentNode.id;\t// get the parent (light number)\n var value = event.target.value;\t\t\t\t\t// get the value\n\n // make a new payload:\n var payload = {};\n // put the value for the given control into the payload:\n payload[thisControl] = Number(value); // convert strings to numbers\n\n // the 'on' control is a special case, it's true/false\n // because it's a checkbox:\n if (thisControl === 'on') {\n payload[thisControl] = event.target.checked;\n }\n\n setLight(thisLight, payload, 'state');\t// make the HTTP call\n}", "doAction (value) {\n if (!this._params.simulate) {\n this._actuator.write(value.state === true ? 1 : 0, () => {\n this.addValue(value.state)\n })\n } else {\n this.addValue(value.state)\n }\n\n value.status = 'completed'\n\n console.info('Changed value of %s to %s', this._model.name, value.state)\n }", "set state(value) {\n defineProperty(this, '_state$', {configurable: true, value: value});\n }", "function ArrowViewStateTransition() {}", "get _eventTargetProperty() {\n return 'checked';\n }", "trigger(event) { \r\n if (this.config.states[this.config.initial].transitions[event] == undefined) {\r\n throw new Error(\"Event: fail check\");\r\n }\r\n this.config.initial = this.config.states[this.config.initial].transitions[event]\r\n this.undoArr.push(this.config.initial)\r\n this.hack++\r\n return this.config.initial\r\n }", "_generateHandler(propertyName) {\n return function(event) {\n this.setState({\n [propertyName]: event.target.value\n })\n }.bind(this)\n }", "function reactive(target) {\n const handler = {\n // receiver => ensures the proper value of this is used when our object has\n // inherited values or functions from another object\n get(target, key, receiver) {\n let result = Reflect.get(target, key, receiver)\n track(target, key)\n return result\n },\n set(target, key, value, receiver) {\n let oldValue = target[key]\n let result = Reflect.set(target, key, value, receiver)\n if (result && oldValue != value) {\n trigger(target, key)\n }\n return result\n },\n }\n return new Proxy(target, handler)\n}", "trigger(event) {\r\n if(this.config.states[this.currentState].transitions[event] === undefined){\r\n throw new Error('Event is undefined by config. So, Fuck Off!');\r\n }\r\n this.prevState = this.currentState;\r\n this.currentState = this.config.states[this.currentState].transitions[event];\r\n }", "toggler() {\n const visibility = this.state.visibility;\n const expanded = this.state.expanded;\n if (visibility === \"hidden\" && !expanded) {\n this.setState({\n visibility: \"visible\",\n expanded: true\n })\n } else {\n this.setState({\n visibility: \"hidden\",\n expanded: false\n })\n }\n\n }", "handleChange(prop, e) {\n var newState = {};\n newState[prop] = e.target.value;\n this.setState(newState);\n }", "function makeProperty( obj, name, predicate ) {\r\n\tvar value; // this is the property value, current goal in this application.\r\n\t\r\n\tobj[\"get\" + name] = function() {\r\n\t\treturn value; \r\n\t};\r\n\t\r\n\tobj[\"set\" + name] = function(v) {\r\n\t\tif ( predicate && !predicate(v))\r\n\t\t\tthrow \"set\" + name + \": invalid value \" + v;\r\n\t\telse\t\r\n\t\t\tvalue = v;\r\n\t};\r\n\t\t\r\n}", "function wrapAround(target, property) \n{\n\t\n\tvar fn = target[property];\n\t\t\n\tif(property.indexOf('->') == -1) return { property: property, value: fn };\n\n\tvar mw = property.split(/\\s*->\\s*/g),\n\taccessorParts = mw[0].split(' ');\n\n\tmw[0] = accessorParts.pop();\n\taccessorParts.push(mw[mw.length - 1]);\n\n\tmw.pop();\n\n\n\treturn { property: accessorParts.join(' '), value: getStepper(target, mw, fn) };\n}", "toggleInput(event) {\n this.openValue = event.target.checked\n this.animate()\n }", "trigger(event) {\r\n var states = this.config.states,\r\n prop = this.currentState,\r\n state = states[prop];\r\n if (event in state.transitions) {\r\n this.currentState = state.transitions[event];\r\n this.history.push(this.currentState);\r\n this.cancelled = [];\r\n }\r\n else throw new Error(\"State doesn't exist\");\r\n \r\n }", "function logProperty(value) {\n console.log(`${value} evaluated`);\n return function (target, propertyKey) {\n console.log(`${value} called`);\n };\n}", "function useToggle(initialValue = false) {\n return useReducer((state) => !state, initialValue);\n }", "toggleItem(prop, value) {\n\t\t\t\tif (value === undefined) {\n\t\t\t\t\tvalue = set({ prop, hidden: true });\n\t\t\t\t}\n\n\t\t\t\tset({ hidden: true, prop }, !value);\n\t\t\t}", "function propertyFunction() {\n var x = value.apply(this, arguments);\n if (x == null) delete this[name];\n else this[name] = x;\n }", "get asSetter() {\n return setter(this.over)\n }", "_upgradeProperty(prop) {\n // https://developers.google.com/web/fundamentals/web-components/best-practices#lazy-properties\n // https://developers.google.com/web/fundamentals/web-components/examples/howto-checkbox\n /* eslint no-prototype-builtins: 0 */\n if (this.hasOwnProperty(prop)) {\n const value = this[prop];\n // get rid of the property that might shadow a setter/getter\n delete this[prop];\n // this time if a setter was defined it will be properly called\n this[prop] = value;\n // if a getter was defined, it will be called from now on\n }\n }", "function transition (state, event) {\n return machine.states[state]\n ?.on?.[event] || state;\n\n // switch (state) {\n // case 'active':\n // switch (event) {\n // case 'click':\n // return 'inactive'\n // default:\n // return state;\n // }\n // case 'inactive':\n // switch (event) {\n // case 'click':\n // return 'active'\n // default:\n // return state;\n // }\n // default:\n // return state;\n // }\n}", "togglerClick() {\n $('#toggler').click(() => {\n let toggler = parseInt($(this).css('left'))\n if (toggler > 0) {\n this.display.togglerSlideLeft()\n } else {\n this.display.togglerSlideRight()\n }\n })\n }", "reset(prop, e) {\n var newState = {};\n newState[prop] = '';\n this.setState(newState);\n }", "function defineProperty(key,handler,value){Object.defineProperty(ctrl,key,{get:function get(){return value;},set:function set(newValue){var oldValue=value;value=newValue;handler(newValue,oldValue);}});}", "function propertyFunction() {\n var x = value.apply(this, arguments);\n if (x == null) delete this[name];\n else this[name] = x;\n }", "function propertyFunction() {\n var x = value.apply(this, arguments);\n if (x == null) delete this[name];\n else this[name] = x;\n }", "function transition(state, event) {\n return machine.states[state]?.on?.[event] || state;\n}", "get (target, propKey, receiver) {\n // We check whether the property accessed is the write method\n // If that is the case, we return a function to proxy the original behavior.\n if (propKey === 'write') {\n // we extract the current chunk from the list of arguments passed to the original function, \n // we log the content of the chunk, \n // we invoke the original method with the given list of arguments\n return function (...args) {\n const [chunk] = args\n console.log('Writing', chunk)\n return writable.write(...args)\n }\n }\n // We return unchanged any other property\n return target[propKey]\n }", "get action() { return this.actionIn; }", "function defineProperty(key,handler,value){Object.defineProperty(ctrl,key,{get:function get(){return value;},set:function set(newValue){var oldValue=value;value=newValue;handler&&handler(newValue,oldValue);}});}", "trigger(event) {\r\n var currentState = this.getState();\r\n var newState = this.states[currentState].transitions[event];\r\n if (newState) {\r\n this.changeState(newState);\r\n this.statesUndone.clear();\r\n }\r\n else throw new Error(\"This event can't be triggered.\");\r\n }", "function toggleProperties($el, property, val) {\n if (val === false || val === 'false') {\n $el.children().first().removeAttr(property);\n } else {\n $el.children().first().attr(property, val);\n }\n }", "render() {\n const {visible} = this.state;\n this.target.setAttribute('aria-hidden', !visible);\n this.toggler.setAttribute('aria-expanded', visible);\n const action = visible ? '_show' : '_hide';\n this[action]();\n }", "stateChanged(state) { }", "onTrigger(prevValue) {\r\n\r\n // Store input\r\n this.lastActionInput = prevValue\r\n\r\n }", "get state() {\r\n return reactionState;\r\n }", "toggle(value = !this.onOff) {\r\n return this.operatePlug({ onOff: value });\r\n }", "handleToggle(event, toggled) {\n this.setState({\n [event.target.name]: toggled\n });\n }", "trigger(event) {\r\n const { transitions } = this.states[this.currentState];\r\n const state = transitions[event];\r\n if (!state) {\r\n throw new Error(\"Transition event not found\");\r\n }\r\n \r\n this.updateState(state);\r\n }", "get state() {\n // Here, state is a non-enumerable property.\n return this.getState();\n }", "set (obj, prop, value) {\n let store = obj.store;\n let setStore = controller.setState.bind ({controller, store});\n setStore ({[prop]: value});\n\n return true;\n }", "function property(node, file, scope) {\n var key = t.toComputedKey(node, node.key);\n if (!t.isLiteral(key)) return; // we can't set a function id with this\n\n var name = t.toBindingIdentifierName(key.value);\n var id = t.identifier(name);\n\n var method = node.value;\n var state = visit(method, name, scope);\n node.value = wrap(state, method, id, scope) || method;\n}", "makeProp(prop, value) {\n\t\tObject.defineProperty(this, prop, {\n\t\t\tvalue,\n\t\t\tenumerable: false,\n\t\t\twritable: true,\n\t\t\tconfigurable: true\n\t\t});\n\t}", "function setupToggler(toggler, index) {\n var enlarge = toggler.find(\".pg-enlarge\");\n var shrink = toggler.find(\".pg-shrink\");\n var current_data = config.images[index];\n current_data.image_wrapper.addClass(\"pg-fitted\");\n\n current_data.toggler = toggler;\n current_data.toggler.enlarge = enlarge;\n current_data.toggler.shrink = shrink;\n\n enlarge.click(function() {\n current_data.image_wrapper.animate({\n width: \"616px\"\n }, 200);\n current_data.image_wrapper.find(\"a.photo img\").animate({\n width: \"616px\"\n }, 200);\n enlarge.hide();\n shrink.show();\n var t = setTimeout(function() { verifyWrapperHeight(); }, 450);\n });\n\n enlarge.children(\".pg-toggler-button\").hover(\n function() {\n enlarge.children(\".pg-toggler-label\").show();\n },\n\n function() {\n enlarge.children(\".pg-toggler-label\").hide();\n }\n );\n\n enlarge.children(\".pg-toggler-label\").hover(\n function() {\n enlarge.children(\".pg-toggler-label\").show();\n },\n function() {\n enlarge.children(\".pg-toggler-label\").hide();\n }\n );\n\n shrink.click(function() {\n current_data.image_wrapper.animate({\n width: \"339px\"\n }, 250);\n current_data.image_wrapper.find(\"a.photo img\").animate({\n width: \"339px\"\n }, 250);\n shrink.hide();\n enlarge.show();\n var t = setTimeout(function() { verifyWrapperHeight(); }, 450);\n });\n\n shrink.children(\".pg-toggler-button\").hover(\n function() {\n shrink.children(\".pg-toggler-label\").show();\n },\n function() {\n shrink.children(\".pg-toggler-label\").hide();\n }\n );\n\n shrink.children(\".pg-toggler-label\").hover(\n function() {\n shrink.children(\".pg-toggler-label\").show();\n },\n function() {\n shrink.children(\".pg-toggler-label\").hide();\n }\n );\n }", "trigger(event) {\r\n if(!this.allStates[this.currentState].transitions[event])\r\n throw new Error(\"Error! Wrong Event!\");\r\n\r\n this.historyStates.push(this.currentState);\r\n this.currentState = this.allStates[this.historyStates[this.historyStates.length-1]].transitions[event];\r\n this.specialRedoArray = [];\r\n }", "async setTargetDoorState(value, callback) {\n const action = {\n open: { state: 'opening', relay: DO.open },\n closed: { state: 'closing', relay: DO.close }\n }[value];\n if (this.currentState == value || this.currentState == action.state) {\n this.log('Door is already ' + this.currentState);\n } else {\n // Start opening or closing the door\n try {\n await this.pulseRelay(action.relay);\n } catch (e) {\n this.emit('error', e);\n return callback(e);\n }\n\n // Update the door state to match\n this.updateDoorPosition(action.state);\n }\n callback();\n }", "stateChanged(state) {\n }", "function py(e,t){var n=e||[!0,!1],r=K();t===void 0?r=K(n[1]):$t(t)?r=t:r=K(t);var a=function(i){i!==void 0?r.value=i:r.value=r.value===n[1]?n[0]:n[1]};return{state:r,toggle:a}}", "function makeTrigger(trigger) {\n if (!trigger) {\n return noop;\n }\n\n if (typeof trigger === 'function') {\n return trigger;\n }\n\n var eventName = trigger;\n\n return function doTrigger(newValue, oldValue) {\n // Trigger an event that has the new and old values under detail\n return this.trigger(eventName, {\n oldValue: oldValue,\n value: newValue\n });\n };\n }", "trigger(event) {\r\n if (this.config.states[this.currentState].transitions[event]) {\r\n this.currentState = this.config.states[this.currentState].transitions[event];\r\n this.history.push(this.currentState);\r\n this.isRedo = false;\r\n } else {\r\n throw new Error();\r\n }\r\n }", "get actuatorState() { return this._actuatorState; }", "toggleState() {\n\n // Update the state to the opposite of what it is currently\n this.state = !this.state;\n }", "_updateStateValue(prop, v) {\n return new Promise((resolve, reject) => {\n var c = this._component\n if(c.state && c.state[prop] !== undefined){\n var state = {}\n state[prop] = v\n c.setState(state, resolve)\n }else{\n c[prop] = v\n c.forceUpdate()\n resolve()\n }\n })\n }", "function makeWatcher(property) {\n return function (val, oldVal) {\n for (const attr in oldVal) {\n if (!Object.prototype.hasOwnProperty.call(val, attr)) {\n this.$delete(this.$data[property], attr);\n }\n }\n\n for (const attr in val) {\n this.$set(this.$data[property], attr, val[attr]);\n }\n };\n}", "function makeWatcher(property) {\n return function (val, oldVal) {\n for (const attr in oldVal) {\n if (!Object.prototype.hasOwnProperty.call(val, attr)) {\n this.$delete(this.$data[property], attr);\n }\n }\n\n for (const attr in val) {\n this.$set(this.$data[property], attr, val[attr]);\n }\n };\n}", "function makeWatcher(property) {\n return function (val, oldVal) {\n for (const attr in oldVal) {\n if (!Object.prototype.hasOwnProperty.call(val, attr)) {\n this.$delete(this.$data[property], attr);\n }\n }\n\n for (const attr in val) {\n this.$set(this.$data[property], attr, val[attr]);\n }\n };\n}", "function makeWatcher(property) {\n return function (val, oldVal) {\n for (const attr in oldVal) {\n if (!Object.prototype.hasOwnProperty.call(val, attr)) {\n this.$delete(this.$data[property], attr);\n }\n }\n\n for (const attr in val) {\n this.$set(this.$data[property], attr, val[attr]);\n }\n };\n}", "function makeWatcher(property) {\n return function (val, oldVal) {\n for (const attr in oldVal) {\n if (!Object.prototype.hasOwnProperty.call(val, attr)) {\n this.$delete(this.$data[property], attr);\n }\n }\n\n for (const attr in val) {\n this.$set(this.$data[property], attr, val[attr]);\n }\n };\n}", "trigger(event) {\r\n let state = this.states[this.currentState];\r\n if (!state.transitions[event]) throw new SyntaxError (\"there is no state\");\r\n this.history.splice(this.step+1);\r\n this.changeState(state.transitions[event]);\r\n }", "componentWillReceiveProps (property) {\n\t\tthis.setState({\n\t\t\tincreasing: property.val > this.props.val\n\t\t});\n\t}", "function SomaClickState() {\n setState(stateValue = stateValue + 1); // Mesma coisa que isso state[1](stateValue);\n // Por setState ser uma funcao ele temq ue ser escrito seu nome e parenteses\n }", "handleToggleElementValue() {\n this.setState(prevState => ({\n showElementValue: !prevState.showElementValue\n }));\n }", "function WgMut2WayActionLink(props) {\n const customNames = props.actionNames !== undefined;\n const representedValues = props.representedValues || [false, true];\n return (\n\t<WgMutexActionLink\n\t name={props.name}\n\t className={props.variableName}\n\t equityTestingForEnabled={{\n\t currentValue: props.value,\n\t representedValuesArray: representedValues\n\t }}\n\t actions={[\n\t {\n\t\t name: customNames ? props.actionNames[0] : \"off\",\n\t\t cb: props.hofCB(props.variableName, representedValues[0])\n\t },{\n\t\t name: customNames ? props.actionNames[1] : \"on\",\n\t\t cb: props.hofCB(props.variableName, representedValues[1])\n\t }\n\t ]}\n\t />\n );\n}", "handleChange(value,propThatNeedsToChange){\n var newObj = {}\n newObj[propThatNeedsToChange]= value\n this.setState(newObj)\n}", "function initializeState(property) {\n var result;\n // Look through all selections for this property;\n // values should all match by the time we perform\n // this lookup anyway.\n self.selection.forEach(function (selected) {\n result = (selected[property] !== undefined) ?\n self.lookupState(property, selected) :\n result;\n });\n return result;\n }", "function makeWatcher(property) {\n return function (val, oldVal) {\n for (var attr in oldVal) {\n if (!Object.prototype.hasOwnProperty.call(val, attr)) {\n this.$delete(this.$data[property], attr);\n }\n }\n\n for (var _attr in val) {\n this.$set(this.$data[property], _attr, val[_attr]);\n }\n };\n}", "function onValue(object, property, callback) {\n Object.defineProperty(object, property, {\n enumerable: true,\n configurable: true,\n get: function () { return; },\n set: function (v) {\n Object.defineProperty(object, property, {\n enumerable: true,\n configurable: true,\n value: v\n });\n // Protect from callback errors.\n try {\n callback(v);\n } catch (e) {\n console.error(\"Error trying to invoke callback for %s: %o\", property, e);\n }\n }\n });\n }", "function reducer(state, action){ // assume state = { name: 'NAVS', isVisible: false}\n switch(action.type){\n case 'Test_action' :\n return {...state, isVisible: true}\n default: return state\n }\n}", "function defineProperty (key, handler, value) {\n Object.defineProperty(ctrl, key, {\n get: function () { return value; },\n set: function (newValue) {\n var oldValue = value;\n value = newValue;\n handler(newValue, oldValue);\n }\n });\n }", "function defineProperty (key, handler, value) {\n Object.defineProperty(ctrl, key, {\n get: function () { return value; },\n set: function (newValue) {\n var oldValue = value;\n value = newValue;\n handler(newValue, oldValue);\n }\n });\n }", "function defineProperty (key, handler, value) {\n Object.defineProperty(ctrl, key, {\n get: function () { return value; },\n set: function (newValue) {\n var oldValue = value;\n value = newValue;\n handler(newValue, oldValue);\n }\n });\n }", "change() {\n this._updateValueProperty();\n\n this.sendAction('action', this.get('value'), this);\n }", "function makeWatcher(property) {\n return function (val, oldVal) {\n for (var attr in oldVal) {\n if (!Object.prototype.hasOwnProperty.call(val, attr)) {\n this.$delete(this.$data[property], attr);\n }\n }\n\n for (var attr in val) {\n this.$set(this.$data[property], attr, val[attr]);\n }\n };\n}", "function makeWatcher(property) {\n return function (val, oldVal) {\n for (var attr in oldVal) {\n if (!Object.prototype.hasOwnProperty.call(val, attr)) {\n this.$delete(this.$data[property], attr);\n }\n }\n\n for (var attr in val) {\n this.$set(this.$data[property], attr, val[attr]);\n }\n };\n}", "function makeWatcher(property) {\n return function (val, oldVal) {\n for (var attr in oldVal) {\n if (!Object.prototype.hasOwnProperty.call(val, attr)) {\n this.$delete(this.$data[property], attr);\n }\n }\n\n for (var attr in val) {\n this.$set(this.$data[property], attr, val[attr]);\n }\n };\n}", "function makeWatcher(property) {\n return function (val, oldVal) {\n for (var attr in oldVal) {\n if (!Object.prototype.hasOwnProperty.call(val, attr)) {\n this.$delete(this.$data[property], attr);\n }\n }\n\n for (var attr in val) {\n this.$set(this.$data[property], attr, val[attr]);\n }\n };\n}", "function makeWatcher(property) {\n return function (val, oldVal) {\n for (var attr in oldVal) {\n if (!Object.prototype.hasOwnProperty.call(val, attr)) {\n this.$delete(this.$data[property], attr);\n }\n }\n\n for (var attr in val) {\n this.$set(this.$data[property], attr, val[attr]);\n }\n };\n}", "function makeWatcher(property) {\n return function (val, oldVal) {\n for (var attr in oldVal) {\n if (!Object.prototype.hasOwnProperty.call(val, attr)) {\n this.$delete(this.$data[property], attr);\n }\n }\n\n for (var attr in val) {\n this.$set(this.$data[property], attr, val[attr]);\n }\n };\n}", "handleChange(value) {\n return () => {\n let newValue = this.state.sliderValue + value\n console.debug(this, 'dispatching slide event')\n window.dispatchEvent(new CustomEvent('slide', {detail: {newValue: newValue}}))\n }\n }", "function track(property, thisArg){\n if(!(property in trackedProperties)){\n trackedProperties[property] = true;\n values[property] = model[property];\n Object.defineProperty(model, property, {\n get: function () { return values[property]; },\n set: function(newValue) {\n var oldValue = values[property];\n values[property] = newValue;\n getListeners(property).forEach(function(callback){\n callback.call(thisArg, newValue, oldValue);\n });\n }\n });\n }\n }", "function PropertyFieldCheckboxWithCallout(targetProperty, properties) {\n return new PropertyFieldCheckboxWithCalloutBuilder(targetProperty, __assign({}, properties, { onRender: null, onDispose: null }));\n}", "toggleAnimationState(event, state) {\n let expand = state === \"expand\" ? true : false\n this.setState({ expand })\n }", "toggleLike() {\n const { _id, liked } = this.props\n this.props.onChange(_id, { liked: !liked})\n }", "handleChange(event) {\n // Verify target being changed\n if (event.target.name === 'admin') {\n // Change the admin state to opposite value\n this.setState(prevState => ({ admin: !prevState.admin }));\n }\n else if (event.target.name === 'archived') {\n // Change the archived state to opposite value\n this.setState(prevState => ({ archived: !prevState.archived }));\n }\n else {\n // Change the state with new value\n this.setState({ [event.target.name]: event.target.value });\n }\n }" ]
[ "0.562566", "0.562566", "0.562566", "0.561733", "0.5212816", "0.5125243", "0.5085007", "0.5065974", "0.50450844", "0.50281835", "0.4977002", "0.49746278", "0.49360406", "0.4935533", "0.4931587", "0.49147934", "0.49135178", "0.48936903", "0.48864853", "0.48856494", "0.48709154", "0.48683652", "0.482198", "0.48125482", "0.47629568", "0.4762369", "0.47338167", "0.47289374", "0.4728339", "0.47262716", "0.47235355", "0.47114277", "0.47103146", "0.4709285", "0.46885014", "0.4683657", "0.46794468", "0.46682286", "0.4656259", "0.4654722", "0.46249238", "0.46235788", "0.46235788", "0.45996013", "0.45819145", "0.45713627", "0.45562813", "0.4540023", "0.45362398", "0.45307285", "0.45261353", "0.4523311", "0.4514352", "0.45115203", "0.45062017", "0.45023477", "0.45002624", "0.44882515", "0.44868094", "0.4469836", "0.44603512", "0.44566974", "0.4451121", "0.44500074", "0.44499078", "0.4438374", "0.44320148", "0.44274664", "0.44238555", "0.44187865", "0.43989956", "0.43989956", "0.43989956", "0.43989956", "0.43989956", "0.43987286", "0.43980053", "0.43919548", "0.43855238", "0.4383913", "0.43819648", "0.43818536", "0.4381692", "0.4379774", "0.43790442", "0.43784896", "0.43784896", "0.43784896", "0.43689978", "0.43658155", "0.43658155", "0.43658155", "0.43658155", "0.43658155", "0.43658155", "0.4361712", "0.43615028", "0.43582556", "0.43567368", "0.435667", "0.43550187" ]
0.0
-1
Factory to get the line and columnbased `position` for `offset` in the bound indices.
function offsetToPositionFactory(indices) { return offsetToPosition // Get the line and column-based `position` for `offset` in the bound indices. function offsetToPosition(offset) { var index = -1 var length = indices.length if (offset < 0) { return {} } while (++index < length) { if (indices[index] > offset) { return { line: index + 1, column: offset - (indices[index - 1] || 0) + 1, offset: offset } } } return {} } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function positionToOffsetFactory(indices) {\n return positionToOffset\n\n // Get the `offset` for a line and column-based `position` in the bound\n // indices.\n function positionToOffset(position) {\n var line = position && position.line\n var column = position && position.column\n\n if (!isNaN(line) && !isNaN(column) && line - 1 in indices) {\n return (indices[line - 2] || 0) + column - 1 || 0\n }\n\n return -1\n }\n}", "function positionToOffsetFactory(indices) {\n return positionToOffset\n\n // Get the `offset` for a line and column-based `position` in the bound\n // indices.\n function positionToOffset(position) {\n var line = position && position.line\n var column = position && position.column\n\n if (!isNaN(line) && !isNaN(column) && line - 1 in indices) {\n return (indices[line - 2] || 0) + column - 1 || 0\n }\n\n return -1\n }\n}", "function positionToOffsetFactory(indices) {\n return positionToOffset\n\n // Get the `offset` for a line and column-based `position` in the bound\n // indices.\n function positionToOffset(position) {\n var line = position && position.line\n var column = position && position.column\n\n if (!isNaN(line) && !isNaN(column) && line - 1 in indices) {\n return (indices[line - 2] || 0) + column - 1 || 0\n }\n\n return -1\n }\n}", "function offsetToPositionFactory(indices) {\n return offsetToPosition\n\n /* Get the line and column-based `position` for\n * `offset` in the bound indices. */\n function offsetToPosition(offset) {\n var index = -1\n var length = indices.length\n\n if (offset < 0) {\n return {}\n }\n\n while (++index < length) {\n if (indices[index] > offset) {\n return {\n line: index + 1,\n column: offset - (indices[index - 1] || 0) + 1,\n offset: offset\n }\n }\n }\n\n return {}\n }\n}", "function offsetToPositionFactory(indices) {\n return offsetToPosition\n\n /* Get the line and column-based `position` for\n * `offset` in the bound indices. */\n function offsetToPosition(offset) {\n var index = -1\n var length = indices.length\n\n if (offset < 0) {\n return {}\n }\n\n while (++index < length) {\n if (indices[index] > offset) {\n return {\n line: index + 1,\n column: offset - (indices[index - 1] || 0) + 1,\n offset: offset\n }\n }\n }\n\n return {}\n }\n}", "function positionToOffsetFactory(indices) {\n return positionToOffset\n\n /* Get the `offset` for a line and column-based\n * `position` in the bound indices. */\n function positionToOffset(position) {\n var line = position && position.line\n var column = position && position.column\n\n if (!isNaN(line) && !isNaN(column) && line - 1 in indices) {\n return (indices[line - 2] || 0) + column - 1 || 0\n }\n\n return -1\n }\n}", "function positionToOffsetFactory(indices) {\n return positionToOffset\n\n /* Get the `offset` for a line and column-based\n * `position` in the bound indices. */\n function positionToOffset(position) {\n var line = position && position.line\n var column = position && position.column\n\n if (!isNaN(line) && !isNaN(column) && line - 1 in indices) {\n return (indices[line - 2] || 0) + column - 1 || 0\n }\n\n return -1\n }\n}", "function offsetToPosition(offset) {\n var index = -1\n var length = indices.length\n\n if (offset < 0) {\n return {}\n }\n\n while (++index < length) {\n if (indices[index] > offset) {\n return {\n line: index + 1,\n column: offset - (indices[index - 1] || 0) + 1,\n offset: offset\n }\n }\n }\n\n return {}\n }", "function offsetToPosition(offset) {\n var index = -1\n var length = indices.length\n\n if (offset < 0) {\n return {}\n }\n\n while (++index < length) {\n if (indices[index] > offset) {\n return {\n line: index + 1,\n column: offset - (indices[index - 1] || 0) + 1,\n offset: offset\n }\n }\n }\n\n return {}\n }", "function offsetToPosition(offset) {\n var index = -1\n var length = indices.length\n\n if (offset < 0) {\n return {}\n }\n\n while (++index < length) {\n if (indices[index] > offset) {\n return {\n line: index + 1,\n column: offset - (indices[index - 1] || 0) + 1,\n offset: offset\n }\n }\n }\n\n return {}\n }", "function offsetToPosition(offset) {\n var index = -1\n var length = indices.length\n\n if (offset < 0) {\n return {}\n }\n\n while (++index < length) {\n if (indices[index] > offset) {\n return {\n line: index + 1,\n column: offset - (indices[index - 1] || 0) + 1,\n offset: offset\n }\n }\n }\n\n return {}\n }", "function offsetToPosition(offset) {\n var index = -1\n var length = indices.length\n\n if (offset < 0) {\n return {}\n }\n\n while (++index < length) {\n if (indices[index] > offset) {\n return {\n line: index + 1,\n column: offset - (indices[index - 1] || 0) + 1,\n offset: offset\n }\n }\n }\n\n return {}\n }", "function pointToOffsetFactory(indices) {\n return pointToOffset\n\n // Get the `offset` for a line and column-based `point` in the bound\n // indices.\n function pointToOffset(point) {\n var line = point && point.line\n var column = point && point.column\n\n if (!isNaN(line) && !isNaN(column) && line - 1 in indices) {\n return (indices[line - 2] || 0) + column - 1 || 0\n }\n\n return -1\n }\n}", "function offsetToPointFactory(indices) {\n return offsetToPoint\n\n // Get the line and column-based `point` for `offset` in the bound indices.\n function offsetToPoint(offset) {\n var index = -1\n var length = indices.length\n\n if (offset < 0) {\n return {}\n }\n\n while (++index < length) {\n if (indices[index] > offset) {\n return {\n line: index + 1,\n column: offset - (indices[index - 1] || 0) + 1,\n offset: offset\n }\n }\n }\n\n return {}\n }\n}", "position_from_offset(offset) {\n const [col, row] = this.col_row_from_offset(offset);\n return new Position(col, row);\n }", "function offsetToPoint(offset) {\n var index = -1\n var length = indices.length\n\n if (offset < 0) {\n return {}\n }\n\n while (++index < length) {\n if (indices[index] > offset) {\n return {\n line: index + 1,\n column: offset - (indices[index - 1] || 0) + 1,\n offset: offset\n }\n }\n }\n\n return {}\n }", "function offsetToPoint(offset) {\n var index = -1\n\n if (offset > -1 && offset < indices[indices.length - 1]) {\n while (++index < indices.length) {\n if (indices[index] > offset) {\n return {\n line: index + 1,\n column: offset - (indices[index - 1] || 0) + 1,\n offset: offset\n }\n }\n }\n }\n\n return {}\n }", "function offsetToPoint(offset) {\n var index = -1\n\n if (offset > -1 && offset < indices[indices.length - 1]) {\n while (++index < indices.length) {\n if (indices[index] > offset) {\n return {\n line: index + 1,\n column: offset - (indices[index - 1] || 0) + 1,\n offset: offset\n }\n }\n }\n }\n\n return {}\n }", "positionAt(offset) {\n return (0, utils_1.positionAt)(offset, this.getText(), this.getLineOffsets());\n }", "function offsetToPoint(offset) {\n var index = -1;\n\n if (offset > -1 && offset < indices[indices.length - 1]) {\n while (++index < indices.length) {\n if (indices[index] > offset) {\n return {\n line: index + 1,\n column: offset - (indices[index - 1] || 0) + 1,\n offset: offset\n }\n }\n }\n }\n\n return {}\n }", "getLineAndColumnFromChunk(offset) {\r\n\t\t\t\tvar column, columnCompensation, compensation, lastLine, lineCount, previousLinesCompensation, ref, string;\r\n\t\t\t\tcompensation = this.getLocationDataCompensation(this.chunkOffset, this.chunkOffset + offset);\r\n\t\t\t\tif (offset === 0) {\r\n\t\t\t\t\treturn [this.chunkLine, this.chunkColumn + compensation, this.chunkOffset + compensation];\r\n\t\t\t\t}\r\n\t\t\t\tif (offset >= this.chunk.length) {\r\n\t\t\t\t\tstring = this.chunk;\r\n\t\t\t\t} else {\r\n\t\t\t\t\tstring = this.chunk.slice(0, +(offset - 1) + 1 || 9e9);\r\n\t\t\t\t}\r\n\t\t\t\tlineCount = count(string, '\\n');\r\n\t\t\t\tcolumn = this.chunkColumn;\r\n\t\t\t\tif (lineCount > 0) {\r\n\t\t\t\t\tref = string.split('\\n'), [lastLine] = slice.call(ref, -1);\r\n\t\t\t\t\tcolumn = lastLine.length;\r\n\t\t\t\t\tpreviousLinesCompensation = this.getLocationDataCompensation(this.chunkOffset, this.chunkOffset + offset - column);\r\n\t\t\t\t\tif (previousLinesCompensation < 0) {\r\n\t\t\t\t\t\t// Don't recompensate for initially inserted newline.\r\n\t\t\t\t\t\tpreviousLinesCompensation = 0;\r\n\t\t\t\t\t}\r\n\t\t\t\t\tcolumnCompensation = this.getLocationDataCompensation(this.chunkOffset + offset + previousLinesCompensation - column, this.chunkOffset + offset + previousLinesCompensation);\r\n\t\t\t\t} else {\r\n\t\t\t\t\tcolumn += string.length;\r\n\t\t\t\t\tcolumnCompensation = compensation;\r\n\t\t\t\t}\r\n\t\t\t\treturn [this.chunkLine + lineCount, column + columnCompensation, this.chunkOffset + offset + compensation];\r\n\t\t\t}", "col_row_offset_from_offset(offset) {\n return [\n this.cell_from_offset(this.cell_width, offset.left),\n this.cell_from_offset(this.cell_height, offset.top),\n ];\n }", "getPositionFromDOMInfo(spanNode, offset) {\n const viewLineDomNode = this._getViewLineDomNode(spanNode);\n if (viewLineDomNode === null) {\n // Couldn't find view line node\n return null;\n }\n const lineNumber = this._getLineNumberFor(viewLineDomNode);\n if (lineNumber === -1) {\n // Couldn't find view line node\n return null;\n }\n if (lineNumber < 1 || lineNumber > this._context.model.getLineCount()) {\n // lineNumber is outside range\n return null;\n }\n if (this._context.model.getLineMaxColumn(lineNumber) === 1) {\n // Line is empty\n return new position_1.Position(lineNumber, 1);\n }\n const rendStartLineNumber = this._visibleLines.getStartLineNumber();\n const rendEndLineNumber = this._visibleLines.getEndLineNumber();\n if (lineNumber < rendStartLineNumber || lineNumber > rendEndLineNumber) {\n // Couldn't find line\n return null;\n }\n let column = this._visibleLines.getVisibleLine(lineNumber).getColumnOfNodeOffset(lineNumber, spanNode, offset);\n const minColumn = this._context.model.getLineMinColumn(lineNumber);\n if (column < minColumn) {\n column = minColumn;\n }\n return new position_1.Position(lineNumber, column);\n }", "cell_from_offset(sizes, offset) {\n // We explore the grid in both directions, starting from the origin.\n let index = 0;\n const original_offset = offset;\n if (offset === 0) {\n return [index, 0];\n }\n // The following two loops have been kept separate to increase readability.\n // Explore to the right or bottom...\n while (offset >= 0) {\n const size = this.cell_size(sizes, index);\n if (offset < size) {\n return [index, original_offset - offset];\n }\n offset -= size;\n ++index;\n }\n // Explore to the left or top...\n while (offset <= 0) {\n --index;\n const size = this.cell_size(sizes, index);\n if (Math.abs(offset) < size) {\n return [index, original_offset - (offset + size)];\n }\n offset += size;\n }\n }", "function getLineInfo(input, offset) {\n for (var line = 1, cur = 0;;) {\n lineBreakG.lastIndex = cur;\n var match = lineBreakG.exec(input);\n\n if (match && match.index < offset) {\n ++line;\n cur = match.index + match[0].length;\n } else {\n return new Position(line, offset - cur);\n }\n }\n }", "positionAt(offset) {\n const before = this.textDocument.slice(0, offset);\n const newLines = before.match(/\\n/g);\n const line = newLines ? newLines.length : 0;\n const preCharacters = before.match(/(\\n|^).*$/g);\n return new tokenizer_1.Position(line, preCharacters ? preCharacters[0].length : 0);\n }", "function getLineInfo(input, offset) {\n for (var line = 1, cur = 0;;) {\n lineBreakG.lastIndex = cur;\n var match = lineBreakG.exec(input);\n if (match && match.index < offset) {\n ++line;\n cur = match.index + match[0].length;\n } else {\n return new Position(line, offset - cur);\n }\n }\n}", "function getLineInfo(input, offset) {\n for (var line = 1, cur = 0;;) {\n lineBreakG.lastIndex = cur;\n var match = lineBreakG.exec(input);\n if (match && match.index < offset) {\n ++line;\n cur = match.index + match[0].length;\n } else {\n return new Position(line, offset - cur);\n }\n }\n}", "function getLineInfo(input, offset) {\n for (var line = 1, cur = 0;;) {\n lineBreakG.lastIndex = cur\n var match = lineBreakG.exec(input)\n if (match && match.index < offset) {\n ++line\n cur = match.index + match[0].length\n } else {\n return new Position(line, offset - cur)\n }\n }\n}", "function getLineInfo(input, offset) {\n for (var line = 1, cur = 0;;) {\n lineBreakG.lastIndex = cur\n var match = lineBreakG.exec(input)\n if (match && match.index < offset) {\n ++line\n cur = match.index + match[0].length\n } else {\n return new Position(line, offset - cur)\n }\n }\n}", "function getLineInfo(input, offset) {\n for (var line = 1, cur = 0;;) {\n lineBreakG.lastIndex = cur;\n var match = lineBreakG.exec(input);\n if (match && match.index < offset) {\n ++line;\n cur = match.index + match[0].length;\n } else {\n return new Position(line, offset - cur)\n }\n }\n }", "function getLineInfo(input, offset) {\n for (var line = 1, cur = 0;;) {\n lineBreakG.lastIndex = cur;\n var match = lineBreakG.exec(input);\n if (match && match.index < offset) {\n ++line;\n cur = match.index + match[0].length;\n } else {\n return new Position(line, offset - cur)\n }\n }\n }", "createPosition () {\n\t\treturn {\n\t\t\tstart: {\n\t\t\t\tline: this.line,\n\t\t\t\tcolumn: this.col\n\t\t\t},\n\t\t\tsource: this.source,\n\t\t\trange: [ this.pos ]\n\t\t};\n\t}", "function getLineInfo(input, offset) {\n\t for (var line = 1, cur = 0;;) {\n\t lineBreakG.lastIndex = cur;\n\t var match = lineBreakG.exec(input);\n\t if (match && match.index < offset) {\n\t ++line;\n\t cur = match.index + match[0].length;\n\t } else {\n\t return new Position(line, offset - cur);\n\t }\n\t }\n\t}", "function getLineInfo(input, offset) {\n\t for (var line = 1, cur = 0;;) {\n\t lineBreakG.lastIndex = cur;\n\t var match = lineBreakG.exec(input);\n\t if (match && match.index < offset) {\n\t ++line;\n\t cur = match.index + match[0].length;\n\t } else {\n\t return new Position(line, offset - cur);\n\t }\n\t }\n\t}", "function getLineInfo(input, offset) {\n for (var line = 1, cur = 0;;) {\n lineBreakG.lastIndex = cur;\n var match = lineBreakG.exec(input);\n if (match && match.index < offset) {\n ++line;\n cur = match.index + match[0].length;\n } else {\n return new Position(line, offset - cur)\n }\n }\n}", "function getLineInfo(input, offset) {\n for (var line = 1, cur = 0;;) {\n lineBreakG.lastIndex = cur;\n var match = lineBreakG.exec(input);\n if (match && match.index < offset) {\n ++line;\n cur = match.index + match[0].length;\n } else {\n return new Position(line, offset - cur)\n }\n }\n}", "function getLineInfo(input, offset) {\n for (var line = 1, cur = 0;;) {\n lineBreakG.lastIndex = cur;\n var match = lineBreakG.exec(input);\n if (match && match.index < offset) {\n ++line;\n cur = match.index + match[0].length;\n } else {\n return new Position(line, offset - cur)\n }\n }\n}", "function getLineInfo(input, offset) {\n for (var line = 1, cur = 0;;) {\n lineBreakG.lastIndex = cur;\n var match = lineBreakG.exec(input);\n if (match && match.index < offset) {\n ++line;\n cur = match.index + match[0].length;\n } else {\n return new Position(line, offset - cur)\n }\n }\n}", "function getLineInfo(input, offset) {\n for (var line = 1, cur = 0;;) {\n lineBreakG.lastIndex = cur;\n var match = lineBreakG.exec(input);\n if (match && match.index < offset) {\n ++line;\n cur = match.index + match[0].length;\n } else {\n return new Position(line, offset - cur)\n }\n }\n}", "function getLineInfo(input, offset) {\n for (var line = 1, cur = 0;;) {\n lineBreakG.lastIndex = cur;\n var match = lineBreakG.exec(input);\n if (match && match.index < offset) {\n ++line;\n cur = match.index + match[0].length;\n } else {\n return new Position(line, offset - cur)\n }\n }\n}", "function getLineInfo(input, offset) {\n for (var line = 1, cur = 0;;) {\n lineBreakG.lastIndex = cur;\n var match = lineBreakG.exec(input);\n if (match && match.index < offset) {\n ++line;\n cur = match.index + match[0].length;\n } else {\n return new Position(line, offset - cur)\n }\n }\n}", "function getLineInfo(input, offset) {\n for (var line = 1, cur = 0;;) {\n lineBreakG.lastIndex = cur;\n var match = lineBreakG.exec(input);\n if (match && match.index < offset) {\n ++line;\n cur = match.index + match[0].length;\n } else {\n return new Position(line, offset - cur)\n }\n }\n}", "function getLineInfo(input, offset) {\n for (var line = 1, cur = 0;;) {\n lineBreakG.lastIndex = cur;\n var match = lineBreakG.exec(input);\n if (match && match.index < offset) {\n ++line;\n cur = match.index + match[0].length;\n } else {\n return new Position(line, offset - cur)\n }\n }\n}", "function getLineInfo(input, offset) {\n for (var line = 1, cur = 0;;) {\n lineBreakG.lastIndex = cur;\n var match = lineBreakG.exec(input);\n if (match && match.index < offset) {\n ++line;\n cur = match.index + match[0].length;\n } else {\n return new Position(line, offset - cur)\n }\n }\n}", "function offset_function(_, i){\n var x = -0.5 + ( Math.floor(i / num_cell) ) / num_cell ;\n var y = -0.5 + (i % num_cell) / num_cell ;\n return [x, y];\n }", "offset_from_position(position) {\n const offset = Offset.zero();\n\n // We attempt to explore in each of the four directions in turn.\n // These four loops could be simplified, but have been left as-is to aid readability.\n\n if (position.x > 0) {\n for (let col = 0; col < Math.floor(position.x); ++col) {\n offset.left += this.cell_size(this.cell_width, col);\n }\n offset.left\n += this.cell_size(this.cell_width, Math.floor(position.x)) * (position.x % 1);\n }\n if (position.x < 0) {\n for (let col = -1; col >= position.x; --col) {\n offset.left -= this.cell_size(this.cell_width, col);\n }\n offset.left\n += this.cell_size(this.cell_width, Math.floor(position.x)) * (position.x % 1);\n }\n\n if (position.y > 0) {\n for (let row = 0; row < Math.floor(position.y); ++row) {\n offset.top += this.cell_size(this.cell_height, row);\n }\n offset.top\n += this.cell_size(this.cell_height, Math.floor(position.y)) * (position.y % 1);\n }\n if (position.y < 0) {\n for (let row = -1; row >= position.y; --row) {\n offset.top -= this.cell_size(this.cell_height, row);\n }\n offset.top\n += this.cell_size(this.cell_height, Math.floor(position.y)) * (position.y % 1);\n }\n\n return offset;\n }", "function grid_from_offset(pos){\n\t \tvar location = {\n\t \t\tcol: Math.floor(pos.left/tileWidth) + 1,\n\t \t\trow: Math.floor(pos.top/tileHeight) + 1\n\t \t}\n\t \treturn location;\n\t }", "function getLineInfo(input, offset) {\n for (var line = 1, cur = 0;;) {\n var nextBreak = nextLineBreak(input, cur, offset);\n if (nextBreak < 0) { return new Position(line, offset - cur) }\n ++line;\n cur = nextBreak;\n }\n}", "function getLineInfo(input, offset) {\n for (var line = 1, cur = 0;;) {\n var nextBreak = nextLineBreak(input, cur, offset);\n if (nextBreak < 0) { return new Position(line, offset - cur) }\n ++line;\n cur = nextBreak;\n }\n }", "col_row_from_offset(offset) {\n return this.col_row_offset_from_offset(offset).map(([index, _]) => index);\n }", "function computeInOffsetByIndex(x, y, index) {\n var outx = x + 15;\n var outy = y + 47 + index * 20;\n\n return { x: outx, y: outy };\n}", "offsetAt(position) {\n return (0, utils_1.offsetAt)(position, this.getText(), this.getLineOffsets());\n }", "function getLineInfo(input, offset) {\n\t for (var line = 1, cur = 0;;) {\n\t _whitespace.lineBreakG.lastIndex = cur;\n\t var match = _whitespace.lineBreakG.exec(input);\n\t if (match && match.index < offset) {\n\t ++line;\n\t cur = match.index + match[0].length;\n\t } else {\n\t return new Position(line, offset - cur);\n\t }\n\t }\n\t}", "function getLineInfo(input, offset) {\n\t for (var line = 1, cur = 0;;) {\n\t _whitespace.lineBreakG.lastIndex = cur;\n\t var match = _whitespace.lineBreakG.exec(input);\n\t if (match && match.index < offset) {\n\t ++line;\n\t cur = match.index + match[0].length;\n\t } else {\n\t return new Position(line, offset - cur);\n\t }\n\t }\n\t}", "function getLocation(source, position) {\n let lastLineStart = 0;\n let line = 1;\n\n for (const match of source.body.matchAll(LineRegExp)) {\n typeof match.index === 'number' || invariant(false);\n\n if (match.index >= position) {\n break;\n }\n\n lastLineStart = match.index + match[0].length;\n line += 1;\n }\n\n return {\n line,\n column: position + 1 - lastLineStart,\n };\n}", "function xyOffsetIndex(i, x, y, w, h) {\n var index = i + x + y * w;\n var absx = (i % w) + x;\n if (absx < 0 && index < 0 || absx >= w && index >= w * h) {\n return i - x - y * w;\n }\n if (absx < 0 || absx >= w) { // if off the left.\n return i - x + y * w;\n }\n //var absy = index - (w * y)\n if (index < 0 || index >= w * h) { // if off top/bottom.\n return i + x - y * w;\n }\n return index;\n}", "function getLineElementsAtPageOffset(offset) {\n\t\tconst lines = document.getElementsByClassName('code-line');\n\t\tconst position = offset - window.scrollY;\n\t\tlet previous = null;\n\t\tfor (const element of lines) {\n\t\t\tconst line = +element.getAttribute('data-line');\n\t\t\tif (isNaN(line)) {\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tconst bounds = element.getBoundingClientRect();\n\t\t\tconst entry = { element, line };\n\t\t\tif (position < bounds.top) {\n\t\t\t\tif (previous && previous.fractional < 1) {\n\t\t\t\t\tprevious.line += previous.fractional;\n\t\t\t\t\treturn { previous };\n\t\t\t\t}\n\t\t\t\treturn { previous, next: entry };\n\t\t\t}\n\t\t\tentry.fractional = (position - bounds.top) / (bounds.height);\n\t\t\tprevious = entry;\n\t\t}\n\t\treturn { previous };\n\t}", "function computeOffset(position, data) {\n let line = position.line;\n let column = position.column + 1;\n for (let i = 0; i < data.length; i++) {\n if (line > 1) {\n /* not yet on the correct line */\n if (data[i] === \"\\n\") {\n line--;\n }\n }\n else if (column > 1) {\n /* not yet on the correct column */\n column--;\n }\n else {\n /* line/column found, return current position */\n return i;\n }\n }\n /* istanbul ignore next: should never reach this line unless espree passes bad\n * positions, no sane way to test */\n throw new Error(\"Failed to compute location offset from position\");\n}", "getCurrentLocation(offset) {\n if (!this.options.sourceCodeLocationInfo) {\n return null;\n }\n return {\n startLine: this.preprocessor.line,\n startCol: this.preprocessor.col - offset,\n startOffset: this.preprocessor.offset - offset,\n endLine: -1,\n endCol: -1,\n endOffset: -1,\n };\n }", "function positionToOffset(position) {\n var line = position && position.line\n var column = position && position.column\n\n if (!isNaN(line) && !isNaN(column) && line - 1 in indices) {\n return (indices[line - 2] || 0) + column - 1 || 0\n }\n\n return -1\n }", "function positionToOffset(position) {\n var line = position && position.line\n var column = position && position.column\n\n if (!isNaN(line) && !isNaN(column) && line - 1 in indices) {\n return (indices[line - 2] || 0) + column - 1 || 0\n }\n\n return -1\n }", "function positionToOffset(position) {\n var line = position && position.line\n var column = position && position.column\n\n if (!isNaN(line) && !isNaN(column) && line - 1 in indices) {\n return (indices[line - 2] || 0) + column - 1 || 0\n }\n\n return -1\n }", "function positionToOffset(position) {\n var line = position && position.line\n var column = position && position.column\n\n if (!isNaN(line) && !isNaN(column) && line - 1 in indices) {\n return (indices[line - 2] || 0) + column - 1 || 0\n }\n\n return -1\n }", "function positionToOffset(position) {\n var line = position && position.line\n var column = position && position.column\n\n if (!isNaN(line) && !isNaN(column) && line - 1 in indices) {\n return (indices[line - 2] || 0) + column - 1 || 0\n }\n\n return -1\n }", "generatedPositionFor(aArgs) {\n let source = util.getArg(aArgs, 'source')\n source = this._findSourceIndex(source)\n if (source < 0) {\n return {\n line: null,\n column: null,\n lastColumn: null,\n }\n }\n\n const needle = {\n source,\n originalLine: util.getArg(aArgs, 'line'),\n originalColumn: util.getArg(aArgs, 'column'),\n }\n\n if (needle.originalLine < 1) {\n throw new Error('Line numbers must be >= 1')\n }\n\n if (needle.originalColumn < 0) {\n throw new Error('Column numbers must be >= 0')\n }\n\n let bias = util.getArg(\n aArgs,\n 'bias',\n SourceMapConsumer.GREATEST_LOWER_BOUND\n )\n if (bias == null) {\n bias = SourceMapConsumer.GREATEST_LOWER_BOUND\n }\n\n let mapping\n this._wasm.withMappingCallback(\n (m) => (mapping = m),\n () => {\n this._wasm.exports.generated_location_for(\n this._getMappingsPtr(),\n needle.source,\n needle.originalLine - 1,\n needle.originalColumn,\n bias\n )\n }\n )\n\n if (mapping) {\n if (mapping.source === needle.source) {\n let lastColumn = mapping.lastGeneratedColumn\n if (this._computedColumnSpans && lastColumn === null) {\n lastColumn = Infinity\n }\n return {\n line: util.getArg(mapping, 'generatedLine', null),\n column: util.getArg(mapping, 'generatedColumn', null),\n lastColumn,\n }\n }\n }\n\n return {\n line: null,\n column: null,\n lastColumn: null,\n }\n }", "function estimateCoords(cm, pos) {\n\t\t var left = 0, pos = clipPos(cm.doc, pos);\n\t\t if (!cm.options.lineWrapping) left = charWidth(cm.display) * pos.ch;\n\t\t var lineObj = getLine(cm.doc, pos.line);\n\t\t var top = heightAtLine(lineObj) + paddingTop(cm.display);\n\t\t return {left: left, right: left, top: top, bottom: top + lineObj.height};\n\t\t }", "function estimateCoords(cm, pos) {\n var left = 0, pos = clipPos(cm.doc, pos);\n if (!cm.options.lineWrapping) left = charWidth(cm.display) * pos.ch;\n var lineObj = getLine(cm.doc, pos.line);\n var top = heightAtLine(lineObj) + paddingTop(cm.display);\n return {left: left, right: left, top: top, bottom: top + lineObj.height};\n }", "function estimateCoords(cm, pos) {\n var left = 0, pos = clipPos(cm.doc, pos);\n if (!cm.options.lineWrapping) left = charWidth(cm.display) * pos.ch;\n var lineObj = getLine(cm.doc, pos.line);\n var top = heightAtLine(lineObj) + paddingTop(cm.display);\n return {left: left, right: left, top: top, bottom: top + lineObj.height};\n }", "function estimateCoords(cm, pos) {\n var left = 0, pos = clipPos(cm.doc, pos);\n if (!cm.options.lineWrapping) left = charWidth(cm.display) * pos.ch;\n var lineObj = getLine(cm.doc, pos.line);\n var top = heightAtLine(lineObj) + paddingTop(cm.display);\n return {left: left, right: left, top: top, bottom: top + lineObj.height};\n }", "function estimateCoords(cm, pos) {\n var left = 0, pos = clipPos(cm.doc, pos);\n if (!cm.options.lineWrapping) left = charWidth(cm.display) * pos.ch;\n var lineObj = getLine(cm.doc, pos.line);\n var top = heightAtLine(lineObj) + paddingTop(cm.display);\n return {left: left, right: left, top: top, bottom: top + lineObj.height};\n }", "function estimateCoords(cm, pos) {\n var left = 0, pos = clipPos(cm.doc, pos);\n if (!cm.options.lineWrapping) left = charWidth(cm.display) * pos.ch;\n var lineObj = getLine(cm.doc, pos.line);\n var top = heightAtLine(lineObj) + paddingTop(cm.display);\n return {left: left, right: left, top: top, bottom: top + lineObj.height};\n }", "function estimateCoords(cm, pos) {\n var left = 0, pos = clipPos(cm.doc, pos);\n if (!cm.options.lineWrapping) left = charWidth(cm.display) * pos.ch;\n var lineObj = getLine(cm.doc, pos.line);\n var top = heightAtLine(lineObj) + paddingTop(cm.display);\n return {left: left, right: left, top: top, bottom: top + lineObj.height};\n }", "function estimateCoords(cm, pos) {\n var left = 0, pos = clipPos(cm.doc, pos);\n if (!cm.options.lineWrapping) left = charWidth(cm.display) * pos.ch;\n var lineObj = getLine(cm.doc, pos.line);\n var top = heightAtLine(lineObj) + paddingTop(cm.display);\n return {left: left, right: left, top: top, bottom: top + lineObj.height};\n }", "function estimateCoords(cm, pos) {\n var left = 0, pos = clipPos(cm.doc, pos);\n if (!cm.options.lineWrapping) left = charWidth(cm.display) * pos.ch;\n var lineObj = getLine(cm.doc, pos.line);\n var top = heightAtLine(lineObj) + paddingTop(cm.display);\n return {left: left, right: left, top: top, bottom: top + lineObj.height};\n }", "offset() {\n if (this.overlap) return this.dot ? 8 : 12;\n return this.dot ? 2 : 4;\n }", "function _cursorCoords(cm, pos, context, lineObj, preparedMeasure, varHeight) {\n lineObj = lineObj || getLine(cm.doc, pos.line);\n\n if (!preparedMeasure) {\n preparedMeasure = prepareMeasureForLine(cm, lineObj);\n }\n\n function get(ch, right) {\n var m = measureCharPrepared(cm, preparedMeasure, ch, right ? \"right\" : \"left\", varHeight);\n\n if (right) {\n m.left = m.right;\n } else {\n m.right = m.left;\n }\n\n return intoCoordSystem(cm, lineObj, m, context);\n }\n\n var order = getOrder(lineObj, cm.doc.direction),\n ch = pos.ch,\n sticky = pos.sticky;\n\n if (ch >= lineObj.text.length) {\n ch = lineObj.text.length;\n sticky = \"before\";\n } else if (ch <= 0) {\n ch = 0;\n sticky = \"after\";\n }\n\n if (!order) {\n return get(sticky == \"before\" ? ch - 1 : ch, sticky == \"before\");\n }\n\n function getBidi(ch, partPos, invert) {\n var part = order[partPos],\n right = part.level == 1;\n return get(invert ? ch - 1 : ch, right != invert);\n }\n\n var partPos = getBidiPartAt(order, ch, sticky);\n var other = bidiOther;\n var val = getBidi(ch, partPos, sticky == \"before\");\n\n if (other != null) {\n val.other = getBidi(ch, other, sticky != \"before\");\n }\n\n return val;\n } // Used to cheaply estimate the coordinates for a position. Used for", "function estimateCoords(cm, pos) {\n\t var left = 0, pos = clipPos(cm.doc, pos);\n\t if (!cm.options.lineWrapping) left = charWidth(cm.display) * pos.ch;\n\t var lineObj = getLine(cm.doc, pos.line);\n\t var top = heightAtLine(lineObj) + paddingTop(cm.display);\n\t return {left: left, right: left, top: top, bottom: top + lineObj.height};\n\t }", "function estimateCoords(cm, pos) {\n\t var left = 0, pos = clipPos(cm.doc, pos);\n\t if (!cm.options.lineWrapping) left = charWidth(cm.display) * pos.ch;\n\t var lineObj = getLine(cm.doc, pos.line);\n\t var top = heightAtLine(lineObj) + paddingTop(cm.display);\n\t return {left: left, right: left, top: top, bottom: top + lineObj.height};\n\t }", "function estimateCoords(cm, pos) {\n\t var left = 0, pos = clipPos(cm.doc, pos);\n\t if (!cm.options.lineWrapping) left = charWidth(cm.display) * pos.ch;\n\t var lineObj = getLine(cm.doc, pos.line);\n\t var top = heightAtLine(lineObj) + paddingTop(cm.display);\n\t return {left: left, right: left, top: top, bottom: top + lineObj.height};\n\t }", "function posToIndex(pos) {\n var row = pos[0];\n var col = pos[1];\n return (row * 4) + col;\n}", "function estimateCoords(cm, pos) {\r\n var left = 0, pos = clipPos(cm.doc, pos);\r\n if (!cm.options.lineWrapping) left = charWidth(cm.display) * pos.ch;\r\n var lineObj = getLine(cm.doc, pos.line);\r\n var top = heightAtLine(lineObj) + paddingTop(cm.display);\r\n return {left: left, right: left, top: top, bottom: top + lineObj.height};\r\n }", "generatedPositionFor(aArgs) {\n for (let i = 0; i < this._sections.length; i++) {\n const section = this._sections[i]\n\n // Only consider this section if the requested source is in the list of\n // sources of the consumer.\n if (\n section.consumer._findSourceIndex(util.getArg(aArgs, 'source')) === -1\n ) {\n continue\n }\n const generatedPosition = section.consumer.generatedPositionFor(aArgs)\n if (generatedPosition) {\n const ret = {\n line:\n generatedPosition.line +\n (section.generatedOffset.generatedLine - 1),\n column:\n generatedPosition.column +\n (section.generatedOffset.generatedLine === generatedPosition.line\n ? section.generatedOffset.generatedColumn - 1\n : 0),\n }\n return ret\n }\n }\n\n return {\n line: null,\n column: null,\n }\n }", "calculateOffset(offset) {\n\n // Note: vec3 has the same alignment as vec4\n let alignment = this.byteSize <= 8 ? this.byteSize : 16;\n\n // arrays have vec4 alignments\n if (this.count)\n alignment = 16;\n\n // align the start offset\n offset = math.roundUp(offset, alignment);\n this.offset = offset / 4;\n }", "function getPosition(offset, size) {\n return Math.round(-1 * offset + Math.random() * (size + 2 * offset));\n }", "focusOfPosition(pos, rowOffset) {\n const rowIndex = pos.row - rowOffset;\n const row = this._rows[rowIndex];\n if (row === undefined) {\n return undefined;\n }\n if (pos.column < row.marginLeft.length + 1) {\n return new focus_1.Focus(rowIndex, -1, pos.column);\n }\n const cellWidths = row.getCells().map((cell) => cell.rawContent.length);\n let columnPos = row.marginLeft.length + 1; // left margin + a pipe\n let columnIndex = 0;\n for (; columnIndex < cellWidths.length; columnIndex++) {\n if (columnPos + cellWidths[columnIndex] + 1 > pos.column) {\n break;\n }\n columnPos += cellWidths[columnIndex] + 1;\n }\n const offset = pos.column - columnPos;\n return new focus_1.Focus(rowIndex, columnIndex, offset);\n }", "function computeOffset(n, startLine) {\n var pos = 0;\n for (;;) {\n var found = text.indexOf(\"\\n\", pos);\n if (found == -1 || (text.charAt(found-1) == \"\\r\" ? found - 1 : found) >= n)\n return {line: startLine, ch: n - pos};\n ++startLine;\n pos = found + 1;\n }\n }", "function computeOffset(n, startLine) {\n var pos = 0;\n for (;;) {\n var found = text.indexOf(\"\\n\", pos);\n if (found == -1 || (text.charAt(found-1) == \"\\r\" ? found - 1 : found) >= n)\n return {line: startLine, ch: n - pos};\n ++startLine;\n pos = found + 1;\n }\n }", "function computeOffset(n, startLine) {\n var pos = 0;\n for (;;) {\n var found = text.indexOf(\"\\n\", pos);\n if (found == -1 || (text.charAt(found-1) == \"\\r\" ? found - 1 : found) >= n)\n return {line: startLine, ch: n - pos};\n ++startLine;\n pos = found + 1;\n }\n }", "function estimateCoords(cm, pos) {\n\t\t var left = 0;\n\t\t pos = clipPos(cm.doc, pos);\n\t\t if (!cm.options.lineWrapping) { left = charWidth(cm.display) * pos.ch; }\n\t\t var lineObj = getLine(cm.doc, pos.line);\n\t\t var top = heightAtLine(lineObj) + paddingTop(cm.display);\n\t\t return {left: left, right: left, top: top, bottom: top + lineObj.height}\n\t\t }", "function applyStyleOffsets(offset, canvas) {\n var s = calculateStyleOffsets(canvas);\n\n return {\n x: offset.x + s.padding.left + s.border.left + s.html.left,\n y: offset.y + s.padding.top + s.border.top + s.html.top\n };\n }", "originalPositionFor(aArgs) {\n const needle = {\n generatedLine: util.getArg(aArgs, 'line'),\n generatedColumn: util.getArg(aArgs, 'column'),\n }\n\n // Find the section containing the generated position we're trying to map\n // to an original position.\n const sectionIndex = binarySearch.search(\n needle,\n this._sections,\n function (aNeedle, section) {\n const cmp =\n aNeedle.generatedLine - section.generatedOffset.generatedLine\n if (cmp) {\n return cmp\n }\n\n return aNeedle.generatedColumn - section.generatedOffset.generatedColumn\n }\n )\n const section = this._sections[sectionIndex]\n\n if (!section) {\n return {\n source: null,\n line: null,\n column: null,\n name: null,\n }\n }\n\n return section.consumer.originalPositionFor({\n line: needle.generatedLine - (section.generatedOffset.generatedLine - 1),\n column:\n needle.generatedColumn -\n (section.generatedOffset.generatedLine === needle.generatedLine\n ? section.generatedOffset.generatedColumn - 1\n : 0),\n bias: aArgs.bias,\n })\n }", "function estimateCoords(cm, pos) {\n var left = 0\n pos = clipPos(cm.doc, pos)\n if (!cm.options.lineWrapping) { left = charWidth(cm.display) * pos.ch }\n var lineObj = getLine(cm.doc, pos.line)\n var top = heightAtLine(lineObj) + paddingTop(cm.display)\n return {left: left, right: left, top: top, bottom: top + lineObj.height}\n}", "function estimateCoords(cm, pos) {\n var left = 0\n pos = clipPos(cm.doc, pos)\n if (!cm.options.lineWrapping) { left = charWidth(cm.display) * pos.ch }\n var lineObj = getLine(cm.doc, pos.line)\n var top = heightAtLine(lineObj) + paddingTop(cm.display)\n return {left: left, right: left, top: top, bottom: top + lineObj.height}\n}", "lineAt(pos, bias = 1) {\n let line = this.state.doc.lineAt(pos);\n let { simulateBreak, simulateDoubleBreak } = this.options;\n if (simulateBreak != null && simulateBreak >= line.from && simulateBreak <= line.to) {\n if (simulateDoubleBreak && simulateBreak == pos)\n return { text: \"\", from: pos };\n else if (bias < 0 ? simulateBreak < pos : simulateBreak <= pos)\n return { text: line.text.slice(simulateBreak - line.from), from: simulateBreak };\n else\n return { text: line.text.slice(0, simulateBreak - line.from), from: line.from };\n }\n return line;\n }", "function estimateCoords(cm, pos) {\n var left = 0;\n pos = clipPos(cm.doc, pos);\n if (!cm.options.lineWrapping) { left = charWidth(cm.display) * pos.ch; }\n var lineObj = getLine(cm.doc, pos.line);\n var top = heightAtLine(lineObj) + paddingTop(cm.display);\n return {left: left, right: left, top: top, bottom: top + lineObj.height}\n }", "function estimateCoords(cm, pos) {\n var left = 0;\n pos = clipPos(cm.doc, pos);\n if (!cm.options.lineWrapping) { left = charWidth(cm.display) * pos.ch; }\n var lineObj = getLine(cm.doc, pos.line);\n var top = heightAtLine(lineObj) + paddingTop(cm.display);\n return {left: left, right: left, top: top, bottom: top + lineObj.height}\n }", "function estimateCoords(cm, pos) {\n var left = 0;\n pos = clipPos(cm.doc, pos);\n if (!cm.options.lineWrapping) { left = charWidth(cm.display) * pos.ch; }\n var lineObj = getLine(cm.doc, pos.line);\n var top = heightAtLine(lineObj) + paddingTop(cm.display);\n return {left: left, right: left, top: top, bottom: top + lineObj.height}\n }" ]
[ "0.7075349", "0.7075349", "0.7075349", "0.69795245", "0.69795245", "0.6974238", "0.6974238", "0.68666387", "0.68666387", "0.68666387", "0.68666387", "0.68666387", "0.6756182", "0.6611567", "0.6542188", "0.64920235", "0.64521325", "0.64521325", "0.64428896", "0.6439124", "0.63396573", "0.6223099", "0.6145379", "0.61399883", "0.6014435", "0.60124534", "0.60066587", "0.60066587", "0.60034055", "0.60034055", "0.59987825", "0.59987825", "0.5991524", "0.5991086", "0.5991086", "0.59875906", "0.59875906", "0.59875906", "0.59875906", "0.59875906", "0.59875906", "0.59875906", "0.59875906", "0.59875906", "0.59875906", "0.59662807", "0.5951814", "0.5938621", "0.590761", "0.59012866", "0.58732915", "0.5859827", "0.5822497", "0.5755895", "0.5755895", "0.5629568", "0.56168336", "0.56152815", "0.5559919", "0.5496719", "0.54824513", "0.54824513", "0.54824513", "0.54824513", "0.54824513", "0.5469438", "0.5445123", "0.5437863", "0.5437863", "0.5437863", "0.5437863", "0.5437863", "0.5437863", "0.5437863", "0.5437863", "0.5433793", "0.54290974", "0.5426756", "0.5426756", "0.5426756", "0.5417588", "0.54153043", "0.5408804", "0.5406938", "0.54061985", "0.5404499", "0.5389263", "0.5389263", "0.5389263", "0.53753656", "0.53717107", "0.5371107", "0.536904", "0.536904", "0.5360935", "0.53555685", "0.53555685", "0.53555685" ]
0.7002797
5
Get the line and columnbased `position` for `offset` in the bound indices.
function offsetToPosition(offset) { var index = -1 var length = indices.length if (offset < 0) { return {} } while (++index < length) { if (indices[index] > offset) { return { line: index + 1, column: offset - (indices[index - 1] || 0) + 1, offset: offset } } } return {} }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "getLineAndColumnFromChunk(offset) {\r\n\t\t\t\tvar column, columnCompensation, compensation, lastLine, lineCount, previousLinesCompensation, ref, string;\r\n\t\t\t\tcompensation = this.getLocationDataCompensation(this.chunkOffset, this.chunkOffset + offset);\r\n\t\t\t\tif (offset === 0) {\r\n\t\t\t\t\treturn [this.chunkLine, this.chunkColumn + compensation, this.chunkOffset + compensation];\r\n\t\t\t\t}\r\n\t\t\t\tif (offset >= this.chunk.length) {\r\n\t\t\t\t\tstring = this.chunk;\r\n\t\t\t\t} else {\r\n\t\t\t\t\tstring = this.chunk.slice(0, +(offset - 1) + 1 || 9e9);\r\n\t\t\t\t}\r\n\t\t\t\tlineCount = count(string, '\\n');\r\n\t\t\t\tcolumn = this.chunkColumn;\r\n\t\t\t\tif (lineCount > 0) {\r\n\t\t\t\t\tref = string.split('\\n'), [lastLine] = slice.call(ref, -1);\r\n\t\t\t\t\tcolumn = lastLine.length;\r\n\t\t\t\t\tpreviousLinesCompensation = this.getLocationDataCompensation(this.chunkOffset, this.chunkOffset + offset - column);\r\n\t\t\t\t\tif (previousLinesCompensation < 0) {\r\n\t\t\t\t\t\t// Don't recompensate for initially inserted newline.\r\n\t\t\t\t\t\tpreviousLinesCompensation = 0;\r\n\t\t\t\t\t}\r\n\t\t\t\t\tcolumnCompensation = this.getLocationDataCompensation(this.chunkOffset + offset + previousLinesCompensation - column, this.chunkOffset + offset + previousLinesCompensation);\r\n\t\t\t\t} else {\r\n\t\t\t\t\tcolumn += string.length;\r\n\t\t\t\t\tcolumnCompensation = compensation;\r\n\t\t\t\t}\r\n\t\t\t\treturn [this.chunkLine + lineCount, column + columnCompensation, this.chunkOffset + offset + compensation];\r\n\t\t\t}", "function offsetToPoint(offset) {\n var index = -1\n var length = indices.length\n\n if (offset < 0) {\n return {}\n }\n\n while (++index < length) {\n if (indices[index] > offset) {\n return {\n line: index + 1,\n column: offset - (indices[index - 1] || 0) + 1,\n offset: offset\n }\n }\n }\n\n return {}\n }", "function offsetToPoint(offset) {\n var index = -1\n\n if (offset > -1 && offset < indices[indices.length - 1]) {\n while (++index < indices.length) {\n if (indices[index] > offset) {\n return {\n line: index + 1,\n column: offset - (indices[index - 1] || 0) + 1,\n offset: offset\n }\n }\n }\n }\n\n return {}\n }", "function offsetToPoint(offset) {\n var index = -1\n\n if (offset > -1 && offset < indices[indices.length - 1]) {\n while (++index < indices.length) {\n if (indices[index] > offset) {\n return {\n line: index + 1,\n column: offset - (indices[index - 1] || 0) + 1,\n offset: offset\n }\n }\n }\n }\n\n return {}\n }", "function offsetToPoint(offset) {\n var index = -1;\n\n if (offset > -1 && offset < indices[indices.length - 1]) {\n while (++index < indices.length) {\n if (indices[index] > offset) {\n return {\n line: index + 1,\n column: offset - (indices[index - 1] || 0) + 1,\n offset: offset\n }\n }\n }\n }\n\n return {}\n }", "function positionToOffsetFactory(indices) {\n return positionToOffset\n\n // Get the `offset` for a line and column-based `position` in the bound\n // indices.\n function positionToOffset(position) {\n var line = position && position.line\n var column = position && position.column\n\n if (!isNaN(line) && !isNaN(column) && line - 1 in indices) {\n return (indices[line - 2] || 0) + column - 1 || 0\n }\n\n return -1\n }\n}", "function positionToOffsetFactory(indices) {\n return positionToOffset\n\n // Get the `offset` for a line and column-based `position` in the bound\n // indices.\n function positionToOffset(position) {\n var line = position && position.line\n var column = position && position.column\n\n if (!isNaN(line) && !isNaN(column) && line - 1 in indices) {\n return (indices[line - 2] || 0) + column - 1 || 0\n }\n\n return -1\n }\n}", "function positionToOffsetFactory(indices) {\n return positionToOffset\n\n // Get the `offset` for a line and column-based `position` in the bound\n // indices.\n function positionToOffset(position) {\n var line = position && position.line\n var column = position && position.column\n\n if (!isNaN(line) && !isNaN(column) && line - 1 in indices) {\n return (indices[line - 2] || 0) + column - 1 || 0\n }\n\n return -1\n }\n}", "positionAt(offset) {\n return (0, utils_1.positionAt)(offset, this.getText(), this.getLineOffsets());\n }", "cell_from_offset(sizes, offset) {\n // We explore the grid in both directions, starting from the origin.\n let index = 0;\n const original_offset = offset;\n if (offset === 0) {\n return [index, 0];\n }\n // The following two loops have been kept separate to increase readability.\n // Explore to the right or bottom...\n while (offset >= 0) {\n const size = this.cell_size(sizes, index);\n if (offset < size) {\n return [index, original_offset - offset];\n }\n offset -= size;\n ++index;\n }\n // Explore to the left or top...\n while (offset <= 0) {\n --index;\n const size = this.cell_size(sizes, index);\n if (Math.abs(offset) < size) {\n return [index, original_offset - (offset + size)];\n }\n offset += size;\n }\n }", "function positionToOffsetFactory(indices) {\n return positionToOffset\n\n /* Get the `offset` for a line and column-based\n * `position` in the bound indices. */\n function positionToOffset(position) {\n var line = position && position.line\n var column = position && position.column\n\n if (!isNaN(line) && !isNaN(column) && line - 1 in indices) {\n return (indices[line - 2] || 0) + column - 1 || 0\n }\n\n return -1\n }\n}", "function positionToOffsetFactory(indices) {\n return positionToOffset\n\n /* Get the `offset` for a line and column-based\n * `position` in the bound indices. */\n function positionToOffset(position) {\n var line = position && position.line\n var column = position && position.column\n\n if (!isNaN(line) && !isNaN(column) && line - 1 in indices) {\n return (indices[line - 2] || 0) + column - 1 || 0\n }\n\n return -1\n }\n}", "function offsetToPositionFactory(indices) {\n return offsetToPosition\n\n // Get the line and column-based `position` for `offset` in the bound indices.\n function offsetToPosition(offset) {\n var index = -1\n var length = indices.length\n\n if (offset < 0) {\n return {}\n }\n\n while (++index < length) {\n if (indices[index] > offset) {\n return {\n line: index + 1,\n column: offset - (indices[index - 1] || 0) + 1,\n offset: offset\n }\n }\n }\n\n return {}\n }\n}", "function offsetToPositionFactory(indices) {\n return offsetToPosition\n\n // Get the line and column-based `position` for `offset` in the bound indices.\n function offsetToPosition(offset) {\n var index = -1\n var length = indices.length\n\n if (offset < 0) {\n return {}\n }\n\n while (++index < length) {\n if (indices[index] > offset) {\n return {\n line: index + 1,\n column: offset - (indices[index - 1] || 0) + 1,\n offset: offset\n }\n }\n }\n\n return {}\n }\n}", "function offsetToPositionFactory(indices) {\n return offsetToPosition\n\n // Get the line and column-based `position` for `offset` in the bound indices.\n function offsetToPosition(offset) {\n var index = -1\n var length = indices.length\n\n if (offset < 0) {\n return {}\n }\n\n while (++index < length) {\n if (indices[index] > offset) {\n return {\n line: index + 1,\n column: offset - (indices[index - 1] || 0) + 1,\n offset: offset\n }\n }\n }\n\n return {}\n }\n}", "col_row_offset_from_offset(offset) {\n return [\n this.cell_from_offset(this.cell_width, offset.left),\n this.cell_from_offset(this.cell_height, offset.top),\n ];\n }", "function offsetToPositionFactory(indices) {\n return offsetToPosition\n\n /* Get the line and column-based `position` for\n * `offset` in the bound indices. */\n function offsetToPosition(offset) {\n var index = -1\n var length = indices.length\n\n if (offset < 0) {\n return {}\n }\n\n while (++index < length) {\n if (indices[index] > offset) {\n return {\n line: index + 1,\n column: offset - (indices[index - 1] || 0) + 1,\n offset: offset\n }\n }\n }\n\n return {}\n }\n}", "function offsetToPositionFactory(indices) {\n return offsetToPosition\n\n /* Get the line and column-based `position` for\n * `offset` in the bound indices. */\n function offsetToPosition(offset) {\n var index = -1\n var length = indices.length\n\n if (offset < 0) {\n return {}\n }\n\n while (++index < length) {\n if (indices[index] > offset) {\n return {\n line: index + 1,\n column: offset - (indices[index - 1] || 0) + 1,\n offset: offset\n }\n }\n }\n\n return {}\n }\n}", "position_from_offset(offset) {\n const [col, row] = this.col_row_from_offset(offset);\n return new Position(col, row);\n }", "function getLineInfo(input, offset) {\n for (var line = 1, cur = 0;;) {\n lineBreakG.lastIndex = cur\n var match = lineBreakG.exec(input)\n if (match && match.index < offset) {\n ++line\n cur = match.index + match[0].length\n } else {\n return new Position(line, offset - cur)\n }\n }\n}", "function getLineInfo(input, offset) {\n for (var line = 1, cur = 0;;) {\n lineBreakG.lastIndex = cur\n var match = lineBreakG.exec(input)\n if (match && match.index < offset) {\n ++line\n cur = match.index + match[0].length\n } else {\n return new Position(line, offset - cur)\n }\n }\n}", "function getLineInfo(input, offset) {\n for (var line = 1, cur = 0;;) {\n lineBreakG.lastIndex = cur;\n var match = lineBreakG.exec(input);\n if (match && match.index < offset) {\n ++line;\n cur = match.index + match[0].length;\n } else {\n return new Position(line, offset - cur);\n }\n }\n}", "function getLineInfo(input, offset) {\n for (var line = 1, cur = 0;;) {\n lineBreakG.lastIndex = cur;\n var match = lineBreakG.exec(input);\n if (match && match.index < offset) {\n ++line;\n cur = match.index + match[0].length;\n } else {\n return new Position(line, offset - cur);\n }\n }\n}", "function getLineInfo(input, offset) {\n for (var line = 1, cur = 0;;) {\n lineBreakG.lastIndex = cur;\n var match = lineBreakG.exec(input);\n if (match && match.index < offset) {\n ++line;\n cur = match.index + match[0].length;\n } else {\n return new Position(line, offset - cur)\n }\n }\n}", "function getLineInfo(input, offset) {\n for (var line = 1, cur = 0;;) {\n lineBreakG.lastIndex = cur;\n var match = lineBreakG.exec(input);\n if (match && match.index < offset) {\n ++line;\n cur = match.index + match[0].length;\n } else {\n return new Position(line, offset - cur)\n }\n }\n}", "function getLineInfo(input, offset) {\n for (var line = 1, cur = 0;;) {\n lineBreakG.lastIndex = cur;\n var match = lineBreakG.exec(input);\n if (match && match.index < offset) {\n ++line;\n cur = match.index + match[0].length;\n } else {\n return new Position(line, offset - cur)\n }\n }\n}", "function getLineInfo(input, offset) {\n for (var line = 1, cur = 0;;) {\n lineBreakG.lastIndex = cur;\n var match = lineBreakG.exec(input);\n if (match && match.index < offset) {\n ++line;\n cur = match.index + match[0].length;\n } else {\n return new Position(line, offset - cur)\n }\n }\n}", "function getLineInfo(input, offset) {\n for (var line = 1, cur = 0;;) {\n lineBreakG.lastIndex = cur;\n var match = lineBreakG.exec(input);\n if (match && match.index < offset) {\n ++line;\n cur = match.index + match[0].length;\n } else {\n return new Position(line, offset - cur)\n }\n }\n}", "function getLineInfo(input, offset) {\n for (var line = 1, cur = 0;;) {\n lineBreakG.lastIndex = cur;\n var match = lineBreakG.exec(input);\n if (match && match.index < offset) {\n ++line;\n cur = match.index + match[0].length;\n } else {\n return new Position(line, offset - cur)\n }\n }\n}", "function getLineInfo(input, offset) {\n for (var line = 1, cur = 0;;) {\n lineBreakG.lastIndex = cur;\n var match = lineBreakG.exec(input);\n if (match && match.index < offset) {\n ++line;\n cur = match.index + match[0].length;\n } else {\n return new Position(line, offset - cur)\n }\n }\n}", "function getLineInfo(input, offset) {\n for (var line = 1, cur = 0;;) {\n lineBreakG.lastIndex = cur;\n var match = lineBreakG.exec(input);\n if (match && match.index < offset) {\n ++line;\n cur = match.index + match[0].length;\n } else {\n return new Position(line, offset - cur)\n }\n }\n}", "function getLineInfo(input, offset) {\n for (var line = 1, cur = 0;;) {\n lineBreakG.lastIndex = cur;\n var match = lineBreakG.exec(input);\n if (match && match.index < offset) {\n ++line;\n cur = match.index + match[0].length;\n } else {\n return new Position(line, offset - cur)\n }\n }\n}", "function getLineInfo(input, offset) {\n for (var line = 1, cur = 0;;) {\n lineBreakG.lastIndex = cur;\n var match = lineBreakG.exec(input);\n if (match && match.index < offset) {\n ++line;\n cur = match.index + match[0].length;\n } else {\n return new Position(line, offset - cur)\n }\n }\n}", "function getLineInfo(input, offset) {\n for (var line = 1, cur = 0;;) {\n lineBreakG.lastIndex = cur;\n var match = lineBreakG.exec(input);\n\n if (match && match.index < offset) {\n ++line;\n cur = match.index + match[0].length;\n } else {\n return new Position(line, offset - cur);\n }\n }\n }", "function getLineInfo(input, offset) {\n for (var line = 1, cur = 0;;) {\n lineBreakG.lastIndex = cur;\n var match = lineBreakG.exec(input);\n if (match && match.index < offset) {\n ++line;\n cur = match.index + match[0].length;\n } else {\n return new Position(line, offset - cur)\n }\n }\n }", "function getLineInfo(input, offset) {\n for (var line = 1, cur = 0;;) {\n lineBreakG.lastIndex = cur;\n var match = lineBreakG.exec(input);\n if (match && match.index < offset) {\n ++line;\n cur = match.index + match[0].length;\n } else {\n return new Position(line, offset - cur)\n }\n }\n }", "function getLineInfo(input, offset) {\n\t for (var line = 1, cur = 0;;) {\n\t lineBreakG.lastIndex = cur;\n\t var match = lineBreakG.exec(input);\n\t if (match && match.index < offset) {\n\t ++line;\n\t cur = match.index + match[0].length;\n\t } else {\n\t return new Position(line, offset - cur);\n\t }\n\t }\n\t}", "function getLineInfo(input, offset) {\n\t for (var line = 1, cur = 0;;) {\n\t lineBreakG.lastIndex = cur;\n\t var match = lineBreakG.exec(input);\n\t if (match && match.index < offset) {\n\t ++line;\n\t cur = match.index + match[0].length;\n\t } else {\n\t return new Position(line, offset - cur);\n\t }\n\t }\n\t}", "function pointToOffsetFactory(indices) {\n return pointToOffset\n\n // Get the `offset` for a line and column-based `point` in the bound\n // indices.\n function pointToOffset(point) {\n var line = point && point.line\n var column = point && point.column\n\n if (!isNaN(line) && !isNaN(column) && line - 1 in indices) {\n return (indices[line - 2] || 0) + column - 1 || 0\n }\n\n return -1\n }\n}", "offset_from_position(position) {\n const offset = Offset.zero();\n\n // We attempt to explore in each of the four directions in turn.\n // These four loops could be simplified, but have been left as-is to aid readability.\n\n if (position.x > 0) {\n for (let col = 0; col < Math.floor(position.x); ++col) {\n offset.left += this.cell_size(this.cell_width, col);\n }\n offset.left\n += this.cell_size(this.cell_width, Math.floor(position.x)) * (position.x % 1);\n }\n if (position.x < 0) {\n for (let col = -1; col >= position.x; --col) {\n offset.left -= this.cell_size(this.cell_width, col);\n }\n offset.left\n += this.cell_size(this.cell_width, Math.floor(position.x)) * (position.x % 1);\n }\n\n if (position.y > 0) {\n for (let row = 0; row < Math.floor(position.y); ++row) {\n offset.top += this.cell_size(this.cell_height, row);\n }\n offset.top\n += this.cell_size(this.cell_height, Math.floor(position.y)) * (position.y % 1);\n }\n if (position.y < 0) {\n for (let row = -1; row >= position.y; --row) {\n offset.top -= this.cell_size(this.cell_height, row);\n }\n offset.top\n += this.cell_size(this.cell_height, Math.floor(position.y)) * (position.y % 1);\n }\n\n return offset;\n }", "col_row_from_offset(offset) {\n return this.col_row_offset_from_offset(offset).map(([index, _]) => index);\n }", "function grid_from_offset(pos){\n\t \tvar location = {\n\t \t\tcol: Math.floor(pos.left/tileWidth) + 1,\n\t \t\trow: Math.floor(pos.top/tileHeight) + 1\n\t \t}\n\t \treturn location;\n\t }", "getPositionFromDOMInfo(spanNode, offset) {\n const viewLineDomNode = this._getViewLineDomNode(spanNode);\n if (viewLineDomNode === null) {\n // Couldn't find view line node\n return null;\n }\n const lineNumber = this._getLineNumberFor(viewLineDomNode);\n if (lineNumber === -1) {\n // Couldn't find view line node\n return null;\n }\n if (lineNumber < 1 || lineNumber > this._context.model.getLineCount()) {\n // lineNumber is outside range\n return null;\n }\n if (this._context.model.getLineMaxColumn(lineNumber) === 1) {\n // Line is empty\n return new position_1.Position(lineNumber, 1);\n }\n const rendStartLineNumber = this._visibleLines.getStartLineNumber();\n const rendEndLineNumber = this._visibleLines.getEndLineNumber();\n if (lineNumber < rendStartLineNumber || lineNumber > rendEndLineNumber) {\n // Couldn't find line\n return null;\n }\n let column = this._visibleLines.getVisibleLine(lineNumber).getColumnOfNodeOffset(lineNumber, spanNode, offset);\n const minColumn = this._context.model.getLineMinColumn(lineNumber);\n if (column < minColumn) {\n column = minColumn;\n }\n return new position_1.Position(lineNumber, column);\n }", "function getLineInfo(input, offset) {\n for (var line = 1, cur = 0;;) {\n var nextBreak = nextLineBreak(input, cur, offset);\n if (nextBreak < 0) { return new Position(line, offset - cur) }\n ++line;\n cur = nextBreak;\n }\n}", "function getLineInfo(input, offset) {\n for (var line = 1, cur = 0;;) {\n var nextBreak = nextLineBreak(input, cur, offset);\n if (nextBreak < 0) { return new Position(line, offset - cur) }\n ++line;\n cur = nextBreak;\n }\n }", "function offset_function(_, i){\n var x = -0.5 + ( Math.floor(i / num_cell) ) / num_cell ;\n var y = -0.5 + (i % num_cell) / num_cell ;\n return [x, y];\n }", "function computeOffset(position, data) {\n let line = position.line;\n let column = position.column + 1;\n for (let i = 0; i < data.length; i++) {\n if (line > 1) {\n /* not yet on the correct line */\n if (data[i] === \"\\n\") {\n line--;\n }\n }\n else if (column > 1) {\n /* not yet on the correct column */\n column--;\n }\n else {\n /* line/column found, return current position */\n return i;\n }\n }\n /* istanbul ignore next: should never reach this line unless espree passes bad\n * positions, no sane way to test */\n throw new Error(\"Failed to compute location offset from position\");\n}", "function getLineInfo(input, offset) {\n\t for (var line = 1, cur = 0;;) {\n\t _whitespace.lineBreakG.lastIndex = cur;\n\t var match = _whitespace.lineBreakG.exec(input);\n\t if (match && match.index < offset) {\n\t ++line;\n\t cur = match.index + match[0].length;\n\t } else {\n\t return new Position(line, offset - cur);\n\t }\n\t }\n\t}", "function getLineInfo(input, offset) {\n\t for (var line = 1, cur = 0;;) {\n\t _whitespace.lineBreakG.lastIndex = cur;\n\t var match = _whitespace.lineBreakG.exec(input);\n\t if (match && match.index < offset) {\n\t ++line;\n\t cur = match.index + match[0].length;\n\t } else {\n\t return new Position(line, offset - cur);\n\t }\n\t }\n\t}", "function positionToOffset(position) {\n var line = position && position.line\n var column = position && position.column\n\n if (!isNaN(line) && !isNaN(column) && line - 1 in indices) {\n return (indices[line - 2] || 0) + column - 1 || 0\n }\n\n return -1\n }", "function positionToOffset(position) {\n var line = position && position.line\n var column = position && position.column\n\n if (!isNaN(line) && !isNaN(column) && line - 1 in indices) {\n return (indices[line - 2] || 0) + column - 1 || 0\n }\n\n return -1\n }", "function positionToOffset(position) {\n var line = position && position.line\n var column = position && position.column\n\n if (!isNaN(line) && !isNaN(column) && line - 1 in indices) {\n return (indices[line - 2] || 0) + column - 1 || 0\n }\n\n return -1\n }", "function positionToOffset(position) {\n var line = position && position.line\n var column = position && position.column\n\n if (!isNaN(line) && !isNaN(column) && line - 1 in indices) {\n return (indices[line - 2] || 0) + column - 1 || 0\n }\n\n return -1\n }", "function positionToOffset(position) {\n var line = position && position.line\n var column = position && position.column\n\n if (!isNaN(line) && !isNaN(column) && line - 1 in indices) {\n return (indices[line - 2] || 0) + column - 1 || 0\n }\n\n return -1\n }", "function offsetToPointFactory(indices) {\n return offsetToPoint\n\n // Get the line and column-based `point` for `offset` in the bound indices.\n function offsetToPoint(offset) {\n var index = -1\n var length = indices.length\n\n if (offset < 0) {\n return {}\n }\n\n while (++index < length) {\n if (indices[index] > offset) {\n return {\n line: index + 1,\n column: offset - (indices[index - 1] || 0) + 1,\n offset: offset\n }\n }\n }\n\n return {}\n }\n}", "getCurrentLocation(offset) {\n if (!this.options.sourceCodeLocationInfo) {\n return null;\n }\n return {\n startLine: this.preprocessor.line,\n startCol: this.preprocessor.col - offset,\n startOffset: this.preprocessor.offset - offset,\n endLine: -1,\n endCol: -1,\n endOffset: -1,\n };\n }", "function xyOffsetIndex(i, x, y, w, h) {\n var index = i + x + y * w;\n var absx = (i % w) + x;\n if (absx < 0 && index < 0 || absx >= w && index >= w * h) {\n return i - x - y * w;\n }\n if (absx < 0 || absx >= w) { // if off the left.\n return i - x + y * w;\n }\n //var absy = index - (w * y)\n if (index < 0 || index >= w * h) { // if off top/bottom.\n return i + x - y * w;\n }\n return index;\n}", "offset() {\n if (this.overlap) return this.dot ? 8 : 12;\n return this.dot ? 2 : 4;\n }", "function computeInOffsetByIndex(x, y, index) {\n var outx = x + 15;\n var outy = y + 47 + index * 20;\n\n return { x: outx, y: outy };\n}", "positionAt(offset) {\n const before = this.textDocument.slice(0, offset);\n const newLines = before.match(/\\n/g);\n const line = newLines ? newLines.length : 0;\n const preCharacters = before.match(/(\\n|^).*$/g);\n return new tokenizer_1.Position(line, preCharacters ? preCharacters[0].length : 0);\n }", "function getLocation(source, position) {\n let lastLineStart = 0;\n let line = 1;\n\n for (const match of source.body.matchAll(LineRegExp)) {\n typeof match.index === 'number' || invariant(false);\n\n if (match.index >= position) {\n break;\n }\n\n lastLineStart = match.index + match[0].length;\n line += 1;\n }\n\n return {\n line,\n column: position + 1 - lastLineStart,\n };\n}", "function posToIndex(pos) {\n var row = pos[0];\n var col = pos[1];\n return (row * 4) + col;\n}", "function getLineElementsAtPageOffset(offset) {\n\t\tconst lines = document.getElementsByClassName('code-line');\n\t\tconst position = offset - window.scrollY;\n\t\tlet previous = null;\n\t\tfor (const element of lines) {\n\t\t\tconst line = +element.getAttribute('data-line');\n\t\t\tif (isNaN(line)) {\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tconst bounds = element.getBoundingClientRect();\n\t\t\tconst entry = { element, line };\n\t\t\tif (position < bounds.top) {\n\t\t\t\tif (previous && previous.fractional < 1) {\n\t\t\t\t\tprevious.line += previous.fractional;\n\t\t\t\t\treturn { previous };\n\t\t\t\t}\n\t\t\t\treturn { previous, next: entry };\n\t\t\t}\n\t\t\tentry.fractional = (position - bounds.top) / (bounds.height);\n\t\t\tprevious = entry;\n\t\t}\n\t\treturn { previous };\n\t}", "getCursorPosition (offset = true) {\n return this.api.getCursorPosition(offset)\n }", "findTokenIndexAtOffset(offset) {\r\n return LineTokens.findIndexInTokensArray(this._tokens, offset);\r\n }", "offsetAt(position) {\n return (0, utils_1.offsetAt)(position, this.getText(), this.getLineOffsets());\n }", "function estimateCoords(cm, pos) {\n var left = 0, pos = clipPos(cm.doc, pos);\n if (!cm.options.lineWrapping) left = charWidth(cm.display) * pos.ch;\n var lineObj = getLine(cm.doc, pos.line);\n var top = heightAtLine(lineObj) + paddingTop(cm.display);\n return {left: left, right: left, top: top, bottom: top + lineObj.height};\n }", "function estimateCoords(cm, pos) {\n var left = 0, pos = clipPos(cm.doc, pos);\n if (!cm.options.lineWrapping) left = charWidth(cm.display) * pos.ch;\n var lineObj = getLine(cm.doc, pos.line);\n var top = heightAtLine(lineObj) + paddingTop(cm.display);\n return {left: left, right: left, top: top, bottom: top + lineObj.height};\n }", "function estimateCoords(cm, pos) {\n var left = 0, pos = clipPos(cm.doc, pos);\n if (!cm.options.lineWrapping) left = charWidth(cm.display) * pos.ch;\n var lineObj = getLine(cm.doc, pos.line);\n var top = heightAtLine(lineObj) + paddingTop(cm.display);\n return {left: left, right: left, top: top, bottom: top + lineObj.height};\n }", "function estimateCoords(cm, pos) {\n var left = 0, pos = clipPos(cm.doc, pos);\n if (!cm.options.lineWrapping) left = charWidth(cm.display) * pos.ch;\n var lineObj = getLine(cm.doc, pos.line);\n var top = heightAtLine(lineObj) + paddingTop(cm.display);\n return {left: left, right: left, top: top, bottom: top + lineObj.height};\n }", "function estimateCoords(cm, pos) {\n var left = 0, pos = clipPos(cm.doc, pos);\n if (!cm.options.lineWrapping) left = charWidth(cm.display) * pos.ch;\n var lineObj = getLine(cm.doc, pos.line);\n var top = heightAtLine(lineObj) + paddingTop(cm.display);\n return {left: left, right: left, top: top, bottom: top + lineObj.height};\n }", "function estimateCoords(cm, pos) {\n var left = 0, pos = clipPos(cm.doc, pos);\n if (!cm.options.lineWrapping) left = charWidth(cm.display) * pos.ch;\n var lineObj = getLine(cm.doc, pos.line);\n var top = heightAtLine(lineObj) + paddingTop(cm.display);\n return {left: left, right: left, top: top, bottom: top + lineObj.height};\n }", "function estimateCoords(cm, pos) {\n var left = 0, pos = clipPos(cm.doc, pos);\n if (!cm.options.lineWrapping) left = charWidth(cm.display) * pos.ch;\n var lineObj = getLine(cm.doc, pos.line);\n var top = heightAtLine(lineObj) + paddingTop(cm.display);\n return {left: left, right: left, top: top, bottom: top + lineObj.height};\n }", "function estimateCoords(cm, pos) {\n var left = 0, pos = clipPos(cm.doc, pos);\n if (!cm.options.lineWrapping) left = charWidth(cm.display) * pos.ch;\n var lineObj = getLine(cm.doc, pos.line);\n var top = heightAtLine(lineObj) + paddingTop(cm.display);\n return {left: left, right: left, top: top, bottom: top + lineObj.height};\n }", "function estimateCoords(cm, pos) {\n\t\t var left = 0, pos = clipPos(cm.doc, pos);\n\t\t if (!cm.options.lineWrapping) left = charWidth(cm.display) * pos.ch;\n\t\t var lineObj = getLine(cm.doc, pos.line);\n\t\t var top = heightAtLine(lineObj) + paddingTop(cm.display);\n\t\t return {left: left, right: left, top: top, bottom: top + lineObj.height};\n\t\t }", "function estimateCoords(cm, pos) {\r\n var left = 0, pos = clipPos(cm.doc, pos);\r\n if (!cm.options.lineWrapping) left = charWidth(cm.display) * pos.ch;\r\n var lineObj = getLine(cm.doc, pos.line);\r\n var top = heightAtLine(lineObj) + paddingTop(cm.display);\r\n return {left: left, right: left, top: top, bottom: top + lineObj.height};\r\n }", "function estimateCoords(cm, pos) {\n\t var left = 0, pos = clipPos(cm.doc, pos);\n\t if (!cm.options.lineWrapping) left = charWidth(cm.display) * pos.ch;\n\t var lineObj = getLine(cm.doc, pos.line);\n\t var top = heightAtLine(lineObj) + paddingTop(cm.display);\n\t return {left: left, right: left, top: top, bottom: top + lineObj.height};\n\t }", "function estimateCoords(cm, pos) {\n\t var left = 0, pos = clipPos(cm.doc, pos);\n\t if (!cm.options.lineWrapping) left = charWidth(cm.display) * pos.ch;\n\t var lineObj = getLine(cm.doc, pos.line);\n\t var top = heightAtLine(lineObj) + paddingTop(cm.display);\n\t return {left: left, right: left, top: top, bottom: top + lineObj.height};\n\t }", "function estimateCoords(cm, pos) {\n\t var left = 0, pos = clipPos(cm.doc, pos);\n\t if (!cm.options.lineWrapping) left = charWidth(cm.display) * pos.ch;\n\t var lineObj = getLine(cm.doc, pos.line);\n\t var top = heightAtLine(lineObj) + paddingTop(cm.display);\n\t return {left: left, right: left, top: top, bottom: top + lineObj.height};\n\t }", "function estimateCoords(cm, pos) {\n var left = 0\n pos = clipPos(cm.doc, pos)\n if (!cm.options.lineWrapping) { left = charWidth(cm.display) * pos.ch }\n var lineObj = getLine(cm.doc, pos.line)\n var top = heightAtLine(lineObj) + paddingTop(cm.display)\n return {left: left, right: left, top: top, bottom: top + lineObj.height}\n}", "function estimateCoords(cm, pos) {\n var left = 0\n pos = clipPos(cm.doc, pos)\n if (!cm.options.lineWrapping) { left = charWidth(cm.display) * pos.ch }\n var lineObj = getLine(cm.doc, pos.line)\n var top = heightAtLine(lineObj) + paddingTop(cm.display)\n return {left: left, right: left, top: top, bottom: top + lineObj.height}\n}", "function estimateCoords(cm, pos) {\n var left = 0;\n pos = clipPos(cm.doc, pos);\n if (!cm.options.lineWrapping) { left = charWidth(cm.display) * pos.ch; }\n var lineObj = getLine(cm.doc, pos.line);\n var top = heightAtLine(lineObj) + paddingTop(cm.display);\n return {left: left, right: left, top: top, bottom: top + lineObj.height}\n }", "function estimateCoords(cm, pos) {\n var left = 0;\n pos = clipPos(cm.doc, pos);\n if (!cm.options.lineWrapping) { left = charWidth(cm.display) * pos.ch; }\n var lineObj = getLine(cm.doc, pos.line);\n var top = heightAtLine(lineObj) + paddingTop(cm.display);\n return {left: left, right: left, top: top, bottom: top + lineObj.height}\n }", "function estimateCoords(cm, pos) {\n var left = 0;\n pos = clipPos(cm.doc, pos);\n if (!cm.options.lineWrapping) { left = charWidth(cm.display) * pos.ch; }\n var lineObj = getLine(cm.doc, pos.line);\n var top = heightAtLine(lineObj) + paddingTop(cm.display);\n return {left: left, right: left, top: top, bottom: top + lineObj.height}\n }", "function estimateCoords(cm, pos) {\n var left = 0;\n pos = clipPos(cm.doc, pos);\n if (!cm.options.lineWrapping) { left = charWidth(cm.display) * pos.ch; }\n var lineObj = getLine(cm.doc, pos.line);\n var top = heightAtLine(lineObj) + paddingTop(cm.display);\n return {left: left, right: left, top: top, bottom: top + lineObj.height}\n }", "function estimateCoords(cm, pos) {\n var left = 0;\n pos = clipPos(cm.doc, pos);\n if (!cm.options.lineWrapping) { left = charWidth(cm.display) * pos.ch; }\n var lineObj = getLine(cm.doc, pos.line);\n var top = heightAtLine(lineObj) + paddingTop(cm.display);\n return {left: left, right: left, top: top, bottom: top + lineObj.height}\n }", "function estimateCoords(cm, pos) {\n var left = 0;\n pos = clipPos(cm.doc, pos);\n if (!cm.options.lineWrapping) { left = charWidth(cm.display) * pos.ch; }\n var lineObj = getLine(cm.doc, pos.line);\n var top = heightAtLine(lineObj) + paddingTop(cm.display);\n return {left: left, right: left, top: top, bottom: top + lineObj.height}\n }", "function estimateCoords(cm, pos) {\n var left = 0;\n pos = clipPos(cm.doc, pos);\n if (!cm.options.lineWrapping) { left = charWidth(cm.display) * pos.ch; }\n var lineObj = getLine(cm.doc, pos.line);\n var top = heightAtLine(lineObj) + paddingTop(cm.display);\n return {left: left, right: left, top: top, bottom: top + lineObj.height}\n }", "function estimateCoords(cm, pos) {\n var left = 0;\n pos = clipPos(cm.doc, pos);\n if (!cm.options.lineWrapping) { left = charWidth(cm.display) * pos.ch; }\n var lineObj = getLine(cm.doc, pos.line);\n var top = heightAtLine(lineObj) + paddingTop(cm.display);\n return {left: left, right: left, top: top, bottom: top + lineObj.height}\n }", "function estimateCoords(cm, pos) {\n var left = 0;\n pos = clipPos(cm.doc, pos);\n if (!cm.options.lineWrapping) { left = charWidth(cm.display) * pos.ch; }\n var lineObj = getLine(cm.doc, pos.line);\n var top = heightAtLine(lineObj) + paddingTop(cm.display);\n return {left: left, right: left, top: top, bottom: top + lineObj.height}\n }", "function estimateCoords(cm, pos) {\n var left = 0;\n pos = clipPos(cm.doc, pos);\n if (!cm.options.lineWrapping) { left = charWidth(cm.display) * pos.ch; }\n var lineObj = getLine(cm.doc, pos.line);\n var top = heightAtLine(lineObj) + paddingTop(cm.display);\n return {left: left, right: left, top: top, bottom: top + lineObj.height}\n }", "function estimateCoords(cm, pos) {\n var left = 0;\n pos = clipPos(cm.doc, pos);\n if (!cm.options.lineWrapping) { left = charWidth(cm.display) * pos.ch; }\n var lineObj = getLine(cm.doc, pos.line);\n var top = heightAtLine(lineObj) + paddingTop(cm.display);\n return {left: left, right: left, top: top, bottom: top + lineObj.height}\n }", "function estimateCoords(cm, pos) {\n var left = 0;\n pos = clipPos(cm.doc, pos);\n if (!cm.options.lineWrapping) { left = charWidth(cm.display) * pos.ch; }\n var lineObj = getLine(cm.doc, pos.line);\n var top = heightAtLine(lineObj) + paddingTop(cm.display);\n return {left: left, right: left, top: top, bottom: top + lineObj.height}\n }", "function estimateCoords(cm, pos) {\n var left = 0;\n pos = clipPos(cm.doc, pos);\n if (!cm.options.lineWrapping) { left = charWidth(cm.display) * pos.ch; }\n var lineObj = getLine(cm.doc, pos.line);\n var top = heightAtLine(lineObj) + paddingTop(cm.display);\n return {left: left, right: left, top: top, bottom: top + lineObj.height}\n }", "function estimateCoords(cm, pos) {\n var left = 0;\n pos = clipPos(cm.doc, pos);\n if (!cm.options.lineWrapping) { left = charWidth(cm.display) * pos.ch; }\n var lineObj = getLine(cm.doc, pos.line);\n var top = heightAtLine(lineObj) + paddingTop(cm.display);\n return {left: left, right: left, top: top, bottom: top + lineObj.height}\n }", "function estimateCoords(cm, pos) {\n var left = 0;\n pos = clipPos(cm.doc, pos);\n if (!cm.options.lineWrapping) { left = charWidth(cm.display) * pos.ch; }\n var lineObj = getLine(cm.doc, pos.line);\n var top = heightAtLine(lineObj) + paddingTop(cm.display);\n return {left: left, right: left, top: top, bottom: top + lineObj.height}\n }" ]
[ "0.66774505", "0.66699433", "0.6659134", "0.6659134", "0.6652503", "0.6436059", "0.6436059", "0.6436059", "0.64176875", "0.63346153", "0.63327104", "0.63327104", "0.62733066", "0.62733066", "0.62733066", "0.62727237", "0.6262357", "0.6262357", "0.6245017", "0.6240079", "0.6240079", "0.6237874", "0.6237874", "0.622642", "0.622642", "0.622642", "0.622642", "0.622642", "0.622642", "0.622642", "0.622642", "0.622642", "0.622642", "0.62121356", "0.6209085", "0.6209085", "0.6207073", "0.6207073", "0.6084728", "0.6073205", "0.606893", "0.60580945", "0.6054491", "0.6021124", "0.5991708", "0.59368503", "0.5936174", "0.5930157", "0.5930157", "0.5896721", "0.5896721", "0.5896721", "0.5896721", "0.5896721", "0.5872336", "0.58382183", "0.58373815", "0.5833846", "0.58303505", "0.579957", "0.57822436", "0.5774531", "0.5768109", "0.57655674", "0.57201135", "0.5708736", "0.5695129", "0.5695129", "0.5695129", "0.5695129", "0.5695129", "0.5695129", "0.5695129", "0.5695129", "0.5683866", "0.5670205", "0.566922", "0.566922", "0.566922", "0.5627675", "0.5627675", "0.56203306", "0.56203306", "0.56203306", "0.56203306", "0.56203306", "0.56203306", "0.56203306", "0.56203306", "0.56203306", "0.56203306", "0.56203306", "0.56203306", "0.56203306", "0.56203306", "0.56203306" ]
0.70611274
4
Factory to get the `offset` for a line and columnbased `position` in the bound indices.
function positionToOffsetFactory(indices) { return positionToOffset // Get the `offset` for a line and column-based `position` in the bound // indices. function positionToOffset(position) { var line = position && position.line var column = position && position.column if (!isNaN(line) && !isNaN(column) && line - 1 in indices) { return (indices[line - 2] || 0) + column - 1 || 0 } return -1 } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function positionToOffsetFactory(indices) {\n return positionToOffset\n\n /* Get the `offset` for a line and column-based\n * `position` in the bound indices. */\n function positionToOffset(position) {\n var line = position && position.line\n var column = position && position.column\n\n if (!isNaN(line) && !isNaN(column) && line - 1 in indices) {\n return (indices[line - 2] || 0) + column - 1 || 0\n }\n\n return -1\n }\n}", "function positionToOffsetFactory(indices) {\n return positionToOffset\n\n /* Get the `offset` for a line and column-based\n * `position` in the bound indices. */\n function positionToOffset(position) {\n var line = position && position.line\n var column = position && position.column\n\n if (!isNaN(line) && !isNaN(column) && line - 1 in indices) {\n return (indices[line - 2] || 0) + column - 1 || 0\n }\n\n return -1\n }\n}", "function pointToOffsetFactory(indices) {\n return pointToOffset\n\n // Get the `offset` for a line and column-based `point` in the bound\n // indices.\n function pointToOffset(point) {\n var line = point && point.line\n var column = point && point.column\n\n if (!isNaN(line) && !isNaN(column) && line - 1 in indices) {\n return (indices[line - 2] || 0) + column - 1 || 0\n }\n\n return -1\n }\n}", "function offsetToPositionFactory(indices) {\n return offsetToPosition\n\n // Get the line and column-based `position` for `offset` in the bound indices.\n function offsetToPosition(offset) {\n var index = -1\n var length = indices.length\n\n if (offset < 0) {\n return {}\n }\n\n while (++index < length) {\n if (indices[index] > offset) {\n return {\n line: index + 1,\n column: offset - (indices[index - 1] || 0) + 1,\n offset: offset\n }\n }\n }\n\n return {}\n }\n}", "function offsetToPositionFactory(indices) {\n return offsetToPosition\n\n // Get the line and column-based `position` for `offset` in the bound indices.\n function offsetToPosition(offset) {\n var index = -1\n var length = indices.length\n\n if (offset < 0) {\n return {}\n }\n\n while (++index < length) {\n if (indices[index] > offset) {\n return {\n line: index + 1,\n column: offset - (indices[index - 1] || 0) + 1,\n offset: offset\n }\n }\n }\n\n return {}\n }\n}", "function offsetToPositionFactory(indices) {\n return offsetToPosition\n\n // Get the line and column-based `position` for `offset` in the bound indices.\n function offsetToPosition(offset) {\n var index = -1\n var length = indices.length\n\n if (offset < 0) {\n return {}\n }\n\n while (++index < length) {\n if (indices[index] > offset) {\n return {\n line: index + 1,\n column: offset - (indices[index - 1] || 0) + 1,\n offset: offset\n }\n }\n }\n\n return {}\n }\n}", "function offsetToPositionFactory(indices) {\n return offsetToPosition\n\n /* Get the line and column-based `position` for\n * `offset` in the bound indices. */\n function offsetToPosition(offset) {\n var index = -1\n var length = indices.length\n\n if (offset < 0) {\n return {}\n }\n\n while (++index < length) {\n if (indices[index] > offset) {\n return {\n line: index + 1,\n column: offset - (indices[index - 1] || 0) + 1,\n offset: offset\n }\n }\n }\n\n return {}\n }\n}", "function offsetToPositionFactory(indices) {\n return offsetToPosition\n\n /* Get the line and column-based `position` for\n * `offset` in the bound indices. */\n function offsetToPosition(offset) {\n var index = -1\n var length = indices.length\n\n if (offset < 0) {\n return {}\n }\n\n while (++index < length) {\n if (indices[index] > offset) {\n return {\n line: index + 1,\n column: offset - (indices[index - 1] || 0) + 1,\n offset: offset\n }\n }\n }\n\n return {}\n }\n}", "offsetAt(position) {\n return (0, utils_1.offsetAt)(position, this.getText(), this.getLineOffsets());\n }", "function positionToOffset(position) {\n var line = position && position.line\n var column = position && position.column\n\n if (!isNaN(line) && !isNaN(column) && line - 1 in indices) {\n return (indices[line - 2] || 0) + column - 1 || 0\n }\n\n return -1\n }", "function positionToOffset(position) {\n var line = position && position.line\n var column = position && position.column\n\n if (!isNaN(line) && !isNaN(column) && line - 1 in indices) {\n return (indices[line - 2] || 0) + column - 1 || 0\n }\n\n return -1\n }", "function positionToOffset(position) {\n var line = position && position.line\n var column = position && position.column\n\n if (!isNaN(line) && !isNaN(column) && line - 1 in indices) {\n return (indices[line - 2] || 0) + column - 1 || 0\n }\n\n return -1\n }", "function positionToOffset(position) {\n var line = position && position.line\n var column = position && position.column\n\n if (!isNaN(line) && !isNaN(column) && line - 1 in indices) {\n return (indices[line - 2] || 0) + column - 1 || 0\n }\n\n return -1\n }", "function positionToOffset(position) {\n var line = position && position.line\n var column = position && position.column\n\n if (!isNaN(line) && !isNaN(column) && line - 1 in indices) {\n return (indices[line - 2] || 0) + column - 1 || 0\n }\n\n return -1\n }", "offset_from_position(position) {\n const offset = Offset.zero();\n\n // We attempt to explore in each of the four directions in turn.\n // These four loops could be simplified, but have been left as-is to aid readability.\n\n if (position.x > 0) {\n for (let col = 0; col < Math.floor(position.x); ++col) {\n offset.left += this.cell_size(this.cell_width, col);\n }\n offset.left\n += this.cell_size(this.cell_width, Math.floor(position.x)) * (position.x % 1);\n }\n if (position.x < 0) {\n for (let col = -1; col >= position.x; --col) {\n offset.left -= this.cell_size(this.cell_width, col);\n }\n offset.left\n += this.cell_size(this.cell_width, Math.floor(position.x)) * (position.x % 1);\n }\n\n if (position.y > 0) {\n for (let row = 0; row < Math.floor(position.y); ++row) {\n offset.top += this.cell_size(this.cell_height, row);\n }\n offset.top\n += this.cell_size(this.cell_height, Math.floor(position.y)) * (position.y % 1);\n }\n if (position.y < 0) {\n for (let row = -1; row >= position.y; --row) {\n offset.top -= this.cell_size(this.cell_height, row);\n }\n offset.top\n += this.cell_size(this.cell_height, Math.floor(position.y)) * (position.y % 1);\n }\n\n return offset;\n }", "function offsetToPointFactory(indices) {\n return offsetToPoint\n\n // Get the line and column-based `point` for `offset` in the bound indices.\n function offsetToPoint(offset) {\n var index = -1\n var length = indices.length\n\n if (offset < 0) {\n return {}\n }\n\n while (++index < length) {\n if (indices[index] > offset) {\n return {\n line: index + 1,\n column: offset - (indices[index - 1] || 0) + 1,\n offset: offset\n }\n }\n }\n\n return {}\n }\n}", "function offsetToPosition(offset) {\n var index = -1\n var length = indices.length\n\n if (offset < 0) {\n return {}\n }\n\n while (++index < length) {\n if (indices[index] > offset) {\n return {\n line: index + 1,\n column: offset - (indices[index - 1] || 0) + 1,\n offset: offset\n }\n }\n }\n\n return {}\n }", "function offsetToPosition(offset) {\n var index = -1\n var length = indices.length\n\n if (offset < 0) {\n return {}\n }\n\n while (++index < length) {\n if (indices[index] > offset) {\n return {\n line: index + 1,\n column: offset - (indices[index - 1] || 0) + 1,\n offset: offset\n }\n }\n }\n\n return {}\n }", "function offsetToPosition(offset) {\n var index = -1\n var length = indices.length\n\n if (offset < 0) {\n return {}\n }\n\n while (++index < length) {\n if (indices[index] > offset) {\n return {\n line: index + 1,\n column: offset - (indices[index - 1] || 0) + 1,\n offset: offset\n }\n }\n }\n\n return {}\n }", "function offsetToPosition(offset) {\n var index = -1\n var length = indices.length\n\n if (offset < 0) {\n return {}\n }\n\n while (++index < length) {\n if (indices[index] > offset) {\n return {\n line: index + 1,\n column: offset - (indices[index - 1] || 0) + 1,\n offset: offset\n }\n }\n }\n\n return {}\n }", "function offsetToPosition(offset) {\n var index = -1\n var length = indices.length\n\n if (offset < 0) {\n return {}\n }\n\n while (++index < length) {\n if (indices[index] > offset) {\n return {\n line: index + 1,\n column: offset - (indices[index - 1] || 0) + 1,\n offset: offset\n }\n }\n }\n\n return {}\n }", "function computeOffset(position, data) {\n let line = position.line;\n let column = position.column + 1;\n for (let i = 0; i < data.length; i++) {\n if (line > 1) {\n /* not yet on the correct line */\n if (data[i] === \"\\n\") {\n line--;\n }\n }\n else if (column > 1) {\n /* not yet on the correct column */\n column--;\n }\n else {\n /* line/column found, return current position */\n return i;\n }\n }\n /* istanbul ignore next: should never reach this line unless espree passes bad\n * positions, no sane way to test */\n throw new Error(\"Failed to compute location offset from position\");\n}", "function xyOffsetIndex(i, x, y, w, h) {\n var index = i + x + y * w;\n var absx = (i % w) + x;\n if (absx < 0 && index < 0 || absx >= w && index >= w * h) {\n return i - x - y * w;\n }\n if (absx < 0 || absx >= w) { // if off the left.\n return i - x + y * w;\n }\n //var absy = index - (w * y)\n if (index < 0 || index >= w * h) { // if off top/bottom.\n return i + x - y * w;\n }\n return index;\n}", "positionAt(offset) {\n return (0, utils_1.positionAt)(offset, this.getText(), this.getLineOffsets());\n }", "function computeInOffsetByIndex(x, y, index) {\n var outx = x + 15;\n var outy = y + 47 + index * 20;\n\n return { x: outx, y: outy };\n}", "function offsetToPoint(offset) {\n var index = -1\n var length = indices.length\n\n if (offset < 0) {\n return {}\n }\n\n while (++index < length) {\n if (indices[index] > offset) {\n return {\n line: index + 1,\n column: offset - (indices[index - 1] || 0) + 1,\n offset: offset\n }\n }\n }\n\n return {}\n }", "offset() {\n if (this.overlap) return this.dot ? 8 : 12;\n return this.dot ? 2 : 4;\n }", "position_from_offset(offset) {\n const [col, row] = this.col_row_from_offset(offset);\n return new Position(col, row);\n }", "function offsetToPoint(offset) {\n var index = -1\n\n if (offset > -1 && offset < indices[indices.length - 1]) {\n while (++index < indices.length) {\n if (indices[index] > offset) {\n return {\n line: index + 1,\n column: offset - (indices[index - 1] || 0) + 1,\n offset: offset\n }\n }\n }\n }\n\n return {}\n }", "function offsetToPoint(offset) {\n var index = -1\n\n if (offset > -1 && offset < indices[indices.length - 1]) {\n while (++index < indices.length) {\n if (indices[index] > offset) {\n return {\n line: index + 1,\n column: offset - (indices[index - 1] || 0) + 1,\n offset: offset\n }\n }\n }\n }\n\n return {}\n }", "function offsetToPoint(offset) {\n var index = -1;\n\n if (offset > -1 && offset < indices[indices.length - 1]) {\n while (++index < indices.length) {\n if (indices[index] > offset) {\n return {\n line: index + 1,\n column: offset - (indices[index - 1] || 0) + 1,\n offset: offset\n }\n }\n }\n }\n\n return {}\n }", "getLineAndColumnFromChunk(offset) {\r\n\t\t\t\tvar column, columnCompensation, compensation, lastLine, lineCount, previousLinesCompensation, ref, string;\r\n\t\t\t\tcompensation = this.getLocationDataCompensation(this.chunkOffset, this.chunkOffset + offset);\r\n\t\t\t\tif (offset === 0) {\r\n\t\t\t\t\treturn [this.chunkLine, this.chunkColumn + compensation, this.chunkOffset + compensation];\r\n\t\t\t\t}\r\n\t\t\t\tif (offset >= this.chunk.length) {\r\n\t\t\t\t\tstring = this.chunk;\r\n\t\t\t\t} else {\r\n\t\t\t\t\tstring = this.chunk.slice(0, +(offset - 1) + 1 || 9e9);\r\n\t\t\t\t}\r\n\t\t\t\tlineCount = count(string, '\\n');\r\n\t\t\t\tcolumn = this.chunkColumn;\r\n\t\t\t\tif (lineCount > 0) {\r\n\t\t\t\t\tref = string.split('\\n'), [lastLine] = slice.call(ref, -1);\r\n\t\t\t\t\tcolumn = lastLine.length;\r\n\t\t\t\t\tpreviousLinesCompensation = this.getLocationDataCompensation(this.chunkOffset, this.chunkOffset + offset - column);\r\n\t\t\t\t\tif (previousLinesCompensation < 0) {\r\n\t\t\t\t\t\t// Don't recompensate for initially inserted newline.\r\n\t\t\t\t\t\tpreviousLinesCompensation = 0;\r\n\t\t\t\t\t}\r\n\t\t\t\t\tcolumnCompensation = this.getLocationDataCompensation(this.chunkOffset + offset + previousLinesCompensation - column, this.chunkOffset + offset + previousLinesCompensation);\r\n\t\t\t\t} else {\r\n\t\t\t\t\tcolumn += string.length;\r\n\t\t\t\t\tcolumnCompensation = compensation;\r\n\t\t\t\t}\r\n\t\t\t\treturn [this.chunkLine + lineCount, column + columnCompensation, this.chunkOffset + offset + compensation];\r\n\t\t\t}", "positionAt(offset) {\n const before = this.textDocument.slice(0, offset);\n const newLines = before.match(/\\n/g);\n const line = newLines ? newLines.length : 0;\n const preCharacters = before.match(/(\\n|^).*$/g);\n return new tokenizer_1.Position(line, preCharacters ? preCharacters[0].length : 0);\n }", "function getLocation(source, position) {\n let lastLineStart = 0;\n let line = 1;\n\n for (const match of source.body.matchAll(LineRegExp)) {\n typeof match.index === 'number' || invariant(false);\n\n if (match.index >= position) {\n break;\n }\n\n lastLineStart = match.index + match[0].length;\n line += 1;\n }\n\n return {\n line,\n column: position + 1 - lastLineStart,\n };\n}", "function estimateCoords(cm, pos) {\n var left = 0, pos = clipPos(cm.doc, pos);\n if (!cm.options.lineWrapping) left = charWidth(cm.display) * pos.ch;\n var lineObj = getLine(cm.doc, pos.line);\n var top = heightAtLine(lineObj) + paddingTop(cm.display);\n return {left: left, right: left, top: top, bottom: top + lineObj.height};\n }", "function estimateCoords(cm, pos) {\n var left = 0, pos = clipPos(cm.doc, pos);\n if (!cm.options.lineWrapping) left = charWidth(cm.display) * pos.ch;\n var lineObj = getLine(cm.doc, pos.line);\n var top = heightAtLine(lineObj) + paddingTop(cm.display);\n return {left: left, right: left, top: top, bottom: top + lineObj.height};\n }", "function estimateCoords(cm, pos) {\n var left = 0, pos = clipPos(cm.doc, pos);\n if (!cm.options.lineWrapping) left = charWidth(cm.display) * pos.ch;\n var lineObj = getLine(cm.doc, pos.line);\n var top = heightAtLine(lineObj) + paddingTop(cm.display);\n return {left: left, right: left, top: top, bottom: top + lineObj.height};\n }", "function estimateCoords(cm, pos) {\n var left = 0, pos = clipPos(cm.doc, pos);\n if (!cm.options.lineWrapping) left = charWidth(cm.display) * pos.ch;\n var lineObj = getLine(cm.doc, pos.line);\n var top = heightAtLine(lineObj) + paddingTop(cm.display);\n return {left: left, right: left, top: top, bottom: top + lineObj.height};\n }", "function estimateCoords(cm, pos) {\n var left = 0, pos = clipPos(cm.doc, pos);\n if (!cm.options.lineWrapping) left = charWidth(cm.display) * pos.ch;\n var lineObj = getLine(cm.doc, pos.line);\n var top = heightAtLine(lineObj) + paddingTop(cm.display);\n return {left: left, right: left, top: top, bottom: top + lineObj.height};\n }", "function estimateCoords(cm, pos) {\n var left = 0, pos = clipPos(cm.doc, pos);\n if (!cm.options.lineWrapping) left = charWidth(cm.display) * pos.ch;\n var lineObj = getLine(cm.doc, pos.line);\n var top = heightAtLine(lineObj) + paddingTop(cm.display);\n return {left: left, right: left, top: top, bottom: top + lineObj.height};\n }", "function estimateCoords(cm, pos) {\n var left = 0, pos = clipPos(cm.doc, pos);\n if (!cm.options.lineWrapping) left = charWidth(cm.display) * pos.ch;\n var lineObj = getLine(cm.doc, pos.line);\n var top = heightAtLine(lineObj) + paddingTop(cm.display);\n return {left: left, right: left, top: top, bottom: top + lineObj.height};\n }", "function estimateCoords(cm, pos) {\n var left = 0, pos = clipPos(cm.doc, pos);\n if (!cm.options.lineWrapping) left = charWidth(cm.display) * pos.ch;\n var lineObj = getLine(cm.doc, pos.line);\n var top = heightAtLine(lineObj) + paddingTop(cm.display);\n return {left: left, right: left, top: top, bottom: top + lineObj.height};\n }", "function getLineInfo(input, offset) {\n for (var line = 1, cur = 0;;) {\n lineBreakG.lastIndex = cur\n var match = lineBreakG.exec(input)\n if (match && match.index < offset) {\n ++line\n cur = match.index + match[0].length\n } else {\n return new Position(line, offset - cur)\n }\n }\n}", "function getLineInfo(input, offset) {\n for (var line = 1, cur = 0;;) {\n lineBreakG.lastIndex = cur\n var match = lineBreakG.exec(input)\n if (match && match.index < offset) {\n ++line\n cur = match.index + match[0].length\n } else {\n return new Position(line, offset - cur)\n }\n }\n}", "function getLineInfo(input, offset) {\n for (var line = 1, cur = 0;;) {\n lineBreakG.lastIndex = cur;\n var match = lineBreakG.exec(input);\n if (match && match.index < offset) {\n ++line;\n cur = match.index + match[0].length;\n } else {\n return new Position(line, offset - cur);\n }\n }\n}", "function getLineInfo(input, offset) {\n for (var line = 1, cur = 0;;) {\n lineBreakG.lastIndex = cur;\n var match = lineBreakG.exec(input);\n if (match && match.index < offset) {\n ++line;\n cur = match.index + match[0].length;\n } else {\n return new Position(line, offset - cur);\n }\n }\n}", "function estimateCoords(cm, pos) {\r\n var left = 0, pos = clipPos(cm.doc, pos);\r\n if (!cm.options.lineWrapping) left = charWidth(cm.display) * pos.ch;\r\n var lineObj = getLine(cm.doc, pos.line);\r\n var top = heightAtLine(lineObj) + paddingTop(cm.display);\r\n return {left: left, right: left, top: top, bottom: top + lineObj.height};\r\n }", "function estimateCoords(cm, pos) {\n\t\t var left = 0, pos = clipPos(cm.doc, pos);\n\t\t if (!cm.options.lineWrapping) left = charWidth(cm.display) * pos.ch;\n\t\t var lineObj = getLine(cm.doc, pos.line);\n\t\t var top = heightAtLine(lineObj) + paddingTop(cm.display);\n\t\t return {left: left, right: left, top: top, bottom: top + lineObj.height};\n\t\t }", "function estimateCoords(cm, pos) {\n\t var left = 0, pos = clipPos(cm.doc, pos);\n\t if (!cm.options.lineWrapping) left = charWidth(cm.display) * pos.ch;\n\t var lineObj = getLine(cm.doc, pos.line);\n\t var top = heightAtLine(lineObj) + paddingTop(cm.display);\n\t return {left: left, right: left, top: top, bottom: top + lineObj.height};\n\t }", "function estimateCoords(cm, pos) {\n\t var left = 0, pos = clipPos(cm.doc, pos);\n\t if (!cm.options.lineWrapping) left = charWidth(cm.display) * pos.ch;\n\t var lineObj = getLine(cm.doc, pos.line);\n\t var top = heightAtLine(lineObj) + paddingTop(cm.display);\n\t return {left: left, right: left, top: top, bottom: top + lineObj.height};\n\t }", "function estimateCoords(cm, pos) {\n\t var left = 0, pos = clipPos(cm.doc, pos);\n\t if (!cm.options.lineWrapping) left = charWidth(cm.display) * pos.ch;\n\t var lineObj = getLine(cm.doc, pos.line);\n\t var top = heightAtLine(lineObj) + paddingTop(cm.display);\n\t return {left: left, right: left, top: top, bottom: top + lineObj.height};\n\t }", "function getLineInfo(input, offset) {\n for (var line = 1, cur = 0;;) {\n lineBreakG.lastIndex = cur;\n var match = lineBreakG.exec(input);\n if (match && match.index < offset) {\n ++line;\n cur = match.index + match[0].length;\n } else {\n return new Position(line, offset - cur)\n }\n }\n}", "function getLineInfo(input, offset) {\n for (var line = 1, cur = 0;;) {\n lineBreakG.lastIndex = cur;\n var match = lineBreakG.exec(input);\n if (match && match.index < offset) {\n ++line;\n cur = match.index + match[0].length;\n } else {\n return new Position(line, offset - cur)\n }\n }\n}", "function getLineInfo(input, offset) {\n for (var line = 1, cur = 0;;) {\n lineBreakG.lastIndex = cur;\n var match = lineBreakG.exec(input);\n if (match && match.index < offset) {\n ++line;\n cur = match.index + match[0].length;\n } else {\n return new Position(line, offset - cur)\n }\n }\n}", "function getLineInfo(input, offset) {\n for (var line = 1, cur = 0;;) {\n lineBreakG.lastIndex = cur;\n var match = lineBreakG.exec(input);\n if (match && match.index < offset) {\n ++line;\n cur = match.index + match[0].length;\n } else {\n return new Position(line, offset - cur)\n }\n }\n}", "function getLineInfo(input, offset) {\n for (var line = 1, cur = 0;;) {\n lineBreakG.lastIndex = cur;\n var match = lineBreakG.exec(input);\n if (match && match.index < offset) {\n ++line;\n cur = match.index + match[0].length;\n } else {\n return new Position(line, offset - cur)\n }\n }\n}", "function getLineInfo(input, offset) {\n for (var line = 1, cur = 0;;) {\n lineBreakG.lastIndex = cur;\n var match = lineBreakG.exec(input);\n if (match && match.index < offset) {\n ++line;\n cur = match.index + match[0].length;\n } else {\n return new Position(line, offset - cur)\n }\n }\n}", "function getLineInfo(input, offset) {\n for (var line = 1, cur = 0;;) {\n lineBreakG.lastIndex = cur;\n var match = lineBreakG.exec(input);\n if (match && match.index < offset) {\n ++line;\n cur = match.index + match[0].length;\n } else {\n return new Position(line, offset - cur)\n }\n }\n}", "function getLineInfo(input, offset) {\n for (var line = 1, cur = 0;;) {\n lineBreakG.lastIndex = cur;\n var match = lineBreakG.exec(input);\n if (match && match.index < offset) {\n ++line;\n cur = match.index + match[0].length;\n } else {\n return new Position(line, offset - cur)\n }\n }\n}", "function getLineInfo(input, offset) {\n for (var line = 1, cur = 0;;) {\n lineBreakG.lastIndex = cur;\n var match = lineBreakG.exec(input);\n if (match && match.index < offset) {\n ++line;\n cur = match.index + match[0].length;\n } else {\n return new Position(line, offset - cur)\n }\n }\n}", "function getLineInfo(input, offset) {\n for (var line = 1, cur = 0;;) {\n lineBreakG.lastIndex = cur;\n var match = lineBreakG.exec(input);\n if (match && match.index < offset) {\n ++line;\n cur = match.index + match[0].length;\n } else {\n return new Position(line, offset - cur)\n }\n }\n}", "function estimateCoords(cm, pos) {\n var left = 0\n pos = clipPos(cm.doc, pos)\n if (!cm.options.lineWrapping) { left = charWidth(cm.display) * pos.ch }\n var lineObj = getLine(cm.doc, pos.line)\n var top = heightAtLine(lineObj) + paddingTop(cm.display)\n return {left: left, right: left, top: top, bottom: top + lineObj.height}\n}", "function estimateCoords(cm, pos) {\n var left = 0\n pos = clipPos(cm.doc, pos)\n if (!cm.options.lineWrapping) { left = charWidth(cm.display) * pos.ch }\n var lineObj = getLine(cm.doc, pos.line)\n var top = heightAtLine(lineObj) + paddingTop(cm.display)\n return {left: left, right: left, top: top, bottom: top + lineObj.height}\n}", "function estimateCoords(cm, pos) {\n var left = 0;\n pos = clipPos(cm.doc, pos);\n if (!cm.options.lineWrapping) { left = charWidth(cm.display) * pos.ch; }\n var lineObj = getLine(cm.doc, pos.line);\n var top = heightAtLine(lineObj) + paddingTop(cm.display);\n return {left: left, right: left, top: top, bottom: top + lineObj.height}\n }", "function estimateCoords(cm, pos) {\n var left = 0;\n pos = clipPos(cm.doc, pos);\n if (!cm.options.lineWrapping) { left = charWidth(cm.display) * pos.ch; }\n var lineObj = getLine(cm.doc, pos.line);\n var top = heightAtLine(lineObj) + paddingTop(cm.display);\n return {left: left, right: left, top: top, bottom: top + lineObj.height}\n }", "function estimateCoords(cm, pos) {\n var left = 0;\n pos = clipPos(cm.doc, pos);\n if (!cm.options.lineWrapping) { left = charWidth(cm.display) * pos.ch; }\n var lineObj = getLine(cm.doc, pos.line);\n var top = heightAtLine(lineObj) + paddingTop(cm.display);\n return {left: left, right: left, top: top, bottom: top + lineObj.height}\n }", "function estimateCoords(cm, pos) {\n var left = 0;\n pos = clipPos(cm.doc, pos);\n if (!cm.options.lineWrapping) { left = charWidth(cm.display) * pos.ch; }\n var lineObj = getLine(cm.doc, pos.line);\n var top = heightAtLine(lineObj) + paddingTop(cm.display);\n return {left: left, right: left, top: top, bottom: top + lineObj.height}\n }", "function estimateCoords(cm, pos) {\n var left = 0;\n pos = clipPos(cm.doc, pos);\n if (!cm.options.lineWrapping) { left = charWidth(cm.display) * pos.ch; }\n var lineObj = getLine(cm.doc, pos.line);\n var top = heightAtLine(lineObj) + paddingTop(cm.display);\n return {left: left, right: left, top: top, bottom: top + lineObj.height}\n }", "function estimateCoords(cm, pos) {\n var left = 0;\n pos = clipPos(cm.doc, pos);\n if (!cm.options.lineWrapping) { left = charWidth(cm.display) * pos.ch; }\n var lineObj = getLine(cm.doc, pos.line);\n var top = heightAtLine(lineObj) + paddingTop(cm.display);\n return {left: left, right: left, top: top, bottom: top + lineObj.height}\n }", "function estimateCoords(cm, pos) {\n var left = 0;\n pos = clipPos(cm.doc, pos);\n if (!cm.options.lineWrapping) { left = charWidth(cm.display) * pos.ch; }\n var lineObj = getLine(cm.doc, pos.line);\n var top = heightAtLine(lineObj) + paddingTop(cm.display);\n return {left: left, right: left, top: top, bottom: top + lineObj.height}\n }", "function estimateCoords(cm, pos) {\n var left = 0;\n pos = clipPos(cm.doc, pos);\n if (!cm.options.lineWrapping) { left = charWidth(cm.display) * pos.ch; }\n var lineObj = getLine(cm.doc, pos.line);\n var top = heightAtLine(lineObj) + paddingTop(cm.display);\n return {left: left, right: left, top: top, bottom: top + lineObj.height}\n }", "function estimateCoords(cm, pos) {\n var left = 0;\n pos = clipPos(cm.doc, pos);\n if (!cm.options.lineWrapping) { left = charWidth(cm.display) * pos.ch; }\n var lineObj = getLine(cm.doc, pos.line);\n var top = heightAtLine(lineObj) + paddingTop(cm.display);\n return {left: left, right: left, top: top, bottom: top + lineObj.height}\n }", "function estimateCoords(cm, pos) {\n var left = 0;\n pos = clipPos(cm.doc, pos);\n if (!cm.options.lineWrapping) { left = charWidth(cm.display) * pos.ch; }\n var lineObj = getLine(cm.doc, pos.line);\n var top = heightAtLine(lineObj) + paddingTop(cm.display);\n return {left: left, right: left, top: top, bottom: top + lineObj.height}\n }", "function estimateCoords(cm, pos) {\n var left = 0;\n pos = clipPos(cm.doc, pos);\n if (!cm.options.lineWrapping) { left = charWidth(cm.display) * pos.ch; }\n var lineObj = getLine(cm.doc, pos.line);\n var top = heightAtLine(lineObj) + paddingTop(cm.display);\n return {left: left, right: left, top: top, bottom: top + lineObj.height}\n }", "function estimateCoords(cm, pos) {\n var left = 0;\n pos = clipPos(cm.doc, pos);\n if (!cm.options.lineWrapping) { left = charWidth(cm.display) * pos.ch; }\n var lineObj = getLine(cm.doc, pos.line);\n var top = heightAtLine(lineObj) + paddingTop(cm.display);\n return {left: left, right: left, top: top, bottom: top + lineObj.height}\n }", "function estimateCoords(cm, pos) {\n var left = 0;\n pos = clipPos(cm.doc, pos);\n if (!cm.options.lineWrapping) { left = charWidth(cm.display) * pos.ch; }\n var lineObj = getLine(cm.doc, pos.line);\n var top = heightAtLine(lineObj) + paddingTop(cm.display);\n return {left: left, right: left, top: top, bottom: top + lineObj.height}\n }", "function estimateCoords(cm, pos) {\n var left = 0;\n pos = clipPos(cm.doc, pos);\n if (!cm.options.lineWrapping) { left = charWidth(cm.display) * pos.ch; }\n var lineObj = getLine(cm.doc, pos.line);\n var top = heightAtLine(lineObj) + paddingTop(cm.display);\n return {left: left, right: left, top: top, bottom: top + lineObj.height}\n }", "function estimateCoords(cm, pos) {\n var left = 0;\n pos = clipPos(cm.doc, pos);\n if (!cm.options.lineWrapping) { left = charWidth(cm.display) * pos.ch; }\n var lineObj = getLine(cm.doc, pos.line);\n var top = heightAtLine(lineObj) + paddingTop(cm.display);\n return {left: left, right: left, top: top, bottom: top + lineObj.height}\n }", "function estimateCoords(cm, pos) {\n var left = 0;\n pos = clipPos(cm.doc, pos);\n if (!cm.options.lineWrapping) { left = charWidth(cm.display) * pos.ch; }\n var lineObj = getLine(cm.doc, pos.line);\n var top = heightAtLine(lineObj) + paddingTop(cm.display);\n return {left: left, right: left, top: top, bottom: top + lineObj.height}\n }", "function estimateCoords(cm, pos) {\n var left = 0;\n pos = clipPos(cm.doc, pos);\n if (!cm.options.lineWrapping) { left = charWidth(cm.display) * pos.ch; }\n var lineObj = getLine(cm.doc, pos.line);\n var top = heightAtLine(lineObj) + paddingTop(cm.display);\n return {left: left, right: left, top: top, bottom: top + lineObj.height}\n }", "column(pos, bias = 1) {\n let { text, from } = this.lineAt(pos, bias);\n let result = this.countColumn(text, pos - from);\n let override = this.options.overrideIndentation ? this.options.overrideIndentation(from) : -1;\n if (override > -1)\n result += override - this.countColumn(text, text.search(/\\S|$/));\n return result;\n }", "function getLineInfo(input, offset) {\n for (var line = 1, cur = 0;;) {\n lineBreakG.lastIndex = cur;\n var match = lineBreakG.exec(input);\n\n if (match && match.index < offset) {\n ++line;\n cur = match.index + match[0].length;\n } else {\n return new Position(line, offset - cur);\n }\n }\n }", "function getLineInfo(input, offset) {\n for (var line = 1, cur = 0;;) {\n lineBreakG.lastIndex = cur;\n var match = lineBreakG.exec(input);\n if (match && match.index < offset) {\n ++line;\n cur = match.index + match[0].length;\n } else {\n return new Position(line, offset - cur)\n }\n }\n }", "function getLineInfo(input, offset) {\n for (var line = 1, cur = 0;;) {\n lineBreakG.lastIndex = cur;\n var match = lineBreakG.exec(input);\n if (match && match.index < offset) {\n ++line;\n cur = match.index + match[0].length;\n } else {\n return new Position(line, offset - cur)\n }\n }\n }", "originalPositionFor(aArgs) {\n const needle = {\n generatedLine: util.getArg(aArgs, 'line'),\n generatedColumn: util.getArg(aArgs, 'column'),\n }\n\n // Find the section containing the generated position we're trying to map\n // to an original position.\n const sectionIndex = binarySearch.search(\n needle,\n this._sections,\n function (aNeedle, section) {\n const cmp =\n aNeedle.generatedLine - section.generatedOffset.generatedLine\n if (cmp) {\n return cmp\n }\n\n return aNeedle.generatedColumn - section.generatedOffset.generatedColumn\n }\n )\n const section = this._sections[sectionIndex]\n\n if (!section) {\n return {\n source: null,\n line: null,\n column: null,\n name: null,\n }\n }\n\n return section.consumer.originalPositionFor({\n line: needle.generatedLine - (section.generatedOffset.generatedLine - 1),\n column:\n needle.generatedColumn -\n (section.generatedOffset.generatedLine === needle.generatedLine\n ? section.generatedOffset.generatedColumn - 1\n : 0),\n bias: aArgs.bias,\n })\n }", "function getLineInfo(input, offset) {\n\t for (var line = 1, cur = 0;;) {\n\t lineBreakG.lastIndex = cur;\n\t var match = lineBreakG.exec(input);\n\t if (match && match.index < offset) {\n\t ++line;\n\t cur = match.index + match[0].length;\n\t } else {\n\t return new Position(line, offset - cur);\n\t }\n\t }\n\t}", "function getLineInfo(input, offset) {\n\t for (var line = 1, cur = 0;;) {\n\t lineBreakG.lastIndex = cur;\n\t var match = lineBreakG.exec(input);\n\t if (match && match.index < offset) {\n\t ++line;\n\t cur = match.index + match[0].length;\n\t } else {\n\t return new Position(line, offset - cur);\n\t }\n\t }\n\t}", "function posToIndex(pos) {\n var row = pos[0];\n var col = pos[1];\n return (row * 4) + col;\n}", "function estimateCoords(cm, pos) {\n\t\t var left = 0;\n\t\t pos = clipPos(cm.doc, pos);\n\t\t if (!cm.options.lineWrapping) { left = charWidth(cm.display) * pos.ch; }\n\t\t var lineObj = getLine(cm.doc, pos.line);\n\t\t var top = heightAtLine(lineObj) + paddingTop(cm.display);\n\t\t return {left: left, right: left, top: top, bottom: top + lineObj.height}\n\t\t }", "function estimateCoords(cm, pos) {\n var left = 0;\n pos = clipPos(cm.doc, pos);\n if (!cm.options.lineWrapping) { left = charWidth(cm.display) * pos.ch; }\n var lineObj = getLine(cm.doc, pos.line);\n var top = heightAtLine(lineObj) + paddingTop(cm.display);\n return {left: left, right: left, top: top, bottom: top + lineObj.height}\n}", "function estimateCoords(cm, pos) {\n var left = 0;\n pos = clipPos(cm.doc, pos);\n if (!cm.options.lineWrapping) { left = charWidth(cm.display) * pos.ch; }\n var lineObj = getLine(cm.doc, pos.line);\n var top = heightAtLine(lineObj) + paddingTop(cm.display);\n return {left: left, right: left, top: top, bottom: top + lineObj.height}\n}", "function estimateCoords(cm, pos) {\n var left = 0;\n pos = clipPos(cm.doc, pos);\n if (!cm.options.lineWrapping) { left = charWidth(cm.display) * pos.ch; }\n var lineObj = getLine(cm.doc, pos.line);\n var top = heightAtLine(lineObj) + paddingTop(cm.display);\n return {left: left, right: left, top: top, bottom: top + lineObj.height}\n}", "function estimateCoords(cm, pos) {\n var left = 0;\n pos = clipPos(cm.doc, pos);\n if (!cm.options.lineWrapping) { left = charWidth(cm.display) * pos.ch; }\n var lineObj = getLine(cm.doc, pos.line);\n var top = heightAtLine(lineObj) + paddingTop(cm.display);\n return {left: left, right: left, top: top, bottom: top + lineObj.height}\n}", "function estimateCoords(cm, pos) {\n var left = 0;\n pos = clipPos(cm.doc, pos);\n if (!cm.options.lineWrapping) { left = charWidth(cm.display) * pos.ch; }\n var lineObj = getLine(cm.doc, pos.line);\n var top = heightAtLine(lineObj) + paddingTop(cm.display);\n return {left: left, right: left, top: top, bottom: top + lineObj.height}\n}", "function estimateCoords(cm, pos) {\n var left = 0;\n pos = clipPos(cm.doc, pos);\n if (!cm.options.lineWrapping) { left = charWidth(cm.display) * pos.ch; }\n var lineObj = getLine(cm.doc, pos.line);\n var top = heightAtLine(lineObj) + paddingTop(cm.display);\n return {left: left, right: left, top: top, bottom: top + lineObj.height}\n}", "function estimateCoords(cm, pos) {\n var left = 0;\n pos = clipPos(cm.doc, pos);\n if (!cm.options.lineWrapping) { left = charWidth(cm.display) * pos.ch; }\n var lineObj = getLine(cm.doc, pos.line);\n var top = heightAtLine(lineObj) + paddingTop(cm.display);\n return {left: left, right: left, top: top, bottom: top + lineObj.height}\n}", "function estimateCoords(cm, pos) {\n var left = 0;\n pos = clipPos(cm.doc, pos);\n if (!cm.options.lineWrapping) { left = charWidth(cm.display) * pos.ch; }\n var lineObj = getLine(cm.doc, pos.line);\n var top = heightAtLine(lineObj) + paddingTop(cm.display);\n return {left: left, right: left, top: top, bottom: top + lineObj.height}\n}", "function estimateCoords(cm, pos) {\n var left = 0;\n pos = clipPos(cm.doc, pos);\n if (!cm.options.lineWrapping) { left = charWidth(cm.display) * pos.ch; }\n var lineObj = getLine(cm.doc, pos.line);\n var top = heightAtLine(lineObj) + paddingTop(cm.display);\n return {left: left, right: left, top: top, bottom: top + lineObj.height}\n}" ]
[ "0.7169871", "0.7169871", "0.6971489", "0.6589328", "0.6589328", "0.6589328", "0.6576411", "0.6576411", "0.6491785", "0.63492906", "0.63492906", "0.63492906", "0.63492906", "0.63492906", "0.6348974", "0.6269752", "0.6182241", "0.6182241", "0.6182241", "0.6182241", "0.6182241", "0.6108724", "0.60228926", "0.58790785", "0.5874491", "0.5859907", "0.58267075", "0.58228296", "0.5806041", "0.5806041", "0.57905984", "0.5711761", "0.5701011", "0.5693237", "0.567317", "0.567317", "0.567317", "0.567317", "0.567317", "0.567317", "0.567317", "0.567317", "0.5657132", "0.5657132", "0.56430244", "0.56430244", "0.5639582", "0.5638906", "0.5630907", "0.5630907", "0.5630907", "0.5628004", "0.5628004", "0.5628004", "0.5628004", "0.5628004", "0.5628004", "0.5628004", "0.5628004", "0.5628004", "0.5628004", "0.56201506", "0.56201506", "0.56166106", "0.56166106", "0.56166106", "0.56166106", "0.56166106", "0.56166106", "0.56166106", "0.56166106", "0.56166106", "0.56166106", "0.56166106", "0.56166106", "0.56166106", "0.56166106", "0.56166106", "0.56166106", "0.56166106", "0.56155086", "0.5614949", "0.56136847", "0.56136847", "0.5601627", "0.56014824", "0.56014824", "0.55993366", "0.55970377", "0.55891865", "0.55891865", "0.55891865", "0.55891865", "0.55891865", "0.55891865", "0.55891865", "0.55891865", "0.55891865" ]
0.727257
2
Get the `offset` for a line and columnbased `position` in the bound indices.
function positionToOffset(position) { var line = position && position.line var column = position && position.column if (!isNaN(line) && !isNaN(column) && line - 1 in indices) { return (indices[line - 2] || 0) + column - 1 || 0 } return -1 }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function positionToOffsetFactory(indices) {\n return positionToOffset\n\n // Get the `offset` for a line and column-based `position` in the bound\n // indices.\n function positionToOffset(position) {\n var line = position && position.line\n var column = position && position.column\n\n if (!isNaN(line) && !isNaN(column) && line - 1 in indices) {\n return (indices[line - 2] || 0) + column - 1 || 0\n }\n\n return -1\n }\n}", "function positionToOffsetFactory(indices) {\n return positionToOffset\n\n // Get the `offset` for a line and column-based `position` in the bound\n // indices.\n function positionToOffset(position) {\n var line = position && position.line\n var column = position && position.column\n\n if (!isNaN(line) && !isNaN(column) && line - 1 in indices) {\n return (indices[line - 2] || 0) + column - 1 || 0\n }\n\n return -1\n }\n}", "function positionToOffsetFactory(indices) {\n return positionToOffset\n\n // Get the `offset` for a line and column-based `position` in the bound\n // indices.\n function positionToOffset(position) {\n var line = position && position.line\n var column = position && position.column\n\n if (!isNaN(line) && !isNaN(column) && line - 1 in indices) {\n return (indices[line - 2] || 0) + column - 1 || 0\n }\n\n return -1\n }\n}", "function computeOffset(position, data) {\n let line = position.line;\n let column = position.column + 1;\n for (let i = 0; i < data.length; i++) {\n if (line > 1) {\n /* not yet on the correct line */\n if (data[i] === \"\\n\") {\n line--;\n }\n }\n else if (column > 1) {\n /* not yet on the correct column */\n column--;\n }\n else {\n /* line/column found, return current position */\n return i;\n }\n }\n /* istanbul ignore next: should never reach this line unless espree passes bad\n * positions, no sane way to test */\n throw new Error(\"Failed to compute location offset from position\");\n}", "offset_from_position(position) {\n const offset = Offset.zero();\n\n // We attempt to explore in each of the four directions in turn.\n // These four loops could be simplified, but have been left as-is to aid readability.\n\n if (position.x > 0) {\n for (let col = 0; col < Math.floor(position.x); ++col) {\n offset.left += this.cell_size(this.cell_width, col);\n }\n offset.left\n += this.cell_size(this.cell_width, Math.floor(position.x)) * (position.x % 1);\n }\n if (position.x < 0) {\n for (let col = -1; col >= position.x; --col) {\n offset.left -= this.cell_size(this.cell_width, col);\n }\n offset.left\n += this.cell_size(this.cell_width, Math.floor(position.x)) * (position.x % 1);\n }\n\n if (position.y > 0) {\n for (let row = 0; row < Math.floor(position.y); ++row) {\n offset.top += this.cell_size(this.cell_height, row);\n }\n offset.top\n += this.cell_size(this.cell_height, Math.floor(position.y)) * (position.y % 1);\n }\n if (position.y < 0) {\n for (let row = -1; row >= position.y; --row) {\n offset.top -= this.cell_size(this.cell_height, row);\n }\n offset.top\n += this.cell_size(this.cell_height, Math.floor(position.y)) * (position.y % 1);\n }\n\n return offset;\n }", "function positionToOffsetFactory(indices) {\n return positionToOffset\n\n /* Get the `offset` for a line and column-based\n * `position` in the bound indices. */\n function positionToOffset(position) {\n var line = position && position.line\n var column = position && position.column\n\n if (!isNaN(line) && !isNaN(column) && line - 1 in indices) {\n return (indices[line - 2] || 0) + column - 1 || 0\n }\n\n return -1\n }\n}", "function positionToOffsetFactory(indices) {\n return positionToOffset\n\n /* Get the `offset` for a line and column-based\n * `position` in the bound indices. */\n function positionToOffset(position) {\n var line = position && position.line\n var column = position && position.column\n\n if (!isNaN(line) && !isNaN(column) && line - 1 in indices) {\n return (indices[line - 2] || 0) + column - 1 || 0\n }\n\n return -1\n }\n}", "offsetAt(position) {\n return (0, utils_1.offsetAt)(position, this.getText(), this.getLineOffsets());\n }", "function pointToOffsetFactory(indices) {\n return pointToOffset\n\n // Get the `offset` for a line and column-based `point` in the bound\n // indices.\n function pointToOffset(point) {\n var line = point && point.line\n var column = point && point.column\n\n if (!isNaN(line) && !isNaN(column) && line - 1 in indices) {\n return (indices[line - 2] || 0) + column - 1 || 0\n }\n\n return -1\n }\n}", "function xyOffsetIndex(i, x, y, w, h) {\n var index = i + x + y * w;\n var absx = (i % w) + x;\n if (absx < 0 && index < 0 || absx >= w && index >= w * h) {\n return i - x - y * w;\n }\n if (absx < 0 || absx >= w) { // if off the left.\n return i - x + y * w;\n }\n //var absy = index - (w * y)\n if (index < 0 || index >= w * h) { // if off top/bottom.\n return i + x - y * w;\n }\n return index;\n}", "column(pos, bias = 1) {\n let { text, from } = this.lineAt(pos, bias);\n let result = this.countColumn(text, pos - from);\n let override = this.options.overrideIndentation ? this.options.overrideIndentation(from) : -1;\n if (override > -1)\n result += override - this.countColumn(text, text.search(/\\S|$/));\n return result;\n }", "function estimateCoords(cm, pos) {\n var left = 0, pos = clipPos(cm.doc, pos);\n if (!cm.options.lineWrapping) left = charWidth(cm.display) * pos.ch;\n var lineObj = getLine(cm.doc, pos.line);\n var top = heightAtLine(lineObj) + paddingTop(cm.display);\n return {left: left, right: left, top: top, bottom: top + lineObj.height};\n }", "function estimateCoords(cm, pos) {\n var left = 0, pos = clipPos(cm.doc, pos);\n if (!cm.options.lineWrapping) left = charWidth(cm.display) * pos.ch;\n var lineObj = getLine(cm.doc, pos.line);\n var top = heightAtLine(lineObj) + paddingTop(cm.display);\n return {left: left, right: left, top: top, bottom: top + lineObj.height};\n }", "function estimateCoords(cm, pos) {\n var left = 0, pos = clipPos(cm.doc, pos);\n if (!cm.options.lineWrapping) left = charWidth(cm.display) * pos.ch;\n var lineObj = getLine(cm.doc, pos.line);\n var top = heightAtLine(lineObj) + paddingTop(cm.display);\n return {left: left, right: left, top: top, bottom: top + lineObj.height};\n }", "function estimateCoords(cm, pos) {\n var left = 0, pos = clipPos(cm.doc, pos);\n if (!cm.options.lineWrapping) left = charWidth(cm.display) * pos.ch;\n var lineObj = getLine(cm.doc, pos.line);\n var top = heightAtLine(lineObj) + paddingTop(cm.display);\n return {left: left, right: left, top: top, bottom: top + lineObj.height};\n }", "function estimateCoords(cm, pos) {\n var left = 0, pos = clipPos(cm.doc, pos);\n if (!cm.options.lineWrapping) left = charWidth(cm.display) * pos.ch;\n var lineObj = getLine(cm.doc, pos.line);\n var top = heightAtLine(lineObj) + paddingTop(cm.display);\n return {left: left, right: left, top: top, bottom: top + lineObj.height};\n }", "function estimateCoords(cm, pos) {\n var left = 0, pos = clipPos(cm.doc, pos);\n if (!cm.options.lineWrapping) left = charWidth(cm.display) * pos.ch;\n var lineObj = getLine(cm.doc, pos.line);\n var top = heightAtLine(lineObj) + paddingTop(cm.display);\n return {left: left, right: left, top: top, bottom: top + lineObj.height};\n }", "function estimateCoords(cm, pos) {\n var left = 0, pos = clipPos(cm.doc, pos);\n if (!cm.options.lineWrapping) left = charWidth(cm.display) * pos.ch;\n var lineObj = getLine(cm.doc, pos.line);\n var top = heightAtLine(lineObj) + paddingTop(cm.display);\n return {left: left, right: left, top: top, bottom: top + lineObj.height};\n }", "function estimateCoords(cm, pos) {\n var left = 0, pos = clipPos(cm.doc, pos);\n if (!cm.options.lineWrapping) left = charWidth(cm.display) * pos.ch;\n var lineObj = getLine(cm.doc, pos.line);\n var top = heightAtLine(lineObj) + paddingTop(cm.display);\n return {left: left, right: left, top: top, bottom: top + lineObj.height};\n }", "function pointToOffset(point) {\n var line = point && point.line\n var column = point && point.column\n\n if (!isNaN(line) && !isNaN(column) && line - 1 in indices) {\n return (indices[line - 2] || 0) + column - 1 || 0\n }\n\n return -1\n }", "function estimateCoords(cm, pos) {\n var left = 0;\n pos = clipPos(cm.doc, pos);\n if (!cm.options.lineWrapping) { left = charWidth(cm.display) * pos.ch; }\n var lineObj = getLine(cm.doc, pos.line);\n var top = heightAtLine(lineObj) + paddingTop(cm.display);\n return {left: left, right: left, top: top, bottom: top + lineObj.height}\n }", "function estimateCoords(cm, pos) {\n var left = 0;\n pos = clipPos(cm.doc, pos);\n if (!cm.options.lineWrapping) { left = charWidth(cm.display) * pos.ch; }\n var lineObj = getLine(cm.doc, pos.line);\n var top = heightAtLine(lineObj) + paddingTop(cm.display);\n return {left: left, right: left, top: top, bottom: top + lineObj.height}\n }", "function estimateCoords(cm, pos) {\n var left = 0;\n pos = clipPos(cm.doc, pos);\n if (!cm.options.lineWrapping) { left = charWidth(cm.display) * pos.ch; }\n var lineObj = getLine(cm.doc, pos.line);\n var top = heightAtLine(lineObj) + paddingTop(cm.display);\n return {left: left, right: left, top: top, bottom: top + lineObj.height}\n }", "function estimateCoords(cm, pos) {\n var left = 0;\n pos = clipPos(cm.doc, pos);\n if (!cm.options.lineWrapping) { left = charWidth(cm.display) * pos.ch; }\n var lineObj = getLine(cm.doc, pos.line);\n var top = heightAtLine(lineObj) + paddingTop(cm.display);\n return {left: left, right: left, top: top, bottom: top + lineObj.height}\n }", "function estimateCoords(cm, pos) {\n var left = 0;\n pos = clipPos(cm.doc, pos);\n if (!cm.options.lineWrapping) { left = charWidth(cm.display) * pos.ch; }\n var lineObj = getLine(cm.doc, pos.line);\n var top = heightAtLine(lineObj) + paddingTop(cm.display);\n return {left: left, right: left, top: top, bottom: top + lineObj.height}\n }", "function estimateCoords(cm, pos) {\n var left = 0;\n pos = clipPos(cm.doc, pos);\n if (!cm.options.lineWrapping) { left = charWidth(cm.display) * pos.ch; }\n var lineObj = getLine(cm.doc, pos.line);\n var top = heightAtLine(lineObj) + paddingTop(cm.display);\n return {left: left, right: left, top: top, bottom: top + lineObj.height}\n }", "function estimateCoords(cm, pos) {\n var left = 0;\n pos = clipPos(cm.doc, pos);\n if (!cm.options.lineWrapping) { left = charWidth(cm.display) * pos.ch; }\n var lineObj = getLine(cm.doc, pos.line);\n var top = heightAtLine(lineObj) + paddingTop(cm.display);\n return {left: left, right: left, top: top, bottom: top + lineObj.height}\n }", "function estimateCoords(cm, pos) {\n var left = 0;\n pos = clipPos(cm.doc, pos);\n if (!cm.options.lineWrapping) { left = charWidth(cm.display) * pos.ch; }\n var lineObj = getLine(cm.doc, pos.line);\n var top = heightAtLine(lineObj) + paddingTop(cm.display);\n return {left: left, right: left, top: top, bottom: top + lineObj.height}\n }", "function estimateCoords(cm, pos) {\n var left = 0;\n pos = clipPos(cm.doc, pos);\n if (!cm.options.lineWrapping) { left = charWidth(cm.display) * pos.ch; }\n var lineObj = getLine(cm.doc, pos.line);\n var top = heightAtLine(lineObj) + paddingTop(cm.display);\n return {left: left, right: left, top: top, bottom: top + lineObj.height}\n }", "function estimateCoords(cm, pos) {\n var left = 0;\n pos = clipPos(cm.doc, pos);\n if (!cm.options.lineWrapping) { left = charWidth(cm.display) * pos.ch; }\n var lineObj = getLine(cm.doc, pos.line);\n var top = heightAtLine(lineObj) + paddingTop(cm.display);\n return {left: left, right: left, top: top, bottom: top + lineObj.height}\n }", "function estimateCoords(cm, pos) {\n var left = 0;\n pos = clipPos(cm.doc, pos);\n if (!cm.options.lineWrapping) { left = charWidth(cm.display) * pos.ch; }\n var lineObj = getLine(cm.doc, pos.line);\n var top = heightAtLine(lineObj) + paddingTop(cm.display);\n return {left: left, right: left, top: top, bottom: top + lineObj.height}\n }", "function estimateCoords(cm, pos) {\n var left = 0;\n pos = clipPos(cm.doc, pos);\n if (!cm.options.lineWrapping) { left = charWidth(cm.display) * pos.ch; }\n var lineObj = getLine(cm.doc, pos.line);\n var top = heightAtLine(lineObj) + paddingTop(cm.display);\n return {left: left, right: left, top: top, bottom: top + lineObj.height}\n }", "function estimateCoords(cm, pos) {\n var left = 0;\n pos = clipPos(cm.doc, pos);\n if (!cm.options.lineWrapping) { left = charWidth(cm.display) * pos.ch; }\n var lineObj = getLine(cm.doc, pos.line);\n var top = heightAtLine(lineObj) + paddingTop(cm.display);\n return {left: left, right: left, top: top, bottom: top + lineObj.height}\n }", "function estimateCoords(cm, pos) {\n var left = 0;\n pos = clipPos(cm.doc, pos);\n if (!cm.options.lineWrapping) { left = charWidth(cm.display) * pos.ch; }\n var lineObj = getLine(cm.doc, pos.line);\n var top = heightAtLine(lineObj) + paddingTop(cm.display);\n return {left: left, right: left, top: top, bottom: top + lineObj.height}\n }", "function estimateCoords(cm, pos) {\n var left = 0;\n pos = clipPos(cm.doc, pos);\n if (!cm.options.lineWrapping) { left = charWidth(cm.display) * pos.ch; }\n var lineObj = getLine(cm.doc, pos.line);\n var top = heightAtLine(lineObj) + paddingTop(cm.display);\n return {left: left, right: left, top: top, bottom: top + lineObj.height}\n }", "function estimateCoords(cm, pos) {\n var left = 0;\n pos = clipPos(cm.doc, pos);\n if (!cm.options.lineWrapping) { left = charWidth(cm.display) * pos.ch; }\n var lineObj = getLine(cm.doc, pos.line);\n var top = heightAtLine(lineObj) + paddingTop(cm.display);\n return {left: left, right: left, top: top, bottom: top + lineObj.height}\n }", "function estimateCoords(cm, pos) {\n var left = 0;\n pos = clipPos(cm.doc, pos);\n if (!cm.options.lineWrapping) { left = charWidth(cm.display) * pos.ch; }\n var lineObj = getLine(cm.doc, pos.line);\n var top = heightAtLine(lineObj) + paddingTop(cm.display);\n return {left: left, right: left, top: top, bottom: top + lineObj.height}\n }", "function estimateCoords(cm, pos) {\r\n var left = 0, pos = clipPos(cm.doc, pos);\r\n if (!cm.options.lineWrapping) left = charWidth(cm.display) * pos.ch;\r\n var lineObj = getLine(cm.doc, pos.line);\r\n var top = heightAtLine(lineObj) + paddingTop(cm.display);\r\n return {left: left, right: left, top: top, bottom: top + lineObj.height};\r\n }", "function estimateCoords(cm, pos) {\n var left = 0\n pos = clipPos(cm.doc, pos)\n if (!cm.options.lineWrapping) { left = charWidth(cm.display) * pos.ch }\n var lineObj = getLine(cm.doc, pos.line)\n var top = heightAtLine(lineObj) + paddingTop(cm.display)\n return {left: left, right: left, top: top, bottom: top + lineObj.height}\n}", "function estimateCoords(cm, pos) {\n var left = 0\n pos = clipPos(cm.doc, pos)\n if (!cm.options.lineWrapping) { left = charWidth(cm.display) * pos.ch }\n var lineObj = getLine(cm.doc, pos.line)\n var top = heightAtLine(lineObj) + paddingTop(cm.display)\n return {left: left, right: left, top: top, bottom: top + lineObj.height}\n}", "function estimateCoords(cm, pos) {\n var left = 0;\n pos = clipPos(cm.doc, pos);\n if (!cm.options.lineWrapping) { left = charWidth(cm.display) * pos.ch; }\n var lineObj = getLine(cm.doc, pos.line);\n var top = heightAtLine(lineObj) + paddingTop(cm.display);\n return {left: left, right: left, top: top, bottom: top + lineObj.height}\n}", "function estimateCoords(cm, pos) {\n var left = 0;\n pos = clipPos(cm.doc, pos);\n if (!cm.options.lineWrapping) { left = charWidth(cm.display) * pos.ch; }\n var lineObj = getLine(cm.doc, pos.line);\n var top = heightAtLine(lineObj) + paddingTop(cm.display);\n return {left: left, right: left, top: top, bottom: top + lineObj.height}\n}", "function estimateCoords(cm, pos) {\n var left = 0;\n pos = clipPos(cm.doc, pos);\n if (!cm.options.lineWrapping) { left = charWidth(cm.display) * pos.ch; }\n var lineObj = getLine(cm.doc, pos.line);\n var top = heightAtLine(lineObj) + paddingTop(cm.display);\n return {left: left, right: left, top: top, bottom: top + lineObj.height}\n}", "function estimateCoords(cm, pos) {\n var left = 0;\n pos = clipPos(cm.doc, pos);\n if (!cm.options.lineWrapping) { left = charWidth(cm.display) * pos.ch; }\n var lineObj = getLine(cm.doc, pos.line);\n var top = heightAtLine(lineObj) + paddingTop(cm.display);\n return {left: left, right: left, top: top, bottom: top + lineObj.height}\n}", "function estimateCoords(cm, pos) {\n var left = 0;\n pos = clipPos(cm.doc, pos);\n if (!cm.options.lineWrapping) { left = charWidth(cm.display) * pos.ch; }\n var lineObj = getLine(cm.doc, pos.line);\n var top = heightAtLine(lineObj) + paddingTop(cm.display);\n return {left: left, right: left, top: top, bottom: top + lineObj.height}\n}", "function estimateCoords(cm, pos) {\n var left = 0;\n pos = clipPos(cm.doc, pos);\n if (!cm.options.lineWrapping) { left = charWidth(cm.display) * pos.ch; }\n var lineObj = getLine(cm.doc, pos.line);\n var top = heightAtLine(lineObj) + paddingTop(cm.display);\n return {left: left, right: left, top: top, bottom: top + lineObj.height}\n}", "function estimateCoords(cm, pos) {\n var left = 0;\n pos = clipPos(cm.doc, pos);\n if (!cm.options.lineWrapping) { left = charWidth(cm.display) * pos.ch; }\n var lineObj = getLine(cm.doc, pos.line);\n var top = heightAtLine(lineObj) + paddingTop(cm.display);\n return {left: left, right: left, top: top, bottom: top + lineObj.height}\n}", "function estimateCoords(cm, pos) {\n var left = 0;\n pos = clipPos(cm.doc, pos);\n if (!cm.options.lineWrapping) { left = charWidth(cm.display) * pos.ch; }\n var lineObj = getLine(cm.doc, pos.line);\n var top = heightAtLine(lineObj) + paddingTop(cm.display);\n return {left: left, right: left, top: top, bottom: top + lineObj.height}\n}", "function estimateCoords(cm, pos) {\n var left = 0;\n pos = clipPos(cm.doc, pos);\n if (!cm.options.lineWrapping) { left = charWidth(cm.display) * pos.ch; }\n var lineObj = getLine(cm.doc, pos.line);\n var top = heightAtLine(lineObj) + paddingTop(cm.display);\n return {left: left, right: left, top: top, bottom: top + lineObj.height}\n}", "function estimateCoords(cm, pos) {\n var left = 0;\n pos = clipPos(cm.doc, pos);\n if (!cm.options.lineWrapping) { left = charWidth(cm.display) * pos.ch; }\n var lineObj = getLine(cm.doc, pos.line);\n var top = heightAtLine(lineObj) + paddingTop(cm.display);\n return {left: left, right: left, top: top, bottom: top + lineObj.height}\n}", "function estimateCoords(cm, pos) {\n var left = 0;\n pos = clipPos(cm.doc, pos);\n if (!cm.options.lineWrapping) { left = charWidth(cm.display) * pos.ch; }\n var lineObj = getLine(cm.doc, pos.line);\n var top = heightAtLine(lineObj) + paddingTop(cm.display);\n return {left: left, right: left, top: top, bottom: top + lineObj.height}\n}", "function estimateCoords(cm, pos) {\n\t\t var left = 0, pos = clipPos(cm.doc, pos);\n\t\t if (!cm.options.lineWrapping) left = charWidth(cm.display) * pos.ch;\n\t\t var lineObj = getLine(cm.doc, pos.line);\n\t\t var top = heightAtLine(lineObj) + paddingTop(cm.display);\n\t\t return {left: left, right: left, top: top, bottom: top + lineObj.height};\n\t\t }", "function estimateCoords(cm, pos) {\n\t var left = 0, pos = clipPos(cm.doc, pos);\n\t if (!cm.options.lineWrapping) left = charWidth(cm.display) * pos.ch;\n\t var lineObj = getLine(cm.doc, pos.line);\n\t var top = heightAtLine(lineObj) + paddingTop(cm.display);\n\t return {left: left, right: left, top: top, bottom: top + lineObj.height};\n\t }", "function estimateCoords(cm, pos) {\n\t var left = 0, pos = clipPos(cm.doc, pos);\n\t if (!cm.options.lineWrapping) left = charWidth(cm.display) * pos.ch;\n\t var lineObj = getLine(cm.doc, pos.line);\n\t var top = heightAtLine(lineObj) + paddingTop(cm.display);\n\t return {left: left, right: left, top: top, bottom: top + lineObj.height};\n\t }", "function estimateCoords(cm, pos) {\n\t var left = 0, pos = clipPos(cm.doc, pos);\n\t if (!cm.options.lineWrapping) left = charWidth(cm.display) * pos.ch;\n\t var lineObj = getLine(cm.doc, pos.line);\n\t var top = heightAtLine(lineObj) + paddingTop(cm.display);\n\t return {left: left, right: left, top: top, bottom: top + lineObj.height};\n\t }", "function offsetToPosition(offset) {\n var index = -1\n var length = indices.length\n\n if (offset < 0) {\n return {}\n }\n\n while (++index < length) {\n if (indices[index] > offset) {\n return {\n line: index + 1,\n column: offset - (indices[index - 1] || 0) + 1,\n offset: offset\n }\n }\n }\n\n return {}\n }", "function offsetToPosition(offset) {\n var index = -1\n var length = indices.length\n\n if (offset < 0) {\n return {}\n }\n\n while (++index < length) {\n if (indices[index] > offset) {\n return {\n line: index + 1,\n column: offset - (indices[index - 1] || 0) + 1,\n offset: offset\n }\n }\n }\n\n return {}\n }", "function offsetToPosition(offset) {\n var index = -1\n var length = indices.length\n\n if (offset < 0) {\n return {}\n }\n\n while (++index < length) {\n if (indices[index] > offset) {\n return {\n line: index + 1,\n column: offset - (indices[index - 1] || 0) + 1,\n offset: offset\n }\n }\n }\n\n return {}\n }", "function offsetToPosition(offset) {\n var index = -1\n var length = indices.length\n\n if (offset < 0) {\n return {}\n }\n\n while (++index < length) {\n if (indices[index] > offset) {\n return {\n line: index + 1,\n column: offset - (indices[index - 1] || 0) + 1,\n offset: offset\n }\n }\n }\n\n return {}\n }", "function offsetToPosition(offset) {\n var index = -1\n var length = indices.length\n\n if (offset < 0) {\n return {}\n }\n\n while (++index < length) {\n if (indices[index] > offset) {\n return {\n line: index + 1,\n column: offset - (indices[index - 1] || 0) + 1,\n offset: offset\n }\n }\n }\n\n return {}\n }", "function getLocation(source, position) {\n let lastLineStart = 0;\n let line = 1;\n\n for (const match of source.body.matchAll(LineRegExp)) {\n typeof match.index === 'number' || invariant(false);\n\n if (match.index >= position) {\n break;\n }\n\n lastLineStart = match.index + match[0].length;\n line += 1;\n }\n\n return {\n line,\n column: position + 1 - lastLineStart,\n };\n}", "function estimateCoords(cm, pos) {\r\n var left = 0;\r\n pos = clipPos(cm.doc, pos);\r\n if (!cm.options.lineWrapping) { left = charWidth(cm.display) * pos.ch; }\r\n var lineObj = getLine(cm.doc, pos.line);\r\n var top = heightAtLine(lineObj) + paddingTop(cm.display);\r\n return {left: left, right: left, top: top, bottom: top + lineObj.height}\r\n}", "function estimateCoords(cm, pos) {\n\t\t var left = 0;\n\t\t pos = clipPos(cm.doc, pos);\n\t\t if (!cm.options.lineWrapping) { left = charWidth(cm.display) * pos.ch; }\n\t\t var lineObj = getLine(cm.doc, pos.line);\n\t\t var top = heightAtLine(lineObj) + paddingTop(cm.display);\n\t\t return {left: left, right: left, top: top, bottom: top + lineObj.height}\n\t\t }", "function posToIndex(pos) {\n var row = pos[0];\n var col = pos[1];\n return (row * 4) + col;\n}", "function cursorCoords(cm, pos, context, lineObj, preparedMeasure, varHeight) {\n lineObj = lineObj || getLine(cm.doc, pos.line)\n if (!preparedMeasure) { preparedMeasure = prepareMeasureForLine(cm, lineObj) }\n function get(ch, right) {\n var m = measureCharPrepared(cm, preparedMeasure, ch, right ? \"right\" : \"left\", varHeight)\n if (right) { m.left = m.right; } else { m.right = m.left }\n return intoCoordSystem(cm, lineObj, m, context)\n }\n var order = getOrder(lineObj, cm.doc.direction), ch = pos.ch, sticky = pos.sticky\n if (ch >= lineObj.text.length) {\n ch = lineObj.text.length\n sticky = \"before\"\n } else if (ch <= 0) {\n ch = 0\n sticky = \"after\"\n }\n if (!order) { return get(sticky == \"before\" ? ch - 1 : ch, sticky == \"before\") }\n\n function getBidi(ch, partPos, invert) {\n var part = order[partPos], right = (part.level % 2) != 0\n return get(invert ? ch - 1 : ch, right != invert)\n }\n var partPos = getBidiPartAt(order, ch, sticky)\n var other = bidiOther\n var val = getBidi(ch, partPos, sticky == \"before\")\n if (other != null) { val.other = getBidi(ch, other, sticky != \"before\") }\n return val\n}", "function cursorCoords(cm, pos, context, lineObj, preparedMeasure, varHeight) {\n lineObj = lineObj || getLine(cm.doc, pos.line);\n if (!preparedMeasure) { preparedMeasure = prepareMeasureForLine(cm, lineObj); }\n function get(ch, right) {\n var m = measureCharPrepared(cm, preparedMeasure, ch, right ? \"right\" : \"left\", varHeight);\n if (right) { m.left = m.right; } else { m.right = m.left; }\n return intoCoordSystem(cm, lineObj, m, context)\n }\n var order = getOrder(lineObj, cm.doc.direction), ch = pos.ch, sticky = pos.sticky;\n if (ch >= lineObj.text.length) {\n ch = lineObj.text.length;\n sticky = \"before\";\n } else if (ch <= 0) {\n ch = 0;\n sticky = \"after\";\n }\n if (!order) { return get(sticky == \"before\" ? ch - 1 : ch, sticky == \"before\") }\n\n function getBidi(ch, partPos, invert) {\n var part = order[partPos], right = part.level == 1;\n return get(invert ? ch - 1 : ch, right != invert)\n }\n var partPos = getBidiPartAt(order, ch, sticky);\n var other = bidiOther;\n var val = getBidi(ch, partPos, sticky == \"before\");\n if (other != null) { val.other = getBidi(ch, other, sticky != \"before\"); }\n return val\n }", "function cursorCoords(cm, pos, context, lineObj, preparedMeasure, varHeight) {\n lineObj = lineObj || getLine(cm.doc, pos.line);\n if (!preparedMeasure) { preparedMeasure = prepareMeasureForLine(cm, lineObj); }\n function get(ch, right) {\n var m = measureCharPrepared(cm, preparedMeasure, ch, right ? \"right\" : \"left\", varHeight);\n if (right) { m.left = m.right; } else { m.right = m.left; }\n return intoCoordSystem(cm, lineObj, m, context)\n }\n var order = getOrder(lineObj, cm.doc.direction), ch = pos.ch, sticky = pos.sticky;\n if (ch >= lineObj.text.length) {\n ch = lineObj.text.length;\n sticky = \"before\";\n } else if (ch <= 0) {\n ch = 0;\n sticky = \"after\";\n }\n if (!order) { return get(sticky == \"before\" ? ch - 1 : ch, sticky == \"before\") }\n\n function getBidi(ch, partPos, invert) {\n var part = order[partPos], right = part.level == 1;\n return get(invert ? ch - 1 : ch, right != invert)\n }\n var partPos = getBidiPartAt(order, ch, sticky);\n var other = bidiOther;\n var val = getBidi(ch, partPos, sticky == \"before\");\n if (other != null) { val.other = getBidi(ch, other, sticky != \"before\"); }\n return val\n }", "function cursorCoords(cm, pos, context, lineObj, preparedMeasure, varHeight) {\n lineObj = lineObj || getLine(cm.doc, pos.line);\n if (!preparedMeasure) { preparedMeasure = prepareMeasureForLine(cm, lineObj); }\n function get(ch, right) {\n var m = measureCharPrepared(cm, preparedMeasure, ch, right ? \"right\" : \"left\", varHeight);\n if (right) { m.left = m.right; } else { m.right = m.left; }\n return intoCoordSystem(cm, lineObj, m, context)\n }\n var order = getOrder(lineObj, cm.doc.direction), ch = pos.ch, sticky = pos.sticky;\n if (ch >= lineObj.text.length) {\n ch = lineObj.text.length;\n sticky = \"before\";\n } else if (ch <= 0) {\n ch = 0;\n sticky = \"after\";\n }\n if (!order) { return get(sticky == \"before\" ? ch - 1 : ch, sticky == \"before\") }\n\n function getBidi(ch, partPos, invert) {\n var part = order[partPos], right = part.level == 1;\n return get(invert ? ch - 1 : ch, right != invert)\n }\n var partPos = getBidiPartAt(order, ch, sticky);\n var other = bidiOther;\n var val = getBidi(ch, partPos, sticky == \"before\");\n if (other != null) { val.other = getBidi(ch, other, sticky != \"before\"); }\n return val\n }", "function cursorCoords(cm, pos, context, lineObj, preparedMeasure, varHeight) {\n lineObj = lineObj || getLine(cm.doc, pos.line);\n if (!preparedMeasure) { preparedMeasure = prepareMeasureForLine(cm, lineObj); }\n function get(ch, right) {\n var m = measureCharPrepared(cm, preparedMeasure, ch, right ? \"right\" : \"left\", varHeight);\n if (right) { m.left = m.right; } else { m.right = m.left; }\n return intoCoordSystem(cm, lineObj, m, context)\n }\n var order = getOrder(lineObj, cm.doc.direction), ch = pos.ch, sticky = pos.sticky;\n if (ch >= lineObj.text.length) {\n ch = lineObj.text.length;\n sticky = \"before\";\n } else if (ch <= 0) {\n ch = 0;\n sticky = \"after\";\n }\n if (!order) { return get(sticky == \"before\" ? ch - 1 : ch, sticky == \"before\") }\n\n function getBidi(ch, partPos, invert) {\n var part = order[partPos], right = part.level == 1;\n return get(invert ? ch - 1 : ch, right != invert)\n }\n var partPos = getBidiPartAt(order, ch, sticky);\n var other = bidiOther;\n var val = getBidi(ch, partPos, sticky == \"before\");\n if (other != null) { val.other = getBidi(ch, other, sticky != \"before\"); }\n return val\n }", "function cursorCoords(cm, pos, context, lineObj, preparedMeasure, varHeight) {\n lineObj = lineObj || getLine(cm.doc, pos.line);\n if (!preparedMeasure) { preparedMeasure = prepareMeasureForLine(cm, lineObj); }\n function get(ch, right) {\n var m = measureCharPrepared(cm, preparedMeasure, ch, right ? \"right\" : \"left\", varHeight);\n if (right) { m.left = m.right; } else { m.right = m.left; }\n return intoCoordSystem(cm, lineObj, m, context)\n }\n var order = getOrder(lineObj, cm.doc.direction), ch = pos.ch, sticky = pos.sticky;\n if (ch >= lineObj.text.length) {\n ch = lineObj.text.length;\n sticky = \"before\";\n } else if (ch <= 0) {\n ch = 0;\n sticky = \"after\";\n }\n if (!order) { return get(sticky == \"before\" ? ch - 1 : ch, sticky == \"before\") }\n\n function getBidi(ch, partPos, invert) {\n var part = order[partPos], right = part.level == 1;\n return get(invert ? ch - 1 : ch, right != invert)\n }\n var partPos = getBidiPartAt(order, ch, sticky);\n var other = bidiOther;\n var val = getBidi(ch, partPos, sticky == \"before\");\n if (other != null) { val.other = getBidi(ch, other, sticky != \"before\"); }\n return val\n }", "function cursorCoords(cm, pos, context, lineObj, preparedMeasure, varHeight) {\n lineObj = lineObj || getLine(cm.doc, pos.line);\n if (!preparedMeasure) { preparedMeasure = prepareMeasureForLine(cm, lineObj); }\n function get(ch, right) {\n var m = measureCharPrepared(cm, preparedMeasure, ch, right ? \"right\" : \"left\", varHeight);\n if (right) { m.left = m.right; } else { m.right = m.left; }\n return intoCoordSystem(cm, lineObj, m, context)\n }\n var order = getOrder(lineObj, cm.doc.direction), ch = pos.ch, sticky = pos.sticky;\n if (ch >= lineObj.text.length) {\n ch = lineObj.text.length;\n sticky = \"before\";\n } else if (ch <= 0) {\n ch = 0;\n sticky = \"after\";\n }\n if (!order) { return get(sticky == \"before\" ? ch - 1 : ch, sticky == \"before\") }\n\n function getBidi(ch, partPos, invert) {\n var part = order[partPos], right = part.level == 1;\n return get(invert ? ch - 1 : ch, right != invert)\n }\n var partPos = getBidiPartAt(order, ch, sticky);\n var other = bidiOther;\n var val = getBidi(ch, partPos, sticky == \"before\");\n if (other != null) { val.other = getBidi(ch, other, sticky != \"before\"); }\n return val\n }", "function cursorCoords(cm, pos, context, lineObj, preparedMeasure, varHeight) {\n lineObj = lineObj || getLine(cm.doc, pos.line);\n if (!preparedMeasure) { preparedMeasure = prepareMeasureForLine(cm, lineObj); }\n function get(ch, right) {\n var m = measureCharPrepared(cm, preparedMeasure, ch, right ? \"right\" : \"left\", varHeight);\n if (right) { m.left = m.right; } else { m.right = m.left; }\n return intoCoordSystem(cm, lineObj, m, context)\n }\n var order = getOrder(lineObj, cm.doc.direction), ch = pos.ch, sticky = pos.sticky;\n if (ch >= lineObj.text.length) {\n ch = lineObj.text.length;\n sticky = \"before\";\n } else if (ch <= 0) {\n ch = 0;\n sticky = \"after\";\n }\n if (!order) { return get(sticky == \"before\" ? ch - 1 : ch, sticky == \"before\") }\n\n function getBidi(ch, partPos, invert) {\n var part = order[partPos], right = part.level == 1;\n return get(invert ? ch - 1 : ch, right != invert)\n }\n var partPos = getBidiPartAt(order, ch, sticky);\n var other = bidiOther;\n var val = getBidi(ch, partPos, sticky == \"before\");\n if (other != null) { val.other = getBidi(ch, other, sticky != \"before\"); }\n return val\n }", "function cursorCoords(cm, pos, context, lineObj, preparedMeasure, varHeight) {\n lineObj = lineObj || getLine(cm.doc, pos.line);\n if (!preparedMeasure) { preparedMeasure = prepareMeasureForLine(cm, lineObj); }\n function get(ch, right) {\n var m = measureCharPrepared(cm, preparedMeasure, ch, right ? \"right\" : \"left\", varHeight);\n if (right) { m.left = m.right; } else { m.right = m.left; }\n return intoCoordSystem(cm, lineObj, m, context)\n }\n var order = getOrder(lineObj, cm.doc.direction), ch = pos.ch, sticky = pos.sticky;\n if (ch >= lineObj.text.length) {\n ch = lineObj.text.length;\n sticky = \"before\";\n } else if (ch <= 0) {\n ch = 0;\n sticky = \"after\";\n }\n if (!order) { return get(sticky == \"before\" ? ch - 1 : ch, sticky == \"before\") }\n\n function getBidi(ch, partPos, invert) {\n var part = order[partPos], right = part.level == 1;\n return get(invert ? ch - 1 : ch, right != invert)\n }\n var partPos = getBidiPartAt(order, ch, sticky);\n var other = bidiOther;\n var val = getBidi(ch, partPos, sticky == \"before\");\n if (other != null) { val.other = getBidi(ch, other, sticky != \"before\"); }\n return val\n }", "function cursorCoords(cm, pos, context, lineObj, preparedMeasure, varHeight) {\n lineObj = lineObj || getLine(cm.doc, pos.line);\n if (!preparedMeasure) { preparedMeasure = prepareMeasureForLine(cm, lineObj); }\n function get(ch, right) {\n var m = measureCharPrepared(cm, preparedMeasure, ch, right ? \"right\" : \"left\", varHeight);\n if (right) { m.left = m.right; } else { m.right = m.left; }\n return intoCoordSystem(cm, lineObj, m, context)\n }\n var order = getOrder(lineObj, cm.doc.direction), ch = pos.ch, sticky = pos.sticky;\n if (ch >= lineObj.text.length) {\n ch = lineObj.text.length;\n sticky = \"before\";\n } else if (ch <= 0) {\n ch = 0;\n sticky = \"after\";\n }\n if (!order) { return get(sticky == \"before\" ? ch - 1 : ch, sticky == \"before\") }\n\n function getBidi(ch, partPos, invert) {\n var part = order[partPos], right = part.level == 1;\n return get(invert ? ch - 1 : ch, right != invert)\n }\n var partPos = getBidiPartAt(order, ch, sticky);\n var other = bidiOther;\n var val = getBidi(ch, partPos, sticky == \"before\");\n if (other != null) { val.other = getBidi(ch, other, sticky != \"before\"); }\n return val\n }", "function cursorCoords(cm, pos, context, lineObj, preparedMeasure, varHeight) {\n lineObj = lineObj || getLine(cm.doc, pos.line);\n if (!preparedMeasure) { preparedMeasure = prepareMeasureForLine(cm, lineObj); }\n function get(ch, right) {\n var m = measureCharPrepared(cm, preparedMeasure, ch, right ? \"right\" : \"left\", varHeight);\n if (right) { m.left = m.right; } else { m.right = m.left; }\n return intoCoordSystem(cm, lineObj, m, context)\n }\n var order = getOrder(lineObj, cm.doc.direction), ch = pos.ch, sticky = pos.sticky;\n if (ch >= lineObj.text.length) {\n ch = lineObj.text.length;\n sticky = \"before\";\n } else if (ch <= 0) {\n ch = 0;\n sticky = \"after\";\n }\n if (!order) { return get(sticky == \"before\" ? ch - 1 : ch, sticky == \"before\") }\n\n function getBidi(ch, partPos, invert) {\n var part = order[partPos], right = part.level == 1;\n return get(invert ? ch - 1 : ch, right != invert)\n }\n var partPos = getBidiPartAt(order, ch, sticky);\n var other = bidiOther;\n var val = getBidi(ch, partPos, sticky == \"before\");\n if (other != null) { val.other = getBidi(ch, other, sticky != \"before\"); }\n return val\n }", "function cursorCoords(cm, pos, context, lineObj, preparedMeasure, varHeight) {\n lineObj = lineObj || getLine(cm.doc, pos.line);\n if (!preparedMeasure) { preparedMeasure = prepareMeasureForLine(cm, lineObj); }\n function get(ch, right) {\n var m = measureCharPrepared(cm, preparedMeasure, ch, right ? \"right\" : \"left\", varHeight);\n if (right) { m.left = m.right; } else { m.right = m.left; }\n return intoCoordSystem(cm, lineObj, m, context)\n }\n var order = getOrder(lineObj, cm.doc.direction), ch = pos.ch, sticky = pos.sticky;\n if (ch >= lineObj.text.length) {\n ch = lineObj.text.length;\n sticky = \"before\";\n } else if (ch <= 0) {\n ch = 0;\n sticky = \"after\";\n }\n if (!order) { return get(sticky == \"before\" ? ch - 1 : ch, sticky == \"before\") }\n\n function getBidi(ch, partPos, invert) {\n var part = order[partPos], right = part.level == 1;\n return get(invert ? ch - 1 : ch, right != invert)\n }\n var partPos = getBidiPartAt(order, ch, sticky);\n var other = bidiOther;\n var val = getBidi(ch, partPos, sticky == \"before\");\n if (other != null) { val.other = getBidi(ch, other, sticky != \"before\"); }\n return val\n }", "function cursorCoords(cm, pos, context, lineObj, preparedMeasure, varHeight) {\n lineObj = lineObj || getLine(cm.doc, pos.line);\n if (!preparedMeasure) { preparedMeasure = prepareMeasureForLine(cm, lineObj); }\n function get(ch, right) {\n var m = measureCharPrepared(cm, preparedMeasure, ch, right ? \"right\" : \"left\", varHeight);\n if (right) { m.left = m.right; } else { m.right = m.left; }\n return intoCoordSystem(cm, lineObj, m, context)\n }\n var order = getOrder(lineObj, cm.doc.direction), ch = pos.ch, sticky = pos.sticky;\n if (ch >= lineObj.text.length) {\n ch = lineObj.text.length;\n sticky = \"before\";\n } else if (ch <= 0) {\n ch = 0;\n sticky = \"after\";\n }\n if (!order) { return get(sticky == \"before\" ? ch - 1 : ch, sticky == \"before\") }\n\n function getBidi(ch, partPos, invert) {\n var part = order[partPos], right = part.level == 1;\n return get(invert ? ch - 1 : ch, right != invert)\n }\n var partPos = getBidiPartAt(order, ch, sticky);\n var other = bidiOther;\n var val = getBidi(ch, partPos, sticky == \"before\");\n if (other != null) { val.other = getBidi(ch, other, sticky != \"before\"); }\n return val\n }", "function cursorCoords(cm, pos, context, lineObj, preparedMeasure, varHeight) {\n lineObj = lineObj || getLine(cm.doc, pos.line);\n if (!preparedMeasure) { preparedMeasure = prepareMeasureForLine(cm, lineObj); }\n function get(ch, right) {\n var m = measureCharPrepared(cm, preparedMeasure, ch, right ? \"right\" : \"left\", varHeight);\n if (right) { m.left = m.right; } else { m.right = m.left; }\n return intoCoordSystem(cm, lineObj, m, context)\n }\n var order = getOrder(lineObj, cm.doc.direction), ch = pos.ch, sticky = pos.sticky;\n if (ch >= lineObj.text.length) {\n ch = lineObj.text.length;\n sticky = \"before\";\n } else if (ch <= 0) {\n ch = 0;\n sticky = \"after\";\n }\n if (!order) { return get(sticky == \"before\" ? ch - 1 : ch, sticky == \"before\") }\n\n function getBidi(ch, partPos, invert) {\n var part = order[partPos], right = part.level == 1;\n return get(invert ? ch - 1 : ch, right != invert)\n }\n var partPos = getBidiPartAt(order, ch, sticky);\n var other = bidiOther;\n var val = getBidi(ch, partPos, sticky == \"before\");\n if (other != null) { val.other = getBidi(ch, other, sticky != \"before\"); }\n return val\n }", "function cursorCoords(cm, pos, context, lineObj, preparedMeasure, varHeight) {\n lineObj = lineObj || getLine(cm.doc, pos.line);\n if (!preparedMeasure) { preparedMeasure = prepareMeasureForLine(cm, lineObj); }\n function get(ch, right) {\n var m = measureCharPrepared(cm, preparedMeasure, ch, right ? \"right\" : \"left\", varHeight);\n if (right) { m.left = m.right; } else { m.right = m.left; }\n return intoCoordSystem(cm, lineObj, m, context)\n }\n var order = getOrder(lineObj, cm.doc.direction), ch = pos.ch, sticky = pos.sticky;\n if (ch >= lineObj.text.length) {\n ch = lineObj.text.length;\n sticky = \"before\";\n } else if (ch <= 0) {\n ch = 0;\n sticky = \"after\";\n }\n if (!order) { return get(sticky == \"before\" ? ch - 1 : ch, sticky == \"before\") }\n\n function getBidi(ch, partPos, invert) {\n var part = order[partPos], right = part.level == 1;\n return get(invert ? ch - 1 : ch, right != invert)\n }\n var partPos = getBidiPartAt(order, ch, sticky);\n var other = bidiOther;\n var val = getBidi(ch, partPos, sticky == \"before\");\n if (other != null) { val.other = getBidi(ch, other, sticky != \"before\"); }\n return val\n }", "function cursorCoords(cm, pos, context, lineObj, preparedMeasure, varHeight) {\n lineObj = lineObj || getLine(cm.doc, pos.line);\n if (!preparedMeasure) { preparedMeasure = prepareMeasureForLine(cm, lineObj); }\n function get(ch, right) {\n var m = measureCharPrepared(cm, preparedMeasure, ch, right ? \"right\" : \"left\", varHeight);\n if (right) { m.left = m.right; } else { m.right = m.left; }\n return intoCoordSystem(cm, lineObj, m, context)\n }\n var order = getOrder(lineObj, cm.doc.direction), ch = pos.ch, sticky = pos.sticky;\n if (ch >= lineObj.text.length) {\n ch = lineObj.text.length;\n sticky = \"before\";\n } else if (ch <= 0) {\n ch = 0;\n sticky = \"after\";\n }\n if (!order) { return get(sticky == \"before\" ? ch - 1 : ch, sticky == \"before\") }\n\n function getBidi(ch, partPos, invert) {\n var part = order[partPos], right = part.level == 1;\n return get(invert ? ch - 1 : ch, right != invert)\n }\n var partPos = getBidiPartAt(order, ch, sticky);\n var other = bidiOther;\n var val = getBidi(ch, partPos, sticky == \"before\");\n if (other != null) { val.other = getBidi(ch, other, sticky != \"before\"); }\n return val\n }", "function cursorCoords(cm, pos, context, lineObj, preparedMeasure, varHeight) {\n lineObj = lineObj || getLine(cm.doc, pos.line);\n if (!preparedMeasure) { preparedMeasure = prepareMeasureForLine(cm, lineObj); }\n function get(ch, right) {\n var m = measureCharPrepared(cm, preparedMeasure, ch, right ? \"right\" : \"left\", varHeight);\n if (right) { m.left = m.right; } else { m.right = m.left; }\n return intoCoordSystem(cm, lineObj, m, context)\n }\n var order = getOrder(lineObj, cm.doc.direction), ch = pos.ch, sticky = pos.sticky;\n if (ch >= lineObj.text.length) {\n ch = lineObj.text.length;\n sticky = \"before\";\n } else if (ch <= 0) {\n ch = 0;\n sticky = \"after\";\n }\n if (!order) { return get(sticky == \"before\" ? ch - 1 : ch, sticky == \"before\") }\n\n function getBidi(ch, partPos, invert) {\n var part = order[partPos], right = part.level == 1;\n return get(invert ? ch - 1 : ch, right != invert)\n }\n var partPos = getBidiPartAt(order, ch, sticky);\n var other = bidiOther;\n var val = getBidi(ch, partPos, sticky == \"before\");\n if (other != null) { val.other = getBidi(ch, other, sticky != \"before\"); }\n return val\n }", "function cursorCoords(cm, pos, context, lineObj, preparedMeasure, varHeight) {\n lineObj = lineObj || getLine(cm.doc, pos.line);\n if (!preparedMeasure) { preparedMeasure = prepareMeasureForLine(cm, lineObj); }\n function get(ch, right) {\n var m = measureCharPrepared(cm, preparedMeasure, ch, right ? \"right\" : \"left\", varHeight);\n if (right) { m.left = m.right; } else { m.right = m.left; }\n return intoCoordSystem(cm, lineObj, m, context)\n }\n var order = getOrder(lineObj, cm.doc.direction), ch = pos.ch, sticky = pos.sticky;\n if (ch >= lineObj.text.length) {\n ch = lineObj.text.length;\n sticky = \"before\";\n } else if (ch <= 0) {\n ch = 0;\n sticky = \"after\";\n }\n if (!order) { return get(sticky == \"before\" ? ch - 1 : ch, sticky == \"before\") }\n\n function getBidi(ch, partPos, invert) {\n var part = order[partPos], right = part.level == 1;\n return get(invert ? ch - 1 : ch, right != invert)\n }\n var partPos = getBidiPartAt(order, ch, sticky);\n var other = bidiOther;\n var val = getBidi(ch, partPos, sticky == \"before\");\n if (other != null) { val.other = getBidi(ch, other, sticky != \"before\"); }\n return val\n }", "function pointToOffset(point) {\n var line = point && point.line\n var column = point && point.column\n var offset\n\n if (!isNaN(line) && !isNaN(column) && line - 1 in indices) {\n offset = (indices[line - 2] || 0) + column - 1 || 0\n }\n\n return offset > -1 && offset < indices[indices.length - 1] ? offset : -1\n }", "function pointToOffset(point) {\n var line = point && point.line\n var column = point && point.column\n var offset\n\n if (!isNaN(line) && !isNaN(column) && line - 1 in indices) {\n offset = (indices[line - 2] || 0) + column - 1 || 0\n }\n\n return offset > -1 && offset < indices[indices.length - 1] ? offset : -1\n }", "function cursorCoords(cm, pos, context, lineObj, preparedMeasure, varHeight) {\n lineObj = lineObj || getLine(cm.doc, pos.line);\n if (!preparedMeasure) { preparedMeasure = prepareMeasureForLine(cm, lineObj); }\n function get(ch, right) {\n var m = measureCharPrepared(cm, preparedMeasure, ch, right ? \"right\" : \"left\", varHeight);\n if (right) { m.left = m.right; } else { m.right = m.left; }\n return intoCoordSystem(cm, lineObj, m, context)\n }\n var order = getOrder(lineObj, cm.doc.direction), ch = pos.ch, sticky = pos.sticky;\n if (ch >= lineObj.text.length) {\n ch = lineObj.text.length;\n sticky = \"before\";\n } else if (ch <= 0) {\n ch = 0;\n sticky = \"after\";\n }\n if (!order) { return get(sticky == \"before\" ? ch - 1 : ch, sticky == \"before\") }\n\n function getBidi(ch, partPos, invert) {\n var part = order[partPos], right = part.level == 1;\n return get(invert ? ch - 1 : ch, right != invert)\n }\n var partPos = getBidiPartAt(order, ch, sticky);\n var other = bidiOther;\n var val = getBidi(ch, partPos, sticky == \"before\");\n if (other != null) { val.other = getBidi(ch, other, sticky != \"before\"); }\n return val\n}", "function cursorCoords(cm, pos, context, lineObj, preparedMeasure, varHeight) {\n lineObj = lineObj || getLine(cm.doc, pos.line);\n if (!preparedMeasure) { preparedMeasure = prepareMeasureForLine(cm, lineObj); }\n function get(ch, right) {\n var m = measureCharPrepared(cm, preparedMeasure, ch, right ? \"right\" : \"left\", varHeight);\n if (right) { m.left = m.right; } else { m.right = m.left; }\n return intoCoordSystem(cm, lineObj, m, context)\n }\n var order = getOrder(lineObj, cm.doc.direction), ch = pos.ch, sticky = pos.sticky;\n if (ch >= lineObj.text.length) {\n ch = lineObj.text.length;\n sticky = \"before\";\n } else if (ch <= 0) {\n ch = 0;\n sticky = \"after\";\n }\n if (!order) { return get(sticky == \"before\" ? ch - 1 : ch, sticky == \"before\") }\n\n function getBidi(ch, partPos, invert) {\n var part = order[partPos], right = part.level == 1;\n return get(invert ? ch - 1 : ch, right != invert)\n }\n var partPos = getBidiPartAt(order, ch, sticky);\n var other = bidiOther;\n var val = getBidi(ch, partPos, sticky == \"before\");\n if (other != null) { val.other = getBidi(ch, other, sticky != \"before\"); }\n return val\n}", "function cursorCoords(cm, pos, context, lineObj, preparedMeasure, varHeight) {\n lineObj = lineObj || getLine(cm.doc, pos.line);\n if (!preparedMeasure) { preparedMeasure = prepareMeasureForLine(cm, lineObj); }\n function get(ch, right) {\n var m = measureCharPrepared(cm, preparedMeasure, ch, right ? \"right\" : \"left\", varHeight);\n if (right) { m.left = m.right; } else { m.right = m.left; }\n return intoCoordSystem(cm, lineObj, m, context)\n }\n var order = getOrder(lineObj, cm.doc.direction), ch = pos.ch, sticky = pos.sticky;\n if (ch >= lineObj.text.length) {\n ch = lineObj.text.length;\n sticky = \"before\";\n } else if (ch <= 0) {\n ch = 0;\n sticky = \"after\";\n }\n if (!order) { return get(sticky == \"before\" ? ch - 1 : ch, sticky == \"before\") }\n\n function getBidi(ch, partPos, invert) {\n var part = order[partPos], right = part.level == 1;\n return get(invert ? ch - 1 : ch, right != invert)\n }\n var partPos = getBidiPartAt(order, ch, sticky);\n var other = bidiOther;\n var val = getBidi(ch, partPos, sticky == \"before\");\n if (other != null) { val.other = getBidi(ch, other, sticky != \"before\"); }\n return val\n}", "function cursorCoords(cm, pos, context, lineObj, preparedMeasure, varHeight) {\n lineObj = lineObj || getLine(cm.doc, pos.line);\n if (!preparedMeasure) { preparedMeasure = prepareMeasureForLine(cm, lineObj); }\n function get(ch, right) {\n var m = measureCharPrepared(cm, preparedMeasure, ch, right ? \"right\" : \"left\", varHeight);\n if (right) { m.left = m.right; } else { m.right = m.left; }\n return intoCoordSystem(cm, lineObj, m, context)\n }\n var order = getOrder(lineObj, cm.doc.direction), ch = pos.ch, sticky = pos.sticky;\n if (ch >= lineObj.text.length) {\n ch = lineObj.text.length;\n sticky = \"before\";\n } else if (ch <= 0) {\n ch = 0;\n sticky = \"after\";\n }\n if (!order) { return get(sticky == \"before\" ? ch - 1 : ch, sticky == \"before\") }\n\n function getBidi(ch, partPos, invert) {\n var part = order[partPos], right = part.level == 1;\n return get(invert ? ch - 1 : ch, right != invert)\n }\n var partPos = getBidiPartAt(order, ch, sticky);\n var other = bidiOther;\n var val = getBidi(ch, partPos, sticky == \"before\");\n if (other != null) { val.other = getBidi(ch, other, sticky != \"before\"); }\n return val\n}", "function cursorCoords(cm, pos, context, lineObj, preparedMeasure, varHeight) {\n lineObj = lineObj || getLine(cm.doc, pos.line);\n if (!preparedMeasure) { preparedMeasure = prepareMeasureForLine(cm, lineObj); }\n function get(ch, right) {\n var m = measureCharPrepared(cm, preparedMeasure, ch, right ? \"right\" : \"left\", varHeight);\n if (right) { m.left = m.right; } else { m.right = m.left; }\n return intoCoordSystem(cm, lineObj, m, context)\n }\n var order = getOrder(lineObj, cm.doc.direction), ch = pos.ch, sticky = pos.sticky;\n if (ch >= lineObj.text.length) {\n ch = lineObj.text.length;\n sticky = \"before\";\n } else if (ch <= 0) {\n ch = 0;\n sticky = \"after\";\n }\n if (!order) { return get(sticky == \"before\" ? ch - 1 : ch, sticky == \"before\") }\n\n function getBidi(ch, partPos, invert) {\n var part = order[partPos], right = part.level == 1;\n return get(invert ? ch - 1 : ch, right != invert)\n }\n var partPos = getBidiPartAt(order, ch, sticky);\n var other = bidiOther;\n var val = getBidi(ch, partPos, sticky == \"before\");\n if (other != null) { val.other = getBidi(ch, other, sticky != \"before\"); }\n return val\n}", "function cursorCoords(cm, pos, context, lineObj, preparedMeasure, varHeight) {\n lineObj = lineObj || getLine(cm.doc, pos.line);\n if (!preparedMeasure) { preparedMeasure = prepareMeasureForLine(cm, lineObj); }\n function get(ch, right) {\n var m = measureCharPrepared(cm, preparedMeasure, ch, right ? \"right\" : \"left\", varHeight);\n if (right) { m.left = m.right; } else { m.right = m.left; }\n return intoCoordSystem(cm, lineObj, m, context)\n }\n var order = getOrder(lineObj, cm.doc.direction), ch = pos.ch, sticky = pos.sticky;\n if (ch >= lineObj.text.length) {\n ch = lineObj.text.length;\n sticky = \"before\";\n } else if (ch <= 0) {\n ch = 0;\n sticky = \"after\";\n }\n if (!order) { return get(sticky == \"before\" ? ch - 1 : ch, sticky == \"before\") }\n\n function getBidi(ch, partPos, invert) {\n var part = order[partPos], right = part.level == 1;\n return get(invert ? ch - 1 : ch, right != invert)\n }\n var partPos = getBidiPartAt(order, ch, sticky);\n var other = bidiOther;\n var val = getBidi(ch, partPos, sticky == \"before\");\n if (other != null) { val.other = getBidi(ch, other, sticky != \"before\"); }\n return val\n}", "function cursorCoords(cm, pos, context, lineObj, preparedMeasure, varHeight) {\n lineObj = lineObj || getLine(cm.doc, pos.line);\n if (!preparedMeasure) { preparedMeasure = prepareMeasureForLine(cm, lineObj); }\n function get(ch, right) {\n var m = measureCharPrepared(cm, preparedMeasure, ch, right ? \"right\" : \"left\", varHeight);\n if (right) { m.left = m.right; } else { m.right = m.left; }\n return intoCoordSystem(cm, lineObj, m, context)\n }\n var order = getOrder(lineObj, cm.doc.direction), ch = pos.ch, sticky = pos.sticky;\n if (ch >= lineObj.text.length) {\n ch = lineObj.text.length;\n sticky = \"before\";\n } else if (ch <= 0) {\n ch = 0;\n sticky = \"after\";\n }\n if (!order) { return get(sticky == \"before\" ? ch - 1 : ch, sticky == \"before\") }\n\n function getBidi(ch, partPos, invert) {\n var part = order[partPos], right = part.level == 1;\n return get(invert ? ch - 1 : ch, right != invert)\n }\n var partPos = getBidiPartAt(order, ch, sticky);\n var other = bidiOther;\n var val = getBidi(ch, partPos, sticky == \"before\");\n if (other != null) { val.other = getBidi(ch, other, sticky != \"before\"); }\n return val\n}", "function cursorCoords(cm, pos, context, lineObj, preparedMeasure, varHeight) {\n lineObj = lineObj || getLine(cm.doc, pos.line);\n if (!preparedMeasure) { preparedMeasure = prepareMeasureForLine(cm, lineObj); }\n function get(ch, right) {\n var m = measureCharPrepared(cm, preparedMeasure, ch, right ? \"right\" : \"left\", varHeight);\n if (right) { m.left = m.right; } else { m.right = m.left; }\n return intoCoordSystem(cm, lineObj, m, context)\n }\n var order = getOrder(lineObj, cm.doc.direction), ch = pos.ch, sticky = pos.sticky;\n if (ch >= lineObj.text.length) {\n ch = lineObj.text.length;\n sticky = \"before\";\n } else if (ch <= 0) {\n ch = 0;\n sticky = \"after\";\n }\n if (!order) { return get(sticky == \"before\" ? ch - 1 : ch, sticky == \"before\") }\n\n function getBidi(ch, partPos, invert) {\n var part = order[partPos], right = part.level == 1;\n return get(invert ? ch - 1 : ch, right != invert)\n }\n var partPos = getBidiPartAt(order, ch, sticky);\n var other = bidiOther;\n var val = getBidi(ch, partPos, sticky == \"before\");\n if (other != null) { val.other = getBidi(ch, other, sticky != \"before\"); }\n return val\n}", "function cursorCoords(cm, pos, context, lineObj, preparedMeasure, varHeight) {\n lineObj = lineObj || getLine(cm.doc, pos.line);\n if (!preparedMeasure) { preparedMeasure = prepareMeasureForLine(cm, lineObj); }\n function get(ch, right) {\n var m = measureCharPrepared(cm, preparedMeasure, ch, right ? \"right\" : \"left\", varHeight);\n if (right) { m.left = m.right; } else { m.right = m.left; }\n return intoCoordSystem(cm, lineObj, m, context)\n }\n var order = getOrder(lineObj, cm.doc.direction), ch = pos.ch, sticky = pos.sticky;\n if (ch >= lineObj.text.length) {\n ch = lineObj.text.length;\n sticky = \"before\";\n } else if (ch <= 0) {\n ch = 0;\n sticky = \"after\";\n }\n if (!order) { return get(sticky == \"before\" ? ch - 1 : ch, sticky == \"before\") }\n\n function getBidi(ch, partPos, invert) {\n var part = order[partPos], right = part.level == 1;\n return get(invert ? ch - 1 : ch, right != invert)\n }\n var partPos = getBidiPartAt(order, ch, sticky);\n var other = bidiOther;\n var val = getBidi(ch, partPos, sticky == \"before\");\n if (other != null) { val.other = getBidi(ch, other, sticky != \"before\"); }\n return val\n}", "function cursorCoords(cm, pos, context, lineObj, preparedMeasure, varHeight) {\n lineObj = lineObj || getLine(cm.doc, pos.line);\n if (!preparedMeasure) { preparedMeasure = prepareMeasureForLine(cm, lineObj); }\n function get(ch, right) {\n var m = measureCharPrepared(cm, preparedMeasure, ch, right ? \"right\" : \"left\", varHeight);\n if (right) { m.left = m.right; } else { m.right = m.left; }\n return intoCoordSystem(cm, lineObj, m, context)\n }\n var order = getOrder(lineObj, cm.doc.direction), ch = pos.ch, sticky = pos.sticky;\n if (ch >= lineObj.text.length) {\n ch = lineObj.text.length;\n sticky = \"before\";\n } else if (ch <= 0) {\n ch = 0;\n sticky = \"after\";\n }\n if (!order) { return get(sticky == \"before\" ? ch - 1 : ch, sticky == \"before\") }\n\n function getBidi(ch, partPos, invert) {\n var part = order[partPos], right = part.level == 1;\n return get(invert ? ch - 1 : ch, right != invert)\n }\n var partPos = getBidiPartAt(order, ch, sticky);\n var other = bidiOther;\n var val = getBidi(ch, partPos, sticky == \"before\");\n if (other != null) { val.other = getBidi(ch, other, sticky != \"before\"); }\n return val\n}", "function cursorCoords(cm, pos, context, lineObj, preparedMeasure, varHeight) {\n lineObj = lineObj || getLine(cm.doc, pos.line);\n if (!preparedMeasure) { preparedMeasure = prepareMeasureForLine(cm, lineObj); }\n function get(ch, right) {\n var m = measureCharPrepared(cm, preparedMeasure, ch, right ? \"right\" : \"left\", varHeight);\n if (right) { m.left = m.right; } else { m.right = m.left; }\n return intoCoordSystem(cm, lineObj, m, context)\n }\n var order = getOrder(lineObj, cm.doc.direction), ch = pos.ch, sticky = pos.sticky;\n if (ch >= lineObj.text.length) {\n ch = lineObj.text.length;\n sticky = \"before\";\n } else if (ch <= 0) {\n ch = 0;\n sticky = \"after\";\n }\n if (!order) { return get(sticky == \"before\" ? ch - 1 : ch, sticky == \"before\") }\n\n function getBidi(ch, partPos, invert) {\n var part = order[partPos], right = (part.level % 2) != 0;\n return get(invert ? ch - 1 : ch, right != invert)\n }\n var partPos = getBidiPartAt(order, ch, sticky);\n var other = bidiOther;\n var val = getBidi(ch, partPos, sticky == \"before\");\n if (other != null) { val.other = getBidi(ch, other, sticky != \"before\"); }\n return val\n}", "function _cursorCoords(cm, pos, context, lineObj, preparedMeasure, varHeight) {\n lineObj = lineObj || getLine(cm.doc, pos.line);\n\n if (!preparedMeasure) {\n preparedMeasure = prepareMeasureForLine(cm, lineObj);\n }\n\n function get(ch, right) {\n var m = measureCharPrepared(cm, preparedMeasure, ch, right ? \"right\" : \"left\", varHeight);\n\n if (right) {\n m.left = m.right;\n } else {\n m.right = m.left;\n }\n\n return intoCoordSystem(cm, lineObj, m, context);\n }\n\n var order = getOrder(lineObj, cm.doc.direction),\n ch = pos.ch,\n sticky = pos.sticky;\n\n if (ch >= lineObj.text.length) {\n ch = lineObj.text.length;\n sticky = \"before\";\n } else if (ch <= 0) {\n ch = 0;\n sticky = \"after\";\n }\n\n if (!order) {\n return get(sticky == \"before\" ? ch - 1 : ch, sticky == \"before\");\n }\n\n function getBidi(ch, partPos, invert) {\n var part = order[partPos],\n right = part.level == 1;\n return get(invert ? ch - 1 : ch, right != invert);\n }\n\n var partPos = getBidiPartAt(order, ch, sticky);\n var other = bidiOther;\n var val = getBidi(ch, partPos, sticky == \"before\");\n\n if (other != null) {\n val.other = getBidi(ch, other, sticky != \"before\");\n }\n\n return val;\n } // Used to cheaply estimate the coordinates for a position. Used for" ]
[ "0.6476816", "0.6476816", "0.6476816", "0.6438751", "0.6400837", "0.6370719", "0.6370719", "0.63069415", "0.61469966", "0.60152006", "0.59834266", "0.59607756", "0.59607756", "0.59607756", "0.59607756", "0.59607756", "0.59607756", "0.59607756", "0.59607756", "0.59309113", "0.5923774", "0.5923774", "0.5923774", "0.5923774", "0.5923774", "0.5923774", "0.5923774", "0.5923774", "0.5923774", "0.5923774", "0.5923774", "0.5923774", "0.5923774", "0.5923774", "0.5923774", "0.5923774", "0.5923774", "0.59204394", "0.5917698", "0.5917698", "0.59021896", "0.59021896", "0.59021896", "0.59021896", "0.59021896", "0.59021896", "0.59021896", "0.59021896", "0.59021896", "0.59021896", "0.59021896", "0.5901378", "0.5899448", "0.5899448", "0.5899448", "0.589644", "0.589644", "0.589644", "0.589644", "0.589644", "0.5887222", "0.58859086", "0.5877513", "0.58728945", "0.5844415", "0.58243847", "0.58243847", "0.58243847", "0.58243847", "0.58243847", "0.58243847", "0.58243847", "0.58243847", "0.58243847", "0.58243847", "0.58243847", "0.58243847", "0.58243847", "0.58243847", "0.58243847", "0.58243847", "0.58243847", "0.58208656", "0.58208656", "0.58194435", "0.58194435", "0.58194435", "0.58194435", "0.58194435", "0.58194435", "0.58194435", "0.58194435", "0.58194435", "0.58194435", "0.5818882", "0.58039415" ]
0.6808515
4
Get indices of linebreaks in `value`.
function indices(value) { var result = [] var index = value.indexOf('\n') while (index !== -1) { result.push(index + 1) index = value.indexOf('\n', index + 1) } result.push(value.length + 1) return result }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function lineCount(value) {\n var count = 0;\n for (var _i = 0, value_1 = value; _i < value_1.length; _i++) {\n var char = value_1[_i];\n if (char === '\\n') {\n count++;\n }\n }\n return count;\n}", "function computeLineStartsMap(text) {\n const result = [0];\n let pos = 0;\n while (pos < text.length) {\n const char = text.charCodeAt(pos++);\n // Handles the \"CRLF\" line break. In that case we peek the character\n // after the \"CR\" and check if it is a line feed.\n if (char === CR_CHAR) {\n if (text.charCodeAt(pos) === LF_CHAR) {\n pos++;\n }\n result.push(pos);\n }\n else if (char === LF_CHAR || char === LINE_SEP_CHAR || char === PARAGRAPH_CHAR) {\n result.push(pos);\n }\n }\n result.push(pos);\n return result;\n }", "get lineBreaks() { return 0; }", "get widgetLineBreaks() {\n return typeof this._content == \"number\" ? this._content : 0;\n }", "function getLineNumberTag(properties){\n for (let i = 0; i < properties.length; i++) {\n const element = properties[i];\n if(properties[i].attributeName === 'LineNumberTag'){\n return properties[i].displayValue;\n }\n }\n}", "function getLineNumber(pos, el){\n if (pos == null)\n return -1;\n //console.log(caretPos);\n\n var curr_line = 0;\n var text = \"\";\n if (el != undefined){\n text = el.value;\n }\n\n //go through, checking for a newline, adding one for each\n for (var i = 0; i < pos; i++){\n if (text[i] === \"\\n\"){\n curr_line++;\n }\n }\n return curr_line;\n}", "function calculateLineNumber(fiddleValue) {\n const lines = fiddleValue.split(/\\n/);\n let newLines = '';\n newLines = lines.map((line, index) => {\n const consReg = /(console\\.log\\()(.*)/;\n // separate console.log from original string and split it in to\n // \"console.log(\" and \")\"\n const clgLines = line.match(consReg);\n if (clgLines) {\n // Add line no: to console.log and join it with rest of the original line.\n // return line.slice(0, clgLines.index) + clgLines[1] + `'${index+1}: ' + ` +clgLines[2];\n return `${line.slice(0, clgLines.index) + clgLines[1]}'${index + 1}: ' + ${clgLines[2]}`;\n }\n return line;\n });\n return newLines.join('\\n');\n}", "find(value) {\n const matches = [];\n this._viewCells.forEach(cell => {\n const cellMatches = cell.startFind(value);\n if (cellMatches) {\n matches.push(cellMatches);\n }\n });\n return matches;\n }", "getLineNumberForIndex(index) {\n const code = this.tokens.code;\n while (this.lastIndex < index && this.lastIndex < code.length) {\n if (code[this.lastIndex] === \"\\n\") {\n this.lastLineNumber++;\n }\n this.lastIndex++;\n }\n return this.lastLineNumber;\n }", "findAll(value) {\n if(this.isEmpty()) return null;\n let indexes = []\n this.forEachNode( (currentNode, index) => {\n if(currentNode.value === value) return indexes.push(index);\n }, indexes)\n\n return indexes.length ? indexes : null;\n }", "function getClassId(val, breaks) {\n var i = 0;\n if (!utils.isValidNumber(val)) {\n return -1;\n }\n while (i < breaks.length && val >= breaks[i]) i++;\n return i;\n }", "function za(e){if(!e.options.lineNumbers)return!1;var t=e.doc,a=L(e.options,t.first+t.size-1),r=e.display;if(a.length!=r.lineNumChars){var f=r.measure.appendChild(n(\"div\",[n(\"div\",a)],\"CodeMirror-linenumber CodeMirror-gutter-elt\")),o=f.firstChild.offsetWidth,i=f.offsetWidth-o;return r.lineGutter.style.width=\"\",r.lineNumInnerWidth=Math.max(o,r.lineGutter.offsetWidth-i)+1,r.lineNumWidth=r.lineNumInnerWidth+i,r.lineNumChars=r.lineNumInnerWidth?a.length:-1,r.lineGutter.style.width=r.lineNumWidth+\"px\",In(e),!0}return!1}", "function lineNumbers(config = {}) {\n return [\n lineNumberConfig.of(config),\n gutters(),\n lineNumberGutter\n ];\n}", "function getSectionRowCount(value) {\n let sectionRowCount = 0;\n if (Array.isArray(value)) {\n for (let row = 0; row < value.length; row++) {\n const rowData = value[row];\n if (rowData.lineType === constants.PDFDocumentLineType.SINGLE_COLUMN) {\n if (sectionRowCount % 1 !== 0) { // caters for when colums end unequal\n sectionRowCount += 0.5;\n }\n sectionRowCount++;\n } else {\n sectionRowCount += 0.5;\n }\n }\n if (sectionRowCount % 1 !== 0) { // caters for when colums end unequal\n sectionRowCount += 0.5;\n }\n // console.log(`Value's length ${value.length} customRow's value ${customRows}`);\n } else {\n // console.log(\"Value is not an Array as expected\")\n }\n return sectionRowCount;\n}", "function get_class(value) {\n for (var i = 1; i < classBreaks.length - 1; i++) { // breaks[0] = dataMin\n if (value <= classBreaks[i]) {\n return i;\n }\n }\n return classBreaks.length - 1;\n}", "getNextValidOffset(line, offset) {\n let count = 0;\n if (!line.paragraph.paragraphFormat.bidi) {\n for (let i = 0; i < line.children.length; i++) {\n let inline = line.children[i];\n if (inline.length === 0 || inline instanceof ListTextElementBox) {\n continue;\n }\n if (offset < count + inline.length) {\n if (inline instanceof TextElementBox || inline instanceof ImageElementBox\n || (inline instanceof FieldElementBox && HelperMethods.isLinkedFieldCharacter(inline))) {\n return (offset > count ? offset : count) + 1;\n }\n }\n count += inline.length;\n }\n }\n else {\n if (offset !== this.getLineLength(line)) {\n offset = line.getInlineForOffset(offset, false, undefined, false, false, true).index;\n }\n }\n return offset;\n }", "calculateLineIndex(startPosition){\n\t\tthis.lineIndex = startPosition + this.top;\n\t\tthis.lineCount = Math.ceil((this.title.length +this.value.length + this.titleSpacing) / process.stdout.columns);\n\t\treturn this.lineIndex + this.lineCount+ this.bottom;\n\t}", "calculateLineIndex(startPosition){\n\t\tthis.lineIndex = startPosition + this.top;\n\t\tthis.lineCount = Math.ceil((this.title.length +this.value.length + this.titleSpacing) / process.stdout.columns);\n\t\treturn this.lineIndex + this.lineCount+ this.bottom;\n\t}", "function indicesOf(array, value) {\n var indices = [];\n for (var i=0; i<array.length; i++) {\n if (array[i] == value) {\n indices.push(i);\n };\n };\n \n return indices;\n}", "function injectLineNumbers(tokens, idx, options, env, slf) {\n var line;\n if (tokens[idx].map && tokens[idx].level === 0) {\n line = tokens[idx].map[0];\n tokens[idx].attrJoin('class', 'line');\n tokens[idx].attrSet('data-line', String(line));\n }\n return slf.renderToken(tokens, idx, options, env, slf);\n }", "function injectLineNumbers(tokens, idx, options, env, slf) {\n var line;\n if (tokens[idx].map && tokens[idx].level === 0) {\n line = tokens[idx].map[0];\n tokens[idx].attrJoin('class', 'line');\n tokens[idx].attrSet('data-line', String(line));\n }\n return slf.renderToken(tokens, idx, options, env, slf);\n }", "function getValueLocator(Value) {\n return Value.slice(Value.lastIndexOf(\"value=\") + 7, Value.lastIndexOf(\"value=\") + 8);\n}", "function formatLines(prefix, indent, value) {\n return value.split('\\n').map(function (line) {\n return formatFirstLine(prefix, indent, line);\n }).join('\\n');\n}", "function process_code_lines() {\r\n\tconst pre = document.getElementsByTagName('pre'),\r\n\tpl = pre.length;\r\n for (let i = 0; i < pl; i++) {\r\n pre[i].innerHTML = '<span class=\"line-number\"></span>' + pre[i].innerHTML + '<span class=\"cl\"></span>';\r\n let num = pre[i].innerHTML.split(/\\n/).length;\r\n for (let j = 0; j < num; j++) {\r\n let line_num = pre[i].getElementsByTagName('span')[0];\r\n line_num.innerHTML += '<span>' + (j + 1) + '</span>';\r\n }\r\n }\r\n}", "function locator(value, fromIndex) {\n const index = value.indexOf(START, fromIndex);\n return index;\n}", "function getLineElementsAtPageOffset(offset) {\n\t\tconst lines = document.getElementsByClassName('code-line');\n\t\tconst position = offset - window.scrollY;\n\t\tlet previous = null;\n\t\tfor (const element of lines) {\n\t\t\tconst line = +element.getAttribute('data-line');\n\t\t\tif (isNaN(line)) {\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tconst bounds = element.getBoundingClientRect();\n\t\t\tconst entry = { element, line };\n\t\t\tif (position < bounds.top) {\n\t\t\t\tif (previous && previous.fractional < 1) {\n\t\t\t\t\tprevious.line += previous.fractional;\n\t\t\t\t\treturn { previous };\n\t\t\t\t}\n\t\t\t\treturn { previous, next: entry };\n\t\t\t}\n\t\t\tentry.fractional = (position - bounds.top) / (bounds.height);\n\t\t\tprevious = entry;\n\t\t}\n\t\treturn { previous };\n\t}", "function linePos(area) { return lineBefore(area).length; }", "function findLine (content) {\n let index = 0;\n while (index < lines.length) {\n if (lines[index] == content)\n break;\n else index++;\n }\n return index;\n }", "function getLineInfo(input, offset) {\n for (var line = 1, cur = 0;;) {\n lineBreakG.lastIndex = cur;\n var match = lineBreakG.exec(input);\n if (match && match.index < offset) {\n ++line;\n cur = match.index + match[0].length;\n } else {\n return new Position(line, offset - cur)\n }\n }\n }", "function getLineInfo(input, offset) {\n for (var line = 1, cur = 0;;) {\n lineBreakG.lastIndex = cur;\n var match = lineBreakG.exec(input);\n if (match && match.index < offset) {\n ++line;\n cur = match.index + match[0].length;\n } else {\n return new Position(line, offset - cur)\n }\n }\n }", "valueReformattedForMultilines(value) {\n if (typeof(value)==\"string\") return(value.replace(/\\n/ig,\"<br/>\"));\n else return(value);\n }", "function getLineInfo(input, offset) {\n for (var line = 1, cur = 0;;) {\n lineBreakG.lastIndex = cur\n var match = lineBreakG.exec(input)\n if (match && match.index < offset) {\n ++line\n cur = match.index + match[0].length\n } else {\n return new Position(line, offset - cur)\n }\n }\n}", "function getLineInfo(input, offset) {\n for (var line = 1, cur = 0;;) {\n lineBreakG.lastIndex = cur\n var match = lineBreakG.exec(input)\n if (match && match.index < offset) {\n ++line\n cur = match.index + match[0].length\n } else {\n return new Position(line, offset - cur)\n }\n }\n}", "function getLineInfo(input, offset) {\n for (var line = 1, cur = 0;;) {\n lineBreakG.lastIndex = cur;\n var match = lineBreakG.exec(input);\n\n if (match && match.index < offset) {\n ++line;\n cur = match.index + match[0].length;\n } else {\n return new Position(line, offset - cur);\n }\n }\n }", "indexOf(value) {\n let node = this.head, i = 0;\n while (node) {\n if (node.value === value) return i;\n node = node.next;\n i++;\n }\n return -1;\n }", "function getLineInfo(input, offset) {\n for (var line = 1, cur = 0;;) {\n lineBreakG.lastIndex = cur;\n var match = lineBreakG.exec(input);\n if (match && match.index < offset) {\n ++line;\n cur = match.index + match[0].length;\n } else {\n return new Position(line, offset - cur)\n }\n }\n}", "function getLineInfo(input, offset) {\n for (var line = 1, cur = 0;;) {\n lineBreakG.lastIndex = cur;\n var match = lineBreakG.exec(input);\n if (match && match.index < offset) {\n ++line;\n cur = match.index + match[0].length;\n } else {\n return new Position(line, offset - cur)\n }\n }\n}", "function getLineInfo(input, offset) {\n for (var line = 1, cur = 0;;) {\n lineBreakG.lastIndex = cur;\n var match = lineBreakG.exec(input);\n if (match && match.index < offset) {\n ++line;\n cur = match.index + match[0].length;\n } else {\n return new Position(line, offset - cur)\n }\n }\n}", "function getLineInfo(input, offset) {\n for (var line = 1, cur = 0;;) {\n lineBreakG.lastIndex = cur;\n var match = lineBreakG.exec(input);\n if (match && match.index < offset) {\n ++line;\n cur = match.index + match[0].length;\n } else {\n return new Position(line, offset - cur)\n }\n }\n}", "function getLineInfo(input, offset) {\n for (var line = 1, cur = 0;;) {\n lineBreakG.lastIndex = cur;\n var match = lineBreakG.exec(input);\n if (match && match.index < offset) {\n ++line;\n cur = match.index + match[0].length;\n } else {\n return new Position(line, offset - cur)\n }\n }\n}", "function getLineInfo(input, offset) {\n for (var line = 1, cur = 0;;) {\n lineBreakG.lastIndex = cur;\n var match = lineBreakG.exec(input);\n if (match && match.index < offset) {\n ++line;\n cur = match.index + match[0].length;\n } else {\n return new Position(line, offset - cur)\n }\n }\n}", "function getLineInfo(input, offset) {\n for (var line = 1, cur = 0;;) {\n lineBreakG.lastIndex = cur;\n var match = lineBreakG.exec(input);\n if (match && match.index < offset) {\n ++line;\n cur = match.index + match[0].length;\n } else {\n return new Position(line, offset - cur)\n }\n }\n}", "function getLineInfo(input, offset) {\n for (var line = 1, cur = 0;;) {\n lineBreakG.lastIndex = cur;\n var match = lineBreakG.exec(input);\n if (match && match.index < offset) {\n ++line;\n cur = match.index + match[0].length;\n } else {\n return new Position(line, offset - cur)\n }\n }\n}", "function getLineInfo(input, offset) {\n for (var line = 1, cur = 0;;) {\n lineBreakG.lastIndex = cur;\n var match = lineBreakG.exec(input);\n if (match && match.index < offset) {\n ++line;\n cur = match.index + match[0].length;\n } else {\n return new Position(line, offset - cur)\n }\n }\n}", "function getLineInfo(input, offset) {\n for (var line = 1, cur = 0;;) {\n lineBreakG.lastIndex = cur;\n var match = lineBreakG.exec(input);\n if (match && match.index < offset) {\n ++line;\n cur = match.index + match[0].length;\n } else {\n return new Position(line, offset - cur)\n }\n }\n}", "function getLineInfo(input, offset) {\n\t for (var line = 1, cur = 0;;) {\n\t lineBreakG.lastIndex = cur;\n\t var match = lineBreakG.exec(input);\n\t if (match && match.index < offset) {\n\t ++line;\n\t cur = match.index + match[0].length;\n\t } else {\n\t return new Position(line, offset - cur);\n\t }\n\t }\n\t}", "function getLineInfo(input, offset) {\n\t for (var line = 1, cur = 0;;) {\n\t lineBreakG.lastIndex = cur;\n\t var match = lineBreakG.exec(input);\n\t if (match && match.index < offset) {\n\t ++line;\n\t cur = match.index + match[0].length;\n\t } else {\n\t return new Position(line, offset - cur);\n\t }\n\t }\n\t}", "function getLineInfo(input, offset) {\n\t for (var line = 1, cur = 0;;) {\n\t _whitespace.lineBreakG.lastIndex = cur;\n\t var match = _whitespace.lineBreakG.exec(input);\n\t if (match && match.index < offset) {\n\t ++line;\n\t cur = match.index + match[0].length;\n\t } else {\n\t return new Position(line, offset - cur);\n\t }\n\t }\n\t}", "function getLineInfo(input, offset) {\n\t for (var line = 1, cur = 0;;) {\n\t _whitespace.lineBreakG.lastIndex = cur;\n\t var match = _whitespace.lineBreakG.exec(input);\n\t if (match && match.index < offset) {\n\t ++line;\n\t cur = match.index + match[0].length;\n\t } else {\n\t return new Position(line, offset - cur);\n\t }\n\t }\n\t}", "function getLineInfo(input, offset) {\n for (var line = 1, cur = 0;;) {\n lineBreakG.lastIndex = cur;\n var match = lineBreakG.exec(input);\n if (match && match.index < offset) {\n ++line;\n cur = match.index + match[0].length;\n } else {\n return new Position(line, offset - cur);\n }\n }\n}", "function getLineInfo(input, offset) {\n for (var line = 1, cur = 0;;) {\n lineBreakG.lastIndex = cur;\n var match = lineBreakG.exec(input);\n if (match && match.index < offset) {\n ++line;\n cur = match.index + match[0].length;\n } else {\n return new Position(line, offset - cur);\n }\n }\n}", "function readLViewValue(value) {\n while (Array.isArray(value)) {\n // This check is not quite right, as it does not take into account `StylingContext`\n // This is why it is in debug, not in util.ts\n if (value.length >= HEADER_OFFSET - 1)\n return value;\n value = value[HOST];\n }\n return null;\n}", "function allIndexesOf (array, value) {\n return ;\n}", "function startOfLinePrecedingIndexWithOnlySpaces(source: string, index: number): ?number {\n for (let i = index - 1; i >= 0; i--) {\n switch (source[i]) {\n case ' ':\n case '\\t':\n break;\n\n case '\\n':\n case '\\r':\n return i + 1;\n\n default:\n return null;\n }\n }\n\n return 0;\n}", "function binarySearchIndices( value ) {\n\n\t\t\tfunction binarySearch( start, end ) {\n\n\t\t\t\t// return closest larger index\n\t\t\t\t// if exact number is not found\n\n\t\t\t\tif ( end < start )\n\t\t\t\t\treturn start;\n\n\t\t\t\tvar mid = start + Math.floor( ( end - start ) / 2 );\n\n\t\t\t\tif ( cumulativeAreas[ mid ] > value ) {\n\n\t\t\t\t\treturn binarySearch( start, mid - 1 );\n\n\t\t\t\t} else if ( cumulativeAreas[ mid ] < value ) {\n\n\t\t\t\t\treturn binarySearch( mid + 1, end );\n\n\t\t\t\t} else {\n\n\t\t\t\t\treturn mid;\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t\tvar result = binarySearch( 0, cumulativeAreas.length - 1 );\n\t\t\treturn result;\n\n\t\t}", "function binarySearchIndices( value ) {\n\n\t\t\tfunction binarySearch( start, end ) {\n\n\t\t\t\t// return closest larger index\n\t\t\t\t// if exact number is not found\n\n\t\t\t\tif ( end < start )\n\t\t\t\t\treturn start;\n\n\t\t\t\tvar mid = start + Math.floor( ( end - start ) / 2 );\n\n\t\t\t\tif ( cumulativeAreas[ mid ] > value ) {\n\n\t\t\t\t\treturn binarySearch( start, mid - 1 );\n\n\t\t\t\t} else if ( cumulativeAreas[ mid ] < value ) {\n\n\t\t\t\t\treturn binarySearch( mid + 1, end );\n\n\t\t\t\t} else {\n\n\t\t\t\t\treturn mid;\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t\tvar result = binarySearch( 0, cumulativeAreas.length - 1 );\n\t\t\treturn result;\n\n\t\t}", "function realLength(value) {\n var length = value.indexOf('\\n')\n return width(length === -1 ? value : value.slice(0, length))\n}", "function visualLineContinued(line) {\n var merged, lines;\n\n while (merged = collapsedSpanAtEnd(line)) {\n line = merged.find(1, true).line;\n (lines || (lines = [])).push(line);\n }\n\n return lines;\n } // Get the line number of the start of the visual line that the", "function binarySearchIndices( value ) {\n\n function binarySearch( start, end ) {\n\n // return closest larger index\n // if exact number is not found\n\n if ( end < start )\n return start;\n\n var mid = start + Math.floor( ( end - start ) / 2 );\n\n if ( cumulativeAreas[ mid ] > value ) {\n\n return binarySearch( start, mid - 1 );\n\n } else if ( cumulativeAreas[ mid ] < value ) {\n\n return binarySearch( mid + 1, end );\n\n } else {\n\n return mid;\n\n }\n\n }\n\n var result = binarySearch( 0, cumulativeAreas.length - 1 )\n return result;\n\n }", "function lineColumnToIndex(lineColumn, text) {\n let index = 0;\n for (let i = 0; i < lineColumn.line - 1; ++i) {\n index = text.indexOf(\"\\n\", index) + 1;\n if (index === -1) {\n return -1;\n }\n }\n return index + lineColumn.column;\n}", "function getLineBreak(taggedText, spaceWidth, start, maxWidth) {\n\t\t\t//console.info('getLineBreak(taggedText, spaceWidth, %s, %s);', start, maxWidth);\n\t\t\tlet i, width = 0;\n\t\t\tfor(i = start; i < taggedText.length; i++) {\n\t\t\t\twidth += taggedText[i].w;\n\t\t\t\t//console.log(i, width, maxWidth, taggedText[i]);\n\t\t\t\tif(taggedText[i].br) {\n\t\t\t\t\tif(width > maxWidth) {\n\t\t\t\t\t\t//console.log(i, width, maxWidth, width > maxWidth);\n\t\t\t\t\t\tdo {i--;} while(i > 0 && taggedText[i].br === false);\n\t\t\t\t\t\t//console.log(i);\n\t\t\t\t\t\t//console.log('return i > i=', i);\n\t\t\t\t\t\treturn i;\n\t\t\t\t\t}\n\t\t\t\t\twidth += spaceWidth;\n\t\t\t\t}\n\t\t\t}\n\t\t\t//console.log('return i-1 > i=', i);\n\t\t\treturn i-1;\n\t\t}", "function binarySearchIndices( value ) {\n\n\t\t\tfunction binarySearch( start, end ) {\n\n\t\t\t\t// return closest larger index\n\t\t\t\t// if exact number is not found\n\n\t\t\t\tif ( end < start )\n\t\t\t\t\t{ return start; }\n\n\t\t\t\tvar mid = start + Math.floor( ( end - start ) / 2 );\n\n\t\t\t\tif ( cumulativeAreas[ mid ] > value ) {\n\n\t\t\t\t\treturn binarySearch( start, mid - 1 );\n\n\t\t\t\t} else if ( cumulativeAreas[ mid ] < value ) {\n\n\t\t\t\t\treturn binarySearch( mid + 1, end );\n\n\t\t\t\t} else {\n\n\t\t\t\t\treturn mid;\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t\tvar result = binarySearch( 0, cumulativeAreas.length - 1 );\n\t\t\treturn result;\n\n\t\t}", "function binarySearchIndices( value ) {\n\n\t\t\tfunction binarySearch( start, end ) {\n\n\t\t\t\t// return closest larger index\n\t\t\t\t// if exact number is not found\n\n\t\t\t\tif ( end < start )\n\t\t\t\t\t{ return start; }\n\n\t\t\t\tvar mid = start + Math.floor( ( end - start ) / 2 );\n\n\t\t\t\tif ( cumulativeAreas[ mid ] > value ) {\n\n\t\t\t\t\treturn binarySearch( start, mid - 1 );\n\n\t\t\t\t} else if ( cumulativeAreas[ mid ] < value ) {\n\n\t\t\t\t\treturn binarySearch( mid + 1, end );\n\n\t\t\t\t} else {\n\n\t\t\t\t\treturn mid;\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t\tvar result = binarySearch( 0, cumulativeAreas.length - 1 );\n\t\t\treturn result;\n\n\t\t}", "function binarySearchIndices( value ) {\n\n\t\t\tfunction binarySearch( start, end ) {\n\n\t\t\t\t// return closest larger index\n\t\t\t\t// if exact number is not found\n\n\t\t\t\tif ( end < start )\n\t\t\t\t\treturn start;\n\n\t\t\t\tvar mid = start + Math.floor( ( end - start ) / 2 );\n\n\t\t\t\tif ( cumulativeAreas[ mid ] > value ) {\n\n\t\t\t\t\treturn binarySearch( start, mid - 1 );\n\n\t\t\t\t} else if ( cumulativeAreas[ mid ] < value ) {\n\n\t\t\t\t\treturn binarySearch( mid + 1, end );\n\n\t\t\t\t} else {\n\n\t\t\t\t\treturn mid;\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t\tvar result = binarySearch( 0, cumulativeAreas.length - 1 )\n\t\t\treturn result;\n\n\t\t}", "function injectLineNumbers(tokens, idx, options, env, slf) {\n var line, endLine, listLine;\n if (tokens[idx].map && tokens[idx].level === 0) {\n line = tokens[idx].map[0];\n endLine = tokens[idx].map[1];\n listLine = [];\n for (var i = line; i < endLine; i++) {\n listLine.push(i);\n }\n tokens[idx].attrJoin(\"class\", exports.PREVIEW_PARAGRAPH_PREFIX + String(line)\n + ' ' + exports.PREVIEW_LINE_CLASS + ' ' + listLine.join(' '));\n tokens[idx].attrJoin(\"data_line_start\", \"\" + String(line));\n tokens[idx].attrJoin(\"data_line_end\", \"\" + String(endLine - 1));\n tokens[idx].attrJoin(\"data_line\", \"\" + String([line, endLine]));\n tokens[idx].attrJoin(\"count_line\", \"\" + String(endLine - line));\n }\n return slf.renderToken(tokens, idx, options, env, slf);\n}", "function search_start_pos(value) {\n var N = height / $p.config.GRIDY; // target grid N\n\n var y = Infinity,\n y$ = value,\n count = 0;\n\n while (y > 0) {\n y = Math.floor(math.log(y$) * self.A + self.B);\n y$ *= self.$_mult;\n if (count++ > N * 3) return 0; // Prevents deadloops\n }\n\n return y$;\n }", "function locator(value, fromIndex) {\n var index = value.indexOf(START, fromIndex);\n return index;\n}", "function getLineText(lineNum){\n var lines = $(\"#work_markup\").val().split(/\\r\\n|\\r|\\n/);\n return lines[lineNum];\n\n}", "function code_line(code, line) {\n return code.findIndex(l => l.line === line)\n}", "function get_class_extended(value, breaks) {\n //console.log(breaks.length);\n for (var i = 1; i < breaks.length - 1; i++) { // breaks[0] = dataMin\n if (value <= breaks[i]) {\n return i;\n }\n }\n return breaks.length - 1;\n}", "lineNumber() {\n\t for (let field of _sweetSpec2.default.getDescendant(this.type).getAttributes()) {\n\t if (typeof this[field.attrName] && this[field.attrName].lineNumber === 'function') {\n\t return this[field.attrName].lineNumber();\n\t }\n\t }\n\t }", "function binarySearchIndices( value ) {\r\n\r\n\t\t\tfunction binarySearch( start, end ) {\r\n\r\n\t\t\t\t// return closest larger index\r\n\t\t\t\t// if exact number is not found\r\n\r\n\t\t\t\tif ( end < start )\r\n\t\t\t\t\treturn start;\r\n\r\n\t\t\t\tvar mid = start + Math.floor( ( end - start ) / 2 );\r\n\r\n\t\t\t\tif ( cumulativeAreas[ mid ] > value ) {\r\n\r\n\t\t\t\t\treturn binarySearch( start, mid - 1 );\r\n\r\n\t\t\t\t} else if ( cumulativeAreas[ mid ] < value ) {\r\n\r\n\t\t\t\t\treturn binarySearch( mid + 1, end );\r\n\r\n\t\t\t\t} else {\r\n\r\n\t\t\t\t\treturn mid;\r\n\r\n\t\t\t\t}\r\n\r\n\t\t\t}\r\n\r\n\t\t\tvar result = binarySearch( 0, cumulativeAreas.length - 1 )\r\n\t\t\treturn result;\r\n\r\n\t\t}", "function binarySearchIndices( value ) {\r\n\r\n\t\tfunction binarySearch( start, end ) {\r\n\r\n\t\t\t// return closest larger index\r\n\t\t\t// if exact number is not found\r\n\r\n\t\t\tif ( end < start )\r\n\t\t\t\treturn start;\r\n\r\n\t\t\tvar mid = start + Math.floor( ( end - start ) / 2 );\r\n\r\n\t\t\tif ( cumulativeAreas[ mid ] > value ) {\r\n\r\n\t\t\t\treturn binarySearch( start, mid - 1 );\r\n\r\n\t\t\t} else if ( cumulativeAreas[ mid ] < value ) {\r\n\r\n\t\t\t\treturn binarySearch( mid + 1, end );\r\n\r\n\t\t\t} else {\r\n\r\n\t\t\t\treturn mid;\r\n\r\n\t\t\t}\r\n\r\n\t\t}\r\n\r\n\t\tvar result = binarySearch( 0, cumulativeAreas.length - 1 );\r\n\t\treturn result;\r\n\r\n\t}", "function indentation(value) {\n var index = 0;\n var indent = 0;\n var character = value.charAt(index);\n var stops = {};\n var size;\n\n while (character in characters) {\n size = characters[character];\n\n indent += size;\n\n if (size > 1) {\n indent = Math.floor(indent / size) * size;\n }\n\n stops[indent] = index;\n\n character = value.charAt(++index);\n }\n\n return {indent: indent, stops: stops};\n}", "function indentation(value) {\n var index = 0;\n var indent = 0;\n var character = value.charAt(index);\n var stops = {};\n var size;\n\n while (character in characters) {\n size = characters[character];\n\n indent += size;\n\n if (size > 1) {\n indent = Math.floor(indent / size) * size;\n }\n\n stops[indent] = index;\n\n character = value.charAt(++index);\n }\n\n return {indent: indent, stops: stops};\n}", "function indentation(value) {\n var index = 0;\n var indent = 0;\n var character = value.charAt(index);\n var stops = {};\n var size;\n\n while (character in characters) {\n size = characters[character];\n\n indent += size;\n\n if (size > 1) {\n indent = Math.floor(indent / size) * size;\n }\n\n stops[indent] = index;\n\n character = value.charAt(++index);\n }\n\n return {indent: indent, stops: stops};\n}", "function indentation(value) {\n var index = 0;\n var indent = 0;\n var character = value.charAt(index);\n var stops = {};\n var size;\n\n while (character in characters) {\n size = characters[character];\n\n indent += size;\n\n if (size > 1) {\n indent = Math.floor(indent / size) * size;\n }\n\n stops[indent] = index;\n\n character = value.charAt(++index);\n }\n\n return {indent: indent, stops: stops};\n}", "function indentation(value) {\n var index = 0;\n var indent = 0;\n var character = value.charAt(index);\n var stops = {};\n var size;\n\n while (character in characters) {\n size = characters[character];\n\n indent += size;\n\n if (size > 1) {\n indent = Math.floor(indent / size) * size;\n }\n\n stops[indent] = index;\n\n character = value.charAt(++index);\n }\n\n return {indent: indent, stops: stops};\n}", "function dotindex(value) {\n var match = EXPRESSION_LAST_DOT.exec(value)\n\n return match ? match.index + 1 : value.length\n}", "function split_linebreaks(s) {\n\t //return s.split(/\\x0d\\x0a|\\x0a/);\n\t\n\t s = s.replace(acorn.allLineBreaks, '\\n');\n\t var out = [],\n\t idx = s.indexOf(\"\\n\");\n\t while (idx !== -1) {\n\t out.push(s.substring(0, idx));\n\t s = s.substring(idx + 1);\n\t idx = s.indexOf(\"\\n\");\n\t }\n\t if (s.length) {\n\t out.push(s);\n\t }\n\t return out;\n\t }", "function getRange() {\n\t if (__.nullValueSeparator == 'bottom') {\n\t return [h() + 1 - __.nullValueSeparatorPadding.bottom - __.nullValueSeparatorPadding.top, 1];\n\t } else if (__.nullValueSeparator == 'top') {\n\t return [h() + 1, 1 + __.nullValueSeparatorPadding.bottom + __.nullValueSeparatorPadding.top];\n\t }\n\t return [h() + 1, 1];\n\t }", "function split_linebreaks(s) {\n\t //return s.split(/\\x0d\\x0a|\\x0a/);\n\n\t s = s.replace(acorn.allLineBreaks, '\\n');\n\t var out = [],\n\t idx = s.indexOf(\"\\n\");\n\t while (idx !== -1) {\n\t out.push(s.substring(0, idx));\n\t s = s.substring(idx + 1);\n\t idx = s.indexOf(\"\\n\");\n\t }\n\t if (s.length) {\n\t out.push(s);\n\t }\n\t return out;\n\t }", "function buildArrayOnIndex(value){\n\tif(value.toString().includes(\" \"))\n\t\treturn value.split(\" \");\n\telse\n\t\treturn [value];\n}", "function editable_ret(value, settings) {\n var lines = value.split('\\n'),\n retval = [];\n for (var i = 0; i < lines.length; i++) {\n var line = lines[i];\n if (settings.name == \"editable_text\") {\n // Since this is for text boxes, we're going to apply\n // blockquote replacement. Greentext, mostly.\n line = line.replace(/^\\>(.+)/, '<span class=\"quote\">&gt;$1</span>');\n }\n retval.push(line);\n }\n return retval.join(\"<br>\");\n }", "function lineValues(rowOrColumnElements) {\n let lineArray = []\n\n for (let i = 0; i < rowOrColumnElements.length; i++) {\n lineArray.push(rowOrColumnElements[i].innerText)\n }\n\n return lineArray // gives the values of each Row and Column as an array\n}", "function applyLineNumbers( i, tbody ){\n var i, cells,\n rows = tbody.getElementsByTagName('tr'),\n nrow = rows.length,\n data = tbody.getAttribute('data-diff').split(/\\D+/),\n xmin = data[0], xmax = data[1], \n ymin = data[2], ymax = data[3]\n ;\n /*function lpad( n, max ){\n var str = String( n ),\n len = String(max).length;\n while( str.length < len ){\n str = '\\xA0'+str;\n }\n return str;\n }*/\n function apply( td, num, max ){\n if( num <= max ){\n $('<span></span>').text( String(num) ).prependTo( td );\n }\n }\n for( i = 0; i < nrow; i++ ){\n cells = rows[i].getElementsByTagName('td');\n apply( cells[0], xmin++, xmax );\n apply( cells[2], ymin++, ymax );\n }\n }", "function findSpanFromSeparator(node, forward) {\n forward = forward || true\n let nodes = []\n\n if (node.nodeType == Node.TEXT_NODE) {\n node = forward ? node.nextSibling : node.previousSibling\n\n if (forward) {\n for(let n = node; n; n = forward ? n.nextSibling : n.previousSibling) {\n if (n.key == node.key) {\n nodes.push(n)\n } else {\n break // Just find neighbors\n }\n }\n } \n }\n\n return nodes\n}", "indexOfValue(value) {\n for (let i = 0; i < this.length; i++) {\n if (this.data[i] === value) {\n return i;\n }\n }\n return -1;\n }", "getPrecedingValidLine(model, lineNumber, indentRulesSupport) {\r\n let languageID = model.getLanguageIdAtPosition(lineNumber, 0);\r\n if (lineNumber > 1) {\r\n let lastLineNumber;\r\n let resultLineNumber = -1;\r\n for (lastLineNumber = lineNumber - 1; lastLineNumber >= 1; lastLineNumber--) {\r\n if (model.getLanguageIdAtPosition(lastLineNumber, 0) !== languageID) {\r\n return resultLineNumber;\r\n }\r\n let text = model.getLineContent(lastLineNumber);\r\n if (indentRulesSupport.shouldIgnore(text) || /^\\s+$/.test(text) || text === '') {\r\n resultLineNumber = lastLineNumber;\r\n continue;\r\n }\r\n return lastLineNumber;\r\n }\r\n }\r\n return -1;\r\n }", "getLines(content: string): string[] {\n return content.split('\\n');\n }", "function getLineNumberForPosition(xmlData, index) {\n var lines = xmlData.substring(0, index).split(/\\r?\\n/);\n return lines.length;\n}", "function getLineNumberForPosition(xmlData, index) {\n var lines = xmlData.substring(0, index).split(/\\r?\\n/);\n return lines.length;\n}", "function getLineNumberForPosition(xmlData, index) {\n var lines = xmlData.substring(0, index).split(/\\r?\\n/);\n return lines.length;\n}", "function getLineNumberForPosition(xmlData, index) {\n var lines = xmlData.substring(0, index).split(/\\r?\\n/);\n return lines.length;\n}", "function getLineNumberForPosition(xmlData, index) {\n var lines = xmlData.substring(0, index).split(/\\r?\\n/);\n return lines.length;\n}" ]
[ "0.65919644", "0.57013166", "0.5432263", "0.5342233", "0.519581", "0.51696146", "0.507851", "0.5013093", "0.49860644", "0.4964226", "0.4946536", "0.49298257", "0.49226657", "0.48780623", "0.48680732", "0.48583052", "0.48488826", "0.48488826", "0.4837607", "0.48324108", "0.48324108", "0.48303702", "0.48257577", "0.48224005", "0.48111778", "0.48009944", "0.47971213", "0.47959033", "0.47843334", "0.47843334", "0.47815198", "0.4780861", "0.4780861", "0.47670415", "0.47633043", "0.47594735", "0.47594735", "0.47594735", "0.47594735", "0.47594735", "0.47594735", "0.47594735", "0.47594735", "0.47594735", "0.47594735", "0.475818", "0.475818", "0.47547293", "0.47547293", "0.47525203", "0.47525203", "0.47513318", "0.47423762", "0.47381562", "0.47279087", "0.47279087", "0.47263703", "0.47246766", "0.47221076", "0.47132128", "0.47109914", "0.4710619", "0.4710619", "0.47079483", "0.47012877", "0.46936655", "0.4674585", "0.46673134", "0.46620685", "0.46616268", "0.46543646", "0.4651644", "0.46407008", "0.4631802", "0.4631802", "0.4631802", "0.4631802", "0.4631802", "0.4630689", "0.4626474", "0.462318", "0.46181145", "0.46142733", "0.46127778", "0.46113205", "0.4604598", "0.46010542", "0.4593338", "0.4582311", "0.45791456", "0.45740852", "0.45740852", "0.45740852", "0.45740852", "0.45740852" ]
0.80642945
5
Factory to deescape a value, based on a list at `key` in `ctx`.
function factory(ctx, key) { return unescape; /* De-escape a string using the expression at `key` * in `ctx`. */ function unescape(value) { var prev = 0; var index = value.indexOf('\\'); var escape = ctx[key]; var queue = []; var character; while (index !== -1) { queue.push(value.slice(prev, index)); prev = index + 1; character = value.charAt(prev); /* If the following character is not a valid escape, * add the slash. */ if (!character || escape.indexOf(character) === -1) { queue.push('\\'); } index = value.indexOf('\\', prev); } queue.push(value.slice(prev)); return queue.join(''); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function factory(ctx, key) {\n return unescape\n\n // De-escape a string using the expression at `key` in `ctx`.\n function unescape(value) {\n var previous = 0\n var index = value.indexOf(backslash)\n var escape = ctx[key]\n var queue = []\n var character\n\n while (index !== -1) {\n queue.push(value.slice(previous, index))\n previous = index + 1\n character = value.charAt(previous)\n\n // If the following character is not a valid escape, add the slash.\n if (!character || escape.indexOf(character) === -1) {\n queue.push(backslash)\n }\n\n index = value.indexOf(backslash, previous + 1)\n }\n\n queue.push(value.slice(previous))\n\n return queue.join('')\n }\n}", "function unescape(value) {\n var prev = 0;\n var index = value.indexOf('\\\\');\n var escape = ctx[key];\n var queue = [];\n var character;\n\n while (index !== -1) {\n queue.push(value.slice(prev, index));\n prev = index + 1;\n character = value.charAt(prev);\n\n /* If the following character is not a valid escape,\n * add the slash. */\n if (!character || escape.indexOf(character) === -1) {\n queue.push('\\\\');\n }\n\n index = value.indexOf('\\\\', prev);\n }\n\n queue.push(value.slice(prev));\n\n return queue.join('');\n }", "function unescape(value) {\n var prev = 0;\n var index = value.indexOf('\\\\');\n var escape = ctx[key];\n var queue = [];\n var character;\n\n while (index !== -1) {\n queue.push(value.slice(prev, index));\n prev = index + 1;\n character = value.charAt(prev);\n\n /* If the following character is not a valid escape,\n * add the slash. */\n if (!character || escape.indexOf(character) === -1) {\n queue.push('\\\\');\n }\n\n index = value.indexOf('\\\\', prev);\n }\n\n queue.push(value.slice(prev));\n\n return queue.join('');\n }", "function unescape(value) {\n var prev = 0;\n var index = value.indexOf('\\\\');\n var escape = ctx[key];\n var queue = [];\n var character;\n\n while (index !== -1) {\n queue.push(value.slice(prev, index));\n prev = index + 1;\n character = value.charAt(prev);\n\n /* If the following character is not a valid escape,\n * add the slash. */\n if (!character || escape.indexOf(character) === -1) {\n queue.push('\\\\');\n }\n\n index = value.indexOf('\\\\', prev);\n }\n\n queue.push(value.slice(prev));\n\n return queue.join('');\n }", "function unescape(value) {\n var prev = 0;\n var index = value.indexOf('\\\\');\n var escape = ctx[key];\n var queue = [];\n var character;\n\n while (index !== -1) {\n queue.push(value.slice(prev, index));\n prev = index + 1;\n character = value.charAt(prev);\n\n /* If the following character is not a valid escape,\n * add the slash. */\n if (!character || escape.indexOf(character) === -1) {\n queue.push('\\\\');\n }\n\n index = value.indexOf('\\\\', prev);\n }\n\n queue.push(value.slice(prev));\n\n return queue.join('');\n }", "function unescape(value) {\n var prev = 0;\n var index = value.indexOf('\\\\');\n var escape = ctx[key];\n var queue = [];\n var character;\n\n while (index !== -1) {\n queue.push(value.slice(prev, index));\n prev = index + 1;\n character = value.charAt(prev);\n\n /* If the following character is not a valid escape,\n * add the slash. */\n if (!character || escape.indexOf(character) === -1) {\n queue.push('\\\\');\n }\n\n index = value.indexOf('\\\\', prev);\n }\n\n queue.push(value.slice(prev));\n\n return queue.join('');\n }", "function unescape(value) {\n var prev = 0;\n var index = value.indexOf('\\\\');\n var escape = ctx[key];\n var queue = [];\n var character;\n\n while (index !== -1) {\n queue.push(value.slice(prev, index));\n prev = index + 1;\n character = value.charAt(prev);\n\n /* If the following character is not a valid escape,\n * add the slash. */\n if (!character || escape.indexOf(character) === -1) {\n queue.push('\\\\');\n }\n\n index = value.indexOf('\\\\', prev);\n }\n\n queue.push(value.slice(prev));\n\n return queue.join('');\n }", "function reviver(key, value){\n \n if (typeof value === \"string\"){\n var str = value.replace(/---/g, \" \");\n return str;\n }\n return value\n }", "function fix( key, escape, json ) {\n\t\t\treturn key.parseOP( /(.*?)(\\$)(.*)/, key => escapeId(key), (lhs,rhs,op) => {\n\t\t\t\tif (lhs) {\n\t\t\t\t\tjsons.push( json );\n\t\t\t\t\t\n\t\t\t\t\tvar \n\t\t\t\t\t\tkeys = rhs.split(\",\"),\n\t\t\t\t\t\tidx = [];\n\t\t\t\t\t\n\t\t\t\t\tkeys.forEach( (key,n) => { \n\t\t\t\t\t\tif ( key )\n\t\t\t\t\t\t\tidx.push( escape( n ? key : op+key) );\n\t\t\t\t\t});\n\t\t\t\t\t\t\n\t\t\t\t\treturn idx.length \n\t\t\t\t\t\t? `json_extract(${escapeId(lhs)}, ${idx.join(\",\")} )`\n\t\t\t\t\t\t: escapeId(lhs);\n\t\t\t\t}\n\n\t\t\t\telse\n\t\t\t\t\treturn escapeId(rhs);\n\t\t\t});\n\t\t}", "function unescape(value) {\n var previous = 0\n var index = value.indexOf(backslash)\n var escape = ctx[key]\n var queue = []\n var character\n\n while (index !== -1) {\n queue.push(value.slice(previous, index))\n previous = index + 1\n character = value.charAt(previous)\n\n // If the following character is not a valid escape, add the slash.\n if (!character || escape.indexOf(character) === -1) {\n queue.push(backslash)\n }\n\n index = value.indexOf(backslash, previous + 1)\n }\n\n queue.push(value.slice(previous))\n\n return queue.join('')\n }", "function dequote (value, escapeChar, dequotedChars) {\n let output = ''\n for (let i = 0; i < value.length; i++) {\n if (value[i] === escapeChar) {\n i++\n if (dequotedChars[value[i]] || value[i] === escapeChar) {\n output += dequotedChars[value[i]] || escapeChar\n } else {\n throw new InvalidOperationError(`The quoted character '${value[i]}' was not recognised.`)\n }\n } else {\n output += value[i]\n }\n }\n return output\n}", "function eval_with_input(expr, ctx) {\n\n // if not string, just return eval(expr)\n if (typeof expr != 'string') {\n return eval(expr, ctx)\n }\n\n // substitute variable\n let regex = new RegExp('\\\\$(' + REGEX_VAR + ')', 'g');\n expr = expr.replace(regex, 'ctx.$1')\n\n // substitute key\n expr = expr.replace(new RegExp('\\\\@(' + REGEX_VAR + ')', 'g'), 'ctx.$1' + KEY_SUFFIX)\n\n // substitute nested keys\n while (expr.match(new RegExp('\\\\@(ctx\\\\.' + REGEX_VAR + '(' + KEY_SUFFIX + ')+)', 'g'))) {\n expr = expr.replace(new RegExp('\\\\@(ctx\\\\.' + REGEX_VAR + '(' + KEY_SUFFIX + ')+)', 'g'), '$1' + KEY_SUFFIX)\n }\n\n // we have a valid JavaScript expression here, replace MemberExpression with CallExpression\n let ast_tree = esprima.parse(expr).body[0]\n let converted_tree = traverse_with_obj_path(ast_tree)\n let converted_expr = escodegen.generate(converted_tree)\n\n // console.log(`eval(${expr}), ${ctx}`)\n let r = eval(converted_expr, ctx)\n //console.log(`eval(${expr}) => ${r}`)\n return r\n}", "function unquote(value) {\n return (value.\n replace(/&lt;/g, \"<\").\n replace(/&gt;/g, \">\").\n replace(/&amp;/g, \"&\"));\n}", "function decodeValue(value) {\n if (value == null) {\n return null;\n }\n return value.replace(decodeLookupRegex, (m) => decodeMap[m] || \"\");\n}", "function createEscaper(map) {\r\n\t\t\tvar escaper = function(match) {\r\n\t\t\t\treturn map[match];\r\n\t\t\t};\r\n\t\t\t// Regexes for identifying a key that needs to be escaped\r\n\t\t\tvar source = '(?:' + utils.keys(map).join('|') + ')';\r\n\t\t\tvar testRegexp = new RegExp(source);\r\n\t\t\tvar replaceRegexp = new RegExp(source, 'g');\r\n\t\t\treturn function(string) {\r\n\t\t\t\tstring = string === null ? '' : '' + string;\r\n\t\t\t\treturn testRegexp.test(string) ? string.replace(replaceRegexp, escaper) : string;\r\n\t\t\t};\r\n\t\t}", "function createEscaper(map) {\n var escaper = function(match) {\n return map[match];\n };\n // Regexes for identifying a key that needs to be escaped.\n var source = '(?:' + keys(map).join('|') + ')';\n var testRegexp = RegExp(source);\n var replaceRegexp = RegExp(source, 'g');\n return function(string) {\n string = string == null ? '' : '' + string;\n return testRegexp.test(string) ? string.replace(replaceRegexp, escaper) : string;\n };\n }", "function createEscaper(map) {\n var escaper = function(match) {\n return map[match];\n };\n // Regexes for identifying a key that needs to be escaped.\n var source = '(?:' + keys(map).join('|') + ')';\n var testRegexp = RegExp(source);\n var replaceRegexp = RegExp(source, 'g');\n return function(string) {\n string = string == null ? '' : '' + string;\n return testRegexp.test(string) ? string.replace(replaceRegexp, escaper) : string;\n };\n }", "function createEscaper(map) {\n var escaper = function(match) {\n return map[match];\n };\n // Regexes for identifying a key that needs to be escaped.\n var source = '(?:' + keys(map).join('|') + ')';\n var testRegexp = RegExp(source);\n var replaceRegexp = RegExp(source, 'g');\n return function(string) {\n string = string == null ? '' : '' + string;\n return testRegexp.test(string) ? string.replace(replaceRegexp, escaper) : string;\n };\n }", "function createEscaper(map) {\n var escaper = function(match) {\n return map[match];\n };\n // Regexes for identifying a key that needs to be escaped.\n var source = '(?:' + keys(map).join('|') + ')';\n var testRegexp = RegExp(source);\n var replaceRegexp = RegExp(source, 'g');\n return function(string) {\n string = string == null ? '' : '' + string;\n return testRegexp.test(string) ? string.replace(replaceRegexp, escaper) : string;\n };\n }", "function createEscaper(map) {\n var escaper = function(match) {\n return map[match];\n };\n // Regexes for identifying a key that needs to be escaped.\n var source = '(?:' + keys(map).join('|') + ')';\n var testRegexp = RegExp(source);\n var replaceRegexp = RegExp(source, 'g');\n return function(string) {\n string = string == null ? '' : '' + string;\n return testRegexp.test(string) ? string.replace(replaceRegexp, escaper) : string;\n };\n }", "function createEscaper(map) {\n var escaper = function(match) {\n return map[match];\n };\n // Regexes for identifying a key that needs to be escaped.\n var source = '(?:' + keys(map).join('|') + ')';\n var testRegexp = RegExp(source);\n var replaceRegexp = RegExp(source, 'g');\n return function(string) {\n string = string == null ? '' : '' + string;\n return testRegexp.test(string) ? string.replace(replaceRegexp, escaper) : string;\n };\n }", "function createEscaper(map) {\n var escaper = function(match) {\n return map[match];\n };\n // Regexes for identifying a key that needs to be escaped.\n var source = '(?:' + keys(map).join('|') + ')';\n var testRegexp = RegExp(source);\n var replaceRegexp = RegExp(source, 'g');\n return function(string) {\n string = string == null ? '' : '' + string;\n return testRegexp.test(string) ? string.replace(replaceRegexp, escaper) : string;\n };\n }", "function createEscaper(map) {\n var escaper = function(match) {\n return map[match];\n };\n // Regexes for identifying a key that needs to be escaped.\n var source = '(?:' + keys(map).join('|') + ')';\n var testRegexp = RegExp(source);\n var replaceRegexp = RegExp(source, 'g');\n return function(string) {\n string = string == null ? '' : '' + string;\n return testRegexp.test(string) ? string.replace(replaceRegexp, escaper) : string;\n };\n }", "function createEscaper(map) {\n var escaper = function(match) {\n return map[match];\n };\n // Regexes for identifying a key that needs to be escaped.\n var source = '(?:' + keys(map).join('|') + ')';\n var testRegexp = RegExp(source);\n var replaceRegexp = RegExp(source, 'g');\n return function(string) {\n string = string == null ? '' : '' + string;\n return testRegexp.test(string) ? string.replace(replaceRegexp, escaper) : string;\n };\n }", "function transform(list, labelKey, valueKey, separator) {\n if (!list) return []\n\n return list.map((item, index) => {\n const name = []\n if (isArray(labelKey)) {\n labelKey.forEach((key) => {\n name.push(get(item, key))\n })\n } else if (isNil(labelKey)) {\n name.push(item)\n } else {\n name.push(get(item, labelKey))\n }\n\n let value\n if (isNil(valueKey)) {\n value = item\n } else if (isArray(valueKey)) {\n for (let i = 0; i < valueKey.length; i += 1) {\n const val = get(item, valueKey[i])\n if (val !== undefined) {\n value = val\n // stop loop jika value ada\n break\n }\n }\n } else {\n value = get(item, valueKey)\n }\n\n const label = isFunction(separator)\n ? // @ts-ignore\n separator(name.length <= 1 ? name[0] : name, item, index)\n : // @ts-ignore\n name.join(separator || ' - ')\n return {\n label,\n original: item,\n value,\n key: value,\n }\n })\n}", "static reviver(key, value) {\n return key === \"\" ? Event.fromJSON(value) : value;\n }", "function replacer(key, value) {\n if (Buffer.isBuffer(value))\n return \"buffer/\" + value.toString('hex')\n else\n return value\n}", "function decoder(value, position, handler) {\n entities(value, {\n position: normalize(position),\n warning: handleWarning,\n text: handler,\n reference: handler,\n textContext: ctx,\n referenceContext: ctx\n })\n }", "function encodeExpression(code, ctx) {\n return expression$2(['item', '_'], code, ctx);\n }", "function reviver(_key, value) {\n // NaN and undefined are not JSON.parseable, but we want to preserve this information\n if (value === NAN_VALUE) {\n return NaN;\n }\n if (value === UNDEFINED_VALUE) {\n return undefined;\n }\n return value;\n}", "function decoder(value, position, handler) {\n entities(value, {\n position: normalize(position),\n warning: handleWarning,\n text: handler,\n reference: handler,\n textContext: ctx,\n referenceContext: ctx\n });\n }", "function decoder(value, position, handler) {\n entities(value, {\n position: normalize(position),\n warning: handleWarning,\n text: handler,\n reference: handler,\n textContext: ctx,\n referenceContext: ctx\n });\n }", "function decoder(value, position, handler) {\n entities(value, {\n position: normalize(position),\n warning: handleWarning,\n text: handler,\n reference: handler,\n textContext: ctx,\n referenceContext: ctx\n });\n }", "function decoder(value, position, handler) {\n entities(value, {\n position: normalize(position),\n warning: handleWarning,\n text: handler,\n reference: handler,\n textContext: ctx,\n referenceContext: ctx\n });\n }", "function decoder(value, position, handler) {\n entities(value, {\n position: normalize(position),\n warning: handleWarning,\n text: handler,\n reference: handler,\n textContext: ctx,\n referenceContext: ctx\n });\n }", "function decoder(value, position, handler) {\n entities(value, {\n position: normalize(position),\n warning: handleWarning,\n text: handler,\n reference: handler,\n textContext: ctx,\n referenceContext: ctx\n });\n }", "function _unescape_Value(obj, script, dotName, outer)\n\t\t{\n\t\t\t/*\n\t\t\tvar msg = '';\n\t\t\tvar value = script.substr(dotName.length+1);\t//value after '='\n\t\t\tvalue.replace(/(\\$(.+?)?\\.(.*))/, function(all, dotName, subkey, key)\n\t\t\t{\t\t\t\t\t\t\t\t\t\t\t\t//if value is $...\n\t\t\t\tvar o = subkey ? subkey.ov(obj) : obj;\n\t\t\t\tif (o instanceof Object && key in o)\t\n\t\t\t\t\treturn;\t\t\t\n\t\t\t\tmsg = _unescape_invalid(script, dotName, outer);\t//source dotName undefined\n\t\t\t});\t\n\t\t\tif (msg) return msg;\n\t\t\t*/\t\t\t\t\t\t\t\t\t\t\t\t//1st replace all \";#\" with dotName [RegExp]\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t//e.g. --> $.1=/xyz/;$.1.lastIndex=3\n\t\t\tscript = script.replace(/;#/g, ';' + dotName);\t\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t//then change number's -- e.g. $.1 --> $[1]\n\t\t\tscript = script.replace(/\\.(\\d+)(?=([.=]|$))/g, '[$1]');\t\n\t\t\tscript = script.replace(/\\$/g, 'obj');\t\t\t//and finally change $ --> obj\n\t\t\t\n\t\t\treturn _unescape_eval('replace value', script, dotName, outer);\n\t\t}", "function encodeExpression(code, ctx) {\n return expression(['item', '_'], code, ctx);\n}", "function encodeExpression(code, ctx) {\n return expression(['item', '_'], code, ctx);\n}", "function createContext(depList) {\n var depListStr = depList.toString();\n var depNames = depListStr\n .slice(depListStr.indexOf('[') + 1, depListStr.lastIndexOf(']'))\n .replace(/\\s/g, '')\n .split(',');\n var depValues = depList();\n var out = '';\n var reg = {};\n var dat = {};\n var ab = [];\n for (var i = 0; i < depValues.length; ++i) {\n var key = depNames[i], value = depValues[i];\n var parts = key\n .replace(/\\\\/, '')\n .match(/^(.*?)(?=(\\.|\\[|$))|\\[(.*?)\\]|(\\.(.*?))(?=(\\.|\\[|$))/g);\n var v = encoder[typeof value](value, reg, ab);\n if (typeof v == 'string') {\n var pfx = 'self.' + parts[0];\n var chain = pfx;\n for (var i_1 = 1; i_1 < parts.length; ++i_1) {\n chain = chainWrap(parts[i_1], chain, pfx);\n pfx += parts[i_1];\n }\n out += chain + \"=\" + v + \";\";\n }\n else {\n // TODO: overwrite instead of assign\n var obj = dat;\n for (var i_2 = 0; i_2 < parts.length - 1; ++i_2) {\n obj = obj[parts[i_2]] = {};\n }\n obj[parts[parts.length - 1]] = v;\n }\n }\n return [out, dat, ab, reg];\n}", "getDecodedLiteralValue(node, key) {\r\n let encodedString = node ? this.getLiteralValue(node, key) : key;\r\n // in the past we use escape for encoding, we try first to decode with decodeURI\r\n // only if we fail we use deprecated unescape\r\n try {\r\n return decodeURI(encodedString);\r\n } catch (ex) {\r\n let decodedString;\r\n try {\r\n // we defined lazy getter for _decode to import from Decode.jsm module\r\n decodedString = this._decode.unescape(encodedString);\r\n } catch (er) {\r\n let msg = \"Tabmix is unable to decode \" + key;\r\n if (node)\r\n msg += \" from \" + node.QueryInterface(Ci.nsIRDFResource).Value;\r\n Tabmix.reportError(msg + \"\\n\" + er);\r\n return \"\";\r\n }\r\n if (node && key) {\r\n this.setLiteral(node, key, encodeURI(decodedString));\r\n this.saveStateDelayed(10000);\r\n }\r\n return decodedString;\r\n }\r\n }", "decodeKey(key) {\n return decodeURIComponent(key);\n }", "function encodeExpression(code, ctx) {\n return expression(['item', '_'], code, ctx);\n }", "function c(key, value, func, enclose){\n\tif(func && value) value = func.apply(null, [value]);\n\tif(value == undefined || value === '') return;\n\tif(enclose) return key + \":'\" + value+\"'\";\n\treturn key + ':' + value;\n}", "decodeKey(key) {\n return decodeURIComponent(key);\n }", "decodeKey(key) {\n return decodeURIComponent(key);\n }", "decodeKey(key) {\n return decodeURIComponent(key);\n }", "decodeKey(key) {\n return decodeURIComponent(key);\n }", "decodeKey(key) {\n return decodeURIComponent(key);\n }", "function factory(ctx) {\n decoder.raw = decodeRaw\n\n return decoder\n\n // Normalize `position` to add an `indent`.\n function normalize(position) {\n var offsets = ctx.offset\n var line = position.line\n var result = []\n\n while (++line) {\n if (!(line in offsets)) {\n break\n }\n\n result.push((offsets[line] || 0) + 1)\n }\n\n return {start: position, indent: result}\n }\n\n // Decode `value` (at `position`) into text-nodes.\n function decoder(value, position, handler) {\n entities(value, {\n position: normalize(position),\n warning: handleWarning,\n text: handler,\n reference: handler,\n textContext: ctx,\n referenceContext: ctx\n })\n }\n\n // Decode `value` (at `position`) into a string.\n function decodeRaw(value, position, options) {\n return entities(\n value,\n xtend(options, {position: normalize(position), warning: handleWarning})\n )\n }\n\n // Handle a warning.\n // See <https://github.com/wooorm/parse-entities> for the warnings.\n function handleWarning(reason, position, code) {\n if (code !== 3) {\n ctx.file.message(reason, position)\n }\n }\n}", "function key_value(key) {\n return Evaluator.key_value(key);\n}", "decodeParam(value, key){\n\n let decodeParamString = function(searchString) {\n if(key === 'search') {\n // Don't include 'search:' in the search tag\n return decodeURIComponent(`${searchString}`);\n }\n else {\n key = key.toString().replace(/__icontains_DEFAULT/g, \"\");\n key = key.toString().replace(/__search_DEFAULT/g, \"\");\n let split = key.split('__');\n let decodedParam = searchString;\n let exclude = false;\n if(key.startsWith('not__')) {\n exclude = true;\n split = split.splice(1, split.length);\n }\n if(key.endsWith('__gt')) {\n decodedParam = '>' + decodedParam;\n split = split.splice(0, split.length-1);\n }\n else if(key.endsWith('__lt')) {\n decodedParam = '<' + decodedParam;\n split = split.splice(0, split.length-1);\n }\n else if(key.endsWith('__gte')) {\n decodedParam = '>=' + decodedParam;\n split = split.splice(0, split.length-1);\n }\n else if(key.endsWith('__lte')) {\n decodedParam = '<=' + decodedParam;\n split = split.splice(0, split.length-1);\n }\n\n let uriDecodedParam = decodeURIComponent(decodedParam);\n\n return exclude ? `-${split.join('.')}:${uriDecodedParam}` : `${split.join('.')}:${uriDecodedParam}`;\n }\n };\n\n if (Array.isArray(value)){\n value = _.uniq(_.flattenDeep(value));\n return _.map(value, (item) => {\n return decodeParamString(item);\n });\n }\n else {\n return decodeParamString(value);\n }\n }", "function resolve(value, ctx) {\n return type_3.isFunction(value) ? value(ctx) : value;\n }", "function cleanValue(key, value) {\n if (key == LIEU) {\n return cleanCity(value)\n .then(cityCleaned => {\n return [{\n key: VILLE,\n value: cityCleaned\n }]\n })\n } else if (key == LOCALISATION) {\n return cleanLocalisation(value)\n } else if (key == CONTRAT) {\n if (value.includes(\"CDI\")) {\n value = \"CDI\";\n }\n if (value.includes(\"CDD\")) {\n value = \"CDD\";\n }\n if (value.includes(\"Contrat d'apprentissage\")) {\n value = \"Contrat d'apprentissage\";\n }\n if (value.includes(\"Stage conventionné\")) {\n value = \"Stage\";\n }\n if (value.includes(\"Contrat de professionnalisation\")) {\n value = \"Contrat de professionnalisation\";\n }\n } else if (key == POSTE) {\n value = value.replace(\" H/F\", \"\").replace(\"(H/F)\", \"\");\n }\n\n const valuesCleaned = [{\n key: SHORT_KEY[key],\n value: value\n }]\n\n return new Promise((resolve, reject) => {\n resolve(valuesCleaned);\n });\n\n}", "static reviver(key, value) {\n if ((typeof value == 'string') || (typeof value == 'object' && typeof value.start == 'string' && typeof value.end == 'string')) {\n return new Calends(value, 'tai64', 'tai64narux');\n }\n\n return value;\n }", "decode(key) {\n /*\n * Ignore when initial value is not defined or null\n */\n const value = this.cookies[key];\n if (value === null || value === undefined) {\n return null;\n }\n /*\n * Reference to the cache object. Mainly done to avoid typos,\n * since this object is referenced a handful of times inside\n * this method.\n */\n const cacheObject = this.cachedCookies.plainCookies;\n /*\n * Return from cache, when already parsed\n */\n if (cacheObject[key] !== undefined) {\n return cacheObject[key];\n }\n /*\n * Attempt to unpack and cache it for future. The value is only\n * when value it is not null.\n */\n const parsed = PlainCookie.canUnpack(value) ? PlainCookie.unpack(value) : null;\n if (parsed !== null) {\n cacheObject[key] = parsed;\n }\n return parsed;\n }", "function unflattenKeylistIntoAnswers(propValArray, value) {\n var answer = answers;\n for (var i = 0, n = propValArray.length - 1; i < n; ++i) {\n // lazy initialize an empty object for the current key if needed\n answer = answer[propValArray[i]] || (answer[propValArray[i]] = []);\n }\n // set the final one to the value\n answer[propValArray[n]] = value;\n }", "function SanitizeCtx(ctx) {\n var r = {};\n for (var key in ctx) {\n if (!key.startsWith('_')) {\n r[key] = ctx[key];\n }\n }\n return r;\n}", "function getDecryptedValue(value, referrer){\n if(value && isEncryptedData(value)) return decryptData(value, referrer);\n else return value;\n}", "function removeInternalValuesFromJSON(key, value)\n{\n switch (key)\n {\n case \"source\":\n case \"target\":\n return value.id; // don't include the whole node object, only the id\n\n case \"index\":\n case \"distance\":\n case \"r\":\n case \"vx\":\n case \"vy\":\n case \"fx\":\n case \"fy\":\n case \"labelwidth\":\n return undefined; // ignore\n\n default:\n return value;\n }\n}", "function replacer(key, value) {\n if (typeof value === 'function') {\n return String(value);\n }\n return value;\n }", "function reviver(key, value) {\n if (typeof value === \"string\") {\n return new Date(value);\n }\n\n return value;\n }", "function factory(ctx) {\n decoder.raw = decodeRaw;\n\n return decoder;\n\n /* Normalize `position` to add an `indent`. */\n function normalize(position) {\n var offsets = ctx.offset;\n var line = position.line;\n var result = [];\n\n while (++line) {\n if (!(line in offsets)) {\n break;\n }\n\n result.push((offsets[line] || 0) + 1);\n }\n\n return {\n start: position,\n indent: result\n };\n }\n\n /* Handle a warning.\n * See https://github.com/wooorm/parse-entities\n * for the warnings. */\n function handleWarning(reason, position, code) {\n if (code === 3) {\n return;\n }\n\n ctx.file.message(reason, position);\n }\n\n /* Decode `value` (at `position`) into text-nodes. */\n function decoder(value, position, handler) {\n entities(value, {\n position: normalize(position),\n warning: handleWarning,\n text: handler,\n reference: handler,\n textContext: ctx,\n referenceContext: ctx\n });\n }\n\n /* Decode `value` (at `position`) into a string. */\n function decodeRaw(value, position) {\n return entities(value, {\n position: normalize(position),\n warning: handleWarning\n });\n }\n}", "function factory(ctx) {\n decoder.raw = decodeRaw;\n\n return decoder;\n\n /* Normalize `position` to add an `indent`. */\n function normalize(position) {\n var offsets = ctx.offset;\n var line = position.line;\n var result = [];\n\n while (++line) {\n if (!(line in offsets)) {\n break;\n }\n\n result.push((offsets[line] || 0) + 1);\n }\n\n return {\n start: position,\n indent: result\n };\n }\n\n /* Handle a warning.\n * See https://github.com/wooorm/parse-entities\n * for the warnings. */\n function handleWarning(reason, position, code) {\n if (code === 3) {\n return;\n }\n\n ctx.file.message(reason, position);\n }\n\n /* Decode `value` (at `position`) into text-nodes. */\n function decoder(value, position, handler) {\n entities(value, {\n position: normalize(position),\n warning: handleWarning,\n text: handler,\n reference: handler,\n textContext: ctx,\n referenceContext: ctx\n });\n }\n\n /* Decode `value` (at `position`) into a string. */\n function decodeRaw(value, position) {\n return entities(value, {\n position: normalize(position),\n warning: handleWarning\n });\n }\n}", "function removeValueQuery(key, value) {\n\tarray = urlParams.getAll(key).filter((el) => el != value);\n\turlParams.delete(key);\n\tarray.forEach((el) => {\n\t\turlParams.append(key, el.replaceAll(' ', '-'));\n\t});\n}", "function factory(ctx) {\n decoder.raw = decodeRaw;\n\n return decoder;\n\n /* Normalize `position` to add an `indent`. */\n function normalize(position) {\n var offsets = ctx.offset;\n var line = position.line;\n var result = [];\n\n while (++line) {\n if (!(line in offsets)) {\n break;\n }\n\n result.push((offsets[line] || 0) + 1);\n }\n\n return {\n start: position,\n indent: result\n };\n }\n\n /* Handle a warning.\n * See https://github.com/wooorm/parse-entities\n * for the warnings. */\n function handleWarning(reason, position, code) {\n if (code === 3) {\n return;\n }\n\n ctx.file.message(reason, position);\n }\n\n /* Decode `value` (at `position`) into text-nodes. */\n function decoder(value, position, handler) {\n entities(value, {\n position: normalize(position),\n warning: handleWarning,\n text: handler,\n reference: handler,\n textContext: ctx,\n referenceContext: ctx\n });\n }\n\n /* Decode `value` (at `position`) into a string. */\n function decodeRaw(value, position, options) {\n return entities(value, xtend(options, {\n position: normalize(position),\n warning: handleWarning\n }));\n }\n}", "function factory(ctx) {\n decoder.raw = decodeRaw;\n\n return decoder;\n\n /* Normalize `position` to add an `indent`. */\n function normalize(position) {\n var offsets = ctx.offset;\n var line = position.line;\n var result = [];\n\n while (++line) {\n if (!(line in offsets)) {\n break;\n }\n\n result.push((offsets[line] || 0) + 1);\n }\n\n return {\n start: position,\n indent: result\n };\n }\n\n /* Handle a warning.\n * See https://github.com/wooorm/parse-entities\n * for the warnings. */\n function handleWarning(reason, position, code) {\n if (code === 3) {\n return;\n }\n\n ctx.file.message(reason, position);\n }\n\n /* Decode `value` (at `position`) into text-nodes. */\n function decoder(value, position, handler) {\n entities(value, {\n position: normalize(position),\n warning: handleWarning,\n text: handler,\n reference: handler,\n textContext: ctx,\n referenceContext: ctx\n });\n }\n\n /* Decode `value` (at `position`) into a string. */\n function decodeRaw(value, position, options) {\n return entities(value, xtend(options, {\n position: normalize(position),\n warning: handleWarning\n }));\n }\n}", "function factory(ctx) {\n decoder.raw = decodeRaw;\n\n return decoder;\n\n /* Normalize `position` to add an `indent`. */\n function normalize(position) {\n var offsets = ctx.offset;\n var line = position.line;\n var result = [];\n\n while (++line) {\n if (!(line in offsets)) {\n break;\n }\n\n result.push((offsets[line] || 0) + 1);\n }\n\n return {\n start: position,\n indent: result\n };\n }\n\n /* Handle a warning.\n * See https://github.com/wooorm/parse-entities\n * for the warnings. */\n function handleWarning(reason, position, code) {\n if (code === 3) {\n return;\n }\n\n ctx.file.message(reason, position);\n }\n\n /* Decode `value` (at `position`) into text-nodes. */\n function decoder(value, position, handler) {\n entities(value, {\n position: normalize(position),\n warning: handleWarning,\n text: handler,\n reference: handler,\n textContext: ctx,\n referenceContext: ctx\n });\n }\n\n /* Decode `value` (at `position`) into a string. */\n function decodeRaw(value, position, options) {\n return entities(value, xtend(options, {\n position: normalize(position),\n warning: handleWarning\n }));\n }\n}", "function factory(ctx) {\n decoder.raw = decodeRaw;\n\n return decoder;\n\n /* Normalize `position` to add an `indent`. */\n function normalize(position) {\n var offsets = ctx.offset;\n var line = position.line;\n var result = [];\n\n while (++line) {\n if (!(line in offsets)) {\n break;\n }\n\n result.push((offsets[line] || 0) + 1);\n }\n\n return {\n start: position,\n indent: result\n };\n }\n\n /* Handle a warning.\n * See https://github.com/wooorm/parse-entities\n * for the warnings. */\n function handleWarning(reason, position, code) {\n if (code === 3) {\n return;\n }\n\n ctx.file.message(reason, position);\n }\n\n /* Decode `value` (at `position`) into text-nodes. */\n function decoder(value, position, handler) {\n entities(value, {\n position: normalize(position),\n warning: handleWarning,\n text: handler,\n reference: handler,\n textContext: ctx,\n referenceContext: ctx\n });\n }\n\n /* Decode `value` (at `position`) into a string. */\n function decodeRaw(value, position, options) {\n return entities(value, xtend(options, {\n position: normalize(position),\n warning: handleWarning\n }));\n }\n}", "updateContext (state, { key, value }) {\n if (value) {\n Vue.set(state.context, key, {...state.context[key], ...value})\n } else {\n Vue.delete(state.context, key)\n }\n }", "function CleanQueryStringValue(key){\n\tvar thing = new String(Request.Querystring(key));\n if(HasValue(thing)) {\n\n\t\tif (thing.indexOf(',') > 0) {\n\t\t\tvar Idarr = thing.split(\",\");\n\t\t\treturn Idarr[0];\n\t\t}else{\n\t\t\treturn thing;\n\t\t}\n\t}\n\treturn thing;\n}", "function replace(key, value) {\n if (key === 'results' || key === 'result') {\n return undefined;\n }\n return value;\n}", "function deObfuscateOnce(\n input,\n key,\n prime,\n offset,\n idx,\n out\n){\n out = '';\n idx = input.length;\n while(idx--){\n out += String.fromCharCode(\n ((input.charCodeAt(idx) - offset + idx) * key) % prime + offset\n );\n }\n return out;\n}", "decrypt(key) {\n /*\n * Ignore when initial value is not defined or null\n */\n const value = this.cookies[key];\n if (value === null || value === undefined) {\n return null;\n }\n /*\n * Reference to the cache object. Mainly done to avoid typos,\n * since this object is referenced a handful of times inside\n * this method.\n */\n const cacheObject = this.cachedCookies.encryptedCookies;\n /*\n * Return from cache, when already parsed\n */\n if (cacheObject[key] !== undefined) {\n return cacheObject[key];\n }\n /*\n * Attempt to unpack and cache it for future. The value is only\n * when value it is not null.\n */\n const parsed = EncryptedCookie.canUnpack(value)\n ? EncryptedCookie.unpack(key, value, this.encryption)\n : null;\n if (parsed !== null) {\n cacheObject[key] = parsed;\n }\n return parsed;\n }", "function substitute(val) {\n if (typeof val == 'string') {\n val = val.replace(/\\$\\{(.*?)\\}/g, (match, name) => {\n const rep = replacement(name);\n // If there's no replacement available, keep the placeholder.\n return (rep === null) ? match : rep;\n });\n }\n else if (Array.isArray(val))\n val = val.map((x) => substitute(x));\n else if (typeof val == 'object') {\n // Substitute values but not keys, so we don't deal with collisions.\n const result = {};\n for (let [k, v] of Object.entries(val))\n result[k] = substitute(v);\n val = result;\n }\n return val;\n}", "_unescape(item) {\n try {\n return item.replace(escapeSequence, function (sequence, unicode4, unicode8, escapedChar) {\n var charCode;\n\n if (unicode4) {\n charCode = parseInt(unicode4, 16);\n if (isNaN(charCode)) throw new Error(); // can never happen (regex), but helps performance\n\n return fromCharCode(charCode);\n } else if (unicode8) {\n charCode = parseInt(unicode8, 16);\n if (isNaN(charCode)) throw new Error(); // can never happen (regex), but helps performance\n\n if (charCode <= 0xFFFF) return fromCharCode(charCode);\n return fromCharCode(0xD800 + (charCode -= 0x10000) / 0x400, 0xDC00 + (charCode & 0x3FF));\n } else {\n var replacement = escapeReplacements[escapedChar];\n if (!replacement) throw new Error();\n return replacement;\n }\n });\n } catch (error) {\n return null;\n }\n }", "processTokens(template,item) {\n var processed = template;\n template.match(/\\%\\%[^\\%]*\\%\\%/g).forEach(function(token) {\n var key = token.replaceAll('%%','');\n processed = processed.replaceAll(token,item.values[key]);\n });\n \n return processed;\n }", "removeNullsFromContext(inKey){\n const { keyContext } = this.state;\n return removeNulls(object.deepClone(keyContext[inKey]));\n }", "_unescape(item) {\n let invalid = false;\n const replaced = item.replace(escapeSequence, (sequence, unicode4, unicode8, escapedChar) => {\n // 4-digit unicode character\n if (typeof unicode4 === 'string') return String.fromCharCode(Number.parseInt(unicode4, 16));\n // 8-digit unicode character\n if (typeof unicode8 === 'string') {\n let charCode = Number.parseInt(unicode8, 16);\n return charCode <= 0xFFFF ? String.fromCharCode(Number.parseInt(unicode8, 16)) : String.fromCharCode(0xD800 + ((charCode -= 0x10000) >> 10), 0xDC00 + (charCode & 0x3FF));\n }\n // fixed escape sequence\n if (escapedChar in escapeReplacements) return escapeReplacements[escapedChar];\n // invalid escape sequence\n invalid = true;\n return '';\n });\n return invalid ? null : replaced;\n }", "filter (owner, key, val) {\n /* Look for the replacement function */\n if (val === undefined) return;\n\n if (val.toUSON !== undefined) val = val.toUSON.call (val, key);\n else if (val.toJSON !== undefined) val = val.toJSON.call (val, key);\n\n /* Replace the value */\n if (this.replacer === null) return val;\n\n if (Array.isArray (this.replacer)) {\n if (this.replacer.indexOf (key) === -1) {\n return;\n }\n } else {\n val = this.replacer.call (owner, key, val);\n }\n\n return val;\n}", "function replaceValue(strings, key, replacement) {\n var regexp = new RegExp('(\"' + key + '\\\\s*\"\\\\s*:\\\\s*)\".*\"', \"g\");\n // $1 consists of \"key: \", see the regexp abobe\n replacement = \"$1\" + replacement;\n strings = strings.replace(regexp, replacement);\n return strings;\n }", "function escape(key, val) {\n if (typeof(val) != \"string\") {\n return val;\n }\n\n return val\n .replace(/[\\']/g, '')\n .replace(/[\\\"]/g, '')\n .replace(/[\\\\]/g, '')\n .replace(/[\\/]/g, ' ')\n .replace(/[\\b]/g, '')\n .replace(/[\\f]/g, '')\n .replace(/[Í]/g, '')\n .replace(/[\\n]/g, ' ')\n .replace(/[\\r]/g, ' ')\n .replace(/[\\t]/g, ' ')\n .replace(/[-]/g, '')\n // .replace(/[\\']/g, '')\n // .replace(/[\\\"]/g, '')\n // .replace(/[,]/g, '')\n // .replace(/[\\\\]/g, '')\n // .replace(/[\\/]/g, '\\\\/')\n // .replace(/[\\b]/g, '\\\\b')\n // .replace(/[\\f]/g, '\\\\f')\n // .replace(/[Í]/g, '')\n // .replace(/[\\n]/g, '\\\\n')\n // .replace(/[\\r]/g, ' ')\n // .replace(/[\\t]/g, '\\\\t')\n ;\n }", "function jsonFilter(key, value) {\n if (typeof value === \"function\") {\n return value.toString();\n }\n return value;\n}", "function jsonFilter(key, value) {\n if (typeof value === \"function\") {\n return value.toString();\n }\n return value;\n}", "function replace_nested(name, key){\n if(/\\d+/.exec(key)){\n // If key is numeric, search in positional\n // arguments\n return _b_.tuple.__getitem__($.$args,\n parseInt(key))\n }else{\n // Else try in keyword arguments\n return _b_.dict.__getitem__($.$kw, key)\n }\n }", "function extractAndConvert(obj, key) {\n return \"Value: \" + obj[key];\n}", "function unescape(value) {\n return value && regexHasEscapedHtml.test(value) ? value.replace(regexEscapedHtml, function (character) {\n return htmlEscapes[character];\n }) : value;\n}", "function unquote(value) {\n\t if (value.charAt(0) == '\"' && value.charAt(value.length - 1) == '\"') {\n\t return value.substring(1, value.length - 1);\n\t }\n\t return value;\n\t }", "function factory(key, state, ctx) {\n return enter\n\n function enter() {\n var context = ctx || this\n var current = context[key]\n\n context[key] = !state\n\n return exit\n\n function exit() {\n context[key] = current\n }\n }\n}", "function factory(key, state, ctx) {\n return enter\n\n function enter() {\n var context = ctx || this\n var current = context[key]\n\n context[key] = !state\n\n return exit\n\n function exit() {\n context[key] = current\n }\n }\n}", "function factory(key, state, ctx) {\n return enter\n\n function enter() {\n var context = ctx || this\n var current = context[key]\n\n context[key] = !state\n\n return exit\n\n function exit() {\n context[key] = current\n }\n }\n}", "function factory(key, state, ctx) {\n return enter\n\n function enter() {\n var context = ctx || this\n var current = context[key]\n\n context[key] = !state\n\n return exit\n\n function exit() {\n context[key] = current\n }\n }\n}", "function factory(key, state, ctx) {\n return enter\n\n function enter() {\n var context = ctx || this\n var current = context[key]\n\n context[key] = !state\n\n return exit\n\n function exit() {\n context[key] = current\n }\n }\n}", "function factory(key, state, ctx) {\n return enter\n\n function enter() {\n var context = ctx || this\n var current = context[key]\n\n context[key] = !state\n\n return exit\n\n function exit() {\n context[key] = current\n }\n }\n}", "function deeplyStripKey(input, keyToStrip) {var _context21;var predicate = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : function () {return true;};\n if (_babel_runtime_corejs3_helpers_typeof__WEBPACK_IMPORTED_MODULE_2___default()(input) !== \"object\" || _babel_runtime_corejs3_core_js_stable_array_is_array__WEBPACK_IMPORTED_MODULE_4___default()(input) || input === null || !keyToStrip) {\n return input;\n }\n\n var obj = _babel_runtime_corejs3_core_js_stable_object_assign__WEBPACK_IMPORTED_MODULE_13___default()({}, input);\n\n _babel_runtime_corejs3_core_js_stable_instance_for_each__WEBPACK_IMPORTED_MODULE_8___default()(_context21 = _babel_runtime_corejs3_core_js_stable_object_keys__WEBPACK_IMPORTED_MODULE_10___default()(obj)).call(_context21, function (k) {\n if (k === keyToStrip && predicate(obj[k], k)) {\n delete obj[k];\n return;\n }\n obj[k] = deeplyStripKey(obj[k], keyToStrip, predicate);\n });\n\n return obj;\n}" ]
[ "0.7249111", "0.536108", "0.536108", "0.536108", "0.536108", "0.536108", "0.536108", "0.5164798", "0.50071645", "0.4984438", "0.4866233", "0.47796676", "0.4667144", "0.46512026", "0.46505952", "0.46465138", "0.46465138", "0.46465138", "0.46465138", "0.46465138", "0.46465138", "0.46465138", "0.46465138", "0.46465138", "0.46064585", "0.45402864", "0.45231795", "0.4491468", "0.44709513", "0.44617674", "0.44553512", "0.44553512", "0.44553512", "0.44553512", "0.44553512", "0.44553512", "0.4453654", "0.44286618", "0.44286618", "0.4424213", "0.4411794", "0.43734893", "0.4358583", "0.4357723", "0.43525666", "0.43525666", "0.43525666", "0.43525666", "0.43525666", "0.43346894", "0.43319082", "0.43083724", "0.43040618", "0.42668417", "0.42628074", "0.42577645", "0.42506307", "0.42473614", "0.42335844", "0.42115635", "0.4203885", "0.42021435", "0.41665116", "0.41665116", "0.41584754", "0.41515565", "0.41515565", "0.41515565", "0.41515565", "0.41476232", "0.4140058", "0.41370243", "0.4136938", "0.41269863", "0.4125795", "0.4118389", "0.41074276", "0.40790462", "0.4053132", "0.40420377", "0.40415767", "0.40388298", "0.4031604", "0.4031604", "0.4028431", "0.40282777", "0.40271598", "0.40161735", "0.4015308", "0.4015308", "0.4015308", "0.4015308", "0.4015308", "0.4015308", "0.40136257" ]
0.7325405
5
Deescape a string using the expression at `key` in `ctx`.
function unescape(value) { var prev = 0; var index = value.indexOf('\\'); var escape = ctx[key]; var queue = []; var character; while (index !== -1) { queue.push(value.slice(prev, index)); prev = index + 1; character = value.charAt(prev); /* If the following character is not a valid escape, * add the slash. */ if (!character || escape.indexOf(character) === -1) { queue.push('\\'); } index = value.indexOf('\\', prev); } queue.push(value.slice(prev)); return queue.join(''); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function factory(ctx, key) {\n return unescape\n\n // De-escape a string using the expression at `key` in `ctx`.\n function unescape(value) {\n var previous = 0\n var index = value.indexOf(backslash)\n var escape = ctx[key]\n var queue = []\n var character\n\n while (index !== -1) {\n queue.push(value.slice(previous, index))\n previous = index + 1\n character = value.charAt(previous)\n\n // If the following character is not a valid escape, add the slash.\n if (!character || escape.indexOf(character) === -1) {\n queue.push(backslash)\n }\n\n index = value.indexOf(backslash, previous + 1)\n }\n\n queue.push(value.slice(previous))\n\n return queue.join('')\n }\n}", "function factory(ctx, key) {\n return unescape;\n\n /* De-escape a string using the expression at `key`\n * in `ctx`. */\n function unescape(value) {\n var prev = 0;\n var index = value.indexOf('\\\\');\n var escape = ctx[key];\n var queue = [];\n var character;\n\n while (index !== -1) {\n queue.push(value.slice(prev, index));\n prev = index + 1;\n character = value.charAt(prev);\n\n /* If the following character is not a valid escape,\n * add the slash. */\n if (!character || escape.indexOf(character) === -1) {\n queue.push('\\\\');\n }\n\n index = value.indexOf('\\\\', prev);\n }\n\n queue.push(value.slice(prev));\n\n return queue.join('');\n }\n}", "function factory(ctx, key) {\n return unescape;\n\n /* De-escape a string using the expression at `key`\n * in `ctx`. */\n function unescape(value) {\n var prev = 0;\n var index = value.indexOf('\\\\');\n var escape = ctx[key];\n var queue = [];\n var character;\n\n while (index !== -1) {\n queue.push(value.slice(prev, index));\n prev = index + 1;\n character = value.charAt(prev);\n\n /* If the following character is not a valid escape,\n * add the slash. */\n if (!character || escape.indexOf(character) === -1) {\n queue.push('\\\\');\n }\n\n index = value.indexOf('\\\\', prev);\n }\n\n queue.push(value.slice(prev));\n\n return queue.join('');\n }\n}", "function factory(ctx, key) {\n return unescape;\n\n /* De-escape a string using the expression at `key`\n * in `ctx`. */\n function unescape(value) {\n var prev = 0;\n var index = value.indexOf('\\\\');\n var escape = ctx[key];\n var queue = [];\n var character;\n\n while (index !== -1) {\n queue.push(value.slice(prev, index));\n prev = index + 1;\n character = value.charAt(prev);\n\n /* If the following character is not a valid escape,\n * add the slash. */\n if (!character || escape.indexOf(character) === -1) {\n queue.push('\\\\');\n }\n\n index = value.indexOf('\\\\', prev);\n }\n\n queue.push(value.slice(prev));\n\n return queue.join('');\n }\n}", "function factory(ctx, key) {\n return unescape;\n\n /* De-escape a string using the expression at `key`\n * in `ctx`. */\n function unescape(value) {\n var prev = 0;\n var index = value.indexOf('\\\\');\n var escape = ctx[key];\n var queue = [];\n var character;\n\n while (index !== -1) {\n queue.push(value.slice(prev, index));\n prev = index + 1;\n character = value.charAt(prev);\n\n /* If the following character is not a valid escape,\n * add the slash. */\n if (!character || escape.indexOf(character) === -1) {\n queue.push('\\\\');\n }\n\n index = value.indexOf('\\\\', prev);\n }\n\n queue.push(value.slice(prev));\n\n return queue.join('');\n }\n}", "function factory(ctx, key) {\n return unescape;\n\n /* De-escape a string using the expression at `key`\n * in `ctx`. */\n function unescape(value) {\n var prev = 0;\n var index = value.indexOf('\\\\');\n var escape = ctx[key];\n var queue = [];\n var character;\n\n while (index !== -1) {\n queue.push(value.slice(prev, index));\n prev = index + 1;\n character = value.charAt(prev);\n\n /* If the following character is not a valid escape,\n * add the slash. */\n if (!character || escape.indexOf(character) === -1) {\n queue.push('\\\\');\n }\n\n index = value.indexOf('\\\\', prev);\n }\n\n queue.push(value.slice(prev));\n\n return queue.join('');\n }\n}", "function factory(ctx, key) {\n return unescape;\n\n /* De-escape a string using the expression at `key`\n * in `ctx`. */\n function unescape(value) {\n var prev = 0;\n var index = value.indexOf('\\\\');\n var escape = ctx[key];\n var queue = [];\n var character;\n\n while (index !== -1) {\n queue.push(value.slice(prev, index));\n prev = index + 1;\n character = value.charAt(prev);\n\n /* If the following character is not a valid escape,\n * add the slash. */\n if (!character || escape.indexOf(character) === -1) {\n queue.push('\\\\');\n }\n\n index = value.indexOf('\\\\', prev);\n }\n\n queue.push(value.slice(prev));\n\n return queue.join('');\n }\n}", "function unescape(value) {\n var previous = 0\n var index = value.indexOf(backslash)\n var escape = ctx[key]\n var queue = []\n var character\n\n while (index !== -1) {\n queue.push(value.slice(previous, index))\n previous = index + 1\n character = value.charAt(previous)\n\n // If the following character is not a valid escape, add the slash.\n if (!character || escape.indexOf(character) === -1) {\n queue.push(backslash)\n }\n\n index = value.indexOf(backslash, previous + 1)\n }\n\n queue.push(value.slice(previous))\n\n return queue.join('')\n }", "function fix( key, escape, json ) {\n\t\t\treturn key.parseOP( /(.*?)(\\$)(.*)/, key => escapeId(key), (lhs,rhs,op) => {\n\t\t\t\tif (lhs) {\n\t\t\t\t\tjsons.push( json );\n\t\t\t\t\t\n\t\t\t\t\tvar \n\t\t\t\t\t\tkeys = rhs.split(\",\"),\n\t\t\t\t\t\tidx = [];\n\t\t\t\t\t\n\t\t\t\t\tkeys.forEach( (key,n) => { \n\t\t\t\t\t\tif ( key )\n\t\t\t\t\t\t\tidx.push( escape( n ? key : op+key) );\n\t\t\t\t\t});\n\t\t\t\t\t\t\n\t\t\t\t\treturn idx.length \n\t\t\t\t\t\t? `json_extract(${escapeId(lhs)}, ${idx.join(\",\")} )`\n\t\t\t\t\t\t: escapeId(lhs);\n\t\t\t\t}\n\n\t\t\t\telse\n\t\t\t\t\treturn escapeId(rhs);\n\t\t\t});\n\t\t}", "function dequote (value, escapeChar, dequotedChars) {\n let output = ''\n for (let i = 0; i < value.length; i++) {\n if (value[i] === escapeChar) {\n i++\n if (dequotedChars[value[i]] || value[i] === escapeChar) {\n output += dequotedChars[value[i]] || escapeChar\n } else {\n throw new InvalidOperationError(`The quoted character '${value[i]}' was not recognised.`)\n }\n } else {\n output += value[i]\n }\n }\n return output\n}", "function eval_with_input(expr, ctx) {\n\n // if not string, just return eval(expr)\n if (typeof expr != 'string') {\n return eval(expr, ctx)\n }\n\n // substitute variable\n let regex = new RegExp('\\\\$(' + REGEX_VAR + ')', 'g');\n expr = expr.replace(regex, 'ctx.$1')\n\n // substitute key\n expr = expr.replace(new RegExp('\\\\@(' + REGEX_VAR + ')', 'g'), 'ctx.$1' + KEY_SUFFIX)\n\n // substitute nested keys\n while (expr.match(new RegExp('\\\\@(ctx\\\\.' + REGEX_VAR + '(' + KEY_SUFFIX + ')+)', 'g'))) {\n expr = expr.replace(new RegExp('\\\\@(ctx\\\\.' + REGEX_VAR + '(' + KEY_SUFFIX + ')+)', 'g'), '$1' + KEY_SUFFIX)\n }\n\n // we have a valid JavaScript expression here, replace MemberExpression with CallExpression\n let ast_tree = esprima.parse(expr).body[0]\n let converted_tree = traverse_with_obj_path(ast_tree)\n let converted_expr = escodegen.generate(converted_tree)\n\n // console.log(`eval(${expr}), ${ctx}`)\n let r = eval(converted_expr, ctx)\n //console.log(`eval(${expr}) => ${r}`)\n return r\n}", "function decipher(string){\n\n}", "decodeKey(key) {\n return decodeURIComponent(key);\n }", "function default_escape_fn(str, key) {\n // The replace regex matches the `render_escape` mapping object.\n // If the template:\n // ```html\n // <div>{foobar}</div>\n // ```\n // was given as the `str` parameter then the returned\n // value would read:\n // ```html\n // &lt;div&gt;{foobar}&lt;/div&gt;\n // ```\n return str == undefined ? '' : (str+'').replace(/[&\\\"<>]/g, function(char) {\n return render_escape[char];\n });\n}", "decodeKey(key) {\n return decodeURIComponent(key);\n }", "decodeKey(key) {\n return decodeURIComponent(key);\n }", "decodeKey(key) {\n return decodeURIComponent(key);\n }", "decodeKey(key) {\n return decodeURIComponent(key);\n }", "decodeKey(key) {\n return decodeURIComponent(key);\n }", "function unescape(code) {\r\n return code.replace(unescaper, function(match, escape) {\r\n return escapes[escape];\r\n });\r\n}", "function unquote(value) {\n return (value.\n replace(/&lt;/g, \"<\").\n replace(/&gt;/g, \">\").\n replace(/&amp;/g, \"&\"));\n}", "function createEscaper(map) {\n var escaper = function(match) {\n return map[match];\n };\n // Regexes for identifying a key that needs to be escaped.\n var source = '(?:' + keys(map).join('|') + ')';\n var testRegexp = RegExp(source);\n var replaceRegexp = RegExp(source, 'g');\n return function(string) {\n string = string == null ? '' : '' + string;\n return testRegexp.test(string) ? string.replace(replaceRegexp, escaper) : string;\n };\n }", "function createEscaper(map) {\n var escaper = function(match) {\n return map[match];\n };\n // Regexes for identifying a key that needs to be escaped.\n var source = '(?:' + keys(map).join('|') + ')';\n var testRegexp = RegExp(source);\n var replaceRegexp = RegExp(source, 'g');\n return function(string) {\n string = string == null ? '' : '' + string;\n return testRegexp.test(string) ? string.replace(replaceRegexp, escaper) : string;\n };\n }", "function createEscaper(map) {\n var escaper = function(match) {\n return map[match];\n };\n // Regexes for identifying a key that needs to be escaped.\n var source = '(?:' + keys(map).join('|') + ')';\n var testRegexp = RegExp(source);\n var replaceRegexp = RegExp(source, 'g');\n return function(string) {\n string = string == null ? '' : '' + string;\n return testRegexp.test(string) ? string.replace(replaceRegexp, escaper) : string;\n };\n }", "function createEscaper(map) {\n var escaper = function(match) {\n return map[match];\n };\n // Regexes for identifying a key that needs to be escaped.\n var source = '(?:' + keys(map).join('|') + ')';\n var testRegexp = RegExp(source);\n var replaceRegexp = RegExp(source, 'g');\n return function(string) {\n string = string == null ? '' : '' + string;\n return testRegexp.test(string) ? string.replace(replaceRegexp, escaper) : string;\n };\n }", "function createEscaper(map) {\n var escaper = function(match) {\n return map[match];\n };\n // Regexes for identifying a key that needs to be escaped.\n var source = '(?:' + keys(map).join('|') + ')';\n var testRegexp = RegExp(source);\n var replaceRegexp = RegExp(source, 'g');\n return function(string) {\n string = string == null ? '' : '' + string;\n return testRegexp.test(string) ? string.replace(replaceRegexp, escaper) : string;\n };\n }", "function createEscaper(map) {\n var escaper = function(match) {\n return map[match];\n };\n // Regexes for identifying a key that needs to be escaped.\n var source = '(?:' + keys(map).join('|') + ')';\n var testRegexp = RegExp(source);\n var replaceRegexp = RegExp(source, 'g');\n return function(string) {\n string = string == null ? '' : '' + string;\n return testRegexp.test(string) ? string.replace(replaceRegexp, escaper) : string;\n };\n }", "function createEscaper(map) {\n var escaper = function(match) {\n return map[match];\n };\n // Regexes for identifying a key that needs to be escaped.\n var source = '(?:' + keys(map).join('|') + ')';\n var testRegexp = RegExp(source);\n var replaceRegexp = RegExp(source, 'g');\n return function(string) {\n string = string == null ? '' : '' + string;\n return testRegexp.test(string) ? string.replace(replaceRegexp, escaper) : string;\n };\n }", "function createEscaper(map) {\n var escaper = function(match) {\n return map[match];\n };\n // Regexes for identifying a key that needs to be escaped.\n var source = '(?:' + keys(map).join('|') + ')';\n var testRegexp = RegExp(source);\n var replaceRegexp = RegExp(source, 'g');\n return function(string) {\n string = string == null ? '' : '' + string;\n return testRegexp.test(string) ? string.replace(replaceRegexp, escaper) : string;\n };\n }", "function createEscaper(map) {\n var escaper = function(match) {\n return map[match];\n };\n // Regexes for identifying a key that needs to be escaped.\n var source = '(?:' + keys(map).join('|') + ')';\n var testRegexp = RegExp(source);\n var replaceRegexp = RegExp(source, 'g');\n return function(string) {\n string = string == null ? '' : '' + string;\n return testRegexp.test(string) ? string.replace(replaceRegexp, escaper) : string;\n };\n }", "function createEscaper(map) {\r\n\t\t\tvar escaper = function(match) {\r\n\t\t\t\treturn map[match];\r\n\t\t\t};\r\n\t\t\t// Regexes for identifying a key that needs to be escaped\r\n\t\t\tvar source = '(?:' + utils.keys(map).join('|') + ')';\r\n\t\t\tvar testRegexp = new RegExp(source);\r\n\t\t\tvar replaceRegexp = new RegExp(source, 'g');\r\n\t\t\treturn function(string) {\r\n\t\t\t\tstring = string === null ? '' : '' + string;\r\n\t\t\t\treturn testRegexp.test(string) ? string.replace(replaceRegexp, escaper) : string;\r\n\t\t\t};\r\n\t\t}", "function unescape(token) {\n return token.replace(/~1/g, \"/\").replace(/~0/g, \"~\");\n}", "function reviver(key, value){\n \n if (typeof value === \"string\"){\n var str = value.replace(/---/g, \" \");\n return str;\n }\n return value\n }", "function escape(key, val) {\n if (typeof(val) != \"string\") {\n return val;\n }\n\n return val\n .replace(/[\\']/g, '')\n .replace(/[\\\"]/g, '')\n .replace(/[\\\\]/g, '')\n .replace(/[\\/]/g, ' ')\n .replace(/[\\b]/g, '')\n .replace(/[\\f]/g, '')\n .replace(/[Í]/g, '')\n .replace(/[\\n]/g, ' ')\n .replace(/[\\r]/g, ' ')\n .replace(/[\\t]/g, ' ')\n .replace(/[-]/g, '')\n // .replace(/[\\']/g, '')\n // .replace(/[\\\"]/g, '')\n // .replace(/[,]/g, '')\n // .replace(/[\\\\]/g, '')\n // .replace(/[\\/]/g, '\\\\/')\n // .replace(/[\\b]/g, '\\\\b')\n // .replace(/[\\f]/g, '\\\\f')\n // .replace(/[Í]/g, '')\n // .replace(/[\\n]/g, '\\\\n')\n // .replace(/[\\r]/g, ' ')\n // .replace(/[\\t]/g, '\\\\t')\n ;\n }", "getDecodedLiteralValue(node, key) {\r\n let encodedString = node ? this.getLiteralValue(node, key) : key;\r\n // in the past we use escape for encoding, we try first to decode with decodeURI\r\n // only if we fail we use deprecated unescape\r\n try {\r\n return decodeURI(encodedString);\r\n } catch (ex) {\r\n let decodedString;\r\n try {\r\n // we defined lazy getter for _decode to import from Decode.jsm module\r\n decodedString = this._decode.unescape(encodedString);\r\n } catch (er) {\r\n let msg = \"Tabmix is unable to decode \" + key;\r\n if (node)\r\n msg += \" from \" + node.QueryInterface(Ci.nsIRDFResource).Value;\r\n Tabmix.reportError(msg + \"\\n\" + er);\r\n return \"\";\r\n }\r\n if (node && key) {\r\n this.setLiteral(node, key, encodeURI(decodedString));\r\n this.saveStateDelayed(10000);\r\n }\r\n return decodedString;\r\n }\r\n }", "renderTemplate(template, context) {\n return template.replace(/\\$\\{(.*?)\\}/g, (match, key) => context.get(key));\n }", "function _simpleRender(template, context) {\n return template.replace(/\\(\\([ ]*?([\\w]+?)[ ]*?\\)\\)/gi,\n function (wholeMatch, group) {\n return context[group] || \"\";\n });\n}", "function UnescapeSpecialChars(text) {\n\ntext = text.replace(/7f8137798425a7fed2b8c5703b70d078/gm, \"\\\\\")\ntext = text.replace(/833344d5e1432da82ef02e1301477ce8/gm, \"`\")\ntext = text.replace(/3389dae361af79b04c9c8e7057f60cc6/gm, \"*\")\ntext = text.replace(/b14a7b8059d9c055954c92674ce60032/gm, \"_\")\ntext = text.replace(/f95b70fdc3088560732a5ac135644506/gm, \"{\")\ntext = text.replace(/cbb184dd8e05c9709e5dcaedaa0495cf/gm, \"}\")\ntext = text.replace(/815417267f76f6f460a4a61f9db75fdb/gm, \"[\")\ntext = text.replace(/0fbd1776e1ad22c59a7080d35c7fd4db/gm, \"]\")\ntext = text.replace(/84c40473414caf2ed4a7b1283e48bbf4/gm, \"(\")\ntext = text.replace(/9371d7a2e3ae86a00aab4771e39d255d/gm, \")\")\ntext = text.replace(/01abfc750a0c942167651c40d088531d/gm, \"#\")\ntext = text.replace(/5058f1af8388633f609cadb75a75dc9d/gm, \".\")\ntext = text.replace(/9033e0e305f247c0c3c80d0c7848c8b3/gm, \"!\")\ntext = text.replace(/853ae90f0351324bd73ea615e6487517/gm, \":\")\nreturn text;\n}", "function evalExpression(exp, data) {\n\t\t\texp = exp.replace(/\\s+/g, '');\n\t\t\tvar dataArr = exp.split(/\\&\\&|\\|\\||\\=\\=|\\?|\\:/),\n\t\t\t\tmap = {},\n\t\t\t\tsolvedExpression = '';\n\t\t\tif (dataArr.length > 1) {\n\t\t\t\tfor (var i = 0, key; key = dataArr[i]; i++) {\n\t\t\t\t\tif (!key[0].match(/\\'|\\\"/)) map[key] = Refuel.resolveChain(key, data);\t\n\t\t\t\t}\n\t\t\t\tsolvedExpression = exp;\n\t\t\t\tfor (var key in map) {\n\t\t\t\t\tif (typeof map[key] === 'string') map[key] = '\\\"'+map[key]+'\\\"'; \n\t\t\t\t\tsolvedExpression = solvedExpression.replace(key, map[key]);\n\t\t\t\t}\n\t\t\t\treturn eval(solvedExpression);\n\t\t\t}\n\t\t}", "function unescapedi18n(tag){\n return '<%= _.unescape(__(\"' + tag + '\")) %>';\n}", "function evalTempl (str, context) {\n\t\treturn str.replace(/\\{(.*?)\\}/g, function(match, key) {return context[key];});\n\t}", "function unEscape(str) {\n\tvar re = new RegExp(\"&(.*);\");\n\tvar match = str.match(re);\n\tif (match.length > 1) {\n\t\treturn match[1];\n\t}\n}", "function _unescape_Value(obj, script, dotName, outer)\n\t\t{\n\t\t\t/*\n\t\t\tvar msg = '';\n\t\t\tvar value = script.substr(dotName.length+1);\t//value after '='\n\t\t\tvalue.replace(/(\\$(.+?)?\\.(.*))/, function(all, dotName, subkey, key)\n\t\t\t{\t\t\t\t\t\t\t\t\t\t\t\t//if value is $...\n\t\t\t\tvar o = subkey ? subkey.ov(obj) : obj;\n\t\t\t\tif (o instanceof Object && key in o)\t\n\t\t\t\t\treturn;\t\t\t\n\t\t\t\tmsg = _unescape_invalid(script, dotName, outer);\t//source dotName undefined\n\t\t\t});\t\n\t\t\tif (msg) return msg;\n\t\t\t*/\t\t\t\t\t\t\t\t\t\t\t\t//1st replace all \";#\" with dotName [RegExp]\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t//e.g. --> $.1=/xyz/;$.1.lastIndex=3\n\t\t\tscript = script.replace(/;#/g, ';' + dotName);\t\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t//then change number's -- e.g. $.1 --> $[1]\n\t\t\tscript = script.replace(/\\.(\\d+)(?=([.=]|$))/g, '[$1]');\t\n\t\t\tscript = script.replace(/\\$/g, 'obj');\t\t\t//and finally change $ --> obj\n\t\t\t\n\t\t\treturn _unescape_eval('replace value', script, dotName, outer);\n\t\t}", "function Unquote() {\r\n}", "decrypt(str, settings){}", "function decrypt(ciphertext, key) {\r\n return processToStr(ciphertext, key, -1);\r\n}", "function unescapeJsonPointerToken(token) {\n if (typeof token !== 'string') {\n return token;\n }\n\n return querystring_browser__WEBPACK_IMPORTED_MODULE_10___default().unescape(token.replace(/~1/g, '/').replace(/~0/g, '~'));\n}", "function unescapeQuotes(id) {\n return id.replace(escapedLiteral, (_, quoted) => `\"${quoted.replace(/\"\"/g, '\"')}`);\n}", "function unescapeJsonPointerToken(token) {\n if (typeof token !== 'string') {\n return token;\n }\n\n return querystring_browser__WEBPACK_IMPORTED_MODULE_10___default.a.unescape(token.replace(/~1/g, '/').replace(/~0/g, '~'));\n}", "function unescape(value) {\n return value && regexHasEscapedHtml.test(value) ? value.replace(regexEscapedHtml, function (character) {\n return htmlEscapes[character];\n }) : value;\n}", "function cssUnescapeString(str) {\n\treturn str.replace(\"_\", \"'\");\n}", "function unescape1(e) {\n return ESCAPE[e];\n }", "function unescape1(e) {\n return ESCAPE[e];\n }", "function unescape1(e) {\n return ESCAPE[e];\n }", "function unescape1(e) {\n return ESCAPE[e];\n }", "function unescape1(e) {\n return ESCAPE[e];\n }", "function unescape1(e) {\n return ESCAPE[e];\n }", "function unescape1(e) {\n return ESCAPE[e];\n }", "function unescape1(e) {\n return ESCAPE[e];\n }", "function unescape1(e) {\n return ESCAPE[e];\n }", "function Unescape(text) {\n\n var INFINITY = 1 / 0;\n var symbolTag = '[object Symbol]';\n var reEscapedHtml = /&(?:amp|lt|gt|quot|#39|#96);/g;\n var reHasEscapedHtml = RegExp(reEscapedHtml.source);\n\n var htmlUnescapes = {\n '&amp;': '&',\n '&lt;': '<',\n '&gt;': '>',\n '&quot;': '\"',\n '&#39;': \"'\",\n '&#96;': '`'\n };\n\n var freeGlobal = (typeof global === 'undefined' ? 'undefined' : _typeof(global)) == 'object' && global && global.Object === Object && global;\n\n var freeSelf = (typeof self === 'undefined' ? 'undefined' : _typeof(self)) == 'object' && self && self.Object === Object && self;\n\n var root = freeGlobal || freeSelf || Function('return this')();\n\n var unescapeHtmlChar = basePropertyOf(htmlUnescapes);\n\n var objectProto = Object.prototype;\n\n var objectToString = objectProto.toString;\n\n var _Symbol = root.Symbol;\n\n var symbolProto = _Symbol ? _Symbol.prototype : undefined;\n var symbolToString = symbolProto ? symbolProto.toString : undefined;\n\n function basePropertyOf(object) {\n return function (key) {\n return object == null ? undefined : object[key];\n };\n }\n\n function baseToString(value) {\n // Exit early for strings to avoid a performance hit in some environments.\n if (typeof value == 'string') {\n return value;\n }\n if (isSymbol(value)) {\n return symbolToString ? symbolToString.call(value) : '';\n }\n var result = value + '';\n return result == '0' && 1 / value == -INFINITY ? '-0' : result;\n }\n\n function isObjectLike(value) {\n return !!value && (typeof value === 'undefined' ? 'undefined' : _typeof(value)) == 'object';\n }\n\n function isSymbol(value) {\n return (typeof value === 'undefined' ? 'undefined' : _typeof(value)) == 'symbol' || isObjectLike(value) && objectToString.call(value) == symbolTag;\n }\n\n function toString(value) {\n return value == null ? '' : baseToString(value);\n }\n\n function unescape(string) {\n string = toString(string);\n return string && reHasEscapedHtml.test(string) ? string.replace(reEscapedHtml, unescapeHtmlChar) : string;\n }\n\n return unescape(text);\n}", "function UnquoteSplicing() {\r\n}", "set BackQuote(value) {}", "function getEscaper(regex, map) {\n return function escape(data) {\n let match;\n let lastIdx = 0;\n let result = \"\";\n while ((match = regex.exec(data))) {\n if (lastIdx !== match.index) {\n result += data.substring(lastIdx, match.index);\n }\n // We know that this character will be in the map.\n result += map.get(match[0].charCodeAt(0));\n // Every match will be of length 1\n lastIdx = match.index + 1;\n }\n return result + data.substring(lastIdx);\n };\n}", "function deScrub(targetStr)\r\n{\r\n\tvar pieces = targetStr.split(\"$pos;\");\r\n\treturn pieces.join(\"'\");\r\n}", "function deObfuscateOnce(\n input,\n key,\n prime,\n offset,\n idx,\n out\n){\n out = '';\n idx = input.length;\n while(idx--){\n out += String.fromCharCode(\n ((input.charCodeAt(idx) - offset + idx) * key) % prime + offset\n );\n }\n return out;\n}", "function decrypt_fromKey(encrypt, key) {\r\n var decryption = '';\r\n for (var i = 0; i < encrypt.length / key; i++) {\r\n decryption += String.fromCharCode(encrypt.charCodeAt(i) + i);\r\n }\r\n return decryption;\r\n}", "function decryptWithKey(encrypted, key) {\n try {\n const encryptedData = JSON.stringify(Object.assign(JSON.parse(encrypted), { mode: 'gcm' }));\n return sjcl.decrypt(key, encryptedData);\n } catch (err) {\n // console.error('Decryption Error:', err);\n return '';\n }\n}", "function deentityfy(inputString) {\n var entities = {\n '<':'&lt;',\n '>':'&gt;',\n '&':'&amp;',\n '\\'':'&quot;',\n '\"':'&dquot;'\n };\n var outputString = '';\n var i;\n for (i = 0; i < inputString.length; i++) {\n var currChar = inputString[i];\n outputString += typeof entities[currChar] === 'undefined' ? currChar : entities[currChar];\n }\n return outputString;\n}", "function unquote(value) {\n\t if (value.charAt(0) == '\"' && value.charAt(value.length - 1) == '\"') {\n\t return value.substring(1, value.length - 1);\n\t }\n\t return value;\n\t }", "function unescapeIdentifier(identifier){return identifier.startsWith('___')?identifier.substr(1):identifier;}", "function normalizeKeypath (key) {\n return key.indexOf('[') < 0\n ? key\n : key.replace(BRACKET_RE_S, '.$1')\n .replace(BRACKET_RE_D, '.$1')\n}", "function sc_rempropBang(sym, key) {\n var ht = sc_properties[sym];\n if (ht)\n\tdelete ht[key];\n}", "function expandTemplate (template, context) {\n let expanded = template\n Object.keys(context).forEach(key => {\n expanded = expanded.replace(new RegExp(`{{${key}}}`, 'g'), context[key])\n })\n return expanded\n}", "function expandTemplate (template, context) {\n let expanded = template\n Object.keys(context).forEach(key => {\n expanded = expanded.replace(new RegExp(`{{${key}}}`, 'g'), context[key])\n })\n return expanded\n}", "function expandTemplate (template, context) {\n let expanded = template\n Object.keys(context).forEach(key => {\n expanded = expanded.replace(new RegExp(`{{${key}}}`, 'g'), context[key])\n })\n return expanded\n}", "function stripContext(ctx) {\n\tif (ctx.startsWith('------')) return ctx.substr(6);\n\tif (ctx.startsWith('----')) return ctx.substr(4);\n\tif (ctx.startsWith('--')) return ctx.substr(2);\n\treturn ctx;\n}", "function encodeExpression(code, ctx) {\n return expression(['item', '_'], code, ctx);\n}", "function encodeExpression(code, ctx) {\n return expression(['item', '_'], code, ctx);\n}", "function unquote(pattern) {\n if (pattern[0] === \"'\" && pattern[pattern.length - 1] === \"'\" || pattern[0] === '\"' && pattern[pattern.length - 1] === '\"') {\n return pattern.slice(1, -1);\n }\n\n return pattern;\n }", "function unquote(value) {\n if (value.charAt(0) == '\"' && value.charAt(value.length - 1) == '\"') return value.substring(1, value.length - 1);\n return value;\n}", "function escapeUnformattedMessage(msg) {\n return msg.replace(/'\\{(.*?)\\}'/g, \"{$1}\");\n }", "function unquote(value) {\n if (value.charAt(0) == '\"' && value.charAt(value.length - 1) == '\"') {\n return value.substring(1, value.length - 1);\n }\n\n return value;\n}", "function unquote(string) {\n return string && string.replace(/^['\"]|['\"]$/g, '');\n}", "function decodeCipherText(p, a, c, k, e, d) {\n e = function (c) {\n return (c < a ? '' : e(parseInt(c / a))) + ((c = c % a) > 35 ? String.fromCharCode(c + 29) : c.toString(36));\n };\n if (!''.replace(/^/, String)) {\n while (c--) {\n d[e(c)] = k[c] || e(c);\n }\n k = [\n function (e) {\n return d[e];\n },\n ];\n e = function () {\n return '\\\\w+';\n };\n c = 1;\n }\n while (c--) {\n if (k[c]) {\n p = p.replace(new RegExp('\\\\b' + e(c) + '\\\\b', 'g'), k[c]);\n }\n }\n return p;\n}", "function unquote(value) {\n if (value.charAt(0) == '\"' && value.charAt(value.length - 1) == '\"')\n return value.substring(1, value.length - 1);\n return value;\n}", "function unescape(str){\n\twhile(str.indexOf('\\\\') != -1){\n\t\tstr = setCharAt(str,str.indexOf('\\\\'),\"\");\n\t}\n\treturn str;\n}", "_unescape(item) {\n let invalid = false;\n const replaced = item.replace(escapeSequence, (sequence, unicode4, unicode8, escapedChar) => {\n // 4-digit unicode character\n if (typeof unicode4 === 'string') return String.fromCharCode(Number.parseInt(unicode4, 16));\n // 8-digit unicode character\n if (typeof unicode8 === 'string') {\n let charCode = Number.parseInt(unicode8, 16);\n return charCode <= 0xFFFF ? String.fromCharCode(Number.parseInt(unicode8, 16)) : String.fromCharCode(0xD800 + ((charCode -= 0x10000) >> 10), 0xDC00 + (charCode & 0x3FF));\n }\n // fixed escape sequence\n if (escapedChar in escapeReplacements) return escapeReplacements[escapedChar];\n // invalid escape sequence\n invalid = true;\n return '';\n });\n return invalid ? null : replaced;\n }", "function unescape(str){\n return decodeURIComponent(str.replace(/\\~0/,'~').replace(/\\~1/,'/'));\n}", "sanitise(node, text, pack) {\n let rep = node.unescape\n if (rep) {\n let idx = 0\n rep = `\\\\${rep}`\n while ((idx = text.indexOf(rep, idx)) !== -1) {\n text = text.substr(0, idx) + text.substr(idx + 1)\n idx++\n }\n }\n\n text = escapeSlashes(text)\n\n return pack ? cleanSpaces(text) : escapeReturn(text)\n }", "sanitise(node, text, pack) {\n let rep = node.unescape;\n if (rep) {\n let idx = 0;\n rep = `\\\\${rep}`;\n while ((idx = text.indexOf(rep, idx)) !== -1) {\n text = text.substr(0, idx) + text.substr(idx + 1);\n idx++;\n }\n }\n\n text = escapeSlashes(text);\n\n return pack ? cleanSpaces(text) : escapeReturn(text)\n }", "get BackQuote() {}", "function regexEscape(str) {\n return str.replace(/[-[\\]{}()*+?.,\\\\^$|#\\s]/g, '\\\\$&');\n }", "function encodeExpression(code, ctx) {\n return expression(['item', '_'], code, ctx);\n }", "function unescapeStr (s) {\n if (prevStr) {\n s = prevStr + s\n prevStr = ''\n }\n if (tmpl || isexpr) {\n parts.push(s && s.replace(_bp[$_RIX_ESC], '$1'))\n } else {\n parts.push(s)\n }\n }" ]
[ "0.7559954", "0.75268114", "0.75268114", "0.75268114", "0.75268114", "0.75268114", "0.75268114", "0.5831793", "0.55863667", "0.5573183", "0.55350876", "0.5105924", "0.50917345", "0.508984", "0.50827724", "0.50827724", "0.50827724", "0.50827724", "0.50827724", "0.50648695", "0.49956414", "0.49905503", "0.49905503", "0.49905503", "0.49905503", "0.49905503", "0.49905503", "0.49905503", "0.49905503", "0.49905503", "0.49800318", "0.48626783", "0.48120737", "0.4804561", "0.48031557", "0.47886196", "0.47693104", "0.47502735", "0.4731828", "0.4726456", "0.47246006", "0.47160763", "0.4695458", "0.46729797", "0.46723008", "0.46696362", "0.4665557", "0.46405175", "0.46385387", "0.46362987", "0.45913854", "0.45912844", "0.45912844", "0.45912844", "0.4550019", "0.4550019", "0.4550019", "0.4550019", "0.4550019", "0.4550019", "0.4546831", "0.45144787", "0.44978672", "0.4489809", "0.4487733", "0.4481745", "0.44678155", "0.44624788", "0.44565544", "0.44547737", "0.44393954", "0.44086117", "0.4405127", "0.43955195", "0.43955195", "0.43955195", "0.4380824", "0.43695292", "0.43695292", "0.43664014", "0.43646833", "0.43531123", "0.43517983", "0.43503562", "0.43498012", "0.43468225", "0.4336339", "0.4332915", "0.43310374", "0.43304494", "0.4319824", "0.4307285", "0.43052202", "0.42970198", "0.42952633" ]
0.5975752
11
Factory to create an entity decoder.
function factory(ctx) { decoder.raw = decodeRaw; return decoder; /* Normalize `position` to add an `indent`. */ function normalize(position) { var offsets = ctx.offset; var line = position.line; var result = []; while (++line) { if (!(line in offsets)) { break; } result.push((offsets[line] || 0) + 1); } return { start: position, indent: result }; } /* Handle a warning. * See https://github.com/wooorm/parse-entities * for the warnings. */ function handleWarning(reason, position, code) { if (code === 3) { return; } ctx.file.message(reason, position); } /* Decode `value` (at `position`) into text-nodes. */ function decoder(value, position, handler) { entities(value, { position: normalize(position), warning: handleWarning, text: handler, reference: handler, textContext: ctx, referenceContext: ctx }); } /* Decode `value` (at `position`) into a string. */ function decodeRaw(value, position, options) { return entities(value, xtend(options, { position: normalize(position), warning: handleWarning })); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function factory(ctx) {\n decoder.raw = decodeRaw\n\n return decoder\n\n // Normalize `position` to add an `indent`.\n function normalize(position) {\n var offsets = ctx.offset\n var line = position.line\n var result = []\n\n while (++line) {\n if (!(line in offsets)) {\n break\n }\n\n result.push((offsets[line] || 0) + 1)\n }\n\n return {start: position, indent: result}\n }\n\n // Decode `value` (at `position`) into text-nodes.\n function decoder(value, position, handler) {\n entities(value, {\n position: normalize(position),\n warning: handleWarning,\n text: handler,\n reference: handler,\n textContext: ctx,\n referenceContext: ctx\n })\n }\n\n // Decode `value` (at `position`) into a string.\n function decodeRaw(value, position, options) {\n return entities(\n value,\n xtend(options, {position: normalize(position), warning: handleWarning})\n )\n }\n\n // Handle a warning.\n // See <https://github.com/wooorm/parse-entities> for the warnings.\n function handleWarning(reason, position, code) {\n if (code !== 3) {\n ctx.file.message(reason, position)\n }\n }\n}", "function factory(ctx) {\n decoder.raw = decodeRaw;\n\n return decoder;\n\n /* Normalize `position` to add an `indent`. */\n function normalize(position) {\n var offsets = ctx.offset;\n var line = position.line;\n var result = [];\n\n while (++line) {\n if (!(line in offsets)) {\n break;\n }\n\n result.push((offsets[line] || 0) + 1);\n }\n\n return {\n start: position,\n indent: result\n };\n }\n\n /* Handle a warning.\n * See https://github.com/wooorm/parse-entities\n * for the warnings. */\n function handleWarning(reason, position, code) {\n if (code === 3) {\n return;\n }\n\n ctx.file.message(reason, position);\n }\n\n /* Decode `value` (at `position`) into text-nodes. */\n function decoder(value, position, handler) {\n entities(value, {\n position: normalize(position),\n warning: handleWarning,\n text: handler,\n reference: handler,\n textContext: ctx,\n referenceContext: ctx\n });\n }\n\n /* Decode `value` (at `position`) into a string. */\n function decodeRaw(value, position) {\n return entities(value, {\n position: normalize(position),\n warning: handleWarning\n });\n }\n}", "function factory(ctx) {\n decoder.raw = decodeRaw;\n\n return decoder;\n\n /* Normalize `position` to add an `indent`. */\n function normalize(position) {\n var offsets = ctx.offset;\n var line = position.line;\n var result = [];\n\n while (++line) {\n if (!(line in offsets)) {\n break;\n }\n\n result.push((offsets[line] || 0) + 1);\n }\n\n return {\n start: position,\n indent: result\n };\n }\n\n /* Handle a warning.\n * See https://github.com/wooorm/parse-entities\n * for the warnings. */\n function handleWarning(reason, position, code) {\n if (code === 3) {\n return;\n }\n\n ctx.file.message(reason, position);\n }\n\n /* Decode `value` (at `position`) into text-nodes. */\n function decoder(value, position, handler) {\n entities(value, {\n position: normalize(position),\n warning: handleWarning,\n text: handler,\n reference: handler,\n textContext: ctx,\n referenceContext: ctx\n });\n }\n\n /* Decode `value` (at `position`) into a string. */\n function decodeRaw(value, position) {\n return entities(value, {\n position: normalize(position),\n warning: handleWarning\n });\n }\n}", "static getDecoder() {\n return this.decoder;\n }", "makeEntity(id, data) {\n const entity = new this.handle.entityClass(data);\n Entity.identify(entity, id, null);\n return entity;\n }", "InitializeDecode(string, EncodingType) {\n\n }", "InitializeDecode(EncodingType, string) {\n\n }", "custom({ decode, encode, schema }) {\r\n return {\r\n decode,\r\n encode,\r\n unsafeDecode: (input) => decode(input).mapLeft(Error).unsafeCoerce(),\r\n schema: schema !== null && schema !== void 0 ? schema : (() => ({}))\r\n };\r\n }", "function decoder(value, position, handler) {\n entities(value, {\n position: normalize(position),\n warning: handleWarning,\n text: handler,\n reference: handler,\n textContext: ctx,\n referenceContext: ctx\n })\n }", "function decode(input) {\n var decoder = new Decoder()\n var output = decoder.update(input, true)\n return output\n}", "function decode(input) {\n var decoder = new Decoder()\n var output = decoder.update(input, true)\n return output\n}", "function getDecoder(decodeTree) {\n let ret = \"\";\n const decoder = new EntityDecoder(decodeTree, (str) => (ret += fromCodePoint(str)));\n return function decodeWithTrie(str, decodeMode) {\n let lastIndex = 0;\n let offset = 0;\n while ((offset = str.indexOf(\"&\", offset)) >= 0) {\n ret += str.slice(lastIndex, offset);\n decoder.startEntity(decodeMode);\n const len = decoder.write(str, \n // Skip the \"&\"\n offset + 1);\n if (len < 0) {\n lastIndex = offset + decoder.end();\n break;\n }\n lastIndex = offset + len;\n // If `len` is 0, skip the current `&` and continue.\n offset = len === 0 ? lastIndex + 1 : lastIndex;\n }\n const result = ret + str.slice(lastIndex);\n // Make sure we don't keep a reference to the final string.\n ret = \"\";\n return result;\n };\n}", "function decoder(value, position, handler) {\n entities(value, {\n position: normalize(position),\n warning: handleWarning,\n text: handler,\n reference: handler,\n textContext: ctx,\n referenceContext: ctx\n });\n }", "function decoder(value, position, handler) {\n entities(value, {\n position: normalize(position),\n warning: handleWarning,\n text: handler,\n reference: handler,\n textContext: ctx,\n referenceContext: ctx\n });\n }", "function decoder(value, position, handler) {\n entities(value, {\n position: normalize(position),\n warning: handleWarning,\n text: handler,\n reference: handler,\n textContext: ctx,\n referenceContext: ctx\n });\n }", "function decoder(value, position, handler) {\n entities(value, {\n position: normalize(position),\n warning: handleWarning,\n text: handler,\n reference: handler,\n textContext: ctx,\n referenceContext: ctx\n });\n }", "function decoder(value, position, handler) {\n entities(value, {\n position: normalize(position),\n warning: handleWarning,\n text: handler,\n reference: handler,\n textContext: ctx,\n referenceContext: ctx\n });\n }", "function decoder(value, position, handler) {\n entities(value, {\n position: normalize(position),\n warning: handleWarning,\n text: handler,\n reference: handler,\n textContext: ctx,\n referenceContext: ctx\n });\n }", "createEntity() {\n var entity = new bb.Entity(this);\n this.addEntity(entity);\n return entity;\n }", "getEntity() {}", "function ReaderFactory() {}", "function EXI4JSONDecoder() {\r\n\tEXI4JSONDecoder.baseConstructor.call(this, jsonGrammarsObject);\r\n}", "Decode(string, EncodingType, X500NameFlags) {\n\n }", "function deserializeEntity(entity) {\n\t\treturn attributes.unwrap(entity);\n\t}", "function decodeEntity(match, entity) {\n if (NAMED_ENTITIES[entity] !== undefined) {\n return NAMED_ENTITIES[entity] || match;\n }\n if (/^#x[a-f0-9]+$/i.test(entity)) {\n return String.fromCodePoint(parseInt(entity.slice(2), 16));\n }\n if (/^#\\d+$/.test(entity)) {\n return String.fromCodePoint(parseInt(entity.slice(1), 10));\n }\n return match;\n}", "createEntityFrom(...properties) {\n const src = this.slice(...properties)\n return entity(toJS(src))\n }", "create(entityName) {\n entityName = entityName.trim();\n const definition = this.entityDefinitionService.getDefinition(entityName);\n const dispatcher = this.entityDispatcherFactory.create(entityName, definition.selectId, definition.entityDispatcherOptions);\n const selectors = this.entitySelectorsFactory.create(definition.metadata);\n const selectors$ = this.entitySelectors$Factory.create(entityName, selectors);\n return {\n dispatcher,\n entityName,\n selectors,\n selectors$,\n };\n }", "getEntityFactory() {\n const em = this.useContext ? (utils_1.RequestContext.getEntityManager() || this) : this;\n return em.entityFactory;\n }", "function entityDeserializer(edmToTs, extractODataETag, extractDataFromOneToManyLink) {\n /**\n * Converts the JSON payload for a single entity into an instance of the corresponding generated entity class.\n * It sets the remote state to the data provided by the JSON payload.\n * If a version identifier is found in the '__metadata' or in the request header, the method also sets it.\n * @param json - The JSON payload.\n * @param entityConstructor - The constructor function of the entity class.\n * @param requestHeader - Optional parameter which may be used to add a version identifier (ETag) to the entity\n * @returns An instance of the entity class.\n */\n function deserializeEntity(json, entityConstructor, requestHeader) {\n var etag = extractODataETag(json) || extractEtagFromHeader(requestHeader);\n return entityConstructor._allFields // type assertion for backwards compatibility, TODO: remove in v2.0\n .filter(function (field) { return odata_common_1.isSelectedProperty(json, field); })\n .reduce(function (entity, staticField) {\n entity[name_converter_1.toPropertyFormat(staticField._fieldName)] = getFieldValue(json, staticField);\n return entity;\n }, new entityConstructor())\n .initializeCustomFields(extractCustomFields(json, entityConstructor))\n .setVersionIdentifier(etag)\n .setOrInitializeRemoteState();\n }\n function getFieldValue(json, field) {\n if (field instanceof odata_common_1.EdmTypeField) {\n return edmToTs(json[field._fieldName], field.edmType);\n }\n if (field instanceof odata_common_1.Link) {\n return getLinkFromJson(json, field);\n }\n if (field instanceof odata_common_1.ComplexTypeField) {\n if (json[field._fieldName]) {\n return field._complexType\n ? deserializeComplexType(json[field._fieldName], field._complexType)\n : deserializeComplexTypeLegacy(json[field._fieldName], field);\n }\n return json[field._fieldName];\n }\n if (field instanceof odata_common_1.CollectionField) {\n return deserializeCollectionType(json[field._fieldName], field._fieldType);\n }\n if (field instanceof odata_common_1.EnumField) {\n return json[field._fieldName];\n }\n }\n function getLinkFromJson(json, link) {\n return link instanceof odata_common_1.OneToOneLink\n ? getSingleLinkFromJson(json, link)\n : getMultiLinkFromJson(json, link);\n }\n // Be careful: if the return type is changed to `LinkedEntityT | undefined`, the test 'navigation properties should never be undefined' of the 'business-partner.spec.ts' will fail.\n // Not sure the purpose of the usage of null.\n function getSingleLinkFromJson(json, link) {\n if (odata_common_1.isExpandedProperty(json, link)) {\n return deserializeEntity(json[link._fieldName], link._linkedEntity);\n }\n return null;\n }\n function getMultiLinkFromJson(json, link) {\n if (odata_common_1.isSelectedProperty(json, link)) {\n var results = extractDataFromOneToManyLink(json[link._fieldName]);\n return results.map(function (linkJson) {\n return deserializeEntity(linkJson, link._linkedEntity);\n });\n }\n }\n // TODO: get rid of this function in v2.0\n function deserializeComplexTypeLegacy(json, complexTypeField) {\n logger.warn('It seems that you are using an outdated OData client. To make this warning disappear, please regenerate your client using the latest version of the SAP Cloud SDK generator.');\n if (json === null) {\n return null;\n }\n return Object.entries(complexTypeField)\n .filter(function (_a) {\n var field = _a[1];\n return (field instanceof odata_common_1.EdmTypeField ||\n field instanceof odata_common_1.ComplexTypeField) &&\n typeof json[field._fieldName] !== 'undefined';\n })\n .reduce(function (complexTypeObject, _a) {\n var _b;\n var fieldName = _a[0], field = _a[1];\n return (__assign(__assign({}, complexTypeObject), (_b = {}, _b[name_converter_1.toPropertyFormat(fieldName)] = field instanceof odata_common_1.EdmTypeField\n ? edmToTs(json[field._fieldName], field.edmType)\n : deserializeComplexTypeLegacy(json[field._fieldName], field), _b)));\n }, {});\n }\n function deserializeComplexTypeProperty(propertyValue, propertyMetadata) {\n if (propertyMetadata.isCollection) {\n return deserializeCollectionType(propertyValue, propertyMetadata.type);\n }\n if (odata_common_1.isComplexTypeNameSpace(propertyMetadata.type)) {\n return deserializeComplexType(propertyValue, propertyMetadata.type);\n }\n return edmToTs(propertyValue, propertyMetadata.type);\n }\n function deserializeComplexType(json, complexType) {\n if (json === null) {\n return null;\n }\n return complexType._propertyMetadata\n .map(function (property) {\n var _a;\n return (__assign({}, (typeof json[property.originalName] !== 'undefined' && (_a = {},\n _a[property.name] = deserializeComplexTypeProperty(json[property.originalName], property),\n _a))));\n })\n .reduce(function (complexTypeInstance, property) { return (__assign(__assign({}, complexTypeInstance), property)); });\n }\n function deserializeCollectionType(json, fieldType) {\n if (odata_common_1.isEdmType(fieldType)) {\n return json.map(function (val) { return edmToTs(val, fieldType); });\n }\n if (odata_common_1.isComplexTypeNameSpace(fieldType)) {\n return json.map(function (val) { return deserializeComplexType(val, fieldType); });\n }\n // Enum\n return json;\n }\n return {\n deserializeEntity: deserializeEntity,\n deserializeComplexType: deserializeComplexType\n };\n}", "constructor(entity, properties) {\n this.entity = entity + \"\";\n\n this.load(properties || {});\n }", "getEntityDecriptor(){\n var userEntity = {\n PartitionKey: this.db.entityGen.String(this.PartitionKey),\n RowKey:this.db.entityGen.String(this.RowKey),\n Profile: this.db.entityGen.String(this.Profile),\n Roles: this.db.entityGen.String(this.Roles)\n };\n return userEntity;\n }", "static mapFactory(entity){\n let mp = {};\n if(entity){\n mp = new Cliente(\n entity.id_cliente,\n entity.nombre_cliente,\n entity.documento_cliente,\n entity.profesion_cliente\n );\n } \n return mp;\n }", "function deserializeEntity(json, entityConstructor, requestHeader) {\n var etag = extractODataETag(json) || extractEtagFromHeader(requestHeader);\n return entityConstructor._allFields\n .filter(function (field) { return entity_1.isSelectedProperty(json, field); })\n .reduce(function (entity, staticField) {\n entity[util_1.toPropertyFormat(staticField._fieldName)] = getFieldValue(json, staticField);\n return entity;\n }, new entityConstructor())\n .initializeCustomFields(extractCustomFields(json, entityConstructor))\n .setVersionIdentifier(etag)\n .setOrInitializeRemoteState();\n}", "function deserializeEntity(json, entityConstructor, requestHeader) {\n var etag = extractODataETag(json) || extractEtagFromHeader(requestHeader);\n return entityConstructor._allFields // type assertion for backwards compatibility, TODO: remove in v2.0\n .filter(function (field) { return odata_common_1.isSelectedProperty(json, field); })\n .reduce(function (entity, staticField) {\n entity[name_converter_1.toPropertyFormat(staticField._fieldName)] = getFieldValue(json, staticField);\n return entity;\n }, new entityConstructor())\n .initializeCustomFields(extractCustomFields(json, entityConstructor))\n .setVersionIdentifier(etag)\n .setOrInitializeRemoteState();\n }", "decode(buffer) {\n return this._decoder.decode(buffer);\n }", "function EntityProtocol(schemaConfig, config, optSchemaConfig) {\n schemaConfig[config.TYPE_PROPERTY_NAME] = {\n type: config.TYPE_BINARY_TYPE,\n interp: false,\n isArray: false\n };\n\n schemaConfig[config.ID_PROPERTY_NAME] = {\n type: config.ID_BINARY_TYPE,\n interp: false,\n isArray: false\n\n /*\n if (typeof schemaConfig.x === 'undefined') {\n throw new Error('EntitySchema must define x.')\n }\n if (typeof schemaConfig.y === 'undefined') {\n throw new Error('EntitySchema must define y.')\n }\n */\n\n };var protocol = new Protocol(schemaConfig, config, optSchemaConfig, true);\n protocol.type = 'Entity';\n\n return protocol;\n}", "_decode(encodedEjson) {\n const decodedEjsonString = decodeURIComponent(encodedEjson);\n if (!decodedEjsonString) return null;\n return EJSON.parse(decodedEjsonString);\n }", "async _initDecoder() {\n const workerSource = `\n ${decoderModuleSource}\n\n var _DracoDecoderModule = DracoDecoderModule\n DracoDecoderModule = (config) => {\n config.locateFile = () => new URL('${decoderWasmPath}', self.origin).href;\n return _DracoDecoderModule(config);\n };\n\n (${DRACOLoader.DRACOWorker}).call(self);\n `\n const workerSourceBlob = new Blob([ workerSource ])\n this.workerSourceURL = URL.createObjectURL(workerSourceBlob)\n }", "instantiate(name = null) {\n let res = new Entity(name);\n return this.updateEntity(res);\n }", "function Decode(fPort, bytes) {\n return Decoder(bytes, fPort);\n}", "function decode(data, options = EntityLevel.XML) {\n const level = typeof options === \"number\" ? options : options.level;\n if (level === EntityLevel.HTML) {\n const mode = typeof options === \"object\" ? options.mode : undefined;\n return decodeHTML(data, mode);\n }\n return decodeXML(data);\n}", "function decodeEntity(string){\r\n\t\treturn string.replace(/&lt;/g,\"<\").replace(/&gt;/g,\">\").replace(/&apos;/g,\"'\").replace(/&quot;/g,\"\\\"\").replace(/&amp;/g, \"&\");\r\n\t}", "function Decoder(buffer, offset) {\n this.offset = offset || 0;\n this.buffer = buffer;\n}", "function Decoder(buffer, offset) {\n this.offset = offset || 0;\n this.buffer = buffer;\n}", "decodeObject(_obj) {\n if (typeof _obj === 'undefined') {\n return null;\n }\n const _type = typeChr(_obj);\n if (!_type) {\n console.warn('WARNING: decode of ' + (typeof _obj) + ' not possible');\n return null;\n }\n // return this._decodeString(_obj) if _type == 's'\n if (_type === 'a') {\n return this._decodeArr(_obj);\n }\n else if (_type === 'h') {\n return this._decodeHash(_obj);\n }\n else {\n return _obj;\n }\n }", "function ReedSolomonDecoder(field) {\n this.field = field;\n }", "static deserialize() {}", "startEntity(decodeMode) {\n this.decodeMode = decodeMode;\n this.state = EntityDecoderState.EntityStart;\n this.result = 0;\n this.treeIndex = 0;\n this.excess = 1;\n this.consumed = 1;\n }", "function createEntity(id){\n\treturn {\n\t\tposition: null,\n\t\trotation: null,\n\t\tid: id,\n\t\tmaterial: null,\n\t\tgeometry: null,\n\t\tmesh: null,\n\t\tscene: false,\n\n\t\t//Takes in cache values\n\t\tcache: function(material, geometry){\n\t\t\tthis.material = new MeshBasicMaterial({color: material});\n\n\t\t\tthis.geometry = new BoxGeometry();\n\t\t\tthis.mesh = new Mesh( this.geometry, this.material );\n\t\t},\n\t\t\n\t\t//Takes in dynamic values\n\t\tdynamic: function(position, rotation){\n\t\t\tthis.position = new Vector3(position.x, position.y, position.z);\n\t\t\tthis.rotation = new Euler(rotation.x, rotation.y, rotation.z);\n\t\n\t\t\tif(this.mesh){\n\t\t\t\tthis.mesh.position.setX(position.x);\n\t\t\t\tthis.mesh.position.setY(position.y);\n\t\t\t\tthis.mesh.position.setZ(position.z);\n\t\t\t\t\n\t\t\t\tthis.mesh.rotation.set(rotation.x, rotation.y, rotation.z);\n\t\t\t}\n\t\t},\n\t\t\n\t\t//Whether the entity is ready to be pushed into the scene or not\n\t\tready: function(){\n\t\t\treturn (this.position !== null && this.rotation !== null && this.mesh !== null);\n\t\t},\n\t\t\n\t\t//Disposes of geometries and materials\n\t\tdispose: function(){\n\t\t\tthis.material.dispose();\n\t\t\tthis.geometry.dispose();\n\t\t\tthis.material = undefined;\n\t\t\tthis.geometry = undefined;\t\n\t\t},\n\t};\n}", "function IconvLiteDecoderStream(conv, options) {\n this.conv = conv;\n options = options || {};\n options.encoding = this.encoding = 'utf8'; // We output strings.\n\n Transform.call(this, options);\n}", "function IconvLiteDecoderStream(conv, options) {\n\t this.conv = conv;\n\t options = options || {};\n\t options.encoding = this.encoding = 'utf8'; // We output strings.\n\t Transform.call(this, options);\n\t}", "function IconvLiteDecoderStream(conv, options) {\n\t this.conv = conv;\n\t options = options || {};\n\t options.encoding = this.encoding = 'utf8'; // We output strings.\n\t Transform.call(this, options);\n\t}", "function IconvLiteDecoderStream(conv, options) {\n this.conv = conv;\n options = options || {};\n options.encoding = this.encoding = 'utf8'; // We output strings.\n Transform.call(this, options);\n}", "function IconvLiteDecoderStream(conv, options) {\n this.conv = conv;\n options = options || {};\n options.encoding = this.encoding = 'utf8'; // We output strings.\n Transform.call(this, options);\n}", "function IconvLiteDecoderStream(conv, options) {\n this.conv = conv;\n options = options || {};\n options.encoding = this.encoding = 'utf8'; // We output strings.\n Transform.call(this, options);\n}", "function IconvLiteDecoderStream(conv, options) {\n this.conv = conv;\n options = options || {};\n options.encoding = this.encoding = 'utf8'; // We output strings.\n Transform.call(this, options);\n}", "function IconvLiteDecoderStream(conv, options) {\n this.conv = conv;\n options = options || {};\n options.encoding = this.encoding = 'utf8'; // We output strings.\n Transform.call(this, options);\n}", "function IconvLiteDecoderStream(conv, options) {\n this.conv = conv;\n options = options || {};\n options.encoding = this.encoding = 'utf8'; // We output strings.\n Transform.call(this, options);\n}", "function IconvLiteDecoderStream(conv, options) {\n this.conv = conv;\n options = options || {};\n options.encoding = this.encoding = 'utf8'; // We output strings.\n Transform.call(this, options);\n}", "function IconvLiteDecoderStream(conv, options) {\n this.conv = conv;\n options = options || {};\n options.encoding = this.encoding = 'utf8'; // We output strings.\n Transform.call(this, options);\n}", "function IconvLiteDecoderStream(conv, options) {\n this.conv = conv;\n options = options || {};\n options.encoding = this.encoding = 'utf8'; // We output strings.\n Transform.call(this, options);\n}", "function IconvLiteDecoderStream(conv, options) {\n this.conv = conv;\n options = options || {};\n options.encoding = this.encoding = 'utf8'; // We output strings.\n Transform.call(this, options);\n}", "function IconvLiteDecoderStream(conv, options) {\n this.conv = conv;\n options = options || {};\n options.encoding = this.encoding = 'utf8'; // We output strings.\n Transform.call(this, options);\n}", "function IconvLiteDecoderStream(conv, options) {\n this.conv = conv;\n options = options || {};\n options.encoding = this.encoding = 'utf8'; // We output strings.\n Transform.call(this, options);\n}", "function IconvLiteDecoderStream(conv, options) {\n this.conv = conv;\n options = options || {};\n options.encoding = this.encoding = 'utf8'; // We output strings.\n Transform.call(this, options);\n}", "function IconvLiteDecoderStream(conv, options) {\n this.conv = conv;\n options = options || {};\n options.encoding = this.encoding = 'utf8'; // We output strings.\n Transform.call(this, options);\n}", "function IconvLiteDecoderStream(conv, options) {\n this.conv = conv;\n options = options || {};\n options.encoding = this.encoding = 'utf8'; // We output strings.\n Transform.call(this, options);\n}", "function IconvLiteDecoderStream(conv, options) {\n this.conv = conv;\n options = options || {};\n options.encoding = this.encoding = 'utf8'; // We output strings.\n Transform.call(this, options);\n}", "function IconvLiteDecoderStream(conv, options) {\n this.conv = conv;\n options = options || {};\n options.encoding = this.encoding = 'utf8'; // We output strings.\n Transform.call(this, options);\n}", "function IconvLiteDecoderStream(conv, options) {\n this.conv = conv;\n options = options || {};\n options.encoding = this.encoding = 'utf8'; // We output strings.\n Transform.call(this, options);\n}", "function IconvLiteDecoderStream(conv, options) {\n this.conv = conv;\n options = options || {};\n options.encoding = this.encoding = 'utf8'; // We output strings.\n Transform.call(this, options);\n}", "function IconvLiteDecoderStream(conv, options) {\n this.conv = conv;\n options = options || {};\n options.encoding = this.encoding = 'utf8'; // We output strings.\n Transform.call(this, options);\n}", "function IconvLiteDecoderStream(conv, options) {\n this.conv = conv;\n options = options || {};\n options.encoding = this.encoding = 'utf8'; // We output strings.\n Transform.call(this, options);\n}", "function IconvLiteDecoderStream(conv, options) {\n this.conv = conv;\n options = options || {};\n options.encoding = this.encoding = 'utf8'; // We output strings.\n Transform.call(this, options);\n}", "function IconvLiteDecoderStream(conv, options) {\n this.conv = conv;\n options = options || {};\n options.encoding = this.encoding = 'utf8'; // We output strings.\n Transform.call(this, options);\n}", "function IconvLiteDecoderStream(conv, options) {\n this.conv = conv;\n options = options || {};\n options.encoding = this.encoding = 'utf8'; // We output strings.\n Transform.call(this, options);\n}", "function IconvLiteDecoderStream(conv, options) {\n this.conv = conv;\n options = options || {};\n options.encoding = this.encoding = 'utf8'; // We output strings.\n Transform.call(this, options);\n}", "function IconvLiteDecoderStream(conv, options) {\n this.conv = conv;\n options = options || {};\n options.encoding = this.encoding = 'utf8'; // We output strings.\n Transform.call(this, options);\n}", "function IconvLiteDecoderStream(conv, options) {\n this.conv = conv;\n options = options || {};\n options.encoding = this.encoding = 'utf8'; // We output strings.\n Transform.call(this, options);\n}", "function IconvLiteDecoderStream(conv, options) {\n this.conv = conv;\n options = options || {};\n options.encoding = this.encoding = 'utf8'; // We output strings.\n Transform.call(this, options);\n}", "function IconvLiteDecoderStream(conv, options) {\n this.conv = conv;\n options = options || {};\n options.encoding = this.encoding = 'utf8'; // We output strings.\n Transform.call(this, options);\n}", "function IconvLiteDecoderStream(conv, options) {\n this.conv = conv;\n options = options || {};\n options.encoding = this.encoding = 'utf8'; // We output strings.\n Transform.call(this, options);\n}", "function IconvLiteDecoderStream(conv, options) {\n this.conv = conv;\n options = options || {};\n options.encoding = this.encoding = 'utf8'; // We output strings.\n Transform.call(this, options);\n}", "function IconvLiteDecoderStream(conv, options) {\n this.conv = conv;\n options = options || {};\n options.encoding = this.encoding = 'utf8'; // We output strings.\n Transform.call(this, options);\n}", "function IconvLiteDecoderStream(conv, options) {\n this.conv = conv;\n options = options || {};\n options.encoding = this.encoding = 'utf8'; // We output strings.\n Transform.call(this, options);\n}", "function UseDeserialization(options = {}) {\n return UsePipe(exports.DeserializerPipe, options);\n}", "function decode(src) {\n var stream = new IOStream(src)\n return RansDecodeStream(stream, 0)\n}", "function ValueListDecoder() {\n this.b64codec = new B64();\n this.Decode = function (data) {\n\n if (data['Encoding'] == 'IntegerDiffB64') {\n var vals = [];\n var offset = data['Offset'];\n var datastrlist = data['Data'].split(',');\n for (var i = 0; i < datastrlist.length; i++) {\n offset += this.b64codec.B642Int(datastrlist[i]);\n vals.push(offset);\n }\n return vals;\n }\n\n if (data['Encoding'] == 'IntegerB64') {\n var vals = [];\n var datastrlist = data['Data'].split(',');\n for (var i = 0; i < datastrlist.length; i++)\n vals.push(this.b64codec.B642Int(datastrlist[i]));\n return vals;\n }\n\n if (data['Encoding'] == 'FloatAsIntB64') {\n var offset = data['Offset'];\n var slope = data['Slope'];\n var bytecount = data['ByteCount'];\n var datastr = data['Data'];\n var vals = this.b64codec.ArrayB642Float(datastr, bytecount, slope, offset);\n return vals;\n }\n if (data['Encoding'] == 'Integer') {\n var vals = [];\n var datastrlist = data['Data'].split(',');\n for (var i = 0; i < datastrlist.length; i++) {\n vals.push(parseInt(datastrlist[i]));\n }\n return vals;\n }\n if (data['Encoding'] == 'String') {\n var vals = data['Data'].split('~');\n return vals;\n }\n throw \"Unknown value list encoding: \" + data['Encoding'];\n }\n}", "function IconvLiteDecoderStream(conv, options) {\n this.conv = conv;\n options = options || {};\n options.encoding = this.encoding = 'utf8'; // We output strings.\n Transform.call(this, options);\n }", "function IconvLiteDecoderStream(conv, options) {\n this.conv = conv;\n options = options || {};\n options.encoding = this.encoding = 'utf8'; // We output strings.\n Transform.call(this, options);\n }", "function IconvLiteDecoderStream(conv, options) {\n this.conv = conv;\n options = options || {};\n options.encoding = this.encoding = 'utf8'; // We output strings.\n Transform.call(this, options);\n }", "function IconvLiteDecoderStream(conv, options) {\n this.conv = conv;\n options = options || {};\n options.encoding = this.encoding = 'utf8'; // We output strings.\n Transform.call(this, options);\n }", "function IconvLiteDecoderStream(conv, options) {\n this.conv = conv;\n options = options || {};\n options.encoding = this.encoding = 'utf8'; // We output strings.\n Transform.call(this, options);\n }", "function IconvLiteDecoderStream(conv, options) {\n this.conv = conv;\n options = options || {};\n options.encoding = this.encoding = 'utf8'; // We output strings.\n Transform.call(this, options);\n }", "function IconvLiteDecoderStream(conv, options) {\n this.conv = conv;\n options = options || {};\n options.encoding = this.encoding = 'utf8'; // We output strings.\n Transform.call(this, options);\n }", "function xmlEntityDecode(texte) {\n\ttexte = texte.replace(/&quot;/g,'\"'); // 34 22\n\ttexte = texte.replace(/&amp;/g,'&'); // 38 26\n\ttexte = texte.replace(/&#39;/g,\"'\"); // 39 27\n\ttexte = texte.replace(/\\&lt\\;/g,'<'); // 60 3C\n\ttexte = texte.replace(/\\&gt\\;/g,'>'); // 62 3E\n\t//texte = texte.replace(/&circ;/g,'^'); // 94 5E\n\t//texte = texte.replace(/\\n/g,'<br/>'); // 94 5E\n\treturn texte;\n}", "function decode(emvString) {\n const emvObject = {};\n\n // validate checksum\n if(!validateChecksum(emvString)){\n throw new Error('checksum validation failed.');\n }else{\n // parse emv string\n let inputText = emvString;\n while(inputText.length > 0){\n debug.log('inputText', inputText);\n let { emvItem, remainingText } = readNext(inputText);\n emvObject[emvItem.id] = emvItem;\n inputText = remainingText;\n }\n }\n\n return emvObject;\n}" ]
[ "0.7219088", "0.71356076", "0.71356076", "0.57152736", "0.5621252", "0.5413163", "0.5362083", "0.5326339", "0.52831817", "0.5236325", "0.5236325", "0.5236282", "0.52257466", "0.52257466", "0.52257466", "0.52257466", "0.52257466", "0.52257466", "0.51879174", "0.5145243", "0.5062314", "0.5045044", "0.50432897", "0.50245947", "0.5012989", "0.5004735", "0.5002781", "0.49977145", "0.49915555", "0.49459326", "0.49331084", "0.4926941", "0.48027477", "0.47856784", "0.47487718", "0.47226095", "0.47126997", "0.46996415", "0.46672988", "0.46656594", "0.46459225", "0.45878416", "0.45414037", "0.45414037", "0.45412916", "0.45356038", "0.4468362", "0.44514373", "0.4438132", "0.44167688", "0.44163728", "0.44163728", "0.44155797", "0.44155797", "0.44155797", "0.44155797", "0.44155797", "0.44155797", "0.44155797", "0.44155797", "0.44155797", "0.44155797", "0.44155797", "0.44155797", "0.44155797", "0.44155797", "0.44155797", "0.44155797", "0.44155797", "0.44155797", "0.44155797", "0.44155797", "0.44155797", "0.44155797", "0.44155797", "0.44155797", "0.44155797", "0.44155797", "0.44155797", "0.44155797", "0.44155797", "0.44155797", "0.44155797", "0.44155797", "0.44155797", "0.440873", "0.43953705", "0.43823636", "0.43802723", "0.43802723", "0.43802723", "0.43802723", "0.43802723", "0.43802723", "0.43712616", "0.43710676", "0.4370561" ]
0.7159043
4
Normalize `position` to add an `indent`.
function normalize(position) { var offsets = ctx.offset; var line = position.line; var result = []; while (++line) { if (!(line in offsets)) { break; } result.push((offsets[line] || 0) + 1); } return { start: position, indent: result }; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function normalize(position) {\n var offsets = ctx.offset\n var line = position.line\n var result = []\n\n while (++line) {\n if (!(line in offsets)) {\n break\n }\n\n result.push((offsets[line] || 0) + 1)\n }\n\n return {start: position, indent: result}\n }", "function position() {\n var before = now()\n\n return update\n\n // Add the position to a node.\n function update(node, indent) {\n var previous = node.position\n var start = previous ? previous.start : before\n var combined = []\n var n = previous && previous.end.line\n var l = before.line\n\n node.position = new Position(start)\n\n // If there was already a `position`, this node was merged. Fixing\n // `start` wasn’t hard, but the indent is different. Especially\n // because some information, the indent between `n` and `l` wasn’t\n // tracked. Luckily, that space is (should be?) empty, so we can\n // safely check for it now.\n if (previous && indent && previous.indent) {\n combined = previous.indent\n\n if (n < l) {\n while (++n < l) {\n combined.push((offset[n] || 0) + 1)\n }\n\n combined.push(before.column)\n }\n\n indent = combined.concat(indent)\n }\n\n node.position.indent = indent || []\n\n return node\n }\n }", "function position() {\n var before = now();\n\n return update;\n\n /* Add the position to a node. */\n function update(node, indent) {\n var prev = node.position;\n var start = prev ? prev.start : before;\n var combined = [];\n var n = prev && prev.end.line;\n var l = before.line;\n\n node.position = new Position(start);\n\n /* If there was already a `position`, this\n * node was merged. Fixing `start` wasn’t\n * hard, but the indent is different.\n * Especially because some information, the\n * indent between `n` and `l` wasn’t\n * tracked. Luckily, that space is\n * (should be?) empty, so we can safely\n * check for it now. */\n if (prev && indent && prev.indent) {\n combined = prev.indent;\n\n if (n < l) {\n while (++n < l) {\n combined.push((offset[n] || 0) + 1);\n }\n\n combined.push(before.column);\n }\n\n indent = combined.concat(indent);\n }\n\n node.position.indent = indent || [];\n\n return node;\n }\n }", "function position() {\n var before = now();\n\n return update;\n\n /* Add the position to a node. */\n function update(node, indent) {\n var prev = node.position;\n var start = prev ? prev.start : before;\n var combined = [];\n var n = prev && prev.end.line;\n var l = before.line;\n\n node.position = new Position(start);\n\n /* If there was already a `position`, this\n * node was merged. Fixing `start` wasn’t\n * hard, but the indent is different.\n * Especially because some information, the\n * indent between `n` and `l` wasn’t\n * tracked. Luckily, that space is\n * (should be?) empty, so we can safely\n * check for it now. */\n if (prev && indent && prev.indent) {\n combined = prev.indent;\n\n if (n < l) {\n while (++n < l) {\n combined.push((offset[n] || 0) + 1);\n }\n\n combined.push(before.column);\n }\n\n indent = combined.concat(indent);\n }\n\n node.position.indent = indent || [];\n\n return node;\n }\n }", "function position() {\n var before = now();\n\n return update;\n\n /* Add the position to a node. */\n function update(node, indent) {\n var prev = node.position;\n var start = prev ? prev.start : before;\n var combined = [];\n var n = prev && prev.end.line;\n var l = before.line;\n\n node.position = new Position(start);\n\n /* If there was already a `position`, this\n * node was merged. Fixing `start` wasn’t\n * hard, but the indent is different.\n * Especially because some information, the\n * indent between `n` and `l` wasn’t\n * tracked. Luckily, that space is\n * (should be?) empty, so we can safely\n * check for it now. */\n if (prev && indent && prev.indent) {\n combined = prev.indent;\n\n if (n < l) {\n while (++n < l) {\n combined.push((offset[n] || 0) + 1);\n }\n\n combined.push(before.column);\n }\n\n indent = combined.concat(indent);\n }\n\n node.position.indent = indent || [];\n\n return node;\n }\n }", "function position() {\n var before = now();\n\n return update;\n\n /* Add the position to a node. */\n function update(node, indent) {\n var prev = node.position;\n var start = prev ? prev.start : before;\n var combined = [];\n var n = prev && prev.end.line;\n var l = before.line;\n\n node.position = new Position(start);\n\n /* If there was already a `position`, this\n * node was merged. Fixing `start` wasn’t\n * hard, but the indent is different.\n * Especially because some information, the\n * indent between `n` and `l` wasn’t\n * tracked. Luckily, that space is\n * (should be?) empty, so we can safely\n * check for it now. */\n if (prev && indent && prev.indent) {\n combined = prev.indent;\n\n if (n < l) {\n while (++n < l) {\n combined.push((offset[n] || 0) + 1);\n }\n\n combined.push(before.column);\n }\n\n indent = combined.concat(indent);\n }\n\n node.position.indent = indent || [];\n\n return node;\n }\n }", "function position() {\n var before = now();\n\n return update;\n\n /* Add the position to a node. */\n function update(node, indent) {\n var prev = node.position;\n var start = prev ? prev.start : before;\n var combined = [];\n var n = prev && prev.end.line;\n var l = before.line;\n\n node.position = new Position(start);\n\n /* If there was already a `position`, this\n * node was merged. Fixing `start` wasn’t\n * hard, but the indent is different.\n * Especially because some information, the\n * indent between `n` and `l` wasn’t\n * tracked. Luckily, that space is\n * (should be?) empty, so we can safely\n * check for it now. */\n if (prev && indent && prev.indent) {\n combined = prev.indent;\n\n if (n < l) {\n while (++n < l) {\n combined.push((offset[n] || 0) + 1);\n }\n\n combined.push(before.column);\n }\n\n indent = combined.concat(indent);\n }\n\n node.position.indent = indent || [];\n\n return node;\n }\n }", "lineIndent(pos, bias = 1) {\n let { text, from } = this.lineAt(pos, bias);\n let override = this.options.overrideIndentation;\n if (override) {\n let overriden = override(from);\n if (overriden > -1)\n return overriden;\n }\n return this.countColumn(text, text.search(/\\S|$/));\n }", "function update(node, indent) {\n var prev = node.position;\n var start = prev ? prev.start : before;\n var combined = [];\n var n = prev && prev.end.line;\n var l = before.line;\n\n node.position = new Position(start);\n\n /* If there was already a `position`, this\n * node was merged. Fixing `start` wasn’t\n * hard, but the indent is different.\n * Especially because some information, the\n * indent between `n` and `l` wasn’t\n * tracked. Luckily, that space is\n * (should be?) empty, so we can safely\n * check for it now. */\n if (prev && indent && prev.indent) {\n combined = prev.indent;\n\n if (n < l) {\n while (++n < l) {\n combined.push((offset[n] || 0) + 1);\n }\n\n combined.push(before.column);\n }\n\n indent = combined.concat(indent);\n }\n\n node.position.indent = indent || [];\n\n return node;\n }", "function update(node, indent) {\n var prev = node.position;\n var start = prev ? prev.start : before;\n var combined = [];\n var n = prev && prev.end.line;\n var l = before.line;\n\n node.position = new Position(start);\n\n /* If there was already a `position`, this\n * node was merged. Fixing `start` wasn’t\n * hard, but the indent is different.\n * Especially because some information, the\n * indent between `n` and `l` wasn’t\n * tracked. Luckily, that space is\n * (should be?) empty, so we can safely\n * check for it now. */\n if (prev && indent && prev.indent) {\n combined = prev.indent;\n\n if (n < l) {\n while (++n < l) {\n combined.push((offset[n] || 0) + 1);\n }\n\n combined.push(before.column);\n }\n\n indent = combined.concat(indent);\n }\n\n node.position.indent = indent || [];\n\n return node;\n }", "function update(node, indent) {\n var prev = node.position;\n var start = prev ? prev.start : before;\n var combined = [];\n var n = prev && prev.end.line;\n var l = before.line;\n\n node.position = new Position(start);\n\n /* If there was already a `position`, this\n * node was merged. Fixing `start` wasn’t\n * hard, but the indent is different.\n * Especially because some information, the\n * indent between `n` and `l` wasn’t\n * tracked. Luckily, that space is\n * (should be?) empty, so we can safely\n * check for it now. */\n if (prev && indent && prev.indent) {\n combined = prev.indent;\n\n if (n < l) {\n while (++n < l) {\n combined.push((offset[n] || 0) + 1);\n }\n\n combined.push(before.column);\n }\n\n indent = combined.concat(indent);\n }\n\n node.position.indent = indent || [];\n\n return node;\n }", "function update(node, indent) {\n var prev = node.position;\n var start = prev ? prev.start : before;\n var combined = [];\n var n = prev && prev.end.line;\n var l = before.line;\n\n node.position = new Position(start);\n\n /* If there was already a `position`, this\n * node was merged. Fixing `start` wasn’t\n * hard, but the indent is different.\n * Especially because some information, the\n * indent between `n` and `l` wasn’t\n * tracked. Luckily, that space is\n * (should be?) empty, so we can safely\n * check for it now. */\n if (prev && indent && prev.indent) {\n combined = prev.indent;\n\n if (n < l) {\n while (++n < l) {\n combined.push((offset[n] || 0) + 1);\n }\n\n combined.push(before.column);\n }\n\n indent = combined.concat(indent);\n }\n\n node.position.indent = indent || [];\n\n return node;\n }", "function update(node, indent) {\n var prev = node.position;\n var start = prev ? prev.start : before;\n var combined = [];\n var n = prev && prev.end.line;\n var l = before.line;\n\n node.position = new Position(start);\n\n /* If there was already a `position`, this\n * node was merged. Fixing `start` wasn’t\n * hard, but the indent is different.\n * Especially because some information, the\n * indent between `n` and `l` wasn’t\n * tracked. Luckily, that space is\n * (should be?) empty, so we can safely\n * check for it now. */\n if (prev && indent && prev.indent) {\n combined = prev.indent;\n\n if (n < l) {\n while (++n < l) {\n combined.push((offset[n] || 0) + 1);\n }\n\n combined.push(before.column);\n }\n\n indent = combined.concat(indent);\n }\n\n node.position.indent = indent || [];\n\n return node;\n }", "function translator_resetPosition(position)\n{\n position += this.offsetAdj;\n this.parser.resetPosition(position);\n}", "function update(node, indent) {\n var previous = node.position\n var start = previous ? previous.start : before\n var combined = []\n var n = previous && previous.end.line\n var l = before.line\n\n node.position = new Position(start)\n\n // If there was already a `position`, this node was merged. Fixing\n // `start` wasn’t hard, but the indent is different. Especially\n // because some information, the indent between `n` and `l` wasn’t\n // tracked. Luckily, that space is (should be?) empty, so we can\n // safely check for it now.\n if (previous && indent && previous.indent) {\n combined = previous.indent\n\n if (n < l) {\n while (++n < l) {\n combined.push((offset[n] || 0) + 1)\n }\n\n combined.push(before.column)\n }\n\n indent = combined.concat(indent)\n }\n\n node.position.indent = indent || []\n\n return node\n }", "offsetAt(position) {\n return (0, utils_1.offsetAt)(position, this.getText(), this.getLineOffsets());\n }", "function normalizedValueToPosition(sliderOpts, normalizedPosition) {\n\t return sliderOpts.inputAreaStart + constants.stepInset +\n\t (sliderOpts.inputAreaLength - 2 * constants.stepInset) * Math.min(1, Math.max(0, normalizedPosition));\n\t}", "function syntaxIndentation(cx, ast, pos) {\n return indentFrom(ast.resolveInner(pos).enterUnfinishedNodesBefore(pos), pos, cx);\n}", "updatePosition(position) {\n if (position == null)\n return;\n const positionNodes = parseExpressions(position)[0].terms;\n for (let i = 0; i < 3; ++i) {\n this.position.setComponent(i, normalizeUnit(positionNodes[i]).number);\n }\n }", "function normalizedValueToPosition(sliderOpts, normalizedPosition) {\n return sliderOpts.inputAreaStart + constants.stepInset +\n (sliderOpts.inputAreaLength - 2 * constants.stepInset) * Math.min(1, Math.max(0, normalizedPosition));\n}", "function normalizedValueToPosition(sliderOpts, normalizedPosition) {\n return sliderOpts.inputAreaStart + constants.stepInset +\n (sliderOpts.inputAreaLength - 2 * constants.stepInset) * Math.min(1, Math.max(0, normalizedPosition));\n}", "function _fixItemsIndent( changePosition, document, batch ) {\n let nextItem = changePosition.nodeAfter;\n\n if ( nextItem && nextItem.name == 'listItem' ) {\n document.enqueueChanges( () => {\n const prevItem = nextItem.previousSibling;\n // This is the maximum indent that following model list item may have.\n const maxIndent = prevItem && prevItem.is( 'listItem' ) ? prevItem.getAttribute( 'indent' ) + 1 : 0;\n\n // Check how much the next item needs to be outdented.\n let outdentBy = nextItem.getAttribute( 'indent' ) - maxIndent;\n const items = [];\n\n while ( nextItem && nextItem.name == 'listItem' && nextItem.getAttribute( 'indent' ) > maxIndent ) {\n if ( outdentBy > nextItem.getAttribute( 'indent' ) ) {\n outdentBy = nextItem.getAttribute( 'indent' );\n }\n\n const newIndent = nextItem.getAttribute( 'indent' ) - outdentBy;\n\n items.push( { item: nextItem, indent: newIndent } );\n\n nextItem = nextItem.nextSibling;\n }\n\n if ( items.length > 0 ) {\n // Since we are outdenting list items, it is safer to start from the last one (it will maintain correct model state).\n for ( const item of items.reverse() ) {\n batch.setAttribute( item.item, 'indent', item.indent );\n }\n }\n } );\n }\n}", "appendAlignment(position) {\n return BluetoothNative.appendAlignment(position);\n }", "function position(pos) {\n log.innerHTML = pos\n }", "function position_normalizer(fb_position)\n\t{\n\t\tif(typeof fb_position === 'undefined'){\n\t\t\treturn '';\n\t\t}\n\t\telse\n\t\t{\n\t\t\tfb_position = fb_position.toLowerCase();\n\n\t\t\tif (fb_position == 'ilb')\n\t\t\t{\n\t\t\t\tfb_position = 'lb';\n\t\t\t}\n\t\t\telse if (fb_position == 'olb')\n\t\t\t{\n\t\t\t\tfb_position = 'lb'; \n\t\t\t}\n\t\t\telse if(fb_position == 'ss')\n\t\t\t{\n\t\t\t\tfb_position = 's';\n\t\t\t}\n\t\t\telse if(fb_position == 'fs')\n\t\t\t{\n\t\t\t\tfb_position = 's';\n\t\t\t}\n\t\t\telse if(fb_position == 'gbp')\n\t\t\t{\n\t\t\t\tfb_position = 's';\n\t\t\t}\n\t\t\telse if(fb_position == 'nt')\n\t\t\t{\n\t\t\t\tfb_position = 'dt';\n\t\t\t}\n\n\t\t\tif(fb_position == 'dt')\n\t\t\t{\n\t\t\t\tfb_position = 'de';\n\t\t\t}\n\t\t\tif(fb_position == 'lb')\n\t\t\t{\n\t\t\t\tfb_position = 'de';\n\t\t\t}\n\t\t\treturn fb_position;\n\t\t}\n\t}", "async _indentToLine() {\n const editor = vscode.window.activeTextEditor;\n\n if (editor && editor.selection.active.line) {\n const pos = editor.selection.active;\n\n await this._addUnderscore(editor.document, pos, '');\n\n // Update current line and preceeding lines\n const {lines, firstRow} = MagikUtils.indentRegion();\n if (lines) {\n await this._indentMagikLines(lines, firstRow, pos.line, true);\n }\n }\n }", "function position() {\n var start = {line: lineno, column: column}\n return function(node) {\n node.position = new Position(start)\n whitespace()\n return node\n }\n }", "function normalizedValueToPosition(sliderOpts, normalizedPosition) {\n var dims = sliderOpts._dims;\n return dims.inputAreaStart + constants.stepInset + (dims.inputAreaLength - 2 * constants.stepInset) * Math.min(1, Math.max(0, normalizedPosition));\n}", "addPosition(pos) {\n this.positions += '=\"'+pos.line + ':' + pos.linePosition + '\",';\n }", "assignPosition(node, position) {\n\t\tif(node.parentNode && position<node.parentNode.position){\n\t\t\tposition = node.parentNode.position;\n\t\t}\n\t\twhile(this.positionMap.get(`${node.level},${position}`)){\n\t\t\tposition++;\n\t\t}\n\t\tnode.position = position;\n\t\tthis.positionMap.set(`${node.level},${position}`, true);\n\t\tfor(var i in node.children){\n\t\t\tthis.assignPosition(node.children[i], position+Number(i));\n\t\t}\n\t}", "function adjustNodeInsertPosition(root, nodeToInsert, position) {\n adjustSteps.forEach(function (handler) {\n position = handler(root, nodeToInsert, position);\n });\n return position;\n}", "function position() {\n var start = { line: lineno, column: column };\n return function(node){\n node.position = new Position(start);\n whitespace();\n return node;\n };\n }", "function position() {\n var start = { line: lineno, column: column };\n return function(node){\n node.position = new Position(start);\n whitespace();\n return node;\n };\n }", "function position() {\n var start = { line: lineno, column: column };\n return function(node){\n node.position = new Position(start);\n whitespace();\n return node;\n };\n }", "function position() {\n var start = { line: lineno, column: column };\n return function(node){\n node.position = new Position(start);\n whitespace();\n return node;\n };\n }", "function position() {\n var start = { line: lineno, column: column };\n return function(node){\n node.position = new Position(start);\n whitespace();\n return node;\n };\n }", "function position() {\n var start = { line: lineno, column: column };\n return function(node){\n node.position = new Position(start);\n whitespace();\n return node;\n };\n }", "function positionToNormalizedValue(sliderOpts, position) {\n return Math.min(1, Math.max(0, (position - constants.stepInset - sliderOpts.inputAreaStart) / (sliderOpts.inputAreaLength - 2 * constants.stepInset - 2 * sliderOpts.inputAreaStart)));\n}", "function positionToNormalizedValue(sliderOpts, position) {\n return Math.min(1, Math.max(0, (position - constants.stepInset - sliderOpts.inputAreaStart) / (sliderOpts.inputAreaLength - 2 * constants.stepInset - 2 * sliderOpts.inputAreaStart)));\n}", "function apply(node, parent) {\n return pos(add(pos(node), parent), indent)\n }", "function positionToNormalizedValue(sliderOpts, position) {\n\t return Math.min(1, Math.max(0, (position - constants.stepInset - sliderOpts.inputAreaStart) / (sliderOpts.inputAreaLength - 2 * constants.stepInset - 2 * sliderOpts.inputAreaStart)));\n\t}", "updatePosition(position) {\n if (position == null)\n return;\n const positionNodes = parseExpressions(position)[0].terms;\n for (let i = 0; i < 3; ++i) {\n this.position.setComponent(i, normalizeUnit(positionNodes[i]).number);\n }\n this.updateMatrixWorld();\n }", "function position() {\n const start = {\n line: lineno,\n column\n };\n return function (node) {\n node.position = new Position(start);\n whitespace();\n return node;\n };\n }", "function positionToNormalizedValue(sliderOpts, position) {\n var dims = sliderOpts._dims;\n return Math.min(1, Math.max(0, (position - constants.stepInset - dims.inputAreaStart) / (dims.inputAreaLength - 2 * constants.stepInset - 2 * dims.inputAreaStart)));\n}", "function pedanticListItem(ctx, value, position) {\n var offsets = ctx.offset\n var line = position.line\n\n // Remove the list-item’s bullet.\n value = value.replace(pedanticBulletExpression, replacer)\n\n // The initial line was also matched by the below, so we reset the `line`.\n line = position.line\n\n return value.replace(initialIndentExpression, replacer)\n\n // A simple replacer which removed all matches, and adds their length to\n // `offset`.\n function replacer($0) {\n offsets[line] = (offsets[line] || 0) + $0.length\n line++\n\n return ''\n }\n}", "function replaceWithOffset(text, offset, STATE) {\r\n if (offset < 0) {\r\n text = text\r\n .replace(/\\t/g, ' '.repeat(STATE.CONFIG.tabSize))\r\n .replace(new RegExp(\"^ {\" + Math.abs(offset) + \"}\"), '');\r\n if (!STATE.CONFIG.insertSpaces) {\r\n text = replaceSpacesOrTabs(text, STATE, false);\r\n }\r\n }\r\n else {\r\n text = text.replace(/^/, STATE.CONFIG.insertSpaces ? ' '.repeat(offset) : '\\t'.repeat(offset / STATE.CONFIG.tabSize));\r\n }\r\n return text;\r\n}", "function indentRange(state, from, to) {\n let updated = Object.create(null);\n let context = new IndentContext(state, { overrideIndentation: start => { var _a; return (_a = updated[start]) !== null && _a !== void 0 ? _a : -1; } });\n let changes = [];\n for (let pos = from; pos <= to;) {\n let line = state.doc.lineAt(pos);\n pos = line.to + 1;\n let indent = getIndentation(context, line.from);\n if (indent == null)\n continue;\n if (!/\\S/.test(line.text))\n indent = 0;\n let cur = /^\\s*/.exec(line.text)[0];\n let norm = indentString(state, indent);\n if (cur != norm) {\n updated[line.from] = indent;\n changes.push({ from: line.from, to: line.from + cur.length, insert: norm });\n }\n }\n return state.changes(changes);\n}", "function adjustForChange(pos, change) {\r\n if (cmp(pos, change.from) < 0) return pos;\r\n if (cmp(pos, change.to) <= 0) return changeEnd(change);\r\n\r\n var line = pos.line + change.text.length - (change.to.line - change.from.line) - 1, ch = pos.ch;\r\n if (pos.line == change.to.line) ch += changeEnd(change).ch - change.to.ch;\r\n return Pos(line, ch);\r\n }", "function position() {\n var start = { line: lineno, column: column };\n return function (node) {\n node.position = new ParsePosition(start);\n whitespace();\n return node;\n };\n }", "function InsertSpaces(line, pos, count)\n\t{\n\t\tvar left\t= line.substr(0, pos);\n\t\tvar right\t= line.substr(pos + 1, line.length);\t// pos + 1 will get rid of the tab\n\t\tvar spaces\t= '';\n\t\t\n\t\tfor(var i = 0; i < count; i++)\n\t\t\tspaces += ' ';\n\t\t\n\t\treturn left + spaces + right;\n\t}", "function adjustForChange(pos, change) {\n if (cmp(pos, change.from) < 0) {\n return pos;\n }\n\n if (cmp(pos, change.to) <= 0) {\n return changeEnd(change);\n }\n\n var line = pos.line + change.text.length - (change.to.line - change.from.line) - 1,\n ch = pos.ch;\n\n if (pos.line == change.to.line) {\n ch += changeEnd(change).ch - change.to.ch;\n }\n\n return Pos(line, ch);\n }", "indent(level) {\n this.level = this.level || 1;\n if (level) {\n this.level += level;\n return '';\n }\n return Array(this.level).join(this.indentation);\n }", "function adjustForChange(pos, change) {\n if (cmp(pos, change.from) < 0) { return pos }\n if (cmp(pos, change.to) <= 0) { return changeEnd(change) }\n\n var line = pos.line + change.text.length - (change.to.line - change.from.line) - 1, ch = pos.ch;\n if (pos.line == change.to.line) { ch += changeEnd(change).ch - change.to.ch; }\n return Pos(line, ch)\n }", "function adjustForChange(pos, change) {\n if (cmp(pos, change.from) < 0) { return pos }\n if (cmp(pos, change.to) <= 0) { return changeEnd(change) }\n\n var line = pos.line + change.text.length - (change.to.line - change.from.line) - 1, ch = pos.ch;\n if (pos.line == change.to.line) { ch += changeEnd(change).ch - change.to.ch; }\n return Pos(line, ch)\n }", "function adjustForChange(pos, change) {\n if (cmp(pos, change.from) < 0) { return pos }\n if (cmp(pos, change.to) <= 0) { return changeEnd(change) }\n\n var line = pos.line + change.text.length - (change.to.line - change.from.line) - 1, ch = pos.ch;\n if (pos.line == change.to.line) { ch += changeEnd(change).ch - change.to.ch; }\n return Pos(line, ch)\n }", "function adjustForChange(pos, change) {\n if (cmp(pos, change.from) < 0) { return pos }\n if (cmp(pos, change.to) <= 0) { return changeEnd(change) }\n\n var line = pos.line + change.text.length - (change.to.line - change.from.line) - 1, ch = pos.ch;\n if (pos.line == change.to.line) { ch += changeEnd(change).ch - change.to.ch; }\n return Pos(line, ch)\n }", "function adjustForChange(pos, change) {\n if (cmp(pos, change.from) < 0) { return pos }\n if (cmp(pos, change.to) <= 0) { return changeEnd(change) }\n\n var line = pos.line + change.text.length - (change.to.line - change.from.line) - 1, ch = pos.ch;\n if (pos.line == change.to.line) { ch += changeEnd(change).ch - change.to.ch; }\n return Pos(line, ch)\n }", "function adjustForChange(pos, change) {\n if (cmp(pos, change.from) < 0) { return pos }\n if (cmp(pos, change.to) <= 0) { return changeEnd(change) }\n\n var line = pos.line + change.text.length - (change.to.line - change.from.line) - 1, ch = pos.ch;\n if (pos.line == change.to.line) { ch += changeEnd(change).ch - change.to.ch; }\n return Pos(line, ch)\n }", "function adjustForChange(pos, change) {\n if (cmp(pos, change.from) < 0) { return pos }\n if (cmp(pos, change.to) <= 0) { return changeEnd(change) }\n\n var line = pos.line + change.text.length - (change.to.line - change.from.line) - 1, ch = pos.ch;\n if (pos.line == change.to.line) { ch += changeEnd(change).ch - change.to.ch; }\n return Pos(line, ch)\n }", "function adjustForChange(pos, change) {\n if (cmp(pos, change.from) < 0) { return pos }\n if (cmp(pos, change.to) <= 0) { return changeEnd(change) }\n\n var line = pos.line + change.text.length - (change.to.line - change.from.line) - 1, ch = pos.ch;\n if (pos.line == change.to.line) { ch += changeEnd(change).ch - change.to.ch; }\n return Pos(line, ch)\n }", "function adjustForChange(pos, change) {\n if (cmp(pos, change.from) < 0) { return pos }\n if (cmp(pos, change.to) <= 0) { return changeEnd(change) }\n\n var line = pos.line + change.text.length - (change.to.line - change.from.line) - 1, ch = pos.ch;\n if (pos.line == change.to.line) { ch += changeEnd(change).ch - change.to.ch; }\n return Pos(line, ch)\n }", "function adjustForChange(pos, change) {\n if (cmp(pos, change.from) < 0) { return pos }\n if (cmp(pos, change.to) <= 0) { return changeEnd(change) }\n\n var line = pos.line + change.text.length - (change.to.line - change.from.line) - 1, ch = pos.ch;\n if (pos.line == change.to.line) { ch += changeEnd(change).ch - change.to.ch; }\n return Pos(line, ch)\n }", "function adjustForChange(pos, change) {\n if (cmp(pos, change.from) < 0) { return pos }\n if (cmp(pos, change.to) <= 0) { return changeEnd(change) }\n\n var line = pos.line + change.text.length - (change.to.line - change.from.line) - 1, ch = pos.ch;\n if (pos.line == change.to.line) { ch += changeEnd(change).ch - change.to.ch; }\n return Pos(line, ch)\n }", "function adjustForChange(pos, change) {\n if (cmp(pos, change.from) < 0) { return pos }\n if (cmp(pos, change.to) <= 0) { return changeEnd(change) }\n\n var line = pos.line + change.text.length - (change.to.line - change.from.line) - 1, ch = pos.ch;\n if (pos.line == change.to.line) { ch += changeEnd(change).ch - change.to.ch; }\n return Pos(line, ch)\n }", "function adjustForChange(pos, change) {\n if (cmp(pos, change.from) < 0) { return pos }\n if (cmp(pos, change.to) <= 0) { return changeEnd(change) }\n\n var line = pos.line + change.text.length - (change.to.line - change.from.line) - 1, ch = pos.ch;\n if (pos.line == change.to.line) { ch += changeEnd(change).ch - change.to.ch; }\n return Pos(line, ch)\n }", "function adjustForChange(pos, change) {\n if (cmp(pos, change.from) < 0) { return pos }\n if (cmp(pos, change.to) <= 0) { return changeEnd(change) }\n\n var line = pos.line + change.text.length - (change.to.line - change.from.line) - 1, ch = pos.ch;\n if (pos.line == change.to.line) { ch += changeEnd(change).ch - change.to.ch; }\n return Pos(line, ch)\n }", "function adjustForChange(pos, change) {\n if (cmp(pos, change.from) < 0) { return pos }\n if (cmp(pos, change.to) <= 0) { return changeEnd(change) }\n\n var line = pos.line + change.text.length - (change.to.line - change.from.line) - 1, ch = pos.ch;\n if (pos.line == change.to.line) { ch += changeEnd(change).ch - change.to.ch; }\n return Pos(line, ch)\n }", "function adjustForChange(pos, change) {\n if (cmp(pos, change.from) < 0) { return pos }\n if (cmp(pos, change.to) <= 0) { return changeEnd(change) }\n\n var line = pos.line + change.text.length - (change.to.line - change.from.line) - 1, ch = pos.ch;\n if (pos.line == change.to.line) { ch += changeEnd(change).ch - change.to.ch; }\n return Pos(line, ch)\n }", "function adjustForChange(pos, change) {\n if (cmp(pos, change.from) < 0) { return pos }\n if (cmp(pos, change.to) <= 0) { return changeEnd(change) }\n\n var line = pos.line + change.text.length - (change.to.line - change.from.line) - 1, ch = pos.ch;\n if (pos.line == change.to.line) { ch += changeEnd(change).ch - change.to.ch; }\n return Pos(line, ch)\n }", "function InsertSpaces(line, pos, count)\r\n\t{\r\n\t\tvar left\t= line.substr(0, pos);\r\n\t\tvar right\t= line.substr(pos + 1, line.length);\t// pos + 1 will get rid of the tab\r\n\t\tvar spaces\t= '';\r\n\t\t\r\n\t\tfor(var i = 0; i < count; i++)\r\n\t\t\tspaces += ' ';\r\n\t\t\r\n\t\treturn left + spaces + right;\r\n\t}", "function adjustForChange(pos, change) {\n if (cmp(pos, change.from) < 0) return pos;\n if (cmp(pos, change.to) <= 0) return changeEnd(change);\n\n var line = pos.line + change.text.length - (change.to.line - change.from.line) - 1, ch = pos.ch;\n if (pos.line == change.to.line) ch += changeEnd(change).ch - change.to.ch;\n return Pos(line, ch);\n }", "function adjustForChange(pos, change) {\n if (cmp(pos, change.from) < 0) return pos;\n if (cmp(pos, change.to) <= 0) return changeEnd(change);\n\n var line = pos.line + change.text.length - (change.to.line - change.from.line) - 1, ch = pos.ch;\n if (pos.line == change.to.line) ch += changeEnd(change).ch - change.to.ch;\n return Pos(line, ch);\n }", "function adjustForChange(pos, change) {\n if (cmp(pos, change.from) < 0) return pos;\n if (cmp(pos, change.to) <= 0) return changeEnd(change);\n\n var line = pos.line + change.text.length - (change.to.line - change.from.line) - 1, ch = pos.ch;\n if (pos.line == change.to.line) ch += changeEnd(change).ch - change.to.ch;\n return Pos(line, ch);\n }", "function adjustForChange(pos, change) {\n if (cmp(pos, change.from) < 0) return pos;\n if (cmp(pos, change.to) <= 0) return changeEnd(change);\n\n var line = pos.line + change.text.length - (change.to.line - change.from.line) - 1, ch = pos.ch;\n if (pos.line == change.to.line) ch += changeEnd(change).ch - change.to.ch;\n return Pos(line, ch);\n }", "function adjustForChange(pos, change) {\n if (cmp(pos, change.from) < 0) return pos;\n if (cmp(pos, change.to) <= 0) return changeEnd(change);\n\n var line = pos.line + change.text.length - (change.to.line - change.from.line) - 1, ch = pos.ch;\n if (pos.line == change.to.line) ch += changeEnd(change).ch - change.to.ch;\n return Pos(line, ch);\n }", "function adjustForChange(pos, change) {\n if (cmp(pos, change.from) < 0) return pos;\n if (cmp(pos, change.to) <= 0) return changeEnd(change);\n\n var line = pos.line + change.text.length - (change.to.line - change.from.line) - 1, ch = pos.ch;\n if (pos.line == change.to.line) ch += changeEnd(change).ch - change.to.ch;\n return Pos(line, ch);\n }", "function adjustForChange(pos, change) {\n if (cmp(pos, change.from) < 0) return pos;\n if (cmp(pos, change.to) <= 0) return changeEnd(change);\n\n var line = pos.line + change.text.length - (change.to.line - change.from.line) - 1, ch = pos.ch;\n if (pos.line == change.to.line) ch += changeEnd(change).ch - change.to.ch;\n return Pos(line, ch);\n }", "indent() {\n var session = this.session;\n var range = this.getSelectionRange();\n\n if (range.start.row < range.end.row) {\n var rows = this.$getSelectedRows();\n session.indentRows(rows.first, rows.last, \"\\t\");\n return;\n } else if (range.start.column < range.end.column) {\n var text = session.getTextRange(range);\n if (!/^\\s+$/.test(text)) {\n var rows = this.$getSelectedRows();\n session.indentRows(rows.first, rows.last, \"\\t\");\n return;\n }\n }\n \n var line = session.getLine(range.start.row);\n var position = range.start;\n var size = session.getTabSize();\n var column = session.documentToScreenColumn(position.row, position.column);\n\n if (this.session.getUseSoftTabs()) {\n var count = (size - column % size);\n var indentString = lang.stringRepeat(\" \", count);\n } else {\n var count = column % size;\n while (line[range.start.column - 1] == \" \" && count) {\n range.start.column--;\n count--;\n }\n this.selection.setSelectionRange(range);\n indentString = \"\\t\";\n }\n return this.insert(indentString);\n }", "function adjustForChange(pos, change) {\n\t\t if (cmp(pos, change.from) < 0) return pos;\n\t\t if (cmp(pos, change.to) <= 0) return changeEnd(change);\n\t\t\n\t\t var line = pos.line + change.text.length - (change.to.line - change.from.line) - 1, ch = pos.ch;\n\t\t if (pos.line == change.to.line) ch += changeEnd(change).ch - change.to.ch;\n\t\t return Pos(line, ch);\n\t\t }", "function getIndentation(context, pos) {\n if (context instanceof state.EditorState)\n context = new IndentContext(context);\n for (let service of context.state.facet(indentService)) {\n let result = service(context, pos);\n if (result !== undefined)\n return result;\n }\n let tree = syntaxTree(context.state);\n return tree ? syntaxIndentation(context, tree, pos) : null;\n}", "function adjustForChange(pos, change) {\n\t\t if (cmp(pos, change.from) < 0) { return pos }\n\t\t if (cmp(pos, change.to) <= 0) { return changeEnd(change) }\n\n\t\t var line = pos.line + change.text.length - (change.to.line - change.from.line) - 1, ch = pos.ch;\n\t\t if (pos.line == change.to.line) { ch += changeEnd(change).ch - change.to.ch; }\n\t\t return Pos(line, ch)\n\t\t }", "function adjustForChange(pos, change) {\n\t if (cmp(pos, change.from) < 0) return pos;\n\t if (cmp(pos, change.to) <= 0) return changeEnd(change);\n\n\t var line = pos.line + change.text.length - (change.to.line - change.from.line) - 1, ch = pos.ch;\n\t if (pos.line == change.to.line) ch += changeEnd(change).ch - change.to.ch;\n\t return Pos(line, ch);\n\t }", "function adjustForChange(pos, change) {\n\t if (cmp(pos, change.from) < 0) return pos;\n\t if (cmp(pos, change.to) <= 0) return changeEnd(change);\n\n\t var line = pos.line + change.text.length - (change.to.line - change.from.line) - 1, ch = pos.ch;\n\t if (pos.line == change.to.line) ch += changeEnd(change).ch - change.to.ch;\n\t return Pos(line, ch);\n\t }", "function indention() {\n return parser(function (ps) {\n var snapshot = ps.snapshot();\n\n if (ps.indent === 0) {\n return ps.succeed(0);\n }\n\n var satisy = function (ch, pos) {\n return pos < ps.indent && ch === 0x09;\n };\n var tabs = ps.skipAdvance(satisy);\n\n if (tabs !== ps.indent) {\n ps.restore(snapshot);\n return ps.fail();\n }\n\n return ps.succeed(tabs);\n });\n }", "function adjustForChange(pos, change) {\n if (cmp(pos, change.from) < 0) { return pos }\n if (cmp(pos, change.to) <= 0) { return changeEnd(change) }\n\n var line = pos.line + change.text.length - (change.to.line - change.from.line) - 1, ch = pos.ch\n if (pos.line == change.to.line) { ch += changeEnd(change).ch - change.to.ch }\n return Pos(line, ch)\n}", "function adjustForChange(pos, change) {\n if (cmp(pos, change.from) < 0) { return pos }\n if (cmp(pos, change.to) <= 0) { return changeEnd(change) }\n\n var line = pos.line + change.text.length - (change.to.line - change.from.line) - 1, ch = pos.ch\n if (pos.line == change.to.line) { ch += changeEnd(change).ch - change.to.ch }\n return Pos(line, ch)\n}", "function adjustForChange(pos, change) {\n if (cmp(pos, change.from) < 0) return pos;\n if (cmp(pos, change.to) <= 0) return changeEnd(change);\n\n let line = pos.line + change.text.length - (change.to.line - change.from.line) - 1,\n ch = pos.ch;\n if (pos.line == change.to.line) ch += changeEnd(change).ch - change.to.ch;\n return Pos(line, ch);\n}", "function adjustForChange(pos, change) {\r\n if (cmp(pos, change.from) < 0) { return pos }\r\n if (cmp(pos, change.to) <= 0) { return changeEnd(change) }\r\n\r\n var line = pos.line + change.text.length - (change.to.line - change.from.line) - 1, ch = pos.ch;\r\n if (pos.line == change.to.line) { ch += changeEnd(change).ch - change.to.ch; }\r\n return Pos(line, ch)\r\n}", "function adjustForChange(pos, change) {\n if (cmp(pos, change.from) < 0) { return pos }\n if (cmp(pos, change.to) <= 0) { return changeEnd(change) }\n\n var line = pos.line + change.text.length - (change.to.line - change.from.line) - 1, ch = pos.ch;\n if (pos.line == change.to.line) { ch += changeEnd(change).ch - change.to.ch; }\n return Pos(line, ch)\n}", "function adjustForChange(pos, change) {\n if (cmp(pos, change.from) < 0) { return pos }\n if (cmp(pos, change.to) <= 0) { return changeEnd(change) }\n\n var line = pos.line + change.text.length - (change.to.line - change.from.line) - 1, ch = pos.ch;\n if (pos.line == change.to.line) { ch += changeEnd(change).ch - change.to.ch; }\n return Pos(line, ch)\n}", "function adjustForChange(pos, change) {\n if (cmp(pos, change.from) < 0) { return pos }\n if (cmp(pos, change.to) <= 0) { return changeEnd(change) }\n\n var line = pos.line + change.text.length - (change.to.line - change.from.line) - 1, ch = pos.ch;\n if (pos.line == change.to.line) { ch += changeEnd(change).ch - change.to.ch; }\n return Pos(line, ch)\n}", "function adjustForChange(pos, change) {\n if (cmp(pos, change.from) < 0) { return pos }\n if (cmp(pos, change.to) <= 0) { return changeEnd(change) }\n\n var line = pos.line + change.text.length - (change.to.line - change.from.line) - 1, ch = pos.ch;\n if (pos.line == change.to.line) { ch += changeEnd(change).ch - change.to.ch; }\n return Pos(line, ch)\n}", "function adjustForChange(pos, change) {\n if (cmp(pos, change.from) < 0) { return pos }\n if (cmp(pos, change.to) <= 0) { return changeEnd(change) }\n\n var line = pos.line + change.text.length - (change.to.line - change.from.line) - 1, ch = pos.ch;\n if (pos.line == change.to.line) { ch += changeEnd(change).ch - change.to.ch; }\n return Pos(line, ch)\n}", "function adjustForChange(pos, change) {\n if (cmp(pos, change.from) < 0) { return pos }\n if (cmp(pos, change.to) <= 0) { return changeEnd(change) }\n\n var line = pos.line + change.text.length - (change.to.line - change.from.line) - 1, ch = pos.ch;\n if (pos.line == change.to.line) { ch += changeEnd(change).ch - change.to.ch; }\n return Pos(line, ch)\n}", "function adjustForChange(pos, change) {\n if (cmp(pos, change.from) < 0) { return pos }\n if (cmp(pos, change.to) <= 0) { return changeEnd(change) }\n\n var line = pos.line + change.text.length - (change.to.line - change.from.line) - 1, ch = pos.ch;\n if (pos.line == change.to.line) { ch += changeEnd(change).ch - change.to.ch; }\n return Pos(line, ch)\n}" ]
[ "0.757144", "0.63089496", "0.6255081", "0.6255081", "0.6255081", "0.6255081", "0.6255081", "0.57605976", "0.5702812", "0.5702812", "0.5702812", "0.5702812", "0.5702812", "0.56591326", "0.56393504", "0.55557984", "0.54419565", "0.5432311", "0.5430044", "0.53908414", "0.53908414", "0.5307652", "0.5258692", "0.5193387", "0.51688015", "0.51649535", "0.5162449", "0.51617754", "0.5154999", "0.51418793", "0.5137667", "0.5132268", "0.5132268", "0.5132268", "0.5132268", "0.5132268", "0.5132268", "0.5128627", "0.5128627", "0.5122554", "0.5113394", "0.5096044", "0.5085981", "0.5077218", "0.5075685", "0.5045536", "0.50427544", "0.5033504", "0.5026842", "0.5024825", "0.5023136", "0.50214034", "0.50210357", "0.50210357", "0.50210357", "0.50210357", "0.50210357", "0.50210357", "0.50210357", "0.50210357", "0.50210357", "0.50210357", "0.50210357", "0.50210357", "0.50210357", "0.50210357", "0.50210357", "0.50210357", "0.50210357", "0.50167924", "0.5016518", "0.5016518", "0.5016518", "0.5016518", "0.5016518", "0.5016518", "0.5016518", "0.50115407", "0.5001768", "0.4997563", "0.49923456", "0.49922535", "0.49922535", "0.4987316", "0.49854532", "0.49854532", "0.4980534", "0.4970721", "0.4966645", "0.4966645", "0.4966645", "0.4966645", "0.4966645", "0.4966645", "0.4966645" ]
0.75367886
6
Handle a warning. See for the warnings.
function handleWarning(reason, position, code) { if (code === 3) { return; } ctx.file.message(reason, position); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function onwarn(warning) {\n if (warning.code === 'THIS_IS_UNDEFINED') return;\n console.error(warning.message);\n}", "function handleWarning(reason, position, code) {\n if (code !== 3) {\n ctx.file.message(reason, position)\n }\n }", "issueWarning(args) {\n this.emit('warning', args);\n }", "function warning(message) {\n command_1.issue('warning', message);\n}", "function warning(message) {\n command_1.issue('warning', message);\n}", "function warning(message) {\n command_1.issue('warning', message);\n}", "function warning(message) {\n command_1.issue('warning', message);\n}", "function warning(message) {\n command_1.issue('warning', message);\n}", "function warning(message){\n\t\t console.error(\"Warning: \" + message);\n\t\t}", "function warning(message) {\r\n command_1.issue('warning', message);\r\n}", "function warning(message) {\r\n command_1.issue('warning', message);\r\n}", "LogWarning() {}", "function handleError(err) {\n $log.warn('warning: Something went wrong', err.message);\n }", "static notifyWarning()\n\t\t{\n\t\t\tthis.notify(NotificationFeedbackType.Warning);\n\t\t}", "function printWarning(warning) {\n if (warning) {\n const warningMessages = warning.details\n .map(({ message }) => message)\n .join('\\n');\n logger_1.default.warn(warningMessages);\n }\n}", "warning(x) {\n this.#mux(x, levels.warning);\n }", "function onWarning (warning) {\n t.equal(warning.name, 'FastifyWarning')\n t.equal(warning.code, 'FSTWRN001')\n t.equal(runs++, expectedWarningEmitted.shift())\n }", "function handleWarnings(warnings) {\n clearOutdatedErrors();\n\n var isHotUpdate = !isFirstCompilation;\n isFirstCompilation = false;\n hasCompileErrors = false;\n\n function printWarnings() {\n // Print warnings to the console.\n var formatted = formatWebpackMessages({\n warnings: warnings,\n errors: [],\n });\n\n if (typeof console !== 'undefined' && typeof console.warn === 'function') {\n for (var i = 0; i < formatted.warnings.length; i++) {\n if (i === 5) {\n console.warn(\n 'There were more warnings in other files.\\n' +\n 'You can find a complete log in the terminal.'\n );\n break;\n }\n console.warn(stripAnsi(formatted.warnings[i]));\n }\n }\n }\n\n // Attempt to apply hot updates or reload.\n if (isHotUpdate) {\n tryApplyUpdates(function onSuccessfulHotUpdate() {\n // Only print warnings if we aren't refreshing the page.\n // Otherwise they'll disappear right away anyway.\n printWarnings();\n // Only dismiss it when we're sure it's a hot update.\n // Otherwise it would flicker right before the reload.\n ErrorOverlay.dismissBuildError();\n });\n } else {\n // Print initial warnings immediately.\n printWarnings();\n }\n}", "function handleWarnings(warnings) {\n clearOutdatedErrors();\n\n var isHotUpdate = !isFirstCompilation;\n isFirstCompilation = false;\n hasCompileErrors = false;\n\n function printWarnings() {\n // Print warnings to the console.\n var formatted = formatWebpackMessages({\n warnings: warnings,\n errors: [],\n });\n\n if (typeof console !== 'undefined' && typeof console.warn === 'function') {\n for (var i = 0; i < formatted.warnings.length; i++) {\n if (i === 5) {\n console.warn(\n 'There were more warnings in other files.\\n' +\n 'You can find a complete log in the terminal.'\n );\n break;\n }\n console.warn(stripAnsi(formatted.warnings[i]));\n }\n }\n }\n\n // Attempt to apply hot updates or reload.\n if (isHotUpdate) {\n tryApplyUpdates(function onSuccessfulHotUpdate() {\n // Only print warnings if we aren't refreshing the page.\n // Otherwise they'll disappear right away anyway.\n printWarnings();\n // Only dismiss it when we're sure it's a hot update.\n // Otherwise it would flicker right before the reload.\n ErrorOverlay.dismissBuildError();\n });\n } else {\n // Print initial warnings immediately.\n printWarnings();\n }\n}", "function handleWarnings(warnings) {\n clearOutdatedErrors();\n\n var isHotUpdate = !isFirstCompilation;\n isFirstCompilation = false;\n hasCompileErrors = false;\n\n function printWarnings() {\n // Print warnings to the console.\n var formatted = formatWebpackMessages({\n warnings: warnings,\n errors: [],\n });\n\n if (typeof console !== 'undefined' && typeof console.warn === 'function') {\n for (var i = 0; i < formatted.warnings.length; i++) {\n if (i === 5) {\n console.warn(\n 'There were more warnings in other files.\\n' +\n 'You can find a complete log in the terminal.'\n );\n break;\n }\n console.warn(stripAnsi(formatted.warnings[i]));\n }\n }\n }\n\n // Attempt to apply hot updates or reload.\n if (isHotUpdate) {\n tryApplyUpdates(function onSuccessfulHotUpdate() {\n // Only print warnings if we aren't refreshing the page.\n // Otherwise they'll disappear right away anyway.\n printWarnings();\n // Only dismiss it when we're sure it's a hot update.\n // Otherwise it would flicker right before the reload.\n ErrorOverlay.dismissBuildError();\n });\n } else {\n // Print initial warnings immediately.\n printWarnings();\n }\n}", "function handleWarnings(warnings) {\n clearOutdatedErrors();\n\n var isHotUpdate = !isFirstCompilation;\n isFirstCompilation = false;\n hasCompileErrors = false;\n\n function printWarnings() {\n // Print warnings to the console.\n var formatted = formatWebpackMessages({\n warnings: warnings,\n errors: [],\n });\n\n if (typeof console !== 'undefined' && typeof console.warn === 'function') {\n for (var i = 0; i < formatted.warnings.length; i++) {\n if (i === 5) {\n console.warn(\n 'There were more warnings in other files.\\n' +\n 'You can find a complete log in the terminal.'\n );\n break;\n }\n console.warn(stripAnsi(formatted.warnings[i]));\n }\n }\n }\n\n // Attempt to apply hot updates or reload.\n if (isHotUpdate) {\n tryApplyUpdates(function onSuccessfulHotUpdate() {\n // Only print warnings if we aren't refreshing the page.\n // Otherwise they'll disappear right away anyway.\n printWarnings();\n // Only dismiss it when we're sure it's a hot update.\n // Otherwise it would flicker right before the reload.\n ErrorOverlay.dismissBuildError();\n });\n } else {\n // Print initial warnings immediately.\n printWarnings();\n }\n}", "function handleWarnings(warnings) {\n clearOutdatedErrors();\n\n var isHotUpdate = !isFirstCompilation;\n isFirstCompilation = false;\n hasCompileErrors = false;\n\n function printWarnings() {\n // Print warnings to the console.\n var formatted = formatWebpackMessages({\n warnings: warnings,\n errors: [],\n });\n\n if (typeof console !== 'undefined' && typeof console.warn === 'function') {\n for (var i = 0; i < formatted.warnings.length; i++) {\n if (i === 5) {\n console.warn(\n 'There were more warnings in other files.\\n' +\n 'You can find a complete log in the terminal.'\n );\n break;\n }\n console.warn(stripAnsi(formatted.warnings[i]));\n }\n }\n }\n\n // Attempt to apply hot updates or reload.\n if (isHotUpdate) {\n tryApplyUpdates(function onSuccessfulHotUpdate() {\n // Only print warnings if we aren't refreshing the page.\n // Otherwise they'll disappear right away anyway.\n printWarnings();\n // Only dismiss it when we're sure it's a hot update.\n // Otherwise it would flicker right before the reload.\n ErrorOverlay.dismissBuildError();\n });\n } else {\n // Print initial warnings immediately.\n printWarnings();\n }\n}", "function handleWarnings(warnings) {\n clearOutdatedErrors();\n\n var isHotUpdate = !isFirstCompilation;\n isFirstCompilation = false;\n hasCompileErrors = false;\n\n function printWarnings() {\n // Print warnings to the console.\n var formatted = formatWebpackMessages({\n warnings: warnings,\n errors: [],\n });\n\n if (typeof console !== 'undefined' && typeof console.warn === 'function') {\n for (var i = 0; i < formatted.warnings.length; i++) {\n if (i === 5) {\n console.warn(\n 'There were more warnings in other files.\\n' +\n 'You can find a complete log in the terminal.'\n );\n break;\n }\n console.warn(stripAnsi(formatted.warnings[i]));\n }\n }\n }\n\n // Attempt to apply hot updates or reload.\n if (isHotUpdate) {\n tryApplyUpdates(function onSuccessfulHotUpdate() {\n // Only print warnings if we aren't refreshing the page.\n // Otherwise they'll disappear right away anyway.\n printWarnings();\n // Only dismiss it when we're sure it's a hot update.\n // Otherwise it would flicker right before the reload.\n ErrorOverlay.dismissBuildError();\n });\n } else {\n // Print initial warnings immediately.\n printWarnings();\n }\n}", "function handleWarnings(warnings) {\n clearOutdatedErrors();\n\n var isHotUpdate = !isFirstCompilation;\n isFirstCompilation = false;\n hasCompileErrors = false;\n\n function printWarnings() {\n // Print warnings to the console.\n var formatted = formatWebpackMessages({\n warnings: warnings,\n errors: [],\n });\n\n if (typeof console !== 'undefined' && typeof console.warn === 'function') {\n for (var i = 0; i < formatted.warnings.length; i++) {\n if (i === 5) {\n console.warn(\n 'There were more warnings in other files.\\n' +\n 'You can find a complete log in the terminal.'\n );\n break;\n }\n console.warn(stripAnsi(formatted.warnings[i]));\n }\n }\n }\n\n // Attempt to apply hot updates or reload.\n if (isHotUpdate) {\n tryApplyUpdates(function onSuccessfulHotUpdate() {\n // Only print warnings if we aren't refreshing the page.\n // Otherwise they'll disappear right away anyway.\n printWarnings();\n // Only dismiss it when we're sure it's a hot update.\n // Otherwise it would flicker right before the reload.\n ErrorOverlay.dismissBuildError();\n });\n } else {\n // Print initial warnings immediately.\n printWarnings();\n }\n}", "function handleWarnings(warnings) {\n clearOutdatedErrors();\n\n var isHotUpdate = !isFirstCompilation;\n isFirstCompilation = false;\n hasCompileErrors = false;\n\n function printWarnings() {\n // Print warnings to the console.\n var formatted = formatWebpackMessages({\n warnings: warnings,\n errors: [],\n });\n\n if (typeof console !== 'undefined' && typeof console.warn === 'function') {\n for (var i = 0; i < formatted.warnings.length; i++) {\n if (i === 5) {\n console.warn(\n 'There were more warnings in other files.\\n' +\n 'You can find a complete log in the terminal.'\n );\n break;\n }\n console.warn(stripAnsi(formatted.warnings[i]));\n }\n }\n }\n\n // Attempt to apply hot updates or reload.\n if (isHotUpdate) {\n tryApplyUpdates(function onSuccessfulHotUpdate() {\n // Only print warnings if we aren't refreshing the page.\n // Otherwise they'll disappear right away anyway.\n printWarnings();\n // Only dismiss it when we're sure it's a hot update.\n // Otherwise it would flicker right before the reload.\n ErrorOverlay.dismissBuildError();\n });\n } else {\n // Print initial warnings immediately.\n printWarnings();\n }\n}", "function handleWarnings(warnings) {\n clearOutdatedErrors();\n\n var isHotUpdate = !isFirstCompilation;\n isFirstCompilation = false;\n hasCompileErrors = false;\n\n function printWarnings() {\n // Print warnings to the console.\n var formatted = formatWebpackMessages({\n warnings: warnings,\n errors: [],\n });\n\n if (typeof console !== 'undefined' && typeof console.warn === 'function') {\n for (var i = 0; i < formatted.warnings.length; i++) {\n if (i === 5) {\n console.warn(\n 'There were more warnings in other files.\\n' +\n 'You can find a complete log in the terminal.'\n );\n break;\n }\n console.warn(stripAnsi(formatted.warnings[i]));\n }\n }\n }\n\n // Attempt to apply hot updates or reload.\n if (isHotUpdate) {\n tryApplyUpdates(function onSuccessfulHotUpdate() {\n // Only print warnings if we aren't refreshing the page.\n // Otherwise they'll disappear right away anyway.\n printWarnings();\n // Only dismiss it when we're sure it's a hot update.\n // Otherwise it would flicker right before the reload.\n ErrorOverlay.dismissBuildError();\n });\n } else {\n // Print initial warnings immediately.\n printWarnings();\n }\n}", "warn() {}", "warning(message) {\n return this.sendMessage(MessageType.Warning, message);\n }", "prepareWarning() {\n // If the date and time-aware locale warning string is ever used again,\n // initialize it here. Currently we use the no-visits warning string,\n // which does not include date and time. See bug 480169 comment 48.\n\n var warningStringID;\n if (this.hasNonSelectedItems()) {\n warningStringID = \"sanitizeSelectedWarning\";\n } else {\n warningStringID = \"sanitizeEverythingWarning2\";\n }\n\n var warningDesc = document.getElementById(\"sanitizeEverythingWarning\");\n warningDesc.textContent = this.bundleBrowser.getString(warningStringID);\n }", "function addWarning(self) {\n const warningObject = {\n type: 'genericWarning',\n time: new Date(),\n state: String(self.fsm.current),\n };\n\n const existingWarning = self.warnings.find(warning => warning.type === warningObject.type);\n\n if (!existingWarning) {\n self.warnings.push(warningObject);\n }\n}", "function warnUser() {\n console.log('warning warning warning');\n}", "function webbnote_error( warning ) {\n\tif ( warning.length === 0 ) return;\n\t\n\tvar error_string = '';\n\t\n\t// Check if\n\tif ( Object.prototype.toString.apply( warning ) === '[object Array]' ) {\n\t\tfor( var i = 0, length = warning.length; i < length; i++ ) {\n\t\t\terror_string += '<li>' + warning[ i ] + '</li>';\n\t\t}\n\t} else {\n\t\terror_string += '<li>' + warning + '</li>';\n\t}\n\t\n\t$( 'body' ).prepend( '<div class=\"page warning\"><h1>Ett fel uppstod</h1><ul>' + error_string + '</ul></div>' );\n}", "function displayWarning(warning) {\n window.alert(warning);\n }", "function checkWarning() {\n if (status.expiry <= 0) {\n logout();\n } else if (status.expiry < status.warning || connectionFailure) {\n if (dialog === null) {\n dialogOn();\n }\n setCounter();\n } else {\n if (dialog !== null) {\n dialogOff();\n }\n }\n }", "function warn(msg) {\n\t console.log(_chalk2.default.yellow('Knex:warning - ' + msg));\n\t}", "function showSpecialWarning() {\r\n return true;\r\n}", "function warn() {\n var args = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n args[_i] = arguments[_i];\n }\n write(args, PRINT_COLOR, WARN('WARNING: '));\n}", "handleCloseWarning() {\n this.clearWarning();\n }", "function warn(message) {\r\n if (_warningCallback) {\r\n _warningCallback(message);\r\n }\r\n else if (console && console.warn) {\r\n console.warn(message);\r\n }\r\n}", "function warn(message) {\r\n if (_warningCallback) {\r\n _warningCallback(message);\r\n }\r\n else if (console && console.warn) {\r\n console.warn(message);\r\n }\r\n}", "function handleError(err) {\n switch (err.errorCode) {\n default:\n console.warn(err);\n }\n}", "function warn (mssg) {\n console.log ('WARNING %s', mssg);\n }", "function warn(message) {\n if (_warningCallback) {\n _warningCallback(message);\n }\n else if (console && console.warn) {\n console.warn(message);\n }\n}", "function useWarnings(options) {\n \n }", "function setWarningCallback(warningCallback) {\n _warningCallback = warningCallback;\n}", "function setWarningCallback(warningCallback) {\n _warningCallback = warningCallback;\n}", "function setWarningCallback(warningCallback) {\n _warningCallback = warningCallback;\n}", "function setWarningCallback(warningCallback) {\n _warningCallback = warningCallback;\n}", "warn (msg : string, ...args : mixed[]) {\n\t\tthis._print(\"warn\", msg, ...args)\n\t}", "function setWarningCallback(warningCallback) {\n _warningCallback = warningCallback === undefined ? warn : warningCallback;\n}", "function setWarningCallback(warningCallback) {\r\n _warningCallback = warningCallback;\r\n}", "function setWarningCallback(warningCallback) {\r\n _warningCallback = warningCallback;\r\n}", "function warn(msg){\n\t\t\n\t\tflashCount = 0;\n\t\t\n\t\tif ( null == msg ){\t\n\t\t\tfaultMsg=\"The inverter has faulted!\"; \n\t\t\t$(\"#alarmMessage\").html(\"The inverter has faulted!\");\n\t\t} else {\n\t\t\tfaultMsg=msg;\n\t\t\t$(\"#alarmMessage\").html(\"FAULTS:\"+msg);\n\t\t}\n\n\t\t$(\"#alarm\").show();\n\t\tif ( !booFault ) {\n\t\t\tbooFault = true;\n\t\t\tscreenFlash();\n\t\t\tsoundAlarm();\n\t\t}\n\t\t\n\n\t}", "function displayWarning(event) {\n var x = 1;\n var stop = setInterval(function() {\n if (x % 2 === 0) $(event.target).addClass(\"glowWarning\");\n else $(event.target).removeClass(\"glowWarning\");\n x++;\n if (x === 10) clearInterval(stop);\n }, 100);\n}", "warn(...args) {\n return this.getInstance().warn(...args);\n }", "function warn(msg) {\n console.log(_chalk2.default.yellow('Knex:warning - ' + msg));\n}", "alertWarning(content) {\n alert(\"warning\", content)\n }", "function warnUser() {\n console.log(\"This is my warning message\");\n}", "function warnUser() {\n console.log(\"This is my warning message\");\n}", "function warnUser(warning) {\n if (warnUser.wasCalled) {\n return;\n }\n warnUser.wasCalled = true;\n console.log(warning);\n}", "onwarn(warning, rollupWarn) {\n if (warning.code !== \"CIRCULAR_DEPENDENCY\") rollupWarn(warning);\n }", "function useWarning(condition) {\n for (var _len = arguments.length, messages = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {\n messages[_key - 1] = arguments[_key];\n }\n\n if (process.env.NODE_ENV !== \"production\") {\n useEffect(function () {\n process.env.NODE_ENV !== \"production\" ? warning.apply(void 0, [condition].concat(messages.map(function (message) {\n return isRefObject(message) ? message.current : message;\n }))) : void 0;\n }, [condition]);\n }\n}", "function\nASSERT_Warning(\n/*a)string*/warning\t//)warning comment\n){\n/*m)private string*/this.warning = true;\n/*m)private string*/this.caller = this.setCaller(warning);\n/*m)private string*/this.comment = this.setComment(warning);\n/*m)private string*/this.expected = new ASSERT_Argument('WARNING!');\n}\t//---ASSERT_Warning", "function WARNING$static_(){ValidationState.WARNING=( new ValidationState(\"warning\"));}", "function warn(warning, type) {\n if (typeof YAML_SILENCE_WARNINGS !== 'undefined' && YAML_SILENCE_WARNINGS) return;\n\n if (typeof process !== 'undefined') {\n if (process.env.YAML_SILENCE_WARNINGS) return; // This will throw in Jest if `warning` is an Error instance due to\n // https://github.com/facebook/jest/issues/2549\n\n if (process.emitWarning) {\n process.emitWarning(warning, type);\n return;\n }\n } // eslint-disable-next-line no-console\n\n\n console.warn(type ? \"\".concat(type, \": \").concat(warning) : warning);\n}", "function fixWarnings(txt) /* (txt : string) -> string */ {\n var location = { value: \"\" };\n var hist = $std_dict.mdict();\n var ls = $std_core.map_3($std_core.list_4($std_core.lines(txt)), function(line /* string */ ) { var _x0 = $std_regex.find(line, rxLocation, undefined); if (_x0 == null) { var _x1 = $std_regex.find(line, rxWarning, undefined); if (_x1 == null) { return $std_core.Just((line + \"\\n\"));} else { var count = $std_core.mbint($std_dict._lb__rb__1(hist, line)); (hist)[line] = ((count + 1)|0); if (count === 4) { return $std_core.Just((\"warning: \" + (((location).value) + (\" ignoring from now on:\" + (line + \"\\n\")))));} else { if (count > 4) { return $std_core.Nothing;} else { return $std_core.Just(($std_regex._index_($std_regex.groups(_x1.unJust), 1) + (((location).value) + ($std_regex._index_($std_regex.groups(_x1.unJust), 2) + \"\\n\"))));}}}} else { ((location).value = ($std_regex._index_($std_regex.groups(_x0.unJust), 1) + \":\")); return $std_core.Nothing;}});\n return $std_core.join_3($std_core.concatMaybe(ls));\n}", "function warn (message) {\n console.warn('%s: Warning: %s', argv.$0, message);\n}", "warn(...theArgs) { return this._log('WARN', {}, theArgs); }", "function warn(message) {\r\n\tnotify(\"Attention\", message);\r\n}", "function warn(message) {\n if (_warningCallback && \"development\" !== 'production') {\n _warningCallback(message);\n }\n else if (console && console.warn) {\n console.warn(message);\n }\n}", "function addWarnings(response) {\n const responseWarnings = ((response || {}).data || {}).warnings || [];\n exceptions.addWarnings(responseWarnings);\n}", "function warn(msg){\r\n rootLogger.warn(msg)\r\n}", "warn(msg) {\n if (!bna.quiet) { return log(msg.gray); }\n }", "getMessageWarning () {\n return this.internalStore.select ('value').get ('warning');\n }", "function warn(message) {\n if (_warningCallback && \"dev\" !== 'production') {\n _warningCallback(message);\n }\n else if (console && console.warn) {\n console.warn(message);\n }\n}", "function warn(format) {\n {\n for (var _len = arguments.length, args = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {\n args[_key - 1] = arguments[_key];\n }\n\n printWarning('warn', format, args);\n }\n }", "function warn(format) {\n {\n for (\n var _len = arguments.length,\n args = new Array(_len > 1 ? _len - 1 : 0),\n _key = 1;\n _key < _len;\n _key++\n ) {\n args[_key - 1] = arguments[_key];\n }\n\n printWarning('warn', format, args);\n }\n }", "function warn(format) {\n {\n for (\n var _len = arguments.length,\n args = new Array(_len > 1 ? _len - 1 : 0),\n _key = 1;\n _key < _len;\n _key++\n ) {\n args[_key - 1] = arguments[_key];\n }\n\n printWarning('warn', format, args);\n }\n }", "function warn(format) {\n {\n for (\n var _len = arguments.length,\n args = new Array(_len > 1 ? _len - 1 : 0),\n _key = 1;\n _key < _len;\n _key++\n ) {\n args[_key - 1] = arguments[_key];\n }\n\n printWarning('warn', format, args);\n }\n }", "function triggerWarning(){\n let warning = document.getElementById('sl__warning');\n\n warning.style.display = \"block\";\n warning.innerHTML = \"Por favor, insira pelo menos <strong>1</strong> item\";\n}", "function warnUser() {\n alert(\"This is my warning message\");\n}", "function warn(format) {\n {\n for (var _len = arguments.length, args = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {\n args[_key - 1] = arguments[_key];\n }\n printWarning('warn', format, args);\n }\n }", "function warn(format) {\n {\n for (var _len = arguments.length, args = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {\n args[_key - 1] = arguments[_key];\n }\n printWarning('warn', format, args);\n }\n }", "function warn(message) {\n console.warn(\"[vee-validate] \" + message);\n }", "function warn(message) {\n if (_warningCallback && process.env.NODE_ENV !== 'production') {\n _warningCallback(message);\n }\n else if (console && console.warn) {\n console.warn(message);\n }\n}", "function warn(format) {\n {\n for (var _len = arguments.length, args = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {\n args[_key - 1] = arguments[_key];\n }\n\n printWarning('warn', format, args);\n }\n }", "function warn(format) {\n {\n for (var _len = arguments.length, args = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {\n args[_key - 1] = arguments[_key];\n }\n\n printWarning('warn', format, args);\n }\n }", "function warn(format) {\n {\n for (var _len = arguments.length, args = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {\n args[_key - 1] = arguments[_key];\n }\n\n printWarning('warn', format, args);\n }\n }", "function warn(format) {\n {\n for (var _len = arguments.length, args = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {\n args[_key - 1] = arguments[_key];\n }\n\n printWarning('warn', format, args);\n }\n }", "function warn(format) {\n {\n for (var _len = arguments.length, args = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {\n args[_key - 1] = arguments[_key];\n }\n\n printWarning('warn', format, args);\n }\n }", "function warn(format) {\n {\n for (var _len = arguments.length, args = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {\n args[_key - 1] = arguments[_key];\n }\n\n printWarning('warn', format, args);\n }\n }", "function warn(format) {\n {\n for (var _len = arguments.length, args = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {\n args[_key - 1] = arguments[_key];\n }\n\n printWarning('warn', format, args);\n }\n }", "function warn(format) {\n {\n for (var _len = arguments.length, args = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {\n args[_key - 1] = arguments[_key];\n }\n\n printWarning('warn', format, args);\n }\n }", "function warn(format) {\n {\n for (var _len = arguments.length, args = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {\n args[_key - 1] = arguments[_key];\n }\n\n printWarning('warn', format, args);\n }\n }", "function warn(format) {\n {\n for (var _len = arguments.length, args = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {\n args[_key - 1] = arguments[_key];\n }\n\n printWarning('warn', format, args);\n }\n }" ]
[ "0.7490234", "0.74281955", "0.71471065", "0.677067", "0.677067", "0.677067", "0.677067", "0.677067", "0.66602415", "0.6655821", "0.6655821", "0.6630893", "0.6614084", "0.6555695", "0.65171844", "0.6493037", "0.6445884", "0.64053947", "0.64053947", "0.64053947", "0.64053947", "0.64053947", "0.64053947", "0.64053947", "0.64053947", "0.64053947", "0.63284725", "0.62647057", "0.62173355", "0.61741936", "0.6134769", "0.6111302", "0.60818523", "0.59972626", "0.59700865", "0.5959034", "0.59555936", "0.59494287", "0.59094566", "0.59094566", "0.5891887", "0.5862047", "0.58587587", "0.58512396", "0.5832713", "0.5832713", "0.5832713", "0.5832713", "0.5831746", "0.5816277", "0.580628", "0.580628", "0.5794415", "0.5789342", "0.5755244", "0.57505924", "0.5735014", "0.57222325", "0.57222325", "0.5667068", "0.56600595", "0.56597763", "0.56417525", "0.5637109", "0.5632043", "0.56170964", "0.55945235", "0.5572417", "0.5568793", "0.55579007", "0.55202836", "0.5514165", "0.55066085", "0.54955417", "0.5487854", "0.548603", "0.548546", "0.548546", "0.548546", "0.54755276", "0.5473278", "0.5470104", "0.5470104", "0.5466258", "0.54625493", "0.5456722", "0.5456722", "0.5456722", "0.5456722", "0.5456722", "0.5456722", "0.5456722", "0.5456722", "0.5456722", "0.5456722" ]
0.752049
5
Decode `value` (at `position`) into textnodes.
function decoder(value, position, handler) { entities(value, { position: normalize(position), warning: handleWarning, text: handler, reference: handler, textContext: ctx, referenceContext: ctx }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function decoder(value, position, handler) {\n entities(value, {\n position: normalize(position),\n warning: handleWarning,\n text: handler,\n reference: handler,\n textContext: ctx,\n referenceContext: ctx\n })\n }", "function decodeRaw(value, position, options) {\n return entities(value, xtend(options, {\n position: normalize(position),\n warning: handleWarning\n }));\n }", "function decodeRaw(value, position, options) {\n return entities(value, xtend(options, {\n position: normalize(position),\n warning: handleWarning\n }));\n }", "function decodeRaw(value, position, options) {\n return entities(value, xtend(options, {\n position: normalize(position),\n warning: handleWarning\n }));\n }", "function decodeRaw(value, position, options) {\n return entities(value, xtend(options, {\n position: normalize(position),\n warning: handleWarning\n }));\n }", "function decodeRaw(value, position, options) {\n return entities(\n value,\n xtend(options, {position: normalize(position), warning: handleWarning})\n )\n }", "function decodeRaw(value, position) {\n return entities(value, {\n position: normalize(position),\n warning: handleWarning\n });\n }", "function decodeRaw(value, position) {\n return entities(value, {\n position: normalize(position),\n warning: handleWarning\n });\n }", "function decodeText(value, encoding) {\n\t\tif (encoding && encoding.trim().toLowerCase() == \"cp437\") {\n\t\t\treturn decodeCP437(value);\n\t\t} else {\n\t\t\treturn new TextDecoder(encoding).decode(value);\n\t\t}\n\t}", "function yellHTMLDecode(value) {\n var temp = document.createElement(\"div\");\n temp.innerHTML = value;\n var result = temp.childNodes[0].nodeValue;\n temp.removeChild(temp.firstChild);\n return result;\n}", "function text(index, value) {\n var lView = getLView();\n ngDevMode && assertEqual(lView[BINDING_INDEX], lView[TVIEW].bindingStartIndex, 'text nodes should be created before any bindings');\n ngDevMode && ngDevMode.rendererCreateTextNode++;\n var textNative = createTextNode(value, lView[RENDERER]);\n var tNode = createNodeAtIndex(index, 3 /* Element */, textNative, null, null);\n // Text nodes are self closing.\n setIsParent(false);\n appendChild(textNative, tNode, lView);\n}", "function text(index, value) {\n var lView = getLView();\n ngDevMode && assertEqual(lView[BINDING_INDEX], lView[TVIEW].bindingStartIndex, 'text nodes should be created before any bindings');\n ngDevMode && ngDevMode.rendererCreateTextNode++;\n var textNative = createTextNode(value, lView[RENDERER]);\n var tNode = createNodeAtIndex(index, 3 /* Element */, textNative, null, null);\n // Text nodes are self closing.\n setIsParent(false);\n appendChild(textNative, tNode, lView);\n}", "function text(index, value) {\n ngDevMode && assertEqual(viewData[BINDING_INDEX], tView.bindingStartIndex, 'text nodes should be created before any bindings');\n ngDevMode && ngDevMode.rendererCreateTextNode++;\n var textNative = createTextNode(value, renderer);\n var tNode = createNodeAtIndex(index, 3 /* Element */, textNative, null, null);\n // Text nodes are self closing.\n isParent = false;\n appendChild(textNative, tNode, viewData);\n}", "function factory(ctx) {\n decoder.raw = decodeRaw\n\n return decoder\n\n // Normalize `position` to add an `indent`.\n function normalize(position) {\n var offsets = ctx.offset\n var line = position.line\n var result = []\n\n while (++line) {\n if (!(line in offsets)) {\n break\n }\n\n result.push((offsets[line] || 0) + 1)\n }\n\n return {start: position, indent: result}\n }\n\n // Decode `value` (at `position`) into text-nodes.\n function decoder(value, position, handler) {\n entities(value, {\n position: normalize(position),\n warning: handleWarning,\n text: handler,\n reference: handler,\n textContext: ctx,\n referenceContext: ctx\n })\n }\n\n // Decode `value` (at `position`) into a string.\n function decodeRaw(value, position, options) {\n return entities(\n value,\n xtend(options, {position: normalize(position), warning: handleWarning})\n )\n }\n\n // Handle a warning.\n // See <https://github.com/wooorm/parse-entities> for the warnings.\n function handleWarning(reason, position, code) {\n if (code !== 3) {\n ctx.file.message(reason, position)\n }\n }\n}", "function asTextData(view,index){return view.nodes[index];}", "function valuetext(value) {\n return value;\n}", "function factory(ctx) {\n decoder.raw = decodeRaw;\n\n return decoder;\n\n /* Normalize `position` to add an `indent`. */\n function normalize(position) {\n var offsets = ctx.offset;\n var line = position.line;\n var result = [];\n\n while (++line) {\n if (!(line in offsets)) {\n break;\n }\n\n result.push((offsets[line] || 0) + 1);\n }\n\n return {\n start: position,\n indent: result\n };\n }\n\n /* Handle a warning.\n * See https://github.com/wooorm/parse-entities\n * for the warnings. */\n function handleWarning(reason, position, code) {\n if (code === 3) {\n return;\n }\n\n ctx.file.message(reason, position);\n }\n\n /* Decode `value` (at `position`) into text-nodes. */\n function decoder(value, position, handler) {\n entities(value, {\n position: normalize(position),\n warning: handleWarning,\n text: handler,\n reference: handler,\n textContext: ctx,\n referenceContext: ctx\n });\n }\n\n /* Decode `value` (at `position`) into a string. */\n function decodeRaw(value, position, options) {\n return entities(value, xtend(options, {\n position: normalize(position),\n warning: handleWarning\n }));\n }\n}", "function factory(ctx) {\n decoder.raw = decodeRaw;\n\n return decoder;\n\n /* Normalize `position` to add an `indent`. */\n function normalize(position) {\n var offsets = ctx.offset;\n var line = position.line;\n var result = [];\n\n while (++line) {\n if (!(line in offsets)) {\n break;\n }\n\n result.push((offsets[line] || 0) + 1);\n }\n\n return {\n start: position,\n indent: result\n };\n }\n\n /* Handle a warning.\n * See https://github.com/wooorm/parse-entities\n * for the warnings. */\n function handleWarning(reason, position, code) {\n if (code === 3) {\n return;\n }\n\n ctx.file.message(reason, position);\n }\n\n /* Decode `value` (at `position`) into text-nodes. */\n function decoder(value, position, handler) {\n entities(value, {\n position: normalize(position),\n warning: handleWarning,\n text: handler,\n reference: handler,\n textContext: ctx,\n referenceContext: ctx\n });\n }\n\n /* Decode `value` (at `position`) into a string. */\n function decodeRaw(value, position, options) {\n return entities(value, xtend(options, {\n position: normalize(position),\n warning: handleWarning\n }));\n }\n}", "function factory(ctx) {\n decoder.raw = decodeRaw;\n\n return decoder;\n\n /* Normalize `position` to add an `indent`. */\n function normalize(position) {\n var offsets = ctx.offset;\n var line = position.line;\n var result = [];\n\n while (++line) {\n if (!(line in offsets)) {\n break;\n }\n\n result.push((offsets[line] || 0) + 1);\n }\n\n return {\n start: position,\n indent: result\n };\n }\n\n /* Handle a warning.\n * See https://github.com/wooorm/parse-entities\n * for the warnings. */\n function handleWarning(reason, position, code) {\n if (code === 3) {\n return;\n }\n\n ctx.file.message(reason, position);\n }\n\n /* Decode `value` (at `position`) into text-nodes. */\n function decoder(value, position, handler) {\n entities(value, {\n position: normalize(position),\n warning: handleWarning,\n text: handler,\n reference: handler,\n textContext: ctx,\n referenceContext: ctx\n });\n }\n\n /* Decode `value` (at `position`) into a string. */\n function decodeRaw(value, position, options) {\n return entities(value, xtend(options, {\n position: normalize(position),\n warning: handleWarning\n }));\n }\n}", "function factory(ctx) {\n decoder.raw = decodeRaw;\n\n return decoder;\n\n /* Normalize `position` to add an `indent`. */\n function normalize(position) {\n var offsets = ctx.offset;\n var line = position.line;\n var result = [];\n\n while (++line) {\n if (!(line in offsets)) {\n break;\n }\n\n result.push((offsets[line] || 0) + 1);\n }\n\n return {\n start: position,\n indent: result\n };\n }\n\n /* Handle a warning.\n * See https://github.com/wooorm/parse-entities\n * for the warnings. */\n function handleWarning(reason, position, code) {\n if (code === 3) {\n return;\n }\n\n ctx.file.message(reason, position);\n }\n\n /* Decode `value` (at `position`) into text-nodes. */\n function decoder(value, position, handler) {\n entities(value, {\n position: normalize(position),\n warning: handleWarning,\n text: handler,\n reference: handler,\n textContext: ctx,\n referenceContext: ctx\n });\n }\n\n /* Decode `value` (at `position`) into a string. */\n function decodeRaw(value, position, options) {\n return entities(value, xtend(options, {\n position: normalize(position),\n warning: handleWarning\n }));\n }\n}", "function factory(ctx) {\n decoder.raw = decodeRaw;\n\n return decoder;\n\n /* Normalize `position` to add an `indent`. */\n function normalize(position) {\n var offsets = ctx.offset;\n var line = position.line;\n var result = [];\n\n while (++line) {\n if (!(line in offsets)) {\n break;\n }\n\n result.push((offsets[line] || 0) + 1);\n }\n\n return {\n start: position,\n indent: result\n };\n }\n\n /* Handle a warning.\n * See https://github.com/wooorm/parse-entities\n * for the warnings. */\n function handleWarning(reason, position, code) {\n if (code === 3) {\n return;\n }\n\n ctx.file.message(reason, position);\n }\n\n /* Decode `value` (at `position`) into text-nodes. */\n function decoder(value, position, handler) {\n entities(value, {\n position: normalize(position),\n warning: handleWarning,\n text: handler,\n reference: handler,\n textContext: ctx,\n referenceContext: ctx\n });\n }\n\n /* Decode `value` (at `position`) into a string. */\n function decodeRaw(value, position) {\n return entities(value, {\n position: normalize(position),\n warning: handleWarning\n });\n }\n}", "function factory(ctx) {\n decoder.raw = decodeRaw;\n\n return decoder;\n\n /* Normalize `position` to add an `indent`. */\n function normalize(position) {\n var offsets = ctx.offset;\n var line = position.line;\n var result = [];\n\n while (++line) {\n if (!(line in offsets)) {\n break;\n }\n\n result.push((offsets[line] || 0) + 1);\n }\n\n return {\n start: position,\n indent: result\n };\n }\n\n /* Handle a warning.\n * See https://github.com/wooorm/parse-entities\n * for the warnings. */\n function handleWarning(reason, position, code) {\n if (code === 3) {\n return;\n }\n\n ctx.file.message(reason, position);\n }\n\n /* Decode `value` (at `position`) into text-nodes. */\n function decoder(value, position, handler) {\n entities(value, {\n position: normalize(position),\n warning: handleWarning,\n text: handler,\n reference: handler,\n textContext: ctx,\n referenceContext: ctx\n });\n }\n\n /* Decode `value` (at `position`) into a string. */\n function decodeRaw(value, position) {\n return entities(value, {\n position: normalize(position),\n warning: handleWarning\n });\n }\n}", "function XmlText(value) {\n this.value = value;\n}", "function XmlText(value) {\n this.value = value;\n}", "function XmlText(value) {\n this.value = value;\n}", "function parse(value, settings) {\n var additional = settings.additional;\n var nonTerminated = settings.nonTerminated;\n var handleText = settings.text;\n var handleReference = settings.reference;\n var handleWarning = settings.warning;\n var textContext = settings.textContext;\n var referenceContext = settings.referenceContext;\n var warningContext = settings.warningContext;\n var pos = settings.position;\n var indent = settings.indent || [];\n var length = value.length;\n var index = 0;\n var lines = -1;\n var column = pos.column || 1;\n var line = pos.line || 1;\n var queue = '';\n var result = [];\n var entityCharacters;\n var namedEntity;\n var terminated;\n var characters;\n var character;\n var reference;\n var following;\n var warning;\n var reason;\n var output;\n var entity;\n var begin;\n var start;\n var type;\n var test;\n var prev;\n var next;\n var diff;\n var end;\n if (typeof additional === 'string') {\n additional = additional.charCodeAt(0);\n }\n\n // Cache the current point.\n prev = now();\n\n // Wrap `handleWarning`.\n warning = handleWarning ? parseError : noop;\n\n // Ensure the algorithm walks over the first character and the end\n // (inclusive).\n index--;\n length++;\n while (++index < length) {\n // If the previous character was a newline.\n if (character === lineFeed) {\n column = indent[lines] || 1;\n }\n character = value.charCodeAt(index);\n if (character === ampersand) {\n following = value.charCodeAt(index + 1);\n\n // The behaviour depends on the identity of the next character.\n if (following === tab || following === lineFeed || following === formFeed || following === space || following === ampersand || following === lessThan || following !== following || additional && following === additional) {\n // Not a character reference.\n // No characters are consumed, and nothing is returned.\n // This is not an error, either.\n queue += fromCharCode(character);\n column++;\n continue;\n }\n start = index + 1;\n begin = start;\n end = start;\n if (following === numberSign) {\n // Numerical entity.\n end = ++begin;\n\n // The behaviour further depends on the next character.\n following = value.charCodeAt(end);\n if (following === uppercaseX || following === lowercaseX) {\n // ASCII hex digits.\n type = hexa;\n end = ++begin;\n } else {\n // ASCII digits.\n type = deci;\n }\n } else {\n // Named entity.\n type = name;\n }\n entityCharacters = '';\n entity = '';\n characters = '';\n test = tests[type];\n end--;\n while (++end < length) {\n following = value.charCodeAt(end);\n if (!test(following)) {\n break;\n }\n characters += fromCharCode(following);\n\n // Check if we can match a legacy named reference.\n // If so, we cache that as the last viable named reference.\n // This ensures we do not need to walk backwards later.\n if (type === name && own.call(legacy, characters)) {\n entityCharacters = characters;\n entity = legacy[characters];\n }\n }\n terminated = value.charCodeAt(end) === semicolon;\n if (terminated) {\n end++;\n namedEntity = type === name ? decodeEntity(characters) : false;\n if (namedEntity) {\n entityCharacters = characters;\n entity = namedEntity;\n }\n }\n diff = 1 + end - start;\n if (!terminated && !nonTerminated) {\n // Empty.\n } else if (!characters) {\n // An empty (possible) entity is valid, unless it’s numeric (thus an\n // ampersand followed by an octothorp).\n if (type !== name) {\n warning(numericEmpty, diff);\n }\n } else if (type === name) {\n // An ampersand followed by anything unknown, and not terminated, is\n // invalid.\n if (terminated && !entity) {\n warning(namedUnknown, 1);\n } else {\n // If theres something after an entity name which is not known, cap\n // the reference.\n if (entityCharacters !== characters) {\n end = begin + entityCharacters.length;\n diff = 1 + end - begin;\n terminated = false;\n }\n\n // If the reference is not terminated, warn.\n if (!terminated) {\n reason = entityCharacters ? namedNotTerminated : namedEmpty;\n if (settings.attribute) {\n following = value.charCodeAt(end);\n if (following === equalsTo) {\n warning(reason, diff);\n entity = null;\n } else if (alphanumerical(following)) {\n entity = null;\n } else {\n warning(reason, diff);\n }\n } else {\n warning(reason, diff);\n }\n }\n }\n reference = entity;\n } else {\n if (!terminated) {\n // All non-terminated numeric entities are not rendered, and trigger a\n // warning.\n warning(numericNotTerminated, diff);\n }\n\n // When terminated and number, parse as either hexadecimal or decimal.\n reference = parseInt(characters, bases[type]);\n\n // Trigger a warning when the parsed number is prohibited, and replace\n // with replacement character.\n if (prohibited(reference)) {\n warning(numericProhibited, diff);\n reference = fromCharCode(replacementCharacter);\n } else if (reference in invalid) {\n // Trigger a warning when the parsed number is disallowed, and replace\n // by an alternative.\n warning(numericDisallowed, diff);\n reference = invalid[reference];\n } else {\n // Parse the number.\n output = '';\n\n // Trigger a warning when the parsed number should not be used.\n if (disallowed(reference)) {\n warning(numericDisallowed, diff);\n }\n\n // Stringify the number.\n if (reference > 0xffff) {\n reference -= 0x10000;\n output += fromCharCode(reference >>> (10 & 0x3ff) | 0xd800);\n reference = 0xdc00 | reference & 0x3ff;\n }\n reference = output + fromCharCode(reference);\n }\n }\n\n // Found it!\n // First eat the queued characters as normal text, then eat an entity.\n if (reference) {\n flush();\n prev = now();\n index = end - 1;\n column += end - start + 1;\n result.push(reference);\n next = now();\n next.offset++;\n if (handleReference) {\n handleReference.call(referenceContext, reference, {\n start: prev,\n end: next\n }, value.slice(start - 1, end));\n }\n prev = next;\n } else {\n // If we could not find a reference, queue the checked characters (as\n // normal characters), and move the pointer to their end.\n // This is possible because we can be certain neither newlines nor\n // ampersands are included.\n characters = value.slice(start - 1, end);\n queue += characters;\n column += characters.length;\n index = end - 1;\n }\n } else {\n // Handle anything other than an ampersand, including newlines and EOF.\n if (character === 10 // Line feed\n ) {\n line++;\n lines++;\n column = 0;\n }\n if (character === character) {\n queue += fromCharCode(character);\n column++;\n } else {\n flush();\n }\n }\n }\n\n // Return the reduced nodes.\n return result.join('');\n\n // Get current position.\n function now() {\n return {\n line: line,\n column: column,\n offset: index + (pos.offset || 0)\n };\n }\n\n // “Throw” a parse-error: a warning.\n function parseError(code, offset) {\n var position = now();\n position.column += offset;\n position.offset += offset;\n handleWarning.call(warningContext, messages[code], position, code);\n }\n\n // Flush `queue` (normal text).\n // Macro invoked before each entity and at the end of `value`.\n // Does nothing when `queue` is empty.\n function flush() {\n if (queue) {\n result.push(queue);\n if (handleText) {\n handleText.call(textContext, queue, {\n start: prev,\n end: now()\n });\n }\n queue = '';\n }\n }\n}", "function asTextData(view, index) {\n return view.nodes[index];\n }", "function asTextData(view, index) {\n return view.nodes[index];\n}", "set childNodes(value) {\n this.textNodes = value;\n }", "function asTextData(view, index) {\n return view.nodes[index];\n}", "function asTextData(view, index) {\n return view.nodes[index];\n}", "function asTextData(view, index) {\n return view.nodes[index];\n}", "function asTextData(view, index) {\n return view.nodes[index];\n}", "function asTextData(view, index) {\n return view.nodes[index];\n}", "function asTextData(view, index) {\n return view.nodes[index];\n}", "function asTextData(view, index) {\n return view.nodes[index];\n}", "function asTextData(view, index) {\n return view.nodes[index];\n}", "function asTextData(view, index) {\n return view.nodes[index];\n}", "set text(value) {}", "set text(value) {}", "function mapTextNodes(container, func) {\n var walker = document.createTreeWalker(container, NodeFilter.SHOW_TEXT);\n var node = walker.firstChild();\n if (node) {\n do {\n node.data = func(node.data);\n } while ((node = walker.nextSibling()));\n }\n\n return node;\n }", "function getLocation(text, position) {\n var segments = []; // strings or numbers\n var earlyReturnException = new Object();\n var previousNode = void 0;\n var previousNodeInst = {\n value: {},\n offset: 0,\n length: 0,\n type: 'object',\n parent: void 0\n };\n var isAtPropertyKey = false;\n function setPreviousNode(value, offset, length, type) {\n previousNodeInst.value = value;\n previousNodeInst.offset = offset;\n previousNodeInst.length = length;\n previousNodeInst.type = type;\n previousNodeInst.colonOffset = void 0;\n previousNode = previousNodeInst;\n }\n try {\n visit(text, {\n onObjectBegin: function (offset, length) {\n if (position <= offset) {\n throw earlyReturnException;\n }\n previousNode = void 0;\n isAtPropertyKey = position > offset;\n segments.push(''); // push a placeholder (will be replaced)\n },\n onObjectProperty: function (name, offset, length) {\n if (position < offset) {\n throw earlyReturnException;\n }\n setPreviousNode(name, offset, length, 'property');\n segments[segments.length - 1] = name;\n if (position <= offset + length) {\n throw earlyReturnException;\n }\n },\n onObjectEnd: function (offset, length) {\n if (position <= offset) {\n throw earlyReturnException;\n }\n previousNode = void 0;\n segments.pop();\n },\n onArrayBegin: function (offset, length) {\n if (position <= offset) {\n throw earlyReturnException;\n }\n previousNode = void 0;\n segments.push(0);\n },\n onArrayEnd: function (offset, length) {\n if (position <= offset) {\n throw earlyReturnException;\n }\n previousNode = void 0;\n segments.pop();\n },\n onLiteralValue: function (value, offset, length) {\n if (position < offset) {\n throw earlyReturnException;\n }\n setPreviousNode(value, offset, length, getLiteralNodeType(value));\n if (position <= offset + length) {\n throw earlyReturnException;\n }\n },\n onSeparator: function (sep, offset, length) {\n if (position <= offset) {\n throw earlyReturnException;\n }\n if (sep === ':' && previousNode && previousNode.type === 'property') {\n previousNode.colonOffset = offset;\n isAtPropertyKey = false;\n previousNode = void 0;\n }\n else if (sep === ',') {\n var last = segments[segments.length - 1];\n if (typeof last === 'number') {\n segments[segments.length - 1] = last + 1;\n }\n else {\n isAtPropertyKey = true;\n segments[segments.length - 1] = '';\n }\n previousNode = void 0;\n }\n }\n });\n }\n catch (e) {\n if (e !== earlyReturnException) {\n throw e;\n }\n }\n return {\n path: segments,\n previousNode: previousNode,\n isAtPropertyKey: isAtPropertyKey,\n matches: function (pattern) {\n var k = 0;\n for (var i = 0; k < pattern.length && i < segments.length; i++) {\n if (pattern[k] === segments[i] || pattern[k] === '*') {\n k++;\n }\n else if (pattern[k] !== '**') {\n return false;\n }\n }\n return k === pattern.length;\n }\n };\n}", "decode(text){\n return new DOMParser().parseFromString(text,\"text/html\").documentElement.textContent;\n }", "function parse(value, settings) {\n var additional = settings.additional\n var nonTerminated = settings.nonTerminated\n var handleText = settings.text\n var handleReference = settings.reference\n var handleWarning = settings.warning\n var textContext = settings.textContext\n var referenceContext = settings.referenceContext\n var warningContext = settings.warningContext\n var pos = settings.position\n var indent = settings.indent || []\n var length = value.length\n var index = 0\n var lines = -1\n var column = pos.column || 1\n var line = pos.line || 1\n var queue = ''\n var result = []\n var entityCharacters\n var namedEntity\n var terminated\n var characters\n var character\n var reference\n var following\n var warning\n var reason\n var output\n var entity\n var begin\n var start\n var type\n var test\n var prev\n var next\n var diff\n var end\n\n if (typeof additional === 'string') {\n additional = additional.charCodeAt(0)\n }\n\n // Cache the current point.\n prev = now()\n\n // Wrap `handleWarning`.\n warning = handleWarning ? parseError : noop\n\n // Ensure the algorithm walks over the first character and the end (inclusive).\n index--\n length++\n\n while (++index < length) {\n // If the previous character was a newline.\n if (character === lineFeed) {\n column = indent[lines] || 1\n }\n\n character = value.charCodeAt(index)\n\n if (character === ampersand) {\n following = value.charCodeAt(index + 1)\n\n // The behaviour depends on the identity of the next character.\n if (\n following === tab ||\n following === lineFeed ||\n following === formFeed ||\n following === space ||\n following === ampersand ||\n following === lessThan ||\n following !== following ||\n (additional && following === additional)\n ) {\n // Not a character reference.\n // No characters are consumed, and nothing is returned.\n // This is not an error, either.\n queue += fromCharCode(character)\n column++\n\n continue\n }\n\n start = index + 1\n begin = start\n end = start\n\n if (following === numberSign) {\n // Numerical entity.\n end = ++begin\n\n // The behaviour further depends on the next character.\n following = value.charCodeAt(end)\n\n if (following === uppercaseX || following === lowercaseX) {\n // ASCII hex digits.\n type = hexa\n end = ++begin\n } else {\n // ASCII digits.\n type = deci\n }\n } else {\n // Named entity.\n type = name\n }\n\n entityCharacters = ''\n entity = ''\n characters = ''\n test = tests[type]\n end--\n\n while (++end < length) {\n following = value.charCodeAt(end)\n\n if (!test(following)) {\n break\n }\n\n characters += fromCharCode(following)\n\n // Check if we can match a legacy named reference.\n // If so, we cache that as the last viable named reference.\n // This ensures we do not need to walk backwards later.\n if (type === name && own.call(legacy, characters)) {\n entityCharacters = characters\n entity = legacy[characters]\n }\n }\n\n terminated = value.charCodeAt(end) === semicolon\n\n if (terminated) {\n end++\n\n namedEntity = type === name ? decodeEntity(characters) : false\n\n if (namedEntity) {\n entityCharacters = characters\n entity = namedEntity\n }\n }\n\n diff = 1 + end - start\n\n if (!terminated && !nonTerminated) {\n // Empty.\n } else if (!characters) {\n // An empty (possible) entity is valid, unless it’s numeric (thus an\n // ampersand followed by an octothorp).\n if (type !== name) {\n warning(numericEmpty, diff)\n }\n } else if (type === name) {\n // An ampersand followed by anything unknown, and not terminated, is\n // invalid.\n if (terminated && !entity) {\n warning(namedUnknown, 1)\n } else {\n // If theres something after an entity name which is not known, cap\n // the reference.\n if (entityCharacters !== characters) {\n end = begin + entityCharacters.length\n diff = 1 + end - begin\n terminated = false\n }\n\n // If the reference is not terminated, warn.\n if (!terminated) {\n reason = entityCharacters ? namedNotTerminated : namedEmpty\n\n if (settings.attribute) {\n following = value.charCodeAt(end)\n\n if (following === equalsTo) {\n warning(reason, diff)\n entity = null\n } else if (alphanumerical(following)) {\n entity = null\n } else {\n warning(reason, diff)\n }\n } else {\n warning(reason, diff)\n }\n }\n }\n\n reference = entity\n } else {\n if (!terminated) {\n // All non-terminated numeric entities are not rendered, and trigger a\n // warning.\n warning(numericNotTerminated, diff)\n }\n\n // When terminated and number, parse as either hexadecimal or decimal.\n reference = parseInt(characters, bases[type])\n\n // Trigger a warning when the parsed number is prohibited, and replace\n // with replacement character.\n if (prohibited(reference)) {\n warning(numericProhibited, diff)\n reference = fromCharCode(replacementCharacter)\n } else if (reference in invalid) {\n // Trigger a warning when the parsed number is disallowed, and replace\n // by an alternative.\n warning(numericDisallowed, diff)\n reference = invalid[reference]\n } else {\n // Parse the number.\n output = ''\n\n // Trigger a warning when the parsed number should not be used.\n if (disallowed(reference)) {\n warning(numericDisallowed, diff)\n }\n\n // Stringify the number.\n if (reference > 0xffff) {\n reference -= 0x10000\n output += fromCharCode((reference >>> (10 & 0x3ff)) | 0xd800)\n reference = 0xdc00 | (reference & 0x3ff)\n }\n\n reference = output + fromCharCode(reference)\n }\n }\n\n // Found it!\n // First eat the queued characters as normal text, then eat an entity.\n if (reference) {\n flush()\n\n prev = now()\n index = end - 1\n column += end - start + 1\n result.push(reference)\n next = now()\n next.offset++\n\n if (handleReference) {\n handleReference.call(\n referenceContext,\n reference,\n {start: prev, end: next},\n value.slice(start - 1, end)\n )\n }\n\n prev = next\n } else {\n // If we could not find a reference, queue the checked characters (as\n // normal characters), and move the pointer to their end.\n // This is possible because we can be certain neither newlines nor\n // ampersands are included.\n characters = value.slice(start - 1, end)\n queue += characters\n column += characters.length\n index = end - 1\n }\n } else {\n // Handle anything other than an ampersand, including newlines and EOF.\n if (\n character === 10 // Line feed\n ) {\n line++\n lines++\n column = 0\n }\n\n if (character === character) {\n queue += fromCharCode(character)\n column++\n } else {\n flush()\n }\n }\n }\n\n // Return the reduced nodes, and any possible warnings.\n return result.join('')\n\n // Get current position.\n function now() {\n return {\n line: line,\n column: column,\n offset: index + (pos.offset || 0)\n }\n }\n\n // “Throw” a parse-error: a warning.\n function parseError(code, offset) {\n var position = now()\n\n position.column += offset\n position.offset += offset\n\n handleWarning.call(warningContext, messages[code], position, code)\n }\n\n // Flush `queue` (normal text).\n // Macro invoked before each entity and at the end of `value`.\n // Does nothing when `queue` is empty.\n function flush() {\n if (queue) {\n result.push(queue)\n\n if (handleText) {\n handleText.call(textContext, queue, {start: prev, end: now()})\n }\n\n queue = ''\n }\n }\n}", "function parse(value, settings) {\n var additional = settings.additional\n var nonTerminated = settings.nonTerminated\n var handleText = settings.text\n var handleReference = settings.reference\n var handleWarning = settings.warning\n var textContext = settings.textContext\n var referenceContext = settings.referenceContext\n var warningContext = settings.warningContext\n var pos = settings.position\n var indent = settings.indent || []\n var length = value.length\n var index = 0\n var lines = -1\n var column = pos.column || 1\n var line = pos.line || 1\n var queue = ''\n var result = []\n var entityCharacters\n var namedEntity\n var terminated\n var characters\n var character\n var reference\n var following\n var warning\n var reason\n var output\n var entity\n var begin\n var start\n var type\n var test\n var prev\n var next\n var diff\n var end\n\n if (typeof additional === 'string') {\n additional = additional.charCodeAt(0)\n }\n\n // Cache the current point.\n prev = now()\n\n // Wrap `handleWarning`.\n warning = handleWarning ? parseError : noop\n\n // Ensure the algorithm walks over the first character and the end (inclusive).\n index--\n length++\n\n while (++index < length) {\n // If the previous character was a newline.\n if (character === lineFeed) {\n column = indent[lines] || 1\n }\n\n character = value.charCodeAt(index)\n\n if (character === ampersand) {\n following = value.charCodeAt(index + 1)\n\n // The behaviour depends on the identity of the next character.\n if (\n following === tab ||\n following === lineFeed ||\n following === formFeed ||\n following === space ||\n following === ampersand ||\n following === lessThan ||\n following !== following ||\n (additional && following === additional)\n ) {\n // Not a character reference.\n // No characters are consumed, and nothing is returned.\n // This is not an error, either.\n queue += fromCharCode(character)\n column++\n\n continue\n }\n\n start = index + 1\n begin = start\n end = start\n\n if (following === numberSign) {\n // Numerical entity.\n end = ++begin\n\n // The behaviour further depends on the next character.\n following = value.charCodeAt(end)\n\n if (following === uppercaseX || following === lowercaseX) {\n // ASCII hex digits.\n type = hexa\n end = ++begin\n } else {\n // ASCII digits.\n type = deci\n }\n } else {\n // Named entity.\n type = name\n }\n\n entityCharacters = ''\n entity = ''\n characters = ''\n test = tests[type]\n end--\n\n while (++end < length) {\n following = value.charCodeAt(end)\n\n if (!test(following)) {\n break\n }\n\n characters += fromCharCode(following)\n\n // Check if we can match a legacy named reference.\n // If so, we cache that as the last viable named reference.\n // This ensures we do not need to walk backwards later.\n if (type === name && own.call(legacy, characters)) {\n entityCharacters = characters\n entity = legacy[characters]\n }\n }\n\n terminated = value.charCodeAt(end) === semicolon\n\n if (terminated) {\n end++\n\n namedEntity = type === name ? decodeEntity(characters) : false\n\n if (namedEntity) {\n entityCharacters = characters\n entity = namedEntity\n }\n }\n\n diff = 1 + end - start\n\n if (!terminated && !nonTerminated) {\n // Empty.\n } else if (!characters) {\n // An empty (possible) entity is valid, unless it’s numeric (thus an\n // ampersand followed by an octothorp).\n if (type !== name) {\n warning(numericEmpty, diff)\n }\n } else if (type === name) {\n // An ampersand followed by anything unknown, and not terminated, is\n // invalid.\n if (terminated && !entity) {\n warning(namedUnknown, 1)\n } else {\n // If theres something after an entity name which is not known, cap\n // the reference.\n if (entityCharacters !== characters) {\n end = begin + entityCharacters.length\n diff = 1 + end - begin\n terminated = false\n }\n\n // If the reference is not terminated, warn.\n if (!terminated) {\n reason = entityCharacters ? namedNotTerminated : namedEmpty\n\n if (settings.attribute) {\n following = value.charCodeAt(end)\n\n if (following === equalsTo) {\n warning(reason, diff)\n entity = null\n } else if (alphanumerical(following)) {\n entity = null\n } else {\n warning(reason, diff)\n }\n } else {\n warning(reason, diff)\n }\n }\n }\n\n reference = entity\n } else {\n if (!terminated) {\n // All non-terminated numeric entities are not rendered, and trigger a\n // warning.\n warning(numericNotTerminated, diff)\n }\n\n // When terminated and number, parse as either hexadecimal or decimal.\n reference = parseInt(characters, bases[type])\n\n // Trigger a warning when the parsed number is prohibited, and replace\n // with replacement character.\n if (prohibited(reference)) {\n warning(numericProhibited, diff)\n reference = fromCharCode(replacementCharacter)\n } else if (reference in invalid) {\n // Trigger a warning when the parsed number is disallowed, and replace\n // by an alternative.\n warning(numericDisallowed, diff)\n reference = invalid[reference]\n } else {\n // Parse the number.\n output = ''\n\n // Trigger a warning when the parsed number should not be used.\n if (disallowed(reference)) {\n warning(numericDisallowed, diff)\n }\n\n // Stringify the number.\n if (reference > 0xffff) {\n reference -= 0x10000\n output += fromCharCode((reference >>> (10 & 0x3ff)) | 0xd800)\n reference = 0xdc00 | (reference & 0x3ff)\n }\n\n reference = output + fromCharCode(reference)\n }\n }\n\n // Found it!\n // First eat the queued characters as normal text, then eat an entity.\n if (reference) {\n flush()\n\n prev = now()\n index = end - 1\n column += end - start + 1\n result.push(reference)\n next = now()\n next.offset++\n\n if (handleReference) {\n handleReference.call(\n referenceContext,\n reference,\n {start: prev, end: next},\n value.slice(start - 1, end)\n )\n }\n\n prev = next\n } else {\n // If we could not find a reference, queue the checked characters (as\n // normal characters), and move the pointer to their end.\n // This is possible because we can be certain neither newlines nor\n // ampersands are included.\n characters = value.slice(start - 1, end)\n queue += characters\n column += characters.length\n index = end - 1\n }\n } else {\n // Handle anything other than an ampersand, including newlines and EOF.\n if (\n character === 10 // Line feed\n ) {\n line++\n lines++\n column = 0\n }\n\n if (character === character) {\n queue += fromCharCode(character)\n column++\n } else {\n flush()\n }\n }\n }\n\n // Return the reduced nodes, and any possible warnings.\n return result.join('')\n\n // Get current position.\n function now() {\n return {\n line: line,\n column: column,\n offset: index + (pos.offset || 0)\n }\n }\n\n // “Throw” a parse-error: a warning.\n function parseError(code, offset) {\n var position = now()\n\n position.column += offset\n position.offset += offset\n\n handleWarning.call(warningContext, messages[code], position, code)\n }\n\n // Flush `queue` (normal text).\n // Macro invoked before each entity and at the end of `value`.\n // Does nothing when `queue` is empty.\n function flush() {\n if (queue) {\n result.push(queue)\n\n if (handleText) {\n handleText.call(textContext, queue, {start: prev, end: now()})\n }\n\n queue = ''\n }\n }\n}", "function parse() {\n var self = this\n var value = String(self.file)\n var start = {line: 1, column: 1, offset: 0}\n var content = xtend(start)\n var node\n\n // Clean non-unix newlines: `\\r\\n` and `\\r` are all changed to `\\n`.\n // This should not affect positional information.\n value = value.replace(lineBreaksExpression, lineFeed)\n\n // BOM.\n if (value.charCodeAt(0) === 0xfeff) {\n value = value.slice(1)\n\n content.column++\n content.offset++\n }\n\n node = {\n type: 'root',\n children: self.tokenizeBlock(value, content),\n position: {start: start, end: self.eof || xtend(start)}\n }\n\n if (!self.options.position) {\n removePosition(node, true)\n }\n\n return node\n}", "function parse(value, settings) {\n var additional = settings.additional\n var nonTerminated = settings.nonTerminated\n var handleText = settings.text\n var handleReference = settings.reference\n var handleWarning = settings.warning\n var textContext = settings.textContext\n var referenceContext = settings.referenceContext\n var warningContext = settings.warningContext\n var pos = settings.position\n var indent = settings.indent || []\n var length = value.length\n var index = 0\n var lines = -1\n var column = pos.column || 1\n var line = pos.line || 1\n var queue = ''\n var result = []\n var entityCharacters\n var namedEntity\n var terminated\n var characters\n var character\n var reference\n var following\n var warning\n var reason\n var output\n var entity\n var begin\n var start\n var type\n var test\n var prev\n var next\n var diff\n var end\n\n if (typeof additional === 'string') {\n additional = additional.charCodeAt(0)\n }\n\n // Cache the current point.\n prev = now()\n\n // Wrap `handleWarning`.\n warning = handleWarning ? parseError : noop\n\n // Ensure the algorithm walks over the first character and the end\n // (inclusive).\n index--\n length++\n\n while (++index < length) {\n // If the previous character was a newline.\n if (character === lineFeed) {\n column = indent[lines] || 1\n }\n\n character = value.charCodeAt(index)\n\n if (character === ampersand) {\n following = value.charCodeAt(index + 1)\n\n // The behaviour depends on the identity of the next character.\n if (\n following === tab ||\n following === lineFeed ||\n following === formFeed ||\n following === space ||\n following === ampersand ||\n following === lessThan ||\n following !== following ||\n (additional && following === additional)\n ) {\n // Not a character reference.\n // No characters are consumed, and nothing is returned.\n // This is not an error, either.\n queue += fromCharCode(character)\n column++\n\n continue\n }\n\n start = index + 1\n begin = start\n end = start\n\n if (following === numberSign) {\n // Numerical entity.\n end = ++begin\n\n // The behaviour further depends on the next character.\n following = value.charCodeAt(end)\n\n if (following === uppercaseX || following === lowercaseX) {\n // ASCII hex digits.\n type = hexa\n end = ++begin\n } else {\n // ASCII digits.\n type = deci\n }\n } else {\n // Named entity.\n type = name\n }\n\n entityCharacters = ''\n entity = ''\n characters = ''\n test = tests[type]\n end--\n\n while (++end < length) {\n following = value.charCodeAt(end)\n\n if (!test(following)) {\n break\n }\n\n characters += fromCharCode(following)\n\n // Check if we can match a legacy named reference.\n // If so, we cache that as the last viable named reference.\n // This ensures we do not need to walk backwards later.\n if (type === name && own.call(legacy, characters)) {\n entityCharacters = characters\n entity = legacy[characters]\n }\n }\n\n terminated = value.charCodeAt(end) === semicolon\n\n if (terminated) {\n end++\n\n namedEntity = type === name ? decodeEntity(characters) : false\n\n if (namedEntity) {\n entityCharacters = characters\n entity = namedEntity\n }\n }\n\n diff = 1 + end - start\n\n if (!terminated && !nonTerminated) {\n // Empty.\n } else if (!characters) {\n // An empty (possible) entity is valid, unless it’s numeric (thus an\n // ampersand followed by an octothorp).\n if (type !== name) {\n warning(numericEmpty, diff)\n }\n } else if (type === name) {\n // An ampersand followed by anything unknown, and not terminated, is\n // invalid.\n if (terminated && !entity) {\n warning(namedUnknown, 1)\n } else {\n // If theres something after an entity name which is not known, cap\n // the reference.\n if (entityCharacters !== characters) {\n end = begin + entityCharacters.length\n diff = 1 + end - begin\n terminated = false\n }\n\n // If the reference is not terminated, warn.\n if (!terminated) {\n reason = entityCharacters ? namedNotTerminated : namedEmpty\n\n if (settings.attribute) {\n following = value.charCodeAt(end)\n\n if (following === equalsTo) {\n warning(reason, diff)\n entity = null\n } else if (alphanumerical(following)) {\n entity = null\n } else {\n warning(reason, diff)\n }\n } else {\n warning(reason, diff)\n }\n }\n }\n\n reference = entity\n } else {\n if (!terminated) {\n // All non-terminated numeric entities are not rendered, and trigger a\n // warning.\n warning(numericNotTerminated, diff)\n }\n\n // When terminated and number, parse as either hexadecimal or decimal.\n reference = parseInt(characters, bases[type])\n\n // Trigger a warning when the parsed number is prohibited, and replace\n // with replacement character.\n if (prohibited(reference)) {\n warning(numericProhibited, diff)\n reference = fromCharCode(replacementCharacter)\n } else if (reference in invalid) {\n // Trigger a warning when the parsed number is disallowed, and replace\n // by an alternative.\n warning(numericDisallowed, diff)\n reference = invalid[reference]\n } else {\n // Parse the number.\n output = ''\n\n // Trigger a warning when the parsed number should not be used.\n if (disallowed(reference)) {\n warning(numericDisallowed, diff)\n }\n\n // Stringify the number.\n if (reference > 0xffff) {\n reference -= 0x10000\n output += fromCharCode((reference >>> (10 & 0x3ff)) | 0xd800)\n reference = 0xdc00 | (reference & 0x3ff)\n }\n\n reference = output + fromCharCode(reference)\n }\n }\n\n // Found it!\n // First eat the queued characters as normal text, then eat an entity.\n if (reference) {\n flush()\n\n prev = now()\n index = end - 1\n column += end - start + 1\n result.push(reference)\n next = now()\n next.offset++\n\n if (handleReference) {\n handleReference.call(\n referenceContext,\n reference,\n {start: prev, end: next},\n value.slice(start - 1, end)\n )\n }\n\n prev = next\n } else {\n // If we could not find a reference, queue the checked characters (as\n // normal characters), and move the pointer to their end.\n // This is possible because we can be certain neither newlines nor\n // ampersands are included.\n characters = value.slice(start - 1, end)\n queue += characters\n column += characters.length\n index = end - 1\n }\n } else {\n // Handle anything other than an ampersand, including newlines and EOF.\n if (\n character === 10 // Line feed\n ) {\n line++\n lines++\n column = 0\n }\n\n if (character === character) {\n queue += fromCharCode(character)\n column++\n } else {\n flush()\n }\n }\n }\n\n // Return the reduced nodes.\n return result.join('')\n\n // Get current position.\n function now() {\n return {\n line: line,\n column: column,\n offset: index + (pos.offset || 0)\n }\n }\n\n // “Throw” a parse-error: a warning.\n function parseError(code, offset) {\n var position = now()\n\n position.column += offset\n position.offset += offset\n\n handleWarning.call(warningContext, messages[code], position, code)\n }\n\n // Flush `queue` (normal text).\n // Macro invoked before each entity and at the end of `value`.\n // Does nothing when `queue` is empty.\n function flush() {\n if (queue) {\n result.push(queue)\n\n if (handleText) {\n handleText.call(textContext, queue, {start: prev, end: now()})\n }\n\n queue = ''\n }\n }\n}", "function parse(value, settings) {\n var additional = settings.additional\n var nonTerminated = settings.nonTerminated\n var handleText = settings.text\n var handleReference = settings.reference\n var handleWarning = settings.warning\n var textContext = settings.textContext\n var referenceContext = settings.referenceContext\n var warningContext = settings.warningContext\n var pos = settings.position\n var indent = settings.indent || []\n var length = value.length\n var index = 0\n var lines = -1\n var column = pos.column || 1\n var line = pos.line || 1\n var queue = ''\n var result = []\n var entityCharacters\n var namedEntity\n var terminated\n var characters\n var character\n var reference\n var following\n var warning\n var reason\n var output\n var entity\n var begin\n var start\n var type\n var test\n var prev\n var next\n var diff\n var end\n\n if (typeof additional === 'string') {\n additional = additional.charCodeAt(0)\n }\n\n // Cache the current point.\n prev = now()\n\n // Wrap `handleWarning`.\n warning = handleWarning ? parseError : noop\n\n // Ensure the algorithm walks over the first character and the end\n // (inclusive).\n index--\n length++\n\n while (++index < length) {\n // If the previous character was a newline.\n if (character === lineFeed) {\n column = indent[lines] || 1\n }\n\n character = value.charCodeAt(index)\n\n if (character === ampersand) {\n following = value.charCodeAt(index + 1)\n\n // The behaviour depends on the identity of the next character.\n if (\n following === tab ||\n following === lineFeed ||\n following === formFeed ||\n following === space ||\n following === ampersand ||\n following === lessThan ||\n following !== following ||\n (additional && following === additional)\n ) {\n // Not a character reference.\n // No characters are consumed, and nothing is returned.\n // This is not an error, either.\n queue += fromCharCode(character)\n column++\n\n continue\n }\n\n start = index + 1\n begin = start\n end = start\n\n if (following === numberSign) {\n // Numerical entity.\n end = ++begin\n\n // The behaviour further depends on the next character.\n following = value.charCodeAt(end)\n\n if (following === uppercaseX || following === lowercaseX) {\n // ASCII hex digits.\n type = hexa\n end = ++begin\n } else {\n // ASCII digits.\n type = deci\n }\n } else {\n // Named entity.\n type = name\n }\n\n entityCharacters = ''\n entity = ''\n characters = ''\n test = tests[type]\n end--\n\n while (++end < length) {\n following = value.charCodeAt(end)\n\n if (!test(following)) {\n break\n }\n\n characters += fromCharCode(following)\n\n // Check if we can match a legacy named reference.\n // If so, we cache that as the last viable named reference.\n // This ensures we do not need to walk backwards later.\n if (type === name && own.call(legacy, characters)) {\n entityCharacters = characters\n entity = legacy[characters]\n }\n }\n\n terminated = value.charCodeAt(end) === semicolon\n\n if (terminated) {\n end++\n\n namedEntity = type === name ? decodeEntity(characters) : false\n\n if (namedEntity) {\n entityCharacters = characters\n entity = namedEntity\n }\n }\n\n diff = 1 + end - start\n\n if (!terminated && !nonTerminated) {\n // Empty.\n } else if (!characters) {\n // An empty (possible) entity is valid, unless it’s numeric (thus an\n // ampersand followed by an octothorp).\n if (type !== name) {\n warning(numericEmpty, diff)\n }\n } else if (type === name) {\n // An ampersand followed by anything unknown, and not terminated, is\n // invalid.\n if (terminated && !entity) {\n warning(namedUnknown, 1)\n } else {\n // If theres something after an entity name which is not known, cap\n // the reference.\n if (entityCharacters !== characters) {\n end = begin + entityCharacters.length\n diff = 1 + end - begin\n terminated = false\n }\n\n // If the reference is not terminated, warn.\n if (!terminated) {\n reason = entityCharacters ? namedNotTerminated : namedEmpty\n\n if (settings.attribute) {\n following = value.charCodeAt(end)\n\n if (following === equalsTo) {\n warning(reason, diff)\n entity = null\n } else if (alphanumerical(following)) {\n entity = null\n } else {\n warning(reason, diff)\n }\n } else {\n warning(reason, diff)\n }\n }\n }\n\n reference = entity\n } else {\n if (!terminated) {\n // All non-terminated numeric entities are not rendered, and trigger a\n // warning.\n warning(numericNotTerminated, diff)\n }\n\n // When terminated and number, parse as either hexadecimal or decimal.\n reference = parseInt(characters, bases[type])\n\n // Trigger a warning when the parsed number is prohibited, and replace\n // with replacement character.\n if (prohibited(reference)) {\n warning(numericProhibited, diff)\n reference = fromCharCode(replacementCharacter)\n } else if (reference in invalid) {\n // Trigger a warning when the parsed number is disallowed, and replace\n // by an alternative.\n warning(numericDisallowed, diff)\n reference = invalid[reference]\n } else {\n // Parse the number.\n output = ''\n\n // Trigger a warning when the parsed number should not be used.\n if (disallowed(reference)) {\n warning(numericDisallowed, diff)\n }\n\n // Stringify the number.\n if (reference > 0xffff) {\n reference -= 0x10000\n output += fromCharCode((reference >>> (10 & 0x3ff)) | 0xd800)\n reference = 0xdc00 | (reference & 0x3ff)\n }\n\n reference = output + fromCharCode(reference)\n }\n }\n\n // Found it!\n // First eat the queued characters as normal text, then eat an entity.\n if (reference) {\n flush()\n\n prev = now()\n index = end - 1\n column += end - start + 1\n result.push(reference)\n next = now()\n next.offset++\n\n if (handleReference) {\n handleReference.call(\n referenceContext,\n reference,\n {start: prev, end: next},\n value.slice(start - 1, end)\n )\n }\n\n prev = next\n } else {\n // If we could not find a reference, queue the checked characters (as\n // normal characters), and move the pointer to their end.\n // This is possible because we can be certain neither newlines nor\n // ampersands are included.\n characters = value.slice(start - 1, end)\n queue += characters\n column += characters.length\n index = end - 1\n }\n } else {\n // Handle anything other than an ampersand, including newlines and EOF.\n if (\n character === 10 // Line feed\n ) {\n line++\n lines++\n column = 0\n }\n\n if (character === character) {\n queue += fromCharCode(character)\n column++\n } else {\n flush()\n }\n }\n }\n\n // Return the reduced nodes.\n return result.join('')\n\n // Get current position.\n function now() {\n return {\n line: line,\n column: column,\n offset: index + (pos.offset || 0)\n }\n }\n\n // “Throw” a parse-error: a warning.\n function parseError(code, offset) {\n var position = now()\n\n position.column += offset\n position.offset += offset\n\n handleWarning.call(warningContext, messages[code], position, code)\n }\n\n // Flush `queue` (normal text).\n // Macro invoked before each entity and at the end of `value`.\n // Does nothing when `queue` is empty.\n function flush() {\n if (queue) {\n result.push(queue)\n\n if (handleText) {\n handleText.call(textContext, queue, {start: prev, end: now()})\n }\n\n queue = ''\n }\n }\n}", "text(text2, marks) {\n let type = this.nodes.text;\n return new TextNode(type, type.defaultAttrs, text2, Mark$1.setFrom(marks));\n }", "function transformTextNodes(node) {\n node.childNodes.forEach((n)=>{\n console.log(n);\n if(n.nodeName === \"#text\"){\n console.log(n.nodeValue);\n n.nodeValue = n.nodeValue.split(\" \")\n .map((text)=>{\n if (!text.trim()) return text;\n // console.log(\"text =\" + text);\n if(text[text.length-1] == '\\n'){\n tmp = text.substr(0,text.length-1);\n return MATCH_LIST[tmp]?`${MATCH_LIST[tmp]}\\n`:text;\n }else{\n tmp = text;\n return MATCH_LIST[tmp]?`${MATCH_LIST[tmp]}`:text;\n }\n })\n .join(\" \");\n // console.log(node);\n }else{\n transformTextNodes(n);\n }\n })\n}", "function handleValue(value) {\n // when the value is an empty string reset the sprite position and remove the existing articles, if any\n if (!value) {\n svg.setAttribute('viewBox', '0 0 21 31');\n section.innerHTML = '';\n } else {\n // else create a regex out of the string and find filter the data array according to a possible match\n const possibleMatch = value;\n const regexPossibleMatch = new RegExp(possibleMatch, 'i');\n const matches = data.filter(({ name }) => regexPossibleMatch.test(name));\n // call the function to display the matches and highlight the matching value\n displayMatches(possibleMatch, matches);\n }\n}", "function text(index,value){var lView=getLView();ngDevMode&&assertEqual(lView[BINDING_INDEX],lView[TVIEW].bindingStartIndex,'text nodes should be created before any bindings');ngDevMode&&ngDevMode.rendererCreateTextNode++;var textNative=createTextNode(value,lView[RENDERER]);var tNode=createNodeAtIndex(index,3/* Element */,textNative,null,null);// Text nodes are self closing.\nsetIsParent(false);appendChild(textNative,tNode,lView);}", "function decodeValue (value, options) {\n return getValueEncoder(options).decode(value)\n}", "function decodeValue (value, options) {\n return getValueEncoder(options).decode(value)\n}", "nodeAt(pos) {\n for (let node = this; ; ) {\n let { index, offset } = node.content.findIndex(pos);\n node = node.maybeChild(index);\n if (!node)\n return null;\n if (offset == pos || node.isText)\n return node;\n pos -= offset + 1;\n }\n }", "text(node) {\n let oldValue;\n const textContent = value => {\n if (oldValue !== value) {\n oldValue = value;\n const type = typeof value;\n if (type === 'object' && value) {\n if ('text' in value) {\n textContent(String(value.text));\n } else if ('any' in value) {\n textContent(value.any);\n } else if ('html' in value) {\n textContent([].concat(value.html).join(''));\n } else if ('length' in value) {\n textContent(slice.call(value).join(''));\n }\n } else if (type === 'function') {\n textContent(value(node));\n } else {\n node.textContent = value == null ? '' : value;\n }\n }\n };\n return textContent;\n }", "toText() {\n let m = this\n let res = m.map(val => {\n if (val.has('#TextValue')) {\n return val\n }\n let obj = parse(val)\n if (obj.num === null) {\n return val\n }\n let fmt = val.has('#Ordinal') ? 'TextOrdinal' : 'TextCardinal'\n let str = format(obj, fmt)\n val.replaceWith(str, { tags: true })\n val.tag('TextValue')\n return val\n })\n return new Numbers(res.document, res.pointer)\n }", "get textContent() {\n return this.isLeaf && this.type.spec.leafText ? this.type.spec.leafText(this) : this.textBetween(0, this.content.size, \"\");\n }", "function fromNodeOffset(node, offset) {\n if (node.nodeType === 3) {\n return text(node, offset);\n }\n\n if (offset === node.childNodes.length) {\n return end(node);\n }\n\n assert(offset >= 0 && offset < node.childNodes.length,\n 'invalid offset for', node, offset);\n\n return before(node.childNodes[offset]);\n}", "function hasTextValue(value) {\n return function (node) {\n return util_1.getTextContent(node) === value;\n };\n}", "getNodeValue() {}", "function convertFromText(c) {\n c.t = 'text0';\n var o = {p: c.p.pop()};\n if (c.si != null) o.i = c.si;\n if (c.sd != null) o.d = c.sd;\n c.o = [o];\n}", "get value(){\n return this.nodeValue;\n }", "get value(){\n return this.nodeValue;\n }", "function valueToNode(value) {\n\t // undefined\n\t if (value === undefined) {\n\t return t.identifier(\"undefined\");\n\t }\n\n\t // null, booleans, strings, numbers, regexs\n\t if (value === true || value === false || value === null || _lodashLangIsString2[\"default\"](value) || _lodashLangIsNumber2[\"default\"](value) || _lodashLangIsRegExp2[\"default\"](value)) {\n\t return t.literal(value);\n\t }\n\n\t // array\n\t if (Array.isArray(value)) {\n\t return t.arrayExpression(value.map(t.valueToNode));\n\t }\n\n\t // object\n\t if (_lodashLangIsPlainObject2[\"default\"](value)) {\n\t var props = [];\n\t for (var key in value) {\n\t var nodeKey;\n\t if (t.isValidIdentifier(key)) {\n\t nodeKey = t.identifier(key);\n\t } else {\n\t nodeKey = t.literal(key);\n\t }\n\t props.push(t.property(\"init\", nodeKey, t.valueToNode(value[key])));\n\t }\n\t return t.objectExpression(props);\n\t }\n\n\t throw new Error(\"don't know how to turn this value into a node\");\n\t}", "function valueToNode(value) {\n\t // undefined\n\t if (value === undefined) {\n\t return t.identifier(\"undefined\");\n\t }\n\n\t // null, booleans, strings, numbers, regexs\n\t if (value === true || value === false || value === null || _lodashLangIsString2[\"default\"](value) || _lodashLangIsNumber2[\"default\"](value) || _lodashLangIsRegExp2[\"default\"](value)) {\n\t return t.literal(value);\n\t }\n\n\t // array\n\t if (Array.isArray(value)) {\n\t return t.arrayExpression(value.map(t.valueToNode));\n\t }\n\n\t // object\n\t if (_lodashLangIsPlainObject2[\"default\"](value)) {\n\t var props = [];\n\t for (var key in value) {\n\t var nodeKey;\n\t if (t.isValidIdentifier(key)) {\n\t nodeKey = t.identifier(key);\n\t } else {\n\t nodeKey = t.literal(key);\n\t }\n\t props.push(t.property(\"init\", nodeKey, t.valueToNode(value[key])));\n\t }\n\t return t.objectExpression(props);\n\t }\n\n\t throw new Error(\"don't know how to turn this value into a node\");\n\t}", "nodeValue(e){\n var value = e.nodeName == '#text' ? e.data : e.innerHTML,\n value = value||'';\n\n return this.domPreparer.prepareTranslateHTML(value, e).trim();\n }", "StringValue(node) {\n return node.value;\n }", "function convertHtmlToText(value) {\n var d = document.createElement(\"div\");\n d.innerHTML = value;\n return d.innerText;\n}", "function valuetext(value) {\n return `${value}`;\n}", "function at(position) {\n return value.charAt(position);\n }", "function valueToNode(value) {\n // undefined\n if (value === undefined) {\n return t.identifier(\"undefined\");\n }\n\n // null, booleans, strings, numbers, regexs\n if (value === true || value === false || value === null || _lodashLangIsString2[\"default\"](value) || _lodashLangIsNumber2[\"default\"](value) || _lodashLangIsRegExp2[\"default\"](value)) {\n return t.literal(value);\n }\n\n // array\n if (Array.isArray(value)) {\n return t.arrayExpression(value.map(t.valueToNode));\n }\n\n // object\n if (_lodashLangIsPlainObject2[\"default\"](value)) {\n var props = [];\n for (var key in value) {\n var nodeKey;\n if (t.isValidIdentifier(key)) {\n nodeKey = t.identifier(key);\n } else {\n nodeKey = t.literal(key);\n }\n props.push(t.property(\"init\", nodeKey, t.valueToNode(value[key])));\n }\n return t.objectExpression(props);\n }\n\n throw new Error(\"don't know how to turn this value into a node\");\n}", "getTextPosition(hierarchicalIndex) {\n let textPosition = new TextPosition(this.owner);\n textPosition.setPositionForCurrentIndex(hierarchicalIndex);\n return textPosition;\n }", "function at(position) {\n return value.charAt(position)\n }", "function at(position) {\n return value.charAt(position)\n }", "function at(position) {\n return value.charAt(position)\n }", "function at(position) {\n return value.charAt(position)\n }", "function TextNode(text) {\n this.text = text;\n}", "function TextNode(text) {\n this.text = text;\n}", "function decode(text) {\n const el = document.createElement(\"div\");\n el.innerHTML = text;\n text = el.innerText;\n return text;\n }", "renderText(selector, value) {\n\t\tdocument.querySelector(selector).textContent = value;\n\t}", "function parseTextData(context, length, mode) {\n\t const rawText = context.source.slice(0, length);\n\t advanceBy(context, length);\n\t if (mode === 2 /* RAWTEXT */ ||\n\t mode === 3 /* CDATA */ ||\n\t rawText.indexOf('&') === -1) {\n\t return rawText;\n\t }\n\t else {\n\t // DATA or RCDATA containing \"&\"\". Entity decoding required.\n\t return context.options.decodeEntities(rawText, mode === 4 /* ATTRIBUTE_VALUE */);\n\t }\n\t}", "function htmlDecode(input){\n var e = document.createElement('span');\n e.innerHTML = input;\n return e.childNodes[0].nodeValue;\n}", "function parseTextData(context, length, mode) {\r\n const rawText = context.source.slice(0, length);\r\n advanceBy(context, length);\r\n if (mode === 2 /* RAWTEXT */ ||\r\n mode === 3 /* CDATA */ ||\r\n rawText.indexOf('&') === -1) {\r\n return rawText;\r\n }\r\n else {\r\n // DATA or RCDATA containing \"&\"\". Entity decoding required.\r\n return context.options.decodeEntities(rawText, mode === 4 /* ATTRIBUTE_VALUE */);\r\n }\r\n}", "function parseTextData(context, length, mode) {\r\n const rawText = context.source.slice(0, length);\r\n advanceBy(context, length);\r\n if (mode === 2 /* RAWTEXT */ ||\r\n mode === 3 /* CDATA */ ||\r\n rawText.indexOf('&') === -1) {\r\n return rawText;\r\n }\r\n else {\r\n // DATA or RCDATA containing \"&\"\". Entity decoding required.\r\n return context.options.decodeEntities(rawText, mode === 4 /* ATTRIBUTE_VALUE */);\r\n }\r\n}", "function text(textNode, offset) {\n return new Point(magic).moveToText(textNode, offset);\n}", "function decodeString(value) {\n var byteString = atob(value);\n var arr = new Uint8Array(byteString.length);\n for (var i = 0; i < byteString.length; i++) {\n arr[i] = byteString.charCodeAt(i);\n }\n return arr;\n }", "function parseTextData(context, length, mode) {\n const rawText = context.source.slice(0, length);\n advanceBy(context, length);\n if (mode === 2 /* RAWTEXT */ ||\n mode === 3 /* CDATA */ ||\n rawText.indexOf('&') === -1) {\n return rawText;\n }\n else {\n // DATA or RCDATA containing \"&\"\". Entity decoding required.\n return context.options.decodeEntities(rawText, mode === 4 /* ATTRIBUTE_VALUE */);\n }\n}", "function parseTextData(context, length, mode) {\n const rawText = context.source.slice(0, length);\n advanceBy(context, length);\n if (mode === 2 /* RAWTEXT */ ||\n mode === 3 /* CDATA */ ||\n rawText.indexOf('&') === -1) {\n return rawText;\n }\n else {\n // DATA or RCDATA containing \"&\"\". Entity decoding required.\n return context.options.decodeEntities(rawText, mode === 4 /* ATTRIBUTE_VALUE */);\n }\n}", "function parseTextData(context, length, mode) {\n const rawText = context.source.slice(0, length);\n advanceBy(context, length);\n if (mode === 2 /* RAWTEXT */ ||\n mode === 3 /* CDATA */ ||\n rawText.indexOf('&') === -1) {\n return rawText;\n }\n else {\n // DATA or RCDATA containing \"&\"\". Entity decoding required.\n return context.options.decodeEntities(rawText, mode === 4 /* ATTRIBUTE_VALUE */);\n }\n}", "function parseTextData(context, length, mode) {\n const rawText = context.source.slice(0, length);\n advanceBy(context, length);\n if (mode === 2 /* RAWTEXT */ ||\n mode === 3 /* CDATA */ ||\n rawText.indexOf('&') === -1) {\n return rawText;\n }\n else {\n // DATA or RCDATA containing \"&\"\". Entity decoding required.\n return context.options.decodeEntities(rawText, mode === 4 /* ATTRIBUTE_VALUE */);\n }\n}", "function parseTextData(context, length, mode) {\n const rawText = context.source.slice(0, length);\n advanceBy(context, length);\n if (mode === 2 /* RAWTEXT */ ||\n mode === 3 /* CDATA */ ||\n rawText.indexOf('&') === -1) {\n return rawText;\n }\n else {\n // DATA or RCDATA containing \"&\"\". Entity decoding required.\n return context.options.decodeEntities(rawText, mode === 4 /* ATTRIBUTE_VALUE */);\n }\n}", "function parseTextData(context, length, mode) {\n const rawText = context.source.slice(0, length);\n advanceBy(context, length);\n if (mode === 2 /* RAWTEXT */ ||\n mode === 3 /* CDATA */ ||\n rawText.indexOf('&') === -1) {\n return rawText;\n }\n else {\n // DATA or RCDATA containing \"&\"\". Entity decoding required.\n return context.options.decodeEntities(rawText, mode === 4 /* ATTRIBUTE_VALUE */);\n }\n}", "constructor(value){\n this.value = value;\n this.children = {};\n this.isWord = false;\n }", "function text(node, parent) {\n return this.encode(this.escape(node.value, node, parent), node);\n}" ]
[ "0.68267065", "0.65928215", "0.65928215", "0.65928215", "0.65928215", "0.65701926", "0.6540789", "0.6540789", "0.5573472", "0.55310106", "0.5367598", "0.5367598", "0.5343417", "0.5194319", "0.5164298", "0.5152497", "0.5152097", "0.5152097", "0.5152097", "0.5152097", "0.51495975", "0.51495975", "0.51352406", "0.51352406", "0.51352406", "0.5061262", "0.5051689", "0.5035118", "0.50243646", "0.501688", "0.501688", "0.501688", "0.501688", "0.501688", "0.501688", "0.501688", "0.501688", "0.501688", "0.4956681", "0.4956681", "0.49396026", "0.49161902", "0.49058336", "0.48991826", "0.48991826", "0.48986554", "0.48962203", "0.48962203", "0.4895479", "0.48917183", "0.48695755", "0.48126626", "0.4803078", "0.4803078", "0.4771952", "0.4752292", "0.474564", "0.47343367", "0.47196174", "0.4712308", "0.47111976", "0.4693304", "0.46613672", "0.46613672", "0.46600705", "0.46600705", "0.4648928", "0.46421745", "0.46305963", "0.46299914", "0.46244675", "0.46232095", "0.4613496", "0.46065226", "0.46065226", "0.46065226", "0.46065226", "0.46028575", "0.46028575", "0.46002188", "0.4594286", "0.4585996", "0.457073", "0.45609814", "0.45609814", "0.45520973", "0.45518866", "0.45437142", "0.45437142", "0.45437142", "0.45437142", "0.45437142", "0.45437142", "0.45427674", "0.4536762" ]
0.6817116
6
Decode `value` (at `position`) into a string.
function decodeRaw(value, position, options) { return entities(value, xtend(options, { position: normalize(position), warning: handleWarning })); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function decodeRaw(value, position) {\n return entities(value, {\n position: normalize(position),\n warning: handleWarning\n });\n }", "function decodeRaw(value, position) {\n return entities(value, {\n position: normalize(position),\n warning: handleWarning\n });\n }", "function decodeRaw(value, position, options) {\n return entities(\n value,\n xtend(options, {position: normalize(position), warning: handleWarning})\n )\n }", "function decoder(value, position, handler) {\n entities(value, {\n position: normalize(position),\n warning: handleWarning,\n text: handler,\n reference: handler,\n textContext: ctx,\n referenceContext: ctx\n })\n }", "function decoder(value, position, handler) {\n entities(value, {\n position: normalize(position),\n warning: handleWarning,\n text: handler,\n reference: handler,\n textContext: ctx,\n referenceContext: ctx\n });\n }", "function decoder(value, position, handler) {\n entities(value, {\n position: normalize(position),\n warning: handleWarning,\n text: handler,\n reference: handler,\n textContext: ctx,\n referenceContext: ctx\n });\n }", "function decoder(value, position, handler) {\n entities(value, {\n position: normalize(position),\n warning: handleWarning,\n text: handler,\n reference: handler,\n textContext: ctx,\n referenceContext: ctx\n });\n }", "function decoder(value, position, handler) {\n entities(value, {\n position: normalize(position),\n warning: handleWarning,\n text: handler,\n reference: handler,\n textContext: ctx,\n referenceContext: ctx\n });\n }", "function decoder(value, position, handler) {\n entities(value, {\n position: normalize(position),\n warning: handleWarning,\n text: handler,\n reference: handler,\n textContext: ctx,\n referenceContext: ctx\n });\n }", "function decoder(value, position, handler) {\n entities(value, {\n position: normalize(position),\n warning: handleWarning,\n text: handler,\n reference: handler,\n textContext: ctx,\n referenceContext: ctx\n });\n }", "function decodeValue (value, options) {\n return getValueEncoder(options).decode(value)\n}", "function decodeValue (value, options) {\n return getValueEncoder(options).decode(value)\n}", "function decodeValue(value) {\n if (value == null) {\n return null;\n }\n return value.replace(decodeLookupRegex, (m) => decodeMap[m] || \"\");\n}", "function at(position) {\n return value.charAt(position);\n }", "function at(position) {\n return value.charAt(position)\n }", "function at(position) {\n return value.charAt(position)\n }", "function at(position) {\n return value.charAt(position)\n }", "function at(position) {\n return value.charAt(position)\n }", "decodeValue(value) {\n return decodeURIComponent(value);\n }", "decodeValue(value) {\n return decodeURIComponent(value);\n }", "decodeValue(value) {\n return decodeURIComponent(value);\n }", "decodeValue(value) {\n return decodeURIComponent(value);\n }", "decodeValue(value) {\n return decodeURIComponent(value);\n }", "decodeValue(value) {\n return decodeURIComponent(value);\n }", "function decodeString(value) {\n return Buffer.from(value, \"base64\");\n}", "function decodeString(value) {\n return Buffer.from(value, \"base64\");\n}", "function decodeString(value) {\n return Buffer.from(value, \"base64\");\n}", "function decodeString(value) {\n return Buffer.from(value, \"base64\");\n}", "function decodeStringToString(value) {\n return Buffer.from(value, \"base64\").toString();\n}", "function decodeString(value) {\n var byteString = atob(value);\n var arr = new Uint8Array(byteString.length);\n for (var i = 0; i < byteString.length; i++) {\n arr[i] = byteString.charCodeAt(i);\n }\n return arr;\n }", "function convert_value_to_string(value) {\n\t\tif (value > 10) {\n\t\t\tswitch (value) {\n\t\t\t\tcase 11:\n\t\t\t\treturn 'Jack';\n\t\t\t\tbreak;\n\t\t\t\tcase 12:\n\t\t\t\treturn 'Queen';\n\t\t\t\tbreak;\n\t\t\t\tcase 13:\n\t\t\t\treturn 'King';\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t\tif (value === 1) {\n\t\t\tswitch (value) {\n\t\t\t\tcase 1:\n\t\t\t\treturn 'Ace';\n\t\t\t}\n\t\t}\n\t\treturn value.toString();\n\t}", "function toString(value) {\r\n\tlet str = \"\";\r\n\tfor (a = 0; a < value.byteLength; a++) {\r\n\t\tstr += String.fromCharCode(value.getInt8(a));\r\n\t}\r\n\treturn str;\r\n}", "function convert_value_to_string(value) {\n\t\tif (value > 10) {\n\t\t\tswitch (value) {\n\t\t\t\tcase 11:\n\t\t\t\treturn 'Jack';\n\t\t\t\tbreak;\n\t\t\t\tcase 12:\n\t\t\t\treturn 'Queen';\n\t\t\t\tbreak;\n\t\t\t\tcase 13:\n\t\t\t\treturn 'King';\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t\treturn value.toString();\n\t}", "function convert_value_to_string(value) {\n\t\tif (value > 10) {\n\t\t\tswitch (value) {\n\t\t\t\tcase 11:\n\t\t\t\treturn 'Jack';\n\t\t\t\tbreak;\n\t\t\t\tcase 12:\n\t\t\t\treturn 'Queen';\n\t\t\t\tbreak;\n\t\t\t\tcase 13:\n\t\t\t\treturn 'King';\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t\treturn value.toString();\n\t}", "function stringRepresentation(value) {\n switch (value[0]) {\n case \"Num\": \n\treturn getNumValue(value);\n case \"Clo\":\n\treturn;\n }\n}", "function toggleAt(value, position){\n\tif (!value) { return ''; }\n\t\n\tvar index = value.length - position,\n\t\tnewChar = (value[index] == '0' ? '1' : '0'),\n\t\tnewValue = value.substring(0, index) + newChar + value.substring(index + 1);\t\n\treturn newValue;\n}", "function $value(value) {\n\t function hasReplaceVal(val) { return function(obj) { return obj.from === val; }; }\n\t function $replace(value) {\n\t var replacement = map(filter(self.replace, hasReplaceVal(value)), function(obj) { return obj.to; });\n\t return replacement.length ? replacement[0] : value;\n\t }\n\t value = $replace(value);\n\t return isDefined(value) ? self.type.decode(value) : $$getDefaultValue();\n\t }", "function decodeText(value, encoding) {\n\t\tif (encoding && encoding.trim().toLowerCase() == \"cp437\") {\n\t\t\treturn decodeCP437(value);\n\t\t} else {\n\t\t\treturn new TextDecoder(encoding).decode(value);\n\t\t}\n\t}", "function yellHTMLDecode(value) {\n var temp = document.createElement(\"div\");\n temp.innerHTML = value;\n var result = temp.childNodes[0].nodeValue;\n temp.removeChild(temp.firstChild);\n return result;\n}", "function decodeUrlValue(value) {\n try {\n return JSON.parse(value);\n } catch (e) {\n return value;\n }\n}", "function $value(value) {\n function hasReplaceVal(val) { return function(obj) { return obj.from === val; }; }\n function $replace(value) {\n var replacement = map(filter(self.replace, hasReplaceVal(value)), function(obj) { return obj.to; });\n return replacement.length ? replacement[0] : value;\n }\n value = $replace(value);\n return isDefined(value) ? self.type.decode(value) : $$getDefaultValue();\n }", "function $value(value) {\n function hasReplaceVal(val) { return function(obj) { return obj.from === val; }; }\n function $replace(value) {\n var replacement = map(filter(self.replace, hasReplaceVal(value)), function(obj) { return obj.to; });\n return replacement.length ? replacement[0] : value;\n }\n value = $replace(value);\n return isDefined(value) ? self.type.decode(value) : $$getDefaultValue();\n }", "function $value(value) {\n function hasReplaceVal(val) { return function(obj) { return obj.from === val; }; }\n function $replace(value) {\n var replacement = map(filter(self.replace, hasReplaceVal(value)), function(obj) { return obj.to; });\n return replacement.length ? replacement[0] : value;\n }\n value = $replace(value);\n return isDefined(value) ? self.type.decode(value) : $$getDefaultValue();\n }", "function $value(value) {\n function hasReplaceVal(val) {\n return function (obj) {\n return obj.from === val;\n };\n }\n\n function $replace(value) {\n var replacement = map(filter(self.replace, hasReplaceVal(value)), function (obj) {\n return obj.to;\n });\n return replacement.length ? replacement[0] : value;\n }\n\n value = $replace(value);\n return isDefined(value) ? self.type.decode(value) : $$getDefaultValue();\n }", "function decode(value, length) {\n if (length === value.length && !decodable(value)) {\n return 0;\n }\n if (length === 0 || length === 1) {\n return 1;\n }\n var result = 0;\n if (parseInt(value[length - 1]) > 0) {\n result = decode(value, length - 1);\n }\n if (value[length - 2] === '1' ||\n (value[length - 2] === '2' && parseInt(value[length - 1]) < 7)) {\n result = result + decode(value, length - 2);\n }\n return result;\n}", "function toText(value) {\n if (hasValue(value) && !isString(value)) {\n if (isNumber(value)) {\n return castString(value);\n }\n else if (isObject(value)) {\n return value.toString();\n }\n }\n return value;\n}", "function packValue(value) {\n const result = memoizedMap.get(value);\n if (result == null) {\n if (value >= MIN_DICT_INDEX && value <= MAX_VERBATIM_INTEGER && Number.isInteger(value))\n return -value;\n \n memoize(value);\n \n if (typeof value === \"number\")\n return String(value);\n if (/^[0-9\\.]|^~/.test(value))\n return `~${value}`;\n return value;\n }\n return result;\n }", "function decodeString(s) {\n var index = 0\n return decodeHelper(s, index)\n}", "function deserializeValue(value) {\n try {\n return value\n ? value == 'true' ||\n (value == 'false'\n ? false\n : value == 'null'\n ? null\n : +value + '' == value\n ? +value\n : /^[\\[\\{]/.test(value)\n ? h.parseJSON(value)\n : value)\n : value;\n } catch (e) {\n return value;\n }\n }", "function mapFragment(p, isVal) {\n return decodeURIComponent(isVal | 0 ? p : p.replace('[]', ''));\n}", "function parseAsString(val, done) {\n if (!val && val!== 0) { return done(null, undefined); }\n done(null, String(val));\n}", "string() {\n let len = this.varint();\n this.throw_if_less_than(len);\n\n let utf8 = this.buffer.subarray(this.pos, this.pos + len);\n this.pos += len;\n let decoder = new TextDecoder(\"utf-8\");\n return decoder.decode(utf8);\n }", "function _toString(value)\n{\n if (typeof value == 'string')\n return value;\n var result = \"\";\n for (var i = 0; i < value.length; ++i)\n result += String.fromCharCode(value[i]);\n return result;\n}", "function toString(value) {\n\t switch (typeof value) {\n\t case 'number':\n\t return value + '';\n\t case 'string':\n\t return value;\n\t default:\n\t return JSON.stringify(value);\n\t }\n\t}", "function decryption(value) {\n var encryptedBytes = aesjs.utils.hex.toBytes(value);\n var aesCtr = new aesjs.ModeOfOperation.ctr(passKey, new aesjs.Counter(1));\n var decryptedBytes = aesCtr.decrypt(encryptedBytes);\n var decryptedText = aesjs.utils.utf8.fromBytes(decryptedBytes);\n return decryptedText;\n}", "function extract_string(mem, offset, len) {\n const buf = new Uint8Array(mem.buffer, offset, len);\n return str = new TextDecoder('utf8').decode(buf); \n}", "async readstr(pos) {\n\t\tlet readbytes = 1;\n\t\tlet p = await this.readbin(readbytes, pos, 'int8');\n\t\treturn this.readbin(p, pos + 1, 'str');\n\t}", "function castString(value) {\n if (typeof value === \"string\") {\n return value;\n }\n else if (typeof value === \"number\") {\n return \"\" + value;\n }\n else {\n throw new Error(\"Expected a string or number but got \" + getType(value));\n }\n}", "function _getFixedLengthValue(value, size) {\n\t\t\t//console.log(\"type=\"+typeof value+\", value=\"+JSON.stringify(value)+\", len=\"+value.length+\", size=\"+size);\n\t\t\tvar val = \"\" + value;\n\t\t\tvar res = val;\n\t\t\tif (typeof value === \"number\") {\n\t\t\t\t// right text align\n\t\t\t\tfor (var i = val.length; i < size; i++) {\n\t\t\t\t\tres = \" \" + res;\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\t// left text align\n\t\t\t\tfor (var i = val.length; i < size; i++) {\n\t\t\t\t\tres += \" \";\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn res;\n\t\t}", "function caml_output_value_to_string (v, fl) {\n /* ignores flags... */\n return new MlStringFromArray (caml_output_val (v));\n}", "function parseValue(value) {\n value = decodeURIComponent(value);\n try {\n return JSON.parse(value);\n } catch(e) {\n return value;\n }\n }", "function decode(string){\n\n}", "function deserializeValue(value) {\n\t try {\n\t return value ? value == \"true\" || (value == \"false\" ? false : value == \"null\" ? null : +value + \"\" == value ? +value : /^[\\[\\{]/.test(value) ? $.parseJSON(value) : value) : value;\n\t } catch (e) {\n\t return value;\n\t }\n\t }", "getString() {\n let buf = new Uint8Array(this.buf).subarray(this.offset);\n\n\t\tlet byteArr = [];\n for (let byte of buf) {\n if (byte == 0)\n break;\n\n\t\t\tbyteArr.push(byte);\n }\n\t\tlet str = new TextDecoder(\"utf-8\").decode(new Uint8Array(byteArr));\n this.offset += byteArr.length+1;\n\n return str;\n }", "function deserializeValue(value) {\n try {\n return value ?\n value == \"true\" ||\n ( value == \"false\" ? false :\n value == \"null\" ? null :\n +value + \"\" == value ? +value :\n /^[\\[\\{]/.test(value) ? $.parseJSON(value) :\n value )\n : value\n } catch(e) {\n return value\n }\n }", "function deserializeValue(value) {\n try {\n return value ?\n value == \"true\" ||\n ( value == \"false\" ? false :\n value == \"null\" ? null :\n +value + \"\" == value ? +value :\n /^[\\[\\{]/.test(value) ? $.parseJSON(value) :\n value )\n : value\n } catch(e) {\n return value\n }\n }", "function deserializeValue(value) {\n try {\n return value ?\n value == \"true\" ||\n ( value == \"false\" ? false :\n value == \"null\" ? null :\n +value + \"\" == value ? +value :\n /^[\\[\\{]/.test(value) ? $.parseJSON(value) :\n value )\n : value\n } catch(e) {\n return value\n }\n }", "function deserializeValue(value) {\n try {\n return value ?\n value == \"true\" ||\n ( value == \"false\" ? false :\n value == \"null\" ? null :\n +value + \"\" == value ? +value :\n /^[\\[\\{]/.test(value) ? $.parseJSON(value) :\n value )\n : value\n } catch(e) {\n return value\n }\n }", "function deserializeValue(value) {\n try {\n return value ?\n value == \"true\" ||\n ( value == \"false\" ? false :\n value == \"null\" ? null :\n +value + \"\" == value ? +value :\n /^[\\[\\{]/.test(value) ? $.parseJSON(value) :\n value )\n : value\n } catch(e) {\n return value\n }\n }", "function deserializeValue(value) {\n try {\n return value ?\n value == \"true\" ||\n ( value == \"false\" ? false :\n value == \"null\" ? null :\n +value + \"\" == value ? +value :\n /^[\\[\\{]/.test(value) ? $.parseJSON(value) :\n value )\n : value\n } catch(e) {\n return value\n }\n }", "function deserializeValue(value) {\n try {\n return value ?\n value == \"true\" ||\n ( value == \"false\" ? false :\n value == \"null\" ? null :\n +value + \"\" == value ? +value :\n /^[\\[\\{]/.test(value) ? $.parseJSON(value) :\n value )\n : value\n } catch(e) {\n return value\n }\n }", "function deserializeValue(value) {\n try {\n return value ?\n value == \"true\" ||\n ( value == \"false\" ? false :\n value == \"null\" ? null :\n +value + \"\" == value ? +value :\n /^[\\[\\{]/.test(value) ? $.parseJSON(value) :\n value )\n : value\n } catch(e) {\n return value\n }\n }", "function deserializeValue(value) {\n try {\n return value ?\n value == \"true\" ||\n ( value == \"false\" ? false :\n value == \"null\" ? null :\n +value + \"\" == value ? +value :\n /^[\\[\\{]/.test(value) ? $.parseJSON(value) :\n value )\n : value\n } catch(e) {\n return value\n }\n }", "function deserializeValue(value) {\n try {\n return value ?\n value == \"true\" ||\n ( value == \"false\" ? false :\n value == \"null\" ? null :\n +value + \"\" == value ? +value :\n /^[\\[\\{]/.test(value) ? $.parseJSON(value) :\n value )\n : value\n } catch(e) {\n return value\n }\n }", "function deserializeValue(value) {\n try {\n return value ?\n value == \"true\" ||\n ( value == \"false\" ? false :\n value == \"null\" ? null :\n +value + \"\" == value ? +value :\n /^[\\[\\{]/.test(value) ? $.parseJSON(value) :\n value )\n : value\n } catch(e) {\n return value\n }\n }", "function deserializeValue(value) {\n try {\n return value ?\n value == \"true\" ||\n ( value == \"false\" ? false :\n value == \"null\" ? null :\n +value + \"\" == value ? +value :\n /^[\\[\\{]/.test(value) ? $.parseJSON(value) :\n value )\n : value\n } catch(e) {\n return value\n }\n }", "function deserializeValue(value) {\n try {\n return value ?\n value == \"true\" ||\n ( value == \"false\" ? false :\n value == \"null\" ? null :\n +value + \"\" == value ? +value :\n /^[\\[\\{]/.test(value) ? $.parseJSON(value) :\n value )\n : value\n } catch(e) {\n return value\n }\n }", "function mountRawSequence ( value ) {\n var out = '';\n var isCep = validCepFormat( value );\n\n if ( isCep ) out = value.replace('-', '');\n\n return out;\n}", "function deserializeValue(value) {\n try {\n return value ?\n value == \"true\" ||\n (value == \"false\" ? false :\n value == \"null\" ? null :\n +value + \"\" == value ? +value :\n /^[\\[\\{]/.test(value) ? $.parseJSON(value) :\n value) : value\n } catch (e) {\n return value\n }\n }", "function deserializeValue(value) {\r\n try {\r\n return value ?\r\n value == \"true\" ||\r\n ( value == \"false\" ? false :\r\n value == \"null\" ? null :\r\n +value + \"\" == value ? +value :\r\n /^[\\[\\{]/.test(value) ? $.parseJSON(value) :\r\n value )\r\n : value\r\n } catch(e) {\r\n return value\r\n }\r\n }", "function valuetext(value) {\n return `${value}`;\n}", "emitNamedEntityData(result, valueLength, consumed) {\n const { decodeTree } = this;\n this.emitCodePoint(valueLength === 1\n ? decodeTree[result] & ~BinTrieFlags.VALUE_LENGTH\n : decodeTree[result + 1], consumed);\n if (valueLength === 3) {\n // For multi-byte values, we need to emit the second byte.\n this.emitCodePoint(decodeTree[result + 2], consumed);\n }\n return consumed;\n }", "function parseItemValue(value) {\n\t\tparseItemValue.cache = parseItemValue.cache || {};\n\t\tif (value) {\n\t\t\tif (parseItemValue.cache[value]) {\n\t\t\t\treturn parseItemValue.cache[value];\n\t\t\t}\n\t\t\t\n\t\t\tvar val = parseInt(value);\n\t\t\tif (val) {\n\t\t\t\tvar copper = val % 10;\n\t\t\t\tvar silver = (val % 100 - copper) / 10;\n\t\t\t\tvar gold = (val - silver * 10 - copper) / 100;\n\t\t\t\t\n\t\t\t\tvar text = '';\n\t\t\t\tif (copper) {\n\t\t\t\t\ttext = '<span class=\"item-value-copper\">' + copper + '</span>';\n\t\t\t\t}\n\t\t\t\tif (silver) {\n\t\t\t\t\ttext = '<span class=\"item-value-silver\">' + silver + '</span> ' + text;\n\t\t\t\t}\n\t\t\t\tif (gold) {\n\t\t\t\t\ttext = '<span class=\"item-value-gold\">' + gold + '</span> ' + text;\n\t\t\t\t}\n\t\t\t\tparseItemValue.cache[value] = text;\n\t\t\t\treturn text;\n\t\t\t}\n\t\t}\t\n\t\treturn '';\n\t}", "function string(val) {\n return {value: val, type: 'string', size: Buffer.from(val, 'utf8').byteLength, unit: 8};\n}", "function deserializeValue( value ) {\n try {\n return value ? value == \"true\" || (value == \"false\" ? false : value == \"null\" ? null : +value + \"\" == value ? +value : /^[\\[\\{]/.test( value ) ? $.parseJSON( value ) : value) : value\n } catch ( e ) {\n return value\n }\n }", "function deserializeValue(value) {\r\n try {\r\n return value ?\r\n value == \"true\" ||\r\n ( value == \"false\" ? false :\r\n value == \"null\" ? null :\r\n +value + \"\" == value ? +value :\r\n /^[\\[\\{]/.test(value) ? $.parseJSON(value) :\r\n value )\r\n : value\r\n } catch(e) {\r\n return value\r\n }\r\n }", "function deserializeValue(value) {\r\n try {\r\n return value ?\r\n value == \"true\" ||\r\n ( value == \"false\" ? false :\r\n value == \"null\" ? null :\r\n +value + \"\" == value ? +value :\r\n /^[\\[\\{]/.test(value) ? $.parseJSON(value) :\r\n value )\r\n : value\r\n } catch(e) {\r\n return value\r\n }\r\n }", "function $value(value) {\n function hasReplaceVal(val) { return function(obj) { return obj.from === val; }; }\n function $replace(value) {\n var replacement = map(filter(self.replace, hasReplaceVal(value)), function(obj) { return obj.to; });\n return replacement.length ? replacement[0] : value;\n }\n value = $replace(value);\n return !isDefined(value) ? $$getDefaultValue() : self.type.$normalize(value);\n }", "function displayValue(value) {\n if (typeof value === \"string\") {\n return quote(value);\n } else {\n return String(value);\n }\n}", "stringNT() {\n const end = this.buffer.indexOf(0, this.at);\n const out = this._utf8.decode(this.buffer.slice(this.at, end));\n this.at = end + 1;\n return out;\n }", "function getCookieVal(offset) {\n var endstr = document.cookie.indexOf(\";\", offset);\n if (endstr == -1) {\n endstr = document.cookie.length;\n }\n return unescape(document.cookie.substring(offset, endstr));\n }", "function toLua(value) {\n const json = JSON.stringify(value, null, 4);\n\n const s = json.replace(/\"(.+?)\":/g, '$1 =').replace(/-/g, '_');\n\n return s;\n}", "function valToString(val) { return val != null ? val.toString().replace(/(~|\\/)/g, function (m) { return {'~':'~~', '/':'~2F'}[m]; }) : val; }", "function valToString(val) { return val != null ? val.toString().replace(/(~|\\/)/g, function (m) { return {'~':'~~', '/':'~2F'}[m]; }) : val; }", "function valToString(val) { return val != null ? val.toString().replace(/(~|\\/)/g, function (m) { return {'~':'~~', '/':'~2F'}[m]; }) : val; }", "function valToString(val) { return val != null ? val.toString().replace(/(~|\\/)/g, function (m) { return {'~':'~~', '/':'~2F'}[m]; }) : val; }", "function valToString(val) { return val != null ? val.toString().replace(/(~|\\/)/g, function (m) { return {'~':'~~', '/':'~2F'}[m]; }) : val; }" ]
[ "0.69702625", "0.69702625", "0.6775656", "0.6490716", "0.6472848", "0.6472848", "0.6472848", "0.6472848", "0.6472848", "0.6472848", "0.6250978", "0.6250978", "0.6115299", "0.6041289", "0.5988353", "0.5988353", "0.5988353", "0.5988353", "0.59686035", "0.59686035", "0.59686035", "0.59686035", "0.59686035", "0.58553386", "0.5736563", "0.5736563", "0.5736563", "0.5736563", "0.57313085", "0.5638031", "0.54857534", "0.5475965", "0.54745144", "0.54745144", "0.54396755", "0.5294096", "0.5272038", "0.5263518", "0.5260953", "0.52465796", "0.52435493", "0.52435493", "0.52435493", "0.51658463", "0.5141478", "0.5062132", "0.50235015", "0.4972334", "0.49664932", "0.49636972", "0.49614593", "0.49246034", "0.49144357", "0.4913976", "0.48450488", "0.48361853", "0.47930986", "0.4791204", "0.4788379", "0.47758818", "0.4767787", "0.47177237", "0.46909738", "0.46852985", "0.46774048", "0.46774048", "0.46774048", "0.46774048", "0.46774048", "0.46774048", "0.46774048", "0.46774048", "0.46774048", "0.46774048", "0.46774048", "0.46774048", "0.46774048", "0.4674029", "0.4663591", "0.4648542", "0.464351", "0.4627128", "0.4620712", "0.46156254", "0.46057817", "0.46057385", "0.46057385", "0.45961192", "0.45958766", "0.4579735", "0.45638993", "0.45519713", "0.45512038", "0.45512038", "0.45512038", "0.45512038", "0.45512038" ]
0.69098884
5
Check if the given character code, or the character code at the first character, is hexadecimal.
function hexadecimal(character) { var code = typeof character === 'string' ? character.charCodeAt(0) : character return ( (code >= 97 /* a */ && code <= 102) /* z */ || (code >= 65 /* A */ && code <= 70) /* Z */ || (code >= 48 /* A */ && code <= 57) /* Z */ ) }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function isHexDigit(code) {\n return (\n isDigit(code) || // 0 .. 9\n (code >= 0x0041 && code <= 0x0046) || // A .. F\n (code >= 0x0061 && code <= 0x0066) // a .. f\n );\n}", "function hexadecimal(character) {\n var code = typeof character === 'string' ? character.charCodeAt(0) : character;\n return code >= 97 /* a */ && code <= 102 /* z */ || code >= 65 /* A */ && code <= 70 /* Z */ || code >= 48 /* A */ && code <= 57 /* Z */;\n}", "function isHexDigit(c){\r\n return /^[0-9A-Fa-f]$/.test(c);\r\n}", "function checkHex(code){\r\n\t\tvar result = /(^#[0-9A-F]{6}$)|(^#[0-9A-F]{3}$)/i.test(code);\r\n\t\treturn result;\r\n\t}", "function isHex(num)\r\n{\r\n\treturn /^[0-9a-fA-f]+$/.test(num);\r\n}", "function isHex(s) {\n return /^0x[0-9a-f]+$/i.test(s);\n}", "function seemsHex(maybeHex) {\n return maybeHex.startsWith('0x');\n}", "function isHex(hex) {\n return HEX_REGEX.test(hex);\n}", "function charIsHexDigit(charCode)\n{\n return (\n (charCode >= 48 && charCode <= 57) || // 0-9\n (charCode >= 97 && charCode <= 122) || // a-z\n (charCode >= 64 && charCode <= 90) // A-Z\n );\n}", "function validHex(t) {\n for (var i = 0; i < t.length; i++) {\n var c = t.charAt(i);\n if (!((c >= 'a' && c <= 'f') || (c >= '0' && c <= '9'))) {\n return false;\n }\n }\n return true;\n}", "function check_hex(inp){\n\n var hexPatt = /^#[0-9A-F]{6}$/i; \n if(hexPatt.test(inp)){\n alert(\"Correct HEXCOLOR code\");\n }\n else{\n alert(\"Incorrect HEXCOLOR code\");\n }\n}", "function needsHexEscape(character) {\n return !((0x00020 <= character && character <= 0x00007E) ||\n (0x00085 === character) ||\n (0x000A0 <= character && character <= 0x00D7FF) ||\n (0x0E000 <= character && character <= 0x00FFFD) ||\n (0x10000 <= character && character <= 0x10FFFF));\n}", "isHex(input) {\n var _a;\n const hexRegEx = /(?:[0-9]|[a-f])/gimu;\n return ((_a = input.match(hexRegEx)) !== null && _a !== void 0 ? _a : []).length === input.length;\n }", "function validateHex(input) {\n return /^#[0-9A-F]{6}$/i.test(input.toUpperCase());\n}", "function checkIfHex(input) {\n const hexReg = /(^#[0-9A-Fa-f]{6}$)|(^#[0-9A-Fa-f]{3}$)/gi;\n if (hexReg.test(input.value)) {\n return true;\n }\n return false;\n}", "function isHex(val) {\n if (typeof val !== \"string\") val = val.toString(16)\n return (val.trim()[0] === \"#\" || (val.trim()[0] + val.trim()[1]) === \"0x\" || typeof val === \"number\") ?\n (val = val.replace(\"#\", \"\").replace(\"0x\", \"\"), (val.trim().length === 6 || val.trim().length === 8)) : false\n}", "function needsHexEscape(character) {\n\t return !((0x00020 <= character && character <= 0x00007E) ||\n\t (character === 0x00085) ||\n\t (0x000A0 <= character && character <= 0x00D7FF) ||\n\t (0x0E000 <= character && character <= 0x00FFFD) ||\n\t (0x10000 <= character && character <= 0x10FFFF));\n\t}", "function check_hex(){\n\n var hex=prompt(\"Enter HexCode: \");\n var hexPattern = /^#[0-9A-F]{6}$/i; //regex for hex code color match\n if(hexPattern.test(hex)){\n alert(\"Correct HEX code\");\n }\n else{\n alert(\"Incorrect HEX code\");\n }\n}", "function isHexPrefixed(str) {\n return str.slice(0, 2) === '0x';\n}", "function isHexPrefixed(str) {\n return str.slice(0, 2) === '0x';\n}", "function isHexPrefixed(str) {\n return str.slice(0, 2) === '0x';\n}", "function isHexPrefixed(str) {\n return str.slice(0, 2) === '0x';\n}", "function isHexPrefixed(str) {\n return str.slice(0, 2) === '0x';\n}", "function isHexPrefixed(str) {\n return str.slice(0, 2) === '0x';\n}", "function isHexPrefixed(str) {\n return str.slice(0, 2) === '0x';\n}", "function isHexPrefixed(str) {\n return str.slice(0, 2) === '0x';\n}", "function isHexaColor(sNum) {\n return (typeof sNum === \"string\") && sNum.length === 6\n && !isNaN(parseInt(sNum, 16));\n}", "function checkHex (str) {\n\t\tvar i, k;\n\t\tif (str.length%2) {\n\t\t\treturn convert(str);\n\t\t} else {\n\t\t\tk = false;\n\t\t\tfor (i=0;i<str.length;i+=2) {\n\t\t\t\tif (isNaN(parseInt(str.substr(i,1), 16))) { k = true; }\n\t\t\t\tif (isNaN(parseInt(str.substr(i+1,1), 16))) { k = true; }\n\t\t\t}\n\t\t\tif (k) { return convert(str); }\n\t\t\treturn str;\n\t\t}\n\t\tfunction convert (chars) {\n\t\t\tvar i, hex = \"\";\n\t\t\tfor (i=0;i<str.length;i++) {\n\t\t\t\thex += str.charCodeAt(i).toString(16);\n\t\t\t}\n\t\t\treturn hex;\n\t\t}\n\t\treturn hex;\n\t}", "function is_hexdigit(str)\n{\n\tif (str.length==0) return false;\n\tfor (var i=0;i < str.length;i++)\n\t{\n\t\tif (str.charAt(i) <= '9' && str.charAt(i) >= '0') continue;\n\t\tif (str.charAt(i) <= 'F' && str.charAt(i) >= 'A') continue;\n\t\tif (str.charAt(i) <= 'f' && str.charAt(i) >= 'a') continue;\n\t\treturn false;\n\t}\n\treturn true;\n}", "function isASCIIDigit(c) {\n return c >= 0x30 && c <= 0x39;\n}", "function isHexPrefixed(str) {\n return str.slice(0, 2) === '0x';\n }", "function isValidHex(hex) {\n var isOk = /(^#[0-9A-F]{6}$)|(^#[0-9A-F]{3}$)/i.test(hex);\n return isOk;\n}", "function isValidHex(hex) {\n var isOk = /(^#[0-9A-F]{6}$)|(^#[0-9A-F]{3}$)/i.test(hex);\n return isOk;\n}", "function isChar(c) {\n return (c >= 0x0001 && c <= 0xD7FF) ||\n (c >= 0xE000 && c <= 0xFFFD) ||\n (c >= 0x10000 && c <= 0x10FFFF);\n}", "function readHexDigit(code) {\n return code >= 0x0030 && code <= 0x0039 // 0-9\n ? code - 0x0030\n : code >= 0x0041 && code <= 0x0046 // A-F\n ? code - 0x0037\n : code >= 0x0061 && code <= 0x0066 // a-f\n ? code - 0x0057\n : -1;\n}", "function isHexColor(color) {\n return string.regex(/^#([a-fA-F0-9]{6}|[a-fA-F0-9]{3})$/)(color)\n}", "function isChar (code) {\n\t// http://www.cambiaresearch.com/articles/15/javascript-char-codes-key-codes\n\treturn code === 32 || (code > 46 && !(code >= 91 && code <= 123) && code !== 144 && code !== 145);\n}", "function isValidHexColor(t) {\n return item => {\n var hash = hashbow(item);\n t.is(typeof hash, 'string');\n t.is(hash.charAt(0), '#');\n t.is(hash.length, 7);\n };\n}", "function isValidHexColor(hexColor) {\n hexColor = hexColor.substr(1);\n var isValid = hexColor.length === 6\n && !isNaN(parseInt(hexColor, 16));\n\n return isValid;\n }", "function validHex(col) {\n if (col) {\n if (typeof col === 'string') {\n if (col[0] === '#') {\n if (col.length === 4 || col.length === 7) {\n for (var i = 1; i < col.length; i++) {\n var num = parseInt(col[i], 16);\n if (isNaN(num)) {\n return false;\n }\n }\n return true;\n }\n }\n }\n }\n return false;\n}", "function readHexChar (len) {\r\n const start = acornPos;\r\n let total = 0, lastCode = 0;\r\n for (let i = 0; i < len; ++i, ++acornPos) {\r\n let code = source.charCodeAt(acornPos), val;\r\n\r\n if (code === 95) {\r\n if (lastCode === 95 || i === 0) syntaxError();\r\n lastCode = code;\r\n continue;\r\n }\r\n\r\n if (code >= 97) val = code - 97 + 10; // a\r\n else if (code >= 65) val = code - 65 + 10; // A\r\n else if (code >= 48 && code <= 57) val = code - 48; // 0-9\r\n else break;\r\n if (val >= 16) break;\r\n lastCode = code;\r\n total = total * 16 + val;\r\n }\r\n\r\n if (lastCode === 95 || acornPos - start !== len) syntaxError();\r\n\r\n return total;\r\n }", "function validateHexadecimal(hex) {\n const hexNo = isValidStr(hex);\n if (!hexNo) return false;\n\n if (/[^0123456789abcdef]/g.test(hexNo)) return false;\n return hexNo;\n}", "function validateSingleChar(str) {\r\n if (str.length === 0) {\r\n return false;\r\n }\r\n var firstChar = str.charCodeAt(0);\r\n if (str.length === 1) {\r\n return (firstChar === 0x9 || firstChar === 0xA || firstChar === 0xD\r\n || (firstChar >= 0x20 && firstChar <= 0xD7FF)\r\n || (firstChar >= 0xE000 && firstChar <= 0xFFFD));\r\n }\r\n if (str.length !== 2) {\r\n return false;\r\n }\r\n // UTF-16 surrogate characters\r\n var secondChar = str.charCodeAt(1);\r\n return ((firstChar >= 0xD800 && firstChar <= 0xDBFF)\r\n && (secondChar >= 0xDC00 && secondChar <= 0xDFFF));\r\n}", "function testIsHexNumber(){\n\t\tvar StringUtils = LanguageModule.StringUtils;\n\t\tvar stringUtils = new StringUtils();\n\t\tvar encodings = stringUtils.stringEncodings;\n\t\t\n\t\t// Get the hex number\n\t\tvar hexSequenceTest1 = stringUtils.isHexNumber(\"abcdef\", encodings.ASCII);\n\t\tvar hexSequenceTest2 = stringUtils.isHexNumber(\"ABCDEF\", encodings.ASCII);\n\t\tvar hexSequenceTest3 = stringUtils.isHexNumber(\"0123456789\", encodings.ASCII);\n\t\tvar hexSequenceTest4 = stringUtils.isHexNumber(\"g\", encodings.ASCII);\n\t\tvar hexSequenceTest5 = stringUtils.isHexNumber(\"G\", encodings.ASCII);\n\t\texpect(hexSequenceTest1).to.eql(true);\n\t\texpect(hexSequenceTest2).to.eql(true);\n\t\texpect(hexSequenceTest3).to.eql(true);\n\t\texpect(hexSequenceTest4).to.eql(false);\n\t\texpect(hexSequenceTest5).to.eql(false);\n\t}", "function isHexString(value, length) {\n if (typeof value !== 'string' || !value.match(/^0x[0-9A-Fa-f]*$/)) {\n return false;\n }\n\n if (length && value.length !== 2 + 2 * length) {\n return false;\n }\n\n return true;\n}", "async function checkHex(input, hexBool){\n console.log(\"HEX BOOL\" + hexBool);\n //console.log(input);\n //console.log(referer);\n let ORIGINALINPUT = input;\n try{\n if(typeof ORIGINALINPUT === \"string\"){\n //console.log(\"reached\");\n //Remove all non-needed characters\n //var ASCIIONLY = ORIGINALINPUT.replace(/[^\\x00-\\x7F]/g, \"\");\n //console.log(\"ASCIIONLY\" + ASCIIONLY);\n // Only Allow alpha numeric. A-F in accourandence with HEX, 0-9. Also removes the hash mark.\n var cleanedInput = ORIGINALINPUT.replace(/[^0-9A-Fa-f]/gi, \"\");\n console.log(\"cleanedInput\" + cleanedInput);\n\n //console.log(cleanedInput);\n // Check if the string is 7 characters\n if(cleanedInput.length==6 && ORIGINALINPUT[0] ===\"#\"){\n // console.log(\"correct length\");\n //check if first character is a pound symbke\n return [true, cleanedInput, hexBool];\n }\n else{\n return [false, '', false];\n }\n }\n else{\n return [false, '', false]; \n }\n return [false, '', false];\n }\n \n catch{\n return [false, '', false];\n }\n}", "function char2hex(a) {\n return a >= 48 && a <= 57 ? a - 48 // 0-9\n : a >= 65 && a <= 70 ? a - 55 // A-F\n : a >= 97 && a <= 102 ? a - 87 // a-f\n : -1;\n}", "function char2hex(a) {\n return a >= 48 && a <= 57 ? a - 48 // 0-9\n : a >= 65 && a <= 70 ? a - 55 // A-F\n : a >= 97 && a <= 102 ? a - 87 // a-f\n : -1;\n}", "function char2hex(a) {\n return a >= 48 && a <= 57 ? a - 48 // 0-9\n : a >= 65 && a <= 70 ? a - 55 // A-F\n : a >= 97 && a <= 102 ? a - 87 // a-f\n : -1;\n}", "function char2hex(a) {\n return a >= 48 && a <= 57 ? a - 48 // 0-9\n : a >= 65 && a <= 70 ? a - 55 // A-F\n : a >= 97 && a <= 102 ? a - 87 // a-f\n : -1;\n}", "function char2hex(a) {\n return a >= 48 && a <= 57 ? a - 48 // 0-9\n : a >= 65 && a <= 70 ? a - 55 // A-F\n : a >= 97 && a <= 102 ? a - 87 // a-f\n : -1;\n}", "function char2hex(a) {\n return a >= 48 && a <= 57 ? a - 48 // 0-9\n : a >= 65 && a <= 70 ? a - 55 // A-F\n : a >= 97 && a <= 102 ? a - 87 // a-f\n : -1;\n}", "function char2hex(a) {\n return a >= 48 && a <= 57 ? a - 48 // 0-9\n : a >= 65 && a <= 70 ? a - 55 // A-F\n : a >= 97 && a <= 102 ? a - 87 // a-f\n : -1;\n}", "function char2hex(a) {\n return a >= 48 && a <= 57 ? a - 48 // 0-9\n : a >= 65 && a <= 70 ? a - 55 // A-F\n : a >= 97 && a <= 102 ? a - 87 // a-f\n : -1;\n}", "function char2hex(a) {\n return a >= 48 && a <= 57 ? a - 48 // 0-9\n : a >= 65 && a <= 70 ? a - 55 // A-F\n : a >= 97 && a <= 102 ? a - 87 // a-f\n : -1;\n}", "function char2hex(a) {\n return a >= 48 && a <= 57 ? a - 48 // 0-9\n : a >= 65 && a <= 70 ? a - 55 // A-F\n : a >= 97 && a <= 102 ? a - 87 // a-f\n : -1;\n}", "function char2hex(a) {\n return a >= 48 && a <= 57 ? a - 48 // 0-9\n : a >= 65 && a <= 70 ? a - 55 // A-F\n : a >= 97 && a <= 102 ? a - 87 // a-f\n : -1;\n}", "function char2hex(a) {\n return a >= 48 && a <= 57 ? a - 48 // 0-9\n : a >= 65 && a <= 70 ? a - 55 // A-F\n : a >= 97 && a <= 102 ? a - 87 // a-f\n : -1;\n}", "function char2hex(a) {\n return a >= 48 && a <= 57 ? a - 48 // 0-9\n : a >= 65 && a <= 70 ? a - 55 // A-F\n : a >= 97 && a <= 102 ? a - 87 // a-f\n : -1;\n}", "function char2hex(a) {\n return a >= 48 && a <= 57 ? a - 48 // 0-9\n : a >= 65 && a <= 70 ? a - 55 // A-F\n : a >= 97 && a <= 102 ? a - 87 // a-f\n : -1;\n}", "function char2hex(a) {\n return a >= 48 && a <= 57 ? a - 48 // 0-9\n : a >= 65 && a <= 70 ? a - 55 // A-F\n : a >= 97 && a <= 102 ? a - 87 // a-f\n : -1;\n}", "function char2hex(a) {\n return a >= 48 && a <= 57 ? a - 48 // 0-9\n : a >= 65 && a <= 70 ? a - 55 // A-F\n : a >= 97 && a <= 102 ? a - 87 // a-f\n : -1;\n}", "function char2hex(a) {\n return a >= 48 && a <= 57 ? a - 48 // 0-9\n : a >= 65 && a <= 70 ? a - 55 // A-F\n : a >= 97 && a <= 102 ? a - 87 // a-f\n : -1;\n}", "function char2hex(a) {\n return a >= 48 && a <= 57 ? a - 48 // 0-9\n : a >= 65 && a <= 70 ? a - 55 // A-F\n : a >= 97 && a <= 102 ? a - 87 // a-f\n : -1;\n}", "function char2hex(a) {\n return a >= 48 && a <= 57 ? a - 48 // 0-9\n : a >= 65 && a <= 70 ? a - 55 // A-F\n : a >= 97 && a <= 102 ? a - 87 // a-f\n : -1;\n}", "function char2hex(a) {\n return a >= 48 && a <= 57 ? a - 48 // 0-9\n : a >= 65 && a <= 70 ? a - 55 // A-F\n : a >= 97 && a <= 102 ? a - 87 // a-f\n : -1;\n}", "function char2hex(a) {\n return a >= 48 && a <= 57 ? a - 48 // 0-9\n : a >= 65 && a <= 70 ? a - 55 // A-F\n : a >= 97 && a <= 102 ? a - 87 // a-f\n : -1;\n}", "function hexVal (c) {\n return (\n c < 58 ? c - 48 : // 0 - 9\n c < 71 ? c - 55 : // A - F\n c - 87 // a - f\n );\n}", "static getAHexCharacter() {\n const characters = [\n '0', '1', '2', '3',\n '4', '5', '6', '7',\n '8', '9', 'A', 'B',\n 'C', 'D', 'E', 'F',\n ];\n\n const randomNumber = this.generateRandomNumber(characters.length);\n\n return characters[randomNumber];\n }", "function isColorCode( fieldValue ) {\r\n\tvar checkOK = \"#0123456789ABCDEFabcdef\";\r\n\tvar checkStr = fieldValue;\r\n\tvar allValid = true;\r\n\tvar allNum = \"\";\r\n\r\n\tfor (i = 0; i < checkStr.length; i++)\r\n\t{\r\n\t\tch = checkStr.charAt(i);\r\n\r\n\t\tfor (j = 0; j < checkOK.length; j++)\r\n\t\t\tif (ch == checkOK.charAt(j))\r\n\t\t\t\tbreak;\r\n\r\n\t\tif (j == checkOK.length)\r\n\t\t{\r\n\t\t\tallValid = false;\r\n\t\t\tbreak;\r\n\t\t}\r\n\r\n\t\tif (ch != \",\")\r\n\t\t\tallNum += ch;\r\n\t}\r\n\r\n\t// now check length and that only first letter is # symbol\r\n\tif ( fieldValue.length != 7 || fieldValue.lastIndexOf( '#' ) != 0 )\r\n\t\tallValid = false;\r\n\r\n\treturn allValid;\r\n}", "function char2hex(a) {\n return a >= 48 && a <= 57 ? a - 48 : // 0-9\n a >= 65 && a <= 70 ? a - 55 : // A-F\n a >= 97 && a <= 102 ? a - 87 : // a-f\n -1;\n}", "function char2hex(a) {\n return a >= 48 && a <= 57 ? a - 48 : // 0-9\n a >= 65 && a <= 70 ? a - 55 : // A-F\n a >= 97 && a <= 102 ? a - 87 : // a-f\n -1;\n}", "function char2hex(a) {\n return a >= 48 && a <= 57 ? a - 48 : // 0-9\n a >= 65 && a <= 70 ? a - 55 : // A-F\n a >= 97 && a <= 102 ? a - 87 : // a-f\n -1;\n}", "function char2hex(a) {\n return a >= 48 && a <= 57 ? a - 48 : // 0-9\n a >= 65 && a <= 70 ? a - 55 : // A-F\n a >= 97 && a <= 102 ? a - 87 : // a-f\n -1;\n}", "function char2hex(a) {\n return a >= 48 && a <= 57 ? a - 48 : // 0-9\n a >= 65 && a <= 70 ? a - 55 : // A-F\n a >= 97 && a <= 102 ? a - 87 : // a-f\n -1;\n}", "function char2hex(a) {\n return a >= 48 && a <= 57 ? a - 48 : // 0-9\n a >= 65 && a <= 70 ? a - 55 : // A-F\n a >= 97 && a <= 102 ? a - 87 : // a-f\n -1;\n}", "function char2hex(a) {\n return a >= 48 && a <= 57 ? a - 48 : // 0-9\n a >= 65 && a <= 70 ? a - 55 : // A-F\n a >= 97 && a <= 102 ? a - 87 : // a-f\n -1;\n}", "function isHexadecimal(value) {\n return typeof value === 'string' && validator_lib_isHexadecimal__WEBPACK_IMPORTED_MODULE_1___default()(value);\n}", "function validateHex(input) {\n let $fieldset = $(input).parent('fieldset');\n $fieldset.removeClass(\"valid\");\n $fieldset.removeClass(\"invalid\");\n let inputText = input.val();\n if ((/^(#[A-Fa-f0-9]{6}|#[A-Fa-f0-9]{3}|transparent)$/i).test(inputText)) {\n $fieldset.addClass(\"valid\");\n return true;\n } else {\n $fieldset.addClass(\"invalid\");\n return false;\n }\n }", "function is32BitHex(testVal){\n\t\tvar testString = String(testVal).toLowerCase();\n\t\tif(testString.match(/^(0x)?[0-9a-f]{8}$/)){\n\t\t\treturn true;\n\t\t}\n\t\treturn false;\n\t}", "function isHexColor(value) {\n return typeof value === 'string' && validator_lib_isHexColor__WEBPACK_IMPORTED_MODULE_1___default()(value);\n}", "function validateChar(str) {\r\n for (var i = 0; i < str.length; i++) {\r\n var firstChar = str.charCodeAt(i);\r\n if (firstChar === 0x9 || firstChar === 0xA || firstChar === 0xD\r\n || (firstChar >= 0x20 && firstChar <= 0xD7FF)\r\n || (firstChar >= 0xE000 && firstChar <= 0xFFFD)) {\r\n continue;\r\n }\r\n if (i + 1 === str.length) {\r\n return false;\r\n }\r\n // UTF-16 surrogate characters\r\n var secondChar = str.charCodeAt(i + 1);\r\n if ((firstChar >= 0xD800 && firstChar <= 0xDBFF)\r\n && (secondChar >= 0xDC00 && secondChar <= 0xDFFF)) {\r\n i++;\r\n continue;\r\n }\r\n return false;\r\n }\r\n return true;\r\n}", "function char2hex(a) {\n return a >= 48 && a <= 57 ? a - 48 // 0-9\n : a >= 65 && a <= 70 ? a - 55 // A-F\n : a >= 97 && a <= 102 ? a - 87 // a-f\n : -1;\n }", "function isHexStrict(hex) {\n return /^(-)?[0-9a-f]*$/i.test(hex);\n}", "function isValidColor(text) {\n return hexColorRegEx.test(text);\n}", "function in_hex() {\n let backend = entrada_selecionada();\n let s = NaN;\n do {\n s = parseInt(prompt(\"Insira uma word de quatro nibbles como 00A0 ou F0DA.\",\n \"0000\"), 16);\n } while (isNaN(s));\n backend.inserir(s);\n update_entrada();\n}", "function char2hex(a) {\n\t return a >= 48 && a <= 57 ? a - 48 // 0-9\n\t : a >= 65 && a <= 70 ? a - 55 // A-F\n\t : a >= 97 && a <= 102 ? a - 87 // a-f\n\t : -1;\n\t}", "function isNonAscii(code) {\n return code >= 0x0080;\n}", "function char2hex(a) {\n\t return a >= 48 && a <= 57 ? a - 48 : // 0-9\n\t a >= 65 && a <= 70 ? a - 55 : // A-F\n\t a >= 97 && a <= 102 ? a - 87 : // a-f\n\t -1;\n\t}", "function char2hex(a) {\n\t return a >= 48 && a <= 57 ? a - 48 : // 0-9\n\t a >= 65 && a <= 70 ? a - 55 : // A-F\n\t a >= 97 && a <= 102 ? a - 87 : // a-f\n\t -1;\n\t}", "function isIdentifierChar(code) {\n if (code < 48) return code === 36;\n if (code < 58) return true;\n if (code < 65) return false;\n if (code < 91) return true;\n if (code < 97) return code === 95;\n if (code < 123) return true;\n if (code <= 0xffff) return code >= 0xaa && nonASCIIidentifier.test(String.fromCharCode(code));\n return isInAstralSet(code, astralIdentifierStartCodes) || isInAstralSet(code, astralIdentifierCodes);\n}", "function isIdentifierChar(code) {\n if (code < 48) return code === 36;\n if (code < 58) return true;\n if (code < 65) return false;\n if (code < 91) return true;\n if (code < 97) return code === 95;\n if (code < 123) return true;\n if (code <= 0xffff) return code >= 0xaa && nonASCIIidentifier.test(String.fromCharCode(code));\n return isInAstralSet(code, astralIdentifierStartCodes) || isInAstralSet(code, astralIdentifierCodes);\n}", "function isIdentifierChar(code) {\n if (code < 48) return code === 36;\n if (code < 58) return true;\n if (code < 65) return false;\n if (code < 91) return true;\n if (code < 97) return code === 95;\n if (code < 123) return true;\n if (code <= 0xffff) return code >= 0xaa && nonASCIIidentifier.test(String.fromCharCode(code));\n return isInAstralSet(code, astralIdentifierStartCodes) || isInAstralSet(code, astralIdentifierCodes);\n}", "function isIdentifierChar(code) {\n\t if (code < 48) return code === 36;\n\t if (code < 58) return true;\n\t if (code < 65) return false;\n\t if (code < 91) return true;\n\t if (code < 97) return code === 95;\n\t if (code < 123) return true;\n\t if (code <= 0xffff) return code >= 0xaa && nonASCIIidentifier.test(String.fromCharCode(code));\n\t return isInAstralSet(code, astralIdentifierStartCodes) || isInAstralSet(code, astralIdentifierCodes);\n\t}" ]
[ "0.7581072", "0.7504311", "0.7498717", "0.7426317", "0.72044915", "0.71264887", "0.7067999", "0.70529914", "0.7017491", "0.70108026", "0.7009791", "0.70016026", "0.6995307", "0.6942766", "0.6934762", "0.69318706", "0.69261026", "0.6873151", "0.6783633", "0.6783633", "0.6783633", "0.6783633", "0.6783633", "0.6783633", "0.6783633", "0.6783633", "0.6768434", "0.67321616", "0.67271733", "0.66402835", "0.66308886", "0.659305", "0.659305", "0.65162563", "0.65133524", "0.6492037", "0.6471191", "0.64474076", "0.64118993", "0.63797545", "0.6306609", "0.6278305", "0.62657994", "0.62111515", "0.61992574", "0.6189663", "0.6146081", "0.6146081", "0.6146081", "0.6146081", "0.6146081", "0.6146081", "0.6146081", "0.6146081", "0.6146081", "0.6146081", "0.6146081", "0.6146081", "0.6146081", "0.6146081", "0.6146081", "0.6146081", "0.6146081", "0.6146081", "0.6146081", "0.6146081", "0.6146081", "0.61238503", "0.61215067", "0.6110459", "0.6102264", "0.6102264", "0.6102264", "0.6102264", "0.6102264", "0.6102264", "0.6102264", "0.6099683", "0.6088015", "0.6081249", "0.6069205", "0.6058257", "0.6008992", "0.60087913", "0.59927887", "0.5969435", "0.5955885", "0.594889", "0.59447396", "0.59447396", "0.59209275", "0.59209275", "0.59209275", "0.5886275" ]
0.7384884
9
Check if the given character code, or the character code at the first character, is alphanumerical.
function alphanumerical(character) { return alphabetical(character) || decimal(character) }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function is_alphanum(str) {\n let curr_char\n for (let i = 0; i < str.length; i ++) {\n curr_char = str.charCodeAt(i)\n if (!(curr_char == 95 || curr_char == 46) &&\n !(curr_char > 47 && curr_char < 58) &&\n !(curr_char > 64 && curr_char < 91) &&\n !(curr_char > 96 && curr_char < 123)) {\n return false\n }\n }\n return true\n}", "function isAlnum_Original(char) {\n return char >= 'A' && char <= 'Z' ||\n char >= 'a' && char <= 'z' ||\n isDigit(char);\n}", "function isAlnum_(char) {\n return char >= 'A' && char <= 'Z'\n || char >= 'a' && char <= 'z' \n || isDigit_(char);\n}", "function isAlphanumeric(string) {\n\treturn isAlphanumeric1(string, false);\n}", "function isAlnum(char) {\n return char >= 'A' && char <= 'Z' ||\n char >= 'a' && char <= 'z' || char == '_' ||\n isDigit(char);\n}", "function isAlnum_(char) {\n return char >= 'A' && char <= 'Z' ||\n char >= 'a' && char <= 'z' ||\n isDigit_(char);\n}", "function isAlphabet(x){\n var as = \"abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ\";\n return (as.indexOf(x) != -1);\n}", "function isAlpha(c){\r\n return /^\\w$/.test(c) && /^\\D$/.test(c);\r\n}", "function isLetter(code) {\n return (\n (code >= 0x0061 && code <= 0x007a) || // A-Z\n (code >= 0x0041 && code <= 0x005a) // a-z\n );\n}", "function alphanumeric(str) {\n return str.match(/^[a-zA-Z0-9]*$/) !== null;\n}", "function isAlpha(aChar)\n{\n myCharCode = aChar.charCodeAt(0);\n \n if(((myCharCode > 64) && (myCharCode < 91)) ||\n ((myCharCode > 96) && (myCharCode < 123)))\n {\n return true;\n }\n \n return false;\n}", "function isLetterOrDigit(char) {\n return \"abcdefghijklmnopqrstuvwxyz0123456789\".indexOf(char) >= 0;\n }", "function isAlphaNumeric(char){\n let code = char.charCodeAt(0);\n if(!(code > 47 && code < 58) &&\n !(code > 64 && code < 91) &&\n !(code > 96 && code < 123)){\n return false;\n }\n return true;\n}", "function isAlphabetCharacter(letter) {\n return (letter.length === 1) && /[a-z]/i.test(letter);\n}", "function isAlnum(char) {\n return char >= 'A' && char <= 'Z' ||\n char >= 'a' && char <= 'z' ||\n isDigit(char);\n}", "function isAlphaNum(c){\r\n return /^\\w$/.test(c);\r\n}", "function isAlpha(aChar) {\n myCharCode = aChar.charCodeAt(0);\n\n if (((myCharCode > 64) && (myCharCode < 91)) ||\n ((myCharCode > 96) && (myCharCode < 123))) {\n return true;\n }\n\n return false;\n}", "function isAlphaNumeric(char) {\n var code = char.charCodeAt(0);\n if (!(code > 47 && code < 58) && !(code > 64 && code < 91) && !(code > 96 && code < 123)) {\n return false;\n }\n return true;\n}", "function isChar (code) {\n\t// http://www.cambiaresearch.com/articles/15/javascript-char-codes-key-codes\n\treturn code === 32 || (code > 46 && !(code >= 91 && code <= 123) && code !== 144 && code !== 145);\n}", "function isLetter(c) {\n\treturn isUppercase(c) || isLowercase(c) || c==32;\n}", "function isAlnum(char) {\n return char >= 'A' && char <= 'Z' ||\n char >= 'a' && char <= 'z' ||\n isDigit(char);\n}", "function isAlnum(char) {\n return char >= 'A' && char <= 'Z' ||\n char >= 'a' && char <= 'z' ||\n isDigit(char);\n}", "function isAlnum(char) {\n return char >= 'A' && char <= 'Z' ||\n char >= 'a' && char <= 'z' ||\n isDigit(char);\n}", "function isAlnum(char) {\n return char >= 'A' && char <= 'Z' ||\n char >= 'a' && char <= 'z' ||\n isDigit(char);\n}", "function isAlnum(char) {\n return char >= 'A' && char <= 'Z' ||\n char >= 'a' && char <= 'z' ||\n isDigit(char);\n}", "function isAlnum(char) {\n return char >= 'A' && char <= 'Z' ||\n char >= 'a' && char <= 'z' ||\n isDigit(char);\n}", "function isAlnum(char) {\n return char >= 'A' && char <= 'Z' ||\n char >= 'a' && char <= 'z' ||\n isDigit(char);\n}", "function isAlphaNumeric(char) {\n var code = char.charCodeAt(0);\n if (!(code > 47 && code < 58) &&\n !(code > 64 && code < 91) &&\n !(code > 96 && code < 123)) {\n return false\n }\n return true\n}", "function isDigitOrAlphabetChar(c) {\nreturn ((c>='0' && c<='9') || (c>='a' && c<='z') || (c>='A' && c<='Z'));\n}", "function isLetter(code) {\n return isUppercaseLetter(code) || isLowercaseLetter(code);\n}", "function alphanumeric(alphane)\n{\n\tvar numaric = alphane;\n\tif(numaric=='')\n\t\treturn false;\n\t\n\tfor(var j=0; j<numaric.length; j++)\n\t{\n\t\t var alphaa = numaric.charAt(j);\n\t\t var hh = alphaa.charCodeAt(0);\n\t\t if((hh > 47 && hh<58) || (hh > 64 && hh<91) || (hh > 96 && hh<123))\n\t\t {\n\t\t }\n\t\t else\n\t\t {\n //alert(\"Your Alpha Numeric Test Failed\");\n\t\t\t return false;\n\t\t }\n \t}\n //alert(\"Your Alpha Numeric Test Passed\");\n return true;\n}", "function areValidChars(char){\n for(var i=0; i<char.length; i++){\n if(alphabet.indexOf(char[i]) == -1 && char[i] != '_' && char[i] != '\\\\'){\n return char[i];\n }\n }\n return true;\n}", "function areCharsOrLetters(theString) {\n var regSpecialChar = /[`!@#$%^&*()_+\\-=\\[\\]{};':\"\\\\|,.<>\\/?~]/\n var isChar = regSpecialChar.test(theString)\n var isLetter = theString.match(/[a-z]/i)\n if (isChar != false && isLetter != null) {\n return true\n } else if (isLetter != null) {\n return true\n } else if (isChar != false) {\n return true\n } else {\n return false\n }\n}", "function isAlphaNumeric(char) {\n let code = char.charCodeAt(0);\n if ( !(code > 47 && code < 58) && // numeric(1-9)\n !(code > 64 && code < 91) && // uppercase alphabets(A-Z)\n !(code > 96 && code < 123)) { // lowercase alphabets(a-z)\n return false;\n }\n return true;\n}", "function isAlpha(text) {\n\t\tif (text.length === 1) {\n\t\t\tif (alphabet.indexOf(text) !== false)\n\t\t\t\treturn true;\n\t\t} return false;\n\t}", "function isAlphaNumeric(char) {\n let code = char.charCodeAt(0);\n if(!(code > 47 && code < 58) && //numeric (0-9)\n !(code > 64 && code < 91) && //upper alpha (A-Z)\n !(code > 96 && code < 123)) { //lower alpha (a-z)\n return false\n }\n return true\n}", "function isAlphabet(str) {\n var code, i, len;\n\n for (i = 0, len = str.length; i < len; i++) {\n code = str.charCodeAt(i);\n if (\n !(code > 64 && code < 91) && // upper alpha (A-Z)\n !(code > 96 && code < 123)\n ) {\n // lower alpha (a-z)\n return false;\n }\n }\n return true;\n}", "function isLetter(char) {\r\n return char.match(/[a-z]/i);\r\n}", "function isalphanumeric(str)\r\n{\r\n\tvar bReturn = true;\r\n\tvar valid=\"0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ_-\";\r\n\tvar invalidfirst = \"_-\";\r\n\tvar invalidlast = \"_-\";\r\n\tfor (var i=0; i<str.length; i++) \r\n\t{\r\n\t\tif ( i == 0 && (invalidfirst.indexOf(str.charAt(i)) > 0))\r\n\t\t{\r\n\t\t\tbReturn = false;\r\n\t\t\tbreak;\r\n\t\t}\r\n\t\telse if ( i == (str.length-1) && (invalidlast.indexOf(str.charAt(i)) > 0))\r\n\t\t{\r\n\t\t\tbReturn = false;\r\n\t\t\tbreak;\r\n\t\t}\r\n\t\telse if (valid.indexOf(str.charAt(i)) < 0)\r\n\t\t{\r\n\t\t\tbReturn = false;\r\n\t\t\tbreak;\r\n\t\t}\r\n\t}\r\n\treturn(bReturn);\r\n}", "function isAlphabeticString(string) {\n var isNotEmpty = !isEmpty(string);\n var doesNotContainDigits = !CONTAINS_DIGIT_REGEX.test(string);\n var doesNotContainInvalidChars = !/[\\{\\}\\(\\)_\\$#\"'@\\|!\\?\\+\\*%<>/]/.test(string);\n return isNotEmpty && doesNotContainDigits && doesNotContainInvalidChars;\n}", "function isLetter(char){\n\treturn char.match(/[a-z]/i);\n}", "function isAlnum(ch) {\n if ((ch >= \"a\" && ch <= \"z\") || (ch == \"&\") || (ch >= \"A\" && ch <= \"Z\") || (ch >= \"0\" && ch <=\"9\")) {\n return true;\n } else {\n return false;\n }\n}", "function isAsciiCodeAlphabet(charCode) {\n let isUpper = (charCode >= UPPER_A_CODE &&\n charCode <= UPPER_Z_CODE);\n\n let isLower = (charCode >= LOWER_A_CODE &&\n charCode <= LOWER_Z_CODE);\n\n return (isUpper || isLower);\n}", "function isAlphaNum(code) {\n return (code >= 0x30 /* 0 */ && code <= 0x39 /* 9 */) ||\n (code >= 0x41 /* A */ && code <= 0x5A /* Z */) ||\n (code >= 0x61 /* a */ && code <= 0x7A /* z */);\n}", "function isAlphaNum(code) {\n return (code >= 0x30 /* 0 */ && code <= 0x39 /* 9 */) ||\n (code >= 0x41 /* A */ && code <= 0x5A /* Z */) ||\n (code >= 0x61 /* a */ && code <= 0x7A /* z */);\n}", "function isAlphaNum(code) {\n return (code >= 0x30 /* 0 */ && code <= 0x39 /* 9 */) ||\n (code >= 0x41 /* A */ && code <= 0x5A /* Z */) ||\n (code >= 0x61 /* a */ && code <= 0x7A /* z */);\n }", "function isAlphanumeric(unsafeText) {\n var regex = /^[a-z0-9-_\\/&\\?=;]+$/i;\n return regex.test(unsafeText);\n}", "function isalpha(char) {\n return /^[A-Z]$/i.test(char);\n}", "function alphabetical(character) {\n var code = typeof character === 'string' ? character.charCodeAt(0) : character;\n return code >= 97 && code <= 122 /* a-z */ || code >= 65 && code <= 90 /* A-Z */;\n}", "function isLetter(char) {\n const alphabet = 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ';\n return alphabet.includes(char);\n }", "function alphanumeric(str){\n var regex1 = /\\w/g\n var regex2 = /[^a-zA-Z0-9]/g\n if (str.match(regex2)){\n return false\n } \n else return regex1.test(str)\n \n \n }", "function sc_isCharAlphabetic(c)\n { return sc_isCharOfClass(c.val, SC_LOWER_CLASS) ||\n\t sc_isCharOfClass(c.val, SC_UPPER_CLASS); }", "valid(c) { return Character.isAlphabetic(c) || c=='+'||c=='/' }", "function isLetter(str) {\n return str.length === 1 && str.match(/[a-z]/i);\n}", "function isLetter(str) {\n return str.length === 1 && str.match(/[a-z]/i);\n}", "function isLetter(str) {\n return str.length === 1 && str.match(/[a-z]/i);\n}", "function isLetter(ch) {\n if (ch.match(/[a-zA-Z]/i)) {\n return true;\n } else {\n return false;\n }\n}", "function alphanumeric(inputtxt) {\n var letterNumber = /^[0-9a-zA-Z]+$/;\n if(inputtxt.match(letterNumber)){\n return true;\n } else { \n return false; \n }\n}", "function isNotAlphabets(str)\n{\n\tfor (var i = 0; i < str.length; i++)\n\t{\n\t\tvar ch = str.substring(i, i + 1);\n\t\tif((ch < \"a\" || \"z\" < ch) && (ch < \"A\" || \"Z\" < ch)) \n\t\t{\n\t\t\treturn true;\n\t\t}\n\t}\n\treturn false;\n}", "function valid_alphabhet(alphabet) {\n var pola = new RegExp(/^[a-z A-Z]+$/);\n return pola.test(alphabet);\n }", "function isAlpha(characters) {\n return /^[A-Z ]*$/.test(characters);\n}", "function isLetter(str) {\r\n\tvar re = /[^a-zA-Z]/g;\r\n\tif (re.test(str)) {\r\n\t\treturn false;\r\n\t}\r\n\treturn true;\r\n}", "function isLetter (c)\r\n{ return ( ((c >= \"a\") && (c <= \"z\")) || ((c >= \"A\") && (c <= \"Z\")) )\r\n}", "function isLetter (c)\r\n{ return ( ((c >= \"a\") && (c <= \"z\")) || ((c >= \"A\") && (c <= \"Z\")) )\r\n}", "function isLetterOrDigit (c)\r\n{ return (isLetter(c) || isDigit(c))\r\n}", "function isLetterOrDigit (c)\r\n{ return (isLetter(c) || isDigit(c))\r\n}", "function checkString( text ) {\n\tvar str= text.value.toString();\n\tvar len=str.length;\n\tvar check = true;\n\tvar err = \"\";\n\tfor(var i=0; i<len; i++)\n\t{\n\t\tif(! ( (str.charAt(i)>='a' && str.charAt(i)<='z') || (str.charAt(i)>='A' && str.charAt(i)<='Z') || str.charAt(i)==' ' ) )\n\t\t{\n\t\t\tcheck= false;\n\t\t}\n\t}\n\tif( check == false)\n\t{\n\t\t\terr=\"Only Alphabets Allowed\";\n\t\t} else {\n\t\t\terr=\"\";\n\t\t}\n\treturn err;\n}", "function isAlphanumeric (s)\r\n\r\n{ var i;\r\n\r\n if (isEmpty(s))\r\n if (isAlphanumeric.arguments.length == 1) return defaultEmptyOK;\r\n else return (isAlphanumeric.arguments[1] == true);\r\n\r\n // Search through string's characters one by one\r\n // until we find a non-alphanumeric character.\r\n // When we do, return false; if we don't, return true.\r\n\r\n for (i = 0; i < s.length; i++)\r\n {\r\n // Check that current character is number or letter.\r\n var c = s.charAt(i);\r\n\r\n if (! (isLetter(c) || isDigit(c) ) )\r\n return false;\r\n }\r\n\r\n // All characters are numbers or letters.\r\n return true;\r\n}", "function isAlphanumeric (s)\r\n\r\n{ var i;\r\n\r\n if (isEmpty(s))\r\n if (isAlphanumeric.arguments.length == 1) return defaultEmptyOK;\r\n else return (isAlphanumeric.arguments[1] == true);\r\n\r\n // Search through string's characters one by one\r\n // until we find a non-alphanumeric character.\r\n // When we do, return false; if we don't, return true.\r\n\r\n for (i = 0; i < s.length; i++)\r\n {\r\n // Check that current character is number or letter.\r\n var c = s.charAt(i);\r\n\r\n if (! (isLetter(c) || isDigit(c) ) )\r\n return false;\r\n }\r\n\r\n // All characters are numbers or letters.\r\n return true;\r\n}", "function isAlNum(str)\n {\n var letterNumber = /^[0-9a-zA-Z]+$/;\n if( str.match(letterNumber) )\n return true;\n return false;\n }", "function isLowerCaseAlphaKey(charCode) {\n return (charCode >= 97 && charCode <= 122);\n }", "function onlyLetters(input) {\n\tinput = input.toUpperCase();\n\tfor (var i = 0; i < input.length; i++) {\n\t\tif (input[i] > 'Z' || input[i] < 'A')\n\t\t\treturn false\n\t}\n\treturn true;\n}", "function ValidateAlphanumeric(alphanumeric) {\n var myRegEx = /[^a-z\\d]/i;\n var isValid = !(myRegEx.test(alphanumeric));\n return isValid;\n}", "function isLetter(str) {\r\n\tif (str.length === 1 && str.match(/[a-z]/i)) {\r\n\t\treturn true;\r\n\t} else {\r\n\t\treturn false;\r\n\t}\r\n}", "function isAlpha (ch){\n return /^[A-Z]$/i.test(ch);\n }", "function isAlphaNumericCharacter(character) {\n var characterCode = character.charCodeAt(0);\n return ((48 /* '0' */ <= characterCode && characterCode <= 57) /* '9' */ ||\n (65 /* 'A' */ <= characterCode && characterCode <= 90) /* 'Z' */ ||\n (97 /* 'a' */ <= characterCode && characterCode <= 122) /* 'z' */);\n }", "function isAlpha (ch){\n return /^[A-Z]$/i.test(ch);\n }", "function isValidalphanumeric(name) {\n var alphaExp = /^([a-zA-Z0-9 ]+)$/;\n if (name.match(alphaExp))\n return true;\n else\n return false;\n}", "function isAlphaNum(code) {\n\t return (code >= 0x30 /* 0 */ && code <= 0x39 /* 9 */) ||\n\t (code >= 0x41 /* A */ && code <= 0x5A /* Z */) ||\n\t (code >= 0x61 /* a */ && code <= 0x7A /* z */);\n\t}", "function alphanumerical(character) {\n return alphabetical(character) || decimal(character);\n}", "function isAlphabetic(string) {\n\treturn isAlphabetic1(string, true);\n}", "function containsOnlyLetters(input)\n{\n\treturn /^[a-zA-Z]/.test(input.replace(/\\s/g, ''));\n}", "function isAlpha(str) {\n var code = void 0,\n i = void 0,\n len = void 0;\n for (i = 0, len = str.length; i < len; i++) {\n code = str.charCodeAt(i);\n if (!(code > 64 && code < 91) && // upper alpha (A-Z)\n !(code > 96 && code < 123)) {\n // lower alpha (a-z)\n return false;\n }\n }\n return true;\n}", "function alphabetical(character) {\n var code = typeof character === 'string' ? character.charCodeAt(0) : character\n\n return (\n (code >= 97 && code <= 122) /* a-z */ ||\n (code >= 65 && code <= 90) /* A-Z */\n )\n}", "function alphabetical(character) {\n var code = typeof character === 'string' ? character.charCodeAt(0) : character\n\n return (\n (code >= 97 && code <= 122) /* a-z */ ||\n (code >= 65 && code <= 90) /* A-Z */\n )\n}", "function alphabetical(character) {\n var code = typeof character === 'string' ? character.charCodeAt(0) : character\n\n return (\n (code >= 97 && code <= 122) /* a-z */ ||\n (code >= 65 && code <= 90) /* A-Z */\n )\n}", "function alphabetical(character) {\n var code = typeof character === 'string' ? character.charCodeAt(0) : character\n\n return (\n (code >= 97 && code <= 122) /* a-z */ ||\n (code >= 65 && code <= 90) /* A-Z */\n )\n}", "function alphabetical(character) {\n var code = typeof character === 'string' ? character.charCodeAt(0) : character\n\n return (\n (code >= 97 && code <= 122) /* a-z */ ||\n (code >= 65 && code <= 90) /* A-Z */\n )\n}", "function alphabetical(character) {\n var code = typeof character === 'string' ? character.charCodeAt(0) : character\n\n return (\n (code >= 97 && code <= 122) /* a-z */ ||\n (code >= 65 && code <= 90) /* A-Z */\n )\n}", "function alphabetical(character) {\n var code = typeof character === 'string' ? character.charCodeAt(0) : character\n\n return (\n (code >= 97 && code <= 122) /* a-z */ ||\n (code >= 65 && code <= 90) /* A-Z */\n )\n}", "function isLetterAndNumeric(str) {\r\n\tvar re = /[^a-zA-Z0-9-]/g;\r\n\tif (re.test(str)) {\r\n\t\treturn false;\r\n\t}\r\n\treturn true;\r\n}", "function isLetters(input){\n for(let i = 0; i < input.length; i++){\n if(input.charAt(i) < 10){\n return false;\n break;\n }\n }\n }", "function isLetter(input){\n return /^[a-zA-Z()]*$/.test(input);\n}", "function isIdentifierChar(code) {\n\t if (code < 48) return code === 36;\n\t if (code < 58) return true;\n\t if (code < 65) return false;\n\t if (code < 91) return true;\n\t if (code < 97) return code === 95;\n\t if (code < 123) return true;\n\t if (code <= 0xffff) return code >= 0xaa && nonASCIIidentifier.test(String.fromCharCode(code));\n\t return isInAstralSet(code, astralIdentifierStartCodes) || isInAstralSet(code, astralIdentifierCodes);\n\t}" ]
[ "0.802424", "0.7736312", "0.7566067", "0.75558513", "0.75211525", "0.7503225", "0.749414", "0.7483334", "0.744038", "0.74399394", "0.74377126", "0.7417362", "0.74167305", "0.73692375", "0.73620534", "0.73524463", "0.734858", "0.73418355", "0.73360133", "0.7333281", "0.73219025", "0.73219025", "0.73219025", "0.73219025", "0.73219025", "0.73219025", "0.73219025", "0.7318089", "0.7311198", "0.7310001", "0.72736275", "0.7272709", "0.7262224", "0.72229534", "0.72163886", "0.7207799", "0.72048724", "0.71974033", "0.71953255", "0.7184459", "0.7176929", "0.71730095", "0.7171841", "0.7161736", "0.7161736", "0.7131431", "0.71294034", "0.7123985", "0.7123408", "0.71168774", "0.710643", "0.70886093", "0.70764095", "0.70731574", "0.70731574", "0.7069435", "0.7065215", "0.706326", "0.706294", "0.70587766", "0.70373476", "0.7035141", "0.7029676", "0.7029676", "0.70237756", "0.70237756", "0.70194876", "0.7017964", "0.7017964", "0.7007222", "0.70065916", "0.700658", "0.6999342", "0.6998556", "0.69852936", "0.6984714", "0.6979942", "0.6979729", "0.69649357", "0.69604796", "0.6956201", "0.69478935", "0.69472694", "0.6935533", "0.6935533", "0.6935533", "0.6935533", "0.6935533", "0.6935533", "0.6935533", "0.6931979", "0.692698", "0.6903849", "0.6900459" ]
0.6999468
77
Check whether a node is mergeable with adjacent nodes.
function mergeable(node) { var start; var end; if (node.type !== 'text' || !node.position) { return true; } start = node.position.start; end = node.position.end; /* Only merge nodes which occupy the same size as their * `value`. */ return start.line !== end.line || end.column - start.column === node.value.length; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function mergeable(node) {\n var start\n var end\n\n if (node.type !== 'text' || !node.position) {\n return true\n }\n\n start = node.position.start\n end = node.position.end\n\n // Only merge nodes which occupy the same size as their `value`.\n return (\n start.line !== end.line || end.column - start.column === node.value.length\n )\n}", "_mergePossible( edge ) {\n\n\t\tconst polygon = edge.polygon;\n\t\tlet currentEdge = edge.twin;\n\n\t\tdo {\n\n\t\t\t// we can only use an edge to merge two regions if the adjacent region does not have any edges\n\t\t\t// apart from edge.twin already connected to the region.\n\n\t\t\tif ( currentEdge !== edge.twin && currentEdge.twin.polygon === polygon ) return false;\n\n\t\t\tcurrentEdge = currentEdge.next;\n\n\t\t} while ( edge.twin !== currentEdge );\n\n\t\treturn true;\n\n\t}", "isNodeOrChildOf(otherNode) {\n let current = this;\n while (current) {\n if (current === otherNode) {\n return true;\n }\n current = current.parent;\n }\n return false;\n }", "hasEdge(node1, node2) {\n const list = this.lists[node1];\n if (list == null) {\n return false;\n }\n // once we got the list of successors, we look for node2\n for (let i = 0; i < list.getSize(); i++) {\n if (list.get(i) === node2) {\n return true;\n }\n }\n }", "isMergeable(register) {\n if (this._registers.length === 0) {\n return true;\n }\n return this.address + this.nbRegisters === register.address;\n }", "function mayWorkFor(node1, node2) {\n if (!(node1 instanceof go.Node)) return false; // must be a Node\n if (node1 === node2) return false; // cannot work for yourself\n if (node2.isInTreeOf(node1)) return false; // cannot work for someone who works for you\n return true;\n }", "areCousins(node1, node2) {}", "function isAdjacent (a ,b) {\n\t\t\tif (b.index === a.index) {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t\tif (b.adjacent.indexOf(a.index) !== -1) {\n\t\t\t\treturn true;\n\t\t\t}\n\t\t\tif (a.adjacent.length >= a.edgesCount) {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t\tif (b.adjacent.length >= b.edgesCount) {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t\tfor (var v=0, l=a.vertices.length; v<l; v++) {\n\t\t\t\tvar result = b.vertices.indexOf(a.vertices[v]);\n\n\t\t\t\tif (result >= 0) {\n\t\t\t\t\tif (b.vertices.indexOf(a.vertices[((v - 1) + l) % l]) !== -1) {\n\t\t\t\t\t\ta.adjacent.push(b.index);\n\t\t\t\t\t\tb.adjacent.push(a.index);\n\t\t\t\t\t\treturn true;\n\t\t\t\t\t}\n\t\t\t\t\tif (b.vertices.indexOf(a.vertices[(v + 1) % l]) !== -1) {\n\t\t\t\t\t\ta.adjacent.push(b.index);\n\t\t\t\t\t\tb.adjacent.push(a.index);\n\t\t\t\t\t\treturn true;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn false;\n\t\t}", "function isConnectedLink(node, link) {\n //link.source and link.target is invalid as it had been automatically replaced with real data.\n if (link.target.index == node.index || link.source.index == node.index)\n return true;\n return false;\n }", "isConnected(nodeA, nodeB) {\n return this.data.get(nodeA).includes(nodeB)\n }", "areCousins(node1, node2) {\n\n }", "areCousins(node1, node2) {\n\n }", "function ancestoryTest(node1, node2) {\n var tmp = node1;\n while (tmp) {\n if (tmp === node2) return true;\n tmp = tmp.parent;\n }\n tmp = node2;\n while (tmp) {\n if (tmp === node1) return true;\n tmp = tmp.parent;\n }\n return false;\n }", "canMergeCells() {\n if (this.selection.isEmpty || !this.selection.start.paragraph.isInsideTable || !this.selection.end.paragraph.isInsideTable) {\n return false;\n }\n let startPos = this.selection.start;\n let endPos = this.selection.end;\n if (!this.selection.isForward) {\n startPos = this.selection.end;\n endPos = this.selection.start;\n }\n let startCell = this.getOwnerCell(this.selection.isForward);\n let endCell = this.getOwnerCell(!this.selection.isForward);\n let containerCell = this.selection.getContainerCellOf(startCell, endCell);\n if (containerCell.ownerTable.contains(endCell)) {\n if (!this.selection.containsCell(containerCell, endCell)) {\n startCell = this.selection.getSelectedCell(startCell, containerCell);\n endCell = this.selection.getSelectedCell(endCell, containerCell);\n let rowSpan = 1;\n if (startCell.ownerRow === endCell.ownerRow) {\n let startCellIndex = startCell.ownerRow.childWidgets.indexOf(startCell);\n for (let i = startCellIndex; i <= startCell.ownerRow.childWidgets.indexOf(endCell); i++) {\n let cell = startCell.ownerRow.childWidgets[i];\n let prevCell = cell.previousWidget;\n if (i !== startCellIndex) {\n if (cell.cellFormat.rowSpan !== rowSpan) {\n return false;\n }\n if (!isNullOrUndefined(prevCell)\n && cell.columnIndex !== (prevCell.cellFormat.columnSpan + prevCell.columnIndex)) {\n return false;\n }\n }\n rowSpan = cell.cellFormat.rowSpan;\n }\n return true;\n }\n return this.canMergeSelectedCellsInTable(startCell.ownerTable, startCell, endCell);\n }\n }\n return false;\n }", "function isBalanced(node) {\n if (!node) return 0;\n\n var left = isBalanced(node.left);\n var right = isBalanced(node.right);\n\n if (left === false || right === false) {\n return false;\n } else if (Math.abs(left - right) > 1) {\n return false;\n } else {\n return Math.max(left, right) + 1;\n }\n}", "function isTreeEdge(tree,u,v){return tree.hasEdge(u,v)}", "addEdge(e){\n\t\tif (e.getEnd() !== undefined){\n\t\t\treturn true\n\t\t}\n\t\telse return false\n }", "addEdge(e){\n\t\tif (e.getEnd() !== undefined){\n\t\t\treturn true\n\t\t}\n\t\telse return false\n }", "canReplaceWith (node) {\n if (node.name !== this.name)\n return false\n\n // gather up all the deps of this node and that are only depended\n // upon by deps of this node. those ones don't count, since\n // they'll be replaced if this node is replaced anyway.\n const depSet = gatherDepSet([this], e => e.to !== this && e.valid)\n\n for (const edge of this.edgesIn) {\n // only care about edges that don't originate from this node\n if (!depSet.has(edge.from) && !edge.satisfiedBy(node))\n return false\n }\n\n return true\n }", "function hasNodeCollision(node1, node2)\n {\n if (node1.position.side != node2.position.side) return false;\n\n return Math.abs(node1.position.top - node2.position.top) < (nodeHeight);\n }", "validateNode(node) {\n // should never have parent or child pointers reference self\n if ([node.parent, node.left, node.right].indexOf(node.id) !== -1) {\n return false;\n }\n // validate height and balance\n let hl = (node.left) ? this.nodes[node.left].height : -1;\n let hr = (node.right) ? this.nodes[node.right].height : -1;\n let eh = 1 + Math.max(hl, hr);\n if (node.height !== eh) {\n return false;\n }\n if (node.balance !== hr - hl) {\n return false;\n }\n // verify any siblings parent back to self\n if (node.siblings.length > 0) {\n for (let sid of node.siblings) {\n if (this.nodes[sid].parent !== node.id)\n return false;\n }\n }\n // if there is a left child, verify it parents to self and recurse it\n if (node.left) {\n if (this.nodes[node.left].parent !== node.id) {\n return false;\n }\n if (!this.validateNode(this.nodes[node.left])) {\n return false;\n }\n }\n // if there is a right child, verify it parents to self and recurse it\n if (node.right) {\n if (this.nodes[node.right].parent !== node.id) {\n return false;\n }\n if (!this.validateNode(this.nodes[node.right])) {\n return false;\n }\n }\n return true;\n }", "function uunodehas(node, // @param Node: child node\r\n context) { // @param Node: context(parent) node\r\n // @return Boolean:\r\n for (var c = node; c && c !== context;) {\r\n c = c.parentNode;\r\n }\r\n return node !== context && c === context;\r\n}", "function checkConnectionBetweenProps( target1, target2, excludedNodes ) {\n\tconst { subNodes: subNodes1, prevNodeMap: prevNodeMap1 } = Object(_getsubnodes__WEBPACK_IMPORTED_MODULE_0__[\"default\"])( target1, excludedNodes.subNodes );\n\tconst { subNodes: subNodes2, prevNodeMap: prevNodeMap2 } = Object(_getsubnodes__WEBPACK_IMPORTED_MODULE_0__[\"default\"])( target2, excludedNodes.subNodes );\n\n\tfor ( const sharedNode of subNodes1 ) {\n\t\tif ( subNodes2.has( sharedNode ) ) {\n\t\t\tconst connection = [];\n\n\t\t\tconnection.push( sharedNode );\n\n\t\t\tlet node = prevNodeMap1.get( sharedNode );\n\n\t\t\twhile ( node && node !== target1 ) {\n\t\t\t\tconnection.push( node );\n\t\t\t\tnode = prevNodeMap1.get( node );\n\t\t\t}\n\n\t\t\tnode = prevNodeMap2.get( sharedNode );\n\n\t\t\twhile ( node && node !== target2 ) {\n\t\t\t\tconnection.unshift( node );\n\t\t\t\tnode = prevNodeMap2.get( node );\n\t\t\t}\n\n\t\t\tconsole.log( '--------' );\n\t\t\tconsole.log( { target1 } );\n\t\t\tconsole.log( { sharedNode } );\n\t\t\tconsole.log( { target2 } );\n\t\t\tconsole.log( { connection } );\n\n\t\t\treturn true;\n\t\t}\n\t}\n\n\treturn false;\n}", "function shouldReallyMerge(a, b) {\n return a.kind === b.kind && (a.kind !== 225 /* ModuleDeclaration */ || areSameModule(a, b));\n // We use 1 NavNode to represent 'A.B.C', but there are multiple source nodes.\n // Only merge module nodes that have the same chain. Don't merge 'A.B.C' with 'A'!\n function areSameModule(a, b) {\n if (a.body.kind !== b.body.kind) {\n return false;\n }\n if (a.body.kind !== 225 /* ModuleDeclaration */) {\n return true;\n }\n return areSameModule(a.body, b.body);\n }\n }", "function isAncestor(relationship){\n return relationship.depth == relationship.distance;\n}", "function checkConnectionBetweenProps(target1, target2, excludedNodes) {\n var _Object = Object(_getsubnodes__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(target1, excludedNodes.subNodes),\n subNodes1 = _Object.subNodes,\n prevNodeMap1 = _Object.prevNodeMap;\n\n var _Object2 = Object(_getsubnodes__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(target2, excludedNodes.subNodes),\n subNodes2 = _Object2.subNodes,\n prevNodeMap2 = _Object2.prevNodeMap;\n\n var _iterator471 = _createForOfIteratorHelper(subNodes1),\n _step471;\n\n try {\n for (_iterator471.s(); !(_step471 = _iterator471.n()).done;) {\n var sharedNode = _step471.value;\n\n if (subNodes2.has(sharedNode)) {\n var connection = [];\n connection.push(sharedNode);\n var node = prevNodeMap1.get(sharedNode);\n\n while (node && node !== target1) {\n connection.push(node);\n node = prevNodeMap1.get(node);\n }\n\n node = prevNodeMap2.get(sharedNode);\n\n while (node && node !== target2) {\n connection.unshift(node);\n node = prevNodeMap2.get(node);\n }\n\n console.log('--------');\n console.log({\n target1: target1\n });\n console.log({\n sharedNode: sharedNode\n });\n console.log({\n target2: target2\n });\n console.log({\n connection: connection\n });\n return true;\n }\n }\n } catch (err) {\n _iterator471.e(err);\n } finally {\n _iterator471.f();\n }\n\n return false;\n }", "static isHoppable(root) {\n const { outEdges } = root; \n if (root.val === null) return true;\n if (outEdges.length === 0) return false;\n for(let i = 0; i < outEdges.length; i++) {\n const edge = outEdges[i];\n const { toVertex } = edge;\n if (Graph.isHoppable(toVertex) === true) {\n return true;\n }\n }\n return false;\n }", "conflictExists () {\n if (! this.nodes || this.nodes.length <= 1) {\n return false;\n }\n\n const alignments = {};\n\n for (let i = 0; i < this.nodes.length; i++) {\n const ti = this.nodes[i];\n\n if (! ti.active) {\n continue;\n }\n\n // If another faction exists, then conflict exists.\n if (! alignments[ti.alignment] && Object.keys(alignments).length >= 1) {\n return true;\n }\n\n alignments[ti.alignment] = true;\n }\n\n return false;\n }", "isSameNode(otherNode) {\n return this.unique === otherNode.unique;\n }", "function checkConnectionBetweenProps(target1, target2, excludedNodes) {\n var _Object = Object(_getsubnodes__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(target1, excludedNodes.subNodes),\n subNodes1 = _Object.subNodes,\n prevNodeMap1 = _Object.prevNodeMap;\n\n var _Object2 = Object(_getsubnodes__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(target2, excludedNodes.subNodes),\n subNodes2 = _Object2.subNodes,\n prevNodeMap2 = _Object2.prevNodeMap;\n\n var _iterator504 = _createForOfIteratorHelper(subNodes1),\n _step504;\n\n try {\n for (_iterator504.s(); !(_step504 = _iterator504.n()).done;) {\n var sharedNode = _step504.value;\n\n if (subNodes2.has(sharedNode)) {\n var connection = [];\n connection.push(sharedNode);\n var node = prevNodeMap1.get(sharedNode);\n\n while (node && node !== target1) {\n connection.push(node);\n node = prevNodeMap1.get(node);\n }\n\n node = prevNodeMap2.get(sharedNode);\n\n while (node && node !== target2) {\n connection.unshift(node);\n node = prevNodeMap2.get(node);\n }\n\n console.log('--------');\n console.log({\n target1: target1\n });\n console.log({\n sharedNode: sharedNode\n });\n console.log({\n target2: target2\n });\n console.log({\n connection: connection\n });\n return true;\n }\n }\n } catch (err) {\n _iterator504.e(err);\n } finally {\n _iterator504.f();\n }\n\n return false;\n }", "function isOverlap(element1, element2, direction) {\n if (direction === Direction.Right)\n return element2.y < element1.y + element1.height && element2.y + element2.height > element1.y;\n else if (direction === Direction.Down)\n return element2.x < element1.x + element1.width && element2.x + element2.width > element1.x;\n return false;\n}", "static edgeExists(n1, n2){\n \n if(edges.length == 0){\n return false;\n }else if(n1.localeCompare(n2) < 0){ //If p1 < p2\n for(var i = 0; i < edges.length; i++){\n if(String(edges[i]).localeCompare(n1 + n2) == 0){\n return true; \n }\n return false;\n }\n }else if(n1.localeCompare(n2)){ //If p1 > p2\n for(var i = 0; i < edges.length; i++){\n if(String(edges[i]).localeCompare(n2 + n1) == 0){\n return true; \n }\n return false;\n }\n }\n \n return true;\n }", "oppositeNode(node) {\n if (this.inputNode === node) {\n return this.outputNode;\n } else if (this.outputNode === node) {\n return this.inputNode;\n }\n\n return;\n }", "adjacent(from, to) {\n // Convert squares to numbers\n let rankFrom = parseInt(from[1]);\n let fileFrom = FILES.indexOf(from[0]);\n let rankTo = parseInt(to[1]);\n let fileTo = FILES.indexOf(to[0]);\n\n // Go through all possible neighbours and check for adjacency\n for (let i = rankFrom - 1; i <= rankFrom + 1; i++) {\n for (let j = fileFrom - 1; j <= fileFrom + 1; j++) {\n if (i === rankTo && j === fileTo) return true;\n }\n }\n // If we made it through the loops without returning, it's not adjacent\n return false;\n }", "function isConnected(a, b) {\r\n return linkedByIndex[a.index + \",\" + b.index] || linkedByIndex[b.index + \",\" + a.index] || a.index == b.index;\r\n }", "function is_ancestor(node, target)\n{\n while (target.parentNode) {\n target = target.parentNode;\n if (node == target)\n return true;\n }\n return false;\n}", "function isConnection() {\n return state.core.isConnection(state.nodes[_id].node);\n }", "function checkConnectionBetweenProps(target1, target2, excludedNodes) {\n var _ref84 = (0, _getsubnodes__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(target1, excludedNodes.subNodes),\n subNodes1 = _ref84.subNodes,\n prevNodeMap1 = _ref84.prevNodeMap;\n\n var _ref85 = (0, _getsubnodes__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(target2, excludedNodes.subNodes),\n subNodes2 = _ref85.subNodes,\n prevNodeMap2 = _ref85.prevNodeMap;\n\n var _iterator471 = _createForOfIteratorHelper(subNodes1),\n _step471;\n\n try {\n for (_iterator471.s(); !(_step471 = _iterator471.n()).done;) {\n var sharedNode = _step471.value;\n\n if (subNodes2.has(sharedNode)) {\n var connection = [];\n connection.push(sharedNode);\n var node = prevNodeMap1.get(sharedNode);\n\n while (node && node !== target1) {\n connection.push(node);\n node = prevNodeMap1.get(node);\n }\n\n node = prevNodeMap2.get(sharedNode);\n\n while (node && node !== target2) {\n connection.unshift(node);\n node = prevNodeMap2.get(node);\n }\n\n console.log('--------');\n console.log({\n target1: target1\n });\n console.log({\n sharedNode: sharedNode\n });\n console.log({\n target2: target2\n });\n console.log({\n connection: connection\n });\n return true;\n }\n }\n } catch (err) {\n _iterator471.e(err);\n } finally {\n _iterator471.f();\n }\n\n return false;\n }", "function isInGraph(node) {\n var n = node;\n while (n !== null && n.parentElement !== n) {\n if (n.tagName === 'svg') return true;\n n = n.parentElement;\n }\n return false;\n}", "checkIfEdgeExists(fromVertex, toVertex) {\n return (fromVertex.edges.includes(toVertex) && toVertex.edges.includes(fromVertex));\n }", "areNodesEqual(nodeA, nodeB) {\n if (!nodeA && !nodeB) return true;\n if ((!nodeA && nodeB) || (nodeA && !nodeB)) return false;\n return (\n nodeA.key === nodeB.key &&\n nodeA.value === nodeB.value &&\n nodeA.isActive === nodeB.isActive\n );\n }", "function areOverlapping(r1, r2) {\n\tif (inRange(r1.x, r2.x, r2.x + r2.w) && inRange(r1.y, r2.y, r2.y + r2.h)) {\n\t\treturn true;\n\t} else {\n\t\treturn false;\n\t}\t\n}", "contains(target) {\n if (this.value === target) return true;\n if (this.value > target) {\n const leftNode = this.left;\n if (leftNode && leftNode.contains(target)) return true;\n } else {\n const rightNode = this.right;\n if (rightNode && rightNode.contains(target)) return true;\n }\n return false;\n }", "function is_subtree(root, root_r) {\n // the variables below will hold the values:\n // 4-30-10-6\n // 4-30-10-6-26-3-3\n var inord1 = in_order(root, []).join(\"-\");\n var inord2 = in_order(root_r, []).join(\"-\");\n\n // 10-4-30-6\n // 26-10-4-30-6-3-3\n var preord1 = pre_order(root, []).join(\"-\");\n var preord2 = pre_order(root_r, []).join(\"-\");\n\n // check if the left tree is contained with the right tree\n return inord2.indexOf(inord1) !== -1 && preord2.indexOf(preord1) !== -1;\n}", "function isConnected(a, b) {\n\t\t return linked[a.index + \", \" + b.index] || linked[b.index + \", \" + a.index];\n\t\t}", "_isNodeInList(node)\n {\n for(let ancestor of this.nodeList)\n {\n\n // nodeList can contain both DOM nodes and widgets (actors). If this is a widget,\n // see if the node is within the widget's tree.\n if(ancestor instanceof Actor)\n {\n for(let rootNode of ancestor.getRoots())\n if(helpers.html.isAbove(rootNode, node))\n return true;\n }\n else\n {\n // node is just a DOM node.\n if(helpers.html.isAbove(ancestor, node))\n return true;\n }\n }\n return false;\n }", "function merge_nodes(source_node_id, target_node_id, consequences) {\n if (consequences.status != null && consequences.status == 'ok') {\n merge_node(source_node_id, target_node_id);\n if (consequences.checkalign != null) {\n // Remove all prior checkmerge button groups\n $('[id*=\"nomerge\"]').parent().remove();\n // Remove all leftover temp relations\n $('.checkalign').remove();\n $.each(consequences.checkalign, function(index, node_ids) {\n var ids_text = node_ids[0] + '-' + node_ids[1];\n var merge_id = 'merge-' + ids_text;\n // Make a checkmerge button if there isn't one already, for this pair\n if ($('#' + merge_id).length == 0) {\n var temp_relation = draw_relation(node_ids[0], node_ids[1], {\n color: \"#89a02c\",\n class: \"checkalign\"\n });\n var sy = parseInt(temp_relation.children('path').attr('d').split('C')[0].split(',')[1]);\n var ey = parseInt(temp_relation.children('path').attr('d').split(' ')[2].split(',')[1]);\n var yC = ey + ((sy - ey) / 2);\n // TODO: compute xC to be always the same distance to the amplitude of the curve\n var xC = parseInt(temp_relation.children('path').attr('d').split(' ')[1].split(',')[0]);\n var svg = $('#svgenlargement').children('svg').svg('get');\n parent_g = svg.group($('#svgenlargement svg g'));\n var yes = svg.image(parent_g, xC, (yC - 8), 16, 16, merge_button_yes, {\n id: merge_id\n });\n var no = svg.image(parent_g, (xC + 20), (yC - 8), 16, 16, merge_button_no, {\n id: 'no' + merge_id\n });\n $(yes).hover(function() {\n $(this).addClass('draggable')\n // Indicate which nodes are active\n get_ellipse(node_ids[0]).attr('fill', '#9999ff');\n get_ellipse(node_ids[1]).attr('fill', '#9999ff');\n }, function() {\n $(this).removeClass('draggable');\n var colorme = $('#update_workspace_button').data('locked') ? color_active : color_inactive;\n colorme(get_ellipse(node_ids[0]));\n colorme(get_ellipse(node_ids[1]));\n });\n $(no).hover(function() {\n $(this).addClass('draggable')\n }, function() {\n $(this).removeClass('draggable')\n });\n $(yes).click(function(evt) {\n // node_ids[0] is the one that goes away\n merge_node(rid2node[node_ids[0]], rid2node[node_ids[1]]);\n temp_relation.remove();\n $(evt.target).parent().remove();\n // remove any suggestions that involve the removed node\n $('[id*=\"-' + node_ids[0] + '\"]').parent().remove();\n $('.checkalign[id*=\"' + rid2node[node_ids[0]] + '\"]').remove();\n //notify backend\n var ncpath = getTextURL('merge');\n var form_values = \"source=\" + node_ids[0] + \"&target=\" + node_ids[1] + \"&single=true\";\n $.post(ncpath, form_values);\n });\n $(no).click(function(evt) {\n temp_relation.remove();\n $(evt.target).parent().remove();\n });\n }\n });\n }\n }\n}", "hasCycle() {\n const numOfNodes = this.nodes.size;\n const numOfEdges = this.getNumOfEdges();\n const numOfConnectedComponents = this.getNumOfConnectedComponents();\n return numOfEdges > numOfNodes - numOfConnectedComponents;\n }", "function adjacent (object, other) {\n for (var exit in Rooms[object.position].exits) {\n if (other.position === Rooms[object.position].exits[exit]) {\n return exit;\n }\n }\n return false;\n}", "isNextTo(other) {\n const leftOrRight = (this.x === other.x - 1 || this.x === other.x + 1) && this.y === other.y;\n const upOrDown = (this.y === other.y - 1 || this.y === other.y + 1) && this.x === other.x;\n return leftOrRight || upOrDown;\n }", "function isAdjacent(x1, y1, x2, y2) {\n var dx = Math.abs(x1 - x2),\n dy = Math.abs(y1 - y2);\n\n return (dx + dy === 1);\n }", "function traverse(node, item, offset) {\n\t\tif(overlaps(node, item)) {\n\t\t\tif(iterate(siblingIndex.get(offset+1), item, offset+1)) {\n\t\t\t\treturn true;\n\t\t\t}\n\n\t\t\tappend(node, item, offset);\n\t\t\treturn true;\n\t\t}\n\t\treturn false;\n\t}", "function visit(g, node, stack, visited) {\n if (visited[node] == 2) {\n return true;\n } else if (visited[node] == 1) {\n return false;\n }\n visited[node] = 1;\n for (let neighbor of g[node]) {\n if (visit(g, neighbor, stack, visited) == false) {\n return false;\n }\n }\n stack.push(node);\n visited[node] = 2;\n return true;\n}", "collidedBy(obj) {\n if (obj.left > this.right ||\n obj.top > this.bottom ||\n obj.right < this.left ||\n obj.bottom < this.top)\n return false;\n \n return true;\n }", "function isNodeInDOM(node) {\n var ancestor = node;\n while (ancestor.parentNode) {\n ancestor = ancestor.parentNode;\n }\n // ancestor should be a document\n return !!ancestor.body;\n }", "function hasRoadConnection(x, y) {\n var road_connections = ['Road', 'Bridge', 'Settlement'];\n var tile = Game.terrain[x][y];\n var road = Game.roads[x][y];\n for (var i=0; i<road_connections.length; i++) {\n if (tile.has(road_connections[i]) || (road !== undefined && road !== null)) return true;\n }\n return false;\n }", "isWhereMergeable(a, b) {\n for (let key in a) {\n let valueA = a[key];\n if (key in b) {\n let valueB = b[key];\n if (typeof valueA === 'object' && typeof valueB === 'object') {\n if (!this.isWhereMergeable(valueA, valueB)) {\n // console.log(valueA, valueB, key, false);\n return false;\n }\n } else {\n // console.log(valueA, valueB, key, false, 1);\n return false;\n }\n }\n }\n\n return true;\n }", "hasCycleFrom(start) {\n const stack = [{ node: start, visited: new Set([start]), lastVisited: null }];\n while (stack.length) {\n const current = stack.pop();\n for (let node of current.node.adjacent.values()) {\n if (current.lastVisited != node) {\n if (current.visited.has(node)) return true;\n else {\n const visited = new Set([...current.visited]);\n visited.add(node);\n stack.push({ node: node, visited: visited, lastVisited: current.node });\n }\n }\n }\n }\n return false;\n }", "function isAdjacent (x1, y1, x2, y2) {\n var dx = Math.abs(x1 - x2),\n dy = Math.abs(y1 - y2);\n return (dx + dy === 1);\n }", "forEachNodeAndEdgeByStage(cb) {\n const nstages = this.nodeEdgeStages.length;\n let r;\n for (let s = 0; s < nstages; s++) {\n const stageNodes = this.nodeEdgeStages[s].nodes;\n const stageEdges = this.nodeEdgeStages[s].edges;\n for (let i = 0; i < stageNodes.length; i++) {\n r = cb(stageNodes[i], s, i);\n if (r === false) { return false; }\n }\n for (let i = 0; i < stageEdges.length; i++) {\n r = cb(stageEdges[i], s, i);\n if (r === false) { return false; }\n }\n }\n return r;\n }", "function isBalanced(node) {\n return isBalancedNode(node).balanced;\n}", "within(a, b) {\n\t\tconst min = this.displayPosition;\n\t\tconst max = new NPoint(min.x + this.nodeDiv.clientWidth, min.y + this.nodeDiv.clientHeight);\n\t\treturn (min.x >= a.x && max.x <= b.x && min.y >= a.y && max.y <= b.y);\n\t}", "within(a, b) {\n\t\tconst min = this.displayPosition;\n\t\tconst max = new NPoint(min.x + this.nodeDiv.clientWidth, min.y + this.nodeDiv.clientHeight);\n\t\treturn (min.x >= a.x && max.x <= b.x && min.y >= a.y && max.y <= b.y);\n\t}", "isValidNode(node) {\n return this.validNodes.includes(node)\n }", "function isBlockwithChildren(event) {\n if (event.overlaped == true) {\n for (var key in overlappedEvents) {\n if (key == event._id) {\n var arr = overlappedEvents[key];\n if (arr !== undefined && arr != null && arr.length > 0) {\n return true;\n }\n }\n }\n }\n return false\n}", "function isEquivalentPosition(node, off, targetNode, targetOff) {\n return targetNode ? (scanFor(node, off, targetNode, targetOff, -1) ||\n scanFor(node, off, targetNode, targetOff, 1)) : false;\n}", "_isOverlap (segA, segB) {\n\t\tvar _isBefore = (segA.end >= segB.start && segA.start <= segB.end + 1);\n\t\tvar _isAfter = (segA.start <= segB.end + 1 && segA.end >= segB.start);\n\t\tvar _isSame = (segA === segB);\n\t\treturn ((_isBefore || _isAfter) && (!_isSame));\n\t}", "function isChildOf(node1, node2) { // Node.prototype.isChildOf\n\twhile (node1.parentNode) {\n\t\tif (node1.parentNode == node2) return true;\n\t\tnode1 = node1.parentNode;\n\t}\n\treturn false;\n}", "function checkForCollision(element, nextElement) {\n //return true if collison found\n\n var overlapFlag = false;\n if (element.start >= nextElement.start && element.start <= nextElement.end || nextElement.start >= element.start && nextElement.start <= element.end) {\n overlapFlag = true;\n }\n if (element.end >= nextElement.start && element.end <= nextElement.end || nextElement.end >= element.start && nextElement.end <= element.end) {\n overlapFlag = true;\n }\n return overlapFlag;\n\n\n}", "function isNestable(arr1, arr2) {\n let arr1Min = Math.min(...arr1),\n arr2Min = Math.min(...arr2),\n arr1Max = Math.max(...arr1),\n arr2Max = Math.max(...arr2)\n\n return arr1Min > arr2Min && arr1Max < arr2Max\n}", "function checkIfWeCanGoDeeper () {\n return trieRemainderPath.length > 0 && !isExternalLink(currentNode)\n }", "function pathsHaveMet(nodeA, nodeB) {\n if (!nodeA.visitedBy || !nodeB.visitedBy) {\n return false\n }\n return nodeA.visitedBy !== nodeB.visitedBy\n}", "function isDescendant(relationship){\n return -relationship.depth == relationship.distance\n}", "_isOverlappingExisting(x, y, w, h) {\n if(!this._positions.length) return false;\n let over = false;\n this._positions.forEach((item) => {\n if (!(item.x > x + w ||\n item.x + item.width < x ||\n item.y > y + h ||\n item.y + item.height < y)) over = true;\n });\n\n return over;\n }", "function isAdjacent(tile_1,tile_2){\n\tvar i1 = tile_1.coord.x;\n\tvar j1 = tile_1.coord.y;\n\tvar\ti2 = tile_2.coord.x;\n\tvar j2 = tile_2.coord.y;\n\tif(i1==i2 && j1==j2+1)\n\t\treturn true;\n\telse if(i1==i2 && j1==j2-1)\n\t\treturn true;\n\telse if(j1==j2 && i1==i2+1)\n\t\treturn true;\n\telse if(j1==j2 && i1==i2-1)\n\t\treturn true;\n\telse if(i1==i2-1 && j1==j2-1)\n\t\treturn true;\n\telse if(i1==i2-1 && j1==j2+1)\n\t\treturn true;\n\telse if(i1==i2+1 && j1==j2-1)\n\t\treturn true;\n\telse if(i1==i2+1 && j1==j2+1)\n\t\treturn true;\n\telse\n\t\treturn false;\n}", "function areEqualNodes(node1, node2) {\n return node1.row === node2.row && node1.column === node2.column;\n}", "function neighboring(a, b) {\n console.log(a);\n console.log(b);\n console.log(linkedByIndex);\n return linkedByIndex[a.id + \",\" + b.id] || linkedByIndex[b.id + \",\" + a.id] || a.id == b.id;\n}", "function isSuperBalanced(baseNode) {\n let maxHeight = 0, minHeight = 0;\n let currHeight = 0;\n // the stack also stores the height of each node\n const stack = [{node: baseNode, height: 0}];\n\n while (stack.length) {\n if (maxHeight - minHeight > 1) {return false;\n }\n const nodeObj = stack.pop();\n currHeight = nodeObj.height;\n const node = nodeObj.node;\n\n if (!node.left && !node.right) {\n if (currHeight > maxHeight) {\n maxHeight = currHeight;\n }\n if (currHeight < minHeight) {\n minHeight = currHeight;\n }\n } else {\n if (node.right) {stack.push({node: node.right, height: currHeight + 1});}\n if (node.left) {stack.push({node: node.left, height: currHeight + 1});}\n }\n }\n\n return (maxHeight - minHeight <= 1);\n}", "function overlap(b1, b2){\r\n if (dist(b1, b2) < b1.r + b2.r){\r\n return true;\r\n }\r\n return false;\r\n}", "connects(candidate, edge) {\n return ((candidate && edge) && (candidate.a.x == edge.a.x && candidate.a.y == edge.a.y ||\n candidate.a.x == edge.b.x && candidate.a.y == edge.b.y ||\n candidate.b.x == edge.a.x && candidate.b.y == edge.a.y ||\n candidate.b.x == edge.b.x && candidate.b.y == edge.b.y)) \n }", "contains(data) { \n if (this.data === data) {\n return true;\n } else if (this.comparator(this.data,data)) { \n // minor optimization, if this is not true then no child of this node\n // can contain the target data\n return this.getLeftChild().contains(data) || this.getRightChild().contains(data);\n } else {\n return false;\n }\n }", "function isNodeInView(node) {\n var yOffset = window.scrollY || window.pageYOffset,\n w = {\n top: yOffset,\n bottom : yOffset + window.innerHeight\n },\n bodyRect = document.body.getBoundingClientRect(),\n elemRect = node.getBoundingClientRect(),\n offset = elemRect.top - bodyRect.top + shrinkOffsetForViewDetection,\n nodeHeight = offset + node.offsetHeight - (shrinkOffsetForViewDetection * 2);\n return offset > w.top && offset < w.bottom || // is top frame in view\n nodeHeight > w.top && nodeHeight < w.bottom || // is bottom frame in view\n offset < w.top && nodeHeight > w.bottom; // is top frame above view and bottom frame below view\n}", "function checkNeighbourNode(parent, node, mode){\n\tif((grid[node.x][node.y] > 0 && grid[node.x][node.y].group == 2) || grid[node.x][node.y] == -1){\n\t\treturn false;\n\t}\n\tvar distance;\n\tif(mode == 0){\n\t\tdistance = unitDistance;\n\t}else{\n\t\tdistance = diagDistance;\n\t\t// NO cutting corners of a wall if moving diagonally\n\t\tswitch(mode){\n\t\t\tcase 1:\n\t\t\t\tvar n1 = {\n\t\t\t\t\tx : node.x,\n\t\t\t\t\ty : node.y + 1\n\t\t\t\t}\n\t\t\t\tvar n2 = {\n\t\t\t\t\tx : node.x + 1,\n\t\t\t\t\ty : node.y\n\t\t\t\t}\n\t\t\t\tif(grid[n1.x][n1.y] != -1 || grid[n2.x][n2.y] != -1){\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\tcase 2:\n\t\t\t\tvar n1 = {\n\t\t\t\t\tx : node.x - 1,\n\t\t\t\t\ty : node.y\n\t\t\t\t}\n\t\t\t\tvar n2 = {\n\t\t\t\t\tx : node.x,\n\t\t\t\t\ty : node.y + 1\n\t\t\t\t}\n\t\t\t\tif(grid[n1.x][n1.y] != -1 || grid[n2.x][n2.y] != -1){\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\tcase 3:\n\t\t\t\tvar n1 = {\n\t\t\t\t\tx : node.x,\n\t\t\t\t\ty : node.y - 1\n\t\t\t\t}\n\t\t\t\tvar n2 = {\n\t\t\t\t\tx : node.x + 1,\n\t\t\t\t\ty : node.y\n\t\t\t\t}\n\t\t\t\tif(grid[n1.x][n1.y] != -1 || grid[n2.x][n2.y] != -1){\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\tcase 4:\n\t\t\t\tvar n1 = {\n\t\t\t\t\tx : node.x - 1,\n\t\t\t\t\ty : node.y\n\t\t\t\t}\n\t\t\t\tvar n2 = {\n\t\t\t\t\tx : node.x,\n\t\t\t\t\ty : node.y - 1\n\t\t\t\t}\n\t\t\t\tif(grid[n1.x][n1.y] != -1 || grid[n2.x][n2.y] != -1){\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t}\n\t}\n\tvar tempG = parent.g + distance;\n\tvar isInOpen = grid[node.x][node.y];\n\tif(isInOpen > 0 && isInOpen.group != 1){\t// if node is not in openSet\n\t\t// openSet.push(node);\n\t\tgrid[node.x][node.y].group = 1;\n\t\topenCounter++;\n\t\topenSetCoord.push(node);\n\t\tanimateNode(node, 1);\n\t}else if(tempG < isInOpen.g){\n\t\tgrid[node.x][node.y].g = tempG;\n\t\tgrid[node.x][node.y].parentX = parent.x;\n\t\tgrid[node.x][node.y].parentY = parent.y;\n\t}\n\treturn true;\n}", "connected(n1, n2) {\n console.log(\"Testing connection between \" + n1 + ' and ' + n2);\n return (this.root(n1) == this.root(n2));\n }", "valid_connection(target) {\n return this.source.level < CONSTANTS.MAXIMUM_CELL_LEVEL &&\n // To allow `valid_connection` to be used to simply check whether the source is valid,\n // we ignore source–target compatibility if `target` is null.\n // We allow cells to be connected even if they do not have the same level. This is\n // because it's often useful when drawing diagrams, even if it may not always be\n // semantically valid.\n (target === null || target.level < CONSTANTS.MAXIMUM_CELL_LEVEL);\n }", "function doesOverlap(e1, e2) {\n if (e1.start > e2.start) {\n [e1, e2] = [e2, e1];\n }\n if (e1.end <= e2.start) {\n return false;\n }\n return true;\n}", "hasNeighbor(tile) {\n return Boolean(this.getAdjacentDirection(tile));\n }", "isAdjacent(tile){\n\t\tif(Math.abs(tile.pos - emptyTile.pos) === 1 || Math.abs(tile.pos - emptyTile.pos) === this.cols) {\n\t\t\treturn true;\n\t\t}\n\t\telse {\n\t\t\treturn false;\n\t\t}\n\t}", "function isConnected(a, b) {\n let c1 = indexLink[a.index + \"|\" + b.index];\n let c2 = indexLink[b.index + \"|\" + a.index];\n return (c1 || c2);\n }", "function isAncestor(instA, instB) {\n\t !('_nativeNode' in instA) ? process.env.NODE_ENV !== 'production' ? invariant(false, 'isAncestor: Invalid argument.') : invariant(false) : void 0;\n\t !('_nativeNode' in instB) ? process.env.NODE_ENV !== 'production' ? invariant(false, 'isAncestor: Invalid argument.') : invariant(false) : void 0;\n\t\n\t while (instB) {\n\t if (instB === instA) {\n\t return true;\n\t }\n\t instB = instB._nativeParent;\n\t }\n\t return false;\n\t}", "function isAncestor(instA, instB) {\n\t !('_nativeNode' in instA) ? process.env.NODE_ENV !== 'production' ? invariant(false, 'isAncestor: Invalid argument.') : invariant(false) : void 0;\n\t !('_nativeNode' in instB) ? process.env.NODE_ENV !== 'production' ? invariant(false, 'isAncestor: Invalid argument.') : invariant(false) : void 0;\n\t\n\t while (instB) {\n\t if (instB === instA) {\n\t return true;\n\t }\n\t instB = instB._nativeParent;\n\t }\n\t return false;\n\t}", "function isAncestor(instA, instB) {\n\t !('_nativeNode' in instA) ? process.env.NODE_ENV !== 'production' ? invariant(false, 'isAncestor: Invalid argument.') : invariant(false) : void 0;\n\t !('_nativeNode' in instB) ? process.env.NODE_ENV !== 'production' ? invariant(false, 'isAncestor: Invalid argument.') : invariant(false) : void 0;\n\t\n\t while (instB) {\n\t if (instB === instA) {\n\t return true;\n\t }\n\t instB = instB._nativeParent;\n\t }\n\t return false;\n\t}", "function is_subtree(root, root_r) {\n // vars will hold values:\n // 4 - 30 - 10 - 6\n // 4 - 30 - 10 - 6 - 26 - 3 - 3\n var inord1 = in_order(root, []).join(\"-\");\n var inord2 = in_order(root_r, []).join(\"-\");\n\n // 10 - 4 - 30 - 6\n // 26 - 10 - 4 - 30 - 6 - 3 - 3\n var preord1 = pre_order(root, []). join(\"-\")\n var preord2 = pre_order(root_r, []). join(\"-\")\n\n // check if tree1 is containde in tree2\n return inord2.indexOf(inord1) !== -1 && preord2.indexOf(preord1) !== -1;\n}", "function isTreeEdge(tree, u, v) {\n return tree.hasEdge(u, v);\n}", "function isTreeEdge(tree, u, v) {\n return tree.hasEdge(u, v);\n}" ]
[ "0.71366274", "0.6259624", "0.6230327", "0.62284565", "0.61179906", "0.60289866", "0.5804878", "0.57994366", "0.57488364", "0.5739582", "0.56976324", "0.56976324", "0.56863534", "0.56215096", "0.56138355", "0.55904573", "0.55699676", "0.55699676", "0.5559757", "0.5553477", "0.5549079", "0.5529907", "0.5524623", "0.55158776", "0.5510619", "0.54767215", "0.546047", "0.54298085", "0.5424227", "0.5406968", "0.539734", "0.53970134", "0.53842056", "0.5379056", "0.53681487", "0.53624153", "0.5334663", "0.5334325", "0.53261703", "0.5318595", "0.53113776", "0.53102636", "0.53053904", "0.5292284", "0.52904975", "0.52780616", "0.5271906", "0.5266753", "0.5257195", "0.5255639", "0.52409995", "0.5240796", "0.522105", "0.52202296", "0.5209409", "0.5200732", "0.51958454", "0.5192139", "0.5189254", "0.518199", "0.51811093", "0.5174402", "0.5174402", "0.51628256", "0.51626515", "0.5162457", "0.5161269", "0.5161052", "0.5160812", "0.51561695", "0.5156127", "0.5137589", "0.5135471", "0.51345897", "0.513063", "0.51305395", "0.51297337", "0.5123267", "0.5113896", "0.51045287", "0.5103962", "0.5101467", "0.51014626", "0.5092939", "0.5084702", "0.5074217", "0.5067739", "0.50575435", "0.50559855", "0.50479347", "0.50479347", "0.50479347", "0.5043211", "0.5043073", "0.5043073" ]
0.7074309
6
Merge two text nodes: `node` into `prev`.
function mergeText(prev, node) { prev.value += node.value; return prev; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function mergeText(previous, node) {\n previous.value += node.value\n\n return previous\n}", "function mergeBlockquote(prev, node) {\n if (this.options.commonmark) {\n return node;\n }\n\n prev.children = prev.children.concat(node.children);\n\n return prev;\n}", "function mergeBlockquote(prev, node) {\n if (this.options.commonmark) {\n return node;\n }\n\n prev.children = prev.children.concat(node.children);\n\n return prev;\n}", "function mergeBlockquote(prev, node) {\n if (this.options.commonmark) {\n return node;\n }\n\n prev.children = prev.children.concat(node.children);\n\n return prev;\n}", "function mergeBlockquote(prev, node) {\n if (this.options.commonmark) {\n return node;\n }\n\n prev.children = prev.children.concat(node.children);\n\n return prev;\n}", "function mergeBlockquote(prev, node) {\n if (this.options.commonmark) {\n return node;\n }\n\n prev.children = prev.children.concat(node.children);\n\n return prev;\n}", "function mergeBlockquote(prev, node) {\n if (this.options.commonmark) {\n return node;\n }\n\n prev.children = prev.children.concat(node.children);\n\n return prev;\n}", "function mergeBlockquote(previous, node) {\n if (this.options.commonmark || this.options.gfm) {\n return node\n }\n\n previous.children = previous.children.concat(node.children)\n\n return previous\n}", "set prev(node) {\n this._prev = Node.sanitizeNode(node, true);\n }", "function mergeTwoNodes(node1, node2) {\n node1.innerHTML = node1.innerHTML + node2.innerHTML\n return node1\n}", "function diffText(prev, next) {\n if (prev === undefined || next === undefined) return null;\n var offsets = getDiffOffsets(prev, next);\n if (offsets == null) return null;\n var insertText = sliceText(next, offsets);\n var removeText = sliceText(prev, offsets);\n return {\n start: offsets.start,\n end: prev.length - offsets.end,\n insertText,\n removeText\n };\n}", "function emitTagAndPreviousTextNode() {\n var textBeforeTag = html.slice(currentDataIdx, currentTag.idx);\n if (textBeforeTag) {\n // the html tag was the first element in the html string, or two \n // tags next to each other, in which case we should not emit a text \n // node\n onText(textBeforeTag, currentDataIdx);\n }\n if (currentTag.type === 'comment') {\n onComment(currentTag.idx);\n }\n else if (currentTag.type === 'doctype') {\n onDoctype(currentTag.idx);\n }\n else {\n if (currentTag.isOpening) {\n onOpenTag(currentTag.name, currentTag.idx);\n }\n if (currentTag.isClosing) { // note: self-closing tags will emit both opening and closing\n onCloseTag(currentTag.name, currentTag.idx);\n }\n }\n // Since we just emitted a tag, reset to the data state for the next char\n resetToDataState();\n currentDataIdx = charIdx + 1;\n }", "function emitTagAndPreviousTextNode() {\n var textBeforeTag = html.slice(currentDataIdx, currentTag.idx);\n if (textBeforeTag) {\n // the html tag was the first element in the html string, or two \n // tags next to each other, in which case we should not emit a text \n // node\n onText(textBeforeTag, currentDataIdx);\n }\n if (currentTag.type === 'comment') {\n onComment(currentTag.idx);\n }\n else if (currentTag.type === 'doctype') {\n onDoctype(currentTag.idx);\n }\n else {\n if (currentTag.isOpening) {\n onOpenTag(currentTag.name, currentTag.idx);\n }\n if (currentTag.isClosing) { // note: self-closing tags will emit both opening and closing\n onCloseTag(currentTag.name, currentTag.idx);\n }\n }\n // Since we just emitted a tag, reset to the data state for the next char\n resetToDataState();\n currentDataIdx = charIdx + 1;\n }", "function diffText (previous, current, el) {\n\t if (current !== previous) el.data = current\n\t return el\n\t }", "function diffText (previous, current, el) {\n if (current.data !== previous.data) el.data = current.data\n return el\n }", "function prev(n){\n while((n = n.previousSibling) && n.nodeType != 1);\n return n;\n }", "function mergeTextNodes(data, coupleData, mode) {\n var prev = data.node;\n var next = data.node;\n var tagsMerged = mode === 'both' ? true : false;\n var remove = [];\n\n while (true) {\n prev = prev.previousSibling;\n if (!prev || prev.nodeType !== Node.TEXT_NODE) break;\n\n if (prev === coupleData.node) {\n tagsMerged = true;\n data.index += prev.nodeValue.length;\n data.node.nodeValue = prev.nodeValue + data.node.nodeValue;\n coupleData.node = data.node;\n } else if (prev.nodeValue.trim().length) {\n break;\n }\n\n remove.push(prev);\n }\n\n while (true) {\n next = next.nextSibling;\n if (!next || next.nodeType !== Node.TEXT_NODE) break;\n\n if (next === coupleData.node) {\n tagsMerged = true;\n coupleData.index += data.node.nodeValue.length;\n data.node.nodeValue = data.node.nodeValue + next.nodeValue;\n coupleData.node = data.node;\n } else if (next.nodeValue.trim().length) {\n break;\n }\n\n remove.push(next);\n }\n\n var parent = data.node.parentElement;\n for (var i = 0; i < remove.length; i++) {\n parent.removeChild(remove[i]);\n }\n\n return tagsMerged;\n}", "function prevNode(node) {\n if (!node) return null;\n if (node.previousSibling) {\n return previousDeep(node.previousSibling);\n }\n return node.parentNode;\n}", "function getRealPreviousSibling(node) {\n var prevSibling = node;\n do {\n prevSibling = prevSibling.previousSibling;\n } while (prevSibling && isEmptyTextNode(prevSibling));\n return prevSibling;\n}", "function GetPreviousTextNode(pNode) {\n\tvar lPreviuosSibling = false;\n\tvar lParent = pNode;\n\twhile(lParent){\n\t\tlPreviuosSibling = lParent.previousSibling;\n\t\twhile(lPreviuosSibling){\n\t\t\tif(lPreviuosSibling.nodeType == 3)\n\t\t\t\treturn lPreviuosSibling;\n\t\t\tif(lPreviuosSibling.nodeType == 1){\n\t\t\t\tvar lTextNode = GetLastTextNodeDescendant(lPreviuosSibling);\n\t\t\t\tif(lTextNode)\n\t\t\t\t\treturn lTextNode;\n\t\t\t}\n\t\t\tlPreviuosSibling = lPreviuosSibling.previousSibling;\n\t\t}\n\t\tlParent = lParent.parentNode;\n\t}\n\treturn false;\n}", "addText(text) {\n let nodes = this.top().content, last = nodes[nodes.length - 1]\n let node = this.schema.text(text, this.marks), merged\n if (last && (merged = maybeMerge(last, node))) nodes[nodes.length - 1] = merged\n else nodes.push(node)\n }", "function previousSibling(node) {\n var node = node.previousSibling;\n try {\n while(node.data) node = node.previousSibling;\n } catch(e) {}\n return node;\n}", "function prev(node) {\r\n var prev_node;\r\n\r\n assert(isElement(node), 'pklib.dom.prev: @node is not HTMLElement');\r\n\r\n while (true) {\r\n prev_node = node.previousSibling;\r\n if (prev_node !== undefined && prev_node !== null && prev_node.nodeType !== node_types.ELEMENT_NODE) {\r\n node = prev_node;\r\n } else {\r\n break;\r\n }\r\n }\r\n return prev_node;\r\n }", "replace(from, to, text) {\n let parts = [];\n this.decompose(0, from, parts, 2 /* Open.To */);\n if (text.length)\n text.decompose(0, text.length, parts, 1 /* Open.From */ | 2 /* Open.To */);\n this.decompose(to, this.length, parts, 1 /* Open.From */);\n return TextNode.from(parts, this.length - (to - from) + text.length);\n }", "function findPreviousText(node, offset, preTextToOriginWord) {\n let context = \"\";\n if (node instanceof Text) {\n context = node.textContent.trim();\n } else {\n context = node.innerText;\n }\n const previousDividerIndex = findLast(context.substring(0, offset), dividers);\n if (previousDividerIndex !== -1) {\n return context.substring(previousDividerIndex + 1, offset) + preTextToOriginWord;\n }\n \n const parentNode = node.parentNode;\n if (parentNode instanceof HTMLElement) {\n return \"\";\n }\n const parentOffset = calcOffset(node, parentNode);\n return findPreviousText(parentNode, parentOffset, preTextToOriginWord + context.substring(0, offset));\n}", "function concatTextNode(string, textNode){\n \t\treturn string.concat(textNode.textContent);\n \t}", "function insert_before(n1,n2){\r\n\tvar before = get_prev(n1);\r\n\tif(is_empty_node(before)){\r\n\t\tset_previous(n1,n2);\r\n\t\tset_next(n2,n1);\r\n\t\tset_previous(n2,empty_node);\r\n\t}else{\r\n\t\tset_next(before,n2);\r\n\t\tset_previous(n2,before);\r\n\t\tset_next(n2,n1);\r\n\t\tset_previous(n1,n2);\r\n\r\n\t}\r\n}", "function mergeTokens(a, b) {\n\ta.text += ' ' + b.text;\n\ta.normalised += ' ' + b.normalised;\n\ta.pos_reason += '|' + b.pos_reason;\n\ta.start = a.start || b.start;\n\ta.noun_capital = a.noun_capital || b.noun_capital;\n\ta.punctuated = a.punctuated || b.punctuated;\n\ta.end = a.end || b.end;\n\treturn a;\n}", "function getPreviousSibling(startBrother) {\n\tendBrother = startBrother.previousSibling;\n\twhile(endBrother.nodeType != 1) endBrother = endBrother.previousSibling;\n\treturn endBrother;\n}", "function addText(node, text) {\n node.appendChild(document.createTextNode(text));\n return node.lastChild;\n}", "prepend(value) {\n let node = new Node(value);\n node.next = this.root;\n\n this.root.prev = node;\n this.root = node;\n }", "function previousDeep(node) {\n if (!node) return null;\n while (node.childNodes.length) {\n node = node.lastChild;\n }\n return node;\n}", "function replaceNodeByText(node, text){\n\n node.parentNode.replaceChild( document.createTextNode(text), node );\n\n}", "insertAfterNode(ref){this.startNode=ref;this.endNode=ref.nextSibling}", "function prepend(elem,prev){var parent=elem.parent;if(parent){var childs=parent.children;childs.splice(childs.lastIndexOf(elem),0,prev);}if(elem.prev){elem.prev.next=prev;}prev.parent=parent;prev.prev=elem.prev;prev.next=elem;elem.prev=prev;}", "insertAfterNode(ref){this.startNode=ref;this.endNode=ref.nextSibling;}", "function setNodeText(node, text) {\n while (node.lastChild) {\n node.removeChild(node.lastChild);\n }\n\n node.appendChild(node.ownerDocument.createTextNode(text));\n}", "function removeSiblings(node) {\n if (!node || node.nodeType != Node.TEXT_NODE) return;\n removeSiblings(node.previousSibling);\n node.remove();\n }", "function update($, node) {\n if (node.type !== \"#\") {\n throw Error(\"Invalid update for a text node\");\n }\n if (node.text !== $.text) {\n $.text = node.text;\n $.domNode.nodeValue = $.text;\n }\n}", "function diffNode (path, entityId, prev, next, el) {\n // Type changed. This could be from element->text, text->ComponentA,\n // ComponentA->ComponentB etc. But NOT div->span. These are the same type\n // (ElementNode) but different tag name.\n if (prev.type !== next.type) return replaceElement(entityId, path, el, next)\n\n switch (next.type) {\n case 'text': return diffText(prev, next, el)\n case 'element': return diffElement(path, entityId, prev, next, el)\n case 'component': return diffComponent(path, entityId, prev, next, el)\n }\n }", "function linkNodes(node1, node2) {\n\tnode1.next = node2;\n\tnode2.prev = node1; \n}", "insertAfterNode(e){this.startNode=e,this.endNode=e.nextSibling}", "oppositeNode(node) {\n if (this.inputNode === node) {\n return this.outputNode;\n } else if (this.outputNode === node) {\n return this.inputNode;\n }\n\n return;\n }", "function appendText(text, node) {\n\tnode.appendChild(document.createTextNode(text));\n}", "function prepend(elem, prev) {\n var parent = elem.parent;\n if (parent) {\n var childs = parent.children;\n childs.splice(childs.lastIndexOf(elem), 0, prev);\n }\n if (elem.prev) {\n elem.prev.next = prev;\n }\n prev.parent = parent;\n prev.prev = elem.prev;\n prev.next = elem;\n elem.prev = prev;\n}", "function prepend(elem, prev) {\n removeElement(prev);\n var parent = elem.parent;\n if (parent) {\n var childs = parent.children;\n childs.splice(childs.indexOf(elem), 0, prev);\n }\n if (elem.prev) {\n elem.prev.next = prev;\n }\n prev.parent = parent;\n prev.prev = elem.prev;\n prev.next = elem;\n elem.prev = prev;\n }", "function endText(node) {\r\n if (!node.firstElementChild) {\r\n return node.innerHTML;\r\n } else {\r\n return endText(node.firstElementChild);\r\n }\r\n}", "function transformTextNodes(node) {\n node.childNodes.forEach((n)=>{\n console.log(n);\n if(n.nodeName === \"#text\"){\n console.log(n.nodeValue);\n n.nodeValue = n.nodeValue.split(\" \")\n .map((text)=>{\n if (!text.trim()) return text;\n // console.log(\"text =\" + text);\n if(text[text.length-1] == '\\n'){\n tmp = text.substr(0,text.length-1);\n return MATCH_LIST[tmp]?`${MATCH_LIST[tmp]}\\n`:text;\n }else{\n tmp = text;\n return MATCH_LIST[tmp]?`${MATCH_LIST[tmp]}`:text;\n }\n })\n .join(\" \");\n // console.log(node);\n }else{\n transformTextNodes(n);\n }\n })\n}", "function result_element_prepend(parent, child, next)\n{\n if(next == null)\n result_element_append(parent, child);\n else\n if(parent != null && child != null)\n {\n // insert child node before the next node:\n for(var i = 0; i < parent.content.length; i++)\n {\n if(parent.content[i] == next)\n {\n parent.content.splice(i, 0, child);\n return;\n }\n }\n }\n}", "function merge_text_nodes( jsonml ) {\n\t // skip the tag name and attribute hash\n\t var i = extract_attr( jsonml ) ? 2 : 1;\n\n\t while ( i < jsonml.length ) {\n\t // if it's a string check the next item too\n\t if ( typeof jsonml[ i ] === \"string\" ) {\n\t if ( i + 1 < jsonml.length && typeof jsonml[ i + 1 ] === \"string\" ) {\n\t // merge the second string into the first and remove it\n\t jsonml[ i ] += jsonml.splice( i + 1, 1 )[ 0 ];\n\t }\n\t else {\n\t ++i;\n\t }\n\t }\n\t // if it's not a string recurse\n\t else {\n\t merge_text_nodes( jsonml[ i ] );\n\t ++i;\n\t }\n\t }\n\t}", "function prepend(elem, prev) {\n removeElement(prev);\n var parent = elem.parent;\n if (parent) {\n var childs = parent.children;\n childs.splice(childs.indexOf(elem), 0, prev);\n }\n if (elem.prev) {\n elem.prev.next = prev;\n }\n prev.parent = parent;\n prev.prev = elem.prev;\n prev.next = elem;\n elem.prev = prev;\n}", "function prepend(elem, prev) {\n removeElement(prev);\n var parent = elem.parent;\n if (parent) {\n var childs = parent.children;\n childs.splice(childs.indexOf(elem), 0, prev);\n }\n if (elem.prev) {\n elem.prev.next = prev;\n }\n prev.parent = parent;\n prev.prev = elem.prev;\n prev.next = elem;\n elem.prev = prev;\n}", "function prepend(elem, prev) {\n removeElement(prev);\n var parent = elem.parent;\n if (parent) {\n var childs = parent.children;\n childs.splice(childs.indexOf(elem), 0, prev);\n }\n if (elem.prev) {\n elem.prev.next = prev;\n }\n prev.parent = parent;\n prev.prev = elem.prev;\n prev.next = elem;\n elem.prev = prev;\n}", "function prepend(elem, prev) {\n removeElement(prev);\n var parent = elem.parent;\n if (parent) {\n var childs = parent.children;\n childs.splice(childs.indexOf(elem), 0, prev);\n }\n if (elem.prev) {\n elem.prev.next = prev;\n }\n prev.parent = parent;\n prev.prev = elem.prev;\n prev.next = elem;\n elem.prev = prev;\n}", "function prepend(elem, prev) {\n removeElement(prev);\n var parent = elem.parent;\n if (parent) {\n var childs = parent.children;\n childs.splice(childs.indexOf(elem), 0, prev);\n }\n if (elem.prev) {\n elem.prev.next = prev;\n }\n prev.parent = parent;\n prev.prev = elem.prev;\n prev.next = elem;\n elem.prev = prev;\n}", "function modText(textNode) {\n textNode.nodeValue = findReplace(textNode.nodeValue);\n console.log(textNode);\n}", "function prepend(elem, prev) {\n removeElement(prev);\n const { parent } = elem;\n if (parent) {\n const childs = parent.children;\n childs.splice(childs.indexOf(elem), 0, prev);\n }\n if (elem.prev) {\n elem.prev.next = prev;\n }\n prev.parent = parent;\n prev.prev = elem.prev;\n prev.next = elem;\n elem.prev = prev;\n}", "function prepend(elem, prev) {\n removeElement(prev);\n var parent = elem.parent;\n if (parent) {\n var childs = parent.children;\n childs.splice(childs.indexOf(elem), 0, prev);\n }\n if (elem.prev) {\n elem.prev.next = prev;\n }\n prev.parent = parent;\n prev.prev = elem.prev;\n prev.next = elem;\n elem.prev = prev;\n}", "function prepend(elem, prev) {\n removeElement(prev);\n var parent = elem.parent;\n\n if (parent) {\n var childs = parent.children;\n childs.splice(childs.indexOf(elem), 0, prev);\n }\n\n if (elem.prev) {\n elem.prev.next = prev;\n }\n\n prev.parent = parent;\n prev.prev = elem.prev;\n prev.next = elem;\n elem.prev = prev;\n}", "function removeLeadingNewline(node) {\n if (node.nodeType !== 3 || node.nodeName !== '#text') {\n return;\n }\n\n node.nodeValue = node.nodeValue.replace(/^\\n/, '');\n }", "function insertNewLine(newLine, doc, pre, lineNum, lines, node, offset){\r\n//debug('inserting:')\r\n//debug(newLine+'nl');\r\n //if the node is the PRE node, with a BR node immediately ahead of it,\r\n //then the offset is really the number\r\n //of nodes down from the top we are, not a location in text\r\n //The line is blank - just insert new text.\r\n if(node.nodeName=='PRE' && node.childNodes[offset].nodeName=='BR' && node.childNodes[offset-1].nodeName=='BR'){\r\n //debug('the node is a pre');\r\n //debug(offset);\r\n //debug(offset-1);\r\n //debug(node.childNodes);\r\n //debug(node.childNodes[offset]);\r\n //debug(node.childNodes[offset-1]);\r\n var newTextNode = doc.createTextNode(newLine);\r\n //var newTextNode = doc.createTextNode(\"foo\");\r\n var newBR = doc.createElement('BR');\r\n //debug('pre - new text node');\r\n //debug(newTextNode);\r\n //debug(pre);\r\n //debug('offset');\r\n \r\n var o=pre.childNodes[offset];\r\n //debug(o);\r\n if(o.nextSibling){\r\n //debug('pre - has next sibling:');\r\n //debug(o.nextSibling);\r\n pre.insertBefore(newTextNode, o.nextSibling);\r\n }else{\r\n //this seems to work\r\n //debug('pre - append child');\r\n //debug(pre.childNodes);\r\n pre.insertBefore(newTextNode, o);\r\n }\r\n //debug('done inserting for pre');\r\n }else{\r\n // if the node is the end-of-line kind of PRE, then we just have to turn it\r\n // into a real node.\r\n// if (node.nodeName == 'PRE' && node.childNodes[offset].nodeName == 'BR' &&\r\n// node.childNodes[offset-1].nodeName != 'BR'){\r\n// debug('the node IS AN END-OF-LINE pre'); \r\n// }\r\n\r\n //the node and offset are normal, we can just reference the lines.\r\n //debug('the node is not a pre');\r\n var newBR = doc.createElement('BR');\r\n var newTextNode=doc.createTextNode(newLine);\r\n \r\n //debug('notpre - new text node');\r\n //debug(newTextNode);\r\n //debug(lines[lineNum]);\r\n //debug(lines[lineNum][0]);\r\n //debug(node);\r\n if(lineNum>0){ \r\n //for every line EXCEPT the first line, you need to reinsert a BR\r\n //for the first line, no BR is needed, it just starts on a #text node.\r\n //debug('insert br');\r\n pre.insertBefore(newBR, lines[lineNum][0]);\r\n }\r\n //debug('1 insert before');\r\n //debug(newTextNode.data+'end');\r\n pre.insertBefore(newTextNode, lines[lineNum][0]);\r\n //debug('2 insert before');\r\n for(n in lines[lineNum]){\r\n //debug('remove '+n);\r\n pre.removeChild(lines[lineNum][n]);\r\n }\r\n }\r\n\r\n}", "function atText(node) {\n var elem = node.cloneNode(true);\n for (var i = elem.childNodes.length - 1; i >= 0; i--) {\n if (elem.childNodes[i].tagName) elem.removeChild(elem.childNodes[i]);\n }\n return elem['innerText' in elem ? 'innerText' : 'textContent'];\n }", "function merge_text_nodes( jsonml ) {\n // skip the tag name and attribute hash\n var i = extract_attr( jsonml ) ? 2 : 1;\n\n while ( i < jsonml.length ) {\n // if it's a string check the next item too\n if ( typeof jsonml[ i ] === \"string\" ) {\n if ( i + 1 < jsonml.length && typeof jsonml[ i + 1 ] === \"string\" ) {\n // merge the second string into the first and remove it\n jsonml[ i ] += jsonml.splice( i + 1, 1 )[ 0 ];\n }\n else {\n ++i;\n }\n }\n // if it's not a string recurse\n else {\n merge_text_nodes( jsonml[ i ] );\n ++i;\n }\n }\n}", "function merge_text_nodes( jsonml ) {\n // skip the tag name and attribute hash\n var i = extract_attr( jsonml ) ? 2 : 1;\n\n while ( i < jsonml.length ) {\n // if it's a string check the next item too\n if ( typeof jsonml[ i ] === \"string\" ) {\n if ( i + 1 < jsonml.length && typeof jsonml[ i + 1 ] === \"string\" ) {\n // merge the second string into the first and remove it\n jsonml[ i ] += jsonml.splice( i + 1, 1 )[ 0 ];\n }\n else {\n ++i;\n }\n }\n // if it's not a string recurse\n else {\n merge_text_nodes( jsonml[ i ] );\n ++i;\n }\n }\n}", "function merge_text_nodes( jsonml ) {\n // skip the tag name and attribute hash\n var i = extract_attr( jsonml ) ? 2 : 1;\n\n while ( i < jsonml.length ) {\n // if it's a string check the next item too\n if ( typeof jsonml[ i ] === \"string\" ) {\n if ( i + 1 < jsonml.length && typeof jsonml[ i + 1 ] === \"string\" ) {\n // merge the second string into the first and remove it\n jsonml[ i ] += jsonml.splice( i + 1, 1 )[ 0 ];\n }\n else {\n ++i;\n }\n }\n // if it's not a string recurse\n else {\n merge_text_nodes( jsonml[ i ] );\n ++i;\n }\n }\n}", "function merge_text_nodes( jsonml ) {\n // skip the tag name and attribute hash\n var i = extract_attr( jsonml ) ? 2 : 1;\n\n while ( i < jsonml.length ) {\n // if it's a string check the next item too\n if ( typeof jsonml[ i ] === \"string\" ) {\n if ( i + 1 < jsonml.length && typeof jsonml[ i + 1 ] === \"string\" ) {\n // merge the second string into the first and remove it\n jsonml[ i ] += jsonml.splice( i + 1, 1 )[ 0 ];\n }\n else {\n ++i;\n }\n }\n // if it's not a string recurse\n else {\n merge_text_nodes( jsonml[ i ] );\n ++i;\n }\n }\n}", "function merge_text_nodes( jsonml ) {\n // skip the tag name and attribute hash\n var i = extract_attr( jsonml ) ? 2 : 1;\n\n while ( i < jsonml.length ) {\n // if it's a string check the next item too\n if ( typeof jsonml[ i ] === \"string\" ) {\n if ( i + 1 < jsonml.length && typeof jsonml[ i + 1 ] === \"string\" ) {\n // merge the second string into the first and remove it\n jsonml[ i ] += jsonml.splice( i + 1, 1 )[ 0 ];\n }\n else {\n ++i;\n }\n }\n // if it's not a string recurse\n else {\n merge_text_nodes( jsonml[ i ] );\n ++i;\n }\n }\n}", "function merge_text_nodes( jsonml ) {\n // skip the tag name and attribute hash\n var i = extract_attr( jsonml ) ? 2 : 1;\n\n while ( i < jsonml.length ) {\n // if it's a string check the next item too\n if ( typeof jsonml[ i ] === \"string\" ) {\n if ( i + 1 < jsonml.length && typeof jsonml[ i + 1 ] === \"string\" ) {\n // merge the second string into the first and remove it\n jsonml[ i ] += jsonml.splice( i + 1, 1 )[ 0 ];\n }\n else {\n ++i;\n }\n }\n // if it's not a string recurse\n else {\n merge_text_nodes( jsonml[ i ] );\n ++i;\n }\n }\n}", "function merge_text_nodes( jsonml ) {\n // skip the tag name and attribute hash\n var i = extract_attr( jsonml ) ? 2 : 1;\n\n while ( i < jsonml.length ) {\n // if it's a string check the next item too\n if ( typeof jsonml[ i ] === \"string\" ) {\n if ( i + 1 < jsonml.length && typeof jsonml[ i + 1 ] === \"string\" ) {\n // merge the second string into the first and remove it\n jsonml[ i ] += jsonml.splice( i + 1, 1 )[ 0 ];\n }\n else {\n ++i;\n }\n }\n // if it's not a string recurse\n else {\n merge_text_nodes( jsonml[ i ] );\n ++i;\n }\n }\n}", "function merge_text_nodes( jsonml ) {\n // skip the tag name and attribute hash\n var i = extract_attr( jsonml ) ? 2 : 1;\n\n while ( i < jsonml.length ) {\n // if it's a string check the next item too\n if ( typeof jsonml[ i ] === \"string\" ) {\n if ( i + 1 < jsonml.length && typeof jsonml[ i + 1 ] === \"string\" ) {\n // merge the second string into the first and remove it\n jsonml[ i ] += jsonml.splice( i + 1, 1 )[ 0 ];\n }\n else {\n ++i;\n }\n }\n // if it's not a string recurse\n else {\n merge_text_nodes( jsonml[ i ] );\n ++i;\n }\n }\n}", "function merge_text_nodes( jsonml ) {\n // skip the tag name and attribute hash\n var i = extract_attr( jsonml ) ? 2 : 1;\n\n while ( i < jsonml.length ) {\n // if it's a string check the next item too\n if ( typeof jsonml[ i ] === \"string\" ) {\n if ( i + 1 < jsonml.length && typeof jsonml[ i + 1 ] === \"string\" ) {\n // merge the second string into the first and remove it\n jsonml[ i ] += jsonml.splice( i + 1, 1 )[ 0 ];\n }\n else {\n ++i;\n }\n }\n // if it's not a string recurse\n else {\n merge_text_nodes( jsonml[ i ] );\n ++i;\n }\n }\n}", "function xWalkTreeRev( oNode, fnVisit, skip, data )\r\n{\r\n var r=null;\r\n if(oNode){if(oNode.nodeType==1&&oNode!=skip){r=fnVisit(oNode,data);if(r)return r;}\r\n for(var c=oNode.lastChild;c;c=c.previousSibling){if(c!=skip)r=xWalkTreeRev(c,fnVisit,skip,data);if(r)return r;}}\r\n return r;\r\n}", "function setText(node, text) {\n if (node.hasChildNodes() && node.firstChild.nodeType == Node.TEXT_NODE) {\n node.firstChild.nodeValue = text;\n } else {\n addText(node, text);\n }\n}", "function prevElementSibling(elem) {\n let { prev } = elem;\n while (prev !== null && !node_isTag(prev))\n ({ prev } = prev);\n return prev;\n}", "function setTextContent(node, text) {\n node[0].children[0].data = text;\n}", "reverseNode(node, prev) {\n var newNode = new Node(node.element, prev);\n if (node.next) {\n return this.reverseNode(node.next, newNode);\n } else {\n return newNode;\n }\n }", "function TextNode(text) {\n this.text = text;\n}", "function TextNode(text) {\n this.text = text;\n}", "function precedingNode(node) {\n if (node.ownerElement)\n return node.ownerElement;\n if (null != node.previousSibling) {\n node = node.previousSibling;\n while (null != node.lastChild) {\n node = node.lastChild;\n }\n return node;\n }\n if (null != node.parentNode) {\n return node.parentNode;\n }\n return null;\n }", "function precedingNode(node) {\n if (node.ownerElement)\n return node.ownerElement;\n if (null != node.previousSibling) {\n node = node.previousSibling;\n while (null != node.lastChild) {\n node = node.lastChild;\n }\n return node;\n }\n if (null != node.parentNode) {\n return node.parentNode;\n }\n return null;\n }", "function merge(target, source) {\n target.additionalNodes = target.additionalNodes || [];\n target.additionalNodes.push(source.node);\n if (source.additionalNodes) {\n (_a = target.additionalNodes).push.apply(_a, source.additionalNodes);\n }\n target.children = ts.concatenate(target.children, source.children);\n if (target.children) {\n mergeChildren(target.children);\n sortChildren(target.children);\n }\n var _a;\n }", "merge(data) {\n this.data = { text: this.data.text + data.text }\n }", "function et2_insertLinkText(_text, _node, _target)\n{\n\tif(!_node)\n\t{\n\t\tegw.debug(\"warn\", \"et2_insertLinkText called without node\", _text, _node, _target);\n\t\treturn;\n\t}\n\n\t// Clear the node\n\tfor (var i = _node.childNodes.length - 1; i >= 0; i--)\n\t{\n\t\t_node.removeChild(_node.childNodes[i]);\n\t}\n\n\tfor (var i = 0; i < _text.length; i++)\n\t{\n\t\tvar s = _text[i];\n\n\t\tif (typeof s == \"string\" || typeof s == \"number\")\n\t\t{\n\t\t\t// Include line breaks\n\t\t\tvar lines = s.split ? s.split('\\n') : [s];\n\n\t\t\t// Insert the lines\n\t\t\tfor (var j = 0; j < lines.length; j++)\n\t\t\t{\n\t\t\t\t_node.appendChild(document.createTextNode(lines[j]));\n\n\t\t\t\tif (j < lines.length - 1)\n\t\t\t\t{\n\t\t\t\t\t_node.appendChild(document.createElement(\"br\"));\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\telse if(s.text)\t// no need to generate a link, if there is no content in it\n\t\t{\n\t\t\tif(!s.href)\n\t\t\t{\n\t\t\t\tegw.debug(\"warn\", \"et2_activateLinks gave bad data\", s, _node, _target);\n\t\t\t\ts.href = \"\";\n\t\t\t}\n\t\t\tvar a = $j(document.createElement(\"a\"))\n\t\t\t\t.attr(\"href\", s.href)\n\t\t\t\t.text(s.text);\n\n\t\t\tif (typeof _target != \"undefined\" && _target && _target != \"_self\" && s.href.substr(0, 7) != \"mailto:\")\n\t\t\t{\n\t\t\t\ta.attr(\"target\", _target);\n\t\t\t}\n\t\t\t// open mailto links depending on preferences in mail app\n\t\t\tif (s.href.substr(0, 7) == \"mailto:\" &&\n\t\t\t\t(egw.user('apps').mail || egw.user('apps').felamimail) &&\n\t\t\t\tegw.preference('force_mailto','addressbook') != '1')\n\t\t\t{\n\t\t\t\ta.click(function(event){\n\t\t\t\t\tegw.open_link(this.href);\n\t\t\t\t\treturn false;\n\t\t\t\t});\n\t\t\t}\n\n\t\t\ta.appendTo(_node);\n\t\t}\n\t}\n}", "function injectAfter(parentNode, referenceNode, node) {\n let beforeNode;\n if (node.parentNode === parentNode &&\n node.previousSibling === referenceNode) {\n return;\n }\n if (referenceNode == null) {\n // node is supposed to be first.\n beforeNode = parentNode.firstChild;\n } else {\n // node is supposed to be after referenceNode.\n beforeNode = referenceNode.nextSibling;\n }\n if (beforeNode && beforeNode.previousSibling !== node) {\n // Cases where `node === beforeNode` should get filtered out by earlier\n // checks and the behavior isn't well-defined.\n invariant(\n node !== beforeNode,\n 'ReactART: Can not insert node before itself'\n );\n node.injectBefore(beforeNode);\n } else if (node.parentNode !== parentNode) {\n node.inject(parentNode);\n }\n}", "getPreviousTextInline(inline) {\n if (inline.previousNode instanceof TextElementBox) {\n return inline.previousNode;\n }\n if (inline.previousNode instanceof FieldElementBox && HelperMethods.isLinkedFieldCharacter(inline.previousNode)) {\n if (inline.previousNode.fieldType === 0 || inline.previousNode.fieldType === 1) {\n return inline.previousNode;\n }\n return inline.previousNode.fieldBegin;\n }\n if (!isNullOrUndefined(inline.previousNode)) {\n return this.getPreviousTextInline((inline.previousNode));\n }\n return undefined;\n }", "function _wrapMatchesInNode(textNode) {\n var parentNode = textNode.parentNode,\n tempElement = _getTempElement(parentNode.ownerDocument);\n\n // We need to insert an empty/temporary <span /> to fix IE quirks\n // Elsewise IE would strip white space in the beginning\n tempElement.innerHTML = \"<span></span>\" + _convertUrlsToLinks(textNode.data);\n tempElement.removeChild(tempElement.firstChild);\n\n while (tempElement.firstChild) {\n // inserts tempElement.firstChild before textNode\n parentNode.insertBefore(tempElement.firstChild, textNode);\n }\n parentNode.removeChild(textNode);\n }", "prepend(data) {\n console.log(\"prepend\", data);\n const node = new Node(data);\n if (this.head === null) {\n return (this.head = null);\n }\n node.next = this.head;\n this.head = node;\n }", "function parseInside (txt, left, right) {\n /*\n if (options.simplifiedAutoLink) {\n txt = showdown.subParser('simplifiedAutoLinks')(txt, options, globals);\n }\n */\n return left + txt + right;\n }", "function parseInside (txt, left, right) {\n /*\n if (options.simplifiedAutoLink) {\n txt = showdown.subParser('simplifiedAutoLinks')(txt, options, globals);\n }\n */\n return left + txt + right;\n }", "function parseInside (txt, left, right) {\n /*\n if (options.simplifiedAutoLink) {\n txt = showdown.subParser('simplifiedAutoLinks')(txt, options, globals);\n }\n */\n return left + txt + right;\n }", "function xPrevSib(e,t)\r\n{\r\n var s = e ? e.previousSibling : null;\r\n if (t) while(s && s.nodeName != t) {s=s.previousSibling;}\r\n else while(s && s.nodeType != 1) {s=s.previousSibling;}\r\n return s;\r\n}", "function merge(node1, node2) {\n if (node1 === null) {\n return node2\n } else if (node2 === null) {\n return node1\n } else if (node1 > node2) {\n node2.next = merge(node1, node2.next)\n return node2\n } else {\n node1.next = merge(node1.next, node2)\n return node1\n }\n}", "function diffNode (path, entityId, prev, next, el) {\n\t var leftType = nodeType(prev)\n\t var rightType = nodeType(next)\n\n\t // Type changed. This could be from element->text, text->ComponentA,\n\t // ComponentA->ComponentB etc. But NOT div->span. These are the same type\n\t // (ElementNode) but different tag name.\n\t if (leftType !== rightType) return replaceElement(entityId, path, el, next)\n\n\t switch (rightType) {\n\t case 'text': return diffText(prev, next, el)\n\t case 'empty': return el\n\t case 'element': return diffElement(path, entityId, prev, next, el)\n\t case 'component': return diffComponent(path, entityId, prev, next, el)\n\t }\n\t }", "function previousElementSibling(el) {\n do { el = el.previousSibling; } while ( el && el.nodeType !== 1 );\n return el;\n}", "function _getPreviousSiblingThatIsNotBlank(node) {\n var previousSibling = node.previousSibling;\n while (previousSibling && _isBlankTextNode(previousSibling)) {\n previousSibling = previousSibling.previousSibling;\n }\n return previousSibling;\n }" ]
[ "0.7849193", "0.6281823", "0.6281823", "0.6281823", "0.6281823", "0.6281823", "0.6281823", "0.62302065", "0.616374", "0.60946196", "0.60043705", "0.59923655", "0.5973659", "0.5908109", "0.589838", "0.56804395", "0.56523275", "0.5615626", "0.5565107", "0.5562803", "0.55494356", "0.5502516", "0.54060477", "0.5385749", "0.5340278", "0.53265333", "0.53151274", "0.5292513", "0.5280039", "0.52707815", "0.5266341", "0.5243369", "0.5222789", "0.5220264", "0.5195582", "0.5163548", "0.51172733", "0.5092261", "0.50736165", "0.5071095", "0.5050587", "0.5028976", "0.50121856", "0.49734426", "0.49662578", "0.49621966", "0.4950244", "0.4945593", "0.49287927", "0.49260676", "0.49108186", "0.49108186", "0.49108186", "0.49108186", "0.49108186", "0.49090165", "0.4905107", "0.48961067", "0.4895431", "0.48856616", "0.48800772", "0.48798963", "0.48784375", "0.48784375", "0.48784375", "0.48784375", "0.48784375", "0.48784375", "0.48784375", "0.48784375", "0.48784375", "0.48720154", "0.48714668", "0.4868984", "0.4831474", "0.48303047", "0.48267382", "0.48267382", "0.48108363", "0.48108363", "0.48080802", "0.48063377", "0.48046565", "0.48044282", "0.47950846", "0.47894892", "0.4788491", "0.47881085", "0.47881085", "0.47881085", "0.47859162", "0.47855195", "0.47852957", "0.47825077", "0.47790325" ]
0.8098557
5
Merge two blockquotes: `node` into `prev`, unless in CommonMark mode.
function mergeBlockquote(prev, node) { if (this.options.commonmark) { return node; } prev.children = prev.children.concat(node.children); return prev; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function mergeBlockquote(previous, node) {\n if (this.options.commonmark || this.options.gfm) {\n return node\n }\n\n previous.children = previous.children.concat(node.children)\n\n return previous\n}", "function mergeText(prev, node) {\n prev.value += node.value;\n\n return prev;\n}", "function mergeText(prev, node) {\n prev.value += node.value;\n\n return prev;\n}", "function mergeText(prev, node) {\n prev.value += node.value;\n\n return prev;\n}", "function mergeText(prev, node) {\n prev.value += node.value;\n\n return prev;\n}", "function mergeText(prev, node) {\n prev.value += node.value;\n\n return prev;\n}", "function mergeText(prev, node) {\n prev.value += node.value;\n\n return prev;\n}", "function mergeText(previous, node) {\n previous.value += node.value\n\n return previous\n}", "function get_or_create_prev_block(node, blockTagName) {\n var rtn = node.previousSibling;\n if (!rtn || rtn.nodeName != blockTagName) {\n rtn = node.ownerDocument.createElement(blockTagName);\n node.parentNode.insertBefore(rtn, node);\n }\n return rtn;\n }", "set prev(node) {\n this._prev = Node.sanitizeNode(node, true);\n }", "testEnterInBlockquoteRemovesExtraNodes() {\n setUpFields(true);\n\n // Let's assume we have the following DOM structure and the\n // cursor is placed after the first numbered list item \"one\".\n //\n // <blockquote class=\"tr_bq\">\n // <div><div>a</div><ol><li>one|</li></div>\n // <div>two</div>\n // </blockquote>\n //\n // After pressing enter, we have the following structure.\n //\n // <blockquote class=\"tr_bq\">\n // <div><div>a</div><ol><li>one|</li></div>\n // </blockquote>\n // <div>&nbsp;</div>\n // <blockquote class=\"tr_bq\">\n // <div><ol><li><span id=\"\"></span></li></ol></div>\n // <div>two</div>\n // </blockquote>\n //\n // This appears to the user as an empty list. After the fix, the HTML\n // will be\n //\n // <blockquote class=\"tr_bq\">\n // <div><div>a</div><ol><li>one|</li></div>\n // </blockquote>\n // <div>&nbsp;</div>\n // <blockquote class=\"tr_bq\">\n // <div>two</div>\n // </blockquote>\n //\n field1.setSafeHtml(\n false,\n testing.newSafeHtmlForTest(\n '<blockquote class=\"tr_bq\">' +\n '<div><div>a</div><ol><li id=\"cursor\">one</li></div>' +\n '<div>b</div>' +\n '</blockquote>'));\n const dom = field1.getEditableDomHelper();\n Range.createCaret(dom.getElement('cursor').firstChild, 3).select();\n testingEvents.fireKeySequence(field1.getElement(), KeyCodes.ENTER);\n const elem = field1.getElement();\n let secondBlockquote =\n dom.getElementsByTagNameAndClass(TagName.BLOCKQUOTE, null, elem)[1];\n assertHTMLEquals('<div>b</div>', secondBlockquote.innerHTML);\n\n // Ensure that we remove only unnecessary subtrees.\n field1.setSafeHtml(\n false,\n testing.newSafeHtmlForTest(\n '<blockquote class=\"tr_bq\">' +\n '<div><span>a</span><div id=\"cursor\">one</div><div>two</div></div>' +\n '<div><span>c</span></div>' +\n '</blockquote>'));\n Range.createCaret(dom.getElement('cursor').firstChild, 3).select();\n testingEvents.fireKeySequence(field1.getElement(), KeyCodes.ENTER);\n secondBlockquote =\n dom.getElementsByTagNameAndClass(TagName.BLOCKQUOTE, null, elem)[1];\n const expectedHTML = '<div><div>two</div></div>' +\n '<div><span>c</span></div>';\n assertHTMLEquals(expectedHTML, secondBlockquote.innerHTML);\n\n // Place the cursor in the middle of a line.\n field1.setSafeHtml(\n false,\n testing.newSafeHtmlForTest(\n '<blockquote id=\"quote\" class=\"tr_bq\">' +\n '<div>one</div><div>two</div>' +\n '</blockquote>'));\n Range.createCaret(dom.getElement('quote').firstChild.firstChild, 1)\n .select();\n testingEvents.fireKeySequence(field1.getElement(), KeyCodes.ENTER);\n const blockquotes =\n dom.getElementsByTagNameAndClass(TagName.BLOCKQUOTE, null, elem);\n assertEquals(2, blockquotes.length);\n assertHTMLEquals('<div>o</div>', blockquotes[0].innerHTML);\n assertHTMLEquals('<div>ne</div><div>two</div>', blockquotes[1].innerHTML);\n }", "function mergeTwoNodes(node1, node2) {\n node1.innerHTML = node1.innerHTML + node2.innerHTML\n return node1\n}", "function getRealPreviousSibling(node) {\n var prevSibling = node;\n do {\n prevSibling = prevSibling.previousSibling;\n } while (prevSibling && isEmptyTextNode(prevSibling));\n return prevSibling;\n}", "function prev(n){\n while((n = n.previousSibling) && n.nodeType != 1);\n return n;\n }", "function prevNode(node) {\n if (!node) return null;\n if (node.previousSibling) {\n return previousDeep(node.previousSibling);\n }\n return node.parentNode;\n}", "function insert_before(n1,n2){\r\n\tvar before = get_prev(n1);\r\n\tif(is_empty_node(before)){\r\n\t\tset_previous(n1,n2);\r\n\t\tset_next(n2,n1);\r\n\t\tset_previous(n2,empty_node);\r\n\t}else{\r\n\t\tset_next(before,n2);\r\n\t\tset_previous(n2,before);\r\n\t\tset_next(n2,n1);\r\n\t\tset_previous(n1,n2);\r\n\r\n\t}\r\n}", "function previousDeep(node) {\n if (!node) return null;\n while (node.childNodes.length) {\n node = node.lastChild;\n }\n return node;\n}", "function trimNode(node) {\n\t\t\t\tvar i, children = node.childNodes, type = node.nodeType;\n\n\t\t\t\tfunction surroundedBySpans(node) {\n\t\t\t\t\tvar previousIsSpan = node.previousSibling && node.previousSibling.nodeName == 'SPAN';\n\t\t\t\t\tvar nextIsSpan = node.nextSibling && node.nextSibling.nodeName == 'SPAN';\n\t\t\t\t\treturn previousIsSpan && nextIsSpan;\n\t\t\t\t}\n\n\t\t\t\tif (type == 1 && node.getAttribute('data-mce-type') == 'bookmark') {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\tfor (i = children.length - 1; i >= 0; i--) {\n\t\t\t\t\ttrimNode(children[i]);\n\t\t\t\t}\n\n\t\t\t\tif (type != 9) {\n\t\t\t\t\t// Keep non whitespace text nodes\n\t\t\t\t\tif (type == 3 && node.nodeValue.length > 0) {\n\t\t\t\t\t\t// If parent element isn't a block or there isn't any useful contents for example \"<p> </p>\"\n\t\t\t\t\t\t// Also keep text nodes with only spaces if surrounded by spans.\n\t\t\t\t\t\t// eg. \"<p><span>a</span> <span>b</span></p>\" should keep space between a and b\n\t\t\t\t\t\tvar trimmedLength = trim(node.nodeValue).length;\n\t\t\t\t\t\tif (!self.isBlock(node.parentNode) || trimmedLength > 0 || trimmedLength === 0 && surroundedBySpans(node)) {\n\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t}\n\t\t\t\t\t} else if (type == 1) {\n\t\t\t\t\t\t// If the only child is a bookmark then move it up\n\t\t\t\t\t\tchildren = node.childNodes;\n\n\t\t\t\t\t\t// TODO fix this complex if\n\t\t\t\t\t\tif (children.length == 1 && children[0] && children[0].nodeType == 1 &&\n\t\t\t\t\t\t\tchildren[0].getAttribute('data-mce-type') == 'bookmark') {\n\t\t\t\t\t\t\tnode.parentNode.insertBefore(children[0], node);\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t// Keep non empty elements or img, hr etc\n\t\t\t\t\t\tif (children.length || /^(br|hr|input|img)$/i.test(node.nodeName)) {\n\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\tself.remove(node);\n\t\t\t\t}\n\n\t\t\t\treturn node;\n\t\t\t}", "function trimNode(node) {\n\t\t\t\tvar i, children = node.childNodes, type = node.nodeType;\n\n\t\t\t\tfunction surroundedBySpans(node) {\n\t\t\t\t\tvar previousIsSpan = node.previousSibling && node.previousSibling.nodeName == 'SPAN';\n\t\t\t\t\tvar nextIsSpan = node.nextSibling && node.nextSibling.nodeName == 'SPAN';\n\t\t\t\t\treturn previousIsSpan && nextIsSpan;\n\t\t\t\t}\n\n\t\t\t\tif (type == 1 && node.getAttribute('data-mce-type') == 'bookmark') {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\tfor (i = children.length - 1; i >= 0; i--) {\n\t\t\t\t\ttrimNode(children[i]);\n\t\t\t\t}\n\n\t\t\t\tif (type != 9) {\n\t\t\t\t\t// Keep non whitespace text nodes\n\t\t\t\t\tif (type == 3 && node.nodeValue.length > 0) {\n\t\t\t\t\t\t// If parent element isn't a block or there isn't any useful contents for example \"<p> </p>\"\n\t\t\t\t\t\t// Also keep text nodes with only spaces if surrounded by spans.\n\t\t\t\t\t\t// eg. \"<p><span>a</span> <span>b</span></p>\" should keep space between a and b\n\t\t\t\t\t\tvar trimmedLength = trim(node.nodeValue).length;\n\t\t\t\t\t\tif (!self.isBlock(node.parentNode) || trimmedLength > 0 || trimmedLength === 0 && surroundedBySpans(node)) {\n\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t}\n\t\t\t\t\t} else if (type == 1) {\n\t\t\t\t\t\t// If the only child is a bookmark then move it up\n\t\t\t\t\t\tchildren = node.childNodes;\n\n\t\t\t\t\t\t// TODO fix this complex if\n\t\t\t\t\t\tif (children.length == 1 && children[0] && children[0].nodeType == 1 &&\n\t\t\t\t\t\t\tchildren[0].getAttribute('data-mce-type') == 'bookmark') {\n\t\t\t\t\t\t\tnode.parentNode.insertBefore(children[0], node);\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t// Keep non empty elements or img, hr etc\n\t\t\t\t\t\tif (children.length || /^(br|hr|input|img)$/i.test(node.nodeName)) {\n\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\tself.remove(node);\n\t\t\t\t}\n\n\t\t\t\treturn node;\n\t\t\t}", "function trimNode(node) {\n\t\t\t\tvar i, children = node.childNodes, type = node.nodeType;\n\n\t\t\t\tfunction surroundedBySpans(node) {\n\t\t\t\t\tvar previousIsSpan = node.previousSibling && node.previousSibling.nodeName == 'SPAN';\n\t\t\t\t\tvar nextIsSpan = node.nextSibling && node.nextSibling.nodeName == 'SPAN';\n\t\t\t\t\treturn previousIsSpan && nextIsSpan;\n\t\t\t\t}\n\n\t\t\t\tif (type == 1 && node.getAttribute('data-mce-type') == 'bookmark') {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\tfor (i = children.length - 1; i >= 0; i--) {\n\t\t\t\t\ttrimNode(children[i]);\n\t\t\t\t}\n\n\t\t\t\tif (type != 9) {\n\t\t\t\t\t// Keep non whitespace text nodes\n\t\t\t\t\tif (type == 3 && node.nodeValue.length > 0) {\n\t\t\t\t\t\t// If parent element isn't a block or there isn't any useful contents for example \"<p> </p>\"\n\t\t\t\t\t\t// Also keep text nodes with only spaces if surrounded by spans.\n\t\t\t\t\t\t// eg. \"<p><span>a</span> <span>b</span></p>\" should keep space between a and b\n\t\t\t\t\t\tvar trimmedLength = trim(node.nodeValue).length;\n\t\t\t\t\t\tif (!self.isBlock(node.parentNode) || trimmedLength > 0 || trimmedLength === 0 && surroundedBySpans(node)) {\n\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t}\n\t\t\t\t\t} else if (type == 1) {\n\t\t\t\t\t\t// If the only child is a bookmark then move it up\n\t\t\t\t\t\tchildren = node.childNodes;\n\n\t\t\t\t\t\t// TODO fix this complex if\n\t\t\t\t\t\tif (children.length == 1 && children[0] && children[0].nodeType == 1 &&\n\t\t\t\t\t\t\tchildren[0].getAttribute('data-mce-type') == 'bookmark') {\n\t\t\t\t\t\t\tnode.parentNode.insertBefore(children[0], node);\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t// Keep non empty elements or img, hr etc\n\t\t\t\t\t\tif (children.length || /^(br|hr|input|img)$/i.test(node.nodeName)) {\n\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\tself.remove(node);\n\t\t\t\t}\n\n\t\t\t\treturn node;\n\t\t\t}", "testEnterInBlockquoteRemovesUnnecessaryBrWithCursorBeforeBr() {\n setUpFields(true);\n\n // Assume the following HTML snippet:-\n // <blockquote>one|<br>two<br></blockquote>\n //\n // After enter on the cursor position, the resulting HTML should be.\n // <blockquote>one<br></blockquote>\n // <div>&nbsp;</div>\n // <blockquote>two<br></blockquote>\n field1.setSafeHtml(\n false,\n testing.newSafeHtmlForTest(\n '<blockquote id=\"quote\" class=\"tr_bq\">one<br>' +\n 'two<br></blockquote>'));\n const dom = field1.getEditableDomHelper();\n let cursor = dom.getElement('quote').firstChild;\n Range.createCaret(cursor, 3).select();\n testingEvents.fireKeySequence(field1.getElement(), KeyCodes.ENTER);\n const elem = field1.getElement();\n let secondBlockquote =\n dom.getElementsByTagNameAndClass(TagName.BLOCKQUOTE, null, elem)[1];\n assertHTMLEquals('two<br>', secondBlockquote.innerHTML);\n\n // Ensures that standard text node split works as expected with the new\n // change.\n field1.setSafeHtml(\n false,\n testing.newSafeHtmlForTest(\n '<blockquote id=\"quote\" class=\"tr_bq\">one<b>two</b><br>'));\n cursor = dom.getElement('quote').firstChild;\n Range.createCaret(cursor, 3).select();\n testingEvents.fireKeySequence(field1.getElement(), KeyCodes.ENTER);\n secondBlockquote =\n dom.getElementsByTagNameAndClass(TagName.BLOCKQUOTE, null, elem)[1];\n assertHTMLEquals('<b>two</b><br>', secondBlockquote.innerHTML);\n }", "function emitTagAndPreviousTextNode() {\n var textBeforeTag = html.slice(currentDataIdx, currentTag.idx);\n if (textBeforeTag) {\n // the html tag was the first element in the html string, or two \n // tags next to each other, in which case we should not emit a text \n // node\n onText(textBeforeTag, currentDataIdx);\n }\n if (currentTag.type === 'comment') {\n onComment(currentTag.idx);\n }\n else if (currentTag.type === 'doctype') {\n onDoctype(currentTag.idx);\n }\n else {\n if (currentTag.isOpening) {\n onOpenTag(currentTag.name, currentTag.idx);\n }\n if (currentTag.isClosing) { // note: self-closing tags will emit both opening and closing\n onCloseTag(currentTag.name, currentTag.idx);\n }\n }\n // Since we just emitted a tag, reset to the data state for the next char\n resetToDataState();\n currentDataIdx = charIdx + 1;\n }", "function emitTagAndPreviousTextNode() {\n var textBeforeTag = html.slice(currentDataIdx, currentTag.idx);\n if (textBeforeTag) {\n // the html tag was the first element in the html string, or two \n // tags next to each other, in which case we should not emit a text \n // node\n onText(textBeforeTag, currentDataIdx);\n }\n if (currentTag.type === 'comment') {\n onComment(currentTag.idx);\n }\n else if (currentTag.type === 'doctype') {\n onDoctype(currentTag.idx);\n }\n else {\n if (currentTag.isOpening) {\n onOpenTag(currentTag.name, currentTag.idx);\n }\n if (currentTag.isClosing) { // note: self-closing tags will emit both opening and closing\n onCloseTag(currentTag.name, currentTag.idx);\n }\n }\n // Since we just emitted a tag, reset to the data state for the next char\n resetToDataState();\n currentDataIdx = charIdx + 1;\n }", "testEnterInBlockquoteRemovesUnnecessaryBrWithCursorAfterBr() {\n setUpFields(true);\n\n // Assume the following HTML snippet:-\n // <blockquote>one<br>|two<br></blockquote>\n //\n // After enter on the cursor position without the fix, the resulting HTML\n // after the blockquote split was:-\n // <blockquote>one</blockquote>\n // <div>&nbsp;</div>\n // <blockquote><br>two<br></blockquote>\n //\n // This creates the impression on an unnecessary newline. The resulting HTML\n // after the fix is:-\n //\n // <blockquote>one<br></blockquote>\n // <div>&nbsp;</div>\n // <blockquote>two<br></blockquote>\n field1.setSafeHtml(\n false,\n testing.newSafeHtmlForTest(\n '<blockquote id=\"quote\" class=\"tr_bq\">one<br>' +\n 'two<br></blockquote>'));\n const dom = field1.getEditableDomHelper();\n Range.createCaret(dom.getElement('quote'), 2).select();\n testingEvents.fireKeySequence(field1.getElement(), KeyCodes.ENTER);\n const elem = field1.getElement();\n const secondBlockquote =\n dom.getElementsByTagNameAndClass(TagName.BLOCKQUOTE, null, elem)[1];\n assertHTMLEquals('two<br>', secondBlockquote.innerHTML);\n\n // Verifies that a blockquote split doesn't happen if it doesn't need to.\n field1.setSafeHtml(\n false,\n testing.newSafeHtmlForTest(\n '<blockquote class=\"tr_bq\">one<br id=\"brcursor\"></blockquote>'));\n selectNodeAndHitEnter(field1, 'brcursor');\n assertEquals(\n 1,\n dom.getElementsByTagNameAndClass(TagName.BLOCKQUOTE, null, elem)\n .length);\n }", "function previousSibling(node) {\n var node = node.previousSibling;\n try {\n while(node.data) node = node.previousSibling;\n } catch(e) {}\n return node;\n}", "function result_element_prepend(parent, child, next)\n{\n if(next == null)\n result_element_append(parent, child);\n else\n if(parent != null && child != null)\n {\n // insert child node before the next node:\n for(var i = 0; i < parent.content.length; i++)\n {\n if(parent.content[i] == next)\n {\n parent.content.splice(i, 0, child);\n return;\n }\n }\n }\n}", "function getPreviousSibling(startBrother) {\n\tendBrother = startBrother.previousSibling;\n\twhile(endBrother.nodeType != 1) endBrother = endBrother.previousSibling;\n\treturn endBrother;\n}", "function add(node, parent) {\n var children = parent ? parent.children : tokens\n var previous = children[children.length - 1]\n var fn\n\n if (\n previous &&\n node.type === previous.type &&\n (node.type === 'text' || node.type === 'blockquote') &&\n mergeable(previous) &&\n mergeable(node)\n ) {\n fn = node.type === 'text' ? mergeText : mergeBlockquote\n node = fn.call(self, previous, node)\n }\n\n if (node !== previous) {\n children.push(node)\n }\n\n if (self.atStart && tokens.length !== 0) {\n self.exitStart()\n }\n\n return node\n }", "function prev(node) {\r\n var prev_node;\r\n\r\n assert(isElement(node), 'pklib.dom.prev: @node is not HTMLElement');\r\n\r\n while (true) {\r\n prev_node = node.previousSibling;\r\n if (prev_node !== undefined && prev_node !== null && prev_node.nodeType !== node_types.ELEMENT_NODE) {\r\n node = prev_node;\r\n } else {\r\n break;\r\n }\r\n }\r\n return prev_node;\r\n }", "function _insertBefore(parentNode, newChild, nextChild) {\n var cp = newChild.parentNode;\n\n if (cp) {\n cp.removeChild(newChild); //remove and update\n }\n\n if (newChild.nodeType === DOCUMENT_FRAGMENT_NODE) {\n var newFirst = newChild.firstChild;\n\n if (newFirst == null) {\n return newChild;\n }\n\n var newLast = newChild.lastChild;\n } else {\n newFirst = newLast = newChild;\n }\n\n var pre = nextChild ? nextChild.previousSibling : parentNode.lastChild;\n newFirst.previousSibling = pre;\n newLast.nextSibling = nextChild;\n\n if (pre) {\n pre.nextSibling = newFirst;\n } else {\n parentNode.firstChild = newFirst;\n }\n\n if (nextChild == null) {\n parentNode.lastChild = newLast;\n } else {\n nextChild.previousSibling = newLast;\n }\n\n do {\n newFirst.parentNode = parentNode;\n } while (newFirst !== newLast && (newFirst = newFirst.nextSibling));\n\n _onUpdateChild(parentNode.ownerDocument || parentNode, parentNode); //console.log(parentNode.lastChild.nextSibling == null)\n\n\n if (newChild.nodeType == DOCUMENT_FRAGMENT_NODE) {\n newChild.firstChild = newChild.lastChild = null;\n }\n\n return newChild;\n}", "previous(editor) {\n var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};\n var {\n mode = 'lowest',\n voids = false\n } = options;\n var {\n match,\n at = editor.selection\n } = options;\n\n if (!at) {\n return;\n }\n\n var [, from] = Editor.first(editor, at);\n var [, to] = Editor.first(editor, []);\n var span = [from, to];\n\n if (Path.isPath(at) && at.length === 0) {\n throw new Error(\"Cannot get the previous node from the root node!\");\n }\n\n if (match == null) {\n if (Path.isPath(at)) {\n var [parent] = Editor.parent(editor, at);\n\n match = n => parent.children.includes(n);\n } else {\n match = () => true;\n }\n }\n\n var [, previous] = Editor.nodes(editor, {\n reverse: true,\n at: span,\n match,\n mode,\n voids\n });\n return previous;\n }", "insertBefore(node) {\n if (this.fragment.hasChildNodes()) {\n node.parentNode.insertBefore(this.fragment, node);\n } else {\n const parentNode = node.parentNode;\n const end = this.lastChild;\n let current = this.firstChild;\n let next;\n\n while (current !== end) {\n next = current.nextSibling;\n parentNode.insertBefore(current, node);\n current = next;\n }\n\n parentNode.insertBefore(end, node);\n }\n }", "mergeNodes(editor) {\n var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};\n Editor.withoutNormalizing(editor, () => {\n var {\n match,\n at = editor.selection\n } = options;\n var {\n hanging = false,\n voids = false,\n mode = 'lowest'\n } = options;\n\n if (!at) {\n return;\n }\n\n if (match == null) {\n if (Path.isPath(at)) {\n var [parent] = Editor.parent(editor, at);\n\n match = n => parent.children.includes(n);\n } else {\n match = n => Editor.isBlock(editor, n);\n }\n }\n\n if (!hanging && Range.isRange(at)) {\n at = Editor.unhangRange(editor, at);\n }\n\n if (Range.isRange(at)) {\n if (Range.isCollapsed(at)) {\n at = at.anchor;\n } else {\n var [, end] = Range.edges(at);\n var pointRef = Editor.pointRef(editor, end);\n Transforms.delete(editor, {\n at\n });\n at = pointRef.unref();\n\n if (options.at == null) {\n Transforms.select(editor, at);\n }\n }\n }\n\n var [current] = Editor.nodes(editor, {\n at,\n match,\n voids,\n mode\n });\n var prev = Editor.previous(editor, {\n at,\n match,\n voids,\n mode\n });\n\n if (!current || !prev) {\n return;\n }\n\n var [node, path] = current;\n var [prevNode, prevPath] = prev;\n\n if (path.length === 0 || prevPath.length === 0) {\n return;\n }\n\n var newPath = Path.next(prevPath);\n var commonPath = Path.common(path, prevPath);\n var isPreviousSibling = Path.isSibling(path, prevPath);\n var levels = Array.from(Editor.levels(editor, {\n at: path\n }), _ref2 => {\n var [n] = _ref2;\n return n;\n }).slice(commonPath.length).slice(0, -1); // Determine if the merge will leave an ancestor of the path empty as a\n // result, in which case we'll want to remove it after merging.\n\n var emptyAncestor = Editor.above(editor, {\n at: path,\n mode: 'highest',\n match: n => levels.includes(n) && hasSingleChildNest(editor, n)\n });\n var emptyRef = emptyAncestor && Editor.pathRef(editor, emptyAncestor[1]);\n var properties;\n var position; // Ensure that the nodes are equivalent, and figure out what the position\n // and extra properties of the merge will be.\n\n if (Text.isText(node) && Text.isText(prevNode)) {\n var rest = _objectWithoutProperties(node, _excluded);\n\n position = prevNode.text.length;\n properties = rest;\n } else if (Element.isElement(node) && Element.isElement(prevNode)) {\n var rest = _objectWithoutProperties(node, _excluded2);\n\n position = prevNode.children.length;\n properties = rest;\n } else {\n throw new Error(\"Cannot merge the node at path [\".concat(path, \"] with the previous sibling because it is not the same kind: \").concat(JSON.stringify(node), \" \").concat(JSON.stringify(prevNode)));\n } // If the node isn't already the next sibling of the previous node, move\n // it so that it is before merging.\n\n\n if (!isPreviousSibling) {\n Transforms.moveNodes(editor, {\n at: path,\n to: newPath,\n voids\n });\n } // If there was going to be an empty ancestor of the node that was merged,\n // we remove it from the tree.\n\n\n if (emptyRef) {\n Transforms.removeNodes(editor, {\n at: emptyRef.current,\n voids\n });\n } // If the target node that we're merging with is empty, remove it instead\n // of merging the two. This is a common rich text editor behavior to\n // prevent losing formatting when deleting entire nodes when you have a\n // hanging selection.\n // if prevNode is first child in parent,don't remove it.\n\n\n if (Element.isElement(prevNode) && Editor.isEmpty(editor, prevNode) || Text.isText(prevNode) && prevNode.text === '' && prevPath[prevPath.length - 1] !== 0) {\n Transforms.removeNodes(editor, {\n at: prevPath,\n voids\n });\n } else {\n editor.apply({\n type: 'merge_node',\n path: newPath,\n position,\n properties\n });\n }\n\n if (emptyRef) {\n emptyRef.unref();\n }\n });\n }", "mergeNodes(editor) {\n var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};\n Editor.withoutNormalizing(editor, () => {\n var {\n match,\n at = editor.selection\n } = options;\n var {\n hanging = false,\n voids = false,\n mode = 'lowest'\n } = options;\n\n if (!at) {\n return;\n }\n\n if (match == null) {\n if (Path.isPath(at)) {\n var [parent] = Editor.parent(editor, at);\n\n match = n => parent.children.includes(n);\n } else {\n match = n => Editor.isBlock(editor, n);\n }\n }\n\n if (!hanging && Range.isRange(at)) {\n at = Editor.unhangRange(editor, at);\n }\n\n if (Range.isRange(at)) {\n if (Range.isCollapsed(at)) {\n at = at.anchor;\n } else {\n var [, end] = Range.edges(at);\n var pointRef = Editor.pointRef(editor, end);\n Transforms.delete(editor, {\n at\n });\n at = pointRef.unref();\n\n if (options.at == null) {\n Transforms.select(editor, at);\n }\n }\n }\n\n var [current] = Editor.nodes(editor, {\n at,\n match,\n voids,\n mode\n });\n var prev = Editor.previous(editor, {\n at,\n match,\n voids,\n mode\n });\n\n if (!current || !prev) {\n return;\n }\n\n var [node, path] = current;\n var [prevNode, prevPath] = prev;\n\n if (path.length === 0 || prevPath.length === 0) {\n return;\n }\n\n var newPath = Path.next(prevPath);\n var commonPath = Path.common(path, prevPath);\n var isPreviousSibling = Path.isSibling(path, prevPath);\n var levels = Array.from(Editor.levels(editor, {\n at: path\n }), (_ref2) => {\n var [n] = _ref2;\n return n;\n }).slice(commonPath.length).slice(0, -1); // Determine if the merge will leave an ancestor of the path empty as a\n // result, in which case we'll want to remove it after merging.\n\n var emptyAncestor = Editor.above(editor, {\n at: path,\n mode: 'highest',\n match: n => levels.includes(n) && Element.isElement(n) && n.children.length === 1\n });\n var emptyRef = emptyAncestor && Editor.pathRef(editor, emptyAncestor[1]);\n var properties;\n var position; // Ensure that the nodes are equivalent, and figure out what the position\n // and extra properties of the merge will be.\n\n if (Text.isText(node) && Text.isText(prevNode)) {\n var rest = _objectWithoutProperties(node, [\"text\"]);\n\n position = prevNode.text.length;\n properties = rest;\n } else if (Element.isElement(node) && Element.isElement(prevNode)) {\n var rest = _objectWithoutProperties(node, [\"children\"]);\n\n position = prevNode.children.length;\n properties = rest;\n } else {\n throw new Error(\"Cannot merge the node at path [\".concat(path, \"] with the previous sibling because it is not the same kind: \").concat(JSON.stringify(node), \" \").concat(JSON.stringify(prevNode)));\n } // If the node isn't already the next sibling of the previous node, move\n // it so that it is before merging.\n\n\n if (!isPreviousSibling) {\n Transforms.moveNodes(editor, {\n at: path,\n to: newPath,\n voids\n });\n } // If there was going to be an empty ancestor of the node that was merged,\n // we remove it from the tree.\n\n\n if (emptyRef) {\n Transforms.removeNodes(editor, {\n at: emptyRef.current,\n voids\n });\n } // If the target node that we're merging with is empty, remove it instead\n // of merging the two. This is a common rich text editor behavior to\n // prevent losing formatting when deleting entire nodes when you have a\n // hanging selection.\n\n\n if (Element.isElement(prevNode) && Editor.isEmpty(editor, prevNode) || Text.isText(prevNode) && prevNode.text === '') {\n Transforms.removeNodes(editor, {\n at: prevPath,\n voids\n });\n } else {\n editor.apply({\n type: 'merge_node',\n path: newPath,\n position,\n properties\n });\n }\n\n if (emptyRef) {\n emptyRef.unref();\n }\n });\n }", "function _insertBefore(parentNode,newChild,nextChild){\n\tvar cp = newChild.parentNode;\n\tif(cp){\n\t\tcp.removeChild(newChild);//remove and update\n\t}\n\tif(newChild.nodeType === DOCUMENT_FRAGMENT_NODE){\n\t\tvar newFirst = newChild.firstChild;\n\t\tif (newFirst == null) {\n\t\t\treturn newChild;\n\t\t}\n\t\tvar newLast = newChild.lastChild;\n\t}else{\n\t\tnewFirst = newLast = newChild;\n\t}\n\tvar pre = nextChild ? nextChild.previousSibling : parentNode.lastChild;\n\n\tnewFirst.previousSibling = pre;\n\tnewLast.nextSibling = nextChild;\n\t\n\t\n\tif(pre){\n\t\tpre.nextSibling = newFirst;\n\t}else{\n\t\tparentNode.firstChild = newFirst;\n\t}\n\tif(nextChild == null){\n\t\tparentNode.lastChild = newLast;\n\t}else{\n\t\tnextChild.previousSibling = newLast;\n\t}\n\tdo{\n\t\tnewFirst.parentNode = parentNode;\n\t}while(newFirst !== newLast && (newFirst= newFirst.nextSibling))\n\t_onUpdateChild(parentNode.ownerDocument||parentNode,parentNode);\n\t//console.log(parentNode.lastChild.nextSibling == null)\n\tif (newChild.nodeType == DOCUMENT_FRAGMENT_NODE) {\n\t\tnewChild.firstChild = newChild.lastChild = null;\n\t}\n\treturn newChild;\n}", "function _insertBefore(parentNode,newChild,nextChild){\n\tvar cp = newChild.parentNode;\n\tif(cp){\n\t\tcp.removeChild(newChild);//remove and update\n\t}\n\tif(newChild.nodeType === DOCUMENT_FRAGMENT_NODE){\n\t\tvar newFirst = newChild.firstChild;\n\t\tif (newFirst == null) {\n\t\t\treturn newChild;\n\t\t}\n\t\tvar newLast = newChild.lastChild;\n\t}else{\n\t\tnewFirst = newLast = newChild;\n\t}\n\tvar pre = nextChild ? nextChild.previousSibling : parentNode.lastChild;\n\n\tnewFirst.previousSibling = pre;\n\tnewLast.nextSibling = nextChild;\n\t\n\t\n\tif(pre){\n\t\tpre.nextSibling = newFirst;\n\t}else{\n\t\tparentNode.firstChild = newFirst;\n\t}\n\tif(nextChild == null){\n\t\tparentNode.lastChild = newLast;\n\t}else{\n\t\tnextChild.previousSibling = newLast;\n\t}\n\tdo{\n\t\tnewFirst.parentNode = parentNode;\n\t}while(newFirst !== newLast && (newFirst= newFirst.nextSibling))\n\t_onUpdateChild(parentNode.ownerDocument||parentNode,parentNode);\n\t//console.log(parentNode.lastChild.nextSibling == null)\n\tif (newChild.nodeType == DOCUMENT_FRAGMENT_NODE) {\n\t\tnewChild.firstChild = newChild.lastChild = null;\n\t}\n\treturn newChild;\n}", "function _insertBefore(parentNode,newChild,nextChild){\n\tvar cp = newChild.parentNode;\n\tif(cp){\n\t\tcp.removeChild(newChild);//remove and update\n\t}\n\tif(newChild.nodeType === DOCUMENT_FRAGMENT_NODE){\n\t\tvar newFirst = newChild.firstChild;\n\t\tif (newFirst == null) {\n\t\t\treturn newChild;\n\t\t}\n\t\tvar newLast = newChild.lastChild;\n\t}else{\n\t\tnewFirst = newLast = newChild;\n\t}\n\tvar pre = nextChild ? nextChild.previousSibling : parentNode.lastChild;\n\n\tnewFirst.previousSibling = pre;\n\tnewLast.nextSibling = nextChild;\n\t\n\t\n\tif(pre){\n\t\tpre.nextSibling = newFirst;\n\t}else{\n\t\tparentNode.firstChild = newFirst;\n\t}\n\tif(nextChild == null){\n\t\tparentNode.lastChild = newLast;\n\t}else{\n\t\tnextChild.previousSibling = newLast;\n\t}\n\tdo{\n\t\tnewFirst.parentNode = parentNode;\n\t}while(newFirst !== newLast && (newFirst= newFirst.nextSibling))\n\t_onUpdateChild(parentNode.ownerDocument||parentNode,parentNode);\n\t//console.log(parentNode.lastChild.nextSibling == null)\n\tif (newChild.nodeType == DOCUMENT_FRAGMENT_NODE) {\n\t\tnewChild.firstChild = newChild.lastChild = null;\n\t}\n\treturn newChild;\n}", "function _insertBefore(parentNode,newChild,nextChild){\n\tvar cp = newChild.parentNode;\n\tif(cp){\n\t\tcp.removeChild(newChild);//remove and update\n\t}\n\tif(newChild.nodeType === DOCUMENT_FRAGMENT_NODE){\n\t\tvar newFirst = newChild.firstChild;\n\t\tif (newFirst == null) {\n\t\t\treturn newChild;\n\t\t}\n\t\tvar newLast = newChild.lastChild;\n\t}else{\n\t\tnewFirst = newLast = newChild;\n\t}\n\tvar pre = nextChild ? nextChild.previousSibling : parentNode.lastChild;\n\n\tnewFirst.previousSibling = pre;\n\tnewLast.nextSibling = nextChild;\n\t\n\t\n\tif(pre){\n\t\tpre.nextSibling = newFirst;\n\t}else{\n\t\tparentNode.firstChild = newFirst;\n\t}\n\tif(nextChild == null){\n\t\tparentNode.lastChild = newLast;\n\t}else{\n\t\tnextChild.previousSibling = newLast;\n\t}\n\tdo{\n\t\tnewFirst.parentNode = parentNode;\n\t}while(newFirst !== newLast && (newFirst= newFirst.nextSibling))\n\t_onUpdateChild(parentNode.ownerDocument||parentNode,parentNode);\n\t//console.log(parentNode.lastChild.nextSibling == null)\n\tif (newChild.nodeType == DOCUMENT_FRAGMENT_NODE) {\n\t\tnewChild.firstChild = newChild.lastChild = null;\n\t}\n\treturn newChild;\n}", "function _insertBefore(parentNode,newChild,nextChild){\n\tvar cp = newChild.parentNode;\n\tif(cp){\n\t\tcp.removeChild(newChild);//remove and update\n\t}\n\tif(newChild.nodeType === DOCUMENT_FRAGMENT_NODE){\n\t\tvar newFirst = newChild.firstChild;\n\t\tif (newFirst == null) {\n\t\t\treturn newChild;\n\t\t}\n\t\tvar newLast = newChild.lastChild;\n\t}else{\n\t\tnewFirst = newLast = newChild;\n\t}\n\tvar pre = nextChild ? nextChild.previousSibling : parentNode.lastChild;\n\n\tnewFirst.previousSibling = pre;\n\tnewLast.nextSibling = nextChild;\n\t\n\t\n\tif(pre){\n\t\tpre.nextSibling = newFirst;\n\t}else{\n\t\tparentNode.firstChild = newFirst;\n\t}\n\tif(nextChild == null){\n\t\tparentNode.lastChild = newLast;\n\t}else{\n\t\tnextChild.previousSibling = newLast;\n\t}\n\tdo{\n\t\tnewFirst.parentNode = parentNode;\n\t}while(newFirst !== newLast && (newFirst= newFirst.nextSibling))\n\t_onUpdateChild(parentNode.ownerDocument||parentNode,parentNode);\n\t//console.log(parentNode.lastChild.nextSibling == null)\n\tif (newChild.nodeType == DOCUMENT_FRAGMENT_NODE) {\n\t\tnewChild.firstChild = newChild.lastChild = null;\n\t}\n\treturn newChild;\n}", "function _insertBefore(parentNode,newChild,nextChild){\n\tvar cp = newChild.parentNode;\n\tif(cp){\n\t\tcp.removeChild(newChild);//remove and update\n\t}\n\tif(newChild.nodeType === DOCUMENT_FRAGMENT_NODE){\n\t\tvar newFirst = newChild.firstChild;\n\t\tif (newFirst == null) {\n\t\t\treturn newChild;\n\t\t}\n\t\tvar newLast = newChild.lastChild;\n\t}else{\n\t\tnewFirst = newLast = newChild;\n\t}\n\tvar pre = nextChild ? nextChild.previousSibling : parentNode.lastChild;\n\n\tnewFirst.previousSibling = pre;\n\tnewLast.nextSibling = nextChild;\n\t\n\t\n\tif(pre){\n\t\tpre.nextSibling = newFirst;\n\t}else{\n\t\tparentNode.firstChild = newFirst;\n\t}\n\tif(nextChild == null){\n\t\tparentNode.lastChild = newLast;\n\t}else{\n\t\tnextChild.previousSibling = newLast;\n\t}\n\tdo{\n\t\tnewFirst.parentNode = parentNode;\n\t}while(newFirst !== newLast && (newFirst= newFirst.nextSibling))\n\t_onUpdateChild(parentNode.ownerDocument||parentNode,parentNode);\n\t//console.log(parentNode.lastChild.nextSibling == null)\n\tif (newChild.nodeType == DOCUMENT_FRAGMENT_NODE) {\n\t\tnewChild.firstChild = newChild.lastChild = null;\n\t}\n\treturn newChild;\n}", "function _insertBefore(parentNode,newChild,nextChild){\n\tvar cp = newChild.parentNode;\n\tif(cp){\n\t\tcp.removeChild(newChild);//remove and update\n\t}\n\tif(newChild.nodeType === DOCUMENT_FRAGMENT_NODE){\n\t\tvar newFirst = newChild.firstChild;\n\t\tif (newFirst == null) {\n\t\t\treturn newChild;\n\t\t}\n\t\tvar newLast = newChild.lastChild;\n\t}else{\n\t\tnewFirst = newLast = newChild;\n\t}\n\tvar pre = nextChild ? nextChild.previousSibling : parentNode.lastChild;\n\n\tnewFirst.previousSibling = pre;\n\tnewLast.nextSibling = nextChild;\n\t\n\t\n\tif(pre){\n\t\tpre.nextSibling = newFirst;\n\t}else{\n\t\tparentNode.firstChild = newFirst;\n\t}\n\tif(nextChild == null){\n\t\tparentNode.lastChild = newLast;\n\t}else{\n\t\tnextChild.previousSibling = newLast;\n\t}\n\tdo{\n\t\tnewFirst.parentNode = parentNode;\n\t}while(newFirst !== newLast && (newFirst= newFirst.nextSibling))\n\t_onUpdateChild(parentNode.ownerDocument||parentNode,parentNode);\n\t//console.log(parentNode.lastChild.nextSibling == null)\n\tif (newChild.nodeType == DOCUMENT_FRAGMENT_NODE) {\n\t\tnewChild.firstChild = newChild.lastChild = null;\n\t}\n\treturn newChild;\n}", "function _insertBefore(parentNode,newChild,nextChild){\n\tvar cp = newChild.parentNode;\n\tif(cp){\n\t\tcp.removeChild(newChild);//remove and update\n\t}\n\tif(newChild.nodeType === DOCUMENT_FRAGMENT_NODE){\n\t\tvar newFirst = newChild.firstChild;\n\t\tif (newFirst == null) {\n\t\t\treturn newChild;\n\t\t}\n\t\tvar newLast = newChild.lastChild;\n\t}else{\n\t\tnewFirst = newLast = newChild;\n\t}\n\tvar pre = nextChild ? nextChild.previousSibling : parentNode.lastChild;\n\n\tnewFirst.previousSibling = pre;\n\tnewLast.nextSibling = nextChild;\n\t\n\t\n\tif(pre){\n\t\tpre.nextSibling = newFirst;\n\t}else{\n\t\tparentNode.firstChild = newFirst;\n\t}\n\tif(nextChild == null){\n\t\tparentNode.lastChild = newLast;\n\t}else{\n\t\tnextChild.previousSibling = newLast;\n\t}\n\tdo{\n\t\tnewFirst.parentNode = parentNode;\n\t}while(newFirst !== newLast && (newFirst= newFirst.nextSibling))\n\t_onUpdateChild(parentNode.ownerDocument||parentNode,parentNode);\n\t//console.log(parentNode.lastChild.nextSibling == null)\n\tif (newChild.nodeType == DOCUMENT_FRAGMENT_NODE) {\n\t\tnewChild.firstChild = newChild.lastChild = null;\n\t}\n\treturn newChild;\n}", "function _insertBefore(parentNode,newChild,nextChild){\n\tvar cp = newChild.parentNode;\n\tif(cp){\n\t\tcp.removeChild(newChild);//remove and update\n\t}\n\tif(newChild.nodeType === DOCUMENT_FRAGMENT_NODE){\n\t\tvar newFirst = newChild.firstChild;\n\t\tif (newFirst == null) {\n\t\t\treturn newChild;\n\t\t}\n\t\tvar newLast = newChild.lastChild;\n\t}else{\n\t\tnewFirst = newLast = newChild;\n\t}\n\tvar pre = nextChild ? nextChild.previousSibling : parentNode.lastChild;\n\n\tnewFirst.previousSibling = pre;\n\tnewLast.nextSibling = nextChild;\n\t\n\t\n\tif(pre){\n\t\tpre.nextSibling = newFirst;\n\t}else{\n\t\tparentNode.firstChild = newFirst;\n\t}\n\tif(nextChild == null){\n\t\tparentNode.lastChild = newLast;\n\t}else{\n\t\tnextChild.previousSibling = newLast;\n\t}\n\tdo{\n\t\tnewFirst.parentNode = parentNode;\n\t}while(newFirst !== newLast && (newFirst= newFirst.nextSibling))\n\t_onUpdateChild(parentNode.ownerDocument||parentNode,parentNode);\n\t//console.log(parentNode.lastChild.nextSibling == null)\n\tif (newChild.nodeType == DOCUMENT_FRAGMENT_NODE) {\n\t\tnewChild.firstChild = newChild.lastChild = null;\n\t}\n\treturn newChild;\n}", "function _insertBefore(parentNode,newChild,nextChild){\n\tvar cp = newChild.parentNode;\n\tif(cp){\n\t\tcp.removeChild(newChild);//remove and update\n\t}\n\tif(newChild.nodeType === DOCUMENT_FRAGMENT_NODE){\n\t\tvar newFirst = newChild.firstChild;\n\t\tif (newFirst == null) {\n\t\t\treturn newChild;\n\t\t}\n\t\tvar newLast = newChild.lastChild;\n\t}else{\n\t\tnewFirst = newLast = newChild;\n\t}\n\tvar pre = nextChild ? nextChild.previousSibling : parentNode.lastChild;\n\n\tnewFirst.previousSibling = pre;\n\tnewLast.nextSibling = nextChild;\n\t\n\t\n\tif(pre){\n\t\tpre.nextSibling = newFirst;\n\t}else{\n\t\tparentNode.firstChild = newFirst;\n\t}\n\tif(nextChild == null){\n\t\tparentNode.lastChild = newLast;\n\t}else{\n\t\tnextChild.previousSibling = newLast;\n\t}\n\tdo{\n\t\tnewFirst.parentNode = parentNode;\n\t}while(newFirst !== newLast && (newFirst= newFirst.nextSibling))\n\t_onUpdateChild(parentNode.ownerDocument||parentNode,parentNode);\n\t//console.log(parentNode.lastChild.nextSibling == null)\n\tif (newChild.nodeType == DOCUMENT_FRAGMENT_NODE) {\n\t\tnewChild.firstChild = newChild.lastChild = null;\n\t}\n\treturn newChild;\n}", "function _insertBefore(parentNode,newChild,nextChild){\n\tvar cp = newChild.parentNode;\n\tif(cp){\n\t\tcp.removeChild(newChild);//remove and update\n\t}\n\tif(newChild.nodeType === DOCUMENT_FRAGMENT_NODE){\n\t\tvar newFirst = newChild.firstChild;\n\t\tif (newFirst == null) {\n\t\t\treturn newChild;\n\t\t}\n\t\tvar newLast = newChild.lastChild;\n\t}else{\n\t\tnewFirst = newLast = newChild;\n\t}\n\tvar pre = nextChild ? nextChild.previousSibling : parentNode.lastChild;\n\n\tnewFirst.previousSibling = pre;\n\tnewLast.nextSibling = nextChild;\n\t\n\t\n\tif(pre){\n\t\tpre.nextSibling = newFirst;\n\t}else{\n\t\tparentNode.firstChild = newFirst;\n\t}\n\tif(nextChild == null){\n\t\tparentNode.lastChild = newLast;\n\t}else{\n\t\tnextChild.previousSibling = newLast;\n\t}\n\tdo{\n\t\tnewFirst.parentNode = parentNode;\n\t}while(newFirst !== newLast && (newFirst= newFirst.nextSibling))\n\t_onUpdateChild(parentNode.ownerDocument||parentNode,parentNode);\n\t//console.log(parentNode.lastChild.nextSibling == null)\n\tif (newChild.nodeType == DOCUMENT_FRAGMENT_NODE) {\n\t\tnewChild.firstChild = newChild.lastChild = null;\n\t}\n\treturn newChild;\n}", "function _insertBefore(parentNode,newChild,nextChild){\n\tvar cp = newChild.parentNode;\n\tif(cp){\n\t\tcp.removeChild(newChild);//remove and update\n\t}\n\tif(newChild.nodeType === DOCUMENT_FRAGMENT_NODE){\n\t\tvar newFirst = newChild.firstChild;\n\t\tif (newFirst == null) {\n\t\t\treturn newChild;\n\t\t}\n\t\tvar newLast = newChild.lastChild;\n\t}else{\n\t\tnewFirst = newLast = newChild;\n\t}\n\tvar pre = nextChild ? nextChild.previousSibling : parentNode.lastChild;\n\n\tnewFirst.previousSibling = pre;\n\tnewLast.nextSibling = nextChild;\n\t\n\t\n\tif(pre){\n\t\tpre.nextSibling = newFirst;\n\t}else{\n\t\tparentNode.firstChild = newFirst;\n\t}\n\tif(nextChild == null){\n\t\tparentNode.lastChild = newLast;\n\t}else{\n\t\tnextChild.previousSibling = newLast;\n\t}\n\tdo{\n\t\tnewFirst.parentNode = parentNode;\n\t}while(newFirst !== newLast && (newFirst= newFirst.nextSibling))\n\t_onUpdateChild(parentNode.ownerDocument||parentNode,parentNode);\n\t//console.log(parentNode.lastChild.nextSibling == null)\n\tif (newChild.nodeType == DOCUMENT_FRAGMENT_NODE) {\n\t\tnewChild.firstChild = newChild.lastChild = null;\n\t}\n\treturn newChild;\n}", "function _insertBefore(parentNode,newChild,nextChild){\n\tvar cp = newChild.parentNode;\n\tif(cp){\n\t\tcp.removeChild(newChild);//remove and update\n\t}\n\tif(newChild.nodeType === DOCUMENT_FRAGMENT_NODE){\n\t\tvar newFirst = newChild.firstChild;\n\t\tif (newFirst == null) {\n\t\t\treturn newChild;\n\t\t}\n\t\tvar newLast = newChild.lastChild;\n\t}else{\n\t\tnewFirst = newLast = newChild;\n\t}\n\tvar pre = nextChild ? nextChild.previousSibling : parentNode.lastChild;\n\n\tnewFirst.previousSibling = pre;\n\tnewLast.nextSibling = nextChild;\n\t\n\t\n\tif(pre){\n\t\tpre.nextSibling = newFirst;\n\t}else{\n\t\tparentNode.firstChild = newFirst;\n\t}\n\tif(nextChild == null){\n\t\tparentNode.lastChild = newLast;\n\t}else{\n\t\tnextChild.previousSibling = newLast;\n\t}\n\tdo{\n\t\tnewFirst.parentNode = parentNode;\n\t}while(newFirst !== newLast && (newFirst= newFirst.nextSibling))\n\t_onUpdateChild(parentNode.ownerDocument||parentNode,parentNode);\n\t//console.log(parentNode.lastChild.nextSibling == null)\n\tif (newChild.nodeType == DOCUMENT_FRAGMENT_NODE) {\n\t\tnewChild.firstChild = newChild.lastChild = null;\n\t}\n\treturn newChild;\n}", "function _insertBefore(parentNode,newChild,nextChild){\n\tvar cp = newChild.parentNode;\n\tif(cp){\n\t\tcp.removeChild(newChild);//remove and update\n\t}\n\tif(newChild.nodeType === DOCUMENT_FRAGMENT_NODE){\n\t\tvar newFirst = newChild.firstChild;\n\t\tif (newFirst == null) {\n\t\t\treturn newChild;\n\t\t}\n\t\tvar newLast = newChild.lastChild;\n\t}else{\n\t\tnewFirst = newLast = newChild;\n\t}\n\tvar pre = nextChild ? nextChild.previousSibling : parentNode.lastChild;\n\n\tnewFirst.previousSibling = pre;\n\tnewLast.nextSibling = nextChild;\n\t\n\t\n\tif(pre){\n\t\tpre.nextSibling = newFirst;\n\t}else{\n\t\tparentNode.firstChild = newFirst;\n\t}\n\tif(nextChild == null){\n\t\tparentNode.lastChild = newLast;\n\t}else{\n\t\tnextChild.previousSibling = newLast;\n\t}\n\tdo{\n\t\tnewFirst.parentNode = parentNode;\n\t}while(newFirst !== newLast && (newFirst= newFirst.nextSibling))\n\t_onUpdateChild(parentNode.ownerDocument||parentNode,parentNode);\n\t//console.log(parentNode.lastChild.nextSibling == null)\n\tif (newChild.nodeType == DOCUMENT_FRAGMENT_NODE) {\n\t\tnewChild.firstChild = newChild.lastChild = null;\n\t}\n\treturn newChild;\n}", "function _insertBefore(parentNode,newChild,nextChild){\n\tvar cp = newChild.parentNode;\n\tif(cp){\n\t\tcp.removeChild(newChild);//remove and update\n\t}\n\tif(newChild.nodeType === DOCUMENT_FRAGMENT_NODE){\n\t\tvar newFirst = newChild.firstChild;\n\t\tif (newFirst == null) {\n\t\t\treturn newChild;\n\t\t}\n\t\tvar newLast = newChild.lastChild;\n\t}else{\n\t\tnewFirst = newLast = newChild;\n\t}\n\tvar pre = nextChild ? nextChild.previousSibling : parentNode.lastChild;\n\n\tnewFirst.previousSibling = pre;\n\tnewLast.nextSibling = nextChild;\n\t\n\t\n\tif(pre){\n\t\tpre.nextSibling = newFirst;\n\t}else{\n\t\tparentNode.firstChild = newFirst;\n\t}\n\tif(nextChild == null){\n\t\tparentNode.lastChild = newLast;\n\t}else{\n\t\tnextChild.previousSibling = newLast;\n\t}\n\tdo{\n\t\tnewFirst.parentNode = parentNode;\n\t}while(newFirst !== newLast && (newFirst= newFirst.nextSibling))\n\t_onUpdateChild(parentNode.ownerDocument||parentNode,parentNode);\n\t//console.log(parentNode.lastChild.nextSibling == null)\n\tif (newChild.nodeType == DOCUMENT_FRAGMENT_NODE) {\n\t\tnewChild.firstChild = newChild.lastChild = null;\n\t}\n\treturn newChild;\n}", "function _insertBefore(parentNode,newChild,nextChild){\n\tvar cp = newChild.parentNode;\n\tif(cp){\n\t\tcp.removeChild(newChild);//remove and update\n\t}\n\tif(newChild.nodeType === DOCUMENT_FRAGMENT_NODE){\n\t\tvar newFirst = newChild.firstChild;\n\t\tif (newFirst == null) {\n\t\t\treturn newChild;\n\t\t}\n\t\tvar newLast = newChild.lastChild;\n\t}else{\n\t\tnewFirst = newLast = newChild;\n\t}\n\tvar pre = nextChild ? nextChild.previousSibling : parentNode.lastChild;\n\n\tnewFirst.previousSibling = pre;\n\tnewLast.nextSibling = nextChild;\n\t\n\t\n\tif(pre){\n\t\tpre.nextSibling = newFirst;\n\t}else{\n\t\tparentNode.firstChild = newFirst;\n\t}\n\tif(nextChild == null){\n\t\tparentNode.lastChild = newLast;\n\t}else{\n\t\tnextChild.previousSibling = newLast;\n\t}\n\tdo{\n\t\tnewFirst.parentNode = parentNode;\n\t}while(newFirst !== newLast && (newFirst= newFirst.nextSibling))\n\t_onUpdateChild(parentNode.ownerDocument||parentNode,parentNode);\n\t//console.log(parentNode.lastChild.nextSibling == null)\n\tif (newChild.nodeType == DOCUMENT_FRAGMENT_NODE) {\n\t\tnewChild.firstChild = newChild.lastChild = null;\n\t}\n\treturn newChild;\n}", "leafFallback(dom) {\n if (dom.nodeName == \"BR\" && this.top.type && this.top.type.inlineContent)\n this.addTextNode(dom.ownerDocument.createTextNode(\"\\n\"));\n }", "function prevElementSibling(elem) {\n let { prev } = elem;\n while (prev !== null && !node_isTag(prev))\n ({ prev } = prev);\n return prev;\n}", "function GetPreviousTextNode(pNode) {\n\tvar lPreviuosSibling = false;\n\tvar lParent = pNode;\n\twhile(lParent){\n\t\tlPreviuosSibling = lParent.previousSibling;\n\t\twhile(lPreviuosSibling){\n\t\t\tif(lPreviuosSibling.nodeType == 3)\n\t\t\t\treturn lPreviuosSibling;\n\t\t\tif(lPreviuosSibling.nodeType == 1){\n\t\t\t\tvar lTextNode = GetLastTextNodeDescendant(lPreviuosSibling);\n\t\t\t\tif(lTextNode)\n\t\t\t\t\treturn lTextNode;\n\t\t\t}\n\t\t\tlPreviuosSibling = lPreviuosSibling.previousSibling;\n\t\t}\n\t\tlParent = lParent.parentNode;\n\t}\n\treturn false;\n}", "function mergeTextNodes(data, coupleData, mode) {\n var prev = data.node;\n var next = data.node;\n var tagsMerged = mode === 'both' ? true : false;\n var remove = [];\n\n while (true) {\n prev = prev.previousSibling;\n if (!prev || prev.nodeType !== Node.TEXT_NODE) break;\n\n if (prev === coupleData.node) {\n tagsMerged = true;\n data.index += prev.nodeValue.length;\n data.node.nodeValue = prev.nodeValue + data.node.nodeValue;\n coupleData.node = data.node;\n } else if (prev.nodeValue.trim().length) {\n break;\n }\n\n remove.push(prev);\n }\n\n while (true) {\n next = next.nextSibling;\n if (!next || next.nodeType !== Node.TEXT_NODE) break;\n\n if (next === coupleData.node) {\n tagsMerged = true;\n coupleData.index += data.node.nodeValue.length;\n data.node.nodeValue = data.node.nodeValue + next.nodeValue;\n coupleData.node = data.node;\n } else if (next.nodeValue.trim().length) {\n break;\n }\n\n remove.push(next);\n }\n\n var parent = data.node.parentElement;\n for (var i = 0; i < remove.length; i++) {\n parent.removeChild(remove[i]);\n }\n\n return tagsMerged;\n}", "function _insertBefore(parentNode, newChild, nextChild) {\n var cp = newChild.parentNode;\n if (cp) {\n cp.removeChild(newChild); //remove and update\n }\n if (newChild.nodeType === DOCUMENT_FRAGMENT_NODE) {\n var newFirst = newChild.firstChild;\n if (newFirst == null) {\n return newChild;\n }\n var newLast = newChild.lastChild;\n } else {\n newFirst = newLast = newChild;\n }\n var pre = nextChild\n ? nextChild.previousSibling\n : parentNode.lastChild;\n\n newFirst.previousSibling = pre;\n newLast.nextSibling = nextChild;\n\n if (pre) {\n pre.nextSibling = newFirst;\n } else {\n parentNode.firstChild = newFirst;\n }\n if (nextChild == null) {\n parentNode.lastChild = newLast;\n } else {\n nextChild.previousSibling = newLast;\n }\n do {\n newFirst.parentNode = parentNode;\n } while (\n newFirst !== newLast &&\n (newFirst = newFirst.nextSibling)\n );\n _onUpdateChild(\n parentNode.ownerDocument || parentNode,\n parentNode\n );\n //console.log(parentNode.lastChild.nextSibling == null)\n if (newChild.nodeType == DOCUMENT_FRAGMENT_NODE) {\n newChild.firstChild = newChild.lastChild = null;\n }\n return newChild;\n }", "function _getPreviousSiblingThatIsNotBlank(node) {\n var previousSibling = node.previousSibling;\n while (previousSibling && _isBlankTextNode(previousSibling)) {\n previousSibling = previousSibling.previousSibling;\n }\n return previousSibling;\n }", "function _getPreviousSiblingThatIsNotBlank(node) {\n var previousSibling = node.previousSibling;\n while (previousSibling && _isBlankTextNode(previousSibling)) {\n previousSibling = previousSibling.previousSibling;\n }\n return previousSibling;\n }", "function _removeLineBreakBeforeAndAfter(node) {\n var nextSibling = _getNextSiblingThatIsNotBlank(node),\n previousSibling = _getPreviousSiblingThatIsNotBlank(node);\n\n if (nextSibling && _isLineBreak(nextSibling)) {\n nextSibling.parentNode.removeChild(nextSibling);\n }\n if (previousSibling && _isLineBreak(previousSibling)) {\n previousSibling.parentNode.removeChild(previousSibling);\n }\n }", "function _removeLineBreakBeforeAndAfter(node) {\n var nextSibling = _getNextSiblingThatIsNotBlank(node),\n previousSibling = _getPreviousSiblingThatIsNotBlank(node);\n\n if (nextSibling && _isLineBreak(nextSibling)) {\n nextSibling.parentNode.removeChild(nextSibling);\n }\n if (previousSibling && _isLineBreak(previousSibling)) {\n previousSibling.parentNode.removeChild(previousSibling);\n }\n }", "function merge(n1, n2) {\n n1.eval = n2.eval;\n if (n2.glyphs) n1.glyphs = n2.glyphs;\n n2.comments && n2.comments.forEach(function(c) {\n if (!n1.comments) n1.comments = [c];\n else if (!n1.comments.filter(function(d) {\n return d.text === c.text;\n }).length) n1.comments.push(c);\n });\n n2.children.forEach(function(c) {\n var existing = childById(n1, c.id);\n if (existing) merge(existing, c);\n else n1.children.push(c);\n });\n}", "function getCommentPrecedingNode(parsed, node) {\n var statementPath = statementOf(parsed, node, { asPath: true }),\n blockPath = statementPath.slice(0, -2),\n block = lively_lang.Path(blockPath).get(parsed);\n\n return !block.comments || !block.comments.length ? null : lively_lang.chain(extractComments(parsed)).reversed().detect(function (ea) {\n return ea.followingNode === node;\n }).value();\n}", "previous(editor) {\n var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};\n var {\n mode = 'lowest',\n voids = false\n } = options;\n var {\n match,\n at = editor.selection\n } = options;\n\n if (!at) {\n return;\n }\n\n var pointBeforeLocation = Editor.before(editor, at, {\n voids\n });\n\n if (!pointBeforeLocation) {\n return;\n }\n\n var [, to] = Editor.first(editor, []); // The search location is from the start of the document to the path of\n // the point before the location passed in\n\n var span = [pointBeforeLocation.path, to];\n\n if (Path.isPath(at) && at.length === 0) {\n throw new Error(\"Cannot get the previous node from the root node!\");\n }\n\n if (match == null) {\n if (Path.isPath(at)) {\n var [parent] = Editor.parent(editor, at);\n\n match = n => parent.children.includes(n);\n } else {\n match = () => true;\n }\n }\n\n var [previous] = Editor.nodes(editor, {\n reverse: true,\n at: span,\n match,\n mode,\n voids\n });\n return previous;\n }", "function isPreviousLineEmpty(text, node) {\n let idx = locStart$1(node) - 1;\n idx = skipSpaces(text, idx, { backwards: true });\n idx = skipNewline(text, idx, { backwards: true });\n idx = skipSpaces(text, idx, { backwards: true });\n const idx2 = skipNewline(text, idx, { backwards: true });\n return idx !== idx2;\n}", "function insertBeforeEnd(node,html)\r\n{\r\n\r\n\tif(node.insertAdjacentHTML)\r\n\t{\r\n\t\tnode.insertAdjacentHTML('beforeEnd', html);\t\t\r\n\t}\r\n\telse\r\n\t{\r\n\t\t//--\r\n\t\t//-- netscape way of inserting html ()\r\n\t\tvar r = node.ownerDocument.createRange();\r\n\t\tr.setStartBefore(node);\r\n\t\tvar parsedHTML = r.createContextualFragment(html);\r\n\t\tnode.appendChild(parsedHTML);\r\n\t}\r\n\r\n\treturn node.lastChild;\r\n}", "function precedingNode(node) {\n if (node.ownerElement)\n return node.ownerElement;\n if (null != node.previousSibling) {\n node = node.previousSibling;\n while (null != node.lastChild) {\n node = node.lastChild;\n }\n return node;\n }\n if (null != node.parentNode) {\n return node.parentNode;\n }\n return null;\n }", "function precedingNode(node) {\n if (node.ownerElement)\n return node.ownerElement;\n if (null != node.previousSibling) {\n node = node.previousSibling;\n while (null != node.lastChild) {\n node = node.lastChild;\n }\n return node;\n }\n if (null != node.parentNode) {\n return node.parentNode;\n }\n return null;\n }", "oppositeNode(node) {\n if (this.inputNode === node) {\n return this.outputNode;\n } else if (this.outputNode === node) {\n return this.inputNode;\n }\n\n return;\n }", "function diffText (previous, current, el) {\n\t if (current !== previous) el.data = current\n\t return el\n\t }", "* tryCombineWithLeft (op) {\n if (\n op != null &&\n op.left != null &&\n op.content != null &&\n op.left[0] === op.id[0] &&\n Y.utils.compareIds(op.left, op.origin)\n ) {\n var left = yield* this.getInsertion(op.left)\n if (left.content != null &&\n left.id[1] + left.content.length === op.id[1] &&\n left.originOf.length === 1 &&\n !left.gc && !left.deleted &&\n !op.gc && !op.deleted\n ) {\n // combine!\n if (op.originOf != null) {\n left.originOf = op.originOf\n } else {\n delete left.originOf\n }\n left.content = left.content.concat(op.content)\n left.right = op.right\n yield* this.os.delete(op.id)\n yield* this.setOperation(left)\n }\n }\n }", "function removeBlockQuoteOnBackSpace() {\n\t\t\t// Add block quote deletion handler\n\t\t\teditor.on('keydown', function(e) {\n\t\t\t\tvar rng, container, offset, root, parent;\n\n\t\t\t\tif (isDefaultPrevented(e) || e.keyCode != VK.BACKSPACE) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\trng = selection.getRng();\n\t\t\t\tcontainer = rng.startContainer;\n\t\t\t\toffset = rng.startOffset;\n\t\t\t\troot = dom.getRoot();\n\t\t\t\tparent = container;\n\n\t\t\t\tif (!rng.collapsed || offset !== 0) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\twhile (parent && parent.parentNode && parent.parentNode.firstChild == parent && parent.parentNode != root) {\n\t\t\t\t\tparent = parent.parentNode;\n\t\t\t\t}\n\n\t\t\t\t// Is the cursor at the beginning of a blockquote?\n\t\t\t\tif (parent.tagName === 'BLOCKQUOTE') {\n\t\t\t\t\t// Remove the blockquote\n\t\t\t\t\teditor.formatter.toggle('blockquote', null, parent);\n\n\t\t\t\t\t// Move the caret to the beginning of container\n\t\t\t\t\trng = dom.createRng();\n\t\t\t\t\trng.setStart(container, 0);\n\t\t\t\t\trng.setEnd(container, 0);\n\t\t\t\t\tselection.setRng(rng);\n\t\t\t\t}\n\t\t\t});\n\t\t}", "function removeBlockQuoteOnBackSpace() {\n\t\t\t// Add block quote deletion handler\n\t\t\teditor.on('keydown', function(e) {\n\t\t\t\tvar rng, container, offset, root, parent;\n\n\t\t\t\tif (isDefaultPrevented(e) || e.keyCode != VK.BACKSPACE) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\trng = selection.getRng();\n\t\t\t\tcontainer = rng.startContainer;\n\t\t\t\toffset = rng.startOffset;\n\t\t\t\troot = dom.getRoot();\n\t\t\t\tparent = container;\n\n\t\t\t\tif (!rng.collapsed || offset !== 0) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\twhile (parent && parent.parentNode && parent.parentNode.firstChild == parent && parent.parentNode != root) {\n\t\t\t\t\tparent = parent.parentNode;\n\t\t\t\t}\n\n\t\t\t\t// Is the cursor at the beginning of a blockquote?\n\t\t\t\tif (parent.tagName === 'BLOCKQUOTE') {\n\t\t\t\t\t// Remove the blockquote\n\t\t\t\t\teditor.formatter.toggle('blockquote', null, parent);\n\n\t\t\t\t\t// Move the caret to the beginning of container\n\t\t\t\t\trng = dom.createRng();\n\t\t\t\t\trng.setStart(container, 0);\n\t\t\t\t\trng.setEnd(container, 0);\n\t\t\t\t\tselection.setRng(rng);\n\t\t\t\t}\n\t\t\t});\n\t\t}", "function removeBlockQuoteOnBackSpace() {\n\t\t\t// Add block quote deletion handler\n\t\t\teditor.on('keydown', function(e) {\n\t\t\t\tvar rng, container, offset, root, parent;\n\n\t\t\t\tif (isDefaultPrevented(e) || e.keyCode != VK.BACKSPACE) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\trng = selection.getRng();\n\t\t\t\tcontainer = rng.startContainer;\n\t\t\t\toffset = rng.startOffset;\n\t\t\t\troot = dom.getRoot();\n\t\t\t\tparent = container;\n\n\t\t\t\tif (!rng.collapsed || offset !== 0) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\twhile (parent && parent.parentNode && parent.parentNode.firstChild == parent && parent.parentNode != root) {\n\t\t\t\t\tparent = parent.parentNode;\n\t\t\t\t}\n\n\t\t\t\t// Is the cursor at the beginning of a blockquote?\n\t\t\t\tif (parent.tagName === 'BLOCKQUOTE') {\n\t\t\t\t\t// Remove the blockquote\n\t\t\t\t\teditor.formatter.toggle('blockquote', null, parent);\n\n\t\t\t\t\t// Move the caret to the beginning of container\n\t\t\t\t\trng = dom.createRng();\n\t\t\t\t\trng.setStart(container, 0);\n\t\t\t\t\trng.setEnd(container, 0);\n\t\t\t\t\tselection.setRng(rng);\n\t\t\t\t}\n\t\t\t});\n\t\t}", "insertAfterNode(ref){this.startNode=ref;this.endNode=ref.nextSibling}", "function prepend(elem,prev){var parent=elem.parent;if(parent){var childs=parent.children;childs.splice(childs.lastIndexOf(elem),0,prev);}if(elem.prev){elem.prev.next=prev;}prev.parent=parent;prev.prev=elem.prev;prev.next=elem;elem.prev=prev;}", "function diffText (previous, current, el) {\n if (current.data !== previous.data) el.data = current.data\n return el\n }", "insertNode(node) {\n if (node.isInline && this.needsBlock && !this.top.type) {\n let block = this.textblockFromContext();\n if (block)\n this.enterInner(block);\n }\n if (this.findPlace(node)) {\n this.closeExtra();\n let top = this.top;\n top.applyPending(node.type);\n if (top.match)\n top.match = top.match.matchType(node.type);\n let marks = top.activeMarks;\n for (let i = 0; i < node.marks.length; i++)\n if (!top.type || top.type.allowsMarkType(node.marks[i].type))\n marks = node.marks[i].addToSet(marks);\n top.content.push(node.mark(marks));\n return true;\n }\n return false;\n }", "function getPreviousBlock(editor) {\n return getNearbyBlock(editor, \"previous\");\n}", "function mergeSelectedBlockAndSetToInlineContainer(editor, options) {\n const { mode = \"previous\" } = options;\n const selection = editor.selection;\n if (!selection)\n return;\n const [, selectedBlockPath] = index_es/* Editor.parent */.ML.parent(editor, selection.anchor.path);\n const mergePath = mode === \"previous\" ? selectedBlockPath : index_es/* Path.next */.y$.next(selectedBlockPath);\n // The path of the newly merged node\n const resultingPath = mode === \"previous\"\n ? index_es/* Path.previous */.y$.previous(selectedBlockPath)\n : selectedBlockPath;\n index_es/* Editor.withoutNormalizing */.ML.withoutNormalizing(editor, () => {\n index_es/* Transforms.mergeNodes */.YR.mergeNodes(editor, { at: mergePath });\n index_es/* Transforms.setNodes */.YR.setNodes(editor, { type: utils_NodeTypes.INLINE_CONTAINER }, { at: resultingPath });\n });\n}", "insertAfterNode(ref){this.startNode=ref;this.endNode=ref.nextSibling;}", "function injectAfter(parentNode, referenceNode, node) {\n let beforeNode;\n if (node.parentNode === parentNode &&\n node.previousSibling === referenceNode) {\n return;\n }\n if (referenceNode == null) {\n // node is supposed to be first.\n beforeNode = parentNode.firstChild;\n } else {\n // node is supposed to be after referenceNode.\n beforeNode = referenceNode.nextSibling;\n }\n if (beforeNode && beforeNode.previousSibling !== node) {\n // Cases where `node === beforeNode` should get filtered out by earlier\n // checks and the behavior isn't well-defined.\n invariant(\n node !== beforeNode,\n 'ReactART: Can not insert node before itself'\n );\n node.injectBefore(beforeNode);\n } else if (node.parentNode !== parentNode) {\n node.inject(parentNode);\n }\n}", "popToNearestCommonAncestor(prev, parentNext);\n } else {\n // We must still be deeper.\n popNextToCommonLevel(prev, parentNext);\n }", "function replaceEmptyNode(data, coupleData, mode) {\n var node = data.node;\n var parent = node.parentElement;\n var tagText = mode === 'both' ? data.tag + coupleData.tag : data.tag;\n\n // Simple check\n var skip =\n !parent ||\n parent === root ||\n !parent.parentElement ||\n parent.childNodes.length > 1 ||\n !replacableNodes[parent.nodeName];\n\n if (skip) return;\n\n var empty = tagText === node.nodeValue.trim();\n\n // Check if tag text node contains only tag(s) and spaces\n if (!empty && mode === 'both') {\n var text = node.nodeValue;\n var inner = text.substring(0, data.index) +\n text.substring(data.index + data.tag.length, coupleData.index) +\n text.substring(coupleData.index + coupleData.tag.length);\n\n empty = !inner.trim().length;\n }\n\n if (!empty) return;\n\n parent.parentElement.replaceChild(node, parent);\n data.level--;\n\n // There are element nodes in new parent, so it's definitely not empty. Do not perform recursive replace\n if (node.parentElement.children.length) return;\n\n // Join moved node with possible sibling empty text nodes in new parent element\n // Node.normalize() can not be used here, because it can destroy current references to text nodes with tags\n var tagsMerged = mergeTextNodes(data, coupleData, mode);\n mode = tagsMerged ? 'both' : mode;\n\n replaceEmptyNode(data, coupleData, mode);\n}", "popToNearestCommonAncestor(parentPrev, next);\n } else {\n // We must still be deeper.\n popPreviousToCommonLevel(parentPrev, next);\n }", "getPreviousParagraphBlock(block) {\n if (block.previousRenderedWidget instanceof ParagraphWidget) {\n return block.previousRenderedWidget;\n }\n else if (block.previousRenderedWidget instanceof TableWidget) {\n return this.getLastParagraphInLastCell((block.previousRenderedWidget));\n }\n if (block.containerWidget instanceof TableCellWidget) {\n return this.getPreviousParagraphCell((block.containerWidget));\n }\n else if (block.containerWidget instanceof BodyWidget) {\n return this.getPreviousParagraph(block.containerWidget);\n }\n else if (block.containerWidget instanceof HeaderFooterWidget && this.isMoveDownOrMoveUp) {\n return this.getLastBlockInPreviousHeaderFooter(block);\n }\n return undefined;\n }", "function compareDocumentPosition(nodeA,nodeB){var aParents=[];var bParents=[];if(nodeA===nodeB){return 0;}var current=tagtypes_1.hasChildren(nodeA)?nodeA:nodeA.parent;while(current){aParents.unshift(current);current=current.parent;}current=tagtypes_1.hasChildren(nodeB)?nodeB:nodeB.parent;while(current){bParents.unshift(current);current=current.parent;}var idx=0;while(aParents[idx]===bParents[idx]){idx++;}if(idx===0){return 1/* DISCONNECTED */;}var sharedParent=aParents[idx-1];var siblings=sharedParent.children;var aSibling=aParents[idx];var bSibling=bParents[idx];if(siblings.indexOf(aSibling)>siblings.indexOf(bSibling)){if(sharedParent===nodeB){return 4/* FOLLOWING */|16/* CONTAINED_BY */;}return 4/* FOLLOWING */;}else{if(sharedParent===nodeA){return 2/* PRECEDING */|8/* CONTAINS */;}return 2/* PRECEDING */;}}", "function previousElementSibling(el) {\n do { el = el.previousSibling; } while ( el && el.nodeType !== 1 );\n return el;\n}", "function nodeToMarkdeepSource(node, leaveEscapes) {\n var source = node.innerHTML;\n\n // Markdown uses <john@bar.com> e-mail syntax, which HTML parsing\n // will try to close by inserting the matching close tags at the end of the\n // document. Remove anything that looks like that and comes *after*\n // the first fallback style.\n source = source.replace(/(?:<style class=\"fallback\">[\\s\\S]*?<\\/style>[\\s\\S]*)<\\/\\S+@\\S+\\.\\S+?>/gim, '');\n \n // Remove artificially inserted close tags\n source = source.replace(/<\\/h?ttps?:.*>/gi, '');\n \n // Now try to fix the URLs themselves, which will be \n // transformed like this: <http: casual-effects.com=\"\" markdeep=\"\">\n source = source.replace(/<(https?): (.*?)>/gi, function (match, protocol, list) {\n\n // Remove any quotes--they wouldn't have been legal in the URL anyway\n var s = '<' + protocol + '://' + list.replace(/=\"\"\\s/g, '/');\n\n if (s.substring(s.length - 3) === '=\"\"') {\n s = s.substring(0, s.length - 3);\n }\n\n // Remove any lingering quotes (since they\n // wouldn't have been legal in the URL)\n s = s.replace(/\"/g, '');\n\n return s + '>';\n });\n\n // Remove the \"fallback\" style tags\n source = source.replace(/<style class=[\"']fallback[\"']>.*?<\\/style>/gmi, '');\n\n source = unescapeHTMLEntities(source);\n\n return source;\n}", "replaceSelectionWith(node, inheritMarks = true) {\n let selection = this.selection;\n if (inheritMarks)\n node = node.mark(this.storedMarks || (selection.empty ? selection.$from.marks() : selection.$from.marksAcross(selection.$to) || Mark$1.none));\n selection.replaceWith(this, node);\n return this;\n }", "function removeEmptyLinesBefore(\n\tnode,\n\tnewline\n) {\n\tnode.raws.before = node.raws.before.replace(/(\\r?\\n\\s*\\r?\\n)+/g, newline);\n\n\treturn node;\n}", "function previousElement(/* Node */ node, /*string? */ tagName) { \n\t//\tsummary:\n\t//\t\treturns the previous sibling element matching tagName\n\tif(!node) { return null; }\n\tif(tagName) { tagName = tagName.toLowerCase(); }\n\tdo {\n\t\tnode = node.previousSibling;\n\t} while(node && node.nodeType != 1 /* ELEMENT_NODE */);\n\n\tif(node && tagName && tagName.toLowerCase() != node.tagName.toLowerCase()) {\n\t\treturn previousElement(node, tagName);\n\t}\n\treturn node;\t//\tElement\n}", "function stretchSpansOverChange(doc, change) {\r\n var oldFirst = isLine(doc, change.from.line) && getLine(doc, change.from.line).markedSpans;\r\n var oldLast = isLine(doc, change.to.line) && getLine(doc, change.to.line).markedSpans;\r\n if (!oldFirst && !oldLast) return null;\r\n\r\n var startCh = change.from.ch, endCh = change.to.ch, isInsert = cmp(change.from, change.to) == 0;\r\n // Get the spans that 'stick out' on both sides\r\n var first = markedSpansBefore(oldFirst, startCh, isInsert);\r\n var last = markedSpansAfter(oldLast, endCh, isInsert);\r\n\r\n // Next, merge those two ends\r\n var sameLine = change.text.length == 1, offset = lst(change.text).length + (sameLine ? startCh : 0);\r\n if (first) {\r\n // Fix up .to properties of first\r\n for (var i = 0; i < first.length; ++i) {\r\n var span = first[i];\r\n if (span.to == null) {\r\n var found = getMarkedSpanFor(last, span.marker);\r\n if (!found) span.to = startCh;\r\n else if (sameLine) span.to = found.to == null ? null : found.to + offset;\r\n }\r\n }\r\n }\r\n if (last) {\r\n // Fix up .from in last (or move them into first in case of sameLine)\r\n for (var i = 0; i < last.length; ++i) {\r\n var span = last[i];\r\n if (span.to != null) span.to += offset;\r\n if (span.from == null) {\r\n var found = getMarkedSpanFor(first, span.marker);\r\n if (!found) {\r\n span.from = offset;\r\n if (sameLine) (first || (first = [])).push(span);\r\n }\r\n } else {\r\n span.from += offset;\r\n if (sameLine) (first || (first = [])).push(span);\r\n }\r\n }\r\n }\r\n // Make sure we didn't create any zero-length spans\r\n if (first) first = clearEmptySpans(first);\r\n if (last && last != first) last = clearEmptySpans(last);\r\n\r\n var newMarkers = [first];\r\n if (!sameLine) {\r\n // Fill gap with whole-line-spans\r\n var gap = change.text.length - 2, gapMarkers;\r\n if (gap > 0 && first)\r\n for (var i = 0; i < first.length; ++i)\r\n if (first[i].to == null)\r\n (gapMarkers || (gapMarkers = [])).push(new MarkedSpan(first[i].marker, null, null));\r\n for (var i = 0; i < gap; ++i)\r\n newMarkers.push(gapMarkers);\r\n newMarkers.push(last);\r\n }\r\n return newMarkers;\r\n }", "mergeToLeft(leftNode, rightNode) {\n if (!rightNode.empty()) {\n let leftNodeLastRightChildOldValue = leftNode.last().rightChild;\n leftNode.last().rightChild = rightNode.getLeftmostChild();\n this.addAtLastIndexOfCallStack(\n () => {\n leftNode.last().rightChild = leftNodeLastRightChildOldValue;\n }\n )\n if (leftNode.hasRightmostChild()) {\n let leftNodeLastRightChildParentOldValue = leftNode.last().rightChild.parent;\n leftNode.last().rightChild.parent = leftNode;\n this.addAtLastIndexOfCallStack(\n () => {\n leftNode.last().rightChild.parent = leftNodeLastRightChildParentOldValue;\n }\n );\n }\n while (!rightNode.empty()) {\n let rightNodeElement = rightNode.popFirst();\n this.addAtLastIndexOfCallStack(\n this.undoPopFirst.bind(this, rightNodeElement, rightNode)\n );\n leftNode.addLast(rightNodeElement);\n this.addAtLastIndexOfCallStack(\n this.undoAddLast.bind(this, leftNode)\n )\n if (leftNode.last().leftChild != null) {\n let leftNodeLastLeftChildParentOldValue = leftNode.last().leftChild.parent;\n leftNode.last().leftChild.parent = leftNode;\n this.addAtLastIndexOfCallStack(\n () => {\n leftNode.last().leftChild.parent = leftNodeLastLeftChildParentOldValue;\n }\n )\n }\n if (leftNode.last().rightChild != null) {\n let leftNodeLastRightChildParentOldValue = leftNode.last().rightChild.parent;\n leftNode.last().rightChild.parent = leftNode;\n this.addAtLastIndexOfCallStack(\n () => {\n leftNode.last().rightChild.parent = leftNodeLastRightChildParentOldValue\n }\n );\n }\n }\n }\n\n let rightNodeParentOldValue = rightNode.parent;\n rightNode.parent = null;\n this.addAtLastIndexOfCallStack(\n () => {\n rightNode.parent = rightNodeParentOldValue;\n }\n );\n\n let rightNodeOldValue = rightNode;\n rightNode = null;\n this.addAtLastIndexOfCallStack(\n () => {\n rightNode = rightNodeOldValue;\n }\n );\n }", "function mergeTokens(a, b) {\n\ta.text += ' ' + b.text;\n\ta.normalised += ' ' + b.normalised;\n\ta.pos_reason += '|' + b.pos_reason;\n\ta.start = a.start || b.start;\n\ta.noun_capital = a.noun_capital || b.noun_capital;\n\ta.punctuated = a.punctuated || b.punctuated;\n\ta.end = a.end || b.end;\n\treturn a;\n}", "insertAfterNode(e){this.startNode=e,this.endNode=e.nextSibling}", "function _addLineBreakBeforeAndAfter(node) {\n var doc = node.ownerDocument,\n nextSibling = _getNextSiblingThatIsNotBlank(node),\n previousSibling = _getPreviousSiblingThatIsNotBlank(node);\n\n if (nextSibling && !_isLineBreakOrBlockElement(nextSibling)) {\n node.parentNode.insertBefore(doc.createElement(\"br\"), nextSibling);\n }\n if (previousSibling && !_isLineBreakOrBlockElement(previousSibling)) {\n node.parentNode.insertBefore(doc.createElement(\"br\"), node);\n }\n }" ]
[ "0.8367977", "0.61360675", "0.61360675", "0.61360675", "0.61360675", "0.61360675", "0.61360675", "0.5930932", "0.57893425", "0.56482565", "0.5554666", "0.54335237", "0.5431284", "0.53100824", "0.52976626", "0.52637064", "0.5200446", "0.5166874", "0.5166874", "0.5166874", "0.5160266", "0.5157747", "0.5155883", "0.51455396", "0.5131664", "0.5094653", "0.50615054", "0.5055284", "0.5041274", "0.50244904", "0.50114465", "0.50024486", "0.50017196", "0.49914032", "0.49769774", "0.49769774", "0.49769774", "0.49769774", "0.49769774", "0.49769774", "0.49769774", "0.49769774", "0.49769774", "0.49769774", "0.49769774", "0.49769774", "0.49769774", "0.49769774", "0.49769774", "0.49769774", "0.49702573", "0.49505237", "0.4936431", "0.4926436", "0.49253345", "0.49250448", "0.49250448", "0.49175546", "0.49175546", "0.49069968", "0.48987228", "0.48933887", "0.48700577", "0.48536092", "0.48521537", "0.48521537", "0.4842181", "0.4838402", "0.48224407", "0.4822319", "0.4822319", "0.4822319", "0.48149553", "0.48133153", "0.48023754", "0.47856978", "0.47832733", "0.4777464", "0.47677726", "0.4763815", "0.4761254", "0.47463417", "0.47449404", "0.47431388", "0.47425753", "0.47421405", "0.47379154", "0.4728178", "0.47110417", "0.4697134", "0.46863", "0.46779525", "0.46660224", "0.46583363", "0.4657026" ]
0.85240054
5
Construct a tokenizer. This creates both `tokenizeInline` and `tokenizeBlock`.
function factory(type) { return tokenize; /* Tokenizer for a bound `type`. */ function tokenize(value, location) { var self = this; var offset = self.offset; var tokens = []; var methods = self[type + 'Methods']; var tokenizers = self[type + 'Tokenizers']; var line = location.line; var column = location.column; var index; var length; var method; var name; var matched; var valueLength; /* Trim white space only lines. */ if (!value) { return tokens; } /* Expose on `eat`. */ eat.now = now; eat.file = self.file; /* Sync initial offset. */ updatePosition(''); /* Iterate over `value`, and iterate over all * tokenizers. When one eats something, re-iterate * with the remaining value. If no tokenizer eats, * something failed (should not happen) and an * exception is thrown. */ while (value) { index = -1; length = methods.length; matched = false; while (++index < length) { name = methods[index]; method = tokenizers[name]; if ( method && /* istanbul ignore next */ (!method.onlyAtStart || self.atStart) && (!method.notInList || !self.inList) && (!method.notInBlock || !self.inBlock) && (!method.notInLink || !self.inLink) ) { valueLength = value.length; method.apply(self, [eat, value]); matched = valueLength !== value.length; if (matched) { break; } } } /* istanbul ignore if */ if (!matched) { self.file.fail(new Error('Infinite loop'), eat.now()); } } self.eof = now(); return tokens; /* Update line, column, and offset based on * `value`. */ function updatePosition(subvalue) { var lastIndex = -1; var index = subvalue.indexOf('\n'); while (index !== -1) { line++; lastIndex = index; index = subvalue.indexOf('\n', index + 1); } if (lastIndex === -1) { column += subvalue.length; } else { column = subvalue.length - lastIndex; } if (line in offset) { if (lastIndex !== -1) { column += offset[line]; } else if (column <= offset[line]) { column = offset[line] + 1; } } } /* Get offset. Called before the first character is * eaten to retrieve the range's offsets. */ function getOffset() { var indentation = []; var pos = line + 1; /* Done. Called when the last character is * eaten to retrieve the range’s offsets. */ return function () { var last = line + 1; while (pos < last) { indentation.push((offset[pos] || 0) + 1); pos++; } return indentation; }; } /* Get the current position. */ function now() { var pos = {line: line, column: column}; pos.offset = self.toOffset(pos); return pos; } /* Store position information for a node. */ function Position(start) { this.start = start; this.end = now(); } /* Throw when a value is incorrectly eaten. * This shouldn’t happen but will throw on new, * incorrect rules. */ function validateEat(subvalue) { /* istanbul ignore if */ if (value.substring(0, subvalue.length) !== subvalue) { /* Capture stack-trace. */ self.file.fail( new Error( 'Incorrectly eaten value: please report this ' + 'warning on http://git.io/vg5Ft' ), now() ); } } /* Mark position and patch `node.position`. */ function position() { var before = now(); return update; /* Add the position to a node. */ function update(node, indent) { var prev = node.position; var start = prev ? prev.start : before; var combined = []; var n = prev && prev.end.line; var l = before.line; node.position = new Position(start); /* If there was already a `position`, this * node was merged. Fixing `start` wasn’t * hard, but the indent is different. * Especially because some information, the * indent between `n` and `l` wasn’t * tracked. Luckily, that space is * (should be?) empty, so we can safely * check for it now. */ if (prev && indent && prev.indent) { combined = prev.indent; if (n < l) { while (++n < l) { combined.push((offset[n] || 0) + 1); } combined.push(before.column); } indent = combined.concat(indent); } node.position.indent = indent || []; return node; } } /* Add `node` to `parent`s children or to `tokens`. * Performs merges where possible. */ function add(node, parent) { var children = parent ? parent.children : tokens; var prev = children[children.length - 1]; if ( prev && node.type === prev.type && node.type in MERGEABLE_NODES && mergeable(prev) && mergeable(node) ) { node = MERGEABLE_NODES[node.type].call(self, prev, node); } if (node !== prev) { children.push(node); } if (self.atStart && tokens.length !== 0) { self.exitStart(); } return node; } /* Remove `subvalue` from `value`. * `subvalue` must be at the start of `value`. */ function eat(subvalue) { var indent = getOffset(); var pos = position(); var current = now(); validateEat(subvalue); apply.reset = reset; reset.test = test; apply.test = test; value = value.substring(subvalue.length); updatePosition(subvalue); indent = indent(); return apply; /* Add the given arguments, add `position` to * the returned node, and return the node. */ function apply(node, parent) { return pos(add(pos(node), parent), indent); } /* Functions just like apply, but resets the * content: the line and column are reversed, * and the eaten value is re-added. * This is useful for nodes with a single * type of content, such as lists and tables. * See `apply` above for what parameters are * expected. */ function reset() { var node = apply.apply(null, arguments); line = current.line; column = current.column; value = subvalue + value; return node; } /* Test the position, after eating, and reverse * to a not-eaten state. */ function test() { var result = pos({}); line = current.line; column = current.column; value = subvalue + value; return result.position; } } } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function tokenizer(input, options) {\n return Parser.tokenizer(input, options)\n }", "function tokenizer(input, options) {\n return Parser.tokenizer(input, options)\n }", "function tokenizer(input, options) {\n return Parser.tokenizer(input, options)\n }", "function tokenizer(input, options) {\n return new Parser(options, input)\n}", "function tokenizer(input, options) {\n return new Parser(options, input)\n}", "function tokenizer(input, options) {\n return new Parser(options, input)\n}", "function tokenizer(input, options) {\n return Parser.tokenizer(input, options)\n}", "function tokenizer(input, options) {\n return Parser.tokenizer(input, options)\n}", "function tokenizer(input, options) {\n return Parser.tokenizer(input, options)\n}", "function tokenizer(input, options) {\n return Parser.tokenizer(input, options)\n}", "function tokenizer(input, options) {\n return Parser.tokenizer(input, options)\n}", "function tokenizer(input, options) {\n return Parser.tokenizer(input, options)\n}", "function tokenizer(input, options) {\n return Parser.tokenizer(input, options)\n}", "static makeTokenizer(literals, input) {\n if (theTokenizer === null) {\n theTokenizer = new tokenizer(literals, input);\n }\n }", "function tokenizer(input, options) {\n return new _state.Parser(options, input);\n}", "function Token(type, text, newlines, whitespace_before, parent) {\n this.type = type;\n this.text = text;\n\n // comments_before are\n // comments that have a new line before them\n // and may or may not have a newline after\n // this is a set of comments before\n this.comments_before = /* inline comment*/ [];\n\n\n this.comments_after = []; // no new line before and newline after\n this.newlines = newlines || 0;\n this.wanted_newline = newlines > 0;\n this.whitespace_before = whitespace_before || '';\n this.parent = parent || null;\n this.opened = null;\n this.directives = null;\n}", "tokenizer(token , isEndOfInput , previousTokens , terminal , config){\n }", "function tokenize(text) {\n return tokenizer.processItem({ lineText: text }, true);\n}", "function tokenizer(input) {\n const singleTokensSpecs = [\n { char: '=', tokenType: 'equal' },\n { char: '*', tokenType: 'star' },\n { char: '!', tokenType: 'not' },\n { char: '[', tokenType: 'bracket' },\n { char: ']', tokenType: 'bracket' },\n { char: '-', tokenType: 'minus' },\n { char: '+', tokenType: 'plus' },\n { char: '\\\\', tokenType: 'backslash' },\n { char: '/', tokenType: 'forwardslash' },\n { char: '.', tokenType: 'dot' },\n { char: '<', tokenType: 'less' },\n { char: '>', tokenType: 'greater' },\n { char: '|', tokenType: 'pipe' },\n { char: '&', tokenType: 'and' },\n { char: '%', tokenType: 'percent' },\n { char: '^', tokenType: 'caret' },\n { char: ',', tokenType: 'comma' },\n { char: ';', tokenType: 'semi' },\n { char: '~', tokenType: 'tilde' },\n { char: '`', tokenType: 'grave' },\n { char: '(', tokenType: 'paren' },\n { char: ')', tokenType: 'paren' },\n { char: ':', tokenType: 'colon' },\n { char: '{', tokenType: 'curly' },\n { char: '}', tokenType: 'curly' },\n { char: '#', tokenType: 'SPECIAL' }\n ];\n const regexSingleTokensSpecs = [\n {\n start: /^(\\/\\/.*)/,\n tokenType: 'NONE',\n addLength: 0\n },\n {\n start: /^([\\s\\t\\n]+)/,\n tokenType: 'NONE',\n addLength: 0\n },\n {\n start: /^(\\d[\\d_]*\\b)/,\n tokenType: 'numberDec',\n addLength: 0\n },\n {\n start: /^0[xX]([\\da-fA-F][\\da-fA-F_]*\\b)/,\n tokenType: 'numberHex',\n addLength: 2\n },\n {\n start: /^(break|const|continue|do|else|exit|for|goto|halt|if|long|return|sleep|struct|void|while)/,\n tokenType: 'keyword',\n addLength: 0\n },\n {\n start: /^(asm)/,\n tokenType: 'SPECIAL',\n addLength: 0\n },\n {\n start: /^(\\w+)/,\n tokenType: 'variable',\n addLength: 0\n }\n ];\n const regexDoubleTokensSpecs = [\n {\n start: /^\\/\\*/,\n end: /([\\s\\S]*?\\*\\/)/,\n tokenType: 'NONE',\n startLength: 2,\n removeTrailing: 0,\n errorMsg: \"Missing '*/' to end comment section.\"\n },\n {\n start: /^\"/,\n end: /([\\s\\S]*?\")/,\n tokenType: 'string',\n startLength: 1,\n removeTrailing: 1,\n errorMsg: \"Missing '\\\"' to end string.\"\n },\n {\n start: /^'/,\n end: /([\\s\\S]*?')/,\n tokenType: 'string',\n startLength: 1,\n removeTrailing: 1,\n errorMsg: \"Missing \\\"'\\\" to end string.\"\n }\n ];\n let currentChar, remainingText;\n let current = 0;\n const tokens = [];\n let currentLine = 1;\n while (current < input.length) {\n currentChar = input.charAt(current);\n remainingText = input.slice(current);\n // Resolve double regex tokens\n const found = regexDoubleTokensSpecs.find(ruleN => {\n const startParts = ruleN.start.exec(remainingText);\n if (startParts != null) {\n const endParts = ruleN.end.exec(remainingText.slice(ruleN.startLength));\n current += ruleN.startLength;\n if (endParts !== null) {\n if (ruleN.tokenType === 'NONE') {\n currentLine += (endParts[1].match(/\\n/g) || '').length;\n current += endParts[1].length;\n return true; // breaks find function\n }\n tokens.push({ type: ruleN.tokenType, value: endParts[1].slice(0, -ruleN.removeTrailing), line: currentLine });\n currentLine += (endParts[1].match(/\\n/g) || '').length;\n current += endParts[1].length;\n return true; // breaks find function\n }\n throw new TypeError(`At line: ${currentLine}. ${ruleN.errorMsg}`);\n }\n return false;\n });\n if (found !== undefined) {\n // item already processed\n continue;\n }\n // Resolve single regex tokens\n const found2 = regexSingleTokensSpecs.find(ruleN => {\n const startParts = ruleN.start.exec(remainingText);\n if (startParts != null) {\n if (ruleN.tokenType === 'NONE') {\n currentLine += (startParts[1].match(/\\n/g) || '').length;\n current += startParts[1].length + ruleN.addLength;\n return true; // breaks find function\n }\n if (ruleN.tokenType === 'SPECIAL') {\n // handle asm case\n const asmParts = /^(asm[^\\w]*\\{([\\s\\S]*?)\\})/.exec(remainingText);\n if (asmParts === null) {\n throw new TypeError('At line:' + currentLine + ' Error parsing `asm { ... }` keyword');\n }\n tokens.push({ type: 'keyword', value: 'asm', line: currentLine, asmText: asmParts[2] });\n currentLine += (asmParts[1].match(/\\n/g) || '').length;\n current += asmParts[1].length;\n return true; // breaks find function\n }\n tokens.push({ type: ruleN.tokenType, value: startParts[1], line: currentLine });\n currentLine += (startParts[1].match(/\\n/g) || '').length;\n current += startParts[1].length + ruleN.addLength;\n return true; // breaks find function\n }\n return false;\n });\n if (found2 !== undefined) {\n continue;\n }\n // Resolve all single tokens\n const search = singleTokensSpecs.find(charDB => charDB.char === currentChar);\n if (search !== undefined) {\n if (search.tokenType === 'NONE') {\n current++;\n continue;\n }\n else if (search.tokenType === 'SPECIAL') {\n if (search.char === '#') {\n current++;\n const lines = input.slice(current).split('\\n');\n let i = 0;\n let val = '';\n for (; i < lines.length; i++) {\n val += lines[i];\n current += lines[i].length + 1; // newline!\n currentLine++;\n if (lines[i].endsWith('\\\\')) {\n val = val.slice(0, -1);\n continue;\n }\n break;\n }\n tokens.push({ type: 'macro', value: val, line: currentLine - i - 1 });\n continue;\n }\n throw new TypeError(`At line: ${currentLine}. SPECIAL rule not implemented in tokenizer().`);\n }\n tokens.push({ type: search.tokenType, value: currentChar, line: currentLine });\n current++;\n continue;\n }\n throw new TypeError(`At line: ${currentLine}. Forbidden character found: '${currentChar}'.`);\n }\n return tokens;\n}", "tokenize(input, ruleName) {\n const tokens = super.tokenize(input)\n if (typeof input === \"string\" && ruleName === \"block\") return this.tokenizer.breakIntoBlocks(tokens)\n return tokens\n }", "tokenize () {\n console.log(\"Initializing tokenizer\");\n //0. Pick some RESERVEDWORD (string which never occurs in your input)\n //1. Read the whole program into a single string; kill the newlines and tabs\n let tokenizedProgram = this.program.replace(\"\\n\",\"\");\n //2. Replace all constant literals with “RESERVEDWORD”<the literal>“RESERVEDWORD”\n let that = this;\n literals.forEach(function(s) {\n tokenizedProgram = tokenizedProgram.split(s).join(that.RESERVEDWORD + s.trim() + that.RESERVEDWORD);\n });\n //3. Replace all “RESERVEDWORDRESERVEDWORD” with just “RESERVEDWORD”\n tokenizedProgram = tokenizedProgram.replace(this.RESERVEDWORD + this.RESERVEDWORD, this.RESERVEDWORD);\n //4. Remove leading “RESERVEDWORD” character, then split on “RESERVEDWORD”\n if(tokenizedProgram.length>0 && tokenizedProgram[0] === this.RESERVEDWORD){\n tokenizedProgram = tokenizedProgram.substring(1);\n }\n let tokens = tokenizedProgram.split(this.RESERVEDWORD);\n //5. Trim whitespace around tokens\n for(let i = 0; i < tokens.length; i++){\n let t = tokens[i].trim();\n if (t.length > 0) {\n this.tokens.push(t);\n }\n }\n console.log(this.tokens);\n console.log(\"Done tokenizing\");\n }", "function Tokenizer(selector) {\n this.selector = selector;\n this.tokens = [];\n this.tokenize();\n }", "function Tokenizer(str) {\n this._str = str;\n this.pos = 0;\n}", "function Tokenizer (input) {\n this.reader = input;\n this._previous = null;\n }", "function factory(type) {\n return tokenize\n\n // Tokenizer for a bound `type`.\n function tokenize(value, location) {\n var self = this\n var offset = self.offset\n var tokens = []\n var methods = self[type + 'Methods']\n var tokenizers = self[type + 'Tokenizers']\n var line = location.line\n var column = location.column\n var index\n var length\n var method\n var name\n var matched\n var valueLength\n\n // Trim white space only lines.\n if (!value) {\n return tokens\n }\n\n // Expose on `eat`.\n eat.now = now\n eat.file = self.file\n\n // Sync initial offset.\n updatePosition('')\n\n // Iterate over `value`, and iterate over all tokenizers. When one eats\n // something, re-iterate with the remaining value. If no tokenizer eats,\n // something failed (should not happen) and an exception is thrown.\n while (value) {\n index = -1\n length = methods.length\n matched = false\n\n while (++index < length) {\n name = methods[index]\n method = tokenizers[name]\n\n // Previously, we had constructs such as footnotes and YAML that used\n // these properties.\n // Those are now external (plus there are userland extensions), that may\n // still use them.\n if (\n method &&\n /* istanbul ignore next */ (!method.onlyAtStart || self.atStart) &&\n /* istanbul ignore next */ (!method.notInList || !self.inList) &&\n /* istanbul ignore next */ (!method.notInBlock || !self.inBlock) &&\n (!method.notInLink || !self.inLink)\n ) {\n valueLength = value.length\n\n method.apply(self, [eat, value])\n\n matched = valueLength !== value.length\n\n if (matched) {\n break\n }\n }\n }\n\n /* istanbul ignore if */\n if (!matched) {\n self.file.fail(new Error('Infinite loop'), eat.now())\n }\n }\n\n self.eof = now()\n\n return tokens\n\n // Update line, column, and offset based on `value`.\n function updatePosition(subvalue) {\n var lastIndex = -1\n var index = subvalue.indexOf('\\n')\n\n while (index !== -1) {\n line++\n lastIndex = index\n index = subvalue.indexOf('\\n', index + 1)\n }\n\n if (lastIndex === -1) {\n column += subvalue.length\n } else {\n column = subvalue.length - lastIndex\n }\n\n if (line in offset) {\n if (lastIndex !== -1) {\n column += offset[line]\n } else if (column <= offset[line]) {\n column = offset[line] + 1\n }\n }\n }\n\n // Get offset. Called before the first character is eaten to retrieve the\n // range’s offsets.\n function getOffset() {\n var indentation = []\n var pos = line + 1\n\n // Done. Called when the last character is eaten to retrieve the range’s\n // offsets.\n return function () {\n var last = line + 1\n\n while (pos < last) {\n indentation.push((offset[pos] || 0) + 1)\n\n pos++\n }\n\n return indentation\n }\n }\n\n // Get the current position.\n function now() {\n var pos = {line: line, column: column}\n\n pos.offset = self.toOffset(pos)\n\n return pos\n }\n\n // Store position information for a node.\n function Position(start) {\n this.start = start\n this.end = now()\n }\n\n // Throw when a value is incorrectly eaten. This shouldn’t happen but will\n // throw on new, incorrect rules.\n function validateEat(subvalue) {\n /* istanbul ignore if */\n if (value.slice(0, subvalue.length) !== subvalue) {\n // Capture stack-trace.\n self.file.fail(\n new Error(\n 'Incorrectly eaten value: please report this warning on https://git.io/vg5Ft'\n ),\n now()\n )\n }\n }\n\n // Mark position and patch `node.position`.\n function position() {\n var before = now()\n\n return update\n\n // Add the position to a node.\n function update(node, indent) {\n var previous = node.position\n var start = previous ? previous.start : before\n var combined = []\n var n = previous && previous.end.line\n var l = before.line\n\n node.position = new Position(start)\n\n // If there was already a `position`, this node was merged. Fixing\n // `start` wasn’t hard, but the indent is different. Especially\n // because some information, the indent between `n` and `l` wasn’t\n // tracked. Luckily, that space is (should be?) empty, so we can\n // safely check for it now.\n if (previous && indent && previous.indent) {\n combined = previous.indent\n\n if (n < l) {\n while (++n < l) {\n combined.push((offset[n] || 0) + 1)\n }\n\n combined.push(before.column)\n }\n\n indent = combined.concat(indent)\n }\n\n node.position.indent = indent || []\n\n return node\n }\n }\n\n // Add `node` to `parent`s children or to `tokens`. Performs merges where\n // possible.\n function add(node, parent) {\n var children = parent ? parent.children : tokens\n var previous = children[children.length - 1]\n var fn\n\n if (\n previous &&\n node.type === previous.type &&\n (node.type === 'text' || node.type === 'blockquote') &&\n mergeable(previous) &&\n mergeable(node)\n ) {\n fn = node.type === 'text' ? mergeText : mergeBlockquote\n node = fn.call(self, previous, node)\n }\n\n if (node !== previous) {\n children.push(node)\n }\n\n if (self.atStart && tokens.length !== 0) {\n self.exitStart()\n }\n\n return node\n }\n\n // Remove `subvalue` from `value`. `subvalue` must be at the start of\n // `value`.\n function eat(subvalue) {\n var indent = getOffset()\n var pos = position()\n var current = now()\n\n validateEat(subvalue)\n\n apply.reset = reset\n reset.test = test\n apply.test = test\n\n value = value.slice(subvalue.length)\n\n updatePosition(subvalue)\n\n indent = indent()\n\n return apply\n\n // Add the given arguments, add `position` to the returned node, and\n // return the node.\n function apply(node, parent) {\n return pos(add(pos(node), parent), indent)\n }\n\n // Functions just like apply, but resets the content: the line and\n // column are reversed, and the eaten value is re-added. This is\n // useful for nodes with a single type of content, such as lists and\n // tables. See `apply` above for what parameters are expected.\n function reset() {\n var node = apply.apply(null, arguments)\n\n line = current.line\n column = current.column\n value = subvalue + value\n\n return node\n }\n\n // Test the position, after eating, and reverse to a not-eaten state.\n function test() {\n var result = pos({})\n\n line = current.line\n column = current.column\n value = subvalue + value\n\n return result.position\n }\n }\n }\n}", "constructor(tokenizer) { \n super()\n this.tokenizer = tokenizer \n this.leftover = false\n }", "function Token(type, tag, nesting) {\n /**\n * Token#type -> String\n *\n * Type of the token (string, e.g. \"paragraph_open\")\n **/\n this.type = type;\n /**\n * Token#tag -> String\n *\n * html tag name, e.g. \"p\"\n **/\n\n this.tag = tag;\n /**\n * Token#attrs -> Array\n *\n * Html attributes. Format: `[ [ name1, value1 ], [ name2, value2 ] ]`\n **/\n\n this.attrs = null;\n /**\n * Token#map -> Array\n *\n * Source map info. Format: `[ line_begin, line_end ]`\n **/\n\n this.map = null;\n /**\n * Token#nesting -> Number\n *\n * Level change (number in {-1, 0, 1} set), where:\n *\n * - `1` means the tag is opening\n * - `0` means the tag is self-closing\n * - `-1` means the tag is closing\n **/\n\n this.nesting = nesting;\n /**\n * Token#level -> Number\n *\n * nesting level, the same as `state.level`\n **/\n\n this.level = 0;\n /**\n * Token#children -> Array\n *\n * An array of child nodes (inline and img tokens)\n **/\n\n this.children = null;\n /**\n * Token#content -> String\n *\n * In a case of self-closing tag (code, html, fence, etc.),\n * it has contents of this tag.\n **/\n\n this.content = '';\n /**\n * Token#markup -> String\n *\n * '*' or '_' for emphasis, fence string for fence, etc.\n **/\n\n this.markup = '';\n /**\n * Token#info -> String\n *\n * fence infostring\n **/\n\n this.info = '';\n /**\n * Token#meta -> Object\n *\n * A place for plugins to store an arbitrary data\n **/\n\n this.meta = null;\n /**\n * Token#block -> Boolean\n *\n * True for block-level tokens, false for inline tokens.\n * Used in renderer to calculate line breaks\n **/\n\n this.block = false;\n /**\n * Token#hidden -> Boolean\n *\n * If it's true, ignore this element when rendering. Used for tight lists\n * to hide paragraphs.\n **/\n\n this.hidden = false;\n}", "function factory(type) {\n return tokenize;\n\n /* Tokenizer for a bound `type`. */\n function tokenize(value, location) {\n var self = this;\n var offset = self.offset;\n var tokens = [];\n var methods = self[type + 'Methods'];\n var tokenizers = self[type + 'Tokenizers'];\n var line = location.line;\n var column = location.column;\n var index;\n var length;\n var method;\n var name;\n var matched;\n var valueLength;\n\n /* Trim white space only lines. */\n if (!value) {\n return tokens;\n }\n\n /* Expose on `eat`. */\n eat.now = now;\n eat.file = self.file;\n\n /* Sync initial offset. */\n updatePosition('');\n\n /* Iterate over `value`, and iterate over all\n * tokenizers. When one eats something, re-iterate\n * with the remaining value. If no tokenizer eats,\n * something failed (should not happen) and an\n * exception is thrown. */\n while (value) {\n index = -1;\n length = methods.length;\n matched = false;\n\n while (++index < length) {\n name = methods[index];\n method = tokenizers[name];\n\n if (\n method &&\n (!method.onlyAtStart || self.atStart) &&\n (!method.notInList || !self.inList) &&\n (!method.notInBlock || !self.inBlock) &&\n (!method.notInLink || !self.inLink)\n ) {\n valueLength = value.length;\n\n method.apply(self, [eat, value]);\n\n matched = valueLength !== value.length;\n\n if (matched) {\n break;\n }\n }\n }\n\n /* istanbul ignore if */\n if (!matched) {\n self.file.fail(new Error('Infinite loop'), eat.now());\n }\n }\n\n self.eof = now();\n\n return tokens;\n\n /**\n * Update line, column, and offset based on\n * `value`.\n *\n * @example\n * updatePosition('foo');\n *\n * @param {string} subvalue - Subvalue to eat.\n */\n function updatePosition(subvalue) {\n var lastIndex = -1;\n var index = subvalue.indexOf('\\n');\n\n while (index !== -1) {\n line++;\n lastIndex = index;\n index = subvalue.indexOf('\\n', index + 1);\n }\n\n if (lastIndex === -1) {\n column += subvalue.length;\n } else {\n column = subvalue.length - lastIndex;\n }\n\n if (line in offset) {\n if (lastIndex !== -1) {\n column += offset[line];\n } else if (column <= offset[line]) {\n column = offset[line] + 1;\n }\n }\n }\n\n /**\n * Get offset. Called before the first character is\n * eaten to retrieve the range's offsets.\n *\n * @return {Function} - `done`, to be called when\n * the last character is eaten.\n */\n function getOffset() {\n var indentation = [];\n var pos = line + 1;\n\n /**\n * Done. Called when the last character is\n * eaten to retrieve the range’s offsets.\n *\n * @return {Array.<number>} - Offset.\n */\n return function () {\n var last = line + 1;\n\n while (pos < last) {\n indentation.push((offset[pos] || 0) + 1);\n\n pos++;\n }\n\n return indentation;\n };\n }\n\n /**\n * Get the current position.\n *\n * @example\n * position = now(); // {line: 1, column: 1, offset: 0}\n *\n * @return {Object} - Current Position.\n */\n function now() {\n var pos = {line: line, column: column};\n\n pos.offset = self.toOffset(pos);\n\n return pos;\n }\n\n /**\n * Store position information for a node.\n *\n * @example\n * start = now();\n * updatePosition('foo');\n * location = new Position(start);\n * // {\n * // start: {line: 1, column: 1, offset: 0},\n * // end: {line: 1, column: 3, offset: 2}\n * // }\n *\n * @param {Object} start - Starting position.\n */\n function Position(start) {\n this.start = start;\n this.end = now();\n }\n\n /**\n * Throw when a value is incorrectly eaten.\n * This shouldn’t happen but will throw on new,\n * incorrect rules.\n *\n * @example\n * // When the current value is set to `foo bar`.\n * validateEat('foo');\n * eat('foo');\n *\n * validateEat('bar');\n * // throws, because the space is not eaten.\n *\n * @param {string} subvalue - Value to be eaten.\n * @throws {Error} - When `subvalue` cannot be eaten.\n */\n function validateEat(subvalue) {\n /* istanbul ignore if */\n if (value.substring(0, subvalue.length) !== subvalue) {\n /* Capture stack-trace. */\n self.file.fail(\n new Error(\n 'Incorrectly eaten value: please report this ' +\n 'warning on http://git.io/vg5Ft'\n ),\n now()\n );\n }\n }\n\n /**\n * Mark position and patch `node.position`.\n *\n * @example\n * var update = position();\n * updatePosition('foo');\n * update({});\n * // {\n * // position: {\n * // start: {line: 1, column: 1, offset: 0},\n * // end: {line: 1, column: 3, offset: 2}\n * // }\n * // }\n *\n * @returns {Function} - Updater.\n */\n function position() {\n var before = now();\n\n return update;\n\n /**\n * Add the position to a node.\n *\n * @example\n * update({type: 'text', value: 'foo'});\n *\n * @param {Node} node - Node to attach position\n * on.\n * @param {Array} [indent] - Indentation for\n * `node`.\n * @return {Node} - `node`.\n */\n function update(node, indent) {\n var prev = node.position;\n var start = prev ? prev.start : before;\n var combined = [];\n var n = prev && prev.end.line;\n var l = before.line;\n\n node.position = new Position(start);\n\n /* If there was already a `position`, this\n * node was merged. Fixing `start` wasn’t\n * hard, but the indent is different.\n * Especially because some information, the\n * indent between `n` and `l` wasn’t\n * tracked. Luckily, that space is\n * (should be?) empty, so we can safely\n * check for it now. */\n if (prev && indent && prev.indent) {\n combined = prev.indent;\n\n if (n < l) {\n while (++n < l) {\n combined.push((offset[n] || 0) + 1);\n }\n\n combined.push(before.column);\n }\n\n indent = combined.concat(indent);\n }\n\n node.position.indent = indent || [];\n\n return node;\n }\n }\n\n /**\n * Add `node` to `parent`s children or to `tokens`.\n * Performs merges where possible.\n *\n * @example\n * add({});\n *\n * add({}, {children: []});\n *\n * @param {Object} node - Node to add.\n * @param {Object} [parent] - Parent to insert into.\n * @return {Object} - Added or merged into node.\n */\n function add(node, parent) {\n var children = parent ? parent.children : tokens;\n var prev = children[children.length - 1];\n\n if (\n prev &&\n node.type === prev.type &&\n node.type in MERGEABLE_NODES &&\n mergeable(prev) &&\n mergeable(node)\n ) {\n node = MERGEABLE_NODES[node.type].call(self, prev, node);\n }\n\n if (node !== prev) {\n children.push(node);\n }\n\n if (self.atStart && tokens.length !== 0) {\n self.exitStart();\n }\n\n return node;\n }\n\n /**\n * Remove `subvalue` from `value`.\n * `subvalue` must be at the start of `value`.\n *\n * @example\n * eat('foo')({type: 'text', value: 'foo'});\n *\n * @param {string} subvalue - Removed from `value`,\n * and passed to `updatePosition`.\n * @return {Function} - Wrapper around `add`, which\n * also adds `position` to node.\n */\n function eat(subvalue) {\n var indent = getOffset();\n var pos = position();\n var current = now();\n\n validateEat(subvalue);\n\n apply.reset = reset;\n reset.test = test;\n apply.test = test;\n\n value = value.substring(subvalue.length);\n\n updatePosition(subvalue);\n\n indent = indent();\n\n return apply;\n\n /**\n * Add the given arguments, add `position` to\n * the returned node, and return the node.\n *\n * @param {Object} node - Node to add.\n * @param {Object} [parent] - Node to insert into.\n * @return {Node} - Added node.\n */\n function apply(node, parent) {\n return pos(add(pos(node), parent), indent);\n }\n\n /**\n * Functions just like apply, but resets the\n * content: the line and column are reversed,\n * and the eaten value is re-added.\n *\n * This is useful for nodes with a single\n * type of content, such as lists and tables.\n *\n * See `apply` above for what parameters are\n * expected.\n *\n * @return {Node} - Added node.\n */\n function reset() {\n var node = apply.apply(null, arguments);\n\n line = current.line;\n column = current.column;\n value = subvalue + value;\n\n return node;\n }\n\n /**\n * Test the position, after eating, and reverse\n * to a not-eaten state.\n *\n * @return {Position} - Position after eating `subvalue`.\n */\n function test() {\n var result = pos({});\n\n line = current.line;\n column = current.column;\n value = subvalue + value;\n\n return result.position;\n }\n }\n }\n}", "tokenize(index) {\n\t\t\tconst {tokenize} = this.impl;\n\t\t\tif (tokenize === undefined) {\n\t\t\t\tthrow new Error(\"No tokenize implementation defined\");\n\t\t\t} else {\n\t\t\t\treturn tokenize(this, index);\n\t\t\t}\n\t\t}", "function tokenize(code,o){\n\t\tif(o === undefined) o = {};\n\t\ttry {\n\t\t\to._source = code;\n\t\t\tlex.reset();\n\t\t\treturn lex.tokenize(code,o);\n\t\t} catch (err) {\n\t\t\tthrow err;\n\t\t};\n\t}", "function Token(type, tag, nesting) {\n /**\n * Token#type -> String\n *\n * Type of the token (string, e.g. \"paragraph_open\")\n **/\n this.type = type;\n\n /**\n * Token#tag -> String\n *\n * html tag name, e.g. \"p\"\n **/\n this.tag = tag;\n\n /**\n * Token#attrs -> Array\n *\n * Html attributes. Format: `[ [ name1, value1 ], [ name2, value2 ] ]`\n **/\n this.attrs = null;\n\n /**\n * Token#map -> Array\n *\n * Source map info. Format: `[ line_begin, line_end ]`\n **/\n this.map = null;\n\n /**\n * Token#nesting -> Number\n *\n * Level change (number in {-1, 0, 1} set), where:\n *\n * - `1` means the tag is opening\n * - `0` means the tag is self-closing\n * - `-1` means the tag is closing\n **/\n this.nesting = nesting;\n\n /**\n * Token#level -> Number\n *\n * nesting level, the same as `state.level`\n **/\n this.level = 0;\n\n /**\n * Token#children -> Array\n *\n * An array of child nodes (inline and img tokens)\n **/\n this.children = null;\n\n /**\n * Token#content -> String\n *\n * In a case of self-closing tag (code, html, fence, etc.),\n * it has contents of this tag.\n **/\n this.content = '';\n\n /**\n * Token#markup -> String\n *\n * '*' or '_' for emphasis, fence string for fence, etc.\n **/\n this.markup = '';\n\n /**\n * Token#info -> String\n *\n * fence infostring\n **/\n this.info = '';\n\n /**\n * Token#meta -> Object\n *\n * A place for plugins to store an arbitrary data\n **/\n this.meta = null;\n\n /**\n * Token#block -> Boolean\n *\n * True for block-level tokens, false for inline tokens.\n * Used in renderer to calculate line breaks\n **/\n this.block = false;\n\n /**\n * Token#hidden -> Boolean\n *\n * If it's true, ignore this element when rendering. Used for tight lists\n * to hide paragraphs.\n **/\n this.hidden = false;\n}", "function Token(type, tag, nesting) {\n /**\n * Token#type -> String\n *\n * Type of the token (string, e.g. \"paragraph_open\")\n **/\n this.type = type;\n\n /**\n * Token#tag -> String\n *\n * html tag name, e.g. \"p\"\n **/\n this.tag = tag;\n\n /**\n * Token#attrs -> Array\n *\n * Html attributes. Format: `[ [ name1, value1 ], [ name2, value2 ] ]`\n **/\n this.attrs = null;\n\n /**\n * Token#map -> Array\n *\n * Source map info. Format: `[ line_begin, line_end ]`\n **/\n this.map = null;\n\n /**\n * Token#nesting -> Number\n *\n * Level change (number in {-1, 0, 1} set), where:\n *\n * - `1` means the tag is opening\n * - `0` means the tag is self-closing\n * - `-1` means the tag is closing\n **/\n this.nesting = nesting;\n\n /**\n * Token#level -> Number\n *\n * nesting level, the same as `state.level`\n **/\n this.level = 0;\n\n /**\n * Token#children -> Array\n *\n * An array of child nodes (inline and img tokens)\n **/\n this.children = null;\n\n /**\n * Token#content -> String\n *\n * In a case of self-closing tag (code, html, fence, etc.),\n * it has contents of this tag.\n **/\n this.content = '';\n\n /**\n * Token#markup -> String\n *\n * '*' or '_' for emphasis, fence string for fence, etc.\n **/\n this.markup = '';\n\n /**\n * Token#info -> String\n *\n * fence infostring\n **/\n this.info = '';\n\n /**\n * Token#meta -> Object\n *\n * A place for plugins to store an arbitrary data\n **/\n this.meta = null;\n\n /**\n * Token#block -> Boolean\n *\n * True for block-level tokens, false for inline tokens.\n * Used in renderer to calculate line breaks\n **/\n this.block = false;\n\n /**\n * Token#hidden -> Boolean\n *\n * If it's true, ignore this element when rendering. Used for tight lists\n * to hide paragraphs.\n **/\n this.hidden = false;\n}", "function Token(type, tag, nesting) {\n /**\n * Token#type -> String\n *\n * Type of the token (string, e.g. \"paragraph_open\")\n **/\n this.type = type;\n\n /**\n * Token#tag -> String\n *\n * html tag name, e.g. \"p\"\n **/\n this.tag = tag;\n\n /**\n * Token#attrs -> Array\n *\n * Html attributes. Format: `[ [ name1, value1 ], [ name2, value2 ] ]`\n **/\n this.attrs = null;\n\n /**\n * Token#map -> Array\n *\n * Source map info. Format: `[ line_begin, line_end ]`\n **/\n this.map = null;\n\n /**\n * Token#nesting -> Number\n *\n * Level change (number in {-1, 0, 1} set), where:\n *\n * - `1` means the tag is opening\n * - `0` means the tag is self-closing\n * - `-1` means the tag is closing\n **/\n this.nesting = nesting;\n\n /**\n * Token#level -> Number\n *\n * nesting level, the same as `state.level`\n **/\n this.level = 0;\n\n /**\n * Token#children -> Array\n *\n * An array of child nodes (inline and img tokens)\n **/\n this.children = null;\n\n /**\n * Token#content -> String\n *\n * In a case of self-closing tag (code, html, fence, etc.),\n * it has contents of this tag.\n **/\n this.content = '';\n\n /**\n * Token#markup -> String\n *\n * '*' or '_' for emphasis, fence string for fence, etc.\n **/\n this.markup = '';\n\n /**\n * Token#info -> String\n *\n * fence infostring\n **/\n this.info = '';\n\n /**\n * Token#meta -> Object\n *\n * A place for plugins to store an arbitrary data\n **/\n this.meta = null;\n\n /**\n * Token#block -> Boolean\n *\n * True for block-level tokens, false for inline tokens.\n * Used in renderer to calculate line breaks\n **/\n this.block = false;\n\n /**\n * Token#hidden -> Boolean\n *\n * If it's true, ignore this element when rendering. Used for tight lists\n * to hide paragraphs.\n **/\n this.hidden = false;\n}", "function Token(type, tag, nesting) {\n /**\n * Token#type -> String\n *\n * Type of the token (string, e.g. \"paragraph_open\")\n **/\n this.type = type;\n\n /**\n * Token#tag -> String\n *\n * html tag name, e.g. \"p\"\n **/\n this.tag = tag;\n\n /**\n * Token#attrs -> Array\n *\n * Html attributes. Format: `[ [ name1, value1 ], [ name2, value2 ] ]`\n **/\n this.attrs = null;\n\n /**\n * Token#map -> Array\n *\n * Source map info. Format: `[ line_begin, line_end ]`\n **/\n this.map = null;\n\n /**\n * Token#nesting -> Number\n *\n * Level change (number in {-1, 0, 1} set), where:\n *\n * - `1` means the tag is opening\n * - `0` means the tag is self-closing\n * - `-1` means the tag is closing\n **/\n this.nesting = nesting;\n\n /**\n * Token#level -> Number\n *\n * nesting level, the same as `state.level`\n **/\n this.level = 0;\n\n /**\n * Token#children -> Array\n *\n * An array of child nodes (inline and img tokens)\n **/\n this.children = null;\n\n /**\n * Token#content -> String\n *\n * In a case of self-closing tag (code, html, fence, etc.),\n * it has contents of this tag.\n **/\n this.content = '';\n\n /**\n * Token#markup -> String\n *\n * '*' or '_' for emphasis, fence string for fence, etc.\n **/\n this.markup = '';\n\n /**\n * Token#info -> String\n *\n * fence infostring\n **/\n this.info = '';\n\n /**\n * Token#meta -> Object\n *\n * A place for plugins to store an arbitrary data\n **/\n this.meta = null;\n\n /**\n * Token#block -> Boolean\n *\n * True for block-level tokens, false for inline tokens.\n * Used in renderer to calculate line breaks\n **/\n this.block = false;\n\n /**\n * Token#hidden -> Boolean\n *\n * If it's true, ignore this element when rendering. Used for tight lists\n * to hide paragraphs.\n **/\n this.hidden = false;\n}", "function Token(type, tag, nesting) {\n /**\n * Token#type -> String\n *\n * Type of the token (string, e.g. \"paragraph_open\")\n **/\n this.type = type;\n\n /**\n * Token#tag -> String\n *\n * html tag name, e.g. \"p\"\n **/\n this.tag = tag;\n\n /**\n * Token#attrs -> Array\n *\n * Html attributes. Format: `[ [ name1, value1 ], [ name2, value2 ] ]`\n **/\n this.attrs = null;\n\n /**\n * Token#map -> Array\n *\n * Source map info. Format: `[ line_begin, line_end ]`\n **/\n this.map = null;\n\n /**\n * Token#nesting -> Number\n *\n * Level change (number in {-1, 0, 1} set), where:\n *\n * - `1` means the tag is opening\n * - `0` means the tag is self-closing\n * - `-1` means the tag is closing\n **/\n this.nesting = nesting;\n\n /**\n * Token#level -> Number\n *\n * nesting level, the same as `state.level`\n **/\n this.level = 0;\n\n /**\n * Token#children -> Array\n *\n * An array of child nodes (inline and img tokens)\n **/\n this.children = null;\n\n /**\n * Token#content -> String\n *\n * In a case of self-closing tag (code, html, fence, etc.),\n * it has contents of this tag.\n **/\n this.content = '';\n\n /**\n * Token#markup -> String\n *\n * '*' or '_' for emphasis, fence string for fence, etc.\n **/\n this.markup = '';\n\n /**\n * Token#info -> String\n *\n * fence infostring\n **/\n this.info = '';\n\n /**\n * Token#meta -> Object\n *\n * A place for plugins to store an arbitrary data\n **/\n this.meta = null;\n\n /**\n * Token#block -> Boolean\n *\n * True for block-level tokens, false for inline tokens.\n * Used in renderer to calculate line breaks\n **/\n this.block = false;\n\n /**\n * Token#hidden -> Boolean\n *\n * If it's true, ignore this element when rendering. Used for tight lists\n * to hide paragraphs.\n **/\n this.hidden = false;\n}", "function Token(type, tag, nesting) {\n /**\n * Token#type -> String\n *\n * Type of the token (string, e.g. \"paragraph_open\")\n **/\n this.type = type;\n\n /**\n * Token#tag -> String\n *\n * html tag name, e.g. \"p\"\n **/\n this.tag = tag;\n\n /**\n * Token#attrs -> Array\n *\n * Html attributes. Format: `[ [ name1, value1 ], [ name2, value2 ] ]`\n **/\n this.attrs = null;\n\n /**\n * Token#map -> Array\n *\n * Source map info. Format: `[ line_begin, line_end ]`\n **/\n this.map = null;\n\n /**\n * Token#nesting -> Number\n *\n * Level change (number in {-1, 0, 1} set), where:\n *\n * - `1` means the tag is opening\n * - `0` means the tag is self-closing\n * - `-1` means the tag is closing\n **/\n this.nesting = nesting;\n\n /**\n * Token#level -> Number\n *\n * nesting level, the same as `state.level`\n **/\n this.level = 0;\n\n /**\n * Token#children -> Array\n *\n * An array of child nodes (inline and img tokens)\n **/\n this.children = null;\n\n /**\n * Token#content -> String\n *\n * In a case of self-closing tag (code, html, fence, etc.),\n * it has contents of this tag.\n **/\n this.content = '';\n\n /**\n * Token#markup -> String\n *\n * '*' or '_' for emphasis, fence string for fence, etc.\n **/\n this.markup = '';\n\n /**\n * Token#info -> String\n *\n * fence infostring\n **/\n this.info = '';\n\n /**\n * Token#meta -> Object\n *\n * A place for plugins to store an arbitrary data\n **/\n this.meta = null;\n\n /**\n * Token#block -> Boolean\n *\n * True for block-level tokens, false for inline tokens.\n * Used in renderer to calculate line breaks\n **/\n this.block = false;\n\n /**\n * Token#hidden -> Boolean\n *\n * If it's true, ignore this element when rendering. Used for tight lists\n * to hide paragraphs.\n **/\n this.hidden = false;\n}", "function Token(type, tag, nesting) {\n /**\n * Token#type -> String\n *\n * Type of the token (string, e.g. \"paragraph_open\")\n **/\n this.type = type;\n\n /**\n * Token#tag -> String\n *\n * html tag name, e.g. \"p\"\n **/\n this.tag = tag;\n\n /**\n * Token#attrs -> Array\n *\n * Html attributes. Format: `[ [ name1, value1 ], [ name2, value2 ] ]`\n **/\n this.attrs = null;\n\n /**\n * Token#map -> Array\n *\n * Source map info. Format: `[ line_begin, line_end ]`\n **/\n this.map = null;\n\n /**\n * Token#nesting -> Number\n *\n * Level change (number in {-1, 0, 1} set), where:\n *\n * - `1` means the tag is opening\n * - `0` means the tag is self-closing\n * - `-1` means the tag is closing\n **/\n this.nesting = nesting;\n\n /**\n * Token#level -> Number\n *\n * nesting level, the same as `state.level`\n **/\n this.level = 0;\n\n /**\n * Token#children -> Array\n *\n * An array of child nodes (inline and img tokens)\n **/\n this.children = null;\n\n /**\n * Token#content -> String\n *\n * In a case of self-closing tag (code, html, fence, etc.),\n * it has contents of this tag.\n **/\n this.content = '';\n\n /**\n * Token#markup -> String\n *\n * '*' or '_' for emphasis, fence string for fence, etc.\n **/\n this.markup = '';\n\n /**\n * Token#info -> String\n *\n * fence infostring\n **/\n this.info = '';\n\n /**\n * Token#meta -> Object\n *\n * A place for plugins to store an arbitrary data\n **/\n this.meta = null;\n\n /**\n * Token#block -> Boolean\n *\n * True for block-level tokens, false for inline tokens.\n * Used in renderer to calculate line breaks\n **/\n this.block = false;\n\n /**\n * Token#hidden -> Boolean\n *\n * If it's true, ignore this element when rendering. Used for tight lists\n * to hide paragraphs.\n **/\n this.hidden = false;\n}", "function Token(type, tag, nesting) {\n /**\n * Token#type -> String\n *\n * Type of the token (string, e.g. \"paragraph_open\")\n **/\n this.type = type;\n\n /**\n * Token#tag -> String\n *\n * html tag name, e.g. \"p\"\n **/\n this.tag = tag;\n\n /**\n * Token#attrs -> Array\n *\n * Html attributes. Format: `[ [ name1, value1 ], [ name2, value2 ] ]`\n **/\n this.attrs = null;\n\n /**\n * Token#map -> Array\n *\n * Source map info. Format: `[ line_begin, line_end ]`\n **/\n this.map = null;\n\n /**\n * Token#nesting -> Number\n *\n * Level change (number in {-1, 0, 1} set), where:\n *\n * - `1` means the tag is opening\n * - `0` means the tag is self-closing\n * - `-1` means the tag is closing\n **/\n this.nesting = nesting;\n\n /**\n * Token#level -> Number\n *\n * nesting level, the same as `state.level`\n **/\n this.level = 0;\n\n /**\n * Token#children -> Array\n *\n * An array of child nodes (inline and img tokens)\n **/\n this.children = null;\n\n /**\n * Token#content -> String\n *\n * In a case of self-closing tag (code, html, fence, etc.),\n * it has contents of this tag.\n **/\n this.content = '';\n\n /**\n * Token#markup -> String\n *\n * '*' or '_' for emphasis, fence string for fence, etc.\n **/\n this.markup = '';\n\n /**\n * Token#info -> String\n *\n * fence infostring\n **/\n this.info = '';\n\n /**\n * Token#meta -> Object\n *\n * A place for plugins to store an arbitrary data\n **/\n this.meta = null;\n\n /**\n * Token#block -> Boolean\n *\n * True for block-level tokens, false for inline tokens.\n * Used in renderer to calculate line breaks\n **/\n this.block = false;\n\n /**\n * Token#hidden -> Boolean\n *\n * If it's true, ignore this element when rendering. Used for tight lists\n * to hide paragraphs.\n **/\n this.hidden = false;\n}", "function Token(type, tag, nesting) {\n /**\n * Token#type -> String\n *\n * Type of the token (string, e.g. \"paragraph_open\")\n **/\n this.type = type;\n\n /**\n * Token#tag -> String\n *\n * html tag name, e.g. \"p\"\n **/\n this.tag = tag;\n\n /**\n * Token#attrs -> Array\n *\n * Html attributes. Format: `[ [ name1, value1 ], [ name2, value2 ] ]`\n **/\n this.attrs = null;\n\n /**\n * Token#map -> Array\n *\n * Source map info. Format: `[ line_begin, line_end ]`\n **/\n this.map = null;\n\n /**\n * Token#nesting -> Number\n *\n * Level change (number in {-1, 0, 1} set), where:\n *\n * - `1` means the tag is opening\n * - `0` means the tag is self-closing\n * - `-1` means the tag is closing\n **/\n this.nesting = nesting;\n\n /**\n * Token#level -> Number\n *\n * nesting level, the same as `state.level`\n **/\n this.level = 0;\n\n /**\n * Token#children -> Array\n *\n * An array of child nodes (inline and img tokens)\n **/\n this.children = null;\n\n /**\n * Token#content -> String\n *\n * In a case of self-closing tag (code, html, fence, etc.),\n * it has contents of this tag.\n **/\n this.content = '';\n\n /**\n * Token#markup -> String\n *\n * '*' or '_' for emphasis, fence string for fence, etc.\n **/\n this.markup = '';\n\n /**\n * Token#info -> String\n *\n * fence infostring\n **/\n this.info = '';\n\n /**\n * Token#meta -> Object\n *\n * A place for plugins to store an arbitrary data\n **/\n this.meta = null;\n\n /**\n * Token#block -> Boolean\n *\n * True for block-level tokens, false for inline tokens.\n * Used in renderer to calculate line breaks\n **/\n this.block = false;\n\n /**\n * Token#hidden -> Boolean\n *\n * If it's true, ignore this element when rendering. Used for tight lists\n * to hide paragraphs.\n **/\n this.hidden = false;\n}", "tokenize(str) {\n this.tokens = [];\n this.ss = new StringStream_1.StringStream(str);\n this.currParenthesisLevel = 0;\n this.errors = [];\n try {\n while (!this.ss.eof()) {\n this.readNextToken();\n }\n }\n catch (err) {\n if (err instanceof errors_1.InvalidParseError) {\n this.errors.push(err);\n }\n else {\n throw err;\n }\n }\n //this._insertImplicitMultiplications()\n //this._removeLineWhiteSpace() // now we can remove all non newline whitespace\n }", "function Token(type, tag, nesting) {\n /**\n * Token#type -> String\n *\n * Type of the token (string, e.g. \"paragraph_open\")\n **/\n this.type = type;\n\n /**\n * Token#tag -> String\n *\n * html tag name, e.g. \"p\"\n **/\n this.tag = tag;\n\n /**\n * Token#attrs -> Array\n *\n * Html attributes. Format: `[ [ name1, value1 ], [ name2, value2 ] ]`\n **/\n this.attrs = null;\n\n /**\n * Token#map -> Array\n *\n * Source map info. Format: `[ line_begin, line_end ]`\n **/\n this.map = null;\n\n /**\n * Token#nesting -> Number\n *\n * Level change (number in {-1, 0, 1} set), where:\n *\n * - `1` means the tag is opening\n * - `0` means the tag is self-closing\n * - `-1` means the tag is closing\n **/\n this.nesting = nesting;\n\n /**\n * Token#level -> Number\n *\n * nesting level, the same as `state.level`\n **/\n this.level = 0;\n\n /**\n * Token#children -> Array\n *\n * An array of child nodes (inline and img tokens)\n **/\n this.children = null;\n\n /**\n * Token#content -> String\n *\n * In a case of self-closing tag (code, html, fence, etc.),\n * it has contents of this tag.\n **/\n this.content = '';\n\n /**\n * Token#markup -> String\n *\n * '*' or '_' for emphasis, fence string for fence, etc.\n **/\n this.markup = '';\n\n /**\n * Token#info -> String\n *\n * fence infostring\n **/\n this.info = '';\n\n /**\n * Token#meta -> Object\n *\n * A place for plugins to store an arbitrary data\n **/\n this.meta = null;\n\n /**\n * Token#block -> Boolean\n *\n * True for block-level tokens, false for inline tokens.\n * Used in renderer to calculate line breaks\n **/\n this.block = false;\n\n /**\n * Token#hidden -> Boolean\n *\n * If it's true, ignore this element when rendering. Used for tight lists\n * to hide paragraphs.\n **/\n this.hidden = false;\n }", "constructor() { \n \n RegexpTokenizerInfo.initialize(this);\n }", "function Tokenizer(source) {\n\n const input = InputStream(source)\n let current = null\n \n return {\n next: next,\n peek: peek,\n eof: eof,\n }\n\n\n function isWhitespace(ch) { return /\\s/.test(ch) }\n function isDigit(ch) { return /[0-9]/.test(ch) }\n function isHex(ch) { return /[0-9a-fA-FxX]/.test(ch) }\n function isIdStart(ch) { return /[a-z_]/i.test(ch) }\n function isId(ch) { return /[a-z_0-9!]/i.test(ch) }\n function isDelim(ch) { return /[.,;(){}[\\]:]/.test(ch) }\n function isOperator(ch) { return /[+\\-*\\/%=&|<>!^]/.test(ch) }\n function isKeyword(wd) {\n return /bool|break|case|class|continue|const|delete|do|double|else|export|extern|float|for|if|import|int|module|new|print|private|public|return|switch|static|throw|to!int|to!double|to!float|uint|void|while/.test(wd);\n }\n\n /*\n * next Token\n *\n * @returns the next new token from the source\n */\n function nextToken() {\n let ch = ''\n\n readWhile(isWhitespace);\n if (input.eof()) {\n return null\n }\n if (input.peek(2) === \"//\") {\n skipTo('\\n')\n return nextToken()\n }\n if (input.peek(3) === \"/**\") {\n skipTo(\"*/\")\n return nextToken()\n }\n if (input.peek(2) === \"/*\") {\n skipTo(\"*/\")\n return nextToken()\n }\n ch = input.peek()\n if (ch === '\"') {\n return new Token(Token.String, readEscaped('\"'), input.getLine(), input.getCol())\n }\n if (ch === \"'\") {\n return new Token(Token.String, readEscaped(\"'\"), input.getLine(), input.getCol())\n }\n if (isDigit(ch)) {\n return new Token(Token.Number, readNumber(), input.getLine(), input.getCol())\n }\n if (isIdStart(ch)) {\n return (function(id) {\n return new Token((isKeyword(id) ? Token.Keyword : Token.Variable), id, input.getLine(), input.getCol())\n })(readWhile(isId))\n }\n if (isDelim(ch)) {\n return new Token(Token.Delimiter, input.next(), input.getLine(), input.getCol())\n }\n if (isOperator(ch)) {\n // return new Token(Token.Operator, readWhile(isOperator), input.getLine(), input.getCol())\n return new Token(Token.Delimiter, readWhile(isOperator), input.getLine(), input.getCol())\n }\n\n throw new Error(`Can't handle character: ${ch}`)\n }\n\n /*\n * read Number\n *\n * @returns the next number from the source stream\n */\n function readNumber() {\n let has_dot = false\n let is_hex = false\n\n let input = readWhile(function(ch) {\n if (ch === '.') {\n if (has_dot) {\n return false\n }\n has_dot = true\n return true\n }\n if (ch === 'x') {\n if (is_hex) {\n return false\n }\n is_hex = true\n }\n if (is_hex)\n return isHex(ch)\n else\n return isDigit(ch)\n })\n if (is_hex) {\n return parseInt(input, 16)\n }\n else {\n if (has_dot) {\n return parseFloat(input)\n } \n else {\n return parseInt(input, 10)\n }\n }\n }\n\n /*\n * read Escaped\n *\n * @returns the next escaped string until end\n */\n function readEscaped(end) {\n let ch = ''\n let escaped = false\n let str = ''\n\n input.next()\n while (!input.eof()) {\n ch = input.next()\n if (escaped) {\n str += ch\n escaped = false\n } else if (ch === '\\\\') {\n escaped = true\n } else if (ch === end) {\n break\n } else {\n str += ch\n }\n }\n return str\n }\n\n /*\n * read While\n *\n * @param predicate function to call to test\n * @returns the next token until predicate\n */\n function readWhile(predicate) {\n let str = ''\n\n while (!input.eof() && predicate(input.peek())) {\n str += input.next()\n }\n return str\n }\n\n /*\n * skip to end\n *\n * skip to the end string\n */\n function skipTo(end) {\n let len = end.length\n\n while (!input.eof() && input.peek(len) !== end) {\n input.next()\n }\n while (!input.eof() && len) {\n input.next()\n len--\n }\n }\n function eof() { return peek() === null }\n function peek() { return current || (current = nextToken()) }\n function next() {\n let token = current\n\n current = null\n return token || nextToken()\n }\n}", "function Token(type, tag, nesting) {\n /**\n\t * Token#type -> String\n\t *\n\t * Type of the token (string, e.g. \"paragraph_open\")\n\t **/\n this.type = type;\n /**\n\t * Token#tag -> String\n\t *\n\t * html tag name, e.g. \"p\"\n\t **/ this.tag = tag;\n /**\n\t * Token#attrs -> Array\n\t *\n\t * Html attributes. Format: `[ [ name1, value1 ], [ name2, value2 ] ]`\n\t **/ this.attrs = null;\n /**\n\t * Token#map -> Array\n\t *\n\t * Source map info. Format: `[ line_begin, line_end ]`\n\t **/ this.map = null;\n /**\n\t * Token#nesting -> Number\n\t *\n\t * Level change (number in {-1, 0, 1} set), where:\n\t *\n\t * - `1` means the tag is opening\n\t * - `0` means the tag is self-closing\n\t * - `-1` means the tag is closing\n\t **/ this.nesting = nesting;\n /**\n\t * Token#level -> Number\n\t *\n\t * nesting level, the same as `state.level`\n\t **/ this.level = 0;\n /**\n\t * Token#children -> Array\n\t *\n\t * An array of child nodes (inline and img tokens)\n\t **/ this.children = null;\n /**\n\t * Token#content -> String\n\t *\n\t * In a case of self-closing tag (code, html, fence, etc.),\n\t * it has contents of this tag.\n\t **/ this.content = \"\";\n /**\n\t * Token#markup -> String\n\t *\n\t * '*' or '_' for emphasis, fence string for fence, etc.\n\t **/ this.markup = \"\";\n /**\n\t * Token#info -> String\n\t *\n\t * Additional information:\n\t *\n\t * - Info string for \"fence\" tokens\n\t * - The value \"auto\" for autolink \"link_open\" and \"link_close\" tokens\n\t * - The string value of the item marker for ordered-list \"list_item_open\" tokens\n\t **/ this.info = \"\";\n /**\n\t * Token#meta -> Object\n\t *\n\t * A place for plugins to store an arbitrary data\n\t **/ this.meta = null;\n /**\n\t * Token#block -> Boolean\n\t *\n\t * True for block-level tokens, false for inline tokens.\n\t * Used in renderer to calculate line breaks\n\t **/ this.block = false;\n /**\n\t * Token#hidden -> Boolean\n\t *\n\t * If it's true, ignore this element when rendering. Used for tight lists\n\t * to hide paragraphs.\n\t **/ this.hidden = false;\n }", "static getTokenizer() {\n return theTokenizer;\n }", "function Lexer(a){this.tokens=[],this.tokens.links={},this.options=a||Marked.defaults,this.rules=block.normal,this.options.gfm&&(this.options.tables?this.rules=block.tables:this.rules=block.gfm)}", "token(input, start, end, value) { return new Token(input, start, end, this.type, value) }", "function BBCodeParser_MultiTokenizer(input, position) {\r\n\t\tvar length = 0;\r\n\r\n\t\tif(position === undefined) position = 0;\r\n\t\tinput = input + '';\r\n\t\tlength = input.length;\r\n\t\tposition = PHPC.intval(position);\r\n\r\n\t\tthis.hasNextToken = function(delimiter) {\r\n\t\t\tif(delimiter === undefined) delimiter = ' ';\r\n\t\t\treturn input.indexOf(delimiter, Math.min(length, position)) !== -1;\r\n\t\t}\r\n\r\n\t\tthis.nextToken = function(delimiter) {\r\n\t\t\tif(delimiter === undefined) delimiter = ' ';\r\n\r\n\t\t\tif(position >= length) {\r\n\t\t\t\treturn false;\r\n\t\t\t}\r\n\r\n\t\t\tvar index = input.indexOf(delimiter, position);\r\n\t\t\tif(index === -1) {\r\n\t\t\t\tindex = length;\r\n\t\t\t}\r\n\r\n\t\t\tvar result = input.substr(position, index - position);\r\n\t\t\tposition = index + 1;\r\n\r\n\t\t\treturn result;\r\n\t\t}\r\n\r\n\t\tthis.reset = function() {\r\n\t\t\tposition = false;\r\n\t\t}\r\n\r\n\t}", "tokenize(AST, sourceCodeString) {\n this.tokensBytePos = {};\n this.lastLo = -1;\n // Attributes on the top-level don't exist in the 'tokens' array in the AST\n // and must be extracted from 'attrs' instead.\n // Keep track of the byte positons for seen idents and attribs,\n // and add tokens for attribs that don't exist in idents.\n this.idents = {};\n this.attribs = {};\n this.mods = {};\n this.sourceCodeBuffer = Buffer.from(sourceCodeString);\n\n // Some token types cannot be derived since they don't exist in the ast_json-data\n // and therefore need to be hard-coded manually:\n this.tokenTypes = {\n Pound: '#',\n Not: '!',\n LBrace: '{',\n RBrace: '}',\n LParen: '(',\n RParen: ')',\n LBracket: '[',\n RBracket: ']',\n };\n // Detect if there is a magic byte-order-mark sequence in the beginning of the file:\n let BOM = null;\n if (this.sourceCodeBuffer[0] == 239\n && this.sourceCodeBuffer[1] == 187\n && this.sourceCodeBuffer[2] == 191\n ) {\n // Remove byte order mark\n BOM = this.sourceCodeBuffer.slice(0,3);\n this.sourceCodeBuffer = this.sourceCodeBuffer.slice(3, this.sourceCodeBuffer.length);\n }\n this.traverse(AST);\n for (let identPos in this.attribs) {\n if (!this.idents.hasOwnProperty(identPos)) {\n if (this.attribs[identPos].style == 'Inner') {\n // InnerAttribute\n this._newToken('Pound', this.attribs[identPos].lo);\n this._newToken('Not', this.attribs[identPos].lo+1);\n this._newToken('LBracket', this.attribs[identPos].lo+2);\n } else if (this.attribs[identPos].style == 'Outer') {\n // OuterAttribute\n this._newToken('Pound', this.attribs[identPos].lo);\n this._newToken('LBracket', this.attribs[identPos].lo+1);\n } else {\n throw new Error('Unknown attribute style: ' + this.attribs[identPos].style);\n }\n this._newToken('RBracket', this.attribs[identPos].hi-1);\n }\n }\n for (let modPos in this.mods) {\n if (!this.idents.hasOwnProperty(modPos)) {\n let modPosOffset = parseInt(modPos);\n if (this.mods[modPos].pub) {\n this.tokensBytePos[modPosOffset] = ['Ident', 'pub']; modPosOffset += 3+1;\n }\n this.tokensBytePos[modPosOffset] = ['Ident', 'mod']; modPosOffset += 3+1;\n this.tokensBytePos[modPosOffset] = ['Ident', this.mods[modPos].ident]; modPosOffset += this.mods[modPos].ident.length + 1;\n this.tokensBytePos[modPosOffset] = ['LBrace', '{']; modPosOffset += 1;\n this.tokensBytePos[this.mods[modPos].hi*1-1] = ['RBrace', '}'];\n }\n }\n let sortedTokens = [];\n let tokenId = 0;\n for(let lo of Object.keys(this.tokensBytePos).sort(function(a, b){return a - b})) {\n this.identToKeyword(this.tokensBytePos[lo]);\n this.tokensBytePos[lo][3] = tokenId++;\n sortedTokens.push(this.tokensBytePos[lo]);\n }\n return sortedTokens;\n }", "function GenTokenParser(){}", "function tokenizer(source, state) {\n\tfunction isSpace(ch) {\n\t\t// The messy regexp is because IE's regexp matcher is of the\n\t\t// opinion that non-breaking spaces are no whitespace.\n\t\treturn ch != \"\\n\" && /^[\\s\\u00a0]$/.test(ch);\n\t}\n\n\tfunction out(token) {\n\t\ttoken.value = token.content = (token.content || \"\") + source.get();\n\t\treturn token;\n\t}\n\n\tfunction next() {\n\t\tvar token;\n\t\tif (!source.more()) throw StopIteration;\n\t\tif (source.peek() == \"\\n\") {\n\t\t\tsource.next();\n\t\t\treturn out({ type:\"whitespace\", style:\"whitespace\" });\n\t\t} else if (source.applies(isSpace)) {\n\t\t\tsource.nextWhile(isSpace);\n\t\t\treturn out({ type:\"whitespace\", style:\"whitespace\" });\n\t\t} else {\n\t\t\twhile (!token) token = state(source, function (s) { state = s; });\n\t\t\treturn out(token);\n\t\t}\n\t}\n\n\treturn { next: next, state: function() { return state; } };\n}", "function Token (type, children, text) {\n this.type = type\n\n if (children) {\n this.children = children\n }\n\n if (text) {\n this.text = text\n }\n }", "function makeLexer() {\n const mooLexer = moo.compile(tokens);\n\n return {\n current: null,\n lines: [],\n get line() {\n return mooLexer.line;\n },\n get col() {\n return mooLexer.col;\n },\n save() {\n return mooLexer.save();\n },\n reset(chunk, info) {\n this.lines = chunk.split('\\n');\n return mooLexer.reset(chunk, info);\n },\n next() {\n // It's a cruel and unusual punishment to implement comments with nearly\n let token = mooLexer.next();\n // Drop all comment tokens found\n while (token && token.type === 'comment') {\n token = mooLexer.next();\n }\n this.current = token;\n return this.current;\n },\n formatError(token) {\n return mooLexer.formatError(token);\n },\n has(name) {\n return mooLexer.has(name);\n },\n };\n}", "function tokenize(code){\n\t// split\n\tcode = code.match(/\\^.|./g);\n\t// depth\n\tvar depth = [0,0];\n\tvar open = \"[{\";\n\tvar close = \"]}\";\n\tfor(var i=0;i<code.length;i++){\n\t\tvar ind1 = open.indexOf(code[i]);\n\t\tvar ind2 = close.indexOf(code[i]);\n\t\tif(ind1+1){\n\t\t\tcode[i]+=depth[ind1]++;\n\t\t} else if(ind2+1){\n\t\t\tcode[i]+=--depth[ind2];\n\t\t}\n\t}\n\treturn code;\n}", "function InlineLexer(links, options) {\n\t\t this.options = options || marked.defaults;\n\t\t this.links = links;\n\t\t this.rules = inline.normal;\n\t\t this.renderer = this.options.renderer || new Renderer;\n\t\t this.renderer.options = this.options;\n\t\t\n\t\t if (!this.links) {\n\t\t throw new\n\t\t Error('Tokens array requires a `links` property.');\n\t\t }\n\t\t\n\t\t if (this.options.gfm) {\n\t\t if (this.options.breaks) {\n\t\t this.rules = inline.breaks;\n\t\t } else {\n\t\t this.rules = inline.gfm;\n\t\t }\n\t\t } else if (this.options.pedantic) {\n\t\t this.rules = inline.pedantic;\n\t\t }\n\t\t}", "function createToken() {\n\t\tif(matchDigit()) {\n\t\t\t// increment token total\n\t\t\ttotalTokens = totalTokens + 1;\n\t\t\t// output token found\n\t\t\tputMessage(\"Found digit: \\t\\t\" + lexString.charAt(0));\n\t\t\t// add token to the token array\n\t\t\ttokens[tokenIndex] = {type: \"digit\", value: lexString.charAt(0), line: lineCount};\n\t\t\t// slice off the first character (of in the case of IDs, the first couple)\n\t\t\tlexString = lexString.slice(1, lexString.length);\n\t\t\t// increment the index of the token array\n\t\t\ttokenIndex = tokenIndex + 1;\n\t\t\tif(matchDigit()) {\n\t\t\t\tputMessage(\"Error: Double digit numbers not supported\");\n\t\t\t\terrorB = true;\n\t\t\t}\n\n\t\t}\n\t\telse if(matchType()) {\n\t\t\ttotalTokens = totalTokens + 1;\n\t\t\tif(lexString.charAt(0) === \"i\") {\n\t\t\t\tputMessage(\"Found Id: \\t\\t\\t\" + \"int\");\n\t\t\t\ttokens[tokenIndex] = {type: \"type\", value: \"int\", line: lineCount};\n\t\t\t\tlexString = lexString.slice(3, lexString.length);\n\t\t\t\ttokenIndex = tokenIndex + 1;\n\t\t\t\tif(matchChar()) {\n\t\t\t\t\tputMessage(\"Error: Character directly following a type (line \" + lineCount + \")\");\n\t\t\t\t\terrorB = true;\n\t\t\t\t}\n\t\t\t}\n\t\t\telse if(lexString.charAt(0) === \"b\") {\n\t\t\t\tputMessage(\"Found Id: \\t\\t\\t\" + \"boolean\");\n\t\t\t\ttokens[tokenIndex] = {type: \"type\", value: \"boolean\", line: lineCount};\n\t\t\t\tlexString = lexString.slice(7, lexString.length);\n\t\t\t\ttokenIndex = tokenIndex + 1;\n\t\t\t\tif(matchChar()) {\n\t\t\t\t\tputMessage(\"Error: Character directly following a type (line \" + lineCount + \")\");\n\t\t\t\t\terrorB = true;\n\t\t\t\t}\n\t\t\t}\n\t\t\telse {\n\t\t\t\tputMessage(\"Found Id: \\t\\t\\t\" + \"string\");\n\t\t\t\ttokens[tokenIndex] = {type: \"type\", value: \"string\", line: lineCount};\n\t\t\t\tlexString = lexString.slice(6, lexString.length);\n\t\t\t\ttokenIndex = tokenIndex + 1;\n\t\t\t}\n\t\t}\n\t\telse if(matchBool()) {\n\t\t\ttotalTokens = totalTokens + 1;\n\t\t\tif(lexString.charAt(0) === \"t\") {\n\t\t\t\tputMessage(\"Found boolean: \\t\" + \"true\");\n\t\t\t\ttokens[tokenIndex] = {type: \"bool\", value: \"true\", line: lineCount};\n\t\t\t\tlexString = lexString.slice(4, lexString.length);\n\t\t\t\ttokenIndex = tokenIndex + 1;\n\t\t\t\tif(matchChar()) {\n\t\t\t\t\tputMessage(\"Error: Character directly following a boolean (line \" + lineCount + \")\");\n\t\t\t\t\terrorB = true;\n\t\t\t\t}\n\t\t\t}\n\t\t\telse {\n\t\t\t\tputMessage(\"Found boolean: \\t\" + \"false\");\n\t\t\t\ttokens[tokenIndex] = {type: \"bool\", value: \"false\", line: lineCount};\n\t\t\t\tlexString = lexString.slice(5, lexString.length);\n\t\t\t\ttokenIndex = tokenIndex + 1;\n\t\t\t}\n\t\t}\n\t\telse if(matchCond()) {\n\t\t\ttotalTokens = totalTokens + 1;\n\t\t\tif(lexString.charAt(0) === \"i\") {\n\t\t\t\tputMessage(\"Found conditional: \\t\" + \"if\");\n\t\t\t\ttokens[tokenIndex] = {type: \"cond\", value: \"if\", line: lineCount};\n\t\t\t\tlexString = lexString.slice(2, lexString.length);\n\t\t\t\ttokenIndex = tokenIndex + 1;\n\t\t\t\tif(matchChar()) {\n\t\t\t\t\tputMessage(\"Error: Character directly following a cond (line \" + lineCount + \")\");\n\t\t\t\t\terrorB = true;\n\t\t\t\t}\n\t\t\t}\n\t\t\telse {\n\t\t\t\tputMessage(\"Found conditional: \\t\" + \"while\");\n\t\t\t\ttokens[tokenIndex] = {type: \"cond\", value: \"while\", line: lineCount};\n\t\t\t\tlexString = lexString.slice(5, lexString.length);\n\t\t\t\ttokenIndex = tokenIndex + 1;\n\t\t\t}\n\t\t}\n\t\telse if(matchPrint()) {\n\t\t\ttotalTokens = totalTokens + 1;\n\t\t\tputMessage(\"Found symbol: \\t\\t\\t\" + \"print\");\n\t\t\ttokens[tokenIndex] = {type: \"symbol\", value: \"print\", line: lineCount};\n\t\t\tlexString = lexString.slice(5, lexString.length);\n\t\t\ttokenIndex = tokenIndex + 1;\n\t\t}\n\t\telse if(matchChar()) {\n\t\t\ttotalTokens = totalTokens + 1;\n\t\t\tputMessage(\"Found character: \\t\" + lexString.charAt(0));\n\t\t\ttokens[tokenIndex] = {type: \"char\", value: lexString.charAt(0), line: lineCount};\n\t\t\tlexString = lexString.slice(1, lexString.length);\n\t\t\ttokenIndex = tokenIndex + 1;\n\t\t\tif(matchChar()) {\n\t\t\t\tputMessage(\"Error: Character directly following a character (line \" + lineCount + \")\");\n\t\t\t\terrorB = true;\n\t\t\t}\n\t\t}\n\t\telse if(matchOp()) {\n\t\t\ttotalTokens = totalTokens + 1;\n\t\t\tputMessage(\"Found operator: \\t\" + lexString.charAt(0));\n\t\t\ttokens[tokenIndex] = {type: \"op\", value: lexString.charAt(0), line: lineCount};\n\t\t\tlexString = lexString.slice(1, lexString.length);\n\t\t\ttokenIndex = tokenIndex + 1;\n\t\t}\n\t\telse if(matchSymbol()) {\n\t\t\ttotalTokens = totalTokens + 1;\n\t\t\tputMessage(\"Found symbol: \\t\\t\" + lexString.charAt(0));\n\t\t\ttokens[tokenIndex] = {type: \"symbol\", value: lexString.charAt(0), line: lineCount};\n\t\t\tlexString = lexString.slice(1, lexString.length);\n\t\t\ttokenIndex = tokenIndex + 1;\n\t\t}\n\t\telse if(matchEqual()) {\n\t\t\tvar save = lexString;\n\t\t\tlexString = lexString.slice(1, lexString.length);\n\t\t\tif(matchEqual()) {\n\t\t\t\ttotalTokens = totalTokens + 1;\n\t\t\t\tputMessage(\"Found symbol: \\t\\t\" + \"==\");\n\t\t\t\ttokens[tokenIndex] = {type: \"symbol\", value: \"==\", line: lineCount};\n\t\t\t\tlexString = lexString.slice(1, lexString.length);\n\t\t\t\ttokenIndex = tokenIndex + 1;\n\t\t\t}\n\t\t\telse {\n\t\t\t\ttotalTokens = totalTokens + 1;\n\t\t\t\tputMessage(\"Found symbol: \\t\\t\" + \"=\");\n\t\t\t\ttokens[tokenIndex] = {type: \"symbol\", value: \"=\", line: lineCount};\n\t\t\t\ttokenIndex = tokenIndex + 1;\n\t\t\t}\n\t\t}\n\t\telse if(matchQuote()) {\n\t\t\tputMessage(\"Found symbol: \\t\\t\" + \"\\\"\");\n\t\t\ttokens[tokenIndex] = {type: \"symbol\", value: \"\\\"\", line: lineCount};\n\t\t\tlexString = lexString.slice(1, lexString.length);\n\t\t\ttokenIndex = tokenIndex + 1;\n\t\t\ttotalTokens = totalTokens + 1;\n\t\t\tlexCharList();\n\t\t}\n\t\telse if (matchWhite()) {\n\t\t\t// there is no token for white space (return or tab) ... SLICE IT UP\n\t\t\tif(matchNewLine()) {\n\t\t\t\tlineCount = lineCount + 1;\n\t\t\t}\n\t\t\tlexString = lexString.slice(1, lexString.length);\n\t\t}\n\t\telse if(matchEnd()) {\n\t\t\ttotalTokens = totalTokens + 1;\n\t\t\tputMessage(\"Found end of program!\");\n\t\t\ttokens[tokenIndex] = {type: \"end\", value: lexString.charAt(0), line: lineCount};\n\t\t\tif(lexString.slice(1, lexString.length).length !== 0) {\n\t\t\t\t//throw an error\n\t\t\t\tputMessage(\"Warning: Code following program end. Deleting extra code.\");\n\t\t\t}\n\t\t\tlexString = \"\";\n\t\t\ttokenIndex = tokenIndex + 1;\n\t\t}\n\t\telse {\n\t\t\t// put error message here\n\t\t\tputMessage(\"Error: \\\"\" + lexString.charAt(0) + \"\\\" not in the language (line \" + lineCount + \")\");\n\t\t\tlexString = lexString.slice(1, lexString.length);\n\t\t\terrorB = true;\n\t\t}\n\t}", "token(input, start, end, value) {\n return new Token(input, start, end, value, this.type)\n }", "function JSONTokenizer(callback){\n\tthis.stack = [];\n\tthis.valFragment = \"\";\n\tthis.escapeState = null;\n\tthis.firstSurrogate = null;\n\tthis.topFn = this.processA;\n\tthis.curString = null;\n\tthis.curKey = null;\n\n\tthis.curState = \"\";\n\treturn this;\n}", "function InlineLexer(links, options) {\n this.options = options || marked.defaults;\n this.links = links;\n this.rules = inline.normal;\n this.renderer = this.options.renderer || new Renderer;\n this.renderer.options = this.options;\n \n if (!this.links) {\n throw new\n Error('Tokens array requires a `links` property.');\n }\n \n if (this.options.gfm) {\n if (this.options.breaks) {\n this.rules = inline.breaks;\n } else {\n this.rules = inline.gfm;\n }\n } else if (this.options.pedantic) {\n this.rules = inline.pedantic;\n }\n }", "function InlineLexer(links, options) {\n\t this.options = options || marked.defaults;\n\t this.links = links;\n\t this.rules = inline.normal;\n\t this.renderer = this.options.renderer || new Renderer;\n\t this.renderer.options = this.options;\n\t\n\t if (!this.links) {\n\t throw new\n\t Error('Tokens array requires a `links` property.');\n\t }\n\t\n\t if (this.options.gfm) {\n\t if (this.options.breaks) {\n\t this.rules = inline.breaks;\n\t } else {\n\t this.rules = inline.gfm;\n\t }\n\t } else if (this.options.pedantic) {\n\t this.rules = inline.pedantic;\n\t }\n\t}", "function InlineLexer(links, options) {\n this.options = options || marked.defaults;\n this.links = links;\n this.rules = inline.normal;\n this.renderer = this.options.renderer || new Renderer();\n this.renderer.options = this.options;\n\n if (!this.links) {\n throw new Error('Tokens array requires a `links` property.');\n }\n\n if (this.options.pedantic) {\n this.rules = inline.pedantic;\n } else if (this.options.gfm) {\n if (this.options.breaks) {\n this.rules = inline.breaks;\n } else {\n this.rules = inline.gfm;\n }\n }\n }", "function InlineLexer(links, options) {\n this.options = options || marked.defaults;\n this.links = links;\n this.rules = inline.normal;\n this.renderer = this.options.renderer || new Renderer();\n this.renderer.options = this.options;\n\n if (!this.links) {\n throw new Error('Tokens array requires a `links` property.');\n }\n\n if (this.options.pedantic) {\n this.rules = inline.pedantic;\n } else if (this.options.gfm) {\n if (this.options.breaks) {\n this.rules = inline.breaks;\n } else {\n this.rules = inline.gfm;\n }\n }\n }", "function InlineLexer(links, options) {\n\t this.options = options || marked.defaults;\n\t this.links = links;\n\t this.rules = inline.normal;\n\t this.renderer = this.options.renderer || new Renderer();\n\t this.renderer.options = this.options;\n\n\t if (!this.links) {\n\t throw new Error('Tokens array requires a `links` property.');\n\t }\n\n\t if (this.options.gfm) {\n\t if (this.options.breaks) {\n\t this.rules = inline.breaks;\n\t } else {\n\t this.rules = inline.gfm;\n\t }\n\t } else if (this.options.pedantic) {\n\t this.rules = inline.pedantic;\n\t }\n\t }", "function InlineLexer(links, options) {\n\t this.options = options || marked.defaults;\n\t this.links = links;\n\t this.rules = inline.normal;\n\t this.renderer = this.options.renderer || new Renderer();\n\t this.renderer.options = this.options;\n\n\t if (!this.links) {\n\t throw new Error('Tokens array requires a `links` property.');\n\t }\n\n\t if (this.options.gfm) {\n\t if (this.options.breaks) {\n\t this.rules = inline.breaks;\n\t } else {\n\t this.rules = inline.gfm;\n\t }\n\t } else if (this.options.pedantic) {\n\t this.rules = inline.pedantic;\n\t }\n\t }", "function InlineLexer(links, options) {\n this.options = options || marked.defaults;\n this.links = links;\n this.rules = inline.normal;\n this.renderer = this.options.renderer || new Renderer();\n this.renderer.options = this.options;\n\n if (!this.links) {\n throw new Error('Tokens array requires a `links` property.');\n }\n\n if (this.options.pedantic) {\n this.rules = inline.pedantic;\n } else if (this.options.gfm) {\n if (this.options.breaks) {\n this.rules = inline.breaks;\n } else {\n this.rules = inline.gfm;\n }\n }\n}", "function InlineLexer(links, options) {\n this.options = options || marked.defaults;\n this.links = links;\n this.rules = inline.normal;\n this.renderer = this.options.renderer || new Renderer();\n this.renderer.options = this.options;\n\n if (!this.links) {\n throw new Error('Tokens array requires a `links` property.');\n }\n\n if (this.options.pedantic) {\n this.rules = inline.pedantic;\n } else if (this.options.gfm) {\n if (this.options.breaks) {\n this.rules = inline.breaks;\n } else {\n this.rules = inline.gfm;\n }\n }\n}", "function InlineLexer(links, options) {\n this.options = options || marked.defaults;\n this.links = links;\n this.rules = inline.normal;\n this.renderer = this.options.renderer || new Renderer();\n this.renderer.options = this.options;\n\n if (!this.links) {\n throw new Error('Tokens array requires a `links` property.');\n }\n\n if (this.options.pedantic) {\n this.rules = inline.pedantic;\n } else if (this.options.gfm) {\n if (this.options.breaks) {\n this.rules = inline.breaks;\n } else {\n this.rules = inline.gfm;\n }\n }\n}", "function InlineLexer(links, options) {\n this.options = options || marked.defaults;\n this.links = links;\n this.rules = inline.normal;\n this.renderer = this.options.renderer || new Renderer();\n this.renderer.options = this.options;\n\n if (!this.links) {\n throw new Error('Tokens array requires a `links` property.');\n }\n\n if (this.options.pedantic) {\n this.rules = inline.pedantic;\n } else if (this.options.gfm) {\n if (this.options.breaks) {\n this.rules = inline.breaks;\n } else {\n this.rules = inline.gfm;\n }\n }\n}", "function InlineLexer(links, options) {\n this.options = options || marked.defaults;\n this.links = links;\n this.rules = inline.normal;\n this.renderer = this.options.renderer || new Renderer();\n this.renderer.options = this.options;\n\n if (!this.links) {\n throw new Error('Tokens array requires a `links` property.');\n }\n\n if (this.options.pedantic) {\n this.rules = inline.pedantic;\n } else if (this.options.gfm) {\n if (this.options.breaks) {\n this.rules = inline.breaks;\n } else {\n this.rules = inline.gfm;\n }\n }\n}", "function InlineLexer(links, options) {\n this.options = options || marked.defaults;\n this.links = links;\n this.rules = inline.normal;\n this.renderer = this.options.renderer || new Renderer();\n this.renderer.options = this.options;\n\n if (!this.links) {\n throw new Error('Tokens array requires a `links` property.');\n }\n\n if (this.options.pedantic) {\n this.rules = inline.pedantic;\n } else if (this.options.gfm) {\n if (this.options.breaks) {\n this.rules = inline.breaks;\n } else {\n this.rules = inline.gfm;\n }\n }\n}", "function InlineLexer(links, options) {\n\t this.options = options || marked.defaults;\n\t this.links = links;\n\t this.rules = inline.normal;\n\t this.renderer = this.options.renderer || new Renderer;\n\t this.renderer.options = this.options;\n\n\t if (!this.links) {\n\t throw new\n\t Error('Tokens array requires a `links` property.');\n\t }\n\n\t if (this.options.gfm) {\n\t if (this.options.breaks) {\n\t this.rules = inline.breaks;\n\t } else {\n\t this.rules = inline.gfm;\n\t }\n\t } else if (this.options.pedantic) {\n\t this.rules = inline.pedantic;\n\t }\n\t}", "function InlineLexer(links, options) {\n\t this.options = options || marked.defaults;\n\t this.links = links;\n\t this.rules = inline.normal;\n\t this.renderer = this.options.renderer || new Renderer;\n\t this.renderer.options = this.options;\n\n\t if (!this.links) {\n\t throw new\n\t Error('Tokens array requires a `links` property.');\n\t }\n\n\t if (this.options.gfm) {\n\t if (this.options.breaks) {\n\t this.rules = inline.breaks;\n\t } else {\n\t this.rules = inline.gfm;\n\t }\n\t } else if (this.options.pedantic) {\n\t this.rules = inline.pedantic;\n\t }\n\t}", "function InlineLexer(links, options) {\n\t this.options = options || marked.defaults;\n\t this.links = links;\n\t this.rules = inline.normal;\n\t this.renderer = this.options.renderer || new Renderer;\n\t this.renderer.options = this.options;\n\n\t if (!this.links) {\n\t throw new\n\t Error('Tokens array requires a `links` property.');\n\t }\n\n\t if (this.options.gfm) {\n\t if (this.options.breaks) {\n\t this.rules = inline.breaks;\n\t } else {\n\t this.rules = inline.gfm;\n\t }\n\t } else if (this.options.pedantic) {\n\t this.rules = inline.pedantic;\n\t }\n\t}", "function InlineLexer(links, options) {\n this.options = options || marked.defaults;\n this.links = links;\n this.rules = inline.normal;\n this.renderer = this.options.renderer || new Renderer();\n this.renderer.options = this.options;\n\n if (!this.links) {\n throw new Error('Tokens array requires a `links` property.');\n }\n\n if (this.options.gfm) {\n if (this.options.breaks) {\n this.rules = inline.breaks;\n } else {\n this.rules = inline.gfm;\n }\n } else if (this.options.pedantic) {\n this.rules = inline.pedantic;\n }\n}", "function InlineLexer(links, options) {\n this.options = options || marked.defaults;\n this.links = links;\n this.rules = inline.normal;\n this.renderer = this.options.renderer || new Renderer();\n this.renderer.options = this.options;\n\n if (!this.links) {\n throw new Error('Tokens array requires a `links` property.');\n }\n\n if (this.options.gfm) {\n if (this.options.breaks) {\n this.rules = inline.breaks;\n } else {\n this.rules = inline.gfm;\n }\n } else if (this.options.pedantic) {\n this.rules = inline.pedantic;\n }\n}", "function InlineLexer(links, options) {\n this.options = options || marked.defaults;\n this.links = links;\n this.rules = inline.normal;\n this.renderer = this.options.renderer || new Renderer();\n this.renderer.options = this.options;\n\n if (!this.links) {\n throw new Error('Tokens array requires a `links` property.');\n }\n\n if (this.options.gfm) {\n if (this.options.breaks) {\n this.rules = inline.breaks;\n } else {\n this.rules = inline.gfm;\n }\n } else if (this.options.pedantic) {\n this.rules = inline.pedantic;\n }\n}", "function InlineLexer(links, options) {\n this.options = options || marked.defaults;\n this.links = links;\n this.rules = inline.normal;\n this.renderer = this.options.renderer || new Renderer();\n this.renderer.options = this.options;\n\n if (!this.links) {\n throw new Error('Tokens array requires a `links` property.');\n }\n\n if (this.options.gfm) {\n if (this.options.breaks) {\n this.rules = inline.breaks;\n } else {\n this.rules = inline.gfm;\n }\n } else if (this.options.pedantic) {\n this.rules = inline.pedantic;\n }\n}", "function InlineLexer(links, options) {\n this.options = options || marked.defaults;\n this.links = links;\n this.rules = inline.normal;\n this.renderer = this.options.renderer || new Renderer();\n this.renderer.options = this.options;\n\n if (!this.links) {\n throw new Error('Tokens array requires a `links` property.');\n }\n\n if (this.options.gfm) {\n if (this.options.breaks) {\n this.rules = inline.breaks;\n } else {\n this.rules = inline.gfm;\n }\n } else if (this.options.pedantic) {\n this.rules = inline.pedantic;\n }\n}", "function InlineLexer(links, options) {\n this.options = options || marked.defaults;\n this.links = links;\n this.rules = inline.normal;\n this.renderer = this.options.renderer || new Renderer();\n this.renderer.options = this.options;\n\n if (!this.links) {\n throw new Error('Tokens array requires a `links` property.');\n }\n\n if (this.options.gfm) {\n if (this.options.breaks) {\n this.rules = inline.breaks;\n } else {\n this.rules = inline.gfm;\n }\n } else if (this.options.pedantic) {\n this.rules = inline.pedantic;\n }\n}", "function InlineLexer(links, options) {\n this.options = options || marked.defaults;\n this.links = links;\n this.rules = inline.normal;\n this.renderer = this.options.renderer || new Renderer();\n this.renderer.options = this.options;\n\n if (!this.links) {\n throw new Error('Tokens array requires a `links` property.');\n }\n\n if (this.options.gfm) {\n if (this.options.breaks) {\n this.rules = inline.breaks;\n } else {\n this.rules = inline.gfm;\n }\n } else if (this.options.pedantic) {\n this.rules = inline.pedantic;\n }\n}", "function InlineLexer(links, options) {\n this.options = options || marked.defaults;\n this.links = links;\n this.rules = inline.normal;\n this.renderer = this.options.renderer || new Renderer();\n this.renderer.options = this.options;\n\n if (!this.links) {\n throw new Error('Tokens array requires a `links` property.');\n }\n\n if (this.options.gfm) {\n if (this.options.breaks) {\n this.rules = inline.breaks;\n } else {\n this.rules = inline.gfm;\n }\n } else if (this.options.pedantic) {\n this.rules = inline.pedantic;\n }\n}", "function InlineLexer(links, options) {\n this.options = options || marked.defaults;\n this.links = links;\n this.rules = inline.normal;\n this.renderer = this.options.renderer || new Renderer();\n this.renderer.options = this.options;\n\n if (!this.links) {\n throw new Error('Tokens array requires a `links` property.');\n }\n\n if (this.options.gfm) {\n if (this.options.breaks) {\n this.rules = inline.breaks;\n } else {\n this.rules = inline.gfm;\n }\n } else if (this.options.pedantic) {\n this.rules = inline.pedantic;\n }\n}", "function InlineLexer(links, options) {\n this.options = options || marked.defaults;\n this.links = links;\n this.rules = inline.normal;\n this.renderer = this.options.renderer || new Renderer();\n this.renderer.options = this.options;\n\n if (!this.links) {\n throw new Error('Tokens array requires a `links` property.');\n }\n\n if (this.options.gfm) {\n if (this.options.breaks) {\n this.rules = inline.breaks;\n } else {\n this.rules = inline.gfm;\n }\n } else if (this.options.pedantic) {\n this.rules = inline.pedantic;\n }\n}", "token(input, start, value) { return new Token(input,start,input.pos,this.type,value) }", "function InlineLexer(links, options) {\n this.options = options || marked.defaults;\n this.links = links;\n this.rules = inline.normal;\n this.renderer = this.options.renderer || new Renderer;\n this.renderer.options = this.options;\n\n if (!this.links) {\n throw new\n Error('Tokens array requires a `links` property.');\n }\n\n if (this.options.gfm) {\n if (this.options.breaks) {\n this.rules = inline.breaks;\n } else {\n this.rules = inline.gfm;\n }\n } else if (this.options.pedantic) {\n this.rules = inline.pedantic;\n }\n}", "function InlineLexer(links, options) {\n this.options = options || marked.defaults;\n this.links = links;\n this.rules = inline.normal;\n this.renderer = this.options.renderer || new Renderer;\n this.renderer.options = this.options;\n\n if (!this.links) {\n throw new\n Error('Tokens array requires a `links` property.');\n }\n\n if (this.options.gfm) {\n if (this.options.breaks) {\n this.rules = inline.breaks;\n } else {\n this.rules = inline.gfm;\n }\n } else if (this.options.pedantic) {\n this.rules = inline.pedantic;\n }\n}", "function InlineLexer(links, options) {\n this.options = options || marked.defaults;\n this.links = links;\n this.rules = inline.normal;\n this.renderer = this.options.renderer || new Renderer;\n this.renderer.options = this.options;\n\n if (!this.links) {\n throw new\n Error('Tokens array requires a `links` property.');\n }\n\n if (this.options.gfm) {\n if (this.options.breaks) {\n this.rules = inline.breaks;\n } else {\n this.rules = inline.gfm;\n }\n } else if (this.options.pedantic) {\n this.rules = inline.pedantic;\n }\n}", "function InlineLexer(links, options) {\n this.options = options || marked.defaults;\n this.links = links;\n this.rules = inline.normal;\n this.renderer = this.options.renderer || new Renderer;\n this.renderer.options = this.options;\n\n if (!this.links) {\n throw new\n Error('Tokens array requires a `links` property.');\n }\n\n if (this.options.gfm) {\n if (this.options.breaks) {\n this.rules = inline.breaks;\n } else {\n this.rules = inline.gfm;\n }\n } else if (this.options.pedantic) {\n this.rules = inline.pedantic;\n }\n}", "function InlineLexer(links, options) {\n this.options = options || marked.defaults;\n this.links = links;\n this.rules = inline.normal;\n this.renderer = this.options.renderer || new Renderer;\n this.renderer.options = this.options;\n\n if (!this.links) {\n throw new\n Error('Tokens array requires a `links` property.');\n }\n\n if (this.options.gfm) {\n if (this.options.breaks) {\n this.rules = inline.breaks;\n } else {\n this.rules = inline.gfm;\n }\n } else if (this.options.pedantic) {\n this.rules = inline.pedantic;\n }\n}", "function InlineLexer(links, options) {\n this.options = options || marked.defaults;\n this.links = links;\n this.rules = inline.normal;\n this.renderer = this.options.renderer || new Renderer;\n this.renderer.options = this.options;\n\n if (!this.links) {\n throw new\n Error('Tokens array requires a `links` property.');\n }\n\n if (this.options.gfm) {\n if (this.options.breaks) {\n this.rules = inline.breaks;\n } else {\n this.rules = inline.gfm;\n }\n } else if (this.options.pedantic) {\n this.rules = inline.pedantic;\n }\n}", "function InlineLexer(links, options) {\n this.options = options || marked.defaults;\n this.links = links;\n this.rules = inline.normal;\n this.renderer = this.options.renderer || new Renderer;\n this.renderer.options = this.options;\n\n if (!this.links) {\n throw new\n Error('Tokens array requires a `links` property.');\n }\n\n if (this.options.gfm) {\n if (this.options.breaks) {\n this.rules = inline.breaks;\n } else {\n this.rules = inline.gfm;\n }\n } else if (this.options.pedantic) {\n this.rules = inline.pedantic;\n }\n}", "function InlineLexer(links, options) {\n this.options = options || marked.defaults;\n this.links = links;\n this.rules = inline.normal;\n this.renderer = this.options.renderer || new Renderer;\n this.renderer.options = this.options;\n\n if (!this.links) {\n throw new\n Error('Tokens array requires a `links` property.');\n }\n\n if (this.options.gfm) {\n if (this.options.breaks) {\n this.rules = inline.breaks;\n } else {\n this.rules = inline.gfm;\n }\n } else if (this.options.pedantic) {\n this.rules = inline.pedantic;\n }\n}", "function InlineLexer(links, options) {\n this.options = options || marked.defaults;\n this.links = links;\n this.rules = inline.normal;\n this.renderer = this.options.renderer || new Renderer;\n this.renderer.options = this.options;\n\n if (!this.links) {\n throw new\n Error('Tokens array requires a `links` property.');\n }\n\n if (this.options.gfm) {\n if (this.options.breaks) {\n this.rules = inline.breaks;\n } else {\n this.rules = inline.gfm;\n }\n } else if (this.options.pedantic) {\n this.rules = inline.pedantic;\n }\n}", "function InlineLexer(links, options) {\n this.options = options || marked.defaults;\n this.links = links;\n this.rules = inline.normal;\n this.renderer = this.options.renderer || new Renderer;\n this.renderer.options = this.options;\n\n if (!this.links) {\n throw new\n Error('Tokens array requires a `links` property.');\n }\n\n if (this.options.gfm) {\n if (this.options.breaks) {\n this.rules = inline.breaks;\n } else {\n this.rules = inline.gfm;\n }\n } else if (this.options.pedantic) {\n this.rules = inline.pedantic;\n }\n}", "function InlineLexer(links, options) {\n this.options = options || marked.defaults;\n this.links = links;\n this.rules = inline.normal;\n this.renderer = this.options.renderer || new Renderer;\n this.renderer.options = this.options;\n\n if (!this.links) {\n throw new\n Error('Tokens array requires a `links` property.');\n }\n\n if (this.options.gfm) {\n if (this.options.breaks) {\n this.rules = inline.breaks;\n } else {\n this.rules = inline.gfm;\n }\n } else if (this.options.pedantic) {\n this.rules = inline.pedantic;\n }\n}", "function InlineLexer(links, options) {\n this.options = options || marked.defaults;\n this.links = links;\n this.rules = inline.normal;\n this.renderer = this.options.renderer || new Renderer;\n this.renderer.options = this.options;\n\n if (!this.links) {\n throw new\n Error('Tokens array requires a `links` property.');\n }\n\n if (this.options.gfm) {\n if (this.options.breaks) {\n this.rules = inline.breaks;\n } else {\n this.rules = inline.gfm;\n }\n } else if (this.options.pedantic) {\n this.rules = inline.pedantic;\n }\n}" ]
[ "0.6647831", "0.6647831", "0.6647831", "0.6637244", "0.6637244", "0.6637244", "0.65069973", "0.65069973", "0.65069973", "0.65069973", "0.65069973", "0.65069973", "0.65069973", "0.63949126", "0.62895286", "0.61172473", "0.608667", "0.5903893", "0.58503217", "0.58113986", "0.5803384", "0.5733558", "0.56966263", "0.5658926", "0.5626011", "0.55551535", "0.5553597", "0.55168456", "0.55125767", "0.5511706", "0.54360014", "0.54360014", "0.54360014", "0.54360014", "0.54360014", "0.54360014", "0.54360014", "0.54360014", "0.54360014", "0.5415937", "0.5378072", "0.5368508", "0.5359228", "0.5339874", "0.53192323", "0.53038603", "0.52896327", "0.5268147", "0.5240542", "0.5228902", "0.5223472", "0.51639706", "0.51637715", "0.51569253", "0.51417303", "0.512923", "0.51287556", "0.5121763", "0.51197726", "0.5110854", "0.5106103", "0.5106103", "0.5097936", "0.5097936", "0.50964504", "0.50964504", "0.50964504", "0.50964504", "0.50964504", "0.50964504", "0.50937706", "0.50937706", "0.50937706", "0.50886005", "0.50886005", "0.50886005", "0.50886005", "0.50886005", "0.50886005", "0.50886005", "0.50886005", "0.50886005", "0.50886005", "0.5083679", "0.50782233", "0.50782233", "0.50782233", "0.50782233", "0.50782233", "0.50782233", "0.50782233", "0.50782233", "0.50782233", "0.50782233", "0.50782233", "0.50782233" ]
0.5797938
25
Tokenizer for a bound `type`.
function tokenize(value, location) { var self = this; var offset = self.offset; var tokens = []; var methods = self[type + 'Methods']; var tokenizers = self[type + 'Tokenizers']; var line = location.line; var column = location.column; var index; var length; var method; var name; var matched; var valueLength; /* Trim white space only lines. */ if (!value) { return tokens; } /* Expose on `eat`. */ eat.now = now; eat.file = self.file; /* Sync initial offset. */ updatePosition(''); /* Iterate over `value`, and iterate over all * tokenizers. When one eats something, re-iterate * with the remaining value. If no tokenizer eats, * something failed (should not happen) and an * exception is thrown. */ while (value) { index = -1; length = methods.length; matched = false; while (++index < length) { name = methods[index]; method = tokenizers[name]; if ( method && /* istanbul ignore next */ (!method.onlyAtStart || self.atStart) && (!method.notInList || !self.inList) && (!method.notInBlock || !self.inBlock) && (!method.notInLink || !self.inLink) ) { valueLength = value.length; method.apply(self, [eat, value]); matched = valueLength !== value.length; if (matched) { break; } } } /* istanbul ignore if */ if (!matched) { self.file.fail(new Error('Infinite loop'), eat.now()); } } self.eof = now(); return tokens; /* Update line, column, and offset based on * `value`. */ function updatePosition(subvalue) { var lastIndex = -1; var index = subvalue.indexOf('\n'); while (index !== -1) { line++; lastIndex = index; index = subvalue.indexOf('\n', index + 1); } if (lastIndex === -1) { column += subvalue.length; } else { column = subvalue.length - lastIndex; } if (line in offset) { if (lastIndex !== -1) { column += offset[line]; } else if (column <= offset[line]) { column = offset[line] + 1; } } } /* Get offset. Called before the first character is * eaten to retrieve the range's offsets. */ function getOffset() { var indentation = []; var pos = line + 1; /* Done. Called when the last character is * eaten to retrieve the range’s offsets. */ return function () { var last = line + 1; while (pos < last) { indentation.push((offset[pos] || 0) + 1); pos++; } return indentation; }; } /* Get the current position. */ function now() { var pos = {line: line, column: column}; pos.offset = self.toOffset(pos); return pos; } /* Store position information for a node. */ function Position(start) { this.start = start; this.end = now(); } /* Throw when a value is incorrectly eaten. * This shouldn’t happen but will throw on new, * incorrect rules. */ function validateEat(subvalue) { /* istanbul ignore if */ if (value.substring(0, subvalue.length) !== subvalue) { /* Capture stack-trace. */ self.file.fail( new Error( 'Incorrectly eaten value: please report this ' + 'warning on http://git.io/vg5Ft' ), now() ); } } /* Mark position and patch `node.position`. */ function position() { var before = now(); return update; /* Add the position to a node. */ function update(node, indent) { var prev = node.position; var start = prev ? prev.start : before; var combined = []; var n = prev && prev.end.line; var l = before.line; node.position = new Position(start); /* If there was already a `position`, this * node was merged. Fixing `start` wasn’t * hard, but the indent is different. * Especially because some information, the * indent between `n` and `l` wasn’t * tracked. Luckily, that space is * (should be?) empty, so we can safely * check for it now. */ if (prev && indent && prev.indent) { combined = prev.indent; if (n < l) { while (++n < l) { combined.push((offset[n] || 0) + 1); } combined.push(before.column); } indent = combined.concat(indent); } node.position.indent = indent || []; return node; } } /* Add `node` to `parent`s children or to `tokens`. * Performs merges where possible. */ function add(node, parent) { var children = parent ? parent.children : tokens; var prev = children[children.length - 1]; if ( prev && node.type === prev.type && node.type in MERGEABLE_NODES && mergeable(prev) && mergeable(node) ) { node = MERGEABLE_NODES[node.type].call(self, prev, node); } if (node !== prev) { children.push(node); } if (self.atStart && tokens.length !== 0) { self.exitStart(); } return node; } /* Remove `subvalue` from `value`. * `subvalue` must be at the start of `value`. */ function eat(subvalue) { var indent = getOffset(); var pos = position(); var current = now(); validateEat(subvalue); apply.reset = reset; reset.test = test; apply.test = test; value = value.substring(subvalue.length); updatePosition(subvalue); indent = indent(); return apply; /* Add the given arguments, add `position` to * the returned node, and return the node. */ function apply(node, parent) { return pos(add(pos(node), parent), indent); } /* Functions just like apply, but resets the * content: the line and column are reversed, * and the eaten value is re-added. * This is useful for nodes with a single * type of content, such as lists and tables. * See `apply` above for what parameters are * expected. */ function reset() { var node = apply.apply(null, arguments); line = current.line; column = current.column; value = subvalue + value; return node; } /* Test the position, after eating, and reverse * to a not-eaten state. */ function test() { var result = pos({}); line = current.line; column = current.column; value = subvalue + value; return result.position; } } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function factory(type) {\n return tokenize;\n\n /* Tokenizer for a bound `type`. */\n function tokenize(value, location) {\n var self = this;\n var offset = self.offset;\n var tokens = [];\n var methods = self[type + 'Methods'];\n var tokenizers = self[type + 'Tokenizers'];\n var line = location.line;\n var column = location.column;\n var index;\n var length;\n var method;\n var name;\n var matched;\n var valueLength;\n\n /* Trim white space only lines. */\n if (!value) {\n return tokens;\n }\n\n /* Expose on `eat`. */\n eat.now = now;\n eat.file = self.file;\n\n /* Sync initial offset. */\n updatePosition('');\n\n /* Iterate over `value`, and iterate over all\n * tokenizers. When one eats something, re-iterate\n * with the remaining value. If no tokenizer eats,\n * something failed (should not happen) and an\n * exception is thrown. */\n while (value) {\n index = -1;\n length = methods.length;\n matched = false;\n\n while (++index < length) {\n name = methods[index];\n method = tokenizers[name];\n\n if (\n method &&\n /* istanbul ignore next */ (!method.onlyAtStart || self.atStart) &&\n (!method.notInList || !self.inList) &&\n (!method.notInBlock || !self.inBlock) &&\n (!method.notInLink || !self.inLink)\n ) {\n valueLength = value.length;\n\n method.apply(self, [eat, value]);\n\n matched = valueLength !== value.length;\n\n if (matched) {\n break;\n }\n }\n }\n\n /* istanbul ignore if */\n if (!matched) {\n self.file.fail(new Error('Infinite loop'), eat.now());\n }\n }\n\n self.eof = now();\n\n return tokens;\n\n /* Update line, column, and offset based on\n * `value`. */\n function updatePosition(subvalue) {\n var lastIndex = -1;\n var index = subvalue.indexOf('\\n');\n\n while (index !== -1) {\n line++;\n lastIndex = index;\n index = subvalue.indexOf('\\n', index + 1);\n }\n\n if (lastIndex === -1) {\n column += subvalue.length;\n } else {\n column = subvalue.length - lastIndex;\n }\n\n if (line in offset) {\n if (lastIndex !== -1) {\n column += offset[line];\n } else if (column <= offset[line]) {\n column = offset[line] + 1;\n }\n }\n }\n\n /* Get offset. Called before the first character is\n * eaten to retrieve the range's offsets. */\n function getOffset() {\n var indentation = [];\n var pos = line + 1;\n\n /* Done. Called when the last character is\n * eaten to retrieve the range’s offsets. */\n return function () {\n var last = line + 1;\n\n while (pos < last) {\n indentation.push((offset[pos] || 0) + 1);\n\n pos++;\n }\n\n return indentation;\n };\n }\n\n /* Get the current position. */\n function now() {\n var pos = {line: line, column: column};\n\n pos.offset = self.toOffset(pos);\n\n return pos;\n }\n\n /* Store position information for a node. */\n function Position(start) {\n this.start = start;\n this.end = now();\n }\n\n /* Throw when a value is incorrectly eaten.\n * This shouldn’t happen but will throw on new,\n * incorrect rules. */\n function validateEat(subvalue) {\n /* istanbul ignore if */\n if (value.substring(0, subvalue.length) !== subvalue) {\n /* Capture stack-trace. */\n self.file.fail(\n new Error(\n 'Incorrectly eaten value: please report this ' +\n 'warning on http://git.io/vg5Ft'\n ),\n now()\n );\n }\n }\n\n /* Mark position and patch `node.position`. */\n function position() {\n var before = now();\n\n return update;\n\n /* Add the position to a node. */\n function update(node, indent) {\n var prev = node.position;\n var start = prev ? prev.start : before;\n var combined = [];\n var n = prev && prev.end.line;\n var l = before.line;\n\n node.position = new Position(start);\n\n /* If there was already a `position`, this\n * node was merged. Fixing `start` wasn’t\n * hard, but the indent is different.\n * Especially because some information, the\n * indent between `n` and `l` wasn’t\n * tracked. Luckily, that space is\n * (should be?) empty, so we can safely\n * check for it now. */\n if (prev && indent && prev.indent) {\n combined = prev.indent;\n\n if (n < l) {\n while (++n < l) {\n combined.push((offset[n] || 0) + 1);\n }\n\n combined.push(before.column);\n }\n\n indent = combined.concat(indent);\n }\n\n node.position.indent = indent || [];\n\n return node;\n }\n }\n\n /* Add `node` to `parent`s children or to `tokens`.\n * Performs merges where possible. */\n function add(node, parent) {\n var children = parent ? parent.children : tokens;\n var prev = children[children.length - 1];\n\n if (\n prev &&\n node.type === prev.type &&\n node.type in MERGEABLE_NODES &&\n mergeable(prev) &&\n mergeable(node)\n ) {\n node = MERGEABLE_NODES[node.type].call(self, prev, node);\n }\n\n if (node !== prev) {\n children.push(node);\n }\n\n if (self.atStart && tokens.length !== 0) {\n self.exitStart();\n }\n\n return node;\n }\n\n /* Remove `subvalue` from `value`.\n * `subvalue` must be at the start of `value`. */\n function eat(subvalue) {\n var indent = getOffset();\n var pos = position();\n var current = now();\n\n validateEat(subvalue);\n\n apply.reset = reset;\n reset.test = test;\n apply.test = test;\n\n value = value.substring(subvalue.length);\n\n updatePosition(subvalue);\n\n indent = indent();\n\n return apply;\n\n /* Add the given arguments, add `position` to\n * the returned node, and return the node. */\n function apply(node, parent) {\n return pos(add(pos(node), parent), indent);\n }\n\n /* Functions just like apply, but resets the\n * content: the line and column are reversed,\n * and the eaten value is re-added.\n * This is useful for nodes with a single\n * type of content, such as lists and tables.\n * See `apply` above for what parameters are\n * expected. */\n function reset() {\n var node = apply.apply(null, arguments);\n\n line = current.line;\n column = current.column;\n value = subvalue + value;\n\n return node;\n }\n\n /* Test the position, after eating, and reverse\n * to a not-eaten state. */\n function test() {\n var result = pos({});\n\n line = current.line;\n column = current.column;\n value = subvalue + value;\n\n return result.position;\n }\n }\n }\n}", "function factory(type) {\n return tokenize;\n\n /* Tokenizer for a bound `type`. */\n function tokenize(value, location) {\n var self = this;\n var offset = self.offset;\n var tokens = [];\n var methods = self[type + 'Methods'];\n var tokenizers = self[type + 'Tokenizers'];\n var line = location.line;\n var column = location.column;\n var index;\n var length;\n var method;\n var name;\n var matched;\n var valueLength;\n\n /* Trim white space only lines. */\n if (!value) {\n return tokens;\n }\n\n /* Expose on `eat`. */\n eat.now = now;\n eat.file = self.file;\n\n /* Sync initial offset. */\n updatePosition('');\n\n /* Iterate over `value`, and iterate over all\n * tokenizers. When one eats something, re-iterate\n * with the remaining value. If no tokenizer eats,\n * something failed (should not happen) and an\n * exception is thrown. */\n while (value) {\n index = -1;\n length = methods.length;\n matched = false;\n\n while (++index < length) {\n name = methods[index];\n method = tokenizers[name];\n\n if (\n method &&\n /* istanbul ignore next */ (!method.onlyAtStart || self.atStart) &&\n (!method.notInList || !self.inList) &&\n (!method.notInBlock || !self.inBlock) &&\n (!method.notInLink || !self.inLink)\n ) {\n valueLength = value.length;\n\n method.apply(self, [eat, value]);\n\n matched = valueLength !== value.length;\n\n if (matched) {\n break;\n }\n }\n }\n\n /* istanbul ignore if */\n if (!matched) {\n self.file.fail(new Error('Infinite loop'), eat.now());\n }\n }\n\n self.eof = now();\n\n return tokens;\n\n /* Update line, column, and offset based on\n * `value`. */\n function updatePosition(subvalue) {\n var lastIndex = -1;\n var index = subvalue.indexOf('\\n');\n\n while (index !== -1) {\n line++;\n lastIndex = index;\n index = subvalue.indexOf('\\n', index + 1);\n }\n\n if (lastIndex === -1) {\n column += subvalue.length;\n } else {\n column = subvalue.length - lastIndex;\n }\n\n if (line in offset) {\n if (lastIndex !== -1) {\n column += offset[line];\n } else if (column <= offset[line]) {\n column = offset[line] + 1;\n }\n }\n }\n\n /* Get offset. Called before the first character is\n * eaten to retrieve the range's offsets. */\n function getOffset() {\n var indentation = [];\n var pos = line + 1;\n\n /* Done. Called when the last character is\n * eaten to retrieve the range’s offsets. */\n return function () {\n var last = line + 1;\n\n while (pos < last) {\n indentation.push((offset[pos] || 0) + 1);\n\n pos++;\n }\n\n return indentation;\n };\n }\n\n /* Get the current position. */\n function now() {\n var pos = {line: line, column: column};\n\n pos.offset = self.toOffset(pos);\n\n return pos;\n }\n\n /* Store position information for a node. */\n function Position(start) {\n this.start = start;\n this.end = now();\n }\n\n /* Throw when a value is incorrectly eaten.\n * This shouldn’t happen but will throw on new,\n * incorrect rules. */\n function validateEat(subvalue) {\n /* istanbul ignore if */\n if (value.substring(0, subvalue.length) !== subvalue) {\n /* Capture stack-trace. */\n self.file.fail(\n new Error(\n 'Incorrectly eaten value: please report this ' +\n 'warning on http://git.io/vg5Ft'\n ),\n now()\n );\n }\n }\n\n /* Mark position and patch `node.position`. */\n function position() {\n var before = now();\n\n return update;\n\n /* Add the position to a node. */\n function update(node, indent) {\n var prev = node.position;\n var start = prev ? prev.start : before;\n var combined = [];\n var n = prev && prev.end.line;\n var l = before.line;\n\n node.position = new Position(start);\n\n /* If there was already a `position`, this\n * node was merged. Fixing `start` wasn’t\n * hard, but the indent is different.\n * Especially because some information, the\n * indent between `n` and `l` wasn’t\n * tracked. Luckily, that space is\n * (should be?) empty, so we can safely\n * check for it now. */\n if (prev && indent && prev.indent) {\n combined = prev.indent;\n\n if (n < l) {\n while (++n < l) {\n combined.push((offset[n] || 0) + 1);\n }\n\n combined.push(before.column);\n }\n\n indent = combined.concat(indent);\n }\n\n node.position.indent = indent || [];\n\n return node;\n }\n }\n\n /* Add `node` to `parent`s children or to `tokens`.\n * Performs merges where possible. */\n function add(node, parent) {\n var children = parent ? parent.children : tokens;\n var prev = children[children.length - 1];\n\n if (\n prev &&\n node.type === prev.type &&\n node.type in MERGEABLE_NODES &&\n mergeable(prev) &&\n mergeable(node)\n ) {\n node = MERGEABLE_NODES[node.type].call(self, prev, node);\n }\n\n if (node !== prev) {\n children.push(node);\n }\n\n if (self.atStart && tokens.length !== 0) {\n self.exitStart();\n }\n\n return node;\n }\n\n /* Remove `subvalue` from `value`.\n * `subvalue` must be at the start of `value`. */\n function eat(subvalue) {\n var indent = getOffset();\n var pos = position();\n var current = now();\n\n validateEat(subvalue);\n\n apply.reset = reset;\n reset.test = test;\n apply.test = test;\n\n value = value.substring(subvalue.length);\n\n updatePosition(subvalue);\n\n indent = indent();\n\n return apply;\n\n /* Add the given arguments, add `position` to\n * the returned node, and return the node. */\n function apply(node, parent) {\n return pos(add(pos(node), parent), indent);\n }\n\n /* Functions just like apply, but resets the\n * content: the line and column are reversed,\n * and the eaten value is re-added.\n * This is useful for nodes with a single\n * type of content, such as lists and tables.\n * See `apply` above for what parameters are\n * expected. */\n function reset() {\n var node = apply.apply(null, arguments);\n\n line = current.line;\n column = current.column;\n value = subvalue + value;\n\n return node;\n }\n\n /* Test the position, after eating, and reverse\n * to a not-eaten state. */\n function test() {\n var result = pos({});\n\n line = current.line;\n column = current.column;\n value = subvalue + value;\n\n return result.position;\n }\n }\n }\n}", "function factory(type) {\n return tokenize;\n\n /* Tokenizer for a bound `type`. */\n function tokenize(value, location) {\n var self = this;\n var offset = self.offset;\n var tokens = [];\n var methods = self[type + 'Methods'];\n var tokenizers = self[type + 'Tokenizers'];\n var line = location.line;\n var column = location.column;\n var index;\n var length;\n var method;\n var name;\n var matched;\n var valueLength;\n\n /* Trim white space only lines. */\n if (!value) {\n return tokens;\n }\n\n /* Expose on `eat`. */\n eat.now = now;\n eat.file = self.file;\n\n /* Sync initial offset. */\n updatePosition('');\n\n /* Iterate over `value`, and iterate over all\n * tokenizers. When one eats something, re-iterate\n * with the remaining value. If no tokenizer eats,\n * something failed (should not happen) and an\n * exception is thrown. */\n while (value) {\n index = -1;\n length = methods.length;\n matched = false;\n\n while (++index < length) {\n name = methods[index];\n method = tokenizers[name];\n\n if (\n method &&\n /* istanbul ignore next */ (!method.onlyAtStart || self.atStart) &&\n (!method.notInList || !self.inList) &&\n (!method.notInBlock || !self.inBlock) &&\n (!method.notInLink || !self.inLink)\n ) {\n valueLength = value.length;\n\n method.apply(self, [eat, value]);\n\n matched = valueLength !== value.length;\n\n if (matched) {\n break;\n }\n }\n }\n\n /* istanbul ignore if */\n if (!matched) {\n self.file.fail(new Error('Infinite loop'), eat.now());\n }\n }\n\n self.eof = now();\n\n return tokens;\n\n /* Update line, column, and offset based on\n * `value`. */\n function updatePosition(subvalue) {\n var lastIndex = -1;\n var index = subvalue.indexOf('\\n');\n\n while (index !== -1) {\n line++;\n lastIndex = index;\n index = subvalue.indexOf('\\n', index + 1);\n }\n\n if (lastIndex === -1) {\n column += subvalue.length;\n } else {\n column = subvalue.length - lastIndex;\n }\n\n if (line in offset) {\n if (lastIndex !== -1) {\n column += offset[line];\n } else if (column <= offset[line]) {\n column = offset[line] + 1;\n }\n }\n }\n\n /* Get offset. Called before the first character is\n * eaten to retrieve the range's offsets. */\n function getOffset() {\n var indentation = [];\n var pos = line + 1;\n\n /* Done. Called when the last character is\n * eaten to retrieve the range’s offsets. */\n return function () {\n var last = line + 1;\n\n while (pos < last) {\n indentation.push((offset[pos] || 0) + 1);\n\n pos++;\n }\n\n return indentation;\n };\n }\n\n /* Get the current position. */\n function now() {\n var pos = {line: line, column: column};\n\n pos.offset = self.toOffset(pos);\n\n return pos;\n }\n\n /* Store position information for a node. */\n function Position(start) {\n this.start = start;\n this.end = now();\n }\n\n /* Throw when a value is incorrectly eaten.\n * This shouldn’t happen but will throw on new,\n * incorrect rules. */\n function validateEat(subvalue) {\n /* istanbul ignore if */\n if (value.substring(0, subvalue.length) !== subvalue) {\n /* Capture stack-trace. */\n self.file.fail(\n new Error(\n 'Incorrectly eaten value: please report this ' +\n 'warning on http://git.io/vg5Ft'\n ),\n now()\n );\n }\n }\n\n /* Mark position and patch `node.position`. */\n function position() {\n var before = now();\n\n return update;\n\n /* Add the position to a node. */\n function update(node, indent) {\n var prev = node.position;\n var start = prev ? prev.start : before;\n var combined = [];\n var n = prev && prev.end.line;\n var l = before.line;\n\n node.position = new Position(start);\n\n /* If there was already a `position`, this\n * node was merged. Fixing `start` wasn’t\n * hard, but the indent is different.\n * Especially because some information, the\n * indent between `n` and `l` wasn’t\n * tracked. Luckily, that space is\n * (should be?) empty, so we can safely\n * check for it now. */\n if (prev && indent && prev.indent) {\n combined = prev.indent;\n\n if (n < l) {\n while (++n < l) {\n combined.push((offset[n] || 0) + 1);\n }\n\n combined.push(before.column);\n }\n\n indent = combined.concat(indent);\n }\n\n node.position.indent = indent || [];\n\n return node;\n }\n }\n\n /* Add `node` to `parent`s children or to `tokens`.\n * Performs merges where possible. */\n function add(node, parent) {\n var children = parent ? parent.children : tokens;\n var prev = children[children.length - 1];\n\n if (\n prev &&\n node.type === prev.type &&\n node.type in MERGEABLE_NODES &&\n mergeable(prev) &&\n mergeable(node)\n ) {\n node = MERGEABLE_NODES[node.type].call(self, prev, node);\n }\n\n if (node !== prev) {\n children.push(node);\n }\n\n if (self.atStart && tokens.length !== 0) {\n self.exitStart();\n }\n\n return node;\n }\n\n /* Remove `subvalue` from `value`.\n * `subvalue` must be at the start of `value`. */\n function eat(subvalue) {\n var indent = getOffset();\n var pos = position();\n var current = now();\n\n validateEat(subvalue);\n\n apply.reset = reset;\n reset.test = test;\n apply.test = test;\n\n value = value.substring(subvalue.length);\n\n updatePosition(subvalue);\n\n indent = indent();\n\n return apply;\n\n /* Add the given arguments, add `position` to\n * the returned node, and return the node. */\n function apply(node, parent) {\n return pos(add(pos(node), parent), indent);\n }\n\n /* Functions just like apply, but resets the\n * content: the line and column are reversed,\n * and the eaten value is re-added.\n * This is useful for nodes with a single\n * type of content, such as lists and tables.\n * See `apply` above for what parameters are\n * expected. */\n function reset() {\n var node = apply.apply(null, arguments);\n\n line = current.line;\n column = current.column;\n value = subvalue + value;\n\n return node;\n }\n\n /* Test the position, after eating, and reverse\n * to a not-eaten state. */\n function test() {\n var result = pos({});\n\n line = current.line;\n column = current.column;\n value = subvalue + value;\n\n return result.position;\n }\n }\n }\n}", "function factory(type) {\n return tokenize;\n\n /* Tokenizer for a bound `type`. */\n function tokenize(value, location) {\n var self = this;\n var offset = self.offset;\n var tokens = [];\n var methods = self[type + 'Methods'];\n var tokenizers = self[type + 'Tokenizers'];\n var line = location.line;\n var column = location.column;\n var index;\n var length;\n var method;\n var name;\n var matched;\n var valueLength;\n\n /* Trim white space only lines. */\n if (!value) {\n return tokens;\n }\n\n /* Expose on `eat`. */\n eat.now = now;\n eat.file = self.file;\n\n /* Sync initial offset. */\n updatePosition('');\n\n /* Iterate over `value`, and iterate over all\n * tokenizers. When one eats something, re-iterate\n * with the remaining value. If no tokenizer eats,\n * something failed (should not happen) and an\n * exception is thrown. */\n while (value) {\n index = -1;\n length = methods.length;\n matched = false;\n\n while (++index < length) {\n name = methods[index];\n method = tokenizers[name];\n\n if (\n method &&\n /* istanbul ignore next */ (!method.onlyAtStart || self.atStart) &&\n (!method.notInList || !self.inList) &&\n (!method.notInBlock || !self.inBlock) &&\n (!method.notInLink || !self.inLink)\n ) {\n valueLength = value.length;\n\n method.apply(self, [eat, value]);\n\n matched = valueLength !== value.length;\n\n if (matched) {\n break;\n }\n }\n }\n\n /* istanbul ignore if */\n if (!matched) {\n self.file.fail(new Error('Infinite loop'), eat.now());\n }\n }\n\n self.eof = now();\n\n return tokens;\n\n /* Update line, column, and offset based on\n * `value`. */\n function updatePosition(subvalue) {\n var lastIndex = -1;\n var index = subvalue.indexOf('\\n');\n\n while (index !== -1) {\n line++;\n lastIndex = index;\n index = subvalue.indexOf('\\n', index + 1);\n }\n\n if (lastIndex === -1) {\n column += subvalue.length;\n } else {\n column = subvalue.length - lastIndex;\n }\n\n if (line in offset) {\n if (lastIndex !== -1) {\n column += offset[line];\n } else if (column <= offset[line]) {\n column = offset[line] + 1;\n }\n }\n }\n\n /* Get offset. Called before the first character is\n * eaten to retrieve the range's offsets. */\n function getOffset() {\n var indentation = [];\n var pos = line + 1;\n\n /* Done. Called when the last character is\n * eaten to retrieve the range’s offsets. */\n return function () {\n var last = line + 1;\n\n while (pos < last) {\n indentation.push((offset[pos] || 0) + 1);\n\n pos++;\n }\n\n return indentation;\n };\n }\n\n /* Get the current position. */\n function now() {\n var pos = {line: line, column: column};\n\n pos.offset = self.toOffset(pos);\n\n return pos;\n }\n\n /* Store position information for a node. */\n function Position(start) {\n this.start = start;\n this.end = now();\n }\n\n /* Throw when a value is incorrectly eaten.\n * This shouldn’t happen but will throw on new,\n * incorrect rules. */\n function validateEat(subvalue) {\n /* istanbul ignore if */\n if (value.substring(0, subvalue.length) !== subvalue) {\n /* Capture stack-trace. */\n self.file.fail(\n new Error(\n 'Incorrectly eaten value: please report this ' +\n 'warning on http://git.io/vg5Ft'\n ),\n now()\n );\n }\n }\n\n /* Mark position and patch `node.position`. */\n function position() {\n var before = now();\n\n return update;\n\n /* Add the position to a node. */\n function update(node, indent) {\n var prev = node.position;\n var start = prev ? prev.start : before;\n var combined = [];\n var n = prev && prev.end.line;\n var l = before.line;\n\n node.position = new Position(start);\n\n /* If there was already a `position`, this\n * node was merged. Fixing `start` wasn’t\n * hard, but the indent is different.\n * Especially because some information, the\n * indent between `n` and `l` wasn’t\n * tracked. Luckily, that space is\n * (should be?) empty, so we can safely\n * check for it now. */\n if (prev && indent && prev.indent) {\n combined = prev.indent;\n\n if (n < l) {\n while (++n < l) {\n combined.push((offset[n] || 0) + 1);\n }\n\n combined.push(before.column);\n }\n\n indent = combined.concat(indent);\n }\n\n node.position.indent = indent || [];\n\n return node;\n }\n }\n\n /* Add `node` to `parent`s children or to `tokens`.\n * Performs merges where possible. */\n function add(node, parent) {\n var children = parent ? parent.children : tokens;\n var prev = children[children.length - 1];\n\n if (\n prev &&\n node.type === prev.type &&\n node.type in MERGEABLE_NODES &&\n mergeable(prev) &&\n mergeable(node)\n ) {\n node = MERGEABLE_NODES[node.type].call(self, prev, node);\n }\n\n if (node !== prev) {\n children.push(node);\n }\n\n if (self.atStart && tokens.length !== 0) {\n self.exitStart();\n }\n\n return node;\n }\n\n /* Remove `subvalue` from `value`.\n * `subvalue` must be at the start of `value`. */\n function eat(subvalue) {\n var indent = getOffset();\n var pos = position();\n var current = now();\n\n validateEat(subvalue);\n\n apply.reset = reset;\n reset.test = test;\n apply.test = test;\n\n value = value.substring(subvalue.length);\n\n updatePosition(subvalue);\n\n indent = indent();\n\n return apply;\n\n /* Add the given arguments, add `position` to\n * the returned node, and return the node. */\n function apply(node, parent) {\n return pos(add(pos(node), parent), indent);\n }\n\n /* Functions just like apply, but resets the\n * content: the line and column are reversed,\n * and the eaten value is re-added.\n * This is useful for nodes with a single\n * type of content, such as lists and tables.\n * See `apply` above for what parameters are\n * expected. */\n function reset() {\n var node = apply.apply(null, arguments);\n\n line = current.line;\n column = current.column;\n value = subvalue + value;\n\n return node;\n }\n\n /* Test the position, after eating, and reverse\n * to a not-eaten state. */\n function test() {\n var result = pos({});\n\n line = current.line;\n column = current.column;\n value = subvalue + value;\n\n return result.position;\n }\n }\n }\n}", "function factory(type) {\n return tokenize;\n\n /* Tokenizer for a bound `type`. */\n function tokenize(value, location) {\n var self = this;\n var offset = self.offset;\n var tokens = [];\n var methods = self[type + 'Methods'];\n var tokenizers = self[type + 'Tokenizers'];\n var line = location.line;\n var column = location.column;\n var index;\n var length;\n var method;\n var name;\n var matched;\n var valueLength;\n\n /* Trim white space only lines. */\n if (!value) {\n return tokens;\n }\n\n /* Expose on `eat`. */\n eat.now = now;\n eat.file = self.file;\n\n /* Sync initial offset. */\n updatePosition('');\n\n /* Iterate over `value`, and iterate over all\n * tokenizers. When one eats something, re-iterate\n * with the remaining value. If no tokenizer eats,\n * something failed (should not happen) and an\n * exception is thrown. */\n while (value) {\n index = -1;\n length = methods.length;\n matched = false;\n\n while (++index < length) {\n name = methods[index];\n method = tokenizers[name];\n\n if (\n method &&\n /* istanbul ignore next */ (!method.onlyAtStart || self.atStart) &&\n (!method.notInList || !self.inList) &&\n (!method.notInBlock || !self.inBlock) &&\n (!method.notInLink || !self.inLink)\n ) {\n valueLength = value.length;\n\n method.apply(self, [eat, value]);\n\n matched = valueLength !== value.length;\n\n if (matched) {\n break;\n }\n }\n }\n\n /* istanbul ignore if */\n if (!matched) {\n self.file.fail(new Error('Infinite loop'), eat.now());\n }\n }\n\n self.eof = now();\n\n return tokens;\n\n /* Update line, column, and offset based on\n * `value`. */\n function updatePosition(subvalue) {\n var lastIndex = -1;\n var index = subvalue.indexOf('\\n');\n\n while (index !== -1) {\n line++;\n lastIndex = index;\n index = subvalue.indexOf('\\n', index + 1);\n }\n\n if (lastIndex === -1) {\n column += subvalue.length;\n } else {\n column = subvalue.length - lastIndex;\n }\n\n if (line in offset) {\n if (lastIndex !== -1) {\n column += offset[line];\n } else if (column <= offset[line]) {\n column = offset[line] + 1;\n }\n }\n }\n\n /* Get offset. Called before the first character is\n * eaten to retrieve the range's offsets. */\n function getOffset() {\n var indentation = [];\n var pos = line + 1;\n\n /* Done. Called when the last character is\n * eaten to retrieve the range’s offsets. */\n return function () {\n var last = line + 1;\n\n while (pos < last) {\n indentation.push((offset[pos] || 0) + 1);\n\n pos++;\n }\n\n return indentation;\n };\n }\n\n /* Get the current position. */\n function now() {\n var pos = {line: line, column: column};\n\n pos.offset = self.toOffset(pos);\n\n return pos;\n }\n\n /* Store position information for a node. */\n function Position(start) {\n this.start = start;\n this.end = now();\n }\n\n /* Throw when a value is incorrectly eaten.\n * This shouldn’t happen but will throw on new,\n * incorrect rules. */\n function validateEat(subvalue) {\n /* istanbul ignore if */\n if (value.substring(0, subvalue.length) !== subvalue) {\n /* Capture stack-trace. */\n self.file.fail(\n new Error(\n 'Incorrectly eaten value: please report this ' +\n 'warning on http://git.io/vg5Ft'\n ),\n now()\n );\n }\n }\n\n /* Mark position and patch `node.position`. */\n function position() {\n var before = now();\n\n return update;\n\n /* Add the position to a node. */\n function update(node, indent) {\n var prev = node.position;\n var start = prev ? prev.start : before;\n var combined = [];\n var n = prev && prev.end.line;\n var l = before.line;\n\n node.position = new Position(start);\n\n /* If there was already a `position`, this\n * node was merged. Fixing `start` wasn’t\n * hard, but the indent is different.\n * Especially because some information, the\n * indent between `n` and `l` wasn’t\n * tracked. Luckily, that space is\n * (should be?) empty, so we can safely\n * check for it now. */\n if (prev && indent && prev.indent) {\n combined = prev.indent;\n\n if (n < l) {\n while (++n < l) {\n combined.push((offset[n] || 0) + 1);\n }\n\n combined.push(before.column);\n }\n\n indent = combined.concat(indent);\n }\n\n node.position.indent = indent || [];\n\n return node;\n }\n }\n\n /* Add `node` to `parent`s children or to `tokens`.\n * Performs merges where possible. */\n function add(node, parent) {\n var children = parent ? parent.children : tokens;\n var prev = children[children.length - 1];\n\n if (\n prev &&\n node.type === prev.type &&\n node.type in MERGEABLE_NODES &&\n mergeable(prev) &&\n mergeable(node)\n ) {\n node = MERGEABLE_NODES[node.type].call(self, prev, node);\n }\n\n if (node !== prev) {\n children.push(node);\n }\n\n if (self.atStart && tokens.length !== 0) {\n self.exitStart();\n }\n\n return node;\n }\n\n /* Remove `subvalue` from `value`.\n * `subvalue` must be at the start of `value`. */\n function eat(subvalue) {\n var indent = getOffset();\n var pos = position();\n var current = now();\n\n validateEat(subvalue);\n\n apply.reset = reset;\n reset.test = test;\n apply.test = test;\n\n value = value.substring(subvalue.length);\n\n updatePosition(subvalue);\n\n indent = indent();\n\n return apply;\n\n /* Add the given arguments, add `position` to\n * the returned node, and return the node. */\n function apply(node, parent) {\n return pos(add(pos(node), parent), indent);\n }\n\n /* Functions just like apply, but resets the\n * content: the line and column are reversed,\n * and the eaten value is re-added.\n * This is useful for nodes with a single\n * type of content, such as lists and tables.\n * See `apply` above for what parameters are\n * expected. */\n function reset() {\n var node = apply.apply(null, arguments);\n\n line = current.line;\n column = current.column;\n value = subvalue + value;\n\n return node;\n }\n\n /* Test the position, after eating, and reverse\n * to a not-eaten state. */\n function test() {\n var result = pos({});\n\n line = current.line;\n column = current.column;\n value = subvalue + value;\n\n return result.position;\n }\n }\n }\n}", "function factory(type) {\n return tokenize;\n\n /* Tokenizer for a bound `type`. */\n function tokenize(value, location) {\n var self = this;\n var offset = self.offset;\n var tokens = [];\n var methods = self[type + 'Methods'];\n var tokenizers = self[type + 'Tokenizers'];\n var line = location.line;\n var column = location.column;\n var index;\n var length;\n var method;\n var name;\n var matched;\n var valueLength;\n\n /* Trim white space only lines. */\n if (!value) {\n return tokens;\n }\n\n /* Expose on `eat`. */\n eat.now = now;\n eat.file = self.file;\n\n /* Sync initial offset. */\n updatePosition('');\n\n /* Iterate over `value`, and iterate over all\n * tokenizers. When one eats something, re-iterate\n * with the remaining value. If no tokenizer eats,\n * something failed (should not happen) and an\n * exception is thrown. */\n while (value) {\n index = -1;\n length = methods.length;\n matched = false;\n\n while (++index < length) {\n name = methods[index];\n method = tokenizers[name];\n\n if (\n method &&\n (!method.onlyAtStart || self.atStart) &&\n (!method.notInList || !self.inList) &&\n (!method.notInBlock || !self.inBlock) &&\n (!method.notInLink || !self.inLink)\n ) {\n valueLength = value.length;\n\n method.apply(self, [eat, value]);\n\n matched = valueLength !== value.length;\n\n if (matched) {\n break;\n }\n }\n }\n\n /* istanbul ignore if */\n if (!matched) {\n self.file.fail(new Error('Infinite loop'), eat.now());\n }\n }\n\n self.eof = now();\n\n return tokens;\n\n /**\n * Update line, column, and offset based on\n * `value`.\n *\n * @example\n * updatePosition('foo');\n *\n * @param {string} subvalue - Subvalue to eat.\n */\n function updatePosition(subvalue) {\n var lastIndex = -1;\n var index = subvalue.indexOf('\\n');\n\n while (index !== -1) {\n line++;\n lastIndex = index;\n index = subvalue.indexOf('\\n', index + 1);\n }\n\n if (lastIndex === -1) {\n column += subvalue.length;\n } else {\n column = subvalue.length - lastIndex;\n }\n\n if (line in offset) {\n if (lastIndex !== -1) {\n column += offset[line];\n } else if (column <= offset[line]) {\n column = offset[line] + 1;\n }\n }\n }\n\n /**\n * Get offset. Called before the first character is\n * eaten to retrieve the range's offsets.\n *\n * @return {Function} - `done`, to be called when\n * the last character is eaten.\n */\n function getOffset() {\n var indentation = [];\n var pos = line + 1;\n\n /**\n * Done. Called when the last character is\n * eaten to retrieve the range’s offsets.\n *\n * @return {Array.<number>} - Offset.\n */\n return function () {\n var last = line + 1;\n\n while (pos < last) {\n indentation.push((offset[pos] || 0) + 1);\n\n pos++;\n }\n\n return indentation;\n };\n }\n\n /**\n * Get the current position.\n *\n * @example\n * position = now(); // {line: 1, column: 1, offset: 0}\n *\n * @return {Object} - Current Position.\n */\n function now() {\n var pos = {line: line, column: column};\n\n pos.offset = self.toOffset(pos);\n\n return pos;\n }\n\n /**\n * Store position information for a node.\n *\n * @example\n * start = now();\n * updatePosition('foo');\n * location = new Position(start);\n * // {\n * // start: {line: 1, column: 1, offset: 0},\n * // end: {line: 1, column: 3, offset: 2}\n * // }\n *\n * @param {Object} start - Starting position.\n */\n function Position(start) {\n this.start = start;\n this.end = now();\n }\n\n /**\n * Throw when a value is incorrectly eaten.\n * This shouldn’t happen but will throw on new,\n * incorrect rules.\n *\n * @example\n * // When the current value is set to `foo bar`.\n * validateEat('foo');\n * eat('foo');\n *\n * validateEat('bar');\n * // throws, because the space is not eaten.\n *\n * @param {string} subvalue - Value to be eaten.\n * @throws {Error} - When `subvalue` cannot be eaten.\n */\n function validateEat(subvalue) {\n /* istanbul ignore if */\n if (value.substring(0, subvalue.length) !== subvalue) {\n /* Capture stack-trace. */\n self.file.fail(\n new Error(\n 'Incorrectly eaten value: please report this ' +\n 'warning on http://git.io/vg5Ft'\n ),\n now()\n );\n }\n }\n\n /**\n * Mark position and patch `node.position`.\n *\n * @example\n * var update = position();\n * updatePosition('foo');\n * update({});\n * // {\n * // position: {\n * // start: {line: 1, column: 1, offset: 0},\n * // end: {line: 1, column: 3, offset: 2}\n * // }\n * // }\n *\n * @returns {Function} - Updater.\n */\n function position() {\n var before = now();\n\n return update;\n\n /**\n * Add the position to a node.\n *\n * @example\n * update({type: 'text', value: 'foo'});\n *\n * @param {Node} node - Node to attach position\n * on.\n * @param {Array} [indent] - Indentation for\n * `node`.\n * @return {Node} - `node`.\n */\n function update(node, indent) {\n var prev = node.position;\n var start = prev ? prev.start : before;\n var combined = [];\n var n = prev && prev.end.line;\n var l = before.line;\n\n node.position = new Position(start);\n\n /* If there was already a `position`, this\n * node was merged. Fixing `start` wasn’t\n * hard, but the indent is different.\n * Especially because some information, the\n * indent between `n` and `l` wasn’t\n * tracked. Luckily, that space is\n * (should be?) empty, so we can safely\n * check for it now. */\n if (prev && indent && prev.indent) {\n combined = prev.indent;\n\n if (n < l) {\n while (++n < l) {\n combined.push((offset[n] || 0) + 1);\n }\n\n combined.push(before.column);\n }\n\n indent = combined.concat(indent);\n }\n\n node.position.indent = indent || [];\n\n return node;\n }\n }\n\n /**\n * Add `node` to `parent`s children or to `tokens`.\n * Performs merges where possible.\n *\n * @example\n * add({});\n *\n * add({}, {children: []});\n *\n * @param {Object} node - Node to add.\n * @param {Object} [parent] - Parent to insert into.\n * @return {Object} - Added or merged into node.\n */\n function add(node, parent) {\n var children = parent ? parent.children : tokens;\n var prev = children[children.length - 1];\n\n if (\n prev &&\n node.type === prev.type &&\n node.type in MERGEABLE_NODES &&\n mergeable(prev) &&\n mergeable(node)\n ) {\n node = MERGEABLE_NODES[node.type].call(self, prev, node);\n }\n\n if (node !== prev) {\n children.push(node);\n }\n\n if (self.atStart && tokens.length !== 0) {\n self.exitStart();\n }\n\n return node;\n }\n\n /**\n * Remove `subvalue` from `value`.\n * `subvalue` must be at the start of `value`.\n *\n * @example\n * eat('foo')({type: 'text', value: 'foo'});\n *\n * @param {string} subvalue - Removed from `value`,\n * and passed to `updatePosition`.\n * @return {Function} - Wrapper around `add`, which\n * also adds `position` to node.\n */\n function eat(subvalue) {\n var indent = getOffset();\n var pos = position();\n var current = now();\n\n validateEat(subvalue);\n\n apply.reset = reset;\n reset.test = test;\n apply.test = test;\n\n value = value.substring(subvalue.length);\n\n updatePosition(subvalue);\n\n indent = indent();\n\n return apply;\n\n /**\n * Add the given arguments, add `position` to\n * the returned node, and return the node.\n *\n * @param {Object} node - Node to add.\n * @param {Object} [parent] - Node to insert into.\n * @return {Node} - Added node.\n */\n function apply(node, parent) {\n return pos(add(pos(node), parent), indent);\n }\n\n /**\n * Functions just like apply, but resets the\n * content: the line and column are reversed,\n * and the eaten value is re-added.\n *\n * This is useful for nodes with a single\n * type of content, such as lists and tables.\n *\n * See `apply` above for what parameters are\n * expected.\n *\n * @return {Node} - Added node.\n */\n function reset() {\n var node = apply.apply(null, arguments);\n\n line = current.line;\n column = current.column;\n value = subvalue + value;\n\n return node;\n }\n\n /**\n * Test the position, after eating, and reverse\n * to a not-eaten state.\n *\n * @return {Position} - Position after eating `subvalue`.\n */\n function test() {\n var result = pos({});\n\n line = current.line;\n column = current.column;\n value = subvalue + value;\n\n return result.position;\n }\n }\n }\n}", "function factory(type) {\n return tokenize\n\n // Tokenizer for a bound `type`.\n function tokenize(value, location) {\n var self = this\n var offset = self.offset\n var tokens = []\n var methods = self[type + 'Methods']\n var tokenizers = self[type + 'Tokenizers']\n var line = location.line\n var column = location.column\n var index\n var length\n var method\n var name\n var matched\n var valueLength\n\n // Trim white space only lines.\n if (!value) {\n return tokens\n }\n\n // Expose on `eat`.\n eat.now = now\n eat.file = self.file\n\n // Sync initial offset.\n updatePosition('')\n\n // Iterate over `value`, and iterate over all tokenizers. When one eats\n // something, re-iterate with the remaining value. If no tokenizer eats,\n // something failed (should not happen) and an exception is thrown.\n while (value) {\n index = -1\n length = methods.length\n matched = false\n\n while (++index < length) {\n name = methods[index]\n method = tokenizers[name]\n\n // Previously, we had constructs such as footnotes and YAML that used\n // these properties.\n // Those are now external (plus there are userland extensions), that may\n // still use them.\n if (\n method &&\n /* istanbul ignore next */ (!method.onlyAtStart || self.atStart) &&\n /* istanbul ignore next */ (!method.notInList || !self.inList) &&\n /* istanbul ignore next */ (!method.notInBlock || !self.inBlock) &&\n (!method.notInLink || !self.inLink)\n ) {\n valueLength = value.length\n\n method.apply(self, [eat, value])\n\n matched = valueLength !== value.length\n\n if (matched) {\n break\n }\n }\n }\n\n /* istanbul ignore if */\n if (!matched) {\n self.file.fail(new Error('Infinite loop'), eat.now())\n }\n }\n\n self.eof = now()\n\n return tokens\n\n // Update line, column, and offset based on `value`.\n function updatePosition(subvalue) {\n var lastIndex = -1\n var index = subvalue.indexOf('\\n')\n\n while (index !== -1) {\n line++\n lastIndex = index\n index = subvalue.indexOf('\\n', index + 1)\n }\n\n if (lastIndex === -1) {\n column += subvalue.length\n } else {\n column = subvalue.length - lastIndex\n }\n\n if (line in offset) {\n if (lastIndex !== -1) {\n column += offset[line]\n } else if (column <= offset[line]) {\n column = offset[line] + 1\n }\n }\n }\n\n // Get offset. Called before the first character is eaten to retrieve the\n // range’s offsets.\n function getOffset() {\n var indentation = []\n var pos = line + 1\n\n // Done. Called when the last character is eaten to retrieve the range’s\n // offsets.\n return function () {\n var last = line + 1\n\n while (pos < last) {\n indentation.push((offset[pos] || 0) + 1)\n\n pos++\n }\n\n return indentation\n }\n }\n\n // Get the current position.\n function now() {\n var pos = {line: line, column: column}\n\n pos.offset = self.toOffset(pos)\n\n return pos\n }\n\n // Store position information for a node.\n function Position(start) {\n this.start = start\n this.end = now()\n }\n\n // Throw when a value is incorrectly eaten. This shouldn’t happen but will\n // throw on new, incorrect rules.\n function validateEat(subvalue) {\n /* istanbul ignore if */\n if (value.slice(0, subvalue.length) !== subvalue) {\n // Capture stack-trace.\n self.file.fail(\n new Error(\n 'Incorrectly eaten value: please report this warning on https://git.io/vg5Ft'\n ),\n now()\n )\n }\n }\n\n // Mark position and patch `node.position`.\n function position() {\n var before = now()\n\n return update\n\n // Add the position to a node.\n function update(node, indent) {\n var previous = node.position\n var start = previous ? previous.start : before\n var combined = []\n var n = previous && previous.end.line\n var l = before.line\n\n node.position = new Position(start)\n\n // If there was already a `position`, this node was merged. Fixing\n // `start` wasn’t hard, but the indent is different. Especially\n // because some information, the indent between `n` and `l` wasn’t\n // tracked. Luckily, that space is (should be?) empty, so we can\n // safely check for it now.\n if (previous && indent && previous.indent) {\n combined = previous.indent\n\n if (n < l) {\n while (++n < l) {\n combined.push((offset[n] || 0) + 1)\n }\n\n combined.push(before.column)\n }\n\n indent = combined.concat(indent)\n }\n\n node.position.indent = indent || []\n\n return node\n }\n }\n\n // Add `node` to `parent`s children or to `tokens`. Performs merges where\n // possible.\n function add(node, parent) {\n var children = parent ? parent.children : tokens\n var previous = children[children.length - 1]\n var fn\n\n if (\n previous &&\n node.type === previous.type &&\n (node.type === 'text' || node.type === 'blockquote') &&\n mergeable(previous) &&\n mergeable(node)\n ) {\n fn = node.type === 'text' ? mergeText : mergeBlockquote\n node = fn.call(self, previous, node)\n }\n\n if (node !== previous) {\n children.push(node)\n }\n\n if (self.atStart && tokens.length !== 0) {\n self.exitStart()\n }\n\n return node\n }\n\n // Remove `subvalue` from `value`. `subvalue` must be at the start of\n // `value`.\n function eat(subvalue) {\n var indent = getOffset()\n var pos = position()\n var current = now()\n\n validateEat(subvalue)\n\n apply.reset = reset\n reset.test = test\n apply.test = test\n\n value = value.slice(subvalue.length)\n\n updatePosition(subvalue)\n\n indent = indent()\n\n return apply\n\n // Add the given arguments, add `position` to the returned node, and\n // return the node.\n function apply(node, parent) {\n return pos(add(pos(node), parent), indent)\n }\n\n // Functions just like apply, but resets the content: the line and\n // column are reversed, and the eaten value is re-added. This is\n // useful for nodes with a single type of content, such as lists and\n // tables. See `apply` above for what parameters are expected.\n function reset() {\n var node = apply.apply(null, arguments)\n\n line = current.line\n column = current.column\n value = subvalue + value\n\n return node\n }\n\n // Test the position, after eating, and reverse to a not-eaten state.\n function test() {\n var result = pos({})\n\n line = current.line\n column = current.column\n value = subvalue + value\n\n return result.position\n }\n }\n }\n}", "acceptToken(type, length) {\n if(this.processWhiteSpace(type, length)) {\n return null;\n }\n if(type < this.Token.$Token) {\n return this.makeToken(type, 0, length);\n } else {\n return this.makeToken(type & this.Token.$Token, type, length);\n }\n }", "function token(type, value) {\n \t\tthis.type = type;\n \t\tthis.value = value;\n \t}", "function typeToken() {\n\t\tvar type = thisToken;\n\t\tif (lastToken == '*')\n\t\t\ttype = '*' + type;\n\t\tgetToken();\n\t\tremoveNewLine();\n\t\tif (thisToken == '*' || thisToken == '&') {\n\t\t\tif (thisToken == '*')\n\t\t\t\ttype = thisToken + type;\n\t\t\tgetToken();\n\t\t}\n\t\t//type cast, not implemented\n\t\tif (thisToken == ')') {\n\t\t\tgetToken();\n\t\t\texecut();\n\t\t\treturn;\n\t\t}\n\t\tgetToken();\n\t\t//call function registration\n\t\tif (thisToken == '(') {\n\t\t\tpreviousToken();\n\t\t\taddFunction(type);\n\t\t} else if (thisToken == '[') {\n\t\t\taddArray(type);\n\t\t}\n\t\t//declaration of variables of the same type, separated by commas, assignment is not supported\n\t\telse if (thisToken == ',') {\n\t\t\tpreviousToken();\n\t\t\taddVar(type);\n\t\t\tgetToken();\n\t\t\twhile (thisToken && thisToken != ';') {\n\t\t\t\tgetToken();\n\t\t\t\taddVar(type);\n\t\t\t\tgetToken();\n\t\t\t\tif (!(thisToken == ',' || thisToken == ';'))\n\t\t\t\t\tputError(lineCount, 17, '');\n\t\t\t\t//info(\"\" + lineCount + \" unsupported variable declaration\");\n\t\t\t}\n\t\t} else {\n\t\t\tpreviousToken();\n\t\t\taddVar(type);\n\t\t}\n\t}", "function tokener(value, type) {\r\n session.tokens.push({\r\n value: value,\r\n type: type || value,\r\n start: null,\r\n end: null\r\n });\r\n }", "isToken(type) { return this.tokenizer.isTokenType(type) }", "getType() {\n return this.token.token_type;\n }", "constructor(token, type) {\n this._token = token; //token object\n this._type = type; //string\n }", "function finishToken(type, val) {\n tokEnd = tokPos;\n if (options.locations) tokEndLoc = new line_loc_t;\n tokType = type;\n skipSpace();\n tokVal = val;\n tokRegexpAllowed = type.beforeExpr;\n }", "eatToken(type) {\n\t\t\tconst token = this.getToken();\n\t\t\tif (token.type === type) {\n\t\t\t\tthis.nextToken();\n\t\t\t\t// @ts-ignore\n\t\t\t\treturn token;\n\t\t\t} else {\n\t\t\t\treturn undefined;\n\t\t\t}\n\t\t}", "constructor(tokens) {\n this.tokens = tokens\n this.pos = 0\n this.types = {}\n for( var i=0; i<tokens.length; i++) this.types[tokens[i].type] = \"\"\n }", "tokenizer(token , isEndOfInput , previousTokens , terminal , config){\n }", "function token(typ,val){\n\t\treturn new Token(typ,val,-1,0);\n\t}", "function Token(type, value) {\n\tthis.type = type;\n\tthis.value = value;\n}", "function tokenizer(term) {\n if (!term) {\n return [];\n }\n\n var tokens = [term];\n var meth = term.indexOf('::');\n\n // Split tokens into methods if \"::\" is found.\n if (meth > -1) {\n tokens.push(term.substr(meth + 2));\n term = term.substr(0, meth - 2);\n }\n\n // Split by namespace or fake namespace.\n if (term.indexOf('\\\\') > -1) {\n tokens = tokens.concat(term.split('\\\\'));\n } else if (term.indexOf('_') > 0) {\n tokens = tokens.concat(term.split('_'));\n }\n\n // Merge in splitting the string by case and return\n tokens = tokens.concat(term.match(/(([A-Z]?[^A-Z]*)|([a-z]?[^a-z]*))/g).slice(0,-1));\n\n return tokens;\n }", "function tokenizer(term) {\n if (!term) {\n return [];\n }\n\n var tokens = [term];\n var meth = term.indexOf('::');\n\n // Split tokens into methods if \"::\" is found.\n if (meth > -1) {\n tokens.push(term.substr(meth + 2));\n term = term.substr(0, meth - 2);\n }\n\n // Split by namespace or fake namespace.\n if (term.indexOf('\\\\') > -1) {\n tokens = tokens.concat(term.split('\\\\'));\n } else if (term.indexOf('_') > 0) {\n tokens = tokens.concat(term.split('_'));\n }\n\n // Merge in splitting the string by case and return\n tokens = tokens.concat(term.match(/(([A-Z]?[^A-Z]*)|([a-z]?[^a-z]*))/g).slice(0,-1));\n\n return tokens;\n }", "function tokenizer(term) {\n if (!term) {\n return [];\n }\n\n var tokens = [term];\n var meth = term.indexOf('::');\n\n // Split tokens into methods if \"::\" is found.\n if (meth > -1) {\n tokens.push(term.substr(meth + 2));\n term = term.substr(0, meth - 2);\n }\n\n // Split by namespace or fake namespace.\n if (term.indexOf('\\\\') > -1) {\n tokens = tokens.concat(term.split('\\\\'));\n } else if (term.indexOf('_') > 0) {\n tokens = tokens.concat(term.split('_'));\n }\n\n // Merge in splitting the string by case and return\n tokens = tokens.concat(term.match(/(([A-Z]?[^A-Z]*)|([a-z]?[^a-z]*))/g).slice(0,-1));\n\n return tokens;\n }", "function tokenizer(term) {\n if (!term) {\n return [];\n }\n\n var tokens = [term];\n var meth = term.indexOf('::');\n\n // Split tokens into methods if \"::\" is found.\n if (meth > -1) {\n tokens.push(term.substr(meth + 2));\n term = term.substr(0, meth - 2);\n }\n\n // Split by namespace or fake namespace.\n if (term.indexOf('\\\\') > -1) {\n tokens = tokens.concat(term.split('\\\\'));\n } else if (term.indexOf('_') > 0) {\n tokens = tokens.concat(term.split('_'));\n }\n\n // Merge in splitting the string by case and return\n tokens = tokens.concat(term.match(/(([A-Z]?[^A-Z]*)|([a-z]?[^a-z]*))/g).slice(0,-1));\n\n return tokens;\n }", "function tokenizer(term) {\n if (!term) {\n return [];\n }\n\n var tokens = [term];\n var meth = term.indexOf('::');\n\n // Split tokens into methods if \"::\" is found.\n if (meth > -1) {\n tokens.push(term.substr(meth + 2));\n term = term.substr(0, meth - 2);\n }\n\n // Split by namespace or fake namespace.\n if (term.indexOf('\\\\') > -1) {\n tokens = tokens.concat(term.split('\\\\'));\n } else if (term.indexOf('_') > 0) {\n tokens = tokens.concat(term.split('_'));\n }\n\n // Merge in splitting the string by case and return\n tokens = tokens.concat(term.match(/(([A-Z]?[^A-Z]*)|([a-z]?[^a-z]*))/g).slice(0,-1));\n\n return tokens;\n }", "function tokenizer(term) {\n if (!term) {\n return [];\n }\n\n var tokens = [term];\n var meth = term.indexOf('::');\n\n // Split tokens into methods if \"::\" is found.\n if (meth > -1) {\n tokens.push(term.substr(meth + 2));\n term = term.substr(0, meth - 2);\n }\n\n // Split by namespace or fake namespace.\n if (term.indexOf('\\\\') > -1) {\n tokens = tokens.concat(term.split('\\\\'));\n } else if (term.indexOf('_') > 0) {\n tokens = tokens.concat(term.split('_'));\n }\n\n // Merge in splitting the string by case and return\n tokens = tokens.concat(term.match(/(([A-Z]?[^A-Z]*)|([a-z]?[^a-z]*))/g).slice(0,-1));\n\n return tokens;\n }", "function tokenizer(term) {\n if (!term) {\n return [];\n }\n\n var tokens = [term];\n var meth = term.indexOf('::');\n\n // Split tokens into methods if \"::\" is found.\n if (meth > -1) {\n tokens.push(term.substr(meth + 2));\n term = term.substr(0, meth - 2);\n }\n\n // Split by namespace or fake namespace.\n if (term.indexOf('\\\\') > -1) {\n tokens = tokens.concat(term.split('\\\\'));\n } else if (term.indexOf('_') > 0) {\n tokens = tokens.concat(term.split('_'));\n }\n\n // Merge in splitting the string by case and return\n tokens = tokens.concat(term.match(/(([A-Z]?[^A-Z]*)|([a-z]?[^a-z]*))/g).slice(0,-1));\n\n return tokens;\n }", "function tokenizer(term) {\n if (!term) {\n return [];\n }\n\n var tokens = [term];\n var meth = term.indexOf('::');\n\n // Split tokens into methods if \"::\" is found.\n if (meth > -1) {\n tokens.push(term.substr(meth + 2));\n term = term.substr(0, meth - 2);\n }\n\n // Split by namespace or fake namespace.\n if (term.indexOf('\\\\') > -1) {\n tokens = tokens.concat(term.split('\\\\'));\n } else if (term.indexOf('_') > 0) {\n tokens = tokens.concat(term.split('_'));\n }\n\n // Merge in splitting the string by case and return\n tokens = tokens.concat(term.match(/(([A-Z]?[^A-Z]*)|([a-z]?[^a-z]*))/g).slice(0,-1));\n\n return tokens;\n }", "function tokenizer(term) {\n if (!term) {\n return [];\n }\n\n var tokens = [term];\n var meth = term.indexOf('::');\n\n // Split tokens into methods if \"::\" is found.\n if (meth > -1) {\n tokens.push(term.substr(meth + 2));\n term = term.substr(0, meth - 2);\n }\n\n // Split by namespace or fake namespace.\n if (term.indexOf('\\\\') > -1) {\n tokens = tokens.concat(term.split('\\\\'));\n } else if (term.indexOf('_') > 0) {\n tokens = tokens.concat(term.split('_'));\n }\n\n // Merge in splitting the string by case and return\n tokens = tokens.concat(term.match(/(([A-Z]?[^A-Z]*)|([a-z]?[^a-z]*))/g).slice(0,-1));\n\n return tokens;\n }", "function tokenizer(term) {\n if (!term) {\n return [];\n }\n\n var tokens = [term];\n var meth = term.indexOf('::');\n\n // Split tokens into methods if \"::\" is found.\n if (meth > -1) {\n tokens.push(term.substr(meth + 2));\n term = term.substr(0, meth - 2);\n }\n\n // Split by namespace or fake namespace.\n if (term.indexOf('\\\\') > -1) {\n tokens = tokens.concat(term.split('\\\\'));\n } else if (term.indexOf('_') > 0) {\n tokens = tokens.concat(term.split('_'));\n }\n\n // Merge in splitting the string by case and return\n tokens = tokens.concat(term.match(/(([A-Z]?[^A-Z]*)|([a-z]?[^a-z]*))/g).slice(0,-1));\n\n return tokens;\n }", "function tokenizer(term) {\n if (!term) {\n return [];\n }\n\n var tokens = [term];\n var meth = term.indexOf('::');\n\n // Split tokens into methods if \"::\" is found.\n if (meth > -1) {\n tokens.push(term.substr(meth + 2));\n term = term.substr(0, meth - 2);\n }\n\n // Split by namespace or fake namespace.\n if (term.indexOf('\\\\') > -1) {\n tokens = tokens.concat(term.split('\\\\'));\n } else if (term.indexOf('_') > 0) {\n tokens = tokens.concat(term.split('_'));\n }\n\n // Merge in splitting the string by case and return\n tokens = tokens.concat(term.match(/(([A-Z]?[^A-Z]*)|([a-z]?[^a-z]*))/g).slice(0,-1));\n\n return tokens;\n }", "function tokenizer(term) {\n if (!term) {\n return [];\n }\n\n var tokens = [term];\n var meth = term.indexOf('::');\n\n // Split tokens into methods if \"::\" is found.\n if (meth > -1) {\n tokens.push(term.substr(meth + 2));\n term = term.substr(0, meth - 2);\n }\n\n // Split by namespace or fake namespace.\n if (term.indexOf('\\\\') > -1) {\n tokens = tokens.concat(term.split('\\\\'));\n } else if (term.indexOf('_') > 0) {\n tokens = tokens.concat(term.split('_'));\n }\n\n // Merge in splitting the string by case and return\n tokens = tokens.concat(term.match(/(([A-Z]?[^A-Z]*)|([a-z]?[^a-z]*))/g).slice(0,-1));\n\n return tokens;\n }", "function tokenizer(term) {\n if (!term) {\n return [];\n }\n\n var tokens = [term];\n var meth = term.indexOf('::');\n\n // Split tokens into methods if \"::\" is found.\n if (meth > -1) {\n tokens.push(term.substr(meth + 2));\n term = term.substr(0, meth - 2);\n }\n\n // Split by namespace or fake namespace.\n if (term.indexOf('\\\\') > -1) {\n tokens = tokens.concat(term.split('\\\\'));\n } else if (term.indexOf('_') > 0) {\n tokens = tokens.concat(term.split('_'));\n }\n\n // Merge in splitting the string by case and return\n tokens = tokens.concat(term.match(/(([A-Z]?[^A-Z]*)|([a-z]?[^a-z]*))/g).slice(0,-1));\n\n return tokens;\n }", "function tokenizer(term) {\n if (!term) {\n return [];\n }\n\n var tokens = [term];\n var meth = term.indexOf('::');\n\n // Split tokens into methods if \"::\" is found.\n if (meth > -1) {\n tokens.push(term.substr(meth + 2));\n term = term.substr(0, meth - 2);\n }\n\n // Split by namespace or fake namespace.\n if (term.indexOf('\\\\') > -1) {\n tokens = tokens.concat(term.split('\\\\'));\n } else if (term.indexOf('_') > 0) {\n tokens = tokens.concat(term.split('_'));\n }\n\n // Merge in splitting the string by case and return\n tokens = tokens.concat(term.match(/(([A-Z]?[^A-Z]*)|([a-z]?[^a-z]*))/g).slice(0,-1));\n\n return tokens;\n }", "function tokenizer(term) {\n if (!term) {\n return [];\n }\n\n var tokens = [term];\n var meth = term.indexOf('::');\n\n // Split tokens into methods if \"::\" is found.\n if (meth > -1) {\n tokens.push(term.substr(meth + 2));\n term = term.substr(0, meth - 2);\n }\n\n // Split by namespace or fake namespace.\n if (term.indexOf('\\\\') > -1) {\n tokens = tokens.concat(term.split('\\\\'));\n } else if (term.indexOf('_') > 0) {\n tokens = tokens.concat(term.split('_'));\n }\n\n // Merge in splitting the string by case and return\n tokens = tokens.concat(term.match(/(([A-Z]?[^A-Z]*)|([a-z]?[^a-z]*))/g).slice(0,-1));\n\n return tokens;\n }", "function tokenizer(term) {\n if (!term) {\n return [];\n }\n\n var tokens = [term];\n var meth = term.indexOf('::');\n\n // Split tokens into methods if \"::\" is found.\n if (meth > -1) {\n tokens.push(term.substr(meth + 2));\n term = term.substr(0, meth - 2);\n }\n\n // Split by namespace or fake namespace.\n if (term.indexOf('\\\\') > -1) {\n tokens = tokens.concat(term.split('\\\\'));\n } else if (term.indexOf('_') > 0) {\n tokens = tokens.concat(term.split('_'));\n }\n\n // Merge in splitting the string by case and return\n tokens = tokens.concat(term.match(/(([A-Z]?[^A-Z]*)|([a-z]?[^a-z]*))/g).slice(0,-1));\n\n return tokens;\n }", "function tokenizer(term) {\n if (!term) {\n return [];\n }\n\n var tokens = [term];\n var meth = term.indexOf('::');\n\n // Split tokens into methods if \"::\" is found.\n if (meth > -1) {\n tokens.push(term.substr(meth + 2));\n term = term.substr(0, meth - 2);\n }\n\n // Split by namespace or fake namespace.\n if (term.indexOf('\\\\') > -1) {\n tokens = tokens.concat(term.split('\\\\'));\n } else if (term.indexOf('_') > 0) {\n tokens = tokens.concat(term.split('_'));\n }\n\n // Merge in splitting the string by case and return\n tokens = tokens.concat(term.match(/(([A-Z]?[^A-Z]*)|([a-z]?[^a-z]*))/g).slice(0,-1));\n\n return tokens;\n }", "function tokenizer(term) {\n if (!term) {\n return [];\n }\n\n var tokens = [term];\n var meth = term.indexOf('::');\n\n // Split tokens into methods if \"::\" is found.\n if (meth > -1) {\n tokens.push(term.substr(meth + 2));\n term = term.substr(0, meth - 2);\n }\n\n // Split by namespace or fake namespace.\n if (term.indexOf('\\\\') > -1) {\n tokens = tokens.concat(term.split('\\\\'));\n } else if (term.indexOf('_') > 0) {\n tokens = tokens.concat(term.split('_'));\n }\n\n // Merge in splitting the string by case and return\n tokens = tokens.concat(term.match(/(([A-Z]?[^A-Z]*)|([a-z]?[^a-z]*))/g).slice(0,-1));\n\n return tokens;\n }", "function tokenizer(term) {\n if (!term) {\n return [];\n }\n\n var tokens = [term];\n var meth = term.indexOf('::');\n\n // Split tokens into methods if \"::\" is found.\n if (meth > -1) {\n tokens.push(term.substr(meth + 2));\n term = term.substr(0, meth - 2);\n }\n\n // Split by namespace or fake namespace.\n if (term.indexOf('\\\\') > -1) {\n tokens = tokens.concat(term.split('\\\\'));\n } else if (term.indexOf('_') > 0) {\n tokens = tokens.concat(term.split('_'));\n }\n\n // Merge in splitting the string by case and return\n tokens = tokens.concat(term.match(/(([A-Z]?[^A-Z]*)|([a-z]?[^a-z]*))/g).slice(0,-1));\n\n return tokens;\n }", "function tokenizer(term) {\n if (!term) {\n return [];\n }\n\n var tokens = [term];\n var meth = term.indexOf('::');\n\n // Split tokens into methods if \"::\" is found.\n if (meth > -1) {\n tokens.push(term.substr(meth + 2));\n term = term.substr(0, meth - 2);\n }\n\n // Split by namespace or fake namespace.\n if (term.indexOf('\\\\') > -1) {\n tokens = tokens.concat(term.split('\\\\'));\n } else if (term.indexOf('_') > 0) {\n tokens = tokens.concat(term.split('_'));\n }\n\n // Merge in splitting the string by case and return\n tokens = tokens.concat(term.match(/(([A-Z]?[^A-Z]*)|([a-z]?[^a-z]*))/g).slice(0,-1));\n\n return tokens;\n }", "function tokenizer(term) {\n if (!term) {\n return [];\n }\n\n var tokens = [term];\n var meth = term.indexOf('::');\n\n // Split tokens into methods if \"::\" is found.\n if (meth > -1) {\n tokens.push(term.substr(meth + 2));\n term = term.substr(0, meth - 2);\n }\n\n // Split by namespace or fake namespace.\n if (term.indexOf('\\\\') > -1) {\n tokens = tokens.concat(term.split('\\\\'));\n } else if (term.indexOf('_') > 0) {\n tokens = tokens.concat(term.split('_'));\n }\n\n // Merge in splitting the string by case and return\n tokens = tokens.concat(term.match(/(([A-Z]?[^A-Z]*)|([a-z]?[^a-z]*))/g).slice(0,-1));\n\n return tokens;\n }", "function tokenizer(term) {\n if (!term) {\n return [];\n }\n\n var tokens = [term];\n var meth = term.indexOf('::');\n\n // Split tokens into methods if \"::\" is found.\n if (meth > -1) {\n tokens.push(term.substr(meth + 2));\n term = term.substr(0, meth - 2);\n }\n\n // Split by namespace or fake namespace.\n if (term.indexOf('\\\\') > -1) {\n tokens = tokens.concat(term.split('\\\\'));\n } else if (term.indexOf('_') > 0) {\n tokens = tokens.concat(term.split('_'));\n }\n\n // Merge in splitting the string by case and return\n tokens = tokens.concat(term.match(/(([A-Z]?[^A-Z]*)|([a-z]?[^a-z]*))/g).slice(0,-1));\n\n return tokens;\n }", "function tokenizer(term) {\n if (!term) {\n return [];\n }\n\n var tokens = [term];\n var meth = term.indexOf('::');\n\n // Split tokens into methods if \"::\" is found.\n if (meth > -1) {\n tokens.push(term.substr(meth + 2));\n term = term.substr(0, meth - 2);\n }\n\n // Split by namespace or fake namespace.\n if (term.indexOf('\\\\') > -1) {\n tokens = tokens.concat(term.split('\\\\'));\n } else if (term.indexOf('_') > 0) {\n tokens = tokens.concat(term.split('_'));\n }\n\n // Merge in splitting the string by case and return\n tokens = tokens.concat(term.match(/(([A-Z]?[^A-Z]*)|([a-z]?[^a-z]*))/g).slice(0,-1));\n\n return tokens;\n }", "function tokenizer(term) {\n if (!term) {\n return [];\n }\n\n var tokens = [term];\n var meth = term.indexOf('::');\n\n // Split tokens into methods if \"::\" is found.\n if (meth > -1) {\n tokens.push(term.substr(meth + 2));\n term = term.substr(0, meth - 2);\n }\n\n // Split by namespace or fake namespace.\n if (term.indexOf('\\\\') > -1) {\n tokens = tokens.concat(term.split('\\\\'));\n } else if (term.indexOf('_') > 0) {\n tokens = tokens.concat(term.split('_'));\n }\n\n // Merge in splitting the string by case and return\n tokens = tokens.concat(term.match(/(([A-Z]?[^A-Z]*)|([a-z]?[^a-z]*))/g).slice(0,-1));\n\n return tokens;\n }", "function Tokenizer(str) {\n this._str = str;\n this.pos = 0;\n}", "tokenTypes(){ return [] }", "function it(type, value, quote) {\n var id, the_token;\n if (type === '(string)' || type === '(range)') {\n if (jx.test(value)) {\n warn_at(bundle.url, line, from);\n }\n }\n the_token = Object.create(syntax[(\n type === '(punctuator)' ||\n (type === '(identifier)' && is_own(syntax, value)) ?\n value :\n type\n )] || syntax['(error)']);\n if (type === '(identifier)') {\n the_token.identifier = true;\n if (value === '__iterator__' || value === '__proto__') {\n fail_at(bundle.reserved_a, line, from, value);\n } else if (option.nomen &&\n (value.charAt(0) === '_' ||\n value.charAt(value.length - 1) === '_')) {\n warn_at(bundle.dangling_a, line, from, value);\n }\n }\n if (value !== undefined) {\n the_token.value = value;\n }\n if (quote) {\n the_token.quote = quote;\n }\n if (comments) {\n the_token.comments = comments;\n comments = null;\n }\n the_token.line = line;\n the_token.from = from;\n the_token.thru = character;\n the_token.prev = older_token;\n id = the_token.id;\n prereg = id && (\n ('(,=:[!&|?{};'.indexOf(id.charAt(id.length - 1)) >= 0) ||\n id === 'return'\n );\n older_token.next = the_token;\n older_token = the_token;\n return the_token;\n }", "static getTokenizer() {\n return theTokenizer;\n }", "function sc_Token(type, val, pos) {\n this.type = type;\n this.val = val;\n this.pos = pos;\n}", "isTokenType(type) { return this.lexeme[type] !== undefined }", "makeToken(type, literal, length) {\n let pos = this.pos;\n if(length === 0 && type !== this.Token.$EOF) {\n length = 1;\n type = this.Token.$Error;\n literal = 0;\n }\n let start = { line: this.line, col: pos - this.linepos };\n if(type === this.Token.$Error) {\n this.linetok = this.line;\n this.linetokpos = this.linepos;\n } else {\n this.line = this.linetok;\n this.linepos = this.linetokpos;\n }\n this.forward(length);\n let end = { line: this.line, col: this.pos - this.linepos};\n return new Token(type, literal, this.input, pos, length, start, end);\n }", "function it(type, value) {\n var id, the_token;\n if (type === '(string)') {\n if (jx.test(value)) {\n warn('url', line, from);\n }\n }\n the_token = Object.create(syntax[(\n type === '(punctuator)' || (type === '(identifier)' &&\n Object.prototype.hasOwnProperty.call(syntax, value))\n ? value\n : type\n )] || syntax['(error)']);\n if (type === '(identifier)') {\n the_token.identifier = true;\n if (value === '__iterator__' || value === '__proto__') {\n stop('reserved_a', line, from, value);\n } else if (!option.nomen &&\n (value.charAt(0) === '_' ||\n value.charAt(value.length - 1) === '_')) {\n warn('dangling_a', line, from, value);\n }\n }\n if (type === '(number)') {\n the_token.number = +value;\n } else if (value !== undefined) {\n the_token.string = String(value);\n }\n the_token.line = line;\n the_token.from = from;\n the_token.thru = character;\n if (comments.length) {\n the_token.comments = comments;\n comments = [];\n }\n id = the_token.id;\n prereg = id && (\n ('(,=:[!&|?{};~+-*%^<>'.indexOf(id.charAt(id.length - 1)) >= 0) ||\n id === 'return' || id === 'case'\n );\n return the_token;\n }", "static makeTokenizer(literals, input) {\n if (theTokenizer === null) {\n theTokenizer = new tokenizer(literals, input);\n }\n }", "function tokenizer(input) {\n const singleTokensSpecs = [\n { char: '=', tokenType: 'equal' },\n { char: '*', tokenType: 'star' },\n { char: '!', tokenType: 'not' },\n { char: '[', tokenType: 'bracket' },\n { char: ']', tokenType: 'bracket' },\n { char: '-', tokenType: 'minus' },\n { char: '+', tokenType: 'plus' },\n { char: '\\\\', tokenType: 'backslash' },\n { char: '/', tokenType: 'forwardslash' },\n { char: '.', tokenType: 'dot' },\n { char: '<', tokenType: 'less' },\n { char: '>', tokenType: 'greater' },\n { char: '|', tokenType: 'pipe' },\n { char: '&', tokenType: 'and' },\n { char: '%', tokenType: 'percent' },\n { char: '^', tokenType: 'caret' },\n { char: ',', tokenType: 'comma' },\n { char: ';', tokenType: 'semi' },\n { char: '~', tokenType: 'tilde' },\n { char: '`', tokenType: 'grave' },\n { char: '(', tokenType: 'paren' },\n { char: ')', tokenType: 'paren' },\n { char: ':', tokenType: 'colon' },\n { char: '{', tokenType: 'curly' },\n { char: '}', tokenType: 'curly' },\n { char: '#', tokenType: 'SPECIAL' }\n ];\n const regexSingleTokensSpecs = [\n {\n start: /^(\\/\\/.*)/,\n tokenType: 'NONE',\n addLength: 0\n },\n {\n start: /^([\\s\\t\\n]+)/,\n tokenType: 'NONE',\n addLength: 0\n },\n {\n start: /^(\\d[\\d_]*\\b)/,\n tokenType: 'numberDec',\n addLength: 0\n },\n {\n start: /^0[xX]([\\da-fA-F][\\da-fA-F_]*\\b)/,\n tokenType: 'numberHex',\n addLength: 2\n },\n {\n start: /^(break|const|continue|do|else|exit|for|goto|halt|if|long|return|sleep|struct|void|while)/,\n tokenType: 'keyword',\n addLength: 0\n },\n {\n start: /^(asm)/,\n tokenType: 'SPECIAL',\n addLength: 0\n },\n {\n start: /^(\\w+)/,\n tokenType: 'variable',\n addLength: 0\n }\n ];\n const regexDoubleTokensSpecs = [\n {\n start: /^\\/\\*/,\n end: /([\\s\\S]*?\\*\\/)/,\n tokenType: 'NONE',\n startLength: 2,\n removeTrailing: 0,\n errorMsg: \"Missing '*/' to end comment section.\"\n },\n {\n start: /^\"/,\n end: /([\\s\\S]*?\")/,\n tokenType: 'string',\n startLength: 1,\n removeTrailing: 1,\n errorMsg: \"Missing '\\\"' to end string.\"\n },\n {\n start: /^'/,\n end: /([\\s\\S]*?')/,\n tokenType: 'string',\n startLength: 1,\n removeTrailing: 1,\n errorMsg: \"Missing \\\"'\\\" to end string.\"\n }\n ];\n let currentChar, remainingText;\n let current = 0;\n const tokens = [];\n let currentLine = 1;\n while (current < input.length) {\n currentChar = input.charAt(current);\n remainingText = input.slice(current);\n // Resolve double regex tokens\n const found = regexDoubleTokensSpecs.find(ruleN => {\n const startParts = ruleN.start.exec(remainingText);\n if (startParts != null) {\n const endParts = ruleN.end.exec(remainingText.slice(ruleN.startLength));\n current += ruleN.startLength;\n if (endParts !== null) {\n if (ruleN.tokenType === 'NONE') {\n currentLine += (endParts[1].match(/\\n/g) || '').length;\n current += endParts[1].length;\n return true; // breaks find function\n }\n tokens.push({ type: ruleN.tokenType, value: endParts[1].slice(0, -ruleN.removeTrailing), line: currentLine });\n currentLine += (endParts[1].match(/\\n/g) || '').length;\n current += endParts[1].length;\n return true; // breaks find function\n }\n throw new TypeError(`At line: ${currentLine}. ${ruleN.errorMsg}`);\n }\n return false;\n });\n if (found !== undefined) {\n // item already processed\n continue;\n }\n // Resolve single regex tokens\n const found2 = regexSingleTokensSpecs.find(ruleN => {\n const startParts = ruleN.start.exec(remainingText);\n if (startParts != null) {\n if (ruleN.tokenType === 'NONE') {\n currentLine += (startParts[1].match(/\\n/g) || '').length;\n current += startParts[1].length + ruleN.addLength;\n return true; // breaks find function\n }\n if (ruleN.tokenType === 'SPECIAL') {\n // handle asm case\n const asmParts = /^(asm[^\\w]*\\{([\\s\\S]*?)\\})/.exec(remainingText);\n if (asmParts === null) {\n throw new TypeError('At line:' + currentLine + ' Error parsing `asm { ... }` keyword');\n }\n tokens.push({ type: 'keyword', value: 'asm', line: currentLine, asmText: asmParts[2] });\n currentLine += (asmParts[1].match(/\\n/g) || '').length;\n current += asmParts[1].length;\n return true; // breaks find function\n }\n tokens.push({ type: ruleN.tokenType, value: startParts[1], line: currentLine });\n currentLine += (startParts[1].match(/\\n/g) || '').length;\n current += startParts[1].length + ruleN.addLength;\n return true; // breaks find function\n }\n return false;\n });\n if (found2 !== undefined) {\n continue;\n }\n // Resolve all single tokens\n const search = singleTokensSpecs.find(charDB => charDB.char === currentChar);\n if (search !== undefined) {\n if (search.tokenType === 'NONE') {\n current++;\n continue;\n }\n else if (search.tokenType === 'SPECIAL') {\n if (search.char === '#') {\n current++;\n const lines = input.slice(current).split('\\n');\n let i = 0;\n let val = '';\n for (; i < lines.length; i++) {\n val += lines[i];\n current += lines[i].length + 1; // newline!\n currentLine++;\n if (lines[i].endsWith('\\\\')) {\n val = val.slice(0, -1);\n continue;\n }\n break;\n }\n tokens.push({ type: 'macro', value: val, line: currentLine - i - 1 });\n continue;\n }\n throw new TypeError(`At line: ${currentLine}. SPECIAL rule not implemented in tokenizer().`);\n }\n tokens.push({ type: search.tokenType, value: currentChar, line: currentLine });\n current++;\n continue;\n }\n throw new TypeError(`At line: ${currentLine}. Forbidden character found: '${currentChar}'.`);\n }\n return tokens;\n}", "function tokenizer(input, options) {\n return Parser.tokenizer(input, options)\n }", "function tokenizer(input, options) {\n return Parser.tokenizer(input, options)\n }", "function tokenizer(input, options) {\n return Parser.tokenizer(input, options)\n }", "token(input, start, end, value) { return new Token(input, start, end, this.type, value) }", "token(input, start, value) { return new Token(input,start,input.pos,this.type,value) }", "_eat(tokenType) {\n const token = this._lookahead;\n\n if (token === null) {\n throw new SyntaxError(\n `Unexpected end of input, expected: \"${tokenType}\"`,\n );\n }\n\n if (token.type !== tokenType) {\n throw new SyntaxError(\n `Unexpected token: \"${token.value}\", expected: \"${tokenType}\"`,\n );\n }\n\n // Advance to next token.\n this._lookahead = this._tokenizer.getNextToken();\n\n return token;\n }", "function GenTokenParser(){}", "typeToken() {\n let typeToken;\n if (this.checkAny(...TokenKind_1.DeclarableTypes)) {\n // Token is a built in type\n typeToken = this.advance();\n }\n else if (this.options.mode === ParseMode.BrighterScript) {\n try {\n // see if we can get a namespaced identifer\n const qualifiedType = this.getNamespacedVariableNameExpression();\n typeToken = (0, creators_1.createToken)(TokenKind_1.TokenKind.Identifier, qualifiedType.getName(this.options.mode), qualifiedType.range);\n }\n catch (_a) {\n //could not get an identifier - just get whatever's next\n typeToken = this.advance();\n }\n }\n else {\n // just get whatever's next\n typeToken = this.advance();\n }\n return typeToken;\n }", "function tokenType(source) {\n switch (source) {\n case BOM:\n return 'byte-order-mark';\n case DOCUMENT:\n return 'doc-mode';\n case FLOW_END:\n return 'flow-error-end';\n case SCALAR:\n return 'scalar';\n case '---':\n return 'doc-start';\n case '...':\n return 'doc-end';\n case '':\n case '\\n':\n case '\\r\\n':\n return 'newline';\n case '-':\n return 'seq-item-ind';\n case '?':\n return 'explicit-key-ind';\n case ':':\n return 'map-value-ind';\n case '{':\n return 'flow-map-start';\n case '}':\n return 'flow-map-end';\n case '[':\n return 'flow-seq-start';\n case ']':\n return 'flow-seq-end';\n case ',':\n return 'comma';\n }\n switch (source[0]) {\n case ' ':\n case '\\t':\n return 'space';\n case '#':\n return 'comment';\n case '%':\n return 'directive-line';\n case '*':\n return 'alias';\n case '&':\n return 'anchor';\n case '!':\n return 'tag';\n case \"'\":\n return 'single-quoted-scalar';\n case '\"':\n return 'double-quoted-scalar';\n case '|':\n case '>':\n return 'block-scalar-header';\n }\n return null;\n}", "function tokenType(source) {\n switch (source) {\n case BOM:\n return 'byte-order-mark';\n case DOCUMENT:\n return 'doc-mode';\n case FLOW_END:\n return 'flow-error-end';\n case SCALAR:\n return 'scalar';\n case '---':\n return 'doc-start';\n case '...':\n return 'doc-end';\n case '':\n case '\\n':\n case '\\r\\n':\n return 'newline';\n case '-':\n return 'seq-item-ind';\n case '?':\n return 'explicit-key-ind';\n case ':':\n return 'map-value-ind';\n case '{':\n return 'flow-map-start';\n case '}':\n return 'flow-map-end';\n case '[':\n return 'flow-seq-start';\n case ']':\n return 'flow-seq-end';\n case ',':\n return 'comma';\n }\n switch (source[0]) {\n case ' ':\n case '\\t':\n return 'space';\n case '#':\n return 'comment';\n case '%':\n return 'directive-line';\n case '*':\n return 'alias';\n case '&':\n return 'anchor';\n case '!':\n return 'tag';\n case \"'\":\n return 'single-quoted-scalar';\n case '\"':\n return 'double-quoted-scalar';\n case '|':\n case '>':\n return 'block-scalar-header';\n }\n return null;\n }", "function emitToken(type, value, prefix, line, length) {\n const start = input ? currentLineLength - input.length : currentLineLength;\n const end = start + length;\n const token = {\n type,\n value,\n prefix,\n line,\n start,\n end\n };\n callback(null, token);\n return token;\n }", "finishToken(type, val) {\n if (val === undefined) val = type.label;\n let prevType = this.state.lex.type;\n this.finishTokenLex(type, val);\n this.updateContext(type, prevType);\n\n if (type === tt.indent) ++this.state.indentation;\n else if (type === tt.dedent) --this.state.indentation;\n\n let token = Token.fromState(this.state.lex);\n\n this.endToken(token);\n\n // Lookahead to see if the newline should actually be ignored, and ignore it if so\n if (token.type === tt.newline) {\n let nextToken = this.readNextToken();\n\n if (nextToken.type.continuesPreviousLine) {\n // convert newline token to whitespace, for sourceElementsTokens\n token.type = tt.whitespace;\n token.value = {code: this.input.slice(token.start, token.end)};\n // TODO: coalesce sequential whitespace sourceElements\n\n // remove newline from concrete tokens\n this.assert(this.state.tokens.pop() === nextToken);\n this.assert(this.state.tokens.pop() === token);\n this.state.tokens.push(nextToken);\n token = nextToken;\n token.meta.continuedPreviousLine = true;\n }\n }\n\n return token;\n }", "constructor(type, word) {\n super()\n this.word = word\n this.type = type\n }", "function BBCodeParser_Token(type, content, argument) {\r\n\r\n\t\tthis.type = BBCodeParser_Token.NONE;\r\n\t\tthis.stat = BBCodeParser_Token.UNDETERMINED;\r\n\t\tthis.content = '';\r\n\t\tthis.argument = null;\r\n\t\tthis.matches = null; // matching start/end code index\r\n\r\n\t\tif(argument === undefined) argument = null;\r\n\t\tthis.type = type;\r\n\t\tthis.content = content;\r\n\t\tthis.stat = (this.type === BBCodeParser_Token.CONTENT)? BBCodeParser_Token.VALID : BBCodeParser_Token.UNDETERMINED;\r\n\t\tthis.argument = argument;\r\n\r\n\t}", "function typenize (type)\n {\n let typewords = type.split(' ');\n\n if (typewords.length === 1)\n {\n if (typewords[0] === 'Integer' || typewords[0] === 'Float')\n return 'number';\n\n else if (typewords[0] === 'String')\n return 'string';\n\n else if (typewords[0] === 'Boolean' || typewords[0] === 'True' || typewords[0] === 'False')\n return 'boolean';\n \n else if (typewords[0] === 'InputFile')\n return '{ name: string, data: Buffer }';\n\n else if (typewords[0] === 'CallbackGame')\n return 'any';\n\n else\n return typewords[0];\n }\n\n else if (typewords.length === 3)\n {\n if (typewords[0] === 'Array' && typewords[1] === 'of')\n return 'Array<' + typenize(typewords[2]) + '>';\n\n else if (typewords[1] === 'or')\n return typenize(typewords[0]) + ' | ' + typenize(typewords[2]);\n }\n\n return 'any';\n }", "function finishToken(\n type,\n contextualKeyword = ContextualKeyword.NONE,\n) {\n state.end = state.pos;\n state.type = type;\n state.contextualKeyword = contextualKeyword;\n}", "function finishToken(\n type,\n contextualKeyword = _keywords.ContextualKeyword.NONE,\n) {\n _base.state.end = _base.state.pos;\n _base.state.type = type;\n _base.state.contextualKeyword = contextualKeyword;\n}", "function DirectiveType() {}", "findTokenType(type) {\n let token = this.findToken();\n if(token.type != type) {\n this.unexpectedToken(token);\n }\n return token;\n }", "isTokenType(type){ return false }", "function tokenize() {\n return input\n .replace(/\\t/g, \"\")\n .split(/\\s+/)\n .map(str => str.trim())\n .filter(str => str.length)\n .filter(str => validateAgainstSpec(str));\n }", "function filterTokens(params, type, callback) {\n params.tokens.forEach(function forToken(token) {\n if (token.type === type) {\n callback(token);\n }\n });\n}", "function tokenizer(input, options) {\n return Parser.tokenizer(input, options)\n}", "function tokenizer(input, options) {\n return Parser.tokenizer(input, options)\n}", "function tokenizer(input, options) {\n return Parser.tokenizer(input, options)\n}", "function tokenizer(input, options) {\n return Parser.tokenizer(input, options)\n}", "function tokenizer(input, options) {\n return Parser.tokenizer(input, options)\n}", "function tokenizer(input, options) {\n return Parser.tokenizer(input, options)\n}", "function tokenizer(input, options) {\n return Parser.tokenizer(input, options)\n}", "function tokenizer () {\n return split(/(<\\/?[\\w\\d-_]+>)/)\n}", "function parse_type() {\n tree.addNode('type', 'branch');\n if (foundTokensCopy[parseCounter][1] == 'int') {\n match('int', parseCounter);\n parseCounter++;\n } else if (foundTokensCopy[parseCounter][1] == 'string') {\n match('string', parseCounter);\n parseCounter++;\n } else if (foundTokensCopy[parseCounter][1] == 'boolean') {\n match('boolean', parseCounter);\n parseCounter++;\n }\n tree.endChildren();\n\n}", "tokenize(buf, off, len, line, column) {\n this._reset(line, column);\n\n let parseState = START;\n for (let i = 0; i < len; i += 1) {\n const c = buf[off + i];\n switch (parseState) {\n case START:\n if (c === '<') {\n parseState = TAG;\n }\n break;\n case TAG:\n if (c === '/') {\n this.endTag = true;\n parseState = NAME;\n } else if (c === '\"' || c === '\\'') {\n this.quoteChar = c;\n parseState = STRING;\n } else if (isWhitespace(c)) {\n parseState = INSIDE;\n } else {\n this.tagName += c;\n parseState = NAME;\n }\n break;\n case NAME:\n if (isWhitespace(c)) {\n parseState = INSIDE;\n } else if (c === '\"' || c === '\\'') {\n this.quoteChar = c;\n parseState = STRING;\n } else if (c === '>') {\n parseState = END;\n } else if (c === '/') {\n parseState = ENDSLASH;\n } else {\n this.tagName += c;\n }\n break;\n case INSIDE:\n if (c === '>') {\n this._attributeEnded();\n parseState = END;\n } else if (c === '/') {\n this._attributeEnded();\n parseState = ENDSLASH;\n } else if (c === '\"' || c === '\\'') {\n this._attributeValueStarted();\n this.quoteChar = c;\n parseState = STRING;\n } else if (c === '=') {\n parseState = EQUAL;\n } else if (!isWhitespace(c)) {\n this.attName += c;\n parseState = ATTNAME;\n }\n break;\n case ATTNAME:\n if (c === '>') {\n this._attributeEnded();\n parseState = END;\n } else if (c === '/') {\n this._attributeEnded();\n parseState = ENDSLASH;\n } else if (c === '=') {\n parseState = EQUAL;\n } else if (c === '\"' || c === '\\'') {\n this.quoteChar = c;\n parseState = STRING;\n } else if (isWhitespace(c)) {\n parseState = BETWEEN_ATTNAME;\n } else {\n this.attName += c;\n }\n break;\n case BETWEEN_ATTNAME:\n if (c === '>') {\n this._attributeEnded();\n parseState = END;\n } else if (c === '/') {\n this._attributeEnded();\n parseState = ENDSLASH;\n } else if (c === '\"' || c === '\\'') {\n this._attributeValueStarted();\n this.quoteChar = c;\n parseState = STRING;\n } else if (c === '=') {\n parseState = EQUAL;\n } else if (!isWhitespace(c)) {\n this._attributeEnded();\n this.attName += c;\n parseState = ATTNAME;\n }\n break;\n case EQUAL:\n if (c === '>') {\n this._attributeEnded();\n parseState = END;\n } else if (c === '\"' || c === '\\'') {\n this._attributeValueStarted();\n this.quoteChar = c;\n parseState = STRING;\n } else if (!isWhitespace(c)) {\n this._attributeValueStarted();\n this.attValue += c;\n parseState = ATTVALUE;\n }\n break;\n case ATTVALUE:\n if (isWhitespace(c)) {\n this._attributeEnded();\n parseState = INSIDE;\n } else if (c === '\"' || c === '\\'') {\n this._attributeEnded();\n this.quoteChar = c;\n parseState = STRING;\n } else if (c === '>') {\n this._attributeEnded();\n parseState = END;\n } else {\n this.attValue += c;\n }\n break;\n case STRING:\n if (c === this.quoteChar) {\n this._attributeEnded();\n parseState = INSIDE;\n } else {\n this.attValue += (c);\n }\n break;\n case ENDSLASH:\n if (c === '>') {\n this.endSlash = true;\n parseState = END;\n } else if (c === '\"' || c === '\\'') {\n this.quoteChar = c;\n parseState = STRING;\n } else if (c !== '/' && !isWhitespace(c)) {\n this.attName += c;\n parseState = ATTNAME;\n } else {\n parseState = INSIDE;\n }\n break;\n case END:\n break;\n default:\n throw new Error('Unexpected parse state');\n }\n if (c === '\\n') {\n this.line += 1;\n this.column = 0;\n } else {\n this.column += 1;\n }\n }\n return this;\n }", "function DirectiveType(){}", "addTag(token, type = undefined, word) {\n if (!token) {\n switch (type) {\n case \"if\":\n return <syn className=\"if\">{word}</syn>;\n case \"func\":\n return <syn className=\"func\">{word}</syn>;\n case \"comm\":\n return <syn className=\"comm\">{word}</syn>;\n default:\n return <syn className=\"default\">{word}</syn>;\n }\n } else {\n switch (token) {\n case \"comm\":\n return <syn className=\"comm\">//</syn>;\n case \"semic\":\n return <syn className=\"semic\">;</syn>;\n case \"lparen\":\n return <syn className=\"paren\">(</syn>;\n case \"rparen\":\n return <syn className=\"paren\">)</syn>;\n case \"lbrack\":\n return <syn className=\"brack\">{\"{\"}</syn>;\n case \"rbrack\":\n return <syn className=\"brack\">{\"}\"}</syn>;\n case \"dquote\":\n return <syn className=\"dquote\">{'\"'}</syn>;\n case \"squote\":\n return <syn className=\"squote\">{\"'\"}</syn>;\n case \"dot\":\n return <syn className=\"dot\">.</syn>;\n case \"lsq\":\n return <syn className=\"sq\">[</syn>;\n case \"rsq\":\n return <syn className=\"sq\">]</syn>;\n case \"eq\":\n return <syn className=\"eq\">=</syn>;\n case \"plus\":\n return <syn className=\"plus\">+</syn>;\n }\n }\n }", "function parseTypeName() {\n var expr, applications, startIndex = index - value.length;\n\n expr = parseNameExpression();\n if (token === Token.DOT_LT || token === Token.LT) {\n next();\n applications = parseTypeExpressionList();\n expect(Token.GT);\n return maybeAddRange({\n type: Syntax.TypeApplication,\n expression: expr,\n applications: applications\n }, [startIndex, previous]);\n }\n return expr;\n }", "tokenize(input, ruleName) {\n const tokens = super.tokenize(input)\n if (typeof input === \"string\" && ruleName === \"block\") return this.tokenizer.breakIntoBlocks(tokens)\n return tokens\n }", "tokenBefore(types) {\n let token = language.syntaxTree(this.state).resolveInner(this.pos, -1);\n while (token && types.indexOf(token.name) < 0)\n token = token.parent;\n return token ? { from: token.from, to: this.pos,\n text: this.state.sliceDoc(token.from, this.pos),\n type: token.type } : null;\n }", "addToken(type, range) {\n const token = Object.assign({ type, value: this.code.slice(...range) }, this.getConvertLocation(...range));\n this.tokens.push(token);\n return token;\n }", "function _Token(type, token, pos, string) {\n return { type: type, token: token, pos: pos, string: string };\n}", "function Token(type, text, newlines, whitespace_before, parent) {\n this.type = type;\n this.text = text;\n\n // comments_before are\n // comments that have a new line before them\n // and may or may not have a newline after\n // this is a set of comments before\n this.comments_before = /* inline comment*/ [];\n\n\n this.comments_after = []; // no new line before and newline after\n this.newlines = newlines || 0;\n this.wanted_newline = newlines > 0;\n this.whitespace_before = whitespace_before || '';\n this.parent = parent || null;\n this.opened = null;\n this.directives = null;\n}", "get delim () {\n return delim[type]\n }", "function tokenTypes(n) {\r\n\tif (n.parent) {\r\n\t\tvar tt = [n.type];\r\n\t\treturn tt.concat(tokenTypes(n.parent));\r\n } else {\r\n \treturn n.type;\r\n\t}\r\n}", "getDirectiveBoundTarget() {\n if (this.next === EOF || this.peekKeywordAs() || this.peekKeywordLet()) {\n return null;\n }\n const ast = this.parsePipe(); // example: \"condition | async\"\n const { start, end } = ast.span;\n const value = this.input.substring(start, end);\n return new ASTWithSource(ast, value, this.location, this.absoluteOffset + start, this.errors);\n }", "getDirectiveBoundTarget() {\n if (this.next === EOF || this.peekKeywordAs() || this.peekKeywordLet()) {\n return null;\n }\n const ast = this.parsePipe(); // example: \"condition | async\"\n const { start, end } = ast.span;\n const value = this.input.substring(start, end);\n return new ASTWithSource(ast, value, this.location, this.absoluteOffset + start, this.errors);\n }", "function fType(type) {\n\t\tif (directives.indexOf(type) > -1) {\n\t\t\treturn '@' + type;\n\t\t}\n\n\t\treturn type;\n\t}", "function Token (type, children, text) {\n this.type = type\n\n if (children) {\n this.children = children\n }\n\n if (text) {\n this.text = text\n }\n }", "function JSONTokenizer(callback){\n\tthis.stack = [];\n\tthis.valFragment = \"\";\n\tthis.escapeState = null;\n\tthis.firstSurrogate = null;\n\tthis.topFn = this.processA;\n\tthis.curString = null;\n\tthis.curKey = null;\n\n\tthis.curState = \"\";\n\treturn this;\n}" ]
[ "0.64397955", "0.64397955", "0.64397955", "0.64397955", "0.64397955", "0.63414675", "0.6329742", "0.6018946", "0.5882375", "0.57774585", "0.57694155", "0.57543147", "0.5736293", "0.5672879", "0.5641096", "0.56112975", "0.5603829", "0.5583456", "0.5562897", "0.55435354", "0.5536896", "0.5536896", "0.5536896", "0.5536896", "0.5536896", "0.5536896", "0.5536896", "0.5536896", "0.5536896", "0.5536896", "0.5536896", "0.5536896", "0.5536896", "0.5536896", "0.5536896", "0.5536896", "0.5536896", "0.5536896", "0.5536896", "0.5536896", "0.5536896", "0.5536896", "0.5536896", "0.5536896", "0.5508124", "0.55071783", "0.546384", "0.5443194", "0.54365134", "0.54148704", "0.5345258", "0.53306097", "0.53190905", "0.5203234", "0.5191094", "0.5191094", "0.5191094", "0.5181715", "0.5178654", "0.5173766", "0.516982", "0.5159654", "0.51494217", "0.5143335", "0.51369274", "0.5135324", "0.5119405", "0.5115032", "0.5113241", "0.51129824", "0.5107877", "0.5103862", "0.5085159", "0.50787264", "0.50714254", "0.5032855", "0.50311726", "0.50311726", "0.50311726", "0.50311726", "0.50311726", "0.50311726", "0.50311726", "0.50204", "0.5013995", "0.5012679", "0.5001036", "0.49815765", "0.49803007", "0.49487194", "0.49439764", "0.49331394", "0.49221632", "0.49095196", "0.48976383", "0.48922879", "0.48875397", "0.48875397", "0.4886188", "0.48838985", "0.48767674" ]
0.0
-1
Update line, column, and offset based on `value`.
function updatePosition(subvalue) { var lastIndex = -1; var index = subvalue.indexOf('\n'); while (index !== -1) { line++; lastIndex = index; index = subvalue.indexOf('\n', index + 1); } if (lastIndex === -1) { column += subvalue.length; } else { column = subvalue.length - lastIndex; } if (line in offset) { if (lastIndex !== -1) { column += offset[line]; } else if (column <= offset[line]) { column = offset[line] + 1; } } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function updatePosition(subvalue) {\n var lastIndex = -1\n var index = subvalue.indexOf('\\n')\n\n while (index !== -1) {\n line++\n lastIndex = index\n index = subvalue.indexOf('\\n', index + 1)\n }\n\n if (lastIndex === -1) {\n column += subvalue.length\n } else {\n column = subvalue.length - lastIndex\n }\n\n if (line in offset) {\n if (lastIndex !== -1) {\n column += offset[line]\n } else if (column <= offset[line]) {\n column = offset[line] + 1\n }\n }\n }", "update(value) {\n let idx = this.valueToIdxMap.get(value);\n if (!this.moveUp(idx)) {\n this.moveDown(idx);\n }\n }", "set offset( value )\n {\n if ( typeof value === 'number' ) this.mOffsetInput.value = value;\n }", "_updateValue(row, column, newValue) {\n const that = this,\n oldValue = that._getValueInCell(row, column);\n\n if (!that._areDifferent(newValue, oldValue)) {\n return;\n }\n\n const dimensionValues = that._coordinates,\n actualIndexes = dimensionValues.slice(0),\n changedValueDimensions = [];\n\n if (that.arrayIndexingMode === 'LabVIEW') {\n actualIndexes[actualIndexes.length - 1] += column;\n actualIndexes[actualIndexes.length - 2] += row;\n }\n else {\n actualIndexes[0] += column;\n actualIndexes[1] += row;\n }\n\n for (let i = 0; i < that.dimensions; i++) {\n if (i === 0) { // x\n if (that._oneDimensionSpecialCase === false) {\n changedValueDimensions.push(actualIndexes[0]);\n }\n else {\n changedValueDimensions.push(row + dimensionValues[0]);\n }\n }\n else if (i === 1) { // y\n changedValueDimensions.push(actualIndexes[1]);\n }\n else { // other dimensions\n changedValueDimensions.push(actualIndexes[i]);\n }\n }\n\n let tempArr = that.value;\n\n for (let j = 0; j < changedValueDimensions.length; j++) {\n if (tempArr[changedValueDimensions[j]] === undefined || tempArr[changedValueDimensions[j]] === oldValue) {\n if (j !== changedValueDimensions.length - 1) {\n tempArr[changedValueDimensions[j]] = [];\n }\n else {\n tempArr[changedValueDimensions[j]] = newValue;\n }\n }\n tempArr = tempArr[changedValueDimensions[j]];\n }\n\n that._fillValueArray(changedValueDimensions.slice(0));\n\n that.$.fireEvent('change', { 'value': newValue, 'oldValue': oldValue, 'dimensionIndexes': changedValueDimensions });\n }", "setValue(value) {\n // Save old values in computeCell for comparison checks\n for (const computeCell of this.computeCells) {\n computeCell.saveValue();\n }\n this.value = value;\n this.onUpdate();\n }", "set Offset(value) {\n this._offset = value;\n }", "function setTailPosition(axis, value) {\n stringValue = String(value) + \"px\";\n $tail.css(axis, stringValue);\n}", "function updateCode(value) {\n\n if (codeMirror.getValue() !== value) {\n var anchor = codeMirror.getCursor(true), head = codeMirror.getCursor(false); // Backup original selection position\n if (cow.merging) {\n value = mergeStr(codeMirror.getValue()||\"\", value||\"\");\n // myChange = true;\n }\n codeMirror.setValue(value); // Set new value / contents\n codeMirror.setSelection(anchor, head); // Restore selection position\n codeMirror.setCursor(head.line, head.ch); // Restore cursor position\n }\n }", "function setCellPositon() {\n puzzleData.forEach((item, index) => {\n if (item.value) _move(item.el, index);\n })\n }", "function setPos(val) {\n RTG_VCF_RECORD.setStart(val - 1); // To internal zero-based\n }", "function test() {\n var result = pos({});\n\n line = current.line;\n column = current.column;\n value = subvalue + value;\n\n return result.position;\n }", "function test() {\n var result = pos({});\n\n line = current.line;\n column = current.column;\n value = subvalue + value;\n\n return result.position;\n }", "function test() {\n var result = pos({});\n\n line = current.line;\n column = current.column;\n value = subvalue + value;\n\n return result.position;\n }", "function test() {\n var result = pos({});\n\n line = current.line;\n column = current.column;\n value = subvalue + value;\n\n return result.position;\n }", "function test() {\n var result = pos({});\n\n line = current.line;\n column = current.column;\n value = subvalue + value;\n\n return result.position;\n }", "function test() {\n var result = pos({})\n\n line = current.line\n column = current.column\n value = subvalue + value\n\n return result.position\n }", "function updateVertexHeight(value, x, y, mesh, width){\n var i = getIdx(x, y, width);\n mesh.geometry.vertices[i].y = value;\n}", "function edit_table_row (source_table, information_str, value)\n{ \n idx = source_table.data ['x_data'].indexOf (information_str)\n if (idx >= 0) \n {\n source_table.data ['y_data'] [idx] = value;\n }\n}", "constructor(type, value, line, column) {\r\n this.type = type;\r\n this.value = value;\r\n this.line = line;\r\n this.column = column;\r\n }", "updateLineNumber(editor, fromLine, toLine) {\n const annotations = this.getAnnotations(editor, fromLine)\n return this._setAnnotations(\n editor,\n annotations.map(annotation => {\n return {\n ...annotation,\n lineNumber: toLine,\n }\n })\n )\n }", "_moveThumbBasedOnValue(value) {\n const that = this,\n px = that._numericProcessor.valueToPx(that._numericProcessor.getCoercedValue(value));\n\n that.updateFillSizeAndPosition(px, that._settings.margin, value, true);\n }", "set position(value) {\n this.position$.next(value);\n }", "function updateValue( value ) \n{\n \n updateComponentValue( value );\n \n}", "function setGridCellDev(grid, row, col, value)\n{\n // IGNORE IF IT'S OUTSIDE THE GRID\n if (!isValidCellDev(row, col))\n {\n return;\n }\n var index = (row * gridWidthDev) + col;\n grid[index] = value;\n}", "function consume() {\n // Line ending; assumes CR is not used (remark removes those).\n if (value.charCodeAt(index) === lineFeed) {\n place.line++\n place.column = 1\n }\n // Anything else.\n else {\n place.column++\n }\n\n index++\n\n place.offset++\n place.index = index\n }", "function setCell(x, y, value) {\n\t\t// If we're writing notes on an empty sqaure\n\t\tif (notes && value !== 0 && !readonly[y][x]) {\n\t\t\t// DOn't mutate state directly\n\t\t\tconst copy = candidates.slice();\n\n\t\t\tif (copy[y][x].includes(value)) {\n\t\t\t\t// Remove values from candidates if already existed\n\t\t\t\tcopy[y][x].splice(copy[y][x].indexOf(value), 1);\n\t\t\t} else {\n\t\t\t\tcopy[y][x].push(value);\n\t\t\t}\n\n\t\t\tsetCandidates(copy);\n\t\t} else {\n\t\t\t// Setting single value to cell if its not readonly\n\t\t\tif (!readonly[y][x]) {\n\t\t\t\tconst copy = sudoku.slice();\n\t\t\t\t// Delete's value if same key is pressed\n\t\t\t\tif (value === sudoku[y][x]) {\n\t\t\t\t\tcopy[y][x] = 0;\n\t\t\t\t} else {\n\t\t\t\t\tcopy[y][x] = value;\n\t\t\t\t}\n\n\t\t\t\tsetSudoku(copy);\n\t\t\t}\n\t\t}\n\t}", "function moveWriteCell(x, y, color, line) {\n if (pos < 0) line = line.substr(pos * -1);\n var msg = pad + color + line;\n\t\t\n writeCell(x, y, msg,animationBoard.id);\n }", "static update(fields, value) {\n if (typeof value === 'number') {\n fields.position = value;\n } else if (typeof value === 'string') {\n fields.insertString = value;\n } else if (typeof value === 'object' && value.d !== undefined) {\n fields.delNum = value.d;\n }\n }", "function setTile(x, y, value) {\n convert(x, y, function (index) {\n data[index] = value;\n \n redraw(x, y, true);\n\n if (tileset.isNSensitive(value)) {\n //Update adjacent\n redraw(x - 1, y, true);\n redraw(x + 1, y, true);\n redraw(x, y - 1, true);\n redraw(x, y + 1, true);\n }\n });\n }", "modify(index, v) { // index is already multiplied by values_per_entry\n if (this.values_per_entry > 1) {\n console.assert(v.length == this.values_per_entry, \"Unexpected number of values\")\n let vindex = index * this.values_per_entry\n console.assert(vindex < this.lst.length, \"modify out of range\")\n for(let vi = 0; vi < v.length; ++vi)\n this.lst[vindex + vi] = v[vi]\n this.reprint_line(vindex, v)\n }\n else {\n console.assert(v.length === undefined, \"Unexpected list\")\n this.lst[index] = v\n this.reprint_line(index, this.lst[index])\n } \n this.pset_dirty()\n }", "function changeLinePos(line, pos) {\n pos = {\n x: pos.x / resizer,\n y: pos.y / resizer\n }\n gMeme[getMemeIdxInGMeme(gCurrMeme)].lines[line].pos = pos;\n}", "setCell(row, column, value) {\n if (/[0-9]/.test(value)) {\n this.sudokuBoard[row][column] = +value;\n }\n return this.getCell(row, column);\n }", "function set(row, col, value) {\n _data[row][col] = value;\n }", "function updatePosition(str) {\n\t var lines = str.match(/\\n/g);\n\t if (lines) lineno += lines.length;\n\t var i = str.lastIndexOf('\\n');\n\t column = ~i ? str.length - i : column + str.length;\n\t }", "_set_value(value) {\n if (!this._has_value_flag) {\n this._update_size(1);\n this._has_value_flag = true;\n }\n this._value = value;\n }", "updateValue(value) {\n const that = this.context;\n\n value = value instanceof JQX.Utilities.BigNumber ? value : new JQX.Utilities.BigNumber(value);\n\n const renderedValue = this.validate(value, that._minObject, that._maxObject);\n let oldValue = that.value,\n valueDetail, difference;\n\n that._number = renderedValue;\n that._drawValue = that.logarithmicScale ? Math.log10(renderedValue) : renderedValue;\n\n if (that.mode === 'numeric') {\n valueDetail = value.toString();\n that.value = valueDetail;\n difference = this.compare(value, oldValue);\n }\n else {\n oldValue = JQX.Utilities.DateTime.fromFullTimeStamp(oldValue);\n that._valueDate = JQX.Utilities.DateTime.fromFullTimeStamp(value);\n that.value = value;\n value = that._valueDate;\n valueDetail = value;\n difference = value.compare(oldValue) !== 0;\n }\n\n if (!that._programmaticValueIsSet && (difference || that._scaleTypeChangedFlag)) {\n that.$.fireEvent('change', { 'value': valueDetail, 'oldValue': oldValue });\n }\n\n if (that.$.hiddenInput) {\n that.$.hiddenInput.value = value;\n }\n\n that._moveThumbBasedOnValue(that._drawValue);\n }", "function updatePositionsincident() {\n var positions = line.geometry.attributes.position.array;\n\n var x = -16;\n var y = 0; \n var z = -2.5;\n var index = 0;\n\n for ( var i = 0, l = MAX_POINTS; i < l; i ++ ) {\n\n positions[ index ++ ] = x;\n positions[ index ++ ] = y;\n positions[ index ++ ] = z;\n\n x += (11.78/MAX_POINTS);\n y += (3/MAX_POINTS);\n }\n}", "setValue(val) {\n const valRel = (val - this.valueMin) / (this.valueMax - this.valueMin);\n const newPos = valRel * this.sliderWidth + 2 * this.handleOffset;\n this.translate(newPos);\n this.value = this.getPositionValue();\n this.dispatchEvent(new CustomEvent(\"update\"));\n }", "_updateValue(value) {\n const valuesHandler = this._valuesHandler;\n valuesHandler.updateValue(valuesHandler.getActualValue(value));\n }", "function moveWriteCell(x, y, color, line) {\n if (pos < 0) pos += board.cols;\n var msg = color + shiftWrapText(line, \" \", pos, board.cols);\n writeCell(x, y, msg, animationBoard.id);\n }", "set(row, column, value) {\n const n = this._width * row + column;\n this._elements[n] = value;\n return this;\n }", "changeValue(value) {\n this.rawValue = value;\n if (this.rawToFinalValue) {\n this.value = this.rawToFinalValue(value);\n }\n else\n this.value = value;\n this.parentSectionReflection.valueChanged();\n this.validate();\n }", "function setCell(row, column, value) {\n \t$scope.game.board[row][column] = value;\n $scope.game.$save();\n\n }", "deleteValueAtOffset(offset) {\n if (offset < 0 || offset > this.length) {\n throw new Error(`Invalid offset \"${offset}\"`);\n }\n const [ left, right ] = [\n this.value.slice(0, offset),\n this.value.slice(offset+1)\n ];\n this.value = left + right;\n }", "set value(value)\n {\n this.updated = true\n this._value = value\n }", "function updatePosition(str) {\n var lines = str.match(/\\n/g);\n if (lines) lineno += lines.length;\n var i = str.lastIndexOf('\\n');\n column = ~i ? str.length - i : column + str.length;\n }", "function updatePosition(str) {\n var lines = str.match(/\\n/g);\n if (lines) lineno += lines.length;\n var i = str.lastIndexOf('\\n');\n column = ~i ? str.length - i : column + str.length;\n }", "function updatePosition(str) {\n var lines = str.match(/\\n/g);\n if (lines) lineno += lines.length;\n var i = str.lastIndexOf('\\n');\n column = ~i ? str.length - i : column + str.length;\n }", "function updatePosition(str) {\n var lines = str.match(/\\n/g);\n if (lines) lineno += lines.length;\n var i = str.lastIndexOf('\\n');\n column = ~i ? str.length - i : column + str.length;\n }", "function updatePosition(str) {\n var lines = str.match(/\\n/g);\n if (lines) lineno += lines.length;\n var i = str.lastIndexOf('\\n');\n column = ~i ? str.length - i : column + str.length;\n }", "function updatePosition(str) {\n var lines = str.match(/\\n/g);\n if (lines) lineno += lines.length;\n var i = str.lastIndexOf('\\n');\n column = ~i ? str.length - i : column + str.length;\n }", "function updatePosition(str) {\n const lines = str.match(/\\n/g);\n\n if (lines) {\n lineno += lines.length;\n }\n\n const i = str.lastIndexOf('\\n'); // eslint-disable-next-line no-bitwise\n\n column = ~i ? str.length - i : column + str.length;\n }", "function updateValueLine() {\n if (paused) return;\n\n var hoverValue = g.selectAll('.nv-hoverValue').data(index);\n\n var hoverEnter = hoverValue.enter()\n .append('g').attr('class', 'nv-hoverValue')\n .style('stroke-opacity', 0)\n .style('fill-opacity', 0);\n\n hoverValue.exit()\n .transition().duration(250)\n .style('stroke-opacity', 0)\n .style('fill-opacity', 0)\n .remove();\n\n hoverValue\n .attr('transform', function(d) { return 'translate(' + x(sparkline.x()(data[d],d)) + ',0)' })\n .transition().duration(250)\n .style('stroke-opacity', 1)\n .style('fill-opacity', 1);\n\n if (!index.length) return;\n\n hoverEnter.append('line')\n .attr('x1', 0)\n .attr('y1', -margin.top)\n .attr('x2', 0)\n .attr('y2', availableHeight);\n\n hoverEnter.append('text').attr('class', 'nv-xValue')\n .attr('x', -6)\n .attr('y', -margin.top)\n .attr('text-anchor', 'end')\n .attr('dy', '.9em');\n\n g.select('.nv-hoverValue .nv-xValue')\n .text(xTickFormat(sparkline.x()(data[index[0]], index[0])));\n\n hoverEnter.append('text').attr('class', 'nv-yValue')\n .attr('x', 6)\n .attr('y', -margin.top)\n .attr('text-anchor', 'start')\n .attr('dy', '.9em');\n\n g.select('.nv-hoverValue .nv-yValue')\n .text(yTickFormat(sparkline.y()(data[index[0]], index[0])));\n }", "function updateValueLine() {\n if (paused) return;\n\n var hoverValue = g.selectAll('.nv-hoverValue').data(index);\n\n var hoverEnter = hoverValue.enter()\n .append('g').attr('class', 'nv-hoverValue')\n .style('stroke-opacity', 0)\n .style('fill-opacity', 0);\n\n hoverValue.exit()\n .transition().duration(250)\n .style('stroke-opacity', 0)\n .style('fill-opacity', 0)\n .remove();\n\n hoverValue\n .attr('transform', function(d) { return 'translate(' + x(sparkline.x()(data[d],d)) + ',0)' })\n .transition().duration(250)\n .style('stroke-opacity', 1)\n .style('fill-opacity', 1);\n\n if (!index.length) return;\n\n hoverEnter.append('line')\n .attr('x1', 0)\n .attr('y1', -margin.top)\n .attr('x2', 0)\n .attr('y2', availableHeight);\n\n hoverEnter.append('text').attr('class', 'nv-xValue')\n .attr('x', -6)\n .attr('y', -margin.top)\n .attr('text-anchor', 'end')\n .attr('dy', '.9em');\n\n g.select('.nv-hoverValue .nv-xValue')\n .text(xTickFormat(sparkline.x()(data[index[0]], index[0])));\n\n hoverEnter.append('text').attr('class', 'nv-yValue')\n .attr('x', 6)\n .attr('y', -margin.top)\n .attr('text-anchor', 'start')\n .attr('dy', '.9em');\n\n g.select('.nv-hoverValue .nv-yValue')\n .text(yTickFormat(sparkline.y()(data[index[0]], index[0])));\n }", "function updateValueLine() {\n if (paused) return;\n\n var hoverValue = g.selectAll('.nv-hoverValue').data(index);\n\n var hoverEnter = hoverValue.enter()\n .append('g').attr('class', 'nv-hoverValue')\n .style('stroke-opacity', 0)\n .style('fill-opacity', 0);\n\n hoverValue.exit()\n .transition().duration(250)\n .style('stroke-opacity', 0)\n .style('fill-opacity', 0)\n .remove();\n\n hoverValue\n .attr('transform', function(d) { return 'translate(' + x(sparkline.x()(data[d],d)) + ',0)' })\n .transition().duration(250)\n .style('stroke-opacity', 1)\n .style('fill-opacity', 1);\n\n if (!index.length) return;\n\n hoverEnter.append('line')\n .attr('x1', 0)\n .attr('y1', -margin.top)\n .attr('x2', 0)\n .attr('y2', availableHeight);\n\n hoverEnter.append('text').attr('class', 'nv-xValue')\n .attr('x', -6)\n .attr('y', -margin.top)\n .attr('text-anchor', 'end')\n .attr('dy', '.9em');\n\n g.select('.nv-hoverValue .nv-xValue')\n .text(xTickFormat(sparkline.x()(data[index[0]], index[0])));\n\n hoverEnter.append('text').attr('class', 'nv-yValue')\n .attr('x', 6)\n .attr('y', -margin.top)\n .attr('text-anchor', 'start')\n .attr('dy', '.9em');\n\n g.select('.nv-hoverValue .nv-yValue')\n .text(yTickFormat(sparkline.y()(data[index[0]], index[0])));\n }", "constructor(kind, start, end, line, column, value) {\n this.kind = kind;\n this.start = start;\n this.end = end;\n this.line = line;\n this.column = column; // eslint-disable-next-line @typescript-eslint/no-non-null-assertion\n\n this.value = value;\n this.prev = null;\n this.next = null;\n }", "update(cell, value) {\n\t\tlet queue = []\n\t\tlet newCell = new DokuCell({\n\t\t\tindex: cell.index,\n\t\t\tpossibilities: [value]\n\t\t})\n\t\tqueue.push(newCell)\n\t\tthis.cells[cell.index] = newCell\n\t\twhile (queue.length !== 0) {\n\t\t\tlet processing = queue.shift()\n\t\t\tif (processing.possibilities.length === 0) { break }\n\n\t\t\tfor (let loc of ['row', 'col', 'subgrid']) {\n\t\t\t\tlet results = this.percolate(processing, processing.possibilities[0], loc)\n\t\t\t\tqueue = queue.concat(results)\n\t\t\t}\n\t\t}\n\t}", "updateValue(value) {\n const that = this.context,\n renderedValue = this.validate(value, that._minObject, that._maxObject),\n oldActualValue = that.value;\n\n if (value.toString() !== oldActualValue.toString() || that._scaleTypeChangedFlag) {\n that.value = value.toString();\n that._number = renderedValue;\n\n if (!that._programmaticValueIsSet) {\n that.$.fireEvent('change', { 'value': that.value, 'oldValue': oldActualValue });\n }\n }\n else {\n that.value = typeof (value) === 'string' ? value : value.toString();\n }\n\n that._drawValue = that.logarithmicScale ? Math.log10(renderedValue).toString() : renderedValue.toString();\n that._moveThumbBasedOnValue(that._drawValue);\n\n if (that.$.hiddenInput) {\n that.$.hiddenInput.value = that.value;\n }\n }", "function updatePosition(str) {\n var lines = str.match(/\\n/g)\n if (lines) {\n lineno += lines.length\n }\n var i = str.lastIndexOf('\\n')\n column = ~i ? str.length - i : column + str.length\n }", "set point(value) {}", "setValue(value) {\n let {grip} = this\n grip.object3D.position.z = 0\n grip.object3D.position.x = Math.max(grip.object3D.position.x, 0.001)\n this.spherical.setFromCartesianCoords(grip.object3D.position.x, grip.object3D.position.y, grip.object3D.position.z)\n this.spherical.theta = Math.PI/ 2\n this.spherical.radius = this.data.handleLength\n this.spherical.phi = THREE.Math.mapLinear(value, this.data.valueRange.x, this.data.valueRange.y, this.data.angleRange.x * Math.PI / 180, this.data.angleRange.y * Math.PI / 180)\n grip.object3D.position.setFromSpherical(this.spherical)\n\n this.bodyPositioner.object3D.matrix.lookAt(this.grip.object3D.position, this.origin, this.forward)\n Util.applyMatrix(this.bodyPositioner.object3D.matrix, this.bodyPositioner.object3D)\n }", "function updatePosition(str) {\n var lines = str.match(/\\n/g);\n if (lines)\n lineno += lines.length;\n var i = str.lastIndexOf('\\n');\n column = ~i ? str.length - i : column + str.length;\n }", "function setIndexPosition(val)\n { \n _pause();\n \n var max = _fileLength()-1;\n // val could be a floating-point number\n val = clamp(parseInt(val), 0, max);\n \n currentIndexPosition = nextIndexPosition = val;\n \n update(performance.now());\n draw();\n }", "function updateDevice(value) {\n if (updateFunction) {\n updateFunction(object, min, max, value);\n }\n }", "set(index, value) {\n this._data[index * CELL_SIZE + 1 /* FG */] = value[CHAR_DATA_ATTR_INDEX];\n if (value[CHAR_DATA_CHAR_INDEX].length > 1) {\n this._combined[index] = value[1];\n this._data[index * CELL_SIZE + 0 /* CONTENT */] = index | 2097152 /* IS_COMBINED_MASK */ | (value[CHAR_DATA_WIDTH_INDEX] << 22 /* WIDTH_SHIFT */);\n }\n else {\n this._data[index * CELL_SIZE + 0 /* CONTENT */] = value[CHAR_DATA_CHAR_INDEX].charCodeAt(0) | (value[CHAR_DATA_WIDTH_INDEX] << 22 /* WIDTH_SHIFT */);\n }\n }", "changeHorizontalPosition(value, change) {\n return String.fromCharCode(value.charCodeAt(0) + change);\n }", "set rectValue(value) {}", "setCell(x, y, val) {\n if (this.isInside(x, y)) {\n this._board[y] = this._board[y].substring(0, x) +\n val + this._board[y].substring(x + 1);\n }\n }", "function updatePositionsfinal() {\n var positions = line2.geometry.attributes.position.array;\n\n var x = 6; \n var y = 2.7; \n var z = -2.5;\n var index = 0;\n\n for ( var i = 0, l = MAX_POINTS; i < l; i ++ ) {\n\n positions[ index ++ ] = x;\n positions[ index ++ ] = y;\n positions[ index ++ ] = z;\n\n x += (9/MAX_POINTS);\n y += (2.6/MAX_POINTS);\n }\n}", "function update_slider(value) {\n d3.select(\"#barcode\").select(\"line\")\n .attr(\"x1\", x(value)) // we map the slider value to the x axis\n .attr(\"x2\", x(value))\n}", "update(x, y, point) {\n\t \tlet constructor = this;\n\t\tmoveAt(x, y, point); \t\n\t\tfunction moveAt(x, y, point) {\n\t\t\tif (point == \"start\") {\n\t\t\t constructor.x1 = x;\n\t\t\t constructor.y1 = y;\n\t\t\t constructor.line.setAttribute('x1', x);\n\t\t\t constructor.line.setAttribute('y1', y);\n\t\t\t}\n\t\t\telse {\n\t\t\t constructor.x2 = x;\n\t\t\t constructor.y2 = y;\n\t\t\t\tconstructor.line.setAttribute('x2', x);\n\t\t\t constructor.line.setAttribute('y2', y);\n\t\t\t}\n\t\t}\n\t}", "function updateValueLine() {\n\t if (paused) return;\n\n\t var hoverValue = g.selectAll('.nv-hoverValue').data(index);\n\n\t var hoverEnter = hoverValue.enter()\n\t .append('g').attr('class', 'nv-hoverValue')\n\t .style('stroke-opacity', 0)\n\t .style('fill-opacity', 0);\n\n\t hoverValue.exit()\n\t .transition().duration(250)\n\t .style('stroke-opacity', 0)\n\t .style('fill-opacity', 0)\n\t .remove();\n\n\t hoverValue\n\t .attr('transform', function(d) { return 'translate(' + x(sparkline.x()(data[d],d)) + ',0)' })\n\t .transition().duration(250)\n\t .style('stroke-opacity', 1)\n\t .style('fill-opacity', 1);\n\n\t if (!index.length) return;\n\n\t hoverEnter.append('line')\n\t .attr('x1', 0)\n\t .attr('y1', -margin.top)\n\t .attr('x2', 0)\n\t .attr('y2', availableHeight);\n\n\t hoverEnter.append('text').attr('class', 'nv-xValue')\n\t .attr('x', -6)\n\t .attr('y', -margin.top)\n\t .attr('text-anchor', 'end')\n\t .attr('dy', '.9em');\n\n\t g.select('.nv-hoverValue .nv-xValue')\n\t .text(xTickFormat(sparkline.x()(data[index[0]], index[0])));\n\n\t hoverEnter.append('text').attr('class', 'nv-yValue')\n\t .attr('x', 6)\n\t .attr('y', -margin.top)\n\t .attr('text-anchor', 'start')\n\t .attr('dy', '.9em');\n\n\t g.select('.nv-hoverValue .nv-yValue')\n\t .text(yTickFormat(sparkline.y()(data[index[0]], index[0])));\n\t }", "update(data) {\n for (let i = 0; i < this.Offsets.length; i += 2) {\n this.Offsets[i] = data[i];\n this.Offsets[i + 1] = data[i + 1];\n }\n }", "makeValue(value) {\n this.code += `[-]`; // Set cell to zero\n this.code += `+`.repeat(value);\n }", "function updateOffset() {\n canvasBounding = canvas.getBoundingClientRect();\n offsetX = canvasBounding.left;\n offsetY = canvasBounding.top;\n}", "_setCellValue(cellRef, value) {\n const tabId = cellRef.get('tabId');\n const rowIdx = cellRef.get('rowIdx');\n const colIdx = cellRef.get('colIdx');\n\n if ( !this.vals.has(tabId) ) {\n this.vals = this.vals.set(tabId, new List());\n }\n if ( !this.vals.getIn([tabId, rowIdx]) ) {\n this.vals = this.vals.setIn([tabId, rowIdx], new List());\n }\n this.vals = this.vals.setIn([cellRef.get('tabId'), cellRef.get('rowIdx'), cellRef.get('colIdx')], value);\n }", "function updateCursorPosition() {\r\n var position = editor.getCursorPosition();\r\n // indicate cursor postion elements\r\n document.getElementById(\"cur-row\").innerText = position.row + 1;\r\n document.getElementById(\"cur-col\").innerText = position.column + 1;\r\n document.getElementById(\"all-lines\").innerText = editor.getSession().getLength();\r\n}", "updatePhysicalPosition(moveNextLine) {\n if (this.currentWidget && this.owner.isLayoutEnabled && this.isUpdateLocation) {\n this.location = this.selection.getPhysicalPositionInternal(this.currentWidget, this.offset, moveNextLine);\n }\n }", "update() {\n let xpos = 0, ypos = 0;\n let i;\n this.ctx.clearRect(0, 0, this.canvas.width, this.canvas.height);\n this.ctx.strokeStyle = \"#E0E0E0\";\n for (i = 0; i < this.cols*this.rows; i++) {\n if (i % this.cols === 0 && i !== 0) {\n ypos += this.cellSize;\n xpos = 0;\n }\n if (this.engine.getCellStateFromIndex(i) === 1) {\n this.ctx.fillRect(xpos, ypos, this.cellSize, this.cellSize);\n }\n if (this.cellSize > 5) {\n this.ctx.strokeRect(xpos, ypos, this.cellSize, this.cellSize);\n }\n xpos += this.cellSize;\n }\n }", "function setCell(column, row, value) {\n var s = SpreadsheetApp.getActiveSpreadsheet();\n var sheet = s.getSheetByName('Data');\n //sheet.appendRow([column, row, value]);\n sheet.getRange(getSheetTranslation(column)+row).setValue(value);\n}", "function HM_UpdateTooltip(x, y, value) {\n // + 15 for distance to cursor\n var translation = 'translate(' + (x + 100) + 'px, ' + (y + 100) + 'px)';\n hm_tooltip.style.webkitTransform = translation;\n hm_tooltip.innerHTML = value;\n}", "updatePosition(x, y) {\n // maze position, sprite width, grid places over\n var canvasX = this.startCanvasX + this.spriteWidth/2 + (this.spriteWidth * x);\n var canvasY = this.startCanvasY - this.spriteWidth/2 + this.mazeHeight - (this.spriteWidth * y);\n\n this.raster.position = new Point(canvasX, canvasY);\n }", "updateValue(value) {\n if (this.control) {\n this.control.control.setValue(value);\n }\n else {\n this.target.value = value;\n }\n }", "function updateLine(line, text, markedSpans, estimateHeight) {\n\t\t line.text = text;\n\t\t if (line.stateAfter) line.stateAfter = null;\n\t\t if (line.styles) line.styles = null;\n\t\t if (line.order != null) line.order = null;\n\t\t detachMarkedSpans(line);\n\t\t attachMarkedSpans(line, markedSpans);\n\t\t var estHeight = estimateHeight ? estimateHeight(line) : 1;\n\t\t if (estHeight != line.height) updateLineHeight(line, estHeight);\n\t\t }", "function updateLine(line, text, markedSpans, estimateHeight) {\n\t\t line.text = text;\n\t\t if (line.stateAfter) { line.stateAfter = null; }\n\t\t if (line.styles) { line.styles = null; }\n\t\t if (line.order != null) { line.order = null; }\n\t\t detachMarkedSpans(line);\n\t\t attachMarkedSpans(line, markedSpans);\n\t\t var estHeight = estimateHeight ? estimateHeight(line) : 1;\n\t\t if (estHeight != line.height) { updateLineHeight(line, estHeight); }\n\t\t }", "setValue(value, step) {\r\n if (is.num(value)) {\r\n this.lastPosition = value;\r\n\r\n if (step) {\r\n value = Math.round(value / step) * step;\r\n\r\n if (this.done) {\r\n this.lastPosition = value;\r\n }\r\n }\r\n }\r\n\r\n if (this._value === value) {\r\n return false;\r\n }\r\n\r\n this._value = value;\r\n return true;\r\n }", "function updateDrawingLineOfAPeer(oldLineObj, newLineObj) {\n oldLineObj.set({\n x2: (newLineObj.x1 < 0) ? newLineObj.left + newLineObj.width : newLineObj.left ,\n y2: (newLineObj.y1 < 0) ? newLineObj.top + newLineObj.height : newLineObj.top\n });\n}", "function assign(value) {\n return function(row, col) {\n return function(puzzle) {\n // will erase all pencil marks as well\n const changedPuzzle = modifyCell(value, row, col, puzzle);\n\n const mark = valueToMark(value);\n const removedAssignedMark = removeMarks(mark);\n\n // reduce the value out of the row, these are col indices\n const reducedRow = indices.reduce((p, cI) => {\n return removedAssignedMark(row, cI)(p);\n }, changedPuzzle);\n\n // reduce the value out of the col, these are row indices\n const reducedRowAndCol = indices.reduce((p, rI) => {\n return removedAssignedMark(rI, col)(p);\n }, reducedRow);\n\n // reduce the value out of the block\n const block = getBlockForRowCol(row, col);\n const reducedRowAndColAndBlock = getAllBlockRowCols(block).reduce((p, i) => {\n return removedAssignedMark(i[0], i[1])(p);\n }, reducedRowAndCol);\n\n return reducedRowAndColAndBlock;\n };\n };\n}", "writeValue(value) {\n this._renderer.setProperty(this._elementRef.nativeElement, 'value', parseFloat(value));\n }", "writeValue(value) {\n this._renderer.setProperty(this._elementRef.nativeElement, 'value', parseFloat(value));\n }", "writeValue(value) {\n this._renderer.setProperty(this._elementRef.nativeElement, 'value', parseFloat(value));\n }", "writeValue(value) {\n this._renderer.setProperty(this._elementRef.nativeElement, 'value', parseFloat(value));\n }", "writeValue(value) {\n this._renderer.setProperty(this._elementRef.nativeElement, 'value', parseFloat(value));\n }", "writeValue(value) {\n this._renderer.setProperty(this._elementRef.nativeElement, 'value', parseFloat(value));\n }", "writeValue(value) {\n this._renderer.setProperty(this._elementRef.nativeElement, 'value', parseFloat(value));\n }", "edit(value) {\r\n if (this.disabled === 'true') {\r\n return;\r\n }\r\n this.onEditing.emit('editing click');\r\n this.preValue = value;\r\n this.editing = true;\r\n this._originalValue = value;\r\n }" ]
[ "0.7200468", "0.6306508", "0.6006134", "0.5928402", "0.58180755", "0.5709779", "0.57011133", "0.56737566", "0.56072223", "0.5580895", "0.55691946", "0.55691946", "0.55691946", "0.55691946", "0.55691946", "0.55479944", "0.55298024", "0.5475479", "0.54641885", "0.5446471", "0.5436405", "0.543478", "0.54130423", "0.54122686", "0.5411041", "0.5397845", "0.53844565", "0.5363287", "0.53560084", "0.5347471", "0.53333205", "0.53233236", "0.531185", "0.52803123", "0.52787876", "0.5276616", "0.52756476", "0.5272276", "0.52536976", "0.52411026", "0.52306604", "0.5228454", "0.5225712", "0.52232695", "0.5212551", "0.520273", "0.520273", "0.520273", "0.520273", "0.520273", "0.520273", "0.5202504", "0.519458", "0.519458", "0.519458", "0.51914024", "0.5190906", "0.5187776", "0.51874363", "0.5176327", "0.516028", "0.51574814", "0.51565385", "0.5151716", "0.5151045", "0.51509875", "0.5149442", "0.5143396", "0.51268923", "0.5107557", "0.50920916", "0.5082116", "0.50758964", "0.5075819", "0.5072753", "0.50631505", "0.5062015", "0.5052502", "0.50365555", "0.5036128", "0.50049627", "0.49984747", "0.4997733", "0.4997464", "0.49961397", "0.4990136", "0.49869117", "0.49865085", "0.49787554", "0.49787554", "0.49787554", "0.49787554", "0.49787554", "0.49787554", "0.49787554", "0.49783683" ]
0.7229146
3
Get offset. Called before the first character is eaten to retrieve the range's offsets.
function getOffset() { var indentation = []; var pos = line + 1; /* Done. Called when the last character is * eaten to retrieve the range’s offsets. */ return function () { var last = line + 1; while (pos < last) { indentation.push((offset[pos] || 0) + 1); pos++; } return indentation; }; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getStartOffSet() {\n var selObj = window.getSelection();\n var selRange = selObj.getRangeAt(0);\n return selRange['startOffset'];\n }", "function getOffset() {\n\t\t\treturn offset;\n\t\t}", "getOffset() {\r\n return this.builder.offset;\r\n }", "offsetAt(position) {\n return (0, utils_1.offsetAt)(position, this.getText(), this.getLineOffsets());\n }", "function annot_offset(range_end){\n var lines = editor.getSession().getDocument().getLines(0, range_end.row);\n var total_off = 0;\n var num_char;\n\n for(var i = 0; i < lines.length; i++){\n num_char = lines[i].length;\n total_off += parseInt((num_char - 1) / 80, 10);\n }\n\n return total_off;\n}", "function fnGetCaretPosition(_dom) {\n if ('selectionStart' in _dom) {\n return (_dom.selectionStart);\n } else { // IE below version 9\n var _sel = document.selection.createRange();\n _sel.moveStart('character', -_dom.value.length);\n return (_sel.text.length);\n }\n }", "function getOffset(offset) {\n\t\t\t// Add all insertions before this location together to calculate\n\t\t\t// the current offset\n\t\t\tfor (var i = 0, l = insertions.length; i < l; i++) {\n\t\t\t\tvar insertion = insertions[i];\n\t\t\t\tif (insertion[0] >= offset)\n\t\t\t\t\tbreak;\n\t\t\t\toffset += insertion[1];\n\t\t\t}\n\t\t\treturn offset;\n\t\t}", "getFieldCharacterPosition(firstInline) {\n let nextValidInline = this.getNextValidElementForField(firstInline);\n //If field separator/end exists at end of paragraph, then move to next paragraph.\n if (isNullOrUndefined(nextValidInline)) {\n let nextParagraph = firstInline.line.paragraph;\n return this.getEndPosition(nextParagraph);\n }\n else {\n return this.getPhysicalPositionInline(nextValidInline, 0, true);\n }\n }", "function doGetCaretPosition(input) {\n if (document.selection) {\n input.focus ();\n var sel = document.selection.createRange();\n sel.moveStart ('character', -input.value.length);\n \n return sel.text.length;\n }\n \n if (input.selectionStart || input.selectionStart == '0') \n return input.selectionStart;\n \n return 0;\n }", "function getCaretPosition () {\r\n var selection = window.getSelection()\r\n var position = selection.anchorOffset\r\n // We move up to the parent span\r\n var sibling = selection.anchorNode.parentNode.previousSibling\r\n while (sibling !== null) {\r\n if (sibling.childNodes.length > 0) {\r\n position += sibling.childNodes[0].length\r\n }\r\n sibling = sibling.previousSibling\r\n }\r\n return position // position\r\n}", "getPageOffset() {\n return this.coord.getPageOffset();\n }", "function translator_getPosition()\n{\n var position = this.parser.getPosition();\n return position - this.offsetAdj;\n}", "function getCursorPosition() {\n var selection = window.getSelection();\n return {\n node: selection.anchorNode,\n offset: selection.anchorOffset\n };\n }", "offset() {\n return this.bb.readInt64(this.bb_pos);\n }", "get offset() { setModified.apply(this); return this._offset; }", "get caretPos() {\n return this.textSelection[0];\n }", "function getOffset() {\n\t\t\tif (!vm.current) {\n\t\t\t\treturn 0;\n\t\t\t}\n\t\t\t//console.log(vm.getRank(vm.current));\n\t\t\treturn (vm.getRank(vm.current) - 2) * 17;\n\t\t}", "function getDropCharOffset (x, y) {\n // Helper function for getting the x-y character offset of a drop\n // event in a contenteditable field.\n // Modified from http://stackoverflow.com/a/10659990.\n var range\n // Standards-based way; implemented only in Firefox\n if (document.caretPositionFromPoint) {\n var pos = document.caretPositionFromPoint(x, y)\n return {\n 'offset': pos.offset,\n 'node': pos.offsetNode\n }\n } else if (document.caretRangeFromPoint) {\n // Webkit\n range = document.caretRangeFromPoint(x, y)\n return {\n 'offset': range.startOffset,\n 'node': range.startContainer\n }\n } else if (document.body.createTextRange) {\n // IE doesn't natively support retrieving the character offset, so\n // insert image at end of text\n // TODO(jrbotros): rewrite with https://github.com/timdown/rangy\n return\n }\n }", "function getScanStartPosition(enclosingNode, originalRange, sourceFile) {\n var start = enclosingNode.getStart(sourceFile);\n if (start === originalRange.pos && enclosingNode.end === originalRange.end) {\n return start;\n }\n var precedingToken = ts.findPrecedingToken(originalRange.pos, sourceFile);\n if (!precedingToken) {\n // no preceding token found - start from the beginning of enclosing node\n return enclosingNode.pos;\n }\n // preceding token ends after the start of original range (i.e when originalRange.pos falls in the middle of literal)\n // start from the beginning of enclosingNode to handle the entire 'originalRange'\n if (precedingToken.end >= originalRange.pos) {\n return enclosingNode.pos;\n }\n return precedingToken.end;\n }", "function getBeginningOfLineOffset(node) {\n return node.position.start.offset - node.position.start.column + 1;\n}", "function cursorIndex() {\r\n var current = selection.createRange(),\r\n diff = current.duplicate();\r\n\r\n diff.moveToElementText(this);\r\n diff.setEndPoint('EndToEnd', current);\r\n\r\n return diff.text.length - current.text.length;\r\n }", "getCursorPosition (offset = true) {\n return this.api.getCursorPosition(offset)\n }", "getOffset() {\nreturn this.offset;\n}", "function getCaretPosition(node) {\r\n\t\tvar range, preCaretRange, caretOffset,\r\n\t\t\twin = getNodeWindow(node);\r\n\r\n\t\tif(isContentEditable(node)){\r\n\t\t\trange = win.getSelection().getRangeAt(0);\r\n\t\t\tpreCaretRange = range.cloneRange();\r\n\r\n\t\t\tpreCaretRange.selectNodeContents(node);\r\n\t\t\tpreCaretRange.setEnd(range.endContainer, range.endOffset);\r\n\t\t\tcaretOffset = preCaretRange.innerText.length;\r\n\r\n\t\t\treturn caretOffset;\r\n\t\t}\r\n\t\telse return node.selectionEnd;\r\n\t}", "function doGetCaretPosition (ctrl) {\n var CaretPos = 0;\n // IE Support\n if (document.selection) {\n ctrl.focus ();\n var Sel = document.selection.createRange ();\n Sel.moveStart ('character', -ctrl.value.length);\n CaretPos = Sel.text.length;\n }\n // Firefox support\n else if (ctrl.selectionStart || ctrl.selectionStart == '0')\n CaretPos = ctrl.selectionStart;\n return (CaretPos);\n }", "positionAt(offset) {\n return (0, utils_1.positionAt)(offset, this.getText(), this.getLineOffsets());\n }", "getIndex() {\n\t\t\tconst {overrides} = this.impl;\n\t\t\tif (overrides !== undefined) {\n\t\t\t\treturn overrides.getIndex(this);\n\t\t\t}\n\n\t\t\treturn this.currentToken.start;\n\t\t}", "getCursorPosition() {\n const _pos = this.editor.selection.active;\n return new mte_kernel_1.Point(_pos.line, _pos.character);\n }", "function peek() {\n return input.charAt(pos);\n }", "function peek() {\n return input.charAt(pos);\n }", "function getEndOffSet() {\n var selObj = window.getSelection();\n var selRange = selObj.getRangeAt(0);\n return selRange['endOffset'];\n }", "getOffsetValue(selection) {\n if (this.startParagraph) {\n let lineInfo = selection.getLineInfoBasedOnParagraph(this.startParagraph, this.startOffset);\n selection.start.setPositionFromLine(lineInfo.line, lineInfo.offset);\n }\n selection.start.updatePhysicalPosition(true);\n if (selection.isEmpty) {\n selection.end.setPositionInternal(selection.start);\n }\n else {\n if (this.endParagraph) {\n let lineInfo = selection.getLineInfoBasedOnParagraph(this.endParagraph, this.endOffset);\n selection.end.setPositionFromLine(lineInfo.line, lineInfo.offset);\n }\n selection.end.updatePhysicalPosition(true);\n }\n }", "function doGetCaretPosition(oField) {\n var iCaretPos = 0;\n if (document.selection) {\n oField.focus ();\n var oSel = document.selection.createRange();\n oSel.moveStart ('character', -oField.value.length);\n iCaretPos = oSel.text.length;\n } else if (oField.selectionStart || oField.selectionStart == '0') {\n iCaretPos = oField.selectionStart;\n }\n return (iCaretPos);\n }", "function doGetCaretPosition(oField) {\n var iCaretPos = 0;\n if (document.selection) {\n oField.focus ();\n var oSel = document.selection.createRange();\n oSel.moveStart ('character', -oField.value.length);\n iCaretPos = oSel.text.length;\n } else if (oField.selectionStart || oField.selectionStart == '0') {\n iCaretPos = oField.selectionStart;\n }\n return (iCaretPos);\n }", "function doGetCaretPosition(oField) {\n var iCaretPos = 0;\n if (document.selection) {\n oField.focus ();\n var oSel = document.selection.createRange();\n oSel.moveStart ('character', -oField.value.length);\n iCaretPos = oSel.text.length;\n } else if (oField.selectionStart || oField.selectionStart == '0') {\n iCaretPos = oField.selectionStart;\n }\n return (iCaretPos);\n }", "function doGetCaretPosition(oField) {\n var iCaretPos = 0;\n if (document.selection) {\n oField.focus ();\n var oSel = document.selection.createRange();\n oSel.moveStart ('character', -oField.value.length);\n iCaretPos = oSel.text.length;\n } else if (oField.selectionStart || oField.selectionStart == '0') {\n iCaretPos = oField.selectionStart;\n }\n return (iCaretPos);\n }", "function doGetCaretPosition(oField) {\n var iCaretPos = 0;\n if (document.selection) {\n oField.focus ();\n var oSel = document.selection.createRange();\n oSel.moveStart ('character', -oField.value.length);\n iCaretPos = oSel.text.length;\n } else if (oField.selectionStart || oField.selectionStart == '0') {\n iCaretPos = oField.selectionStart;\n }\n return (iCaretPos);\n }", "function doGetCaretPosition(oField) {\n var iCaretPos = 0;\n if (document.selection) {\n oField.focus ();\n var oSel = document.selection.createRange();\n oSel.moveStart ('character', -oField.value.length);\n iCaretPos = oSel.text.length;\n } else if (oField.selectionStart || oField.selectionStart == '0') {\n iCaretPos = oField.selectionStart;\n }\n return (iCaretPos);\n }", "function doGetCaretPosition(oField) {\n var iCaretPos = 0;\n if (document.selection) {\n oField.focus ();\n var oSel = document.selection.createRange();\n oSel.moveStart ('character', -oField.value.length);\n iCaretPos = oSel.text.length;\n } else if (oField.selectionStart || oField.selectionStart == '0') {\n iCaretPos = oField.selectionStart;\n }\n return (iCaretPos);\n }", "function doGetCaretPosition(oField) {\n var iCaretPos = 0;\n if (document.selection) {\n oField.focus ();\n var oSel = document.selection.createRange();\n oSel.moveStart ('character', -oField.value.length);\n iCaretPos = oSel.text.length;\n } else if (oField.selectionStart || oField.selectionStart == '0') {\n iCaretPos = oField.selectionStart;\n }\n return (iCaretPos);\n }", "function doGetCaretPosition(oField) {\n var iCaretPos = 0;\n if (document.selection) {\n oField.focus ();\n var oSel = document.selection.createRange();\n oSel.moveStart ('character', -oField.value.length);\n iCaretPos = oSel.text.length;\n } else if (oField.selectionStart || oField.selectionStart == '0') {\n iCaretPos = oField.selectionStart;\n }\n return (iCaretPos);\n }", "function doGetCaretPosition(oField) {\n var iCaretPos = 0;\n if (document.selection) {\n oField.focus ();\n var oSel = document.selection.createRange();\n oSel.moveStart ('character', -oField.value.length);\n iCaretPos = oSel.text.length;\n } else if (oField.selectionStart || oField.selectionStart == '0') {\n iCaretPos = oField.selectionStart;\n }\n return (iCaretPos);\n }", "function doGetCaretPosition(oField) {\n var iCaretPos = 0;\n if (document.selection) {\n oField.focus ();\n var oSel = document.selection.createRange();\n oSel.moveStart ('character', -oField.value.length);\n iCaretPos = oSel.text.length;\n } else if (oField.selectionStart || oField.selectionStart == '0') {\n iCaretPos = oField.selectionStart;\n }\n return (iCaretPos);\n }", "function doGetCaretPosition(oField) {\n var iCaretPos = 0;\n if (document.selection) {\n oField.focus ();\n var oSel = document.selection.createRange();\n oSel.moveStart ('character', -oField.value.length);\n iCaretPos = oSel.text.length;\n } else if (oField.selectionStart || oField.selectionStart == '0') {\n iCaretPos = oField.selectionStart;\n }\n return (iCaretPos);\n }", "function doGetCaretPosition(oField) {\n var iCaretPos = 0;\n if (document.selection) {\n oField.focus ();\n var oSel = document.selection.createRange();\n oSel.moveStart ('character', -oField.value.length);\n iCaretPos = oSel.text.length;\n } else if (oField.selectionStart || oField.selectionStart == '0') {\n iCaretPos = oField.selectionStart;\n }\n return (iCaretPos);\n }", "function doGetCaretPosition(oField) {\n var iCaretPos = 0;\n if (document.selection) {\n oField.focus ();\n var oSel = document.selection.createRange();\n oSel.moveStart ('character', -oField.value.length);\n iCaretPos = oSel.text.length;\n } else if (oField.selectionStart || oField.selectionStart == '0') {\n iCaretPos = oField.selectionStart;\n }\n return (iCaretPos);\n }", "peek() { return this.string.charAt(this.pos) || undefined; }", "function doGetCaretPosition(oField) {\n var iCaretPos = 0;\n if (document.selection) {\n oField.focus ();\n var oSel = document.selection.createRange();\n oSel.moveStart ('character', -oField.value.length);\n iCaretPos = oSel.text.length;\n } else if (oField.selectionStart || oField.selectionStart == '0') {\n iCaretPos = oField.selectionStart;\n }\n return (iCaretPos);\n }", "function getOffsetExcludeWS() {\n if (this.scanner.tokenIndex > 0) {\n if (this.scanner.lookupType(-1) === WhiteSpace) {\n return this.scanner.tokenIndex > 1\n ? this.scanner.getTokenStart(this.scanner.tokenIndex - 1)\n : this.scanner.firstCharOffset;\n }\n }\n\n return this.scanner.tokenStart;\n}", "positionAt(offset) {\n const before = this.textDocument.slice(0, offset);\n const newLines = before.match(/\\n/g);\n const line = newLines ? newLines.length : 0;\n const preCharacters = before.match(/(\\n|^).*$/g);\n return new tokenizer_1.Position(line, preCharacters ? preCharacters[0].length : 0);\n }", "function getStartingPositionOfCurrentWordInDiv(editableDiv) {\r\n\tvar caretPos = getCaretPositionInDiv(editableDiv);\r\n\tvar curLetter = getCharAtPosInDiv(editableDiv, caretPos);\r\n\tvar curPos = caretPos;\r\n\r\n\tdo {\r\n\t\tcurPos = curPos-1;\r\n\t\tcurLetter\t= getCharAtPosInDiv(editableDiv, curPos);\r\n\r\n\t} while (curLetter != ' ' && curPos > 0);\r\n\treturn curPos==0 ? 0:curPos+1;\r\n}", "get textOffset() {\n return this.pos - this.path[this.path.length - 1];\n }", "function caretPos(el) {\n\t\tif (\"selection\" in document) {\n\t\t\tvar range = el.createTextRange();\n\t\t\ttry {\n\t\t\t\trange.setEndPoint(\"EndToStart\", document.selection.createRange());\n\t\t\t} catch (e) {\n\t\t\t\t// Catch IE failure here, return 0 like\n\t\t\t\t// other browsers\n\t\t\t\treturn 0;\n\t\t\t}\n\t\t\treturn range.text.length;\n\t\t} else if (el.selectionStart != null) {\n\t\t\treturn el.selectionStart;\n\t\t}\n\t}", "get selectionStart() { return this.selectionStartIn; }", "function doGetCaretPosition(oField) {\n var iCaretPos = 0;\n if (document.selection) {\n oField.focus ();\n var oSel = document.selection.createRange();\n oSel.moveStart ('character', -oField.value.length);\n iCaretPos = oSel.text.length;\n } else if (oField.selectionStart || oField.selectionStart == '0') {\n iCaretPos = oField.selectionStart;\n }\n return (iCaretPos);\n }", "function doGetCaretPosition(oField) {\n\t\tvar iCaretPos = 0;\n\t\tif (document.selection) {\n\t\t\tif (!oField.is(':focus')) {\n\t\t\t\toField.focus();\n\t\t\t}\n\t\t\tvar oSel = document.selection.createRange();\n\t\t\toSel.moveStart('character', -oField.value.length);\n\t\t\tiCaretPos = oSel.text.length;\n\t\t} else if (oField.selectionStart || oField.selectionStart == '0') {\n\t\t\tiCaretPos = oField.selectionStart;\n\t\t}\n\t\treturn (iCaretPos);\n\t}", "function getCaretPos (field) {\n\n\t\tvar pos = 0;\n\n\t\t// IE\n\t\tif (document.selection) {\n\t\t\tfield.focus(); \t\t\t\t\t\t\t\t\t\t// Set focus on element\n\t\t\tvar sel = document.selection.createRange(); \t\t// Get empty selection range\n\t\t\tsel.moveStart('character', -field.value.length); \t// Move selection to 0 position\n\t\t\tpos = sel.text.length; \t\t\t\t\t\t\t\t// The caret position is selection length\n\t\t}\n\n\t\t// Firefox\n\t\telse if (field.selectionStart || field.selectionStart == '0')\n\t\t\tpos = field.selectionStart;\n\n\t\treturn pos;\n\t}", "function getCaretPos(el) { \n\tif (el.selectionStart) { \n\t\treturn el.selectionStart; \n\t} else if (document.selection) { \n\t\tel.focus(); \n\t\n\t\tvar r = document.selection.createRange(); \n\t\tif (r == null) { \n\t\t\treturn 0; \n\t\t} \n\t\n\t\tvar re = el.createTextRange(), \n\t\trc = re.duplicate(); \n\t\tre.moveToBookmark(r.getBookmark()); \n\t\trc.setEndPoint('EndToStart', re); \n\t\n\t\treturn rc.text.length; \n\t} \n\treturn 0;\n}", "getStartOffset(paragraph) {\n let startOffset = 0;\n if (paragraph.childWidgets.length > 0) {\n let childWidgets = paragraph.childWidgets[0];\n return this.getStartLineOffset(childWidgets);\n }\n return startOffset;\n }", "function getTextPositionOffset(parent, child, offset) {\n var range = document.createRange()\n , selection\n , contents\n\n if (!child) {\n selection = window.getSelection();\n child = selection.focusNode || parent;\n offset = selection.focusOffset || 0;\n }\n\n range.setStart(parent, 0);\n range.setEnd(child, offset);\n contents = range.cloneContents();\n\n return contents.textContent.trimLeft().length + contents.childNodes.length - 1;\n}", "get start() {\n return this.selector('TextPositionSelector').start;\n }", "get start() {\n return this.selector('TextPositionSelector').start;\n }", "function getPosition() {\n return _character.getPosition();\n }", "function getOffset(el) {\n var rect = el.getBoundingClientRect();\n return {\n left: rect.left + rect.width / 2\n };\n}", "peek() {\n return this.input.charAt(this.pos);\n }", "GetCursorStartPos()\n {\n let win = this.getCurrentWindowRead();\n return Vec2.Subtract(win.DC.CursorStartPos, win.Pos);\n }", "get begin() {\n if (this._positions.anchor < this._positions.focus) {\n return this._positions.anchor\n }\n\n return this._positions.focus\n }", "offset() {\n if (this.overlap) return this.dot ? 8 : 12;\n return this.dot ? 2 : 4;\n }", "function getFirstVisiblePosition(el) {\r\n var firstVisibleTextChild = isTextNode(el) ? el : getFirstVisibleTextNode(el);\r\n var curDocument = findDocument(el);\r\n var range = curDocument.createRange();\r\n if (firstVisibleTextChild) {\r\n range.selectNodeContents(firstVisibleTextChild);\r\n return calculatePositionByNodeAndOffset(el, { node: firstVisibleTextChild, offset: range.startOffset });\r\n }\r\n return 0;\r\n }", "getRange(selection) {\n const range = codeChunkContainingPoint('cell', this.editor, this.getCursorPositionForSelection(selection));\n return range.translate(\n [0, 0],\n [this.isA(), 0],\n );\n }", "function computeOffset(position, data) {\n let line = position.line;\n let column = position.column + 1;\n for (let i = 0; i < data.length; i++) {\n if (line > 1) {\n /* not yet on the correct line */\n if (data[i] === \"\\n\") {\n line--;\n }\n }\n else if (column > 1) {\n /* not yet on the correct column */\n column--;\n }\n else {\n /* line/column found, return current position */\n return i;\n }\n }\n /* istanbul ignore next: should never reach this line unless espree passes bad\n * positions, no sane way to test */\n throw new Error(\"Failed to compute location offset from position\");\n}", "function getOffset(el) {\n const rect = el.getBoundingClientRect();\n return {\n left: rect.left,\n top: rect.top\n };\n }", "function getOffset(cursor, defaultOffset) {\n if (typeof cursor === 'undefined' || cursor === null) {\n return defaultOffset;\n }\n\n let offset = cursorToOffset(cursor);\n if (isNaN(offset)) {\n return defaultOffset;\n }\n\n return offset;\n}", "function getchar(position){\n return $(position).text();\n}", "getUntilChar(char) {\n const currIndex = this.index;\n var finalIndex = currIndex;\n while (this.currentChar != char && this.index < this.length) {\n this.consume();\n finalIndex = this.index;\n }\n return this.string.substring(currIndex, finalIndex);\n }", "getPreviousValidOffset(paragraph, offset) {\n if (offset === 0) {\n return 0;\n }\n let validOffset = 0;\n let count = 0;\n let value = 0;\n let bidi = paragraph.paragraphFormat.bidi;\n for (let i = 0; i < paragraph.childWidgets.length; i++) {\n let lineWidget = paragraph.childWidgets[i];\n if (!bidi) {\n for (let j = 0; j < lineWidget.children.length; j++) {\n let inline = lineWidget.children[j];\n if (inline.length === 0) {\n continue;\n }\n if (offset <= count + inline.length) {\n return offset - 1 === count ? validOffset : offset - 1;\n }\n if (inline instanceof TextElementBox || inline instanceof ImageElementBox\n || (inline instanceof FieldElementBox && HelperMethods.isLinkedFieldCharacter(inline))) {\n validOffset = count + inline.length;\n }\n count += inline.length;\n }\n }\n else {\n value = lineWidget.getInlineForOffset(offset, false, undefined, false, true, false).index;\n if (value >= 0) {\n return value;\n }\n }\n }\n return offset - 1 === count ? validOffset : offset - 1;\n }", "function getCaret(el) { \n if (el.selectionStart) { \n return el.selectionStart; \n } else if (document.selection) { \n el.focus(); \n\n var r = document.selection.createRange(); \n if (r === null) { \n return 0; \n } \n\n var re = el.createTextRange(), \n rc = re.duplicate(); \n re.moveToBookmark(r.getBookmark()); \n rc.setEndPoint('EndToStart', re); \n\n return rc.text.length; \n } \n return 0; \n}", "function GetCaretStart(obj)\n{\n\tif(typeof obj.selectionStart != \"undefined\")\n\t{\n\t\treturn obj.selectionStart;\n\t}\n\telse if(document.selection&&document.selection.createRange)\n\t{\n\t\tvar M=document.selection.createRange();\n\t\ttry\n\t\t{\n\t\t\tvar Lp = M.duplicate();\n\t\t\tLp.moveToElementText(obj);\n\t\t}\n\t\tcatch(e)\n\t\t{\n\t\t\tvar Lp = obj.createTextRange();\n\t\t}\n\t\tLp.setEndPoint(\"EndToStart\",M);\n\t\tvar rb = Lp.text.length;\n\t\tif(rb > obj.value.length)\n\t\t{\n\t\t\treturn -1;\n\t\t}\n\t\treturn rb;\n\t}\n}", "function excerptStart(mention) {\n var i = sentenceRe.lastIndex = Math.max(mention.section.i, mention.i - 80), match;\n while (match = sentenceRe.exec(mention.section.speech.text)) {\n if (match.index < mention.i - 20) return match.index + match[0].length;\n if (i <= mention.section.i) break;\n sentenceRe.lastIndex = i = Math.max(mention.section.i, i - 20);\n }\n return mention.section.i;\n }", "function excerptStart(mention) {\n var i = sentenceRe.lastIndex = Math.max(mention.section.i, mention.i - 80), match;\n while (match = sentenceRe.exec(mention.section.speech.text)) {\n if (match.index < mention.i - 20) return match.index + match[0].length;\n if (i <= mention.section.i) break;\n sentenceRe.lastIndex = i = Math.max(mention.section.i, i - 20);\n }\n return mention.section.i;\n }", "function excerptStart(mention) {\n var i = sentenceRe.lastIndex = Math.max(mention.section.i, mention.i - 80), match;\n while (match = sentenceRe.exec(mention.section.speech.text)) {\n if (match.index < mention.i - 20) return match.index + match[0].length;\n if (i <= mention.section.i) break;\n sentenceRe.lastIndex = i = Math.max(mention.section.i, i - 20);\n }\n return mention.section.i;\n }", "function excerptStart(mention) {\n var i = sentenceRe.lastIndex = Math.max(mention.section.i, mention.i - 80), match;\n while (match = sentenceRe.exec(mention.section.speech.text)) {\n if (match.index < mention.i - 20) return match.index + match[0].length;\n if (i <= mention.section.i) break;\n sentenceRe.lastIndex = i = Math.max(mention.section.i, i - 20);\n }\n return mention.section.i;\n }", "function excerptStart(mention) {\n var i = sentenceRe.lastIndex = Math.max(mention.section.i, mention.i - 80), match;\n while (match = sentenceRe.exec(mention.section.speech.text)) {\n if (match.index < mention.i - 20) return match.index + match[0].length;\n if (i <= mention.section.i) break;\n sentenceRe.lastIndex = i = Math.max(mention.section.i, i - 20);\n }\n return mention.section.i;\n }", "function excerptStart(mention) {\n var i = sentenceRe.lastIndex = Math.max(mention.section.i, mention.i - 80), match;\n while (match = sentenceRe.exec(mention.section.speech.text)) {\n if (match.index < mention.i - 20) return match.index + match[0].length;\n if (i <= mention.section.i) break;\n sentenceRe.lastIndex = i = Math.max(mention.section.i, i - 20);\n }\n return mention.section.i;\n }", "function excerptStart(mention) {\n var i = sentenceRe.lastIndex = Math.max(mention.section.i, mention.i - 80), match;\n while (match = sentenceRe.exec(mention.section.speech.text)) {\n if (match.index < mention.i - 20) return match.index + match[0].length;\n if (i <= mention.section.i) break;\n sentenceRe.lastIndex = i = Math.max(mention.section.i, i - 20);\n }\n return mention.section.i;\n }", "function excerptStart(mention) {\n var i = sentenceRe.lastIndex = Math.max(mention.section.i, mention.i - 80), match;\n while (match = sentenceRe.exec(mention.section.speech.text)) {\n if (match.index < mention.i - 20) return match.index + match[0].length;\n if (i <= mention.section.i) break;\n sentenceRe.lastIndex = i = Math.max(mention.section.i, i - 20);\n }\n return mention.section.i;\n }", "function excerptStart(mention) {\n var i = sentenceRe.lastIndex = Math.max(mention.section.i, mention.i - 80), match;\n while (match = sentenceRe.exec(mention.section.speech.text)) {\n if (match.index < mention.i - 20) return match.index + match[0].length;\n if (i <= mention.section.i) break;\n sentenceRe.lastIndex = i = Math.max(mention.section.i, i - 20);\n }\n return mention.section.i;\n }", "function excerptStart(mention) {\n var i = sentenceRe.lastIndex = Math.max(mention.section.i, mention.i - 80), match;\n while (match = sentenceRe.exec(mention.section.speech.text)) {\n if (match.index < mention.i - 20) return match.index + match[0].length;\n if (i <= mention.section.i) break;\n sentenceRe.lastIndex = i = Math.max(mention.section.i, i - 20);\n }\n return mention.section.i;\n }", "function excerptStart(mention) {\n var i = sentenceRe.lastIndex = Math.max(mention.section.i, mention.i - 80), match;\n while (match = sentenceRe.exec(mention.section.speech.text)) {\n if (match.index < mention.i - 20) return match.index + match[0].length;\n if (i <= mention.section.i) break;\n sentenceRe.lastIndex = i = Math.max(mention.section.i, i - 20);\n }\n return mention.section.i;\n }", "function excerptStart(mention) {\n var i = sentenceRe.lastIndex = Math.max(mention.section.i, mention.i - 80), match;\n while (match = sentenceRe.exec(mention.section.speech.text)) {\n if (match.index < mention.i - 20) return match.index + match[0].length;\n if (i <= mention.section.i) break;\n sentenceRe.lastIndex = i = Math.max(mention.section.i, i - 20);\n }\n return mention.section.i;\n }", "function excerptStart(mention) {\n var i = sentenceRe.lastIndex = Math.max(mention.section.i, mention.i - 80), match;\n while (match = sentenceRe.exec(mention.section.speech.text)) {\n if (match.index < mention.i - 20) return match.index + match[0].length;\n if (i <= mention.section.i) break;\n sentenceRe.lastIndex = i = Math.max(mention.section.i, i - 20);\n }\n return mention.section.i;\n }", "function excerptStart(mention) {\n var i = sentenceRe.lastIndex = Math.max(mention.section.i, mention.i - 80), match;\n while (match = sentenceRe.exec(mention.section.speech.text)) {\n if (match.index < mention.i - 20) return match.index + match[0].length;\n if (i <= mention.section.i) break;\n sentenceRe.lastIndex = i = Math.max(mention.section.i, i - 20);\n }\n return mention.section.i;\n }", "function excerptStart(mention) {\n var i = sentenceRe.lastIndex = Math.max(mention.section.i, mention.i - 80), match;\n while (match = sentenceRe.exec(mention.section.speech.text)) {\n if (match.index < mention.i - 20) return match.index + match[0].length;\n if (i <= mention.section.i) break;\n sentenceRe.lastIndex = i = Math.max(mention.section.i, i - 20);\n }\n return mention.section.i;\n }", "function excerptStart(mention) {\n var i = sentenceRe.lastIndex = Math.max(mention.section.i, mention.i - 80), match;\n while (match = sentenceRe.exec(mention.section.speech.text)) {\n if (match.index < mention.i - 20) return match.index + match[0].length;\n if (i <= mention.section.i) break;\n sentenceRe.lastIndex = i = Math.max(mention.section.i, i - 20);\n }\n return mention.section.i;\n }", "function excerptStart(mention) {\n var i = sentenceRe.lastIndex = Math.max(mention.section.i, mention.i - 80), match;\n while (match = sentenceRe.exec(mention.section.speech.text)) {\n if (match.index < mention.i - 20) return match.index + match[0].length;\n if (i <= mention.section.i) break;\n sentenceRe.lastIndex = i = Math.max(mention.section.i, i - 20);\n }\n return mention.section.i;\n }", "function excerptStart(mention) {\n var i = sentenceRe.lastIndex = Math.max(mention.section.i, mention.i - 80), match;\n while (match = sentenceRe.exec(mention.section.speech.text)) {\n if (match.index < mention.i - 20) return match.index + match[0].length;\n if (i <= mention.section.i) break;\n sentenceRe.lastIndex = i = Math.max(mention.section.i, i - 20);\n }\n return mention.section.i;\n }" ]
[ "0.68109906", "0.65578", "0.63603795", "0.6280547", "0.6275719", "0.62400013", "0.6212487", "0.607922", "0.60775465", "0.6075039", "0.6062073", "0.60516286", "0.60412747", "0.60324687", "0.6024554", "0.6019764", "0.60101163", "0.60079426", "0.6006103", "0.59962153", "0.59952617", "0.5992597", "0.5982163", "0.59506184", "0.5939593", "0.5914668", "0.59066564", "0.5897421", "0.5889063", "0.5889063", "0.5836717", "0.58193165", "0.5801269", "0.5801269", "0.5801269", "0.5801269", "0.5801269", "0.5801269", "0.5801269", "0.5801269", "0.5801269", "0.5801269", "0.5801269", "0.5801269", "0.5801269", "0.5801269", "0.57945436", "0.5790807", "0.57898366", "0.578491", "0.57750463", "0.57745785", "0.57721883", "0.5771", "0.5770213", "0.57630306", "0.5757556", "0.57571554", "0.5751159", "0.5746532", "0.573156", "0.573156", "0.5722313", "0.5716749", "0.5707675", "0.56987077", "0.56959414", "0.5673984", "0.566779", "0.5663707", "0.56589586", "0.56264246", "0.5619343", "0.56150454", "0.56096077", "0.56073695", "0.56071067", "0.560531", "0.560338", "0.560338", "0.560338", "0.560338", "0.560338", "0.560338", "0.560338", "0.560338", "0.560338", "0.560338", "0.560338", "0.560338", "0.560338", "0.560338", "0.560338", "0.560338", "0.560338", "0.560338" ]
0.7644563
3
Get the current position.
function now() { var pos = {line: line, column: column}; pos.offset = self.toOffset(pos); return pos; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getCurrentPosition() {\n return $._getCurrentPosition();\n}", "function getPos() {\n\t\treturn _this.position;\n\t}", "function getPosition() {\n return _character.getPosition();\n }", "async getPosition() {\n return this._position;\n }", "getPosition() {\n return this._lastPosition;\n }", "get_position() {\n return this.liveFunc._position;\n }", "getPosition() {\n\t\t\tconst {overrides} = this.impl;\n\t\t\tif (overrides !== undefined) {\n\t\t\t\treturn overrides.getPosition(this);\n\t\t\t}\n\n\t\t\tconst index = this.getIndex();\n\t\t\tconst cached = this.indexTracker.cachedPositions.get(index.valueOf());\n\t\t\tif (cached !== undefined) {\n\t\t\t\treturn cached;\n\t\t\t}\n\n\t\t\tconst pos = {\n\t\t\t\tline: this.currLine,\n\t\t\t\tcolumn: this.currColumn,\n\t\t\t};\n\t\t\tthis.indexTracker.setPositionIndex(pos, index);\n\t\t\treturn pos;\n\t\t}", "function getCurrentPosition()\n\t\t{\n\t\t\tlet currentTransformValues = getCurrentGroupTransformValues(),\n\t\t\t\tviewBoxCoordinates = { x: currentTransformValues.translateX, y: currentTransformValues.translateY },\n\t\t\t\tworldCoordinates = { x: viewBoxCoordinates.x / ViewBoxScaleFactor, y: viewBoxCoordinates.y / ViewBoxScaleFactor },\n\t\t\t\tcurrentPosition =\n\t\t\t\t\t{\n\t\t\t\t\t\tviewBoxCoordinates: viewBoxCoordinates,\n\t\t\t\t\t\tworldCoordinates: worldCoordinates,\n\t\t\t\t\t\tflip: (currentTransformValues.scaleX < 0) ? -1 : 1,\n\t\t\t\t\t\tangle: currentTransformValues.rotateAngle\n\t\t\t\t\t};\n\t\t\treturn currentPosition;\n\t\t} // end getCurrentPosition()", "get position() {\n\t\t\treturn {x: this.x, y: this.y};\n\t\t}", "get position() {\n\t\treturn this.state.sourcePosition;\n\t}", "get position() {\n\t\treturn this._position.object;\n\t}", "get position() {\n return this._position;\n }", "currentPointerPosition(e) {\n const [x, y] = Mouse.rel(e);\n return this.positionToSequence({\n xPos: x,\n yPos: y,\n });\n }", "getCursorPosition() {\n const _pos = this.editor.selection.active;\n return new mte_kernel_1.Point(_pos.line, _pos.character);\n }", "get position() {\n if (!position ||\n (Date.now() - position.timestamp > positionTTL)) {\n\n updatePosition();\n }\n\n return position;\n }", "get position() { return this._position; }", "get position() { return this._position; }", "get current() {\n return this.strand.at(this.cursor);\n }", "getPos() {\n return this.positions;\n }", "function getPosition() {\n let position = document.getElementById(getyx(y,x));\n\treturn position;\n}", "pos() {\n if (this.is_vertex()) {\n return this.position;\n } else {\n return this.offset;\n }\n }", "get currentAbsoluteOffset() {\n return this.absoluteOffset + this.inputIndex;\n }", "get currentAbsoluteOffset() {\n return this.absoluteOffset + this.inputIndex;\n }", "function translator_getPosition()\n{\n var position = this.parser.getPosition();\n return position - this.offsetAdj;\n}", "position() {\n return VrMath.getTranslation(this.headMatrix);\n }", "getCurrentScrollPosition() {\n return this._state;\n }", "get position() {\n return {x: this.x, y: this.y}\n }", "function now() {\n var pos = {line: line, column: column}\n\n pos.offset = self.toOffset(pos)\n\n return pos\n }", "function processCurrentposition(data) {\n var pos = parseInt(data);\n setPosition(pos);\n}", "function pos() {\n return RTG_VCF_RECORD.getOneBasedStart();\n }", "getCurrent() \r\n\t{\r\n\t\treturn this.current;\r\n\t}", "getLocation() {\n return this.position;\n }", "get position() {\n return {\n x: this.x,\n y: this.y\n };\n }", "addr() {\n return this.pos;\n }", "addr() {\n return this.pos;\n }", "function getcurentposition() {\n\tnavigator.geolocation.getCurrentPosition(GeoOnSuccess, GeoOnError, {enableHighAccuracy: true});\n}", "getNewPos(){\n return this.newPos;\n }", "getCursorPos(){\n let posVector = {\n \"x\":this.activePointer.x,\n \"y\":this.activePointer.y\n }\n return posVector;\n }", "presentPosition() {\n\t\treturn this.positionContainer.length > 0 ? this.positionContainer[this.positionContainer.length - 1] : null;\n\t}", "getPlayerPosition() {\n return this.player.position;\n }", "get position() {\n const now = this.now();\n const ticks = this._clock.getTicksAtTime(now);\n return new TicksClass(this.context, ticks).toBarsBeatsSixteenths();\n }", "function geoGetCurrentPos() {\n return new Promise((resolve, reject) => {\n navigator.geolocation.getCurrentPosition((position) => {\n resolve(position);\n }, () => {\n reject(new Error('Unable to fetch location.'));\n });\n });\n }", "function _getCurrent(){\n return current || null;\n }", "function TimelinePosCur() {\n var pos = null;\n for (var i = 0, len = tw.timeline.length; i < len; i++) {\n if (tw.timeline[i].time > tw.tCur) {\n pos = i - 1;\n break;\n }\n }\n // Case: no any value when get value-end in Timeline array[]\n if (pos === null)\n pos = tw.timeline.length - 1;\n // Store position of Animation\n tw.timePosCur = pos;\n }", "function currentPos(ele, mode, direction) {\n var pos = 0;\n direction || (direction = \"left\");\n if ([\"left\", \"top\"].indexOf(direction) === -1) return 0;\n if (mode === \"transition\" && ele.style.transform) {\n pos = ele.style.transform.match(/\\((-?\\d+)px\\)/i);\n return (pos && pos.length >= 2) ? parseInt(pos[1]) : 0;\n }\n if (mode === \"step\") {\n return parseInt(ele.style[direction] === \"\" ? 0 : ele.style[direction]);\n }\n return 0;\n }", "_current() {\n return this._history[this.index];\n }", "get cursorX() {\n\t\treturn this._cursorPos[0];\n\t}", "get_position() {\r\n return {\r\n x_pos: this.sprite.x_pos,\r\n y_pos: this.sprite.y_pos\r\n };\r\n }", "function pos() {\r\n var p = _pfa(arguments);\r\n\r\n if (p) {\r\n self.moveTo(p.x, p.y);\r\n }\r\n\r\n return new Pos(ie ? self.screenLeft : self.screenX,\r\n ie ? self.screenTop : self.screenY);\r\n}", "function _calcCurrentPos() {\n\t\t\treturn _settings.wrapper ? Math.ceil( _settings.wrapper.scrollTop() ) : Math.ceil( $( window ).scrollTop() );\n\t\t}", "get targetPosition() {}", "_positionToCurrent(position) {\n const { start, end } = this._moving;\n const { step, min, max, rtl } = this.props;\n\n if (position < start) {\n position = start;\n } else if (position > end) {\n position = end;\n }\n let percent = getPercent(start, end, position);\n percent = rtl ? 100 - percent : percent;\n // reset by step\n const newValue = parseFloat(\n (Math.round(((percent / 100) * (max - min)) / step) * step).toFixed(getPrecision(step))\n );\n const currentValue = (min + newValue).toFixed(getPrecision(step));\n\n return Number(currentValue);\n }", "function _pos() {\r\n var p = _pfa(arguments);\r\n if (p) {\r\n this.p = absPos(this, p);\r\n }\r\n return objCss(this, \"position\") == \"absolute\" ? this.p : absPos(this);\r\n}", "getCursorPosition() {\n return this.cursorPosition;\n }", "position() {\n return this._positionBuilder;\n }", "get startingPositionInput() {\n return this._startingPosition;\n }", "function currentCoord() {\n\treturn game_data.village.coord;\n}", "function getInitialPos() {\n\n if(!fixed) {\n initialPos = $elem.position();\n }\n\n return initialPos;\n\n }", "GetCursorStartPos()\n {\n let win = this.getCurrentWindowRead();\n return Vec2.Subtract(win.DC.CursorStartPos, win.Pos);\n }", "get pos()\n\t{\n\t\treturn new NodeGraph.Position(this.x, this.y);\n\t}", "setLastPos() {\n this.previousPos = this.getCurrentPosition();\n }", "function Position_GetPosition(html)\n{\n\t//done!\n\treturn new Position_Rect(Browser_GetLeft(html), Browser_GetTop(html), Browser_GetOffsetWidth(html), Browser_GetOffsetHeight(html));\n}", "function getPosition() {\n return n.attr(\"T\")\n }", "function getPosition(position) {\n\t\treturn board[position];\n\t}", "GetCursorPos()\n {\n let win = this.getCurrentWindowRead();\n return new Vec2(win.DC.CursorPos.x - win.Pos.x + win.Scroll.x,\n win.DC.CursorPos.y - win.Pos.y + win.Scroll.y);\n }", "getCenterPosition() {\n\t\tlet center = this.getCenter();\n\t\treturn {\n\t\t\tx: this.x + center.x,\n\t\t\ty: this.y + center.y\n\t\t};\n\t}", "get position() {\n return this._boundingBox.topLeft.rotate(this.rotation, this.pivot);\n }", "function pos_actuelle()\n {\n\treturn (joueurs[joueur_actuel].position);\n }", "function test() {\n var result = pos({})\n\n line = current.line\n column = current.column\n value = subvalue + value\n\n return result.position\n }", "getCurrent() {\n return this.entries[this.currentIndex];\n }", "getCurrent() {\n return this.entries[this.currentIndex];\n }", "function getUserPos()\r\n{\r\n\treturn userPos;\r\n}", "get position()\n\t{\n\t\texchWebService.commonAbFunctions.logInfo(\"exchangeAbFolderDirectory: get position\\n\");\n\t\treturn 2;\n\t}", "function getCurrentIndex() {\n\t\treturn currentIndex;\n\t}", "get position() {\n return this.chunkPosition + this.i;\n }", "function currentYPosition() {\n // Firefox, Chrome, Opera, Safari\n if (self.pageYOffset) {\n return self.pageYOffset;\n }\n // Internet Explorer 6 - standards mode\n if (document.documentElement && document.documentElement.scrollTop) {\n return document.documentElement.scrollTop;\n }\n // Internet Explorer 6, 7 and 8\n if (document.body.scrollTop) {\n return document.body.scrollTop;\n }\n return 0;\n}", "function getCurPos() {\n let xPos = event.offsetX;\n let yPos = event.offsetY;\n //for each selected==true ? card chang its position : nothing\n player.cards.onHand.forEach(element => {\n if (element.selected) {\n element.speaking = false;\n let distanceX = element.width / 2;\n let distanceY = element.height / 2;\n element.x = xPos - distanceX;\n element.y = yPos - distanceY;\n }\n });\n}", "get cursorPrevX() {\n\t\treturn this._cursorPrevPos[0];\n\t}", "getPos() {\n return {\n x : this.getX(),\n y : this.getY(),\n deg : this.getDeg(),\n scale : this.getScale(),\n turnover : this.getTurnover(),\n }\n }", "get left(): number {\n return this.position.x\n }", "get begin() {\n if (this._positions.anchor < this._positions.focus) {\n return this._positions.anchor\n }\n\n return this._positions.focus\n }", "get left() {\n // origin is at top left so just return x\n return this.x\n }", "function getPos_x(){\n return x;\n}", "getInitialPosition(){\n return new Position(this.width/2, this.height - 6);\n }", "function getPosition() {\n\n\t//change time box to show updated message\n\t$('#time').val(\"Getting data...\");\n\n\t//instruct location service to get position with appropriate callbacks\n\tnavigator.geolocation.getCurrentPosition(successPosition, failPosition);\n}", "function getPosition(elem) {\n if (!elem.offsetParent) {\n return null;\n }\n var rect = elem.getBoundingClientRect();\n return {\n left: rect.left, \n top: rect.top\n };\n }", "function getCursorPosition() {\n var selection = window.getSelection();\n return {\n node: selection.anchorNode,\n offset: selection.anchorOffset\n };\n }", "function damePosicion () {\n return miMarcador[0].getPosition()\n }", "function getTimePosition() {\n mopidy.playback.getTimePosition()\n .then(processCurrentTimePosition, consoleError);\n}", "function test() {\n var result = pos({});\n\n line = current.line;\n column = current.column;\n value = subvalue + value;\n\n return result.position;\n }", "function test() {\n var result = pos({});\n\n line = current.line;\n column = current.column;\n value = subvalue + value;\n\n return result.position;\n }", "function test() {\n var result = pos({});\n\n line = current.line;\n column = current.column;\n value = subvalue + value;\n\n return result.position;\n }", "function test() {\n var result = pos({});\n\n line = current.line;\n column = current.column;\n value = subvalue + value;\n\n return result.position;\n }", "function test() {\n var result = pos({});\n\n line = current.line;\n column = current.column;\n value = subvalue + value;\n\n return result.position;\n }", "function getPlayerLocation() {\n\t\tTitanium.Geolocation.getCurrentPosition( updatePlayerPosition );\n\t}", "get xPosition() { return this._xPosition; }" ]
[ "0.8059421", "0.7960642", "0.788338", "0.7707294", "0.75241387", "0.7512489", "0.7508141", "0.73519945", "0.7219399", "0.7159119", "0.7157245", "0.7149591", "0.71272236", "0.70371795", "0.70171124", "0.7005105", "0.7005105", "0.7004674", "0.6965421", "0.6886338", "0.6807483", "0.68041927", "0.68041927", "0.678062", "0.6779578", "0.6723054", "0.6702111", "0.668678", "0.6668834", "0.66275185", "0.6624051", "0.66020375", "0.65974784", "0.6585126", "0.6585126", "0.65829223", "0.65777636", "0.65709406", "0.65701437", "0.65684783", "0.65321255", "0.65266854", "0.65210825", "0.65085834", "0.64948344", "0.6490388", "0.6478958", "0.6471457", "0.6465249", "0.6456651", "0.6451986", "0.6445536", "0.64434344", "0.6440019", "0.64332324", "0.64321446", "0.64197206", "0.6416148", "0.6406501", "0.6389355", "0.6387651", "0.6382818", "0.63722295", "0.6370634", "0.63686043", "0.6327088", "0.6322699", "0.6308519", "0.6306937", "0.62995", "0.62995", "0.62991655", "0.6294919", "0.62881595", "0.6285495", "0.627974", "0.62796223", "0.6279397", "0.6274087", "0.6264246", "0.6252497", "0.6245192", "0.62410825", "0.62299013", "0.62237597", "0.6216041", "0.6214639", "0.62118566", "0.6211515", "0.6205362", "0.6205362", "0.6205362", "0.6205362", "0.6205362", "0.6202819", "0.62003267" ]
0.668909
31
Store position information for a node.
function Position(start) { this.start = start; this.end = now(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "setNodePosition(Pos, node) {\n let currrentNode = this.nodes.find(n => n === node);\n currrentNode.x = Pos.x;\n currrentNode.y = Pos.y;\n }", "savePosition() {\n this.savedX = this.x;\n this.savedY = this.y;\n }", "function savePositions () {\n var updateTheseNodes = {};\n\n // store indices for all fixed nodes\n for (var key in data) {\n updateTheseNodes[key] = {\n 'fixedNodes': {},\n 'unfixedNodes': {}\n };\n if (data.hasOwnProperty(key)) {\n d3.select(\"#vis\" + key).selectAll(\".node\").each(function(d, i) {\n // we need to name the nodes so we can identify them on the server; indices don't suffice\n if(d.fixed) updateTheseNodes[key].fixedNodes[\"n\" + i] = {\"x\": d.x, \"y\": d.y};\n else updateTheseNodes[key].unfixedNodes[\"n\" + i] = true;\n });\n }\n }\n\n // send fixed node indices to the server to save\n $.ajax({\n url: \"/assignments/updatePositions/\"+assignmentNumber,\n type: \"post\",\n data: updateTheseNodes\n }).done(function(status) {\n if(status == 'OK'){\n alertMessage(\"Node positions saved!\", \"success\");\n } else {\n alertMessage(\"Unsuccessful. Try logging in!\", \"danger\");\n }\n });\n}", "function node_position(node){\n params = {\n x: node.getX() - node.getOffsetX(),\n y: node.getY() - node.getOffsetY(),\n width: node.getWidth() * node.getScaleX(),\n height: node.getHeight() * node.getScaleY()\n };\n\n return params;\n}", "get pos()\n\t{\n\t\treturn new NodeGraph.Position(this.x, this.y);\n\t}", "saveNodesPositions() {\n if (this.visualization && this.visualization.getNodesPositions) {\n const nodes = this.visualization.getNodesPositions();\n this.props.actions.setVisualizationNodesPosition(this.props.visualizationKey, nodes);\n }\n }", "assignPosition(node, position) {\n\t\tif(node.parentNode && position<node.parentNode.position){\n\t\t\tposition = node.parentNode.position;\n\t\t}\n\t\twhile(this.positionMap.get(`${node.level},${position}`)){\n\t\t\tposition++;\n\t\t}\n\t\tnode.position = position;\n\t\tthis.positionMap.set(`${node.level},${position}`, true);\n\t\tfor(var i in node.children){\n\t\t\tthis.assignPosition(node.children[i], position+Number(i));\n\t\t}\n\t}", "function savePosition()\r\n{\r\n\tvar pos = getPosition();\r\n\tMZ_setValue(numTroll+\".position.X\",pos[0]);\r\n\tMZ_setValue(numTroll+\".position.Y\",pos[1]);\r\n\tMZ_setValue(numTroll+\".position.N\",pos[2]);\r\n}", "function savePosition() {\n\t\tvar xhr = new XMLHttpRequest();\n\n\t\txhr.onreadystatechange = function() {\n\t\t\t// We stored the position, we'll store it again\n\t\t\tif (xhr.readyState == 4 && xhr.status == 200)\n\t\t\t\tsetTimeout(savePosition, SAVE_INTERVAL);\n\t\t};\n\n\t\txhr.open('POST', 'save-position.php', true);\n\t\txhr.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');\n\t\txhr.send('data=' + JSON.stringify(calcPos()));\n\t}", "assignPosition(node, position) {\n // update the position of the node\n node.position = position;\n \n // the base case\n if (node.children.length === 0)\n {\n leafNodeCounter = leafNodeCounter + 1;\n return node;\n }\n // recursive case\n else\n {\n leafNodeCounter = 0;\n for (var d = 0; d < node.children.length; d++)\n {\n // this is a really bad hack and there is definitely something better out there. \n // However, it gets the job done\n if (node.children[d].name === \"Protosomes\")\n {\n leafNodeCounter = leafNodeCounter + 2;\n }\n\n this.assignPosition(node.children[d], node.position + leafNodeCounter);\n }\n }\n\n }", "function writePosition(x,y){\n //first refer to the point and set the value\n database.ref('ball/position').set({\n 'x':position.x+x,\n 'y':position.y+y\n })\n}", "function storeNode(node) {\n // add reference between entity id and node\n if (node.elt.get('info')) {\n var entity = node.elt.get('info').entity;\n if (entity !== undefined) {\n if (nodes_by_entity_ids[entity] === undefined) {\n nodes_by_entity_ids[entity] = [node];\n } else {\n nodes_by_entity_ids[entity].push(node);\n }\n }\n }\n }", "handlePosition(node) {\n return 'middle top'; // sets the position of the handle in the format of \"X-AXIS Y-AXIS\" such as \"left top\", \"middle top\"\n }", "function savePosition(position) {\n // Update location copy text\n locBody.text = position.coords.latitude.toFixed(3) + \" , \" + position.coords.longitude.toFixed(3);\n // Log coordinates to console\n console.log(\n \"Latitude: \" + position.coords.latitude,\n \"Longitude: \" + position.coords.longitude\n );\n // Reset distance label copy text\n distBody.text = \"--\";\n // Update saved position variable\n savedPosition = position; // This belongs in the model.\n}", "updatePosition(position) {\n this.position = position;\n localStorage.setItem(\"position\", position);\n }", "function patch(node) {\n if (!node.position) {\n node.position = {}\n }\n}", "function writePosition(x,y){\n //set will set new values to the x and yinside the data base\n //position.x=recent position of the ball from the data base and x=new position of hypnotic ball on the canvas(when moved with w,a,s,d keys)\n database.ref('ball/position').set({\n 'x':position.x+x,\n 'y':position.y+y\n })\n\n}", "newPosition(position) {\n this.position = position;\n }", "function insertPositions() {\n $.each(rankingData, function(index, value) {\n rankingData[index].position = index + 1;\n });\n }", "get position() { return this._position; }", "get position() { return this._position; }", "newPosition(x, y)\n {\n this.x = x;\n this.y = y;\n }", "get position() {\n\t\t\treturn {x: this.x, y: this.y};\n\t\t}", "storeNode(node, id) {\n node._index_ = id;\n this.nodes.set(id, node);\n }", "set position (newPosition) {\n this.emit('position', newPosition)\n this._position = newPosition * this.ticksPerSongPosition\n }", "get position() {\n return this._position;\n }", "updatePosition(position) {\n if (position == null)\n return;\n const positionNodes = parseExpressions(position)[0].terms;\n for (let i = 0; i < 3; ++i) {\n this.position.setComponent(i, normalizeUnit(positionNodes[i]).number);\n }\n this.updateMatrixWorld();\n }", "updatePosition(position) {\n if (position == null)\n return;\n const positionNodes = parseExpressions(position)[0].terms;\n for (let i = 0; i < 3; ++i) {\n this.position.setComponent(i, normalizeUnit(positionNodes[i]).number);\n }\n }", "function writePosition(x,y){\n //updating the x and y position in the database\n database.ref(\"ball/position\").set({\n 'x': position.x + x, \n 'y': position.y + y\n })\n\n\n}", "function recordPosition(position) {\n var latitude = position.coords.latitude;\n var longitude = position.coords.longitude;\n\n Session.set('lat', latitude);\n Session.set('long', longitude);\n var savedlated = Session.get('lat');\n var savedlonged = Session.get('long');\n console.log(savedlated+ \",\" + savedlonged);\n console.log(latitude + \",\" + longitude);\n}", "function coordinates(){\n $('.info-top').html(posY);\n $('.info-left').html(posX);\n }", "function getPosition() {\n return n.attr(\"T\")\n }", "function processCurrentposition(data) {\n var pos = parseInt(data);\n setPosition(pos);\n}", "function positionTokenAtNode(token, node) {\n // these details depend on the node template\n token.location = node.position.copy().offset(4 + 6, 5 + 6);\n }", "function PositionData() {\r\n this.TerritoryType = ExtraTools.eTerritoryType.None;\r\n this.X = 0;\r\n this.Y = 0;\r\n this.Distribution = ExtraTools.eTerritoryDistribution.None;\r\n this.OasisBonus = ExtraTools.eOasisBonus.None;\r\n this.PlayerID = 0;\r\n this.PlayerName = null;\r\n this.AllyID = 0;\r\n this.AllyName = null;\r\n this.VillageName = null;\r\n this.VillagePoints = 0;\r\n this.Tribe = ExtraTools.eTribe.None;\r\n this.LastRaidDate = null;\r\n this.LastRaidHours = null;\r\n this.LastRaidResources = null;\r\n this.LastRaidMaxResources = null;\r\n}", "addPosition(pos) {\n this.positions += '=\"'+pos.line + ':' + pos.linePosition + '\",';\n }", "function storePosition(position) {\n console.log(\"Latitude: \" + position.coords.latitude + \" Longitude: \" + position.coords.longitude);\n \n localStorage.setItem('airport', 'ATL');\n localStorage.setItem('map', 'C');\n localStorage.setItem('destination', 'C33');\n localStorage.setItem('userLat', position.coords.latitude);\n localStorage.setItem('userLon', position.coords.longitude);\n\n console.log(localStorage.getItem('airport'));\n console.log(localStorage.getItem('map'));\n console.log(localStorage.getItem('destination'));\n console.log(localStorage.getItem('userLat'));\n console.log(localStorage.getItem('userLon'));\n}", "set pos(newPos) {\n this._pos = newPos;\n }", "SetNewPositionToANode(registeredPos) {\n this.setNodePosition(registeredPos.newValue, registeredPos.element);\n }", "savePosition(position) {\n const lat = position.coords.latitude\n const long = position.coords.longitude\n \n localStorage.setItem('lat', lat)\n localStorage.setItem('long', long)\n }", "function update_coords(index, position = null) {\n var history = document.getElementById(\"history\");\n var entry = history.rows[history.rows.length - 1];\n var coords = entry.insertCell(index);\n if (position) {\n coords.appendChild(document.createTextNode(pos_repr(position)));\n update_storage();\n }\n else {\n coords.appendChild(document.createTextNode(\"Locating...\"));\n navigator.geolocation.getCurrentPosition(function(position) {\n var coords_text = document.createTextNode(pos_repr(position));\n coords.removeChild(coords.childNodes[0]);\n coords.appendChild(coords_text);\n update_storage();\n }, function() {\n var coords_text = document.createTextNode(\"No geo data\");\n coords.removeChild(coords.childNodes[0]);\n coords.appendChild(coords_text);\n update_storage();\n });\n }\n\n}", "nodePosition() {\n if (this.tempPos.next == null) {\n return -1; // last pos\n } else if (this.tempPos.prev == null) {\n return 1; // first pos\n } else {\n return 0; // middle pos\n }\n }", "function position() {\n var before = now()\n\n return update\n\n // Add the position to a node.\n function update(node, indent) {\n var previous = node.position\n var start = previous ? previous.start : before\n var combined = []\n var n = previous && previous.end.line\n var l = before.line\n\n node.position = new Position(start)\n\n // If there was already a `position`, this node was merged. Fixing\n // `start` wasn’t hard, but the indent is different. Especially\n // because some information, the indent between `n` and `l` wasn’t\n // tracked. Luckily, that space is (should be?) empty, so we can\n // safely check for it now.\n if (previous && indent && previous.indent) {\n combined = previous.indent\n\n if (n < l) {\n while (++n < l) {\n combined.push((offset[n] || 0) + 1)\n }\n\n combined.push(before.column)\n }\n\n indent = combined.concat(indent)\n }\n\n node.position.indent = indent || []\n\n return node\n }\n }", "function get_node_map_position(node, map)\n{\n\tvar coor = new L.LatLng(node.Latitude, node.Longitude);\n\t\n\treturn \"translate(\"+ \n\t\tmap.latLngToLayerPoint(coor).x +\",\"+ \n\t\tmap.latLngToLayerPoint(coor).y +\")\";\n}", "function get_node_map_position(node, map)\n{\n\tvar coor = new L.LatLng(node.Latitude, node.Longitude);\n\t\n\treturn \"translate(\"+ \n\t\tmap.latLngToLayerPoint(coor).x +\",\"+ \n\t\tmap.latLngToLayerPoint(coor).y +\")\";\n}", "position (data) {\n\t\tthrow interfaceError('position')\n\t}", "function saveDiagramProperties() {\n myDiagram.model.modelData.position = go.Point.stringify(myDiagram.position);\n}", "updatePosition() {\n this.position = Utils.convertToEntityPosition(this.bmp);\n }", "setUserPosition(state, json) {\n state.lex.sessionAttributes.userPosition = json;\n state.lex.sessionAttributes.latitude = json.latitude;\n state.lex.sessionAttributes.longitude = json.longitude;\n }", "function storeposition() {\n if (calc < points) {\n numx.push(x);\n numy.push(y);\n calc += 1;\n } else {\n numx.splice(0, 1);\n numy.splice(0, 1);\n calc -= 1;\n }\n}", "function position(pos) {\n log.innerHTML = pos\n }", "function Legato_Structure_Position( top, right, bottom, left )\r\n{\r\n\r\n\t// Store the passed in parameters.\r\n\tthis.top = top;\r\n\tthis.right = right;\r\n\tthis.bottom = bottom;\r\n\tthis.left = left;\r\n\r\n}", "setPosition(x, y) {\n this.pos.x = x;\n this.pos.y = y;\n }", "function Position() {\n this.x = 0;\n this.y = 0;\n}", "function updateNodePositions() {\n // set node positions\n rect.attr('transform', function (d) {\n return 'translate(' + d.x + ',' + d.y + ')';\n });\n}", "function setNodesPosition(nodes) {\n var deferred = $.Deferred();\n if ( nodes.length == 0 ) { deferred.resolve(); return deferred.promise(); }\n var lab_filename = $('#lab-viewport').attr('data-path');\n var form_data = [];\n form_data=nodes;\n var url = '/api/labs' + lab_filename + '/nodes' ;\n var type = 'PUT';\n $.ajax({\n cache: false,\n timeout: TIMEOUT,\n type: type,\n url: encodeURI(url),\n dataType: 'json',\n data: JSON.stringify(form_data),\n success: function (data) {\n if (data['status'] == 'success') {\n logger(1, 'DEBUG: node position updated.');\n deferred.resolve();\n } else {\n // Application error\n logger(1, 'DEBUG: application error (' + data['status'] + ') on ' + type + ' ' + url + ' (' + data['message'] + ').');\n deferred.reject(data['message']);\n }\n },\n error: function (data) {\n // Server error\n var message = getJsonMessage(data['responseText']);\n logger(1, 'DEBUG: server error (' + data['status'] + ') on ' + type + ' ' + url + '.');\n logger(1, 'DEBUG: ' + message);\n deferred.reject(message);\n }\n });\n return deferred.promise();\n}", "function getPos() {\n\t\treturn _this.position;\n\t}", "function position() {\n var before = now();\n\n return update;\n\n /* Add the position to a node. */\n function update(node, indent) {\n var prev = node.position;\n var start = prev ? prev.start : before;\n var combined = [];\n var n = prev && prev.end.line;\n var l = before.line;\n\n node.position = new Position(start);\n\n /* If there was already a `position`, this\n * node was merged. Fixing `start` wasn’t\n * hard, but the indent is different.\n * Especially because some information, the\n * indent between `n` and `l` wasn’t\n * tracked. Luckily, that space is\n * (should be?) empty, so we can safely\n * check for it now. */\n if (prev && indent && prev.indent) {\n combined = prev.indent;\n\n if (n < l) {\n while (++n < l) {\n combined.push((offset[n] || 0) + 1);\n }\n\n combined.push(before.column);\n }\n\n indent = combined.concat(indent);\n }\n\n node.position.indent = indent || [];\n\n return node;\n }\n }", "function position() {\n var before = now();\n\n return update;\n\n /* Add the position to a node. */\n function update(node, indent) {\n var prev = node.position;\n var start = prev ? prev.start : before;\n var combined = [];\n var n = prev && prev.end.line;\n var l = before.line;\n\n node.position = new Position(start);\n\n /* If there was already a `position`, this\n * node was merged. Fixing `start` wasn’t\n * hard, but the indent is different.\n * Especially because some information, the\n * indent between `n` and `l` wasn’t\n * tracked. Luckily, that space is\n * (should be?) empty, so we can safely\n * check for it now. */\n if (prev && indent && prev.indent) {\n combined = prev.indent;\n\n if (n < l) {\n while (++n < l) {\n combined.push((offset[n] || 0) + 1);\n }\n\n combined.push(before.column);\n }\n\n indent = combined.concat(indent);\n }\n\n node.position.indent = indent || [];\n\n return node;\n }\n }", "function position() {\n var before = now();\n\n return update;\n\n /* Add the position to a node. */\n function update(node, indent) {\n var prev = node.position;\n var start = prev ? prev.start : before;\n var combined = [];\n var n = prev && prev.end.line;\n var l = before.line;\n\n node.position = new Position(start);\n\n /* If there was already a `position`, this\n * node was merged. Fixing `start` wasn’t\n * hard, but the indent is different.\n * Especially because some information, the\n * indent between `n` and `l` wasn’t\n * tracked. Luckily, that space is\n * (should be?) empty, so we can safely\n * check for it now. */\n if (prev && indent && prev.indent) {\n combined = prev.indent;\n\n if (n < l) {\n while (++n < l) {\n combined.push((offset[n] || 0) + 1);\n }\n\n combined.push(before.column);\n }\n\n indent = combined.concat(indent);\n }\n\n node.position.indent = indent || [];\n\n return node;\n }\n }", "function position() {\n var before = now();\n\n return update;\n\n /* Add the position to a node. */\n function update(node, indent) {\n var prev = node.position;\n var start = prev ? prev.start : before;\n var combined = [];\n var n = prev && prev.end.line;\n var l = before.line;\n\n node.position = new Position(start);\n\n /* If there was already a `position`, this\n * node was merged. Fixing `start` wasn’t\n * hard, but the indent is different.\n * Especially because some information, the\n * indent between `n` and `l` wasn’t\n * tracked. Luckily, that space is\n * (should be?) empty, so we can safely\n * check for it now. */\n if (prev && indent && prev.indent) {\n combined = prev.indent;\n\n if (n < l) {\n while (++n < l) {\n combined.push((offset[n] || 0) + 1);\n }\n\n combined.push(before.column);\n }\n\n indent = combined.concat(indent);\n }\n\n node.position.indent = indent || [];\n\n return node;\n }\n }", "function position() {\n var before = now();\n\n return update;\n\n /* Add the position to a node. */\n function update(node, indent) {\n var prev = node.position;\n var start = prev ? prev.start : before;\n var combined = [];\n var n = prev && prev.end.line;\n var l = before.line;\n\n node.position = new Position(start);\n\n /* If there was already a `position`, this\n * node was merged. Fixing `start` wasn’t\n * hard, but the indent is different.\n * Especially because some information, the\n * indent between `n` and `l` wasn’t\n * tracked. Luckily, that space is\n * (should be?) empty, so we can safely\n * check for it now. */\n if (prev && indent && prev.indent) {\n combined = prev.indent;\n\n if (n < l) {\n while (++n < l) {\n combined.push((offset[n] || 0) + 1);\n }\n\n combined.push(before.column);\n }\n\n indent = combined.concat(indent);\n }\n\n node.position.indent = indent || [];\n\n return node;\n }\n }", "function setPosition(e) {\n pos.x = e.clientX;\n pos.y = e.clientY;\n}", "function setPosition(e) {\n pos.x = e.clientX;\n pos.y = e.clientY;\n}", "function setPosition(e) {\n pos.x = e.clientX;\n pos.y = e.clientY;\n}", "function onDragMove() {\n if (this.dragging) {\n let newPosition = this.data.getLocalPosition(this.parent);\n this.x = newPosition.x;\n this.y = newPosition.y;\n }\n}", "function setPosition(e) {\r\n pos.x = e.clientX;\r\n pos.y = e.clientY;\r\n}", "updatePos(token, tObj) {\n tObj.xPos = token.get('left');\n tObj.yPos = token.get('top');\n }", "FetchNodeIndex(position)\n {\n return position.x + (position.y * grid.resolution);\n }", "get position() {\n return {x: this.x, y: this.y}\n }", "updatePosition(position) \n {\n this.position = position;\n }", "function updatePosition() {\r\n\t\t\tcircle.attr('transform', `translate(${point.x * graph.cell_size + graph.offset.x} ${point.y * graph.cell_size + graph.offset.y})`);\r\n\t\t}", "function point(node) {\n var point = (node && node.position && node.position[type]) || {}\n\n return {\n line: point.line || null,\n column: point.column || null,\n offset: isNaN(point.offset) ? null : point.offset\n }\n }", "setPosition(x, y) {\n this.x = x\n this.y = y\n }", "set position(value) {\n this.position$.next(value);\n }", "function PersistInNode(n) {\n RED.nodes.createNode(this, n);\n var node = this;\n\n node.name = n.name;\n node.storageNode = RED.nodes.getNode(n.storageNode);\n\n node.on(\"input\", function (msg) {\n node.storageNode.store(node.name, msg);\n });\n }", "function Position (x, y) {\n this.x = x;\n this.y = y;\n this.position = this;\n}", "function setPosition(position) {\n\tglobalPos.latitude = position.coords.latitude;\n\tglobalPos.longitude = position.coords.longitude;\n\t\n\tconsole.log(\"globalLat: \" + globalPos.latitude + \", globalLong: \" + globalPos.longitude);\n\tcheckSound();\n\tprintPosition(position);\n\t\n}", "get position() {\n\t\treturn this._position.object;\n\t}", "function readPosition(data) {\r\n height = data.val();\r\n balloon.x = height.x;\r\n balloon.y = height.y;\r\n}", "function Position(table) {\n\n this.time = new Date(table[0]);\n this.tag_id = table[1];\n this.x = parseFloat(table[2]);\n this.y = parseFloat(table[3]);\n\n}", "function set_player_loc(x, y) {\n player['x'] = x;\n player['newx'] = x;\n player['y'] = y;\n player['newy'] = y\n}", "function setNode(pos, dist){\n\tif(nodeArray[pos] != start){\n\t\tnodeArray[pos].addDis('&#8734');\n\t}\n\n\tif(pos < nodeArray.length - 1){\n\t\tsetTimeout(function(){setNode(++pos, dist);}, 50);\n\t\t// setTimeout(function(){alert(pos);}, 1000);\n\t}\n\n\tif (pos == nodeArray.length - 1) {\n\t\tdijkstraHelp(null, q, [], dist);\n\t};\n}", "function Position(x,y){\n this.x = x;\n this.y = y;\n}", "function Position(x,y){\n this.x = x;\n this.y = y;\n}", "function setpos (object, x, y) {\n object.setAttribute('x', x + '');\n object.setAttribute('y', y + '');\n}", "function generatePositionData(){\n\t\n\tvar message = new Object();\n message.sessionName = sessionName;\n message.longitude = longitude = (Math.random()/1000)+25.4559615;\n message.latitude = latitude = (Math.random()/1000)+65.0564222;\n message.state = connection;\n \n if(connection === \"Online\" && synchronizing === false)\n \tsendPosition(message);\n else if(connection === \"Offline\")\n \tsaveLocally(message);\n \t\n showCoordinates();\n}", "setPosition(x, y) {\n this.x = x;\n this.y = y;\n }", "function Position (x, y) {\n\t\tthis.x = x;\n\t\tthis.y = y;\n\t}", "function positionNode(node,col,row) {\n // Could cache this info - all nodes are the same size (I assert...)\n var bbox = node.getBBox();\n // Sizes used here relate to node sizes in render-service and the default grid size (40)\n var offsetx = 40;//bbox.width/2;\n var offsety = 40;//bbox.height/2;\n var hspace = 120+80;//bbox.width*1.5; \n var vspace = 40*2;//bbox.height*2; \n node.translate((offsetx+col*hspace)-bbox.x,(offsety+row*vspace)-bbox.y);\n var outgoingLinks = getOutgoingLinks(node,OUTPUT_PORT);\n var target, targetId;\n if (outgoingLinks.length !== 0) {\n targetId = outgoingLinks[0].get('target').id;\n target = graph.getCell(targetId);\n row = positionNode(target,col+1,row);\n }\n // As we 'unwind' visit tap streams\n var outgoingTapLinks = getOutgoingLinks(node,TAP_PORT);\n for (var i=0;i<outgoingTapLinks.length;i++) {\n row++;\n var link = outgoingTapLinks[i];\n targetId = link.get('target').id;\n target = graph.getCell(targetId);\n row = positionNode(target,col+1,row);\n }\n return row;\n }", "get position() {\n return {\n x: this.x,\n y: this.y\n };\n }", "function Position(left, top) {\n this.left = left;\n this.top = top;\n}", "function Position(left, top) {\n this.left = left;\n this.top = top;\n}", "function setNodePosition(){\n\t\t//console.log(print);\n\t\tvar change = 0;\n\t\tvar offset = Math.max(xOffset - leftPanelWidth,0);\n\n\t\t//set xpos of nodes, and check if node is an outside node\n\t\tlayerMap.forEach(function(d, i){\n\t\t\tif (i > 0){\n\t\t\t\td.forEach(function(e){\n\t\t\t\t\tvar tmp = [];\n\t\t\t\t\tnodesChildren[e].forEach(function(f){\n\t\t\t\t\t\tif (!nodesData[f].outside.isOutside){\n\t\t\t\t\t\t\ttmp.push(nodesData[f].xpos);\n\t\t\t\t\t\t}\n\t\t\t\t\t});\t\n\t\t\t\t\tif (tmp.length == 0){\n\t\t\t\t\t\tif (!nodesData[e].outside.isOutside){\n\t\t\t\t\t\t\tchange++;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tnodesData[e].outside.isOutside = true;\n\t\t\t\t\t\tnodesData[e].xpos = -1;\n\t\t\t\t\t} else {\n\t\t\t\t\t\tif (nodesData[e].outside.isOutside){\n\t\t\t\t\t\t\tchange++;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tnodesData[e].xpos = (d3.min(tmp) + d3.max(tmp)) / 2;\n\t\t\t\t\t\tif (!d.fixed){\n\t\t\t\t\t\t\tnodesData[e].position.x = nodesData[e].xpos;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tnodesData[e].outside.isOutside = false;\n\t\t\t\t\t}\n\t\t\t\t}); \n\t\t\t} else {\n\t\t\t\td.forEach(function(e){\n\t\t\t\t\tvar tmpX = nodesData[e].xpos;\t\n\t\t\t\t\tif (tmpX - nodeRadius > offset && tmpX + nodeRadius < offset + windowWidth){\n\t\t\t\t\t\tif (nodesData[e].outside.isOutside){\n\t\t\t\t\t\t\tchange++;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tnodesData[e].outside.isOutside = false;\n\t\t\t\t\t} else {\n\t\t\t\t\t\tif (!nodesData[e].outside.isOutside){\n\t\t\t\t\t\t\tchange++;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tnodesData[e].outside.isOutside = true;\n\t\t\t\t\t}\n\t\t\t\t})\n\t\t\t}\n\t\t});\n\n\n\t\t\n\t\t//Set the color, opacity of nodes based on the status of isOutside\n\t\tnodes.each(function(d){\n\t\t\t/*if (d.noLayer){\n\t\t\t\td.outside.isOutside = true;\n\t\t\t\td3.select(this)\n\t\t\t\t\t.attr(\"opacity\", 0.8)\n\t\t\t\t\t.attr(\"r\", nodeRadius)\n\t\t\t\t\t.attr(\"fill\", \"red\");\n\t\t\t}\t\t*/\t\t\t\t\n\t\t\tif (d.fixed && !(d.x - nodeRadius > offset && d.x + nodeRadius < offset + windowWidth)){\n\t\t\t\td.fixed = false\t\t\t\t\n\t\t\t\td3.select(this).classed(\"fixed\", false);\n\t \t\t\td.position.x = d.xpos;\n\t\t\t\td.position.y = height - nodeRadius - d.layer * unitLinkLength;\n\t\t\t}\n\t\t\tif (d.outside.isOutside && !d.noLayer){\n\t\t\t\tif (d.unAssigned){\n\n\t\t\t\t}\t\t\t\t\n\t\t\t\td3.select(this)\n\t\t\t\t\t.transition()\n\t\t\t\t\t.duration(500)\n\t\t\t\t\t.attr(\"opacity\", 0.5)\n\t\t\t\t\t.attr(\"r\", nodeRadius)\n\t\t\t\t\t.attr(\"fill\", function(d){\n\t\t\t\t\t\treturn cScale(d.index + 1);\n\t\t\t\t\t});\t\n\t\t\t\t\n\t\t\t} else {\n\t\t\t\td3.select(this)\n\t\t\t\t\t.transition()\n\t\t\t\t\t.duration(500)\n\t\t\t\t\t.attr(\"opacity\", 0.7)\n\t\t\t\t\t.attr(\"r\", nodeRadius)\n\t\t\t\t\t.attr(\"fill\", \"red\");\t\t\t\t\n\t\t\t}\n\t\t\t//console.log(d.id + \" \" + d.outside.isOutside + \" \" + d.position.x);\n\t\t});\n\t\t//console.log(change)\n\n\t\t//when some node changes its status, the correspoding links, labels and the x position of inside nodes should also change.\n\t\tif (change > 0 || firstTime){\n\t\t\tfirstTime = false;\n\t\t\td3.select(htmlElement).selectAll(\".nodeLabel\")\n\t\t\t\t.attr(\"opacity\", function(d){\n\t\t\t\t\tif (d.node.noLayer){\n\t\t\t\t\t\td.node.showLabel = true;\n\t\t\t\t\t\treturn 1;\n\t\t\t\t\t}\n\t\t\t\t\tif (d.type == \"nodeLabel\" && d.node.outside){\n\t\t\t\t\t\tif ((!d.node.outside.isOutside && (print || d.node.type != \"anchor\")) || (d.node.outside.isOutside && d.node.degree >= 3)){\n\t\t\t\t\t\t\td.node.showLabel = true;\n\t\t\t\t\t\t\treturn 1;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\t\n\t\t\t\t\td.node.showLabel = false;\n\t\t\t\t\treturn 0;\t\t\t\n\t\t\t\t});\n\t\t\td3.select(htmlElement).selectAll(\".linkLabel\")\n\t\t\t\t.attr(\"opacity\", function(d){\n\t\t\t\t\tif (d.type == \"linkLabel\"){\n\t\t\t\t\t\t// if (nodesData[d.node.tgt].noLayer){\n\t\t\t\t\t\t// \td.show = true;\n\t\t\t\t\t\t// \treturn 1;\n\t\t\t\t\t\t// }\n\t\t\t\t\t\t// if (nodesData[d.node.tgt].type == 'anchor' && !nodesData[d.node.tgt].outside.isOutside){\n\t\t\t\t\t\t// \td.show = true;\n\t\t\t\t\t\t// \treturn 1;\n\t\t\t\t\t\t// }\n\t\t\t\t\t\tif ((d.node.src < nodesData.length && nodesData[d.node.src].noLayer == undefined && nodesData[d.node.src].outside.isOutside) \n\t\t\t\t\t\t\t|| (d.node.tgt < nodesData.length && nodesData[d.node.tgt].noLayer == undefined && nodesData[d.node.tgt].outside.isOutside)){\n\t\t\t\t\t\t\td.show = false;\n\t\t\t\t\t\t\treturn 0;\n\t\t\t\t\t\t}\n\t\t\t\t\t\td.show = true;\n\t\t\t\t\t\treturn 1;\n\t\t\t\t\t}\n\t\t\t\t});\n\t\t\td3.select(htmlElement).selectAll(\".edgeLinkLabel\")\n\t\t\t\t.attr(\"opacity\", function(d){\n\t\t\t\t\t//console.log(d.index);\n\t\t\t\t\tif (!d.node.src.show || \n\t\t\t\t\t\t(nodesData[d.node.tgt].noLayer == undefined && nodesData[d.node.tgt].outside.isOutside)) {\n\t\t\t\t\t\td.show = false;\n\t\t\t\t\t\treturn 0;\n\t\t\t\t\t}\n\t\t\t\t\td.show = true;\n\t\t\t\t\treturn 1;\t\t\t\t\t\n\t\t\t\t});\n\t\t\t/*d3.select(htmlElement).selectAll(\".clickBoard\")\n\t\t\t\t.attr(\"fill\", function(d){\n\t\t\t\t\tif (d.content == \"edgeLinks\"){\n\t\t\t\t\t\tif (nodesData[d.node.tgt].outside.isOutside || !d.node.src.show){\n\t\t\t\t\t\t\treturn \"node\";\n\t\t\t\t\t\t}\n\t\t\t\t\t\treturn \"transparent\";\n\t\t\t\t\t} else if (d.type == \"linkLabel\"){\n\t\t\t\t\t\tif (nodesData[d.node.src].outside.isOutside || nodesData[d.node.tgt].outside.isOutside){\n\t\t\t\t\t\t\treturn \"none\";\n\t\t\t\t\t\t}\n\t\t\t\t\t\treturn \"transparent\";\n\t\t\t\t\t} \n\t\t\t\t\treturn d.node.showLabel ? \"transparent\" : \"none\";\n\t\t\t\t});*/\n\n\t\t\tlinks.classed(\"outsideLink\", function(d){\n\t\t\t\t/*if (d.type == \"edgeLink\"){\n\t\t\t\t\treturn d.target.outside.isOutside;\n\t\t\t\t}*/\n\t\t\t\tif (d.target.noLayer){\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t\tif (d.source.outside && d.target.outside){\n\t\t\t\t\tif (d.target.type == 'anchor' && !d.target.outside.isOutside){\n\t\t\t\t\t\treturn false;\n\t\t\t\t\t}\n\t\t\t\t\treturn d.source.outside.isOutside || d.target.outside.isOutside;\n\t\t\t\t}\n\t\t\t\treturn false;\n\t\t\t});\n\n\t\t\t\n\t\t\tforce.start();\n\t\t}\n\t}", "function setPositions(nodes) {\n // determine positions\n for (i in nodes) {\n if (nodes[i].category === \"Math\") {\n nodes[i].x = mathX\n nodes[i].y = firstY + i * smallVerticalGap\n } else if (nodes[i].category === \"Lower\") {\n nodes[i].x = mathX*2\n nodes[i].y = firstY + (i-numMath) * bigVerticalGap\n } else if (nodes[i].category === \"100\") {\n nodes[i].x = mathX*3\n nodes[i].y = firstY + (i-(numMath+numLower)) * 70\n } else if (nodes[i].category === \"101\") {\n nodes[i].x = mathX*4\n nodes[i].y = firstY + (i-(numMath+numLower+num100)) * bigVerticalGap\n } else if (nodes[i].category === \"102\") {\n nodes[i].x = mathX*5\n nodes[i].y = firstY + (i-(numMath+numLower+num100+num101)) * bigVerticalGap\n } else if (nodes[i].category === \"Elective\") {\n nodes[i].x = horizontalX + (i-(numMath+numRequired)) * horizontalGap\n nodes[i].y = horizontalY\n } else if (nodes[i].category === \"Consulting\") {\n nodes[i].x = horizontalX + (i-(numMath+numRequired+numElective)) * horizontalGap\n nodes[i].y = horizontalY + 100\n }\n }\n }", "function positionNode(d) {\n // keep the node within the boundaries of the svg\n if (d.x < 0) {\n d.x = 0\n };\n if (d.y < 0) {\n d.y = 0\n };\n if (d.x > width) {\n d.x = width\n };\n if (d.y > height) {\n d.y = height\n };\n return \"translate(\" + d.x + \",\" + d.y + \")\";\n }", "function updateCoords(){\n storage.write('coords.json', coords);\n}", "function Position(x, y){\n this.x = x;\n this.y = y;\n}", "get position() {\n if (!position ||\n (Date.now() - position.timestamp > positionTTL)) {\n\n updatePosition();\n }\n\n return position;\n }", "function CachedItemPosition() {}", "function CachedItemPosition() {}" ]
[ "0.6429364", "0.63434136", "0.63226074", "0.6272839", "0.62623346", "0.62435097", "0.61585325", "0.6147435", "0.6058061", "0.605646", "0.59816897", "0.5943724", "0.5837633", "0.581746", "0.579113", "0.57636505", "0.57392776", "0.5709215", "0.5697817", "0.5697627", "0.5697627", "0.5629988", "0.5621395", "0.5619351", "0.5611742", "0.5602382", "0.55987865", "0.55886185", "0.5585089", "0.5578605", "0.5577215", "0.55763656", "0.55557126", "0.5544201", "0.5533213", "0.55284965", "0.5523978", "0.5522969", "0.5508201", "0.54980433", "0.5487588", "0.54841816", "0.5476106", "0.546692", "0.546692", "0.545187", "0.5443164", "0.544235", "0.5438239", "0.5423911", "0.53859097", "0.5370455", "0.5362634", "0.5359876", "0.5359085", "0.5355807", "0.535149", "0.5348405", "0.5348405", "0.5348405", "0.5348405", "0.5348405", "0.5346203", "0.5346203", "0.5346203", "0.53411555", "0.5330201", "0.5316158", "0.5311811", "0.5301659", "0.52954155", "0.5294321", "0.5291428", "0.5287858", "0.52871305", "0.5282841", "0.52750385", "0.52719265", "0.5265895", "0.525932", "0.5254812", "0.5247968", "0.5247835", "0.52478105", "0.52478105", "0.52422374", "0.52408296", "0.52391875", "0.52223295", "0.5220141", "0.52187294", "0.52109873", "0.52109873", "0.52109134", "0.52067786", "0.5206599", "0.51968575", "0.51962394", "0.5196062", "0.51936907", "0.51936907" ]
0.0
-1
Mark position and patch `node.position`.
function position() { var before = now(); return update; /* Add the position to a node. */ function update(node, indent) { var prev = node.position; var start = prev ? prev.start : before; var combined = []; var n = prev && prev.end.line; var l = before.line; node.position = new Position(start); /* If there was already a `position`, this * node was merged. Fixing `start` wasn’t * hard, but the indent is different. * Especially because some information, the * indent between `n` and `l` wasn’t * tracked. Luckily, that space is * (should be?) empty, so we can safely * check for it now. */ if (prev && indent && prev.indent) { combined = prev.indent; if (n < l) { while (++n < l) { combined.push((offset[n] || 0) + 1); } combined.push(before.column); } indent = combined.concat(indent); } node.position.indent = indent || []; return node; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function patch(node) {\n if (!node.position) {\n node.position = {}\n }\n}", "setNodePosition(Pos, node) {\n let currrentNode = this.nodes.find(n => n === node);\n currrentNode.x = Pos.x;\n currrentNode.y = Pos.y;\n }", "assignPosition(node, position) {\n // update the position of the node\n node.position = position;\n \n // the base case\n if (node.children.length === 0)\n {\n leafNodeCounter = leafNodeCounter + 1;\n return node;\n }\n // recursive case\n else\n {\n leafNodeCounter = 0;\n for (var d = 0; d < node.children.length; d++)\n {\n // this is a really bad hack and there is definitely something better out there. \n // However, it gets the job done\n if (node.children[d].name === \"Protosomes\")\n {\n leafNodeCounter = leafNodeCounter + 2;\n }\n\n this.assignPosition(node.children[d], node.position + leafNodeCounter);\n }\n }\n\n }", "assignPosition(node, position) {\n\t\tif(node.parentNode && position<node.parentNode.position){\n\t\t\tposition = node.parentNode.position;\n\t\t}\n\t\twhile(this.positionMap.get(`${node.level},${position}`)){\n\t\t\tposition++;\n\t\t}\n\t\tnode.position = position;\n\t\tthis.positionMap.set(`${node.level},${position}`, true);\n\t\tfor(var i in node.children){\n\t\t\tthis.assignPosition(node.children[i], position+Number(i));\n\t\t}\n\t}", "function positionTokenAtNode(token, node) {\n // these details depend on the node template\n token.location = node.position.copy().offset(4 + 6, 5 + 6);\n }", "function updatePosition() {\r\n\t\t\tcircle.attr('transform', `translate(${point.x * graph.cell_size + graph.offset.x} ${point.y * graph.cell_size + graph.offset.y})`);\r\n\t\t}", "function position() {\n var before = now()\n\n return update\n\n // Add the position to a node.\n function update(node, indent) {\n var previous = node.position\n var start = previous ? previous.start : before\n var combined = []\n var n = previous && previous.end.line\n var l = before.line\n\n node.position = new Position(start)\n\n // If there was already a `position`, this node was merged. Fixing\n // `start` wasn’t hard, but the indent is different. Especially\n // because some information, the indent between `n` and `l` wasn’t\n // tracked. Luckily, that space is (should be?) empty, so we can\n // safely check for it now.\n if (previous && indent && previous.indent) {\n combined = previous.indent\n\n if (n < l) {\n while (++n < l) {\n combined.push((offset[n] || 0) + 1)\n }\n\n combined.push(before.column)\n }\n\n indent = combined.concat(indent)\n }\n\n node.position.indent = indent || []\n\n return node\n }\n }", "function setCursorPositionInNode(node, pos)\n\t{\n\t\tvar sel, range;\n\t\tif (window.getSelection && document.createRange) {\n\t\t\trange = document.createRange();\n \t\t\trange.setEnd(node, pos);\n\t\t\trange.setStart(node, pos);\n\t\t\tsel = window.getSelection();\n\t\t\tsel.removeAllRanges();\n\t\t\tsel.addRange(range);\n\t\t} else if (document.body.createTextRange) {\n\t\t\trange = document.body.createTextRange();\n\t\t\trange.setEnd(node, pos);\n\t\t\trange.setStart(node, pos);\n\t\t\trange.select();\n\t\t}\n\t}", "markLocation(node/*, startLocation*/) {\n return node;\n }", "function sync(dom, pos) {\r\n dom.style.left = `${pos.x}px`;\r\n dom.style.top = `${pos.y}px`;\r\n}", "set pos(newPos) {\n this._pos = newPos;\n }", "markOn(){\n this.room.markPosition(this.positionX, this.positionY);\n }", "setPosition(x, y) {\n this.pos.x = x;\n this.pos.y = y;\n }", "setPosition(newX=this.x, newY=this.y) {\n this.x = newX;\n this.y = newY;\n this.updateEdges() // Update Edge positions\n this.setAnchorPostion(this, newX, newY); // Update DOM element\n }", "function setpos (object, x, y) {\n object.setAttribute('x', x + '');\n object.setAttribute('y', y + '');\n}", "function updateNodePositions() {\n // set node positions\n rect.attr('transform', function (d) {\n return 'translate(' + d.x + ',' + d.y + ')';\n });\n}", "modify_mark(marker) {\n if (!marker.offset_handled) {\n marker.start_pos += this.offset;\n marker.end_pos += this.offset;\n }\n return marker;\n }", "function markPosition(x, y, markerObject) {\n if (x >= 0 && x < size && y >= 0 && y < size){\n if (matrix[y][x] && matrix[y][x].marker != markerObject.marker)\n matrix[y][x] = {steps: matrix[y][x].steps + markerObject.steps, marker: 'x'};\n else \n matrix[y][x] = markerObject;\n }\n}", "function setNodePosition(){\n\t\t//console.log(print);\n\t\tvar change = 0;\n\t\tvar offset = Math.max(xOffset - leftPanelWidth,0);\n\n\t\t//set xpos of nodes, and check if node is an outside node\n\t\tlayerMap.forEach(function(d, i){\n\t\t\tif (i > 0){\n\t\t\t\td.forEach(function(e){\n\t\t\t\t\tvar tmp = [];\n\t\t\t\t\tnodesChildren[e].forEach(function(f){\n\t\t\t\t\t\tif (!nodesData[f].outside.isOutside){\n\t\t\t\t\t\t\ttmp.push(nodesData[f].xpos);\n\t\t\t\t\t\t}\n\t\t\t\t\t});\t\n\t\t\t\t\tif (tmp.length == 0){\n\t\t\t\t\t\tif (!nodesData[e].outside.isOutside){\n\t\t\t\t\t\t\tchange++;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tnodesData[e].outside.isOutside = true;\n\t\t\t\t\t\tnodesData[e].xpos = -1;\n\t\t\t\t\t} else {\n\t\t\t\t\t\tif (nodesData[e].outside.isOutside){\n\t\t\t\t\t\t\tchange++;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tnodesData[e].xpos = (d3.min(tmp) + d3.max(tmp)) / 2;\n\t\t\t\t\t\tif (!d.fixed){\n\t\t\t\t\t\t\tnodesData[e].position.x = nodesData[e].xpos;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tnodesData[e].outside.isOutside = false;\n\t\t\t\t\t}\n\t\t\t\t}); \n\t\t\t} else {\n\t\t\t\td.forEach(function(e){\n\t\t\t\t\tvar tmpX = nodesData[e].xpos;\t\n\t\t\t\t\tif (tmpX - nodeRadius > offset && tmpX + nodeRadius < offset + windowWidth){\n\t\t\t\t\t\tif (nodesData[e].outside.isOutside){\n\t\t\t\t\t\t\tchange++;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tnodesData[e].outside.isOutside = false;\n\t\t\t\t\t} else {\n\t\t\t\t\t\tif (!nodesData[e].outside.isOutside){\n\t\t\t\t\t\t\tchange++;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tnodesData[e].outside.isOutside = true;\n\t\t\t\t\t}\n\t\t\t\t})\n\t\t\t}\n\t\t});\n\n\n\t\t\n\t\t//Set the color, opacity of nodes based on the status of isOutside\n\t\tnodes.each(function(d){\n\t\t\t/*if (d.noLayer){\n\t\t\t\td.outside.isOutside = true;\n\t\t\t\td3.select(this)\n\t\t\t\t\t.attr(\"opacity\", 0.8)\n\t\t\t\t\t.attr(\"r\", nodeRadius)\n\t\t\t\t\t.attr(\"fill\", \"red\");\n\t\t\t}\t\t*/\t\t\t\t\n\t\t\tif (d.fixed && !(d.x - nodeRadius > offset && d.x + nodeRadius < offset + windowWidth)){\n\t\t\t\td.fixed = false\t\t\t\t\n\t\t\t\td3.select(this).classed(\"fixed\", false);\n\t \t\t\td.position.x = d.xpos;\n\t\t\t\td.position.y = height - nodeRadius - d.layer * unitLinkLength;\n\t\t\t}\n\t\t\tif (d.outside.isOutside && !d.noLayer){\n\t\t\t\tif (d.unAssigned){\n\n\t\t\t\t}\t\t\t\t\n\t\t\t\td3.select(this)\n\t\t\t\t\t.transition()\n\t\t\t\t\t.duration(500)\n\t\t\t\t\t.attr(\"opacity\", 0.5)\n\t\t\t\t\t.attr(\"r\", nodeRadius)\n\t\t\t\t\t.attr(\"fill\", function(d){\n\t\t\t\t\t\treturn cScale(d.index + 1);\n\t\t\t\t\t});\t\n\t\t\t\t\n\t\t\t} else {\n\t\t\t\td3.select(this)\n\t\t\t\t\t.transition()\n\t\t\t\t\t.duration(500)\n\t\t\t\t\t.attr(\"opacity\", 0.7)\n\t\t\t\t\t.attr(\"r\", nodeRadius)\n\t\t\t\t\t.attr(\"fill\", \"red\");\t\t\t\t\n\t\t\t}\n\t\t\t//console.log(d.id + \" \" + d.outside.isOutside + \" \" + d.position.x);\n\t\t});\n\t\t//console.log(change)\n\n\t\t//when some node changes its status, the correspoding links, labels and the x position of inside nodes should also change.\n\t\tif (change > 0 || firstTime){\n\t\t\tfirstTime = false;\n\t\t\td3.select(htmlElement).selectAll(\".nodeLabel\")\n\t\t\t\t.attr(\"opacity\", function(d){\n\t\t\t\t\tif (d.node.noLayer){\n\t\t\t\t\t\td.node.showLabel = true;\n\t\t\t\t\t\treturn 1;\n\t\t\t\t\t}\n\t\t\t\t\tif (d.type == \"nodeLabel\" && d.node.outside){\n\t\t\t\t\t\tif ((!d.node.outside.isOutside && (print || d.node.type != \"anchor\")) || (d.node.outside.isOutside && d.node.degree >= 3)){\n\t\t\t\t\t\t\td.node.showLabel = true;\n\t\t\t\t\t\t\treturn 1;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\t\n\t\t\t\t\td.node.showLabel = false;\n\t\t\t\t\treturn 0;\t\t\t\n\t\t\t\t});\n\t\t\td3.select(htmlElement).selectAll(\".linkLabel\")\n\t\t\t\t.attr(\"opacity\", function(d){\n\t\t\t\t\tif (d.type == \"linkLabel\"){\n\t\t\t\t\t\t// if (nodesData[d.node.tgt].noLayer){\n\t\t\t\t\t\t// \td.show = true;\n\t\t\t\t\t\t// \treturn 1;\n\t\t\t\t\t\t// }\n\t\t\t\t\t\t// if (nodesData[d.node.tgt].type == 'anchor' && !nodesData[d.node.tgt].outside.isOutside){\n\t\t\t\t\t\t// \td.show = true;\n\t\t\t\t\t\t// \treturn 1;\n\t\t\t\t\t\t// }\n\t\t\t\t\t\tif ((d.node.src < nodesData.length && nodesData[d.node.src].noLayer == undefined && nodesData[d.node.src].outside.isOutside) \n\t\t\t\t\t\t\t|| (d.node.tgt < nodesData.length && nodesData[d.node.tgt].noLayer == undefined && nodesData[d.node.tgt].outside.isOutside)){\n\t\t\t\t\t\t\td.show = false;\n\t\t\t\t\t\t\treturn 0;\n\t\t\t\t\t\t}\n\t\t\t\t\t\td.show = true;\n\t\t\t\t\t\treturn 1;\n\t\t\t\t\t}\n\t\t\t\t});\n\t\t\td3.select(htmlElement).selectAll(\".edgeLinkLabel\")\n\t\t\t\t.attr(\"opacity\", function(d){\n\t\t\t\t\t//console.log(d.index);\n\t\t\t\t\tif (!d.node.src.show || \n\t\t\t\t\t\t(nodesData[d.node.tgt].noLayer == undefined && nodesData[d.node.tgt].outside.isOutside)) {\n\t\t\t\t\t\td.show = false;\n\t\t\t\t\t\treturn 0;\n\t\t\t\t\t}\n\t\t\t\t\td.show = true;\n\t\t\t\t\treturn 1;\t\t\t\t\t\n\t\t\t\t});\n\t\t\t/*d3.select(htmlElement).selectAll(\".clickBoard\")\n\t\t\t\t.attr(\"fill\", function(d){\n\t\t\t\t\tif (d.content == \"edgeLinks\"){\n\t\t\t\t\t\tif (nodesData[d.node.tgt].outside.isOutside || !d.node.src.show){\n\t\t\t\t\t\t\treturn \"node\";\n\t\t\t\t\t\t}\n\t\t\t\t\t\treturn \"transparent\";\n\t\t\t\t\t} else if (d.type == \"linkLabel\"){\n\t\t\t\t\t\tif (nodesData[d.node.src].outside.isOutside || nodesData[d.node.tgt].outside.isOutside){\n\t\t\t\t\t\t\treturn \"none\";\n\t\t\t\t\t\t}\n\t\t\t\t\t\treturn \"transparent\";\n\t\t\t\t\t} \n\t\t\t\t\treturn d.node.showLabel ? \"transparent\" : \"none\";\n\t\t\t\t});*/\n\n\t\t\tlinks.classed(\"outsideLink\", function(d){\n\t\t\t\t/*if (d.type == \"edgeLink\"){\n\t\t\t\t\treturn d.target.outside.isOutside;\n\t\t\t\t}*/\n\t\t\t\tif (d.target.noLayer){\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t\tif (d.source.outside && d.target.outside){\n\t\t\t\t\tif (d.target.type == 'anchor' && !d.target.outside.isOutside){\n\t\t\t\t\t\treturn false;\n\t\t\t\t\t}\n\t\t\t\t\treturn d.source.outside.isOutside || d.target.outside.isOutside;\n\t\t\t\t}\n\t\t\t\treturn false;\n\t\t\t});\n\n\t\t\t\n\t\t\tforce.start();\n\t\t}\n\t}", "set x(nx){\n\t\tthis.position.nx = nx;\n\t}", "set position(p) {\n this.previous.to(this);\n if (this._lock)\n this._lockPt = p;\n this.to(p);\n }", "updatePos(token, tObj) {\n tObj.xPos = token.get('left');\n tObj.yPos = token.get('top');\n }", "newPosition(position) {\n this.position = position;\n }", "setPosition(x, y) {\n this.x = x\n this.y = y\n }", "function setPosition(el, point) {\n /*eslint-disable */\n el._leaflet_pos = point;\n /* eslint-enable */\n\n if (any3d) {\n setTransform(el, point);\n } else {\n el.style.left = point.x + 'px';\n el.style.top = point.y + 'px';\n }\n } // @function getPosition(el: HTMLElement): Point", "function patch(nodes, location, offset) {\n var index = -1\n var start = offset\n var end\n var node\n\n while (++index < nodes.length) {\n node = nodes[index]\n\n if (node.children) {\n patch(node.children, location, start)\n }\n\n end = start + toString(node).length\n\n node.position = {\n start: location.toPoint(start),\n end: location.toPoint(end)\n }\n\n start = end\n }\n\n return nodes\n }", "function handleToMovePatchNode() {}", "setPosition(x, y) {\n this.x = x;\n this.y = y;\n }", "sendToStartPos() {\n this.x = this.spawnX;\n this.y = this.spawnY;\n }", "set position (newPosition) {\n this.emit('position', newPosition)\n this._position = newPosition * this.ticksPerSongPosition\n }", "function setPos(j) {\n pos = j;\n update();\n\n\n}", "function setpostion(newPostion) {\n setPosition(newPostion);\n }", "updatePosition(position) \n {\n this.position = position;\n }", "setPosition() {\r\n if (!this.object) return;\r\n this.updatePosition();\r\n }", "set_position(newval) {\n this.liveFunc.set_position(newval);\n return this._yapi.SUCCESS;\n }", "setPosition(position) {\n this.position = position;\n }", "set position(value) {\n this.position$.next(value);\n }", "updatePos(node) {\n if (node != null) {\n\n var q = node.distanceFromParent;\n\n // this.isRB && \n if (node.dpth == 0) {\n node.changePositionNoMove(10_000, 200);\n }\n \n if (node.dpth > 0) {\n node.changePositionNoMove(node.parent.posX+q, node.parent.posY+this.z);\n }\n\n this.updatePos(node.left);\n this.updatePos(node.right);\n }\n }", "SetNewPositionToANode(registeredPos) {\n this.setNodePosition(registeredPos.newValue, registeredPos.element);\n }", "function setPosition( graphID, updatedX, updatedY )\n{\n console.log( `moving ${graphID} to ${updatedX}, ${updatedY}`);\n\n // changing a body's position in Matter JS maintains the constraints\n // we will remove all the constraints, move the body, then put the constraints back in\n var circleBody = idToCircleMap.get( graphID );\n\n // track neighbors \n var neighbors = new Array();\n var currentConstraints = Composite.allConstraints(barAndJointComposite);\n var currentConstraint;\n\n // iterate over all constraints\n // if find a neighbor, remove the constraint and track the graphID to add back in\n for ( var i = 0; i < currentConstraints.length; i++ )\n {\n currentConstraint = currentConstraints[i];\n if ( currentConstraint.bodyA == circleBody )\n {\n neighbors.push( currentConstraint.bodyB.graphID );\n Composite.remove( barAndJointComposite, currentConstraint ); \n }\n else if ( currentConstraint.bodyB == circleBody )\n {\n neighbors.push( currentConstraint.bodyA.graphID );\n Composite.remove( barAndJointComposite, currentConstraint ); \n }\n }\n Body.setPosition( circleBody, {x:updatedX, y:updatedY});\n\n // now add the constraints back in\n for ( var i = 0; i < neighbors.length; i++ )\n addConstraintBetween( graphID, neighbors[i] );\n console.log( circleBody );\n}", "setPosition(posX, posY) {\n this._positionX = posX;\n this._positionY = posY;\n this._zoomDirty = true;\n }", "function changeLinePos(line, pos) {\n pos = {\n x: pos.x / resizer,\n y: pos.y / resizer\n }\n gMeme[getMemeIdxInGMeme(gCurrMeme)].lines[line].pos = pos;\n}", "set posX(value){\n this._posX = value;\n }", "setPosition(position)\n {\n this.position = position;\n }", "updatePosition(position) {\n if (position == null)\n return;\n const positionNodes = parseExpressions(position)[0].terms;\n for (let i = 0; i < 3; ++i) {\n this.position.setComponent(i, normalizeUnit(positionNodes[i]).number);\n }\n this.updateMatrixWorld();\n }", "update () {\n this.position = [this.x, this.y];\n }", "function position() {\n var start = { line: lineno, column: column };\n return function(node){\n node.position = new Position(start);\n whitespace();\n return node;\n };\n }", "function position() {\n var start = { line: lineno, column: column };\n return function(node){\n node.position = new Position(start);\n whitespace();\n return node;\n };\n }", "function position() {\n var start = { line: lineno, column: column };\n return function(node){\n node.position = new Position(start);\n whitespace();\n return node;\n };\n }", "function position() {\n var start = { line: lineno, column: column };\n return function(node){\n node.position = new Position(start);\n whitespace();\n return node;\n };\n }", "function position() {\n var start = { line: lineno, column: column };\n return function(node){\n node.position = new Position(start);\n whitespace();\n return node;\n };\n }", "function position() {\n var start = { line: lineno, column: column };\n return function(node){\n node.position = new Position(start);\n whitespace();\n return node;\n };\n }", "updatePosition(position) {\n if (position == null)\n return;\n const positionNodes = parseExpressions(position)[0].terms;\n for (let i = 0; i < 3; ++i) {\n this.position.setComponent(i, normalizeUnit(positionNodes[i]).number);\n }\n }", "addNodeMark(pos, mark) {\n this.step(new AddNodeMarkStep(pos, mark));\n return this;\n }", "setPosition(newX=this.x, newY=this.y) {\n this.x = newX;\n this.y = newY;\n this.updateEdges() // Update Edge positions\n this.setBlobPosition(this, newX, newY); // Update DOM element\n // Update Text Positioning\n if (this.shape === \"rectangle\") {\n this.updateTextPosition(this.html, this.x, this.y, this.width, this.height);\n }\n else if (this.shape === \"circle\") {\n this.updateTextPosition(this.html, this.x - this.radius/1.4, this.y - this.radius/1.4, this.radius*1.4, this.radius*1.4);\n }\n else {\n this.updateTextPosition(this.html, this.x - this.radiusx/1.4, this.y - this.radiusy/1.4, this.radiusx*1.4, this.radiusy*1.4);\n }\n }", "set targetPosition(value) {}", "set_red_ghost_pos(position) {\r\n\r\n this.ghost.ghost_red_pos_x = position.x_pos;\r\n this.ghost.ghost_red_pos_y = position.y_pos; \r\n }", "invalidateCSSPositioning() {\n if ( !this.positionDirty ) {\n this.positionDirty = true;\n\n // mark all ancestors of this peer so that we can quickly find this dirty peer when we traverse\n // the PDOMInstance tree\n let parent = this.pdomInstance.parent;\n while ( parent ) {\n parent.peer.childPositionDirty = true;\n parent = parent.parent;\n }\n }\n }", "setPos(x,y){\n\t\tthis.setX(x);\n\t\tthis.setY(y);\n\t}", "function removePosition(node, force) {\n visit(node, force ? hard : soft)\n return node\n}", "function removePosition(node, force) {\n visit(node, force ? hard : soft)\n return node\n}", "function removePosition(node, force) {\n visit(node, force ? hard : soft)\n return node\n}", "function CWCMFlowNode_setPoint(_x, _y){\n\tthis.updated = true;\n\tthis.center.x = _x;\n\tthis.center.y = _y;\n}", "moveTo(point) {\n if (!this.fixed) {\n this.reset()\n this.dest = point\n }\n // this.pos = point\n // this.fixed = true\n }", "function markIt(node) {\n node.addClass(\"marked\");\n jsav.umsg(\"Mark node \" + node.value());\n node.highlight();\n jsav.step();\n}", "function positionSet(point, index) {\n circles[index].x = point.x;\n circles[index].y = point.y;\n positioned[index] = true;\n }", "function position() {\n var start = {line: lineno, column: column}\n return function(node) {\n node.position = new Position(start)\n whitespace()\n return node\n }\n }", "setOldPosition(registeredPos) {\n this.setNodePosition(registeredPos.oldValue, registeredPos.element);\n }", "function reposition(node, x, k) {\r\n // console.log(node)\r\n node.x = x;\r\n if (node.children && (n = node.children.length)) {\r\n var i = -1, n;\r\n while (++i < n) x += reposition(node.children[i], x, k);\r\n }\r\n return node.dx = node.value * k;\r\n}", "function positionSet(point, index) {\n circles[index].x = point.x;\n circles[index].y = point.y;\n positioned[index] = true;\n }", "function positionSet(point, index) {\n circles[index].x = point.x;\n circles[index].y = point.y;\n positioned[index] = true;\n }", "function positionSet(point, index) {\n circles[index].x = point.x;\n circles[index].y = point.y;\n positioned[index] = true;\n }", "function ticked() {\n link.attr(\"d\", positionLink);\n node.attr(\"transform\", positionNode);\n }", "function setNewXPositions(last) {\n data.tree.eachBefore(d => {\n d.x = d.x / last\n d.x = d.x * graph.scale.vertical.value\n\n let element = d3.select('#node' + d.data.id)\n if (!element) return\n element.attr('transform', 'translate(' + [d.y, d.x] + ')')\n if (d.parent) {\n d3.select('#link' + d.data.id)\n .select('path')\n .attr('d', 'M' + [d.parent.y, d.parent.x] + 'V' + d.x + 'H' + d.y)\n\n if (graph.style.linkLabels) {\n if (d3.select('#label' + d.data.id)) {\n d3.select('#label' + d.data.id)\n .attr('y', (d.x - 5).toString())\n }\n }\n }\n })\n }", "function pointAt(node){\n var parent = node.parentNode;\n var next = node.nextSibling;\n return function(newnode) {\n parent.insertBefore(newnode, next);\n };\n }", "setWorldPosition(position, update = false){ \n let new_pos = this.getParentSpaceMatrix().getInverse().times(position)\n let pp_r_s_inv = Matrix3x3.Translation(new_pos).times(\n Matrix3x3.Rotation(this.getRotation()).times(\n Matrix3x3.Scale(this.getScale())\n )).getInverse()\n let new_a_mat = pp_r_s_inv.times(this.matrix)\n this.setPosition(new_pos, update)\n this.setAnchorShift(new Vec2(new_a_mat.m02, new_a_mat.m12))\n this.updateMatrixProperties()\n }", "changePosition(x, y, z) {\n\t\t'use strict';\n\t\tthis.obj.position.set(x, y, z);\n\t}", "changePosition(x, y, z) {\n\t\t'use strict';\n\t\tthis.obj.position.set(x, y, z);\n\t}", "function finishNodeAt(node, type, pos, loc) {\n node.type = type;\n node.end = pos;\n if (this.options.locations)\n { node.loc.end = loc; }\n if (this.options.ranges)\n { node.range[1] = pos; }\n return node\n }", "function finishNodeAt(node, type, pos, loc) {\n node.type = type;\n node.end = pos;\n if (this.options.locations)\n { node.loc.end = loc; }\n if (this.options.ranges)\n { node.range[1] = pos; }\n return node\n }", "function finishNodeAt(node, type, pos, loc) {\n node.type = type;\n node.end = pos;\n if (this.options.locations)\n { node.loc.end = loc; }\n if (this.options.ranges)\n { node.range[1] = pos; }\n return node\n }", "insertAfterPart(ref){ref.__insert(this.startNode=createMarker());this.endNode=ref.endNode;ref.endNode=this.startNode}", "function position() {\n const start = {\n line: lineno,\n column\n };\n return function (node) {\n node.position = new Position(start);\n whitespace();\n return node;\n };\n }", "function reposition(node, x, k) {\n node.x = x;\n if (node.children && (n = node.children.length)) {\n var i = -1, n;\n while (++i < n) x += reposition(node.children[i], x, k);\n }\n return node.dx = node.value * k;\n }", "function setNodesPosition(nodes) {\n var deferred = $.Deferred();\n if ( nodes.length == 0 ) { deferred.resolve(); return deferred.promise(); }\n var lab_filename = $('#lab-viewport').attr('data-path');\n var form_data = [];\n form_data=nodes;\n var url = '/api/labs' + lab_filename + '/nodes' ;\n var type = 'PUT';\n $.ajax({\n cache: false,\n timeout: TIMEOUT,\n type: type,\n url: encodeURI(url),\n dataType: 'json',\n data: JSON.stringify(form_data),\n success: function (data) {\n if (data['status'] == 'success') {\n logger(1, 'DEBUG: node position updated.');\n deferred.resolve();\n } else {\n // Application error\n logger(1, 'DEBUG: application error (' + data['status'] + ') on ' + type + ' ' + url + ' (' + data['message'] + ').');\n deferred.reject(data['message']);\n }\n },\n error: function (data) {\n // Server error\n var message = getJsonMessage(data['responseText']);\n logger(1, 'DEBUG: server error (' + data['status'] + ') on ' + type + ' ' + url + '.');\n logger(1, 'DEBUG: ' + message);\n deferred.reject(message);\n }\n });\n return deferred.promise();\n}", "reset(position) {\n this.x = this.x0;\n this.y = this.y0;\n }", "newPosition(x, y)\n {\n this.x = x;\n this.y = y;\n }", "function position() {\n\t var start = { line: lineno, column: column };\n\t return function(node){\n\t node.position = new Position(start);\n\t whitespace();\n\t return node;\n\t };\n\t }", "updatePosition() {\n this.position = Utils.convertToEntityPosition(this.bmp);\n }", "function removePosition(node, force) {\n visit(node, force ? hard : soft);\n return node;\n}", "function update(node, indent) {\n var prev = node.position;\n var start = prev ? prev.start : before;\n var combined = [];\n var n = prev && prev.end.line;\n var l = before.line;\n\n node.position = new Position(start);\n\n /* If there was already a `position`, this\n * node was merged. Fixing `start` wasn’t\n * hard, but the indent is different.\n * Especially because some information, the\n * indent between `n` and `l` wasn’t\n * tracked. Luckily, that space is\n * (should be?) empty, so we can safely\n * check for it now. */\n if (prev && indent && prev.indent) {\n combined = prev.indent;\n\n if (n < l) {\n while (++n < l) {\n combined.push((offset[n] || 0) + 1);\n }\n\n combined.push(before.column);\n }\n\n indent = combined.concat(indent);\n }\n\n node.position.indent = indent || [];\n\n return node;\n }", "function update(node, indent) {\n var prev = node.position;\n var start = prev ? prev.start : before;\n var combined = [];\n var n = prev && prev.end.line;\n var l = before.line;\n\n node.position = new Position(start);\n\n /* If there was already a `position`, this\n * node was merged. Fixing `start` wasn’t\n * hard, but the indent is different.\n * Especially because some information, the\n * indent between `n` and `l` wasn’t\n * tracked. Luckily, that space is\n * (should be?) empty, so we can safely\n * check for it now. */\n if (prev && indent && prev.indent) {\n combined = prev.indent;\n\n if (n < l) {\n while (++n < l) {\n combined.push((offset[n] || 0) + 1);\n }\n\n combined.push(before.column);\n }\n\n indent = combined.concat(indent);\n }\n\n node.position.indent = indent || [];\n\n return node;\n }", "function update(node, indent) {\n var prev = node.position;\n var start = prev ? prev.start : before;\n var combined = [];\n var n = prev && prev.end.line;\n var l = before.line;\n\n node.position = new Position(start);\n\n /* If there was already a `position`, this\n * node was merged. Fixing `start` wasn’t\n * hard, but the indent is different.\n * Especially because some information, the\n * indent between `n` and `l` wasn’t\n * tracked. Luckily, that space is\n * (should be?) empty, so we can safely\n * check for it now. */\n if (prev && indent && prev.indent) {\n combined = prev.indent;\n\n if (n < l) {\n while (++n < l) {\n combined.push((offset[n] || 0) + 1);\n }\n\n combined.push(before.column);\n }\n\n indent = combined.concat(indent);\n }\n\n node.position.indent = indent || [];\n\n return node;\n }", "function update(node, indent) {\n var prev = node.position;\n var start = prev ? prev.start : before;\n var combined = [];\n var n = prev && prev.end.line;\n var l = before.line;\n\n node.position = new Position(start);\n\n /* If there was already a `position`, this\n * node was merged. Fixing `start` wasn’t\n * hard, but the indent is different.\n * Especially because some information, the\n * indent between `n` and `l` wasn’t\n * tracked. Luckily, that space is\n * (should be?) empty, so we can safely\n * check for it now. */\n if (prev && indent && prev.indent) {\n combined = prev.indent;\n\n if (n < l) {\n while (++n < l) {\n combined.push((offset[n] || 0) + 1);\n }\n\n combined.push(before.column);\n }\n\n indent = combined.concat(indent);\n }\n\n node.position.indent = indent || [];\n\n return node;\n }", "function update(node, indent) {\n var prev = node.position;\n var start = prev ? prev.start : before;\n var combined = [];\n var n = prev && prev.end.line;\n var l = before.line;\n\n node.position = new Position(start);\n\n /* If there was already a `position`, this\n * node was merged. Fixing `start` wasn’t\n * hard, but the indent is different.\n * Especially because some information, the\n * indent between `n` and `l` wasn’t\n * tracked. Luckily, that space is\n * (should be?) empty, so we can safely\n * check for it now. */\n if (prev && indent && prev.indent) {\n combined = prev.indent;\n\n if (n < l) {\n while (++n < l) {\n combined.push((offset[n] || 0) + 1);\n }\n\n combined.push(before.column);\n }\n\n indent = combined.concat(indent);\n }\n\n node.position.indent = indent || [];\n\n return node;\n }", "updatePosition() {\n this.handleWrapping();\n this.x += this.vx;\n }" ]
[ "0.7861916", "0.6788894", "0.6681636", "0.6610156", "0.6173554", "0.6161047", "0.6156374", "0.6002291", "0.5998681", "0.59891766", "0.59890425", "0.59074354", "0.5890844", "0.58887213", "0.5858468", "0.58487445", "0.58283585", "0.5807958", "0.578546", "0.5776166", "0.5738537", "0.57345665", "0.57160676", "0.57159877", "0.568641", "0.56833047", "0.5668272", "0.56670654", "0.56437093", "0.56378496", "0.5619375", "0.5618386", "0.5598774", "0.55974984", "0.5594161", "0.55873626", "0.55770046", "0.55669427", "0.5566843", "0.5560061", "0.55485374", "0.5546027", "0.55324996", "0.55317974", "0.55279386", "0.5527807", "0.5519506", "0.5519506", "0.5519506", "0.5519506", "0.5519506", "0.5519506", "0.5514231", "0.5513732", "0.5511838", "0.55108047", "0.55080056", "0.5506884", "0.5506144", "0.5488956", "0.5488956", "0.5488956", "0.54822105", "0.5475014", "0.5465711", "0.54641", "0.54621327", "0.5431846", "0.54280686", "0.542779", "0.542779", "0.542779", "0.5419225", "0.54158497", "0.5410287", "0.539644", "0.5393866", "0.5393866", "0.538352", "0.538352", "0.538352", "0.5377997", "0.5364237", "0.5352925", "0.53521043", "0.5349427", "0.5349224", "0.5348465", "0.534532", "0.53425676", "0.53411424", "0.53411424", "0.53411424", "0.53411424", "0.53411424", "0.5333536" ]
0.612533
11
Add the position to a node.
function update(node, indent) { var prev = node.position; var start = prev ? prev.start : before; var combined = []; var n = prev && prev.end.line; var l = before.line; node.position = new Position(start); /* If there was already a `position`, this * node was merged. Fixing `start` wasn’t * hard, but the indent is different. * Especially because some information, the * indent between `n` and `l` wasn’t * tracked. Luckily, that space is * (should be?) empty, so we can safely * check for it now. */ if (prev && indent && prev.indent) { combined = prev.indent; if (n < l) { while (++n < l) { combined.push((offset[n] || 0) + 1); } combined.push(before.column); } indent = combined.concat(indent); } node.position.indent = indent || []; return node; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function add (node, parent) {\n parent.children.push(node)\n if (parser.position) {\n parent.position = {\n start: parent.children[0].position.start,\n end: node.position.end\n }\n }\n }", "addPosition(pos) {\n this.positions += '=\"'+pos.line + ':' + pos.linePosition + '\",';\n }", "assignPosition(node, position) {\n\t\tif(node.parentNode && position<node.parentNode.position){\n\t\t\tposition = node.parentNode.position;\n\t\t}\n\t\twhile(this.positionMap.get(`${node.level},${position}`)){\n\t\t\tposition++;\n\t\t}\n\t\tnode.position = position;\n\t\tthis.positionMap.set(`${node.level},${position}`, true);\n\t\tfor(var i in node.children){\n\t\t\tthis.assignPosition(node.children[i], position+Number(i));\n\t\t}\n\t}", "assignPosition(node, position) {\n // update the position of the node\n node.position = position;\n \n // the base case\n if (node.children.length === 0)\n {\n leafNodeCounter = leafNodeCounter + 1;\n return node;\n }\n // recursive case\n else\n {\n leafNodeCounter = 0;\n for (var d = 0; d < node.children.length; d++)\n {\n // this is a really bad hack and there is definitely something better out there. \n // However, it gets the job done\n if (node.children[d].name === \"Protosomes\")\n {\n leafNodeCounter = leafNodeCounter + 2;\n }\n\n this.assignPosition(node.children[d], node.position + leafNodeCounter);\n }\n }\n\n }", "setNodePosition(Pos, node) {\n let currrentNode = this.nodes.find(n => n === node);\n currrentNode.x = Pos.x;\n currrentNode.y = Pos.y;\n }", "SetNewPositionToANode(registeredPos) {\n this.setNodePosition(registeredPos.newValue, registeredPos.element);\n }", "function positionTokenAtNode(token, node) {\n // these details depend on the node template\n token.location = node.position.copy().offset(4 + 6, 5 + 6);\n }", "insertAtPosition(position, nodeToInsert) {\n if(position > this.length + 1 || !position || !nodeToInsert)\n return\n\n if(position === 1) {\n this.setHead(nodeToInsert)\n return\n }\n\n let curr = this.head, currPost = 1\n while(curr && currPost++ < position)\n curr = curr.next\n\n if(curr) this.insertBefore(curr, nodeToInsert)\n else this.setTail(nodeToInsert)\n\n }", "insertIn(position, value) {\n if (position < 0 || \n position > this.length) {\n\n console.error(\"Position is out of range! \", position)\n return null;\n }\n\n let node = new Node(value);\n\n if (position === 0) {\n\n node.next = this.head;\n this.head = node;\n\n } else {\n let current = this.head,\n prev = null,\n index = 0;\n\n while (index < position) {\n prev = current;\n current = current.next;\n index ++;\n }\n\n prev.next = node;\n node.next = current;\n }\n\n this.length++;\n\n }", "pushPosition(position) {\n\t\tthis.positionContainer.push(position);\n\t}", "function position() {\n var before = now()\n\n return update\n\n // Add the position to a node.\n function update(node, indent) {\n var previous = node.position\n var start = previous ? previous.start : before\n var combined = []\n var n = previous && previous.end.line\n var l = before.line\n\n node.position = new Position(start)\n\n // If there was already a `position`, this node was merged. Fixing\n // `start` wasn’t hard, but the indent is different. Especially\n // because some information, the indent between `n` and `l` wasn’t\n // tracked. Luckily, that space is (should be?) empty, so we can\n // safely check for it now.\n if (previous && indent && previous.indent) {\n combined = previous.indent\n\n if (n < l) {\n while (++n < l) {\n combined.push((offset[n] || 0) + 1)\n }\n\n combined.push(before.column)\n }\n\n indent = combined.concat(indent)\n }\n\n node.position.indent = indent || []\n\n return node\n }\n }", "insertAfter(position, data) {\n /*\n `position === -1` means we are adding the node before the head,\n hence, our `head` should be changed\n */\n if (position === -1) {\n let newNode = new ListNode(data)\n newNode.next = this.head\n this.head = newNode\n return\n }\n\n let currentNode = this.find(position)\n\n if (currentNode) {\n let newNode = new ListNode(data)\n newNode.next = currentNode.next\n currentNode.next = newNode\n } else {\n throw new Error(`Cannot insert at position ${position + 1}: unreachable position!`)\n }\n }", "function addNode(){\n\n if (!CONST.nodeEditingEnabled)\n return;\n // prevent I-bar on drag\n //d3.event.preventDefault();\n\n // because :active only works in WebKit?\n svg.classed('active', true);\n\n if(d3.event.ctrlKey || mousedown_node || mousedown_link) return;\n\n // insert new node at point\n var point = d3.mouse(this),\n node = {id: 'ID' + ++lastNodeId, reflexive: false};\n node.x = point[0];\n node.y = point[1];\n nodes.push(node);\n\n showMsg('New node is added', 'success');\n restart();\n }", "function position() {\n var before = now();\n\n return update;\n\n /* Add the position to a node. */\n function update(node, indent) {\n var prev = node.position;\n var start = prev ? prev.start : before;\n var combined = [];\n var n = prev && prev.end.line;\n var l = before.line;\n\n node.position = new Position(start);\n\n /* If there was already a `position`, this\n * node was merged. Fixing `start` wasn’t\n * hard, but the indent is different.\n * Especially because some information, the\n * indent between `n` and `l` wasn’t\n * tracked. Luckily, that space is\n * (should be?) empty, so we can safely\n * check for it now. */\n if (prev && indent && prev.indent) {\n combined = prev.indent;\n\n if (n < l) {\n while (++n < l) {\n combined.push((offset[n] || 0) + 1);\n }\n\n combined.push(before.column);\n }\n\n indent = combined.concat(indent);\n }\n\n node.position.indent = indent || [];\n\n return node;\n }\n }", "function position() {\n var before = now();\n\n return update;\n\n /* Add the position to a node. */\n function update(node, indent) {\n var prev = node.position;\n var start = prev ? prev.start : before;\n var combined = [];\n var n = prev && prev.end.line;\n var l = before.line;\n\n node.position = new Position(start);\n\n /* If there was already a `position`, this\n * node was merged. Fixing `start` wasn’t\n * hard, but the indent is different.\n * Especially because some information, the\n * indent between `n` and `l` wasn’t\n * tracked. Luckily, that space is\n * (should be?) empty, so we can safely\n * check for it now. */\n if (prev && indent && prev.indent) {\n combined = prev.indent;\n\n if (n < l) {\n while (++n < l) {\n combined.push((offset[n] || 0) + 1);\n }\n\n combined.push(before.column);\n }\n\n indent = combined.concat(indent);\n }\n\n node.position.indent = indent || [];\n\n return node;\n }\n }", "function position() {\n var before = now();\n\n return update;\n\n /* Add the position to a node. */\n function update(node, indent) {\n var prev = node.position;\n var start = prev ? prev.start : before;\n var combined = [];\n var n = prev && prev.end.line;\n var l = before.line;\n\n node.position = new Position(start);\n\n /* If there was already a `position`, this\n * node was merged. Fixing `start` wasn’t\n * hard, but the indent is different.\n * Especially because some information, the\n * indent between `n` and `l` wasn’t\n * tracked. Luckily, that space is\n * (should be?) empty, so we can safely\n * check for it now. */\n if (prev && indent && prev.indent) {\n combined = prev.indent;\n\n if (n < l) {\n while (++n < l) {\n combined.push((offset[n] || 0) + 1);\n }\n\n combined.push(before.column);\n }\n\n indent = combined.concat(indent);\n }\n\n node.position.indent = indent || [];\n\n return node;\n }\n }", "function position() {\n var before = now();\n\n return update;\n\n /* Add the position to a node. */\n function update(node, indent) {\n var prev = node.position;\n var start = prev ? prev.start : before;\n var combined = [];\n var n = prev && prev.end.line;\n var l = before.line;\n\n node.position = new Position(start);\n\n /* If there was already a `position`, this\n * node was merged. Fixing `start` wasn’t\n * hard, but the indent is different.\n * Especially because some information, the\n * indent between `n` and `l` wasn’t\n * tracked. Luckily, that space is\n * (should be?) empty, so we can safely\n * check for it now. */\n if (prev && indent && prev.indent) {\n combined = prev.indent;\n\n if (n < l) {\n while (++n < l) {\n combined.push((offset[n] || 0) + 1);\n }\n\n combined.push(before.column);\n }\n\n indent = combined.concat(indent);\n }\n\n node.position.indent = indent || [];\n\n return node;\n }\n }", "function position() {\n var before = now();\n\n return update;\n\n /* Add the position to a node. */\n function update(node, indent) {\n var prev = node.position;\n var start = prev ? prev.start : before;\n var combined = [];\n var n = prev && prev.end.line;\n var l = before.line;\n\n node.position = new Position(start);\n\n /* If there was already a `position`, this\n * node was merged. Fixing `start` wasn’t\n * hard, but the indent is different.\n * Especially because some information, the\n * indent between `n` and `l` wasn’t\n * tracked. Luckily, that space is\n * (should be?) empty, so we can safely\n * check for it now. */\n if (prev && indent && prev.indent) {\n combined = prev.indent;\n\n if (n < l) {\n while (++n < l) {\n combined.push((offset[n] || 0) + 1);\n }\n\n combined.push(before.column);\n }\n\n indent = combined.concat(indent);\n }\n\n node.position.indent = indent || [];\n\n return node;\n }\n }", "function InsertNode() {}", "insertAt(item, position) {\n if(this.head === null) {\n this.head = new _Node(item, this.head)\n }\n let currNode = this.head\n let count = 0\n while(count < position - 1) {\n currNode = currNode.next\n count++\n }\n currNode.next = new _Node(item, currNode.next)\n }", "insert(pos, val) {\n const newNode = new LListNode(val, pos.current().getNext());\n pos.current().setNext(newNode);\n pos.next();\n return pos;\n }", "addNode(node, outerDeco, innerDeco, view, pos) {\n this.top.children.splice(this.index++, 0, NodeViewDesc.create(this.top, node, outerDeco, innerDeco, view, pos));\n this.changed = true;\n }", "function insertNode(text, position, parentNode, session) {\n var seed = session.seed();\n\n seed.setValue(text);\n parentNode.insert(seed, position);\n\n return seed;\n }", "function insertNode(location, reference) {\n\tvar newNode = document.createElement('div');\n\tnewNode.className = 'node';\n\n\tif (location === 'before') {\n\t\tnodeList.insertBefore(newNode, reference);\n\t} else {\n\t\tnodeList.insertBefore(newNode, reference.nextSibling);\n\t}\n\t\n\tnewNode.innerHTML = nodeFiller;\n}", "newPosition(position) {\n this.position = position;\n }", "function positionNode(d) {\n // keep the node within the boundaries of the svg\n if (d.x < 0) {\n d.x = 0\n };\n if (d.y < 0) {\n d.y = 0\n };\n if (d.x > width) {\n d.x = width\n };\n if (d.y > height) {\n d.y = height\n };\n return \"translate(\" + d.x + \",\" + d.y + \")\";\n }", "insert(pos, val){\r\n\r\n if(pos > this.length || pos < 0) return false;\r\n\r\n if(pos === this.length){\r\n this.push(val);\r\n }else if(pos === 0){\r\n this.unshift(val);\r\n }else{\r\n let selectedNode = this.getNode(pos-1);\r\n let oldNext = selectedNode.next;\r\n\r\n let newNode = new Node(val);\r\n selectedNode.next = newNode;\r\n newNode.next = oldNext; \r\n newNode.prev = selectedNode;\r\n selectedNode.prev = newNode;\r\n this.length += 1;\r\n }\r\n\r\n return true;\r\n\r\n }", "function addNodeOnto(x,y,name){\n var index = node_dataOnto.length;\n node_dataOnto.push({x:x,y:y,name:name,index:index});\n refreshGraphOnto(node_dataOnto,link_dataOnto);\n}", "function adjustNodeInsertPosition(root, nodeToInsert, position) {\n adjustSteps.forEach(function (handler) {\n position = handler(root, nodeToInsert, position);\n });\n return position;\n}", "createNode(pos) {\n let newX;\n let newY;\n if (pos !== undefined) {\n newX = pos.x;\n newY = pos.y;\n }\n else {\n newX = this.cursorPosition.x;\n newY = this.cursorPosition.y;\n }\n return new Types_1.Node(\"0\", this.findLowestIDAvailable(), newX, newY, this.frozen, false);\n }", "function addNode(){\n d.push(createNode(nodeCount));\n nodeCount++;\n}", "function patch(node) {\n if (!node.position) {\n node.position = {}\n }\n}", "function insertNodeAtPosition(head, data, position){ \n \tif(position == 0){\n \tconst to_insert = new LinkedListNode(data)\n \tto_insert.next = head\n head = to_insert\n return head\n }\n let count = 1\n let current = head\n while(count < position){\n \tcount++\n current = current.next\n\t}\n const to_insert = new LinkedListNode(data)\n to_insert.next = current.next\n current.next = to_insert\n \n current = head\n let result = \"\"\n while(current){\n \tresult += `${current.data} `\n \tcurrent = current.next\n }\n \n return head\n}", "set position(value) {\n this.position$.next(value);\n }", "get pos()\n\t{\n\t\treturn new NodeGraph.Position(this.x, this.y);\n\t}", "insertAt(element, position){\n var head = this.head;\n var node = new Node(element);\n if(position <=0 || position>this.size+1)\n return;\n else if(position == 1){\n node.next = head;\n this.head = node;\n }\n else if(position == this.size+1){\n var current = this.head;\n while(current.next){\n current = current.next;\n }\n current.next = node;\n }\n else{\n var current = this.head;\n for(var i=1; i<position-1; i++){\n current = current.next;\n }\n var nextNode = current.next;\n node.next = current.next;\n current.next = node;\n\n }\n this.size++;\n\n }", "insertAt(element, pos) {\n let nodeToInsert = new Node(element);\n let count = 0;\n let current = this.head;\n let previous;\n if (pos === 0) {\n nodeToInsert.next = this.head;\n this.head = nodeToInsert;\n } else if (pos == this.size) {\n while (count < pos) {\n previous = current;\n current = current.next;\n count++;\n }\n previous.next = nodeToInsert;\n }\n else {\n while (count < pos) {\n previous = current;\n current = current.next;\n count++;\n }\n nodeToInsert.next = previous.next;\n previous.next = nodeToInsert;\n this.size++;\n }\n }", "function addNodeToCy(nodeText, x, y){\r\n\tif(x == undefined) x = 0;\r\n\tif(y == undefined) y = 0;\r\n\t\r\n\tif(hasSuperSubScript(nodeText)){\r\n\t\treturn insertSuperSubscript(nodeText, x, y);\r\n\t}\t\r\n\r\n\tnode = \t{ // node\" +\r\n\t\t\t\tdata: {name: nodeText/*, label_name: nodeText*/},\r\n\t\t\t\trenderedPosition: { x: x, y: y},\r\n\t\t\t\tclasses:['base']\r\n\t\t\t};\r\n\treturn cy.add(node);\r\n}", "set position (newPosition) {\n this.emit('position', newPosition)\n this._position = newPosition * this.ticksPerSongPosition\n }", "constructor($pos) {\n let node = $pos.nodeAfter;\n let $end = $pos.node(0).resolve($pos.pos + node.nodeSize);\n super($pos, $end);\n this.node = node;\n }", "insertAt(position,item){\n \n if(this.head === null){\n this.insertFirst(item);\n }\n \n let ticker = 0;\n let currNode = this.head;\n let nextNode = this.head;\n \n while ((nextNode !== null) && (ticker !== position)) {\n //save the previous node \n currNode = nextNode;\n nextNode = currNode.next;\n ticker++;\n }\n \n currNode.next = new _Node(item,nextNode);\n \n }", "function writePosition(x,y){\n //first refer to the point and set the value\n database.ref('ball/position').set({\n 'x':position.x+x,\n 'y':position.y+y\n })\n}", "insert(position, element){\n if (position >= 0 && position < this.length){\n var node = new Node(element);\n var current = this.head;\n var previous;\n var counter = 0;\n // if adding element at the beginning of the list...\n if (position === 0){\n // push back the 1st element...\n node.next = current;\n // point head to inserted node\n this.head = node;\n } else {\n // loop thru til we reach the desired position...\n while (counter++ < position){\n previous = current;\n current = current.next;\n }\n // when finally bust out of the loop, CURRENT is referencing element after the position we would like to insert... (want to add new item b/w prev and current)\n // point previous.next to node && point node.next to current\n // make a link b/w the new item and current\n node.next = current;\n // change link b/w previous and current\n previous.next = node;\n }\n this.length++;\n return true;\n } else {\n return false;\n }\n }", "function addPosition(x,y,positionArray) {\n var position={x,y};\n positionArray.push(position);\n}", "setPosition(newX=this.x, newY=this.y) {\n this.x = newX;\n this.y = newY;\n this.updateEdges() // Update Edge positions\n this.setAnchorPostion(this, newX, newY); // Update DOM element\n }", "insertAfterNode(e){this.startNode=e,this.endNode=e.nextSibling}", "set pos(newPos) {\n this._pos = newPos;\n }", "function addNode(val,x,y)\n{\n d3.select(`#node${val-1}`).remove();\n\n const svg = d3.select('svg');\n\n const g= svg.append('g')\n .attr('id',`node${val-1}`);\n\n const c = g.append('circle')\n .attr('cx',`${x}`)\n .attr('cy',`${y}`)\n .attr('r',25)\n .style('fill','#F5F2B8')\n .attr('stroke','#383F51')\n .attr('stroke-width','2px');\n\n const t =g.append('text')\n .attr('x',`${x}`)\n .attr('y',`${y}`)\n .text(val)\n .attr('fill','#383F51')\n .attr('alignment-baseline',\"central\")\n .attr('text-anchor','middle')\n .attr('font-size','20px')\n .style('font-weight','bold');\n\n}", "function setCursorPositionInNode(node, pos)\n\t{\n\t\tvar sel, range;\n\t\tif (window.getSelection && document.createRange) {\n\t\t\trange = document.createRange();\n \t\t\trange.setEnd(node, pos);\n\t\t\trange.setStart(node, pos);\n\t\t\tsel = window.getSelection();\n\t\t\tsel.removeAllRanges();\n\t\t\tsel.addRange(range);\n\t\t} else if (document.body.createTextRange) {\n\t\t\trange = document.body.createTextRange();\n\t\t\trange.setEnd(node, pos);\n\t\t\trange.setStart(node, pos);\n\t\t\trange.select();\n\t\t}\n\t}", "addAfter(value, position){\n\t\tif(!this.head) return this.add(value);\n\t\tif(this.length < position) return 'position does not exist';\n\t\tif(this.length === position) return this.add(value);\n\t\tlet newNode = new Node(value);\n\t\tlet aux, count = 1;\n\t\tlet current = this.head;\n\t\twhile(count <= position){\n\t\t\tcurrent = current.next\n\t\t\tcount++\n\t\t}\n\t\taux = current.next;\n\t\tnewNode.next = aux;\n\t\tcurrent.next = newNode;\n\t\tthis.length++;\n\t\treturn this;\n\t}", "function setNode(pos, dist){\n\tif(nodeArray[pos] != start){\n\t\tnodeArray[pos].addDis('&#8734');\n\t}\n\n\tif(pos < nodeArray.length - 1){\n\t\tsetTimeout(function(){setNode(++pos, dist);}, 50);\n\t\t// setTimeout(function(){alert(pos);}, 1000);\n\t}\n\n\tif (pos == nodeArray.length - 1) {\n\t\tdijkstraHelp(null, q, [], dist);\n\t};\n}", "insertAfterNode(ref){this.startNode=ref;this.endNode=ref.nextSibling}", "updatePosition(position) {\n if (position == null)\n return;\n const positionNodes = parseExpressions(position)[0].terms;\n for (let i = 0; i < 3; ++i) {\n this.position.setComponent(i, normalizeUnit(positionNodes[i]).number);\n }\n }", "newPosition(x, y)\n {\n this.x = x;\n this.y = y;\n }", "function append(node, item, offset) {\n\n\t\titem.offset = ++offset;\n\t\tsiblingIndex.add(item);\n\t\tnode.children.push(item);\n\t\titem.parent = node;\n\t\titem.id = id++;\n\t\ttree.push(item);\n\n\t}", "function pointAt(node){\n var parent = node.parentNode;\n var next = node.nextSibling;\n return function(newnode) {\n parent.insertBefore(newnode, next);\n };\n }", "updatePosition(position) {\n if (position == null)\n return;\n const positionNodes = parseExpressions(position)[0].terms;\n for (let i = 0; i < 3; ++i) {\n this.position.setComponent(i, normalizeUnit(positionNodes[i]).number);\n }\n this.updateMatrixWorld();\n }", "insertAfterNode(ref) {\n this.startNode = ref;\n this.endNode = ref.nextSibling;\n }", "function addNode(x,y,radius,nodeColor,nodeName)\r\n{\r\n\r\n\tnodeText[nodeString.length]='<text x=\"'+(x-4.3*nodeName.length)+'\" y=\"'+(y+2*radius)+'\" fill=\"white\">'+nodeName+'</text>';\r\n\tnodeString[nodeString.length]='<circle cx=\"'+x+'\" cy=\"'+y+'\" r=\"'+radius+'\" stroke=\"white\" stroke-width=\"1\" fill=\"'+nodeColor+'\" onmouseover=\"changeNodeInformation('+nodeString.length+')\" onClick=\"nodeClickHandle('+nodeString.length+')\" />';\r\n}", "function updateNodePositions() {\n // set node positions\n rect.attr('transform', function (d) {\n return 'translate(' + d.x + ',' + d.y + ')';\n });\n}", "addValue(val) {\n let n = new Node(val);\n if (this.root == null) {\n this.root = n;\n // An initial position for the root node\n this.root.x = width / 2;\n this.root.y = 16;\n } else {\n this.root.addNode(n);\n }\n }", "function position() {\n var start = {line: lineno, column: column}\n return function(node) {\n node.position = new Position(start)\n whitespace()\n return node\n }\n }", "function createNodes(node, positionX, positionY, val = 0){\n let newVal = val + int(node.freq);\n circles.push([positionX, positionY, node.freq, node.symbol]);\n \n if(node.left !== null){\n createNodes(node.left, positionX - 100, positionY + 100, newVal);\n lines.push([positionX, positionY, positionX - 100, positionY + 100]);\n } \n \n if(node.right !== null){\n createNodes(node.right, positionX + 100, positionY + 100, newVal)\n lines.push([positionX, positionY, positionX + 100, positionY + 100]);\n }\n \n}", "function insertPositions() {\n $.each(rankingData, function(index, value) {\n rankingData[index].position = index + 1;\n });\n }", "function position() {\n var start = { line: lineno, column: column };\n return function(node){\n node.position = new Position(start);\n whitespace();\n return node;\n };\n }", "function position() {\n var start = { line: lineno, column: column };\n return function(node){\n node.position = new Position(start);\n whitespace();\n return node;\n };\n }", "function position() {\n var start = { line: lineno, column: column };\n return function(node){\n node.position = new Position(start);\n whitespace();\n return node;\n };\n }", "function position() {\n var start = { line: lineno, column: column };\n return function(node){\n node.position = new Position(start);\n whitespace();\n return node;\n };\n }", "function position() {\n var start = { line: lineno, column: column };\n return function(node){\n node.position = new Position(start);\n whitespace();\n return node;\n };\n }", "function position() {\n var start = { line: lineno, column: column };\n return function(node){\n node.position = new Position(start);\n whitespace();\n return node;\n };\n }", "add_node (node) {\n this.socket.emit('add_node', {\n nodeId: node.nodeId,\n iport: node.iport\n });\n }", "addAt(index, data) {\n var node = new Node(data);\n\n if (index < 0 || index > this.size) {\n console.log(\"this index \" + index + \"th position is not from current list position 0 to \" + this. size);\n this.size--;\n }else if (index == 0) {\n this.addStart(data);\n this.size--;\n }else if (index == this.size) {\n this.add(data);\n this.size--;\n }else {\n var temp = this.head;\n for (var i = 0; i < index - 1; i++) {\n temp = temp.next;\n }\n\n //updating new nodes pointer to next node\n node.next = temp.next;\n //updating previous node's pointer to new node\n temp.next = node;\n }\n this.size++;\n }", "function position(pos) {\n log.innerHTML = pos\n }", "insertAfterNode(ref){this.startNode=ref;this.endNode=ref.nextSibling;}", "function position() {\n\t var start = { line: lineno, column: column };\n\t return function(node){\n\t node.position = new Position(start);\n\t whitespace();\n\t return node;\n\t };\n\t }", "insertAfterNode(ref) {\n this.startNode = ref;\n this.endNode = ref.nextSibling;\n }", "insertAfterNode(ref) {\n this.startNode = ref;\n this.endNode = ref.nextSibling;\n }", "insertAfterNode(ref) {\n this.startNode = ref;\n this.endNode = ref.nextSibling;\n }", "insertAfterNode(ref) {\n this.startNode = ref;\n this.endNode = ref.nextSibling;\n }", "insertAfterNode(ref) {\n this.startNode = ref;\n this.endNode = ref.nextSibling;\n }", "set x(nx){\n\t\tthis.position.nx = nx;\n\t}", "setNodeColumn() {\n const node = this;\n if (!defined(node.options.column)) {\n // No links to this node, place it left\n if (node.linksTo.length === 0) {\n node.column = 0;\n }\n else {\n node.column = node.getFromNode().fromColumn + 1;\n }\n }\n }", "pushNewPos(x, y, stack)\n\t{\n\t\tconsole.log (\"==> \", x, \", \", y);\n let npos = new Position();\n\t\tnpos.setx(x);\n\t\tnpos.sety(y);\n\t\tif (this.maze.validPosition(x,y))\n\t\t\tstack.push(npos);\n\t}", "setPosition(x, y) {\n this.pos.x = x;\n this.pos.y = y;\n }", "insert(index, val) {\n // check if the index less than zero ang greater than the length.\n if(index < 0 || index > this.length) {\n return false;\n }\n // if the index is the same as length use push.\n if(index === this.length){\n this.push(val);\n return true;\n }\n // if the index is zero use unshift. \n if(index === 0) {\n this.unshift(val);\n return true;\n }\n // get the node at the target position\n let targetNode = this.get(index);\n // find the node before the target index.\n let beforeTargetNode = this.get(index - 1);\n // Create new Node with val. \n let newNode = new Node(val);\n // set the next prop on the node be the new node. \n newNode.next = targetNode;\n // set the before target node next prop to the new Node. \n beforeTargetNode.next = newNode;\n // increment the length\n this.length++;\n\n // return true.\n return true;\n }", "function insertOrAppend(container, pos, el) {\n var childs = container.childNodes;\n if (pos < childs.length) {\n var refNode = childs[pos];\n container.insertBefore(el, refNode);\n } else {\n container.appendChild(el);\n }\n }", "addNode(x, y, text, rx = 20, ry = 20) {\n let node = new Node(x, y, rx, ry, text);\n this.root.appendChild(node.root);\n this.nodes.push(node);\n return node;\n }", "insertNode(editor, node) {\n editor.insertNode(node);\n }", "insertNode(editor, node) {\n editor.insertNode(node);\n }", "function position() {\n const start = {\n line: lineno,\n column\n };\n return function (node) {\n node.position = new Position(start);\n whitespace();\n return node;\n };\n }", "function insert(n, p, x1, y1, x2, y2) {\n if (isNaN(p.x) || isNaN(p.y)) return; // ignore invalid points\n if (n.leaf) {\n var v = n.point;\n if (v) {\n // If the point at this leaf node is at the same position as the new\n // point we are adding, we leave the point associated with the\n // internal node while adding the new point to a child node. This\n // avoids infinite recursion.\n if ((Math.abs(v.x - p.x) + Math.abs(v.y - p.y)) < .01) {\n insertChild(n, p, x1, y1, x2, y2);\n } else {\n n.point = null;\n insertChild(n, v, x1, y1, x2, y2);\n insertChild(n, p, x1, y1, x2, y2);\n }\n } else {\n n.point = p;\n }\n } else {\n insertChild(n, p, x1, y1, x2, y2);\n }\n }", "function insert(n, p, x1, y1, x2, y2) {\n if (isNaN(p.x) || isNaN(p.y)) return; // ignore invalid points\n if (n.leaf) {\n var v = n.point;\n if (v) {\n // If the point at this leaf node is at the same position as the new\n // point we are adding, we leave the point associated with the\n // internal node while adding the new point to a child node. This\n // avoids infinite recursion.\n if ((Math.abs(v.x - p.x) + Math.abs(v.y - p.y)) < .01) {\n insertChild(n, p, x1, y1, x2, y2);\n } else {\n n.point = null;\n insertChild(n, v, x1, y1, x2, y2);\n insertChild(n, p, x1, y1, x2, y2);\n }\n } else {\n n.point = p;\n }\n } else {\n insertChild(n, p, x1, y1, x2, y2);\n }\n }", "setPosition(x, y) {\n this.x = x\n this.y = y\n }", "insertAfterNode(ref) {\n this.startNode = ref;\n this.endNode = ref.nextSibling;\n }", "setPosition(position) {\n this.position = position;\n }", "insert(element, position) {\n // check for out-of-bounds values\n if(index >= 0 && index <= this.count) { \n const node = new Node(element);\n // change the head reference to node and add a new element to the list\n if(index === 0) { \n node.next = current; \n this.head = node;\n // to loop through the list until the desired position\n } else {\n const previous = this.getElementAt(index - 1);\n node.next = previous.next; // to link the new node and the current\n previous.next = node; \n }\n this.count++;\n return true;\n }\n return false;\n }", "insertCell(x, y) {\n this.root.insert(x, y);\n }", "function ParticleRotateToPositionNode(mode /*uint*/, position) {\n if (position === void 0) { position = null; }\n _super.call(this, \"ParticleRotateToPosition\", mode, 3, 3);\n this._pStateClass = ParticleRotateToPositionState;\n this._iPosition = position || new Vector3D();\n }", "function addNode() {\r\n\t\t\t\t\t\t\t// removeId(root);\r\n\r\n\t\t\t\t\t\t\tvar newNode = {};\r\n\t\t\t\t\t\t\tnewNode.name = \"Node\"\r\n\t\t\t\t\t\t\t\t\t+ Math.floor((Math.random() * 100) + 1);\r\n\t\t\t\t\t\t\tnewNode.VALUE = 100;\r\n\t\t\t\t\t\t\tvar component = root[\"children\"]; // considering\r\n\t\t\t\t\t\t\t// component\r\n\t\t\t\t\t\t\t// node to add\r\n\t\t\t\t\t\t\t// new nodes as\r\n\t\t\t\t\t\t\t// a test.\r\n\t\t\t\t\t\t\tcomponent.push(newNode);\r\n\t\t\t\t\t\t\tgeneratedNodesIdx.push(component.length - 1);// tracking\r\n\t\t\t\t\t\t\t// newly\r\n\t\t\t\t\t\t\t// generated\r\n\t\t\t\t\t\t\t// nodes\r\n\t\t\t\t\t\t\t// to\r\n\t\t\t\t\t\t\t// remove\r\n\t\t\t\t\t\t\tupdate();\r\n\t\t\t\t\t\t}", "setPosition(x, y) {\n this.x = x;\n this.y = y;\n }", "function updatePosition() {\r\n\t\t\tcircle.attr('transform', `translate(${point.x * graph.cell_size + graph.offset.x} ${point.y * graph.cell_size + graph.offset.y})`);\r\n\t\t}" ]
[ "0.65842587", "0.6516607", "0.6484519", "0.6458811", "0.63893163", "0.62335664", "0.6225618", "0.61637735", "0.61253077", "0.60475916", "0.60419756", "0.5999882", "0.59785116", "0.5964825", "0.5964825", "0.5964825", "0.5964825", "0.5964825", "0.59278154", "0.59051055", "0.5901259", "0.58630866", "0.5838625", "0.58188635", "0.5809159", "0.5797509", "0.5774651", "0.57729393", "0.5772319", "0.5768111", "0.5731056", "0.5717036", "0.5708865", "0.56807077", "0.5666992", "0.5664542", "0.56640655", "0.5660068", "0.56595004", "0.565204", "0.560263", "0.56018305", "0.56014013", "0.56006944", "0.5594555", "0.5591222", "0.55698967", "0.55558455", "0.5552502", "0.55331004", "0.55274653", "0.5526056", "0.5505175", "0.55015147", "0.5495383", "0.54930955", "0.5479434", "0.54737186", "0.54603213", "0.54598755", "0.54550207", "0.5452428", "0.54511666", "0.54473", "0.54385203", "0.54385203", "0.54385203", "0.54385203", "0.54385203", "0.54385203", "0.54353106", "0.542941", "0.54277307", "0.5421702", "0.5409045", "0.53886795", "0.53886795", "0.53886795", "0.53886795", "0.53886795", "0.5374939", "0.5372405", "0.5365805", "0.5362376", "0.5360638", "0.5358303", "0.535758", "0.5355967", "0.5355967", "0.535018", "0.5348159", "0.5348159", "0.5344112", "0.5330438", "0.53300214", "0.53265595", "0.5308668", "0.5298879", "0.52846766", "0.52830726", "0.5276127" ]
0.0
-1
Add `node` to `parent`s children or to `tokens`. Performs merges where possible.
function add(node, parent) { var children = parent ? parent.children : tokens; var prev = children[children.length - 1]; if ( prev && node.type === prev.type && node.type in MERGEABLE_NODES && mergeable(prev) && mergeable(node) ) { node = MERGEABLE_NODES[node.type].call(self, prev, node); } if (node !== prev) { children.push(node); } if (self.atStart && tokens.length !== 0) { self.exitStart(); } return node; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function add(node, parent) {\n var children = parent ? parent.children : tokens\n var previous = children[children.length - 1]\n var fn\n\n if (\n previous &&\n node.type === previous.type &&\n (node.type === 'text' || node.type === 'blockquote') &&\n mergeable(previous) &&\n mergeable(node)\n ) {\n fn = node.type === 'text' ? mergeText : mergeBlockquote\n node = fn.call(self, previous, node)\n }\n\n if (node !== previous) {\n children.push(node)\n }\n\n if (self.atStart && tokens.length !== 0) {\n self.exitStart()\n }\n\n return node\n }", "function add (node, parent) {\n parent.children.push(node)\n if (parser.position) {\n parent.position = {\n start: parent.children[0].position.start,\n end: node.position.end\n }\n }\n }", "function mutation_append(node, parent) {\n /**\n * To append a node to a parent, pre-insert node into parent before null.\n */\n return mutation_preInsert(node, parent, null);\n}", "function union(nodeA, nodeB, parent) {\n let parentA = findParent(nodeA, parent);\n let parentB = findParent(nodeB, parent);\n parent[parentB] = parentA;\n}", "function addNodes(parent, nodes) {\n return nodes ? { ...parent, nodes } : parent;\n }", "function apply(node, parent) {\n return pos(add(pos(node), parent), indent);\n }", "function apply(node, parent) {\n return pos(add(pos(node), parent), indent);\n }", "function apply(node, parent) {\n return pos(add(pos(node), parent), indent);\n }", "function apply(node, parent) {\n return pos(add(pos(node), parent), indent);\n }", "function apply(node, parent) {\n return pos(add(pos(node), parent), indent);\n }", "appendToTree(Node) {\n this.tree = {...this.tree, ...Node};\n }", "function addNode(parent_id, node_data, user, done) {\n\n Node.findById(parent_id, function (error, parent_node) {\n if (error) {\n return done(error);\n }\n\n if (!parent_node) {\n return done('This parent node doesn\\'t exist');\n }\n\n // Assign task ID.\n // Task IDs are incremental, prefixed by parent task IDs.\n var taskId = 1;\n if (typeof parent_node.last_task_id !== 'undefined') {\n taskId = parent_node.last_task_id + 1;\n }\n\n var node = new Node({\n title: node_data.title,\n user: user._id,\n _parent: parent_node._id,\n level: parent_node.level + 1,\n path: (parent_node.path) ? (parent_node.path + ',' + parent_node._id) : parent_node._id,\n _project: parent_node._project,\n task_id: parent_node.task_id + '.' + taskId,\n });\n\n // Save the last task ID.\n parent_node.set('last_task_id', taskId);\n parent_node.save();\n\n node.save(function (error) {\n if (error) {\n return done(error);\n }\n\n parent_node._nodes.unshift(node._id);\n parent_node.save(function (err) {});\n\n done(null, node, parent_node);\n\n });\n });\n}", "function apply(node, parent) {\n return pos(add(pos(node), parent), indent)\n }", "function appendNode(parent, node) {\n\n // Handle the replacement based on the type\n if (isElement(node) == true)\n parent.appendChild(node);\n else {\n var el = document.createElement(\"div\");\n el.innerHTML = node;\n\n var nodes = [];\n\n // Populate the nodes\n for (var i = 0; i < el.childNodes.length; i++)\n nodes.push(el.childNodes[i]);\n\n // Insert all the nodes\n for (i = 0; i < nodes.length; i++)\n parent.appendChild(nodes[i]);\n\n }\n\n // Return\n return;\n\n }", "shiftNodeUp(node) {\n\n\t\tif (node.parent == null) {\n\t\t\tthis.root = node;\n\t\t\treturn;\n\t\t}\n\n\t\tif (node.priority <= node.parent.priority) {\n\t\t\treturn;\n\n\t\t} else if (this.parentNodes.length != 0) {\n\t\t\tvar indexOfNode = this.parentNodes.indexOf (node);\n\t\t\tvar indexOfNodeParent = this.parentNodes.indexOf (node.parent);\n\t\t\tif ( indexOfNode != -1) {\n\t\t\t\tthis.parentNodes[indexOfNode] = node.parent;\n\t\t\t\tif (indexOfNodeParent != -1) {\n\t\t\t\t\tthis.parentNodes[indexOfNodeParent] = node;\n\t\t\t\t}\t\n\t\t\t}\t\n\n\t\tif (this.root == node.parent) { \n\t\t\tthis.root = node; \n\t\t}\n\n\t\tnode.swapWithParent ();\n\t\tthis.shiftNodeUp(node);\n\t\t} \t\n\t}", "function walkAddParent(ast, fn) {\n let stack = [ast], i, j, key, len, node, child, subchild;\n for (i = 0; i < stack.length; i += 1) {\n node = stack[i];\n fn(node);\n for (key in node) {\n if (key !== 'parent' && key.substr(0, 3) != 'fp_') {\n child = node[key];\n if (child instanceof Array) {\n for (j = 0, len = child.length; j < len; j += 1) {\n subchild = child[j];\n if (subchild instanceof Object) {\n subchild.parent = node;\n }\n stack.push(subchild);\n }\n }\n else if (child != void 0 && typeof child.type === 'string') {\n child.parent = node;\n stack.push(child);\n }\n }\n }\n }\n}", "addSibling(node){\r\n\t\tif(this.parent != null){\r\n\t\t\tvar childrenList = this.parent.children;\r\n\t\t\tchildrenList[childrenList.length] = node;\r\n\t\t\tnode.parent = this.parent;\r\n\t\t}\r\n\t}", "function mergeBlockquote(prev, node) {\n if (this.options.commonmark) {\n return node;\n }\n\n prev.children = prev.children.concat(node.children);\n\n return prev;\n}", "function mergeBlockquote(prev, node) {\n if (this.options.commonmark) {\n return node;\n }\n\n prev.children = prev.children.concat(node.children);\n\n return prev;\n}", "function mergeBlockquote(prev, node) {\n if (this.options.commonmark) {\n return node;\n }\n\n prev.children = prev.children.concat(node.children);\n\n return prev;\n}", "function mergeBlockquote(prev, node) {\n if (this.options.commonmark) {\n return node;\n }\n\n prev.children = prev.children.concat(node.children);\n\n return prev;\n}", "function mergeBlockquote(prev, node) {\n if (this.options.commonmark) {\n return node;\n }\n\n prev.children = prev.children.concat(node.children);\n\n return prev;\n}", "function mergeBlockquote(prev, node) {\n if (this.options.commonmark) {\n return node;\n }\n\n prev.children = prev.children.concat(node.children);\n\n return prev;\n}", "addParent(node, parent) {\n // implement by subclass\n }", "function mergeBlockquote(previous, node) {\n if (this.options.commonmark || this.options.gfm) {\n return node\n }\n\n previous.children = previous.children.concat(node.children)\n\n return previous\n}", "mergeToRight(leftNode, rightNode) {\n if (!leftNode.empty()) {\n\n let rightNodeFirstLeftChildOldValue = rightNode.first().leftChild;\n rightNode.first().leftChild = leftNode.getRightmostChild();\n this.addAtLastIndexOfCallStack(\n () => {\n rightNode.first().leftChild = rightNodeFirstLeftChildOldValue;\n }\n );\n\n if (rightNode.hasLeftmostChild()) {\n let rightNodeFirstLeftChildParentOldValue = rightNode.first().leftChild.parent;\n rightNode.first().leftChild.parent = rightNode;\n this.addAtLastIndexOfCallStack(\n () => {\n rightNode.first().leftChild.parent = rightNodeFirstLeftChildParentOldValue;\n }\n );\n }\n while (!leftNode.empty()) {\n let leftNodeElement = leftNode.popLast();\n this.addAtLastIndexOfCallStack(\n this.undoPopLast.bind(this, leftNodeElement, leftNode)\n );\n\n rightNode.addFirst(leftNodeElement);\n this.addAtLastIndexOfCallStack(\n this.undoAddFirst.bind(this, rightNode)\n );\n\n if (rightNode.first().leftChild !== null) {\n let rightNodeFirstLeftChildParentOldValue = rightNode.first().leftChild.parent;\n rightNode.first().leftChild.parent = rightNode;\n this.addAtLastIndexOfCallStack(\n () => {\n rightNode.first().leftChild.parent = rightNodeFirstLeftChildParentOldValue;\n }\n );\n }\n if (rightNode.first().rightChild !== null) {\n let rightNodeFirstRightChildParentOldValue = rightNode.first().rightChild.parent;\n rightNode.first().rightChild.parent = rightNode;\n this.addAtLastIndexOfCallStack(\n () => {\n rightNode.first().rightChild.parent = rightNodeFirstRightChildParentOldValue;\n }\n );\n }\n }\n }\n\n let leftNodeParentOldValue = leftNode.parent;\n leftNode.parent = null;\n this.addAtLastIndexOfCallStack(\n () => {\n leftNode.parent = leftNodeParentOldValue;\n }\n )\n\n let leftNodeOldValue = leftNode;\n leftNode = null;\n this.addAtLastIndexOfCallStack(\n () => {\n leftNode = leftNodeOldValue;\n }\n );\n\n }", "function merge(target, source) {\n target.additionalNodes = target.additionalNodes || [];\n target.additionalNodes.push(source.node);\n if (source.additionalNodes) {\n (_a = target.additionalNodes).push.apply(_a, source.additionalNodes);\n }\n target.children = ts.concatenate(target.children, source.children);\n if (target.children) {\n mergeChildren(target.children);\n sortChildren(target.children);\n }\n var _a;\n }", "function _onNodeAction (node, parent) {\n var par = parent;\n\n node.setParent = function (newParent) {\n par = newParent;\n };\n\n /**\n * Method getParent\n *\n * Method return parent of the node\n *\n * @returns {*}\n */\n node.getParent = function () {\n return par;\n };\n\n /**\n * Method getNext\n *\n * Method returns next node in subnodes array or null if current node is last in array\n *\n * @returns {*}\n */\n node.getNext = function () {\n var index,\n nextNode;\n\n if (parent !== null) {\n index = parent.subnodes.indexOf(node);\n nextNode = parent.subnodes[index+1];\n\n return (typeof nextNode !== 'undefined') ? nextNode : null;\n } else {\n return null;\n }\n };\n\n /**\n * Method getPrev\n *\n * Method returns previous node in subnodes array or null if current node is first in array\n *\n * @returns {*}\n */\n node.getPrev = function () {\n var index,\n prevNode;\n\n if (parent !== null) {\n index = parent.subnodes.indexOf(node);\n prevNode = parent.subnodes[index-1];\n\n return (typeof prevNode !== 'undefined') ? prevNode : null;\n } else {\n return null;\n }\n };\n\n /*\n Add levels indicators to nested subtrees.\n */\n node.level = (parent === null) ? 1 : parent.level + 1;\n\n\n if (angular.isArray(node.subnodes)) {\n for (var i = 0, len = node.subnodes.length; i < len; i++) {\n _onNodeAction(node.subnodes[i], node);\n }\n }\n }", "function _insertBefore(parent, node, refNode) {\n\t\tparent.insertBefore(node, refNode);\n\t}", "function mutation_replaceAll(node, parent) {\n /**\n * 1. If node is not null, adopt node into parent’s node document.\n */\n if (node !== null) {\n DocumentAlgorithm_1.document_adopt(node, parent._nodeDocument);\n }\n /**\n * 2. Let removedNodes be parent’s children.\n */\n const removedNodes = Array.from(parent._children);\n /**\n * 3. Let addedNodes be the empty list.\n * 4. If node is DocumentFragment node, then set addedNodes to node’s\n * children.\n * 5. Otherwise, if node is non-null, set addedNodes to [node].\n */\n let addedNodes = [];\n if (node && node._nodeType === interfaces_1.NodeType.DocumentFragment) {\n addedNodes = Array.from(node._children);\n }\n else if (node !== null) {\n addedNodes.push(node);\n }\n /**\n * 6. Remove all parent’s children, in tree order, with the suppress\n * observers flag set.\n */\n for (const childNode of removedNodes) {\n mutation_remove(childNode, parent, true);\n }\n /**\n * 7. If node is not null, then insert node into parent before null with the\n * suppress observers flag set.\n */\n if (node !== null) {\n mutation_insert(node, parent, null, true);\n }\n /**\n * 8. Queue a tree mutation record for parent with addedNodes, removedNodes,\n * null, and null.\n */\n if (dom_1.dom.features.mutationObservers) {\n MutationObserverAlgorithm_1.observer_queueTreeMutationRecord(parent, addedNodes, removedNodes, null, null);\n }\n}", "add_node(parent, child) {\n if (!this._is_node(parent)) {\n console.error(\"[ERROR] can't add a data that is not a node : 'parent' is not a node\")\n }\n if (!this._is_node(child)) {\n console.error(\"[ERROR] can't add a data that is not a node : 'child' is not a node\")\n }\n\n if (this._id_set.includes(child.id)) {\n console.error(\"[ERROR] id '\" + child.id + \"' already exist in the tree\");\n return;\n }\n\n if (typeof child.parent_node !== 'undefined') {\n console.error(\"[ERROR] can't add a node that has a parent : 'child' already has a parent\");\n return;\n }\n\n child.parent_node = parent;\n parent.child_list.push(child);\n this._id_set.push(child.id);\n }", "process(node) {\n let parent = this.parentPrefix(node)\n\n for (let prefix of this.prefixes) {\n if (!parent || parent === prefix) {\n this.add(node, prefix)\n }\n }\n }", "mergeToLeft(leftNode, rightNode) {\n if (!rightNode.empty()) {\n let leftNodeLastRightChildOldValue = leftNode.last().rightChild;\n leftNode.last().rightChild = rightNode.getLeftmostChild();\n this.addAtLastIndexOfCallStack(\n () => {\n leftNode.last().rightChild = leftNodeLastRightChildOldValue;\n }\n )\n if (leftNode.hasRightmostChild()) {\n let leftNodeLastRightChildParentOldValue = leftNode.last().rightChild.parent;\n leftNode.last().rightChild.parent = leftNode;\n this.addAtLastIndexOfCallStack(\n () => {\n leftNode.last().rightChild.parent = leftNodeLastRightChildParentOldValue;\n }\n );\n }\n while (!rightNode.empty()) {\n let rightNodeElement = rightNode.popFirst();\n this.addAtLastIndexOfCallStack(\n this.undoPopFirst.bind(this, rightNodeElement, rightNode)\n );\n leftNode.addLast(rightNodeElement);\n this.addAtLastIndexOfCallStack(\n this.undoAddLast.bind(this, leftNode)\n )\n if (leftNode.last().leftChild != null) {\n let leftNodeLastLeftChildParentOldValue = leftNode.last().leftChild.parent;\n leftNode.last().leftChild.parent = leftNode;\n this.addAtLastIndexOfCallStack(\n () => {\n leftNode.last().leftChild.parent = leftNodeLastLeftChildParentOldValue;\n }\n )\n }\n if (leftNode.last().rightChild != null) {\n let leftNodeLastRightChildParentOldValue = leftNode.last().rightChild.parent;\n leftNode.last().rightChild.parent = leftNode;\n this.addAtLastIndexOfCallStack(\n () => {\n leftNode.last().rightChild.parent = leftNodeLastRightChildParentOldValue\n }\n );\n }\n }\n }\n\n let rightNodeParentOldValue = rightNode.parent;\n rightNode.parent = null;\n this.addAtLastIndexOfCallStack(\n () => {\n rightNode.parent = rightNodeParentOldValue;\n }\n );\n\n let rightNodeOldValue = rightNode;\n rightNode = null;\n this.addAtLastIndexOfCallStack(\n () => {\n rightNode = rightNodeOldValue;\n }\n );\n }", "liftUp(node, parentIndex, side) {\n let parentElement = node.popAt(Math.floor(this.base / 2));\n this.addAtLastIndexOfCallStack(\n this.undoPopAt.bind(this, parentElement, node, Math.floor(this.base / 2))\n );\n let newNode = this.split(node);\n\n if (!node.hasParent()) {\n node.parent = new BNode();\n let nodeParentIsLeafOldValue = node.parent.isLeaf;\n node.parent.isLeaf = false;\n this.addAtLastIndexOfCallStack(() => {\n node.parent.isLeaf = nodeParentIsLeafOldValue;\n });\n }\n\n if (this.root === node) {\n let rootOldValue = this.root;\n this.root = node.parent;\n this.addAtLastIndexOfCallStack(() => {\n this.root = rootOldValue\n });\n }\n\n let newNodeParentOldValue = newNode.parent;\n newNode.parent = node.parent;\n this.addAtLastIndexOfCallStack(() => {\n newNode.parent = newNodeParentOldValue;\n });\n\n let parentElementLeftChildOldValue = parentElement.leftChild;\n parentElement.leftChild = node;\n this.addAtLastIndexOfCallStack(() => {\n parentElement.leftChild = parentElementLeftChildOldValue\n });\n\n let parentElementRightChildOldValue = parentElement.rightChild;\n parentElement.rightChild = newNode;\n this.addAtLastIndexOfCallStack(() => {\n parentElement.rightChild = parentElementRightChildOldValue;\n });\n\n if (node.parent.empty() || (parentIndex === node.parent.size() - 1 && side === true)) {\n node.parent.addLast(parentElement);\n this.addAtLastIndexOfCallStack(\n this.undoAddLast.bind(this, node.parent)\n );\n } else {\n if (node.parent.hasLeftChildAt(parentIndex)) {\n let nodeParentAtLeftChildOldValue = node.parent.at(parentIndex).leftChild;\n node.parent.at(parentIndex).leftChild = parentElement.rightChild;\n this.addAtLastIndexOfCallStack(() => {\n node.parent.at(parentIndex).leftChild = nodeParentAtLeftChildOldValue;\n });\n }\n\n if (node.parent.hasRightChildAt(parentIndex - 1)) {\n let nodeParentAtRightChildOldValue = node.parent.at(parentIndex - 1).rightChild;\n node.parent.at(parentIndex - 1).rightChild = parentElement.leftChild;\n this.addAtLastIndexOfCallStack(() => {\n node.parent.at(parentIndex - 1).rightChild = nodeParentAtRightChildOldValue;\n });\n }\n\n node.parent.addAt(parentIndex, parentElement);\n this.addAtLastIndexOfCallStack(\n this.undoAddAt.bind(this, node.parent, parentIndex)\n );\n }\n\n let nodeParentIsLeafOldValue = node.parent.isLeaf;\n node.parent.isLeaf = false;\n this.addAtLastIndexOfCallStack(() => {\n node.parent.isLeaf = nodeParentIsLeafOldValue;\n })\n }", "function addChildNode(child, node, sourceFile, appId) {\n var childType = child.type;\n if (child.type === \"Literal\") {\n if (child.value != undefined && typeof child.value === 'string') {\n childType = \"StringLiteral\";\n }\n else if (child.value != undefined && typeof child.value === 'number') {\n childType = \"NumberLiteral\";\n }\n else if (child.value != undefined && typeof child.value == 'boolean') {\n childType = \"BooleanLiteral\";\n }\n }\n\n var hasLoc = (child.loc != undefined), lineNumber, columnNumber;\n if (hasLoc) {\n lineNumber = child.loc.start.line;\n columnNumber = child.loc.start.column;\n }\n\n //Add this in the childNodes array of the current node\n var newCodeTreeNode = new CodeTreeNode(\"ast\", childType, node.codetreeref, sourceFile, appId);\n if (child.type === \"Literal\") newCodeTreeNode.abstractOut();\n if (hasLoc) newCodeTreeNode.addLoc(lineNumber, columnNumber);\n node.codetreeref.addChild(newCodeTreeNode);\n child.codetreeref = newCodeTreeNode;\n\n //Add values if necessary\n if (child.type === \"Literal\" && child.raw != undefined) {\n var newLiteralNode = new CodeTreeNode(\"ast\", \"\" + child.raw, newCodeTreeNode, sourceFile, appId);\n if (hasLoc) newLiteralNode.addLoc(lineNumber, columnNumber);\n newLiteralNode.abstractOut();\n newCodeTreeNode.addChild(newLiteralNode);\n }\n else if (child.type === \"Identifier\" && child.name != undefined) {\n var newNameNode = new CodeTreeNode(\"ast\", child.name, newCodeTreeNode, sourceFile, appId);\n if (hasLoc) newNameNode.addLoc(lineNumber, columnNumber);\n newNameNode.abstractOut();\n newCodeTreeNode.addChild(newNameNode);\n }\n else if (child.type === \"BinaryExpression\" || child.type === \"UpdateExpression\" || child.type === \"UnaryExpression\") {\n if (child.operator != undefined) {\n var newOperatorNode = new CodeTreeNode(\"ast\", child.operator, newCodeTreeNode, \n sourceFile, appId);\n if (hasLoc) newOperatorNode.addLoc(lineNumber, columnNumber);\n newCodeTreeNode.addChild(newOperatorNode);\n }\n if (child.prefix != undefined) {\n var newPrefixNode = new CodeTreeNode(\"ast\", child.prefix + \"\", newCodeTreeNode, \n sourceFile, appId);\n if (hasLoc) newPrefixNode.addLoc(lineNumber, columnNumber);\n newCodeTreeNode.addChild(newPrefixNode);\n }\n }\n }", "function addToTree(parent, current, userquestion, userans) {\n var newnode = {Q: userquestion, Y: userans, N: current};\n // replace the guess in the parent node\n if( current == parent.Y ) {\n parent.Y = newnode;\n } else if (current == parent.N) {\n parent.N = newnode;\n } else {\n throw new Error(\"this shouldn't happen\");\n }\n}", "add(node) {\n if (this.left === null) {\n this.left = node;\n return this.left;\n } else if (this.right === null) {\n this.right = node;\n return this.right;\n }\n return null;\n }", "merge(tree) {\n let arr = tree.toArray();\n for(let i=0; i<arr.length; i++) {\n this.add(arr[i]);\n }\n }", "function setParent(node) {\n if ('children' in node) {\n for (var index in node.children) {\n node.children[index].parent = node;\n setParent(node.children[index]);\n }\n }\n }", "function mutation_preInsert(node, parent, child) {\n /**\n * 1. Ensure pre-insertion validity of node into parent before child.\n * 2. Let reference child be child.\n * 3. If reference child is node, set it to node’s next sibling.\n * 4. Adopt node into parent’s node document.\n * 5. Insert node into parent before reference child.\n * 6. Return node.\n */\n mutation_ensurePreInsertionValidity(node, parent, child);\n let referenceChild = child;\n if (referenceChild === node)\n referenceChild = node._nextSibling;\n DocumentAlgorithm_1.document_adopt(node, parent._nodeDocument);\n mutation_insert(node, parent, referenceChild);\n return node;\n}", "function appendBuiltContent( ancestorBranches, key, node ){\n \n nodeOf( head( ancestorBranches))[key] = node;\n }", "function appendBuiltContent( ancestorBranches, key, node ){\n \n nodeOf( head( ancestorBranches))[key] = node;\n }", "function appendBuiltContent( ancestorBranches, key, node ){\n \n nodeOf( head( ancestorBranches))[key] = node;\n }", "function appendBuiltContent( ancestorBranches, key, node ){\n \n nodeOf( head( ancestorBranches))[key] = node;\n }", "function appendBuiltContent( ancestorBranches, key, node ){\n \n nodeOf( head( ancestorBranches))[key] = node;\n }", "function appendBuiltContent( ancestorBranches, key, node ){\n \n nodeOf( head( ancestorBranches))[key] = node;\n }", "function appendBuiltContent( ancestorBranches, key, node ){\n \n nodeOf( head( ancestorBranches))[key] = node;\n }", "function appendBuiltContent( ancestorBranches, key, node ){\n \n nodeOf( head( ancestorBranches))[key] = node;\n }", "function appendBuiltContent( ancestorBranches, key, node ){\n \n nodeOf( head( ancestorBranches))[key] = node;\n }", "function appendBuiltContent( ancestorBranches, key, node ){\n \n nodeOf( head( ancestorBranches))[key] = node;\n }", "function appendBuiltContent( ancestorBranches, key, node ){\n \n nodeOf( head( ancestorBranches))[key] = node;\n }", "function appendBuiltContent( ancestorBranches, key, node ){\n \n nodeOf( head( ancestorBranches))[key] = node;\n }", "function appendBuiltContent( ancestorBranches, key, node ){\n \n nodeOf( head( ancestorBranches))[key] = node;\n }", "insertNode(node, newNode) {\n // Handle case where value is less than parent, GO LEFT\n if (newNode.data < node.data) {\n // Check if we can place node\n if (node.left === null) {\n // Place node\n node.left = newNode;\n // Otherwise use recursion to do the same process over again\n // until we find a null position to put the node\n } else this.insertNode(node.left, newNode);\n } else {\n // Handle case where value is grater than parent, GO RIGHT\n if (node.right === null) {\n node.right = newNode;\n } else this.insertNode(node.right, newNode);\n }\n }", "function addParentLinks(tree, parent) {\n if (!tree) {\n return;\n }\n tree.parent = parent;\n addParentLinks(tree.left, tree);\n addParentLinks(tree.right, tree);\n}", "function insertRight(parent, node) {\n\tvar index = parent.length - 1;\n\tparent[index] = node;\n\tparent.sizes[index] = (0, _util.length)(node) + (index > 0 ? parent.sizes[index - 1] : 0);\n}", "function visit(node) {\r\n if (visited.has(node)) {\r\n return;\r\n }\r\n visited.add(node);\r\n var children = graph.get(node);\r\n if (children) {\r\n children.forEach(visit);\r\n }\r\n sorted.push(node);\r\n }", "function addNode(token, docId, child) {\n\t\tvar getter = me.store.get(token);\n\t\t\n\t\tgetter.onsuccess = function(evt) {\n\t\t\tvar node = evt.target.result || { prefix: token };\n\t\t\tvar insert = false;\n\t\t\t\n\t\t\tif (child) {\n\t\t\t\t// It’s an internal node!\n\t\t\t\t// Children: Characters that could follow\n\t\t\t\tnode.children = node.children || [];\n\t\t\t\t\n\t\t\t\tif (node.children.indexOf(child) === -1) {\n\t\t\t\t\tnode.children.push(child);\n\t\t\t\t\tinsert = true;\n\t\t\t\t}\n\t\t\t}\n\t\t\telse {\n\t\t\t\t// DocIds: Documents that contain this word *as a whole token*\n\t\t\t\t// Notice that the same document cannot add both docIds and\n\t\t\t\t// children to the same node, by definition of what these are.\n\t\t\t\tnode.docIds = node.docIds || [];\n\t\t\t\t\n\t\t\t\tif (node.docIds.indexOf(docId) === -1) {\n\t\t\t\t\tnode.docIds.push(docId);\n\t\t\t\t\tinsert = true;\n\t\t\t\t}\n\t\t\t}\n\t\n\t\t\tif (insert) {\n\t\t\t\tvar insertion = me.store.put(node);\n\t\t\t\t\n\t\t\t\t// TODO retry or something\n\t\t\t\tinsertion.onerror = me.onerror;\n\t\t\t}\n\t\t};\n\t\t\n\t\tgetter.onerror = me.onerror;\n\t}", "add(data, parentNode) {\n let node = new Node(data);\n parentNode = parentNode ? this.contains(parentNode) : null;\n\n if (parentNode) {\n parentNode.children.push(node);\n }\n else if (!this.root) {\n this.root = node;\n }\n else {\n return 'There is no parent node in the tree';\n }\n }", "function insert(parent, elm, ref) {\n if (isDef(parent)) {\n if (isDef(ref)) {\n if (nodeOps.parentNode(ref) === parent) {\n nodeOps.insertBefore(parent, elm, ref);\n }\n }\n else {\n nodeOps.appendChild(parent, elm);\n }\n }\n }", "function addChild(child, node) {\n\t var children = node.children;\n\t\n\t if (child.parentNode === node) {\n\t return;\n\t }\n\t\n\t children.push(child);\n\t child.parentNode = node;\n\t }", "function addChild(child, node) {\n var children = node.children;\n\n if (child.parentNode === node) {\n return;\n }\n\n children.push(child);\n child.parentNode = node;\n}", "propagateDownFromLeft(node, parentPos, leftSibling) {\n let parentElement = node.parent.popAt(parentPos);\n this.addAtLastIndexOfCallStack(\n this.undoPopAt.bind(this, parentElement, node.parent, parentPos)\n );\n if (node.parent.hasRightChildAt(parentPos - 1)) {\n let nodeParentAtRightChildOldValue = node.parent.at(parentPos - 1).rightChild;\n node.parent.at(parentPos - 1).rightChild = node;\n this.addAtLastIndexOfCallStack(\n () => {\n node.parent.at(parentPos - 1).rightChild = nodeParentAtRightChildOldValue;\n }\n );\n }\n let parentElementLeftChildOldValue = parentElement.leftChild;\n parentElement.leftChild = null;\n this.addAtLastIndexOfCallStack(\n () => {\n parentElement.leftChild = parentElementLeftChildOldValue;\n }\n )\n\n let parentElementRightChildOldValue = parentElement.rightChild;\n parentElement.rightChild = node.hasLeftmostChild() ? node.getLeftmostChild() : this.recentNode;\n this.addAtLastIndexOfCallStack(\n () => {\n parentElement.rightChild = parentElementRightChildOldValue;\n }\n )\n\n node.addFirst(parentElement);\n this.addAtLastIndexOfCallStack(\n this.undoAddFirst.bind(this, node)\n );\n\n let nodeIsLeafOldValue = node.isLeaf;\n node.isLeaf = node.isLeaf && leftSibling.isLeaf;\n this.addAtLastIndexOfCallStack(\n () => {\n node.isLeaf = nodeIsLeafOldValue;\n }\n );\n\n this.mergeToRight(leftSibling, node);\n if (node.parent === this.root && this.root.size() === 0) {\n let rootOldValue = this.root;\n this.root = node;\n this.addAtLastIndexOfCallStack(\n () => {\n this.root = rootOldValue;\n }\n );\n\n let nodeParentOldValue = node.parent;\n node.parent = null;\n this.addAtLastIndexOfCallStack(\n () => {\n node.parent = nodeParentOldValue;\n }\n )\n }\n }", "function processNode(node){\n processChild(node);\n for( i in node.children )\n processNode(node.children[i]);\n }", "function mergeText(previous, node) {\n previous.value += node.value\n\n return previous\n}", "setLeftAndUpdateParent(node) {\n this.left = node;\n if (node) {\n node.parent = this;\n node.parentSide = LEFT;\n }\n }", "mergeNodes(editor) {\n var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};\n Editor.withoutNormalizing(editor, () => {\n var {\n match,\n at = editor.selection\n } = options;\n var {\n hanging = false,\n voids = false,\n mode = 'lowest'\n } = options;\n\n if (!at) {\n return;\n }\n\n if (match == null) {\n if (Path.isPath(at)) {\n var [parent] = Editor.parent(editor, at);\n\n match = n => parent.children.includes(n);\n } else {\n match = n => Editor.isBlock(editor, n);\n }\n }\n\n if (!hanging && Range.isRange(at)) {\n at = Editor.unhangRange(editor, at);\n }\n\n if (Range.isRange(at)) {\n if (Range.isCollapsed(at)) {\n at = at.anchor;\n } else {\n var [, end] = Range.edges(at);\n var pointRef = Editor.pointRef(editor, end);\n Transforms.delete(editor, {\n at\n });\n at = pointRef.unref();\n\n if (options.at == null) {\n Transforms.select(editor, at);\n }\n }\n }\n\n var [current] = Editor.nodes(editor, {\n at,\n match,\n voids,\n mode\n });\n var prev = Editor.previous(editor, {\n at,\n match,\n voids,\n mode\n });\n\n if (!current || !prev) {\n return;\n }\n\n var [node, path] = current;\n var [prevNode, prevPath] = prev;\n\n if (path.length === 0 || prevPath.length === 0) {\n return;\n }\n\n var newPath = Path.next(prevPath);\n var commonPath = Path.common(path, prevPath);\n var isPreviousSibling = Path.isSibling(path, prevPath);\n var levels = Array.from(Editor.levels(editor, {\n at: path\n }), _ref2 => {\n var [n] = _ref2;\n return n;\n }).slice(commonPath.length).slice(0, -1); // Determine if the merge will leave an ancestor of the path empty as a\n // result, in which case we'll want to remove it after merging.\n\n var emptyAncestor = Editor.above(editor, {\n at: path,\n mode: 'highest',\n match: n => levels.includes(n) && hasSingleChildNest(editor, n)\n });\n var emptyRef = emptyAncestor && Editor.pathRef(editor, emptyAncestor[1]);\n var properties;\n var position; // Ensure that the nodes are equivalent, and figure out what the position\n // and extra properties of the merge will be.\n\n if (Text.isText(node) && Text.isText(prevNode)) {\n var rest = _objectWithoutProperties(node, _excluded);\n\n position = prevNode.text.length;\n properties = rest;\n } else if (Element.isElement(node) && Element.isElement(prevNode)) {\n var rest = _objectWithoutProperties(node, _excluded2);\n\n position = prevNode.children.length;\n properties = rest;\n } else {\n throw new Error(\"Cannot merge the node at path [\".concat(path, \"] with the previous sibling because it is not the same kind: \").concat(JSON.stringify(node), \" \").concat(JSON.stringify(prevNode)));\n } // If the node isn't already the next sibling of the previous node, move\n // it so that it is before merging.\n\n\n if (!isPreviousSibling) {\n Transforms.moveNodes(editor, {\n at: path,\n to: newPath,\n voids\n });\n } // If there was going to be an empty ancestor of the node that was merged,\n // we remove it from the tree.\n\n\n if (emptyRef) {\n Transforms.removeNodes(editor, {\n at: emptyRef.current,\n voids\n });\n } // If the target node that we're merging with is empty, remove it instead\n // of merging the two. This is a common rich text editor behavior to\n // prevent losing formatting when deleting entire nodes when you have a\n // hanging selection.\n // if prevNode is first child in parent,don't remove it.\n\n\n if (Element.isElement(prevNode) && Editor.isEmpty(editor, prevNode) || Text.isText(prevNode) && prevNode.text === '' && prevPath[prevPath.length - 1] !== 0) {\n Transforms.removeNodes(editor, {\n at: prevPath,\n voids\n });\n } else {\n editor.apply({\n type: 'merge_node',\n path: newPath,\n position,\n properties\n });\n }\n\n if (emptyRef) {\n emptyRef.unref();\n }\n });\n }", "insertNode(node, new_node) {\n // if the data is less than the node\n // data move left of the tree\n if (new_node.data < node.data) {\n if (node.left === null) {\n node.left = new_node;\n } else {\n //if left id not null\n //recurse until null is found\n this.insertNode(node.left, new_node);\n }\n } else {\n // if right is null insert node here\n if (node.right === null) {\n node.right = new_node;\n } else {\n //if right is not null\n //recurse until null is found\n this.insertNode(node.right, new_node);\n }\n }\n }", "mergeNodes(editor) {\n var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};\n Editor.withoutNormalizing(editor, () => {\n var {\n match,\n at = editor.selection\n } = options;\n var {\n hanging = false,\n voids = false,\n mode = 'lowest'\n } = options;\n\n if (!at) {\n return;\n }\n\n if (match == null) {\n if (Path.isPath(at)) {\n var [parent] = Editor.parent(editor, at);\n\n match = n => parent.children.includes(n);\n } else {\n match = n => Editor.isBlock(editor, n);\n }\n }\n\n if (!hanging && Range.isRange(at)) {\n at = Editor.unhangRange(editor, at);\n }\n\n if (Range.isRange(at)) {\n if (Range.isCollapsed(at)) {\n at = at.anchor;\n } else {\n var [, end] = Range.edges(at);\n var pointRef = Editor.pointRef(editor, end);\n Transforms.delete(editor, {\n at\n });\n at = pointRef.unref();\n\n if (options.at == null) {\n Transforms.select(editor, at);\n }\n }\n }\n\n var [current] = Editor.nodes(editor, {\n at,\n match,\n voids,\n mode\n });\n var prev = Editor.previous(editor, {\n at,\n match,\n voids,\n mode\n });\n\n if (!current || !prev) {\n return;\n }\n\n var [node, path] = current;\n var [prevNode, prevPath] = prev;\n\n if (path.length === 0 || prevPath.length === 0) {\n return;\n }\n\n var newPath = Path.next(prevPath);\n var commonPath = Path.common(path, prevPath);\n var isPreviousSibling = Path.isSibling(path, prevPath);\n var levels = Array.from(Editor.levels(editor, {\n at: path\n }), (_ref2) => {\n var [n] = _ref2;\n return n;\n }).slice(commonPath.length).slice(0, -1); // Determine if the merge will leave an ancestor of the path empty as a\n // result, in which case we'll want to remove it after merging.\n\n var emptyAncestor = Editor.above(editor, {\n at: path,\n mode: 'highest',\n match: n => levels.includes(n) && Element.isElement(n) && n.children.length === 1\n });\n var emptyRef = emptyAncestor && Editor.pathRef(editor, emptyAncestor[1]);\n var properties;\n var position; // Ensure that the nodes are equivalent, and figure out what the position\n // and extra properties of the merge will be.\n\n if (Text.isText(node) && Text.isText(prevNode)) {\n var rest = _objectWithoutProperties(node, [\"text\"]);\n\n position = prevNode.text.length;\n properties = rest;\n } else if (Element.isElement(node) && Element.isElement(prevNode)) {\n var rest = _objectWithoutProperties(node, [\"children\"]);\n\n position = prevNode.children.length;\n properties = rest;\n } else {\n throw new Error(\"Cannot merge the node at path [\".concat(path, \"] with the previous sibling because it is not the same kind: \").concat(JSON.stringify(node), \" \").concat(JSON.stringify(prevNode)));\n } // If the node isn't already the next sibling of the previous node, move\n // it so that it is before merging.\n\n\n if (!isPreviousSibling) {\n Transforms.moveNodes(editor, {\n at: path,\n to: newPath,\n voids\n });\n } // If there was going to be an empty ancestor of the node that was merged,\n // we remove it from the tree.\n\n\n if (emptyRef) {\n Transforms.removeNodes(editor, {\n at: emptyRef.current,\n voids\n });\n } // If the target node that we're merging with is empty, remove it instead\n // of merging the two. This is a common rich text editor behavior to\n // prevent losing formatting when deleting entire nodes when you have a\n // hanging selection.\n\n\n if (Element.isElement(prevNode) && Editor.isEmpty(editor, prevNode) || Text.isText(prevNode) && prevNode.text === '') {\n Transforms.removeNodes(editor, {\n at: prevPath,\n voids\n });\n } else {\n editor.apply({\n type: 'merge_node',\n path: newPath,\n position,\n properties\n });\n }\n\n if (emptyRef) {\n emptyRef.unref();\n }\n });\n }", "function addNode(node, path){\n if ( node.name.indexOf('.') === 0 || path.indexOf('/.') >= 0){ // ignore hidden files\n return;\n }\n var relativePath = path.replace(root,'');\n\n node.path = relativePath + '/' + node.name;\n nodesMap[node.path] = node;\n\n if ( relativePath.length === 0 ){ //is root\n tree.push(node);\n return;\n }\n node.parentPath = node.path.substring(0,node.path.lastIndexOf('/'));\n const parent = nodesMap[node.parentPath];\n parent.children.push(node);\n\n }", "function populate_parent(astroot) {\n\n function visit(node, parent) {\n if (!node || typeof node.type !== \"string\") {\n return;\n }\n\n for ( var prop in node) {\n if (node.hasOwnProperty(prop)) {\n\n // skip cyclic reference\n // at least for try-statement\n if (prop === '__parent__') {\n continue;\n }\n\n var child = node[prop];\n if (Array.isArray(child)) {\n for (var i = 0; i < child.length; i++) {\n visit(child[i], node);\n }\n }\n else {\n visit(child, node);\n }\n }\n }\n\n // must be post\n node.__parent__ = parent;\n }\n visit(astroot, null);\n}", "propagateDownFromRight(node, parentPos, rightSibling) {\n let parentElement = node.parent.popAt(parentPos);\n this.addAtLastIndexOfCallStack(\n this.undoPopAt.bind(this, parentElement, node.parent, parentPos)\n );\n\n if (node.parent.hasLeftChildAt(parentPos)) {\n let nodeParentAtLeftChildOldValue = node.parent.at(parentPos).leftChild;\n node.parent.at(parentPos).leftChild = node;\n this.addAtLastIndexOfCallStack(\n () => {\n node.parent.at(parentPos).leftChild = nodeParentAtLeftChildOldValue;\n }\n )\n }\n\n let parentElementLeftChildOldValue = parentElement.leftChild;\n parentElement.leftChild = node.hasRightmostChild() ? node.getRightmostChild() : this.recentNode;\n this.addAtLastIndexOfCallStack(\n () => {\n parentElement.leftChild = parentElementLeftChildOldValue;\n }\n );\n\n let parentElementRightChildOldValue = parentElement.rightChild;\n parentElement.rightChild = null;\n this.addAtLastIndexOfCallStack(\n () => {\n parentElement.rightChild = parentElementRightChildOldValue;\n }\n );\n\n node.addLast(parentElement);\n this.addAtLastIndexOfCallStack(\n this.undoAddLast.bind(this, node)\n );\n\n let nodeIsLeafOldValue = node.isLeaf;\n node.isLeaf = node.isLeaf && rightSibling.isLeaf;\n this.addAtLastIndexOfCallStack(\n () => {\n node.isLeaf = nodeIsLeafOldValue;\n }\n );\n\n this.mergeToLeft(node, rightSibling);\n\n\n if (node.parent === this.root && this.root.size() === 0) {\n let rootOldValue = this.root;\n this.root = node;\n this.addAtLastIndexOfCallStack(\n () => {\n this.root = rootOldValue;\n }\n )\n\n let nodeParentOldValue = node.parent;\n node.parent = null;\n this.addAtLastIndexOfCallStack(\n () => {\n node.parent = nodeParentOldValue;\n }\n );\n }\n }", "function appendBuiltContent (ancestorBranches, key, node) {\n Object(__WEBPACK_IMPORTED_MODULE_1__ascent__[\"c\" /* nodeOf */])(Object(__WEBPACK_IMPORTED_MODULE_3__lists__[\"g\" /* head */])(ancestorBranches))[key] = node\n }", "function append(node, item, offset) {\n\n\t\titem.offset = ++offset;\n\t\tsiblingIndex.add(item);\n\t\tnode.children.push(item);\n\t\titem.parent = node;\n\t\titem.id = id++;\n\t\ttree.push(item);\n\n\t}", "function _build(_lst, _parent) {\n for (var i = 0; i < _lst.length; i++) {\n var node = _lst[i];\n node._parent = _parent; // public assign of parent; ugly \n if (node.children) {\n _build(node.children, node);\n }\n }\n }", "function recursiveAdd(node) {\n // node.depth = depth;\n if (node.data.name !== 'ROOT') {\n descendants.push(node);\n }\n if (node.children) {\n node.children.forEach(d => recursiveAdd(d));\n }\n }", "setRightAndUpdateParent(node) {\n this.right = node;\n if (node) {\n node.parent = this;\n node.parentSide = RIGHT;\n }\n }", "_replaceWith(node) {\n if (this.parent) {\n if (this == this.parent.left) {\n this.parent.left = node;\n } else if (this == this.parent.right) {\n this.parent.right = node;\n }\n\n if (node) {\n node.parent = this.parent;\n }\n } else {\n if (node) {\n this.key = node.key;\n this.value = node.value;\n this.left = node.left;\n this.right = node.right;\n } else {\n this.key = null;\n this.value = null;\n this.left = null;\n this.right = null;\n }\n }\n }", "function insert(node, parent, tight) {\n var children = parent.children\n var length = children.length\n var last = children[length - 1]\n var isLoose = false\n var index\n var item\n\n if (node.depth === 1) {\n item = listItem()\n\n item.children.push({\n type: PARAGRAPH,\n children: [\n {\n type: LINK,\n title: null,\n url: '#' + node.id,\n children: [{type: TEXT, value: node.value}]\n }\n ]\n })\n\n children.push(item)\n } else if (last && last.type === LIST_ITEM) {\n insert(node, last, tight)\n } else if (last && last.type === LIST) {\n node.depth--\n\n insert(node, last, tight)\n } else if (parent.type === LIST) {\n item = listItem()\n\n insert(node, item, tight)\n\n children.push(item)\n } else {\n item = list()\n node.depth--\n\n insert(node, item, tight)\n\n children.push(item)\n }\n\n // Properly style list-items with new lines.\n parent.spread = !tight\n\n if (parent.type === LIST && parent.spread) {\n parent.spread = false\n index = -1\n\n while (++index < length) {\n if (children[index].children.length > 1) {\n parent.spread = true\n break\n }\n }\n }\n\n // To do: remove `loose` in next major release.\n if (parent.type === LIST_ITEM) {\n parent.loose = tight ? false : children.length > 1\n } else {\n if (tight) {\n isLoose = false\n } else {\n index = -1\n\n while (++index < length) {\n if (children[index].loose) {\n isLoose = true\n\n break\n }\n }\n }\n\n index = -1\n\n while (++index < length) {\n children[index].loose = isLoose\n }\n }\n}", "function add_parent_links(node) {\n\tfor(var c = 0; c < node.children.length; c++) {\n\t\tnode.children[c].parent = node;\n\t\tadd_parent_links(node.children[c]);\n\t}\n}", "function moveNode(node, parent) {\n\tvar n = document.getElementById(node);\n\tvar p = document.getElementById(parent);\n\tif (n != undefined && n !== null && p != undefined && p !== null) {\n\t\tp.appendChild(n.parentNode.removeChild(n));\n\t}\n}", "function mergeText(prev, node) {\n prev.value += node.value;\n\n return prev;\n}", "function mergeText(prev, node) {\n prev.value += node.value;\n\n return prev;\n}", "function mergeText(prev, node) {\n prev.value += node.value;\n\n return prev;\n}", "function mergeText(prev, node) {\n prev.value += node.value;\n\n return prev;\n}", "function mergeText(prev, node) {\n prev.value += node.value;\n\n return prev;\n}", "function mergeText(prev, node) {\n prev.value += node.value;\n\n return prev;\n}", "function mutation_insert_single(node, parent, suppressObservers) {\n /**\n * 1. Let count be the number of children of node if it is a\n * DocumentFragment node, and one otherwise.\n * 2. If child is non-null, then:\n * 2.1. For each live range whose start node is parent and start\n * offset is greater than child's index, increase its start\n * offset by count.\n * 2.2. For each live range whose end node is parent and end\n * offset is greater than child's index, increase its end\n * offset by count.\n * 3. Let nodes be node’s children, if node is a DocumentFragment node;\n * otherwise « node ».\n * 4. If node is a DocumentFragment node, remove its children with the\n * suppress observers flag set.\n * 5. If node is a DocumentFragment node, then queue a tree mutation record\n * for node with « », nodes, null, and null.\n */\n /**\n * 6. Let previousSibling be child’s previous sibling or parent’s last\n * child if child is null.\n */\n const previousSibling = parent._lastChild;\n // set document element node\n if (util_1.Guard.isElementNode(node)) {\n // set document element node\n if (util_1.Guard.isDocumentNode(parent)) {\n parent._documentElement = node;\n }\n // mark that the document has namespaces\n if (!node._nodeDocument._hasNamespaces && (node._namespace !== null ||\n node._namespacePrefix !== null)) {\n node._nodeDocument._hasNamespaces = true;\n }\n }\n /**\n * 7. For each node in nodes, in tree order:\n * 7.1. If child is null, then append node to parent’s children.\n * 7.2. Otherwise, insert node into parent’s children before child’s\n * index.\n */\n node._parent = parent;\n parent._children.add(node);\n // assign siblings and children for quick lookups\n if (parent._firstChild === null) {\n node._previousSibling = null;\n node._nextSibling = null;\n parent._firstChild = node;\n parent._lastChild = node;\n }\n else {\n const prev = parent._lastChild;\n node._previousSibling = prev;\n node._nextSibling = null;\n if (prev)\n prev._nextSibling = node;\n if (!prev)\n parent._firstChild = node;\n parent._lastChild = node;\n }\n /**\n * 7.3. If parent is a shadow host and node is a slotable, then\n * assign a slot for node.\n */\n if (dom_1.dom.features.slots) {\n if (parent._shadowRoot !== null && util_1.Guard.isSlotable(node)) {\n ShadowTreeAlgorithm_1.shadowTree_assignASlot(node);\n }\n }\n /**\n * 7.4. If node is a Text node, run the child text content change\n * steps for parent.\n */\n if (dom_1.dom.features.steps) {\n if (util_1.Guard.isTextNode(node)) {\n DOMAlgorithm_1.dom_runChildTextContentChangeSteps(parent);\n }\n }\n /**\n * 7.5. If parent's root is a shadow root, and parent is a slot\n * whose assigned nodes is the empty list, then run signal\n * a slot change for parent.\n */\n if (dom_1.dom.features.slots) {\n if (util_1.Guard.isShadowRoot(TreeAlgorithm_1.tree_rootNode(parent)) &&\n util_1.Guard.isSlot(parent) && util_2.isEmpty(parent._assignedNodes)) {\n ShadowTreeAlgorithm_1.shadowTree_signalASlotChange(parent);\n }\n }\n /**\n * 7.6. Run assign slotables for a tree with node's root.\n */\n if (dom_1.dom.features.slots) {\n ShadowTreeAlgorithm_1.shadowTree_assignSlotablesForATree(TreeAlgorithm_1.tree_rootNode(node));\n }\n /**\n * 7.7. For each shadow-including inclusive descendant\n * inclusiveDescendant of node, in shadow-including tree\n * order:\n * 7.7.1. Run the insertion steps with inclusiveDescendant.\n */\n if (dom_1.dom.features.steps) {\n DOMAlgorithm_1.dom_runInsertionSteps(node);\n }\n if (dom_1.dom.features.customElements) {\n /**\n * 7.7.2. If inclusiveDescendant is connected, then:\n */\n if (util_1.Guard.isElementNode(node) &&\n ShadowTreeAlgorithm_1.shadowTree_isConnected(node)) {\n if (util_1.Guard.isCustomElementNode(node)) {\n /**\n * 7.7.2.1. If inclusiveDescendant is custom, then enqueue a custom\n * element callback reaction with inclusiveDescendant, callback name\n * \"connectedCallback\", and an empty argument list.\n */\n CustomElementAlgorithm_1.customElement_enqueueACustomElementCallbackReaction(node, \"connectedCallback\", []);\n }\n else {\n /**\n * 7.7.2.2. Otherwise, try to upgrade inclusiveDescendant.\n */\n CustomElementAlgorithm_1.customElement_tryToUpgrade(node);\n }\n }\n }\n /**\n * 8. If suppress observers flag is unset, then queue a tree mutation record\n * for parent with nodes, « », previousSibling, and child.\n */\n if (dom_1.dom.features.mutationObservers) {\n if (!suppressObservers) {\n MutationObserverAlgorithm_1.observer_queueTreeMutationRecord(parent, [node], [], previousSibling, null);\n }\n }\n}", "function doTreesMerge(newLvl, existingLvl, newParentId, existingParentId, tP) { //console.log(\"doTreesMerge called. newLvl = %s, existingLvl = %s, newParent = %s, existingParent = %s\", newLvl, existingLvl, taxaNameMap[newParentId], taxaNameMap[existingParentId])\n if (newLvl > existingLvl) { // more specific taxon\n if (treesMergeAtHigherLevel(tP.taxaObjs[taxaNameMap[newParentId]], existingParentId, tP)) {\n tP.recrd.parent = newParentId; \t\t\t\t\t\t// console.log(\"trees merge\");\n }\n } else { confirmDirectRelationship(tP.taxaObjs[taxaNameMap[newParentId]], newParentId); }\n /**\n * If the taxon has a less specific direct parent in this record than in one previously processed, \n * check to ensure the existing parent is a child of the parent taxon in this record.\n */\n function confirmDirectRelationship(existingTaxonObj, newParentId) { \n if (!isChild(existingTaxonObj)) { // No case yet. TODO: add to Complex Errors\n console.log(\"trees don't merge. newParent =%s, existing =%s, rcrd = %O, existingParent = %O\", taxaNameMap[newParentId], taxaNameMap[existingParentId], tP.recrd, tP.taxaObjs[taxaNameMap[existingParentId]].name); \n }\n\n function isChild(existingParnt) { // console.log(\"existingParnt - %s, existingParntLvl - %s, tP.taxaObjs = %O\", existingParnt.name, existingParnt.level, tP.taxaObjs)\n if ( existingParnt.level === newLvl ) { //console.log(\"levels equal. existingId = %s, newParentId = %s\", existingParnt.tempId, newParentId)\n if ( existingParnt.tempId === newParentId ) { return true; \n } else { return false; }\n }\n if ( existingParnt.parent === newParentId ) { return true;\n } else { return isChild(existingParnt.parent); }\n }\n }\n }", "function insert(node, parent_id, sort)\n {\n var li, parent_li,\n parent_node = parent_id ? indexbyid[parent_id] : null\n search_ = search_active;\n\n // ignore, already exists\n if (indexbyid[node.id]) {\n return;\n }\n\n // apply saved state\n state = get_state(node.id, node.collapsed);\n if (state !== undefined) {\n node.collapsed = state;\n }\n\n // insert as child of an existing node\n if (parent_node) {\n node.level = parent_node.level + 1;\n if (!parent_node.children)\n parent_node.children = [];\n\n search_active = false;\n parent_node.children.push(node);\n parent_li = id2dom(parent_id);\n\n // re-render the entire subtree\n if (parent_node.children.length == 1) {\n render_node(parent_node, null, parent_li);\n li = id2dom(node.id);\n }\n else {\n // append new node to parent's child list\n li = render_node(node, parent_li.children('ul').first());\n }\n\n // list is in search mode\n if (search_) {\n search_active = search_;\n\n // add clone to current search results (top level)\n if (!li.is(':visible')) {\n $('<li>')\n .attr('id', li.attr('id') + '--xsR')\n .attr('class', li.attr('class'))\n .addClass('searchresult__')\n .append(li.children().first().clone(true, true))\n .appendTo(container);\n }\n }\n }\n // insert at top level\n else {\n node.level = 0;\n data.push(node);\n li = render_node(node, container);\n }\n\n indexbyid[node.id] = node;\n\n // set new reference to node.html after insert\n // will otherwise vanish in Firefox 3.6\n if (typeof node.html == 'object') {\n indexbyid[node.id].html = id2dom(node.id, true).children();\n }\n\n if (sort) {\n resort_node(li, typeof sort == 'string' ? '[class~=\"' + sort + '\"]' : '');\n }\n }", "function setChild(parent, node) {\n\n var c, newNode, currentDocument = parent._ownerDocument || parent;\n\n switch (node.type)\n {\n case 'tag':\n case 'script':\n case 'style':\n try {\n newNode = currentDocument.createElement(node.name);\n if (node.location) {\n newNode.sourceLocation = node.location;\n newNode.sourceLocation.file = parent.sourceLocation.file;\n }\n } catch (err) {\n currentDocument.trigger('error', 'invalid markup', {\n exception: err,\n node : node\n });\n\n return null;\n }\n break;\n\n case 'text':\n newNode = currentDocument.createTextNode(HTMLDecode(node.data));\n break;\n\n case 'comment':\n newNode = currentDocument.createComment(node.data);\n break;\n\n default:\n return null;\n break;\n }\n\n if (!newNode)\n return null;\n\n if (node.attribs) {\n for (c in node.attribs) {\n // catchin errors here helps with improperly escaped attributes\n // but properly fixing parent should (can only?) be done in the htmlparser itself\n try {\n newNode.setAttribute(c.toLowerCase(), HTMLDecode(node.attribs[c]));\n } catch(e2) { /* noop */ }\n }\n }\n\n if (node.children) {\n for (c = 0; c < node.children.length; c++) {\n setChild(newNode, node.children[c]);\n }\n }\n\n return parent.appendChild(newNode);\n}", "function inorder(node){\n if(!_.isNull(node.left)) inorder(node.left)\n trav.push({\"key\": node.key, \"value\": node.value, \"children\": [_.get(node, \"left.value\", \"null\"), _.get(node, \"right.value\", \"null\")]})\n if(!_.isNull(node.right)) inorder(node.right)\n}", "function addParent(obj, parent) {\n const isNode = obj && typeof obj.type === 'string';\n const childParent = isNode ? obj : parent;\n\n for (const k in obj) {\n const value = obj[k];\n\n if (Array.isArray(value)) {\n value.forEach(function (v) {\n addParent(v, childParent);\n });\n } else if (value && typeof value === 'object') {\n addParent(value, childParent);\n }\n }\n\n if (isNode) {\n Object.defineProperty(obj, 'parent', {\n configurable: true,\n writable: true,\n enumerable: false,\n value: parent || null\n });\n }\n\n return obj;\n}", "function addParent(obj, parent) {\n var isNode = obj && typeof obj.type === 'string'\n var childParent = isNode ? obj : parent\n\n for (var k in obj) {\n var value = obj[k]\n if (Array.isArray(value)) {\n value.forEach(function(v) {\n addParent(v, childParent)\n })\n } else if (value && typeof value === 'object') {\n addParent(value, childParent)\n }\n }\n\n if (isNode) {\n Object.defineProperty(obj, 'parent', {\n configurable: true,\n writable: true,\n enumerable: false,\n value: parent || null,\n })\n }\n\n return obj\n}", "function addParent(obj, parent) {\n var isNode = obj && typeof obj.type === 'string';\n var childParent = isNode ? obj : parent;\n for (var k in obj) {\n var value = obj[k];\n if (Array.isArray(value)) {\n value.forEach(function (v) { addParent(v, childParent); });\n }\n else if (value && typeof value === 'object') {\n addParent(value, childParent);\n }\n }\n if (isNode) {\n Object.defineProperty(obj, 'parent', {\n configurable: true,\n writable: true,\n enumerable: false,\n value: parent || null\n });\n }\n return obj;\n}", "function addParent(obj, parent) {\n\t var isNode = obj && typeof obj.type === 'string';\n\t var childParent = isNode ? obj : parent;\n\n\t for (var k in obj) {\n\t var value = obj[k];\n\t if (Array.isArray(value)) {\n\t value.forEach(function(v) { addParent(v, childParent); });\n\t } else if (value && typeof value === 'object') {\n\t addParent(value, childParent);\n\t }\n\t }\n\n\t if (isNode) {\n\t Object.defineProperty(obj, 'parent', {\n\t configurable: true,\n\t writable: true,\n\t enumerable: false,\n\t value: parent || null\n\t });\n\t }\n\n\t return obj;\n\t}" ]
[ "0.74623704", "0.5998085", "0.57359624", "0.57040995", "0.56888145", "0.5535257", "0.5535257", "0.5535257", "0.5535257", "0.5535257", "0.55218256", "0.5493243", "0.5486552", "0.54409987", "0.54202956", "0.5411669", "0.5390074", "0.53790534", "0.53790534", "0.53790534", "0.53790534", "0.53790534", "0.53790534", "0.5371325", "0.5319005", "0.5274896", "0.52699554", "0.52597815", "0.5209134", "0.5184268", "0.51841974", "0.5155314", "0.51059544", "0.5099333", "0.507212", "0.50685", "0.50469136", "0.5014044", "0.49929148", "0.49847203", "0.495219", "0.495219", "0.495219", "0.495219", "0.495219", "0.495219", "0.495219", "0.495219", "0.495219", "0.495219", "0.495219", "0.495219", "0.495219", "0.49518812", "0.49414974", "0.49396214", "0.49374208", "0.49367702", "0.49260554", "0.4919646", "0.49158227", "0.49065253", "0.4898696", "0.4898408", "0.48935607", "0.48881334", "0.48849413", "0.4878346", "0.487683", "0.48706537", "0.48678532", "0.4854516", "0.48428777", "0.4832726", "0.48295563", "0.48269823", "0.48189488", "0.48056132", "0.48051724", "0.48051092", "0.47925398", "0.47891352", "0.47891352", "0.47891352", "0.47891352", "0.47891352", "0.47891352", "0.47807458", "0.4780702", "0.47782883", "0.4771163", "0.47606012", "0.4755697", "0.47343466", "0.47313714", "0.47299752" ]
0.7812813
3
Remove `subvalue` from `value`. `subvalue` must be at the start of `value`.
function eat(subvalue) { var indent = getOffset(); var pos = position(); var current = now(); validateEat(subvalue); apply.reset = reset; reset.test = test; apply.test = test; value = value.substring(subvalue.length); updatePosition(subvalue); indent = indent(); return apply; /* Add the given arguments, add `position` to * the returned node, and return the node. */ function apply(node, parent) { return pos(add(pos(node), parent), indent); } /* Functions just like apply, but resets the * content: the line and column are reversed, * and the eaten value is re-added. * This is useful for nodes with a single * type of content, such as lists and tables. * See `apply` above for what parameters are * expected. */ function reset() { var node = apply.apply(null, arguments); line = current.line; column = current.column; value = subvalue + value; return node; } /* Test the position, after eating, and reverse * to a not-eaten state. */ function test() { var result = pos({}); line = current.line; column = current.column; value = subvalue + value; return result.position; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function subInputValue(val, sub)\n{\n var dataArray = '';\n var data = \"\";\n if (val == sub) return 0;\n dataArray = val.toString().split(',');\n var index = $.inArray(sub, dataArray);\n dataArray.splice(index, 1);\n return dataArray.join();\n}", "deleteVal(str) {\n\t\tvar sub = str.substring(0, str.length - 1);\n\t\treturn sub;\n\t}", "function removeSarja(subfield) {\n if (subfield.code !== 'a') {\n return;\n }\n const tmp = subfield.value.replace(/ ?-(?:[a-z]|ä|ö)*sarja$/u, '');\n if (tmp.length > 0) {\n subfield.value = tmp; // eslint-disable-line functional/immutable-data\n return;\n }\n }", "function removeChar(value, char) {\n if (!value.length || !char.length) {\n return '';\n }\n\n if (char.includes(value[0])) {\n return '' + removeChar(value.slice(1), char);\n }\n\n return value[0] + removeChar(value.slice(1), char);\n}", "function removeSubStr(str, substr) {\n\t\tstr = str || \"\";\n\t\tvar k = str.indexOf(substr);\n\t\treturn k + 1 ? str.slice(0, k) + str.slice(k + substr.length) : str;\n\t}", "static removePrefix(value) {\n if (value.includes(InitialPrefix) && value.includes(EndPrefix)) {\n return value\n .toString()\n .replace(InitialPrefix, \"\")\n .replace(EndPrefix, \"\");\n }\n return value;\n }", "removeByValue (value) {\n\t\tthis.remove(this.findFirst(value));\n\t}", "function removeSubStr(string,substring){\n return string.replace(substring,\"\")\n}", "removeByValue(value) {\n return this.delete(this.getIndexOf(value));\n }", "function listRemoveOneElementByValue(list, remove_value){\n list=substr(list, 1, list.length-1);\n var index=find_not_in_str_list_dict(list, remove_value);\n list=replace_from_index_to_index(list, remove_value, \"\", index, index+remove_value.length);\n list=append(\"[\", list);\n list=append(list, \"]\");\n list=replace_not_in_string(list, \",,\", \",\");\n list=replace_not_in_string(list, \"[,\", \"[\");\n list=replace_not_in_string(list, \",]\", \"]\");\n return list;\n}", "function removeTrailingZeroes(value) {\n while (value.charAt(value.length - 1) === '0') {\n value = value.slice(0, -1);\n }\n if (value.charAt(value.length - 1) === '.') {\n value = value.slice(0, -1);\n }\n return value;\n }", "removeValue (value) {\r\n // TODO: Do we need it?\r\n console.warn(`This feature is not implemented yet`)\r\n }", "function deleteOnValue() {\n return displayScreenNumber.value = displayScreenNumber.value.slice(0, displayScreenNumber.value.length - 1);\n}", "remove(value) {\n\t\tif (!this.root) {\n\t\t\treturn 'Tree is empty!';\n\t\t} else {\n\t\t\tthis.removeNode(this.root, value);\n\t\t}\n\t}", "function removeZeros(value) {\n if (value.indexOf('.') !== -1) {\n while (value[value.length - 1] === '0') {\n value = value.substring(0, value.length - 1);\n }\n if (value[value.length - 1] === '.') {\n value = value.substring(0, value.length - 1);\n }\n }\n return value;\n}", "static subtract(array, subArray) {\n return Utils.removeIf(array, function(el) {\n return Utils.hasValue(subArray, el);\n });\n }", "removeValue(value) {\n\t\tlet currentNode = this.head\n\t\tlet index = 0\n\n\t\twhile (value != currentNode.value) {\n\t\t\tcurrentNode = currentNode.next\n\t\t\tindex++\n\t\t}\n\t\treturn this.remove(index)\n\t}", "function remove(as, value) {\n var index = as.indexOf(value);\n if (index != -1) {\n as.splice(index, 1);\n return true;\n }\n else {\n return false;\n }\n }", "function dropBrackets (value) {\n return value.replace(/[(,)]/g, '');\n}", "static removeValue(array, value) {\n for (var tI = array.length - 1; tI >= 0; tI--) {\n if (array[tI] === value) {\n array.splice(tI, 1);\n return tI;\n }\n }\n }", "function removeNumber(){\n var stringInput = document.getElementById(\"input-number\").value; \n var inputLength = stringInput.length\n var remove = stringInput.slice(0,inputLength-1);\n document.getElementById(\"input-number\").value = remove;\n}", "function clean_start_end_value(value){\n\n\t// In case we pass in a number\n\tvalue = value.toString();\n\n\tlet changed = false;\n\tlet new_value;\n\n\tif(value == ''){\n\n\t\t// Check if empty string\n\t\tnew_value = 0;\n\t\tchanged = true;\n\n\t}else if(value.charAt(0) == '0'){\n\n\t\t// Remove leading zeroes\n\t\tnew_value = parseInt(value,10);\n\t\tchanged = true;\n\n\t}else{\n\n\t\t// Check if we exceed the limits for the start or end value\n\t\tnew_value = parseInt(value,10);\n\t\tif(new_value > 180){\n\t\t\tnew_value = 180;\n\t\t\tchanged = true;\t \n\t\t}else if(new_value < 0){\n\t\t\tnew_value = 0;\n\t\t\tchanged = true;\n\t\t}\n\t}\n\n\tif(changed){\n\t\treturn new_value;\n\t}else{\n\t\treturn false;\n\t}\n}", "function removeFromLast(){\n \n const previousValue = document.querySelector(\".inputValueShower\").value\n \n const updateValue = previousValue.substring(0, previousValue.length - 1)\n \n document.querySelector(\".inputValueShower\").value = updateValue \n }", "function eat(subvalue) {\n var indent = getOffset()\n var pos = position()\n var current = now()\n\n validateEat(subvalue)\n\n apply.reset = reset\n reset.test = test\n apply.test = test\n\n value = value.slice(subvalue.length)\n\n updatePosition(subvalue)\n\n indent = indent()\n\n return apply\n\n // Add the given arguments, add `position` to the returned node, and\n // return the node.\n function apply(node, parent) {\n return pos(add(pos(node), parent), indent)\n }\n\n // Functions just like apply, but resets the content: the line and\n // column are reversed, and the eaten value is re-added. This is\n // useful for nodes with a single type of content, such as lists and\n // tables. See `apply` above for what parameters are expected.\n function reset() {\n var node = apply.apply(null, arguments)\n\n line = current.line\n column = current.column\n value = subvalue + value\n\n return node\n }\n\n // Test the position, after eating, and reverse to a not-eaten state.\n function test() {\n var result = pos({})\n\n line = current.line\n column = current.column\n value = subvalue + value\n\n return result.position\n }\n }", "function cut_out_tags(value) {\n return value.replace(/<.+>/g, \"\");\n}", "static removeLeftZeros(value) {\n while (value.startsWith('0')) {\n value = value.substring(1, value.length);\n }\n return value;\n }", "function FFString_trim( value ){\n\treturn FFString_trimRight(FFSting_trimLeft(value));\t\n}", "remove(value) {\n this.root = this.removeVisitor(this.root, value)\n }", "function removeDigit() {\n pinInsert.value = pinInsert.value.slice(0, -1);\n}", "function removeValue(array, value, can_fail) {\n var idx = array.indexOf(value);\n ASSERT(can_fail || idx != -1, 'Unable to Remove Value ' + value);\n if (idx != -1) array.splice(idx, 1);\n return idx != -1;\n}", "function removeExtraCommas(value) {\n\t//if last char of textbox value is comma then remove\n\tif(value.charAt(value.length-1) == ',')\n\t\tvalue = value.substring(0, value.length-1);\n\t//if first char of textbox value is comma then remove\n\tif(value.charAt(0) == ',')\n\t\tvalue = value.replace(\",\", \"\");\n\t//return value\n\treturn value;\n}", "function reviver(key, value){\n \n if (typeof value === \"string\"){\n var str = value.replace(/---/g, \" \");\n return str;\n }\n return value\n }", "remove(value) {\n this.root = this.removeNode(thisroot, value);\n }", "function trim( value ) {\n\t\n\treturn LTrim(RTrim(value));\n\t\n}", "function trim( value ) {\n\t\n\treturn LTrim(RTrim(value));\n\t\n}", "function trim( value ) {\n\t\n\treturn LTrim(RTrim(value));\n\t\n}", "function trimNbspAfterDeleteAndPaddValue() {\n\t\t\t\t\tvar rng, container, offset;\n\n\t\t\t\t\trng = selection.getRng(true);\n\t\t\t\t\tcontainer = rng.startContainer;\n\t\t\t\t\toffset = rng.startOffset;\n\n\t\t\t\t\tif (container.nodeType == 3 && rng.collapsed) {\n\t\t\t\t\t\tif (container.data[offset] === '\\u00a0') {\n\t\t\t\t\t\t\tcontainer.deleteData(offset, 1);\n\n\t\t\t\t\t\t\tif (!/[\\u00a0| ]$/.test(value)) {\n\t\t\t\t\t\t\t\tvalue += ' ';\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t} else if (container.data[offset - 1] === '\\u00a0') {\n\t\t\t\t\t\t\tcontainer.deleteData(offset - 1, 1);\n\n\t\t\t\t\t\t\tif (!/[\\u00a0| ]$/.test(value)) {\n\t\t\t\t\t\t\t\tvalue = ' ' + value;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}", "removekey(value) {\n\n this.root = this.remove(this.root, value)\n\n }", "function trim( value ) {\r\n\t\r\n return LTrim(RTrim(value));\r\n\t\r\n }", "function trim( value )\r\n{\r\n\t\r\n\treturn LTrim(RTrim(value));\r\n\t\r\n}", "function removeAt(arr, value) {\n return arr[value]\n}", "cleanValue() {\n if (!this.node.value.match(/\\d/)) {\n this.node.value = '';\n }\n }", "function del() {\n currentValue = currentValue.slice(0, -1);\n}", "function trimNbspAfterDeleteAndPaddValue() {\n\t\t\tvar rng, container, offset;\n\n\t\t\trng = selection.getRng(true);\n\t\t\tcontainer = rng.startContainer;\n\t\t\toffset = rng.startOffset;\n\n\t\t\tif (container.nodeType == 3 && rng.collapsed) {\n\t\t\t\tif (container.data[offset] === '\\u00a0') {\n\t\t\t\t\tcontainer.deleteData(offset, 1);\n\n\t\t\t\t\tif (!/[\\u00a0| ]$/.test(value)) {\n\t\t\t\t\t\tvalue += ' ';\n\t\t\t\t\t}\n\t\t\t\t} else if (container.data[offset - 1] === '\\u00a0') {\n\t\t\t\t\tcontainer.deleteData(offset - 1, 1);\n\n\t\t\t\t\tif (!/[\\u00a0| ]$/.test(value)) {\n\t\t\t\t\t\tvalue = ' ' + value;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}", "function trimNbspAfterDeleteAndPaddValue() {\n\t\t\tvar rng, container, offset;\n\n\t\t\trng = selection.getRng(true);\n\t\t\tcontainer = rng.startContainer;\n\t\t\toffset = rng.startOffset;\n\n\t\t\tif (container.nodeType == 3 && rng.collapsed) {\n\t\t\t\tif (container.data[offset] === '\\u00a0') {\n\t\t\t\t\tcontainer.deleteData(offset, 1);\n\n\t\t\t\t\tif (!/[\\u00a0| ]$/.test(value)) {\n\t\t\t\t\t\tvalue += ' ';\n\t\t\t\t\t}\n\t\t\t\t} else if (container.data[offset - 1] === '\\u00a0') {\n\t\t\t\t\tcontainer.deleteData(offset - 1, 1);\n\n\t\t\t\t\tif (!/[\\u00a0| ]$/.test(value)) {\n\t\t\t\t\t\tvalue = ' ' + value;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}", "function remove_copy(first, last, output, val) {\r\n return remove_copy_if(first, last, output, function (elem) { return comparators_1.equal_to(elem, val); });\r\n}", "function trim( value ) {\n\t\n\treturn LTrim(RTrim(value));\n}", "function trim( value ) {\r\n\t\r\n\treturn LTrim(RTrim(value));\r\n\t\r\n}", "function removeOne(){\n let x=document.getElementById('input').value;\n console.log(x);\n let length=x.length;\n console.log(length);\n if(length>0)\n {\n document.getElementById('input').value=x.slice(0,length-1);\n if(operand1==null)\n {\n operand1=null;\n }\n else{\n operand2=null;\n }\n }\n else{\n window.alert('cannot remove from empty');\n }\n}", "function trim( value ) {\n\n return LTrim(RTrim(value));\n\n}", "function trim( value )\r\n{\r\n return LTrim(RTrim(value));\r\n}", "function trim( value )\n{\n\n return LTrim(RTrim(value));\n\n}", "remove(value) {\n let currentNode = this.head;\n\n if (currentNode !== null) {\n if (currentNode.data == value) {\n this.head = currentNode.next;\n this.size--;\n } else {\n let previousNode;\n\n while (currentNode && currentNode.data !== value) {\n previousNode = currentNode;\n currentNode = currentNode.next;\n }\n\n if (currentNode && previousNode) {\n previousNode.next = currentNode.next;\n this.size--;\n } else {\n return `Given ${value} value not found !!!`;\n }\n }\n }\n }", "function removeFirst(x, y){\n return x.toString().replace(y, \"\");\n }", "function trim( value ) {\r\n\t\treturn LTrim(RTrim(value));\r\n\t}", "function cleanup(value) {\n return value.trim();\n }", "function removeValueQuery(key, value) {\n\tarray = urlParams.getAll(key).filter((el) => el != value);\n\turlParams.delete(key);\n\tarray.forEach((el) => {\n\t\turlParams.append(key, el.replaceAll(' ', '-'));\n\t});\n}", "function trim( value ) {\r\n\treturn LTrim(RTrim(value));\r\n}", "eliminate_token( t, type, value ) {\n if( Array.isArray(t.value) ) {\n var a = t.value\n for(var i=a.length-1; i>=0; i-- ) {\n if(a[i].type==EmptyRule.TAG || \n a[i].type ==type &&\n (value==null || t.value==value)) a.splice(i,1)\n else a[i] = this.eliminate_token(a[i],type,value)\n } \n }\n return t\n }", "function subtract$1 (input, value) {\n return addSubtract$1(this, input, value, -1);\n }", "function subtract$1 (input, value) {\n return addSubtract$1(this, input, value, -1);\n }", "function subtract$1 (input, value) {\n return addSubtract$1(this, input, value, -1);\n }", "function subtract$1 (input, value) {\n return addSubtract$1(this, input, value, -1);\n }", "function subtract$1 (input, value) {\n return addSubtract$1(this, input, value, -1);\n }", "function subtract$1 (input, value) {\n return addSubtract$1(this, input, value, -1);\n }", "function subtract$1 (input, value) {\n return addSubtract$1(this, input, value, -1);\n }", "function subtract$1 (input, value) {\n return addSubtract$1(this, input, value, -1);\n }", "function subtract$1 (input, value) {\n return addSubtract$1(this, input, value, -1);\n }", "function subtract$1 (input, value) {\n return addSubtract$1(this, input, value, -1);\n }", "function subtract$1 (input, value) {\n return addSubtract$1(this, input, value, -1);\n }", "function subtract$1 (input, value) {\n return addSubtract$1(this, input, value, -1);\n }", "function subtract$1 (input, value) {\n return addSubtract$1(this, input, value, -1);\n }", "function subtract$1 (input, value) {\n return addSubtract$1(this, input, value, -1);\n }", "function subtract$1 (input, value) {\n return addSubtract$1(this, input, value, -1);\n }", "function subtract$1 (input, value) {\n return addSubtract$1(this, input, value, -1);\n }", "function subtract$1 (input, value) {\n return addSubtract$1(this, input, value, -1);\n }", "function subtract$1 (input, value) {\n return addSubtract$1(this, input, value, -1);\n }", "function subtract$1 (input, value) {\n return addSubtract$1(this, input, value, -1);\n }", "function subtract$1 (input, value) {\n return addSubtract$1(this, input, value, -1);\n }", "function subtract$1 (input, value) {\n return addSubtract$1(this, input, value, -1);\n }", "function subtract$1 (input, value) {\n return addSubtract$1(this, input, value, -1);\n }", "function subtract$1 (input, value) {\n return addSubtract$1(this, input, value, -1);\n }", "function subtract$1 (input, value) {\n return addSubtract$1(this, input, value, -1);\n }", "function subtract$1 (input, value) {\n return addSubtract$1(this, input, value, -1);\n }", "function subtract$1 (input, value) {\n return addSubtract$1(this, input, value, -1);\n }", "function subtract$1 (input, value) {\n return addSubtract$1(this, input, value, -1);\n }", "function subtract$1 (input, value) {\n return addSubtract$1(this, input, value, -1);\n }", "function subtract$1 (input, value) {\n return addSubtract$1(this, input, value, -1);\n }", "function subtract$1 (input, value) {\n return addSubtract$1(this, input, value, -1);\n }", "function subtract$1 (input, value) {\n return addSubtract$1(this, input, value, -1);\n }", "function subtract$1 (input, value) {\n return addSubtract$1(this, input, value, -1);\n }", "function subtract$1 (input, value) {\n return addSubtract$1(this, input, value, -1);\n }", "function subtract$1 (input, value) {\n return addSubtract$1(this, input, value, -1);\n }", "function subtract$1 (input, value) {\n return addSubtract$1(this, input, value, -1);\n }", "function subtract$1 (input, value) {\n return addSubtract$1(this, input, value, -1);\n }", "function subtract$1 (input, value) {\n return addSubtract$1(this, input, value, -1);\n }" ]
[ "0.66989744", "0.615324", "0.6097065", "0.6078783", "0.59160215", "0.5887385", "0.5751531", "0.5706532", "0.5595195", "0.5557081", "0.5488317", "0.54675454", "0.5466561", "0.5354575", "0.5338592", "0.53191656", "0.53060836", "0.53027904", "0.5236537", "0.5217721", "0.52087337", "0.5207466", "0.52063435", "0.518902", "0.51641876", "0.51426446", "0.5140779", "0.5134126", "0.5122181", "0.5110599", "0.51101446", "0.51026213", "0.5093175", "0.5091366", "0.5091366", "0.5091366", "0.5087284", "0.50858223", "0.5084209", "0.50797963", "0.50746536", "0.50738543", "0.50632775", "0.5058835", "0.5058835", "0.5057153", "0.50476307", "0.50425947", "0.504131", "0.5032724", "0.503269", "0.503151", "0.5030651", "0.5020485", "0.5015161", "0.5014819", "0.5008207", "0.5007002", "0.5006053", "0.5004041", "0.5003496", "0.5003496", "0.5003496", "0.5003496", "0.5003496", "0.5003496", "0.5003496", "0.5003496", "0.5003496", "0.5003496", "0.5003496", "0.5003496", "0.5003496", "0.5003496", "0.5003496", "0.5003496", "0.5003496", "0.5003496", "0.5003496", "0.5003496", "0.5003496", "0.5003496", "0.5003496", "0.5003496", "0.5003496", "0.5003496", "0.5003496", "0.5003496", "0.5003496", "0.5003496", "0.5003496", "0.5003496", "0.5003496", "0.5003496", "0.5003496", "0.5003496" ]
0.51343733
30
Add the given arguments, add `position` to the returned node, and return the node.
function apply(node, parent) { return pos(add(pos(node), parent), indent); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "assignPosition(node, position) {\n // update the position of the node\n node.position = position;\n \n // the base case\n if (node.children.length === 0)\n {\n leafNodeCounter = leafNodeCounter + 1;\n return node;\n }\n // recursive case\n else\n {\n leafNodeCounter = 0;\n for (var d = 0; d < node.children.length; d++)\n {\n // this is a really bad hack and there is definitely something better out there. \n // However, it gets the job done\n if (node.children[d].name === \"Protosomes\")\n {\n leafNodeCounter = leafNodeCounter + 2;\n }\n\n this.assignPosition(node.children[d], node.position + leafNodeCounter);\n }\n }\n\n }", "addAfter(value, position){\n\t\tif(!this.head) return this.add(value);\n\t\tif(this.length < position) return 'position does not exist';\n\t\tif(this.length === position) return this.add(value);\n\t\tlet newNode = new Node(value);\n\t\tlet aux, count = 1;\n\t\tlet current = this.head;\n\t\twhile(count <= position){\n\t\t\tcurrent = current.next\n\t\t\tcount++\n\t\t}\n\t\taux = current.next;\n\t\tnewNode.next = aux;\n\t\tcurrent.next = newNode;\n\t\tthis.length++;\n\t\treturn this;\n\t}", "insertAtPosition(position, nodeToInsert) {\n if(position > this.length + 1 || !position || !nodeToInsert)\n return\n\n if(position === 1) {\n this.setHead(nodeToInsert)\n return\n }\n\n let curr = this.head, currPost = 1\n while(curr && currPost++ < position)\n curr = curr.next\n\n if(curr) this.insertBefore(curr, nodeToInsert)\n else this.setTail(nodeToInsert)\n\n }", "pushPosition(position) {\n\t\tthis.positionContainer.push(position);\n\t}", "function position() {\n var start = { line: lineno, column: column };\n return function(node){\n node.position = new Position(start);\n whitespace();\n return node;\n };\n }", "function position() {\n var start = { line: lineno, column: column };\n return function(node){\n node.position = new Position(start);\n whitespace();\n return node;\n };\n }", "function position() {\n var start = { line: lineno, column: column };\n return function(node){\n node.position = new Position(start);\n whitespace();\n return node;\n };\n }", "function position() {\n var start = { line: lineno, column: column };\n return function(node){\n node.position = new Position(start);\n whitespace();\n return node;\n };\n }", "function position() {\n var start = { line: lineno, column: column };\n return function(node){\n node.position = new Position(start);\n whitespace();\n return node;\n };\n }", "function position() {\n var start = { line: lineno, column: column };\n return function(node){\n node.position = new Position(start);\n whitespace();\n return node;\n };\n }", "function position() {\n\t var start = { line: lineno, column: column };\n\t return function(node){\n\t node.position = new Position(start);\n\t whitespace();\n\t return node;\n\t };\n\t }", "function position() {\n var start = {line: lineno, column: column}\n return function(node) {\n node.position = new Position(start)\n whitespace()\n return node\n }\n }", "function insertNode(text, position, parentNode, session) {\n var seed = session.seed();\n\n seed.setValue(text);\n parentNode.insert(seed, position);\n\n return seed;\n }", "insertIn(position, value) {\n if (position < 0 || \n position > this.length) {\n\n console.error(\"Position is out of range! \", position)\n return null;\n }\n\n let node = new Node(value);\n\n if (position === 0) {\n\n node.next = this.head;\n this.head = node;\n\n } else {\n let current = this.head,\n prev = null,\n index = 0;\n\n while (index < position) {\n prev = current;\n current = current.next;\n index ++;\n }\n\n prev.next = node;\n node.next = current;\n }\n\n this.length++;\n\n }", "async addNode(){\r\n return this.call('addnode',...(Array.from(arguments)));\r\n }", "function position() {\n var before = now()\n\n return update\n\n // Add the position to a node.\n function update(node, indent) {\n var previous = node.position\n var start = previous ? previous.start : before\n var combined = []\n var n = previous && previous.end.line\n var l = before.line\n\n node.position = new Position(start)\n\n // If there was already a `position`, this node was merged. Fixing\n // `start` wasn’t hard, but the indent is different. Especially\n // because some information, the indent between `n` and `l` wasn’t\n // tracked. Luckily, that space is (should be?) empty, so we can\n // safely check for it now.\n if (previous && indent && previous.indent) {\n combined = previous.indent\n\n if (n < l) {\n while (++n < l) {\n combined.push((offset[n] || 0) + 1)\n }\n\n combined.push(before.column)\n }\n\n indent = combined.concat(indent)\n }\n\n node.position.indent = indent || []\n\n return node\n }\n }", "function position() {\n var before = now();\n\n return update;\n\n /* Add the position to a node. */\n function update(node, indent) {\n var prev = node.position;\n var start = prev ? prev.start : before;\n var combined = [];\n var n = prev && prev.end.line;\n var l = before.line;\n\n node.position = new Position(start);\n\n /* If there was already a `position`, this\n * node was merged. Fixing `start` wasn’t\n * hard, but the indent is different.\n * Especially because some information, the\n * indent between `n` and `l` wasn’t\n * tracked. Luckily, that space is\n * (should be?) empty, so we can safely\n * check for it now. */\n if (prev && indent && prev.indent) {\n combined = prev.indent;\n\n if (n < l) {\n while (++n < l) {\n combined.push((offset[n] || 0) + 1);\n }\n\n combined.push(before.column);\n }\n\n indent = combined.concat(indent);\n }\n\n node.position.indent = indent || [];\n\n return node;\n }\n }", "function position() {\n var before = now();\n\n return update;\n\n /* Add the position to a node. */\n function update(node, indent) {\n var prev = node.position;\n var start = prev ? prev.start : before;\n var combined = [];\n var n = prev && prev.end.line;\n var l = before.line;\n\n node.position = new Position(start);\n\n /* If there was already a `position`, this\n * node was merged. Fixing `start` wasn’t\n * hard, but the indent is different.\n * Especially because some information, the\n * indent between `n` and `l` wasn’t\n * tracked. Luckily, that space is\n * (should be?) empty, so we can safely\n * check for it now. */\n if (prev && indent && prev.indent) {\n combined = prev.indent;\n\n if (n < l) {\n while (++n < l) {\n combined.push((offset[n] || 0) + 1);\n }\n\n combined.push(before.column);\n }\n\n indent = combined.concat(indent);\n }\n\n node.position.indent = indent || [];\n\n return node;\n }\n }", "function position() {\n var before = now();\n\n return update;\n\n /* Add the position to a node. */\n function update(node, indent) {\n var prev = node.position;\n var start = prev ? prev.start : before;\n var combined = [];\n var n = prev && prev.end.line;\n var l = before.line;\n\n node.position = new Position(start);\n\n /* If there was already a `position`, this\n * node was merged. Fixing `start` wasn’t\n * hard, but the indent is different.\n * Especially because some information, the\n * indent between `n` and `l` wasn’t\n * tracked. Luckily, that space is\n * (should be?) empty, so we can safely\n * check for it now. */\n if (prev && indent && prev.indent) {\n combined = prev.indent;\n\n if (n < l) {\n while (++n < l) {\n combined.push((offset[n] || 0) + 1);\n }\n\n combined.push(before.column);\n }\n\n indent = combined.concat(indent);\n }\n\n node.position.indent = indent || [];\n\n return node;\n }\n }", "function position() {\n var before = now();\n\n return update;\n\n /* Add the position to a node. */\n function update(node, indent) {\n var prev = node.position;\n var start = prev ? prev.start : before;\n var combined = [];\n var n = prev && prev.end.line;\n var l = before.line;\n\n node.position = new Position(start);\n\n /* If there was already a `position`, this\n * node was merged. Fixing `start` wasn’t\n * hard, but the indent is different.\n * Especially because some information, the\n * indent between `n` and `l` wasn’t\n * tracked. Luckily, that space is\n * (should be?) empty, so we can safely\n * check for it now. */\n if (prev && indent && prev.indent) {\n combined = prev.indent;\n\n if (n < l) {\n while (++n < l) {\n combined.push((offset[n] || 0) + 1);\n }\n\n combined.push(before.column);\n }\n\n indent = combined.concat(indent);\n }\n\n node.position.indent = indent || [];\n\n return node;\n }\n }", "function position() {\n var before = now();\n\n return update;\n\n /* Add the position to a node. */\n function update(node, indent) {\n var prev = node.position;\n var start = prev ? prev.start : before;\n var combined = [];\n var n = prev && prev.end.line;\n var l = before.line;\n\n node.position = new Position(start);\n\n /* If there was already a `position`, this\n * node was merged. Fixing `start` wasn’t\n * hard, but the indent is different.\n * Especially because some information, the\n * indent between `n` and `l` wasn’t\n * tracked. Luckily, that space is\n * (should be?) empty, so we can safely\n * check for it now. */\n if (prev && indent && prev.indent) {\n combined = prev.indent;\n\n if (n < l) {\n while (++n < l) {\n combined.push((offset[n] || 0) + 1);\n }\n\n combined.push(before.column);\n }\n\n indent = combined.concat(indent);\n }\n\n node.position.indent = indent || [];\n\n return node;\n }\n }", "assignPosition(node, position) {\n\t\tif(node.parentNode && position<node.parentNode.position){\n\t\t\tposition = node.parentNode.position;\n\t\t}\n\t\twhile(this.positionMap.get(`${node.level},${position}`)){\n\t\t\tposition++;\n\t\t}\n\t\tnode.position = position;\n\t\tthis.positionMap.set(`${node.level},${position}`, true);\n\t\tfor(var i in node.children){\n\t\t\tthis.assignPosition(node.children[i], position+Number(i));\n\t\t}\n\t}", "createNode(pos) {\n let newX;\n let newY;\n if (pos !== undefined) {\n newX = pos.x;\n newY = pos.y;\n }\n else {\n newX = this.cursorPosition.x;\n newY = this.cursorPosition.y;\n }\n return new Types_1.Node(\"0\", this.findLowestIDAvailable(), newX, newY, this.frozen, false);\n }", "function add (node, parent) {\n parent.children.push(node)\n if (parser.position) {\n parent.position = {\n start: parent.children[0].position.start,\n end: node.position.end\n }\n }\n }", "function position() {\n const start = {\n line: lineno,\n column\n };\n return function (node) {\n node.position = new Position(start);\n whitespace();\n return node;\n };\n }", "function insertNodeAtPosition(head, data, position){ \n \tif(position == 0){\n \tconst to_insert = new LinkedListNode(data)\n \tto_insert.next = head\n head = to_insert\n return head\n }\n let count = 1\n let current = head\n while(count < position){\n \tcount++\n current = current.next\n\t}\n const to_insert = new LinkedListNode(data)\n to_insert.next = current.next\n current.next = to_insert\n \n current = head\n let result = \"\"\n while(current){\n \tresult += `${current.data} `\n \tcurrent = current.next\n }\n \n return head\n}", "function insert(position, newText) {\n return { range: { start: position, end: position }, newText: newText };\n }", "function insert(position, newText) {\r\n return { range: { start: position, end: position }, newText: newText };\r\n }", "function insert(position, newText) {\r\n return { range: { start: position, end: position }, newText: newText };\r\n }", "function insert(position, newText) {\r\n return { range: { start: position, end: position }, newText: newText };\r\n }", "function insert(position, newText) {\r\n return { range: { start: position, end: position }, newText: newText };\r\n }", "function insert(position, newText) {\r\n return { range: { start: position, end: position }, newText: newText };\r\n }", "function insert(position, newText) {\r\n return { range: { start: position, end: position }, newText: newText };\r\n }", "function insert(position, newText) {\n return {\n range: {\n start: position,\n end: position\n },\n newText: newText\n };\n }", "function insert(position, newText) {\n return {\n range: {\n start: position,\n end: position\n },\n newText: newText\n };\n }", "function insert(position, newText) {\n return {\n range: {\n start: position,\n end: position\n },\n newText: newText\n };\n }", "function adjustNodeInsertPosition(root, nodeToInsert, position) {\n adjustSteps.forEach(function (handler) {\n position = handler(root, nodeToInsert, position);\n });\n return position;\n}", "insertAfter(position, data) {\n /*\n `position === -1` means we are adding the node before the head,\n hence, our `head` should be changed\n */\n if (position === -1) {\n let newNode = new ListNode(data)\n newNode.next = this.head\n this.head = newNode\n return\n }\n\n let currentNode = this.find(position)\n\n if (currentNode) {\n let newNode = new ListNode(data)\n newNode.next = currentNode.next\n currentNode.next = newNode\n } else {\n throw new Error(`Cannot insert at position ${position + 1}: unreachable position!`)\n }\n }", "addPosition(pos) {\n this.positions += '=\"'+pos.line + ':' + pos.linePosition + '\",';\n }", "insert(pos, val) {\n const newNode = new LListNode(val, pos.current().getNext());\n pos.current().setNext(newNode);\n pos.next();\n return pos;\n }", "insert(position, element){\n if (position >= 0 && position < this.length){\n var node = new Node(element);\n var current = this.head;\n var previous;\n var counter = 0;\n // if adding element at the beginning of the list...\n if (position === 0){\n // push back the 1st element...\n node.next = current;\n // point head to inserted node\n this.head = node;\n } else {\n // loop thru til we reach the desired position...\n while (counter++ < position){\n previous = current;\n current = current.next;\n }\n // when finally bust out of the loop, CURRENT is referencing element after the position we would like to insert... (want to add new item b/w prev and current)\n // point previous.next to node && point node.next to current\n // make a link b/w the new item and current\n node.next = current;\n // change link b/w previous and current\n previous.next = node;\n }\n this.length++;\n return true;\n } else {\n return false;\n }\n }", "function position() {\n var start = { line: lineno, column: column };\n return function (node) {\n node.position = new ParsePosition(start);\n whitespace();\n return node;\n };\n }", "addNode(x, y, text, rx = 20, ry = 20) {\n let node = new Node(x, y, rx, ry, text);\n this.root.appendChild(node.root);\n this.nodes.push(node);\n return node;\n }", "function addPosition(x,y,positionArray) {\n var position={x,y};\n positionArray.push(position);\n}", "getNextPositionForward(position) {\n const valueToAdd = position.c === 'N' || position.c === 'E' ? 1 : -1;\n const propToChange = position.c ==='W' || position.c === 'E' ? 'x' : 'y';\n position[propToChange] = position[propToChange] + valueToAdd;\n return position;\n }", "newPosition(position) {\n this.position = position;\n }", "constructor($pos) {\n let node = $pos.nodeAfter;\n let $end = $pos.node(0).resolve($pos.pos + node.nodeSize);\n super($pos, $end);\n this.node = node;\n }", "function insertNode(location, reference) {\n\tvar newNode = document.createElement('div');\n\tnewNode.className = 'node';\n\n\tif (location === 'before') {\n\t\tnodeList.insertBefore(newNode, reference);\n\t} else {\n\t\tnodeList.insertBefore(newNode, reference.nextSibling);\n\t}\n\t\n\tnewNode.innerHTML = nodeFiller;\n}", "findChildAtPosition(position, options) {\n return this.findChild((node) => {\n var _a;\n //if the current node includes this range, keep that node\n if (util_1.default.rangeContains(node.range, position)) {\n return (_a = node.findChildAtPosition(position, options)) !== null && _a !== void 0 ? _a : node;\n }\n }, options);\n }", "function addText(text, position = \"left\", color = \"\") {\n\tlet element = new Text(text, position, color ? color : fontColor);\n\telement.add();\n\treturn element;\n}", "insertAt(element, position){\n var head = this.head;\n var node = new Node(element);\n if(position <=0 || position>this.size+1)\n return;\n else if(position == 1){\n node.next = head;\n this.head = node;\n }\n else if(position == this.size+1){\n var current = this.head;\n while(current.next){\n current = current.next;\n }\n current.next = node;\n }\n else{\n var current = this.head;\n for(var i=1; i<position-1; i++){\n current = current.next;\n }\n var nextNode = current.next;\n node.next = current.next;\n current.next = node;\n\n }\n this.size++;\n\n }", "insertAt(item, position) {\n if(this.head === null) {\n this.head = new _Node(item, this.head)\n }\n let currNode = this.head\n let count = 0\n while(count < position - 1) {\n currNode = currNode.next\n count++\n }\n currNode.next = new _Node(item, currNode.next)\n }", "updatePosition(position) {\n if (position == null)\n return;\n const positionNodes = parseExpressions(position)[0].terms;\n for (let i = 0; i < 3; ++i) {\n this.position.setComponent(i, normalizeUnit(positionNodes[i]).number);\n }\n this.updateMatrixWorld();\n }", "updatePosition(position) {\n if (position == null)\n return;\n const positionNodes = parseExpressions(position)[0].terms;\n for (let i = 0; i < 3; ++i) {\n this.position.setComponent(i, normalizeUnit(positionNodes[i]).number);\n }\n }", "function InsertNode() {}", "function calcPosition (position, velocity) {\n var deltaP = multVector(velocity, animSpeed);\n return addVectors(position, deltaP);\n}", "goToPosition(position) {\n\t\t//if we are already ina position clear the positionContainer\n\t\tif (this.presentPosition()) {\n\t\t\tthis.positionContainer.length = 0;\n\t\t}\n\t\t//if we find an 'entry' in a given position , we call it\n\t\tif (position.entry) {\n\t\t\tposition.entry(play);\n\t\t}\n\t\t//setting the current game position in the positionContainer\n\t\tthis.positionContainer.push(position);\n\t}", "addModifier(modifier, position) {\n if (position !== undefined) {\n modifier.setPosition(position);\n }\n\n modifier.setStave(this);\n this.formatted = false;\n this.modifiers.push(modifier);\n return this;\n }", "function add_node( id, type, place)\n{\n\tvar my = document.createElement(type);\n\tmy.id = id;\n\n\tmy.style.position = \"relative\";\n\n\tplace.appendChild(my);\n\n\treturn my;\n}", "function createNodes(node, positionX, positionY, val = 0){\n let newVal = val + int(node.freq);\n circles.push([positionX, positionY, node.freq, node.symbol]);\n \n if(node.left !== null){\n createNodes(node.left, positionX - 100, positionY + 100, newVal);\n lines.push([positionX, positionY, positionX - 100, positionY + 100]);\n } \n \n if(node.right !== null){\n createNodes(node.right, positionX + 100, positionY + 100, newVal)\n lines.push([positionX, positionY, positionX + 100, positionY + 100]);\n }\n \n}", "appendValue( value, location ) {\n const node = new Node( value )\n\n if ( ! this.head ) {\n this.head = node\n\n return this\n }\n\n if ( location === 0 ) {\n node.next = this.head.next\n this.head.next = node\n\n return this\n }\n\n let count = 0\n let runner = this.head\n\n while ( count < location && runner.next ) {\n runner = runner.next\n count ++\n }\n\n node.next = runner.next\n runner.next = node\n\n return this\n }", "function node_add(_pos, _rx, _ry, _fontsize,_type){\r\n\tvar newnode=null;\r\n\tvar title_pre = \"V\";\r\n\tswitch(_type){\r\n\t\tcase \"ellipse\": title_pre =\"F\";\r\n\t\t\tbreak;\r\n\t\tcase \"rect\": title_pre =\"X\";\r\n\t\t\tbreak;\r\n\t\tcase \"triangle\": title_pre = \"1\";\r\n\t\t\tbreak;\r\n\t\tdefault:;\r\n\t}// end of switch (_type) title_pre\r\n\tswitch (_type){\r\n\t\tcase \"ellipse\": \r\n\t\t\tNodecurrent_IdNUM++;\r\n\t\t\tElli_current_TitleNUM++;\t\t\t\r\n\t\t\tnewnode = { id: \"node\"+String(Nodecurrent_IdNUM), type: _type, x:_pos.x, y:_pos.y, rx: default_RADIUSH,ry:default_RADIUSV, strokedotted:0, color: defaultCOLOR, title: title_pre+ Elli_current_TitleNUM, fontsize:defaultFONTSIZE,strokewidth:default_strokeWIDTH, selected: false};\r\n\t\t\tnodes.push(newnode);\r\n\t\t\tnumElli++;\r\n\t\t\tnumNode++;\t\t\t\t\r\n\t\t\tbreak;\r\n\t\tcase \"rect\":\r\n\t\t\tNodecurrent_IdNUM++;\r\n\t\t\tRec_current_TitleNUM++;\r\n\t\t\tnewnode = { id: \"node\"+String(Nodecurrent_IdNUM), type: _type, x:_pos.x, y:_pos.y, rx: default_RADIUSH,ry:default_RADIUSV, strokedotted:0, color: defaultCOLOR, title: title_pre+ Rec_current_TitleNUM, fontsize:defaultFONTSIZE,strokewidth:default_strokeWIDTH,selected: false};\r\n\t\t\tnodes.push(newnode);\r\n\t\t\tnumRec++;\r\n\t\t\tnumNode++;\t\t\t\t\r\n\t\t\tbreak;\r\n\t\tcase \"triangle\":{\r\n\t\t\tNodecurrent_IdNUM++;\r\n\t\t\tnewnode = { id: \"node\"+String(Nodecurrent_IdNUM), type: _type, x:_pos.x, y:_pos.y, rx: default_RADIUSH,ry:default_RADIUSV, strokedotted:0, color: defaultCOLOR, title: title_pre, fontsize:defaultFONTSIZE,strokewidth:default_strokeWIDTH,selected: false};\r\n\t\t\tnodes.push(newnode);\r\n\t\t\tnumTri++;\r\n\t\t\tnumNode++;\t\t\t\t\r\n\t\t\tbreak;\r\n\t\t}\r\n\t\t\tbreak;\r\n\t\tdefault:;\r\n\t}//end of switch (_type) \r\n\treturn newnode;\r\n}", "insert (options) {\n // set the parent div and create the node:\n options.div= this.div.sub;\n options.control= this.control;\n var node= new MooTreeNode(options);\n // set the new node's parent:\n node.parent= this;\n // mark this node's last node as no longer being the last, then add the new last node:\n var n= this.nodes;\n if (n.length) n[n.length-1].last= false;\n n.push(node);\n // repaint the new node:\n node.update();\n // repaint the new node's parent (this node):\n if (n.length == 1) this.update();\n // recursively repaint the new node's previous sibling node:\n if (n.length > 1) n[n.length-2].update(true);\n return node;\n }", "insertAt(position,item){\n \n if(this.head === null){\n this.insertFirst(item);\n }\n \n let ticker = 0;\n let currNode = this.head;\n let nextNode = this.head;\n \n while ((nextNode !== null) && (ticker !== position)) {\n //save the previous node \n currNode = nextNode;\n nextNode = currNode.next;\n ticker++;\n }\n \n currNode.next = new _Node(item,nextNode);\n \n }", "function prepareUiNode( node, position ) {\n\t\t\n\t\tvar id = node.getId();\n\t\tvar type = node.getInfo().nodeType;\n\t\tvar name = node.getInfo().typeName;\n\t\t\n\t\tvar div = $('<div>', {id : id})\n\t\t\t\t\t.addClass(campaign_designer.settings.nodeClass)\n\t\t\t\t\t.offset(position)\n\t\t\t\t\t.appendTo(campaign_designer.settings.nodePositionRoot)\n\t\t\t\t\t.html(\tname+'<br/><br/>' + \n\t\t\t\t\t\t\t'<a href=\"#\" class=\"cmdLink edit\" rel=\"'+id+'\">edit</a><br/>'+\n\t\t\t\t\t\t\t'<a href=\"#\" class=\"cmdLink remove\" rel=\"'+id+'\">remove</a>');\n\t\tnode.setUiNode( div );\n\t\treturn div;\n\t}", "insert(element, position) {\n // check for out-of-bounds values\n if(index >= 0 && index <= this.count) { \n const node = new Node(element);\n // change the head reference to node and add a new element to the list\n if(index === 0) { \n node.next = current; \n this.head = node;\n // to loop through the list until the desired position\n } else {\n const previous = this.getElementAt(index - 1);\n node.next = previous.next; // to link the new node and the current\n previous.next = node; \n }\n this.count++;\n return true;\n }\n return false;\n }", "function createObject(position, member) {\n\n function newObj(position, member) {\n this.position = position;\n this.member = member;\n }\n\n var newOB = new newObj(position, member);\n\n listOfPosition.push(newOB);\n\n\n}", "function ParticleRotateToPositionNode(mode /*uint*/, position) {\n if (position === void 0) { position = null; }\n _super.call(this, \"ParticleRotateToPosition\", mode, 3, 3);\n this._pStateClass = ParticleRotateToPositionState;\n this._iPosition = position || new Vector3D();\n }", "function addEl() {\r\n var nodes = arguments\r\n for (var i = 1; i < nodes.length; i++) {\r\n nodes[i - 1].appendChild(nodes[i])\r\n }\r\n}", "insert(pos, val){\r\n\r\n if(pos > this.length || pos < 0) return false;\r\n\r\n if(pos === this.length){\r\n this.push(val);\r\n }else if(pos === 0){\r\n this.unshift(val);\r\n }else{\r\n let selectedNode = this.getNode(pos-1);\r\n let oldNext = selectedNode.next;\r\n\r\n let newNode = new Node(val);\r\n selectedNode.next = newNode;\r\n newNode.next = oldNext; \r\n newNode.prev = selectedNode;\r\n selectedNode.prev = newNode;\r\n this.length += 1;\r\n }\r\n\r\n return true;\r\n\r\n }", "static createNode(params) {\n let renderer = params.renderer;\n let paper = params.paper;\n let metadata = params.metadata;\n let position = params.position;\n let props = params.props;\n let graph = params.graph || (params.paper ? params.paper.model : undefined);\n let node;\n if (!position) {\n position = { x: 0, y: 0 };\n }\n if (renderer && isFunction(renderer.createNode)) {\n node = renderer.createNode(metadata, props);\n }\n else {\n node = new joint.shapes.flo.Node();\n if (metadata) {\n node.attr('.label/text', metadata.name);\n }\n }\n node.set('type', joint.shapes.flo.NODE_TYPE);\n if (position) {\n node.set('position', position);\n }\n if (props) {\n Array.from(props.keys()).forEach(key => node.attr(`props/${key}`, props.get(key)));\n }\n node.attr('metadata', metadata);\n if (graph) {\n graph.addCell(node);\n }\n if (renderer && isFunction(renderer.initializeNewNode)) {\n let descriptor = {\n paper: paper,\n graph: graph\n };\n renderer.initializeNewNode(node, descriptor);\n }\n return node;\n }", "add(value, type, name, status, description) {\n if(typeof value !== 'number') {\n return null;\n }\n\n if(!this.root) {\n this.root = new Node(value, type, name, status, description);\n return;\n }\n\n let _insert = (node) => {\n if(value < node.value) {\n if(node.left === null) {\n node.left = new Node(value, type, name, status, description);\n return;\n } else if (node.left !== null) {\n return +_insert(node.left);\n }\n } else if(value >= node.value) {\n if(node.right === null) {\n node.right = new Node(value, type, name, status, description);\n return;\n } else if (node.right !== null) {\n return _insert(node.right);\n }\n }\n }\n _insert(this.root);\n }", "function LayoutNode(plane, position) {\n return {\n plane: plane,\n position: position\n };\n }", "insertAt(element, pos) {\n let nodeToInsert = new Node(element);\n let count = 0;\n let current = this.head;\n let previous;\n if (pos === 0) {\n nodeToInsert.next = this.head;\n this.head = nodeToInsert;\n } else if (pos == this.size) {\n while (count < pos) {\n previous = current;\n current = current.next;\n count++;\n }\n previous.next = nodeToInsert;\n }\n else {\n while (count < pos) {\n previous = current;\n current = current.next;\n count++;\n }\n nodeToInsert.next = previous.next;\n previous.next = nodeToInsert;\n this.size++;\n }\n }", "setPosition(pos) {\n this.position = pos;\n return this;\n }", "givePosition() {\n let v = createVector(this.x, this.y);\n return v;\n }", "newPosition(x, y)\n {\n this.x = x;\n this.y = y;\n }", "function addNode(x,y,radius,nodeColor,nodeName)\r\n{\r\n\r\n\tnodeText[nodeString.length]='<text x=\"'+(x-4.3*nodeName.length)+'\" y=\"'+(y+2*radius)+'\" fill=\"white\">'+nodeName+'</text>';\r\n\tnodeString[nodeString.length]='<circle cx=\"'+x+'\" cy=\"'+y+'\" r=\"'+radius+'\" stroke=\"white\" stroke-width=\"1\" fill=\"'+nodeColor+'\" onmouseover=\"changeNodeInformation('+nodeString.length+')\" onClick=\"nodeClickHandle('+nodeString.length+')\" />';\r\n}", "function getNodeByPosition(positionPath){\n\tvar tree = positionPath.getTree();\n\tvar node = tree.root;\n\tvar pathValues = tree.path;\n\n\tfor(var i = 0; i < pathValues.length; i++){\n\t\tnode = node.childNodes[pathValues[i]];\n\t}\n\n\treturn node;\n}", "function insertOrAppend(container, pos, el) {\n var childs = container.childNodes;\n if (pos < childs.length) {\n var refNode = childs[pos];\n container.insertBefore(el, refNode);\n } else {\n container.appendChild(el);\n }\n }", "function position(val, norm_fn)\n{\n norm_fn = def(norm_fn, normalizePosition);\n\n var value = norm_fn(val);\n require(typeof value !== 'undefined',\n \"Cannot create Position instance from \" + repr(val));\n\n return new Position(value);\n}", "function position(val, norm_fn)\n{\n norm_fn = def(norm_fn, normalizePosition);\n\n var value = norm_fn(val);\n require(typeof value !== 'undefined',\n \"Cannot create Position instance from \" + repr(val));\n\n return new Position(value);\n}", "function addNode(){\n d.push(createNode(nodeCount));\n nodeCount++;\n}", "function insert(position, newText, annotation) {\n return {\n range: {\n start: position,\n end: position\n },\n newText: newText,\n annotationId: annotation\n };\n }", "add(index, value) {\n if (index < 0 || index > this.size()) return; /* TODO: Throw IndexOutOfBoundsException */\n if (index === 0) return this.addFirst(value);\n if (index === this.size()) return this.addLast(value);\n\n const newNode = new Node(value);\n const beforeNode = this._getNode(index - 1);\n const afterNode = beforeNode.next;\n beforeNode.next = newNode;\n newNode.next = afterNode;\n this.length++;\n return this;\n }", "function finishNodeAt(node, type, pos, loc) {\n node.type = type;\n node.end = pos;\n if (this.options.locations)\n { node.loc.end = loc; }\n if (this.options.ranges)\n { node.range[1] = pos; }\n return node\n }", "function finishNodeAt(node, type, pos, loc) {\n node.type = type;\n node.end = pos;\n if (this.options.locations)\n { node.loc.end = loc; }\n if (this.options.ranges)\n { node.range[1] = pos; }\n return node\n }", "function finishNodeAt(node, type, pos, loc) {\n node.type = type;\n node.end = pos;\n if (this.options.locations)\n { node.loc.end = loc; }\n if (this.options.ranges)\n { node.range[1] = pos; }\n return node\n }", "pushNewPos(x, y, stack)\n\t{\n\t\tconsole.log (\"==> \", x, \", \", y);\n let npos = new Position();\n\t\tnpos.setx(x);\n\t\tnpos.sety(y);\n\t\tif (this.maze.validPosition(x,y))\n\t\t\tstack.push(npos);\n\t}", "function createNode(radius, xStartPos, id) {\n var newNode = Object.create(nodeObject);\n newNode.radius = radius;\n newNode.x = xStartPos;\n newNode.y = 0;\n newNode.id = id;\n\n return newNode;\n}", "function addNode(val,node){\n\tconst link = document.createElement(\"a\");\n\tconst para = document.createElement(\"p\");\n\tpara.innerHTML = val;\n\tlink.appendChild(para)\n\tnode.appendChild(link)\n}", "add(x, y){\n return new Vector2(this.x + x, this.y + y);\n }", "function addNodeToCy(nodeText, x, y){\r\n\tif(x == undefined) x = 0;\r\n\tif(y == undefined) y = 0;\r\n\t\r\n\tif(hasSuperSubScript(nodeText)){\r\n\t\treturn insertSuperSubscript(nodeText, x, y);\r\n\t}\t\r\n\r\n\tnode = \t{ // node\" +\r\n\t\t\t\tdata: {name: nodeText/*, label_name: nodeText*/},\r\n\t\t\t\trenderedPosition: { x: x, y: y},\r\n\t\t\t\tclasses:['base']\r\n\t\t\t};\r\n\treturn cy.add(node);\r\n}", "add(v) {\n\t\tfor (var i = 0; i < arguments.length; i++) {\n\t\t\tthis.x += arguments[i].x\n\t\t\tthis.y += arguments[i].y\n\t\t}\n\n\t\treturn this;\n\t}", "positionInfo(position)\n {\n return new WorldPositionInfo(this, position);\n }", "function spawnLocation(xPos, yPos) {\n \n return { x: xPos, y: yPos };\n\n}", "function addPosition() {\n var newposition = $(\"#position\").val();\n var params = {\n \"position\": newposition\n };\n submitAJAX(\"newpos\", params, showPosResult);\n}", "function domMan(elType, text, position, callback){\n\tvar newEl = create(elType);\n\tvar textInfo = text;\n\tnewEl.appendChild(text);\n\tposition.appendChild(newEl);\n\n\tif(callback !== undefined){\n\t\tcallback(newEl);\n\t}\n}", "function node_position(node){\n params = {\n x: node.getX() - node.getOffsetX(),\n y: node.getY() - node.getOffsetY(),\n width: node.getWidth() * node.getScaleX(),\n height: node.getHeight() * node.getScaleY()\n };\n\n return params;\n}", "add(x, y) {\n return new Vector(this.x + x, this.y + y);\n }", "FetchNodeIndex(position)\n {\n return position.x + (position.y * grid.resolution);\n }" ]
[ "0.6184237", "0.5976594", "0.5897871", "0.5891385", "0.5836728", "0.5836728", "0.5836728", "0.5836728", "0.5836728", "0.5836728", "0.5797177", "0.57895225", "0.578314", "0.5762615", "0.573231", "0.5724759", "0.57198524", "0.57198524", "0.57198524", "0.57198524", "0.57198524", "0.57099944", "0.56889683", "0.5685877", "0.56463426", "0.55636245", "0.5562105", "0.5552071", "0.5552071", "0.5552071", "0.5552071", "0.5541066", "0.5541066", "0.5512098", "0.5512098", "0.5512098", "0.5468487", "0.54638124", "0.54232275", "0.542109", "0.54192406", "0.54191345", "0.5402493", "0.5396506", "0.53817844", "0.5370782", "0.53576016", "0.5352683", "0.53459144", "0.52953845", "0.5289711", "0.52719724", "0.52669555", "0.5254973", "0.5246701", "0.51902765", "0.51588166", "0.51147556", "0.5088135", "0.50755984", "0.50638354", "0.5060797", "0.5042587", "0.50388974", "0.5036257", "0.50357896", "0.50217694", "0.5017066", "0.5005017", "0.5000717", "0.49979576", "0.49843317", "0.4979786", "0.49677545", "0.49519694", "0.4951644", "0.49506095", "0.49374598", "0.492315", "0.49021935", "0.48791328", "0.48791328", "0.48727736", "0.4871798", "0.48620468", "0.4860607", "0.4860607", "0.4860607", "0.48593706", "0.48571298", "0.484635", "0.48361868", "0.48342305", "0.4833768", "0.48332158", "0.48250628", "0.4815021", "0.4812519", "0.47991866", "0.47970715", "0.4789527" ]
0.0
-1
Functions just like apply, but resets the content: the line and column are reversed, and the eaten value is readded. This is useful for nodes with a single type of content, such as lists and tables. See `apply` above for what parameters are expected.
function reset() { var node = apply.apply(null, arguments); line = current.line; column = current.column; value = subvalue + value; return node; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function reset() {\n var node = apply.apply(null, arguments)\n\n line = current.line\n column = current.column\n value = subvalue + value\n\n return node\n }", "_reset(line, column) {\n this.tagName = '';\n this.attributes = [];\n this.endTag = false;\n this.endSlash = false;\n this.line = line;\n this.column = column;\n }", "shiftRight() {\n for (let line of this.cells) {\n for (let i = line.length - 1; i > 0; i--) {\n line[i].setType(line[i - 1].type);\n }\n line[0].setType(BeadType.default);\n }\n }", "function position() {\n var start = { line: lineno, column: column };\n return function(node){\n node.position = new Position(start);\n whitespace();\n return node;\n };\n }", "function position() {\n var start = { line: lineno, column: column };\n return function(node){\n node.position = new Position(start);\n whitespace();\n return node;\n };\n }", "function position() {\n var start = { line: lineno, column: column };\n return function(node){\n node.position = new Position(start);\n whitespace();\n return node;\n };\n }", "function position() {\n var start = { line: lineno, column: column };\n return function(node){\n node.position = new Position(start);\n whitespace();\n return node;\n };\n }", "function position() {\n var start = { line: lineno, column: column };\n return function(node){\n node.position = new Position(start);\n whitespace();\n return node;\n };\n }", "function position() {\n var start = { line: lineno, column: column };\n return function(node){\n node.position = new Position(start);\n whitespace();\n return node;\n };\n }", "function position() {\n\t var start = { line: lineno, column: column };\n\t return function(node){\n\t node.position = new Position(start);\n\t whitespace();\n\t return node;\n\t };\n\t }", "reverseIndex() {\n this._restrictCursor();\n const buffer = this._bufferService.buffer;\n if (buffer.y === buffer.scrollTop) {\n // possibly move the code below to term.reverseScroll();\n // test: echo -ne '\\e[1;1H\\e[44m\\eM\\e[0m'\n // blankLine(true) is xterm/linux behavior\n const scrollRegionHeight = buffer.scrollBottom - buffer.scrollTop;\n buffer.lines.shiftElements(buffer.ybase + buffer.y, scrollRegionHeight, 1);\n buffer.lines.set(buffer.ybase + buffer.y, buffer.getBlankLine(this._eraseAttrData()));\n this._dirtyRowService.markRangeDirty(buffer.scrollTop, buffer.scrollBottom);\n }\n else {\n buffer.y--;\n this._restrictCursor(); // quickfix to not run out of bounds\n }\n return true;\n }", "restoreValueAt(columnIndex, rowIndex) {\n if (!this.hasCellAt(columnIndex, rowIndex))\n return;\n var cell = this.getCellElementAt(columnIndex, rowIndex);\n if (!latte._undef(cell.data('original-value'))) {\n this.setValueAt(columnIndex, rowIndex, cell.data('original-value'));\n cell.removeData('original-value');\n }\n }", "function position() {\n var start = {line: lineno, column: column}\n return function(node) {\n node.position = new Position(start)\n whitespace()\n return node\n }\n }", "function position() {\n const start = {\n line: lineno,\n column\n };\n return function (node) {\n node.position = new Position(start);\n whitespace();\n return node;\n };\n }", "function eat(subvalue) {\n var indent = getOffset()\n var pos = position()\n var current = now()\n\n validateEat(subvalue)\n\n apply.reset = reset\n reset.test = test\n apply.test = test\n\n value = value.slice(subvalue.length)\n\n updatePosition(subvalue)\n\n indent = indent()\n\n return apply\n\n // Add the given arguments, add `position` to the returned node, and\n // return the node.\n function apply(node, parent) {\n return pos(add(pos(node), parent), indent)\n }\n\n // Functions just like apply, but resets the content: the line and\n // column are reversed, and the eaten value is re-added. This is\n // useful for nodes with a single type of content, such as lists and\n // tables. See `apply` above for what parameters are expected.\n function reset() {\n var node = apply.apply(null, arguments)\n\n line = current.line\n column = current.column\n value = subvalue + value\n\n return node\n }\n\n // Test the position, after eating, and reverse to a not-eaten state.\n function test() {\n var result = pos({})\n\n line = current.line\n column = current.column\n value = subvalue + value\n\n return result.position\n }\n }", "function reverseLine(line){\n \n var tempX = line.x1;\n var tempY = line.y1;\n line.x1 = line.x2;\n line.y1 = line.y2;\n line.x2 = tempX;\n line.y2 = tempY;\n \n return line;\n}", "function decrementColumn() {\n GameData.column = correctColumn(GameData.column--);\n}", "function position() {\n var start = { line: lineno, column: column };\n return function (node) {\n node.position = new ParsePosition(start);\n whitespace();\n return node;\n };\n }", "_reverseCols() {\n this.forEach(arr => {\n arr.reverse();\n });\n }", "restore() {\n if(this.saved.caret)\n this.set(this.saved.startNodeIndex, this.saved.startOffset);\n else\n this.set(this.saved.startNodeIndex, this.saved.startOffset,\n this.saved.endNodeIndex, this.saved.endOffset);\n }", "propagateFromRightSibling(node, parentPos, rightSibling) {\n let nodeElement = node.parent.popAt(parentPos);\n this.addAtLastIndexOfCallStack(\n this.undoPopAt.bind(this, nodeElement, node.parent, parentPos)\n );\n\n let nodeElementLeftChildOldValue = nodeElement.leftChild;\n nodeElement.leftChild = node.hasRightmostChild() ? node.getRightmostChild() : this.recentNode;\n this.addAtLastIndexOfCallStack(\n () => {\n nodeElement.leftChild = nodeElementLeftChildOldValue;\n }\n );\n\n let nodeElementRightChildOldValue = nodeElement.rightChild;\n nodeElement.rightChild = rightSibling.getLeftmostChild();\n this.addAtLastIndexOfCallStack(\n () => {\n nodeElement.rightChild = nodeElementRightChildOldValue;\n }\n );\n\n if (nodeElement.hasLeftChild()) {\n let nodeElementLeftChildParentOldValue = nodeElement.leftChild.parent;\n nodeElement.leftChild.parent = node;\n this.addAtLastIndexOfCallStack(\n () => {\n nodeElement.leftChild.parent = nodeElementLeftChildParentOldValue;\n }\n );\n }\n\n if (nodeElement.hasRightChild()) {\n let nodeElementRightChildParent = nodeElement.rightChild.parent;\n nodeElement.rightChild.parent = node;\n this.addAtLastIndexOfCallStack(\n () => {\n nodeElement.rightChild.parent = nodeElementRightChildParent;\n }\n );\n }\n\n node.addLast(nodeElement);\n this.addAtLastIndexOfCallStack(\n this.undoAddLast.bind(this, node)\n );\n\n let parentElement = rightSibling.popFirst();\n this.addAtLastIndexOfCallStack(\n this.undoPopFirst.bind(this, parentElement, rightSibling)\n );\n\n let parentElementLeftChildOldValue = parentElement.leftChild;\n parentElement.leftChild = node;\n this.addAtLastIndexOfCallStack(\n () => {\n parentElement.leftChild = parentElementLeftChildOldValue;\n }\n );\n\n let parentElementRightChildOldValue = parentElement.rightChild;\n parentElement.rightChild = rightSibling;\n this.addAtLastIndexOfCallStack(\n () => {\n parentElement.rightChild = parentElementRightChildOldValue;\n }\n );\n\n node.parent.addAt(parentPos, parentElement);\n this.addAtLastIndexOfCallStack(\n this.undoAddAt.bind(this, node.parent, parentPos)\n );\n }", "propagateFromLeftSibling(node, parentPos, leftSibling) {\n let nodeElement = node.parent.popAt(parentPos);\n this.addAtLastIndexOfCallStack(\n this.undoPopAt.bind(this, nodeElement, node.parent, parentPos)\n );\n\n let oldLeftChildValue = nodeElement.leftChild;\n nodeElement.leftChild = leftSibling.getRightmostChild();\n this.addAtLastIndexOfCallStack(\n () => {\n nodeElement.leftChild = oldLeftChildValue;\n }\n );\n\n let oldRightChildValue = nodeElement.rightChild;\n nodeElement.rightChild = node.hasLeftmostChild() ? node.getLeftmostChild() : this.recentNode;\n this.addAtLastIndexOfCallStack(\n () => {\n nodeElement.rightChild = oldRightChildValue;\n }\n );\n\n if (nodeElement.hasLeftChild()) {\n let oldLeftChildParentValue = nodeElement.leftChild.parent;\n nodeElement.leftChild.parent = node;\n this.addAtLastIndexOfCallStack(\n () => {\n nodeElement.leftChild.parent = oldLeftChildParentValue\n }\n );\n }\n\n if (nodeElement.hasRightChild()) {\n let oldRightChildParentValue = nodeElement.rightChild.parent;\n nodeElement.rightChild.parent = node;\n this.addAtLastIndexOfCallStack(\n () => {\n nodeElement.rightChild.parent = oldRightChildParentValue\n }\n );\n }\n\n node.addFirst(nodeElement);\n this.addAtLastIndexOfCallStack(\n this.undoAddFirst.bind(this, node)\n );\n\n let parentElement = leftSibling.popLast();\n this.addAtLastIndexOfCallStack(\n this.undoPopLast.bind(this, parentElement, leftSibling)\n );\n\n let parentElementLeftChildOldValue = parentElement.leftChild;\n parentElement.leftChild = leftSibling;\n this.addAtLastIndexOfCallStack(\n () => {\n parentElement.leftChild = parentElementLeftChildOldValue;\n }\n );\n\n let parentElementRightChildOldValue = parentElement.rightChild;\n parentElement.rightChild = node;\n this.addAtLastIndexOfCallStack(\n () => {\n parentElement.rightChild = parentElementRightChildOldValue\n }\n );\n\n node.parent.addAt(parentPos, parentElement);\n this.addAtLastIndexOfCallStack(\n this.undoAddAt.bind(this, node.parent, parentPos)\n );\n }", "function eat(subvalue) {\n var indent = getOffset();\n var pos = position();\n var current = now();\n\n validateEat(subvalue);\n\n apply.reset = reset;\n reset.test = test;\n apply.test = test;\n\n value = value.substring(subvalue.length);\n\n updatePosition(subvalue);\n\n indent = indent();\n\n return apply;\n\n /* Add the given arguments, add `position` to\n * the returned node, and return the node. */\n function apply(node, parent) {\n return pos(add(pos(node), parent), indent);\n }\n\n /* Functions just like apply, but resets the\n * content: the line and column are reversed,\n * and the eaten value is re-added.\n * This is useful for nodes with a single\n * type of content, such as lists and tables.\n * See `apply` above for what parameters are\n * expected. */\n function reset() {\n var node = apply.apply(null, arguments);\n\n line = current.line;\n column = current.column;\n value = subvalue + value;\n\n return node;\n }\n\n /* Test the position, after eating, and reverse\n * to a not-eaten state. */\n function test() {\n var result = pos({});\n\n line = current.line;\n column = current.column;\n value = subvalue + value;\n\n return result.position;\n }\n }", "function eat(subvalue) {\n var indent = getOffset();\n var pos = position();\n var current = now();\n\n validateEat(subvalue);\n\n apply.reset = reset;\n reset.test = test;\n apply.test = test;\n\n value = value.substring(subvalue.length);\n\n updatePosition(subvalue);\n\n indent = indent();\n\n return apply;\n\n /* Add the given arguments, add `position` to\n * the returned node, and return the node. */\n function apply(node, parent) {\n return pos(add(pos(node), parent), indent);\n }\n\n /* Functions just like apply, but resets the\n * content: the line and column are reversed,\n * and the eaten value is re-added.\n * This is useful for nodes with a single\n * type of content, such as lists and tables.\n * See `apply` above for what parameters are\n * expected. */\n function reset() {\n var node = apply.apply(null, arguments);\n\n line = current.line;\n column = current.column;\n value = subvalue + value;\n\n return node;\n }\n\n /* Test the position, after eating, and reverse\n * to a not-eaten state. */\n function test() {\n var result = pos({});\n\n line = current.line;\n column = current.column;\n value = subvalue + value;\n\n return result.position;\n }\n }", "function eat(subvalue) {\n var indent = getOffset();\n var pos = position();\n var current = now();\n\n validateEat(subvalue);\n\n apply.reset = reset;\n reset.test = test;\n apply.test = test;\n\n value = value.substring(subvalue.length);\n\n updatePosition(subvalue);\n\n indent = indent();\n\n return apply;\n\n /* Add the given arguments, add `position` to\n * the returned node, and return the node. */\n function apply(node, parent) {\n return pos(add(pos(node), parent), indent);\n }\n\n /* Functions just like apply, but resets the\n * content: the line and column are reversed,\n * and the eaten value is re-added.\n * This is useful for nodes with a single\n * type of content, such as lists and tables.\n * See `apply` above for what parameters are\n * expected. */\n function reset() {\n var node = apply.apply(null, arguments);\n\n line = current.line;\n column = current.column;\n value = subvalue + value;\n\n return node;\n }\n\n /* Test the position, after eating, and reverse\n * to a not-eaten state. */\n function test() {\n var result = pos({});\n\n line = current.line;\n column = current.column;\n value = subvalue + value;\n\n return result.position;\n }\n }", "function eat(subvalue) {\n var indent = getOffset();\n var pos = position();\n var current = now();\n\n validateEat(subvalue);\n\n apply.reset = reset;\n reset.test = test;\n apply.test = test;\n\n value = value.substring(subvalue.length);\n\n updatePosition(subvalue);\n\n indent = indent();\n\n return apply;\n\n /* Add the given arguments, add `position` to\n * the returned node, and return the node. */\n function apply(node, parent) {\n return pos(add(pos(node), parent), indent);\n }\n\n /* Functions just like apply, but resets the\n * content: the line and column are reversed,\n * and the eaten value is re-added.\n * This is useful for nodes with a single\n * type of content, such as lists and tables.\n * See `apply` above for what parameters are\n * expected. */\n function reset() {\n var node = apply.apply(null, arguments);\n\n line = current.line;\n column = current.column;\n value = subvalue + value;\n\n return node;\n }\n\n /* Test the position, after eating, and reverse\n * to a not-eaten state. */\n function test() {\n var result = pos({});\n\n line = current.line;\n column = current.column;\n value = subvalue + value;\n\n return result.position;\n }\n }", "function eat(subvalue) {\n var indent = getOffset();\n var pos = position();\n var current = now();\n\n validateEat(subvalue);\n\n apply.reset = reset;\n reset.test = test;\n apply.test = test;\n\n value = value.substring(subvalue.length);\n\n updatePosition(subvalue);\n\n indent = indent();\n\n return apply;\n\n /* Add the given arguments, add `position` to\n * the returned node, and return the node. */\n function apply(node, parent) {\n return pos(add(pos(node), parent), indent);\n }\n\n /* Functions just like apply, but resets the\n * content: the line and column are reversed,\n * and the eaten value is re-added.\n * This is useful for nodes with a single\n * type of content, such as lists and tables.\n * See `apply` above for what parameters are\n * expected. */\n function reset() {\n var node = apply.apply(null, arguments);\n\n line = current.line;\n column = current.column;\n value = subvalue + value;\n\n return node;\n }\n\n /* Test the position, after eating, and reverse\n * to a not-eaten state. */\n function test() {\n var result = pos({});\n\n line = current.line;\n column = current.column;\n value = subvalue + value;\n\n return result.position;\n }\n }", "function flip(board, row, col) {\n const index = rowColToIndex(board, row, col);\n let boardCopy = [...board];\n if (boardCopy[index] === \"X\") {\n boardCopy = setBoardCell(boardCopy, \"O\", row, col);\n return boardCopy;\n }\n else if (boardCopy[index] === \"O\") {\n boardCopy = setBoardCell(boardCopy, \"X\", row, col);\n return boardCopy;\n }\n else {\n return boardCopy;\n }\n}", "function revert(h, node) {\n var subtype = node.referenceType\n var suffix = ']'\n var contents\n var head\n var tail\n\n if (subtype === 'collapsed') {\n suffix += '[]'\n } else if (subtype === 'full') {\n suffix += '[' + (node.label || node.identifier) + ']'\n }\n\n if (node.type === 'imageReference') {\n return u('text', '![' + node.alt + suffix)\n }\n\n contents = all(h, node)\n head = contents[0]\n\n if (head && head.type === 'text') {\n head.value = '[' + head.value\n } else {\n contents.unshift(u('text', '['))\n }\n\n tail = contents[contents.length - 1]\n\n if (tail && tail.type === 'text') {\n tail.value += suffix\n } else {\n contents.push(u('text', suffix))\n }\n\n return contents\n}", "function testTree_TableAccess_CrossColumnIndex_Reverse() {\n var treeBefore =\n 'project()\\n' +\n '-order_by(DummyTable.string DESC, DummyTable.number DESC)\\n' +\n '--select(value_pred(DummyTable.boolean eq false))\\n' +\n '---table_access(DummyTable)\\n';\n\n var treeAfter =\n 'project()\\n' +\n '-select(value_pred(DummyTable.boolean eq false))\\n' +\n '--table_access_by_row_id(DummyTable)\\n' +\n '---index_range_scan(DummyTable.pkDummyTable, ' +\n '[unbound, unbound],[unbound, unbound], reverse)\\n';\n\n var rootNodeBefore = constructTree2(lf.Order.DESC, lf.Order.DESC);\n assertEquals(treeBefore, lf.tree.toString(rootNodeBefore));\n\n var pass = new lf.proc.OrderByIndexPass(hr.db.getGlobal());\n var rootNodeAfter = pass.rewrite(rootNodeBefore);\n assertEquals(treeAfter, lf.tree.toString(rootNodeAfter));\n}", "function undo(){\n _.last(lines).remove();\n lines.pop();\n}", "setNodeColumn() {\n const node = this;\n if (!defined(node.options.column)) {\n // No links to this node, place it left\n if (node.linksTo.length === 0) {\n node.column = 0;\n }\n else {\n node.column = node.getFromNode().fromColumn + 1;\n }\n }\n }", "function mirrorVertical(originalFunction){\n return function(parameter){\n var point = originalFunction(parameter);\n point[1] = -point[1];\n return point;\n }\n}", "restoreOriginalState() {\n\n\t\tconst originalValueOffset = this.valueSize * 3;\n\t\tthis.binding.setValue( this.buffer, originalValueOffset );\n\n\t}", "function defaultTransform_(data, row, column, options) {\r\n if (!data[row][column]) {\r\n if (row < 2 || hasOption_(options, \"noInherit\")) {\r\n data[row][column] = \"\";\r\n } else {\r\n data[row][column] = data[row-1][column];\r\n }\r\n }\r\n\r\n if (!hasOption_(options, \"rawHeaders\") && row == 0) {\r\n if (column == 0 && data[row].length > 1) {\r\n removeCommonPrefixes_(data, row);\r\n }\r\n\r\n data[row][column] = toTitleCase_(data[row][column].toString().replace(/[\\/\\_]/g, \" \"));\r\n }\r\n\r\n if (!hasOption_(options, \"noTruncate\") && data[row][column]) {\r\n data[row][column] = data[row][column].toString().substr(0, 256);\r\n }\r\n\r\n if (hasOption_(options, \"debugLocation\")) {\r\n data[row][column] = \"[\" + row + \",\" + column + \"]\" + data[row][column];\r\n }\r\n}", "@action eventBinder() {\n var that = this;\n\n that.startPos = 0;\n that.endPos = 0;\n that.selection = '';\n that.lastchar = '\\n';\n that.previousValue = that.value;\n\n that.clearUndo();\n }", "function changeLine(doc, handle, changeType, op) {\n var no = handle,\n line = handle;\n\n if (typeof handle == \"number\") {\n line = getLine(doc, clipLine(doc, handle));\n } else {\n no = lineNo(handle);\n }\n\n if (no == null) {\n return null;\n }\n\n if (op(line, no) && doc.cm) {\n regLineChange(doc.cm, no, changeType);\n }\n\n return line;\n } // The document is represented as a BTree consisting of leaves, with", "invert() {\r\n this.data = this.data.map(rows => rows.map(cols => cols*-1));\r\n }", "function getCursor($node, offset) {\n\t\t\t\t$nodeTd = $node.parent();\n \t\t\tvar oldLine, newLine;\n\t\t\t\tif (!$nodeTd.hasClass(\"old\") && !$nodeTd.hasClass(\"new\") \n\t\t\t\t\t\t|| $nodeTd.hasClass(\"old\") && $nodeTd.hasClass(\"new\")) {\n\t\t\t\t\toldLine = $nodeTd.data(\"old\") + 1;\n\t\t\t\t\tnewLine = $nodeTd.data(\"new\") + 1;\n\t\t\t\t} else if ($nodeTd.hasClass(\"old\")) {\n\t\t\t\t\toldLine = $nodeTd.data(\"old\") + 1;\n\t\t\t\t} else {\n\t\t\t\t\tnewLine = $nodeTd.data(\"new\") + 1;\n\t\t\t\t}\n\t\t\t\tvar $contents = $nodeTd.contents();\n\t\t\t\tvar oldOffset = 0, newOffset = 0;\n \t\t\tfor (var i=0; i<$contents.length; i++) {\n \t\t\t\tvar $content = $($contents[i]);\n \t\t\t\tif ($content.is($node)) {\n \t\t\t\t\tif ($content.hasClass(\"delete\")) { \n \t\t\t\t\t\toldCh = oldOffset + offset;\n \t\t\t\t\t\tnewCh = undefined;\n \t\t\t\t\t\tnewLine = undefined;\n \t\t\t\t\t} else if ($content.hasClass(\"insert\")) {\n \t\t\t\t\t\toldCh = undefined;\n \t\t\t\t\t\toldLine = undefined;\n \t\t\t\t\t\tnewCh = newOffset + offset;\n \t\t\t\t\t} else {\n \t\t\t\t\t\toldCh = oldOffset + offset;\n \t\t\t\t\t\tnewCh = newOffset + offset;\n \t\t\t\t\t}\n \t\t\t\t\tbreak;\n \t\t\t\t} else {\n \t\t\t\t\tvar len = $content.text().length;\n \t\t\t\t\tif ($content.hasClass(\"delete\")) {\n \t\t\t\t\t\toldOffset += len;\n \t\t\t\t\t} else if ($content.hasClass(\"insert\")) {\n \t\t\t\t\t\tnewOffset += len;\n \t\t\t\t\t} else {\n\t \t\t\t\t\toldOffset += len;\n\t \t\t\t\t\tnewOffset += len;\n \t\t\t\t\t}\n \t\t\t\t}\n \t\t\t}\n \t\t\tif ($nodeTd.hasClass(\"left\")) {\n \t\t\t\tnewLine = newCh = undefined;\n \t\t\t} else if ($nodeTd.hasClass(\"right\")) {\n \t\t\t\toldLine = oldCh = undefined;\n \t\t\t}\n\t\t\t\treturn {\n\t\t\t\t\toldLine: oldLine,\n\t\t\t\t\toldCh: oldCh,\n\t\t\t\t\tnewLine: newLine,\n\t\t\t\t\tnewCh: newCh\n\t\t\t\t};\n \t\t}", "function modifyClearCells(arg, row, column) {\r\n\tvar i = arg.emptyCells.indexOf(String(row) + String(column));\r\n\targ.emptyCells.splice(i, 1);\r\n}", "function flipRe(idx) {return {row: Math.floor(idx/numRows), ele: idx%numRows}}", "function moveRight() {\n\t\tfor (var row = 0; row < Rows; row++) {\n\t\t\tarrayCol = new Array(Cols);\n\t\t\tfor (var col = 0; col < Cols; col++) {\n\t\t\t\tarrayCol[col] = matrix[row][Cols - 1 - col];\n\t\t\t}\n\t\t\tmatrix[row] = newArray(arrayCol).reverse();\n\t\t}\n\n\t\tdraw();\n\t}", "function clearCell(x,y){}", "function undo() {\n updateFormula(function(text) {\n return text.slice(0, -1);\n });\n }", "originalValue(columnIndex, rowIndex, value = null) {\n var cell = this.getCellElementAt(columnIndex, rowIndex);\n if (latte._undef(value))\n return cell.data('original-value');\n cell.data('original-value', value);\n return this;\n }", "propagateDownFromLeft(node, parentPos, leftSibling) {\n let parentElement = node.parent.popAt(parentPos);\n this.addAtLastIndexOfCallStack(\n this.undoPopAt.bind(this, parentElement, node.parent, parentPos)\n );\n if (node.parent.hasRightChildAt(parentPos - 1)) {\n let nodeParentAtRightChildOldValue = node.parent.at(parentPos - 1).rightChild;\n node.parent.at(parentPos - 1).rightChild = node;\n this.addAtLastIndexOfCallStack(\n () => {\n node.parent.at(parentPos - 1).rightChild = nodeParentAtRightChildOldValue;\n }\n );\n }\n let parentElementLeftChildOldValue = parentElement.leftChild;\n parentElement.leftChild = null;\n this.addAtLastIndexOfCallStack(\n () => {\n parentElement.leftChild = parentElementLeftChildOldValue;\n }\n )\n\n let parentElementRightChildOldValue = parentElement.rightChild;\n parentElement.rightChild = node.hasLeftmostChild() ? node.getLeftmostChild() : this.recentNode;\n this.addAtLastIndexOfCallStack(\n () => {\n parentElement.rightChild = parentElementRightChildOldValue;\n }\n )\n\n node.addFirst(parentElement);\n this.addAtLastIndexOfCallStack(\n this.undoAddFirst.bind(this, node)\n );\n\n let nodeIsLeafOldValue = node.isLeaf;\n node.isLeaf = node.isLeaf && leftSibling.isLeaf;\n this.addAtLastIndexOfCallStack(\n () => {\n node.isLeaf = nodeIsLeafOldValue;\n }\n );\n\n this.mergeToRight(leftSibling, node);\n if (node.parent === this.root && this.root.size() === 0) {\n let rootOldValue = this.root;\n this.root = node;\n this.addAtLastIndexOfCallStack(\n () => {\n this.root = rootOldValue;\n }\n );\n\n let nodeParentOldValue = node.parent;\n node.parent = null;\n this.addAtLastIndexOfCallStack(\n () => {\n node.parent = nodeParentOldValue;\n }\n )\n }\n }", "function R(e,t,a){if(void 0===a&&(a=null),!(this instanceof R))return new R(e,t,a);this.line=e,this.ch=t,this.sticky=a}", "propagateDownFromRight(node, parentPos, rightSibling) {\n let parentElement = node.parent.popAt(parentPos);\n this.addAtLastIndexOfCallStack(\n this.undoPopAt.bind(this, parentElement, node.parent, parentPos)\n );\n\n if (node.parent.hasLeftChildAt(parentPos)) {\n let nodeParentAtLeftChildOldValue = node.parent.at(parentPos).leftChild;\n node.parent.at(parentPos).leftChild = node;\n this.addAtLastIndexOfCallStack(\n () => {\n node.parent.at(parentPos).leftChild = nodeParentAtLeftChildOldValue;\n }\n )\n }\n\n let parentElementLeftChildOldValue = parentElement.leftChild;\n parentElement.leftChild = node.hasRightmostChild() ? node.getRightmostChild() : this.recentNode;\n this.addAtLastIndexOfCallStack(\n () => {\n parentElement.leftChild = parentElementLeftChildOldValue;\n }\n );\n\n let parentElementRightChildOldValue = parentElement.rightChild;\n parentElement.rightChild = null;\n this.addAtLastIndexOfCallStack(\n () => {\n parentElement.rightChild = parentElementRightChildOldValue;\n }\n );\n\n node.addLast(parentElement);\n this.addAtLastIndexOfCallStack(\n this.undoAddLast.bind(this, node)\n );\n\n let nodeIsLeafOldValue = node.isLeaf;\n node.isLeaf = node.isLeaf && rightSibling.isLeaf;\n this.addAtLastIndexOfCallStack(\n () => {\n node.isLeaf = nodeIsLeafOldValue;\n }\n );\n\n this.mergeToLeft(node, rightSibling);\n\n\n if (node.parent === this.root && this.root.size() === 0) {\n let rootOldValue = this.root;\n this.root = node;\n this.addAtLastIndexOfCallStack(\n () => {\n this.root = rootOldValue;\n }\n )\n\n let nodeParentOldValue = node.parent;\n node.parent = null;\n this.addAtLastIndexOfCallStack(\n () => {\n node.parent = nodeParentOldValue;\n }\n );\n }\n }", "clear() {\n if (this.buffer.ybase === 0 && this.buffer.y === 0) {\n // Don't clear if it's already clear\n return;\n }\n this.buffer.lines.set(0, this.buffer.lines.get(this.buffer.ybase + this.buffer.y));\n this.buffer.lines.length = 1;\n this.buffer.ydisp = 0;\n this.buffer.ybase = 0;\n this.buffer.y = 0;\n for (let i = 1; i < this.rows; i++) {\n this.buffer.lines.push(this.buffer.getBlankLine(DEFAULT_ATTR_DATA));\n }\n this.refresh(0, this.rows - 1);\n this._onScroll.fire(this.buffer.ydisp);\n }", "undoPos()\n {\n this.dot.undoPos();\n }", "function reverseMutate() {\n let newOnes = ones.slice().reverse();\n console.log(ones);\n console.log(newOnes);\n }", "function removePosition(node, force) {\n visit(node, force ? hard : soft)\n return node\n}", "function removePosition(node, force) {\n visit(node, force ? hard : soft)\n return node\n}", "function removePosition(node, force) {\n visit(node, force ? hard : soft)\n return node\n}", "set(row, column, value) {\n const n = this._width * row + column;\n this._elements[n] = value;\n return this;\n }", "function SpreadFromLeft(tree) {\n\n return Spread(+tree.getAttribute(\"data-x\") - 1,\n +tree.getAttribute(\"data-y\"));\n\n}", "trimEmptyLines () {\n this.trimEmptyLinesAtBeginning()\n\n this.lines.reverse()\n this.trimEmptyLinesAtBeginning()\n this.lines.reverse()\n }", "function rewriteXY(newMatrix,rewX rewY, rewValue) {\n\t\tvar zwischenSpeicher = newMatrix[rewX];\n\t\tzwischenSpeicher[rewY] = rewValue;\n\t\tnewMatrix[rewX] = zwischenSpeicher;\n\t\treturn newMatrix;\t\n\t}", "function borrarRow2(e) {\n // console.log(e);\n e.target.parentNode.parentNode.removeChild(e.target.parentNode);\n document.querySelector('textarea').value = ej;\n}", "clearEol() {\n const {cursor, bg_color, size, font_attr} = this.proxy\n const {line, col} = cursor\n const clear_length = (size.cols - col) * font_attr.font_width\n log.debug(`Clear until EOL: ${line}:${col} length=${clear_length}`)\n this.drawBlock(line, col, 1, clear_length, bg_color)\n this.lines.clearEol(line, col)\n }", "function relaxRightToLeft(columns, alpha, beta) {\n for (var n = columns.length, i = n - 2; i >= 0; --i) {\n var column = columns[i];\n for (var _i = 0, column_2 = column; _i < column_2.length; _i++) {\n var source = column_2[_i];\n var y = 0;\n var w = 0;\n for (var _a = 0, _b = source.sourceLinks; _a < _b.length; _a++) {\n var _c = _b[_a], target = _c.target, value_2 = _c.value;\n var v = value_2 * (target.layer - source.layer);\n y += sourceTop(source, target) * v;\n w += v;\n }\n if (!(w > 0))\n continue;\n var dy_2 = (y / w - source.y0) * alpha;\n source.y0 += dy_2;\n source.y1 += dy_2;\n reorderNodeLinks(source);\n }\n if (sort === undefined)\n column.sort(ascendingBreadth);\n if (column.length)\n resolveCollisions(column, beta);\n }\n }", "function columnize($putInHere, $pullOutHere, $parentColumn, height){\n while($parentColumn.height() < height &&\n $pullOutHere[0].childNodes.length){\n $putInHere.append($pullOutHere[0].childNodes[0]);\n }\n if($putInHere[0].childNodes.length == 0) return;\n\n // now we're too tall, undo the last one\n var kids = $putInHere[0].childNodes;\n var lastKid = kids[kids.length-1];\n $putInHere[0].removeChild(lastKid);\n var $item = jQuery(lastKid);\n\n\n if($item[0].nodeType == 3){\n // it's a text node, split it up\n var oText = $item[0].nodeValue;\n var counter2 = options.width / 18;\n if(options.accuracy)\n counter2 = options.accuracy;\n var columnText;\n var latestTextNode = null;\n while($parentColumn.height() < height && oText.length){\n if (oText.indexOf(' ', counter2) != '-1') {\n columnText = oText.substring(0, oText.indexOf(' ', counter2));\n } else {\n columnText = oText;\n }\n latestTextNode = document.createTextNode(columnText);\n $putInHere.append(latestTextNode);\n\n if(oText.length > counter2){\n oText = oText.substring(oText.indexOf(' ', counter2));\n }else{\n oText = \"\";\n }\n }\n if($parentColumn.height() >= height && latestTextNode != null){\n // too tall :(\n $putInHere[0].removeChild(latestTextNode);\n oText = latestTextNode.nodeValue + oText;\n }\n if(oText.length){\n $item[0].nodeValue = oText;\n }else{\n return false; // we ate the whole text node, move on to the next node\n }\n }\n\n if($pullOutHere.children().length){\n $pullOutHere.prepend($item);\n }else{\n $pullOutHere.append($item);\n }\n\n return $item[0].nodeType == 3;\n }", "function operate() {\n var matrix = this.matrix,\n dataProvider = this.dataProvider;\n matrix.cellReferences.length = 0;\n (0, _array.arrayEach)(matrix.data, function (cell) {\n cell.setState(_value.default.STATE_OUT_OFF_DATE);\n cell.clearPrecedents();\n var row = cell.row,\n column = cell.column;\n var value = dataProvider.getSourceDataAtCell(row, column);\n\n if ((0, _utils.isFormulaExpression)(value)) {\n var prevRow = visualRows.get(cell);\n var expModifier = new _expressionModifier.default(value);\n expModifier.translate({\n row: dataProvider.t.toVisualRow(row) - prevRow\n });\n dataProvider.updateSourceData(row, column, expModifier.toString());\n }\n });\n visualRows = null;\n}", "function removePosition(node, force) {\n visit(node, force ? hard : soft);\n return node;\n}", "function toggleleft () {\n\n // grab the current column1 column and save it!\n old_column1 = document.getElementById(\"hello-world-column1\").innerHTML;\n\n // replace the screen contents of column1 column with new_text\n document.getElementById(\"hello-world-column1\").innerHTML = new_column1;\n\n\n console.log(\"-- updated by click --\");\n console.log(\"new_column1: \" + new_column1);\n console.log(\"old_column1: \" + old_column1);\n console.log(\"----------------------\\n\\n\\n\");\n\n // this allows the \"toggle\" - we swap the old for the new!\n new_column1 = old_column1;\n\n console.log(\"-- updated by \\\"toggle\\\" --\");\n console.log(\"new_column1: \" + new_column1);\n console.log(\"old_column1: \" + old_column1);\n console.log(\"*** NOTE: new_column1 == old_column1 now! ***\");\n console.log(\"-------------------------\\n\\n\\n\");\n }", "function consume() {\n // Line ending; assumes CR is not used (remark removes those).\n if (value.charCodeAt(index) === lineFeed) {\n place.line++\n place.column = 1\n }\n // Anything else.\n else {\n place.column++\n }\n\n index++\n\n place.offset++\n place.index = index\n }", "function undoMove(board, move) {\n board[move] = ' ';\n}", "function mirrorHorizontal(originalFunction){\n return function(parameter){\n var point = originalFunction(parameter);\n point[0] = -point[0];\n return point;\n }\n}", "pop()\n\t{\n\t\tthis.rows.pop();\n\t\t// Update the column count\n\t\tthis.width = this.rows.reduce(\n\t\t\t(width, row) => Math.max(row.type == 'full' ? 1 : row.data.length, width),\n\t\t\t0\n\t\t);\n\t}", "function colRev(col, rev){\n\tanimateCollapse(col);\n\tsetTimeout(animateReveal(rev), 1500);\n}", "function helper(change){\n let [row, col] = change\n for(let i = 0; i < matrix.length; i+=1){\n matrix[i][col] = 0\n }\n for(let j = 0; j < matrix[0].length; j+=1){\n matrix[row][j] = 0\n }\n }", "shiftLeft() {\n for (let line of this.cells) {\n for (let i = 0; i < line.length - 1; i++) {\n line[i].setType(line[i + 1].type);\n }\n line[line.length - 1].setType(BeadType.default);\n }\n }", "function resetRowContents()\r\n\t{\r\n\r\n\t\tvar theCell;\r\n\t\tvar thisRow;\r\n\r\n\t\tif ( editingRow !== -1 )\r\n\t\t{\r\n\t\t\t// get a reference to the Cell selected\r\n\t\t\ttheCell = document.getElementById('cell' + editingRow);\r\n\r\n\t\t\tthisRow = class_myRows[editingRow];\r\n\r\n\t\t\t// re-create the cell as it was before\r\n\t\t\tif ( thisRow.link.length > 0 )\r\n\t\t\t{\r\n\t\t\t\ttheCell.innerHTML= \"<A href=\\\"\" + thisRow.link + getOptionalParams( thisRow ) + \"\\\">\" + thisRow.name + \"</a> \" + fn_MenuStr( '', '', thisRow.dataId, '', imgSrc, LocString( 'Functions' ), '' ) + thisRow.modifiedImgs;\r\n\t\t\t}\r\n\t\t\telse\r\n\t\t\t{\r\n\t\t\t\ttheCell.innerHTML= \"&nbsp;\" + thisRow.name + fn_MenuStr( '', '', thisRow.dataId, '', imgSrc, LocString( 'Functions' ), '' ) + thisRow.modifiedImgs;\r\n\t\t\t}\r\n\t\t\teditingRow = -1;\r\n\t\t\tkillPopup();\r\n\t\t}\r\n\t}", "function flipCell(y, x) {\n if (x >= 0 && x < ncols && y >= 0 && y < nrows) {\n board[y][x] = !board[y][x];\n }\n }", "function r(e,t,n,r,o){this.children=[],this.sourceContents={},this.line=null==e?null:e,this.column=null==t?null:t,this.source=null==n?null:n,this.name=null==o?null:o,null!=r&&this.add(r)}", "function break_up_node(read_node, $write_context) {\n \n // check type to determine how to break it\n if (read_node.nodeType == Node.TEXT_NODE) {\n \n // text nodes get chopped up by words\n $write_context = write_text_to_column($(read_node), $write_context);\n \n } else {\n \n // put an empty clone of it in the column (the same one the whole didn't fit into)\n // and trigger the recursion.\n var $write_sub_context = $(read_node).clone().empty().appendTo($write_context);\n $write_context = walk_read_nodes($(read_node), $write_sub_context);\n }\n return $write_context;\n }", "function SpreadFromRight(tree) {\n\n return Spread(+tree.getAttribute(\"data-x\") + 1,\n +tree.getAttribute(\"data-y\"));\n\n}", "restorePos(_x, _y)\n {\n this.x = _x;\n this.y = _y;\n }", "_undo() {\n for (const [k, v] of Object.entries(this._undos)) {\n if (v) {\n\tthis._cells[k] = v;\n }\n else {\n\tdelete this._cells[k];\n }\n }\n }", "revert() { }", "Rewind() {}", "undo() {\n if (this.canUndo()) {\n this.shouldSaveHistory = false;\n const { index, state } = this.stack[(this.position -= 1)];\n this.onUpdate();\n\n this.editor.blocks.render({ blocks: state }).then(() => this.editor.caret.setToBlock(index, \"end\"));\n }\n }", "restoreValue() {\n this.textInputNode.value = this.originalValue;\n }", "function reverseRowsAndColumns(matrix) {\n let transformedMx = [];\n matrix.map((row) => {\n row.map((val, cIndex) => {\n if (!transformedMx[cIndex]) transformedMx.push([]);\n transformedMx[cIndex].push(val);\n});\n});\n return transformedMx;\n}", "function redips_column(std){\n\tvar nrows = std.hall.nrows;\n\treturn nrows - 1 - (std.hall_position.charCodeAt(0) - 65); // 'A' is 65, 'B' is 66, .. Vertical offset -1\n}", "function backspace() {\n if (calcVals.cur.length > 0) {\n calcVals.cur = calcVals.cur.substring(0, calcVals.cur.length - 1);\n }\n if (calcVals.cur.length === 0) {\n calcVals.cur = \"0\";\n }\n calcVals.prevAttr = \"filler\";\n}", "function _overwrite(args, t) {\n var previous = _stack[_index].graph;\n if (_index > 0) {\n _index--;\n _stack.pop();\n }\n _stack = _stack.slice(0, _index + 1);\n var actionResult = _act(args, t);\n _stack.push(actionResult);\n _index++;\n return change(previous);\n }", "function changeLine(doc, handle, changeType, op) {\n\t\t var no = handle, line = handle;\n\t\t if (typeof handle == \"number\") { line = getLine(doc, clipLine(doc, handle)); }\n\t\t else { no = lineNo(handle); }\n\t\t if (no == null) { return null }\n\t\t if (op(line, no) && doc.cm) { regLineChange(doc.cm, no, changeType); }\n\t\t return line\n\t\t }", "rotate() {\n const newCells = []\n for (let i = 0; i < this.cells.length; i++) {\n newCells[i] = []\n for (let j = 0; j < this.cells.length; j++) {\n newCells[i][j] = this.cells[this.cells.length - 1 - j][i]\n }\n }\n this.cells = newCells\n }", "function changeLine(doc, handle, changeType, op) {\n var no = handle, line = handle;\n if (typeof handle == \"number\") { line = getLine(doc, clipLine(doc, handle)); }\n else { no = lineNo(handle); }\n if (no == null) { return null }\n if (op(line, no) && doc.cm) { regLineChange(doc.cm, no, changeType); }\n return line\n }", "function changeLine(doc, handle, changeType, op) {\n var no = handle, line = handle;\n if (typeof handle == \"number\") { line = getLine(doc, clipLine(doc, handle)); }\n else { no = lineNo(handle); }\n if (no == null) { return null }\n if (op(line, no) && doc.cm) { regLineChange(doc.cm, no, changeType); }\n return line\n }", "function changeLine(doc, handle, changeType, op) {\n var no = handle, line = handle;\n if (typeof handle == \"number\") { line = getLine(doc, clipLine(doc, handle)); }\n else { no = lineNo(handle); }\n if (no == null) { return null }\n if (op(line, no) && doc.cm) { regLineChange(doc.cm, no, changeType); }\n return line\n }", "function changeLine(doc, handle, changeType, op) {\n var no = handle, line = handle;\n if (typeof handle == \"number\") { line = getLine(doc, clipLine(doc, handle)); }\n else { no = lineNo(handle); }\n if (no == null) { return null }\n if (op(line, no) && doc.cm) { regLineChange(doc.cm, no, changeType); }\n return line\n }", "function changeLine(doc, handle, changeType, op) {\n var no = handle, line = handle;\n if (typeof handle == \"number\") { line = getLine(doc, clipLine(doc, handle)); }\n else { no = lineNo(handle); }\n if (no == null) { return null }\n if (op(line, no) && doc.cm) { regLineChange(doc.cm, no, changeType); }\n return line\n }", "function changeLine(doc, handle, changeType, op) {\n var no = handle, line = handle;\n if (typeof handle == \"number\") { line = getLine(doc, clipLine(doc, handle)); }\n else { no = lineNo(handle); }\n if (no == null) { return null }\n if (op(line, no) && doc.cm) { regLineChange(doc.cm, no, changeType); }\n return line\n }", "function changeLine(doc, handle, changeType, op) {\n var no = handle, line = handle;\n if (typeof handle == \"number\") { line = getLine(doc, clipLine(doc, handle)); }\n else { no = lineNo(handle); }\n if (no == null) { return null }\n if (op(line, no) && doc.cm) { regLineChange(doc.cm, no, changeType); }\n return line\n }" ]
[ "0.72795355", "0.53835183", "0.5181338", "0.518", "0.518", "0.518", "0.518", "0.518", "0.518", "0.51663584", "0.5156114", "0.5098013", "0.5072985", "0.4976196", "0.4880812", "0.48687857", "0.48530856", "0.48391765", "0.48253495", "0.4817544", "0.4776628", "0.4767747", "0.47495526", "0.47495526", "0.47495526", "0.47495526", "0.47495526", "0.47313908", "0.46884713", "0.46787226", "0.46785676", "0.4660378", "0.46584618", "0.46545672", "0.4651193", "0.46413124", "0.4631119", "0.4609149", "0.46089718", "0.4605441", "0.45965233", "0.45875913", "0.45802027", "0.45744443", "0.4560223", "0.4559384", "0.45450038", "0.45415407", "0.4532388", "0.45190972", "0.45142126", "0.45133683", "0.45133683", "0.45133683", "0.45039946", "0.44802177", "0.44690162", "0.44662288", "0.44662043", "0.44591838", "0.44566286", "0.44518396", "0.44464812", "0.4445049", "0.44384328", "0.44382668", "0.44269183", "0.44247082", "0.44208026", "0.44136697", "0.4412158", "0.44095832", "0.4405493", "0.43911996", "0.43896455", "0.43756694", "0.43705237", "0.43699673", "0.43670103", "0.43664387", "0.43663156", "0.43611988", "0.43483156", "0.43465108", "0.43346033", "0.43270853", "0.4324269", "0.43213335", "0.43169698", "0.43169576", "0.43169576", "0.43169576", "0.43169576", "0.43169576", "0.43169576", "0.43169576" ]
0.71728957
4
Test the position, after eating, and reverse to a noteaten state.
function test() { var result = pos({}); line = current.line; column = current.column; value = subvalue + value; return result.position; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "backToPosition() {\n while (this.current_position != this.position) {\n this.closeDoors();\n if (this.current_position > this.position) {\n this.moveDown();\n console.log(this.current_position);\n } else if (this.current_position < this.position) {\n this.moveUp();\n }\n console.log(this.current_position);\n }\n this.openDoors = true;\n }", "function handleReversedCoordinates(){\n if (complexScope.aLeftUpper > complexScope.aRightBottom) {\n complexScope.changer = complexScope.aLeftUpper;\n complexScope.aLeftUpper = complexScope.aRightBottom;\n complexScope.aRightBottom = complexScope.changer;\n // if you create the new area from right to left\n }\n if (complexScope.bLeftUpper < complexScope.bRightBottom) {\n complexScope.changer = complexScope.bLeftUpper;\n complexScope.bLeftUpper = complexScope.bRightBottom;\n complexScope.bRightBottom = complexScope.changer;\n // if you create the new area from right to left\n }\n }", "eat(pos) {\n \tvar x = this.frame.x;\n var y = this.frame.y;\n if(x == pos.x && y == pos.y) {\n return true;\n }\n return false;\n }", "function updateFoodAcquiredState(){\n if(snake.history[0].x === food.x && snake.history[0].y === food.y){\n $(\"#success\").get(0).play();\n points = points + 10;\n $(\"#points\").html(points);\n snake.history.unshift({x:snake.history[0].x,y:snake.history[0].y});\n toBeClearedFields.push(food);\n food.x = Math.floor(Math.random() * size);\n food.y = Math.floor(Math.random() * size);\n }\n }", "markOff(){\n this.room.unmarkPosition(this.positionX, this.positionY);\n }", "eoi() { return this.pos==this.end }", "function inPosA2() {\n\trandomNum = Random.value * 10;\n\n\tif(targetDirF == true && randomNum < 6){\n\t\t//do nothing, go forward\n\t\tcalculatingMove = false;\n\t}else if(targetDirR == true){\n\t\t//turn right\n\t\tif(targetTurnR2 == 0){\n\t\t\ttransform.GetComponent(aiStates).rightCoord = targetTurnR1;\n\t\t\ttransform.GetComponent(aiStates).rightState = true;\n\t\t}else{\n\t\t\ttransform.GetComponent(aiStates).rightCoord = targetTurnR2;\n\t\t\ttransform.GetComponent(aiStates).rightState = true;\n\t\t}\n\t}else{\n\t\tif(targetDirF == true){\n\t\t\t//do nothing, go forward\n\t\t\tcalculatingMove = false;\n\t\t}else if(targetDirR == true){\n\t\t\t//turn right\n\t\t\tif(targetTurnR2 == 0){\n\t\t\t\ttransform.GetComponent(aiStates).rightCoord = targetTurnR1;\n\t\t\t\ttransform.GetComponent(aiStates).rightState = true;\n\t\t\t}else{\n\t\t\t\ttransform.GetComponent(aiStates).rightCoord = targetTurnR2;\n\t\t\t\ttransform.GetComponent(aiStates).rightState = true;\n\t\t\t}\n\t\t}else{\n\t\t\tDebug.Log(\"Error with turn selection, position A2\");\n\t\t\ttransform.GetComponent(aiStates).startAgain = true;\n\t\t}\n\t}\n}", "eat(pos){\n let x = this.body[this.body.length-1].x\n let y = this.body[this.body.length-1].y\n if (x == pos.x && y == pos.y){\n this.grow();\n return true;\n }\n else{\n false;\n }\n }", "click(e, position) {\n\t/*check if the positon in state.position is empty, else alert invalid*/\n if (this.state.positions[position] == \"\") {\n this.state.positions.splice(position, 1, this.state.toggle);\n this.setState({ positions: this.state.positions });\n this.winner()\n if (this.state.toggle == \"x\") {\n this.setState({ toggle: \"o\" })\n } else {\n this.setState({ toggle: \"x\" })\n };\n } else { alert(\"invalid\") }\n }", "function goBackward(rover) {\n switch (rover.direction) {\n case 'N':\n rover.position[0]--\n break;\n case 'E':\n rover.position[1]--\n break;\n case 'S':\n rover.position[0]++\n break;\n case 'W':\n rover.position[1]++\n break;\n };\n\t\tconsole.log(\"New Rover Position: [\" + rover.position[0] + \", \" + rover.position[1] + \"]\")\n}", "function check_arrow(event){\r\n\r\n const LEFT_KEY = 37;\r\n const RIGHT_KEY = 39;\r\n const UP_KEY = 38;\r\n const DOWN_KEY = 40;\r\n\r\n if(changing_direction) return;\r\n changing_direction = true;\r\n const keyPressed = event.keyCode;\r\n // Use this to check if the snake is moving in the reverse side\r\n const goingUp = dy === -10;\r\n const goingDown = dy === 10;\r\n const goingRight = dx === 10;\r\n const goingLeft = dx === -10;\r\n\r\n if(keyPressed === LEFT_KEY && !goingRight){\r\n dx = -10;\r\n dy = 0;\r\n }\r\n\r\n if(keyPressed === RIGHT_KEY && !goingLeft){\r\n dx = 10;\r\n dy = 0;\r\n }\r\n\r\n if(keyPressed === UP_KEY && !goingDown){\r\n dx = 0;\r\n dy = -10;\r\n }\r\n\r\n if(keyPressed === DOWN_KEY && !goingUp){\r\n dx = 0;\r\n dy = 10;\r\n }\r\n}", "function noteOff(noteNumber) { }", "function checkForTrick(trickEndPosition : Vector3)\n\t{\n\t\tvar xDifference : float = 0;\n\t\t\n\t\txDifference = trickEndPosition.x - trickStartPosition.x;\n\t\t\n\t\tif(xDifference < -180 || xDifference > 180)//they did a flip\n\t\t{\n\t\t\tvar didATrick : String = \"hi\";\n\t\t\txDifference = 2;\n\t\t}\n\t\t\n\t\ttrickStartPosition = new Vector3(0,0,0);\n\t}", "function downPropogate(){\n newPosition = ghostPosition + options[3]\n newGhostDirection = directions[3]\n if (!canMove()) {\n let randomIndex = Math.floor(Math.random()*2)+1\n newPosition = ghostPosition + options[randomIndex]\n newGhostDirection = directions[randomIndex]\n if (!canMove()){\n randomIndex = (randomIndex===1) ? 2:1\n newPosition = ghostPosition + options[randomIndex]\n newGhostDirection = directions[randomIndex]\n if (!canMove()){\n newPosition = ghostPosition + options[0]\n newGhostDirection = directions[0]\n }\n }\n }\n }", "function encloseRightState(){\n if(shipY < 0){\n shipY = 0;\n }\n if(shipY > height - 50){\n shipY = height - 50;\n }\n if(shipX > width - 40){\n shipX = width - 40;\n }\n}", "moveForward () {\n let posAux = Object.assign({}, this.position);\n switch (this.position.orientation) {\n case 'N':\n this.position.column++;\n break;\n case 'S':\n this.position.column--;\n break;\n case 'E':\n this.position.row--;\n break;\n case 'W':\n this.position.row++;\n break;\n default:\n break;\n }\n this.isLost(posAux);\n }", "function outOfSight(){\n\t\tif(snakeArr[0].x>99&&currentMove=='r'){\n\t\t\treturn 'rightExcede';\n\t\t}\n\t\telse if(snakeArr[0].x<0&&currentMove=='l'){\n\t\t\treturn 'leftExcede';\n\t\t}\n\t\telse if(snakeArr[0].y>45.5&&currentMove=='b'){\n\t\t\treturn 'bottomExcede';\n\t\t}\n\t\telse if(snakeArr[0].y<0&&currentMove=='t'){\n\t\t\treturn 'topExcede';\n\t\t}\n\t\telse{\n\t\t\treturn false;\n\t\t}\n\t}", "winner(){\n const msg = \" Winner is: \" + this.state.toggle;\n /*check from the central position */\n if(this.state.positions[4]!==\"\"){\n if(this.state.positions[0]===this.state.positions[4] && this.state.positions[4]===this.state.positions[8]||\n this.state.positions[2]===this.state.positions[4] && this.state.positions[4]===this.state.positions[6]||\n this.state.positions[1]===this.state.positions[4] && this.state.positions[4]===this.state.positions[7]||\n this.state.positions[3]===this.state.positions[4] && this.state.positions[4]===this.state.positions[5]\n ){\n alert(msg)\n this.setState({positions:[\"\", \"\", \"\", \"\", \"\", \"\", \"\", \"\", \"\"]});\n this.setState({toggle:\"x\"});\n }\n /*check from the inicial position */\n \t}else if(this.state.positions[0]!==\"\"){\n \tif(this.state.positions[1]===this.state.positions[0] && this.state.positions[0]===this.state.positions[2]||\n this.state.positions[3]===this.state.positions[0] && this.state.positions[0]===this.state.positions[6]\n \t){\n alert(msg);\n this.setState({positions:[\"\", \"\", \"\", \"\", \"\", \"\", \"\", \"\", \"\"]});\n this.setState({toggle:\"x\"});\n \t}\n \t/*check from the last position */\n \t}else if(this.state.positions[8]!==\"\")\n \tif(this.state.positions[2]===this.state.positions[8] && this.state.positions[8]===this.state.positions[5]||\n this.state.positions[6]===this.state.positions[8] && this.state.positions[8]===this.state.positions[7]\n \t){\n alert(msg);\n this.setState({positions:[\"\", \"\", \"\", \"\", \"\", \"\", \"\", \"\", \"\"]});\n this.setState({toggle:\"x\"});\n \t}\n }", "function trackbackAlternations(originalPos, newPos) {\n var vp = getMaskSet()[\"validPositions\"][newPos],\n targetLocator = vp.locator,\n tll = targetLocator.length;\n\n for (var ps = originalPos; ps < newPos; ps++) {\n if (!isMask(ps)) {\n var tests = getTests(ps),\n bestMatch = tests[0], equality = -1;\n $.each(tests, function (ndx, tst) {\n for (var i = 0; i < tll; i++) {\n if (tst.locator[i] && checkAlternationMatch(tst.locator[i].toString().split(','), targetLocator[i].toString().split(',')) && equality < i) {\n equality = i;\n bestMatch = tst;\n }\n }\n });\n setValidPosition(ps, $.extend({}, bestMatch, { \"input\": bestMatch[\"match\"].def }), true)\n }\n }\n }", "function updateState(pos) {\n if ('NEWS'.indexOf(pos.val) > -1) {\n bender.direction = pos.val;\n }\n else if (pos.val === 'B') {\n bender.breaker = !bender.breaker;\n }\n else if (pos.val === 'X') {\n board[pos.row][pos.col] = ' ';\n }\n else if (pos.val === 'I') {\n bender.pattern = bender.pattern.split('').reverse().join('');\n }\n else if (pos.val === 'T') {\n teleport();\n }\n }", "if (!game.inEditorMode) {\n // revert pos\n this.pos = lastPos;\n }", "tellPositionInFrontY(){\n switch(this.orientation){\n case 0:\n return this.positionY - 1;\n case 2:\n return this.positionY + 1;\n }\n return this.positionY;\n }", "function trackbackAlternations(originalPos, newPos) {\n\t\t\t\tvar vp = getMaskSet().validPositions[newPos];\n\t\t\t\tif (vp) {\n\t\t\t\t\tvar targetLocator = vp.locator,\n\t\t\t\t\t\ttll = targetLocator.length;\n\n\t\t\t\t\tfor (var ps = originalPos; ps < newPos; ps++) {\n\t\t\t\t\t\tif (getMaskSet().validPositions[ps] === undefined && !isMask(ps, true)) {\n\t\t\t\t\t\t\tvar tests = getTests(ps).slice(),\n\t\t\t\t\t\t\t\tbestMatch = determineTestTemplate(tests, true),\n\t\t\t\t\t\t\t\tequality = -1;\n\t\t\t\t\t\t\tif (tests[tests.length - 1].match.def === \"\") tests.pop();\n\t\t\t\t\t\t\t$.each(tests, function (ndx, tst) { //find best matching\n\t\t\t\t\t\t\t\tfor (var i = 0; i < tll; i++) {\n\t\t\t\t\t\t\t\t\tif (tst.locator[i] !== undefined && checkAlternationMatch(tst.locator[i].toString().split(\",\"), targetLocator[i].toString().split(\",\"), tst.na)) {\n\t\t\t\t\t\t\t\t\t\tif (equality < i) {\n\t\t\t\t\t\t\t\t\t\t\tequality = i;\n\t\t\t\t\t\t\t\t\t\t\tbestMatch = tst;\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\t\t//check if alternationIndex is closer then the current bestmatch\n\t\t\t\t\t\t\t\t\t\tvar targetAI = targetLocator[i],\n\t\t\t\t\t\t\t\t\t\t\tbestMatchAI = bestMatch.locator[i],\n\t\t\t\t\t\t\t\t\t\t\ttstAI = tst.locator[i];\n\t\t\t\t\t\t\t\t\t\tif ((targetAI - bestMatchAI) > Math.abs(targetAI - tstAI)) {\n\t\t\t\t\t\t\t\t\t\t\tbestMatch = tst;\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t});\n\t\t\t\t\t\t\tbestMatch = $.extend({}, bestMatch, {\n\t\t\t\t\t\t\t\t\"input\": getPlaceholder(ps, bestMatch.match, true) || bestMatch.match.def\n\t\t\t\t\t\t\t});\n\t\t\t\t\t\t\tbestMatch.generatedInput = true;\n\t\t\t\t\t\t\tsetValidPosition(ps, bestMatch, true);\n\t\t\t\t\t\t\t//revalidate the new position to update the locator value\n\t\t\t\t\t\t\tgetMaskSet().validPositions[newPos] = undefined;\n\t\t\t\t\t\t\t_isValid(newPos, vp.input, true);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}", "function reactionReverse () {\n direction = -direction; // Stromrichtung umkehren\n reset(); // Ausgangsstellung\n }", "function elongateTopNote(noteIndex)\n{\n if(topNoteBlocks[noteIndex]){\n var newTop = - fallDownSpeed;\n topNoteBlocks[noteIndex].style.top = newTop;\n }\n \n}", "function C012_AfterClass_Amanda_CheckNotes() {\n\tif (((ActorGetValue(ActorCloth) == \"\") || (ActorGetValue(ActorCloth) == \"Clothed\") || (ActorGetValue(ActorCloth) == \"Pajamas\")) && !ActorHasInventory(\"Collar\") && !ActorIsRestrained() && !ActorIsGagged()) ActorSetPose(\"CheckNotes\");\n\tLeaveIcon = \"Leave\";\n}", "function flip(mark) {\nif (mark ==\"X\")\n return 'O';\nreturn 'X';\n}", "function gameLogic() {\n\n // Check if pressed direction is opposite of current direction\n var isReverseDir =\n (nextDir === Directions.UP && snakeDir === Directions.DOWN) ||\n (nextDir === Directions.DOWN && snakeDir === Directions.UP) ||\n (nextDir === Directions.RIGHT && snakeDir === Directions.LEFT) ||\n (nextDir === Directions.LEFT && snakeDir === Directions.RIGHT);\n\n // Change snake dir only if pressed direction is not reverse\n if (!isReverseDir) {\n snakeDir = nextDir;\n }\n\n var oldHead = snake[0]; // Get the position of the head\n \n // Position new head depending on snake direction\n if (snakeDir === Directions.UP)\n var newHead = { x: oldHead.x, y: oldHead.y - 1 };\n else if (snakeDir === Directions.DOWN)\n var newHead = { x: oldHead.x, y: oldHead.y + 1 };\n else if (snakeDir === Directions.LEFT)\n var newHead = { x: oldHead.x - 1, y: oldHead.y };\n else if (snakeDir === Directions.RIGHT)\n var newHead = { x: oldHead.x + 1, y: oldHead.y };\n\n // Add the new head to the front of snake \n snake.unshift(newHead)\n \n // Check if food is eaten\n var ateFood = newHead.x === food.x && newHead.y === food.y;\n\n if (ateFood) { // If the food is eaten then reposition food randomly\n food = {\n x: (Math.random() * 40) | 0,\n y: (Math.random() * 40) | 0\n };\n } else { \n // Remove the last part of the snake - this moves the snake\n // if food is eaten then we skip this part. This is how the \n // snake grows.\n snake.pop();\n }\n\n // Check if snake is dead\n var isDead = false; // initial value\n // Check if newHead is on any other snake part\n for (var i = 1; i < snake.length; i++) {\n if (newHead.x === snake[i].x && newHead.y === snake[i].y) {\n isDead = true;\n break;\n }\n }\n\n\n // Check if snake is out of bounds\n if (newHead.x < 0 || newHead.y < 0 || newHead.x >= 40 || newHead.y >= 40) {\n isDead = true;\n }\n\n // Stop the game if player is dead\n if (isDead) gameRunning = false;\n}", "function trackbackAlternations(originalPos, newPos) {\n\t var vp = getMaskSet().validPositions[newPos],\n\t\t\t\t\t\ttargetLocator = vp.locator,\n\t\t\t\t\t\ttll = targetLocator.length;\n\n\t for (var ps = originalPos; ps < newPos; ps++) {\n\t if (getMaskSet().validPositions[ps] === undefined && !isMask(ps, true)) {\n\t var tests = getTests(ps),\n\t\t\t\t\t\t\t\tbestMatch = tests[0],\n\t\t\t\t\t\t\t\tequality = -1;\n\t $.each(tests, function (ndx, tst) { //find best matching\n\t for (var i = 0; i < tll; i++) {\n\t if (tst.locator[i] !== undefined && checkAlternationMatch(tst.locator[i].toString().split(\",\"), targetLocator[i].toString().split(\",\"))) {\n\t if (equality < i) {\n\t equality = i;\n\t bestMatch = tst;\n\t }\n\t } else break;\n\t }\n\t });\n\t setValidPosition(ps, $.extend({}, bestMatch, {\n\t \"input\": bestMatch.match.placeholder || bestMatch.match.def\n\t }), true);\n\t }\n\t }\n\t }", "function C012_AfterClass_Amanda_SetPose() {\n\tif (((ActorGetValue(ActorCloth) == \"\") || (ActorGetValue(ActorCloth) == \"Clothed\")) && !ActorIsRestrained() && !ActorIsGagged()) {\n\t\tvar Love = ActorGetValue(ActorLove);\n\t\tvar Sub = ActorGetValue(ActorSubmission);\n\t\tif ((Sub <= -10) && (Math.abs(Sub) >= Math.abs(Love))) ActorSetPose(\"Point\");\n\t\tif ((Sub >= 10) && (Math.abs(Sub) >= Math.abs(Love))) ActorSetPose(\"Shy\");\n\t\tif ((Love >= 10) && (Math.abs(Love) >= Math.abs(Sub))) ActorSetPose(\"Love\");\n\t\tif ((Love <= -10) && (Math.abs(Love) >= Math.abs(Sub))) ActorSetPose(\"Angry\");\n\t\tif (Common_ActorIsOwned) ActorSetPose(\"Shy\");\n\t} else {\n\t\tif ((ActorGetValue(ActorCloth) == \"Naked\") && !ActorIsRestrained() && !ActorIsGagged() && (ActorGetValue(ActorSubmission) >= 10)) ActorSetPose(\"Shy\");\n\t\tif ((ActorGetValue(ActorCloth) == \"Pajamas\") && !ActorIsRestrained() && !ActorIsGagged() && (ActorGetValue(ActorLove) >= 10)) ActorSetPose(\"Happy\");\n\t\telse ActorSetPose(\"\");\n\t}\n}", "function ELdown(){\n console.log(\"In eyes l arrow clicked\");\n eyes.destroy();\n eyeindex--;\n if(eyeindex<=0)\n {\n eyeindex = 0;\n eyes = game.add.image(970, 235, images.eyes[eyeindex].name);\n eyes.scale.setTo(0.1);\n be = bb.create(550, 55, images.eyes[eyeindex].name);\n be.scale.setTo(0.1);\n }\n else if (eyeindex >= images.eyes.length)\n {\n eyeindex = images.eyes.length -1;\n eyes = game.add.image(970, 235, images.eyes[eyeindex].name);\n eyes.scale.setTo(0.1);\n be = bb.create(550, 55, images.eyes[eyeindex].name);\n be.scale.setTo(0.1);\n }\n else\n {\n eyes = game.add.image(970, 235, images.eyes[eyeindex].name);\n eyes.scale.setTo(0.1);\n be = bb.create(550, 55, images.eyes[eyeindex].name);\n be.scale.setTo(0.1);\n }\n player.appearance.head.eye = images.eyes[eyeindex].name;\n\n}", "isTonic(note) {\n return (note % 12) == this.offset();\n }", "function C012_AfterClass_Amanda_TestLove() {\n\tif (!ActorIsGagged()) {\n\t\tif (!ActorIsRestrained() && !Common_PlayerRestrained) {\n\t\t\tif (!Common_PlayerNaked && (ActorGetValue(ActorCloth) != \"Naked\")) {\n\t\t\t\tif (ActorGetValue(ActorLove) >= 20) {\n\t\t\t\t\tActorSetPose(\"\");\n\t\t\t\t\tC012_AfterClass_Amanda_CurrentStage = 100;\n\t\t\t\t\tOverridenIntroText = \"\";\n\t\t\t\t}\n\t\t\t} else OverridenIntroText = GetText(\"CantDateWhileNaked\");\n\t\t} else OverridenIntroText = GetText(\"CantDateWhileRestrained\");\n\t} else C012_AfterClass_Amanda_GaggedAnswer();\n}", "function testCase(pos) {\n switch (pos) {\n case 0:\n thisPos = {Location: 'now', lng: 121.5552137, ret: 25.0851076};\n break;\n case 1:\n thisPos = {Location: 'now', lng: 121.5536283, ret: 25.0926443};\n break;\n case 2:\n thisPos = {Location: 'now', lng: 121.5575088, ret: 25.1077731};\n break;\n }\n gmap.onPositionChange();\n}", "function offCourse() {\n getCurrentPosition().then(function (position) {\n if (!routeExists()) {\n return;\n }\n var startPoint = turf.point([position.coords.longitude, position.coords.latitude]);\n var nextRoutePoint = turf.along(currentRoute.geom, currentRoute.stepped + stepLengthMiles, 'miles');\n var currentBearing = turf.bearing(startPoint, nextRoutePoint);\n var bearing = currentBearing + 90;\n if (bearing > 180) {\n bearing -= 360;\n }\n var reroutePoint = turf.destination(startPoint, stepLengthMiles * 2, bearing, 'miles');\n $rootScope.$broadcast(events.positionOffCourse, reroutePoint);\n });\n }", "getPosition(absState) {\n return absState % (this._w + 1);\n }", "function resetFood(){\n //to ensure the food position is not on surrent snake/resetPos\n function isFoodPosOK(x,y){\n //not on snake0\n for (var i = 0; i < snakes[0].body.length; i++){\n if (x == snakes[0].body[i][0] && y == snakes[0].body[i][1])\n return false;\n }\n //not on snake1\n for (var i = 0; i < snakes[1].body.length; i++){\n if (x == snakes[1].body[i][0] && y == snakes[1].body[i][1])\n return false;\n }\n return true;\n }\n \n //update position\n var x = Math.floor(Math.random()*18)+1;\n var y = Math.floor(Math.random()*18)+1;\n while (!isFoodPosOK(x,y)){\n x = Math.floor(Math.random()*18)+1;\n y = Math.floor(Math.random()*18)+1;\n } \n foodPos = [x,y,0];\n }", "function calculateDirectionToMoveAndUpdatePosition() {\n var NS, EW;\n\n if (TY < LY) {\n NS = 'S';\n TY += 1;\n }\n else if (TY > LY) {\n NS = 'N';\n TY -= 1;\n }\n else {\n NS = '';\n }\n\n if (TX < LX) {\n EW = 'E';\n TX += 1;\n }\n else if (TX > LX) {\n EW = 'W';\n TX -= 1;\n }\n else {\n EW = '';\n }\n\n return NS+EW;\n }", "function is_eating(w) {\n $rt_addContract(w, cd4e49798d42ac5a95f1a8edbd8ed8c01c, \"motion.ts(68,27)\");\n return (w.food).equals(w.snake.segs.x);\n }", "function resetSnake(i){\n //ensure reset position is not on the other sname nor on food\n function isSnakePosOK(x,y){\n //not on the other snake\n for (var k = 0; k < snakes[1-i].body.length; k++){\n if ((x == snakes[1-i].body[k][0] || x-1 == snakes[1-i].body[k][0] || x-2 == snakes[1-i].body[k][0]) && y == snakes[1-i].body[k][1])\n return false; \n }\n //not on food\n if ((x == foodPos[0] || x-1 == foodPos[0] || x-2 == foodPos[0]) && y == foodPos[1])\n return false;\n return true;\n }\n \n //update point\n if (i==0) {\n point = 0;\n document.getElementById(\"point\").innerHTML = point;\n }\n else {\n cpoint = 0;\n document.getElementById(\"cpoint\").innerHTML = cpoint;\n }\n\n //update position\n var x = Math.floor(Math.random()*15)+3;\n var y = Math.floor(Math.random()*18)+1;\n while (!isSnakePosOK(x,y)){\n x = Math.floor(Math.random()*15)+3;\n y = Math.floor(Math.random()*18)+1;\n } \n snakes[i].body = [[x,y,0],[x-1,y,0],[x-2,y,0]];\n snakes[i].direction=[\"right\", \"right\"];\n }", "function moveBackward(rover){\n console.log(`----${rover.name}----`);\n console.log(\"moveBackward was called\");\n switch (rover.direction) {\n case 'N':\n if (rover.y < 9) {\n rover.y++;\n if (rover1.x === rover2.x && rover1.y === rover2.y) {\n rover.y--\n console.log(`There is an other Rover at (${rover.x},${rover.y+1}). Change your way!`);\n } else if (grid[rover.y][rover.x] === o) {\n rover.y--;\n console.log(`There is an ${o} at (${rover.x},${rover.y+1}). Change your way!`)\n }\n } else {\n console.log(\"canceled command, you are on the grid limit!\");\n }\n break;\n case 'W':\n if (rover.x < 9) {\n rover.x++;\n if (rover1.x === rover2.x && rover1.y === rover2.y) {\n rover.x--\n console.log(`There is an other Rover at (${rover.x+1},${rover.y}). Change your way!`);\n } else if (grid[rover.y][rover.x] === o) {\n rover.x--;\n console.log(`There is an ${o} at (${rover.x+1},${rover.y}). Change your way!`)\n }\n } else {\n console.log(\"canceled command, you are on the grid limit!\");\n }\n break;\n case 'S':\n if (rover.y > 0) {\n rover.y--;\n if (rover1.x === rover2.x && rover1.y === rover2.y) {\n rover.y++\n console.log(`There is an other Rover at (${rover.x},${rover.y-1}). Change your way!`);\n } else if (grid[rover.y][rover.x] === o) {\n rover.y++;\n console.log(`There is an ${o} at (${rover.x},${rover.y-1}). Change your way!`)\n }\n } else {\n console.log(\"canceled command, you are on the grid limit!\");\n }\n break;\n case 'E':\n if (rover.x > 0) {\n rover.x--;\n if (rover1.x === rover2.x && rover1.y === rover2.y) {\n rover.x++\n console.log(`There is an other Rover at (${rover.x-1},${rover.y}). Change your way!`);\n } else if (grid[rover.y][rover.x] === o) {\n rover.x++;\n console.log(`There is an ${o} at (${rover.x-1},${rover.y}). Change your way!`)\n }\n } else {\n console.log(\"canceled command, you are on the grid limit!\");\n }\n break;\n }\n console.log(`Direction: ${rover.direction}`);\n console.log(`Position: (${rover.x},${rover.y})`);\n rover.travelLog.push({x: rover.x, y: rover.y});\n}", "reoderQuestion(up = true) {\n const {questionId, answerId} = this.props;\n up ? this.moveUp(questionId, answerId) : this.moveDown(questionId, answerId);\n }", "function moveDown() {\n undraw(); //undraw tetromino\n currentPosition += width; //change reference point to one row down\n draw(); //draw the tetromino \n freeze(); \n }", "function stepApplyNewPosition () {\n\t\tvar state={\n\t\t\t\tediting: false,\n\t\t\t\tnode: false,\n\t\t\t\tdata: {\n\t\t\t\t\tx: 0,\n\t\t\t\t\ty: 0,\n\t\t\t\t\trotate: 0,\n\t\t\t\t\tscale: 0\n\t\t\t\t}\n\t\t },\n\t\tconfig= {\n\t\t\trotateStep: 3,\n\t\t\tscaleStep: 1,\n\t\t\tmoveStep: 50\n\t\t },\n\t\tdefaults= {\n\t\t\tx: 0,\n\t\t\ty: 0,\n\t\t\trotate: 0,\n\t\t\tscale: 1\n\t\t };\n\t\t \n\t /* $('body').on('mousedown','.step',function(e){\n\t\tstate.editing=true;\n\t\tstate.node=$(this);\n\t\tstate.node.fadeTo(0.6);\n\t\t});\n\t\t\n\t $('body').on('mouseup','.step',function(e){\n\t\tstate.editing=false;\n\t\tvar $t=$(this);\n\t\t$t.fadeTo(1);\n\t\t});\n\t*/\t\n\t\tstate.editing=true;\n\t\tstate.node=$(this);\n\t\t\n\t\tif(state.editing){\n\t\t var $t=state.node;\n\t\t for(var i in state.data){\n\t\t\tvar tmp=$t.attr('data-'+i);\n\t\t\tif(tmp===''){tmp=defaults[i]}\n\t\t\tstate.data[i]= ~~(tmp);\n\t\t\t}\n\t\t\t//console.log(['before...',state.data,state.node[0]]);\n\t\t \n\t\t switch(e.which){\n\t\t\tcase 113: //q\n\t\t\t state.data.rotate-=config.rotateStep;\n\t\t\t\tbreak;\n\t\t\tcase 119: //w\n\t\t\t state.data.y-=config.moveStep;\n\t\t\t\tbreak;\n\t\t\tcase 101: //e\n\t\t\t state.data.rotate+=config.rotateStep;\n\t\t\t\tbreak;\n\t\t\tcase 97: //a\n\t\t\t state.data.x-=config.moveStep;\n\t\t\t\tbreak;\n\t\t\tcase 115: //s\n\t\t\t state.data.y+=config.moveStep;\n\t\t\t\tbreak;\n\t\t\tcase 100: //d\n\t\t\t state.data.x+=config.moveStep;\n\t\t\t\tbreak;\n\t\t\tcase 122: //z\n\t\t\t state.data.scale+=config.scaleStep;\n\t\t\t\tbreak;\n\t\t\tcase 120: //x\n\t\t\t state.data.scale-=config.scaleStep;\n\t\t\t\tbreak;\n\t\t\t \n\t\t\tdefault:\n\t\t\t console.log(e.which);\n\t\t\t \n\t\t\t //yeah, I know, but it looks better when it's here\n\t\t\t break;\n\t\t \n\t\t \n\t\t\t}\n\t\t //console.log(['done...',state.data,state.node[0]]);\n\t\t //reapply all. damn slow \n\t\t for(var i in state.data){\n\t\t\t$t.attr('data-'+i,state.data[i]);\n\t\t\t}\n\t\t\t\n\t\t window['--drawSlideGlobalHandler'](state.node[0],'whatever')\n\t\t\t\n\t\t }\n\t}", "function flip(mark) {\n if (mark ==\"X\")\n return 'O';\n return 'X';\n}", "checkCheatNotes() {\n let cheatKey = true\n let cheatTouch = true\n for (let posIdx = 1; posIdx <= this.noteToShow; posIdx++) {\n cheatKey = cheatKey && this.key.isDownVisually(this.key.pos[posIdx])\n }\n for (let posIdx = 1; posIdx <= this.noteToShow; posIdx++) {\n cheatTouch = cheatTouch && this.touch.isDownVisually(this.touch.pos[posIdx])\n }\n\n return cheatKey || cheatTouch\n }", "function palmPosition(hand, index) {\n if (!isLocked) {\n lateralTracking(hand.palmPosition[0]);\n }\n // console.log(hand);\n }", "noteOff() {\n this.keyRect.fill(this.displayOptions.color);\n grid.highlightPitch(this.pitch, false, this.displayOptions);\n audio.noteOff(this.pitch)\n }", "invertDirectionRandom() {\n let hasInverted = false;\n if (Math.random() < 0.5) {\n let temp = this.deltaY;\n this.deltaY = this.deltaX;\n this.deltaX = temp;\n hasInverted = true;\n }\n if (Math.random() < 0.5) {\n this.deltaX = -this.deltaX;\n hasInverted = true;\n }\n if (Math.random() < 0.5) {\n this.deltaY = -this.deltaY;\n hasInverted = true;\n }\n if (!hasInverted) {\n this.invertDirection();\n }\n this.updateHitboxes();\n }", "function onSnake(position){\n for (var i = 0; i < snake.length; ++i){ //Iterates through the snake\n if (position.x == snake[i].x && position.y == snake[i].y) { //if position of x & y is the same as the position of the snake x and y\n return true;\n }\n }\n return false; //Default false\n}", "function trash_down(trashy) {\n //trashy handles the movement of elements with the CSS atrributes\n var trash_current_top = parseInt(trashy.css('top'));\n var trash_current_bottom = parseInt(trashy.css('bottom'));\n var trash_current_left = parseInt(trashy.css('left'));\n var rb_area_height = parseInt(rb_area.height());\n var trash_in = rb_area_height-(rb_area_height*0.4); //.4 of the trash is inside the RB\n var trash_away = rb_area_height-(rb_area_height*0.7);//.7 of the trash is inside the RB\n \n setGameDimension();\n \n if(ft){ //sets the position of the first trash, \n var new_lane_pos = 0;\n var first_trash=Math.floor(Math.random() * max_lane);\n new_lane_pos = recycle_bins_container.dumpsters[first_trash].rb_coordinates;\n laneTracker = first_trash;\n trashy.css('left', new_lane_pos);\n ft=false;\n }\n \n \n //document.getElementById(\"myoutput\").innerHTML = \"GW: \"+ container_width + \" RB1:<i>\"+recycle_bins_container.dumpsters[0].rb_coordinates + \"</i> RB2:<i>\"+recycle_bins_container.dumpsters[1].rb_coordinates + \"</i> RB3:<i>\"+recycle_bins_container.dumpsters[2].rb_coordinates + \"</i> RB4:<i>\"+recycle_bins_container.dumpsters[3].rb_coordinates+\"</i>\";\n //document.getElementById(\"myoutput2\").innerHTML = \"L: \"+ trash_current_left + \" Speed: \"+speed +\" CL: \"+laneTracker+\" RBH: \"+rb_area_height +\" RBW:\"+ $(\"#image-rb-1\").width() +\" B: \"+ trash_current_bottom +\" T: \"+ trash_current_top;\n \n //635 this is near the RB \n if (parseInt(trashy.css('top'))>=container_height){ \n speed = 1;\n trash_info_status = true; //now it needs change because it has reached the RB... //I think I don't need this\n } \n if (trash_current_bottom <= trash_in && my_collision == false) {\n //trash bottom possition vs Recycle Bins Heights \n //once this validation has been done, then it won't be possible to move the trash! #todo\n my_collision = true;\n collision();\n\n }\n if (trash_current_bottom <= trash_away) {\n trash_current_top = -100;\n my_collision = false;\n trashy.css('left', newLane());//here is where the new Y position is being defined...\n nextTrash(); //sets the next current trash values\n }\n trashy.css('top', trash_current_top + speed); //this is what moves trash down.:\n }", "function C012_AfterClass_Jennifer_TestLove() {\n\tif (!ActorIsGagged()) {\n\t\tif (!ActorIsRestrained() && !Common_PlayerRestrained) {\n\t\t\tif (!Common_PlayerNaked && (ActorGetValue(ActorCloth) != \"Naked\")) {\n\t\t\t\tif (ActorGetValue(ActorLove) >= 20) {\n\t\t\t\t\tActorSetPose(\"\");\n\t\t\t\t\tC012_AfterClass_Jennifer_CurrentStage = 100;\n\t\t\t\t\tOverridenIntroText = \"\";\n\t\t\t\t}\n\t\t\t} else OverridenIntroText = GetText(\"CantDateWhileNaked\");\n\t\t} else OverridenIntroText = GetText(\"CantDateWhileRestrained\");\n\t} else C012_AfterClass_Jennifer_GaggedAnswer();\n}", "moveDown() {\n this.y<332?this.y+=83:false;\n }", "function checkPosition() {\n // Für Ameise Schwarz\n for (let i = 0; i < Sem.ant.length; i++) {\n let a = Sem.ant[i];\n // Wenn Ameisen Position auf X - Achse zwischen 567 & 750 \n if (a.x >= 567 && a.x <= 750) {\n // Wenn Ameisen Position auf Y - Achse zwischen 245 & 429\n if (a.y >= 245 && a.y <= 429) {\n // Ruft Funktion für Game Over Screen auf\n gameLost();\n }\n }\n }\n // Für Ameise Braun\n for (let i = 0; i < Sem.antBrown.length; i++) {\n let b = Sem.antBrown[i];\n // Wenn Ameisen Position auf X - Achse zwischen 567 & 750\n if (b.x >= 567 && b.x <= 750) {\n // Wenn Ameisen Position auf Y - Achse zwischen 245 & 429\n if (b.y >= 245 && b.y <= 429) {\n // Ruft Funktion für Game Over Screen auf\n gameLost();\n }\n }\n }\n // Für Ameise Rot\n for (let i = 0; i < Sem.antRed.length; i++) {\n let r = Sem.antRed[i];\n // Wenn Ameisen Position auf X - Achse zwischen 567 & 750\n if (r.x >= 567 && r.x <= 750) {\n // Wenn Ameisen Position auf Y - Achse zwischen 245 & 429\n if (r.y >= 245 && r.y <= 429) {\n // Ruft Funktion für Game Over Screen auf\n gameLost();\n }\n }\n }\n }", "function checkPosition(){\n if (i > (data.omicron.length - 1)) {\n i = 0;\n } else if (i < 0) {\n i = (data.omicron.length - 1);\n }\n }", "function inPosA1() {\n\t//TWO LANE ROAD, POSITION A1\n\tif(coordOpt2 == 0 && coordOpt3 == 0){\n\t\trandomNum = Random.value * 10;\n\t\tif(targetDirF == true && randomNum <= 3){\n\t\t\t//do nothing, go forward\n\t\t\tcalculatingMove = false;\n\t\t}else if(targetDirL == true && randomNum > 3 && randomNum <= 6){\n\t\t\t//turn left\n\t\t\ttransform.GetComponent(aiStates).leftCoord = targetTurnL;\n\t\t\ttransform.GetComponent(aiStates).leftState = true;\n\t\t}else if(targetDirR == true && randomNum > 6){\n\t\t\t//turn right\n\t\t\tif(targetTurnR2 == 0){\n\t\t\t\ttransform.GetComponent(aiStates).rightCoord = targetTurnR1;\n\t\t\t\ttransform.GetComponent(aiStates).rightState = true;\n\t\t\t}else{\n\t\t\t\ttransform.GetComponent(aiStates).rightCoord = targetTurnR2;\n\t\t\t\ttransform.GetComponent(aiStates).rightState = true;\n\t\t\t}\n\t\t}else{\n\t\t\t//if none of the above, take first available option\n\t\t\tif(targetDirF == true){\n\t\t\t\t//do nothing, go forward\n\t\t\t\tcalculatingMove = false;\n\t\t\t}else if(targetDirL == true){\n\t\t\t\t//turn left\n\t\t\t\ttransform.GetComponent(aiStates).leftCoord = targetTurnL;\n\t\t\t\ttransform.GetComponent(aiStates).leftState = true;\n\t\t\t}else if(targetDirR == true){\n\t\t\t\t//turn right\n\t\t\t\tif(targetTurnR2 == 0){\n\t\t\t\t\ttransform.GetComponent(aiStates).rightCoord = targetTurnR1;\n\t\t\t\t\ttransform.GetComponent(aiStates).rightState = true;\n\t\t\t\t}else{\n\t\t\t\t\ttransform.GetComponent(aiStates).rightCoord = targetTurnR2;\n\t\t\t\t\ttransform.GetComponent(aiStates).rightState = true;\n\t\t\t\t}\n\t\t\t}else{\n\t\t\t\tDebug.Log(\"Error with turn selection 2ln road\");\n\t\t\t\ttransform.GetComponent(aiStates).startAgain = true;\n\t\t\t}\n\t\t}\n\t\t\n\t//THREE LANE ROAD, POSITION A1\n\t}else if(coordOpt2 == 0 && coordOpt3 != 0){\n\t\trandomNum = Random.value * 10;\n\t\tif(targetDirF == true && randomNum < 6){\n\t\t\t//do nothing, go forward\n\t\t\tcalculatingMove = false;\n\t\t}else if(targetDirR == true){\n\t\t\t//turn right\n\t\t\tif(targetTurnR2 == 0){\n\t\t\t\ttransform.GetComponent(aiStates).rightCoord = targetTurnR1;\n\t\t\t\ttransform.GetComponent(aiStates).rightState = true;\n\t\t\t}else{\n\t\t\t\ttransform.GetComponent(aiStates).rightCoord = targetTurnR2;\n\t\t\t\ttransform.GetComponent(aiStates).rightState = true;\n\t\t\t}\n\t\t}else{\n\t\t\tif(targetDirF == true){\n\t\t\t\t//do nothing, go forward\n\t\t\t\tcalculatingMove = false;\n\t\t\t}else if(targetDirR == true){\n\t\t\t\t//turn right\n\t\t\t\tif(targetTurnR2 == 0){\n\t\t\t\t\ttransform.GetComponent(aiStates).rightCoord = targetTurnR1;\n\t\t\t\t\ttransform.GetComponent(aiStates).rightState = true;\n\t\t\t\t}else{\n\t\t\t\t\ttransform.GetComponent(aiStates).rightCoord = targetTurnR2;\n\t\t\t\t\ttransform.GetComponent(aiStates).rightState = true;\n\t\t\t\t}\n\t\t\t}else{\n\t\t\t\tDebug.Log(\"Error with turn selection 3ln road\");\n\t\t\t\ttransform.GetComponent(aiStates).startAgain = true;\n\t\t\t}\n\t\t}\n\t\n\t//FOUR LANE ROAD, POSITION A1\n\t}else if(coordOpt3 == 0 && coordOpt2 != 0){\n\t\trandomNum = Random.value * 10;\n\t\tif(targetDirF == true && randomNum > 6){\n\t\t\t//do nothing, go forward\n\t\t\tcalculatingMove = false;\n\t\t}else if(targetDirL == true){\n\t\t\t//turn left\n\t\t\ttransform.GetComponent(aiStates).leftCoord = targetTurnL;\n\t\t\ttransform.GetComponent(aiStates).leftState = true;\n\t\t}else{\n\t\t\tif(targetDirF == true){\n\t\t\t\t//do nothing, go forward\n\t\t\t\tcalculatingMove = false;\n\t\t\t}else if(targetDirL == true){\n\t\t\t\t//turn left\n\t\t\t\ttransform.GetComponent(aiStates).leftCoord = targetTurnL;\n\t\t\t\ttransform.GetComponent(aiStates).leftState = true;\n\t\t\t}else{\n\t\t\t\tDebug.Log(\"Error with turn selection 4ln road\");\n\t\t\t\ttransform.GetComponent(aiStates).startAgain = true;\n\t\t\t}\n\t\t}\n\t\t\t\t\n\t//FIVE LANE ROAD, POSITION A1\n\t}else if(coordOpt2 != 0 && coordOpt3 != 0){\n\t\t//5ln road\n\t\t//MUST GO FORWARD\n\t\tcalculatingMove = false;\n\t\tif(targetDirF == false){\n\t\t\ttransform.GetComponent(aiStates).startAgain = true;\n\t\t}\n\t}\n}", "rotateBasedOnPositionOfLetter( letter, oppositeDay ) {\n var index = this.positionOfLetter( this.target, letter );\n\n if (oppositeDay) {\n // rotate back left based on where the letter used to be. how?\n if (index === 0) {\n index = 1;\n } else if (index === 1) {\n index = 1;\n } else {\n index = 4;\n }\n this.rotateSteps(\"left\", index );\n\n } else {\n if (index >= 4) {\n index++;\n }\n index++;\n this.rotateSteps(\"right\", index );\n }\n }", "function C012_AfterClass_Amanda_TestPunish() {\n\n\t// The more love, the less chances the player will be punished\n\tif (EventRandomChance(\"Love\")) {\n\t\tC012_AfterClass_Amanda_CheckNotes();\n\t} else {\n\t\tActorSetPose(\"Angry\");\n\t\tOverridenIntroText = \"\";\n\t\tC012_AfterClass_Amanda_CurrentStage = 3900;\n\t}\n\n}", "moveCheck(direction, originalLocation) {\n const { dispatch } = this.props;\n let newLocationId;\n let newLocation;\n if(direction == \"north\") {\n newLocationId = originalLocation - 1;\n newLocation = this.props.currentLevel[newLocationId];\n if(newLocationId >= 0 && newLocation.value !== 'W') {\n return newLocationId;\n } else if (newLocation.isEnemy !== '' || newLocation.isProjectile || newLocation.value === 'L') {\n let knockBackDirection = this.reverseDirection(direction);\n dispatch(actions.knockBack(originalLocation, knockBackDirection));\n return false;\n } else {\n return false;\n }\n } else if (direction == \"east\") {\n newLocationId = originalLocation + 10;\n newLocation = this.props.currentLevel[newLocationId];\n if(newLocationId <= 100 && newLocation.value !== 'W') {\n return newLocationId;\n } else if (newLocation.isEnemy !== '' || newLocation.isProjectile || newLocation.value === 'L') {\n let knockBackDirection = this.reverseDirection(direction);\n dispatch(actions.knockBack(originalLocation, knockBackDirection));\n return false;\n } else {\n return false;\n }\n } else if (direction == \"south\") {\n newLocationId = originalLocation + 1;\n newLocation = this.props.currentLevel[newLocationId];\n if(newLocationId > 0 && newLocationId <= 100 && originalLocation % 10 !== 0 && newLocation.value !== 'W') {\n return newLocationId;\n } else if (newLocation.isEnemy !== '' || newLocation.isProjectile || newLocation.value === 'L') {\n let knockBackDirection = this.reverseDirection(direction);\n dispatch(actions.knockBack(originalLocation, knockBackDirection));\n return false;\n } else {\n return false;\n }\n } else if (direction == \"west\") {\n newLocationId = originalLocation - 10;\n newLocation = this.props.currentLevel[newLocationId];\n if(newLocationId >= 0 && newLocation.value !== 'W') {\n return newLocationId;\n } else if (newLocation.isEnemy !== '' || newLocation.isProjectile || newLocation.value === 'L') {\n let knockBackDirection = this.reverseDirection(direction);\n dispatch(actions.knockBack(originalLocation, knockBackDirection));\n return false;\n } else {\n return false;\n }\n }\n }", "function change_direction(){\n\tvar lastx = snake_array[snake_array.length-1].x;\n\tvar lasty = snake_array[snake_array.length-1].y;\n\tsnake_array[0] = {x: lastx, y: lasty, color: \"black\"};\n\tvar tail = snake_array.shift();\n\tif(d === \"left\"){\n\t\tsnake_array.push(tail);\n\t\tsnake_array[snake_array.length-1].x--;\n\t}\n\telse if(d === \"right\"){\n\t\tsnake_array.push(tail);\n\t\tsnake_array[snake_array.length-1].x++;\n\t}\n\telse if(d === \"up\"){\n\t\tsnake_array.push(tail);\n\t\tsnake_array[snake_array.length-1].y--;\n\t}\n\telse if(d === \"down\"){\n\t\tsnake_array.push(tail);\n\t\tsnake_array[snake_array.length-1].y++;\n\t}\n\thitItself(snake_array[snake_array.length-1]);\n\thitTheWall(snake_array[snake_array.length-1]);\n\tpaint_snake();\n\teat();\n\t// console.log(snake_array[snake_array.length - 1]);\n\n}", "function rePosition(){\r\n piece.pos.y = 0; // this and next line puts the next piece at the top centered\r\n piece.pos.x = ( (arena[0].length / 2) | 0) - ( (piece.matrix[0].length / 2) | 0);\r\n }", "if (move.endsWith(\"'\")) {\n // three turns\n completedRotation = -NINETY_DEGREES;\n }", "returnToLastPos() {\n if (this.previousPos) {\n this.x = this.previousPos.x\n this.y = this.previousPos.y\n }\n }", "returnFromRight() {\r\n this.fltire.rotateY(16);\r\n this.frtire.rotateY(16);\r\n }", "moveRight() {\n\n if (this.posX <= 670 && pause == false)\n this.posX = this.posX + 5;\n }", "function checkIfEatenR() {\n // Thanks Jeremy.\n //paintFood(Math.random()*300,Math.random()*300,\"blue\")\n // This works: moveRight() == paintFood(235,10,\"blue\")\n //moveRight == paintFood(235,10,\"blue\")\n \n if ( moveRight() == paintFood(235,10) ){\n console.log(\"Food updated.\")\n updateFood();\n console.log(\"Next food.\");\n nextFood();\n }\n}", "function updateSnakeMovement() {\n let newPos = {x: snake.history[0].x, y: snake.history[0].y};\n toBeClearedFields.push(snake.history.pop());\n if (command !== null) {\n switch (command) {\n case \"LEFT\":\n newPos.x--;\n break;\n case \"UP\":\n newPos.y--;\n break;\n case \"RIGHT\":\n newPos.x++;\n break;\n case \"DOWN\":\n newPos.y++;\n break;\n }\n }\n snake.history.unshift(newPos);\n }", "function decideSlideBead(beadSpot){ \n let x;\n spot = beadChecker(\"left\", \"left\");\n if (beadSpot === spot && canClick){\n moveBead(\"right\"); \n } else {\n spot= beadChecker(\"right\", \"right\"); \n if (beadSpot === spot && canClick){\n moveBead(\"left\"); \n }\n }\n}", "resetState() {\n this._movements = 0;\n }", "function stare() {\n\t\ttry {\n\t\t\tmoveEye(\".tally_eye_left\", \"stare\");\n\t\t\tmoveEye(\".tally_eye_right\", \"stare\");\n\t\t\tsetTimeout(function() {\n\t\t\t\tfollowCursor = true;\n\t\t\t}, 400);\n\t\t} catch (err) {\n\t\t\tconsole.error(err);\n\t\t}\n\t}", "offscreen() {\n if (this.xpos < -this.width) {\n return true;\n } else {\n return false;\n }\n }", "upgradePionToDameAdverse(posRow, colorPion, tailleDamier){\n let dame = false;\n if(colorPion == this.couleurJoueur){\n if(posRow == 0){\n dame = true;\n }\n } else {\n if(posRow+1 == tailleDamier){\n dame = true;\n }\n }\n return dame;\n }", "reverseFinished() {\n return (this.y < height / 2 + 0.5 && this.y > height / 2 - 0.5) || (this.x < width / 2 + 0.5 && this.x > width / 2 - 0.5)\n }", "function MoveNoteDown(noteIndex) {\n if (noteIndex > stateVars.itemArray.length - 2) {\n return;\n }\n\n var newNoteArray = [];\n if (stateVars.itemArray != null) {\n newNoteArray = stateVars.itemArray;\n }\n\n var placeholder = newNoteArray[noteIndex + 1];\n newNoteArray[noteIndex + 1] = newNoteArray[noteIndex];\n newNoteArray[noteIndex] = placeholder;\n\n setStateVars((prevState) => {\n return ({\n ...prevState,\n noteArray: newNoteArray,\n promptNewNote: false,\n editNoteIndex: noteIndex + 1,\n requireUpdate: true\n });\n });\n }", "function MoveDown()\n{\n mrRat.direction = 'down';\n\n if (gameData[mrRat.y + 1][mrRat.x] >= 10)\n {\n //The rat eats a cheese\n if (gameData[mrRat.y + 1][mrRat.x] === 12) {\n EatsCheese(false);\n }\n\n //The rats eats a random cheese\n if (gameData[mrRat.y + 1][mrRat.x] === 15) {\n EatsCheese(true);\n }\n\n //The rat hits the rat poison or rat trap\n if (gameData[mrRat.y + 1][mrRat.x] === 16 || gameData[mrRat.y + 1][mrRat.x] === 13) {\n TheRatDied();\n }\n\n gameData[mrRat.y][mrRat.x] = _GROUND;\n mrRat.y = mrRat.y + 1;\n gameData[mrRat.y][mrRat.x] = _RAT;\n\n //MrRat has reached the gool\n if (mrRat.x == 18 && mrRat.y == 14) {\n Goal();\n return;\n }\n\n DeleteMap();\n DrawMap();\n }\n}", "posZahtMet()\n {\n this.posZah=!this.posZah;\n }", "async reverse() {\n this.tl.pause();\n this.angle = 100;\n this._playShieldBounceSound();\n\n await gsap.to(this, {\n x: -50,\n y: 'random(-50,50)',\n duration: 1,\n });\n }", "Smotion(desloc)\n\t{\n\t\t// If the key A is pressed then moves the vehicle backward and turn left\n\t\tif (this.keysdirectionPress[0]){\n\t\t\tthis.angleDirection -= desloc/5;\n\t\t\tthis.position[2] -= desloc*Math.cos(this.angleDirection);\n\t\t\tthis.position[0] += desloc*Math.sin(this.angleDirection);\n\n\t\t\t// If the next position is out of limits or has altimetry other than 0 then revert the movement\n\t\t\tif ( ! this.checkNextPosition(this.position[0],this.position[2])){\n\t\t\t\tthis.angleDirection += desloc/5;\n\t\t\t\tthis.position[2] += desloc*Math.cos(this.angleDirection);\n\t\t\t\tthis.position[0] -= desloc*Math.sin(this.angleDirection);\n\t\t\t}\n\t\t\tthis.frontLeftWheel.update(desloc,5);\n\t\t\tthis.frontRightWheel.update(-desloc,5);\n\t\t\tthis.backLeftWheel.update(desloc,0);\n\t\t\tthis.backRightWheel.update(-desloc,0);\n\t\t} else \n\t\t\t// If the key D is pressed then moves the vehicle backward and turn rigth\n\t\t\tif (this.keysdirectionPress[1]){\n\t\t\t\tthis.angleDirection += desloc/5;\n\t\t\t\tthis.position[2] -= desloc*Math.cos(this.angleDirection);\n\t\t\t\tthis.position[0] += desloc*Math.sin(this.angleDirection);\n\n\t\t\t\t// If the next position is out of limits or has altimetry other than 0 then revert the movement\n\t\t\t\tif ( ! this.checkNextPosition(this.position[0],this.position[2])){\n\t\t\t\t\tthis.angleDirection -= desloc/5;\n\t\t\t\t\tthis.position[2] += desloc*Math.cos(this.angleDirection);\n\t\t\t\t\tthis.position[0] -= desloc*Math.sin(this.angleDirection);\n\t\t\t\t}\n\t\t\t\tthis.frontLeftWheel.update(desloc,-5);\n\t\t\t\tthis.frontRightWheel.update(-desloc,-5);\n\t\t\t\tthis.backLeftWheel.update(desloc,0);\n\t\t\t\tthis.backRightWheel.update(-desloc,0);\n\t\t\t}\n\n\t\t// If only key W is pressed then moves the vehicle backward straight\n\t\tif ( !(this.keysdirectionPress[0] || this.keysdirectionPress[1]) ){\n\t\t\tthis.position[2] -= desloc*Math.cos(this.angleDirection);\n\t\t\tthis.position[0] += desloc*Math.sin(this.angleDirection);\n\n\t\t\t// If the next position is out of limits or has altimetry other than 0 then revert the movement\n\t\t\tif ( ! this.checkNextPosition(this.position[0],this.position[2])){\n\t\t\t\tthis.position[2] += desloc*Math.cos(this.angleDirection);\n\t\t\t\tthis.position[0] -= desloc*Math.sin(this.angleDirection);\n\t\t\t}\n\t\t\tthis.frontLeftWheel.update(desloc,0);\n\t\t\tthis.frontRightWheel.update(-desloc,0);\n\t\t\tthis.backLeftWheel.update(desloc,0);\n\t\t\tthis.backRightWheel.update(-desloc,0);\n\t\t}\n\t}", "function test21() {\n reset();\n e = {key: 'z', preventDefault: function() {}}\n downkey(e)\n let swapCurr = copyPiece(currentPiece)\n let swapHeld = copyPiece(heldPiece)\n downkey(e)\n return currentPiece.equals(swapCurr) && heldPiece.equals(swapHeld);\n}", "static MoveTowards() {}", "hasStarted () {\r\n return Boolean(this._pastPos[this._pastPos.length-1])\r\n }", "get true_position() { return this.position.copy().rotateX(Ribbon.LATITUDE).rotateZ(Earth.rotation).rotateZ(Ribbon.LONGITUDE); }", "function movementLogic(ant) {\n if(grid[ant.x][ant.y] == 0) {\n ant.turnRight();\n grid[ant.x][ant.y] = 1;\n } else if (grid[ant.x][ant.y] == 1) {\n ant.turnLeft();\n grid[ant.x][ant.y] = 0;\n }\n stroke(color(255 * grid[ant.x][ant.y]));\n ant.moveForward();\n point(ant.x ,ant.y);\n}", "function answer(e) {\n clearInterval(counter);\n let y = e.path[1];\n let x = parseInt(e.path[1].dataset.num);\n if (x === currentQuote) {\n correct(y);\n } else {\n wrong(y);\n }\n }", "function moveRight() {\n undraw()\n const reachedRightEdge = curT.some(index => (curPos + index) % width === width - 1)\n if (!reachedRightEdge) curPos += 1\n if (curT.some(index => squares[curPos + index].classList.contains('taken'))) {\n // if the position has been taken by another figure, push the tetromino back\n curPos -= 1 \n }\n draw()\n }", "noteOff(pitch) {\n this.keys[pitch].noteOff()\n }", "function frame() {\n console.log(\"zaim\");\n if (pos == z) {\n clearInterval(id);\n } else {\n pos--; \n //elem.style.top = pos + 'px'; \n elemt.style.left = pos+\"px\"; \n x=pos;\n //console.log(`avancer pos ${tos}`);\n }\n }", "function test20() {\n reset();\n let origCurr = copyPiece(currentPiece)\n heldPiece = getRandomPiece()\n let origHeld = copyPiece(heldPiece)\n e = {key: 'z', preventDefault: function() {}}\n downkey(e)\n return heldPiece.equals(origCurr) && currentPiece.equals(origHeld)\n}", "handleToggle(type, cursorToEnd, oldState) {\n const { noteTracker, tr, markType } = this;\n const { $cursor, from, to } = tr.selection;\n\n if ($cursor) {\n const note = this.currentNote;\n if (note) {\n const { start, end } = note;\n return this.removeRanges([{ from: start, to: end }]);\n } else if (this.hasPlaceholder(oldState)) {\n return tr.removeStoredMark(markType);\n }\n return this.startNote(type);\n } else {\n const note = noteTracker.noteCoveringRange(from, to, true);\n if (note) {\n const { start, end, meta } = note;\n\n const notes = [];\n notes.push({\n from: start,\n to: from,\n meta: cloneDeep(meta),\n });\n\n // If this is a not of a different type then split add it in\n // the middle\n if (note.meta.type && note.meta.type !== type) {\n notes.push({\n from,\n to,\n meta: {\n type,\n },\n });\n }\n\n notes.push({\n from: to,\n to: end,\n meta: cloneDeep(meta),\n });\n\n return this.rebuildRange(\n {\n from: start,\n to: end,\n },\n notes\n );\n }\n return this.addNotes([{ from, to, meta: { type } }], cursorToEnd);\n }\n }", "move(predicate) {\n //console.log(predicate);\n const moveBy = this.moveMap[this.state.heading];\n // console.log(moveBy);\n const nextPos = { x: this.state.pos.x, y: this.state.pos.y };\n //console.log(nextPos);\n // Set next position\n nextPos[moveBy.plane] += moveBy.amount;\n\n // Check if move is legal\n const isLegal = predicate(nextPos);\n\n if (isLegal) {\n this.state.pos = nextPos;\n }\n }", "function toggleState (state) {\n scope.ytModel.open = state\n scope.ytModel.active = true\n return scope.ytModel.moveX = state ? boundary : 0\n }", "function moveRight()\r\n {\r\n undraw()\r\n const isAtRightEdge = currentTetromino.some(index => (currentPosition + index) % 10 === 9)\r\n\r\n if(!isAtRightEdge)\r\n currentPosition +=1\r\n if(currentTetromino.some(index => squares[currentPosition + index].classList.contains('taken')))\r\n currentPosition -= 1\r\n draw()\r\n }", "function swapDown(state) {\n let blankPOS = findBlankCell(state)\n return swap(state, { y: blankPOS.y + 1, x: blankPOS.x })\n}", "function encloseLeftState(){\n if(shipY < 0){\n shipY = 0;\n }\n if(shipY > height - 50){\n shipY = height - 50;\n }\n if(shipX < 0){\n shipX = 0;\n }\n}", "lookAt(target) {\n let orientation = (target.x - this.x < 0) ? 'left' : 'right';\n this.setOrientation(orientation);\n }", "function changeDirection(e) {\n if (e.keyCode == 37) {\n direction = 0;\n console.log(\"direction is left:\" + direction);\n updateSnakeList();\n } else if (e.keyCode == 38) {\n direction = 1;\n console.log(\"direction is up:\" + direction)\n } else if (e.keyCode == 39) {\n direction = 2;\n console.log(\"direction is right :\" + direction)\n } else if (e.keyCode == 40) {\n direction = 3;\n console.log(\"direction is down :\" + direction)\n }\n }" ]
[ "0.5747144", "0.55379176", "0.55339026", "0.54902875", "0.54773253", "0.54693604", "0.5463387", "0.5449033", "0.54478693", "0.53943497", "0.5390149", "0.5382457", "0.5367056", "0.5353433", "0.53518414", "0.53282654", "0.53261423", "0.5319799", "0.5306259", "0.5305748", "0.52875155", "0.5286165", "0.52837783", "0.5275026", "0.52733016", "0.5268174", "0.526177", "0.525922", "0.5254313", "0.5248475", "0.52469075", "0.52418053", "0.52103424", "0.5184941", "0.51804894", "0.51761764", "0.5174548", "0.51647425", "0.51303947", "0.5128262", "0.51270795", "0.5122117", "0.5121537", "0.5119905", "0.51164645", "0.5109902", "0.50918025", "0.509092", "0.5087641", "0.50792366", "0.5078407", "0.5072986", "0.50632167", "0.50609475", "0.50493586", "0.5048017", "0.50474924", "0.5041004", "0.5034936", "0.5032151", "0.50278157", "0.50269586", "0.50239575", "0.50207615", "0.50155824", "0.50151163", "0.501479", "0.50132555", "0.5002544", "0.5001513", "0.4998847", "0.4997094", "0.49882665", "0.49850178", "0.49820077", "0.49814463", "0.49796802", "0.49757335", "0.49738544", "0.49728665", "0.49683106", "0.49570513", "0.49540034", "0.49539778", "0.49491397", "0.49467856", "0.4938097", "0.49362886", "0.49349728", "0.4934565", "0.49329442", "0.4932399", "0.49281734", "0.49267942", "0.4922213", "0.4919026" ]
0.49256462
97
Parse the bound file.
function parse() { var self = this; var value = String(self.file); var start = {line: 1, column: 1, offset: 0}; var content = xtend(start); var node; /* Clean non-unix newlines: `\r\n` and `\r` are all * changed to `\n`. This should not affect positional * information. */ value = value.replace(EXPRESSION_LINE_BREAKS, C_NEWLINE); if (value.charCodeAt(0) === 0xFEFF) { value = value.slice(1); content.column++; content.offset++; } node = { type: 'root', children: self.tokenizeBlock(value, content), position: { start: start, end: self.eof || xtend(start) } }; if (!self.options.position) { removePosition(node, true); } return node; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function parse(fileName) {\n\n var baseDir = path.dirname(fileName);\n\n var jsonData = parseFile(fileName);\n if (!jsonData) {\n return null;\n }\n\n jsonData = replace(baseDir, jsonData, 'segment');\n if (!jsonData) {\n return null;\n }\n\n\n if (jsonData.hasOwnProperty('segment')) {\n if (!Array.isArray(jsonData.segment)) {\n console.error('segment must be array');\n return null;\n }\n for (var i = 0; i < jsonData.segment.length; i++) {\n\n var segment = jsonData.segment[i];\n segment = replace(baseDir, segment, 'host');\n if (!segment) {\n return null;\n }\n segment = replace(baseDir, segment, 'gateway');\n if (!segment) {\n return null;\n }\n jsonData.segment[i] = segment;\n }\n }\n\n jsonData = replace(baseDir, jsonData, 'event');\n\n //console.log(JSON.stringify(jsonData));\n return jsonData;\n}", "function BinaryParser() {}", "function BinaryParser() {}", "function BinaryParser() {}", "function BinaryParser() {}", "function BinaryParser() {}", "function parse(file) {\n let names = [];\n let parts = file.split(':');\n parts[0].split('\\n').forEach(function(line) {\n if (line !== '') {\n names.push(line.split(',')[0]);\n }\n });\n let n = -1;\n parts[1].split('\\n').forEach(function(line) {\n if (n >= 0) {\n data[names[n]] = line;\n }\n n++;\n });\n}", "function parse( file ) {\n\t\treturn __awaiter( this, void 0, void 0, function () {\n\t\t\treturn __generator( this, function ( _a ) {\n\t\t\t\treturn [\n\t\t\t\t\t2,\n\t\t\t\t\t/*return*/\n\t\t\t\t\tnew Promise( function ( resolve, reject ) {\n\t\t\t\t\t\tfs.readFile( file, 'utf8', function ( err, data ) {\n\t\t\t\t\t\t\tif ( err ) {\n\t\t\t\t\t\t\t\treject( err );\n\t\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\tresolve( parseString( data ) );\n\t\t\t\t\t\t} );\n\t\t\t\t\t} ),\n\t\t\t\t];\n\t\t\t} );\n\t\t} );\n\t}", "function BinaryParser() { }", "function parseFile(event) {\n Papa.parse(event.target.files[0], {\n complete: function (results) {\n console.log(results.data)\n setParse(results.data);\n setIsReady(true)\n }\n })\n }", "function parseRawTagData() {\n\n\t// Pre-populate the `generators.all` store with\n\t// all of the generator names, so that they can\n\t// be referenced.\n\t_.each( rawTagData, function( gen, path ) {\n\t\tlet name = getGeneratorNameFromPath( path );\n\t\tgenerators.all[ name ] = null;\n\t});\n\n\t// Iterate over each file and its Dox data\n\t_.each( rawTagData, function( gen, path ) {\n\n\t\t// Resolve a name for the generator\n\t\tlet name = getGeneratorNameFromPath( path );\n\n\t\t// Initialize a generator info object\n\t\tlet item = {\n\t\t\tname: name,\n\t\t\ttype: \"partial\",\n\t\t\tisDefault: false,\n\t\t\tdescription: gen.description,\n\t\t\tauthor: null,\n\t\t\tcreated: null,\n\t\t\tpaths: {\n\t\t\t\tabs: path,\n\t\t\t\trel: getRelativeGeneratorPath( path )\n\t\t\t},\n\t\t\tuses: {},\n\t\t\tcreates: {},\n\t\t\toperations: [],\n\t\t\tpromptsFor: {},\n\t\t\texample: null\n\t\t};\n\n\t\t// Parse each tag object generated by Dox\n\t\t_.each( gen.doxData, function( tag ) {\n\t\t\tparseOneTag( item, tag );\n\t\t});\n\n\t\t// Persist the generator info object\n\t\tgenerators.all[ name ] = item;\n\t\tgenerators[ item.type ][ name ] = item;\n\n\t});\n\n}", "function parse(file) {\n return __awaiter(this, void 0, void 0, function () {\n return __generator(this, function (_a) {\n return [2\n /*return*/\n , new Promise(function (resolve, reject) {\n fs.readFile(file, 'utf8', function (err, data) {\n if (err) {\n reject(err);\n return;\n }\n\n resolve(parseString(data));\n });\n })];\n });\n });\n }", "parse() {\n /**\n * The first two bytes are a bitmask which states which features are present in the mapFile\n * The second two bytes are.. something?\n */\n const featureFlags = this.take(2, \"featureFlags\").readUInt16LE(0);\n this.take(2, \"unknown01\");\n if (featureFlags & 0b000000000000001) {\n this.robotStatus = this.take(0x2C, \"robot status\");\n }\n\n\n if (featureFlags & 0b000000000000010) {\n this.mapHead = this.take(0x28, \"map head\");\n this.parseImg();\n }\n if (featureFlags & 0b000000000000100) {\n let head = asInts(this.take(12, \"history\"));\n this.history = [];\n for (let i = 0; i < head[2]; i++) {\n // Convert from ±meters to mm. UI assumes center is at 20m\n let position = this.readFloatPosition(this.buf, this.offset + 1);\n // first byte may be angle or whether robot is in taxi mode/cleaning\n //position.push(this.buf.readUInt8(this.offset)); //TODO\n this.history.push(position[0], position[1]);\n this.offset += 9;\n }\n }\n if (featureFlags & 0b000000000001000) {\n // TODO: Figure out charge station location from this.\n let chargeStation = this.take(16, \"charge station\");\n this.chargeStation = {\n position: this.readFloatPosition(chargeStation, 4),\n orientation: chargeStation.readFloatLE(12)\n };\n }\n if (featureFlags & 0b000000000010000) {\n let head = asInts(this.take(12, \"virtual wall\"));\n\n this.virtual_wall = [];\n this.no_go_area = [];\n\n let wall_num = head[2];\n\n for (let i = 0; i < wall_num; i++) {\n this.take(12, \"virtual wall prefix\");\n let body = asFloat(this.take(32, \"Virtual walls coords\"));\n\n if (body[0] === body[2] && body[1] === body[3] && body[4] === body[6] && body[5] === body[7]) {\n //is wall\n let x1 = Math.round(ViomiMapParser.convertFloat(body[0]));\n let y1 = Math.round(ViomiMapParser.MAX_MAP_HEIGHT - ViomiMapParser.convertFloat(body[1]));\n let x2 = Math.round(ViomiMapParser.convertFloat(body[4]));\n let y2 = Math.round(ViomiMapParser.MAX_MAP_HEIGHT - ViomiMapParser.convertFloat(body[5]));\n\n this.virtual_wall.push([x1, y1, x2, y2]);\n } else {\n //is zone\n let x1 = Math.round(ViomiMapParser.convertFloat(body[0]));\n let y1 = Math.round(ViomiMapParser.MAX_MAP_HEIGHT - ViomiMapParser.convertFloat(body[1]));\n let x2 = Math.round(ViomiMapParser.convertFloat(body[2]));\n let y2 = Math.round(ViomiMapParser.MAX_MAP_HEIGHT - ViomiMapParser.convertFloat(body[3]));\n let x3 = Math.round(ViomiMapParser.convertFloat(body[4]));\n let y3 = Math.round(ViomiMapParser.MAX_MAP_HEIGHT - ViomiMapParser.convertFloat(body[5]));\n let x4 = Math.round(ViomiMapParser.convertFloat(body[6]));\n let y4 = Math.round(ViomiMapParser.MAX_MAP_HEIGHT - ViomiMapParser.convertFloat(body[7]));\n\n this.no_go_area.push([x1, y1, x2, y2, x3, y3, x4, y4]);\n }\n\n this.take(48, \"unknown48\");\n }\n }\n if (featureFlags & 0b000000000100000) {\n let head = asInts(this.take(12, \"area head\"));\n let area_num = head[2];\n\n this.clean_area = [];\n\n for (let i = 0; i < area_num; i++) {\n this.take(12, \"area prefix\");\n let body = asFloat(this.take(32, \"area coords\"));\n\n let x1 = Math.round(ViomiMapParser.convertFloat(body[0]));\n let y1 = Math.round(ViomiMapParser.MAX_MAP_HEIGHT - ViomiMapParser.convertFloat(body[1]));\n let x2 = Math.round(ViomiMapParser.convertFloat(body[2]));\n let y2 = Math.round(ViomiMapParser.MAX_MAP_HEIGHT - ViomiMapParser.convertFloat(body[3]));\n let x3 = Math.round(ViomiMapParser.convertFloat(body[4]));\n let y3 = Math.round(ViomiMapParser.MAX_MAP_HEIGHT - ViomiMapParser.convertFloat(body[5]));\n let x4 = Math.round(ViomiMapParser.convertFloat(body[6]));\n let y4 = Math.round(ViomiMapParser.MAX_MAP_HEIGHT - ViomiMapParser.convertFloat(body[7]));\n\n this.clean_area.push([x1, y1, x2, y2, x3, y3, x4, y4]);\n\n this.take(48, \"unknown48\");\n }\n }\n if (featureFlags & 0b000000001000000) {\n let navigateTarget = this.take(20, \"navigate\");\n this.navigateTarget = {position: this.readFloatPosition(navigateTarget, 8)};\n }\n if (featureFlags & 0b000000010000000) {\n let realtimePose = this.take(21, \"realtime\");\n this.realtimePose = {position: this.readFloatPosition(realtimePose, 9)};\n }\n\n if (featureFlags & 0b000100000000000) {\n //v6 example: 5b590f5f00000001\n //v7 example: e35a185e00000001\n this.take(8, \"unknown8\");\n this.parseRooms();\n // more stuff i don't understand\n this.take(50, \"unknown50\");\n this.take(5, \"unknown5\");\n this.points = [];\n try {\n this.parsePose();\n } catch (e) {\n Logger.warn(\"Unable to parse Pose\", e); //TODO\n }\n }\n this.take(this.buf.length - this.offset, \"trailing\");\n\n // TODO: one of them is just the room outline, not actual past navigation logic\n return this.convertToValetudoMap({\n image: this.img,\n zones: this.rooms,\n //TODO: at least according to all my sample files, this.points is never the path\n //Why is this here?\n //path: {points: this.points.length ? this.points : this.history},\n path: {points: this.history},\n goto_target: this.navigateTarget && this.navigateTarget.position,\n robot: this.realtimePose && this.realtimePose.position,\n charger: this.chargeStation && this.chargeStation.position,\n virtual_wall: this.virtual_wall,\n no_go_area: this.no_go_area,\n clean_area: this.clean_area\n });\n }", "function parseFile(str) {\n\n\t\t// Verifying str type\n\t\tif (typeof str !== 'string') {\n\t\t\talert('Sorry... we had a uhh... error parsing?');\n\t\t\treturn;\n\t\t}\n\n\t\t// RegEx is a blast -_-\n\t\tlet newParsedArr = str.match(/['\"].*?['\"]/g).map(item => {\n\t\t\treturn item.replace(/['\"]/g, \"\");\n\t\t});\n\t\tformatPaths(newParsedArr);\n\t}", "load(file) {\n this._loading = file;\n\n // Read file and split into lines\n const map = {};\n\n const content = fs.readFileSync(file, 'ascii');\n const lines = content.split(/[\\r\\n]+/);\n\n lines.forEach(line => {\n // Clean up whitespace/comments, and split into fields\n const fields = line.replace(/\\s*#.*|^\\s*|\\s*$/g, '').split(/\\s+/);\n map[fields.shift()] = fields;\n });\n\n this.define(map);\n\n this._loading = null;\n }", "function parseHBX(completePath)\n{\n\tnTodo++;\n\tlet fileName = path.parse(completePath).name\n\tvar ck = /DYNAMIC\\s+([_a-z0-9]+)/i;\n\tvar reader = readline.createInterface({input:fs.createReadStream(completePath,\"utf8\")});\n\treader.on(\"line\",l =>\n\t{\n\t\tvar m = l.match(ck);\n\t\tif(m && m[1])\n\t\t{\n\t\t\tstdMethods.push([m[1],fileName]);\n\t\t}\n\t});\n\treader.on(\"close\",() =>\n\t{\n\t\tnTodo--;\n\t\tif(nTodo==0)\n\t\t\tcreateDoc();\n\t})\n}", "parseFlsFile(baseFile) {\r\n this.extension.logger.addLogMessage('Parse fls file.');\r\n const rootDir = path.dirname(baseFile);\r\n const outDir = this.getOutDir(baseFile);\r\n const flsFile = path.resolve(rootDir, path.join(outDir, path.basename(baseFile, '.tex') + '.fls'));\r\n if (!fs.existsSync(flsFile)) {\r\n this.extension.logger.addLogMessage(`Cannot find fls file: ${flsFile}`);\r\n return;\r\n }\r\n this.extension.logger.addLogMessage(`Fls file found: ${flsFile}`);\r\n const ioFiles = this.parseFlsContent(fs.readFileSync(flsFile).toString(), rootDir);\r\n ioFiles.input.forEach((inputFile) => {\r\n // Drop files that are also listed as OUTPUT or should be ignored\r\n if (ioFiles.output.includes(inputFile) ||\r\n this.isExcluded(inputFile) ||\r\n !fs.existsSync(inputFile)) {\r\n return;\r\n }\r\n // Drop the current rootFile often listed as INPUT and drop any file that is already in the texFileTree\r\n if (baseFile === inputFile || inputFile in this.cachedContent) {\r\n return;\r\n }\r\n if (path.extname(inputFile) === '.tex') {\r\n // Parse tex files as imported subfiles.\r\n this.cachedContent[baseFile].children.push({\r\n index: Number.MAX_VALUE,\r\n file: inputFile\r\n });\r\n this.parseFileAndSubs(inputFile);\r\n }\r\n else if (this.fileWatcher && !this.filesWatched.includes(inputFile)) {\r\n // Watch non-tex files.\r\n this.fileWatcher.add(inputFile);\r\n this.filesWatched.push(inputFile);\r\n }\r\n });\r\n ioFiles.output.forEach((outputFile) => {\r\n if (path.extname(outputFile) === '.aux' && fs.existsSync(outputFile)) {\r\n this.parseAuxFile(fs.readFileSync(outputFile).toString(), path.dirname(outputFile).replace(outDir, rootDir));\r\n }\r\n });\r\n }", "function parse() {\n var self = this\n var value = String(self.file)\n var start = {line: 1, column: 1, offset: 0}\n var content = xtend(start)\n var node\n\n // Clean non-unix newlines: `\\r\\n` and `\\r` are all changed to `\\n`.\n // This should not affect positional information.\n value = value.replace(lineBreaksExpression, lineFeed)\n\n // BOM.\n if (value.charCodeAt(0) === 0xfeff) {\n value = value.slice(1)\n\n content.column++\n content.offset++\n }\n\n node = {\n type: 'root',\n children: self.tokenizeBlock(value, content),\n position: {start: start, end: self.eof || xtend(start)}\n }\n\n if (!self.options.position) {\n removePosition(node, true)\n }\n\n return node\n}", "function parseAllGRIBs(inData) {\n // create the object to keep all the data in\n var weatherDB = new weatherDBObject();\n\n // loop through all the grib parts in the file\n var gribCount = 1;\n var starttime = +new Date();\n while (inData.byteLength > 0) {\n if (gribCount % 10 == 0) {\n\n var currentTime = +new Date();\n starttime = currentTime;\n }\n dbg(2, \" Starting GRIB Block \" + gribCount);\n gribCount++;\n var sect0 = new DataView(inData, 0, 16);\n // Make sure this is a grib file\n // first 4 characters should be GRIB. Must be a meteorological file (byte 7 = 0) and version 2 (byte 8 = 2). Max length supported is 2^32 (top 32 if length =0)\n\n if (sect0.getUint8(0) == 0x47 && sect0.getUint8(1) == 0x52 && sect0.getUint8(2) == 0x49 && sect0.getUint8(3) == 0x42 && sect0.getUint8(6) == 0x0 && sect0.getUint8(7) == 0x2 && sect0.getUint32(8) == 0) {\n\n // get the length of the grub file\n var griblength = sect0.getUint32(12);\n\n // trim off this grib\n var grib = inData.slice(0, griblength);\n inData = inData.slice(griblength);\n // at this point grib contains one of the multiple gribs in the source file\n // there is a separate grib for each parameter and pressure (alt)\n parseGRIB(grib, weatherDB);\n if (weatherDB.status < 0) {\n // error found, return\n return (weatherDB);\n }\n\n } else {\n // alert(\"ERROR: Not a grib file this parser understands\");\n dbg(0, \"ERROR: Not a grib file this parser understands\");\n weatherDB.statusMsg = \"ERROR: Not a grib file this parser understands\";\n weatherDB.status = -1;\n\t\t\tthrow error;\n return (weatherDB);\n }\n }\n // just keep the unique, sorted values for lats, longs, pressures, & params.\n weatherDB.lats = arrayUnique(weatherDB.lats);\n weatherDB.lats.sort(function (a, b) {\n return a - b\n });\n weatherDB.longs = arrayUnique(weatherDB.longs);\n weatherDB.longs.sort(function (a, b) {\n return a - b\n });\n weatherDB.pressures = arrayUnique(weatherDB.pressures);\n weatherDB.pressures.sort(function (a, b) {\n return a - b\n });\n weatherDB.params = arrayUnique(weatherDB.params);\n weatherDB.params.sort();\n weatherDB.status = 100; // say the data is valid\n return weatherDB;\n}", "parseFileAndSubs(file, onChange = false) {\r\n if (this.isExcluded(file)) {\r\n this.extension.logger.addLogMessage(`Ignoring ${file}`);\r\n return;\r\n }\r\n this.extension.logger.addLogMessage(`Parsing ${file}`);\r\n if (this.fileWatcher && !this.filesWatched.includes(file)) {\r\n // The file is first time considered by the extension.\r\n this.fileWatcher.add(file);\r\n this.filesWatched.push(file);\r\n }\r\n const content = this.getDirtyContent(file, onChange);\r\n this.cachedContent[file].children = [];\r\n this.cachedContent[file].bibs = [];\r\n this.cachedFullContent = undefined;\r\n this.parseInputFiles(content, file);\r\n this.parseBibFiles(content, file);\r\n // We need to parse the fls to discover file dependencies when defined by TeX macro\r\n // It happens a lot with subfiles, https://tex.stackexchange.com/questions/289450/path-of-figures-in-different-directories-with-subfile-latex\r\n this.parseFlsFile(file);\r\n }", "function readFile() {\n\t\tlet reader = new FileReader();\n\t\treader.addEventListener('loadend', () => {\n\t\t\tparseFile(reader.result);\n\t\t});\n\t\treader.readAsText(this.files[0]);\n\t}", "function parseFile(evt){\n let files = evt.target.files; // FileList object\n if(files.length === 0){ //if no files\n return;\n }\n let f = files[0];\n\n let pointsArray = [];\n fileFaces = [];\n let reader = new FileReader();\n reader.onload = (function(theFile) {\n return function(e) {\n let contents = atob(e.target.result.split(\"base64,\")[1]);\n contents = contents.split(/\\n/); //split contents into lines\n if(contents[0].replace(/\\s+/, \"\") === \"\"){ //if first line is blank\n contents.shift(); //delete it\n }\n if(contents[0].replace(/\\s+/, \"\") !== \"ply\"){ //if first line does not contain \"ply\"\n console.log(\"No Ply: \" + contents[0]); //do nothing with the file\n return;\n }\n\n let i = 1;\n let numVerts = 0;\n let numFaces = 0;\n\n while(contents[i].indexOf(\"end_header\") === -1){ //while we haven't hit the end of the header\n if(contents[i].indexOf(\"element vertex\") !== -1){ //if this line indicates # vertices\n let idx = contents[i].indexOf(\"element vertex\");\n numVerts = parseInt(contents[i].substring(idx+14)); //parse # of vertices\n } else if(contents[i].indexOf(\"element face\") !== -1){ //if this line indicates # of faces\n let idx = contents[i].indexOf(\"element face\");\n numFaces = parseInt(contents[i].substring(idx+12)); //parse # of faces\n }\n i++;\n }\n i++; //increment to line just after end_header\n let left = vec4(Number.MAX_VALUE, 0.0, 0.0, 0.0);\n let right = vec4(Number.MIN_VALUE, 0.0, 0.0, 0.0);\n let top = vec4(0.0, Number.MIN_VALUE, 0.0, 0.0);\n let bottom = vec4(0.0, Number.MAX_VALUE, 0.0, 0.0);\n let minZ = vec4(0.0, 0.0, Number.MAX_VALUE, 0.0);\n let maxZ = vec4(0.0, 0.0, Number.MIN_VALUE, 0.0); //initialize extents to easily-overridden values\n\n let j = 0;\n for(j = 0; j < numVerts; j++){ //for each vertex\n while(contents[i].replace(/\\s+/, \"\") === \"\"){ //ignore empty lines\n i++;\n }\n let points = contents[i].split(/\\s+/); //split along spaces\n if(points[0].replace(/\\s+/, \"\") === \"\"){ //ignore empty first element\n points.shift();\n }\n let x = parseFloat(points[0]);\n let y = parseFloat(points[1]);\n let z = parseFloat(points[2]);\n let thisPoint = vec4(x, y, z, 1.0);\n\n if(x < left[0]){ //if x is further left\n left = thisPoint;\n }\n if(x > right[0]){ //if x is further right\n right = thisPoint;\n }\n if(y < bottom[1]){ //if y is lower\n bottom = thisPoint;\n }\n if(y > top[1]){ //if y is higher\n top = thisPoint;\n }\n if(z < minZ[2]){ //if Z is further\n minZ = thisPoint;\n }\n if(z > maxZ[2]){ //if Z is closer\n maxZ = thisPoint;\n }\n pointsArray.push(thisPoint);\n i++;\n }\n\n let divisor = Math.max(right[0]-left[0], top[1]-bottom[1], maxZ[2]-minZ[2]) / 2; //calculate largest dimension\n let shiftX = (-(right[0] - (right[0]-left[0])/2))/divisor; //X axis translation to center at origin\n let shiftY = (-(top[1] - (top[1]-bottom[1])/2))/divisor; //Y axis translation to center at origin\n let shiftZ = (-(maxZ[2] - (maxZ[2]-minZ[2])/2))/divisor; //Z axis translation to center at origin\n for(j = 0; j < numFaces; j++){ //for each face\n while(contents[i].replace(/\\s+/, \"\") === \"\"){ //ignore empty lines\n i++;\n }\n let verts = contents[i].split(/\\s+/);\n if(verts[0].replace(/\\s+/, \"\") === \"\"){ //if empty first element\n verts.shift();\n }\n let vertLen = parseInt(verts[0]); //parse # vertices\n verts.shift();\n\n for(let k = 0; k < vertLen; k++){ //for # of vertices\n let currVert = pointsArray[verts[k]];\n fileFaces.push(vec4(currVert[0]/divisor + shiftX, currVert[1]/divisor + shiftY, currVert[2]/divisor + shiftZ, 1.0));\n //shift vertex so whole object is centered on origin and [-1, 1], push to face\n }\n i++;\n }\n let rightBB = right[0]/divisor + shiftX;\n let topBB = top[1]/divisor + shiftY;\n let maxZBB = maxZ[2]/divisor + shiftZ;\n\n //back face\n fileBB = generateBB(rightBB, topBB, maxZBB);\n\n fileUploaded = true;\n if(shapeArray.length === 3){ //if another file is already loaded\n shapeArray.pop(); //get rid of it\n }\n shapeArray.push(fileFaces); //push this file to shape array\n fileFlatNormal = fNormals(shapeArray[2]); //calculate flat normals\n fileGNormal = gNormals(shapeArray[2]); //calculate gouraud normals\n generateLines(); //regenerate lines to account fo new bounding box\n };\n })(f);\n reader.readAsDataURL(f);\n}", "function loadStructureHandler(text)\r\n\t{\r\n\t var content = text.split(\"\\n\");\r\n\t //console.log(content[1]);\r\n\t BuildStructure(name,content,callback, new ProgressDialog(\"Assimilating PDB file \"+name+\"...\"));\r\n\t}", "function parseText(file) {\n console.log(file);\n var lines = file.split(\"\\n\");\n var params = lines[0].split(\" \");\n if (params.length < 3) {\n console.log(\"File format error\");\n return false;\n }\n listType = params[0];\n rowSize = parseInt(params[1], 10);\n memSize = parseInt(params[2], 10);\n for (var i = 1; i < lines.length; i++) {\n //parse each line\n if (lines[i].length <= 0) break;\n if (lines[i].charAt(0) == '#') console.log(lines[i]);\n else {\n var args = lines[i].split(\" \");\n var addr;\n if (args.length == 2) {\n //this is a free block\n var block;\n freebls.push({\n address: addr = parseInt(args[0], 16),\n size: parseInt(args[1], 10),\n type: FREE\n });\n if (addr < memhead) memhead = addr;\n } else if (args.length == 3) {\n usedbls.push({\n address: addr = parseInt(args[0], 16),\n size: parseInt(args[1], 10),\n rsize: parseInt(args[2], 10),\n type: USED\n });\n if (addr < memhead) memhead = addr;\n } else {\n console.log(\"Error parsing file, line \" + i + \"has incorrect ammount of arguments\");\n return false;\n }\n }\n }\n\n if (listType == EXPLICIT) {\n // add link\n for (var i = 0; i < freebls.length - 1; i++) {\n freebls[i].next = freebls[i + 1].address;\n }\n }\n\n function compare(a, b) {\n return a.address > b.address;\n }\n freebls.sort(compare);\n if (listType == EXPLICIT) {\n for (var i = 0; i < freebls.length - 1; i++) {\n var diff = freebls[i + 1].address - freebls[i].address;\n if (diff > freebls[i].size) {\n //there is a used block\n usedbls.push({\n address: freebls[i].address + freebls[i].size,\n size: diff - freebls[i].size,\n type: USED\n })\n }\n }\n var lastfree = freebls[freebls.length - 1];\n var lastusedhead = lastfree.address + lastfree.size;\n if (memSize > lastfree.address + lastfree.size - memhead) {\n usedbls.push({\n address: lastfree.address + lastfree.size,\n size: memSize + memhead - lastusedhead,\n type: USED\n });\n }\n }\n bls = freebls.concat(usedbls);\n bls.sort(compare);\n\n // for (var i = 0; i < freebls.length - 1; i++) {\n // console.log(\"\" + freebls[i].address + \" \" + freebls[i].size);\n // }\n\n initBoxes();\n\n return true;\n}", "parseFile(file) {\r\n this._lines = [];\r\n this._currentLine = -1;\r\n this._resetStates();\r\n\r\n lineReader.eachLine(file, (line) => {\r\n this._lines.push(ParseUtil.clearCRLF(line));\r\n }).then(()=>{\r\n this._linesGenerator = this.lineReader();\r\n this._readNextLine();\r\n });\r\n }", "function parseFile(path, cvt, cb) {\n if (cvt == null) cvt = adapter;\n fs.readFile(path, (err, data) => {\n if (err) return cb(err);\n xml2js.parseString(data, (err, data) => {\n if (err) return cb(err);\n if (! data) return cb(null, null);\n const key = Object.keys(data)[0];\n if (! key) return cb(null, null);\n cb(null, cvt(data[key], key));\n });\n });\n}", "getDefinition(file, position) {\n // Overridden in XMLScope. Brs files use implementation in BrsFile\n return [];\n }", "function parseLiveFile(e) {\n if (e.document.isUntitled) {\n return;\n }\n if (e.document.languageId !== 'go') {\n return;\n }\n if (!goLiveErrorsEnabled()) {\n return;\n }\n if (runner != null) {\n clearTimeout(runner);\n }\n runner = setTimeout(() => {\n processFile(e);\n runner = null;\n }, config_1.getGoConfig(e.document.uri)['liveErrors']['delay']);\n}", "function parseFile(file) {\n\n if (window.File && window.FileReader && Window.FileList && window.Blob) {\n alert(\"File Reader APIs not up to date on current browser.\")\n return\n }\n \n //create file reader \n var reader = new FileReader()\n\n\n if(file.files && file.files[0]) {\n reader.onload = function (e) {\n parseInput(e.target.result)\n }\n\n reader.readAsText(file.files[0])\n }\n else {\n alert(\"Error reading file.\")\n }\n\n}", "function parseFile(err, contents) {\r\n const output = parse(contents, {\r\n columns: true,\r\n skip_empty_lines: true\r\n });\r\n\r\n // Call build function. Interpret and construct Org Chart\r\n buildOutput(output);\r\n}", "function BaseBodyParser() {\n\t}", "handleTheFile(event) {\n event.preventDefault();\n if (this.inputFile.current.files[0] === undefined) { return; }\n\n // Confirm file extension and read the data as text\n console.log('Reading the file...');\n let fileName = this.inputFile.current.files[0].name;\n if (!fileName.endsWith('.asc')) {\n console.error('Error opening the file: Invalid file extension, .asc expected.');\n return;\n }\n let file = this.inputFile.current.files[0];\n let reader = new FileReader();\n reader.onload = (event) => {\n console.log('Done.');\n this.ParseTheData(event.target.result);\n }\n reader.onerror = () => {\n console.error('Error opening the file: Cannot read file.');\n return;\n }\n reader.readAsText(file);\n }", "function metadataParser(file, callback, errback) {\n queue.push({file: file, callback: callback, errback: errback});\n if (!busy)\n processQueue();\n }", "function parsed_done() {\n\n\tconsole.log(fileParsed);\n\n}", "function parse(context, file) {\n var message\n\n if (stats(file).fatal) {\n return\n }\n\n if (context.treeIn) {\n debug('Not parsing already parsed document')\n\n try {\n context.tree = json(file.toString())\n } catch (error) {\n message = file.message(\n new Error('Cannot read file as JSON\\n' + error.message)\n )\n message.fatal = true\n }\n\n // Add the preferred extension to ensure the file, when serialized, is\n // correctly recognised.\n // Only add it if there is a path — not if the file is for example stdin.\n if (file.path) {\n file.extname = context.extensions[0]\n }\n\n file.contents = ''\n\n return\n }\n\n debug('Parsing `%s`', file.path)\n\n context.tree = context.processor.parse(file)\n\n debug('Parsed document')\n}", "function parse (fileName, text) {\n const reader = Reader.create(fileName, text)\n const fragments = []\n\n // loop through lines, building fragments\n while (true) {\n if (reader.atEnd()) break\n\n // get the first line of the next fragment\n reader.skipEmptyLines()\n\n const line = reader.read()\n if (line == null) break\n\n // push the fragment line back for fragment handler to process\n reader.pushBack()\n\n const fragment = getFragment(line)\n if (fragment.read(reader) == null) break\n\n fragments.push(fragment)\n }\n\n return fragments\n}", "parseFile(file) {\n\n var content = this.lire(file);\n\n var lines = content.split(/\\r?\\n/);\n\n //string that contains keys\n var header = lines[0];\n\n //array containing data separate with \";\"\n var dataLines = lines.slice(1);\n\n // data = dataLines.map(this.parser);\n\n var data = this.jsonifydata(header,dataLines);\n\n console.log(data);\n\n }", "function parse$a(context, file) {\n var message;\n\n if (stats$5(file).fatal) {\n return\n }\n\n if (context.treeIn) {\n debug$8('Not parsing already parsed document');\n\n try {\n context.tree = json$1(file.toString());\n } catch (error) {\n message = file.message(\n new Error('Cannot read file as JSON\\n' + error.message)\n );\n message.fatal = true;\n }\n\n // Add the preferred extension to ensure the file, when serialized, is\n // correctly recognised.\n // Only add it if there is a path — not if the file is for example stdin.\n if (file.path) {\n file.extname = context.extensions[0];\n }\n\n file.contents = '';\n\n return\n }\n\n debug$8('Parsing `%s`', file.path);\n\n context.tree = context.processor.parse(file);\n\n debug$8('Parsed document');\n}", "parseBitmap(buffer, parsed) {\r\n\r\n // file buffer\r\n this.buffer = buffer;\r\n\r\n // fileType\r\n this.type = buffer.toString('utf-8', 0, 2);\r\n // fileSize\r\n this.fileSize = buffer.readInt32LE(2);\r\n // Bytes Per Pixel\r\n this.bitsPerPixel = buffer.readInt16LE(28);\r\n // Height\r\n this.height = buffer.readInt32LE(22);\r\n // Width\r\n this.width = buffer.readInt32LE(18);\r\n // DIB Header size \r\n this.sizeOfTheDIBHeader = buffer.readInt32LE(14);\r\n // Start of color chart\r\n this.colorChart = (this.sizeOfTheDIBHeader + 14 + 12);\r\n // Start of pixels\r\n this.pixels = buffer.readInt32LE(10);\r\n\r\n parsed(this);\r\n }", "async parse() {\n const buffer = await readFile(`${this.file}`);\n // Create a naked object to model the bitmap properties\n const parsedBitmap = {};\n\n // Identify the offsets by reading the bitmap docs\n const FILE_SIZE_OFFSET = 2;\n const WIDTH_OFFSET = 18;\n const HEIGHT_OFFSET = 22;\n const BYTES_PER_PIXEL_OFFSET = 28;\n const COLOR_PALLET_OFFSET = 46;\n const COLOR_TABLE_OFFSET = 54;\n const PIXEL_ARRAY_OFFSET = 310;\n\n //------------------------------------------------------\n // READING INFORMATION FROM THE BITMAP FILE\n //------------------------------------------------------\n\n parsedBitmap.type = buffer.toString('utf-8', 0, 2);\n parsedBitmap.fileSize = buffer.readInt32LE(FILE_SIZE_OFFSET);\n parsedBitmap.bytesPerPixel = buffer.readInt16LE(BYTES_PER_PIXEL_OFFSET);\n parsedBitmap.height = buffer.readInt32LE(HEIGHT_OFFSET);\n parsedBitmap.width = buffer.readInt32LE(WIDTH_OFFSET);\n parsedBitmap.colorPallet = buffer.readInt32LE(COLOR_PALLET_OFFSET);\n parsedBitmap.colorTable = buffer.readInt32LE(COLOR_TABLE_OFFSET);\n parsedBitmap.pixelArray = buffer.readInt32LE(PIXEL_ARRAY_OFFSET);\n\n const colorTable = buffer.slice(PIXEL_ARRAY_OFFSET);\n const tableOfColors = buffer.slice(COLOR_TABLE_OFFSET, PIXEL_ARRAY_OFFSET);\n\n // Bottom left boundary = 1146\n // Top right boundary = buffer.length\n // Color table = 121 to 1145 (1145 - 4 * 256)\n // const num = 6111 - 3 * 112;\n // const blockheight = 400;\n\n // console.log(parsedBitmap);\n return parsedBitmap;\n }", "function parsedFile(lines) {\n let rounds = 0;\n let players = [];\n let root = {};\n\n lines.forEach((line) => {\n if (line.indexOf('InitGame') !== -1) {\n rounds = getInitGame(root, rounds);\n }\n\n if (line.indexOf('killed') !== -1) {\n kill(root[`game_${rounds}`], line);\n }\n\n if (line.indexOf('ClientUserinfoChanged') !== -1) {\n instancePlayers(root[`game_${rounds}`], line);\n }\n });\n return root;\n}", "static parseBpmn(filenames) {\n if (typeof filenames === 'string') {\n filenames = [filenames];\n }\n return filenames.map(filename => {\n const xmlData = fs.readFileSync(filename).toString();\n if (parser.validate(xmlData)) {\n return parser.parse(xmlData, BpmnParser.parserOptions);\n }\n return {};\n });\n }", "function parseFile(contents, fileName) {\n\t\ttry {\n\t\t\tif(typeof contents === 'string') {\n\t\t\t\tcontents = JSON.parse(contents);\n\t\t\t\tdataBase = contents;\n\t\t\t\tcheckData();\n\t\t\t\treturn;\n\t\t\t}\n\t\t} catch (e) { }\n\n\t\tif(contents instanceof Array) { // from slot set of \"FileContents\"\n\t\t\tdataBase = contents;\n\t\t\tcheckData();\n\t\t\treturn;\n\t\t}\n\n\t\tvar p = 0;\n\t\tvar lex = {\" \":0, \",\":0, \"\\t\":0, \"\\n\":0, \";\":0};\n\t\tvar best = \"\\n\";\n\t\tvar bestn = 0;\n\n\t\twhile (p < contents.length) {\n\t\t\tif(lex.hasOwnProperty(contents[p])) {\n\t\t\t\tlex[contents[p]] += 1;\n\n\t\t\t\tif(lex[contents[p]] > bestn) {\n\t\t\t\t\tbestn = lex[contents[p]];\n\t\t\t\t\tbest = contents[p];\n\t\t\t\t}\n\t\t\t}\n\t\t\tp++;\n\t\t}\n\n\t\tdataBase = [];\n\t\tp1 = 0;\n\t\tp2 = p1+1;\n\t\tvar firstRow = true;\n\n\t\twhile (p2 < contents.length) {\n\t\t\tif(contents[p2] == \"\\n\" || p2 == contents.length - 1) {\n\t\t\t\tif(p2 == contents.length - 1 && contents[p2] != \"\\n\") {\n\t\t\t\t\tp2++; // include last character too\n\t\t\t\t}\n\t\t\t\tvar thisRow = contents.substr(p1, p2 - p1);\n\t\t\t\tvar items = thisRow.split(best);\n\t\t\t\tvar name = items[0];\n\t\t\t\tvar vals = [];\n\t\t\t\tfor(var i = 1; i < items.length; i++) {\n\t\t\t\t\tvar val = parseFloat(items[i]);\n\n\t\t\t\t\tif(val !== null && val !== undefined && !isNaN(val)) {\n\t\t\t\t\t\tvals.push(val);\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tvar data = [name, vals];\n\t\t\t\tif(vals.length > 0) {\n\t\t\t\t\tdataBase.push(data);\n\t\t\t\t}\n\n\t\t\t\tfirstRow = false;\n\n\t\t\t\twhile(contents[p2] == \"\\n\") {\n\t\t\t\t\tp2++;\n\t\t\t\t}\n\t\t\t\tp1 = p2;\n\t\t\t\tp2 = p1 + 1;\n\t\t\t}\n\t\t\telse {\n\t\t\t\tp2++;\n\t\t\t}\n\t\t}\n\n\t\t$scope.set(\"FileContents\", dataBase);\n\t\t$scope.dataSetName = fileName;\n\t\tcheckData();\n\t}", "function parse(doc) {\n var file = vfile(doc)\n var Parser\n\n freeze()\n Parser = processor.Parser\n assertParser('parse', Parser)\n\n if (newable(Parser)) {\n return new Parser(String(file), file).parse()\n }\n\n return Parser(String(file), file) // eslint-disable-line new-cap\n }", "function parse(doc) {\n var file = vfile(doc)\n var Parser\n\n freeze()\n Parser = processor.Parser\n assertParser('parse', Parser)\n\n if (newable(Parser)) {\n return new Parser(String(file), file).parse()\n }\n\n return Parser(String(file), file) // eslint-disable-line new-cap\n }", "function parse(doc) {\n var file = vfile(doc)\n var Parser\n\n freeze()\n Parser = processor.Parser\n assertParser('parse', Parser)\n\n if (newable(Parser)) {\n return new Parser(String(file), file).parse()\n }\n\n return Parser(String(file), file) // eslint-disable-line new-cap\n }", "function parse(doc) {\n var file = vfile(doc)\n var Parser\n\n freeze()\n Parser = processor.Parser\n assertParser('parse', Parser)\n\n if (newable(Parser)) {\n return new Parser(String(file), file).parse()\n }\n\n return Parser(String(file), file) // eslint-disable-line new-cap\n }", "function parse(doc) {\n var file = vfile(doc)\n var Parser\n\n freeze()\n Parser = processor.Parser\n assertParser('parse', Parser)\n\n if (newable(Parser)) {\n return new Parser(String(file), file).parse()\n }\n\n return Parser(String(file), file) // eslint-disable-line new-cap\n }", "function parseFile(fileUpload) {\n\n //Add error handling here.\n var status = 'good';\n \n \n //TODO: Insert parsing code here\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n //TODO: Insert parsing code here\n let glFile = csvGenerator(),\n wideFile = csvGenerator(),\n longFile = csvGenerator()\n \n if (status === 'good') {\n return {\n GL: glFile,\n Workorders_Wide: wideFile,\n Workorders_Long: longFile\n };\n } else {\n return null;\n }\n \n}", "function parse(doc) {\n var file = vfile(doc)\n var Parser\n\n freeze()\n Parser = processor.Parser\n assertParser('parse', Parser)\n\n if (newable(Parser, 'parse')) {\n return new Parser(String(file), file).parse()\n }\n\n return Parser(String(file), file) // eslint-disable-line new-cap\n }", "function parse(doc) {\n var file = vfile(doc)\n var Parser\n\n freeze()\n Parser = processor.Parser\n assertParser('parse', Parser)\n\n if (newable(Parser, 'parse')) {\n return new Parser(String(file), file).parse()\n }\n\n return Parser(String(file), file) // eslint-disable-line new-cap\n }", "function parse(doc) {\n var file = vfile(doc)\n var Parser\n\n freeze()\n Parser = processor.Parser\n assertParser('parse', Parser)\n\n if (newable(Parser, 'parse')) {\n return new Parser(String(file), file).parse()\n }\n\n return Parser(String(file), file) // eslint-disable-line new-cap\n }", "function process(filename, source) {\n try {\n if (util.isString(source) && source.charAt(0) === \"{\")\n source = JSON.parse(source);\n if (!util.isString(source))\n self.setOptions(source.options).addJSON(source.nested);\n else {\n parse.filename = filename;\n var parsed = parse(source, self, options),\n resolved,\n i = 0;\n if (parsed.imports)\n for (; i < parsed.imports.length; ++i)\n if (resolved = self.resolvePath(filename, parsed.imports[i]))\n fetch(resolved);\n if (parsed.weakImports)\n for (i = 0; i < parsed.weakImports.length; ++i)\n if (resolved = self.resolvePath(filename, parsed.weakImports[i]))\n fetch(resolved, true);\n }\n } catch (err) {\n finish(err);\n }\n if (!sync && !queued)\n finish(null, self); // only once anyway\n }", "function process(filename, source) {\n try {\n if (util.isString(source) && source.charAt(0) === \"{\")\n source = JSON.parse(source);\n if (!util.isString(source))\n self.setOptions(source.options).addJSON(source.nested);\n else {\n parse.filename = filename;\n var parsed = parse(source, self, options),\n resolved,\n i = 0;\n if (parsed.imports)\n for (; i < parsed.imports.length; ++i)\n if (resolved = self.resolvePath(filename, parsed.imports[i]))\n fetch(resolved);\n if (parsed.weakImports)\n for (i = 0; i < parsed.weakImports.length; ++i)\n if (resolved = self.resolvePath(filename, parsed.weakImports[i]))\n fetch(resolved, true);\n }\n } catch (err) {\n finish(err);\n }\n if (!sync && !queued)\n finish(null, self); // only once anyway\n }", "_parseCollection()\n {\n var that = this;\n fs.readFile(this.option.path, 'utf8', function (err, data) {\n if (err) throw err;\n that.collection = JSON.parse(data);\n that._serveCollection();\n })\n }", "function parseFile(req, res, next){\n var filePath = req.files.file.path;\n console.log(filePath);\n function onNewRecord(record){\n console.log(record)\n }\n\n function onError(error){\n console.log(error)\n }\n\n function done(linesRead){\n res.send(200, linesRead)\n }\n\n var columns = true; \n parseCSVFile(filePath, columns, onNewRecord, onError, done);\n\n}", "function ReadPDBfile(file,callback)\r\n{\r\n\tvar self = this;\r\n\tvar name= PDButil.stripName(file.name);\r\n\t\r\n\t//Assigning Properties by reading the file\r\n\tvar pdbfileReader = new FileReader();\r\n\t\r\n\t//Reads the file\r\n\tpdbfileReader.readAsText(file);\r\n\t\r\n\t//When file is read, this function is called\r\n\tpdbfileReader.onload = loadStructureHandler;\r\n\tpdbfileReader.onerror = errorStructureHandler;\r\n\t\r\n\tfunction loadStructureHandler(event)\r\n\t{\r\n\t var content = event.target.result.split(\"\\n\");\r\n\t //console.log(content[1]);\r\n\t BuildStructure(name,content,callback, new ProgressDialog(\"Assimilating PDB file \"+name+\"...\"));\r\n\t};\r\n\r\n\tfunction errorStructureHandler(event)\r\n\t{\r\n\t console.log(\"Error while reading the file\");\r\n\t};\r\n \r\n}", "function parse(doc) {\n var file = vfile(doc);\n var Parser;\n\n freeze();\n Parser = processor.Parser;\n assertParser('parse', Parser);\n\n if (newable(Parser, 'parse')) {\n return new Parser(String(file), file).parse()\n }\n\n return Parser(String(file), file) // eslint-disable-line new-cap\n }", "function Parser(doc, file) {\n this.file = file;\n this.offset = {};\n this.options = xtend(this.options);\n this.setOptions({});\n\n this.inList = false;\n this.inBlock = false;\n this.inLink = false;\n this.atStart = true;\n\n this.toOffset = vfileLocation(file).toOffset;\n this.unescape = unescape(this, 'escape');\n this.decode = decode(this);\n}", "function r(e){e||(e={}),this._file=i.getArg(e,\"file\",null),this._sourceRoot=i.getArg(e,\"sourceRoot\",null),this._sources=new a,this._names=new a,this._mappings=[],this._sourcesContents=null}", "function parse(doc) {\n var file = vfile(doc);\n var Parser;\n\n freeze();\n Parser = processor.Parser;\n assertParser('parse', Parser);\n\n if (newable(Parser)) {\n return new Parser(String(file), file).parse();\n }\n\n return Parser(String(file), file); // eslint-disable-line new-cap\n }", "function parseFile(fileContents) {\n return fileContents.split('\\n').map(s => validate(s.trim()));\n}", "_parseMappings(aStr, aSourceRoot) {\n throw new Error('Subclasses must implement _parseMappings')\n }", "function process(filename, source) {\n try {\n if (util.isString(source) && source.charAt(0) === \"{\")\n source = JSON.parse(source);\n if (!util.isString(source))\n self.setOptions(source.options).addJSON(source.nested);\n else {\n parse.filename = filename;\n var parsed = parse(source, self, options),\n resolved,\n i = 0;\n if (parsed.imports)\n for (; i < parsed.imports.length; ++i)\n if (resolved = getBundledFileName(parsed.imports[i]) || self.resolvePath(filename, parsed.imports[i]))\n fetch(resolved);\n if (parsed.weakImports)\n for (i = 0; i < parsed.weakImports.length; ++i)\n if (resolved = getBundledFileName(parsed.weakImports[i]) || self.resolvePath(filename, parsed.weakImports[i]))\n fetch(resolved, true);\n }\n } catch (err) {\n finish(err);\n }\n if (!sync && !queued)\n finish(null, self); // only once anyway\n }", "function process(filename, source) {\n try {\n if (util.isString(source) && source.charAt(0) === \"{\")\n source = JSON.parse(source);\n if (!util.isString(source))\n self.setOptions(source.options).addJSON(source.nested);\n else {\n parse.filename = filename;\n var parsed = parse(source, self, options),\n resolved,\n i = 0;\n if (parsed.imports)\n for (; i < parsed.imports.length; ++i)\n if (resolved = getBundledFileName(parsed.imports[i]) || self.resolvePath(filename, parsed.imports[i]))\n fetch(resolved);\n if (parsed.weakImports)\n for (i = 0; i < parsed.weakImports.length; ++i)\n if (resolved = getBundledFileName(parsed.weakImports[i]) || self.resolvePath(filename, parsed.weakImports[i]))\n fetch(resolved, true);\n }\n } catch (err) {\n finish(err);\n }\n if (!sync && !queued)\n finish(null, self); // only once anyway\n }", "function readspacemetadata() {\n // Read the file and send to the callback\n fs.readFile(metadatapath, handleFile);\n}", "load(fname) {\n let s = fs.readFileSync(fname, \"utf8\");\n let memento = JSON.parse(s);\n this._results = memento.results;\n this._params = memento.params;\n this._combinations = memento.combinations;\n }", "parseSignatureFileBuffer(signatureFileBuffer) {\n const fileHashSize = 48; // number of bytes\n let index = 0;\n while (index < signatureFileBuffer.length) {\n const typeDelimiter = signatureFileBuffer[index++];\n\n switch (typeDelimiter) {\n case 4:\n // hash\n this.hash = signatureFileBuffer.subarray(index, index + fileHashSize);\n index += fileHashSize;\n break;\n case 3:\n // signature\n const signatureLength = signatureFileBuffer.readInt32BE(index);\n index += 4;\n this.signature = signatureFileBuffer.subarray(index, index + signatureLength);\n index += signatureLength;\n break;\n default:\n throw new Error(`Unexpected type delimiter '${typeDelimiter}' in signature file at index '${index - 1}'`);\n }\n }\n }", "function GeometryParser() {}", "function parseFileXML( xmlNode ) {\n\n\t\tgbjson = XML2jsobj( xmlNode );\n\t\t//console.log( 'gbjson', gbjson );\n\n\t\tparseGbJson( gbjson );\n\n\t\treturn gbjson;\n\n\t}", "function parseGCTFile(fileContents)\n {\n var data = {\n sampleNames: [],\n rowNames: [],\n rowDescriptions: [],\n matrix: [[]]\n };\n var lines = fileContents.split(/\\r\\n|\\r|\\n/); //fileContents.split(/\\r|\\n/);\n\n if(lines.length >= 4 && lines[0].indexOf(\"#1.2\") != -1)\n {\n //The samples\n var sampleLines = lines[2];\n var samples = sampleLines.split(/\\t/);\n samples.splice(0, 2);\n data.sampleNames = samples;\n\n //the data starts on line 4 for a gct file\n for(var r=3;r<lines.length;r++)\n {\n var rowData = lines[r].split(/\\t/);\n data.rowNames.push(rowData[0]);\n data.rowDescriptions.push(rowData[1]);\n data.matrix[r-3] = rowData.slice(2).map(Number);\n }\n }\n else\n {\n throw new Error(\"Error parsing data: Unexpected number of lines \" + lines.length + \".\");\n }\n\n return data;\n }", "function processInput() {\n\n\tvar boundaryInfo = getCourseBoundaries(fileContents);\n\tvar boundaries = boundaryInfo.boundaries;\n\tvar oneSection = RegExp( sectionChunk, 'gim' );\n\tvar j = 0;\n\tfor (var i = 0; i < boundaryInfo.boundaries.length ; ++i) {\n\t\tvar courseSection = fileContents.substring(boundaries[i], boundaries[i+1]);\n\t\twhile(true) {\n\t\t\tvar result = oneSection.exec(courseSection);\n\t\t\tif (!result) break;\n\t\t\tvar sectionInfo = { \n\t\t\t\ttimes : result[4].trim().split('\\n'),\n\t\t\t\trooms : result[5].trim().split('\\n'),\n\t\t\t\tinstructors : result[6].trim().split('\\n'),\n\t\t\t\tdates\t\t\t\t: result[7].trim().split('\\n'),\n\t\t\t};\n\t\t\tsections[j] = {\n\t\t\t\tname : boundaryInfo.courses[i].name,\n\t\t\t\tdisc : boundaryInfo.courses[i].disc,\n\t\t\t\tnum : boundaryInfo.courses[i].num,\n\t\t\t\tCFID : result[1],\n\t\t\t\tsectionName : result[2],\n\t\t\t\tsectionType : result[3],\n\t\t\t\tisFull : ( result[8].trim()[0] === 'O' ? false : true ), // Is it open? TODO: Make case insensitive.\n\t\t\t\tdays : getSessions( sectionInfo ),\n\t\t\t};\n\t\t\t++j;\n\t\t}\n\t\toneSection.lastIndex = 0;\n\t}\n\tconsole.log( JSON.stringify(sections, null, 1) ); // DEBUG\n}", "function TextParser() {}", "function TextParser() {}", "function n(e){e||(e={}),this._file=o.getArg(e,\"file\",null),this._sourceRoot=o.getArg(e,\"sourceRoot\",null),this._sources=new i,this._names=new i,this._mappings=[],this._sourcesContents=null}", "function parseTag (context, fname, ctype, valtype, pathfrags, fileScope, defaultScope, docstr, next) {\n if (docstr instanceof Array) {\n for (var i=0,j=Math.max (1, docstr.length); i<j; i++) {\n var workingDocstr = docstr[i] || '';\n workingDocstr = workingDocstr.match (/^[\\r\\n]*([^]*)[\\r\\n]*$/)[1];\n parseTag (\n context,\n fname,\n ctype,\n valtype,\n pathfrags,\n fileScope,\n defaultScope,\n workingDocstr,\n next\n );\n }\n return;\n }\n var tagScope;\n if (fileScope.length)\n tagScope = fileScope.concat (pathfrags);\n // tagScope = concatPaths (fileScope, pathfrags);\n else if (defaultScope.length && (ctype != 'module' || !pathfrags.length))\n tagScope = defaultScope.concat (pathfrags);\n // tagScope = concatPaths (defaultScope, pathfrags);\n else\n tagScope = pathfrags.concat();\n // tagScope = concatPaths (pathfrags);\n\n if (ctype == 'module')\n fileScope.push.apply (fileScope, pathfrags);\n else if (ctype == 'submodule')\n ctype = 'module';\n // convert @constuctor to @spare\n else if (ctype == 'constructor') {\n ctype = 'spare';\n pathfrags.push ([ '~', 'constructor' ]);\n }\n\n // consume modifiers\n var modifiers = [];\n docstr = consumeModifiers (fname, fileScope, tagScope, next, docstr, modifiers);\n\n // begin searching for inner tags\n var innerMatch = docstr ? docstr.match (Patterns.innerTag) : undefined;\n if (!innerMatch) {\n // the entire comment is one component\n try {\n lastComponent = context.submit (\n tagScope.length ? tagScope : fileScope,\n {\n ctype: ctype,\n valtype: valtype,\n // doc: { value:docstr, context:cloneArr(fileScope) },\n doc: { value:docstr, context:fileScope.concat() },\n modifiers: modifiers\n }\n );\n context.logger.trace ({\n type: ctype,\n file: fname,\n path: tagScope.map (function(a){ return a[0]+a[1]; }).join('')\n }, 'read declaration');\n return;\n } catch (err) {\n context.logger.error (err, 'parsing error');\n return;\n }\n }\n\n var argscope = tagScope.concat();\n var inpathstr = innerMatch[3];\n var inpathfrags = [];\n var insigargs;\n var pathMatch;\n var linkScope = fileScope.concat();\n var lastComponent;\n do {\n if (\n ctype == 'callback'\n || ctype == 'argument'\n || ctype == 'kwarg'\n || ctype == 'args'\n || ctype == 'kwargs'\n || ctype == 'returns'\n || ctype == 'signature'\n )\n submissionPath = argscope.concat (inpathfrags);\n // submissionPath = concatPaths (argscope, inpathfrags);\n else if (ctype != 'load')\n submissionPath = tagScope.concat (inpathfrags);\n // submissionPath = concatPaths (tagScope, inpathfrags);\n\n // any chance this is just a @load declaration?\n if (ctype == 'load') {\n var lookupPath =\n inpathfrags[0][1]\n || docstr.slice (0, innerMatch.index).replace (/^\\s*/, '').replace (/\\s*$/, '')\n ;\n var filename = pathLib.resolve (pathLib.dirname (fname), lookupPath);\n var loadedDoc;\n if (Object.hasOwnProperty.call (loadedDocuments, filename))\n loadedDoc = loadedDocuments[filename];\n else try {\n context.latency.log ('parsing');\n loadedDoc = fs.readFileSync (filename).toString();\n context.latency.log ('file system');\n } catch (err) {\n context.logger.warn (\n { filename:filename },\n '@load Declaration failed'\n );\n }\n if (loadedDoc)\n context.submit (\n submissionPath,\n { doc: { value:loadedDoc } }\n );\n } else\n // submit the previous match\n try {\n var inlineDocStr = docstr.slice (0, innerMatch.index);\n if (inlineDocStr.match (/^[\\s\\n]*$/))\n inlineDocStr = '';\n if (\n ctype != 'returns'\n || valtype.length\n || inlineDocStr\n || modifiers.length\n || insigargs\n || submissionPath[submissionPath.length-1][1]\n )\n lastComponent = context.submit (\n submissionPath,\n {\n ctype: ctype,\n valtype: valtype,\n doc: { value:inlineDocStr, context:linkScope },\n modifiers: modifiers,\n sigargs: insigargs\n }\n );\n context.logger.trace ({\n type: ctype,\n file: fname,\n path: submissionPath.map (function(a){ return a[0]+a[1]; }).join('')\n }, 'read declaration');\n } catch (err) {\n context.logger.error (err, 'parsing error');\n return;\n }\n\n // prepare the next submission\n if (ctype == 'returns') {\n if (!inpathstr && argscope.length > tagScope.length)\n argscope.pop();\n } else if (ctype == 'callback')\n argscope = argscope.concat (inpathfrags);\n // argscope = concatPaths (argscope, inpathfrags);\n else if (\n ctype != 'argument'\n && ctype != 'kwarg'\n && ctype != 'args'\n && ctype != 'kwargs'\n && ctype != 'returns'\n && ctype != 'signature'\n )\n argscope = tagScope.concat (inpathfrags);\n // argscope = concatPaths (cloneArr (tagScope), inpathfrags);\n\n linkScope = fileScope.concat();\n // linkScope = cloneArr (fileScope);\n modifiers = [];\n ctype = innerMatch[1];\n valtype = innerMatch[2];\n inpathstr = innerMatch[3];\n docstr = innerMatch[4];\n\n if (ctype == 'signature') {\n insigargs = [];\n var sigargSplit = inpathstr.slice(1).slice(0, -1).split (Patterns.signatureArgument);\n inpathstr = '';\n for (var i=1,j=sigargSplit.length; i<j; i+=3) {\n var sigvaltype = parseType (sigargSplit[i], fileScope.length ? fileScope : defaultScope);\n var sigvalname = parsePath (sigargSplit[i+1], fileScope);\n if (sigvalname && !sigvalname[0][0])\n sigvalname[0][0] = '(';\n var sigargargpath = tagScope.concat (sigvalname);\n // var sigargargpath = concatPaths (cloneArr (tagScope), sigvalname);\n var sigvalnameStr;\n if (sigvalname && sigvalname.length)\n sigvalnameStr = sigvalname.slice(-1)[0][1];\n insigargs.push ({\n name: sigvalnameStr,\n valtype: sigvaltype,\n path: sigargargpath\n });\n }\n inpathfrags = [ [ ] ];\n } else\n inpathfrags = parsePath (inpathstr, fileScope);\n\n if (inpathfrags[0] && !inpathfrags[0][0])\n if (inpathfrags.length == 1)\n inpathfrags[0][0] = Patterns.delimitersInverse[ctype] || '.';\n else\n inpathfrags[0][0] = '.';\n\n // direct-to-type syntax\n if (!Patterns.innerCtypes.hasOwnProperty (ctype)) {\n valtype = ctype;\n ctype = Patterns.delimiters[inpathfrags[inpathfrags.length-1][0]];\n }\n\n // convert @constuctor to @spare\n if (ctype == 'constructor') {\n ctype = 'spare';\n inpathfrags[inpathfrags.length-1][0] = '~';\n inpathfrags[inpathfrags.length-1][1] = 'constructor';\n }\n\n valtype = parseType (valtype, fileScope.length ? fileScope : defaultScope);\n\n // consume modifiers\n docstr = consumeModifiers (fname, fileScope, tagScope, next, docstr, modifiers);\n\n // some tags affect the scope\n if (ctype == 'module') {\n fileScope.push.apply (fileScope, inpathfrags);\n // tagScope.push.apply (tagScope, inpathfrags);\n }\n if (ctype == 'submodule')\n ctype = 'module';\n\n } while (docstr && (innerMatch = docstr.match (Patterns.innerTag)));\n\n // submit the final match from this tag\n var submissionPath;\n if (\n ctype == 'callback'\n || ctype == 'argument'\n || ctype == 'kwarg'\n || ctype == 'args'\n || ctype == 'kwargs'\n || ctype == 'returns'\n || ctype == 'signature'\n )\n submissionPath = argscope.concat (inpathfrags);\n // submissionPath = concatPaths (argscope, inpathfrags);\n else if (ctype != 'load')\n submissionPath = tagScope.concat (inpathfrags);\n // submissionPath = concatPaths (cloneArr (tagScope), inpathfrags);\n\n // consume modifiers\n docstr = consumeModifiers (fname, fileScope, tagScope, next, docstr, modifiers);\n\n // any chance this is just a @load declaration?\n if (ctype == 'load') {\n var lookupPath =\n inpathfrags[0][1]\n || docstr.replace (/^\\s*/, '').replace (/\\s*$/, '')\n ;\n var filename = pathLib.resolve (pathLib.dirname (fname), lookupPath);\n var loadedDoc;\n if (Object.hasOwnProperty.call (loadedDocuments, filename))\n loadedDoc = loadedDocuments[filename];\n else try {\n context.latency.log ('parsing');\n loadedDoc = fs.readFileSync (filename).toString();\n context.latency.log ('file system');\n } catch (err) {\n context.logger.warn (\n { filename:filename },\n '@load Declaration failed'\n );\n }\n if (loadedDoc)\n lastComponent = context.submit (\n submissionPath,\n { doc: { value:loadedDoc } }\n );\n } else {\n if (\n ctype != 'returns'\n || valtype.length\n || inlineDocStr\n || modifiers.length\n || insigargs\n || submissionPath[submissionPath.length-1][1]\n )\n try {\n lastComponent = context.submit (\n submissionPath,\n {\n ctype: ctype,\n valtype: valtype,\n doc: { value:docstr, context:linkScope },\n modifiers: modifiers,\n sigargs: insigargs\n }\n );\n context.logger.trace ({\n type: ctype,\n file: fname,\n path: submissionPath.map (function(a){ return a[0]+a[1]; }).join('')\n }, 'read declaration');\n } catch (err) {\n context.logger.error (err, 'parsing error');\n return;\n }\n }\n}", "function parseTopLevel() {\n parseBlockBody(TokenType.eof);\n state.scopes.push(new Scope(0, state.tokens.length, true));\n if (state.scopeDepth !== 0) {\n throw new Error(`Invalid scope depth at end of file: ${state.scopeDepth}`);\n }\n return new File(state.tokens, state.scopes);\n}", "doParse(content: string): any {\n let lines = this.getLines(content);\n return this.parseContent(lines);\n }", "function readFile (evt) {\r\n var files = evt.target.files;\r\n var file = files[0]; \r\n Papa.parse(file, {\r\n \tcomplete: function(results) {\r\n \t\tlog(results);\r\n \t}\r\n }, config);\r\n }", "function parse(file: string): ParserReturn {\n if (file.match(/\\.tsx?$/)) {\n return TypeScriptParser.parse(file);\n } else {\n return babylonParser(file);\n }\n}", "@memoize\n get parser() {\n return new TaskList({\n name: `Parsing ${this.type}: ${this.projectName}`,\n tasks: [\n new Task({\n name: `Loading ${this.type}`,\n run: (parentScope) => {\n this.resetCompiled()\n const scope = this.getScope(parentScope)\n this.setState(\"scope\", scope)\n return this.load()\n }\n }),\n TaskList.forEach({\n name: `Parsing imports`,\n list: () => this.activeImports,\n getTask: (file) =>\n new Task({\n name: `Parsing import: ${file.file}`,\n run: () => file.parse(this.scope)\n })\n })\n ]\n })\n }", "parse() {\n while (this.shouldContinue()) {\n const c = this.buffer.charCodeAt(this.index - this.offset);\n switch (this.state) {\n case Tokenizer_State.Text: {\n this.stateText(c);\n break;\n }\n case Tokenizer_State.SpecialStartSequence: {\n this.stateSpecialStartSequence(c);\n break;\n }\n case Tokenizer_State.InSpecialTag: {\n this.stateInSpecialTag(c);\n break;\n }\n case Tokenizer_State.CDATASequence: {\n this.stateCDATASequence(c);\n break;\n }\n case Tokenizer_State.InAttributeValueDq: {\n this.stateInAttributeValueDoubleQuotes(c);\n break;\n }\n case Tokenizer_State.InAttributeName: {\n this.stateInAttributeName(c);\n break;\n }\n case Tokenizer_State.InCommentLike: {\n this.stateInCommentLike(c);\n break;\n }\n case Tokenizer_State.InSpecialComment: {\n this.stateInSpecialComment(c);\n break;\n }\n case Tokenizer_State.BeforeAttributeName: {\n this.stateBeforeAttributeName(c);\n break;\n }\n case Tokenizer_State.InTagName: {\n this.stateInTagName(c);\n break;\n }\n case Tokenizer_State.InClosingTagName: {\n this.stateInClosingTagName(c);\n break;\n }\n case Tokenizer_State.BeforeTagName: {\n this.stateBeforeTagName(c);\n break;\n }\n case Tokenizer_State.AfterAttributeName: {\n this.stateAfterAttributeName(c);\n break;\n }\n case Tokenizer_State.InAttributeValueSq: {\n this.stateInAttributeValueSingleQuotes(c);\n break;\n }\n case Tokenizer_State.BeforeAttributeValue: {\n this.stateBeforeAttributeValue(c);\n break;\n }\n case Tokenizer_State.BeforeClosingTagName: {\n this.stateBeforeClosingTagName(c);\n break;\n }\n case Tokenizer_State.AfterClosingTagName: {\n this.stateAfterClosingTagName(c);\n break;\n }\n case Tokenizer_State.BeforeSpecialS: {\n this.stateBeforeSpecialS(c);\n break;\n }\n case Tokenizer_State.InAttributeValueNq: {\n this.stateInAttributeValueNoQuotes(c);\n break;\n }\n case Tokenizer_State.InSelfClosingTag: {\n this.stateInSelfClosingTag(c);\n break;\n }\n case Tokenizer_State.InDeclaration: {\n this.stateInDeclaration(c);\n break;\n }\n case Tokenizer_State.BeforeDeclaration: {\n this.stateBeforeDeclaration(c);\n break;\n }\n case Tokenizer_State.BeforeComment: {\n this.stateBeforeComment(c);\n break;\n }\n case Tokenizer_State.InProcessingInstruction: {\n this.stateInProcessingInstruction(c);\n break;\n }\n case Tokenizer_State.InNamedEntity: {\n this.stateInNamedEntity(c);\n break;\n }\n case Tokenizer_State.BeforeEntity: {\n this.stateBeforeEntity(c);\n break;\n }\n case Tokenizer_State.InHexEntity: {\n this.stateInHexEntity(c);\n break;\n }\n case Tokenizer_State.InNumericEntity: {\n this.stateInNumericEntity(c);\n break;\n }\n default: {\n // `this._state === State.BeforeNumericEntity`\n this.stateBeforeNumericEntity(c);\n }\n }\n this.index++;\n }\n this.cleanup();\n }", "function LevelParser(filename) {\n //Engine.Object.call(this);\n this.filename = filename;\n }", "function parseWithLocation(content, filename, locationKeyName) {\r\n return _parse(content, filename, locationKeyName);\r\n}", "function parseFile(fileToParse){\n var fs = require('fs');\n var decodedFile = {};\n\n var toDecode = fs.readFileSync(fileToParse);\n\n // pass the byte array into _parse for decoding\n decodedFile = _parse(toDecode).result;\n\n return decodedFile;\n}", "function reqListener() {\n console.log('File loaded: ' + sourceLocation);\n cm.setValue(this.responseText);\n engineStartup();\n }", "load() {\n this.completed = false;\n this.rendered = false;\n\n // Resets variables on load\n this.raw = [];\n this.header = [];\n this.selected = [];\n if (this.chart instanceof Chart) this.chart.destroy();\n\n let readRange = {};\n if (this.fileReadRange != null) readRange = this.getNumColsFromA1(this.fileReadRange);\n console.log(`Will read ${ readRange.numCols > 0 ? 'first ' + readRange.numCols : 'all'} columns and ${ readRange.numRows > 0 ? 'first ' + readRange.numRows : 'all'} rows.`);\n this.fileReadRange = readRange.col + (readRange.numRows > 0 ? readRange.numRows : '');\n \n const selectedFile = document.getElementById('myfile').files[0];\n console.log(selectedFile.name);\n this.fileName = selectedFile.name;\n Papa.parse(selectedFile, {\n skipEmptyLines: true,\n preview: readRange.numRows > 0 ? readRange.numRows : 0,\n complete: (results) => {\n console.log('Finished:', results.data);\n this.raw = results.data;\n this.limitColumns(readRange.numCols > 0 ? readRange.numCols : 0);\n this.header = Array.from(this.raw[0]); // problem: duplicated / null headers\n this.header.shift();\n this.refreshPreview();\n this.completed = true;\n console.log(this.completed);\n }\n });\n }", "function parseData(e) {\r\n const file = e.target.files[0];\r\n\r\n Papa.parse(file, {\r\n dynamicTyping: true,\r\n complete: function(results) {\r\n $('header').hide();\r\n $('main').prepend(`<h1 class=\"tableTitle\">Christopher Duerkes</h1>`);\r\n createTable(results.data);\r\n addEventListeners();\r\n }\r\n });\r\n}", "function parseRawGeometry(asset, cfg, geometryId, ok) {\n /*\n Geometry format\n\n bytes : info\n [0.. 3]: uint32; file type identifer (= 0x11)\n [4.. 7]: uint32; byte-length of padded asset id\n [8..11]: uint32; byte-length of padded morph keys JSON\n [12..15]: uint32; byte-length of positions array\n [16..19]: uint32; byte-length of normals array\n [20..23]: uint32; byte-length of indices array\n [24..27]: uint32; byte-length of uv array\n [28..43]: unit32[4]; unused, reserved for future use\n [ .. ]: text; asset id (tail-padded with empty spaces, e.g. 0x20)\n [ .. ]: text; morph key JSON (tail-padded with 0x20)\n [ .. ]: float32[]; positions array\n [ .. ]: float32[]; normals array\n [ .. ]: int32[]; indices array\n [ .. ]: float32[]; uv array\n */\n\n var index = new Uint32Array(asset, 0, 11);\n\n var assetIdSize = index[1];\n var keysSize = index[2];\n var positionsSize = index[3];\n var normalsSize = index[4];\n var indicesSize = index[5];\n var uvsSize = index[6];\n // var unused = index[7 ... 10];\n\n var assetIdStart = 11 * Uint32Array.BYTES_PER_ELEMENT;\n var keysStart = assetIdStart + assetIdSize;\n var positionsStart = keysStart + keysSize;\n var normalsStart = positionsStart + positionsSize;\n var indicesStart = normalsStart + normalsSize;\n var uvsStart = indicesStart + indicesSize;\n\n var numVertices = 0;\n\n if (positionsSize > 0) {\n cfg.geometry.positions = new Float32Array(asset, positionsStart, positionsSize / Float32Array.BYTES_PER_ELEMENT);\n cfg.boundary = getBoundary(cfg.geometry.positions);\n numVertices = cfg.geometry.positions.length / 3;\n }\n\n if (normalsSize > 0) {\n cfg.geometry.normals = new Float32Array(asset, normalsStart, normalsSize / Float32Array.BYTES_PER_ELEMENT);\n }\n\n if (uvsSize > 0) {\n cfg.geometry.uv = new Float32Array(asset, uvsStart, uvsSize / Float32Array.BYTES_PER_ELEMENT);\n }\n\n if (indicesSize > 0) {\n cfg.geometry.indices = new Uint32Array(asset, indicesStart, indicesSize / Uint32Array.BYTES_PER_ELEMENT);\n if (numVertices <= 256) {\n cfg.geometry.indices = new Uint8Array(cfg.geometry.indices);\n } else if (numVertices <= 65536) {\n cfg.geometry.indices = new Uint16Array(cfg.geometry.indices);\n }\n }\n\n ok(HumanAssetsGeometries.createGeometry(geometryId, cfg));\n }", "function FontParserSVG(rawData) {\n\t this.rawData = rawData;\n\t this._domParser = new DOMParser();\n\t this._document = this._domParser.parseFromString(rawData, 'application/xml');\n\t this._parseFontProperties();\n\t this._parseFontKerning();\n\t }", "parse() {\n return this.parseSection (this.pos);\n}", "function _readFile(evt) {\n //Retrieve the uploaded File\n const file = evt.target.files[0],\n fileReader = new FileReader();\n\n //callback once file loaded, the loaded file is in text format\n fileReader.onload = function(content) {\n\n // Step 1: convert the textfile to obtain HTML DOM object to access the info section\n let toHTMLDOM = convertToHTMLDOM(content);\n\n // Step 2: create a map for the bio obtained via DOM acceess\n fetchVCardData(toHTMLDOM);\n\n // branch to reset the page, when a second file is uploaded\n if (properties.container.childNodes.length > 0) {\n resetPage();\n }\n\n //Step 3: create the network\n createNetwork();\n }\n fileReader.readAsText(file);\n }", "function TextParser() { }", "async load (filePath) {\n console.log(`Deserializing from ${filePath}`)\n this.data = this.formatStrategy.deserialize(\n await fs.readFile(filePath, 'utf-8')\n )\n }", "*_parseLines(lines) {\n const reTag = /^:([0-9]{2}|NS)([A-Z])?:/;\n let tag = null;\n\n for (let i of lines) {\n\n // Detect new tag start\n const match = i.match(reTag);\n if (match || i.startsWith('-}') || i.startsWith('{')) {\n if (tag) {yield tag;} // Yield previous\n tag = match // Start new tag\n ? {\n id: match[1],\n subId: match[2] || '',\n data: [i.substr(match[0].length)]\n }\n : {\n id: 'MB',\n subId: '',\n data: [i.trim()],\n };\n } else { // Add a line to previous tag\n tag.data.push(i);\n }\n }\n\n if (tag) { yield tag; } // Yield last\n }" ]
[ "0.5563817", "0.54014236", "0.54014236", "0.54014236", "0.54014236", "0.54014236", "0.53815776", "0.53685594", "0.5361048", "0.53508544", "0.526773", "0.52418554", "0.52402407", "0.5168292", "0.516796", "0.51584196", "0.51400054", "0.51273656", "0.51238674", "0.51143503", "0.5110669", "0.5096612", "0.5084995", "0.50358194", "0.50236064", "0.50198877", "0.5010868", "0.49962887", "0.49905312", "0.49806875", "0.49776477", "0.49556607", "0.4949758", "0.49440938", "0.49232057", "0.49167985", "0.48911986", "0.48804656", "0.4806407", "0.48060504", "0.48028654", "0.47879165", "0.47798657", "0.47730207", "0.47730207", "0.47730207", "0.47730207", "0.47730207", "0.4759532", "0.47539398", "0.47539398", "0.47539398", "0.47522107", "0.47522107", "0.4748619", "0.47453746", "0.47450182", "0.47281173", "0.47246864", "0.4716924", "0.47115806", "0.4693119", "0.46909425", "0.46781224", "0.46781224", "0.4676019", "0.466036", "0.46537542", "0.46407095", "0.46240392", "0.46184602", "0.46179095", "0.46087363", "0.46087363", "0.46063486", "0.4599959", "0.45875302", "0.45760655", "0.45754096", "0.45672745", "0.45610714", "0.45517465", "0.4551201", "0.45446298", "0.4541461", "0.45370662", "0.45302784", "0.4524684", "0.45233724", "0.45225692", "0.4520544", "0.4519211", "0.45152685", "0.45083275", "0.45062083" ]
0.4607834
78
Visit a single node.
function one(node, index, parents) { var result = [] var subresult if (!test || is(node, index, parents[parents.length - 1] || null)) { result = toResult(visitor(node, parents)) if (result[0] === EXIT) { return result } } if (node.children && result[0] !== SKIP) { subresult = toResult(all(node.children, parents.concat(node))) return subresult[0] === EXIT ? subresult : result } return result }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "visitNode(node) { }", "visit() {\n if(this.state) this.state = Node.VISITED;\n }", "function node(){}", "function one(node, index, parent) {\n var result;\n\n index = index || (parent ? 0 : null);\n\n if (!type || node.type === type) {\n result = visitor(node, index, parent || null);\n }\n\n if (node.children && result !== false) {\n return all(node.children, node);\n }\n\n return result;\n }", "function visit(node, fn) {\n if (!node.visited) {\n define(node, 'visited', true);\n return node.nodes ? mapVisit(node.nodes, fn) : fn(node);\n }\n return node;\n}", "function visit(node, fn) {\n if (!node.visited) {\n define(node, 'visited', true);\n return node.nodes ? mapVisit(node.nodes, fn) : fn(node);\n }\n\n return node;\n}", "visit(node, context) {\n if (node instanceof AST) {\n node.visit(this, context);\n }\n else {\n node.visit(this);\n }\n }", "visit(node, context) {\n if (node instanceof AST) {\n node.visit(this, context);\n }\n else {\n node.visit(this);\n }\n }", "function visit(node, fn) {\n if (!node.visited) {\n _define(node, 'visited', true);\n\n return node.nodes ? mapVisit(node.nodes, fn) : fn(node);\n }\n\n return node;\n}", "function visit(node, fn) {\n if (!node.visited) {\n defineProperty$7(node, 'visited', true);\n return node.nodes ? mapVisit$1(node.nodes, fn) : fn(node);\n }\n return node;\n}", "function traverseNodes(node, visitor) {\n traverse(node, null, visitor);\n}", "function one(node) {\n if (node.type === type) {\n callback.call(context, node);\n }\n\n var children = node.children;\n var index = -1;\n var length = children ? children.length : 0;\n\n while (++index < length) {\n one(children[index]);\n }\n }", "function visit(node, fn) {\n return node.nodes ? mapVisit(node.nodes, fn) : fn(node);\n }", "function visit(node, fn) {\n return node.nodes ? mapVisit(node.nodes, fn) : fn(node);\n }", "function visit(node, fn) {\n return node.nodes ? mapVisit(node.nodes, fn) : fn(node);\n }", "function visit(node, fn) {\n return node.nodes ? mapVisit(node.nodes, fn) : fn(node);\n }", "function one(node) {\n var result\n\n if (!type || node.type === type) {\n result = visitor(node, stack.concat())\n }\n\n if (node.children && result !== false) {\n return all(node.children, node)\n }\n\n return result\n }", "function one(node) {\n var result\n\n if (!type || node.type === type) {\n result = visitor(node, stack.concat())\n }\n\n if (node.children && result !== false) {\n return all(node.children, node)\n }\n\n return result\n }", "function one(node) {\n var result\n\n if (!type || node.type === type) {\n result = visitor(node, stack.concat())\n }\n\n if (node.children && result !== false) {\n return all(node.children, node)\n }\n\n return result\n }", "function one(node) {\n var result\n\n if (!type || node.type === type) {\n result = visitor(node, stack.concat())\n }\n\n if (node.children && result !== false) {\n return all(node.children, node)\n }\n\n return result\n }", "function one(node) {\n var result\n\n if (!type || node.type === type) {\n result = visitor(node, stack.concat())\n }\n\n if (node.children && result !== false) {\n return all(node.children, node)\n }\n\n return result\n }", "function one(node) {\n var result\n\n if (!type || node.type === type) {\n result = visitor(node, stack.concat())\n }\n\n if (node.children && result !== false) {\n return all(node.children, node)\n }\n\n return result\n }", "function node() {\n invoke(this);\n }", "function visitedNode(url) {\n\tvar nodeIndex = getNodeIndex(url);\n\tvar node = dataHolder.nodes[nodeIndex];\n\tnode.visited = true;\n}", "function Node() {}", "get node() { return this._node; }", "function Node(){}", "visit(){\n this.visited = true ;\n }", "function one(node, index, parents) {\n var result\n\n if (!test || is(test, node, index, parents[parents.length - 1] || null)) {\n result = visitor(node, parents)\n\n if (result === EXIT) {\n return result\n }\n }\n\n if (node.children && result !== SKIP) {\n return all(node.children, parents.concat(node)) === EXIT ? EXIT : result\n }\n\n return result\n }", "function one(node, index, parents) {\n var result\n\n if (!test || is(test, node, index, parents[parents.length - 1] || null)) {\n result = visitor(node, parents)\n\n if (result === EXIT) {\n return result\n }\n }\n\n if (node.children && result !== SKIP) {\n return all(node.children, parents.concat(node)) === EXIT ? EXIT : result\n }\n\n return result\n }", "trackNodeBy(index, node) {\n return node.id;\n }", "function printNode (value) {\n console.log('Visisted vertex: ' + value)\n}", "function xpath_single_node(context_node, xpath) {\n return document.evaluate( \n xpath + '[1]', \n context_node, null, XPathResult.FIRST_ORDERED_NODE_TYPE, null\n ).singleNodeValue;\n }", "traverse() {\n this.root.visit(this.root);\n }", "function acceptNode()\n {\n return NodeFilter.FILTER_ACCEPT;\n }", "function RNode(){}", "function RNode() {}", "function RNode() {}", "function RNode() {}", "function selectNode() {\n if ((graphTypes[selected] == \"material\") || (graphTypes[selected] == \"process\")) {\n updateAttributes(this);\n } else if (graphTypes[selected] == \"link\") {\n addEdge(this);\n } else if (graphTypes[selected] == \"delete\") {\n deleteNode(this.id);\n }\n}", "visit(node) {\n node.state = 1 /* IN_PROGRESS */;\n for (const edge of Object.values(node.dependencies)) {\n const target = this.nodes[edge.to];\n switch (target.state) {\n case 2 /* VISITED */: break; // Do nothing, since node was already visited\n case 1 /* IN_PROGRESS */:\n this.visitOpenNode(node, target, edge);\n break;\n case 0 /* NOT_VISITED */: this.visit(target);\n }\n }\n if (node.state !== 2 /* VISITED */) {\n node.state = 2 /* VISITED */;\n this.sortedNodeList.push(node.hash);\n }\n }", "function highlightSingleNode(node) {\n d3.select('#type' + node.type + '-group' + node.id)\n .transition()\n .style('opacity', DEFAULT_NODE_EDGE_OPACITY);\n }", "function Visitor(doc) {\n\tthis.stack = [];\n\tthis.parent = doc; //always a list item\n\tthis.node = doc.head();\n\tthis.index = 0;\n\tthis.point = 1;\n\tthis.retained = 0;\n\tthis.ops = []; //to get to the doc\n}", "function VNode() {}", "function TNode() {}", "function TNode() {}", "function TNode() {}", "function TNode(){}", "function visit(node) {\n // Only consider exported nodes\n if (!isNodeExported(node))\n return;\n if (node.kind === ts.SyntaxKind.EnumDeclaration) {\n var enNode = node;\n var symbol = checker.getSymbolAtLocation(enNode.name);\n if (!!symbol && generateDts) {\n visitEnumNode(enNode, symbol);\n }\n }\n else if (node.kind === ts.SyntaxKind.FunctionDeclaration) {\n var fnNode = node;\n var symbol = checker.getSymbolAtLocation(fnNode.name);\n if (!!symbol && generateDts) {\n visitFunctionNode(fnNode, symbol);\n }\n }\n else if (node.kind === ts.SyntaxKind.VariableStatement) {\n var vsNode = node;\n if (vsNode.declarationList.declarations.length > 0) {\n var varNode = vsNode.declarationList.declarations[0];\n var symbol = checker.getSymbolAtLocation(varNode.name);\n if (!!symbol && (generateDts || isSymbolHasComments(symbol))) {\n visitVariableNode(varNode, symbol);\n }\n }\n }\n else if (node.kind === ts.SyntaxKind.ClassDeclaration) {\n // This is a top level class, get its symbol\n var symbol = checker.getSymbolAtLocation(node.name);\n if (!symbol)\n return;\n if (generateDts || isSymbolHasComments(symbol)) {\n visitDocumentedNode(node, symbol);\n }\n }\n else if (node.kind === ts.SyntaxKind.InterfaceDeclaration) {\n // This is a top level class, get its symbol\n var name_1 = node.name;\n var symbol = checker.getSymbolAtLocation(name_1);\n if (generateDts || isSymbolHasComments(symbol) || isOptionsInterface(name_1.text)) {\n visitDocumentedNode(node, symbol);\n }\n }\n else if (node.kind === ts.SyntaxKind.ModuleDeclaration) {\n // This is a namespace, visit its children\n ts.forEachChild(node, visit);\n }\n else if (node.kind === ts.SyntaxKind.ExportDeclaration) {\n visitExportDeclarationNode(node);\n }\n }", "function markIt(node, modeljsav) {\n node.addClass(\"visited\");\n modeljsav.umsg(\"Add node \" + node.value() + \" to the MST\");\n node.highlight();\n }", "function highlightNode(nodeId) {\n var node = myDiagram.findNodeForKey(nodeId++);\n // console.log(node);\n if (node !== null) {\n // make sure the selected node is in the viewport\n myDiagram.scrollToRect(node.actualBounds);\n // move the large yellow node behind the selected node to highlight it\n highlighter.location = new go.Point(\n node.location.x + 40,\n node.location.y + 40\n );\n // console.log(node.location)\n // console.log(highlighter.location)\n }\n}", "function NodeHandler() { }", "function visit(node) {\r\n if (visited.has(node)) {\r\n return;\r\n }\r\n visited.add(node);\r\n var children = graph.get(node);\r\n if (children) {\r\n children.forEach(visit);\r\n }\r\n sorted.push(node);\r\n }", "function get_node(id)\n {\n return indexbyid[id];\n }", "function NodeDef() {}", "function NodeDef() {}", "function NodeDef() {}", "function node(v) {\n\t\t\t\tif (!v.firstChild ||\n\t\t\t\t\tv.firstChild.nodeName === \"#text\") {\n\t\t\t\t\tv = v.textContent.match(/[^\\n]+/);\n\n\t\t\t\t\treturn v != null ? v[0] : \"\";\n\t\t\t\t}\n\n\t\t\t\treturn node(v.firstChild);\n\t\t\t}", "function markIt(node, av) {\n var edge;\n step++;\n node.addedStep = step;\n node.addClass(\"visited\");\n if (av) {\n av.umsg(\"Visit node \" + node.value());\n }\n node.highlight();\n if (av) {\n av.step();\n if (node.prev) {\n av.umsg(\"Add edge (\" + node.prev.value() + \",\" + node.value() +\n \") to the DFS graph\");\n edge = node.edgeFrom(node.prev).css({\"stroke-width\": \"4\", \"stroke\": \"red\"});\n edge.added = true;\n av.step();\n }\n av.stepOption('grade', true);\n }\n }", "function traverseNodes(node) {\n if (node.value) {\n cb(node.value);\n }\n if (node.left) {\n traverseNodes(node.left);\n }\n if (node.right) {\n traverseNodes(node.right);\n }\n }", "function Node() {\r\n this.className = 'Node';\r\n this.id = null;\r\n this.serverId = null;\r\n this.name = null;\r\n this.date = null;\r\n this.duration = null;\r\n this.state = \"closed\";\r\n this.checked = false;\r\n this.traverseToken = null;\r\n // Means node has no children.\r\n this.leaf = false;\r\n // for editing node: information source\r\n this.source = null;\r\n // the flag is this node belongs to user\r\n this.belongsToUser = false;\r\n // this node is currently edited\r\n this.edited = false;\r\n // key which would be shared\r\n this.shareId = null;\r\n}", "function Node() {\n}", "function RNode() { }", "function RNode() { }", "function markIt(node, av) {\n var edge;\n step++;\n node.addedStep = step;\n node.addClass(\"visited\");\n if (av) {\n av.umsg(\"Visit node \" + node.value());\n }\n node.highlight();\n if (av) {\n av.step();\n if (node.prev) {\n av.umsg(\"Add edge (\" + node.prev.value() + \",\" + node.value() +\n \") to the DFS graph\");\n edge = node.edgeFrom(node.prev).css({\"stroke-width\": \"4\", \"stroke\": \"red\"});\n edge.added = true;\n av.step();\n }\n av.stepOption('grade', true);\n }\n }", "link() {\n //the act of walking causes the nodes to be linked\n this.walk(() => { }, {\n walkMode: visitors_1.WalkMode.visitAllRecursive\n });\n }", "function Node() {\n }", "function VertexNode( point ) {\n\n\t\tthis.point = point;\n\t\tthis.prev = null;\n\t\tthis.next = null;\n\t\tthis.face = null; // the face that is able to see this vertex\n\n\t}", "function NodeDef(){}", "getNodeValue() {}", "function visit() {\n if (this.isBlacklisted()) return false;\n if (this.opts.shouldSkip && this.opts.shouldSkip(this)) return false;\n\n this.call(\"enter\");\n\n if (this.shouldSkip) {\n return this.shouldStop;\n }\n\n var node = this.node;\n var opts = this.opts;\n\n if (node) {\n if (Array.isArray(node)) {\n // traverse over these replacement nodes we purposely don't call exitNode\n // as the original node has been destroyed\n for (var i = 0; i < node.length; i++) {\n _index2[\"default\"].node(node[i], opts, this.scope, this.state, this, this.skipKeys);\n }\n } else {\n _index2[\"default\"].node(node, opts, this.scope, this.state, this, this.skipKeys);\n this.call(\"exit\");\n }\n }\n\n return this.shouldStop;\n}", "function node(val){\n\tthis.val = val;\n\tthis.next = null;\n}", "function Node(){\n\t\tthis.setup();\n\t\tthis;\n\t}", "function VertexNode( point ) {\n\n\t\t\tthis.point = point;\n\t\t\tthis.prev = null;\n\t\t\tthis.next = null;\n\t\t\tthis.face = null; // the face that is able to see this vertex\n\n\t\t}", "function visit(node, visitor) {\n const visitor_ = initVisitor(visitor);\n if (identity.isDocument(node)) {\n const cd = visit_(null, node.contents, visitor_, Object.freeze([node]));\n if (cd === REMOVE)\n node.contents = null;\n }\n else\n visit_(null, node, visitor_, Object.freeze([]));\n}", "function SelectNode(nodeId){\n var nodeObj = $(\"#\"+nodeId).val();\n $(\"#divTree\").jstree(\"select_node\", nodeObj, null, null); \n}", "function node(x, y, parent_index, g, h, f)\n{\n\tthis.x = x;\n\tthis.y = y;\n\tthis.parent_index = parent_index;\n\tthis.g = g;\n\tthis.h = h;\n\tthis.f = f;\n}", "function Node(value) {\n\n this.value = value;\n this.edges = [];\n this.searched = false;\n this.parent = null;\n\n\n }", "function Node(data) {\n this.data = data;\n}", "function highlightGraphNode( node, on )\n {\n //if( d3.event.shiftKey ) on = false; // for debugging\n\n // If we are to activate a movie, and there's already one active,\n // first switch that one off\n if( on && activeMovie !== undefined ) {\n \t highlightGraphNode( nodeArray[activeMovie], false );\n }\n\n // locate the SVG nodes: circle & label group\n circle = d3.select( '#c' + node.index );\n label = d3.select( '#l' + node.index );\n\n // activate/deactivate the node itself\n circle\n\t.classed( 'main', on );\n label\n\t.classed( 'on', on || currentZoom >= SHOW_THRESHOLD );\n label.selectAll('text')\n\t.classed( 'main', on );\n\n // activate all siblings\n Object(node.links).forEach( function(id) {\n\td3.select(\"#c\"+id).classed( 'sibling', on );\n\tlabel = d3.select('#l'+id);\n\tlabel.classed( 'on', on || currentZoom >= SHOW_THRESHOLD );\n\tlabel.selectAll('text.nlabel')\n\t .classed( 'sibling', on );\n } );\n\n // set the value for the current active movie\n activeMovie = on ? node.index : undefined;\n }", "function NodeVisitor() {\n _classCallCheck(this, NodeVisitor);\n\n this[path] = [];\n }", "function visit(node, visitor) {\n const visitor_ = initVisitor(visitor);\n if (isDocument(node)) {\n const cd = visit_(null, node.contents, visitor_, Object.freeze([node]));\n if (cd === REMOVE)\n node.contents = null;\n }\n else\n visit_(null, node, visitor_, Object.freeze([]));\n }", "function visit() {\n\t if (this.isBlacklisted()) return false;\n\t if (this.opts.shouldSkip && this.opts.shouldSkip(this)) return false;\n\n\t this.call(\"enter\");\n\n\t if (this.shouldSkip) {\n\t return this.shouldStop;\n\t }\n\n\t var node = this.node;\n\t var opts = this.opts;\n\n\t if (node) {\n\t if (Array.isArray(node)) {\n\t // traverse over these replacement nodes we purposely don't call exitNode\n\t // as the original node has been destroyed\n\t for (var i = 0; i < node.length; i++) {\n\t _index2[\"default\"].node(node[i], opts, this.scope, this.state, this, this.skipKeys);\n\t }\n\t } else {\n\t _index2[\"default\"].node(node, opts, this.scope, this.state, this, this.skipKeys);\n\t this.call(\"exit\");\n\t }\n\t }\n\n\t return this.shouldStop;\n\t}", "function visit() {\n\t if (this.isBlacklisted()) return false;\n\t if (this.opts.shouldSkip && this.opts.shouldSkip(this)) return false;\n\n\t this.call(\"enter\");\n\n\t if (this.shouldSkip) {\n\t return this.shouldStop;\n\t }\n\n\t var node = this.node;\n\t var opts = this.opts;\n\n\t if (node) {\n\t if (Array.isArray(node)) {\n\t // traverse over these replacement nodes we purposely don't call exitNode\n\t // as the original node has been destroyed\n\t for (var i = 0; i < node.length; i++) {\n\t _index2[\"default\"].node(node[i], opts, this.scope, this.state, this, this.skipKeys);\n\t }\n\t } else {\n\t _index2[\"default\"].node(node, opts, this.scope, this.state, this, this.skipKeys);\n\t this.call(\"exit\");\n\t }\n\t }\n\n\t return this.shouldStop;\n\t}", "function Node(value){\n this.value =value;\n this.next = null;\n this.id = null;\n}", "function selectSingleNode(xPath,params){\r\n\t\tparams=params||{}; params['type']=9;\r\n\t\treturn selectNodes(xPath,params).singleNodeValue;\r\n\t}", "function selectSingleNode(xPath,params){\r\n\t\tparams=params||{}; params['type']=9;\r\n\t\treturn selectNodes(xPath,params).singleNodeValue;\r\n\t}", "function selectSingleNode(xPath,params){\r\n\t\tparams=params||{}; params['type']=9;\r\n\t\treturn selectNodes(xPath,params).singleNodeValue;\r\n\t}", "function NodeDef() { }", "function NodeDef() { }", "function Node (value) {\n this.value = value;\n this.next = null;\n}", "function handleMouseClickNode(d) {\n var data = data_display.getNearLinksAndNodes(d, links);\n data_display.highlightElements(data, d, svg);\n data_display.getInfoForSelectedNode($element, d);\n exposeSiblingNodes(data.nodes);\n }", "function printOne(v) {\n if (visited[v] == 0) {\n\n dfs(v);\n }\n }", "getNode() {\n throw new Error(\"Must be implemented\");\n }", "function Node(value) {\n this.value = value;\n this.next = null;\n}", "function depthFirst(node, visited = new Set()) {\n if (visited.has(node.val)) return; //base case\n visited.add(node.val);\n console.log(node.val);\n node.neighbors.forEach((neighbor) => depthFirst(neighbor, visted));\n}", "function doVisitFull(visit, node) {\n if(node.left) {\n var v = doVisitFull(visit, node.left)\n if(v) { return v }\n }\n var v = visit(node.key, node.value)\n if(v) { return v }\n if(node.right) {\n return doVisitFull(visit, node.right)\n }\n}", "function doVisitFull(visit, node) {\n if(node.left) {\n var v = doVisitFull(visit, node.left)\n if(v) { return v }\n }\n var v = visit(node.key, node.value)\n if(v) { return v }\n if(node.right) {\n return doVisitFull(visit, node.right)\n }\n}", "function doVisitFull(visit, node) {\n if(node.left) {\n var v = doVisitFull(visit, node.left)\n if(v) { return v }\n }\n var v = visit(node.key, node.value)\n if(v) { return v }\n if(node.right) {\n return doVisitFull(visit, node.right)\n }\n}", "function doVisitFull(visit, node) {\n if(node.left) {\n var v = doVisitFull(visit, node.left)\n if(v) { return v }\n }\n var v = visit(node.key, node.value)\n if(v) { return v }\n if(node.right) {\n return doVisitFull(visit, node.right)\n }\n}", "function doVisitFull(visit, node) {\n if(node.left) {\n var v = doVisitFull(visit, node.left)\n if(v) { return v }\n }\n var v = visit(node.key, node.value)\n if(v) { return v }\n if(node.right) {\n return doVisitFull(visit, node.right)\n }\n}" ]
[ "0.7661173", "0.6445177", "0.64438576", "0.62799275", "0.61086637", "0.6075337", "0.6050634", "0.6050634", "0.60447025", "0.59705806", "0.5951017", "0.59241366", "0.59029406", "0.59029406", "0.59029406", "0.59029406", "0.58092374", "0.58092374", "0.58092374", "0.58092374", "0.58092374", "0.58092374", "0.5638122", "0.5634819", "0.56231177", "0.5618358", "0.56083405", "0.56052923", "0.56012523", "0.56012523", "0.557841", "0.54742527", "0.54182273", "0.5396234", "0.5384098", "0.53541404", "0.53203416", "0.53203416", "0.53203416", "0.52719855", "0.52649283", "0.5262126", "0.5243119", "0.5201253", "0.5189972", "0.5189972", "0.5189972", "0.5165522", "0.5163557", "0.5131042", "0.5128941", "0.51285887", "0.5114775", "0.5075901", "0.50638694", "0.50638694", "0.50638694", "0.5057978", "0.5054426", "0.50467837", "0.50438815", "0.5038807", "0.5036836", "0.5036836", "0.50325066", "0.5023742", "0.5014729", "0.5013049", "0.5012683", "0.50086606", "0.49914277", "0.49758056", "0.49576145", "0.49546307", "0.4951027", "0.49153227", "0.49142677", "0.49141124", "0.4914059", "0.4913577", "0.49127087", "0.49102014", "0.4905613", "0.4905613", "0.4902319", "0.48940614", "0.48940614", "0.48940614", "0.48884943", "0.48884943", "0.48719746", "0.48632544", "0.48566177", "0.4852583", "0.48490554", "0.48469722", "0.48363703", "0.48363703", "0.48363703", "0.48363703", "0.48363703" ]
0.0
-1