Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| class MinHeap { | |
| constructor (comparator = (a, b) => a - b) { | |
| this._data = [] | |
| this._comparator = comparator | |
| } | |
| push (...values) { | |
| for (const v of values) { | |
| let cIndex = this._data.push(v) - 1 | |
| while (cIndex > 0) { |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| function delay (invoke, ms) { | |
| return (...args) => new Promise(resolve => { | |
| setTimeout(resolve, ms) | |
| }).then(() => invoke.apply(...args)) | |
| } | |
| function delay2 (invoke, ms) { | |
| return (...args) => new Promise(resolve => { | |
| setTimeout(resolve, ms, invoke(...args)) | |
| }) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Promise.waterfall = function (array, invoke) { | |
| let pending = Promise.resolve() | |
| const results = [] | |
| for (const item of array) { | |
| pending = pending | |
| .then(() => invoke(item, i)) | |
| .then(result => results.push(result)) | |
| } | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <template> | |
| <div class="tooltip" :style="style"> | |
| <slot></slot> | |
| </div> | |
| </template> | |
| <script> | |
| export default { | |
| props: { | |
| target: { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| const readline = require('readline') | |
| const fs = require('fs') | |
| module.exports = function (...args) { | |
| const transforms = [] | |
| let state = 'pending' | |
| let error = null | |
| const rl = readline.createInterface({ | |
| input: fs.createReadStream(...args) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <template> | |
| <video class="object-fit-video" v-bind="$attrs" v-on="$listeners" :style="videoStyle"> | |
| <slot></slot> | |
| </video> | |
| </template> | |
| <script> | |
| const supportsObjectFit = window.CSS && window.CSS.supports && | |
| window.CSS.supports('object-fit', 'cover') && | |
| !/Edge/.test(window.navigator.userAgent) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| const Promise = window.Promise || (function () { | |
| function PromiseLike (init) { | |
| let state = 'pending' | |
| let resolved, error | |
| const pendingResolve = [] | |
| const pendingReject = [] | |
| function resolve (value) { | |
| state = 'resolved' | |
| resolved = value | |
| pendingResolve.forEach(function (fn) { fn(value) }) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import TweenLite from 'gsap/TweenLite' | |
| import {_ANIMATE_, currentAnimations, defaultConfig} from './shared' | |
| export default function (Target, animatedProps = []) { | |
| if (animatedProps.length === 0) return Target | |
| const props = { | |
| animation: Object | |
| } | |
| animatedProps.forEach(prop => { props[prop] = null }) |