diff --git a/Phaser/AnimationManager.d.ts b/Phaser/AnimationManager.d.ts new file mode 100644 index 00000000..f8e535b0 --- /dev/null +++ b/Phaser/AnimationManager.d.ts @@ -0,0 +1,28 @@ +/// +/// +/// +/// +/// +/// +module Phaser { + class AnimationManager { + constructor(game: Game, parent: Sprite); + private _game; + private _parent; + private _anims; + private _frameIndex; + private _frameData; + public currentAnim: Animation; + public currentFrame: Frame; + public loadFrameData(frameData: FrameData): void; + public add(name: string, frames?: any[], frameRate?: number, loop?: bool, useNumericIndex?: bool): void; + private validateFrames(frames, useNumericIndex); + public play(name: string, frameRate?: number, loop?: bool): void; + public stop(name: string): void; + public update(): void; + public frameData : FrameData; + public frameTotal : number; + public frame : number; + public frameName : string; + } +} diff --git a/Phaser/Basic.d.ts b/Phaser/Basic.d.ts new file mode 100644 index 00000000..80795a46 --- /dev/null +++ b/Phaser/Basic.d.ts @@ -0,0 +1,23 @@ +/// +module Phaser { + class Basic { + constructor(game: Game); + public _game: Game; + public name: string; + public ID: number; + public isGroup: bool; + public exists: bool; + public active: bool; + public visible: bool; + public alive: bool; + public ignoreDrawDebug: bool; + public destroy(): void; + public preUpdate(): void; + public update(): void; + public postUpdate(): void; + public render(camera: Camera, cameraOffsetX: number, cameraOffsetY: number): void; + public kill(): void; + public revive(): void; + public toString(): string; + } +} diff --git a/Phaser/Cache.d.ts b/Phaser/Cache.d.ts new file mode 100644 index 00000000..5a3f6a02 --- /dev/null +++ b/Phaser/Cache.d.ts @@ -0,0 +1,26 @@ +/// +module Phaser { + class Cache { + constructor(game: Game); + private _game; + private _canvases; + private _images; + private _sounds; + private _text; + public addCanvas(key: string, canvas: HTMLCanvasElement, context: CanvasRenderingContext2D): void; + public addSpriteSheet(key: string, url: string, data, frameWidth: number, frameHeight: number, frameMax: number): void; + public addTextureAtlas(key: string, url: string, data, jsonData): void; + public addImage(key: string, url: string, data): void; + public addSound(key: string, url: string, data): void; + public decodedSound(key: string, data): void; + public addText(key: string, url: string, data): void; + public getCanvas(key: string); + public getImage(key: string); + public getFrameData(key: string): FrameData; + public getSound(key: string); + public isSoundDecoded(key: string): bool; + public isSpriteSheet(key: string): bool; + public getText(key: string); + public destroy(): void; + } +} diff --git a/Phaser/CameraManager.d.ts b/Phaser/CameraManager.d.ts new file mode 100644 index 00000000..12f16417 --- /dev/null +++ b/Phaser/CameraManager.d.ts @@ -0,0 +1,17 @@ +/// +/// +module Phaser { + class CameraManager { + constructor(game: Game, x: number, y: number, width: number, height: number); + private _game; + private _cameras; + private _cameraInstance; + public current: Camera; + public getAll(): Camera[]; + public update(): void; + public render(): void; + public addCamera(x: number, y: number, width: number, height: number): Camera; + public removeCamera(id: number): bool; + public destroy(): void; + } +} diff --git a/Phaser/Collision.d.ts b/Phaser/Collision.d.ts new file mode 100644 index 00000000..af37f01a --- /dev/null +++ b/Phaser/Collision.d.ts @@ -0,0 +1,53 @@ +/// +/// +/// +/// +/// +/// +/// +/// +module Phaser { + class Collision { + constructor(game: Game); + private _game; + static LEFT: number; + static RIGHT: number; + static UP: number; + static DOWN: number; + static NONE: number; + static CEILING: number; + static FLOOR: number; + static WALL: number; + static ANY: number; + static OVERLAP_BIAS: number; + static TILE_OVERLAP: bool; + static _tempBounds: Quad; + static lineToLine(line1: Line, line2: Line, output?: IntersectResult): IntersectResult; + static lineToLineSegment(line: Line, seg: Line, output?: IntersectResult): IntersectResult; + static lineToRawSegment(line: Line, x1: number, y1: number, x2: number, y2: number, output?: IntersectResult): IntersectResult; + static lineToRay(line1: Line, ray: Line, output?: IntersectResult): IntersectResult; + static lineToCircle(line: Line, circle: Circle, output?: IntersectResult): IntersectResult; + static lineToRectangle(line: Line, rect: Rectangle, output?: IntersectResult): IntersectResult; + static lineSegmentToLineSegment(line1: Line, line2: Line, output?: IntersectResult): IntersectResult; + static lineSegmentToRay(line: Line, ray: Line, output?: IntersectResult): IntersectResult; + static lineSegmentToCircle(seg: Line, circle: Circle, output?: IntersectResult): IntersectResult; + static lineSegmentToRectangle(seg: Line, rect: Rectangle, output?: IntersectResult): IntersectResult; + static rayToRectangle(ray: Line, rect: Rectangle, output?: IntersectResult): IntersectResult; + static rayToLineSegment(rayX1, rayY1, rayX2, rayY2, lineX1, lineY1, lineX2, lineY2, output?: IntersectResult): IntersectResult; + static pointToRectangle(point, rect: Rectangle, output?: IntersectResult): IntersectResult; + static rectangleToRectangle(rect1: Rectangle, rect2: Rectangle, output?: IntersectResult): IntersectResult; + static rectangleToCircle(rect: Rectangle, circle: Circle, output?: IntersectResult): IntersectResult; + static circleToCircle(circle1: Circle, circle2: Circle, output?: IntersectResult): IntersectResult; + static circleToRectangle(circle: Circle, rect: Rectangle, output?: IntersectResult): IntersectResult; + static circleContainsPoint(circle: Circle, point, output?: IntersectResult): IntersectResult; + public overlap(object1?: Basic, object2?: Basic, notifyCallback?, processCallback?): bool; + static separate(object1, object2): bool; + static separateTile(object: GameObject, x: number, y: number, width: number, height: number, mass: number, collideLeft: bool, collideRight: bool, collideUp: bool, collideDown: bool): bool; + static separateTileX(object: GameObject, x: number, y: number, width: number, height: number, mass: number, collideLeft: bool, collideRight: bool): bool; + static separateTileY(object: GameObject, x: number, y: number, width: number, height: number, mass: number, collideUp: bool, collideDown: bool): bool; + static separateX(object1, object2): bool; + static separateY(object1, object2): bool; + static distance(x1: number, y1: number, x2: number, y2: number): number; + static distanceSquared(x1: number, y1: number, x2: number, y2: number): number; + } +} diff --git a/Phaser/DynamicTexture.d.ts b/Phaser/DynamicTexture.d.ts new file mode 100644 index 00000000..4e499c14 --- /dev/null +++ b/Phaser/DynamicTexture.d.ts @@ -0,0 +1,32 @@ +/// +module Phaser { + class DynamicTexture { + constructor(game: Game, width: number, height: number); + private _game; + private _sx; + private _sy; + private _sw; + private _sh; + private _dx; + private _dy; + private _dw; + private _dh; + public bounds: Rectangle; + public canvas: HTMLCanvasElement; + public context: CanvasRenderingContext2D; + public getPixel(x: number, y: number): number; + public getPixel32(x: number, y: number): number; + public getPixels(rect: Rectangle): ImageData; + public setPixel(x: number, y: number, color: number): void; + public setPixel32(x: number, y: number, color: number): void; + public setPixels(rect: Rectangle, input): void; + public fillRect(rect: Rectangle, color: number): void; + public pasteImage(key: string, frame?: number, destX?: number, destY?: number, destWidth?: number, destHeight?: number): void; + public copyPixels(sourceTexture: DynamicTexture, sourceRect: Rectangle, destPoint: Point): void; + public clear(): void; + public width : number; + public height : number; + private getColor32(alpha, red, green, blue); + private getColor(red, green, blue); + } +} diff --git a/Phaser/FXManager.d.ts b/Phaser/FXManager.d.ts new file mode 100644 index 00000000..4a202ca2 --- /dev/null +++ b/Phaser/FXManager.d.ts @@ -0,0 +1,18 @@ +/// +module Phaser { + class FXManager { + constructor(game: Game); + private _fx; + private _length; + private _game; + public active: bool; + public visible: bool; + public add(effect): any; + public preUpdate(): void; + public postUpdate(): void; + public preRender(camera: Camera, cameraX: number, cameraY: number, cameraWidth: number, cameraHeight: number): void; + public render(camera: Camera, cameraX: number, cameraY: number, cameraWidth: number, cameraHeight: number): void; + public postRender(camera: Camera, cameraX: number, cameraY: number, cameraWidth: number, cameraHeight: number): void; + public destroy(): void; + } +} diff --git a/Phaser/FXManager.ts b/Phaser/FXManager.ts new file mode 100644 index 00000000..af76b90c --- /dev/null +++ b/Phaser/FXManager.ts @@ -0,0 +1,220 @@ +/// + +/** +* Phaser - FXManager +* +* The FXManager controls all special effects applied to game objects such as Cameras. +*/ + +module Phaser { + + export class FXManager { + + constructor(game: Game, parent) { + + this._game = game; + this._parent = parent; + this._fx = []; + + this.active = true; + this.visible = true; + + } + + /** + * The essential reference to the main game object. + */ + private _game: Game; + + /** + * A reference to the object that owns this FXManager instance. + */ + private _parent; + + /** + * The array in which we keep all of the registered FX + */ + private _fx; + + /** + * Holds the size of the _fx array + */ + private _length: number; + + /** + * Controls whether any of the FX have preUpdate, update or postUpdate called + */ + public active: bool; + + /** + * Controls whether any of the FX have preRender, render or postRender called + */ + public visible: bool; + + /** + * Adds a new FX to the FXManager. + * The effect must be an object with at least one of the following methods: preUpdate, postUpdate, preRender, render or postRender. + * A new instance of the effect will be created and a reference to Game will be passed to the object constructor. + */ + public add(effect): any { + + var result: bool = false; + var newEffect = { effect: {}, preUpdate: false, postUpdate: false, preRender: false, render: false, postRender: false }; + + if (typeof effect === 'function') + { + newEffect.effect = new effect(this._game, this._parent); + } + else + { + throw new Error("Invalid object given to Phaser.FXManager.add"); + } + + // Check for methods now to avoid having to do this every loop + + if (typeof newEffect.effect['preUpdate'] === 'function') + { + newEffect.preUpdate = true; + result = true; + } + + if (typeof newEffect.effect['postUpdate'] === 'function') + { + newEffect.postUpdate = true; + result = true; + } + + if (typeof newEffect.effect['preRender'] === 'function') + { + newEffect.preRender = true; + result = true; + } + + if (typeof newEffect.effect['render'] === 'function') + { + newEffect.render = true; + result = true; + } + + if (typeof newEffect.effect['postRender'] === 'function') + { + newEffect.postRender = true; + result = true; + } + + if (result == true) + { + this._length = this._fx.push(newEffect); + + return newEffect.effect; + } + else + { + return result; + } + + } + + /** + * Pre-update is called at the start of the objects update cycle, before any other updates have taken place. + */ + public preUpdate() { + + if (this.active) + { + for (var i = 0; i < this._length; i++) + { + if (this._fx[i].preUpdate) + { + this._fx[i].effect.preUpdate(); + } + } + } + + } + + /** + * Post-update is called at the end of the objects update cycle, after other update logic has taken place. + */ + public postUpdate() { + + if (this.active) + { + for (var i = 0; i < this._length; i++) + { + if (this._fx[i].postUpdate) + { + this._fx[i].effect.postUpdate(); + } + } + } + + } + + /** + * Pre-render is called at the start of the object render cycle, before any transforms have taken place. + * It happens directly AFTER a canvas context.save has happened if added to a Camera. + */ + public preRender(camera:Camera, cameraX: number, cameraY: number, cameraWidth: number, cameraHeight: number) { + + if (this.visible) + { + for (var i = 0; i < this._length; i++) + { + if (this._fx[i].preRender) + { + this._fx[i].effect.preRender(camera, cameraX, cameraY, cameraWidth, cameraHeight); + } + } + } + + } + + /** + * render is called during the objects render cycle, right after all transforms have finished, but before any children/image data is rendered. + */ + public render(camera:Camera, cameraX: number, cameraY: number, cameraWidth: number, cameraHeight: number) { + + if (this.visible) + { + for (var i = 0; i < this._length; i++) + { + if (this._fx[i].preRender) + { + this._fx[i].effect.preRender(camera, cameraX, cameraY, cameraWidth, cameraHeight); + } + } + } + + } + + /** + * Post-render is called during the objects render cycle, after the children/image data has been rendered. + * It happens directly BEFORE a canvas context.restore has happened if added to a Camera. + */ + public postRender(camera:Camera, cameraX: number, cameraY: number, cameraWidth: number, cameraHeight: number) { + + if (this.visible) + { + for (var i = 0; i < this._length; i++) + { + if (this._fx[i].postRender) + { + this._fx[i].effect.postRender(camera, cameraX, cameraY, cameraWidth, cameraHeight); + } + } + } + + } + + /** + * Clear down this FXManager and null out references + */ + public destroy() { + this._game = null; + this._fx = null; + } + + } + +} diff --git a/Phaser/Game.d.ts b/Phaser/Game.d.ts new file mode 100644 index 00000000..e9a63ebc --- /dev/null +++ b/Phaser/Game.d.ts @@ -0,0 +1,88 @@ +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +module Phaser { + class Game { + constructor(callbackContext, parent?: string, width?: number, height?: number, initCallback?, createCallback?, updateCallback?, renderCallback?); + private _raf; + private _maxAccumulation; + private _accumulator; + private _step; + private _loadComplete; + private _paused; + private _pendingState; + public callbackContext; + public onInitCallback; + public onCreateCallback; + public onUpdateCallback; + public onRenderCallback; + public onPausedCallback; + public cache: Cache; + public collision: Collision; + public input: Input; + public loader: Loader; + public math: GameMath; + public motion: Motion; + public sound: SoundManager; + public stage: Stage; + public time: Time; + public tweens: TweenManager; + public world: World; + public rnd: RandomDataGenerator; + public device: Device; + public isBooted: bool; + public isRunning: bool; + private boot(parent, width, height); + private loadComplete(); + private bootLoop(); + private pausedLoop(); + private loop(); + private startState(); + public setCallbacks(initCallback?, createCallback?, updateCallback?, renderCallback?): void; + public switchState(state, clearWorld?: bool, clearCache?: bool): void; + public destroy(): void; + public paused : bool; + public framerate : number; + public createCamera(x: number, y: number, width: number, height: number): Camera; + public createGeomSprite(x: number, y: number): GeomSprite; + public createSprite(x: number, y: number, key?: string): Sprite; + public createDynamicTexture(width: number, height: number): DynamicTexture; + public createGroup(MaxSize?: number): Group; + public createParticle(): Particle; + public createEmitter(x?: number, y?: number, size?: number): Emitter; + public createScrollZone(key: string, x?: number, y?: number, width?: number, height?: number): ScrollZone; + public createTilemap(key: string, mapData: string, format: number, resizeWorld?: bool, tileWidth?: number, tileHeight?: number): Tilemap; + public createTween(obj): Tween; + public collide(objectOrGroup1?: Basic, objectOrGroup2?: Basic, notifyCallback?): bool; + public camera : Camera; + } +} diff --git a/Phaser/Game.ts b/Phaser/Game.ts index 79de3d29..f8fa2690 100644 --- a/Phaser/Game.ts +++ b/Phaser/Game.ts @@ -4,6 +4,7 @@ /// /// /// +/// /// /// /// diff --git a/Phaser/GameMath.d.ts b/Phaser/GameMath.d.ts new file mode 100644 index 00000000..50b05b2a --- /dev/null +++ b/Phaser/GameMath.d.ts @@ -0,0 +1,110 @@ +/// +module Phaser { + class GameMath { + constructor(game: Game); + private _game; + static PI: number; + static PI_2: number; + static PI_4: number; + static PI_8: number; + static PI_16: number; + static TWO_PI: number; + static THREE_PI_2: number; + static E: number; + static LN10: number; + static LN2: number; + static LOG10E: number; + static LOG2E: number; + static SQRT1_2: number; + static SQRT2: number; + static DEG_TO_RAD: number; + static RAD_TO_DEG: number; + static B_16: number; + static B_31: number; + static B_32: number; + static B_48: number; + static B_53: number; + static B_64: number; + static ONE_THIRD: number; + static TWO_THIRDS: number; + static ONE_SIXTH: number; + static COS_PI_3: number; + static SIN_2PI_3: number; + static CIRCLE_ALPHA: number; + static ON: bool; + static OFF: bool; + static SHORT_EPSILON: number; + static PERC_EPSILON: number; + static EPSILON: number; + static LONG_EPSILON: number; + public cosTable: any[]; + public sinTable: any[]; + public fuzzyEqual(a: number, b: number, epsilon?: number): bool; + public fuzzyLessThan(a: number, b: number, epsilon?: number): bool; + public fuzzyGreaterThan(a: number, b: number, epsilon?: number): bool; + public fuzzyCeil(val: number, epsilon?: number): number; + public fuzzyFloor(val: number, epsilon?: number): number; + public average(...args: any[]): number; + public slam(value: number, target: number, epsilon?: number): number; + public percentageMinMax(val: number, max: number, min?: number): number; + public sign(n: number): number; + public truncate(n: number): number; + public shear(n: number): number; + public wrap(val: number, max: number, min?: number): number; + public arithWrap(value: number, max: number, min?: number): number; + public clamp(input: number, max: number, min?: number): number; + public snapTo(input: number, gap: number, start?: number): number; + public snapToFloor(input: number, gap: number, start?: number): number; + public snapToCeil(input: number, gap: number, start?: number): number; + public snapToInArray(input: number, arr: number[], sort?: bool): number; + public roundTo(value: number, place?: number, base?: number): number; + public floorTo(value: number, place?: number, base?: number): number; + public ceilTo(value: number, place?: number, base?: number): number; + public interpolateFloat(a: number, b: number, weight: number): number; + public radiansToDegrees(angle: number): number; + public degreesToRadians(angle: number): number; + public angleBetween(x1: number, y1: number, x2: number, y2: number): number; + public normalizeAngle(angle: number, radians?: bool): number; + public nearestAngleBetween(a1: number, a2: number, radians?: bool): number; + public normalizeAngleToAnother(dep: number, ind: number, radians?: bool): number; + public normalizeAngleAfterAnother(dep: number, ind: number, radians?: bool): number; + public normalizeAngleBeforeAnother(dep: number, ind: number, radians?: bool): number; + public interpolateAngles(a1: number, a2: number, weight: number, radians?: bool, ease?): number; + public logBaseOf(value: number, base: number): number; + public GCD(m: number, n: number): number; + public LCM(m: number, n: number): number; + public factorial(value: number): number; + public gammaFunction(value: number): number; + public fallingFactorial(base: number, exp: number): number; + public risingFactorial(base: number, exp: number): number; + public binCoef(n: number, k: number): number; + public risingBinCoef(n: number, k: number): number; + public chanceRoll(chance?: number): bool; + public maxAdd(value: number, amount: number, max: number): number; + public minSub(value: number, amount: number, min: number): number; + public wrapValue(value: number, amount: number, max: number): number; + public randomSign(): number; + public isOdd(n: number): bool; + public isEven(n: number): bool; + public wrapAngle(angle: number): number; + public angleLimit(angle: number, min: number, max: number): number; + public linearInterpolation(v, k); + public bezierInterpolation(v, k): number; + public catmullRomInterpolation(v, k); + public linear(p0, p1, t); + public bernstein(n, i): number; + public catmullRom(p0, p1, p2, p3, t); + public difference(a: number, b: number): number; + public globalSeed: number; + public random(): number; + public srand(Seed: number): number; + public getRandom(Objects, StartIndex?: number, Length?: number); + public floor(Value: number): number; + public ceil(Value: number): number; + public sinCosGenerator(length: number, sinAmplitude?: number, cosAmplitude?: number, frequency?: number): any[]; + public shiftSinTable(): number; + public shiftCosTable(): number; + public vectorLength(dx: number, dy: number): number; + public dotProduct(ax: number, ay: number, bx: number, by: number): number; + } +} diff --git a/Phaser/Group.d.ts b/Phaser/Group.d.ts new file mode 100644 index 00000000..1c60bb4a --- /dev/null +++ b/Phaser/Group.d.ts @@ -0,0 +1,39 @@ +/// +/// +module Phaser { + class Group extends Basic { + constructor(game: Game, MaxSize?: number); + static ASCENDING: number; + static DESCENDING: number; + public members: Basic[]; + public length: number; + private _maxSize; + private _marker; + private _sortIndex; + private _sortOrder; + public destroy(): void; + public update(): void; + public render(camera: Camera, cameraOffsetX: number, cameraOffsetY: number): void; + public maxSize : number; + public add(Object: Basic): Basic; + public recycle(ObjectClass?); + public remove(Object: Basic, Splice?: bool): Basic; + public replace(OldObject: Basic, NewObject: Basic): Basic; + public sort(Index?: string, Order?: number): void; + public setAll(VariableName: string, Value: Object, Recurse?: bool): void; + public callAll(FunctionName: string, Recurse?: bool): void; + public forEach(callback, recursive?: bool): void; + public forEachAlive(context, callback, recursive?: bool): void; + public getFirstAvailable(ObjectClass?); + public getFirstNull(): number; + public getFirstExtant(): Basic; + public getFirstAlive(): Basic; + public getFirstDead(): Basic; + public countLiving(): number; + public countDead(): number; + public getRandom(StartIndex?: number, Length?: number): Basic; + public clear(): void; + public kill(): void; + public sortHandler(Obj1: Basic, Obj2: Basic): number; + } +} diff --git a/Phaser/Loader.d.ts b/Phaser/Loader.d.ts new file mode 100644 index 00000000..4f5436fa --- /dev/null +++ b/Phaser/Loader.d.ts @@ -0,0 +1,34 @@ +/// +module Phaser { + class Loader { + constructor(game: Game, callback); + private _game; + private _keys; + private _fileList; + private _gameCreateComplete; + private _onComplete; + private _onFileLoad; + private _progressChunk; + private _xhr; + private _queueSize; + public hasLoaded: bool; + public progress: number; + public reset(): void; + public queueSize : number; + public addImageFile(key: string, url: string): void; + public addSpriteSheet(key: string, url: string, frameWidth: number, frameHeight: number, frameMax?: number): void; + public addTextureAtlas(key: string, url: string, jsonURL?: string, jsonData?): void; + public addAudioFile(key: string, url: string): void; + public addTextFile(key: string, url: string): void; + public removeFile(key: string): void; + public removeAll(): void; + public load(onFileLoadCallback?, onCompleteCallback?): void; + private loadFile(); + private fileError(key); + private fileComplete(key); + private jsonLoadComplete(key); + private jsonLoadError(key); + private nextFile(previousKey, success); + private checkKeyExists(key); + } +} diff --git a/Phaser/Motion.d.ts b/Phaser/Motion.d.ts new file mode 100644 index 00000000..05bb4b8a --- /dev/null +++ b/Phaser/Motion.d.ts @@ -0,0 +1,23 @@ +/// +/// +module Phaser { + class Motion { + constructor(game: Game); + private _game; + public computeVelocity(Velocity: number, Acceleration?: number, Drag?: number, Max?: number): number; + public velocityFromAngle(angle: number, speed: number): Point; + public moveTowardsObject(source: GameObject, dest: GameObject, speed?: number, maxTime?: number): void; + public accelerateTowardsObject(source: GameObject, dest: GameObject, speed: number, xSpeedMax: number, ySpeedMax: number): void; + public moveTowardsMouse(source: GameObject, speed?: number, maxTime?: number): void; + public accelerateTowardsMouse(source: GameObject, speed: number, xSpeedMax: number, ySpeedMax: number): void; + public moveTowardsPoint(source: GameObject, target: Point, speed?: number, maxTime?: number): void; + public accelerateTowardsPoint(source: GameObject, target: Point, speed: number, xSpeedMax: number, ySpeedMax: number): void; + public distanceBetween(a: GameObject, b: GameObject): number; + public distanceToPoint(a: GameObject, target: Point): number; + public distanceToMouse(a: GameObject): number; + public angleBetweenPoint(a: GameObject, target: Point, asDegrees?: bool): number; + public angleBetween(a: GameObject, b: GameObject, asDegrees?: bool): number; + public velocityFromFacing(parent: GameObject, speed: number): Point; + public angleBetweenMouse(a: GameObject, asDegrees?: bool): number; + } +} diff --git a/Phaser/Phaser.csproj b/Phaser/Phaser.csproj index 4559b466..937e0b5d 100644 --- a/Phaser/Phaser.csproj +++ b/Phaser/Phaser.csproj @@ -47,12 +47,14 @@ true false ../build/phaser.js + true ES5 false false ../build/phaser.js + true @@ -67,6 +69,10 @@ DynamicTexture.ts + + + FXManager.ts + Game.ts diff --git a/Phaser/Phaser.d.ts b/Phaser/Phaser.d.ts new file mode 100644 index 00000000..a743b1ff --- /dev/null +++ b/Phaser/Phaser.d.ts @@ -0,0 +1,3 @@ +module Phaser { + var VERSION: string; +} diff --git a/Phaser/Phaser.ts b/Phaser/Phaser.ts index ee955885..623bae7d 100644 --- a/Phaser/Phaser.ts +++ b/Phaser/Phaser.ts @@ -7,7 +7,7 @@ * * Richard Davey (@photonstorm) * -* Many thanks to Adam Saltsman (@ADAMATOMIC) for the original Flixel AS3 code on which Phaser is based. +* Many thanks to Adam Saltsman (@ADAMATOMIC) for releasing Flixel on which Phaser took a lot of inspiration. * * "If you want your children to be intelligent, read them fairy tales." * "If you want them to be more intelligent, read them more fairy tales." diff --git a/Phaser/Signal.d.ts b/Phaser/Signal.d.ts new file mode 100644 index 00000000..c7810ee9 --- /dev/null +++ b/Phaser/Signal.d.ts @@ -0,0 +1,26 @@ +/// +module Phaser { + class Signal { + private _bindings; + private _prevParams; + static VERSION: string; + public memorize: bool; + private _shouldPropagate; + public active: bool; + public validateListener(listener, fnName): void; + private _registerListener(listener, isOnce, listenerContext, priority); + private _addBinding(binding); + private _indexOfListener(listener, context); + public has(listener, context?: any): bool; + public add(listener, listenerContext?: any, priority?: number): SignalBinding; + public addOnce(listener, listenerContext?: any, priority?: number): SignalBinding; + public remove(listener, context?: any); + public removeAll(): void; + public getNumListeners(): number; + public halt(): void; + public dispatch(...paramsArr: any[]): void; + public forget(): void; + public dispose(): void; + public toString(): string; + } +} diff --git a/Phaser/SignalBinding.d.ts b/Phaser/SignalBinding.d.ts new file mode 100644 index 00000000..2f949792 --- /dev/null +++ b/Phaser/SignalBinding.d.ts @@ -0,0 +1,21 @@ +/// +module Phaser { + class SignalBinding { + constructor(signal: Signal, listener, isOnce: bool, listenerContext, priority?: number); + private _listener; + private _isOnce; + public context; + private _signal; + public priority: number; + public active: bool; + public params; + public execute(paramsArr?: any[]); + public detach(); + public isBound(): bool; + public isOnce(): bool; + public getListener(); + public getSignal(): Signal; + public _destroy(): void; + public toString(): string; + } +} diff --git a/Phaser/SoundManager.d.ts b/Phaser/SoundManager.d.ts new file mode 100644 index 00000000..9fe94071 --- /dev/null +++ b/Phaser/SoundManager.d.ts @@ -0,0 +1,16 @@ +/// +/// +module Phaser { + class SoundManager { + constructor(game: Game); + private _game; + private _context; + private _gainNode; + private _volume; + public mute(): void; + public unmute(): void; + public volume : number; + public decode(key: string, callback?, sound?: Sound): void; + public play(key: string, volume?: number, loop?: bool): Sound; + } +} diff --git a/Phaser/Stage.d.ts b/Phaser/Stage.d.ts new file mode 100644 index 00000000..a4443e02 --- /dev/null +++ b/Phaser/Stage.d.ts @@ -0,0 +1,47 @@ +/// +/// +/// +/// +/// +module Phaser { + class Stage { + constructor(game: Game, parent: string, width: number, height: number); + private _game; + private _bgColor; + private _bootScreen; + private _pauseScreen; + static ORIENTATION_LANDSCAPE: number; + static ORIENTATION_PORTRAIT: number; + public bounds: Rectangle; + public aspectRatio: number; + public clear: bool; + public canvas: HTMLCanvasElement; + public context: CanvasRenderingContext2D; + public disablePauseScreen: bool; + public disableBootScreen: bool; + public offset: Point; + public scale: StageScaleMode; + public scaleMode: number; + public minScaleX: number; + public maxScaleX: number; + public minScaleY: number; + public maxScaleY: number; + public update(): void; + private visibilityChange(event); + private getOffset(element); + public strokeStyle: string; + public lineWidth: number; + public fillStyle: string; + public saveCanvasValues(): void; + public restoreCanvasValues(): void; + public backgroundColor : string; + public x : number; + public y : number; + public width : number; + public height : number; + public centerX : number; + public centerY : number; + public randomX : number; + public randomY : number; + } +} diff --git a/Phaser/Time.d.ts b/Phaser/Time.d.ts new file mode 100644 index 00000000..946a0236 --- /dev/null +++ b/Phaser/Time.d.ts @@ -0,0 +1,25 @@ +/// +module Phaser { + class Time { + constructor(game: Game); + private _game; + private _started; + public timeScale: number; + public elapsed: number; + public time: number; + public now: number; + public delta: number; + public totalElapsedSeconds : number; + public fps: number; + public fpsMin: number; + public fpsMax: number; + public msMin: number; + public msMax: number; + public frames: number; + private _timeLastSecond; + public update(): void; + public elapsedSince(since: number): number; + public elapsedSecondsSince(since: number): number; + public reset(): void; + } +} diff --git a/Phaser/TweenManager.d.ts b/Phaser/TweenManager.d.ts new file mode 100644 index 00000000..21d47a5d --- /dev/null +++ b/Phaser/TweenManager.d.ts @@ -0,0 +1,15 @@ +/// +/// +module Phaser { + class TweenManager { + constructor(game: Game); + private _game; + private _tweens; + public getAll(): Tween[]; + public removeAll(): void; + public create(object): Tween; + public add(tween: Tween): Tween; + public remove(tween: Tween): void; + public update(): bool; + } +} diff --git a/Phaser/World.d.ts b/Phaser/World.d.ts new file mode 100644 index 00000000..0c672981 --- /dev/null +++ b/Phaser/World.d.ts @@ -0,0 +1,32 @@ +/// +module Phaser { + class World { + constructor(game: Game, width: number, height: number); + private _game; + public cameras: CameraManager; + public group: Group; + public bounds: Rectangle; + public worldDivisions: number; + public update(): void; + public render(): void; + public destroy(): void; + public setSize(width: number, height: number, updateCameraBounds?: bool): void; + public width : number; + public height : number; + public centerX : number; + public centerY : number; + public randomX : number; + public randomY : number; + public createCamera(x: number, y: number, width: number, height: number): Camera; + public removeCamera(id: number): bool; + public getAllCameras(): Camera[]; + public createSprite(x: number, y: number, key?: string): Sprite; + public createGeomSprite(x: number, y: number): GeomSprite; + public createDynamicTexture(width: number, height: number): DynamicTexture; + public createGroup(MaxSize?: number): Group; + public createScrollZone(key: string, x?: number, y?: number, width?: number, height?: number): ScrollZone; + public createTilemap(key: string, mapData: string, format: number, resizeWorld?: bool, tileWidth?: number, tileHeight?: number): Tilemap; + public createParticle(): Particle; + public createEmitter(x?: number, y?: number, size?: number): Emitter; + } +} diff --git a/Phaser/gameobjects/Emitter.d.ts b/Phaser/gameobjects/Emitter.d.ts new file mode 100644 index 00000000..564fb553 --- /dev/null +++ b/Phaser/gameobjects/Emitter.d.ts @@ -0,0 +1,38 @@ +/// +/// +module Phaser { + class Emitter extends Group { + constructor(game: Game, X?: number, Y?: number, Size?: number); + public x: number; + public y: number; + public width: number; + public height: number; + public minParticleSpeed: MicroPoint; + public maxParticleSpeed: MicroPoint; + public particleDrag: MicroPoint; + public minRotation: number; + public maxRotation: number; + public gravity: number; + public on: bool; + public frequency: number; + public lifespan: number; + public bounce: number; + public particleClass; + private _quantity; + private _explode; + private _timer; + private _counter; + private _point; + public destroy(): void; + public makeParticles(Graphics, Quantity?: number, BakedRotations?: number, Multiple?: bool, Collide?: number): Emitter; + public update(): void; + public kill(): void; + public start(Explode?: bool, Lifespan?: number, Frequency?: number, Quantity?: number): void; + public emitParticle(): void; + public setSize(Width: number, Height: number): void; + public setXSpeed(Min?: number, Max?: number): void; + public setYSpeed(Min?: number, Max?: number): void; + public setRotation(Min?: number, Max?: number): void; + public at(Object): void; + } +} diff --git a/Phaser/gameobjects/GameObject.d.ts b/Phaser/gameobjects/GameObject.d.ts new file mode 100644 index 00000000..c7d821e7 --- /dev/null +++ b/Phaser/gameobjects/GameObject.d.ts @@ -0,0 +1,84 @@ +/// +/// +/// +module Phaser { + class GameObject extends Basic { + constructor(game: Game, x?: number, y?: number, width?: number, height?: number); + private _angle; + static ALIGN_TOP_LEFT: number; + static ALIGN_TOP_CENTER: number; + static ALIGN_TOP_RIGHT: number; + static ALIGN_CENTER_LEFT: number; + static ALIGN_CENTER: number; + static ALIGN_CENTER_RIGHT: number; + static ALIGN_BOTTOM_LEFT: number; + static ALIGN_BOTTOM_CENTER: number; + static ALIGN_BOTTOM_RIGHT: number; + static OUT_OF_BOUNDS_STOP: number; + static OUT_OF_BOUNDS_KILL: number; + public _point: MicroPoint; + public cameraBlacklist: number[]; + public bounds: Rectangle; + public worldBounds: Quad; + public outOfBoundsAction: number; + public align: number; + public facing: number; + public alpha: number; + public scale: MicroPoint; + public origin: MicroPoint; + public z: number; + public rotationOffset: number; + public renderRotation: bool; + public immovable: bool; + public velocity: MicroPoint; + public mass: number; + public elasticity: number; + public acceleration: MicroPoint; + public drag: MicroPoint; + public maxVelocity: MicroPoint; + public angularVelocity: number; + public angularAcceleration: number; + public angularDrag: number; + public maxAngular: number; + public scrollFactor: MicroPoint; + public health: number; + public moves: bool; + public touching: number; + public wasTouching: number; + public allowCollisions: number; + public last: MicroPoint; + public inputEnabled: bool; + private _inputOver; + public onInputOver: Signal; + public onInputOut: Signal; + public onInputDown: Signal; + public onInputUp: Signal; + public preUpdate(): void; + public update(): void; + public postUpdate(): void; + private updateInput(); + private updateMotion(); + public overlaps(ObjectOrGroup, InScreenSpace?: bool, Camera?: Camera): bool; + public overlapsAt(X: number, Y: number, ObjectOrGroup, InScreenSpace?: bool, Camera?: Camera): bool; + public overlapsPoint(point: Point, InScreenSpace?: bool, Camera?: Camera): bool; + public onScreen(Camera?: Camera): bool; + public getScreenXY(point?: MicroPoint, Camera?: Camera): MicroPoint; + public solid : bool; + public getMidpoint(point?: MicroPoint): MicroPoint; + public reset(X: number, Y: number): void; + public isTouching(Direction: number): bool; + public justTouched(Direction: number): bool; + public hurt(Damage: number): void; + public setBounds(x: number, y: number, width: number, height: number): void; + public hideFromCamera(camera: Camera): void; + public showToCamera(camera: Camera): void; + public clearCameraList(): void; + public destroy(): void; + public x : number; + public y : number; + public rotation : number; + public angle : number; + public width : number; + public height : number; + } +} diff --git a/Phaser/gameobjects/GeomSprite.d.ts b/Phaser/gameobjects/GeomSprite.d.ts new file mode 100644 index 00000000..bc84c8cc --- /dev/null +++ b/Phaser/gameobjects/GeomSprite.d.ts @@ -0,0 +1,40 @@ +/// +module Phaser { + class GeomSprite extends GameObject { + constructor(game: Game, x?: number, y?: number); + private _dx; + private _dy; + private _dw; + private _dh; + public type: number; + static UNASSIGNED: number; + static CIRCLE: number; + static LINE: number; + static POINT: number; + static RECTANGLE: number; + public circle: Circle; + public line: Line; + public point: Point; + public rect: Rectangle; + public renderOutline: bool; + public renderFill: bool; + public lineWidth: number; + public lineColor: string; + public fillColor: string; + public loadCircle(circle: Circle): GeomSprite; + public loadLine(line: Line): GeomSprite; + public loadPoint(point: Point): GeomSprite; + public loadRectangle(rect: Rectangle): GeomSprite; + public createCircle(diameter: number): GeomSprite; + public createLine(x: number, y: number): GeomSprite; + public createPoint(): GeomSprite; + public createRectangle(width: number, height: number): GeomSprite; + public refresh(): void; + public update(): void; + public inCamera(camera: Rectangle): bool; + public render(camera: Camera, cameraOffsetX: number, cameraOffsetY: number): bool; + public renderPoint(offsetX, offsetY, point, size): void; + public renderDebugInfo(x: number, y: number, color?: string): void; + public collide(source: GeomSprite): bool; + } +} diff --git a/Phaser/gameobjects/Particle.d.ts b/Phaser/gameobjects/Particle.d.ts new file mode 100644 index 00000000..6ba96084 --- /dev/null +++ b/Phaser/gameobjects/Particle.d.ts @@ -0,0 +1,11 @@ +/// +/// +module Phaser { + class Particle extends Sprite { + constructor(game: Game); + public lifespan: number; + public friction: number; + public update(): void; + public onEmit(): void; + } +} diff --git a/Phaser/gameobjects/ScrollRegion.d.ts b/Phaser/gameobjects/ScrollRegion.d.ts new file mode 100644 index 00000000..075a5a71 --- /dev/null +++ b/Phaser/gameobjects/ScrollRegion.d.ts @@ -0,0 +1,22 @@ +/// +/// +module Phaser { + class ScrollRegion { + constructor(x: number, y: number, width: number, height: number, speedX: number, speedY: number); + private _A; + private _B; + private _C; + private _D; + private _bounds; + private _scroll; + private _anchorWidth; + private _anchorHeight; + private _inverseWidth; + private _inverseHeight; + public visible: bool; + public scrollSpeed: MicroPoint; + public update(delta: number): void; + public render(context: CanvasRenderingContext2D, texture, dx: number, dy: number, dw: number, dh: number): void; + private crop(context, texture, srcX, srcY, srcW, srcH, destX, destY, destW, destH, offsetX, offsetY); + } +} diff --git a/Phaser/gameobjects/ScrollZone.d.ts b/Phaser/gameobjects/ScrollZone.d.ts new file mode 100644 index 00000000..745abdb4 --- /dev/null +++ b/Phaser/gameobjects/ScrollZone.d.ts @@ -0,0 +1,23 @@ +/// +/// +/// +module Phaser { + class ScrollZone extends GameObject { + constructor(game: Game, key: string, x?: number, y?: number, width?: number, height?: number); + private _texture; + private _dynamicTexture; + private _dx; + private _dy; + private _dw; + private _dh; + public currentRegion: ScrollRegion; + public regions: ScrollRegion[]; + public flipped: bool; + public addRegion(x: number, y: number, width: number, height: number, speedX?: number, speedY?: number): ScrollRegion; + public setSpeed(x: number, y: number): ScrollZone; + public update(): void; + public inCamera(camera: Rectangle): bool; + public render(camera: Camera, cameraOffsetX: number, cameraOffsetY: number): bool; + private createRepeatingTexture(regionWidth, regionHeight); + } +} diff --git a/Phaser/gameobjects/Sprite.d.ts b/Phaser/gameobjects/Sprite.d.ts new file mode 100644 index 00000000..8e68f1a0 --- /dev/null +++ b/Phaser/gameobjects/Sprite.d.ts @@ -0,0 +1,34 @@ +/// +/// +/// +/// +module Phaser { + class Sprite extends GameObject { + constructor(game: Game, x?: number, y?: number, key?: string); + private _texture; + private _dynamicTexture; + private _sx; + private _sy; + private _sw; + private _sh; + private _dx; + private _dy; + private _dw; + private _dh; + public animations: AnimationManager; + public renderDebug: bool; + public renderDebugColor: string; + public renderDebugPointColor: string; + public flipped: bool; + public loadGraphic(key: string): Sprite; + public loadDynamicTexture(texture: DynamicTexture): Sprite; + public makeGraphic(width: number, height: number, color?: number): Sprite; + public inCamera(camera: Rectangle): bool; + public postUpdate(): void; + public frame : number; + public frameName : string; + public render(camera: Camera, cameraOffsetX: number, cameraOffsetY: number): bool; + private renderBounds(camera, cameraOffsetX, cameraOffsetY); + public renderDebugInfo(x: number, y: number, color?: string): void; + } +} diff --git a/Phaser/gameobjects/Tilemap.d.ts b/Phaser/gameobjects/Tilemap.d.ts new file mode 100644 index 00000000..23941256 --- /dev/null +++ b/Phaser/gameobjects/Tilemap.d.ts @@ -0,0 +1,31 @@ +/// +/// +/// +/// +module Phaser { + class Tilemap extends GameObject { + constructor(game: Game, key: string, mapData: string, format: number, resizeWorld?: bool, tileWidth?: number, tileHeight?: number); + static FORMAT_CSV: number; + static FORMAT_TILED_JSON: number; + public tiles: Tile[]; + public layers: TilemapLayer[]; + public currentLayer: TilemapLayer; + public collisionLayer: TilemapLayer; + public mapFormat: number; + public update(): void; + public render(camera: Camera, cameraOffsetX: number, cameraOffsetY: number): void; + private parseCSV(data, key, tileWidth, tileHeight); + private parseTiledJSON(data, key); + private generateTiles(qty); + public widthInPixels : number; + public heightInPixels : number; + public setCollisionRange(start: number, end: number, collision?: number, resetCollisions?: bool): void; + public setCollisionByIndex(values: number[], collision?: number, resetCollisions?: bool): void; + public getTile(x: number, y: number, layer?: number): Tile; + public getTileFromWorldXY(x: number, y: number, layer?: number): Tile; + public getTileFromInputXY(layer?: number): Tile; + public getTileOverlaps(object: GameObject): bool; + public collide(objectOrGroup?, callback?): bool; + public collideGameObject(object: GameObject): bool; + } +} diff --git a/Phaser/geom/Circle.d.ts b/Phaser/geom/Circle.d.ts new file mode 100644 index 00000000..de0e9237 --- /dev/null +++ b/Phaser/geom/Circle.d.ts @@ -0,0 +1,34 @@ +/// +module Phaser { + class Circle { + constructor(x?: number, y?: number, diameter?: number); + private _diameter; + private _radius; + public x: number; + public y: number; + public diameter : number; + public radius : number; + public circumference(): number; + public bottom : number; + public left : number; + public right : number; + public top : number; + public area : number; + public isEmpty : bool; + public intersectCircleLine(line: Line): bool; + public clone(output?: Circle): Circle; + public contains(x: number, y: number): bool; + public containsPoint(point: Point): bool; + public containsCircle(circle: Circle): bool; + public copyFrom(source: Circle): Circle; + public copyTo(target: Circle): Circle; + public distanceTo(target: any, round?: bool): number; + public equals(toCompare: Circle): bool; + public intersects(toIntersect: Circle): bool; + public circumferencePoint(angle: number, asDegrees?: bool, output?: Point): Point; + public offset(dx: number, dy: number): Circle; + public offsetPoint(point: Point): Circle; + public setTo(x: number, y: number, diameter: number): Circle; + public toString(): string; + } +} diff --git a/Phaser/geom/IntersectResult.d.ts b/Phaser/geom/IntersectResult.d.ts new file mode 100644 index 00000000..0557082b --- /dev/null +++ b/Phaser/geom/IntersectResult.d.ts @@ -0,0 +1,15 @@ +/// +module Phaser { + class IntersectResult { + public result: bool; + public x: number; + public y: number; + public x1: number; + public y1: number; + public x2: number; + public y2: number; + public width: number; + public height: number; + public setTo(x1: number, y1: number, x2?: number, y2?: number, width?: number, height?: number): void; + } +} diff --git a/Phaser/geom/Line.d.ts b/Phaser/geom/Line.d.ts new file mode 100644 index 00000000..b8b0fbd6 --- /dev/null +++ b/Phaser/geom/Line.d.ts @@ -0,0 +1,27 @@ +/// +module Phaser { + class Line { + constructor(x1?: number, y1?: number, x2?: number, y2?: number); + public x1: number; + public y1: number; + public x2: number; + public y2: number; + public clone(output?: Line): Line; + public copyFrom(source: Line): Line; + public copyTo(target: Line): Line; + public setTo(x1?: number, y1?: number, x2?: number, y2?: number): Line; + public width : number; + public height : number; + public length : number; + public getY(x: number): number; + public angle : number; + public slope : number; + public perpSlope : number; + public yIntercept : number; + public isPointOnLine(x: number, y: number): bool; + public isPointOnLineSegment(x: number, y: number): bool; + public intersectLineLine(line): any; + public perp(x: number, y: number, output?: Line): Line; + public toString(): string; + } +} diff --git a/Phaser/geom/MicroPoint.d.ts b/Phaser/geom/MicroPoint.d.ts new file mode 100644 index 00000000..48e9145f --- /dev/null +++ b/Phaser/geom/MicroPoint.d.ts @@ -0,0 +1,16 @@ +/// +module Phaser { + class MicroPoint { + constructor(x?: number, y?: number, parent?: any); + private _x; + private _y; + public parent: any; + public x : number; + public y : number; + public copyFrom(source: any): MicroPoint; + public copyTo(target: any): MicroPoint; + public setTo(x: number, y: number, callParent?: bool): MicroPoint; + public equals(toCompare): bool; + public toString(): string; + } +} diff --git a/Phaser/geom/Point.d.ts b/Phaser/geom/Point.d.ts new file mode 100644 index 00000000..f93c2002 --- /dev/null +++ b/Phaser/geom/Point.d.ts @@ -0,0 +1,28 @@ +/// +module Phaser { + class Point { + constructor(x?: number, y?: number); + public x: number; + public y: number; + public add(toAdd: Point, output?: Point): Point; + public addTo(x?: number, y?: number): Point; + public subtractFrom(x?: number, y?: number): Point; + public invert(): Point; + public clamp(min: number, max: number): Point; + public clampX(min: number, max: number): Point; + public clampY(min: number, max: number): Point; + public clone(output?: Point): Point; + public copyFrom(source: Point): Point; + public copyTo(target: Point): Point; + public distanceTo(target: Point, round?: bool): number; + static distanceBetween(pointA: Point, pointB: Point, round?: bool): number; + public distanceCompare(target: Point, distance: number): bool; + public equals(toCompare: Point): bool; + public interpolate(pointA, pointB, f): void; + public offset(dx: number, dy: number): Point; + public polar(length, angle): void; + public setTo(x: number, y: number): Point; + public subtract(point: Point, output?: Point): Point; + public toString(): string; + } +} diff --git a/Phaser/geom/Quad.d.ts b/Phaser/geom/Quad.d.ts new file mode 100644 index 00000000..3a8425f5 --- /dev/null +++ b/Phaser/geom/Quad.d.ts @@ -0,0 +1,19 @@ +/// +module Phaser { + class Quad { + constructor(x?: number, y?: number, width?: number, height?: number); + public x: number; + public y: number; + public width: number; + public height: number; + public setTo(x: number, y: number, width: number, height: number): Quad; + public left : number; + public right : number; + public top : number; + public bottom : number; + public halfWidth : number; + public halfHeight : number; + public intersects(q, t?: number): bool; + public toString(): string; + } +} diff --git a/Phaser/geom/Rectangle.d.ts b/Phaser/geom/Rectangle.d.ts new file mode 100644 index 00000000..e09befbd --- /dev/null +++ b/Phaser/geom/Rectangle.d.ts @@ -0,0 +1,57 @@ +/// +/// +module Phaser { + class Rectangle { + constructor(x?: number, y?: number, width?: number, height?: number); + private _tempX; + private _tempY; + private _tempWidth; + private _tempHeight; + public x : number; + public y : number; + public topLeft: MicroPoint; + public topCenter: MicroPoint; + public topRight: MicroPoint; + public leftCenter: MicroPoint; + public center: MicroPoint; + public rightCenter: MicroPoint; + public bottomLeft: MicroPoint; + public bottomCenter: MicroPoint; + public bottomRight: MicroPoint; + private _width; + private _height; + private _halfWidth; + private _halfHeight; + public length: number; + public updateBounds(): void; + public width : number; + public height : number; + public halfWidth : number; + public halfHeight : number; + public bottom : number; + public left : number; + public right : number; + public size(output?: Point): Point; + public volume : number; + public perimeter : number; + public top : number; + public clone(output?: Rectangle): Rectangle; + public contains(x: number, y: number): bool; + public containsPoint(point: any): bool; + public containsRect(rect: Rectangle): bool; + public copyFrom(source: Rectangle): Rectangle; + public copyTo(target: Rectangle): Rectangle; + public equals(toCompare: Rectangle): bool; + public inflate(dx: number, dy: number): Rectangle; + public inflatePoint(point: Point): Rectangle; + public intersection(toIntersect: Rectangle, output?: Rectangle): Rectangle; + public intersects(r2: Rectangle, t?: number): bool; + public isEmpty : bool; + public offset(dx: number, dy: number): Rectangle; + public offsetPoint(point: Point): Rectangle; + public setEmpty(): Rectangle; + public setTo(x: number, y: number, width: number, height: number): Rectangle; + public union(toUnion: Rectangle, output?: Rectangle): Rectangle; + public toString(): string; + } +} diff --git a/Phaser/node_modules/grunt/.npmignore b/Phaser/node_modules/grunt/.npmignore deleted file mode 100644 index 032c58e0..00000000 --- a/Phaser/node_modules/grunt/.npmignore +++ /dev/null @@ -1,3 +0,0 @@ -node_modules -.npm-debug.log -tmp diff --git a/Phaser/node_modules/grunt/.travis.yml b/Phaser/node_modules/grunt/.travis.yml deleted file mode 100644 index b30fcb75..00000000 --- a/Phaser/node_modules/grunt/.travis.yml +++ /dev/null @@ -1,5 +0,0 @@ -language: node_js -node_js: - - 0.8 -before_script: - - npm install -g grunt-cli diff --git a/Phaser/node_modules/grunt/AUTHORS b/Phaser/node_modules/grunt/AUTHORS deleted file mode 100644 index d9cace84..00000000 --- a/Phaser/node_modules/grunt/AUTHORS +++ /dev/null @@ -1,4 +0,0 @@ -"Cowboy" Ben Alman (http://benalman.com/) -Kyle Robinson Young (http://dontkry.com/) -Tyler Kellen (http://goingslowly.com) -Sindre Sorhus (http://sindresorhus.com) diff --git a/Phaser/node_modules/grunt/CHANGELOG b/Phaser/node_modules/grunt/CHANGELOG deleted file mode 100644 index 81e937bd..00000000 --- a/Phaser/node_modules/grunt/CHANGELOG +++ /dev/null @@ -1,23 +0,0 @@ -v0.4.1: - date: 2013-03-13 - changes: - - Fix path.join thrown errors with expandMapping rename. Closes gh-725. - - Update copyright date to 2013. Closes gh-660. - - Remove some side effects from manually requiring Grunt. Closes gh-605. - - grunt.log: add formatting support and implicitly cast msg to a string. Closes gh-703. - - Update js-yaml to version 2. Closes gh-683. - - The grunt.util.spawn method now falls back to stdout when the `grunt` option is set. Closes gh-691. - - Making --verbose "Files:" warnings less scary. Closes gh-657. - - Fixing typo: the grunt.fatal method now defaults to FATAL_ERROR. Closes gh-656, gh-707. - - Removed a duplicate line. Closes gh-702. - - Gruntfile name should no longer be case sensitive. Closes gh-685. - - The grunt.file.delete method warns and returns false if file doesn't exist. Closes gh-635, gh-714. - - The grunt.package property is now resolved via require(). Closes gh-704. - - The grunt.util.spawn method no longer breaks on multibyte stdio. Closes gh-710. - - Fix "path.join arguments must be strings" error in file.expand/recurse when options.cwd is not set. Closes gh-722. - - Adding a fairly relevant keyword to package.json (task). -v0.4.0: - date: 2013-02-18 - changes: - - Initial release of 0.4.0. - - See http://gruntjs.com/upgrading-from-0.3-to-0.4 for a list of changes / migration guide. diff --git a/Phaser/node_modules/grunt/CONTRIBUTING.md b/Phaser/node_modules/grunt/CONTRIBUTING.md deleted file mode 100644 index 5d08cc38..00000000 --- a/Phaser/node_modules/grunt/CONTRIBUTING.md +++ /dev/null @@ -1 +0,0 @@ -Please see the [Contributing to grunt](http://gruntjs.com/contributing) guide for information on contributing to this project. diff --git a/Phaser/node_modules/grunt/LICENSE-MIT b/Phaser/node_modules/grunt/LICENSE-MIT deleted file mode 100644 index bb2aad6d..00000000 --- a/Phaser/node_modules/grunt/LICENSE-MIT +++ /dev/null @@ -1,22 +0,0 @@ -Copyright (c) 2013 "Cowboy" Ben Alman - -Permission is hereby granted, free of charge, to any person -obtaining a copy of this software and associated documentation -files (the "Software"), to deal in the Software without -restriction, including without limitation the rights to use, -copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the -Software is furnished to do so, subject to the following -conditions: - -The above copyright notice and this permission notice shall be -included in all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES -OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT -HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, -WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING -FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR -OTHER DEALINGS IN THE SOFTWARE. diff --git a/Phaser/node_modules/grunt/README.md b/Phaser/node_modules/grunt/README.md deleted file mode 100644 index e0d0f4a0..00000000 --- a/Phaser/node_modules/grunt/README.md +++ /dev/null @@ -1,13 +0,0 @@ -# Grunt: The JavaScript Task Runner [![Build Status](https://secure.travis-ci.org/gruntjs/grunt.png?branch=master)](http://travis-ci.org/gruntjs/grunt) - -### Documentation - -Visit the [gruntjs.com](http://gruntjs.com/) website for all the things. - -### Support / Contributing -Before you make an issue, please read our [Contributing](http://gruntjs.com/contributing) guide. - -You can find the grunt team in [#grunt on irc.freenode.net](irc://irc.freenode.net/#grunt). - -### Release History -See the [CHANGELOG](CHANGELOG). diff --git a/Phaser/node_modules/grunt/docs/README.md b/Phaser/node_modules/grunt/docs/README.md deleted file mode 100644 index bf485150..00000000 --- a/Phaser/node_modules/grunt/docs/README.md +++ /dev/null @@ -1 +0,0 @@ -Visit the [gruntjs.com](http://gruntjs.com/) website for all the things. \ No newline at end of file diff --git a/Phaser/node_modules/grunt/node_modules/.bin/cake b/Phaser/node_modules/grunt/node_modules/.bin/cake deleted file mode 120000 index d95f32af..00000000 --- a/Phaser/node_modules/grunt/node_modules/.bin/cake +++ /dev/null @@ -1 +0,0 @@ -../coffee-script/bin/cake \ No newline at end of file diff --git a/Phaser/node_modules/grunt/node_modules/.bin/coffee b/Phaser/node_modules/grunt/node_modules/.bin/coffee deleted file mode 120000 index b57f275d..00000000 --- a/Phaser/node_modules/grunt/node_modules/.bin/coffee +++ /dev/null @@ -1 +0,0 @@ -../coffee-script/bin/coffee \ No newline at end of file diff --git a/Phaser/node_modules/grunt/node_modules/.bin/js-yaml b/Phaser/node_modules/grunt/node_modules/.bin/js-yaml deleted file mode 120000 index 9dbd010d..00000000 --- a/Phaser/node_modules/grunt/node_modules/.bin/js-yaml +++ /dev/null @@ -1 +0,0 @@ -../js-yaml/bin/js-yaml.js \ No newline at end of file diff --git a/Phaser/node_modules/grunt/node_modules/.bin/lodash b/Phaser/node_modules/grunt/node_modules/.bin/lodash deleted file mode 120000 index 24deae28..00000000 --- a/Phaser/node_modules/grunt/node_modules/.bin/lodash +++ /dev/null @@ -1 +0,0 @@ -../lodash/build.js \ No newline at end of file diff --git a/Phaser/node_modules/grunt/node_modules/.bin/nopt b/Phaser/node_modules/grunt/node_modules/.bin/nopt deleted file mode 120000 index 6b6566ea..00000000 --- a/Phaser/node_modules/grunt/node_modules/.bin/nopt +++ /dev/null @@ -1 +0,0 @@ -../nopt/bin/nopt.js \ No newline at end of file diff --git a/Phaser/node_modules/grunt/node_modules/.bin/which b/Phaser/node_modules/grunt/node_modules/.bin/which deleted file mode 120000 index f62471c8..00000000 --- a/Phaser/node_modules/grunt/node_modules/.bin/which +++ /dev/null @@ -1 +0,0 @@ -../which/bin/which \ No newline at end of file diff --git a/Phaser/node_modules/grunt/node_modules/async/.gitmodules b/Phaser/node_modules/grunt/node_modules/async/.gitmodules deleted file mode 100644 index a9aae984..00000000 --- a/Phaser/node_modules/grunt/node_modules/async/.gitmodules +++ /dev/null @@ -1,9 +0,0 @@ -[submodule "deps/nodeunit"] - path = deps/nodeunit - url = git://github.com/caolan/nodeunit.git -[submodule "deps/UglifyJS"] - path = deps/UglifyJS - url = https://github.com/mishoo/UglifyJS.git -[submodule "deps/nodelint"] - path = deps/nodelint - url = https://github.com/tav/nodelint.git diff --git a/Phaser/node_modules/grunt/node_modules/async/.npmignore b/Phaser/node_modules/grunt/node_modules/async/.npmignore deleted file mode 100644 index 9bdfc97c..00000000 --- a/Phaser/node_modules/grunt/node_modules/async/.npmignore +++ /dev/null @@ -1,4 +0,0 @@ -deps -dist -test -nodelint.cfg \ No newline at end of file diff --git a/Phaser/node_modules/grunt/node_modules/async/LICENSE b/Phaser/node_modules/grunt/node_modules/async/LICENSE deleted file mode 100644 index b7f9d500..00000000 --- a/Phaser/node_modules/grunt/node_modules/async/LICENSE +++ /dev/null @@ -1,19 +0,0 @@ -Copyright (c) 2010 Caolan McMahon - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. diff --git a/Phaser/node_modules/grunt/node_modules/async/Makefile b/Phaser/node_modules/grunt/node_modules/async/Makefile deleted file mode 100644 index bad647c6..00000000 --- a/Phaser/node_modules/grunt/node_modules/async/Makefile +++ /dev/null @@ -1,25 +0,0 @@ -PACKAGE = asyncjs -NODEJS = $(if $(shell test -f /usr/bin/nodejs && echo "true"),nodejs,node) -CWD := $(shell pwd) -NODEUNIT = $(CWD)/node_modules/nodeunit/bin/nodeunit -UGLIFY = $(CWD)/node_modules/uglify-js/bin/uglifyjs -NODELINT = $(CWD)/node_modules/nodelint/nodelint - -BUILDDIR = dist - -all: clean test build - -build: $(wildcard lib/*.js) - mkdir -p $(BUILDDIR) - $(UGLIFY) lib/async.js > $(BUILDDIR)/async.min.js - -test: - $(NODEUNIT) test - -clean: - rm -rf $(BUILDDIR) - -lint: - $(NODELINT) --config nodelint.cfg lib/async.js - -.PHONY: test build all diff --git a/Phaser/node_modules/grunt/node_modules/async/README.md b/Phaser/node_modules/grunt/node_modules/async/README.md deleted file mode 100644 index 1bbbc477..00000000 --- a/Phaser/node_modules/grunt/node_modules/async/README.md +++ /dev/null @@ -1,1021 +0,0 @@ -# Async.js - -Async is a utility module which provides straight-forward, powerful functions -for working with asynchronous JavaScript. Although originally designed for -use with [node.js](http://nodejs.org), it can also be used directly in the -browser. - -Async provides around 20 functions that include the usual 'functional' -suspects (map, reduce, filter, forEach…) as well as some common patterns -for asynchronous control flow (parallel, series, waterfall…). All these -functions assume you follow the node.js convention of providing a single -callback as the last argument of your async function. - - -## Quick Examples - - async.map(['file1','file2','file3'], fs.stat, function(err, results){ - // results is now an array of stats for each file - }); - - async.filter(['file1','file2','file3'], path.exists, function(results){ - // results now equals an array of the existing files - }); - - async.parallel([ - function(){ ... }, - function(){ ... } - ], callback); - - async.series([ - function(){ ... }, - function(){ ... } - ]); - -There are many more functions available so take a look at the docs below for a -full list. This module aims to be comprehensive, so if you feel anything is -missing please create a GitHub issue for it. - - -## Download - -Releases are available for download from -[GitHub](http://github.com/caolan/async/downloads). -Alternatively, you can install using Node Package Manager (npm): - - npm install async - - -__Development:__ [async.js](https://github.com/caolan/async/raw/master/lib/async.js) - 17.5kb Uncompressed - -__Production:__ [async.min.js](https://github.com/caolan/async/raw/master/dist/async.min.js) - 1.7kb Packed and Gzipped - - -## In the Browser - -So far its been tested in IE6, IE7, IE8, FF3.6 and Chrome 5. Usage: - - - - - -## Documentation - -### Collections - -* [forEach](#forEach) -* [map](#map) -* [filter](#filter) -* [reject](#reject) -* [reduce](#reduce) -* [detect](#detect) -* [sortBy](#sortBy) -* [some](#some) -* [every](#every) -* [concat](#concat) - -### Control Flow - -* [series](#series) -* [parallel](#parallel) -* [whilst](#whilst) -* [until](#until) -* [waterfall](#waterfall) -* [queue](#queue) -* [auto](#auto) -* [iterator](#iterator) -* [apply](#apply) -* [nextTick](#nextTick) - -### Utils - -* [memoize](#memoize) -* [unmemoize](#unmemoize) -* [log](#log) -* [dir](#dir) -* [noConflict](#noConflict) - - -## Collections - - -### forEach(arr, iterator, callback) - -Applies an iterator function to each item in an array, in parallel. -The iterator is called with an item from the list and a callback for when it -has finished. If the iterator passes an error to this callback, the main -callback for the forEach function is immediately called with the error. - -Note, that since this function applies the iterator to each item in parallel -there is no guarantee that the iterator functions will complete in order. - -__Arguments__ - -* arr - An array to iterate over. -* iterator(item, callback) - A function to apply to each item in the array. - The iterator is passed a callback which must be called once it has completed. -* callback(err) - A callback which is called after all the iterator functions - have finished, or an error has occurred. - -__Example__ - - // assuming openFiles is an array of file names and saveFile is a function - // to save the modified contents of that file: - - async.forEach(openFiles, saveFile, function(err){ - // if any of the saves produced an error, err would equal that error - }); - ---------------------------------------- - - -### forEachSeries(arr, iterator, callback) - -The same as forEach only the iterator is applied to each item in the array in -series. The next iterator is only called once the current one has completed -processing. This means the iterator functions will complete in order. - - ---------------------------------------- - - -### forEachLimit(arr, limit, iterator, callback) - -The same as forEach only the iterator is applied to batches of items in the -array, in series. The next batch of iterators is only called once the current -one has completed processing. - -__Arguments__ - -* arr - An array to iterate over. -* limit - How many items should be in each batch. -* iterator(item, callback) - A function to apply to each item in the array. - The iterator is passed a callback which must be called once it has completed. -* callback(err) - A callback which is called after all the iterator functions - have finished, or an error has occurred. - -__Example__ - - // Assume documents is an array of JSON objects and requestApi is a - // function that interacts with a rate-limited REST api. - - async.forEachLimit(documents, 20, requestApi, function(err){ - // if any of the saves produced an error, err would equal that error - }); ---------------------------------------- - - -### map(arr, iterator, callback) - -Produces a new array of values by mapping each value in the given array through -the iterator function. The iterator is called with an item from the array and a -callback for when it has finished processing. The callback takes 2 arguments, -an error and the transformed item from the array. If the iterator passes an -error to this callback, the main callback for the map function is immediately -called with the error. - -Note, that since this function applies the iterator to each item in parallel -there is no guarantee that the iterator functions will complete in order, however -the results array will be in the same order as the original array. - -__Arguments__ - -* arr - An array to iterate over. -* iterator(item, callback) - A function to apply to each item in the array. - The iterator is passed a callback which must be called once it has completed - with an error (which can be null) and a transformed item. -* callback(err, results) - A callback which is called after all the iterator - functions have finished, or an error has occurred. Results is an array of the - transformed items from the original array. - -__Example__ - - async.map(['file1','file2','file3'], fs.stat, function(err, results){ - // results is now an array of stats for each file - }); - ---------------------------------------- - - -### mapSeries(arr, iterator, callback) - -The same as map only the iterator is applied to each item in the array in -series. The next iterator is only called once the current one has completed -processing. The results array will be in the same order as the original. - - ---------------------------------------- - - -### filter(arr, iterator, callback) - -__Alias:__ select - -Returns a new array of all the values which pass an async truth test. -_The callback for each iterator call only accepts a single argument of true or -false, it does not accept an error argument first!_ This is in-line with the -way node libraries work with truth tests like path.exists. This operation is -performed in parallel, but the results array will be in the same order as the -original. - -__Arguments__ - -* arr - An array to iterate over. -* iterator(item, callback) - A truth test to apply to each item in the array. - The iterator is passed a callback which must be called once it has completed. -* callback(results) - A callback which is called after all the iterator - functions have finished. - -__Example__ - - async.filter(['file1','file2','file3'], path.exists, function(results){ - // results now equals an array of the existing files - }); - ---------------------------------------- - - -### filterSeries(arr, iterator, callback) - -__alias:__ selectSeries - -The same as filter only the iterator is applied to each item in the array in -series. The next iterator is only called once the current one has completed -processing. The results array will be in the same order as the original. - ---------------------------------------- - - -### reject(arr, iterator, callback) - -The opposite of filter. Removes values that pass an async truth test. - ---------------------------------------- - - -### rejectSeries(arr, iterator, callback) - -The same as filter, only the iterator is applied to each item in the array -in series. - - ---------------------------------------- - - -### reduce(arr, memo, iterator, callback) - -__aliases:__ inject, foldl - -Reduces a list of values into a single value using an async iterator to return -each successive step. Memo is the initial state of the reduction. This -function only operates in series. For performance reasons, it may make sense to -split a call to this function into a parallel map, then use the normal -Array.prototype.reduce on the results. This function is for situations where -each step in the reduction needs to be async, if you can get the data before -reducing it then its probably a good idea to do so. - -__Arguments__ - -* arr - An array to iterate over. -* memo - The initial state of the reduction. -* iterator(memo, item, callback) - A function applied to each item in the - array to produce the next step in the reduction. The iterator is passed a - callback which accepts an optional error as its first argument, and the state - of the reduction as the second. If an error is passed to the callback, the - reduction is stopped and the main callback is immediately called with the - error. -* callback(err, result) - A callback which is called after all the iterator - functions have finished. Result is the reduced value. - -__Example__ - - async.reduce([1,2,3], 0, function(memo, item, callback){ - // pointless async: - process.nextTick(function(){ - callback(null, memo + item) - }); - }, function(err, result){ - // result is now equal to the last value of memo, which is 6 - }); - ---------------------------------------- - - -### reduceRight(arr, memo, iterator, callback) - -__Alias:__ foldr - -Same as reduce, only operates on the items in the array in reverse order. - - ---------------------------------------- - - -### detect(arr, iterator, callback) - -Returns the first value in a list that passes an async truth test. The -iterator is applied in parallel, meaning the first iterator to return true will -fire the detect callback with that result. That means the result might not be -the first item in the original array (in terms of order) that passes the test. - -If order within the original array is important then look at detectSeries. - -__Arguments__ - -* arr - An array to iterate over. -* iterator(item, callback) - A truth test to apply to each item in the array. - The iterator is passed a callback which must be called once it has completed. -* callback(result) - A callback which is called as soon as any iterator returns - true, or after all the iterator functions have finished. Result will be - the first item in the array that passes the truth test (iterator) or the - value undefined if none passed. - -__Example__ - - async.detect(['file1','file2','file3'], path.exists, function(result){ - // result now equals the first file in the list that exists - }); - ---------------------------------------- - - -### detectSeries(arr, iterator, callback) - -The same as detect, only the iterator is applied to each item in the array -in series. This means the result is always the first in the original array (in -terms of array order) that passes the truth test. - - ---------------------------------------- - - -### sortBy(arr, iterator, callback) - -Sorts a list by the results of running each value through an async iterator. - -__Arguments__ - -* arr - An array to iterate over. -* iterator(item, callback) - A function to apply to each item in the array. - The iterator is passed a callback which must be called once it has completed - with an error (which can be null) and a value to use as the sort criteria. -* callback(err, results) - A callback which is called after all the iterator - functions have finished, or an error has occurred. Results is the items from - the original array sorted by the values returned by the iterator calls. - -__Example__ - - async.sortBy(['file1','file2','file3'], function(file, callback){ - fs.stat(file, function(err, stats){ - callback(err, stats.mtime); - }); - }, function(err, results){ - // results is now the original array of files sorted by - // modified date - }); - - ---------------------------------------- - - -### some(arr, iterator, callback) - -__Alias:__ any - -Returns true if at least one element in the array satisfies an async test. -_The callback for each iterator call only accepts a single argument of true or -false, it does not accept an error argument first!_ This is in-line with the -way node libraries work with truth tests like path.exists. Once any iterator -call returns true, the main callback is immediately called. - -__Arguments__ - -* arr - An array to iterate over. -* iterator(item, callback) - A truth test to apply to each item in the array. - The iterator is passed a callback which must be called once it has completed. -* callback(result) - A callback which is called as soon as any iterator returns - true, or after all the iterator functions have finished. Result will be - either true or false depending on the values of the async tests. - -__Example__ - - async.some(['file1','file2','file3'], path.exists, function(result){ - // if result is true then at least one of the files exists - }); - ---------------------------------------- - - -### every(arr, iterator, callback) - -__Alias:__ all - -Returns true if every element in the array satisfies an async test. -_The callback for each iterator call only accepts a single argument of true or -false, it does not accept an error argument first!_ This is in-line with the -way node libraries work with truth tests like path.exists. - -__Arguments__ - -* arr - An array to iterate over. -* iterator(item, callback) - A truth test to apply to each item in the array. - The iterator is passed a callback which must be called once it has completed. -* callback(result) - A callback which is called after all the iterator - functions have finished. Result will be either true or false depending on - the values of the async tests. - -__Example__ - - async.every(['file1','file2','file3'], path.exists, function(result){ - // if result is true then every file exists - }); - ---------------------------------------- - - -### concat(arr, iterator, callback) - -Applies an iterator to each item in a list, concatenating the results. Returns the -concatenated list. The iterators are called in parallel, and the results are -concatenated as they return. There is no guarantee that the results array will -be returned in the original order of the arguments passed to the iterator function. - -__Arguments__ - -* arr - An array to iterate over -* iterator(item, callback) - A function to apply to each item in the array. - The iterator is passed a callback which must be called once it has completed - with an error (which can be null) and an array of results. -* callback(err, results) - A callback which is called after all the iterator - functions have finished, or an error has occurred. Results is an array containing - the concatenated results of the iterator function. - -__Example__ - - async.concat(['dir1','dir2','dir3'], fs.readdir, function(err, files){ - // files is now a list of filenames that exist in the 3 directories - }); - ---------------------------------------- - - -### concatSeries(arr, iterator, callback) - -Same as async.concat, but executes in series instead of parallel. - - -## Control Flow - - -### series(tasks, [callback]) - -Run an array of functions in series, each one running once the previous -function has completed. If any functions in the series pass an error to its -callback, no more functions are run and the callback for the series is -immediately called with the value of the error. Once the tasks have completed, -the results are passed to the final callback as an array. - -It is also possible to use an object instead of an array. Each property will be -run as a function and the results will be passed to the final callback as an object -instead of an array. This can be a more readable way of handling results from -async.series. - - -__Arguments__ - -* tasks - An array or object containing functions to run, each function is passed - a callback it must call on completion. -* callback(err, results) - An optional callback to run once all the functions - have completed. This function gets an array of all the arguments passed to - the callbacks used in the array. - -__Example__ - - async.series([ - function(callback){ - // do some stuff ... - callback(null, 'one'); - }, - function(callback){ - // do some more stuff ... - callback(null, 'two'); - }, - ], - // optional callback - function(err, results){ - // results is now equal to ['one', 'two'] - }); - - - // an example using an object instead of an array - async.series({ - one: function(callback){ - setTimeout(function(){ - callback(null, 1); - }, 200); - }, - two: function(callback){ - setTimeout(function(){ - callback(null, 2); - }, 100); - }, - }, - function(err, results) { - // results is now equal to: {one: 1, two: 2} - }); - - ---------------------------------------- - - -### parallel(tasks, [callback]) - -Run an array of functions in parallel, without waiting until the previous -function has completed. If any of the functions pass an error to its -callback, the main callback is immediately called with the value of the error. -Once the tasks have completed, the results are passed to the final callback as an -array. - -It is also possible to use an object instead of an array. Each property will be -run as a function and the results will be passed to the final callback as an object -instead of an array. This can be a more readable way of handling results from -async.parallel. - - -__Arguments__ - -* tasks - An array or object containing functions to run, each function is passed a - callback it must call on completion. -* callback(err, results) - An optional callback to run once all the functions - have completed. This function gets an array of all the arguments passed to - the callbacks used in the array. - -__Example__ - - async.parallel([ - function(callback){ - setTimeout(function(){ - callback(null, 'one'); - }, 200); - }, - function(callback){ - setTimeout(function(){ - callback(null, 'two'); - }, 100); - }, - ], - // optional callback - function(err, results){ - // the results array will equal ['one','two'] even though - // the second function had a shorter timeout. - }); - - - // an example using an object instead of an array - async.parallel({ - one: function(callback){ - setTimeout(function(){ - callback(null, 1); - }, 200); - }, - two: function(callback){ - setTimeout(function(){ - callback(null, 2); - }, 100); - }, - }, - function(err, results) { - // results is now equals to: {one: 1, two: 2} - }); - - ---------------------------------------- - - -### whilst(test, fn, callback) - -Repeatedly call fn, while test returns true. Calls the callback when stopped, -or an error occurs. - -__Arguments__ - -* test() - synchronous truth test to perform before each execution of fn. -* fn(callback) - A function to call each time the test passes. The function is - passed a callback which must be called once it has completed with an optional - error as the first argument. -* callback(err) - A callback which is called after the test fails and repeated - execution of fn has stopped. - -__Example__ - - var count = 0; - - async.whilst( - function () { return count < 5; }, - function (callback) { - count++; - setTimeout(callback, 1000); - }, - function (err) { - // 5 seconds have passed - } - ); - - ---------------------------------------- - - -### until(test, fn, callback) - -Repeatedly call fn, until test returns true. Calls the callback when stopped, -or an error occurs. - -The inverse of async.whilst. - - ---------------------------------------- - - -### waterfall(tasks, [callback]) - -Runs an array of functions in series, each passing their results to the next in -the array. However, if any of the functions pass an error to the callback, the -next function is not executed and the main callback is immediately called with -the error. - -__Arguments__ - -* tasks - An array of functions to run, each function is passed a callback it - must call on completion. -* callback(err, [results]) - An optional callback to run once all the functions - have completed. This will be passed the results of the last task's callback. - - - -__Example__ - - async.waterfall([ - function(callback){ - callback(null, 'one', 'two'); - }, - function(arg1, arg2, callback){ - callback(null, 'three'); - }, - function(arg1, callback){ - // arg1 now equals 'three' - callback(null, 'done'); - } - ], function (err, result) { - // result now equals 'done' - }); - - ---------------------------------------- - - -### queue(worker, concurrency) - -Creates a queue object with the specified concurrency. Tasks added to the -queue will be processed in parallel (up to the concurrency limit). If all -workers are in progress, the task is queued until one is available. Once -a worker has completed a task, the task's callback is called. - -__Arguments__ - -* worker(task, callback) - An asynchronous function for processing a queued - task. -* concurrency - An integer for determining how many worker functions should be - run in parallel. - -__Queue objects__ - -The queue object returned by this function has the following properties and -methods: - -* length() - a function returning the number of items waiting to be processed. -* concurrency - an integer for determining how many worker functions should be - run in parallel. This property can be changed after a queue is created to - alter the concurrency on-the-fly. -* push(task, [callback]) - add a new task to the queue, the callback is called - once the worker has finished processing the task. - instead of a single task, an array of tasks can be submitted. the respective callback is used for every task in the list. -* saturated - a callback that is called when the queue length hits the concurrency and further tasks will be queued -* empty - a callback that is called when the last item from the queue is given to a worker -* drain - a callback that is called when the last item from the queue has returned from the worker - -__Example__ - - // create a queue object with concurrency 2 - - var q = async.queue(function (task, callback) { - console.log('hello ' + task.name); - callback(); - }, 2); - - - // assign a callback - q.drain = function() { - console.log('all items have been processed'); - } - - // add some items to the queue - - q.push({name: 'foo'}, function (err) { - console.log('finished processing foo'); - }); - q.push({name: 'bar'}, function (err) { - console.log('finished processing bar'); - }); - - // add some items to the queue (batch-wise) - - q.push([{name: 'baz'},{name: 'bay'},{name: 'bax'}], function (err) { - console.log('finished processing bar'); - }); - - ---------------------------------------- - - -### auto(tasks, [callback]) - -Determines the best order for running functions based on their requirements. -Each function can optionally depend on other functions being completed first, -and each function is run as soon as its requirements are satisfied. If any of -the functions pass an error to their callback, that function will not complete -(so any other functions depending on it will not run) and the main callback -will be called immediately with the error. Functions also receive an object -containing the results of functions which have completed so far. - -__Arguments__ - -* tasks - An object literal containing named functions or an array of - requirements, with the function itself the last item in the array. The key - used for each function or array is used when specifying requirements. The - syntax is easier to understand by looking at the example. -* callback(err, results) - An optional callback which is called when all the - tasks have been completed. The callback will receive an error as an argument - if any tasks pass an error to their callback. If all tasks complete - successfully, it will receive an object containing their results. - -__Example__ - - async.auto({ - get_data: function(callback){ - // async code to get some data - }, - make_folder: function(callback){ - // async code to create a directory to store a file in - // this is run at the same time as getting the data - }, - write_file: ['get_data', 'make_folder', function(callback){ - // once there is some data and the directory exists, - // write the data to a file in the directory - callback(null, filename); - }], - email_link: ['write_file', function(callback, results){ - // once the file is written let's email a link to it... - // results.write_file contains the filename returned by write_file. - }] - }); - -This is a fairly trivial example, but to do this using the basic parallel and -series functions would look like this: - - async.parallel([ - function(callback){ - // async code to get some data - }, - function(callback){ - // async code to create a directory to store a file in - // this is run at the same time as getting the data - } - ], - function(results){ - async.series([ - function(callback){ - // once there is some data and the directory exists, - // write the data to a file in the directory - }, - email_link: function(callback){ - // once the file is written let's email a link to it... - } - ]); - }); - -For a complicated series of async tasks using the auto function makes adding -new tasks much easier and makes the code more readable. - - ---------------------------------------- - - -### iterator(tasks) - -Creates an iterator function which calls the next function in the array, -returning a continuation to call the next one after that. Its also possible to -'peek' the next iterator by doing iterator.next(). - -This function is used internally by the async module but can be useful when -you want to manually control the flow of functions in series. - -__Arguments__ - -* tasks - An array of functions to run, each function is passed a callback it - must call on completion. - -__Example__ - - var iterator = async.iterator([ - function(){ sys.p('one'); }, - function(){ sys.p('two'); }, - function(){ sys.p('three'); } - ]); - - node> var iterator2 = iterator(); - 'one' - node> var iterator3 = iterator2(); - 'two' - node> iterator3(); - 'three' - node> var nextfn = iterator2.next(); - node> nextfn(); - 'three' - - ---------------------------------------- - - -### apply(function, arguments..) - -Creates a continuation function with some arguments already applied, a useful -shorthand when combined with other control flow functions. Any arguments -passed to the returned function are added to the arguments originally passed -to apply. - -__Arguments__ - -* function - The function you want to eventually apply all arguments to. -* arguments... - Any number of arguments to automatically apply when the - continuation is called. - -__Example__ - - // using apply - - async.parallel([ - async.apply(fs.writeFile, 'testfile1', 'test1'), - async.apply(fs.writeFile, 'testfile2', 'test2'), - ]); - - - // the same process without using apply - - async.parallel([ - function(callback){ - fs.writeFile('testfile1', 'test1', callback); - }, - function(callback){ - fs.writeFile('testfile2', 'test2', callback); - }, - ]); - -It's possible to pass any number of additional arguments when calling the -continuation: - - node> var fn = async.apply(sys.puts, 'one'); - node> fn('two', 'three'); - one - two - three - ---------------------------------------- - - -### nextTick(callback) - -Calls the callback on a later loop around the event loop. In node.js this just -calls process.nextTick, in the browser it falls back to setTimeout(callback, 0), -which means other higher priority events may precede the execution of the callback. - -This is used internally for browser-compatibility purposes. - -__Arguments__ - -* callback - The function to call on a later loop around the event loop. - -__Example__ - - var call_order = []; - async.nextTick(function(){ - call_order.push('two'); - // call_order now equals ['one','two] - }); - call_order.push('one') - - -## Utils - - -### memoize(fn, [hasher]) - -Caches the results of an async function. When creating a hash to store function -results against, the callback is omitted from the hash and an optional hash -function can be used. - -__Arguments__ - -* fn - the function you to proxy and cache results from. -* hasher - an optional function for generating a custom hash for storing - results, it has all the arguments applied to it apart from the callback, and - must be synchronous. - -__Example__ - - var slow_fn = function (name, callback) { - // do something - callback(null, result); - }; - var fn = async.memoize(slow_fn); - - // fn can now be used as if it were slow_fn - fn('some name', function () { - // callback - }); - - -### unmemoize(fn) - -Undoes a memoized function, reverting it to the original, unmemoized -form. Comes handy in tests. - -__Arguments__ - -* fn - the memoized function - - -### log(function, arguments) - -Logs the result of an async function to the console. Only works in node.js or -in browsers that support console.log and console.error (such as FF and Chrome). -If multiple arguments are returned from the async function, console.log is -called on each argument in order. - -__Arguments__ - -* function - The function you want to eventually apply all arguments to. -* arguments... - Any number of arguments to apply to the function. - -__Example__ - - var hello = function(name, callback){ - setTimeout(function(){ - callback(null, 'hello ' + name); - }, 1000); - }; - - node> async.log(hello, 'world'); - 'hello world' - - ---------------------------------------- - - -### dir(function, arguments) - -Logs the result of an async function to the console using console.dir to -display the properties of the resulting object. Only works in node.js or -in browsers that support console.dir and console.error (such as FF and Chrome). -If multiple arguments are returned from the async function, console.dir is -called on each argument in order. - -__Arguments__ - -* function - The function you want to eventually apply all arguments to. -* arguments... - Any number of arguments to apply to the function. - -__Example__ - - var hello = function(name, callback){ - setTimeout(function(){ - callback(null, {hello: name}); - }, 1000); - }; - - node> async.dir(hello, 'world'); - {hello: 'world'} - - ---------------------------------------- - - -### noConflict() - -Changes the value of async back to its original value, returning a reference to the -async object. diff --git a/Phaser/node_modules/grunt/node_modules/async/package.json b/Phaser/node_modules/grunt/node_modules/async/package.json deleted file mode 100644 index 8fbed48a..00000000 --- a/Phaser/node_modules/grunt/node_modules/async/package.json +++ /dev/null @@ -1,35 +0,0 @@ -{ - "name": "async", - "description": "Higher-order functions and common patterns for asynchronous code", - "main": "./index", - "author": { - "name": "Caolan McMahon" - }, - "version": "0.1.22", - "repository": { - "type": "git", - "url": "http://github.com/caolan/async.git" - }, - "bugs": { - "url": "http://github.com/caolan/async/issues" - }, - "licenses": [ - { - "type": "MIT", - "url": "http://github.com/caolan/async/raw/master/LICENSE" - } - ], - "devDependencies": { - "nodeunit": ">0.0.0", - "uglify-js": "1.2.x", - "nodelint": ">0.0.0" - }, - "readme": "# Async.js\n\nAsync is a utility module which provides straight-forward, powerful functions\nfor working with asynchronous JavaScript. Although originally designed for\nuse with [node.js](http://nodejs.org), it can also be used directly in the\nbrowser.\n\nAsync provides around 20 functions that include the usual 'functional'\nsuspects (map, reduce, filter, forEach…) as well as some common patterns\nfor asynchronous control flow (parallel, series, waterfall…). All these\nfunctions assume you follow the node.js convention of providing a single\ncallback as the last argument of your async function.\n\n\n## Quick Examples\n\n async.map(['file1','file2','file3'], fs.stat, function(err, results){\n // results is now an array of stats for each file\n });\n\n async.filter(['file1','file2','file3'], path.exists, function(results){\n // results now equals an array of the existing files\n });\n\n async.parallel([\n function(){ ... },\n function(){ ... }\n ], callback);\n\n async.series([\n function(){ ... },\n function(){ ... }\n ]);\n\nThere are many more functions available so take a look at the docs below for a\nfull list. This module aims to be comprehensive, so if you feel anything is\nmissing please create a GitHub issue for it.\n\n\n## Download\n\nReleases are available for download from\n[GitHub](http://github.com/caolan/async/downloads).\nAlternatively, you can install using Node Package Manager (npm):\n\n npm install async\n\n\n__Development:__ [async.js](https://github.com/caolan/async/raw/master/lib/async.js) - 17.5kb Uncompressed\n\n__Production:__ [async.min.js](https://github.com/caolan/async/raw/master/dist/async.min.js) - 1.7kb Packed and Gzipped\n\n\n## In the Browser\n\nSo far its been tested in IE6, IE7, IE8, FF3.6 and Chrome 5. Usage:\n\n \n \n\n\n## Documentation\n\n### Collections\n\n* [forEach](#forEach)\n* [map](#map)\n* [filter](#filter)\n* [reject](#reject)\n* [reduce](#reduce)\n* [detect](#detect)\n* [sortBy](#sortBy)\n* [some](#some)\n* [every](#every)\n* [concat](#concat)\n\n### Control Flow\n\n* [series](#series)\n* [parallel](#parallel)\n* [whilst](#whilst)\n* [until](#until)\n* [waterfall](#waterfall)\n* [queue](#queue)\n* [auto](#auto)\n* [iterator](#iterator)\n* [apply](#apply)\n* [nextTick](#nextTick)\n\n### Utils\n\n* [memoize](#memoize)\n* [unmemoize](#unmemoize)\n* [log](#log)\n* [dir](#dir)\n* [noConflict](#noConflict)\n\n\n## Collections\n\n\n### forEach(arr, iterator, callback)\n\nApplies an iterator function to each item in an array, in parallel.\nThe iterator is called with an item from the list and a callback for when it\nhas finished. If the iterator passes an error to this callback, the main\ncallback for the forEach function is immediately called with the error.\n\nNote, that since this function applies the iterator to each item in parallel\nthere is no guarantee that the iterator functions will complete in order.\n\n__Arguments__\n\n* arr - An array to iterate over.\n* iterator(item, callback) - A function to apply to each item in the array.\n The iterator is passed a callback which must be called once it has completed.\n* callback(err) - A callback which is called after all the iterator functions\n have finished, or an error has occurred.\n\n__Example__\n\n // assuming openFiles is an array of file names and saveFile is a function\n // to save the modified contents of that file:\n\n async.forEach(openFiles, saveFile, function(err){\n // if any of the saves produced an error, err would equal that error\n });\n\n---------------------------------------\n\n\n### forEachSeries(arr, iterator, callback)\n\nThe same as forEach only the iterator is applied to each item in the array in\nseries. The next iterator is only called once the current one has completed\nprocessing. This means the iterator functions will complete in order.\n\n\n---------------------------------------\n\n\n### forEachLimit(arr, limit, iterator, callback)\n\nThe same as forEach only the iterator is applied to batches of items in the\narray, in series. The next batch of iterators is only called once the current\none has completed processing.\n\n__Arguments__\n\n* arr - An array to iterate over.\n* limit - How many items should be in each batch.\n* iterator(item, callback) - A function to apply to each item in the array.\n The iterator is passed a callback which must be called once it has completed.\n* callback(err) - A callback which is called after all the iterator functions\n have finished, or an error has occurred.\n\n__Example__\n\n // Assume documents is an array of JSON objects and requestApi is a\n // function that interacts with a rate-limited REST api.\n\n async.forEachLimit(documents, 20, requestApi, function(err){\n // if any of the saves produced an error, err would equal that error\n });\n---------------------------------------\n\n\n### map(arr, iterator, callback)\n\nProduces a new array of values by mapping each value in the given array through\nthe iterator function. The iterator is called with an item from the array and a\ncallback for when it has finished processing. The callback takes 2 arguments, \nan error and the transformed item from the array. If the iterator passes an\nerror to this callback, the main callback for the map function is immediately\ncalled with the error.\n\nNote, that since this function applies the iterator to each item in parallel\nthere is no guarantee that the iterator functions will complete in order, however\nthe results array will be in the same order as the original array.\n\n__Arguments__\n\n* arr - An array to iterate over.\n* iterator(item, callback) - A function to apply to each item in the array.\n The iterator is passed a callback which must be called once it has completed\n with an error (which can be null) and a transformed item.\n* callback(err, results) - A callback which is called after all the iterator\n functions have finished, or an error has occurred. Results is an array of the\n transformed items from the original array.\n\n__Example__\n\n async.map(['file1','file2','file3'], fs.stat, function(err, results){\n // results is now an array of stats for each file\n });\n\n---------------------------------------\n\n\n### mapSeries(arr, iterator, callback)\n\nThe same as map only the iterator is applied to each item in the array in\nseries. The next iterator is only called once the current one has completed\nprocessing. The results array will be in the same order as the original.\n\n\n---------------------------------------\n\n\n### filter(arr, iterator, callback)\n\n__Alias:__ select\n\nReturns a new array of all the values which pass an async truth test.\n_The callback for each iterator call only accepts a single argument of true or\nfalse, it does not accept an error argument first!_ This is in-line with the\nway node libraries work with truth tests like path.exists. This operation is\nperformed in parallel, but the results array will be in the same order as the\noriginal.\n\n__Arguments__\n\n* arr - An array to iterate over.\n* iterator(item, callback) - A truth test to apply to each item in the array.\n The iterator is passed a callback which must be called once it has completed.\n* callback(results) - A callback which is called after all the iterator\n functions have finished.\n\n__Example__\n\n async.filter(['file1','file2','file3'], path.exists, function(results){\n // results now equals an array of the existing files\n });\n\n---------------------------------------\n\n\n### filterSeries(arr, iterator, callback)\n\n__alias:__ selectSeries\n\nThe same as filter only the iterator is applied to each item in the array in\nseries. The next iterator is only called once the current one has completed\nprocessing. The results array will be in the same order as the original.\n\n---------------------------------------\n\n\n### reject(arr, iterator, callback)\n\nThe opposite of filter. Removes values that pass an async truth test.\n\n---------------------------------------\n\n\n### rejectSeries(arr, iterator, callback)\n\nThe same as filter, only the iterator is applied to each item in the array\nin series.\n\n\n---------------------------------------\n\n\n### reduce(arr, memo, iterator, callback)\n\n__aliases:__ inject, foldl\n\nReduces a list of values into a single value using an async iterator to return\neach successive step. Memo is the initial state of the reduction. This\nfunction only operates in series. For performance reasons, it may make sense to\nsplit a call to this function into a parallel map, then use the normal\nArray.prototype.reduce on the results. This function is for situations where\neach step in the reduction needs to be async, if you can get the data before\nreducing it then its probably a good idea to do so.\n\n__Arguments__\n\n* arr - An array to iterate over.\n* memo - The initial state of the reduction.\n* iterator(memo, item, callback) - A function applied to each item in the\n array to produce the next step in the reduction. The iterator is passed a\n callback which accepts an optional error as its first argument, and the state\n of the reduction as the second. If an error is passed to the callback, the\n reduction is stopped and the main callback is immediately called with the\n error.\n* callback(err, result) - A callback which is called after all the iterator\n functions have finished. Result is the reduced value.\n\n__Example__\n\n async.reduce([1,2,3], 0, function(memo, item, callback){\n // pointless async:\n process.nextTick(function(){\n callback(null, memo + item)\n });\n }, function(err, result){\n // result is now equal to the last value of memo, which is 6\n });\n\n---------------------------------------\n\n\n### reduceRight(arr, memo, iterator, callback)\n\n__Alias:__ foldr\n\nSame as reduce, only operates on the items in the array in reverse order.\n\n\n---------------------------------------\n\n\n### detect(arr, iterator, callback)\n\nReturns the first value in a list that passes an async truth test. The\niterator is applied in parallel, meaning the first iterator to return true will\nfire the detect callback with that result. That means the result might not be\nthe first item in the original array (in terms of order) that passes the test.\n\nIf order within the original array is important then look at detectSeries.\n\n__Arguments__\n\n* arr - An array to iterate over.\n* iterator(item, callback) - A truth test to apply to each item in the array.\n The iterator is passed a callback which must be called once it has completed.\n* callback(result) - A callback which is called as soon as any iterator returns\n true, or after all the iterator functions have finished. Result will be\n the first item in the array that passes the truth test (iterator) or the\n value undefined if none passed.\n\n__Example__\n\n async.detect(['file1','file2','file3'], path.exists, function(result){\n // result now equals the first file in the list that exists\n });\n\n---------------------------------------\n\n\n### detectSeries(arr, iterator, callback)\n\nThe same as detect, only the iterator is applied to each item in the array\nin series. This means the result is always the first in the original array (in\nterms of array order) that passes the truth test.\n\n\n---------------------------------------\n\n\n### sortBy(arr, iterator, callback)\n\nSorts a list by the results of running each value through an async iterator.\n\n__Arguments__\n\n* arr - An array to iterate over.\n* iterator(item, callback) - A function to apply to each item in the array.\n The iterator is passed a callback which must be called once it has completed\n with an error (which can be null) and a value to use as the sort criteria.\n* callback(err, results) - A callback which is called after all the iterator\n functions have finished, or an error has occurred. Results is the items from\n the original array sorted by the values returned by the iterator calls.\n\n__Example__\n\n async.sortBy(['file1','file2','file3'], function(file, callback){\n fs.stat(file, function(err, stats){\n callback(err, stats.mtime);\n });\n }, function(err, results){\n // results is now the original array of files sorted by\n // modified date\n });\n\n\n---------------------------------------\n\n\n### some(arr, iterator, callback)\n\n__Alias:__ any\n\nReturns true if at least one element in the array satisfies an async test.\n_The callback for each iterator call only accepts a single argument of true or\nfalse, it does not accept an error argument first!_ This is in-line with the\nway node libraries work with truth tests like path.exists. Once any iterator\ncall returns true, the main callback is immediately called.\n\n__Arguments__\n\n* arr - An array to iterate over.\n* iterator(item, callback) - A truth test to apply to each item in the array.\n The iterator is passed a callback which must be called once it has completed.\n* callback(result) - A callback which is called as soon as any iterator returns\n true, or after all the iterator functions have finished. Result will be\n either true or false depending on the values of the async tests.\n\n__Example__\n\n async.some(['file1','file2','file3'], path.exists, function(result){\n // if result is true then at least one of the files exists\n });\n\n---------------------------------------\n\n\n### every(arr, iterator, callback)\n\n__Alias:__ all\n\nReturns true if every element in the array satisfies an async test.\n_The callback for each iterator call only accepts a single argument of true or\nfalse, it does not accept an error argument first!_ This is in-line with the\nway node libraries work with truth tests like path.exists.\n\n__Arguments__\n\n* arr - An array to iterate over.\n* iterator(item, callback) - A truth test to apply to each item in the array.\n The iterator is passed a callback which must be called once it has completed.\n* callback(result) - A callback which is called after all the iterator\n functions have finished. Result will be either true or false depending on\n the values of the async tests.\n\n__Example__\n\n async.every(['file1','file2','file3'], path.exists, function(result){\n // if result is true then every file exists\n });\n\n---------------------------------------\n\n\n### concat(arr, iterator, callback)\n\nApplies an iterator to each item in a list, concatenating the results. Returns the\nconcatenated list. The iterators are called in parallel, and the results are\nconcatenated as they return. There is no guarantee that the results array will\nbe returned in the original order of the arguments passed to the iterator function.\n\n__Arguments__\n\n* arr - An array to iterate over\n* iterator(item, callback) - A function to apply to each item in the array.\n The iterator is passed a callback which must be called once it has completed\n with an error (which can be null) and an array of results.\n* callback(err, results) - A callback which is called after all the iterator\n functions have finished, or an error has occurred. Results is an array containing\n the concatenated results of the iterator function.\n\n__Example__\n\n async.concat(['dir1','dir2','dir3'], fs.readdir, function(err, files){\n // files is now a list of filenames that exist in the 3 directories\n });\n\n---------------------------------------\n\n\n### concatSeries(arr, iterator, callback)\n\nSame as async.concat, but executes in series instead of parallel.\n\n\n## Control Flow\n\n\n### series(tasks, [callback])\n\nRun an array of functions in series, each one running once the previous\nfunction has completed. If any functions in the series pass an error to its\ncallback, no more functions are run and the callback for the series is\nimmediately called with the value of the error. Once the tasks have completed,\nthe results are passed to the final callback as an array.\n\nIt is also possible to use an object instead of an array. Each property will be\nrun as a function and the results will be passed to the final callback as an object\ninstead of an array. This can be a more readable way of handling results from\nasync.series.\n\n\n__Arguments__\n\n* tasks - An array or object containing functions to run, each function is passed\n a callback it must call on completion.\n* callback(err, results) - An optional callback to run once all the functions\n have completed. This function gets an array of all the arguments passed to\n the callbacks used in the array.\n\n__Example__\n\n async.series([\n function(callback){\n // do some stuff ...\n callback(null, 'one');\n },\n function(callback){\n // do some more stuff ...\n callback(null, 'two');\n },\n ],\n // optional callback\n function(err, results){\n // results is now equal to ['one', 'two']\n });\n\n\n // an example using an object instead of an array\n async.series({\n one: function(callback){\n setTimeout(function(){\n callback(null, 1);\n }, 200);\n },\n two: function(callback){\n setTimeout(function(){\n callback(null, 2);\n }, 100);\n },\n },\n function(err, results) {\n // results is now equal to: {one: 1, two: 2}\n });\n\n\n---------------------------------------\n\n\n### parallel(tasks, [callback])\n\nRun an array of functions in parallel, without waiting until the previous\nfunction has completed. If any of the functions pass an error to its\ncallback, the main callback is immediately called with the value of the error.\nOnce the tasks have completed, the results are passed to the final callback as an\narray.\n\nIt is also possible to use an object instead of an array. Each property will be\nrun as a function and the results will be passed to the final callback as an object\ninstead of an array. This can be a more readable way of handling results from\nasync.parallel.\n\n\n__Arguments__\n\n* tasks - An array or object containing functions to run, each function is passed a\n callback it must call on completion.\n* callback(err, results) - An optional callback to run once all the functions\n have completed. This function gets an array of all the arguments passed to\n the callbacks used in the array.\n\n__Example__\n\n async.parallel([\n function(callback){\n setTimeout(function(){\n callback(null, 'one');\n }, 200);\n },\n function(callback){\n setTimeout(function(){\n callback(null, 'two');\n }, 100);\n },\n ],\n // optional callback\n function(err, results){\n // the results array will equal ['one','two'] even though\n // the second function had a shorter timeout.\n });\n\n\n // an example using an object instead of an array\n async.parallel({\n one: function(callback){\n setTimeout(function(){\n callback(null, 1);\n }, 200);\n },\n two: function(callback){\n setTimeout(function(){\n callback(null, 2);\n }, 100);\n },\n },\n function(err, results) {\n // results is now equals to: {one: 1, two: 2}\n });\n\n\n---------------------------------------\n\n\n### whilst(test, fn, callback)\n\nRepeatedly call fn, while test returns true. Calls the callback when stopped,\nor an error occurs.\n\n__Arguments__\n\n* test() - synchronous truth test to perform before each execution of fn.\n* fn(callback) - A function to call each time the test passes. The function is\n passed a callback which must be called once it has completed with an optional\n error as the first argument.\n* callback(err) - A callback which is called after the test fails and repeated\n execution of fn has stopped.\n\n__Example__\n\n var count = 0;\n\n async.whilst(\n function () { return count < 5; },\n function (callback) {\n count++;\n setTimeout(callback, 1000);\n },\n function (err) {\n // 5 seconds have passed\n }\n );\n\n\n---------------------------------------\n\n\n### until(test, fn, callback)\n\nRepeatedly call fn, until test returns true. Calls the callback when stopped,\nor an error occurs.\n\nThe inverse of async.whilst.\n\n\n---------------------------------------\n\n\n### waterfall(tasks, [callback])\n\nRuns an array of functions in series, each passing their results to the next in\nthe array. However, if any of the functions pass an error to the callback, the\nnext function is not executed and the main callback is immediately called with\nthe error.\n\n__Arguments__\n\n* tasks - An array of functions to run, each function is passed a callback it\n must call on completion.\n* callback(err, [results]) - An optional callback to run once all the functions\n have completed. This will be passed the results of the last task's callback.\n\n\n\n__Example__\n\n async.waterfall([\n function(callback){\n callback(null, 'one', 'two');\n },\n function(arg1, arg2, callback){\n callback(null, 'three');\n },\n function(arg1, callback){\n // arg1 now equals 'three'\n callback(null, 'done');\n }\n ], function (err, result) {\n // result now equals 'done' \n });\n\n\n---------------------------------------\n\n\n### queue(worker, concurrency)\n\nCreates a queue object with the specified concurrency. Tasks added to the\nqueue will be processed in parallel (up to the concurrency limit). If all\nworkers are in progress, the task is queued until one is available. Once\na worker has completed a task, the task's callback is called.\n\n__Arguments__\n\n* worker(task, callback) - An asynchronous function for processing a queued\n task.\n* concurrency - An integer for determining how many worker functions should be\n run in parallel.\n\n__Queue objects__\n\nThe queue object returned by this function has the following properties and\nmethods:\n\n* length() - a function returning the number of items waiting to be processed.\n* concurrency - an integer for determining how many worker functions should be\n run in parallel. This property can be changed after a queue is created to\n alter the concurrency on-the-fly.\n* push(task, [callback]) - add a new task to the queue, the callback is called\n once the worker has finished processing the task.\n instead of a single task, an array of tasks can be submitted. the respective callback is used for every task in the list.\n* saturated - a callback that is called when the queue length hits the concurrency and further tasks will be queued\n* empty - a callback that is called when the last item from the queue is given to a worker\n* drain - a callback that is called when the last item from the queue has returned from the worker\n\n__Example__\n\n // create a queue object with concurrency 2\n\n var q = async.queue(function (task, callback) {\n console.log('hello ' + task.name);\n callback();\n }, 2);\n\n\n // assign a callback\n q.drain = function() {\n console.log('all items have been processed');\n }\n\n // add some items to the queue\n\n q.push({name: 'foo'}, function (err) {\n console.log('finished processing foo');\n });\n q.push({name: 'bar'}, function (err) {\n console.log('finished processing bar');\n });\n\n // add some items to the queue (batch-wise)\n\n q.push([{name: 'baz'},{name: 'bay'},{name: 'bax'}], function (err) {\n console.log('finished processing bar');\n });\n\n\n---------------------------------------\n\n\n### auto(tasks, [callback])\n\nDetermines the best order for running functions based on their requirements.\nEach function can optionally depend on other functions being completed first,\nand each function is run as soon as its requirements are satisfied. If any of\nthe functions pass an error to their callback, that function will not complete\n(so any other functions depending on it will not run) and the main callback\nwill be called immediately with the error. Functions also receive an object\ncontaining the results of functions which have completed so far.\n\n__Arguments__\n\n* tasks - An object literal containing named functions or an array of\n requirements, with the function itself the last item in the array. The key\n used for each function or array is used when specifying requirements. The\n syntax is easier to understand by looking at the example.\n* callback(err, results) - An optional callback which is called when all the\n tasks have been completed. The callback will receive an error as an argument\n if any tasks pass an error to their callback. If all tasks complete\n successfully, it will receive an object containing their results.\n\n__Example__\n\n async.auto({\n get_data: function(callback){\n // async code to get some data\n },\n make_folder: function(callback){\n // async code to create a directory to store a file in\n // this is run at the same time as getting the data\n },\n write_file: ['get_data', 'make_folder', function(callback){\n // once there is some data and the directory exists,\n // write the data to a file in the directory\n callback(null, filename);\n }],\n email_link: ['write_file', function(callback, results){\n // once the file is written let's email a link to it...\n // results.write_file contains the filename returned by write_file.\n }]\n });\n\nThis is a fairly trivial example, but to do this using the basic parallel and\nseries functions would look like this:\n\n async.parallel([\n function(callback){\n // async code to get some data\n },\n function(callback){\n // async code to create a directory to store a file in\n // this is run at the same time as getting the data\n }\n ],\n function(results){\n async.series([\n function(callback){\n // once there is some data and the directory exists,\n // write the data to a file in the directory\n },\n email_link: function(callback){\n // once the file is written let's email a link to it...\n }\n ]);\n });\n\nFor a complicated series of async tasks using the auto function makes adding\nnew tasks much easier and makes the code more readable.\n\n\n---------------------------------------\n\n\n### iterator(tasks)\n\nCreates an iterator function which calls the next function in the array,\nreturning a continuation to call the next one after that. Its also possible to\n'peek' the next iterator by doing iterator.next().\n\nThis function is used internally by the async module but can be useful when\nyou want to manually control the flow of functions in series.\n\n__Arguments__\n\n* tasks - An array of functions to run, each function is passed a callback it\n must call on completion.\n\n__Example__\n\n var iterator = async.iterator([\n function(){ sys.p('one'); },\n function(){ sys.p('two'); },\n function(){ sys.p('three'); }\n ]);\n\n node> var iterator2 = iterator();\n 'one'\n node> var iterator3 = iterator2();\n 'two'\n node> iterator3();\n 'three'\n node> var nextfn = iterator2.next();\n node> nextfn();\n 'three'\n\n\n---------------------------------------\n\n\n### apply(function, arguments..)\n\nCreates a continuation function with some arguments already applied, a useful\nshorthand when combined with other control flow functions. Any arguments\npassed to the returned function are added to the arguments originally passed\nto apply.\n\n__Arguments__\n\n* function - The function you want to eventually apply all arguments to.\n* arguments... - Any number of arguments to automatically apply when the\n continuation is called.\n\n__Example__\n\n // using apply\n\n async.parallel([\n async.apply(fs.writeFile, 'testfile1', 'test1'),\n async.apply(fs.writeFile, 'testfile2', 'test2'),\n ]);\n\n\n // the same process without using apply\n\n async.parallel([\n function(callback){\n fs.writeFile('testfile1', 'test1', callback);\n },\n function(callback){\n fs.writeFile('testfile2', 'test2', callback);\n },\n ]);\n\nIt's possible to pass any number of additional arguments when calling the\ncontinuation:\n\n node> var fn = async.apply(sys.puts, 'one');\n node> fn('two', 'three');\n one\n two\n three\n\n---------------------------------------\n\n\n### nextTick(callback)\n\nCalls the callback on a later loop around the event loop. In node.js this just\ncalls process.nextTick, in the browser it falls back to setTimeout(callback, 0),\nwhich means other higher priority events may precede the execution of the callback.\n\nThis is used internally for browser-compatibility purposes.\n\n__Arguments__\n\n* callback - The function to call on a later loop around the event loop.\n\n__Example__\n\n var call_order = [];\n async.nextTick(function(){\n call_order.push('two');\n // call_order now equals ['one','two]\n });\n call_order.push('one')\n\n\n## Utils\n\n\n### memoize(fn, [hasher])\n\nCaches the results of an async function. When creating a hash to store function\nresults against, the callback is omitted from the hash and an optional hash\nfunction can be used.\n\n__Arguments__\n\n* fn - the function you to proxy and cache results from.\n* hasher - an optional function for generating a custom hash for storing\n results, it has all the arguments applied to it apart from the callback, and\n must be synchronous.\n\n__Example__\n\n var slow_fn = function (name, callback) {\n // do something\n callback(null, result);\n };\n var fn = async.memoize(slow_fn);\n\n // fn can now be used as if it were slow_fn\n fn('some name', function () {\n // callback\n });\n\n\n### unmemoize(fn)\n\nUndoes a memoized function, reverting it to the original, unmemoized\nform. Comes handy in tests.\n\n__Arguments__\n\n* fn - the memoized function\n\n\n### log(function, arguments)\n\nLogs the result of an async function to the console. Only works in node.js or\nin browsers that support console.log and console.error (such as FF and Chrome).\nIf multiple arguments are returned from the async function, console.log is\ncalled on each argument in order.\n\n__Arguments__\n\n* function - The function you want to eventually apply all arguments to.\n* arguments... - Any number of arguments to apply to the function.\n\n__Example__\n\n var hello = function(name, callback){\n setTimeout(function(){\n callback(null, 'hello ' + name);\n }, 1000);\n };\n\n node> async.log(hello, 'world');\n 'hello world'\n\n\n---------------------------------------\n\n\n### dir(function, arguments)\n\nLogs the result of an async function to the console using console.dir to\ndisplay the properties of the resulting object. Only works in node.js or\nin browsers that support console.dir and console.error (such as FF and Chrome).\nIf multiple arguments are returned from the async function, console.dir is\ncalled on each argument in order.\n\n__Arguments__\n\n* function - The function you want to eventually apply all arguments to.\n* arguments... - Any number of arguments to apply to the function.\n\n__Example__\n\n var hello = function(name, callback){\n setTimeout(function(){\n callback(null, {hello: name});\n }, 1000);\n };\n\n node> async.dir(hello, 'world');\n {hello: 'world'}\n\n\n---------------------------------------\n\n\n### noConflict()\n\nChanges the value of async back to its original value, returning a reference to the\nasync object.\n", - "readmeFilename": "README.md", - "_id": "async@0.1.22", - "dist": { - "shasum": "3b270eedc0419d6f92a664444ce98e0f59a8fef7" - }, - "_from": "async@~0.1.22", - "_resolved": "https://registry.npmjs.org/async/-/async-0.1.22.tgz" -} diff --git a/Phaser/node_modules/grunt/node_modules/coffee-script/.npmignore b/Phaser/node_modules/grunt/node_modules/coffee-script/.npmignore deleted file mode 100644 index 21e430d2..00000000 --- a/Phaser/node_modules/grunt/node_modules/coffee-script/.npmignore +++ /dev/null @@ -1,11 +0,0 @@ -*.coffee -*.html -.DS_Store -.git* -Cakefile -documentation/ -examples/ -extras/coffee-script.js -raw/ -src/ -test/ diff --git a/Phaser/node_modules/grunt/node_modules/coffee-script/CNAME b/Phaser/node_modules/grunt/node_modules/coffee-script/CNAME deleted file mode 100644 index faadabe5..00000000 --- a/Phaser/node_modules/grunt/node_modules/coffee-script/CNAME +++ /dev/null @@ -1 +0,0 @@ -coffeescript.org \ No newline at end of file diff --git a/Phaser/node_modules/grunt/node_modules/coffee-script/LICENSE b/Phaser/node_modules/grunt/node_modules/coffee-script/LICENSE deleted file mode 100644 index dbe6b4e3..00000000 --- a/Phaser/node_modules/grunt/node_modules/coffee-script/LICENSE +++ /dev/null @@ -1,22 +0,0 @@ -Copyright (c) 2009-2012 Jeremy Ashkenas - -Permission is hereby granted, free of charge, to any person -obtaining a copy of this software and associated documentation -files (the "Software"), to deal in the Software without -restriction, including without limitation the rights to use, -copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the -Software is furnished to do so, subject to the following -conditions: - -The above copyright notice and this permission notice shall be -included in all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES -OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT -HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, -WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING -FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR -OTHER DEALINGS IN THE SOFTWARE. \ No newline at end of file diff --git a/Phaser/node_modules/grunt/node_modules/coffee-script/README b/Phaser/node_modules/grunt/node_modules/coffee-script/README deleted file mode 100644 index 69ee6f43..00000000 --- a/Phaser/node_modules/grunt/node_modules/coffee-script/README +++ /dev/null @@ -1,51 +0,0 @@ - - { - } } { - { { } } - } }{ { - { }{ } } _____ __ __ - ( }{ }{ { ) / ____| / _|/ _| - .- { { } { }} -. | | ___ | |_| |_ ___ ___ - ( ( } { } { } } ) | | / _ \| _| _/ _ \/ _ \ - |`-..________ ..-'| | |___| (_) | | | || __/ __/ - | | \_____\___/|_| |_| \___|\___| - | ;--. - | (__ \ _____ _ _ - | | ) ) / ____| (_) | | - | |/ / | (___ ___ _ __ _ _ __ | |_ - | ( / \___ \ / __| '__| | '_ \| __| - | |/ ____) | (__| | | | |_) | |_ - | | |_____/ \___|_| |_| .__/ \__| - `-.._________..-' | | - |_| - - - CoffeeScript is a little language that compiles into JavaScript. - - Install Node.js, and then the CoffeeScript compiler: - sudo bin/cake install - - Or, if you have the Node Package Manager installed: - npm install -g coffee-script - (Leave off the -g if you don't wish to install globally.) - - Execute a script: - coffee /path/to/script.coffee - - Compile a script: - coffee -c /path/to/script.coffee - - For documentation, usage, and examples, see: - http://coffeescript.org/ - - To suggest a feature, report a bug, or general discussion: - http://github.com/jashkenas/coffee-script/issues/ - - If you'd like to chat, drop by #coffeescript on Freenode IRC, - or on webchat.freenode.net. - - The source repository: - git://github.com/jashkenas/coffee-script.git - - All contributors are listed here: - http://github.com/jashkenas/coffee-script/contributors diff --git a/Phaser/node_modules/grunt/node_modules/coffee-script/Rakefile b/Phaser/node_modules/grunt/node_modules/coffee-script/Rakefile deleted file mode 100644 index dfb85dab..00000000 --- a/Phaser/node_modules/grunt/node_modules/coffee-script/Rakefile +++ /dev/null @@ -1,78 +0,0 @@ -require 'rubygems' -require 'erb' -require 'fileutils' -require 'rake/testtask' -require 'json' - -desc "Build the documentation page" -task :doc do - source = 'documentation/index.html.erb' - child = fork { exec "bin/coffee -bcw -o documentation/js documentation/coffee/*.coffee" } - at_exit { Process.kill("INT", child) } - Signal.trap("INT") { exit } - loop do - mtime = File.stat(source).mtime - if !@mtime || mtime > @mtime - rendered = ERB.new(File.read(source)).result(binding) - File.open('index.html', 'w+') {|f| f.write(rendered) } - end - @mtime = mtime - sleep 1 - end -end - -desc "Build coffee-script-source gem" -task :gem do - require 'rubygems' - require 'rubygems/package' - - gemspec = Gem::Specification.new do |s| - s.name = 'coffee-script-source' - s.version = JSON.parse(File.read('package.json'))["version"] - s.date = Time.now.strftime("%Y-%m-%d") - - s.homepage = "http://jashkenas.github.com/coffee-script/" - s.summary = "The CoffeeScript Compiler" - s.description = <<-EOS - CoffeeScript is a little language that compiles into JavaScript. - Underneath all of those embarrassing braces and semicolons, - JavaScript has always had a gorgeous object model at its heart. - CoffeeScript is an attempt to expose the good parts of JavaScript - in a simple way. - EOS - - s.files = [ - 'lib/coffee_script/coffee-script.js', - 'lib/coffee_script/source.rb' - ] - - s.authors = ['Jeremy Ashkenas'] - s.email = 'jashkenas@gmail.com' - s.rubyforge_project = 'coffee-script-source' - end - - file = File.open("coffee-script-source.gem", "w") - Gem::Package.open(file, 'w') do |pkg| - pkg.metadata = gemspec.to_yaml - - path = "lib/coffee_script/source.rb" - contents = <<-ERUBY -module CoffeeScript - module Source - def self.bundled_path - File.expand_path("../coffee-script.js", __FILE__) - end - end -end - ERUBY - pkg.add_file_simple(path, 0644, contents.size) do |tar_io| - tar_io.write(contents) - end - - contents = File.read("extras/coffee-script.js") - path = "lib/coffee_script/coffee-script.js" - pkg.add_file_simple(path, 0644, contents.size) do |tar_io| - tar_io.write(contents) - end - end -end diff --git a/Phaser/node_modules/grunt/node_modules/coffee-script/extras/jsl.conf b/Phaser/node_modules/grunt/node_modules/coffee-script/extras/jsl.conf deleted file mode 100644 index 1190da52..00000000 --- a/Phaser/node_modules/grunt/node_modules/coffee-script/extras/jsl.conf +++ /dev/null @@ -1,44 +0,0 @@ -# JavaScriptLint configuration file for CoffeeScript. - -+no_return_value # function {0} does not always return a value -+duplicate_formal # duplicate formal argument {0} --equal_as_assign # test for equality (==) mistyped as assignment (=)?{0} -+var_hides_arg # variable {0} hides argument -+redeclared_var # redeclaration of {0} {1} --anon_no_return_value # anonymous function does not always return a value -+missing_semicolon # missing semicolon -+meaningless_block # meaningless block; curly braces have no impact --comma_separated_stmts # multiple statements separated by commas (use semicolons?) -+unreachable_code # unreachable code -+missing_break # missing break statement --missing_break_for_last_case # missing break statement for last case in switch --comparison_type_conv # comparisons against null, 0, true, false, or an empty string allowing implicit type conversion (use === or !==) --inc_dec_within_stmt # increment (++) and decrement (--) operators used as part of greater statement --useless_void # use of the void type may be unnecessary (void is always undefined) -+multiple_plus_minus # unknown order of operations for successive plus (e.g. x+++y) or minus (e.g. x---y) signs -+use_of_label # use of label --block_without_braces # block statement without curly braces -+leading_decimal_point # leading decimal point may indicate a number or an object member -+trailing_decimal_point # trailing decimal point may indicate a number or an object member -+octal_number # leading zeros make an octal number -+nested_comment # nested comment -+misplaced_regex # regular expressions should be preceded by a left parenthesis, assignment, colon, or comma -+ambiguous_newline # unexpected end of line; it is ambiguous whether these lines are part of the same statement -+empty_statement # empty statement or extra semicolon --missing_option_explicit # the "option explicit" control comment is missing -+partial_option_explicit # the "option explicit" control comment, if used, must be in the first script tag -+dup_option_explicit # duplicate "option explicit" control comment -+useless_assign # useless assignment -+ambiguous_nested_stmt # block statements containing block statements should use curly braces to resolve ambiguity -+ambiguous_else_stmt # the else statement could be matched with one of multiple if statements (use curly braces to indicate intent) --missing_default_case # missing default case in switch statement -+duplicate_case_in_switch # duplicate case in switch statements -+default_not_at_end # the default case is not at the end of the switch statement -+legacy_cc_not_understood # couldn't understand control comment using /*@keyword@*/ syntax -+jsl_cc_not_understood # couldn't understand control comment using /*jsl:keyword*/ syntax -+useless_comparison # useless comparison; comparing identical expressions -+with_statement # with statement hides undeclared variables; use temporary variable instead -+trailing_comma_in_array # extra comma is not recommended in array initializers -+assign_to_function_call # assignment to a function call -+parseint_missing_radix # parseInt missing radix parameter -+lambda_assign_requires_semicolon diff --git a/Phaser/node_modules/grunt/node_modules/coffee-script/package.json b/Phaser/node_modules/grunt/node_modules/coffee-script/package.json deleted file mode 100644 index aaf03a02..00000000 --- a/Phaser/node_modules/grunt/node_modules/coffee-script/package.json +++ /dev/null @@ -1,49 +0,0 @@ -{ - "name": "coffee-script", - "description": "Unfancy JavaScript", - "keywords": [ - "javascript", - "language", - "coffeescript", - "compiler" - ], - "author": { - "name": "Jeremy Ashkenas" - }, - "version": "1.3.3", - "licenses": [ - { - "type": "MIT", - "url": "https://raw.github.com/jashkenas/coffee-script/master/LICENSE" - } - ], - "engines": { - "node": ">=0.4.0" - }, - "directories": { - "lib": "./lib/coffee-script" - }, - "main": "./lib/coffee-script/coffee-script", - "bin": { - "coffee": "./bin/coffee", - "cake": "./bin/cake" - }, - "homepage": "http://coffeescript.org", - "bugs": "https://github.com/jashkenas/coffee-script/issues", - "repository": { - "type": "git", - "url": "git://github.com/jashkenas/coffee-script.git" - }, - "devDependencies": { - "uglify-js": ">=1.0.0", - "jison": ">=0.2.0" - }, - "readme": "\n {\n } } {\n { { } }\n } }{ {\n { }{ } } _____ __ __\n ( }{ }{ { ) / ____| / _|/ _|\n .- { { } { }} -. | | ___ | |_| |_ ___ ___\n ( ( } { } { } } ) | | / _ \\| _| _/ _ \\/ _ \\\n |`-..________ ..-'| | |___| (_) | | | || __/ __/\n | | \\_____\\___/|_| |_| \\___|\\___|\n | ;--.\n | (__ \\ _____ _ _\n | | ) ) / ____| (_) | |\n | |/ / | (___ ___ _ __ _ _ __ | |_\n | ( / \\___ \\ / __| '__| | '_ \\| __|\n | |/ ____) | (__| | | | |_) | |_\n | | |_____/ \\___|_| |_| .__/ \\__|\n `-.._________..-' | |\n |_|\n\n\n CoffeeScript is a little language that compiles into JavaScript.\n\n Install Node.js, and then the CoffeeScript compiler:\n sudo bin/cake install\n\n Or, if you have the Node Package Manager installed:\n npm install -g coffee-script\n (Leave off the -g if you don't wish to install globally.)\n\n Execute a script:\n coffee /path/to/script.coffee\n\n Compile a script:\n coffee -c /path/to/script.coffee\n\n For documentation, usage, and examples, see:\n http://coffeescript.org/\n\n To suggest a feature, report a bug, or general discussion:\n http://github.com/jashkenas/coffee-script/issues/\n\n If you'd like to chat, drop by #coffeescript on Freenode IRC,\n or on webchat.freenode.net.\n\n The source repository:\n git://github.com/jashkenas/coffee-script.git\n\n All contributors are listed here:\n http://github.com/jashkenas/coffee-script/contributors\n", - "readmeFilename": "README", - "_id": "coffee-script@1.3.3", - "dist": { - "shasum": "d41e076292bcf98fbb2753e76e1a07a8be5db9b7" - }, - "_from": "coffee-script@~1.3.3", - "_resolved": "https://registry.npmjs.org/coffee-script/-/coffee-script-1.3.3.tgz" -} diff --git a/Phaser/node_modules/grunt/node_modules/colors/MIT-LICENSE.txt b/Phaser/node_modules/grunt/node_modules/colors/MIT-LICENSE.txt deleted file mode 100644 index 7dca1070..00000000 --- a/Phaser/node_modules/grunt/node_modules/colors/MIT-LICENSE.txt +++ /dev/null @@ -1,22 +0,0 @@ -Copyright (c) 2010 - -Marak Squires -Alexis Sellier (cloudhead) - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. \ No newline at end of file diff --git a/Phaser/node_modules/grunt/node_modules/colors/ReadMe.md b/Phaser/node_modules/grunt/node_modules/colors/ReadMe.md deleted file mode 100644 index 1c6b0d07..00000000 --- a/Phaser/node_modules/grunt/node_modules/colors/ReadMe.md +++ /dev/null @@ -1,77 +0,0 @@ -# colors.js - get color and style in your node.js console ( and browser ) like what - - - - -## Installation - - npm install colors - -## colors and styles! - -- bold -- italic -- underline -- inverse -- yellow -- cyan -- white -- magenta -- green -- red -- grey -- blue -- rainbow -- zebra -- random - -## Usage - -``` js -var colors = require('./colors'); - -console.log('hello'.green); // outputs green text -console.log('i like cake and pies'.underline.red) // outputs red underlined text -console.log('inverse the color'.inverse); // inverses the color -console.log('OMG Rainbows!'.rainbow); // rainbow (ignores spaces) -``` - -# Creating Custom themes - -```js - -var require('colors'); - -colors.setTheme({ - silly: 'rainbow', - input: 'grey', - verbose: 'cyan', - prompt: 'grey', - info: 'green', - data: 'grey', - help: 'cyan', - warn: 'yellow', - debug: 'blue', - error: 'red' -}); - -// outputs red text -console.log("this is an error".error); - -// outputs yellow text -console.log("this is a warning".warn); -``` - - -### Contributors - -Marak (Marak Squires) -Alexis Sellier (cloudhead) -mmalecki (Maciej Małecki) -nicoreed (Nico Reed) -morganrallen (Morgan Allen) -JustinCampbell (Justin Campbell) -ded (Dustin Diaz) - - -#### , Marak Squires , Justin Campbell, Dustin Diaz (@ded) diff --git a/Phaser/node_modules/grunt/node_modules/colors/example.html b/Phaser/node_modules/grunt/node_modules/colors/example.html deleted file mode 100644 index ab956494..00000000 --- a/Phaser/node_modules/grunt/node_modules/colors/example.html +++ /dev/null @@ -1,74 +0,0 @@ - - - - - Colors Example - - - - - - \ No newline at end of file diff --git a/Phaser/node_modules/grunt/node_modules/colors/package.json b/Phaser/node_modules/grunt/node_modules/colors/package.json deleted file mode 100644 index b4b9612c..00000000 --- a/Phaser/node_modules/grunt/node_modules/colors/package.json +++ /dev/null @@ -1,24 +0,0 @@ -{ - "name": "colors", - "description": "get colors in your node.js console like what", - "version": "0.6.0-1", - "author": { - "name": "Marak Squires" - }, - "repository": { - "type": "git", - "url": "http://github.com/Marak/colors.js.git" - }, - "engines": { - "node": ">=0.1.90" - }, - "main": "colors", - "readme": "# colors.js - get color and style in your node.js console ( and browser ) like what\n\n\n\n\n## Installation\n\n npm install colors\n\n## colors and styles!\n\n- bold\n- italic\n- underline\n- inverse\n- yellow\n- cyan\n- white\n- magenta\n- green\n- red\n- grey\n- blue\n- rainbow\n- zebra\n- random\n\n## Usage\n\n``` js\nvar colors = require('./colors');\n\nconsole.log('hello'.green); // outputs green text\nconsole.log('i like cake and pies'.underline.red) // outputs red underlined text\nconsole.log('inverse the color'.inverse); // inverses the color\nconsole.log('OMG Rainbows!'.rainbow); // rainbow (ignores spaces)\n```\n\n# Creating Custom themes\n\n```js\n\nvar require('colors');\n\ncolors.setTheme({\n silly: 'rainbow',\n input: 'grey',\n verbose: 'cyan',\n prompt: 'grey',\n info: 'green',\n data: 'grey',\n help: 'cyan',\n warn: 'yellow',\n debug: 'blue',\n error: 'red'\n});\n\n// outputs red text\nconsole.log(\"this is an error\".error);\n\n// outputs yellow text\nconsole.log(\"this is a warning\".warn);\n```\n\n\n### Contributors \n\nMarak (Marak Squires)\nAlexis Sellier (cloudhead)\nmmalecki (Maciej Małecki)\nnicoreed (Nico Reed)\nmorganrallen (Morgan Allen)\nJustinCampbell (Justin Campbell)\nded (Dustin Diaz)\n\n\n#### , Marak Squires , Justin Campbell, Dustin Diaz (@ded)\n", - "readmeFilename": "ReadMe.md", - "_id": "colors@0.6.0-1", - "dist": { - "shasum": "322d52c6f629babb21b1713e6365d1b6ec1937bd" - }, - "_from": "colors@~0.6.0-1", - "_resolved": "https://registry.npmjs.org/colors/-/colors-0.6.0-1.tgz" -} diff --git a/Phaser/node_modules/grunt/node_modules/dateformat/Readme.md b/Phaser/node_modules/grunt/node_modules/dateformat/Readme.md deleted file mode 100644 index d469e6d7..00000000 --- a/Phaser/node_modules/grunt/node_modules/dateformat/Readme.md +++ /dev/null @@ -1,67 +0,0 @@ -# node-dateformat - -A node.js package for Steven Levithan's excellent [dateFormat()][dateformat] function. - -## Modifications - -* Removed the `Date.prototype.format` method. Sorry folks, but extending native prototypes is for suckers. -* Added a `module.exports = dateFormat;` statement at the bottom - -## Usage - -As taken from Steven's post, modified to match the Modifications listed above: - - var dateFormat = require('dateformat'); - var now = new Date(); - - // Basic usage - dateFormat(now, "dddd, mmmm dS, yyyy, h:MM:ss TT"); - // Saturday, June 9th, 2007, 5:46:21 PM - - // You can use one of several named masks - dateFormat(now, "isoDateTime"); - // 2007-06-09T17:46:21 - - // ...Or add your own - dateFormat.masks.hammerTime = 'HH:MM! "Can\'t touch this!"'; - dateFormat(now, "hammerTime"); - // 17:46! Can't touch this! - - // When using the standalone dateFormat function, - // you can also provide the date as a string - dateFormat("Jun 9 2007", "fullDate"); - // Saturday, June 9, 2007 - - // Note that if you don't include the mask argument, - // dateFormat.masks.default is used - dateFormat(now); - // Sat Jun 09 2007 17:46:21 - - // And if you don't include the date argument, - // the current date and time is used - dateFormat(); - // Sat Jun 09 2007 17:46:22 - - // You can also skip the date argument (as long as your mask doesn't - // contain any numbers), in which case the current date/time is used - dateFormat("longTime"); - // 5:46:22 PM EST - - // And finally, you can convert local time to UTC time. Simply pass in - // true as an additional argument (no argument skipping allowed in this case): - dateFormat(now, "longTime", true); - // 10:46:21 PM UTC - - // ...Or add the prefix "UTC:" to your mask. - dateFormat(now, "UTC:h:MM:ss TT Z"); - // 10:46:21 PM UTC - - // You can also get the ISO 8601 week of the year: - dateFormat(now, "W"); - // 42 -## License - -(c) 2007-2009 Steven Levithan [stevenlevithan.com][stevenlevithan], MIT license. - -[dateformat]: http://blog.stevenlevithan.com/archives/date-time-format -[stevenlevithan]: http://stevenlevithan.com/ diff --git a/Phaser/node_modules/grunt/node_modules/dateformat/package.json b/Phaser/node_modules/grunt/node_modules/dateformat/package.json deleted file mode 100644 index 91a795a0..00000000 --- a/Phaser/node_modules/grunt/node_modules/dateformat/package.json +++ /dev/null @@ -1,24 +0,0 @@ -{ - "name": "dateformat", - "description": "A node.js package for Steven Levithan's excellent dateFormat() function.", - "maintainers": "Felix Geisendörfer ", - "homepage": "https://github.com/felixge/node-dateformat", - "author": { - "name": "Steven Levithan" - }, - "version": "1.0.2-1.2.3", - "main": "./lib/dateformat", - "dependencies": {}, - "devDependencies": {}, - "engines": { - "node": "*" - }, - "readme": "# node-dateformat\n\nA node.js package for Steven Levithan's excellent [dateFormat()][dateformat] function.\n\n## Modifications\n\n* Removed the `Date.prototype.format` method. Sorry folks, but extending native prototypes is for suckers.\n* Added a `module.exports = dateFormat;` statement at the bottom\n\n## Usage\n\nAs taken from Steven's post, modified to match the Modifications listed above:\n\n var dateFormat = require('dateformat');\n var now = new Date();\n\n // Basic usage\n dateFormat(now, \"dddd, mmmm dS, yyyy, h:MM:ss TT\");\n // Saturday, June 9th, 2007, 5:46:21 PM\n\n // You can use one of several named masks\n dateFormat(now, \"isoDateTime\");\n // 2007-06-09T17:46:21\n\n // ...Or add your own\n dateFormat.masks.hammerTime = 'HH:MM! \"Can\\'t touch this!\"';\n dateFormat(now, \"hammerTime\");\n // 17:46! Can't touch this!\n\n // When using the standalone dateFormat function,\n // you can also provide the date as a string\n dateFormat(\"Jun 9 2007\", \"fullDate\");\n // Saturday, June 9, 2007\n\n // Note that if you don't include the mask argument,\n // dateFormat.masks.default is used\n dateFormat(now);\n // Sat Jun 09 2007 17:46:21\n\n // And if you don't include the date argument,\n // the current date and time is used\n dateFormat();\n // Sat Jun 09 2007 17:46:22\n\n // You can also skip the date argument (as long as your mask doesn't\n // contain any numbers), in which case the current date/time is used\n dateFormat(\"longTime\");\n // 5:46:22 PM EST\n\n // And finally, you can convert local time to UTC time. Simply pass in\n // true as an additional argument (no argument skipping allowed in this case):\n dateFormat(now, \"longTime\", true);\n // 10:46:21 PM UTC\n\n // ...Or add the prefix \"UTC:\" to your mask.\n dateFormat(now, \"UTC:h:MM:ss TT Z\");\n // 10:46:21 PM UTC\n\n // You can also get the ISO 8601 week of the year:\n dateFormat(now, \"W\");\n // 42\n## License\n\n(c) 2007-2009 Steven Levithan [stevenlevithan.com][stevenlevithan], MIT license.\n\n[dateformat]: http://blog.stevenlevithan.com/archives/date-time-format\n[stevenlevithan]: http://stevenlevithan.com/\n", - "readmeFilename": "Readme.md", - "_id": "dateformat@1.0.2-1.2.3", - "dist": { - "shasum": "692290ea53102d50a82968882eab448a048a7f23" - }, - "_from": "dateformat@1.0.2-1.2.3", - "_resolved": "https://registry.npmjs.org/dateformat/-/dateformat-1.0.2-1.2.3.tgz" -} diff --git a/Phaser/node_modules/grunt/node_modules/dateformat/test/test_weekofyear.sh b/Phaser/node_modules/grunt/node_modules/dateformat/test/test_weekofyear.sh deleted file mode 100644 index 3c3e69b3..00000000 --- a/Phaser/node_modules/grunt/node_modules/dateformat/test/test_weekofyear.sh +++ /dev/null @@ -1,27 +0,0 @@ -#!/bin/bash - -# this just takes php's date() function as a reference to check if week of year -# is calculated correctly in the range from 1970 .. 2038 by brute force... - -SEQ="seq" -SYSTEM=`uname` -if [ "$SYSTEM" = "Darwin" ]; then - SEQ="jot" -fi - -for YEAR in {1970..2038}; do - for MONTH in {1..12}; do - DAYS=$(cal $MONTH $YEAR | egrep "28|29|30|31" |tail -1 |awk '{print $NF}') - for DAY in $( $SEQ $DAYS ); do - DATE=$YEAR-$MONTH-$DAY - echo -n $DATE ... - NODEVAL=$(node test_weekofyear.js $DATE) - PHPVAL=$(php -r "echo intval(date('W', strtotime('$DATE')));") - if [ "$NODEVAL" -ne "$PHPVAL" ]; then - echo "MISMATCH: node: $NODEVAL vs php: $PHPVAL for date $DATE" - else - echo " OK" - fi - done - done -done diff --git a/Phaser/node_modules/grunt/node_modules/eventemitter2/.npmignore b/Phaser/node_modules/grunt/node_modules/eventemitter2/.npmignore deleted file mode 100644 index dbed6714..00000000 --- a/Phaser/node_modules/grunt/node_modules/eventemitter2/.npmignore +++ /dev/null @@ -1,13 +0,0 @@ -#ignore these files -*.swp -*~ -*.lock -*.DS_Store -node_modules -npm-debug.log -*.out -*.o -*.tmp - - - diff --git a/Phaser/node_modules/grunt/node_modules/eventemitter2/README.md b/Phaser/node_modules/grunt/node_modules/eventemitter2/README.md deleted file mode 100644 index e0c2aa84..00000000 --- a/Phaser/node_modules/grunt/node_modules/eventemitter2/README.md +++ /dev/null @@ -1,212 +0,0 @@ -# EventEmitter2 - -EventEmitter2 is a an implementation of the EventEmitter found in Node.js - -## Features - - - Namespaces/Wildcards. - - Times To Listen (TTL), extends the `once` concept with `many`. - - Browser environment compatibility. - - Demonstrates good performance in benchmarks - -``` -EventEmitterHeatUp x 3,728,965 ops/sec \302\2610.68% (60 runs sampled) -EventEmitter x 2,822,904 ops/sec \302\2610.74% (63 runs sampled) -EventEmitter2 x 7,251,227 ops/sec \302\2610.55% (58 runs sampled) -EventEmitter2 (wild) x 3,220,268 ops/sec \302\2610.44% (65 runs sampled) -Fastest is EventEmitter2 -``` - -## Differences (Non breaking, compatible with existing EventEmitter) - - - The constructor takes a configuration object. - -```javascript - var EventEmitter2 = require('eventemitter2').EventEmitter2; - var server = new EventEmitter2({ - wildcard: true, // should the event emitter use wildcards. - delimiter: '::', // the delimiter used to segment namespaces, defaults to `.`. - newListener: false, // if you want to emit the newListener event set to true. - maxListeners: 20, // the max number of listeners that can be assigned to an event, defaults to 10. - }); -``` - - - Getting the actual event that fired. - -```javascript - server.on('foo.*', function(value1, value2) { - console.log(this.event, value1, value2); - }); -``` - - - Fire an event N times and then remove it, an extension of the `once` concept. - -```javascript - server.many('foo', 4, function() { - console.log('hello'); - }); -``` - - - Pass in a namespaced event as an array rather than a delimited string. - -```javascript - server.many(['foo', 'bar', 'bazz'], function() { - console.log('hello'); - }); -``` - - -## API - -When an `EventEmitter` instance experiences an error, the typical action is -to emit an `error` event. Error events are treated as a special case. -If there is no listener for it, then the default action is to print a stack -trace and exit the program. - -All EventEmitters emit the event `newListener` when new listeners are -added. - - -**Namespaces** with **Wildcards** -To use namespaces/wildcards, pass the `wildcard` option into the EventEmitter constructor. -When namespaces/wildcards are enabled, events can either be strings (`foo.bar`) separated -by a delimiter or arrays (`['foo', 'bar']`). The delimiter is also configurable as a -constructor option. - -An event name passed to any event emitter method can contain a wild card (the `*` character). -If the event name is a string, a wildcard may appear as `foo.*`. If the event name is an array, -the wildcard may appear as `['foo', '*']`. - -If either of the above described events were passed to the `on` method, subsequent emits such -as the following would be observed... - -```javascript - emitter.emit('foo.bazz'); - emitter.emit(['foo', 'bar']); -``` - - -#### emitter.addListener(event, listener) -#### emitter.on(event, listener) - -Adds a listener to the end of the listeners array for the specified event. - -```javascript - server.on('data', function(value1, value2, value3 /* accepts any number of expected values... */) { - console.log('The event was raised!'); - }); -``` - -```javascript - server.on('data', function(value) { - console.log('The event was raised!'); - }); -``` - -#### emitter.onAny(listener) - -Adds a listener that will be fired when any event is emitted. - -```javascript - server.onAny(function(value) { - console.log('All events trigger this.'); - }); -``` - -#### emitter.offAny(listener) - -Removes the listener that will be fired when any event is emitted. - -```javascript - server.offAny(function(value) { - console.log('The event was raised!'); - }); -``` - -#### emitter.once(event, listener) - -Adds a **one time** listener for the event. The listener is invoked only the first time the event is fired, after which it is removed. - -```javascript - server.once('get', function (value) { - console.log('Ah, we have our first value!'); - }); -``` - -#### emitter.many(event, timesToListen, listener) - -Adds a listener that will execute **n times** for the event before being removed. The listener is invoked only the first time the event is fired, after which it is removed. - -```javascript - server.many('get', 4, function (value) { - console.log('This event will be listened to exactly four times.'); - }); -``` - - -#### emitter.removeListener(event, listener) -#### emitter.off(event, listener) - -Remove a listener from the listener array for the specified event. **Caution**: changes array indices in the listener array behind the listener. - -```javascript - var callback = function(value) { - console.log('someone connected!'); - }; - server.on('get', callback); - // ... - server.removeListener('get', callback); -``` - - -#### emitter.removeAllListeners([event]) - -Removes all listeners, or those of the specified event. - - -#### emitter.setMaxListeners(n) - -By default EventEmitters will print a warning if more than 10 listeners are added to it. This is a useful default which helps finding memory leaks. Obviously not all Emitters should be limited to 10. This function allows that to be increased. Set to zero for unlimited. - - -#### emitter.listeners(event) - -Returns an array of listeners for the specified event. This array can be manipulated, e.g. to remove listeners. - -```javascript - server.on('get', function(value) { - console.log('someone connected!'); - }); - console.log(console.log(server.listeners('get')); // [ [Function] ] -``` - -#### emitter.listenersAny() - -Returns an array of listeners that are listening for any event that is specified. This array can be manipulated, e.g. to remove listeners. - -```javascript - server.onAny(function(value) { - console.log('someone connected!'); - }); - console.log(console.log(server.listenersAny()[0]); // [ [Function] ] // someone connected! -``` - -#### emitter.emit(event, [arg1], [arg2], [...]) - -Execute each of the listeners that may be listening for the specified event name in order with the list of arguments. - -## Test coverage - -There is a test suite that tries to cover each use case, it can be found here. - -## Licence - -(The MIT License) - -Copyright (c) 2011 hij1nx - -Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the 'Software'), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/Phaser/node_modules/grunt/node_modules/eventemitter2/package.json b/Phaser/node_modules/grunt/node_modules/eventemitter2/package.json deleted file mode 100644 index 9a721ee2..00000000 --- a/Phaser/node_modules/grunt/node_modules/eventemitter2/package.json +++ /dev/null @@ -1,78 +0,0 @@ -{ - "name": "eventemitter2", - "version": "0.4.11", - "description": "A Node.js event emitter implementation with namespaces, wildcards, TTL and browser support.", - "keywords": [ - "event", - "events", - "emitter", - "eventemitter" - ], - "author": { - "name": "hij1nx", - "email": "hij1nx@nodejitsu.com" - }, - "maintainers": [ - { - "name": "hij1nx", - "email": "hij1nx@nodejitsu.com" - }, - { - "name": "jameson", - "email": "jameson@nodejitsu.com" - } - ], - "contributors": [ - { - "name": "Eric Elliott" - }, - { - "name": "Charlie Robbins", - "email": "charlie@nodejitsu.com" - }, - { - "name": "Jameson Lee", - "email": "jameson@nodejitsu.com" - }, - { - "name": "Jeroen van Duffelen", - "email": "jvduf@nodejitsu.com" - }, - { - "name": "Fedor Indutny", - "email": "fedor.indutny@gmail.com" - } - ], - "licenses": [ - { - "type": "MIT" - } - ], - "homepage": "https://github.com/hij1nx/EventEmitter2", - "repositories": [ - { - "type": "git", - "url": "git://github.com/hij1nx/EventEmitter2.git" - } - ], - "devDependencies": { - "nodeunit": "*", - "benchmark": ">= 0.2.2" - }, - "engines": [ - "node" - ], - "main": "./lib/eventemitter2.js", - "scripts": { - "test": "nodeunit test/simple/* && nodeunit test/wildcardEvents/*", - "benchmark": "node test/perf/benchmark.js" - }, - "readme": "# EventEmitter2\n\nEventEmitter2 is a an implementation of the EventEmitter found in Node.js\n\n## Features\n\n - Namespaces/Wildcards.\n - Times To Listen (TTL), extends the `once` concept with `many`.\n - Browser environment compatibility.\n - Demonstrates good performance in benchmarks\n\n```\nEventEmitterHeatUp x 3,728,965 ops/sec \\302\\2610.68% (60 runs sampled)\nEventEmitter x 2,822,904 ops/sec \\302\\2610.74% (63 runs sampled)\nEventEmitter2 x 7,251,227 ops/sec \\302\\2610.55% (58 runs sampled)\nEventEmitter2 (wild) x 3,220,268 ops/sec \\302\\2610.44% (65 runs sampled)\nFastest is EventEmitter2\n```\n\n## Differences (Non breaking, compatible with existing EventEmitter)\n\n - The constructor takes a configuration object.\n \n```javascript\n var EventEmitter2 = require('eventemitter2').EventEmitter2;\n var server = new EventEmitter2({\n wildcard: true, // should the event emitter use wildcards.\n delimiter: '::', // the delimiter used to segment namespaces, defaults to `.`.\n newListener: false, // if you want to emit the newListener event set to true.\n maxListeners: 20, // the max number of listeners that can be assigned to an event, defaults to 10.\n });\n```\n\n - Getting the actual event that fired.\n\n```javascript\n server.on('foo.*', function(value1, value2) {\n console.log(this.event, value1, value2);\n });\n```\n\n - Fire an event N times and then remove it, an extension of the `once` concept.\n\n```javascript\n server.many('foo', 4, function() {\n console.log('hello');\n });\n```\n\n - Pass in a namespaced event as an array rather than a delimited string.\n\n```javascript\n server.many(['foo', 'bar', 'bazz'], function() {\n console.log('hello');\n });\n```\n\n\n## API\n\nWhen an `EventEmitter` instance experiences an error, the typical action is\nto emit an `error` event. Error events are treated as a special case.\nIf there is no listener for it, then the default action is to print a stack\ntrace and exit the program.\n\nAll EventEmitters emit the event `newListener` when new listeners are\nadded.\n\n\n**Namespaces** with **Wildcards**\nTo use namespaces/wildcards, pass the `wildcard` option into the EventEmitter constructor.\nWhen namespaces/wildcards are enabled, events can either be strings (`foo.bar`) separated\nby a delimiter or arrays (`['foo', 'bar']`). The delimiter is also configurable as a \nconstructor option.\n\nAn event name passed to any event emitter method can contain a wild card (the `*` character).\nIf the event name is a string, a wildcard may appear as `foo.*`. If the event name is an array, \nthe wildcard may appear as `['foo', '*']`.\n\nIf either of the above described events were passed to the `on` method, subsequent emits such \nas the following would be observed...\n\n```javascript\n emitter.emit('foo.bazz');\n emitter.emit(['foo', 'bar']);\n```\n\n\n#### emitter.addListener(event, listener)\n#### emitter.on(event, listener)\n\nAdds a listener to the end of the listeners array for the specified event.\n\n```javascript\n server.on('data', function(value1, value2, value3 /* accepts any number of expected values... */) {\n console.log('The event was raised!');\n });\n```\n\n```javascript\n server.on('data', function(value) {\n console.log('The event was raised!');\n });\n```\n\n#### emitter.onAny(listener)\n\nAdds a listener that will be fired when any event is emitted.\n\n```javascript\n server.onAny(function(value) {\n console.log('All events trigger this.');\n });\n```\n\n#### emitter.offAny(listener)\n\nRemoves the listener that will be fired when any event is emitted.\n\n```javascript\n server.offAny(function(value) {\n console.log('The event was raised!');\n });\n```\n\n#### emitter.once(event, listener)\n\nAdds a **one time** listener for the event. The listener is invoked only the first time the event is fired, after which it is removed.\n\n```javascript\n server.once('get', function (value) {\n console.log('Ah, we have our first value!');\n });\n```\n\n#### emitter.many(event, timesToListen, listener)\n\nAdds a listener that will execute **n times** for the event before being removed. The listener is invoked only the first time the event is fired, after which it is removed.\n\n```javascript\n server.many('get', 4, function (value) {\n console.log('This event will be listened to exactly four times.');\n });\n```\n\n\n#### emitter.removeListener(event, listener)\n#### emitter.off(event, listener)\n\nRemove a listener from the listener array for the specified event. **Caution**: changes array indices in the listener array behind the listener.\n\n```javascript\n var callback = function(value) {\n console.log('someone connected!');\n };\n server.on('get', callback);\n // ...\n server.removeListener('get', callback);\n```\n\n\n#### emitter.removeAllListeners([event])\n\nRemoves all listeners, or those of the specified event.\n\n\n#### emitter.setMaxListeners(n)\n\nBy default EventEmitters will print a warning if more than 10 listeners are added to it. This is a useful default which helps finding memory leaks. Obviously not all Emitters should be limited to 10. This function allows that to be increased. Set to zero for unlimited.\n\n\n#### emitter.listeners(event)\n\nReturns an array of listeners for the specified event. This array can be manipulated, e.g. to remove listeners.\n\n```javascript\n server.on('get', function(value) {\n console.log('someone connected!');\n });\n console.log(console.log(server.listeners('get')); // [ [Function] ]\n```\n\n#### emitter.listenersAny()\n\nReturns an array of listeners that are listening for any event that is specified. This array can be manipulated, e.g. to remove listeners.\n\n```javascript\n server.onAny(function(value) {\n console.log('someone connected!');\n });\n console.log(console.log(server.listenersAny()[0]); // [ [Function] ] // someone connected!\n```\n\n#### emitter.emit(event, [arg1], [arg2], [...])\n\nExecute each of the listeners that may be listening for the specified event name in order with the list of arguments.\n\n## Test coverage\n\nThere is a test suite that tries to cover each use case, it can be found here.\n\n## Licence\n\n(The MIT License)\n\nCopyright (c) 2011 hij1nx \n\nPermission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the 'Software'), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n", - "readmeFilename": "README.md", - "_id": "eventemitter2@0.4.11", - "dist": { - "shasum": "8bbf2b6ac7b31e2eea0c8d8f533ef41f849a9e2c" - }, - "_from": "eventemitter2@~0.4.9", - "_resolved": "https://registry.npmjs.org/eventemitter2/-/eventemitter2-0.4.11.tgz" -} diff --git a/Phaser/node_modules/grunt/node_modules/findup-sync/.jshintrc b/Phaser/node_modules/grunt/node_modules/findup-sync/.jshintrc deleted file mode 100644 index 6d171b89..00000000 --- a/Phaser/node_modules/grunt/node_modules/findup-sync/.jshintrc +++ /dev/null @@ -1,16 +0,0 @@ -{ - "loopfunc": true, - "curly": true, - "eqeqeq": true, - "immed": true, - "latedef": true, - "newcap": true, - "noarg": true, - "sub": true, - "undef": true, - "unused": true, - "boss": true, - "eqnull": true, - "node": true, - "es5": true -} diff --git a/Phaser/node_modules/grunt/node_modules/findup-sync/.npmignore b/Phaser/node_modules/grunt/node_modules/findup-sync/.npmignore deleted file mode 100644 index e69de29b..00000000 diff --git a/Phaser/node_modules/grunt/node_modules/findup-sync/LICENSE-MIT b/Phaser/node_modules/grunt/node_modules/findup-sync/LICENSE-MIT deleted file mode 100644 index bb2aad6d..00000000 --- a/Phaser/node_modules/grunt/node_modules/findup-sync/LICENSE-MIT +++ /dev/null @@ -1,22 +0,0 @@ -Copyright (c) 2013 "Cowboy" Ben Alman - -Permission is hereby granted, free of charge, to any person -obtaining a copy of this software and associated documentation -files (the "Software"), to deal in the Software without -restriction, including without limitation the rights to use, -copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the -Software is furnished to do so, subject to the following -conditions: - -The above copyright notice and this permission notice shall be -included in all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES -OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT -HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, -WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING -FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR -OTHER DEALINGS IN THE SOFTWARE. diff --git a/Phaser/node_modules/grunt/node_modules/findup-sync/README.md b/Phaser/node_modules/grunt/node_modules/findup-sync/README.md deleted file mode 100644 index 3b08b4e0..00000000 --- a/Phaser/node_modules/grunt/node_modules/findup-sync/README.md +++ /dev/null @@ -1,44 +0,0 @@ -# findup-sync - -Find the first file matching a given pattern in the current directory or the nearest ancestor directory. - -## Getting Started -Install the module with: `npm install findup-sync` - -```js -var findup = require('findup-sync'); - -// Start looking in the CWD. -var filepath1 = findup('{a,b}*.txt'); - -// Start looking somewhere else, and ignore case (probably a good idea). -var filepath2 = findup('{a,b}*.txt', {cwd: '/some/path', nocase: true}); -``` - -## Usage - -```js -findup(patternOrPatterns [, minimatchOptions]) -``` - -### patternOrPatterns -Type: `String` or `Array` -Default: none - -One or more wildcard glob patterns. Or just filenames. - -### minimatchOptions -Type: `Object` -Default: `{}` - -Options to be passed to [minimatch](https://github.com/isaacs/minimatch). - -Note that if you want to start in a different directory than the current working directory, specify a `cwd` property here. - -## Contributing -In lieu of a formal styleguide, take care to maintain the existing coding style. Add unit tests for any new or changed functionality. Lint and test your code using [Grunt](http://gruntjs.com/). - -## Release History -2013-03-08 - v0.1.2 - Updated dependencies. Fixed a Node 0.9.x bug. Updated unit tests to work cross-platform. -2012-11-15 - v0.1.1 - Now works without an options object. -2012-11-01 - v0.1.0 - Initial release. diff --git a/Phaser/node_modules/grunt/node_modules/findup-sync/node_modules/.bin/lodash b/Phaser/node_modules/grunt/node_modules/findup-sync/node_modules/.bin/lodash deleted file mode 120000 index 24deae28..00000000 --- a/Phaser/node_modules/grunt/node_modules/findup-sync/node_modules/.bin/lodash +++ /dev/null @@ -1 +0,0 @@ -../lodash/build.js \ No newline at end of file diff --git a/Phaser/node_modules/grunt/node_modules/findup-sync/node_modules/lodash/LICENSE.txt b/Phaser/node_modules/grunt/node_modules/findup-sync/node_modules/lodash/LICENSE.txt deleted file mode 100644 index cc082396..00000000 --- a/Phaser/node_modules/grunt/node_modules/findup-sync/node_modules/lodash/LICENSE.txt +++ /dev/null @@ -1,22 +0,0 @@ -Copyright 2012-2013 The Dojo Foundation -Based on Underscore.js 1.4.3, copyright 2009-2013 Jeremy Ashkenas, -DocumentCloud Inc. - -Permission is hereby granted, free of charge, to any person obtaining -a copy of this software and associated documentation files (the -"Software"), to deal in the Software without restriction, including -without limitation the rights to use, copy, modify, merge, publish, -distribute, sublicense, and/or sell copies of the Software, and to -permit persons to whom the Software is furnished to do so, subject to -the following conditions: - -The above copyright notice and this permission notice shall be -included in all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE -LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION -WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. \ No newline at end of file diff --git a/Phaser/node_modules/grunt/node_modules/findup-sync/node_modules/lodash/README.md b/Phaser/node_modules/grunt/node_modules/findup-sync/node_modules/lodash/README.md deleted file mode 100644 index 6181c779..00000000 --- a/Phaser/node_modules/grunt/node_modules/findup-sync/node_modules/lodash/README.md +++ /dev/null @@ -1,276 +0,0 @@ -# Lo-Dash v1.0.1 -[![build status](https://secure.travis-ci.org/bestiejs/lodash.png)](http://travis-ci.org/bestiejs/lodash) - -An alternative to Underscore.js, delivering consistency, [customization](https://github.com/bestiejs/lodash#custom-builds), [performance](http://lodash.com/benchmarks), and [extra features](https://github.com/bestiejs/lodash#features). - -## Download - -* Lo-Dash builds (for modern environments):
-[Development](https://raw.github.com/bestiejs/lodash/v1.0.1/dist/lodash.js) and -[Production](https://raw.github.com/bestiejs/lodash/v1.0.1/dist/lodash.min.js) - -* Lo-Dash compatibility builds (for legacy and modern environments):
-[Development](https://raw.github.com/bestiejs/lodash/v1.0.1/dist/lodash.compat.js) and -[Production](https://raw.github.com/bestiejs/lodash/v1.0.1/dist/lodash.compat.min.js) - -* Underscore compatibility builds:
-[Development](https://raw.github.com/bestiejs/lodash/v1.0.1/dist/lodash.underscore.js) and -[Production](https://raw.github.com/bestiejs/lodash/v1.0.1/dist/lodash.underscore.min.js) - -* CDN copies of ≤ v1.0.1’s builds are available on [cdnjs](http://cdnjs.com/) thanks to [CloudFlare](http://www.cloudflare.com/):
-[Lo-Dash dev](http://cdnjs.cloudflare.com/ajax/libs/lodash.js/1.0.1/lodash.js), -[Lo-Dash prod](http://cdnjs.cloudflare.com/ajax/libs/lodash.js/1.0.1/lodash.min.js),
-[Lo-Dash compat-dev](http://cdnjs.cloudflare.com/ajax/libs/lodash.js/1.0.1/lodash.compat.js), -[Lo-Dash compat-prod](http://cdnjs.cloudflare.com/ajax/libs/lodash.js/1.0.1/lodash.compat.min.js),
-[Underscore compat-dev](http://cdnjs.cloudflare.com/ajax/libs/lodash.js/1.0.1/lodash.underscore.js), and -[Underscore compat-prod](http://cdnjs.cloudflare.com/ajax/libs/lodash.js/1.0.1/lodash.underscore.min.js) - -* For optimal file size, [create a custom build](https://github.com/bestiejs/lodash#custom-builds) with only the features you need - -## Dive in - -We’ve got [API docs](http://lodash.com/docs), [benchmarks](http://lodash.com/benchmarks), and [unit tests](http://lodash.com/tests). - -For a list of upcoming features, check out our [roadmap](https://github.com/bestiejs/lodash/wiki/Roadmap). - -## Resources - -For more information check out these articles, screencasts, and other videos over Lo-Dash: - - * Posts - - [Say “Hello†to Lo-Dash](http://kitcambridge.be/blog/say-hello-to-lo-dash/) - - * Videos - - [Introducing Lo-Dash](https://vimeo.com/44154599) - - [Lo-Dash optimizations and custom builds](https://vimeo.com/44154601) - - [Lo-Dash’s origin and why it’s a better utility belt](https://vimeo.com/44154600) - - [Unit testing in Lo-Dash](https://vimeo.com/45865290) - - [Lo-Dash’s approach to native method use](https://vimeo.com/48576012) - - [CascadiaJS: Lo-Dash for a better utility belt](http://www.youtube.com/watch?v=dpPy4f_SeEk) - -## Features - - * AMD loader support ([RequireJS](http://requirejs.org/), [curl.js](https://github.com/cujojs/curl), etc.) - * [_(…)](http://lodash.com/docs#_) supports intuitive chaining - * [_.at](http://lodash.com/docs#at) for cherry-picking collection values - * [_.bindKey](http://lodash.com/docs#bindKey) for binding [*“lazyâ€* defined](http://michaux.ca/articles/lazy-function-definition-pattern) methods - * [_.cloneDeep](http://lodash.com/docs#cloneDeep) for deep cloning arrays and objects - * [_.contains](http://lodash.com/docs#contains) accepts a `fromIndex` argument - * [_.forEach](http://lodash.com/docs#forEach) is chainable and supports exiting iteration early - * [_.forIn](http://lodash.com/docs#forIn) for iterating over an object’s own and inherited properties - * [_.forOwn](http://lodash.com/docs#forOwn) for iterating over an object’s own properties - * [_.isPlainObject](http://lodash.com/docs#isPlainObject) checks if values are created by the `Object` constructor - * [_.merge](http://lodash.com/docs#merge) for a deep [_.extend](http://lodash.com/docs#extend) - * [_.partial](http://lodash.com/docs#partial) and [_.partialRight](http://lodash.com/docs#partialRight) for partial application without `this` binding - * [_.template](http://lodash.com/docs#template) supports [*“importsâ€* options](http://lodash.com/docs#templateSettings_imports), [ES6 template delimiters](http://people.mozilla.org/~jorendorff/es6-draft.html#sec-7.8.6), and [sourceURLs](http://www.html5rocks.com/en/tutorials/developertools/sourcemaps/#toc-sourceurl) - * [_.where](http://lodash.com/docs#where) supports deep object comparisons - * [_.clone](http://lodash.com/docs#clone), [_.omit](http://lodash.com/docs#omit), [_.pick](http://lodash.com/docs#pick), - [and more…](http://lodash.com/docs "_.assign, _.cloneDeep, _.first, _.initial, _.isEqual, _.last, _.merge, _.rest") accept `callback` and `thisArg` arguments - * [_.contains](http://lodash.com/docs#contains), [_.size](http://lodash.com/docs#size), [_.toArray](http://lodash.com/docs#toArray), - [and more…](http://lodash.com/docs "_.at, _.countBy, _.every, _.filter, _.find, _.forEach, _.groupBy, _.invoke, _.map, _.max, _.min, _.pluck, _.reduce, _.reduceRight, _.reject, _.shuffle, _.some, _.sortBy, _.where") accept strings - * [_.filter](http://lodash.com/docs#filter), [_.find](http://lodash.com/docs#find), [_.map](http://lodash.com/docs#map), - [and more…](http://lodash.com/docs "_.countBy, _.every, _.first, _.groupBy, _.initial, _.last, _.max, _.min, _.reject, _.rest, _.some, _.sortBy, _.sortedIndex, _.uniq") support *“_.pluckâ€* and *“_.whereâ€* `callback` shorthands - -## Support - -Lo-Dash has been tested in at least Chrome 5~24, Firefox 1~18, IE 6-10, Opera 9.25-12, Safari 3-6, Node.js 0.4.8-0.8.20, Narwhal 0.3.2, PhantomJS 1.8.1, RingoJS 0.9, and Rhino 1.7RC5. - -## Custom builds - -Custom builds make it easy to create lightweight versions of Lo-Dash containing only the methods you need. -To top it off, we handle all method dependency and alias mapping for you. - - * Backbone builds, with only methods required by Backbone, may be created using the `backbone` modifier argument. -```bash -lodash backbone -``` - - * CSP builds, supporting default [Content Security Policy](https://dvcs.w3.org/hg/content-security-policy/raw-file/tip/csp-specification.dev.html) restrictions, may be created using the `csp` modifier argument. - The `csp` modifier is an alais of the `mobile` modifier. Lo-Dash may be used in Chrome extensions by using either the `csp`, `mobile`, or `underscore` build and using precompiled templates, or loading Lo-Dash in a [sandbox](http://developer.chrome.com/stable/extensions/sandboxingEval.html). -```bash -lodash csp -``` - - * Legacy builds, tailored for older environments without [ES5 support](http://es5.github.com/), may be created using the `legacy` modifier argument. -```bash -lodash legacy -``` - - * Modern builds, tailored for newer environments with ES5 support, may be created using the `modern` modifier argument. -```bash -lodash modern -``` - - * Mobile builds, without method compilation and most bug fixes for old browsers, may be created using the `mobile` modifier argument. -```bash -lodash mobile -``` - - * Strict builds, with `_.bindAll`, `_.defaults`, and `_.extend` in [strict mode](http://es5.github.com/#C), may be created using the `strict` modifier argument. -```bash -lodash strict -``` - - * Underscore builds, tailored for projects already using Underscore, may be created using the `underscore` modifier argument. -```bash -lodash underscore -``` - -Custom builds may be created using the following commands: - - * Use the `category` argument to pass comma separated categories of methods to include in the build.
- Valid categories (case-insensitive) are *“arraysâ€*, *“chainingâ€*, *“collectionsâ€*, *“functionsâ€*, *“objectsâ€*, and *“utilitiesâ€*. -```bash -lodash category=collections,functions -lodash category="collections, functions" -``` - - * Use the `exports` argument to pass comma separated names of ways to export the `LoDash` function.
- Valid exports are *“amdâ€*, *“commonjsâ€*, *“globalâ€*, *“nodeâ€*, and *“noneâ€*. -```bash -lodash exports=amd,commonjs,node -lodash exports="amd, commonjs, node" -``` - - * Use the `iife` argument to specify code to replace the immediately-invoked function expression that wraps Lo-Dash. -```bash -lodash iife="!function(window,undefined){%output%}(this)" -``` - - * Use the `include` argument to pass comma separated method/category names to include in the build. -```bash -lodash include=each,filter,map -lodash include="each, filter, map" -``` - - * Use the `minus` argument to pass comma separated method/category names to remove from those included in the build. -```bash -lodash underscore minus=result,shuffle -lodash underscore minus="result, shuffle" -``` - - * Use the `plus` argument to pass comma separated method/category names to add to those included in the build. -```bash -lodash backbone plus=random,template -lodash backbone plus="random, template" -``` - - * Use the `template` argument to pass the file path pattern used to match template files to precompile. -```bash -lodash template="./*.jst" -``` - - * Use the `settings` argument to pass the template settings used when precompiling templates. -```bash -lodash settings="{interpolate:/\{\{([\s\S]+?)\}\}/g}" -``` - - * Use the `moduleId` argument to specify the AMD module ID of Lo-Dash, which defaults to “lodashâ€, used by precompiled templates. -```bash -lodash moduleId="underscore" -``` - -All arguments, except `legacy` with `csp`, `mobile`, `modern`, or `underscore`, may be combined.
-Unless specified by `-o` or `--output`, all files created are saved to the current working directory. - -The following options are also supported: - - * `-c`, `--stdout` ......... Write output to standard output - * `-d`, `--debug` ........... Write only the non-minified development output - * `-h`, `--help` ............. Display help information - * `-m`, `--minify` ......... Write only the minified production output - * `-o`, `--output` ......... Write output to a given path/filename - * `-p`, `--source-map` .. Generate a source map for the minified output, using an optional source map URL - * `-s`, `--silent` ......... Skip status updates normally logged to the console - * `-V`, `--version` ....... Output current version of Lo-Dash - -The `lodash` command-line utility is available when Lo-Dash is installed as a global package (i.e. `npm install -g lodash`). - -## Installation and usage - -In browsers: - -```html - -``` - -Using [`npm`](http://npmjs.org/): - -```bash -npm install lodash - -npm install -g lodash -npm link lodash -``` - -To avoid potential issues, update `npm` before installing Lo-Dash: - -```bash -npm install npm -g -``` - -In [Node.js](http://nodejs.org/) and [RingoJS v0.8.0+](http://ringojs.org/): - -```js -var _ = require('lodash'); - -// or as a drop-in replacement for Underscore -var _ = require('lodash/lodash.underscore'); -``` - -**Note:** If Lo-Dash is installed globally, run [`npm link lodash`](http://blog.nodejs.org/2011/03/23/npm-1-0-global-vs-local-installation/) in your project’s root directory before requiring it. - -In [RingoJS v0.7.0-](http://ringojs.org/): - -```js -var _ = require('lodash')._; -``` - -In [Rhino](http://www.mozilla.org/rhino/): - -```js -load('lodash.js'); -``` - -In an AMD loader like [RequireJS](http://requirejs.org/): - -```js -require({ - 'paths': { - 'underscore': 'path/to/lodash' - } -}, -['underscore'], function(_) { - console.log(_.VERSION); -}); -``` - -## Release Notes - -### v1.0.1 - - * Add support for specifying source map URLs in `-p`/`--source-map` build options - * Ensured the second argument passed to `_.assign` is not treated as a `callback` - * Ensured `-p`/`--source-map` build options correctly set the `sourceMappingURL` - * Made `-p`/`--source-map` build options set source map *“sourcesâ€* keys based on the builds performed - * Made `_.defer` use `setImmediate`, in Node.js, when available - * Made `_.where` search arrays for values regardless of their index position - * Removed dead code from `_.template` - -The full changelog is available [here](https://github.com/bestiejs/lodash/wiki/Changelog). - -## BestieJS - -Lo-Dash is part of the BestieJS *“Best in Classâ€* module collection. This means we promote solid browser/environment support, ES5 precedents, unit testing, and plenty of documentation. - -## Author - -* [John-David Dalton](http://allyoucanleet.com/) - [![twitter/jdalton](http://gravatar.com/avatar/299a3d891ff1920b69c364d061007043?s=70)](https://twitter.com/jdalton "Follow @jdalton on Twitter") - -## Contributors - -* [Kit Cambridge](http://kitcambridge.github.com/) - [![twitter/kitcambridge](http://gravatar.com/avatar/6662a1d02f351b5ef2f8b4d815804661?s=70)](https://twitter.com/kitcambridge "Follow @kitcambridge on Twitter") -* [Mathias Bynens](http://mathiasbynens.be/) - [![twitter/mathias](http://gravatar.com/avatar/24e08a9ea84deb17ae121074d0f17125?s=70)](https://twitter.com/mathias "Follow @mathias on Twitter") diff --git a/Phaser/node_modules/grunt/node_modules/findup-sync/node_modules/lodash/doc/README.md b/Phaser/node_modules/grunt/node_modules/findup-sync/node_modules/lodash/doc/README.md deleted file mode 100644 index 8e22b33a..00000000 --- a/Phaser/node_modules/grunt/node_modules/findup-sync/node_modules/lodash/doc/README.md +++ /dev/null @@ -1,3590 +0,0 @@ -# Lo-Dash v1.0.1 - - - - - - -## `Arrays` -* [`_.compact`](#_compactarray) -* [`_.difference`](#_differencearray--array1-array2-) -* [`_.drop`](#_restarray--callbackn1-thisarg) -* [`_.first`](#_firstarray--callbackn-thisarg) -* [`_.flatten`](#_flattenarray-shallow) -* [`_.head`](#_firstarray--callbackn-thisarg) -* [`_.indexOf`](#_indexofarray-value--fromindex0) -* [`_.initial`](#_initialarray--callbackn1-thisarg) -* [`_.intersection`](#_intersectionarray1-array2-) -* [`_.last`](#_lastarray--callbackn-thisarg) -* [`_.lastIndexOf`](#_lastindexofarray-value--fromindexarraylength-1) -* [`_.object`](#_objectkeys--values) -* [`_.range`](#_rangestart0-end--step1) -* [`_.rest`](#_restarray--callbackn1-thisarg) -* [`_.sortedIndex`](#_sortedindexarray-value--callbackidentity-thisarg) -* [`_.tail`](#_restarray--callbackn1-thisarg) -* [`_.take`](#_firstarray--callbackn-thisarg) -* [`_.union`](#_unionarray1-array2-) -* [`_.uniq`](#_uniqarray--issortedfalse-callbackidentity-thisarg) -* [`_.unique`](#_uniqarray--issortedfalse-callbackidentity-thisarg) -* [`_.without`](#_withoutarray--value1-value2-) -* [`_.zip`](#_ziparray1-array2-) - - - - - - -## `Chaining` -* [`_`](#_value) -* [`_.tap`](#_tapvalue-interceptor) -* [`_.prototype.toString`](#_prototypetostring) -* [`_.prototype.value`](#_prototypevalueof) -* [`_.prototype.valueOf`](#_prototypevalueof) - - - - - - -## `Collections` -* [`_.all`](#_everycollection--callbackidentity-thisarg) -* [`_.any`](#_somecollection--callbackidentity-thisarg) -* [`_.at`](#_atcollection--index1-index2-) -* [`_.collect`](#_mapcollection--callbackidentity-thisarg) -* [`_.contains`](#_containscollection-target--fromindex0) -* [`_.countBy`](#_countbycollection--callbackidentity-thisarg) -* [`_.detect`](#_findcollection--callbackidentity-thisarg) -* [`_.each`](#_foreachcollection--callbackidentity-thisarg) -* [`_.every`](#_everycollection--callbackidentity-thisarg) -* [`_.filter`](#_filtercollection--callbackidentity-thisarg) -* [`_.find`](#_findcollection--callbackidentity-thisarg) -* [`_.foldl`](#_reducecollection--callbackidentity-accumulator-thisarg) -* [`_.foldr`](#_reducerightcollection--callbackidentity-accumulator-thisarg) -* [`_.forEach`](#_foreachcollection--callbackidentity-thisarg) -* [`_.groupBy`](#_groupbycollection--callbackidentity-thisarg) -* [`_.include`](#_containscollection-target--fromindex0) -* [`_.inject`](#_reducecollection--callbackidentity-accumulator-thisarg) -* [`_.invoke`](#_invokecollection-methodname--arg1-arg2-) -* [`_.map`](#_mapcollection--callbackidentity-thisarg) -* [`_.max`](#_maxcollection--callbackidentity-thisarg) -* [`_.min`](#_mincollection--callbackidentity-thisarg) -* [`_.pluck`](#_pluckcollection-property) -* [`_.reduce`](#_reducecollection--callbackidentity-accumulator-thisarg) -* [`_.reduceRight`](#_reducerightcollection--callbackidentity-accumulator-thisarg) -* [`_.reject`](#_rejectcollection--callbackidentity-thisarg) -* [`_.select`](#_filtercollection--callbackidentity-thisarg) -* [`_.shuffle`](#_shufflecollection) -* [`_.size`](#_sizecollection) -* [`_.some`](#_somecollection--callbackidentity-thisarg) -* [`_.sortBy`](#_sortbycollection--callbackidentity-thisarg) -* [`_.toArray`](#_toarraycollection) -* [`_.where`](#_wherecollection-properties) - - - - - - -## `Functions` -* [`_.after`](#_aftern-func) -* [`_.bind`](#_bindfunc--thisarg-arg1-arg2-) -* [`_.bindAll`](#_bindallobject--methodname1-methodname2-) -* [`_.bindKey`](#_bindkeyobject-key--arg1-arg2-) -* [`_.compose`](#_composefunc1-func2-) -* [`_.debounce`](#_debouncefunc-wait-immediate) -* [`_.defer`](#_deferfunc--arg1-arg2-) -* [`_.delay`](#_delayfunc-wait--arg1-arg2-) -* [`_.memoize`](#_memoizefunc--resolver) -* [`_.once`](#_oncefunc) -* [`_.partial`](#_partialfunc--arg1-arg2-) -* [`_.partialRight`](#_partialrightfunc--arg1-arg2-) -* [`_.throttle`](#_throttlefunc-wait) -* [`_.wrap`](#_wrapvalue-wrapper) - - - - - - -## `Objects` -* [`_.assign`](#_assignobject--source1-source2--callback-thisarg) -* [`_.clone`](#_clonevalue--deepfalse-callback-thisarg) -* [`_.cloneDeep`](#_clonedeepvalue--callback-thisarg) -* [`_.defaults`](#_defaultsobject--source1-source2-) -* [`_.extend`](#_assignobject--source1-source2--callback-thisarg) -* [`_.forIn`](#_forinobject--callbackidentity-thisarg) -* [`_.forOwn`](#_forownobject--callbackidentity-thisarg) -* [`_.functions`](#_functionsobject) -* [`_.has`](#_hasobject-property) -* [`_.invert`](#_invertobject) -* [`_.isArguments`](#_isargumentsvalue) -* [`_.isArray`](#_isarrayvalue) -* [`_.isBoolean`](#_isbooleanvalue) -* [`_.isDate`](#_isdatevalue) -* [`_.isElement`](#_iselementvalue) -* [`_.isEmpty`](#_isemptyvalue) -* [`_.isEqual`](#_isequala-b--callback-thisarg) -* [`_.isFinite`](#_isfinitevalue) -* [`_.isFunction`](#_isfunctionvalue) -* [`_.isNaN`](#_isnanvalue) -* [`_.isNull`](#_isnullvalue) -* [`_.isNumber`](#_isnumbervalue) -* [`_.isObject`](#_isobjectvalue) -* [`_.isPlainObject`](#_isplainobjectvalue) -* [`_.isRegExp`](#_isregexpvalue) -* [`_.isString`](#_isstringvalue) -* [`_.isUndefined`](#_isundefinedvalue) -* [`_.keys`](#_keysobject) -* [`_.merge`](#_mergeobject--source1-source2--callback-thisarg) -* [`_.methods`](#_functionsobject) -* [`_.omit`](#_omitobject-callback-prop1-prop2--thisarg) -* [`_.pairs`](#_pairsobject) -* [`_.pick`](#_pickobject-callback-prop1-prop2--thisarg) -* [`_.values`](#_valuesobject) - - - - - - -## `Utilities` -* [`_.escape`](#_escapestring) -* [`_.identity`](#_identityvalue) -* [`_.mixin`](#_mixinobject) -* [`_.noConflict`](#_noconflict) -* [`_.random`](#_randommin0-max1) -* [`_.result`](#_resultobject-property) -* [`_.template`](#_templatetext-data-options) -* [`_.times`](#_timesn-callback--thisarg) -* [`_.unescape`](#_unescapestring) -* [`_.uniqueId`](#_uniqueidprefix) - - - - - - -## `Methods` -* [`_.templateSettings.imports._`](#_templatesettingsimports_) - - - - - - -## `Properties` -* [`_.VERSION`](#_version) -* [`_.templateSettings`](#_templatesettings) -* [`_.templateSettings.escape`](#_templatesettingsescape) -* [`_.templateSettings.evaluate`](#_templatesettingsevaluate) -* [`_.templateSettings.interpolate`](#_templatesettingsinterpolate) -* [`_.templateSettings.variable`](#_templatesettingsvariable) -* [`_.templateSettings.imports`](#_templatesettingsimports) - - - - - - - - - - - - -## `“Arrays†Methods` - - - -### `_.compact(array)` -# [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L3166 "View in source") [Ⓣ][1] - -Creates an array with all falsey values of `array` removed. The values `false`, `null`, `0`, `""`, `undefined` and `NaN` are all falsey. - -#### Arguments -1. `array` *(Array)*: The array to compact. - -#### Returns -*(Array)*: Returns a new filtered array. - -#### Example -```js -_.compact([0, 1, false, 2, '', 3]); -// => [1, 2, 3] -``` - -* * * - - - - - - -### `_.difference(array [, array1, array2, ...])` -# [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L3196 "View in source") [Ⓣ][1] - -Creates an array of `array` elements not present in the other arrays using strict equality for comparisons, i.e. `===`. - -#### Arguments -1. `array` *(Array)*: The array to process. -2. `[array1, array2, ...]` *(Array)*: Arrays to check. - -#### Returns -*(Array)*: Returns a new array of `array` elements not present in the other arrays. - -#### Example -```js -_.difference([1, 2, 3, 4, 5], [5, 2, 10]); -// => [1, 3, 4] -``` - -* * * - - - - - - -### `_.first(array [, callback|n, thisArg])` -# [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L3268 "View in source") [Ⓣ][1] - -Gets the first element of the `array`. If a number `n` is passed, the first `n` elements of the `array` are returned. If a `callback` function is passed, the first elements the `callback` returns truthy for are returned. The `callback` is bound to `thisArg` and invoked with three arguments; *(value, index, array)*. - -If a property name is passed for `callback`, the created "_.pluck" style callback will return the property value of the given element. - -If an object is passed for `callback`, the created "_.where" style callback will return `true` for elements that have the propeties of the given object, else `false`. - -#### Aliases -*head, take* - -#### Arguments -1. `array` *(Array)*: The array to query. -2. `[callback|n]` *(Function|Object|Number|String)*: The function called per element or the number of elements to return. If a property name or object is passed, it will be used to create a "_.pluck" or "_.where" style callback, respectively. -3. `[thisArg]` *(Mixed)*: The `this` binding of `callback`. - -#### Returns -*(Mixed)*: Returns the first element(s) of `array`. - -#### Example -```js -_.first([1, 2, 3]); -// => 1 - -_.first([1, 2, 3], 2); -// => [1, 2] - -_.first([1, 2, 3], function(num) { - return num < 3; -}); -// => [1, 2] - -var food = [ - { 'name': 'banana', 'organic': true }, - { 'name': 'beet', 'organic': false }, -]; - -// using "_.pluck" callback shorthand -_.first(food, 'organic'); -// => [{ 'name': 'banana', 'organic': true }] - -var food = [ - { 'name': 'apple', 'type': 'fruit' }, - { 'name': 'banana', 'type': 'fruit' }, - { 'name': 'beet', 'type': 'vegetable' } -]; - -// using "_.where" callback shorthand -_.first(food, { 'type': 'fruit' }); -// => [{ 'name': 'apple', 'type': 'fruit' }, { 'name': 'banana', 'type': 'fruit' }] -``` - -* * * - - - - - - -### `_.flatten(array, shallow)` -# [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L3307 "View in source") [Ⓣ][1] - -Flattens a nested array *(the nesting can be to any depth)*. If `shallow` is truthy, `array` will only be flattened a single level. - -#### Arguments -1. `array` *(Array)*: The array to compact. -2. `shallow` *(Boolean)*: A flag to indicate only flattening a single level. - -#### Returns -*(Array)*: Returns a new flattened array. - -#### Example -```js -_.flatten([1, [2], [3, [[4]]]]); -// => [1, 2, 3, 4]; - -_.flatten([1, [2], [3, [[4]]]], true); -// => [1, 2, 3, [[4]]]; -``` - -* * * - - - - - - -### `_.indexOf(array, value [, fromIndex=0])` -# [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L3349 "View in source") [Ⓣ][1] - -Gets the index at which the first occurrence of `value` is found using strict equality for comparisons, i.e. `===`. If the `array` is already sorted, passing `true` for `fromIndex` will run a faster binary search. - -#### Arguments -1. `array` *(Array)*: The array to search. -2. `value` *(Mixed)*: The value to search for. -3. `[fromIndex=0]` *(Boolean|Number)*: The index to search from or `true` to perform a binary search on a sorted `array`. - -#### Returns -*(Number)*: Returns the index of the matched value or `-1`. - -#### Example -```js -_.indexOf([1, 2, 3, 1, 2, 3], 2); -// => 1 - -_.indexOf([1, 2, 3, 1, 2, 3], 2, 3); -// => 4 - -_.indexOf([1, 1, 2, 2, 3, 3], 2, true); -// => 2 -``` - -* * * - - - - - - -### `_.initial(array [, callback|n=1, thisArg])` -# [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L3423 "View in source") [Ⓣ][1] - -Gets all but the last element of `array`. If a number `n` is passed, the last `n` elements are excluded from the result. If a `callback` function is passed, the last elements the `callback` returns truthy for are excluded from the result. The `callback` is bound to `thisArg` and invoked with three arguments; *(value, index, array)*. - -If a property name is passed for `callback`, the created "_.pluck" style callback will return the property value of the given element. - -If an object is passed for `callback`, the created "_.where" style callback will return `true` for elements that have the propeties of the given object, else `false`. - -#### Arguments -1. `array` *(Array)*: The array to query. -2. `[callback|n=1]` *(Function|Object|Number|String)*: The function called per element or the number of elements to exclude. If a property name or object is passed, it will be used to create a "_.pluck" or "_.where" style callback, respectively. -3. `[thisArg]` *(Mixed)*: The `this` binding of `callback`. - -#### Returns -*(Array)*: Returns a slice of `array`. - -#### Example -```js -_.initial([1, 2, 3]); -// => [1, 2] - -_.initial([1, 2, 3], 2); -// => [1] - -_.initial([1, 2, 3], function(num) { - return num > 1; -}); -// => [1] - -var food = [ - { 'name': 'beet', 'organic': false }, - { 'name': 'carrot', 'organic': true } -]; - -// using "_.pluck" callback shorthand -_.initial(food, 'organic'); -// => [{ 'name': 'beet', 'organic': false }] - -var food = [ - { 'name': 'banana', 'type': 'fruit' }, - { 'name': 'beet', 'type': 'vegetable' }, - { 'name': 'carrot', 'type': 'vegetable' } -]; - -// using "_.where" callback shorthand -_.initial(food, { 'type': 'vegetable' }); -// => [{ 'name': 'banana', 'type': 'fruit' }] -``` - -* * * - - - - - - -### `_.intersection([array1, array2, ...])` -# [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L3457 "View in source") [Ⓣ][1] - -Computes the intersection of all the passed-in arrays using strict equality for comparisons, i.e. `===`. - -#### Arguments -1. `[array1, array2, ...]` *(Array)*: Arrays to process. - -#### Returns -*(Array)*: Returns a new array of unique elements that are present in **all** of the arrays. - -#### Example -```js -_.intersection([1, 2, 3], [101, 2, 1, 10], [2, 1]); -// => [1, 2] -``` - -* * * - - - - - - -### `_.last(array [, callback|n, thisArg])` -# [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L3548 "View in source") [Ⓣ][1] - -Gets the last element of the `array`. If a number `n` is passed, the last `n` elements of the `array` are returned. If a `callback` function is passed, the last elements the `callback` returns truthy for are returned. The `callback` is bound to `thisArg` and invoked with three arguments; *(value, index, array)*. - - If a property name is passed for `callback`, the created "_.pluck" style callback will return the property value of the given element. - -If an object is passed for `callback`, the created "_.where" style callback will return `true` for elements that have the propeties of the given object, else `false`. - -#### Arguments -1. `array` *(Array)*: The array to query. -2. `[callback|n]` *(Function|Object|Number|String)*: The function called per element or the number of elements to return. If a property name or object is passed, it will be used to create a "_.pluck" or "_.where" style callback, respectively. -3. `[thisArg]` *(Mixed)*: The `this` binding of `callback`. - -#### Returns -*(Mixed)*: Returns the last element(s) of `array`. - -#### Example -```js -_.last([1, 2, 3]); -// => 3 - -_.last([1, 2, 3], 2); -// => [2, 3] - -_.last([1, 2, 3], function(num) { - return num > 1; -}); -// => [2, 3] - -var food = [ - { 'name': 'beet', 'organic': false }, - { 'name': 'carrot', 'organic': true } -]; - -// using "_.pluck" callback shorthand -_.last(food, 'organic'); -// => [{ 'name': 'carrot', 'organic': true }] - -var food = [ - { 'name': 'banana', 'type': 'fruit' }, - { 'name': 'beet', 'type': 'vegetable' }, - { 'name': 'carrot', 'type': 'vegetable' } -]; - -// using "_.where" callback shorthand -_.last(food, { 'type': 'vegetable' }); -// => [{ 'name': 'beet', 'type': 'vegetable' }, { 'name': 'carrot', 'type': 'vegetable' }] -``` - -* * * - - - - - - -### `_.lastIndexOf(array, value [, fromIndex=array.length-1])` -# [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L3589 "View in source") [Ⓣ][1] - -Gets the index at which the last occurrence of `value` is found using strict equality for comparisons, i.e. `===`. If `fromIndex` is negative, it is used as the offset from the end of the collection. - -#### Arguments -1. `array` *(Array)*: The array to search. -2. `value` *(Mixed)*: The value to search for. -3. `[fromIndex=array.length-1]` *(Number)*: The index to search from. - -#### Returns -*(Number)*: Returns the index of the matched value or `-1`. - -#### Example -```js -_.lastIndexOf([1, 2, 3, 1, 2, 3], 2); -// => 4 - -_.lastIndexOf([1, 2, 3, 1, 2, 3], 2, 3); -// => 1 -``` - -* * * - - - - - - -### `_.object(keys [, values=[]])` -# [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L3619 "View in source") [Ⓣ][1] - -Creates an object composed from arrays of `keys` and `values`. Pass either a single two dimensional array, i.e. `[[key1, value1], [key2, value2]]`, or two arrays, one of `keys` and one of corresponding `values`. - -#### Arguments -1. `keys` *(Array)*: The array of keys. -2. `[values=[]]` *(Array)*: The array of values. - -#### Returns -*(Object)*: Returns an object composed of the given keys and corresponding values. - -#### Example -```js -_.object(['moe', 'larry'], [30, 40]); -// => { 'moe': 30, 'larry': 40 } -``` - -* * * - - - - - - -### `_.range([start=0], end [, step=1])` -# [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L3663 "View in source") [Ⓣ][1] - -Creates an array of numbers *(positive and/or negative)* progressing from `start` up to but not including `end`. - -#### Arguments -1. `[start=0]` *(Number)*: The start of the range. -2. `end` *(Number)*: The end of the range. -3. `[step=1]` *(Number)*: The value to increment or descrement by. - -#### Returns -*(Array)*: Returns a new range array. - -#### Example -```js -_.range(10); -// => [0, 1, 2, 3, 4, 5, 6, 7, 8, 9] - -_.range(1, 11); -// => [1, 2, 3, 4, 5, 6, 7, 8, 9, 10] - -_.range(0, 30, 5); -// => [0, 5, 10, 15, 20, 25] - -_.range(0, -10, -1); -// => [0, -1, -2, -3, -4, -5, -6, -7, -8, -9] - -_.range(0); -// => [] -``` - -* * * - - - - - - -### `_.rest(array [, callback|n=1, thisArg])` -# [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L3741 "View in source") [Ⓣ][1] - -The opposite of `_.initial`, this method gets all but the first value of `array`. If a number `n` is passed, the first `n` values are excluded from the result. If a `callback` function is passed, the first elements the `callback` returns truthy for are excluded from the result. The `callback` is bound to `thisArg` and invoked with three arguments; *(value, index, array)*. - -If a property name is passed for `callback`, the created "_.pluck" style callback will return the property value of the given element. - -If an object is passed for `callback`, the created "_.where" style callback will return `true` for elements that have the propeties of the given object, else `false`. - -#### Aliases -*drop, tail* - -#### Arguments -1. `array` *(Array)*: The array to query. -2. `[callback|n=1]` *(Function|Object|Number|String)*: The function called per element or the number of elements to exclude. If a property name or object is passed, it will be used to create a "_.pluck" or "_.where" style callback, respectively. -3. `[thisArg]` *(Mixed)*: The `this` binding of `callback`. - -#### Returns -*(Array)*: Returns a slice of `array`. - -#### Example -```js -_.rest([1, 2, 3]); -// => [2, 3] - -_.rest([1, 2, 3], 2); -// => [3] - -_.rest([1, 2, 3], function(num) { - return num < 3; -}); -// => [3] - -var food = [ - { 'name': 'banana', 'organic': true }, - { 'name': 'beet', 'organic': false }, -]; - -// using "_.pluck" callback shorthand -_.rest(food, 'organic'); -// => [{ 'name': 'beet', 'organic': false }] - -var food = [ - { 'name': 'apple', 'type': 'fruit' }, - { 'name': 'banana', 'type': 'fruit' }, - { 'name': 'beet', 'type': 'vegetable' } -]; - -// using "_.where" callback shorthand -_.rest(food, { 'type': 'fruit' }); -// => [{ 'name': 'beet', 'type': 'vegetable' }] -``` - -* * * - - - - - - -### `_.sortedIndex(array, value [, callback=identity, thisArg])` -# [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L3805 "View in source") [Ⓣ][1] - -Uses a binary search to determine the smallest index at which the `value` should be inserted into `array` in order to maintain the sort order of the sorted `array`. If `callback` is passed, it will be executed for `value` and each element in `array` to compute their sort ranking. The `callback` is bound to `thisArg` and invoked with one argument; *(value)*. - -If a property name is passed for `callback`, the created "_.pluck" style callback will return the property value of the given element. - -If an object is passed for `callback`, the created "_.where" style callback will return `true` for elements that have the propeties of the given object, else `false`. - -#### Arguments -1. `array` *(Array)*: The array to iterate over. -2. `value` *(Mixed)*: The value to evaluate. -3. `[callback=identity]` *(Function|Object|String)*: The function called per iteration. If a property name or object is passed, it will be used to create a "_.pluck" or "_.where" style callback, respectively. -4. `[thisArg]` *(Mixed)*: The `this` binding of `callback`. - -#### Returns -*(Number)*: Returns the index at which the value should be inserted into `array`. - -#### Example -```js -_.sortedIndex([20, 30, 50], 40); -// => 2 - -// using "_.pluck" callback shorthand -_.sortedIndex([{ 'x': 20 }, { 'x': 30 }, { 'x': 50 }], { 'x': 40 }, 'x'); -// => 2 - -var dict = { - 'wordToNumber': { 'twenty': 20, 'thirty': 30, 'fourty': 40, 'fifty': 50 } -}; - -_.sortedIndex(['twenty', 'thirty', 'fifty'], 'fourty', function(word) { - return dict.wordToNumber[word]; -}); -// => 2 - -_.sortedIndex(['twenty', 'thirty', 'fifty'], 'fourty', function(word) { - return this.wordToNumber[word]; -}, dict); -// => 2 -``` - -* * * - - - - - - -### `_.union([array1, array2, ...])` -# [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L3837 "View in source") [Ⓣ][1] - -Computes the union of the passed-in arrays using strict equality for comparisons, i.e. `===`. - -#### Arguments -1. `[array1, array2, ...]` *(Array)*: Arrays to process. - -#### Returns -*(Array)*: Returns a new array of unique values, in order, that are present in one or more of the arrays. - -#### Example -```js -_.union([1, 2, 3], [101, 2, 1, 10], [2, 1]); -// => [1, 2, 3, 101, 10] -``` - -* * * - - - - - - -### `_.uniq(array [, isSorted=false, callback=identity, thisArg])` -# [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L3884 "View in source") [Ⓣ][1] - -Creates a duplicate-value-free version of the `array` using strict equality for comparisons, i.e. `===`. If the `array` is already sorted, passing `true` for `isSorted` will run a faster algorithm. If `callback` is passed, each element of `array` is passed through a callback` before uniqueness is computed. The `callback` is bound to `thisArg` and invoked with three arguments; *(value, index, array)*. - -If a property name is passed for `callback`, the created "_.pluck" style callback will return the property value of the given element. - -If an object is passed for `callback`, the created "_.where" style callback will return `true` for elements that have the propeties of the given object, else `false`. - -#### Aliases -*unique* - -#### Arguments -1. `array` *(Array)*: The array to process. -2. `[isSorted=false]` *(Boolean)*: A flag to indicate that the `array` is already sorted. -3. `[callback=identity]` *(Function|Object|String)*: The function called per iteration. If a property name or object is passed, it will be used to create a "_.pluck" or "_.where" style callback, respectively. -4. `[thisArg]` *(Mixed)*: The `this` binding of `callback`. - -#### Returns -*(Array)*: Returns a duplicate-value-free array. - -#### Example -```js -_.uniq([1, 2, 1, 3, 1]); -// => [1, 2, 3] - -_.uniq([1, 1, 2, 2, 3], true); -// => [1, 2, 3] - -_.uniq([1, 2, 1.5, 3, 2.5], function(num) { return Math.floor(num); }); -// => [1, 2, 3] - -_.uniq([1, 2, 1.5, 3, 2.5], function(num) { return this.floor(num); }, Math); -// => [1, 2, 3] - -// using "_.pluck" callback shorthand -_.uniq([{ 'x': 1 }, { 'x': 2 }, { 'x': 1 }], 'x'); -// => [{ 'x': 1 }, { 'x': 2 }] -``` - -* * * - - - - - - -### `_.without(array [, value1, value2, ...])` -# [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L3943 "View in source") [Ⓣ][1] - -Creates an array with all occurrences of the passed values removed using strict equality for comparisons, i.e. `===`. - -#### Arguments -1. `array` *(Array)*: The array to filter. -2. `[value1, value2, ...]` *(Mixed)*: Values to remove. - -#### Returns -*(Array)*: Returns a new filtered array. - -#### Example -```js -_.without([1, 2, 1, 0, 3, 1, 4], 0, 1); -// => [2, 3, 4] -``` - -* * * - - - - - - -### `_.zip([array1, array2, ...])` -# [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L3974 "View in source") [Ⓣ][1] - -Groups the elements of each array at their corresponding indexes. Useful for separate data sources that are coordinated through matching array indexes. For a matrix of nested arrays, `_.zip.apply(...)` can transpose the matrix in a similar fashion. - -#### Arguments -1. `[array1, array2, ...]` *(Array)*: Arrays to process. - -#### Returns -*(Array)*: Returns a new array of grouped elements. - -#### Example -```js -_.zip(['moe', 'larry'], [30, 40], [true, false]); -// => [['moe', 30, true], ['larry', 40, false]] -``` - -* * * - - - - - - - - - -## `“Chaining†Methods` - - - -### `_(value)` -# [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L272 "View in source") [Ⓣ][1] - -Creates a `lodash` object, that wraps the given `value`, to enable method chaining. - -In addition to Lo-Dash methods, wrappers also have the following `Array` methods:
-`concat`, `join`, `pop`, `push`, `reverse`, `shift`, `slice`, `sort`, `splice`, and `unshift` - -The chainable wrapper functions are:
-`after`, `assign`, `bind`, `bindAll`, `bindKey`, `chain`, `compact`, `compose`, `concat`, `countBy`, `debounce`, `defaults`, `defer`, `delay`, `difference`, `filter`, `flatten`, `forEach`, `forIn`, `forOwn`, `functions`, `groupBy`, `initial`, `intersection`, `invert`, `invoke`, `keys`, `map`, `max`, `memoize`, `merge`, `min`, `object`, `omit`, `once`, `pairs`, `partial`, `partialRight`, `pick`, `pluck`, `push`, `range`, `reject`, `rest`, `reverse`, `shuffle`, `slice`, `sort`, `sortBy`, `splice`, `tap`, `throttle`, `times`, `toArray`, `union`, `uniq`, `unshift`, `values`, `where`, `without`, `wrap`, and `zip` - -The non-chainable wrapper functions are:
-`clone`, `cloneDeep`, `contains`, `escape`, `every`, `find`, `has`, `identity`, `indexOf`, `isArguments`, `isArray`, `isBoolean`, `isDate`, `isElement`, `isEmpty`, `isEqual`, `isFinite`, `isFunction`, `isNaN`, `isNull`, `isNumber`, `isObject`, `isPlainObject`, `isRegExp`, `isString`, `isUndefined`, `join`, `lastIndexOf`, `mixin`, `noConflict`, `pop`, `random`, `reduce`, `reduceRight`, `result`, `shift`, `size`, `some`, `sortedIndex`, `template`, `unescape`, and `uniqueId` - -The wrapper functions `first` and `last` return wrapped values when `n` is passed, otherwise they return unwrapped values. - -#### Arguments -1. `value` *(Mixed)*: The value to wrap in a `lodash` instance. - -#### Returns -*(Object)*: Returns a `lodash` instance. - -* * * - - - - - - -### `_.tap(value, interceptor)` -# [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L4874 "View in source") [Ⓣ][1] - -Invokes `interceptor` with the `value` as the first argument, and then returns `value`. The purpose of this method is to "tap into" a method chain, in order to perform operations on intermediate results within the chain. - -#### Arguments -1. `value` *(Mixed)*: The value to pass to `interceptor`. -2. `interceptor` *(Function)*: The function to invoke. - -#### Returns -*(Mixed)*: Returns `value`. - -#### Example -```js -_([1, 2, 3, 4]) - .filter(function(num) { return num % 2 == 0; }) - .tap(alert) - .map(function(num) { return num * num; }) - .value(); -// => // [2, 4] (alerted) -// => [4, 16] -``` - -* * * - - - - - - -### `_.prototype.toString()` -# [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L4891 "View in source") [Ⓣ][1] - -Produces the `toString` result of the wrapped value. - -#### Returns -*(String)*: Returns the string result. - -#### Example -```js -_([1, 2, 3]).toString(); -// => '1,2,3' -``` - -* * * - - - - - - -### `_.prototype.valueOf()` -# [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L4908 "View in source") [Ⓣ][1] - -Extracts the wrapped value. - -#### Aliases -*value* - -#### Returns -*(Mixed)*: Returns the wrapped value. - -#### Example -```js -_([1, 2, 3]).valueOf(); -// => [1, 2, 3] -``` - -* * * - - - - - - - - - -## `“Collections†Methods` - - - -### `_.at(collection [, index1, index2, ...])` -# [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L2167 "View in source") [Ⓣ][1] - -Creates an array of elements from the specified indexes, or keys, of the `collection`. Indexes may be specified as individual arguments or as arrays of indexes. - -#### Arguments -1. `collection` *(Array|Object|String)*: The collection to iterate over. -2. `[index1, index2, ...]` *(Array|Number|String)*: The indexes of `collection` to retrieve, either as individual arguments or arrays. - -#### Returns -*(Array)*: Returns a new array of elements corresponding to the provided indexes. - -#### Example -```js -_.at(['a', 'b', 'c', 'd', 'e'], [0, 2, 4]); -// => ['a', 'c', 'e'] - -_.at(['moe', 'larry', 'curly'], 0, 2); -// => ['moe', 'curly'] -``` - -* * * - - - - - - -### `_.contains(collection, target [, fromIndex=0])` -# [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L2209 "View in source") [Ⓣ][1] - -Checks if a given `target` element is present in a `collection` using strict equality for comparisons, i.e. `===`. If `fromIndex` is negative, it is used as the offset from the end of the collection. - -#### Aliases -*include* - -#### Arguments -1. `collection` *(Array|Object|String)*: The collection to iterate over. -2. `target` *(Mixed)*: The value to check for. -3. `[fromIndex=0]` *(Number)*: The index to search from. - -#### Returns -*(Boolean)*: Returns `true` if the `target` element is found, else `false`. - -#### Example -```js -_.contains([1, 2, 3], 1); -// => true - -_.contains([1, 2, 3], 1, 2); -// => false - -_.contains({ 'name': 'moe', 'age': 40 }, 'moe'); -// => true - -_.contains('curly', 'ur'); -// => true -``` - -* * * - - - - - - -### `_.countBy(collection [, callback=identity, thisArg])` -# [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L2263 "View in source") [Ⓣ][1] - -Creates an object composed of keys returned from running each element of the `collection` through the given `callback`. The corresponding value of each key is the number of times the key was returned by the `callback`. The `callback` is bound to `thisArg` and invoked with three arguments; *(value, index|key, collection)*. - -If a property name is passed for `callback`, the created "_.pluck" style callback will return the property value of the given element. - -If an object is passed for `callback`, the created "_.where" style callback will return `true` for elements that have the propeties of the given object, else `false`. - -#### Arguments -1. `collection` *(Array|Object|String)*: The collection to iterate over. -2. `[callback=identity]` *(Function|Object|String)*: The function called per iteration. If a property name or object is passed, it will be used to create a "_.pluck" or "_.where" style callback, respectively. -3. `[thisArg]` *(Mixed)*: The `this` binding of `callback`. - -#### Returns -*(Object)*: Returns the composed aggregate object. - -#### Example -```js -_.countBy([4.3, 6.1, 6.4], function(num) { return Math.floor(num); }); -// => { '4': 1, '6': 2 } - -_.countBy([4.3, 6.1, 6.4], function(num) { return this.floor(num); }, Math); -// => { '4': 1, '6': 2 } - -_.countBy(['one', 'two', 'three'], 'length'); -// => { '3': 2, '5': 1 } -``` - -* * * - - - - - - -### `_.every(collection [, callback=identity, thisArg])` -# [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L2315 "View in source") [Ⓣ][1] - -Checks if the `callback` returns a truthy value for **all** elements of a `collection`. The `callback` is bound to `thisArg` and invoked with three arguments; *(value, index|key, collection)*. - -If a property name is passed for `callback`, the created "_.pluck" style callback will return the property value of the given element. - -If an object is passed for `callback`, the created "_.where" style callback will return `true` for elements that have the propeties of the given object, else `false`. - -#### Aliases -*all* - -#### Arguments -1. `collection` *(Array|Object|String)*: The collection to iterate over. -2. `[callback=identity]` *(Function|Object|String)*: The function called per iteration. If a property name or object is passed, it will be used to create a "_.pluck" or "_.where" style callback, respectively. -3. `[thisArg]` *(Mixed)*: The `this` binding of `callback`. - -#### Returns -*(Boolean)*: Returns `true` if all elements pass the callback check, else `false`. - -#### Example -```js -_.every([true, 1, null, 'yes'], Boolean); -// => false - -var stooges = [ - { 'name': 'moe', 'age': 40 }, - { 'name': 'larry', 'age': 50 } -]; - -// using "_.pluck" callback shorthand -_.every(stooges, 'age'); -// => true - -// using "_.where" callback shorthand -_.every(stooges, { 'age': 50 }); -// => false -``` - -* * * - - - - - - -### `_.filter(collection [, callback=identity, thisArg])` -# [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L2376 "View in source") [Ⓣ][1] - -Examines each element in a `collection`, returning an array of all elements the `callback` returns truthy for. The `callback` is bound to `thisArg` and invoked with three arguments; *(value, index|key, collection)*. - -If a property name is passed for `callback`, the created "_.pluck" style callback will return the property value of the given element. - -If an object is passed for `callback`, the created "_.where" style callback will return `true` for elements that have the propeties of the given object, else `false`. - -#### Aliases -*select* - -#### Arguments -1. `collection` *(Array|Object|String)*: The collection to iterate over. -2. `[callback=identity]` *(Function|Object|String)*: The function called per iteration. If a property name or object is passed, it will be used to create a "_.pluck" or "_.where" style callback, respectively. -3. `[thisArg]` *(Mixed)*: The `this` binding of `callback`. - -#### Returns -*(Array)*: Returns a new array of elements that passed the callback check. - -#### Example -```js -var evens = _.filter([1, 2, 3, 4, 5, 6], function(num) { return num % 2 == 0; }); -// => [2, 4, 6] - -var food = [ - { 'name': 'apple', 'organic': false, 'type': 'fruit' }, - { 'name': 'carrot', 'organic': true, 'type': 'vegetable' } -]; - -// using "_.pluck" callback shorthand -_.filter(food, 'organic'); -// => [{ 'name': 'carrot', 'organic': true, 'type': 'vegetable' }] - -// using "_.where" callback shorthand -_.filter(food, { 'type': 'fruit' }); -// => [{ 'name': 'apple', 'organic': false, 'type': 'fruit' }] -``` - -* * * - - - - - - -### `_.find(collection [, callback=identity, thisArg])` -# [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L2443 "View in source") [Ⓣ][1] - -Examines each element in a `collection`, returning the first that the `callback` returns truthy for. The `callback` is bound to `thisArg` and invoked with three arguments; *(value, index|key, collection)*. - -If a property name is passed for `callback`, the created "_.pluck" style callback will return the property value of the given element. - -If an object is passed for `callback`, the created "_.where" style callback will return `true` for elements that have the propeties of the given object, else `false`. - -#### Aliases -*detect* - -#### Arguments -1. `collection` *(Array|Object|String)*: The collection to iterate over. -2. `[callback=identity]` *(Function|Object|String)*: The function called per iteration. If a property name or object is passed, it will be used to create a "_.pluck" or "_.where" style callback, respectively. -3. `[thisArg]` *(Mixed)*: The `this` binding of `callback`. - -#### Returns -*(Mixed)*: Returns the element that passed the callback check, else `undefined`. - -#### Example -```js -var even = _.find([1, 2, 3, 4, 5, 6], function(num) { return num % 2 == 0; }); -// => 2 - -var food = [ - { 'name': 'apple', 'organic': false, 'type': 'fruit' }, - { 'name': 'banana', 'organic': true, 'type': 'fruit' }, - { 'name': 'beet', 'organic': false, 'type': 'vegetable' }, - { 'name': 'carrot', 'organic': true, 'type': 'vegetable' } -]; - -// using "_.where" callback shorthand -var veggie = _.find(food, { 'type': 'vegetable' }); -// => { 'name': 'beet', 'organic': false, 'type': 'vegetable' } - -// using "_.pluck" callback shorthand -var healthy = _.find(food, 'organic'); -// => { 'name': 'banana', 'organic': true, 'type': 'fruit' } -``` - -* * * - - - - - - -### `_.forEach(collection [, callback=identity, thisArg])` -# [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L2478 "View in source") [Ⓣ][1] - -Iterates over a `collection`, executing the `callback` for each element in the `collection`. The `callback` is bound to `thisArg` and invoked with three arguments; *(value, index|key, collection)*. Callbacks may exit iteration early by explicitly returning `false`. - -#### Aliases -*each* - -#### Arguments -1. `collection` *(Array|Object|String)*: The collection to iterate over. -2. `[callback=identity]` *(Function)*: The function called per iteration. -3. `[thisArg]` *(Mixed)*: The `this` binding of `callback`. - -#### Returns -*(Array, Object, String)*: Returns `collection`. - -#### Example -```js -_([1, 2, 3]).forEach(alert).join(','); -// => alerts each number and returns '1,2,3' - -_.forEach({ 'one': 1, 'two': 2, 'three': 3 }, alert); -// => alerts each number value (order is not guaranteed) -``` - -* * * - - - - - - -### `_.groupBy(collection [, callback=identity, thisArg])` -# [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L2528 "View in source") [Ⓣ][1] - -Creates an object composed of keys returned from running each element of the `collection` through the `callback`. The corresponding value of each key is an array of elements passed to `callback` that returned the key. The `callback` is bound to `thisArg` and invoked with three arguments; *(value, index|key, collection)*. - -If a property name is passed for `callback`, the created "_.pluck" style callback will return the property value of the given element. - -If an object is passed for `callback`, the created "_.where" style callback will return `true` for elements that have the propeties of the given object, else `false` - -#### Arguments -1. `collection` *(Array|Object|String)*: The collection to iterate over. -2. `[callback=identity]` *(Function|Object|String)*: The function called per iteration. If a property name or object is passed, it will be used to create a "_.pluck" or "_.where" style callback, respectively. -3. `[thisArg]` *(Mixed)*: The `this` binding of `callback`. - -#### Returns -*(Object)*: Returns the composed aggregate object. - -#### Example -```js -_.groupBy([4.2, 6.1, 6.4], function(num) { return Math.floor(num); }); -// => { '4': [4.2], '6': [6.1, 6.4] } - -_.groupBy([4.2, 6.1, 6.4], function(num) { return this.floor(num); }, Math); -// => { '4': [4.2], '6': [6.1, 6.4] } - -// using "_.pluck" callback shorthand -_.groupBy(['one', 'two', 'three'], 'length'); -// => { '3': ['one', 'two'], '5': ['three'] } -``` - -* * * - - - - - - -### `_.invoke(collection, methodName [, arg1, arg2, ...])` -# [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L2561 "View in source") [Ⓣ][1] - -Invokes the method named by `methodName` on each element in the `collection`, returning an array of the results of each invoked method. Additional arguments will be passed to each invoked method. If `methodName` is a function, it will be invoked for, and `this` bound to, each element in the `collection`. - -#### Arguments -1. `collection` *(Array|Object|String)*: The collection to iterate over. -2. `methodName` *(Function|String)*: The name of the method to invoke or the function invoked per iteration. -3. `[arg1, arg2, ...]` *(Mixed)*: Arguments to invoke the method with. - -#### Returns -*(Array)*: Returns a new array of the results of each invoked method. - -#### Example -```js -_.invoke([[5, 1, 7], [3, 2, 1]], 'sort'); -// => [[1, 5, 7], [1, 2, 3]] - -_.invoke([123, 456], String.prototype.split, ''); -// => [['1', '2', '3'], ['4', '5', '6']] -``` - -* * * - - - - - - -### `_.map(collection [, callback=identity, thisArg])` -# [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L2613 "View in source") [Ⓣ][1] - -Creates an array of values by running each element in the `collection` through the `callback`. The `callback` is bound to `thisArg` and invoked with three arguments; *(value, index|key, collection)*. - -If a property name is passed for `callback`, the created "_.pluck" style callback will return the property value of the given element. - -If an object is passed for `callback`, the created "_.where" style callback will return `true` for elements that have the propeties of the given object, else `false`. - -#### Aliases -*collect* - -#### Arguments -1. `collection` *(Array|Object|String)*: The collection to iterate over. -2. `[callback=identity]` *(Function|Object|String)*: The function called per iteration. If a property name or object is passed, it will be used to create a "_.pluck" or "_.where" style callback, respectively. -3. `[thisArg]` *(Mixed)*: The `this` binding of `callback`. - -#### Returns -*(Array)*: Returns a new array of the results of each `callback` execution. - -#### Example -```js -_.map([1, 2, 3], function(num) { return num * 3; }); -// => [3, 6, 9] - -_.map({ 'one': 1, 'two': 2, 'three': 3 }, function(num) { return num * 3; }); -// => [3, 6, 9] (order is not guaranteed) - -var stooges = [ - { 'name': 'moe', 'age': 40 }, - { 'name': 'larry', 'age': 50 } -]; - -// using "_.pluck" callback shorthand -_.map(stooges, 'name'); -// => ['moe', 'larry'] -``` - -* * * - - - - - - -### `_.max(collection [, callback=identity, thisArg])` -# [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L2670 "View in source") [Ⓣ][1] - -Retrieves the maximum value of an `array`. If `callback` is passed, it will be executed for each value in the `array` to generate the criterion by which the value is ranked. The `callback` is bound to `thisArg` and invoked with three arguments; *(value, index, collection)*. - -If a property name is passed for `callback`, the created "_.pluck" style callback will return the property value of the given element. - -If an object is passed for `callback`, the created "_.where" style callback will return `true` for elements that have the propeties of the given object, else `false`. - -#### Arguments -1. `collection` *(Array|Object|String)*: The collection to iterate over. -2. `[callback=identity]` *(Function|Object|String)*: The function called per iteration. If a property name or object is passed, it will be used to create a "_.pluck" or "_.where" style callback, respectively. -3. `[thisArg]` *(Mixed)*: The `this` binding of `callback`. - -#### Returns -*(Mixed)*: Returns the maximum value. - -#### Example -```js -_.max([4, 2, 8, 6]); -// => 8 - -var stooges = [ - { 'name': 'moe', 'age': 40 }, - { 'name': 'larry', 'age': 50 } -]; - -_.max(stooges, function(stooge) { return stooge.age; }); -// => { 'name': 'larry', 'age': 50 }; - -// using "_.pluck" callback shorthand -_.max(stooges, 'age'); -// => { 'name': 'larry', 'age': 50 }; -``` - -* * * - - - - - - -### `_.min(collection [, callback=identity, thisArg])` -# [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L2739 "View in source") [Ⓣ][1] - -Retrieves the minimum value of an `array`. If `callback` is passed, it will be executed for each value in the `array` to generate the criterion by which the value is ranked. The `callback` is bound to `thisArg` and invoked with three arguments; *(value, index, collection)*. - -If a property name is passed for `callback`, the created "_.pluck" style callback will return the property value of the given element. - -If an object is passed for `callback`, the created "_.where" style callback will return `true` for elements that have the propeties of the given object, else `false`. - -#### Arguments -1. `collection` *(Array|Object|String)*: The collection to iterate over. -2. `[callback=identity]` *(Function|Object|String)*: The function called per iteration. If a property name or object is passed, it will be used to create a "_.pluck" or "_.where" style callback, respectively. -3. `[thisArg]` *(Mixed)*: The `this` binding of `callback`. - -#### Returns -*(Mixed)*: Returns the minimum value. - -#### Example -```js -_.min([4, 2, 8, 6]); -// => 2 - -var stooges = [ - { 'name': 'moe', 'age': 40 }, - { 'name': 'larry', 'age': 50 } -]; - -_.min(stooges, function(stooge) { return stooge.age; }); -// => { 'name': 'moe', 'age': 40 }; - -// using "_.pluck" callback shorthand -_.min(stooges, 'age'); -// => { 'name': 'moe', 'age': 40 }; -``` - -* * * - - - - - - -### `_.pluck(collection, property)` -# [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L2789 "View in source") [Ⓣ][1] - -Retrieves the value of a specified property from all elements in the `collection`. - -#### Arguments -1. `collection` *(Array|Object|String)*: The collection to iterate over. -2. `property` *(String)*: The property to pluck. - -#### Returns -*(Array)*: Returns a new array of property values. - -#### Example -```js -var stooges = [ - { 'name': 'moe', 'age': 40 }, - { 'name': 'larry', 'age': 50 } -]; - -_.pluck(stooges, 'name'); -// => ['moe', 'larry'] -``` - -* * * - - - - - - -### `_.reduce(collection [, callback=identity, accumulator, thisArg])` -# [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L2821 "View in source") [Ⓣ][1] - -Reduces a `collection` to a value that is the accumulated result of running each element in the `collection` through the `callback`, where each successive `callback` execution consumes the return value of the previous execution. If `accumulator` is not passed, the first element of the `collection` will be used as the initial `accumulator` value. The `callback` is bound to `thisArg` and invoked with four arguments; *(accumulator, value, index|key, collection)*. - -#### Aliases -*foldl, inject* - -#### Arguments -1. `collection` *(Array|Object|String)*: The collection to iterate over. -2. `[callback=identity]` *(Function)*: The function called per iteration. -3. `[accumulator]` *(Mixed)*: Initial value of the accumulator. -4. `[thisArg]` *(Mixed)*: The `this` binding of `callback`. - -#### Returns -*(Mixed)*: Returns the accumulated value. - -#### Example -```js -var sum = _.reduce([1, 2, 3], function(sum, num) { - return sum + num; -}); -// => 6 - -var mapped = _.reduce({ 'a': 1, 'b': 2, 'c': 3 }, function(result, num, key) { - result[key] = num * 3; - return result; -}, {}); -// => { 'a': 3, 'b': 6, 'c': 9 } -``` - -* * * - - - - - - -### `_.reduceRight(collection [, callback=identity, accumulator, thisArg])` -# [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L2864 "View in source") [Ⓣ][1] - -This method is similar to `_.reduce`, except that it iterates over a `collection` from right to left. - -#### Aliases -*foldr* - -#### Arguments -1. `collection` *(Array|Object|String)*: The collection to iterate over. -2. `[callback=identity]` *(Function)*: The function called per iteration. -3. `[accumulator]` *(Mixed)*: Initial value of the accumulator. -4. `[thisArg]` *(Mixed)*: The `this` binding of `callback`. - -#### Returns -*(Mixed)*: Returns the accumulated value. - -#### Example -```js -var list = [[0, 1], [2, 3], [4, 5]]; -var flat = _.reduceRight(list, function(a, b) { return a.concat(b); }, []); -// => [4, 5, 2, 3, 0, 1] -``` - -* * * - - - - - - -### `_.reject(collection [, callback=identity, thisArg])` -# [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L2924 "View in source") [Ⓣ][1] - -The opposite of `_.filter`, this method returns the elements of a `collection` that `callback` does **not** return truthy for. - -If a property name is passed for `callback`, the created "_.pluck" style callback will return the property value of the given element. - -If an object is passed for `callback`, the created "_.where" style callback will return `true` for elements that have the propeties of the given object, else `false`. - -#### Arguments -1. `collection` *(Array|Object|String)*: The collection to iterate over. -2. `[callback=identity]` *(Function|Object|String)*: The function called per iteration. If a property name or object is passed, it will be used to create a "_.pluck" or "_.where" style callback, respectively. -3. `[thisArg]` *(Mixed)*: The `this` binding of `callback`. - -#### Returns -*(Array)*: Returns a new array of elements that did **not** pass the callback check. - -#### Example -```js -var odds = _.reject([1, 2, 3, 4, 5, 6], function(num) { return num % 2 == 0; }); -// => [1, 3, 5] - -var food = [ - { 'name': 'apple', 'organic': false, 'type': 'fruit' }, - { 'name': 'carrot', 'organic': true, 'type': 'vegetable' } -]; - -// using "_.pluck" callback shorthand -_.reject(food, 'organic'); -// => [{ 'name': 'apple', 'organic': false, 'type': 'fruit' }] - -// using "_.where" callback shorthand -_.reject(food, { 'type': 'fruit' }); -// => [{ 'name': 'carrot', 'organic': true, 'type': 'vegetable' }] -``` - -* * * - - - - - - -### `_.shuffle(collection)` -# [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L2945 "View in source") [Ⓣ][1] - -Creates an array of shuffled `array` values, using a version of the Fisher-Yates shuffle. See http://en.wikipedia.org/wiki/Fisher-Yates_shuffle. - -#### Arguments -1. `collection` *(Array|Object|String)*: The collection to shuffle. - -#### Returns -*(Array)*: Returns a new shuffled collection. - -#### Example -```js -_.shuffle([1, 2, 3, 4, 5, 6]); -// => [4, 1, 6, 3, 5, 2] -``` - -* * * - - - - - - -### `_.size(collection)` -# [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L2978 "View in source") [Ⓣ][1] - -Gets the size of the `collection` by returning `collection.length` for arrays and array-like objects or the number of own enumerable properties for objects. - -#### Arguments -1. `collection` *(Array|Object|String)*: The collection to inspect. - -#### Returns -*(Number)*: Returns `collection.length` or number of own enumerable properties. - -#### Example -```js -_.size([1, 2]); -// => 2 - -_.size({ 'one': 1, 'two': 2, 'three': 3 }); -// => 3 - -_.size('curly'); -// => 5 -``` - -* * * - - - - - - -### `_.some(collection [, callback=identity, thisArg])` -# [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L3025 "View in source") [Ⓣ][1] - -Checks if the `callback` returns a truthy value for **any** element of a `collection`. The function returns as soon as it finds passing value, and does not iterate over the entire `collection`. The `callback` is bound to `thisArg` and invoked with three arguments; *(value, index|key, collection)*. - -If a property name is passed for `callback`, the created "_.pluck" style callback will return the property value of the given element. - -If an object is passed for `callback`, the created "_.where" style callback will return `true` for elements that have the propeties of the given object, else `false`. - -#### Aliases -*any* - -#### Arguments -1. `collection` *(Array|Object|String)*: The collection to iterate over. -2. `[callback=identity]` *(Function|Object|String)*: The function called per iteration. If a property name or object is passed, it will be used to create a "_.pluck" or "_.where" style callback, respectively. -3. `[thisArg]` *(Mixed)*: The `this` binding of `callback`. - -#### Returns -*(Boolean)*: Returns `true` if any element passes the callback check, else `false`. - -#### Example -```js -_.some([null, 0, 'yes', false], Boolean); -// => true - -var food = [ - { 'name': 'apple', 'organic': false, 'type': 'fruit' }, - { 'name': 'carrot', 'organic': true, 'type': 'vegetable' } -]; - -// using "_.pluck" callback shorthand -_.some(food, 'organic'); -// => true - -// using "_.where" callback shorthand -_.some(food, { 'type': 'meat' }); -// => false -``` - -* * * - - - - - - -### `_.sortBy(collection [, callback=identity, thisArg])` -# [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L3081 "View in source") [Ⓣ][1] - -Creates an array of elements, sorted in ascending order by the results of running each element in the `collection` through the `callback`. This method performs a stable sort, that is, it will preserve the original sort order of equal elements. The `callback` is bound to `thisArg` and invoked with three arguments; *(value, index|key, collection)*. - -If a property name is passed for `callback`, the created "_.pluck" style callback will return the property value of the given element. - -If an object is passed for `callback`, the created "_.where" style callback will return `true` for elements that have the propeties of the given object, else `false`. - -#### Arguments -1. `collection` *(Array|Object|String)*: The collection to iterate over. -2. `[callback=identity]` *(Function|Object|String)*: The function called per iteration. If a property name or object is passed, it will be used to create a "_.pluck" or "_.where" style callback, respectively. -3. `[thisArg]` *(Mixed)*: The `this` binding of `callback`. - -#### Returns -*(Array)*: Returns a new array of sorted elements. - -#### Example -```js -_.sortBy([1, 2, 3], function(num) { return Math.sin(num); }); -// => [3, 1, 2] - -_.sortBy([1, 2, 3], function(num) { return this.sin(num); }, Math); -// => [3, 1, 2] - -// using "_.pluck" callback shorthand -_.sortBy(['banana', 'strawberry', 'apple'], 'length'); -// => ['apple', 'banana', 'strawberry'] -``` - -* * * - - - - - - -### `_.toArray(collection)` -# [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L3116 "View in source") [Ⓣ][1] - -Converts the `collection` to an array. - -#### Arguments -1. `collection` *(Array|Object|String)*: The collection to convert. - -#### Returns -*(Array)*: Returns the new converted array. - -#### Example -```js -(function() { return _.toArray(arguments).slice(1); })(1, 2, 3, 4); -// => [2, 3, 4] -``` - -* * * - - - - - - -### `_.where(collection, properties)` -# [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L3148 "View in source") [Ⓣ][1] - -Examines each element in a `collection`, returning an array of all elements that have the given `properties`. When checking `properties`, this method performs a deep comparison between values to determine if they are equivalent to each other. - -#### Arguments -1. `collection` *(Array|Object|String)*: The collection to iterate over. -2. `properties` *(Object)*: The object of property values to filter by. - -#### Returns -*(Array)*: Returns a new array of elements that have the given `properties`. - -#### Example -```js -var stooges = [ - { 'name': 'moe', 'age': 40 }, - { 'name': 'larry', 'age': 50 } -]; - -_.where(stooges, { 'age': 40 }); -// => [{ 'name': 'moe', 'age': 40 }] -``` - -* * * - - - - - - - - - -## `“Functions†Methods` - - - -### `_.after(n, func)` -# [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L4007 "View in source") [Ⓣ][1] - -Creates a function that is restricted to executing `func` only after it is called `n` times. The `func` is executed with the `this` binding of the created function. - -#### Arguments -1. `n` *(Number)*: The number of times the function must be called before it is executed. -2. `func` *(Function)*: The function to restrict. - -#### Returns -*(Function)*: Returns the new restricted function. - -#### Example -```js -var renderNotes = _.after(notes.length, render); -_.forEach(notes, function(note) { - note.asyncSave({ 'success': renderNotes }); -}); -// `renderNotes` is run once, after all notes have saved -``` - -* * * - - - - - - -### `_.bind(func [, thisArg, arg1, arg2, ...])` -# [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L4040 "View in source") [Ⓣ][1] - -Creates a function that, when called, invokes `func` with the `this` binding of `thisArg` and prepends any additional `bind` arguments to those passed to the bound function. - -#### Arguments -1. `func` *(Function)*: The function to bind. -2. `[thisArg]` *(Mixed)*: The `this` binding of `func`. -3. `[arg1, arg2, ...]` *(Mixed)*: Arguments to be partially applied. - -#### Returns -*(Function)*: Returns the new bound function. - -#### Example -```js -var func = function(greeting) { - return greeting + ' ' + this.name; -}; - -func = _.bind(func, { 'name': 'moe' }, 'hi'); -func(); -// => 'hi moe' -``` - -* * * - - - - - - -### `_.bindAll(object [, methodName1, methodName2, ...])` -# [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L4071 "View in source") [Ⓣ][1] - -Binds methods on `object` to `object`, overwriting the existing method. Method names may be specified as individual arguments or as arrays of method names. If no method names are provided, all the function properties of `object` will be bound. - -#### Arguments -1. `object` *(Object)*: The object to bind and assign the bound methods to. -2. `[methodName1, methodName2, ...]` *(String)*: Method names on the object to bind. - -#### Returns -*(Object)*: Returns `object`. - -#### Example -```js -var view = { - 'label': 'docs', - 'onClick': function() { alert('clicked ' + this.label); } -}; - -_.bindAll(view); -jQuery('#docs').on('click', view.onClick); -// => alerts 'clicked docs', when the button is clicked -``` - -* * * - - - - - - -### `_.bindKey(object, key [, arg1, arg2, ...])` -# [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L4117 "View in source") [Ⓣ][1] - -Creates a function that, when called, invokes the method at `object[key]` and prepends any additional `bindKey` arguments to those passed to the bound function. This method differs from `_.bind` by allowing bound functions to reference methods that will be redefined or don't yet exist. See http://michaux.ca/articles/lazy-function-definition-pattern. - -#### Arguments -1. `object` *(Object)*: The object the method belongs to. -2. `key` *(String)*: The key of the method. -3. `[arg1, arg2, ...]` *(Mixed)*: Arguments to be partially applied. - -#### Returns -*(Function)*: Returns the new bound function. - -#### Example -```js -var object = { - 'name': 'moe', - 'greet': function(greeting) { - return greeting + ' ' + this.name; - } -}; - -var func = _.bindKey(object, 'greet', 'hi'); -func(); -// => 'hi moe' - -object.greet = function(greeting) { - return greeting + ', ' + this.name + '!'; -}; - -func(); -// => 'hi, moe!' -``` - -* * * - - - - - - -### `_.compose([func1, func2, ...])` -# [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L4140 "View in source") [Ⓣ][1] - -Creates a function that is the composition of the passed functions, where each function consumes the return value of the function that follows. For example, composing the functions `f()`, `g()`, and `h()` produces `f(g(h()))`. Each function is executed with the `this` binding of the composed function. - -#### Arguments -1. `[func1, func2, ...]` *(Function)*: Functions to compose. - -#### Returns -*(Function)*: Returns the new composed function. - -#### Example -```js -var greet = function(name) { return 'hi ' + name; }; -var exclaim = function(statement) { return statement + '!'; }; -var welcome = _.compose(exclaim, greet); -welcome('moe'); -// => 'hi moe!' -``` - -* * * - - - - - - -### `_.debounce(func, wait, immediate)` -# [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L4173 "View in source") [Ⓣ][1] - -Creates a function that will delay the execution of `func` until after `wait` milliseconds have elapsed since the last time it was invoked. Pass `true` for `immediate` to cause debounce to invoke `func` on the leading, instead of the trailing, edge of the `wait` timeout. Subsequent calls to the debounced function will return the result of the last `func` call. - -#### Arguments -1. `func` *(Function)*: The function to debounce. -2. `wait` *(Number)*: The number of milliseconds to delay. -3. `immediate` *(Boolean)*: A flag to indicate execution is on the leading edge of the timeout. - -#### Returns -*(Function)*: Returns the new debounced function. - -#### Example -```js -var lazyLayout = _.debounce(calculateLayout, 300); -jQuery(window).on('resize', lazyLayout); -``` - -* * * - - - - - - -### `_.defer(func [, arg1, arg2, ...])` -# [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L4237 "View in source") [Ⓣ][1] - -Defers executing the `func` function until the current call stack has cleared. Additional arguments will be passed to `func` when it is invoked. - -#### Arguments -1. `func` *(Function)*: The function to defer. -2. `[arg1, arg2, ...]` *(Mixed)*: Arguments to invoke the function with. - -#### Returns -*(Number)*: Returns the `setTimeout` timeout id. - -#### Example -```js -_.defer(function() { alert('deferred'); }); -// returns from the function before `alert` is called -``` - -* * * - - - - - - -### `_.delay(func, wait [, arg1, arg2, ...])` -# [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L4217 "View in source") [Ⓣ][1] - -Executes the `func` function after `wait` milliseconds. Additional arguments will be passed to `func` when it is invoked. - -#### Arguments -1. `func` *(Function)*: The function to delay. -2. `wait` *(Number)*: The number of milliseconds to delay execution. -3. `[arg1, arg2, ...]` *(Mixed)*: Arguments to invoke the function with. - -#### Returns -*(Number)*: Returns the `setTimeout` timeout id. - -#### Example -```js -var log = _.bind(console.log, console); -_.delay(log, 1000, 'logged later'); -// => 'logged later' (Appears after one second.) -``` - -* * * - - - - - - -### `_.memoize(func [, resolver])` -# [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L4265 "View in source") [Ⓣ][1] - -Creates a function that memoizes the result of `func`. If `resolver` is passed, it will be used to determine the cache key for storing the result based on the arguments passed to the memoized function. By default, the first argument passed to the memoized function is used as the cache key. The `func` is executed with the `this` binding of the memoized function. - -#### Arguments -1. `func` *(Function)*: The function to have its output memoized. -2. `[resolver]` *(Function)*: A function used to resolve the cache key. - -#### Returns -*(Function)*: Returns the new memoizing function. - -#### Example -```js -var fibonacci = _.memoize(function(n) { - return n < 2 ? n : fibonacci(n - 1) + fibonacci(n - 2); -}); -``` - -* * * - - - - - - -### `_.once(func)` -# [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L4292 "View in source") [Ⓣ][1] - -Creates a function that is restricted to execute `func` once. Repeat calls to the function will return the value of the first call. The `func` is executed with the `this` binding of the created function. - -#### Arguments -1. `func` *(Function)*: The function to restrict. - -#### Returns -*(Function)*: Returns the new restricted function. - -#### Example -```js -var initialize = _.once(createApplication); -initialize(); -initialize(); -// `initialize` executes `createApplication` once -``` - -* * * - - - - - - -### `_.partial(func [, arg1, arg2, ...])` -# [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L4327 "View in source") [Ⓣ][1] - -Creates a function that, when called, invokes `func` with any additional `partial` arguments prepended to those passed to the new function. This method is similar to `_.bind`, except it does **not** alter the `this` binding. - -#### Arguments -1. `func` *(Function)*: The function to partially apply arguments to. -2. `[arg1, arg2, ...]` *(Mixed)*: Arguments to be partially applied. - -#### Returns -*(Function)*: Returns the new partially applied function. - -#### Example -```js -var greet = function(greeting, name) { return greeting + ' ' + name; }; -var hi = _.partial(greet, 'hi'); -hi('moe'); -// => 'hi moe' -``` - -* * * - - - - - - -### `_.partialRight(func [, arg1, arg2, ...])` -# [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L4358 "View in source") [Ⓣ][1] - -This method is similar to `_.partial`, except that `partial` arguments are appended to those passed to the new function. - -#### Arguments -1. `func` *(Function)*: The function to partially apply arguments to. -2. `[arg1, arg2, ...]` *(Mixed)*: Arguments to be partially applied. - -#### Returns -*(Function)*: Returns the new partially applied function. - -#### Example -```js -var defaultsDeep = _.partialRight(_.merge, _.defaults); - -var options = { - 'variable': 'data', - 'imports': { 'jq': $ } -}; - -defaultsDeep(options, _.templateSettings); - -options.variable -// => 'data' - -options.imports -// => { '_': _, 'jq': $ } -``` - -* * * - - - - - - -### `_.throttle(func, wait)` -# [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L4380 "View in source") [Ⓣ][1] - -Creates a function that, when executed, will only call the `func` function at most once per every `wait` milliseconds. If the throttled function is invoked more than once during the `wait` timeout, `func` will also be called on the trailing edge of the timeout. Subsequent calls to the throttled function will return the result of the last `func` call. - -#### Arguments -1. `func` *(Function)*: The function to throttle. -2. `wait` *(Number)*: The number of milliseconds to throttle executions to. - -#### Returns -*(Function)*: Returns the new throttled function. - -#### Example -```js -var throttled = _.throttle(updatePosition, 100); -jQuery(window).on('scroll', throttled); -``` - -* * * - - - - - - -### `_.wrap(value, wrapper)` -# [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L4433 "View in source") [Ⓣ][1] - -Creates a function that passes `value` to the `wrapper` function as its first argument. Additional arguments passed to the function are appended to those passed to the `wrapper` function. The `wrapper` is executed with the `this` binding of the created function. - -#### Arguments -1. `value` *(Mixed)*: The value to wrap. -2. `wrapper` *(Function)*: The wrapper function. - -#### Returns -*(Function)*: Returns the new function. - -#### Example -```js -var hello = function(name) { return 'hello ' + name; }; -hello = _.wrap(hello, function(func) { - return 'before, ' + func('moe') + ', after'; -}); -hello(); -// => 'before, hello moe, after' -``` - -* * * - - - - - - - - - -## `“Objects†Methods` - - - -### `_.assign(object [, source1, source2, ..., callback, thisArg])` -# [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L1062 "View in source") [Ⓣ][1] - -Assigns own enumerable properties of source object(s) to the destination object. Subsequent sources will overwrite propery assignments of previous sources. If a `callback` function is passed, it will be executed to produce the assigned values. The `callback` is bound to `thisArg` and invoked with two arguments; *(objectValue, sourceValue)*. - -#### Aliases -*extend* - -#### Arguments -1. `object` *(Object)*: The destination object. -2. `[source1, source2, ...]` *(Object)*: The source objects. -3. `[callback]` *(Function)*: The function to customize assigning values. -4. `[thisArg]` *(Mixed)*: The `this` binding of `callback`. - -#### Returns -*(Object)*: Returns the destination object. - -#### Example -```js -_.assign({ 'name': 'moe' }, { 'age': 40 }); -// => { 'name': 'moe', 'age': 40 } - -var defaults = _.partialRight(_.assign, function(a, b) { - return typeof a == 'undefined' ? b : a; -}); - -var food = { 'name': 'apple' }; -defaults(food, { 'name': 'banana', 'type': 'fruit' }); -// => { 'name': 'apple', 'type': 'fruit' } -``` - -* * * - - - - - - -### `_.clone(value [, deep=false, callback, thisArg])` -# [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L1117 "View in source") [Ⓣ][1] - -Creates a clone of `value`. If `deep` is `true`, nested objects will also be cloned, otherwise they will be assigned by reference. If a `callback` function is passed, it will be executed to produce the cloned values. If `callback` returns `undefined`, cloning will be handled by the method instead. The `callback` is bound to `thisArg` and invoked with one argument; *(value)*. - -#### Arguments -1. `value` *(Mixed)*: The value to clone. -2. `[deep=false]` *(Boolean)*: A flag to indicate a deep clone. -3. `[callback]` *(Function)*: The function to customize cloning values. -4. `[thisArg]` *(Mixed)*: The `this` binding of `callback`. - -#### Returns -*(Mixed)*: Returns the cloned `value`. - -#### Example -```js -var stooges = [ - { 'name': 'moe', 'age': 40 }, - { 'name': 'larry', 'age': 50 } -]; - -var shallow = _.clone(stooges); -shallow[0] === stooges[0]; -// => true - -var deep = _.clone(stooges, true); -deep[0] === stooges[0]; -// => false - -_.mixin({ - 'clone': _.partialRight(_.clone, function(value) { - return _.isElement(value) ? value.cloneNode(false) : undefined; - }) -}); - -var clone = _.clone(document.body); -clone.childNodes.length; -// => 0 -``` - -* * * - - - - - - -### `_.cloneDeep(value [, callback, thisArg])` -# [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L1242 "View in source") [Ⓣ][1] - -Creates a deep clone of `value`. If a `callback` function is passed, it will be executed to produce the cloned values. If `callback` returns the value it was passed, cloning will be handled by the method instead. The `callback` is bound to `thisArg` and invoked with one argument; *(value)*. - -Note: This function is loosely based on the structured clone algorithm. Functions and DOM nodes are **not** cloned. The enumerable properties of `arguments` objects and objects created by constructors other than `Object` are cloned to plain `Object` objects. See http://www.w3.org/TR/html5/infrastructure.html#internal-structured-cloning-algorithm. - -#### Arguments -1. `value` *(Mixed)*: The value to deep clone. -2. `[callback]` *(Function)*: The function to customize cloning values. -3. `[thisArg]` *(Mixed)*: The `this` binding of `callback`. - -#### Returns -*(Mixed)*: Returns the deep cloned `value`. - -#### Example -```js -var stooges = [ - { 'name': 'moe', 'age': 40 }, - { 'name': 'larry', 'age': 50 } -]; - -var deep = _.cloneDeep(stooges); -deep[0] === stooges[0]; -// => false - -var view = { - 'label': 'docs', - 'node': element -}; - -var clone = _.cloneDeep(view, function(value) { - return _.isElement(value) ? value.cloneNode(true) : value; -}); - -clone.node == view.node; -// => false -``` - -* * * - - - - - - -### `_.defaults(object [, source1, source2, ...])` -# [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L1266 "View in source") [Ⓣ][1] - -Assigns own enumerable properties of source object(s) to the destination object for all destination properties that resolve to `undefined`. Once a property is set, additional defaults of the same property will be ignored. - -#### Arguments -1. `object` *(Object)*: The destination object. -2. `[source1, source2, ...]` *(Object)*: The source objects. - -#### Returns -*(Object)*: Returns the destination object. - -#### Example -```js -var food = { 'name': 'apple' }; -_.defaults(food, { 'name': 'banana', 'type': 'fruit' }); -// => { 'name': 'apple', 'type': 'fruit' } -``` - -* * * - - - - - - -### `_.forIn(object [, callback=identity, thisArg])` -# [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L882 "View in source") [Ⓣ][1] - -Iterates over `object`'s own and inherited enumerable properties, executing the `callback` for each property. The `callback` is bound to `thisArg` and invoked with three arguments; *(value, key, object)*. Callbacks may exit iteration early by explicitly returning `false`. - -#### Arguments -1. `object` *(Object)*: The object to iterate over. -2. `[callback=identity]` *(Function)*: The function called per iteration. -3. `[thisArg]` *(Mixed)*: The `this` binding of `callback`. - -#### Returns -*(Object)*: Returns `object`. - -#### Example -```js -function Dog(name) { - this.name = name; -} - -Dog.prototype.bark = function() { - alert('Woof, woof!'); -}; - -_.forIn(new Dog('Dagny'), function(value, key) { - alert(key); -}); -// => alerts 'name' and 'bark' (order is not guaranteed) -``` - -* * * - - - - - - -### `_.forOwn(object [, callback=identity, thisArg])` -# [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L907 "View in source") [Ⓣ][1] - -Iterates over an object's own enumerable properties, executing the `callback` for each property. The `callback` is bound to `thisArg` and invoked with three arguments; *(value, key, object)*. Callbacks may exit iteration early by explicitly returning `false`. - -#### Arguments -1. `object` *(Object)*: The object to iterate over. -2. `[callback=identity]` *(Function)*: The function called per iteration. -3. `[thisArg]` *(Mixed)*: The `this` binding of `callback`. - -#### Returns -*(Object)*: Returns `object`. - -#### Example -```js -_.forOwn({ '0': 'zero', '1': 'one', 'length': 2 }, function(num, key) { - alert(key); -}); -// => alerts '0', '1', and 'length' (order is not guaranteed) -``` - -* * * - - - - - - -### `_.functions(object)` -# [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L1283 "View in source") [Ⓣ][1] - -Creates a sorted array of all enumerable properties, own and inherited, of `object` that have function values. - -#### Aliases -*methods* - -#### Arguments -1. `object` *(Object)*: The object to inspect. - -#### Returns -*(Array)*: Returns a new array of property names that have function values. - -#### Example -```js -_.functions(_); -// => ['all', 'any', 'bind', 'bindAll', 'clone', 'compact', 'compose', ...] -``` - -* * * - - - - - - -### `_.has(object, property)` -# [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L1308 "View in source") [Ⓣ][1] - -Checks if the specified object `property` exists and is a direct property, instead of an inherited property. - -#### Arguments -1. `object` *(Object)*: The object to check. -2. `property` *(String)*: The property to check for. - -#### Returns -*(Boolean)*: Returns `true` if key is a direct property, else `false`. - -#### Example -```js -_.has({ 'a': 1, 'b': 2, 'c': 3 }, 'b'); -// => true -``` - -* * * - - - - - - -### `_.invert(object)` -# [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L1325 "View in source") [Ⓣ][1] - -Creates an object composed of the inverted keys and values of the given `object`. - -#### Arguments -1. `object` *(Object)*: The object to invert. - -#### Returns -*(Object)*: Returns the created inverted object. - -#### Example -```js -_.invert({ 'first': 'moe', 'second': 'larry' }); -// => { 'moe': 'first', 'larry': 'second' } (order is not guaranteed) -``` - -* * * - - - - - - -### `_.isArguments(value)` -# [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L843 "View in source") [Ⓣ][1] - -Checks if `value` is an `arguments` object. - -#### Arguments -1. `value` *(Mixed)*: The value to check. - -#### Returns -*(Boolean)*: Returns `true`, if the `value` is an `arguments` object, else `false`. - -#### Example -```js -(function() { return _.isArguments(arguments); })(1, 2, 3); -// => true - -_.isArguments([1, 2, 3]); -// => false -``` - -* * * - - - - - - -### `_.isArray(value)` -# [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L925 "View in source") [Ⓣ][1] - -Checks if `value` is an array. - -#### Arguments -1. `value` *(Mixed)*: The value to check. - -#### Returns -*(Boolean)*: Returns `true`, if the `value` is an array, else `false`. - -#### Example -```js -(function() { return _.isArray(arguments); })(); -// => false - -_.isArray([1, 2, 3]); -// => true -``` - -* * * - - - - - - -### `_.isBoolean(value)` -# [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L1351 "View in source") [Ⓣ][1] - -Checks if `value` is a boolean value. - -#### Arguments -1. `value` *(Mixed)*: The value to check. - -#### Returns -*(Boolean)*: Returns `true`, if the `value` is a boolean value, else `false`. - -#### Example -```js -_.isBoolean(null); -// => false -``` - -* * * - - - - - - -### `_.isDate(value)` -# [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L1368 "View in source") [Ⓣ][1] - -Checks if `value` is a date. - -#### Arguments -1. `value` *(Mixed)*: The value to check. - -#### Returns -*(Boolean)*: Returns `true`, if the `value` is a date, else `false`. - -#### Example -```js -_.isDate(new Date); -// => true -``` - -* * * - - - - - - -### `_.isElement(value)` -# [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L1385 "View in source") [Ⓣ][1] - -Checks if `value` is a DOM element. - -#### Arguments -1. `value` *(Mixed)*: The value to check. - -#### Returns -*(Boolean)*: Returns `true`, if the `value` is a DOM element, else `false`. - -#### Example -```js -_.isElement(document.body); -// => true -``` - -* * * - - - - - - -### `_.isEmpty(value)` -# [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L1410 "View in source") [Ⓣ][1] - -Checks if `value` is empty. Arrays, strings, or `arguments` objects with a length of `0` and objects with no own enumerable properties are considered "empty". - -#### Arguments -1. `value` *(Array|Object|String)*: The value to inspect. - -#### Returns -*(Boolean)*: Returns `true`, if the `value` is empty, else `false`. - -#### Example -```js -_.isEmpty([1, 2, 3]); -// => false - -_.isEmpty({}); -// => true - -_.isEmpty(''); -// => true -``` - -* * * - - - - - - -### `_.isEqual(a, b [, callback, thisArg])` -# [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L1469 "View in source") [Ⓣ][1] - -Performs a deep comparison between two values to determine if they are equivalent to each other. If `callback` is passed, it will be executed to compare values. If `callback` returns `undefined`, comparisons will be handled by the method instead. The `callback` is bound to `thisArg` and invoked with two arguments; *(a, b)*. - -#### Arguments -1. `a` *(Mixed)*: The value to compare. -2. `b` *(Mixed)*: The other value to compare. -3. `[callback]` *(Function)*: The function to customize comparing values. -4. `[thisArg]` *(Mixed)*: The `this` binding of `callback`. - -#### Returns -*(Boolean)*: Returns `true`, if the values are equvalent, else `false`. - -#### Example -```js -var moe = { 'name': 'moe', 'age': 40 }; -var copy = { 'name': 'moe', 'age': 40 }; - -moe == copy; -// => false - -_.isEqual(moe, copy); -// => true - -var words = ['hello', 'goodbye']; -var otherWords = ['hi', 'goodbye']; - -_.isEqual(words, otherWords, function(a, b) { - var reGreet = /^(?:hello|hi)$/i, - aGreet = _.isString(a) && reGreet.test(a), - bGreet = _.isString(b) && reGreet.test(b); - - return (aGreet || bGreet) ? (aGreet == bGreet) : undefined; -}); -// => true -``` - -* * * - - - - - - -### `_.isFinite(value)` -# [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L1650 "View in source") [Ⓣ][1] - -Checks if `value` is, or can be coerced to, a finite number. - -Note: This is not the same as native `isFinite`, which will return true for booleans and empty strings. See http://es5.github.com/#x15.1.2.5. - -#### Arguments -1. `value` *(Mixed)*: The value to check. - -#### Returns -*(Boolean)*: Returns `true`, if the `value` is finite, else `false`. - -#### Example -```js -_.isFinite(-101); -// => true - -_.isFinite('10'); -// => true - -_.isFinite(true); -// => false - -_.isFinite(''); -// => false - -_.isFinite(Infinity); -// => false -``` - -* * * - - - - - - -### `_.isFunction(value)` -# [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L1667 "View in source") [Ⓣ][1] - -Checks if `value` is a function. - -#### Arguments -1. `value` *(Mixed)*: The value to check. - -#### Returns -*(Boolean)*: Returns `true`, if the `value` is a function, else `false`. - -#### Example -```js -_.isFunction(_); -// => true -``` - -* * * - - - - - - -### `_.isNaN(value)` -# [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L1730 "View in source") [Ⓣ][1] - -Checks if `value` is `NaN`. - -Note: This is not the same as native `isNaN`, which will return `true` for `undefined` and other values. See http://es5.github.com/#x15.1.2.4. - -#### Arguments -1. `value` *(Mixed)*: The value to check. - -#### Returns -*(Boolean)*: Returns `true`, if the `value` is `NaN`, else `false`. - -#### Example -```js -_.isNaN(NaN); -// => true - -_.isNaN(new Number(NaN)); -// => true - -isNaN(undefined); -// => true - -_.isNaN(undefined); -// => false -``` - -* * * - - - - - - -### `_.isNull(value)` -# [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L1752 "View in source") [Ⓣ][1] - -Checks if `value` is `null`. - -#### Arguments -1. `value` *(Mixed)*: The value to check. - -#### Returns -*(Boolean)*: Returns `true`, if the `value` is `null`, else `false`. - -#### Example -```js -_.isNull(null); -// => true - -_.isNull(undefined); -// => false -``` - -* * * - - - - - - -### `_.isNumber(value)` -# [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L1769 "View in source") [Ⓣ][1] - -Checks if `value` is a number. - -#### Arguments -1. `value` *(Mixed)*: The value to check. - -#### Returns -*(Boolean)*: Returns `true`, if the `value` is a number, else `false`. - -#### Example -```js -_.isNumber(8.4 * 5); -// => true -``` - -* * * - - - - - - -### `_.isObject(value)` -# [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L1697 "View in source") [Ⓣ][1] - -Checks if `value` is the language type of Object. *(e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`)* - -#### Arguments -1. `value` *(Mixed)*: The value to check. - -#### Returns -*(Boolean)*: Returns `true`, if the `value` is an object, else `false`. - -#### Example -```js -_.isObject({}); -// => true - -_.isObject([1, 2, 3]); -// => true - -_.isObject(1); -// => false -``` - -* * * - - - - - - -### `_.isPlainObject(value)` -# [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L1797 "View in source") [Ⓣ][1] - -Checks if a given `value` is an object created by the `Object` constructor. - -#### Arguments -1. `value` *(Mixed)*: The value to check. - -#### Returns -*(Boolean)*: Returns `true`, if `value` is a plain object, else `false`. - -#### Example -```js -function Stooge(name, age) { - this.name = name; - this.age = age; -} - -_.isPlainObject(new Stooge('moe', 40)); -// => false - -_.isPlainObject([1, 2, 3]); -// => false - -_.isPlainObject({ 'name': 'moe', 'age': 40 }); -// => true -``` - -* * * - - - - - - -### `_.isRegExp(value)` -# [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L1822 "View in source") [Ⓣ][1] - -Checks if `value` is a regular expression. - -#### Arguments -1. `value` *(Mixed)*: The value to check. - -#### Returns -*(Boolean)*: Returns `true`, if the `value` is a regular expression, else `false`. - -#### Example -```js -_.isRegExp(/moe/); -// => true -``` - -* * * - - - - - - -### `_.isString(value)` -# [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L1839 "View in source") [Ⓣ][1] - -Checks if `value` is a string. - -#### Arguments -1. `value` *(Mixed)*: The value to check. - -#### Returns -*(Boolean)*: Returns `true`, if the `value` is a string, else `false`. - -#### Example -```js -_.isString('moe'); -// => true -``` - -* * * - - - - - - -### `_.isUndefined(value)` -# [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L1856 "View in source") [Ⓣ][1] - -Checks if `value` is `undefined`. - -#### Arguments -1. `value` *(Mixed)*: The value to check. - -#### Returns -*(Boolean)*: Returns `true`, if the `value` is `undefined`, else `false`. - -#### Example -```js -_.isUndefined(void 0); -// => true -``` - -* * * - - - - - - -### `_.keys(object)` -# [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L944 "View in source") [Ⓣ][1] - -Creates an array composed of the own enumerable property names of `object`. - -#### Arguments -1. `object` *(Object)*: The object to inspect. - -#### Returns -*(Array)*: Returns a new array of property names. - -#### Example -```js -_.keys({ 'one': 1, 'two': 2, 'three': 3 }); -// => ['one', 'two', 'three'] (order is not guaranteed) -``` - -* * * - - - - - - -### `_.merge(object [, source1, source2, ..., callback, thisArg])` -# [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L1916 "View in source") [Ⓣ][1] - -Recursively merges own enumerable properties of the source object(s), that don't resolve to `undefined`, into the destination object. Subsequent sources will overwrite propery assignments of previous sources. If a `callback` function is passed, it will be executed to produce the merged values of the destination and source properties. If `callback` returns `undefined`, merging will be handled by the method instead. The `callback` is bound to `thisArg` and invoked with two arguments; *(objectValue, sourceValue)*. - -#### Arguments -1. `object` *(Object)*: The destination object. -2. `[source1, source2, ...]` *(Object)*: The source objects. -3. `[callback]` *(Function)*: The function to customize merging properties. -4. `[thisArg]` *(Mixed)*: The `this` binding of `callback`. - -#### Returns -*(Object)*: Returns the destination object. - -#### Example -```js -var names = { - 'stooges': [ - { 'name': 'moe' }, - { 'name': 'larry' } - ] -}; - -var ages = { - 'stooges': [ - { 'age': 40 }, - { 'age': 50 } - ] -}; - -_.merge(names, ages); -// => { 'stooges': [{ 'name': 'moe', 'age': 40 }, { 'name': 'larry', 'age': 50 }] } - -var food = { - 'fruits': ['apple'], - 'vegetables': ['beet'] -}; - -var otherFood = { - 'fruits': ['banana'], - 'vegetables': ['carrot'] -}; - -_.merge(food, otherFood, function(a, b) { - return _.isArray(a) ? a.concat(b) : undefined; -}); -// => { 'fruits': ['apple', 'banana'], 'vegetables': ['beet', 'carrot] } -``` - -* * * - - - - - - -### `_.omit(object, callback|[prop1, prop2, ..., thisArg])` -# [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L2023 "View in source") [Ⓣ][1] - -Creates a shallow clone of `object` excluding the specified properties. Property names may be specified as individual arguments or as arrays of property names. If a `callback` function is passed, it will be executed for each property in the `object`, omitting the properties `callback` returns truthy for. The `callback` is bound to `thisArg` and invoked with three arguments; *(value, key, object)*. - -#### Arguments -1. `object` *(Object)*: The source object. -2. `callback|[prop1, prop2, ...]` *(Function|String)*: The properties to omit or the function called per iteration. -3. `[thisArg]` *(Mixed)*: The `this` binding of `callback`. - -#### Returns -*(Object)*: Returns an object without the omitted properties. - -#### Example -```js -_.omit({ 'name': 'moe', 'age': 40 }, 'age'); -// => { 'name': 'moe' } - -_.omit({ 'name': 'moe', 'age': 40 }, function(value) { - return typeof value == 'number'; -}); -// => { 'name': 'moe' } -``` - -* * * - - - - - - -### `_.pairs(object)` -# [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L2057 "View in source") [Ⓣ][1] - -Creates a two dimensional array of the given object's key-value pairs, i.e. `[[key1, value1], [key2, value2]]`. - -#### Arguments -1. `object` *(Object)*: The object to inspect. - -#### Returns -*(Array)*: Returns new array of key-value pairs. - -#### Example -```js -_.pairs({ 'moe': 30, 'larry': 40 }); -// => [['moe', 30], ['larry', 40]] (order is not guaranteed) -``` - -* * * - - - - - - -### `_.pick(object, callback|[prop1, prop2, ..., thisArg])` -# [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L2095 "View in source") [Ⓣ][1] - -Creates a shallow clone of `object` composed of the specified properties. Property names may be specified as individual arguments or as arrays of property names. If `callback` is passed, it will be executed for each property in the `object`, picking the properties `callback` returns truthy for. The `callback` is bound to `thisArg` and invoked with three arguments; *(value, key, object)*. - -#### Arguments -1. `object` *(Object)*: The source object. -2. `callback|[prop1, prop2, ...]` *(Array|Function|String)*: The function called per iteration or properties to pick, either as individual arguments or arrays. -3. `[thisArg]` *(Mixed)*: The `this` binding of `callback`. - -#### Returns -*(Object)*: Returns an object composed of the picked properties. - -#### Example -```js -_.pick({ 'name': 'moe', '_userid': 'moe1' }, 'name'); -// => { 'name': 'moe' } - -_.pick({ 'name': 'moe', '_userid': 'moe1' }, function(value, key) { - return key.charAt(0) != '_'; -}); -// => { 'name': 'moe' } -``` - -* * * - - - - - - -### `_.values(object)` -# [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L2132 "View in source") [Ⓣ][1] - -Creates an array composed of the own enumerable property values of `object`. - -#### Arguments -1. `object` *(Object)*: The object to inspect. - -#### Returns -*(Array)*: Returns a new array of property values. - -#### Example -```js -_.values({ 'one': 1, 'two': 2, 'three': 3 }); -// => [1, 2, 3] -``` - -* * * - - - - - - - - - -## `“Utilities†Methods` - - - -### `_.escape(string)` -# [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L4457 "View in source") [Ⓣ][1] - -Converts the characters `&`, `<`, `>`, `"`, and `'` in `string` to their corresponding HTML entities. - -#### Arguments -1. `string` *(String)*: The string to escape. - -#### Returns -*(String)*: Returns the escaped string. - -#### Example -```js -_.escape('Moe, Larry & Curly'); -// => 'Moe, Larry & Curly' -``` - -* * * - - - - - - -### `_.identity(value)` -# [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L4475 "View in source") [Ⓣ][1] - -This function returns the first argument passed to it. - -#### Arguments -1. `value` *(Mixed)*: Any value. - -#### Returns -*(Mixed)*: Returns `value`. - -#### Example -```js -var moe = { 'name': 'moe' }; -moe === _.identity(moe); -// => true -``` - -* * * - - - - - - -### `_.mixin(object)` -# [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L4501 "View in source") [Ⓣ][1] - -Adds functions properties of `object` to the `lodash` function and chainable wrapper. - -#### Arguments -1. `object` *(Object)*: The object of function properties to add to `lodash`. - -#### Example -```js -_.mixin({ - 'capitalize': function(string) { - return string.charAt(0).toUpperCase() + string.slice(1).toLowerCase(); - } -}); - -_.capitalize('moe'); -// => 'Moe' - -_('moe').capitalize(); -// => 'Moe' -``` - -* * * - - - - - - -### `_.noConflict()` -# [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L4525 "View in source") [Ⓣ][1] - -Reverts the '_' variable to its previous value and returns a reference to the `lodash` function. - -#### Returns -*(Function)*: Returns the `lodash` function. - -#### Example -```js -var lodash = _.noConflict(); -``` - -* * * - - - - - - -### `_.random([min=0, max=1])` -# [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L4548 "View in source") [Ⓣ][1] - -Produces a random number between `min` and `max` *(inclusive)*. If only one argument is passed, a number between `0` and the given number will be returned. - -#### Arguments -1. `[min=0]` *(Number)*: The minimum possible value. -2. `[max=1]` *(Number)*: The maximum possible value. - -#### Returns -*(Number)*: Returns a random number. - -#### Example -```js -_.random(0, 5); -// => a number between 0 and 5 - -_.random(5); -// => also a number between 0 and 5 -``` - -* * * - - - - - - -### `_.result(object, property)` -# [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L4586 "View in source") [Ⓣ][1] - -Resolves the value of `property` on `object`. If `property` is a function, it will be invoked and its result returned, else the property value is returned. If `object` is falsey, then `null` is returned. - -#### Arguments -1. `object` *(Object)*: The object to inspect. -2. `property` *(String)*: The property to get the value of. - -#### Returns -*(Mixed)*: Returns the resolved value. - -#### Example -```js -var object = { - 'cheese': 'crumpets', - 'stuff': function() { - return 'nonsense'; - } -}; - -_.result(object, 'cheese'); -// => 'crumpets' - -_.result(object, 'stuff'); -// => 'nonsense' -``` - -* * * - - - - - - -### `_.template(text, data, options)` -# [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L4674 "View in source") [Ⓣ][1] - -A micro-templating method that handles arbitrary delimiters, preserves whitespace, and correctly escapes quotes within interpolated code. - -Note: In the development build, `_.template` utilizes sourceURLs for easier debugging. See http://www.html5rocks.com/en/tutorials/developertools/sourcemaps/#toc-sourceurl - -Note: Lo-Dash may be used in Chrome extensions by either creating a `lodash csp` build and using precompiled templates, or loading Lo-Dash in a sandbox. - -For more information on precompiling templates see:
-http://lodash.com/#custom-builds - -For more information on Chrome extension sandboxes see:
-http://developer.chrome.com/stable/extensions/sandboxingEval.html - -#### Arguments -1. `text` *(String)*: The template text. -2. `data` *(Obect)*: The data object used to populate the text. -3. `options` *(Object)*: The options object. escape - The "escape" delimiter regexp. evaluate - The "evaluate" delimiter regexp. interpolate - The "interpolate" delimiter regexp. sourceURL - The sourceURL of the template's compiled source. variable - The data object variable name. - -#### Returns -*(Function, String)*: Returns a compiled function when no `data` object is given, else it returns the interpolated text. - -#### Example -```js -// using a compiled template -var compiled = _.template('hello <%= name %>'); -compiled({ 'name': 'moe' }); -// => 'hello moe' - -var list = '<% _.forEach(people, function(name) { %>
  • <%= name %>
  • <% }); %>'; -_.template(list, { 'people': ['moe', 'larry'] }); -// => '
  • moe
  • larry
  • ' - -// using the "escape" delimiter to escape HTML in data property values -_.template('<%- value %>', { 'value': '\n```\n\nUsing [`npm`](http://npmjs.org/):\n\n```bash\nnpm install lodash\n\nnpm install -g lodash\nnpm link lodash\n```\n\nTo avoid potential issues, update `npm` before installing Lo-Dash:\n\n```bash\nnpm install npm -g\n```\n\nIn [Node.js](http://nodejs.org/) and [RingoJS v0.8.0+](http://ringojs.org/):\n\n```js\nvar _ = require('lodash');\n\n// or as a drop-in replacement for Underscore\nvar _ = require('lodash/lodash.underscore');\n```\n\n**Note:** If Lo-Dash is installed globally, run [`npm link lodash`](http://blog.nodejs.org/2011/03/23/npm-1-0-global-vs-local-installation/) in your project’s root directory before requiring it.\n\nIn [RingoJS v0.7.0-](http://ringojs.org/):\n\n```js\nvar _ = require('lodash')._;\n```\n\nIn [Rhino](http://www.mozilla.org/rhino/):\n\n```js\nload('lodash.js');\n```\n\nIn an AMD loader like [RequireJS](http://requirejs.org/):\n\n```js\nrequire({\n 'paths': {\n 'underscore': 'path/to/lodash'\n }\n},\n['underscore'], function(_) {\n console.log(_.VERSION);\n});\n```\n\n## Release Notes\n\n### v1.0.1\n\n * Add support for specifying source map URLs in `-p`/`--source-map` build options\n * Ensured the second argument passed to `_.assign` is not treated as a `callback`\n * Ensured `-p`/`--source-map` build options correctly set the `sourceMappingURL`\n * Made `-p`/`--source-map` build options set source map *“sourcesâ€* keys based on the builds performed\n * Made `_.defer` use `setImmediate`, in Node.js, when available\n * Made `_.where` search arrays for values regardless of their index position\n * Removed dead code from `_.template`\n\nThe full changelog is available [here](https://github.com/bestiejs/lodash/wiki/Changelog).\n\n## BestieJS\n\nLo-Dash is part of the BestieJS *“Best in Classâ€* module collection. This means we promote solid browser/environment support, ES5 precedents, unit testing, and plenty of documentation.\n\n## Author\n\n* [John-David Dalton](http://allyoucanleet.com/)\n [![twitter/jdalton](http://gravatar.com/avatar/299a3d891ff1920b69c364d061007043?s=70)](https://twitter.com/jdalton \"Follow @jdalton on Twitter\")\n\n## Contributors\n\n* [Kit Cambridge](http://kitcambridge.github.com/)\n [![twitter/kitcambridge](http://gravatar.com/avatar/6662a1d02f351b5ef2f8b4d815804661?s=70)](https://twitter.com/kitcambridge \"Follow @kitcambridge on Twitter\")\n* [Mathias Bynens](http://mathiasbynens.be/)\n [![twitter/mathias](http://gravatar.com/avatar/24e08a9ea84deb17ae121074d0f17125?s=70)](https://twitter.com/mathias \"Follow @mathias on Twitter\")\n", - "readmeFilename": "README.md", - "_id": "lodash@1.0.1", - "dist": { - "shasum": "bbb6614d7fe68155d6f1cf8b3e2fb65b010dfaed" - }, - "_from": "lodash@~1.0.1", - "_resolved": "https://registry.npmjs.org/lodash/-/lodash-1.0.1.tgz" -} diff --git a/Phaser/node_modules/grunt/node_modules/findup-sync/node_modules/lodash/test/template/a.jst b/Phaser/node_modules/grunt/node_modules/findup-sync/node_modules/lodash/test/template/a.jst deleted file mode 100644 index cca541d8..00000000 --- a/Phaser/node_modules/grunt/node_modules/findup-sync/node_modules/lodash/test/template/a.jst +++ /dev/null @@ -1,3 +0,0 @@ -
      -<% _.forEach(people, function(name) { %>
    • <%- name %>
    • <% }); %> -
    \ No newline at end of file diff --git a/Phaser/node_modules/grunt/node_modules/findup-sync/node_modules/lodash/test/template/b.jst b/Phaser/node_modules/grunt/node_modules/findup-sync/node_modules/lodash/test/template/b.jst deleted file mode 100644 index cad081d1..00000000 --- a/Phaser/node_modules/grunt/node_modules/findup-sync/node_modules/lodash/test/template/b.jst +++ /dev/null @@ -1 +0,0 @@ -<% print("Hello " + epithet); %>. \ No newline at end of file diff --git a/Phaser/node_modules/grunt/node_modules/findup-sync/node_modules/lodash/test/template/c.jst b/Phaser/node_modules/grunt/node_modules/findup-sync/node_modules/lodash/test/template/c.jst deleted file mode 100644 index f9267990..00000000 --- a/Phaser/node_modules/grunt/node_modules/findup-sync/node_modules/lodash/test/template/c.jst +++ /dev/null @@ -1 +0,0 @@ -Hello ${ name }! \ No newline at end of file diff --git a/Phaser/node_modules/grunt/node_modules/findup-sync/node_modules/lodash/test/template/d.tpl b/Phaser/node_modules/grunt/node_modules/findup-sync/node_modules/lodash/test/template/d.tpl deleted file mode 100644 index c7a43bc1..00000000 --- a/Phaser/node_modules/grunt/node_modules/findup-sync/node_modules/lodash/test/template/d.tpl +++ /dev/null @@ -1 +0,0 @@ -Hello {{ name }}! \ No newline at end of file diff --git a/Phaser/node_modules/grunt/node_modules/findup-sync/node_modules/lodash/vendor/qunit-clib/LICENSE.txt b/Phaser/node_modules/grunt/node_modules/findup-sync/node_modules/lodash/vendor/qunit-clib/LICENSE.txt deleted file mode 100644 index a7501f98..00000000 --- a/Phaser/node_modules/grunt/node_modules/findup-sync/node_modules/lodash/vendor/qunit-clib/LICENSE.txt +++ /dev/null @@ -1,20 +0,0 @@ -Copyright 2011-2013 John-David Dalton - -Permission is hereby granted, free of charge, to any person obtaining -a copy of this software and associated documentation files (the -"Software"), to deal in the Software without restriction, including -without limitation the rights to use, copy, modify, merge, publish, -distribute, sublicense, and/or sell copies of the Software, and to -permit persons to whom the Software is furnished to do so, subject to -the following conditions: - -The above copyright notice and this permission notice shall be -included in all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE -LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION -WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. \ No newline at end of file diff --git a/Phaser/node_modules/grunt/node_modules/findup-sync/node_modules/lodash/vendor/qunit-clib/README.md b/Phaser/node_modules/grunt/node_modules/findup-sync/node_modules/lodash/vendor/qunit-clib/README.md deleted file mode 100644 index 7c2edfa8..00000000 --- a/Phaser/node_modules/grunt/node_modules/findup-sync/node_modules/lodash/vendor/qunit-clib/README.md +++ /dev/null @@ -1,58 +0,0 @@ -# QUnit CLIB v1.2.0 -## command-line interface boilerplate - -QUnit CLIB helps extend QUnit's CLI support to many common CLI environments. - -## Screenshot - -![QUnit CLIB brings QUnit to your favorite shell.](http://i.imgur.com/jpu9l.png) - -## Support - -QUnit CLIB has been tested in at least Node.js 0.4.8-0.8.19, Narwhal v0.3.2, PhantomJS 1.8.1, RingoJS v0.9, and Rhino v1.7RC5. - -## Usage - -```js -(function(window) { - - // use a single "load" function - var load = typeof require == 'function' ? require : window.load; - - // load QUnit and CLIB if needed - var QUnit = - window.QUnit || ( - window.addEventListener || (window.addEventListener = Function.prototype), - window.setTimeout || (window.setTimeout = Function.prototype), - window.QUnit = load('path/to/qunit.js') || window.QUnit, - load('path/to/qunit-clib.js'), - window.addEventListener === Function.prototype && delete window.addEventListener, - window.QUnit - ); - - // explicitly call `QUnit.module()` instead of `module()` - // in case we are in a CLI environment - QUnit.module('A Test Module'); - - test('A Test', function() { - // ... - }); - - // must call `QUnit.start()` if using QUnit < 1.3.0 with Node.js or any - // version of QUnit with Narwhal, PhantomJS, Rhino, or RingoJS - if (!window.document) { - QUnit.start(); - } -}(typeof global == 'object' && global || this)); -``` - -## Footnotes - - 1. QUnit v1.3.0 does not work with Narwhal or Ringo < v0.8.0 - - 2. Rhino v1.7RC4 does not support timeout fallbacks `clearTimeout` and `setTimeout` - -## Author - -* [John-David Dalton](http://allyoucanleet.com/) - [![twitter/jdalton](http://gravatar.com/avatar/299a3d891ff1920b69c364d061007043?s=70)](https://twitter.com/jdalton "Follow @jdalton on Twitter") diff --git a/Phaser/node_modules/grunt/node_modules/findup-sync/node_modules/lodash/vendor/qunit/README.md b/Phaser/node_modules/grunt/node_modules/findup-sync/node_modules/lodash/vendor/qunit/README.md deleted file mode 100644 index 6ab73f57..00000000 --- a/Phaser/node_modules/grunt/node_modules/findup-sync/node_modules/lodash/vendor/qunit/README.md +++ /dev/null @@ -1,62 +0,0 @@ -[QUnit](http://qunitjs.com) - A JavaScript Unit Testing framework. -================================ - -QUnit is a powerful, easy-to-use, JavaScript test suite. It's used by the jQuery -project to test its code and plugins but is capable of testing any generic -JavaScript code (and even capable of testing JavaScript code on the server-side). - -QUnit is especially useful for regression testing: Whenever a bug is reported, -write a test that asserts the existence of that particular bug. Then fix it and -commit both. Every time you work on the code again, run the tests. If the bug -comes up again - a regression - you'll spot it immediately and know how to fix -it, because you know what code you just changed. - -Having good unit test coverage makes safe refactoring easy and cheap. You can -run the tests after each small refactoring step and always know what change -broke something. - -QUnit is similar to other unit testing frameworks like JUnit, but makes use of -the features JavaScript provides and helps with testing code in the browser, e.g. -with its stop/start facilities for testing asynchronous code. - -If you are interested in helping developing QUnit, you are in the right place. -For related discussions, visit the -[QUnit and Testing forum](http://forum.jquery.com/qunit-and-testing). - -Development ------------ - -To submit patches, fork the repository, create a branch for the change. Then implement -the change, run `grunt` to lint and test it, then commit, push and create a pull request. - -Include some background for the change in the commit message and `Fixes #nnn`, referring -to the issue number you're addressing. - -To run `grunt`, you need `node` and `npm`, then `npm install grunt -g`. That gives you a global -grunt binary. For additional grunt tasks, also run `npm install`. - -Releases --------- - -Install git-extras and run `git changelog` to update History.md. -Update qunit/qunit.js|css and package.json to the release version, commit and -tag, update them again to the next version, commit and push commits and tags -(`git push --tags origin master`). - -Put the 'v' in front of the tag, e.g. `v1.8.0`. Clean up the changelog, removing merge commits -or whitespace cleanups. - -To upload to code.jquery.com (replace $version accordingly), ssh to code.origin.jquery.com: - - cp qunit/qunit.js /var/www/html/code.jquery.com/qunit/qunit-$version.js - cp qunit/qunit.css /var/www/html/code.jquery.com/qunit/qunit-$version.css - -Then update /var/www/html/code.jquery.com/index.html and purge it with: - - curl -s http://code.origin.jquery.com/?reload - -Update web-base-template to link to those files for qunitjs.com. - -Publish to npm via - - npm publish diff --git a/Phaser/node_modules/grunt/node_modules/findup-sync/node_modules/lodash/vendor/tar/README.md b/Phaser/node_modules/grunt/node_modules/findup-sync/node_modules/lodash/vendor/tar/README.md deleted file mode 100644 index 7cfe3bbc..00000000 --- a/Phaser/node_modules/grunt/node_modules/findup-sync/node_modules/lodash/vendor/tar/README.md +++ /dev/null @@ -1,50 +0,0 @@ -# node-tar - -Tar for Node.js. - -## Goals of this project - -1. Be able to parse and reasonably extract the contents of any tar file - created by any program that creates tar files, period. - - At least, this includes every version of: - - * bsdtar - * gnutar - * solaris posix tar - * Joerg Schilling's star ("Schilly tar") - -2. Create tar files that can be extracted by any of the following tar - programs: - - * bsdtar/libarchive version 2.6.2 - * gnutar 1.15 and above - * SunOS Posix tar - * Joerg Schilling's star ("Schilly tar") - -3. 100% test coverage. Speed is important. Correctness is slightly - more important. - -4. Create the kind of tar interface that Node users would want to use. - -5. Satisfy npm's needs for a portable tar implementation with a - JavaScript interface. - -6. No excuses. No complaining. No tolerance for failure. - -## But isn't there already a tar.js? - -Yes, there are a few. This one is going to be better, and it will be -fanatically maintained, because npm will depend on it. - -That's why I need to write it from scratch. Creating and extracting -tarballs is such a large part of what npm does, I simply can't have it -be a black box any longer. - -## Didn't you have something already? Where'd it go? - -It's in the "old" folder. It's not functional. Don't use it. - -It was a useful exploration to learn the issues involved, but like most -software of any reasonable complexity, node-tar won't be useful until -it's been written at least 3 times. diff --git a/Phaser/node_modules/grunt/node_modules/findup-sync/node_modules/lodash/vendor/tar/vendor/block-stream/LICENCE b/Phaser/node_modules/grunt/node_modules/findup-sync/node_modules/lodash/vendor/tar/vendor/block-stream/LICENCE deleted file mode 100644 index 74489e2e..00000000 --- a/Phaser/node_modules/grunt/node_modules/findup-sync/node_modules/lodash/vendor/tar/vendor/block-stream/LICENCE +++ /dev/null @@ -1,25 +0,0 @@ -Copyright (c) Isaac Z. Schlueter -All rights reserved. - -The BSD License - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions -are met: -1. Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. -2. Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - -THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS -``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED -TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS -BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR -CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF -SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS -INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN -CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) -ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE -POSSIBILITY OF SUCH DAMAGE. diff --git a/Phaser/node_modules/grunt/node_modules/findup-sync/node_modules/lodash/vendor/tar/vendor/block-stream/README.md b/Phaser/node_modules/grunt/node_modules/findup-sync/node_modules/lodash/vendor/tar/vendor/block-stream/README.md deleted file mode 100644 index c16e9c46..00000000 --- a/Phaser/node_modules/grunt/node_modules/findup-sync/node_modules/lodash/vendor/tar/vendor/block-stream/README.md +++ /dev/null @@ -1,14 +0,0 @@ -# block-stream - -A stream of blocks. - -Write data into it, and it'll output data in buffer blocks the size you -specify, padding with zeroes if necessary. - -```javascript -var block = new BlockStream(512) -fs.createReadStream("some-file").pipe(block) -block.pipe(fs.createWriteStream("block-file")) -``` - -When `.end()` or `.flush()` is called, it'll pad the block with zeroes. diff --git a/Phaser/node_modules/grunt/node_modules/findup-sync/node_modules/lodash/vendor/tar/vendor/fstream/LICENCE b/Phaser/node_modules/grunt/node_modules/findup-sync/node_modules/lodash/vendor/tar/vendor/fstream/LICENCE deleted file mode 100644 index 74489e2e..00000000 --- a/Phaser/node_modules/grunt/node_modules/findup-sync/node_modules/lodash/vendor/tar/vendor/fstream/LICENCE +++ /dev/null @@ -1,25 +0,0 @@ -Copyright (c) Isaac Z. Schlueter -All rights reserved. - -The BSD License - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions -are met: -1. Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. -2. Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - -THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS -``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED -TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS -BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR -CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF -SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS -INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN -CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) -ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE -POSSIBILITY OF SUCH DAMAGE. diff --git a/Phaser/node_modules/grunt/node_modules/findup-sync/node_modules/lodash/vendor/tar/vendor/fstream/README.md b/Phaser/node_modules/grunt/node_modules/findup-sync/node_modules/lodash/vendor/tar/vendor/fstream/README.md deleted file mode 100644 index 9d8cb77e..00000000 --- a/Phaser/node_modules/grunt/node_modules/findup-sync/node_modules/lodash/vendor/tar/vendor/fstream/README.md +++ /dev/null @@ -1,76 +0,0 @@ -Like FS streams, but with stat on them, and supporting directories and -symbolic links, as well as normal files. Also, you can use this to set -the stats on a file, even if you don't change its contents, or to create -a symlink, etc. - -So, for example, you can "write" a directory, and it'll call `mkdir`. You -can specify a uid and gid, and it'll call `chown`. You can specify a -`mtime` and `atime`, and it'll call `utimes`. You can call it a symlink -and provide a `linkpath` and it'll call `symlink`. - -Note that it won't automatically resolve symbolic links. So, if you -call `fstream.Reader('/some/symlink')` then you'll get an object -that stats and then ends immediately (since it has no data). To follow -symbolic links, do this: `fstream.Reader({path:'/some/symlink', follow: -true })`. - -There are various checks to make sure that the bytes emitted are the -same as the intended size, if the size is set. - -## Examples - -```javascript -fstream - .Writer({ path: "path/to/file" - , mode: 0755 - , size: 6 - }) - .write("hello\n") - .end() -``` - -This will create the directories if they're missing, and then write -`hello\n` into the file, chmod it to 0755, and assert that 6 bytes have -been written when it's done. - -```javascript -fstream - .Writer({ path: "path/to/file" - , mode: 0755 - , size: 6 - , flags: "a" - }) - .write("hello\n") - .end() -``` - -You can pass flags in, if you want to append to a file. - -```javascript -fstream - .Writer({ path: "path/to/symlink" - , linkpath: "./file" - , SymbolicLink: true - , mode: "0755" // octal strings supported - }) - .end() -``` - -If isSymbolicLink is a function, it'll be called, and if it returns -true, then it'll treat it as a symlink. If it's not a function, then -any truish value will make a symlink, or you can set `type: -'SymbolicLink'`, which does the same thing. - -Note that the linkpath is relative to the symbolic link location, not -the parent dir or cwd. - -```javascript -fstream - .Reader("path/to/dir") - .pipe(fstream.Writer("path/to/other/dir")) -``` - -This will do like `cp -Rp path/to/dir path/to/other/dir`. If the other -dir exists and isn't a directory, then it'll emit an error. It'll also -set the uid, gid, mode, etc. to be identical. In this way, it's more -like `rsync -a` than simply a copy. diff --git a/Phaser/node_modules/grunt/node_modules/findup-sync/node_modules/lodash/vendor/tar/vendor/graceful-fs/LICENSE b/Phaser/node_modules/grunt/node_modules/findup-sync/node_modules/lodash/vendor/tar/vendor/graceful-fs/LICENSE deleted file mode 100644 index 05a40109..00000000 --- a/Phaser/node_modules/grunt/node_modules/findup-sync/node_modules/lodash/vendor/tar/vendor/graceful-fs/LICENSE +++ /dev/null @@ -1,23 +0,0 @@ -Copyright 2009, 2010, 2011 Isaac Z. Schlueter. -All rights reserved. - -Permission is hereby granted, free of charge, to any person -obtaining a copy of this software and associated documentation -files (the "Software"), to deal in the Software without -restriction, including without limitation the rights to use, -copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the -Software is furnished to do so, subject to the following -conditions: - -The above copyright notice and this permission notice shall be -included in all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES -OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT -HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, -WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING -FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR -OTHER DEALINGS IN THE SOFTWARE. diff --git a/Phaser/node_modules/grunt/node_modules/findup-sync/node_modules/lodash/vendor/tar/vendor/graceful-fs/README.md b/Phaser/node_modules/grunt/node_modules/findup-sync/node_modules/lodash/vendor/tar/vendor/graceful-fs/README.md deleted file mode 100644 index 7d2e681e..00000000 --- a/Phaser/node_modules/grunt/node_modules/findup-sync/node_modules/lodash/vendor/tar/vendor/graceful-fs/README.md +++ /dev/null @@ -1,5 +0,0 @@ -Just like node's `fs` module, but it does an incremental back-off when -EMFILE is encountered. - -Useful in asynchronous situations where one needs to try to open lots -and lots of files. diff --git a/Phaser/node_modules/grunt/node_modules/findup-sync/node_modules/lodash/vendor/tar/vendor/inherits/README.md b/Phaser/node_modules/grunt/node_modules/findup-sync/node_modules/lodash/vendor/tar/vendor/inherits/README.md deleted file mode 100644 index b2beaed9..00000000 --- a/Phaser/node_modules/grunt/node_modules/findup-sync/node_modules/lodash/vendor/tar/vendor/inherits/README.md +++ /dev/null @@ -1,51 +0,0 @@ -A dead simple way to do inheritance in JS. - - var inherits = require("inherits") - - function Animal () { - this.alive = true - } - Animal.prototype.say = function (what) { - console.log(what) - } - - inherits(Dog, Animal) - function Dog () { - Dog.super.apply(this) - } - Dog.prototype.sniff = function () { - this.say("sniff sniff") - } - Dog.prototype.bark = function () { - this.say("woof woof") - } - - inherits(Chihuahua, Dog) - function Chihuahua () { - Chihuahua.super.apply(this) - } - Chihuahua.prototype.bark = function () { - this.say("yip yip") - } - - // also works - function Cat () { - Cat.super.apply(this) - } - Cat.prototype.hiss = function () { - this.say("CHSKKSS!!") - } - inherits(Cat, Animal, { - meow: function () { this.say("miao miao") } - }) - Cat.prototype.purr = function () { - this.say("purr purr") - } - - - var c = new Chihuahua - assert(c instanceof Chihuahua) - assert(c instanceof Dog) - assert(c instanceof Animal) - -The actual function is laughably small. 10-lines small. diff --git a/Phaser/node_modules/grunt/node_modules/findup-sync/node_modules/lodash/vendor/tar/vendor/mkdirp/LICENSE b/Phaser/node_modules/grunt/node_modules/findup-sync/node_modules/lodash/vendor/tar/vendor/mkdirp/LICENSE deleted file mode 100644 index 432d1aeb..00000000 --- a/Phaser/node_modules/grunt/node_modules/findup-sync/node_modules/lodash/vendor/tar/vendor/mkdirp/LICENSE +++ /dev/null @@ -1,21 +0,0 @@ -Copyright 2010 James Halliday (mail@substack.net) - -This project is free software released under the MIT/X11 license: - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. diff --git a/Phaser/node_modules/grunt/node_modules/findup-sync/node_modules/lodash/vendor/tar/vendor/mkdirp/README.markdown b/Phaser/node_modules/grunt/node_modules/findup-sync/node_modules/lodash/vendor/tar/vendor/mkdirp/README.markdown deleted file mode 100644 index 40de04f7..00000000 --- a/Phaser/node_modules/grunt/node_modules/findup-sync/node_modules/lodash/vendor/tar/vendor/mkdirp/README.markdown +++ /dev/null @@ -1,61 +0,0 @@ -mkdirp -====== - -Like `mkdir -p`, but in node.js! - -[![build status](https://secure.travis-ci.org/substack/node-mkdirp.png)](http://travis-ci.org/substack/node-mkdirp) - -example -======= - -pow.js ------- - var mkdirp = require('mkdirp'); - - mkdirp('/tmp/foo/bar/baz', function (err) { - if (err) console.error(err) - else console.log('pow!') - }); - -Output - pow! - -And now /tmp/foo/bar/baz exists, huzzah! - -methods -======= - -var mkdirp = require('mkdirp'); - -mkdirp(dir, mode, cb) ---------------------- - -Create a new directory and any necessary subdirectories at `dir` with octal -permission string `mode`. - -If `mode` isn't specified, it defaults to `0777 & (~process.umask())`. - -`cb(err, made)` fires with the error or the first directory `made` -that had to be created, if any. - -mkdirp.sync(dir, mode) ----------------------- - -Synchronously create a new directory and any necessary subdirectories at `dir` -with octal permission string `mode`. - -If `mode` isn't specified, it defaults to `0777 & (~process.umask())`. - -Returns the first directory that had to be created, if any. - -install -======= - -With [npm](http://npmjs.org) do: - - npm install mkdirp - -license -======= - -MIT/X11 diff --git a/Phaser/node_modules/grunt/node_modules/findup-sync/node_modules/lodash/vendor/tar/vendor/rimraf/AUTHORS b/Phaser/node_modules/grunt/node_modules/findup-sync/node_modules/lodash/vendor/tar/vendor/rimraf/AUTHORS deleted file mode 100644 index 247b7543..00000000 --- a/Phaser/node_modules/grunt/node_modules/findup-sync/node_modules/lodash/vendor/tar/vendor/rimraf/AUTHORS +++ /dev/null @@ -1,6 +0,0 @@ -# Authors sorted by whether or not they're me. -Isaac Z. Schlueter (http://blog.izs.me) -Wayne Larsen (http://github.com/wvl) -ritch -Marcel Laverdet -Yosef Dinerstein diff --git a/Phaser/node_modules/grunt/node_modules/findup-sync/node_modules/lodash/vendor/tar/vendor/rimraf/LICENSE b/Phaser/node_modules/grunt/node_modules/findup-sync/node_modules/lodash/vendor/tar/vendor/rimraf/LICENSE deleted file mode 100644 index 05a40109..00000000 --- a/Phaser/node_modules/grunt/node_modules/findup-sync/node_modules/lodash/vendor/tar/vendor/rimraf/LICENSE +++ /dev/null @@ -1,23 +0,0 @@ -Copyright 2009, 2010, 2011 Isaac Z. Schlueter. -All rights reserved. - -Permission is hereby granted, free of charge, to any person -obtaining a copy of this software and associated documentation -files (the "Software"), to deal in the Software without -restriction, including without limitation the rights to use, -copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the -Software is furnished to do so, subject to the following -conditions: - -The above copyright notice and this permission notice shall be -included in all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES -OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT -HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, -WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING -FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR -OTHER DEALINGS IN THE SOFTWARE. diff --git a/Phaser/node_modules/grunt/node_modules/findup-sync/node_modules/lodash/vendor/tar/vendor/rimraf/README.md b/Phaser/node_modules/grunt/node_modules/findup-sync/node_modules/lodash/vendor/tar/vendor/rimraf/README.md deleted file mode 100644 index 96ce9b2a..00000000 --- a/Phaser/node_modules/grunt/node_modules/findup-sync/node_modules/lodash/vendor/tar/vendor/rimraf/README.md +++ /dev/null @@ -1,21 +0,0 @@ -A `rm -rf` for node. - -Install with `npm install rimraf`, or just drop rimraf.js somewhere. - -## API - -`rimraf(f, callback)` - -The callback will be called with an error if there is one. Certain -errors are handled for you: - -* `EBUSY` - rimraf will back off a maximum of opts.maxBusyTries times - before giving up. -* `EMFILE` - If too many file descriptors get opened, rimraf will - patiently wait until more become available. - - -## rimraf.sync - -It can remove stuff synchronously, too. But that's not so good. Use -the async API. It's better. diff --git a/Phaser/node_modules/grunt/node_modules/findup-sync/node_modules/lodash/vendor/underscore/LICENSE b/Phaser/node_modules/grunt/node_modules/findup-sync/node_modules/lodash/vendor/underscore/LICENSE deleted file mode 100644 index 0d8dbe40..00000000 --- a/Phaser/node_modules/grunt/node_modules/findup-sync/node_modules/lodash/vendor/underscore/LICENSE +++ /dev/null @@ -1,22 +0,0 @@ -Copyright (c) 2009-2013 Jeremy Ashkenas, DocumentCloud - -Permission is hereby granted, free of charge, to any person -obtaining a copy of this software and associated documentation -files (the "Software"), to deal in the Software without -restriction, including without limitation the rights to use, -copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the -Software is furnished to do so, subject to the following -conditions: - -The above copyright notice and this permission notice shall be -included in all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES -OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT -HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, -WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING -FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR -OTHER DEALINGS IN THE SOFTWARE. diff --git a/Phaser/node_modules/grunt/node_modules/findup-sync/node_modules/lodash/vendor/underscore/README.md b/Phaser/node_modules/grunt/node_modules/findup-sync/node_modules/lodash/vendor/underscore/README.md deleted file mode 100644 index b1f3e50a..00000000 --- a/Phaser/node_modules/grunt/node_modules/findup-sync/node_modules/lodash/vendor/underscore/README.md +++ /dev/null @@ -1,19 +0,0 @@ - __ - /\ \ __ - __ __ ___ \_\ \ __ _ __ ____ ___ ___ _ __ __ /\_\ ____ - /\ \/\ \ /' _ `\ /'_ \ /'__`\/\ __\/ ,__\ / ___\ / __`\/\ __\/'__`\ \/\ \ /',__\ - \ \ \_\ \/\ \/\ \/\ \ \ \/\ __/\ \ \//\__, `\/\ \__//\ \ \ \ \ \//\ __/ __ \ \ \/\__, `\ - \ \____/\ \_\ \_\ \___,_\ \____\\ \_\\/\____/\ \____\ \____/\ \_\\ \____\/\_\ _\ \ \/\____/ - \/___/ \/_/\/_/\/__,_ /\/____/ \/_/ \/___/ \/____/\/___/ \/_/ \/____/\/_//\ \_\ \/___/ - \ \____/ - \/___/ - -Underscore.js is a utility-belt library for JavaScript that provides -support for the usual functional suspects (each, map, reduce, filter...) -without extending any core JavaScript objects. - -For Docs, License, Tests, and pre-packed downloads, see: -http://underscorejs.org - -Many thanks to our contributors: -https://github.com/documentcloud/underscore/contributors diff --git a/Phaser/node_modules/grunt/node_modules/findup-sync/package.json b/Phaser/node_modules/grunt/node_modules/findup-sync/package.json deleted file mode 100644 index e6210ecc..00000000 --- a/Phaser/node_modules/grunt/node_modules/findup-sync/package.json +++ /dev/null @@ -1,52 +0,0 @@ -{ - "name": "findup-sync", - "description": "Find the first file matching a given pattern in the current directory or the nearest ancestor directory.", - "version": "0.1.2", - "homepage": "https://github.com/cowboy/node-findup-sync", - "author": { - "name": "\"Cowboy\" Ben Alman", - "url": "http://benalman.com/" - }, - "repository": { - "type": "git", - "url": "git://github.com/cowboy/node-findup-sync.git" - }, - "bugs": { - "url": "https://github.com/cowboy/node-findup-sync/issues" - }, - "licenses": [ - { - "type": "MIT", - "url": "https://github.com/cowboy/node-findup-sync/blob/master/LICENSE-MIT" - } - ], - "main": "lib/findup-sync", - "engines": { - "node": ">= 0.6.0" - }, - "scripts": { - "test": "grunt nodeunit" - }, - "dependencies": { - "glob": "~3.1.21", - "lodash": "~1.0.1" - }, - "devDependencies": { - "grunt": "~0.4.0", - "grunt-contrib-jshint": "~0.2.0", - "grunt-contrib-nodeunit": "~0.1.2" - }, - "keywords": [ - "find", - "glob", - "file" - ], - "readme": "# findup-sync\n\nFind the first file matching a given pattern in the current directory or the nearest ancestor directory.\n\n## Getting Started\nInstall the module with: `npm install findup-sync`\n\n```js\nvar findup = require('findup-sync');\n\n// Start looking in the CWD.\nvar filepath1 = findup('{a,b}*.txt');\n\n// Start looking somewhere else, and ignore case (probably a good idea).\nvar filepath2 = findup('{a,b}*.txt', {cwd: '/some/path', nocase: true});\n```\n\n## Usage\n\n```js\nfindup(patternOrPatterns [, minimatchOptions])\n```\n\n### patternOrPatterns\nType: `String` or `Array` \nDefault: none\n\nOne or more wildcard glob patterns. Or just filenames.\n\n### minimatchOptions\nType: `Object` \nDefault: `{}`\n\nOptions to be passed to [minimatch](https://github.com/isaacs/minimatch).\n\nNote that if you want to start in a different directory than the current working directory, specify a `cwd` property here.\n\n## Contributing\nIn lieu of a formal styleguide, take care to maintain the existing coding style. Add unit tests for any new or changed functionality. Lint and test your code using [Grunt](http://gruntjs.com/).\n\n## Release History\n2013-03-08 - v0.1.2 - Updated dependencies. Fixed a Node 0.9.x bug. Updated unit tests to work cross-platform. \n2012-11-15 - v0.1.1 - Now works without an options object. \n2012-11-01 - v0.1.0 - Initial release.\n", - "readmeFilename": "README.md", - "_id": "findup-sync@0.1.2", - "dist": { - "shasum": "ca92407e195dd57f027db19332844c783d94312c" - }, - "_from": "findup-sync@~0.1.0", - "_resolved": "https://registry.npmjs.org/findup-sync/-/findup-sync-0.1.2.tgz" -} diff --git a/Phaser/node_modules/grunt/node_modules/findup-sync/test/fixtures/a.txt b/Phaser/node_modules/grunt/node_modules/findup-sync/test/fixtures/a.txt deleted file mode 100644 index e69de29b..00000000 diff --git a/Phaser/node_modules/grunt/node_modules/findup-sync/test/fixtures/a/b/bar.txt b/Phaser/node_modules/grunt/node_modules/findup-sync/test/fixtures/a/b/bar.txt deleted file mode 100644 index e69de29b..00000000 diff --git a/Phaser/node_modules/grunt/node_modules/findup-sync/test/fixtures/a/foo.txt b/Phaser/node_modules/grunt/node_modules/findup-sync/test/fixtures/a/foo.txt deleted file mode 100644 index e69de29b..00000000 diff --git a/Phaser/node_modules/grunt/node_modules/findup-sync/test/fixtures/aaa.txt b/Phaser/node_modules/grunt/node_modules/findup-sync/test/fixtures/aaa.txt deleted file mode 100644 index e69de29b..00000000 diff --git a/Phaser/node_modules/grunt/node_modules/glob/.npmignore b/Phaser/node_modules/grunt/node_modules/glob/.npmignore deleted file mode 100644 index 2af4b71c..00000000 --- a/Phaser/node_modules/grunt/node_modules/glob/.npmignore +++ /dev/null @@ -1,2 +0,0 @@ -.*.swp -test/a/ diff --git a/Phaser/node_modules/grunt/node_modules/glob/.travis.yml b/Phaser/node_modules/grunt/node_modules/glob/.travis.yml deleted file mode 100644 index baa0031d..00000000 --- a/Phaser/node_modules/grunt/node_modules/glob/.travis.yml +++ /dev/null @@ -1,3 +0,0 @@ -language: node_js -node_js: - - 0.8 diff --git a/Phaser/node_modules/grunt/node_modules/glob/LICENSE b/Phaser/node_modules/grunt/node_modules/glob/LICENSE deleted file mode 100644 index 0c44ae71..00000000 --- a/Phaser/node_modules/grunt/node_modules/glob/LICENSE +++ /dev/null @@ -1,27 +0,0 @@ -Copyright (c) Isaac Z. Schlueter ("Author") -All rights reserved. - -The BSD License - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions -are met: - -1. Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - -2. Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - -THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND -ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS -BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR -CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF -SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR -BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, -WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE -OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN -IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/Phaser/node_modules/grunt/node_modules/glob/README.md b/Phaser/node_modules/grunt/node_modules/glob/README.md deleted file mode 100644 index 6e27df62..00000000 --- a/Phaser/node_modules/grunt/node_modules/glob/README.md +++ /dev/null @@ -1,233 +0,0 @@ -# Glob - -This is a glob implementation in JavaScript. It uses the `minimatch` -library to do its matching. - -## Attention: node-glob users! - -The API has changed dramatically between 2.x and 3.x. This library is -now 100% JavaScript, and the integer flags have been replaced with an -options object. - -Also, there's an event emitter class, proper tests, and all the other -things you've come to expect from node modules. - -And best of all, no compilation! - -## Usage - -```javascript -var glob = require("glob") - -// options is optional -glob("**/*.js", options, function (er, files) { - // files is an array of filenames. - // If the `nonull` option is set, and nothing - // was found, then files is ["**/*.js"] - // er is an error object or null. -}) -``` - -## Features - -Please see the [minimatch -documentation](https://github.com/isaacs/minimatch) for more details. - -Supports these glob features: - -* Brace Expansion -* Extended glob matching -* "Globstar" `**` matching - -See: - -* `man sh` -* `man bash` -* `man 3 fnmatch` -* `man 5 gitignore` -* [minimatch documentation](https://github.com/isaacs/minimatch) - -## glob(pattern, [options], cb) - -* `pattern` {String} Pattern to be matched -* `options` {Object} -* `cb` {Function} - * `err` {Error | null} - * `matches` {Array} filenames found matching the pattern - -Perform an asynchronous glob search. - -## glob.sync(pattern, [options] - -* `pattern` {String} Pattern to be matched -* `options` {Object} -* return: {Array} filenames found matching the pattern - -Perform a synchronous glob search. - -## Class: glob.Glob - -Create a Glob object by instanting the `glob.Glob` class. - -```javascript -var Glob = require("glob").Glob -var mg = new Glob(pattern, options, cb) -``` - -It's an EventEmitter, and starts walking the filesystem to find matches -immediately. - -### new glob.Glob(pattern, [options], [cb]) - -* `pattern` {String} pattern to search for -* `options` {Object} -* `cb` {Function} Called when an error occurs, or matches are found - * `err` {Error | null} - * `matches` {Array} filenames found matching the pattern - -Note that if the `sync` flag is set in the options, then matches will -be immediately available on the `g.found` member. - -### Properties - -* `minimatch` The minimatch object that the glob uses. -* `options` The options object passed in. -* `error` The error encountered. When an error is encountered, the - glob object is in an undefined state, and should be discarded. -* `aborted` Boolean which is set to true when calling `abort()`. There - is no way at this time to continue a glob search after aborting, but - you can re-use the statCache to avoid having to duplicate syscalls. - -### Events - -* `end` When the matching is finished, this is emitted with all the - matches found. If the `nonull` option is set, and no match was found, - then the `matches` list contains the original pattern. The matches - are sorted, unless the `nosort` flag is set. -* `match` Every time a match is found, this is emitted with the matched. -* `error` Emitted when an unexpected error is encountered, or whenever - any fs error occurs if `options.strict` is set. -* `abort` When `abort()` is called, this event is raised. - -### Methods - -* `abort` Stop the search. - -### Options - -All the options that can be passed to Minimatch can also be passed to -Glob to change pattern matching behavior. Also, some have been added, -or have glob-specific ramifications. - -All options are false by default, unless otherwise noted. - -All options are added to the glob object, as well. - -* `cwd` The current working directory in which to search. Defaults - to `process.cwd()`. -* `root` The place where patterns starting with `/` will be mounted - onto. Defaults to `path.resolve(options.cwd, "/")` (`/` on Unix - systems, and `C:\` or some such on Windows.) -* `nomount` By default, a pattern starting with a forward-slash will be - "mounted" onto the root setting, so that a valid filesystem path is - returned. Set this flag to disable that behavior. -* `mark` Add a `/` character to directory matches. Note that this - requires additional stat calls. -* `nosort` Don't sort the results. -* `stat` Set to true to stat *all* results. This reduces performance - somewhat, and is completely unnecessary, unless `readdir` is presumed - to be an untrustworthy indicator of file existence. It will cause - ELOOP to be triggered one level sooner in the case of cyclical - symbolic links. -* `silent` When an unusual error is encountered - when attempting to read a directory, a warning will be printed to - stderr. Set the `silent` option to true to suppress these warnings. -* `strict` When an unusual error is encountered - when attempting to read a directory, the process will just continue on - in search of other matches. Set the `strict` option to raise an error - in these cases. -* `statCache` A cache of results of filesystem information, to prevent - unnecessary stat calls. While it should not normally be necessary to - set this, you may pass the statCache from one glob() call to the - options object of another, if you know that the filesystem will not - change between calls. (See "Race Conditions" below.) -* `sync` Perform a synchronous glob search. -* `nounique` In some cases, brace-expanded patterns can result in the - same file showing up multiple times in the result set. By default, - this implementation prevents duplicates in the result set. - Set this flag to disable that behavior. -* `nonull` Set to never return an empty set, instead returning a set - containing the pattern itself. This is the default in glob(3). -* `nocase` Perform a case-insensitive match. Note that case-insensitive - filesystems will sometimes result in glob returning results that are - case-insensitively matched anyway, since readdir and stat will not - raise an error. -* `debug` Set to enable debug logging in minimatch and glob. -* `globDebug` Set to enable debug logging in glob, but not minimatch. - -## Comparisons to other fnmatch/glob implementations - -While strict compliance with the existing standards is a worthwhile -goal, some discrepancies exist between node-glob and other -implementations, and are intentional. - -If the pattern starts with a `!` character, then it is negated. Set the -`nonegate` flag to suppress this behavior, and treat leading `!` -characters normally. This is perhaps relevant if you wish to start the -pattern with a negative extglob pattern like `!(a|B)`. Multiple `!` -characters at the start of a pattern will negate the pattern multiple -times. - -If a pattern starts with `#`, then it is treated as a comment, and -will not match anything. Use `\#` to match a literal `#` at the -start of a line, or set the `nocomment` flag to suppress this behavior. - -The double-star character `**` is supported by default, unless the -`noglobstar` flag is set. This is supported in the manner of bsdglob -and bash 4.1, where `**` only has special significance if it is the only -thing in a path part. That is, `a/**/b` will match `a/x/y/b`, but -`a/**b` will not. **Note that this is different from the way that `**` is -handled by ruby's `Dir` class.** - -If an escaped pattern has no matches, and the `nonull` flag is set, -then glob returns the pattern as-provided, rather than -interpreting the character escapes. For example, -`glob.match([], "\\*a\\?")` will return `"\\*a\\?"` rather than -`"*a?"`. This is akin to setting the `nullglob` option in bash, except -that it does not resolve escaped pattern characters. - -If brace expansion is not disabled, then it is performed before any -other interpretation of the glob pattern. Thus, a pattern like -`+(a|{b),c)}`, which would not be valid in bash or zsh, is expanded -**first** into the set of `+(a|b)` and `+(a|c)`, and those patterns are -checked for validity. Since those two are valid, matching proceeds. - -## Windows - -**Please only use forward-slashes in glob expressions.** - -Though windows uses either `/` or `\` as its path separator, only `/` -characters are used by this glob implementation. You must use -forward-slashes **only** in glob expressions. Back-slashes will always -be interpreted as escape characters, not path separators. - -Results from absolute patterns such as `/foo/*` are mounted onto the -root setting using `path.join`. On windows, this will by default result -in `/foo/*` matching `C:\foo\bar.txt`. - -## Race Conditions - -Glob searching, by its very nature, is susceptible to race conditions, -since it relies on directory walking and such. - -As a result, it is possible that a file that exists when glob looks for -it may have been deleted or modified by the time it returns the result. - -As part of its internal implementation, this program caches all stat -and readdir calls that it makes, in order to cut down on system -overhead. However, this also makes it even more susceptible to races, -especially if the statCache object is reused between glob calls. - -Users are thus advised not to use a glob result as a -guarantee of filesystem state in the face of rapid changes. -For the vast majority of operations, this is never a problem. diff --git a/Phaser/node_modules/grunt/node_modules/glob/node_modules/graceful-fs/.npmignore b/Phaser/node_modules/grunt/node_modules/glob/node_modules/graceful-fs/.npmignore deleted file mode 100644 index c2658d7d..00000000 --- a/Phaser/node_modules/grunt/node_modules/glob/node_modules/graceful-fs/.npmignore +++ /dev/null @@ -1 +0,0 @@ -node_modules/ diff --git a/Phaser/node_modules/grunt/node_modules/glob/node_modules/graceful-fs/LICENSE b/Phaser/node_modules/grunt/node_modules/glob/node_modules/graceful-fs/LICENSE deleted file mode 100644 index 05a40109..00000000 --- a/Phaser/node_modules/grunt/node_modules/glob/node_modules/graceful-fs/LICENSE +++ /dev/null @@ -1,23 +0,0 @@ -Copyright 2009, 2010, 2011 Isaac Z. Schlueter. -All rights reserved. - -Permission is hereby granted, free of charge, to any person -obtaining a copy of this software and associated documentation -files (the "Software"), to deal in the Software without -restriction, including without limitation the rights to use, -copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the -Software is furnished to do so, subject to the following -conditions: - -The above copyright notice and this permission notice shall be -included in all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES -OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT -HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, -WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING -FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR -OTHER DEALINGS IN THE SOFTWARE. diff --git a/Phaser/node_modules/grunt/node_modules/glob/node_modules/graceful-fs/README.md b/Phaser/node_modules/grunt/node_modules/glob/node_modules/graceful-fs/README.md deleted file mode 100644 index 7d2e681e..00000000 --- a/Phaser/node_modules/grunt/node_modules/glob/node_modules/graceful-fs/README.md +++ /dev/null @@ -1,5 +0,0 @@ -Just like node's `fs` module, but it does an incremental back-off when -EMFILE is encountered. - -Useful in asynchronous situations where one needs to try to open lots -and lots of files. diff --git a/Phaser/node_modules/grunt/node_modules/glob/node_modules/graceful-fs/package.json b/Phaser/node_modules/grunt/node_modules/glob/node_modules/graceful-fs/package.json deleted file mode 100644 index a798ef13..00000000 --- a/Phaser/node_modules/grunt/node_modules/glob/node_modules/graceful-fs/package.json +++ /dev/null @@ -1,40 +0,0 @@ -{ - "author": { - "name": "Isaac Z. Schlueter", - "email": "i@izs.me", - "url": "http://blog.izs.me" - }, - "name": "graceful-fs", - "description": "fs monkey-patching to avoid EMFILE and other problems", - "version": "1.2.0", - "repository": { - "type": "git", - "url": "git://github.com/isaacs/node-graceful-fs.git" - }, - "main": "graceful-fs.js", - "engines": { - "node": ">=0.4.0" - }, - "directories": { - "test": "test" - }, - "scripts": { - "test": "tap test/*.js" - }, - "keywords": [ - "fs", - "EMFILE", - "error", - "handling", - "monkeypatch" - ], - "license": "BSD", - "readme": "Just like node's `fs` module, but it does an incremental back-off when\nEMFILE is encountered.\n\nUseful in asynchronous situations where one needs to try to open lots\nand lots of files.\n", - "readmeFilename": "README.md", - "_id": "graceful-fs@1.2.0", - "dist": { - "shasum": "3e88cb0b86a44728092d4a9ecea898b7e1d7def5" - }, - "_from": "graceful-fs@~1.2.0", - "_resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-1.2.0.tgz" -} diff --git a/Phaser/node_modules/grunt/node_modules/glob/node_modules/inherits/README.md b/Phaser/node_modules/grunt/node_modules/glob/node_modules/inherits/README.md deleted file mode 100644 index b2beaed9..00000000 --- a/Phaser/node_modules/grunt/node_modules/glob/node_modules/inherits/README.md +++ /dev/null @@ -1,51 +0,0 @@ -A dead simple way to do inheritance in JS. - - var inherits = require("inherits") - - function Animal () { - this.alive = true - } - Animal.prototype.say = function (what) { - console.log(what) - } - - inherits(Dog, Animal) - function Dog () { - Dog.super.apply(this) - } - Dog.prototype.sniff = function () { - this.say("sniff sniff") - } - Dog.prototype.bark = function () { - this.say("woof woof") - } - - inherits(Chihuahua, Dog) - function Chihuahua () { - Chihuahua.super.apply(this) - } - Chihuahua.prototype.bark = function () { - this.say("yip yip") - } - - // also works - function Cat () { - Cat.super.apply(this) - } - Cat.prototype.hiss = function () { - this.say("CHSKKSS!!") - } - inherits(Cat, Animal, { - meow: function () { this.say("miao miao") } - }) - Cat.prototype.purr = function () { - this.say("purr purr") - } - - - var c = new Chihuahua - assert(c instanceof Chihuahua) - assert(c instanceof Dog) - assert(c instanceof Animal) - -The actual function is laughably small. 10-lines small. diff --git a/Phaser/node_modules/grunt/node_modules/glob/node_modules/inherits/package.json b/Phaser/node_modules/grunt/node_modules/glob/node_modules/inherits/package.json deleted file mode 100644 index a9521755..00000000 --- a/Phaser/node_modules/grunt/node_modules/glob/node_modules/inherits/package.json +++ /dev/null @@ -1,30 +0,0 @@ -{ - "name": "inherits", - "description": "A tiny simple way to do classic inheritance in js", - "version": "1.0.0", - "keywords": [ - "inheritance", - "class", - "klass", - "oop", - "object-oriented" - ], - "main": "./inherits.js", - "repository": { - "type": "git", - "url": "https://github.com/isaacs/inherits" - }, - "author": { - "name": "Isaac Z. Schlueter", - "email": "i@izs.me", - "url": "http://blog.izs.me/" - }, - "readme": "A dead simple way to do inheritance in JS.\n\n var inherits = require(\"inherits\")\n\n function Animal () {\n this.alive = true\n }\n Animal.prototype.say = function (what) {\n console.log(what)\n }\n\n inherits(Dog, Animal)\n function Dog () {\n Dog.super.apply(this)\n }\n Dog.prototype.sniff = function () {\n this.say(\"sniff sniff\")\n }\n Dog.prototype.bark = function () {\n this.say(\"woof woof\")\n }\n\n inherits(Chihuahua, Dog)\n function Chihuahua () {\n Chihuahua.super.apply(this)\n }\n Chihuahua.prototype.bark = function () {\n this.say(\"yip yip\")\n }\n\n // also works\n function Cat () {\n Cat.super.apply(this)\n }\n Cat.prototype.hiss = function () {\n this.say(\"CHSKKSS!!\")\n }\n inherits(Cat, Animal, {\n meow: function () { this.say(\"miao miao\") }\n })\n Cat.prototype.purr = function () {\n this.say(\"purr purr\")\n }\n\n\n var c = new Chihuahua\n assert(c instanceof Chihuahua)\n assert(c instanceof Dog)\n assert(c instanceof Animal)\n\nThe actual function is laughably small. 10-lines small.\n", - "readmeFilename": "README.md", - "_id": "inherits@1.0.0", - "dist": { - "shasum": "f31c29ca5d0348508c1fb08655aa94e483a0c53e" - }, - "_from": "inherits@1", - "_resolved": "https://registry.npmjs.org/inherits/-/inherits-1.0.0.tgz" -} diff --git a/Phaser/node_modules/grunt/node_modules/glob/package.json b/Phaser/node_modules/grunt/node_modules/glob/package.json deleted file mode 100644 index 52b6dc61..00000000 --- a/Phaser/node_modules/grunt/node_modules/glob/package.json +++ /dev/null @@ -1,40 +0,0 @@ -{ - "author": { - "name": "Isaac Z. Schlueter", - "email": "i@izs.me", - "url": "http://blog.izs.me/" - }, - "name": "glob", - "description": "a little globber", - "version": "3.1.21", - "repository": { - "type": "git", - "url": "git://github.com/isaacs/node-glob.git" - }, - "main": "glob.js", - "engines": { - "node": "*" - }, - "dependencies": { - "minimatch": "~0.2.11", - "graceful-fs": "~1.2.0", - "inherits": "1" - }, - "devDependencies": { - "tap": "~0.4.0", - "mkdirp": "0", - "rimraf": "1" - }, - "scripts": { - "test": "tap test/*.js" - }, - "license": "BSD", - "readme": "# Glob\n\nThis is a glob implementation in JavaScript. It uses the `minimatch`\nlibrary to do its matching.\n\n## Attention: node-glob users!\n\nThe API has changed dramatically between 2.x and 3.x. This library is\nnow 100% JavaScript, and the integer flags have been replaced with an\noptions object.\n\nAlso, there's an event emitter class, proper tests, and all the other\nthings you've come to expect from node modules.\n\nAnd best of all, no compilation!\n\n## Usage\n\n```javascript\nvar glob = require(\"glob\")\n\n// options is optional\nglob(\"**/*.js\", options, function (er, files) {\n // files is an array of filenames.\n // If the `nonull` option is set, and nothing\n // was found, then files is [\"**/*.js\"]\n // er is an error object or null.\n})\n```\n\n## Features\n\nPlease see the [minimatch\ndocumentation](https://github.com/isaacs/minimatch) for more details.\n\nSupports these glob features:\n\n* Brace Expansion\n* Extended glob matching\n* \"Globstar\" `**` matching\n\nSee:\n\n* `man sh`\n* `man bash`\n* `man 3 fnmatch`\n* `man 5 gitignore`\n* [minimatch documentation](https://github.com/isaacs/minimatch)\n\n## glob(pattern, [options], cb)\n\n* `pattern` {String} Pattern to be matched\n* `options` {Object}\n* `cb` {Function}\n * `err` {Error | null}\n * `matches` {Array} filenames found matching the pattern\n\nPerform an asynchronous glob search.\n\n## glob.sync(pattern, [options]\n\n* `pattern` {String} Pattern to be matched\n* `options` {Object}\n* return: {Array} filenames found matching the pattern\n\nPerform a synchronous glob search.\n\n## Class: glob.Glob\n\nCreate a Glob object by instanting the `glob.Glob` class.\n\n```javascript\nvar Glob = require(\"glob\").Glob\nvar mg = new Glob(pattern, options, cb)\n```\n\nIt's an EventEmitter, and starts walking the filesystem to find matches\nimmediately.\n\n### new glob.Glob(pattern, [options], [cb])\n\n* `pattern` {String} pattern to search for\n* `options` {Object}\n* `cb` {Function} Called when an error occurs, or matches are found\n * `err` {Error | null}\n * `matches` {Array} filenames found matching the pattern\n\nNote that if the `sync` flag is set in the options, then matches will\nbe immediately available on the `g.found` member.\n\n### Properties\n\n* `minimatch` The minimatch object that the glob uses.\n* `options` The options object passed in.\n* `error` The error encountered. When an error is encountered, the\n glob object is in an undefined state, and should be discarded.\n* `aborted` Boolean which is set to true when calling `abort()`. There\n is no way at this time to continue a glob search after aborting, but\n you can re-use the statCache to avoid having to duplicate syscalls.\n\n### Events\n\n* `end` When the matching is finished, this is emitted with all the\n matches found. If the `nonull` option is set, and no match was found,\n then the `matches` list contains the original pattern. The matches\n are sorted, unless the `nosort` flag is set.\n* `match` Every time a match is found, this is emitted with the matched.\n* `error` Emitted when an unexpected error is encountered, or whenever\n any fs error occurs if `options.strict` is set.\n* `abort` When `abort()` is called, this event is raised.\n\n### Methods\n\n* `abort` Stop the search.\n\n### Options\n\nAll the options that can be passed to Minimatch can also be passed to\nGlob to change pattern matching behavior. Also, some have been added,\nor have glob-specific ramifications.\n\nAll options are false by default, unless otherwise noted.\n\nAll options are added to the glob object, as well.\n\n* `cwd` The current working directory in which to search. Defaults\n to `process.cwd()`.\n* `root` The place where patterns starting with `/` will be mounted\n onto. Defaults to `path.resolve(options.cwd, \"/\")` (`/` on Unix\n systems, and `C:\\` or some such on Windows.)\n* `nomount` By default, a pattern starting with a forward-slash will be\n \"mounted\" onto the root setting, so that a valid filesystem path is\n returned. Set this flag to disable that behavior.\n* `mark` Add a `/` character to directory matches. Note that this\n requires additional stat calls.\n* `nosort` Don't sort the results.\n* `stat` Set to true to stat *all* results. This reduces performance\n somewhat, and is completely unnecessary, unless `readdir` is presumed\n to be an untrustworthy indicator of file existence. It will cause\n ELOOP to be triggered one level sooner in the case of cyclical\n symbolic links.\n* `silent` When an unusual error is encountered\n when attempting to read a directory, a warning will be printed to\n stderr. Set the `silent` option to true to suppress these warnings.\n* `strict` When an unusual error is encountered\n when attempting to read a directory, the process will just continue on\n in search of other matches. Set the `strict` option to raise an error\n in these cases.\n* `statCache` A cache of results of filesystem information, to prevent\n unnecessary stat calls. While it should not normally be necessary to\n set this, you may pass the statCache from one glob() call to the\n options object of another, if you know that the filesystem will not\n change between calls. (See \"Race Conditions\" below.)\n* `sync` Perform a synchronous glob search.\n* `nounique` In some cases, brace-expanded patterns can result in the\n same file showing up multiple times in the result set. By default,\n this implementation prevents duplicates in the result set.\n Set this flag to disable that behavior.\n* `nonull` Set to never return an empty set, instead returning a set\n containing the pattern itself. This is the default in glob(3).\n* `nocase` Perform a case-insensitive match. Note that case-insensitive\n filesystems will sometimes result in glob returning results that are\n case-insensitively matched anyway, since readdir and stat will not\n raise an error.\n* `debug` Set to enable debug logging in minimatch and glob.\n* `globDebug` Set to enable debug logging in glob, but not minimatch.\n\n## Comparisons to other fnmatch/glob implementations\n\nWhile strict compliance with the existing standards is a worthwhile\ngoal, some discrepancies exist between node-glob and other\nimplementations, and are intentional.\n\nIf the pattern starts with a `!` character, then it is negated. Set the\n`nonegate` flag to suppress this behavior, and treat leading `!`\ncharacters normally. This is perhaps relevant if you wish to start the\npattern with a negative extglob pattern like `!(a|B)`. Multiple `!`\ncharacters at the start of a pattern will negate the pattern multiple\ntimes.\n\nIf a pattern starts with `#`, then it is treated as a comment, and\nwill not match anything. Use `\\#` to match a literal `#` at the\nstart of a line, or set the `nocomment` flag to suppress this behavior.\n\nThe double-star character `**` is supported by default, unless the\n`noglobstar` flag is set. This is supported in the manner of bsdglob\nand bash 4.1, where `**` only has special significance if it is the only\nthing in a path part. That is, `a/**/b` will match `a/x/y/b`, but\n`a/**b` will not. **Note that this is different from the way that `**` is\nhandled by ruby's `Dir` class.**\n\nIf an escaped pattern has no matches, and the `nonull` flag is set,\nthen glob returns the pattern as-provided, rather than\ninterpreting the character escapes. For example,\n`glob.match([], \"\\\\*a\\\\?\")` will return `\"\\\\*a\\\\?\"` rather than\n`\"*a?\"`. This is akin to setting the `nullglob` option in bash, except\nthat it does not resolve escaped pattern characters.\n\nIf brace expansion is not disabled, then it is performed before any\nother interpretation of the glob pattern. Thus, a pattern like\n`+(a|{b),c)}`, which would not be valid in bash or zsh, is expanded\n**first** into the set of `+(a|b)` and `+(a|c)`, and those patterns are\nchecked for validity. Since those two are valid, matching proceeds.\n\n## Windows\n\n**Please only use forward-slashes in glob expressions.**\n\nThough windows uses either `/` or `\\` as its path separator, only `/`\ncharacters are used by this glob implementation. You must use\nforward-slashes **only** in glob expressions. Back-slashes will always\nbe interpreted as escape characters, not path separators.\n\nResults from absolute patterns such as `/foo/*` are mounted onto the\nroot setting using `path.join`. On windows, this will by default result\nin `/foo/*` matching `C:\\foo\\bar.txt`.\n\n## Race Conditions\n\nGlob searching, by its very nature, is susceptible to race conditions,\nsince it relies on directory walking and such.\n\nAs a result, it is possible that a file that exists when glob looks for\nit may have been deleted or modified by the time it returns the result.\n\nAs part of its internal implementation, this program caches all stat\nand readdir calls that it makes, in order to cut down on system\noverhead. However, this also makes it even more susceptible to races,\nespecially if the statCache object is reused between glob calls.\n\nUsers are thus advised not to use a glob result as a\nguarantee of filesystem state in the face of rapid changes.\nFor the vast majority of operations, this is never a problem.\n", - "readmeFilename": "README.md", - "_id": "glob@3.1.21", - "dist": { - "shasum": "3e571d3685492f79bbfbac81a61416dec97b2998" - }, - "_from": "glob@~3.1.21", - "_resolved": "https://registry.npmjs.org/glob/-/glob-3.1.21.tgz" -} diff --git a/Phaser/node_modules/grunt/node_modules/glob/test/bash-results.json b/Phaser/node_modules/grunt/node_modules/glob/test/bash-results.json deleted file mode 100644 index c227449b..00000000 --- a/Phaser/node_modules/grunt/node_modules/glob/test/bash-results.json +++ /dev/null @@ -1,348 +0,0 @@ -{ - "test/a/*/+(c|g)/./d": [ - "test/a/b/c/./d" - ], - "test/a/**/[cg]/../[cg]": [ - "test/a/abcdef/g/../g", - "test/a/abcfed/g/../g", - "test/a/b/c/../c", - "test/a/c/../c", - "test/a/c/d/c/../c", - "test/a/symlink/a/b/c/../c", - "test/a/symlink/a/b/c/a/b/c/../c", - "test/a/symlink/a/b/c/a/b/c/a/b/c/../c", - "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/../c", - "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/../c", - "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/../c", - "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/../c", - "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/../c", - "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/../c", - "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/../c", - "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/../c", - "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/../c", - "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/../c", - "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/../c", - "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/../c", - "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/../c", - "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/../c", - "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/../c", - "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/../c", - "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/../c", - "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/../c", - "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/../c", - "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/../c", - "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/../c", - "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/../c", - "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/../c", - "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/../c", - "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/../c", - "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/../c", - "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/../c", - "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/../c", - "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/../c" - ], - "test/a/{b,c,d,e,f}/**/g": [], - "test/a/b/**": [ - "test/a/b", - "test/a/b/c", - "test/a/b/c/d" - ], - "test/**/g": [ - "test/a/abcdef/g", - "test/a/abcfed/g" - ], - "test/a/abc{fed,def}/g/h": [ - "test/a/abcdef/g/h", - "test/a/abcfed/g/h" - ], - "test/a/abc{fed/g,def}/**/": [ - "test/a/abcdef", - "test/a/abcdef/g", - "test/a/abcfed/g" - ], - "test/a/abc{fed/g,def}/**///**/": [ - "test/a/abcdef", - "test/a/abcdef/g", - "test/a/abcfed/g" - ], - "test/**/a/**/": [ - "test/a", - "test/a/abcdef", - "test/a/abcdef/g", - "test/a/abcfed", - "test/a/abcfed/g", - "test/a/b", - "test/a/b/c", - "test/a/bc", - "test/a/bc/e", - "test/a/c", - "test/a/c/d", - "test/a/c/d/c", - "test/a/cb", - "test/a/cb/e", - "test/a/symlink", - "test/a/symlink/a", - "test/a/symlink/a/b", - "test/a/symlink/a/b/c", - "test/a/symlink/a/b/c/a", - "test/a/symlink/a/b/c/a/b", - "test/a/symlink/a/b/c/a/b/c", - "test/a/symlink/a/b/c/a/b/c/a", - "test/a/symlink/a/b/c/a/b/c/a/b", - "test/a/symlink/a/b/c/a/b/c/a/b/c", - "test/a/symlink/a/b/c/a/b/c/a/b/c/a", - "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b", - "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c", - "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a", - "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b", - "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c", - "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a", - "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b", - "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c", - "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a", - "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b", - "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c", - "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a", - "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b", - "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c", - "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a", - "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b", - "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c", - "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a", - "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b", - "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c", - "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a", - "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b", - "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c", - "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a", - "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b", - "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c", - "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a", - "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b", - "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c", - "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a", - "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b", - "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c", - "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a", - "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b", - "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c", - "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a", - "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b", - "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c", - "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a", - "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b", - "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c", - "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a", - "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b", - "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c", - "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a", - "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b", - "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c", - "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a", - "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b", - "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c", - "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a", - "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b", - "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c", - "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a", - "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b", - "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c", - "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a", - "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b", - "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c", - "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a", - "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b", - "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c", - "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a", - "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b", - "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c", - "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a", - "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b", - "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c", - "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a", - "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b", - "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c", - "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a", - "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b", - "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c", - "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a", - "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b", - "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c", - "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a", - "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b", - "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c", - "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a", - "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b", - "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c", - "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a", - "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b", - "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c", - "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a", - "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b" - ], - "test/+(a|b|c)/a{/,bc*}/**": [ - "test/a/abcdef", - "test/a/abcdef/g", - "test/a/abcdef/g/h", - "test/a/abcfed", - "test/a/abcfed/g", - "test/a/abcfed/g/h" - ], - "test/*/*/*/f": [ - "test/a/bc/e/f", - "test/a/cb/e/f" - ], - "test/**/f": [ - "test/a/bc/e/f", - "test/a/cb/e/f" - ], - "test/a/symlink/a/b/c/a/b/c/a/b/c//a/b/c////a/b/c/**/b/c/**": [ - "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c", - "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a", - "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b", - "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c", - "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a", - "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b", - "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c", - "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a", - "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b", - "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c", - "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a", - "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b", - "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c", - "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a", - "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b", - "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c", - "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a", - "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b", - "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c", - "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a", - "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b", - "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c", - "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a", - "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b", - "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c", - "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a", - "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b", - "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c", - "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a", - "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b", - "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c", - "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a", - "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b", - "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c", - "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a", - "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b", - "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c", - "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a", - "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b", - "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c", - "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a", - "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b", - "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c", - "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a", - "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b", - "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c", - "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a", - "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b", - "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c", - "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a", - "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b", - "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c", - "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a", - "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b", - "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c", - "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a", - "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b", - "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c", - "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a", - "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b", - "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c", - "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a", - "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b", - "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c", - "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a", - "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b", - "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c", - "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a", - "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b", - "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c", - "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a", - "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b", - "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c", - "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a", - "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b", - "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c", - "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a", - "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b", - "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c", - "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a", - "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b", - "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c" - ], - "{./*/*,/tmp/glob-test/*}": [ - "./examples/g.js", - "./examples/usr-local.js", - "./node_modules/graceful-fs", - "./node_modules/inherits", - "./node_modules/minimatch", - "./node_modules/mkdirp", - "./node_modules/rimraf", - "./node_modules/tap", - "./test/00-setup.js", - "./test/a", - "./test/bash-comparison.js", - "./test/bash-results.json", - "./test/cwd-test.js", - "./test/mark.js", - "./test/nocase-nomagic.js", - "./test/pause-resume.js", - "./test/root-nomount.js", - "./test/root.js", - "./test/zz-cleanup.js", - "/tmp/glob-test/asdf", - "/tmp/glob-test/bar", - "/tmp/glob-test/baz", - "/tmp/glob-test/foo", - "/tmp/glob-test/quux", - "/tmp/glob-test/qwer", - "/tmp/glob-test/rewq" - ], - "{/tmp/glob-test/*,*}": [ - "/tmp/glob-test/asdf", - "/tmp/glob-test/bar", - "/tmp/glob-test/baz", - "/tmp/glob-test/foo", - "/tmp/glob-test/quux", - "/tmp/glob-test/qwer", - "/tmp/glob-test/rewq", - "examples", - "glob.js", - "LICENSE", - "node_modules", - "package.json", - "README.md", - "test" - ], - "test/a/!(symlink)/**": [ - "test/a/abcdef", - "test/a/abcdef/g", - "test/a/abcdef/g/h", - "test/a/abcfed", - "test/a/abcfed/g", - "test/a/abcfed/g/h", - "test/a/b", - "test/a/b/c", - "test/a/b/c/d", - "test/a/bc", - "test/a/bc/e", - "test/a/bc/e/f", - "test/a/c", - "test/a/c/d", - "test/a/c/d/c", - "test/a/c/d/c/b", - "test/a/cb", - "test/a/cb/e", - "test/a/cb/e/f" - ] -} diff --git a/Phaser/node_modules/grunt/node_modules/hooker/LICENSE-MIT b/Phaser/node_modules/grunt/node_modules/hooker/LICENSE-MIT deleted file mode 100644 index 90c336c3..00000000 --- a/Phaser/node_modules/grunt/node_modules/hooker/LICENSE-MIT +++ /dev/null @@ -1,22 +0,0 @@ -Copyright (c) 2012 "Cowboy" Ben Alman - -Permission is hereby granted, free of charge, to any person -obtaining a copy of this software and associated documentation -files (the "Software"), to deal in the Software without -restriction, including without limitation the rights to use, -copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the -Software is furnished to do so, subject to the following -conditions: - -The above copyright notice and this permission notice shall be -included in all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES -OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT -HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, -WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING -FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR -OTHER DEALINGS IN THE SOFTWARE. diff --git a/Phaser/node_modules/grunt/node_modules/hooker/README.md b/Phaser/node_modules/grunt/node_modules/hooker/README.md deleted file mode 100644 index 138943a2..00000000 --- a/Phaser/node_modules/grunt/node_modules/hooker/README.md +++ /dev/null @@ -1,186 +0,0 @@ -# JavaScript Hooker - -Monkey-patch (hook) functions for debugging and stuff. - -## Getting Started - -This code should work just fine in Node.js: - -First, install the module with: `npm install hooker` - -```javascript -var hooker = require('hooker'); -hooker.hook(Math, "max", function() { - console.log(arguments.length + " arguments passed"); -}); -Math.max(5, 6, 7) // logs: "3 arguments passed", returns 7 -``` - -Or in the browser: - -```html - - -``` - -In the browser, you can attach Hooker's methods to any object. - -```html - - - -``` - -## Documentation - -### hooker.hook -Monkey-patch (hook) one or more methods of an object. -#### Signature: -`hooker.hook(object, [ props, ] [options | prehookFunction])` -#### `props` -The optional `props` argument can be a method name, array of method names or null. If null (or omitted), all enumerable methods of `object` will be hooked. -#### `options` -* `pre` - (Function) a pre-hook function to be executed before the original function. Arguments passed into the method will be passed into the pre-hook function as well. -* `post` - (Function) a post-hook function to be executed after the original function. The original function's result is passed into the post-hook function as its first argument, followed by the method arguments. -* `once` - (Boolean) if true, auto-unhook the function after the first execution. -* `passName` - (Boolean) if true, pass the name of the method into the pre-hook function as its first arg (preceding all other arguments), and into the post-hook function as the second arg (after result but preceding all other arguments). - -#### Returns: -An array of hooked method names. - -### hooker.unhook -Un-monkey-patch (unhook) one or more methods of an object. -#### Signature: -`hooker.unhook(object [, props ])` -#### `props` -The optional `props` argument can be a method name, array of method names or null. If null (or omitted), all methods of `object` will be unhooked. -#### Returns: -An array of unhooked method names. - -### hooker.orig -Get a reference to the original method from a hooked function. -#### Signature: -`hooker.orig(object, props)` - -### hooker.override -When a pre- or post-hook returns the result of this function, the value -passed will be used in place of the original function's return value. Any -post-hook override value will take precedence over a pre-hook override value. -#### Signature: -`hooker.override(value)` - -### hooker.preempt -When a pre-hook returns the result of this function, the value passed will -be used in place of the original function's return value, and the original -function will NOT be executed. -#### Signature: -`hooker.preempt(value)` - -### hooker.filter -When a pre-hook returns the result of this function, the context and -arguments passed will be applied into the original function. -#### Signature: -`hooker.filter(context, arguments)` - - -## Examples -See the unit tests for more examples. - -```javascript -var hooker = require('hooker'); -// Simple logging. -hooker.hook(Math, "max", function() { - console.log(arguments.length + " arguments passed"); -}); -Math.max(5, 6, 7) // logs: "3 arguments passed", returns 7 - -hooker.unhook(Math, "max"); // (This is assumed between all further examples) -Math.max(5, 6, 7) // 7 - -// Returning hooker.override(value) overrides the original value. -hooker.hook(Math, "max", function() { - if (arguments.length === 0) { - return hooker.override(9000); - } -}); -Math.max(5, 6, 7) // 7 -Math.max() // 9000 - -// Auto-unhook after one execution. -hooker.hook(Math, "max", { - once: true, - pre: function() { - console.log("Init something here"); - } -}); -Math.max(5, 6, 7) // logs: "Init something here", returns 7 -Math.max(5, 6, 7) // 7 - -// Filter `this` and arguments through a pre-hook function. -hooker.hook(Math, "max", { - pre: function() { - var args = [].map.call(arguments, function(num) { - return num * 2; - }); - return hooker.filter(this, args); // thisValue, arguments - } -}); -Math.max(5, 6, 7) // 14 - -// Modify the original function's result with a post-hook function. -hooker.hook(Math, "max", { - post: function(result) { - return hooker.override(result * 100); - } -}); -Math.max(5, 6, 7) // 700 - -// Hook every Math method. Note: if Math's methods were enumerable, the second -// argument could be omitted. Since they aren't, an array of properties to hook -// must be explicitly passed. Non-method properties will be skipped. -// See a more generic example here: http://bit.ly/vvJlrS -hooker.hook(Math, Object.getOwnPropertyNames(Math), { - passName: true, - pre: function(name) { - console.log("=> Math." + name, [].slice.call(arguments, 1)); - }, - post: function(result, name) { - console.log("<= Math." + name, result); - } -}); - -var result = Math.max(5, 6, 7); -// => Math.max [ 5, 6, 7 ] -// <= Math.max 7 -result // 7 - -result = Math.ceil(3.456); -// => Math.ceil [ 3.456 ] -// <= Math.ceil 4 -result // 4 -``` - -## Contributing -In lieu of a formal styleguide, take care to maintain the existing coding style. Add unit tests for any new or changed functionality. Lint and test your code using [grunt](https://github.com/cowboy/grunt). - -_Also, please don't edit files in the "dist" subdirectory as they are generated via grunt. You'll find source code in the "lib" subdirectory!_ - -## Release History -2012/01/09 - v0.2.3 - First official release. - -## License -Copyright (c) 2012 "Cowboy" Ben Alman -Licensed under the MIT license. - diff --git a/Phaser/node_modules/grunt/node_modules/hooker/package.json b/Phaser/node_modules/grunt/node_modules/hooker/package.json deleted file mode 100644 index 7025ae51..00000000 --- a/Phaser/node_modules/grunt/node_modules/hooker/package.json +++ /dev/null @@ -1,49 +0,0 @@ -{ - "name": "hooker", - "description": "Monkey-patch (hook) functions for debugging and stuff.", - "version": "0.2.3", - "homepage": "http://github.com/cowboy/javascript-hooker", - "author": { - "name": "\"Cowboy\" Ben Alman", - "url": "http://benalman.com/" - }, - "repository": { - "type": "git", - "url": "git://github.com/cowboy/javascript-hooker.git" - }, - "bugs": { - "url": "https://github.com/cowboy/javascript-hooker/issues" - }, - "licenses": [ - { - "type": "MIT", - "url": "https://github.com/cowboy/javascript-hooker/blob/master/LICENSE-MIT" - } - ], - "dependencies": {}, - "devDependencies": { - "grunt": "~0.2.1" - }, - "keywords": [ - "patch", - "hook", - "function", - "debug", - "aop" - ], - "engines": { - "node": "*" - }, - "main": "lib/hooker", - "scripts": { - "test": "grunt test" - }, - "readme": "# JavaScript Hooker\n\nMonkey-patch (hook) functions for debugging and stuff.\n\n## Getting Started\n\nThis code should work just fine in Node.js:\n\nFirst, install the module with: `npm install hooker`\n\n```javascript\nvar hooker = require('hooker');\nhooker.hook(Math, \"max\", function() {\n console.log(arguments.length + \" arguments passed\");\n});\nMath.max(5, 6, 7) // logs: \"3 arguments passed\", returns 7\n```\n\nOr in the browser:\n\n```html\n\n\n```\n\nIn the browser, you can attach Hooker's methods to any object.\n\n```html\n\n\n\n```\n\n## Documentation\n\n### hooker.hook\nMonkey-patch (hook) one or more methods of an object.\n#### Signature:\n`hooker.hook(object, [ props, ] [options | prehookFunction])`\n#### `props`\nThe optional `props` argument can be a method name, array of method names or null. If null (or omitted), all enumerable methods of `object` will be hooked.\n#### `options`\n* `pre` - (Function) a pre-hook function to be executed before the original function. Arguments passed into the method will be passed into the pre-hook function as well.\n* `post` - (Function) a post-hook function to be executed after the original function. The original function's result is passed into the post-hook function as its first argument, followed by the method arguments.\n* `once` - (Boolean) if true, auto-unhook the function after the first execution.\n* `passName` - (Boolean) if true, pass the name of the method into the pre-hook function as its first arg (preceding all other arguments), and into the post-hook function as the second arg (after result but preceding all other arguments).\n\n#### Returns:\nAn array of hooked method names.\n\n### hooker.unhook\nUn-monkey-patch (unhook) one or more methods of an object.\n#### Signature:\n`hooker.unhook(object [, props ])`\n#### `props`\nThe optional `props` argument can be a method name, array of method names or null. If null (or omitted), all methods of `object` will be unhooked.\n#### Returns:\nAn array of unhooked method names.\n\n### hooker.orig\nGet a reference to the original method from a hooked function.\n#### Signature:\n`hooker.orig(object, props)`\n\n### hooker.override\nWhen a pre- or post-hook returns the result of this function, the value\npassed will be used in place of the original function's return value. Any\npost-hook override value will take precedence over a pre-hook override value.\n#### Signature:\n`hooker.override(value)`\n\n### hooker.preempt\nWhen a pre-hook returns the result of this function, the value passed will\nbe used in place of the original function's return value, and the original\nfunction will NOT be executed.\n#### Signature:\n`hooker.preempt(value)`\n\n### hooker.filter\nWhen a pre-hook returns the result of this function, the context and\narguments passed will be applied into the original function.\n#### Signature:\n`hooker.filter(context, arguments)`\n\n\n## Examples\nSee the unit tests for more examples.\n\n```javascript\nvar hooker = require('hooker');\n// Simple logging.\nhooker.hook(Math, \"max\", function() {\n console.log(arguments.length + \" arguments passed\");\n});\nMath.max(5, 6, 7) // logs: \"3 arguments passed\", returns 7\n\nhooker.unhook(Math, \"max\"); // (This is assumed between all further examples)\nMath.max(5, 6, 7) // 7\n\n// Returning hooker.override(value) overrides the original value.\nhooker.hook(Math, \"max\", function() {\n if (arguments.length === 0) {\n return hooker.override(9000);\n }\n});\nMath.max(5, 6, 7) // 7\nMath.max() // 9000\n\n// Auto-unhook after one execution.\nhooker.hook(Math, \"max\", {\n once: true,\n pre: function() {\n console.log(\"Init something here\");\n }\n});\nMath.max(5, 6, 7) // logs: \"Init something here\", returns 7\nMath.max(5, 6, 7) // 7\n\n// Filter `this` and arguments through a pre-hook function.\nhooker.hook(Math, \"max\", {\n pre: function() {\n var args = [].map.call(arguments, function(num) {\n return num * 2;\n });\n return hooker.filter(this, args); // thisValue, arguments\n }\n});\nMath.max(5, 6, 7) // 14\n\n// Modify the original function's result with a post-hook function.\nhooker.hook(Math, \"max\", {\n post: function(result) {\n return hooker.override(result * 100);\n }\n});\nMath.max(5, 6, 7) // 700\n\n// Hook every Math method. Note: if Math's methods were enumerable, the second\n// argument could be omitted. Since they aren't, an array of properties to hook\n// must be explicitly passed. Non-method properties will be skipped.\n// See a more generic example here: http://bit.ly/vvJlrS\nhooker.hook(Math, Object.getOwnPropertyNames(Math), {\n passName: true,\n pre: function(name) {\n console.log(\"=> Math.\" + name, [].slice.call(arguments, 1));\n },\n post: function(result, name) {\n console.log(\"<= Math.\" + name, result);\n }\n});\n\nvar result = Math.max(5, 6, 7);\n// => Math.max [ 5, 6, 7 ]\n// <= Math.max 7\nresult // 7\n\nresult = Math.ceil(3.456);\n// => Math.ceil [ 3.456 ]\n// <= Math.ceil 4\nresult // 4\n```\n\n## Contributing\nIn lieu of a formal styleguide, take care to maintain the existing coding style. Add unit tests for any new or changed functionality. Lint and test your code using [grunt](https://github.com/cowboy/grunt).\n\n_Also, please don't edit files in the \"dist\" subdirectory as they are generated via grunt. You'll find source code in the \"lib\" subdirectory!_\n\n## Release History\n2012/01/09 - v0.2.3 - First official release.\n\n## License\nCopyright (c) 2012 \"Cowboy\" Ben Alman \nLicensed under the MIT license. \n\n", - "readmeFilename": "README.md", - "_id": "hooker@0.2.3", - "dist": { - "shasum": "42604c7eaa578b96b26e57a598b5a2b18dfaa4e2" - }, - "_from": "hooker@~0.2.3", - "_resolved": "https://registry.npmjs.org/hooker/-/hooker-0.2.3.tgz" -} diff --git a/Phaser/node_modules/grunt/node_modules/iconv-lite/.npmignore b/Phaser/node_modules/grunt/node_modules/iconv-lite/.npmignore deleted file mode 100644 index fe46877a..00000000 --- a/Phaser/node_modules/grunt/node_modules/iconv-lite/.npmignore +++ /dev/null @@ -1,3 +0,0 @@ -node_modules -*~ -*sublime-* diff --git a/Phaser/node_modules/grunt/node_modules/iconv-lite/.travis.yml b/Phaser/node_modules/grunt/node_modules/iconv-lite/.travis.yml deleted file mode 100644 index 0bab9cd8..00000000 --- a/Phaser/node_modules/grunt/node_modules/iconv-lite/.travis.yml +++ /dev/null @@ -1,5 +0,0 @@ - language: node_js - node_js: - - 0.4 - - 0.6 - - 0.8 diff --git a/Phaser/node_modules/grunt/node_modules/iconv-lite/LICENSE b/Phaser/node_modules/grunt/node_modules/iconv-lite/LICENSE deleted file mode 100644 index d518d837..00000000 --- a/Phaser/node_modules/grunt/node_modules/iconv-lite/LICENSE +++ /dev/null @@ -1,21 +0,0 @@ -Copyright (c) 2011 Alexander Shtuchkin - -Permission is hereby granted, free of charge, to any person obtaining -a copy of this software and associated documentation files (the -"Software"), to deal in the Software without restriction, including -without limitation the rights to use, copy, modify, merge, publish, -distribute, sublicense, and/or sell copies of the Software, and to -permit persons to whom the Software is furnished to do so, subject to -the following conditions: - -The above copyright notice and this permission notice shall be -included in all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE -LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION -WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - diff --git a/Phaser/node_modules/grunt/node_modules/iconv-lite/README.md b/Phaser/node_modules/grunt/node_modules/iconv-lite/README.md deleted file mode 100644 index 66de64e9..00000000 --- a/Phaser/node_modules/grunt/node_modules/iconv-lite/README.md +++ /dev/null @@ -1,67 +0,0 @@ -iconv-lite - pure javascript character encoding conversion -====================================================================== - -[![Build Status](https://secure.travis-ci.org/ashtuchkin/iconv-lite.png?branch=master)](http://travis-ci.org/ashtuchkin/iconv-lite) - -## Features - -* Pure javascript. Doesn't need native code compilation. -* Easy API. -* Works on Windows and in sandboxed environments like [Cloud9](http://c9.io). -* Encoding is much faster than node-iconv (see below for performance comparison). - -## Usage - - var iconv = require('iconv-lite'); - - // Convert from an encoded buffer to string. - str = iconv.decode(buf, 'win1251'); - - // Convert from string to an encoded buffer. - buf = iconv.encode("Sample input string", 'win1251'); - -## Supported encodings - -* All node.js native encodings: 'utf8', 'ucs2', 'ascii', 'binary', 'base64' -* All widespread single byte encodings: Windows 125x family, ISO-8859 family, - IBM/DOS codepages, Macintosh family, KOI8 family. - Aliases like 'latin1', 'us-ascii' also supported. -* Multibyte encodings: 'gbk', 'gb2313', 'Big5', 'cp950'. - -Others are easy to add, see the source. Please, participate. -Most encodings are generated from node-iconv. Thank you Ben Noordhuis and iconv authors! - -Not supported yet: EUC family, Shift_JIS. - - -## Encoding/decoding speed - -Comparison with node-iconv module (1000x256kb, on Ubuntu 12.04, Core i5/2.5 GHz, Node v0.8.7). -Note: your results may vary, so please always check on your hardware. - - operation iconv@1.2.4 iconv-lite@0.2.4 - ---------------------------------------------------------- - encode('win1251') ~115 Mb/s ~230 Mb/s - decode('win1251') ~95 Mb/s ~130 Mb/s - - -## Notes - -Untranslatable characters are set to � or ?. No transliteration is currently supported, pull requests are welcome. - -## Testing - - git clone git@github.com:ashtuchkin/iconv-lite.git - cd iconv-lite - npm install - npm test - - # To view performance: - node test/performance.js - -## TODO - -* Support streaming character conversion, something like util.pipe(req, iconv.fromEncodingStream('latin1')). -* Add more encodings. -* Add transliteration (best fit char). -* Add tests and correct support of variable-byte encodings (currently work is delegated to node). diff --git a/Phaser/node_modules/grunt/node_modules/iconv-lite/README.md~ b/Phaser/node_modules/grunt/node_modules/iconv-lite/README.md~ deleted file mode 100644 index 5f575615..00000000 --- a/Phaser/node_modules/grunt/node_modules/iconv-lite/README.md~ +++ /dev/null @@ -1,54 +0,0 @@ -iconv-lite - native javascript conversion between character encodings. -====================================================================== - -## Usage - - var iconv = require('iconv-lite'); - - // Convert from an encoded buffer to string. - str = iconv.fromEncoding(buf, 'win-1251'); - // Or - str = iconv.decode(buf, 'win-1251'); - - // Convert from string to an encoded buffer. - buf = iconv.toEncoding("Sample input string", 'win-1251'); - // Or - buf = iconv.encode("Sample input string", 'win-1251'); - -## Supported encodings - -Currently only a small part of encodings supported: - -* All node.js native encodings: 'utf8', 'ucs2', 'ascii', 'binary', 'base64'. -* 'latin1' -* Cyrillic encodings: 'windows-1251', 'koi8-r', 'iso 8859-5'. - -Other encodings are easy to add, see the source. Please, participate. - - -## Encoding/decoding speed - -Comparison with iconv module (1000 times 256kb, on Core i5/2.5 GHz). - - Operation\module iconv iconv-lite (this) - toEncoding('win1251') 19.57 mb/s 49.04 mb/s - fromEncoding('win1251') 16.39 mb/s 24.11 mb/s - - -## Notes - -This module is JavaScript-only, thus can be used in a sandboxed environment like [Cloud9](http://c9.io). - -Untranslatable characters are set to '?'. No transliteration is currently supported, pull requests are welcome. - -## Testing - - npm install --dev iconv-lite - vows - -## TODO - -* Support streaming character conversion, something like util.pipe(req, iconv.fromEncodingStream('latin1')). -* Add more encodings. -* Add transliteration (best fit char). -* Add tests and correct support of variable-byte encodings (currently work is delegated to node). diff --git a/Phaser/node_modules/grunt/node_modules/iconv-lite/package.json b/Phaser/node_modules/grunt/node_modules/iconv-lite/package.json deleted file mode 100644 index 274530fc..00000000 --- a/Phaser/node_modules/grunt/node_modules/iconv-lite/package.json +++ /dev/null @@ -1,72 +0,0 @@ -{ - "name": "iconv-lite", - "description": "Convert character encodings in pure javascript.", - "version": "0.2.8", - "keywords": [ - "iconv", - "convert", - "charset" - ], - "author": { - "name": "Alexander Shtuchkin", - "email": "ashtuchkin@gmail.com" - }, - "contributors": [ - { - "name": "Jinwu Zhan", - "url": "https://github.com/jenkinv" - }, - { - "name": "Adamansky Anton", - "url": "https://github.com/adamansky" - }, - { - "name": "George Stagas", - "url": "https://github.com/stagas" - }, - { - "name": "Mike D Pilsbury", - "url": "https://github.com/pekim" - }, - { - "name": "Niggler", - "url": "https://github.com/Niggler" - }, - { - "name": "wychi", - "url": "https://github.com/wychi" - }, - { - "name": "David Kuo", - "url": "https://github.com/david50407" - }, - { - "name": "ChangZhuo Chen", - "url": "https://github.com/czchen" - } - ], - "main": "index.js", - "homepage": "https://github.com/ashtuchkin/iconv-lite", - "repository": { - "type": "git", - "url": "git://github.com/ashtuchkin/iconv-lite.git" - }, - "engines": { - "node": ">=0.4.0" - }, - "scripts": { - "test": "vows --spec" - }, - "devDependencies": { - "vows": "", - "iconv": ">=1.1" - }, - "readme": "iconv-lite - pure javascript character encoding conversion\n======================================================================\n\n[![Build Status](https://secure.travis-ci.org/ashtuchkin/iconv-lite.png?branch=master)](http://travis-ci.org/ashtuchkin/iconv-lite)\n\n## Features\n\n* Pure javascript. Doesn't need native code compilation.\n* Easy API.\n* Works on Windows and in sandboxed environments like [Cloud9](http://c9.io).\n* Encoding is much faster than node-iconv (see below for performance comparison).\n\n## Usage\n\n var iconv = require('iconv-lite');\n \n // Convert from an encoded buffer to string.\n str = iconv.decode(buf, 'win1251');\n \n // Convert from string to an encoded buffer.\n buf = iconv.encode(\"Sample input string\", 'win1251');\n\n## Supported encodings\n\n* All node.js native encodings: 'utf8', 'ucs2', 'ascii', 'binary', 'base64'\n* All widespread single byte encodings: Windows 125x family, ISO-8859 family, \n IBM/DOS codepages, Macintosh family, KOI8 family. \n Aliases like 'latin1', 'us-ascii' also supported.\n* Multibyte encodings: 'gbk', 'gb2313', 'Big5', 'cp950'.\n\nOthers are easy to add, see the source. Please, participate.\nMost encodings are generated from node-iconv. Thank you Ben Noordhuis and iconv authors!\n\nNot supported yet: EUC family, Shift_JIS.\n\n\n## Encoding/decoding speed\n\nComparison with node-iconv module (1000x256kb, on Ubuntu 12.04, Core i5/2.5 GHz, Node v0.8.7). \nNote: your results may vary, so please always check on your hardware.\n\n operation iconv@1.2.4 iconv-lite@0.2.4 \n ----------------------------------------------------------\n encode('win1251') ~115 Mb/s ~230 Mb/s\n decode('win1251') ~95 Mb/s ~130 Mb/s\n\n\n## Notes\n\nUntranslatable characters are set to � or ?. No transliteration is currently supported, pull requests are welcome.\n\n## Testing\n\n git clone git@github.com:ashtuchkin/iconv-lite.git\n cd iconv-lite\n npm install\n npm test\n \n # To view performance:\n node test/performance.js\n\n## TODO\n\n* Support streaming character conversion, something like util.pipe(req, iconv.fromEncodingStream('latin1')).\n* Add more encodings.\n* Add transliteration (best fit char).\n* Add tests and correct support of variable-byte encodings (currently work is delegated to node).\n", - "readmeFilename": "README.md", - "_id": "iconv-lite@0.2.8", - "dist": { - "shasum": "30302bd7ab6a9733502fd42405709d43a705bb28" - }, - "_from": "iconv-lite@~0.2.5", - "_resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.2.8.tgz" -} diff --git a/Phaser/node_modules/grunt/node_modules/iconv-lite/test/big5File.txt b/Phaser/node_modules/grunt/node_modules/iconv-lite/test/big5File.txt deleted file mode 100644 index 9c13042c..00000000 --- a/Phaser/node_modules/grunt/node_modules/iconv-lite/test/big5File.txt +++ /dev/null @@ -1,13 +0,0 @@ - - - meta ¼ÐÅÒªº¨Ï¥Î¡G¤¤¤åºô­¶ - - - - -³o¬O¤@­ÓÁcÅ餤¤åºô­¶¡I
    -(This page uses big5 character set.)
    -charset=big5 - - - \ No newline at end of file diff --git a/Phaser/node_modules/grunt/node_modules/iconv-lite/test/gbkFile.txt b/Phaser/node_modules/grunt/node_modules/iconv-lite/test/gbkFile.txt deleted file mode 100644 index 345b5d09..00000000 --- a/Phaser/node_modules/grunt/node_modules/iconv-lite/test/gbkFile.txt +++ /dev/null @@ -1,14 +0,0 @@ -°Ù¶Èһϣ¬Äã¾ÍÖªµÀ - - - - - - - - - - - \ No newline at end of file diff --git a/Phaser/node_modules/grunt/node_modules/js-yaml/HISTORY.md b/Phaser/node_modules/grunt/node_modules/js-yaml/HISTORY.md deleted file mode 100644 index 71205e96..00000000 --- a/Phaser/node_modules/grunt/node_modules/js-yaml/HISTORY.md +++ /dev/null @@ -1,148 +0,0 @@ -2.0.4 / 2013-04-08 ------------------- - -* Updated .npmignore to reduce package size - - -2.0.3 / 2013-02-26 ------------------- - -* Fixed dumping of empty arrays ans objects. ([] and {} instead of null) - - -2.0.2 / 2013-02-15 ------------------- - -* Fixed input validation: tabs are printable characters. - - -2.0.1 / 2013-02-09 ------------------- - -* Fixed error, when options not passed to function cass - - -2.0.0 / 2013-02-09 ------------------- - -* Full rewrite. New architecture. Fast one-stage parsing. -* Changed custom types API. -* Added YAML dumper. - - -1.0.3 / 2012-11-05 ------------------- - -* Fixed utf-8 files loading. - - -1.0.2 / 2012-08-02 ------------------- - -* Pull out hand-written shims. Use ES5-Shims for old browsers support. See #44. -* Fix timstamps incorectly parsed in local time when no time part specified. - - -1.0.1 / 2012-07-07 ------------------- - -* Fixes `TypeError: 'undefined' is not an object` under Safari. Thanks Phuong. -* Fix timestamps incorrectly parsed in local time. Thanks @caolan. Closes #46. - - -1.0.0 / 2012-07-01 ------------------- - -* `y`, `yes`, `n`, `no`, `on`, `off` are not converted to Booleans anymore. - Fixes #42. -* `require(filename)` now returns a single document and throws an Error if - file contains more than one document. -* CLI was merged back from js-yaml.bin - - -0.3.7 / 2012-02-28 ------------------- - -* Fix export of `addConstructor()`. Closes #39. - - -0.3.6 / 2012-02-22 ------------------- - -* Removed AMD parts - too buggy to use. Need help to rewrite from scratch -* Removed YUI compressor warning (renamed `double` variable). Closes #40. - - -0.3.5 / 2012-01-10 ------------------- - -* Workagound for .npmignore fuckup under windows. Thanks to airportyh. - - -0.3.4 / 2011-12-24 ------------------- - -* Fixes str[] for oldIEs support. -* Adds better has change support for browserified demo. -* improves compact output of Error. Closes #33. - - -0.3.3 / 2011-12-20 ------------------- - -* jsyaml executable moved to separate module. -* adds `compact` stringification of Errors. - - -0.3.2 / 2011-12-16 ------------------- - -* Fixes ug with block style scalars. Closes #26. -* All sources are passing JSLint now. -* Fixes bug in Safari. Closes #28. -* Fixes bug in Opers. Closes #29. -* Improves browser support. Closes #20. -* Added jsyaml executable. -* Added !!js/function support. Closes #12. - - -0.3.1 / 2011-11-18 ------------------- - -* Added AMD support for browserified version. -* Wrapped browserified js-yaml into closure. -* Fixed the resolvement of non-specific tags. Closes #17. -* Added permalinks for online demo YAML snippets. Now we have YPaste service, lol. -* Added !!js/regexp and !!js/undefined types. Partially solves #12. -* Fixed !!set mapping. -* Fixed month parse in dates. Closes #19. - - -0.3.0 / 2011-11-09 ------------------- - -* Removed JS.Class dependency. Closes #3. -* Added browserified version. Closes #13. -* Added live demo of browserified version. -* Ported some of the PyYAML tests. See #14. -* Fixed timestamp bug when fraction was given. - - -0.2.2 / 2011-11-06 ------------------- - -* Fixed crash on docs without ---. Closes #8. -* Fixed miltiline string parse -* Fixed tests/comments for using array as key - - -0.2.1 / 2011-11-02 ------------------- - -* Fixed short file read (<4k). Closes #9. - - -0.2.0 / 2011-11-02 ------------------- - -* First public release diff --git a/Phaser/node_modules/grunt/node_modules/js-yaml/LICENSE b/Phaser/node_modules/grunt/node_modules/js-yaml/LICENSE deleted file mode 100644 index 0f16ee95..00000000 --- a/Phaser/node_modules/grunt/node_modules/js-yaml/LICENSE +++ /dev/null @@ -1,21 +0,0 @@ -(The MIT License) - -Copyright (C) 2011, 2013 by Vitaly Puzrin - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. diff --git a/Phaser/node_modules/grunt/node_modules/js-yaml/README.md b/Phaser/node_modules/grunt/node_modules/js-yaml/README.md deleted file mode 100644 index e326d602..00000000 --- a/Phaser/node_modules/grunt/node_modules/js-yaml/README.md +++ /dev/null @@ -1,249 +0,0 @@ -JS-YAML - YAML 1.2 parser and serializer for JavaScript -======================================================= - -[![Build Status](https://secure.travis-ci.org/nodeca/js-yaml.png)](http://travis-ci.org/nodeca/js-yaml) - -[Online Demo](http://nodeca.github.com/js-yaml/) - - -This is an implementation of [YAML](http://yaml.org/), a human friendly data -serialization language. Started as [PyYAML](http://pyyaml.org/) port, it was -completely rewritten from scratch. Now it's very fast, and supports 1.2 spec. - - -Breaking changes in 1.x.x -> 2.0.x ----------------------------------- - -If your have not used __custom__ tags or loader classes - no changes needed. Just -upgrade library and enjoy high parse speed. - -In other case, you should rewrite your tag constructors and custom loader -classes, to conform new schema-based API. See -[examples](https://github.com/nodeca/js-yaml/tree/master/examples) and -[wiki](https://github.com/nodeca/js-yaml/wiki) for details. -Note, that parser internals were completely rewritten. - - -Installation ------------- - -### YAML module for node.js - -``` -npm install js-yaml -``` - - -### CLI executable - -If you want to inspect your YAML files from CLI, install js-yaml globally: - -``` -npm install js-yaml -g -``` - -#### Usage - -``` -usage: js-yaml [-h] [-v] [-c] [-j] [-t] file - -Positional arguments: - file File with YAML document(s) - -Optional arguments: - -h, --help Show this help message and exit. - -v, --version Show program's version number and exit. - -c, --compact Display errors in compact mode - -j, --to-json Output a non-funky boring JSON - -t, --trace Show stack trace on error -``` - - -### Bundled YAML library for browsers - -``` html - - -``` - -Browser support was done mostly for online demo. If you find any errors - feel -free to send pull requests with fixes. Also note, that IE and other old browsers -needs [es5-shims](https://github.com/kriskowal/es5-shim) to operate. - - -API ---- - -Here we cover the most 'useful' methods. If you need advanced details (creating -your own tags), see [wiki](https://github.com/nodeca/js-yaml/wiki) and -[examples](https://github.com/nodeca/js-yaml/tree/master/examples) for more -info. - -In node.js JS-YAML automatically registers handlers for `.yml` and `.yaml` -files. You can load them just with `require`. That's mostly equivalent to -calling `load()` on fetched content of a file. Just with one string! - -``` javascript -require('js-yaml'); - -// Get document, or throw exception on error -try { - var doc = require('/home/ixti/example.yml'); - console.log(doc); -} catch (e) { - console.log(e); -} -``` - - -### load (string [ , options ]) - -Parses `string` as single YAML document. Returns a JavaScript object or throws -`YAMLException` on error. - -NOTE: This function **does not** understands multi-document sources, it throws -exception on those. - -options: - -- `filename` _(default: null)_ - string to be used as a file path in - error/warning messages. -- `strict` _(default - false)_ makes the loader to throw errors instead of - warnings. -- `schema` _(default: `DEFAULT_SCHEMA`)_ - specifies a schema to use. - - -### loadAll (string, iterator [ , options ]) - -Same as `load()`, but understands multi-document sources and apply `iterator` to -each document. - -``` javascript -var yaml = require('js-yaml'); - -yaml.loadAll(data, function (doc) { - console.log(doc); -}); -``` - - -### safeLoad (string [ , options ]) - -Same as `load()` but uses `SAFE_SCHEMA` by default - only recommended tags of -YAML specification (no JavaScript-specific tags, e.g. `!!js/regexp`). - - -### safeLoadAll (string, iterator [ , options ]) - -Same as `loadAll()` but uses `SAFE_SCHEMA` by default - only recommended tags of -YAML specification (no JavaScript-specific tags, e.g. `!!js/regexp`). - - -### dump (object [ , options ]) - -Serializes `object` as YAML document. - -options: - -- `indent` _(default: 2)_ - indentation width to use (in spaces). -- `flowLevel` (default: -1) - specifies level of nesting, when to switch from - block to flow style for collections. -1 means block style everwhere -- `styles` - "tag" => "style" map. Each tag may have own set of styles. -- `schema` _(default: `DEFAULT_SCHEMA`)_ specifies a schema to use. - -styles: - -``` none -!!null - "canonical" => "~" - -!!int - "binary" => "0b1", "0b101010", "0b1110001111010" - "octal" => "01", "052", "016172" - "decimal" => "1", "42", "7290" - "hexadecimal" => "0x1", "0x2A", "0x1C7A" - -!!null, !!bool, !!float - "lowercase" => "null", "true", "false", ".nan", '.inf' - "uppercase" => "NULL", "TRUE", "FALSE", ".NAN", '.INF' - "camelcase" => "Null", "True", "False", ".NaN", '.Inf' -``` - -By default, !!int uses `decimal`, and !!null, !!bool, !!float use `lowercase`. - - -### safeDump (object [ , options ]) - -Same as `dump()` but uses `SAFE_SCHEMA` by default - only recommended tags of -YAML specification (no JavaScript-specific tags, e.g. `!!js/regexp`). - - -Supported YAML types --------------------- - -The list of standard YAML tags and corresponding JavaScipt types. See also -[YAML tag discussion](http://pyyaml.org/wiki/YAMLTagDiscussion) and -[YAML types repository](http://yaml.org/type/). - -``` -!!null '' # null -!!bool 'yes' # bool -!!int '3...' # number -!!float '3.14...' # number -!!binary '...base64...' # buffer -!!timestamp 'YYYY-...' # date -!!omap [ ... ] # array of key-value pairs -!!pairs [ ... ] # array or array pairs -!!set { ... } # array of objects with given keys and null values -!!str '...' # string -!!seq [ ... ] # array -!!map { ... } # object -``` - -**JavaScript-specific tags** - -``` -!!js/regexp /pattern/gim # RegExp -!!js/undefined '' # Undefined -!!js/function 'function () {...}' # Function -``` - - - - -## Caveats - -Note, that you use arrays or objects as key in JS-YAML. JS do not allows objects -or array as keys, and stringifies (by calling .toString method) them at the -moment of adding them. - -``` yaml ---- -? [ foo, bar ] -: - baz -? { foo: bar } -: - baz - - baz -``` - -``` javascript -{ "foo,bar": ["baz"], "[object Object]": ["baz", "baz"] } -``` - -Also, reading of properties on implicit block mapping keys is not supported yet. -So, the following YAML document cannot be loaded. - -``` yaml -&anchor foo: - foo: bar - *anchor: duplicate key - baz: bat - *anchor: duplicate key -``` - -## License - -View the [LICENSE](https://github.com/nodeca/js-yaml/blob/master/LICENSE) file -(MIT). diff --git a/Phaser/node_modules/grunt/node_modules/js-yaml/examples/custom_types.yaml b/Phaser/node_modules/grunt/node_modules/js-yaml/examples/custom_types.yaml deleted file mode 100644 index 033134f5..00000000 --- a/Phaser/node_modules/grunt/node_modules/js-yaml/examples/custom_types.yaml +++ /dev/null @@ -1,18 +0,0 @@ -subject: Custom types in JS-YAML -spaces: -- !space - height: 1000 - width: 1000 - points: - - !point [ 10, 43, 23 ] - - !point [ 165, 0, 50 ] - - !point [ 100, 100, 100 ] - -- !space - height: 64 - width: 128 - points: - - !point [ 12, 43, 0 ] - - !point [ 1, 4, 90 ] - -- !space {} # An empty space diff --git a/Phaser/node_modules/grunt/node_modules/js-yaml/examples/dumper.json b/Phaser/node_modules/grunt/node_modules/js-yaml/examples/dumper.json deleted file mode 100644 index 9f54c053..00000000 --- a/Phaser/node_modules/grunt/node_modules/js-yaml/examples/dumper.json +++ /dev/null @@ -1,22 +0,0 @@ -{ - "name" : "Wizzard", - "level" : 17, - "sanity" : null, - "inventory" : [ - { - "name" : "Hat", - "features" : [ "magic", "pointed" ], - "traits" : {} - }, - { - "name" : "Staff", - "features" : [], - "traits" : { "damage" : 10 } - }, - { - "name" : "Cloak", - "features" : [ "old" ], - "traits" : { "defence" : 0, "comfort" : 3 } - } - ] -} diff --git a/Phaser/node_modules/grunt/node_modules/js-yaml/examples/sample_document.yaml b/Phaser/node_modules/grunt/node_modules/js-yaml/examples/sample_document.yaml deleted file mode 100644 index 4479ee9c..00000000 --- a/Phaser/node_modules/grunt/node_modules/js-yaml/examples/sample_document.yaml +++ /dev/null @@ -1,197 +0,0 @@ ---- -# Collection Types ############################################################# -################################################################################ - -# http://yaml.org/type/map.html -----------------------------------------------# - -map: - # Unordered set of key: value pairs. - Block style: !!map - Clark : Evans - Ingy : döt Net - Oren : Ben-Kiki - Flow style: !!map { Clark: Evans, Ingy: döt Net, Oren: Ben-Kiki } - -# http://yaml.org/type/omap.html ----------------------------------------------# - -omap: - # Explicitly typed ordered map (dictionary). - Bestiary: !!omap - - aardvark: African pig-like ant eater. Ugly. - - anteater: South-American ant eater. Two species. - - anaconda: South-American constrictor snake. Scaly. - # Etc. - # Flow style - Numbers: !!omap [ one: 1, two: 2, three : 3 ] - -# http://yaml.org/type/pairs.html ---------------------------------------------# - -pairs: - # Explicitly typed pairs. - Block tasks: !!pairs - - meeting: with team. - - meeting: with boss. - - break: lunch. - - meeting: with client. - Flow tasks: !!pairs [ meeting: with team, meeting: with boss ] - -# http://yaml.org/type/set.html -----------------------------------------------# - -set: - # Explicitly typed set. - baseball players: !!set - ? Mark McGwire - ? Sammy Sosa - ? Ken Griffey - # Flow style - baseball teams: !!set { Boston Red Sox, Detroit Tigers, New York Yankees } - -# http://yaml.org/type/seq.html -----------------------------------------------# - -seq: - # Ordered sequence of nodes - Block style: !!seq - - Mercury # Rotates - no light/dark sides. - - Venus # Deadliest. Aptly named. - - Earth # Mostly dirt. - - Mars # Seems empty. - - Jupiter # The king. - - Saturn # Pretty. - - Uranus # Where the sun hardly shines. - - Neptune # Boring. No rings. - - Pluto # You call this a planet? - Flow style: !!seq [ Mercury, Venus, Earth, Mars, # Rocks - Jupiter, Saturn, Uranus, Neptune, # Gas - Pluto ] # Overrated - - -# Scalar Types ################################################################# -################################################################################ - -# http://yaml.org/type/binary.html --------------------------------------------# - -binary: - canonical: !!binary "\ - R0lGODlhDAAMAIQAAP//9/X17unp5WZmZgAAAOfn515eXvPz7Y6OjuDg4J+fn5\ - OTk6enp56enmlpaWNjY6Ojo4SEhP/++f/++f/++f/++f/++f/++f/++f/++f/+\ - +f/++f/++f/++f/++f/++SH+Dk1hZGUgd2l0aCBHSU1QACwAAAAADAAMAAAFLC\ - AgjoEwnuNAFOhpEMTRiggcz4BNJHrv/zCFcLiwMWYNG84BwwEeECcgggoBADs=" - generic: !!binary | - R0lGODlhDAAMAIQAAP//9/X17unp5WZmZgAAAOfn515eXvPz7Y6OjuDg4J+fn5 - OTk6enp56enmlpaWNjY6Ojo4SEhP/++f/++f/++f/++f/++f/++f/++f/++f/+ - +f/++f/++f/++f/++f/++SH+Dk1hZGUgd2l0aCBHSU1QACwAAAAADAAMAAAFLC - AgjoEwnuNAFOhpEMTRiggcz4BNJHrv/zCFcLiwMWYNG84BwwEeECcgggoBADs= - description: - The binary value above is a tiny arrow encoded as a gif image. - -# http://yaml.org/type/bool.html ----------------------------------------------# - -bool: - - true - - True - - TRUE - - false - - False - - FALSE - -# http://yaml.org/type/float.html ---------------------------------------------# - -float: - canonical: 6.8523015e+5 - exponentioal: 685.230_15e+03 - fixed: 685_230.15 - sexagesimal: 190:20:30.15 - negative infinity: -.inf - not a number: .NaN - -# http://yaml.org/type/int.html -----------------------------------------------# - -int: - canonical: 685230 - decimal: +685_230 - octal: 02472256 - hexadecimal: 0x_0A_74_AE - binary: 0b1010_0111_0100_1010_1110 - sexagesimal: 190:20:30 - -# http://yaml.org/type/merge.html ---------------------------------------------# - -merge: - - &CENTER { x: 1, y: 2 } - - &LEFT { x: 0, y: 2 } - - &BIG { r: 10 } - - &SMALL { r: 1 } - - # All the following maps are equal: - - - # Explicit keys - x: 1 - y: 2 - r: 10 - label: nothing - - - # Merge one map - << : *CENTER - r: 10 - label: center - - - # Merge multiple maps - << : [ *CENTER, *BIG ] - label: center/big - - - # Override - << : [ *BIG, *LEFT, *SMALL ] - x: 1 - label: big/left/small - -# http://yaml.org/type/null.html ----------------------------------------------# - -null: - # This mapping has four keys, - # one has a value. - empty: - canonical: ~ - english: null - ~: null key - # This sequence has five - # entries, two have values. - sparse: - - ~ - - 2nd entry - - - - 4th entry - - Null - -# http://yaml.org/type/str.html -----------------------------------------------# - -string: abcd - -# http://yaml.org/type/timestamp.html -----------------------------------------# - -timestamp: - canonical: 2001-12-15T02:59:43.1Z - valid iso8601: 2001-12-14t21:59:43.10-05:00 - space separated: 2001-12-14 21:59:43.10 -5 - no time zone (Z): 2001-12-15 2:59:43.10 - date (00:00:00Z): 2002-12-14 - - -# JavaScript Specific Types #################################################### -################################################################################ - -# https://developer.mozilla.org/en/JavaScript/Reference/Global_Objects/RegExp - -regexp: - simple: !!js/regexp foobar - modifiers: !!js/regexp /foobar/mi - -# https://developer.mozilla.org/en/JavaScript/Reference/Global_Objects/undefined - -undefined: !!js/undefined ~ - -# https://developer.mozilla.org/en/JavaScript/Reference/Global_Objects/Function - -function: !!js/function > - function foobar() { - return 'Wow! JS-YAML Rocks!'; - } diff --git a/Phaser/node_modules/grunt/node_modules/js-yaml/node_modules/argparse/HISTORY.md b/Phaser/node_modules/grunt/node_modules/js-yaml/node_modules/argparse/HISTORY.md deleted file mode 100644 index e8d79ced..00000000 --- a/Phaser/node_modules/grunt/node_modules/js-yaml/node_modules/argparse/HISTORY.md +++ /dev/null @@ -1,97 +0,0 @@ -0.1.13 / 2013-05-08 -------------------- - -* Added `.npmignore` to reduce package size - - -0.1.12 / 2013-02-10 -------------------- - -* Fixed conflictHandler (#46), @hpaulj - - -0.1.11 / 2013-02-07 -------------------- - -* Multiple bugfixes, @hpaulj -* Added 70+ tests (ported from python), @hpaulj -* Added conflictHandler, @applepicke -* Added fromfilePrefixChar, @hpaulj - - -0.1.10 / 2012-12-30 -------------------- - -* Added [mutual exclusion](http://docs.python.org/dev/library/argparse.html#mutual-exclusion) - support, thanks to @hpaulj -* Fixed options check for `storeConst` & `appendConst` actions, thanks to @hpaulj - - -0.1.9 / 2012-12-27 ------------------- - -* Fixed option dest interferens with other options (issue #23), thanks to @hpaulj -* Fixed default value behavior with `*` positionals, thanks to @hpaulj -* Improve `getDefault()` behavior, thanks to @hpaulj -* Imrove negative argument parsing, thanks to @hpaulj - - -0.1.8 / 2012-12-01 ------------------- - -* Fixed parser parents (issue #19), thanks to @hpaulj -* Fixed negative argument parse (issue #20), thanks to @hpaulj - - -0.1.7 / 2012-10-14 ------------------- - -* Fixed 'choices' argument parse (issue #16) -* Fixed stderr output (issue #15) - - -0.1.6 / 2012-09-09 ------------------- - -* Fixed check for conflict of options (thanks to @tomxtobin) - - -0.1.5 / 2012-09-03 ------------------- - -* Fix parser #setDefaults method (thanks to @tomxtobin) - - -0.1.4 / 2012-07-30 ------------------- - -* Fixed pseudo-argument support (thanks to @CGamesPlay) -* Fixed addHelp default (should be true), if not set (thanks to @benblank) - - -0.1.3 / 2012-06-27 ------------------- - -* Fixed formatter api name: Formatter -> HelpFormatter - - -0.1.2 / 2012-05-29 ------------------- - -* Added basic tests -* Removed excess whitespace in help -* Fixed error reporting, when parcer with subcommands - called with empty arguments - - -0.1.1 / 2012-05-23 ------------------- - -* Fixed line wrapping in help formatter -* Added better error reporting on invalid arguments - - -0.1.0 / 2012-05-16 ------------------- - -* First release. diff --git a/Phaser/node_modules/grunt/node_modules/js-yaml/node_modules/argparse/LICENSE b/Phaser/node_modules/grunt/node_modules/js-yaml/node_modules/argparse/LICENSE deleted file mode 100644 index 1afdae55..00000000 --- a/Phaser/node_modules/grunt/node_modules/js-yaml/node_modules/argparse/LICENSE +++ /dev/null @@ -1,21 +0,0 @@ -(The MIT License) - -Copyright (C) 2012 by Vitaly Puzrin - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. diff --git a/Phaser/node_modules/grunt/node_modules/js-yaml/node_modules/argparse/README.md b/Phaser/node_modules/grunt/node_modules/js-yaml/node_modules/argparse/README.md deleted file mode 100644 index f20e0c1f..00000000 --- a/Phaser/node_modules/grunt/node_modules/js-yaml/node_modules/argparse/README.md +++ /dev/null @@ -1,239 +0,0 @@ -argparse -======== - -[![Build Status](https://secure.travis-ci.org/nodeca/argparse.png?branch=master)](http://travis-ci.org/nodeca/argparse) - -CLI arguments parser for node.js. Javascript port of python's -[argparse](http://docs.python.org/dev/library/argparse.html) module -(original version 3.2). That's a full port, except some very rare options, -recorded in issue tracker. - -**NB.** Method names changed to camelCase. See [generated docs](http://nodeca.github.com/argparse/). - - -Example -======= - -test.js file: - -```javascript -#!/usr/bin/env node -'use strict'; - -var ArgumentParser = require('../lib/argparse').ArgumentParser; -var parser = new ArgumentParser({ - version: '0.0.1', - addHelp:true, - description: 'Argparse example' -}); -parser.addArgument( - [ '-f', '--foo' ], - { - help: 'foo bar' - } -); -parser.addArgument( - [ '-b', '--bar' ], - { - help: 'bar foo' - } -); -var args = parser.parseArgs(); -console.dir(args); -``` - -Display help: - -``` -$ ./test.js -h -usage: example.js [-h] [-v] [-f FOO] [-b BAR] - -Argparse example - -Optional arguments: - -h, --help Show this help message and exit. - -v, --version Show program's version number and exit. - -f FOO, --foo FOO foo bar - -b BAR, --bar BAR bar foo -``` - -Parse arguments: - -``` -$ ./test.js -f=3 --bar=4 -{ foo: '3', bar: '4' } -``` - -More [examples](https://github.com/nodeca/argparse/tree/master/examples). - - -ArgumentParser objects -====================== - -``` -new ArgumentParser({paramters hash}); -``` - -Creates a new ArgumentParser object. - -**Supported params:** - -- ```description``` - Text to display before the argument help. -- ```epilog``` - Text to display after the argument help. -- ```addHelp``` - Add a -h/–help option to the parser. (default: True) -- ```argumentDefault``` - Set the global default value for arguments. (default: None) -- ```parents``` - A list of ArgumentParser objects whose arguments should also be included. -- ```prefixChars``` - The set of characters that prefix optional arguments. (default: ‘-‘) -- ```formatterClass``` - A class for customizing the help output. -- ```prog``` - The name of the program (default: sys.argv[0]) -- ```usage``` - The string describing the program usage (default: generated) -- ```conflictHandler``` - Usually unnecessary, defines strategy for resolving conflicting optionals. - -**Not supportied yet** - -- ```fromfilePrefixChars``` - The set of characters that prefix files from which additional arguments should be read. - - -Details in [original ArgumentParser guide](http://docs.python.org/dev/library/argparse.html#argumentparser-objects) - - -addArgument() method -==================== - -``` -ArgumentParser.addArgument([names or flags], {options}) -``` - -Defines how a single command-line argument should be parsed. - -- ```name or flags``` - Either a name or a list of option strings, e.g. foo or -f, --foo. - -Options: - -- ```action``` - The basic type of action to be taken when this argument is encountered at the command line. -- ```nargs```- The number of command-line arguments that should be consumed. -- ```constant``` - A constant value required by some action and nargs selections. -- ```defaultValue``` - The value produced if the argument is absent from the command line. -- ```type``` - The type to which the command-line argument should be converted. -- ```choices``` - A container of the allowable values for the argument. -- ```required``` - Whether or not the command-line option may be omitted (optionals only). -- ```help``` - A brief description of what the argument does. -- ```metavar``` - A name for the argument in usage messages. -- ```dest``` - The name of the attribute to be added to the object returned by parseArgs(). - -Details in [original add_argument guide](http://docs.python.org/dev/library/argparse.html#the-add-argument-method) - - -Action (some details) -================ - -ArgumentParser objects associate command-line arguments with actions. -These actions can do just about anything with the command-line arguments associated -with them, though most actions simply add an attribute to the object returned by -parseArgs(). The action keyword argument specifies how the command-line arguments -should be handled. The supported actions are: - -- ```store``` - Just stores the argument’s value. This is the default action. -- ```storeConst``` - Stores value, specified by the const keyword argument. - (Note that the const keyword argument defaults to the rather unhelpful None.) - The 'storeConst' action is most commonly used with optional arguments, that - specify some sort of flag. -- ```storeTrue``` and ```storeFalse``` - Stores values True and False - respectively. These are special cases of 'storeConst'. -- ```append``` - Stores a list, and appends each argument value to the list. - This is useful to allow an option to be specified multiple times. -- ```appendConst``` - Stores a list, and appends value, specified by the - const keyword argument to the list. (Note, that the const keyword argument defaults - is None.) The 'appendConst' action is typically used when multiple arguments need - to store constants to the same list. -- ```count``` - Counts the number of times a keyword argument occurs. For example, - used for increasing verbosity levels. -- ```help``` - Prints a complete help message for all the options in the current - parser and then exits. By default a help action is automatically added to the parser. - See ArgumentParser for details of how the output is created. -- ```version``` - Prints version information and exit. Expects a `version=` - keyword argument in the addArgument() call. - -Details in [original action guide](http://docs.python.org/dev/library/argparse.html#action) - - -Sub-commands -============ - -ArgumentParser.addSubparsers() - -Many programs split their functionality into a number of sub-commands, for -example, the svn program can invoke sub-commands like `svn checkout`, `svn update`, -and `svn commit`. Splitting up functionality this way can be a particularly good -idea when a program performs several different functions which require different -kinds of command-line arguments. `ArgumentParser` supports creation of such -sub-commands with `addSubparsers()` method. The `addSubparsers()` method is -normally called with no arguments and returns an special action object. -This object has a single method `addParser()`, which takes a command name and -any `ArgumentParser` constructor arguments, and returns an `ArgumentParser` object -that can be modified as usual. - -Example: - -sub_commands.js -```javascript -#!/usr/bin/env node -'use strict'; - -var ArgumentParser = require('../lib/argparse').ArgumentParser; -var parser = new ArgumentParser({ - version: '0.0.1', - addHelp:true, - description: 'Argparse examples: sub-commands', -}); - -var subparsers = parser.addSubparsers({ - title:'subcommands', - dest:"subcommand_name" -}); - -var bar = subparsers.addParser('c1', {addHelp:true}); -bar.addArgument( - [ '-f', '--foo' ], - { - action: 'store', - help: 'foo3 bar3' - } -); -var bar = subparsers.addParser( - 'c2', - {aliases:['co'], addHelp:true} -); -bar.addArgument( - [ '-b', '--bar' ], - { - action: 'store', - type: 'int', - help: 'foo3 bar3' - } -); - -var args = parser.parseArgs(); -console.dir(args); - -``` - -Details in [original sub-commands guide](http://docs.python.org/dev/library/argparse.html#sub-commands) - - -Contributors -============ - -- [Eugene Shkuropat](https://github.com/shkuropat) -- [Paul Jacobson](https://github.com/hpaulj) - -[others](https://github.com/nodeca/argparse/graphs/contributors) - -License -======= - -Copyright (c) 2012 [Vitaly Puzrin](https://github.com/puzrin). -Released under the MIT license. See -[LICENSE](https://github.com/nodeca/argparse/blob/master/LICENSE) for details. - - diff --git a/Phaser/node_modules/grunt/node_modules/js-yaml/node_modules/argparse/node_modules/underscore.string/.travis.yml b/Phaser/node_modules/grunt/node_modules/js-yaml/node_modules/argparse/node_modules/underscore.string/.travis.yml deleted file mode 100644 index ab27b29b..00000000 --- a/Phaser/node_modules/grunt/node_modules/js-yaml/node_modules/argparse/node_modules/underscore.string/.travis.yml +++ /dev/null @@ -1,8 +0,0 @@ -language: ruby -rvm: - - 1.9.3 - -before_script: - - "export DISPLAY=:99.0" - - "sh -e /etc/init.d/xvfb start" - - sleep 2 \ No newline at end of file diff --git a/Phaser/node_modules/grunt/node_modules/js-yaml/node_modules/argparse/node_modules/underscore.string/Gemfile b/Phaser/node_modules/grunt/node_modules/js-yaml/node_modules/argparse/node_modules/underscore.string/Gemfile deleted file mode 100644 index 8ebff7ec..00000000 --- a/Phaser/node_modules/grunt/node_modules/js-yaml/node_modules/argparse/node_modules/underscore.string/Gemfile +++ /dev/null @@ -1,4 +0,0 @@ -source :rubygems - -gem 'uglifier' -gem 'rake' \ No newline at end of file diff --git a/Phaser/node_modules/grunt/node_modules/js-yaml/node_modules/argparse/node_modules/underscore.string/Gemfile.lock b/Phaser/node_modules/grunt/node_modules/js-yaml/node_modules/argparse/node_modules/underscore.string/Gemfile.lock deleted file mode 100644 index c41e4a73..00000000 --- a/Phaser/node_modules/grunt/node_modules/js-yaml/node_modules/argparse/node_modules/underscore.string/Gemfile.lock +++ /dev/null @@ -1,17 +0,0 @@ -GEM - remote: http://rubygems.org/ - specs: - execjs (1.4.0) - multi_json (~> 1.0) - multi_json (1.3.6) - rake (0.9.2.2) - uglifier (1.3.0) - execjs (>= 0.3.0) - multi_json (~> 1.0, >= 1.0.2) - -PLATFORMS - ruby - -DEPENDENCIES - rake - uglifier diff --git a/Phaser/node_modules/grunt/node_modules/js-yaml/node_modules/argparse/node_modules/underscore.string/README.markdown b/Phaser/node_modules/grunt/node_modules/js-yaml/node_modules/argparse/node_modules/underscore.string/README.markdown deleted file mode 100644 index fc884984..00000000 --- a/Phaser/node_modules/grunt/node_modules/js-yaml/node_modules/argparse/node_modules/underscore.string/README.markdown +++ /dev/null @@ -1,744 +0,0 @@ -# Underscore.string [![Build Status](https://secure.travis-ci.org/epeli/underscore.string.png?branch=master)](http://travis-ci.org/epeli/underscore.string) # - - - -Javascript lacks complete string manipulation operations. -This an attempt to fill that gap. List of build-in methods can be found -for example from [Dive Into JavaScript][d]. - -[d]: http://www.diveintojavascript.com/core-javascript-reference/the-string-object - - -As name states this an extension for [Underscore.js][u], but it can be used -independently from **_s**-global variable. But with Underscore.js you can -use Object-Oriented style and chaining: - -[u]: http://documentcloud.github.com/underscore/ - -```javascript -_(" epeli ").chain().trim().capitalize().value() -=> "Epeli" -``` - -## Download ## - - * [Development version](https://raw.github.com/epeli/underscore.string/master/lib/underscore.string.js) *Uncompressed with Comments 18kb* - * [Production version](https://github.com/epeli/underscore.string/raw/master/dist/underscore.string.min.js) *Minified 7kb* - - -## Node.js installation ## - -**npm package** - - npm install underscore.string - -**Standalone usage**: - -```javascript -var _s = require('underscore.string'); -``` - -**Integrate with Underscore.js**: - -```javascript -var _ = require('underscore'); - -// Import Underscore.string to separate object, because there are conflict functions (include, reverse, contains) -_.str = require('underscore.string'); - -// Mix in non-conflict functions to Underscore namespace if you want -_.mixin(_.str.exports()); - -// All functions, include conflict, will be available through _.str object -_.str.include('Underscore.string', 'string'); // => true -``` - -## String Functions ## - -For availability of functions in this way you need to mix in Underscore.string functions: - -```javascript -_.mixin(_.string.exports()); -``` - -otherwise functions from examples will be available through _.string or _.str objects: - -```javascript -_.str.capitalize('epeli') -=> "Epeli" -``` - -**numberFormat** _.numberFormat(number, [ decimals=0, decimalSeparator='.', orderSeparator=',']) - -Formats the numbers. - -```javascript -_.numberFormat(1000, 2) -=> "1,000.00" - -_.numberFormat(123456789.123, 5, '.', ',') -=> "123,456,789.12300" -``` - - -**levenshtein** _.levenshtein(string1, string2) - -Calculates [Levenshtein distance][ld] between two strings. -[ld]: http://en.wikipedia.org/wiki/Levenshtein_distance - -```javascript -_.levenshtein('kitten', 'kittah') -=> 2 -``` - -**capitalize** _.capitalize(string) - -Converts first letter of the string to uppercase. - -```javascript -_.capitalize("foo Bar") -=> "Foo Bar" -``` - -**chop** _.chop(string, step) - -```javascript -_.chop('whitespace', 3) -=> ['whi','tes','pac','e'] -``` - -**clean** _.clean(str) - -Compress some whitespaces to one. - -```javascript -_.clean(" foo bar ") -=> 'foo bar' -``` - -**chars** _.chars(str) - -```javascript -_.chars('Hello') -=> ['H','e','l','l','o'] -``` - -**swapCase** _.swapCase(str) - -Returns a copy of the string in which all the case-based characters have had their case swapped. - -```javascript -_.swapCase('hELLO') -=> 'Hello' -``` - -**include** available only through _.str object, because Underscore has function with the same name. - -```javascript -_.str.include("foobar", "ob") -=> true -``` - -(removed) **includes** _.includes(string, substring) - -Tests if string contains a substring. - -```javascript -_.includes("foobar", "ob") -=> true -``` - -**includes** function was removed - -But you can create it in this way, for compatibility with previous versions: - -```javascript -_.includes = _.str.include -``` - -**count** _.count(string, substring) - -```javascript -_('Hello world').count('l') -=> 3 -``` - -**escapeHTML** _.escapeHTML(string) - -Converts HTML special characters to their entity equivalents. - -```javascript -_('
    Blah blah blah
    ').escapeHTML(); -=> '<div>Blah blah blah</div>' -``` - -**unescapeHTML** _.unescapeHTML(string) - -Converts entity characters to HTML equivalents. - -```javascript -_('<div>Blah blah blah</div>').unescapeHTML(); -=> '
    Blah blah blah
    ' -``` - -**insert** _.insert(string, index, substing) - -```javascript -_('Hello ').insert(6, 'world') -=> 'Hello world' -``` - -**isBlank** _.isBlank(string) - -```javascript -_('').isBlank(); // => true -_('\n').isBlank(); // => true -_(' ').isBlank(); // => true -_('a').isBlank(); // => false -``` - -**join** _.join(separator, *strings) - -Joins strings together with given separator - -```javascript -_.join(" ", "foo", "bar") -=> "foo bar" -``` - -**lines** _.lines(str) - -```javascript -_.lines("Hello\nWorld") -=> ["Hello", "World"] -``` - -**reverse** available only through _.str object, because Underscore has function with the same name. - -Return reversed string: - -```javascript -_.str.reverse("foobar") -=> 'raboof' -``` - -**splice** _.splice(string, index, howmany, substring) - -Like a array splice. - -```javascript -_('https://edtsech@bitbucket.org/edtsech/underscore.strings').splice(30, 7, 'epeli') -=> 'https://edtsech@bitbucket.org/epeli/underscore.strings' -``` - -**startsWith** _.startsWith(string, starts) - -This method checks whether string starts with starts. - -```javascript -_("image.gif").startsWith("image") -=> true -``` - -**endsWith** _.endsWith(string, ends) - -This method checks whether string ends with ends. - -```javascript -_("image.gif").endsWith("gif") -=> true -``` - -**succ** _.succ(str) - -Returns the successor to str. - -```javascript -_('a').succ() -=> 'b' - -_('A').succ() -=> 'B' -``` - -**supplant** - -Supplant function was removed, use Underscore.js [template function][p]. - -[p]: http://documentcloud.github.com/underscore/#template - -**strip** alias for *trim* - -**lstrip** alias for *ltrim* - -**rstrip** alias for *rtrim* - -**titleize** _.titleize(string) - -```javascript -_('my name is epeli').titleize() -=> 'My Name Is Epeli' -``` - -**camelize** _.camelize(string) - -Converts underscored or dasherized string to a camelized one - -```javascript -_('-moz-transform').camelize() -=> 'MozTransform' -``` - -**classify** _.classify(string) - -Converts string to camelized class name - -```javascript -_('some_class_name').classify() -=> 'SomeClassName' -``` - -**underscored** _.underscored(string) - -Converts a camelized or dasherized string into an underscored one - -```javascript -_('MozTransform').underscored() -=> 'moz_transform' -``` - -**dasherize** _.dasherize(string) - -Converts a underscored or camelized string into an dasherized one - -```javascript -_('MozTransform').dasherize() -=> '-moz-transform' -``` - -**humanize** _.humanize(string) - -Converts an underscored, camelized, or dasherized string into a humanized one. -Also removes beginning and ending whitespace, and removes the postfix '_id'. - -```javascript -_(' capitalize dash-CamelCase_underscore trim ').humanize() -=> 'Capitalize dash camel case underscore trim' -``` - -**trim** _.trim(string, [characters]) - -trims defined characters from begining and ending of the string. -Defaults to whitespace characters. - -```javascript -_.trim(" foobar ") -=> "foobar" - -_.trim("_-foobar-_", "_-") -=> "foobar" -``` - - -**ltrim** _.ltrim(string, [characters]) - -Left trim. Similar to trim, but only for left side. - - -**rtrim** _.rtrim(string, [characters]) - -Right trim. Similar to trim, but only for right side. - -**truncate** _.truncate(string, length, truncateString) - -```javascript -_('Hello world').truncate(5) -=> 'Hello...' - -_('Hello').truncate(10) -=> 'Hello' -``` - -**prune** _.prune(string, length, pruneString) - -Elegant version of truncate. -Makes sure the pruned string does not exceed the original length. -Avoid half-chopped words when truncating. - -```javascript -_('Hello, world').prune(5) -=> 'Hello...' - -_('Hello, world').prune(8) -=> 'Hello...' - -_('Hello, world').prune(5, ' (read a lot more)') -=> 'Hello, world' (as adding "(read a lot more)" would be longer than the original string) - -_('Hello, cruel world').prune(15) -=> 'Hello, cruel...' - -_('Hello').prune(10) -=> 'Hello' -``` - -**words** _.words(str, delimiter=/\s+/) - -Split string by delimiter (String or RegExp), /\s+/ by default. - -```javascript -_.words(" I love you ") -=> ["I","love","you"] - -_.words("I_love_you", "_") -=> ["I","love","you"] - -_.words("I-love-you", /-/) -=> ["I","love","you"] - -_.words(" ") -=> [] -``` - -**sprintf** _.sprintf(string format, *arguments) - -C like string formatting. -Credits goes to [Alexandru Marasteanu][o]. -For more detailed documentation, see the [original page][o]. - -[o]: http://www.diveintojavascript.com/projects/sprintf-for-javascript - -```javascript -_.sprintf("%.1f", 1.17) -"1.2" -``` - -**pad** _.pad(str, length, [padStr, type]) - -pads the `str` with characters until the total string length is equal to the passed `length` parameter. By default, pads on the **left** with the space char (`" "`). `padStr` is truncated to a single character if necessary. - -```javascript -_.pad("1", 8) --> " 1"; - -_.pad("1", 8, '0') --> "00000001"; - -_.pad("1", 8, '0', 'right') --> "10000000"; - -_.pad("1", 8, '0', 'both') --> "00001000"; - -_.pad("1", 8, 'bleepblorp', 'both') --> "bbbb1bbb"; -``` - -**lpad** _.lpad(str, length, [padStr]) - -left-pad a string. Alias for `pad(str, length, padStr, 'left')` - -```javascript -_.lpad("1", 8, '0') --> "00000001"; -``` - -**rpad** _.rpad(str, length, [padStr]) - -right-pad a string. Alias for `pad(str, length, padStr, 'right')` - -```javascript -_.rpad("1", 8, '0') --> "10000000"; -``` - -**lrpad** _.lrpad(str, length, [padStr]) - -left/right-pad a string. Alias for `pad(str, length, padStr, 'both')` - -```javascript -_.lrpad("1", 8, '0') --> "00001000"; -``` - -**center** alias for **lrpad** - -**ljust** alias for *rpad* - -**rjust** alias for *lpad* - -**toNumber** _.toNumber(string, [decimals]) - -Parse string to number. Returns NaN if string can't be parsed to number. - -```javascript -_('2.556').toNumber() -=> 3 - -_('2.556').toNumber(1) -=> 2.6 -``` - -**strRight** _.strRight(string, pattern) - -Searches a string from left to right for a pattern and returns a substring consisting of the characters in the string that are to the right of the pattern or all string if no match found. - -```javascript -_('This_is_a_test_string').strRight('_') -=> "is_a_test_string"; -``` - -**strRightBack** _.strRightBack(string, pattern) - -Searches a string from right to left for a pattern and returns a substring consisting of the characters in the string that are to the right of the pattern or all string if no match found. - -```javascript -_('This_is_a_test_string').strRightBack('_') -=> "string"; -``` - -**strLeft** _.strLeft(string, pattern) - -Searches a string from left to right for a pattern and returns a substring consisting of the characters in the string that are to the left of the pattern or all string if no match found. - -```javascript -_('This_is_a_test_string').strLeft('_') -=> "This"; -``` - -**strLeftBack** _.strLeftBack(string, pattern) - -Searches a string from right to left for a pattern and returns a substring consisting of the characters in the string that are to the left of the pattern or all string if no match found. - -```javascript -_('This_is_a_test_string').strLeftBack('_') -=> "This_is_a_test"; -``` - -**stripTags** - -Removes all html tags from string. - -```javascript -_('a link').stripTags() -=> 'a link' - -_('a link').stripTags() -=> 'a linkalert("hello world!")' -``` - -**toSentence** _.toSentence(array, [delimiter, lastDelimiter]) - -Join an array into a human readable sentence. - -```javascript -_.toSentence(['jQuery', 'Mootools', 'Prototype']) -=> 'jQuery, Mootools and Prototype'; - -_.toSentence(['jQuery', 'Mootools', 'Prototype'], ', ', ' unt ') -=> 'jQuery, Mootools unt Prototype'; -``` - -**toSentenceSerial** _.toSentenceSerial(array, [delimiter, lastDelimiter]) - -The same as `toSentence`, but adjusts delimeters to use [Serial comma](http://en.wikipedia.org/wiki/Serial_comma). - -```javascript -_.toSentenceSerial(['jQuery', 'Mootools']) -=> 'jQuery and Mootools'; - -_.toSentenceSerial(['jQuery', 'Mootools', 'Prototype']) -=> 'jQuery, Mootools, and Prototype' - -_.toSentenceSerial(['jQuery', 'Mootools', 'Prototype'], ', ', ' unt '); -=> 'jQuery, Mootools, unt Prototype'; -``` - -**repeat** _.repeat(string, count, [separator]) - -Repeats a string count times. - -```javascript -_.repeat("foo", 3) -=> 'foofoofoo'; - -_.repeat("foo", 3, "bar") -=> 'foobarfoobarfoo' -``` - -**surround** _.surround(string, wrap) - -Surround a string with another string. - -```javascript -_.surround("foo", "ab") -=> 'abfooab'; -``` - -**quote** _.quote(string) or _.q(string) - -Quotes a string. - -```javascript -_.quote('foo') -=> '"foo"'; -``` - - -**slugify** _.slugify(string) - -Transform text into a URL slug. Replaces whitespaces, accentuated, and special characters with a dash. - -```javascript -_.slugify("Un éléphant à l'orée du bois") -=> 'un-elephant-a-loree-du-bois'; -``` - -***Caution: this function is charset dependent*** - -## Roadmap ## - -Any suggestions or bug reports are welcome. Just email me or more preferably open an issue. - -#### Problems - -We lose two things for `include` and `reverse` methods from `_.string`: - -* Calls like `_('foobar').include('bar')` aren't available; -* Chaining isn't available too. - -But if you need this functionality you can create aliases for conflict functions which will be convenient for you: - -```javascript -_.mixin({ - includeString: _.str.include, - reverseString: _.str.reverse -}) - -// Now wrapper calls and chaining are available. -_('foobar').chain().reverseString().includeString('rab').value() -``` - -#### Standalone Usage - -If you are using Underscore.string without Underscore. You also have `_.string` namespace for it and `_.str` alias -But of course you can just reassign `_` variable with `_.string` - -```javascript -_ = _.string -``` - -## Changelog ## - -### 2.3.1 ### - -* Changed integration logic, now trying everything in order -* Fixed classify method to chew some unexpected input -* Fixed toNumber method failing to recognize '0.0' as a proper number - - -### 2.3.0 ### - -* Added `numberformat` method -* Added `levenshtein` method (Levenshtein distance calculation) -* Added `swapCase` method -* Changed default behavior of `words` method -* Added `toSentenceSerial` method -* Added `surround` and `quote` methods - -### 2.2.0 ### - -* Capitalize method behavior changed -* Various perfomance tweaks - -### 2.1.1### - -* Fixed words method bug -* Added classify method - -### 2.1.0 ### - -* AMD support -* Added toSentence method -* Added slugify method -* Lots of speed optimizations - -### 2.0.0 ### - -* Added prune, humanize functions -* Added _.string (_.str) namespace for Underscore.string library -* Removed includes function - -For upgrading to this version you need to mix in Underscore.string library to Underscore object: - -```javascript -_.mixin(_.string.exports()); -``` - -and all non-conflict Underscore.string functions will be available through Underscore object. -Also function `includes` has been removed, you should replace this function by `_.str.include` -or create alias `_.includes = _.str.include` and all your code will work fine. - -### 1.1.6 ### - -* Fixed reverse and truncate -* Added isBlank, stripTags, inlude(alias for includes) -* Added uglifier compression - -### 1.1.5 ### - -* Added strRight, strRightBack, strLeft, strLeftBack - -### 1.1.4 ### - -* Added pad, lpad, rpad, lrpad methods and aliases center, ljust, rjust -* Integration with Underscore 1.1.6 - -### 1.1.3 ### - -* Added methods: underscored, camelize, dasherize -* Support newer version of npm - -### 1.1.2 ### - -* Created functions: lines, chars, words functions - -### 1.0.2 ### - -* Created integration test suite with underscore.js 1.1.4 (now it's absolutely compatible) -* Removed 'reverse' function, because this function override underscore.js 'reverse' - -## Contribute ## - -* Fork & pull request. Don't forget about tests. -* If you planning add some feature please create issue before. - -Otherwise changes will be rejected. - -## Contributors list ## -[Can be found here](https://github.com/epeli/underscore.string/graphs/contributors). - - -## Licence ## - -The MIT License - -Copyright (c) 2011 Esa-Matti Suuronen esa-matti@suuronen.org - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. diff --git a/Phaser/node_modules/grunt/node_modules/js-yaml/node_modules/argparse/node_modules/underscore.string/Rakefile b/Phaser/node_modules/grunt/node_modules/js-yaml/node_modules/argparse/node_modules/underscore.string/Rakefile deleted file mode 100644 index 587c81b7..00000000 --- a/Phaser/node_modules/grunt/node_modules/js-yaml/node_modules/argparse/node_modules/underscore.string/Rakefile +++ /dev/null @@ -1,23 +0,0 @@ -# encoding: utf-8 -task default: :test - -desc 'Use UglifyJS to compress Underscore.string' -task :build do - require 'uglifier' - source = File.read('lib/underscore.string.js') - compressed = Uglifier.compile(source, copyright: false) - File.open('dist/underscore.string.min.js', 'w'){ |f| f.write compressed } - compression_rate = compressed.length.to_f/source.length - puts "compressed dist/underscore.string.min.js: #{compressed.length}/#{source.length} #{(compression_rate * 100).round}%" -end - -desc 'Run tests' -task :test do - puts "Running underscore.string test suite." - result1 = system %{phantomjs ./test/run-qunit.js "test/test.html"} - - puts "Running Underscore test suite." - result2 = system %{phantomjs ./test/run-qunit.js "test/test_underscore/index.html"} - - exit(result1 && result2 ? 0 : 1) -end \ No newline at end of file diff --git a/Phaser/node_modules/grunt/node_modules/js-yaml/node_modules/argparse/node_modules/underscore.string/package.json b/Phaser/node_modules/grunt/node_modules/js-yaml/node_modules/argparse/node_modules/underscore.string/package.json deleted file mode 100644 index 51f52829..00000000 --- a/Phaser/node_modules/grunt/node_modules/js-yaml/node_modules/argparse/node_modules/underscore.string/package.json +++ /dev/null @@ -1,77 +0,0 @@ -{ - "name": "underscore.string", - "version": "2.3.1", - "description": "String manipulation extensions for Underscore.js javascript library.", - "homepage": "http://epeli.github.com/underscore.string/", - "contributors": [ - { - "name": "Esa-Matti Suuronen", - "email": "esa-matti@suuronen.org", - "url": "http://esa-matti.suuronen.org/" - }, - { - "name": "Edward Tsech", - "email": "edtsech@gmail.com" - }, - { - "name": "Pavel Pravosud", - "email": "pavel@pravosud.com", - "url": "" - }, - { - "name": "Sasha Koss", - "email": "kossnocorp@gmail.com", - "url": "http://koss.nocorp.me/" - }, - { - "name": "Vladimir Dronnikov", - "email": "dronnikov@gmail.com" - }, - { - "name": "Pete Kruckenberg", - "email": "https://github.com/kruckenb", - "url": "" - }, - { - "name": "Paul Chavard", - "email": "paul@chavard.net", - "url": "" - }, - { - "name": "Ed Finkler", - "email": "coj@funkatron.com", - "url": "" - } - ], - "keywords": [ - "underscore", - "string" - ], - "main": "./lib/underscore.string", - "directories": { - "lib": "./lib" - }, - "engines": { - "node": "*" - }, - "repository": { - "type": "git", - "url": "https://github.com/epeli/underscore.string.git" - }, - "bugs": { - "url": "https://github.com/epeli/underscore.string/issues" - }, - "licenses": [ - { - "type": "MIT" - } - ], - "readme": "# Underscore.string [![Build Status](https://secure.travis-ci.org/epeli/underscore.string.png?branch=master)](http://travis-ci.org/epeli/underscore.string) #\n\n\n\nJavascript lacks complete string manipulation operations.\nThis an attempt to fill that gap. List of build-in methods can be found\nfor example from [Dive Into JavaScript][d].\n\n[d]: http://www.diveintojavascript.com/core-javascript-reference/the-string-object\n\n\nAs name states this an extension for [Underscore.js][u], but it can be used\nindependently from **_s**-global variable. But with Underscore.js you can\nuse Object-Oriented style and chaining:\n\n[u]: http://documentcloud.github.com/underscore/\n\n```javascript\n_(\" epeli \").chain().trim().capitalize().value()\n=> \"Epeli\"\n```\n\n## Download ##\n\n * [Development version](https://raw.github.com/epeli/underscore.string/master/lib/underscore.string.js) *Uncompressed with Comments 18kb*\n * [Production version](https://github.com/epeli/underscore.string/raw/master/dist/underscore.string.min.js) *Minified 7kb*\n\n\n## Node.js installation ##\n\n**npm package**\n\n npm install underscore.string\n\n**Standalone usage**:\n\n```javascript\nvar _s = require('underscore.string');\n```\n\n**Integrate with Underscore.js**:\n\n```javascript\nvar _ = require('underscore');\n\n// Import Underscore.string to separate object, because there are conflict functions (include, reverse, contains)\n_.str = require('underscore.string');\n\n// Mix in non-conflict functions to Underscore namespace if you want\n_.mixin(_.str.exports());\n\n// All functions, include conflict, will be available through _.str object\n_.str.include('Underscore.string', 'string'); // => true\n```\n\n## String Functions ##\n\nFor availability of functions in this way you need to mix in Underscore.string functions:\n\n```javascript\n_.mixin(_.string.exports());\n```\n\notherwise functions from examples will be available through _.string or _.str objects:\n\n```javascript\n_.str.capitalize('epeli')\n=> \"Epeli\"\n```\n\n**numberFormat** _.numberFormat(number, [ decimals=0, decimalSeparator='.', orderSeparator=','])\n\nFormats the numbers.\n\n```javascript\n_.numberFormat(1000, 2)\n=> \"1,000.00\"\n\n_.numberFormat(123456789.123, 5, '.', ',')\n=> \"123,456,789.12300\"\n```\n\n\n**levenshtein** _.levenshtein(string1, string2)\n\nCalculates [Levenshtein distance][ld] between two strings.\n[ld]: http://en.wikipedia.org/wiki/Levenshtein_distance\n\n```javascript\n_.levenshtein('kitten', 'kittah')\n=> 2\n```\n\n**capitalize** _.capitalize(string)\n\nConverts first letter of the string to uppercase.\n\n```javascript\n_.capitalize(\"foo Bar\")\n=> \"Foo Bar\"\n```\n\n**chop** _.chop(string, step)\n\n```javascript\n_.chop('whitespace', 3)\n=> ['whi','tes','pac','e']\n```\n\n**clean** _.clean(str)\n\nCompress some whitespaces to one.\n\n```javascript\n_.clean(\" foo bar \")\n=> 'foo bar'\n```\n\n**chars** _.chars(str)\n\n```javascript\n_.chars('Hello')\n=> ['H','e','l','l','o']\n```\n\n**swapCase** _.swapCase(str)\n\nReturns a copy of the string in which all the case-based characters have had their case swapped.\n\n```javascript\n_.swapCase('hELLO')\n=> 'Hello'\n```\n\n**include** available only through _.str object, because Underscore has function with the same name.\n\n```javascript\n_.str.include(\"foobar\", \"ob\")\n=> true\n```\n\n(removed) **includes** _.includes(string, substring)\n\nTests if string contains a substring.\n\n```javascript\n_.includes(\"foobar\", \"ob\")\n=> true\n```\n\n**includes** function was removed\n\nBut you can create it in this way, for compatibility with previous versions:\n\n```javascript\n_.includes = _.str.include\n```\n\n**count** _.count(string, substring)\n\n```javascript\n_('Hello world').count('l')\n=> 3\n```\n\n**escapeHTML** _.escapeHTML(string)\n\nConverts HTML special characters to their entity equivalents.\n\n```javascript\n_('
    Blah blah blah
    ').escapeHTML();\n=> '<div>Blah blah blah</div>'\n```\n\n**unescapeHTML** _.unescapeHTML(string)\n\nConverts entity characters to HTML equivalents.\n\n```javascript\n_('<div>Blah blah blah</div>').unescapeHTML();\n=> '
    Blah blah blah
    '\n```\n\n**insert** _.insert(string, index, substing)\n\n```javascript\n_('Hello ').insert(6, 'world')\n=> 'Hello world'\n```\n\n**isBlank** _.isBlank(string)\n\n```javascript\n_('').isBlank(); // => true\n_('\\n').isBlank(); // => true\n_(' ').isBlank(); // => true\n_('a').isBlank(); // => false\n```\n\n**join** _.join(separator, *strings)\n\nJoins strings together with given separator\n\n```javascript\n_.join(\" \", \"foo\", \"bar\")\n=> \"foo bar\"\n```\n\n**lines** _.lines(str)\n\n```javascript\n_.lines(\"Hello\\nWorld\")\n=> [\"Hello\", \"World\"]\n```\n\n**reverse** available only through _.str object, because Underscore has function with the same name.\n\nReturn reversed string:\n\n```javascript\n_.str.reverse(\"foobar\")\n=> 'raboof'\n```\n\n**splice** _.splice(string, index, howmany, substring)\n\nLike a array splice.\n\n```javascript\n_('https://edtsech@bitbucket.org/edtsech/underscore.strings').splice(30, 7, 'epeli')\n=> 'https://edtsech@bitbucket.org/epeli/underscore.strings'\n```\n\n**startsWith** _.startsWith(string, starts)\n\nThis method checks whether string starts with starts.\n\n```javascript\n_(\"image.gif\").startsWith(\"image\")\n=> true\n```\n\n**endsWith** _.endsWith(string, ends)\n\nThis method checks whether string ends with ends.\n\n```javascript\n_(\"image.gif\").endsWith(\"gif\")\n=> true\n```\n\n**succ** _.succ(str)\n\nReturns the successor to str.\n\n```javascript\n_('a').succ()\n=> 'b'\n\n_('A').succ()\n=> 'B'\n```\n\n**supplant**\n\nSupplant function was removed, use Underscore.js [template function][p].\n\n[p]: http://documentcloud.github.com/underscore/#template\n\n**strip** alias for *trim*\n\n**lstrip** alias for *ltrim*\n\n**rstrip** alias for *rtrim*\n\n**titleize** _.titleize(string)\n\n```javascript\n_('my name is epeli').titleize()\n=> 'My Name Is Epeli'\n```\n\n**camelize** _.camelize(string)\n\nConverts underscored or dasherized string to a camelized one\n\n```javascript\n_('-moz-transform').camelize()\n=> 'MozTransform'\n```\n\n**classify** _.classify(string)\n\nConverts string to camelized class name\n\n```javascript\n_('some_class_name').classify()\n=> 'SomeClassName'\n```\n\n**underscored** _.underscored(string)\n\nConverts a camelized or dasherized string into an underscored one\n\n```javascript\n_('MozTransform').underscored()\n=> 'moz_transform'\n```\n\n**dasherize** _.dasherize(string)\n\nConverts a underscored or camelized string into an dasherized one\n\n```javascript\n_('MozTransform').dasherize()\n=> '-moz-transform'\n```\n\n**humanize** _.humanize(string)\n\nConverts an underscored, camelized, or dasherized string into a humanized one.\nAlso removes beginning and ending whitespace, and removes the postfix '_id'.\n\n```javascript\n_(' capitalize dash-CamelCase_underscore trim ').humanize()\n=> 'Capitalize dash camel case underscore trim'\n```\n\n**trim** _.trim(string, [characters])\n\ntrims defined characters from begining and ending of the string.\nDefaults to whitespace characters.\n\n```javascript\n_.trim(\" foobar \")\n=> \"foobar\"\n\n_.trim(\"_-foobar-_\", \"_-\")\n=> \"foobar\"\n```\n\n\n**ltrim** _.ltrim(string, [characters])\n\nLeft trim. Similar to trim, but only for left side.\n\n\n**rtrim** _.rtrim(string, [characters])\n\nRight trim. Similar to trim, but only for right side.\n\n**truncate** _.truncate(string, length, truncateString)\n\n```javascript\n_('Hello world').truncate(5)\n=> 'Hello...'\n\n_('Hello').truncate(10)\n=> 'Hello'\n```\n\n**prune** _.prune(string, length, pruneString)\n\nElegant version of truncate.\nMakes sure the pruned string does not exceed the original length.\nAvoid half-chopped words when truncating.\n\n```javascript\n_('Hello, world').prune(5)\n=> 'Hello...'\n\n_('Hello, world').prune(8)\n=> 'Hello...'\n\n_('Hello, world').prune(5, ' (read a lot more)')\n=> 'Hello, world' (as adding \"(read a lot more)\" would be longer than the original string)\n\n_('Hello, cruel world').prune(15)\n=> 'Hello, cruel...'\n\n_('Hello').prune(10)\n=> 'Hello'\n```\n\n**words** _.words(str, delimiter=/\\s+/)\n\nSplit string by delimiter (String or RegExp), /\\s+/ by default.\n\n```javascript\n_.words(\" I love you \")\n=> [\"I\",\"love\",\"you\"]\n\n_.words(\"I_love_you\", \"_\")\n=> [\"I\",\"love\",\"you\"]\n\n_.words(\"I-love-you\", /-/)\n=> [\"I\",\"love\",\"you\"]\n\n_.words(\" \")\n=> []\n```\n\n**sprintf** _.sprintf(string format, *arguments)\n\nC like string formatting.\nCredits goes to [Alexandru Marasteanu][o].\nFor more detailed documentation, see the [original page][o].\n\n[o]: http://www.diveintojavascript.com/projects/sprintf-for-javascript\n\n```javascript\n_.sprintf(\"%.1f\", 1.17)\n\"1.2\"\n```\n\n**pad** _.pad(str, length, [padStr, type])\n\npads the `str` with characters until the total string length is equal to the passed `length` parameter. By default, pads on the **left** with the space char (`\" \"`). `padStr` is truncated to a single character if necessary.\n\n```javascript\n_.pad(\"1\", 8)\n-> \" 1\";\n\n_.pad(\"1\", 8, '0')\n-> \"00000001\";\n\n_.pad(\"1\", 8, '0', 'right')\n-> \"10000000\";\n\n_.pad(\"1\", 8, '0', 'both')\n-> \"00001000\";\n\n_.pad(\"1\", 8, 'bleepblorp', 'both')\n-> \"bbbb1bbb\";\n```\n\n**lpad** _.lpad(str, length, [padStr])\n\nleft-pad a string. Alias for `pad(str, length, padStr, 'left')`\n\n```javascript\n_.lpad(\"1\", 8, '0')\n-> \"00000001\";\n```\n\n**rpad** _.rpad(str, length, [padStr])\n\nright-pad a string. Alias for `pad(str, length, padStr, 'right')`\n\n```javascript\n_.rpad(\"1\", 8, '0')\n-> \"10000000\";\n```\n\n**lrpad** _.lrpad(str, length, [padStr])\n\nleft/right-pad a string. Alias for `pad(str, length, padStr, 'both')`\n\n```javascript\n_.lrpad(\"1\", 8, '0')\n-> \"00001000\";\n```\n\n**center** alias for **lrpad**\n\n**ljust** alias for *rpad*\n\n**rjust** alias for *lpad*\n\n**toNumber** _.toNumber(string, [decimals])\n\nParse string to number. Returns NaN if string can't be parsed to number.\n\n```javascript\n_('2.556').toNumber()\n=> 3\n\n_('2.556').toNumber(1)\n=> 2.6\n```\n\n**strRight** _.strRight(string, pattern)\n\nSearches a string from left to right for a pattern and returns a substring consisting of the characters in the string that are to the right of the pattern or all string if no match found.\n\n```javascript\n_('This_is_a_test_string').strRight('_')\n=> \"is_a_test_string\";\n```\n\n**strRightBack** _.strRightBack(string, pattern)\n\nSearches a string from right to left for a pattern and returns a substring consisting of the characters in the string that are to the right of the pattern or all string if no match found.\n\n```javascript\n_('This_is_a_test_string').strRightBack('_')\n=> \"string\";\n```\n\n**strLeft** _.strLeft(string, pattern)\n\nSearches a string from left to right for a pattern and returns a substring consisting of the characters in the string that are to the left of the pattern or all string if no match found.\n\n```javascript\n_('This_is_a_test_string').strLeft('_')\n=> \"This\";\n```\n\n**strLeftBack** _.strLeftBack(string, pattern)\n\nSearches a string from right to left for a pattern and returns a substring consisting of the characters in the string that are to the left of the pattern or all string if no match found.\n\n```javascript\n_('This_is_a_test_string').strLeftBack('_')\n=> \"This_is_a_test\";\n```\n\n**stripTags**\n\nRemoves all html tags from string.\n\n```javascript\n_('a link').stripTags()\n=> 'a link'\n\n_('a link').stripTags()\n=> 'a linkalert(\"hello world!\")'\n```\n\n**toSentence** _.toSentence(array, [delimiter, lastDelimiter])\n\nJoin an array into a human readable sentence.\n\n```javascript\n_.toSentence(['jQuery', 'Mootools', 'Prototype'])\n=> 'jQuery, Mootools and Prototype';\n\n_.toSentence(['jQuery', 'Mootools', 'Prototype'], ', ', ' unt ')\n=> 'jQuery, Mootools unt Prototype';\n```\n\n**toSentenceSerial** _.toSentenceSerial(array, [delimiter, lastDelimiter])\n\nThe same as `toSentence`, but adjusts delimeters to use [Serial comma](http://en.wikipedia.org/wiki/Serial_comma).\n\n```javascript\n_.toSentenceSerial(['jQuery', 'Mootools'])\n=> 'jQuery and Mootools';\n\n_.toSentenceSerial(['jQuery', 'Mootools', 'Prototype'])\n=> 'jQuery, Mootools, and Prototype'\n\n_.toSentenceSerial(['jQuery', 'Mootools', 'Prototype'], ', ', ' unt ');\n=> 'jQuery, Mootools, unt Prototype';\n```\n\n**repeat** _.repeat(string, count, [separator])\n\nRepeats a string count times.\n\n```javascript\n_.repeat(\"foo\", 3)\n=> 'foofoofoo';\n\n_.repeat(\"foo\", 3, \"bar\")\n=> 'foobarfoobarfoo'\n```\n\n**surround** _.surround(string, wrap)\n\nSurround a string with another string.\n\n```javascript\n_.surround(\"foo\", \"ab\")\n=> 'abfooab';\n```\n\n**quote** _.quote(string) or _.q(string)\n\nQuotes a string.\n\n```javascript\n_.quote('foo')\n=> '\"foo\"';\n```\n\n\n**slugify** _.slugify(string)\n\nTransform text into a URL slug. Replaces whitespaces, accentuated, and special characters with a dash.\n\n```javascript\n_.slugify(\"Un éléphant à l'orée du bois\")\n=> 'un-elephant-a-loree-du-bois';\n```\n\n***Caution: this function is charset dependent***\n\n## Roadmap ##\n\nAny suggestions or bug reports are welcome. Just email me or more preferably open an issue.\n\n#### Problems\n\nWe lose two things for `include` and `reverse` methods from `_.string`:\n\n* Calls like `_('foobar').include('bar')` aren't available;\n* Chaining isn't available too.\n\nBut if you need this functionality you can create aliases for conflict functions which will be convenient for you:\n\n```javascript\n_.mixin({\n includeString: _.str.include,\n reverseString: _.str.reverse\n})\n\n// Now wrapper calls and chaining are available.\n_('foobar').chain().reverseString().includeString('rab').value()\n```\n\n#### Standalone Usage\n\nIf you are using Underscore.string without Underscore. You also have `_.string` namespace for it and `_.str` alias\nBut of course you can just reassign `_` variable with `_.string`\n\n```javascript\n_ = _.string\n```\n\n## Changelog ##\n\n### 2.3.1 ###\n\n* Changed integration logic, now trying everything in order\n* Fixed classify method to chew some unexpected input\n* Fixed toNumber method failing to recognize '0.0' as a proper number\n\n\n### 2.3.0 ###\n\n* Added `numberformat` method\n* Added `levenshtein` method (Levenshtein distance calculation)\n* Added `swapCase` method\n* Changed default behavior of `words` method\n* Added `toSentenceSerial` method\n* Added `surround` and `quote` methods\n\n### 2.2.0 ###\n\n* Capitalize method behavior changed\n* Various perfomance tweaks\n\n### 2.1.1###\n\n* Fixed words method bug\n* Added classify method\n\n### 2.1.0 ###\n\n* AMD support\n* Added toSentence method\n* Added slugify method\n* Lots of speed optimizations\n\n### 2.0.0 ###\n\n* Added prune, humanize functions\n* Added _.string (_.str) namespace for Underscore.string library\n* Removed includes function\n\nFor upgrading to this version you need to mix in Underscore.string library to Underscore object:\n\n```javascript\n_.mixin(_.string.exports());\n```\n\nand all non-conflict Underscore.string functions will be available through Underscore object.\nAlso function `includes` has been removed, you should replace this function by `_.str.include`\nor create alias `_.includes = _.str.include` and all your code will work fine.\n\n### 1.1.6 ###\n\n* Fixed reverse and truncate\n* Added isBlank, stripTags, inlude(alias for includes)\n* Added uglifier compression\n\n### 1.1.5 ###\n\n* Added strRight, strRightBack, strLeft, strLeftBack\n\n### 1.1.4 ###\n\n* Added pad, lpad, rpad, lrpad methods and aliases center, ljust, rjust\n* Integration with Underscore 1.1.6\n\n### 1.1.3 ###\n\n* Added methods: underscored, camelize, dasherize\n* Support newer version of npm\n\n### 1.1.2 ###\n\n* Created functions: lines, chars, words functions\n\n### 1.0.2 ###\n\n* Created integration test suite with underscore.js 1.1.4 (now it's absolutely compatible)\n* Removed 'reverse' function, because this function override underscore.js 'reverse'\n\n## Contribute ##\n\n* Fork & pull request. Don't forget about tests.\n* If you planning add some feature please create issue before.\n\nOtherwise changes will be rejected.\n\n## Contributors list ##\n[Can be found here](https://github.com/epeli/underscore.string/graphs/contributors).\n\n\n## Licence ##\n\nThe MIT License\n\nCopyright (c) 2011 Esa-Matti Suuronen esa-matti@suuronen.org\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in\nall copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\nTHE SOFTWARE.\n", - "readmeFilename": "README.markdown", - "_id": "underscore.string@2.3.1", - "dist": { - "shasum": "deb7588dfa2f252ee47e4516edafbef4ff97ec22" - }, - "_from": "underscore.string@~2.3.1", - "_resolved": "https://registry.npmjs.org/underscore.string/-/underscore.string-2.3.1.tgz" -} diff --git a/Phaser/node_modules/grunt/node_modules/js-yaml/node_modules/argparse/node_modules/underscore.string/test/test.html b/Phaser/node_modules/grunt/node_modules/js-yaml/node_modules/argparse/node_modules/underscore.string/test/test.html deleted file mode 100644 index c959a3a3..00000000 --- a/Phaser/node_modules/grunt/node_modules/js-yaml/node_modules/argparse/node_modules/underscore.string/test/test.html +++ /dev/null @@ -1,31 +0,0 @@ - - - - - Underscore.strings Test Suite - - - - - - - - - - -

    Underscore.string Test Suite

    -

    -

    -
      -
      -

      Underscore.string Speed Suite

      - -
      - - diff --git a/Phaser/node_modules/grunt/node_modules/js-yaml/node_modules/argparse/node_modules/underscore.string/test/test_standalone.html b/Phaser/node_modules/grunt/node_modules/js-yaml/node_modules/argparse/node_modules/underscore.string/test/test_standalone.html deleted file mode 100644 index 9854c171..00000000 --- a/Phaser/node_modules/grunt/node_modules/js-yaml/node_modules/argparse/node_modules/underscore.string/test/test_standalone.html +++ /dev/null @@ -1,18 +0,0 @@ - - - - Underscore.strings Test Suite - - - - - - - - -

      Underscore.string Test Suite

      -

      -

      -
        - - diff --git a/Phaser/node_modules/grunt/node_modules/js-yaml/node_modules/argparse/node_modules/underscore.string/test/test_underscore/index.html b/Phaser/node_modules/grunt/node_modules/js-yaml/node_modules/argparse/node_modules/underscore.string/test/test_underscore/index.html deleted file mode 100644 index 064fa986..00000000 --- a/Phaser/node_modules/grunt/node_modules/js-yaml/node_modules/argparse/node_modules/underscore.string/test/test_underscore/index.html +++ /dev/null @@ -1,45 +0,0 @@ - - - - Underscore Test Suite - - - - - - - - - - - - - - - - -
        -
        -
        -
        -
        -
        -
        -
        -

        Underscore Speed Suite

        -

        - A representative sample of the functions are benchmarked here, to provide - a sense of how fast they might run in different browsers. - Each iteration runs on an array of 1000 elements.

        - For example, the 'intersection' test measures the number of times you can - find the intersection of two thousand-element arrays in one second. -

        -
        - - - diff --git a/Phaser/node_modules/grunt/node_modules/js-yaml/node_modules/argparse/node_modules/underscore.string/test/test_underscore/vendor/qunit.css b/Phaser/node_modules/grunt/node_modules/js-yaml/node_modules/argparse/node_modules/underscore.string/test/test_underscore/vendor/qunit.css deleted file mode 100644 index 55970e00..00000000 --- a/Phaser/node_modules/grunt/node_modules/js-yaml/node_modules/argparse/node_modules/underscore.string/test/test_underscore/vendor/qunit.css +++ /dev/null @@ -1,235 +0,0 @@ -/** - * QUnit v1.10.0 - A JavaScript Unit Testing Framework - * - * http://qunitjs.com - * - * Copyright 2012 jQuery Foundation and other contributors - * Released under the MIT license. - * http://jquery.org/license - */ - -/** Font Family and Sizes */ - -#qunit-tests, #qunit-header, #qunit-banner, #qunit-testrunner-toolbar, #qunit-userAgent, #qunit-testresult { - font-family: "Helvetica Neue Light", "HelveticaNeue-Light", "Helvetica Neue", Calibri, Helvetica, Arial, sans-serif; -} - -#qunit-testrunner-toolbar, #qunit-userAgent, #qunit-testresult, #qunit-tests li { font-size: small; } -#qunit-tests { font-size: smaller; } - - -/** Resets */ - -#qunit-tests, #qunit-tests ol, #qunit-header, #qunit-banner, #qunit-userAgent, #qunit-testresult, #qunit-modulefilter { - margin: 0; - padding: 0; -} - - -/** Header */ - -#qunit-header { - padding: 0.5em 0 0.5em 1em; - - color: #8699a4; - background-color: #0d3349; - - font-size: 1.5em; - line-height: 1em; - font-weight: normal; - - border-radius: 5px 5px 0 0; - -moz-border-radius: 5px 5px 0 0; - -webkit-border-top-right-radius: 5px; - -webkit-border-top-left-radius: 5px; -} - -#qunit-header a { - text-decoration: none; - color: #c2ccd1; -} - -#qunit-header a:hover, -#qunit-header a:focus { - color: #fff; -} - -#qunit-testrunner-toolbar label { - display: inline-block; - padding: 0 .5em 0 .1em; -} - -#qunit-banner { - height: 5px; -} - -#qunit-testrunner-toolbar { - padding: 0.5em 0 0.5em 2em; - color: #5E740B; - background-color: #eee; - overflow: hidden; -} - -#qunit-userAgent { - padding: 0.5em 0 0.5em 2.5em; - background-color: #2b81af; - color: #fff; - text-shadow: rgba(0, 0, 0, 0.5) 2px 2px 1px; -} - -#qunit-modulefilter-container { - float: right; -} - -/** Tests: Pass/Fail */ - -#qunit-tests { - list-style-position: inside; -} - -#qunit-tests li { - padding: 0.4em 0.5em 0.4em 2.5em; - border-bottom: 1px solid #fff; - list-style-position: inside; -} - -#qunit-tests.hidepass li.pass, #qunit-tests.hidepass li.running { - display: none; -} - -#qunit-tests li strong { - cursor: pointer; -} - -#qunit-tests li a { - padding: 0.5em; - color: #c2ccd1; - text-decoration: none; -} -#qunit-tests li a:hover, -#qunit-tests li a:focus { - color: #000; -} - -#qunit-tests ol { - margin-top: 0.5em; - padding: 0.5em; - - background-color: #fff; - - border-radius: 5px; - -moz-border-radius: 5px; - -webkit-border-radius: 5px; -} - -#qunit-tests table { - border-collapse: collapse; - margin-top: .2em; -} - -#qunit-tests th { - text-align: right; - vertical-align: top; - padding: 0 .5em 0 0; -} - -#qunit-tests td { - vertical-align: top; -} - -#qunit-tests pre { - margin: 0; - white-space: pre-wrap; - word-wrap: break-word; -} - -#qunit-tests del { - background-color: #e0f2be; - color: #374e0c; - text-decoration: none; -} - -#qunit-tests ins { - background-color: #ffcaca; - color: #500; - text-decoration: none; -} - -/*** Test Counts */ - -#qunit-tests b.counts { color: black; } -#qunit-tests b.passed { color: #5E740B; } -#qunit-tests b.failed { color: #710909; } - -#qunit-tests li li { - padding: 5px; - background-color: #fff; - border-bottom: none; - list-style-position: inside; -} - -/*** Passing Styles */ - -#qunit-tests li li.pass { - color: #3c510c; - background-color: #fff; - border-left: 10px solid #C6E746; -} - -#qunit-tests .pass { color: #528CE0; background-color: #D2E0E6; } -#qunit-tests .pass .test-name { color: #366097; } - -#qunit-tests .pass .test-actual, -#qunit-tests .pass .test-expected { color: #999999; } - -#qunit-banner.qunit-pass { background-color: #C6E746; } - -/*** Failing Styles */ - -#qunit-tests li li.fail { - color: #710909; - background-color: #fff; - border-left: 10px solid #EE5757; - white-space: pre; -} - -#qunit-tests > li:last-child { - border-radius: 0 0 5px 5px; - -moz-border-radius: 0 0 5px 5px; - -webkit-border-bottom-right-radius: 5px; - -webkit-border-bottom-left-radius: 5px; -} - -#qunit-tests .fail { color: #000000; background-color: #EE5757; } -#qunit-tests .fail .test-name, -#qunit-tests .fail .module-name { color: #000000; } - -#qunit-tests .fail .test-actual { color: #EE5757; } -#qunit-tests .fail .test-expected { color: green; } - -#qunit-banner.qunit-fail { background-color: #EE5757; } - - -/** Result */ - -#qunit-testresult { - padding: 0.5em 0.5em 0.5em 2.5em; - - color: #2b81af; - background-color: #D2E0E6; - - border-bottom: 1px solid white; -} -#qunit-testresult .module-name { - font-weight: bold; -} - -/** Fixture */ - -#qunit-fixture { - position: absolute; - top: -10000px; - left: -10000px; - width: 1000px; - height: 1000px; -} diff --git a/Phaser/node_modules/grunt/node_modules/js-yaml/node_modules/argparse/node_modules/underscore/.npmignore b/Phaser/node_modules/grunt/node_modules/js-yaml/node_modules/argparse/node_modules/underscore/.npmignore deleted file mode 100644 index 4e5886de..00000000 --- a/Phaser/node_modules/grunt/node_modules/js-yaml/node_modules/argparse/node_modules/underscore/.npmignore +++ /dev/null @@ -1,4 +0,0 @@ -test/ -Rakefile -docs/ -raw/ diff --git a/Phaser/node_modules/grunt/node_modules/js-yaml/node_modules/argparse/node_modules/underscore/.travis.yml b/Phaser/node_modules/grunt/node_modules/js-yaml/node_modules/argparse/node_modules/underscore/.travis.yml deleted file mode 100644 index 99dc7712..00000000 --- a/Phaser/node_modules/grunt/node_modules/js-yaml/node_modules/argparse/node_modules/underscore/.travis.yml +++ /dev/null @@ -1,5 +0,0 @@ -language: node_js -node_js: - - 0.8 -notifications: - email: false diff --git a/Phaser/node_modules/grunt/node_modules/js-yaml/node_modules/argparse/node_modules/underscore/CNAME b/Phaser/node_modules/grunt/node_modules/js-yaml/node_modules/argparse/node_modules/underscore/CNAME deleted file mode 100644 index a007e65c..00000000 --- a/Phaser/node_modules/grunt/node_modules/js-yaml/node_modules/argparse/node_modules/underscore/CNAME +++ /dev/null @@ -1 +0,0 @@ -underscorejs.org diff --git a/Phaser/node_modules/grunt/node_modules/js-yaml/node_modules/argparse/node_modules/underscore/CONTRIBUTING.md b/Phaser/node_modules/grunt/node_modules/js-yaml/node_modules/argparse/node_modules/underscore/CONTRIBUTING.md deleted file mode 100644 index de5d5626..00000000 --- a/Phaser/node_modules/grunt/node_modules/js-yaml/node_modules/argparse/node_modules/underscore/CONTRIBUTING.md +++ /dev/null @@ -1,9 +0,0 @@ -## How to contribute to Underscore.js - -* Before you open a ticket or send a pull request, [search](https://github.com/documentcloud/underscore/issues) for previous discussions about the same feature or issue. Add to the earlier ticket if you find one. - -* Before sending a pull request for a feature, be sure to have [tests](http://underscorejs.org/test/). - -* Use the same coding style as the rest of the [codebase](https://github.com/documentcloud/underscore/blob/master/underscore.js). - -* In your pull request, do not add documentation or re-build the minified `underscore-min.js` file. We'll do those things before cutting a new release. diff --git a/Phaser/node_modules/grunt/node_modules/js-yaml/node_modules/argparse/node_modules/underscore/LICENSE b/Phaser/node_modules/grunt/node_modules/js-yaml/node_modules/argparse/node_modules/underscore/LICENSE deleted file mode 100644 index 0d8dbe40..00000000 --- a/Phaser/node_modules/grunt/node_modules/js-yaml/node_modules/argparse/node_modules/underscore/LICENSE +++ /dev/null @@ -1,22 +0,0 @@ -Copyright (c) 2009-2013 Jeremy Ashkenas, DocumentCloud - -Permission is hereby granted, free of charge, to any person -obtaining a copy of this software and associated documentation -files (the "Software"), to deal in the Software without -restriction, including without limitation the rights to use, -copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the -Software is furnished to do so, subject to the following -conditions: - -The above copyright notice and this permission notice shall be -included in all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES -OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT -HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, -WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING -FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR -OTHER DEALINGS IN THE SOFTWARE. diff --git a/Phaser/node_modules/grunt/node_modules/js-yaml/node_modules/argparse/node_modules/underscore/README.md b/Phaser/node_modules/grunt/node_modules/js-yaml/node_modules/argparse/node_modules/underscore/README.md deleted file mode 100644 index b1f3e50a..00000000 --- a/Phaser/node_modules/grunt/node_modules/js-yaml/node_modules/argparse/node_modules/underscore/README.md +++ /dev/null @@ -1,19 +0,0 @@ - __ - /\ \ __ - __ __ ___ \_\ \ __ _ __ ____ ___ ___ _ __ __ /\_\ ____ - /\ \/\ \ /' _ `\ /'_ \ /'__`\/\ __\/ ,__\ / ___\ / __`\/\ __\/'__`\ \/\ \ /',__\ - \ \ \_\ \/\ \/\ \/\ \ \ \/\ __/\ \ \//\__, `\/\ \__//\ \ \ \ \ \//\ __/ __ \ \ \/\__, `\ - \ \____/\ \_\ \_\ \___,_\ \____\\ \_\\/\____/\ \____\ \____/\ \_\\ \____\/\_\ _\ \ \/\____/ - \/___/ \/_/\/_/\/__,_ /\/____/ \/_/ \/___/ \/____/\/___/ \/_/ \/____/\/_//\ \_\ \/___/ - \ \____/ - \/___/ - -Underscore.js is a utility-belt library for JavaScript that provides -support for the usual functional suspects (each, map, reduce, filter...) -without extending any core JavaScript objects. - -For Docs, License, Tests, and pre-packed downloads, see: -http://underscorejs.org - -Many thanks to our contributors: -https://github.com/documentcloud/underscore/contributors diff --git a/Phaser/node_modules/grunt/node_modules/js-yaml/node_modules/argparse/node_modules/underscore/favicon.ico b/Phaser/node_modules/grunt/node_modules/js-yaml/node_modules/argparse/node_modules/underscore/favicon.ico deleted file mode 100644 index 03049683..00000000 Binary files a/Phaser/node_modules/grunt/node_modules/js-yaml/node_modules/argparse/node_modules/underscore/favicon.ico and /dev/null differ diff --git a/Phaser/node_modules/grunt/node_modules/js-yaml/node_modules/argparse/node_modules/underscore/index.html b/Phaser/node_modules/grunt/node_modules/js-yaml/node_modules/argparse/node_modules/underscore/index.html deleted file mode 100644 index 8c5793ab..00000000 --- a/Phaser/node_modules/grunt/node_modules/js-yaml/node_modules/argparse/node_modules/underscore/index.html +++ /dev/null @@ -1,2467 +0,0 @@ - - - - - - - - - Underscore.js - - - - - - -
        - -

        - -

        - -

        - Underscore is a - utility-belt library for JavaScript that provides a lot of the - functional programming support that you would expect in - Prototype.js - (or Ruby), - but without extending any of the built-in JavaScript objects. It's the - tie to go along with jQuery's tux, - and Backbone.js's suspenders. -

        - -

        - Underscore provides 80-odd functions that support both the usual - functional suspects: map, select, invoke — - as well as more specialized helpers: function binding, javascript - templating, deep equality testing, and so on. It delegates to built-in - functions, if present, so modern browsers will use the - native implementations of forEach, map, reduce, - filter, every, some and indexOf. -

        - -

        - A complete Test & Benchmark Suite - is included for your perusal. -

        - -

        - You may also read through the annotated source code. -

        - -

        - The project is - hosted on GitHub. - You can report bugs and discuss features on the - issues page, - on Freenode in the #documentcloud channel, - or send tweets to @documentcloud. -

        - -

        - Underscore is an open-source component of DocumentCloud. -

        - -

        Downloads (Right-click, and use "Save As")

        - - - - - - - - - - - - - - - - - -
        Development Version (1.4.4)40kb, Uncompressed with Plentiful Comments
        Production Version (1.4.4)4kb, Minified and Gzipped
        Edge VersionUnreleased, current master, use at your own risk
        - -
        - -

        Collection Functions (Arrays or Objects)

        - -

        - each_.each(list, iterator, [context]) - Alias: forEach -
        - Iterates over a list of elements, yielding each in turn to an iterator - function. The iterator is bound to the context object, if one is - passed. Each invocation of iterator is called with three arguments: - (element, index, list). If list is a JavaScript object, iterator's - arguments will be (value, key, list). Delegates to the native - forEach function if it exists. -

        -
        -_.each([1, 2, 3], alert);
        -=> alerts each number in turn...
        -_.each({one : 1, two : 2, three : 3}, alert);
        -=> alerts each number value in turn...
        - -

        - map_.map(list, iterator, [context]) - Alias: collect -
        - Produces a new array of values by mapping each value in list - through a transformation function (iterator). If the native map method - exists, it will be used instead. If list is a JavaScript object, - iterator's arguments will be (value, key, list). -

        -
        -_.map([1, 2, 3], function(num){ return num * 3; });
        -=> [3, 6, 9]
        -_.map({one : 1, two : 2, three : 3}, function(num, key){ return num * 3; });
        -=> [3, 6, 9]
        - -

        - reduce_.reduce(list, iterator, memo, [context]) - Aliases: inject, foldl -
        - Also known as inject and foldl, reduce boils down a - list of values into a single value. Memo is the initial state - of the reduction, and each successive step of it should be returned by - iterator. The iterator is passed four arguments: the memo, - then the value and index (or key) of the iteration, - and finally a reference to the entire list. -

        -
        -var sum = _.reduce([1, 2, 3], function(memo, num){ return memo + num; }, 0);
        -=> 6
        -
        - -

        - reduceRight_.reduceRight(list, iterator, memo, [context]) - Alias: foldr -
        - The right-associative version of reduce. Delegates to the - JavaScript 1.8 version of reduceRight, if it exists. Foldr - is not as useful in JavaScript as it would be in a language with lazy - evaluation. -

        -
        -var list = [[0, 1], [2, 3], [4, 5]];
        -var flat = _.reduceRight(list, function(a, b) { return a.concat(b); }, []);
        -=> [4, 5, 2, 3, 0, 1]
        -
        - -

        - find_.find(list, iterator, [context]) - Alias: detect -
        - Looks through each value in the list, returning the first one that - passes a truth test (iterator). The function returns as - soon as it finds an acceptable element, and doesn't traverse the - entire list. -

        -
        -var even = _.find([1, 2, 3, 4, 5, 6], function(num){ return num % 2 == 0; });
        -=> 2
        -
        - -

        - filter_.filter(list, iterator, [context]) - Alias: select -
        - Looks through each value in the list, returning an array of all - the values that pass a truth test (iterator). Delegates to the - native filter method, if it exists. -

        -
        -var evens = _.filter([1, 2, 3, 4, 5, 6], function(num){ return num % 2 == 0; });
        -=> [2, 4, 6]
        -
        - -

        - where_.where(list, properties) -
        - Looks through each value in the list, returning an array of all - the values that contain all of the key-value pairs listed in properties. -

        -
        -_.where(listOfPlays, {author: "Shakespeare", year: 1611});
        -=> [{title: "Cymbeline", author: "Shakespeare", year: 1611},
        -    {title: "The Tempest", author: "Shakespeare", year: 1611}]
        -
        - -

        - findWhere_.findWhere(list, properties) -
        - Looks through the list and returns the first value that matches - all of the key-value pairs listed in properties. -

        -
        -_.findWhere(publicServicePulitzers, {newsroom: "The New York Times"});
        -=> {year: 1918, newsroom: "The New York Times",
        -  reason: "For its public service in publishing in full so many official reports,
        -  documents and speeches by European statesmen relating to the progress and
        -  conduct of the war."}
        -
        - -

        - reject_.reject(list, iterator, [context]) -
        - Returns the values in list without the elements that the truth - test (iterator) passes. The opposite of filter. -

        -
        -var odds = _.reject([1, 2, 3, 4, 5, 6], function(num){ return num % 2 == 0; });
        -=> [1, 3, 5]
        -
        - -

        - every_.every(list, iterator, [context]) - Alias: all -
        - Returns true if all of the values in the list pass the iterator - truth test. Delegates to the native method every, if present. -

        -
        -_.every([true, 1, null, 'yes'], _.identity);
        -=> false
        -
        - -

        - some_.some(list, [iterator], [context]) - Alias: any -
        - Returns true if any of the values in the list pass the - iterator truth test. Short-circuits and stops traversing the list - if a true element is found. Delegates to the native method some, - if present. -

        -
        -_.some([null, 0, 'yes', false]);
        -=> true
        -
        - -

        - contains_.contains(list, value) - Alias: include -
        - Returns true if the value is present in the list. - Uses indexOf internally, if list is an Array. -

        -
        -_.contains([1, 2, 3], 3);
        -=> true
        -
        - -

        - invoke_.invoke(list, methodName, [*arguments]) -
        - Calls the method named by methodName on each value in the list. - Any extra arguments passed to invoke will be forwarded on to the - method invocation. -

        -
        -_.invoke([[5, 1, 7], [3, 2, 1]], 'sort');
        -=> [[1, 5, 7], [1, 2, 3]]
        -
        - -

        - pluck_.pluck(list, propertyName) -
        - A convenient version of what is perhaps the most common use-case for - map: extracting a list of property values. -

        -
        -var stooges = [{name : 'moe', age : 40}, {name : 'larry', age : 50}, {name : 'curly', age : 60}];
        -_.pluck(stooges, 'name');
        -=> ["moe", "larry", "curly"]
        -
        - -

        - max_.max(list, [iterator], [context]) -
        - Returns the maximum value in list. If iterator is passed, - it will be used on each value to generate the criterion by which the - value is ranked. -

        -
        -var stooges = [{name : 'moe', age : 40}, {name : 'larry', age : 50}, {name : 'curly', age : 60}];
        -_.max(stooges, function(stooge){ return stooge.age; });
        -=> {name : 'curly', age : 60};
        -
        - -

        - min_.min(list, [iterator], [context]) -
        - Returns the minimum value in list. If iterator is passed, - it will be used on each value to generate the criterion by which the - value is ranked. -

        -
        -var numbers = [10, 5, 100, 2, 1000];
        -_.min(numbers);
        -=> 2
        -
        - -

        - sortBy_.sortBy(list, iterator, [context]) -
        - Returns a sorted copy of list, ranked in ascending order by the - results of running each value through iterator. Iterator may - also be the string name of the property to sort by (eg. length). -

        -
        -_.sortBy([1, 2, 3, 4, 5, 6], function(num){ return Math.sin(num); });
        -=> [5, 4, 6, 3, 1, 2]
        -
        - -

        - groupBy_.groupBy(list, iterator, [context]) -
        - Splits a collection into sets, grouped by the result of running each - value through iterator. If iterator is a string instead of - a function, groups by the property named by iterator on each of - the values. -

        -
        -_.groupBy([1.3, 2.1, 2.4], function(num){ return Math.floor(num); });
        -=> {1: [1.3], 2: [2.1, 2.4]}
        -
        -_.groupBy(['one', 'two', 'three'], 'length');
        -=> {3: ["one", "two"], 5: ["three"]}
        -
        - -

        - countBy_.countBy(list, iterator, [context]) -
        - Sorts a list into groups and returns a count for the number of objects - in each group. - Similar to groupBy, but instead of returning a list of values, - returns a count for the number of values in that group. -

        -
        -_.countBy([1, 2, 3, 4, 5], function(num) {
        -  return num % 2 == 0 ? 'even' : 'odd';
        -});
        -=> {odd: 3, even: 2}
        -
        - -

        - shuffle_.shuffle(list) -
        - Returns a shuffled copy of the list, using a version of the - Fisher-Yates shuffle. -

        -
        -_.shuffle([1, 2, 3, 4, 5, 6]);
        -=> [4, 1, 6, 3, 5, 2]
        -
        - -

        - toArray_.toArray(list) -
        - Converts the list (anything that can be iterated over), into a - real Array. Useful for transmuting the arguments object. -

        -
        -(function(){ return _.toArray(arguments).slice(1); })(1, 2, 3, 4);
        -=> [2, 3, 4]
        -
        - -

        - size_.size(list) -
        - Return the number of values in the list. -

        -
        -_.size({one : 1, two : 2, three : 3});
        -=> 3
        -
        - -

        Array Functions

        - -

        - - Note: All array functions will also work on the arguments object. - However, Underscore functions are not designed to work on "sparse" arrays. - -

        - -

        - first_.first(array, [n]) - Alias: head, take -
        - Returns the first element of an array. Passing n will - return the first n elements of the array. -

        -
        -_.first([5, 4, 3, 2, 1]);
        -=> 5
        -
        - -

        - initial_.initial(array, [n]) -
        - Returns everything but the last entry of the array. Especially useful on - the arguments object. Pass n to exclude the last n elements - from the result. -

        -
        -_.initial([5, 4, 3, 2, 1]);
        -=> [5, 4, 3, 2]
        -
        - -

        - last_.last(array, [n]) -
        - Returns the last element of an array. Passing n will return - the last n elements of the array. -

        -
        -_.last([5, 4, 3, 2, 1]);
        -=> 1
        -
        - -

        - rest_.rest(array, [index]) - Alias: tail, drop -
        - Returns the rest of the elements in an array. Pass an index - to return the values of the array from that index onward. -

        -
        -_.rest([5, 4, 3, 2, 1]);
        -=> [4, 3, 2, 1]
        -
        - -

        - compact_.compact(array) -
        - Returns a copy of the array with all falsy values removed. - In JavaScript, false, null, 0, "", - undefined and NaN are all falsy. -

        -
        -_.compact([0, 1, false, 2, '', 3]);
        -=> [1, 2, 3]
        -
        - -

        - flatten_.flatten(array, [shallow]) -
        - Flattens a nested array (the nesting can be to any depth). If you - pass shallow, the array will only be flattened a single level. -

        -
        -_.flatten([1, [2], [3, [[4]]]]);
        -=> [1, 2, 3, 4];
        -
        -_.flatten([1, [2], [3, [[4]]]], true);
        -=> [1, 2, 3, [[4]]];
        -
        - -

        - without_.without(array, [*values]) -
        - Returns a copy of the array with all instances of the values - removed. -

        -
        -_.without([1, 2, 1, 0, 3, 1, 4], 0, 1);
        -=> [2, 3, 4]
        -
        - -

        - union_.union(*arrays) -
        - Computes the union of the passed-in arrays: the list of unique items, - in order, that are present in one or more of the arrays. -

        -
        -_.union([1, 2, 3], [101, 2, 1, 10], [2, 1]);
        -=> [1, 2, 3, 101, 10]
        -
        - -

        - intersection_.intersection(*arrays) -
        - Computes the list of values that are the intersection of all the arrays. - Each value in the result is present in each of the arrays. -

        -
        -_.intersection([1, 2, 3], [101, 2, 1, 10], [2, 1]);
        -=> [1, 2]
        -
        - -

        - difference_.difference(array, *others) -
        - Similar to without, but returns the values from array that - are not present in the other arrays. -

        -
        -_.difference([1, 2, 3, 4, 5], [5, 2, 10]);
        -=> [1, 3, 4]
        -
        - -

        - uniq_.uniq(array, [isSorted], [iterator]) - Alias: unique -
        - Produces a duplicate-free version of the array, using === to test - object equality. If you know in advance that the array is sorted, - passing true for isSorted will run a much faster algorithm. - If you want to compute unique items based on a transformation, pass an - iterator function. -

        -
        -_.uniq([1, 2, 1, 3, 1, 4]);
        -=> [1, 2, 3, 4]
        -
        - -

        - zip_.zip(*arrays) -
        - Merges together the values of each of the arrays with the - values at the corresponding position. Useful when you have separate - data sources that are coordinated through matching array indexes. - If you're working with a matrix of nested arrays, zip.apply - can transpose the matrix in a similar fashion. -

        -
        -_.zip(['moe', 'larry', 'curly'], [30, 40, 50], [true, false, false]);
        -=> [["moe", 30, true], ["larry", 40, false], ["curly", 50, false]]
        -
        - -

        - object_.object(list, [values]) -
        - Converts arrays into objects. Pass either a single list of - [key, value] pairs, or a list of keys, and a list of values. -

        -
        -_.object(['moe', 'larry', 'curly'], [30, 40, 50]);
        -=> {moe: 30, larry: 40, curly: 50}
        -
        -_.object([['moe', 30], ['larry', 40], ['curly', 50]]);
        -=> {moe: 30, larry: 40, curly: 50}
        -
        - -

        - indexOf_.indexOf(array, value, [isSorted]) -
        - Returns the index at which value can be found in the array, - or -1 if value is not present in the array. Uses the native - indexOf function unless it's missing. If you're working with a - large array, and you know that the array is already sorted, pass true - for isSorted to use a faster binary search ... or, pass a number as - the third argument in order to look for the first matching value in the - array after the given index. -

        -
        -_.indexOf([1, 2, 3], 2);
        -=> 1
        -
        - -

        - lastIndexOf_.lastIndexOf(array, value, [fromIndex]) -
        - Returns the index of the last occurrence of value in the array, - or -1 if value is not present. Uses the native lastIndexOf - function if possible. Pass fromIndex to start your search at a - given index. -

        -
        -_.lastIndexOf([1, 2, 3, 1, 2, 3], 2);
        -=> 4
        -
        - -

        - sortedIndex_.sortedIndex(list, value, [iterator], [context]) -
        - Uses a binary search to determine the index at which the value - should be inserted into the list in order to maintain the list's - sorted order. If an iterator is passed, it will be used to compute - the sort ranking of each value, including the value you pass. -

        -
        -_.sortedIndex([10, 20, 30, 40, 50], 35);
        -=> 3
        -
        - -

        - range_.range([start], stop, [step]) -
        - A function to create flexibly-numbered lists of integers, handy for - each and map loops. start, if omitted, defaults - to 0; step defaults to 1. Returns a list of integers - from start to stop, incremented (or decremented) by step, - exclusive. -

        -
        -_.range(10);
        -=> [0, 1, 2, 3, 4, 5, 6, 7, 8, 9]
        -_.range(1, 11);
        -=> [1, 2, 3, 4, 5, 6, 7, 8, 9, 10]
        -_.range(0, 30, 5);
        -=> [0, 5, 10, 15, 20, 25]
        -_.range(0, -10, -1);
        -=> [0, -1, -2, -3, -4, -5, -6, -7, -8, -9]
        -_.range(0);
        -=> []
        -
        - -

        Function (uh, ahem) Functions

        - -

        - bind_.bind(function, object, [*arguments]) -
        - Bind a function to an object, meaning that whenever - the function is called, the value of this will be the object. - Optionally, pass arguments to the function to pre-fill them, - also known as partial application. -

        -
        -var func = function(greeting){ return greeting + ': ' + this.name };
        -func = _.bind(func, {name : 'moe'}, 'hi');
        -func();
        -=> 'hi: moe'
        -
        - -

        - bindAll_.bindAll(object, [*methodNames]) -
        - Binds a number of methods on the object, specified by - methodNames, to be run in the context of that object whenever they - are invoked. Very handy for binding functions that are going to be used - as event handlers, which would otherwise be invoked with a fairly useless - this. If no methodNames are provided, all of the object's - function properties will be bound to it. -

        -
        -var buttonView = {
        -  label   : 'underscore',
        -  onClick : function(){ alert('clicked: ' + this.label); },
        -  onHover : function(){ console.log('hovering: ' + this.label); }
        -};
        -_.bindAll(buttonView);
        -jQuery('#underscore_button').bind('click', buttonView.onClick);
        -=> When the button is clicked, this.label will have the correct value...
        -
        - -

        - partial_.partial(function, [*arguments]) -
        - Partially apply a function by filling in any number of its arguments, - without changing its dynamic this value. A close cousin - of bind. -

        -
        -var add = function(a, b) { return a + b; };
        -add5 = _.partial(add, 5);
        -add5(10);
        -=> 15
        -
        - -

        - memoize_.memoize(function, [hashFunction]) -
        - Memoizes a given function by caching the computed result. Useful - for speeding up slow-running computations. If passed an optional - hashFunction, it will be used to compute the hash key for storing - the result, based on the arguments to the original function. The default - hashFunction just uses the first argument to the memoized function - as the key. -

        -
        -var fibonacci = _.memoize(function(n) {
        -  return n < 2 ? n : fibonacci(n - 1) + fibonacci(n - 2);
        -});
        -
        - -

        - delay_.delay(function, wait, [*arguments]) -
        - Much like setTimeout, invokes function after wait - milliseconds. If you pass the optional arguments, they will be - forwarded on to the function when it is invoked. -

        -
        -var log = _.bind(console.log, console);
        -_.delay(log, 1000, 'logged later');
        -=> 'logged later' // Appears after one second.
        -
        - -

        - defer_.defer(function, [*arguments]) -
        - Defers invoking the function until the current call stack has cleared, - similar to using setTimeout with a delay of 0. Useful for performing - expensive computations or HTML rendering in chunks without blocking the UI thread - from updating. If you pass the optional arguments, they will be - forwarded on to the function when it is invoked. -

        -
        -_.defer(function(){ alert('deferred'); });
        -// Returns from the function before the alert runs.
        -
        - -

        - throttle_.throttle(function, wait) -
        - Creates and returns a new, throttled version of the passed function, - that, when invoked repeatedly, will only actually call the original function - at most once per every wait - milliseconds. Useful for rate-limiting events that occur faster than you - can keep up with. -

        -
        -var throttled = _.throttle(updatePosition, 100);
        -$(window).scroll(throttled);
        -
        - -

        - debounce_.debounce(function, wait, [immediate]) -
        - Creates and returns a new debounced version of the passed function that - will postpone its execution until after - wait milliseconds have elapsed since the last time it - was invoked. Useful for implementing behavior that should only happen - after the input has stopped arriving. For example: rendering a - preview of a Markdown comment, recalculating a layout after the window - has stopped being resized, and so on. -

        - -

        - Pass true for the immediate parameter to cause - debounce to trigger the function on the leading instead of the - trailing edge of the wait interval. Useful in circumstances like - preventing accidental double-clicks on a "submit" button from firing a - second time. -

        - -
        -var lazyLayout = _.debounce(calculateLayout, 300);
        -$(window).resize(lazyLayout);
        -
        - -

        - once_.once(function) -
        - Creates a version of the function that can only be called one time. - Repeated calls to the modified function will have no effect, returning - the value from the original call. Useful for initialization functions, - instead of having to set a boolean flag and then check it later. -

        -
        -var initialize = _.once(createApplication);
        -initialize();
        -initialize();
        -// Application is only created once.
        -
        - -

        - after_.after(count, function) -
        - Creates a version of the function that will only be run after first - being called count times. Useful for grouping asynchronous responses, - where you want to be sure that all the async calls have finished, before - proceeding. -

        -
        -var renderNotes = _.after(notes.length, render);
        -_.each(notes, function(note) {
        -  note.asyncSave({success: renderNotes});
        -});
        -// renderNotes is run once, after all notes have saved.
        -
        - -

        - wrap_.wrap(function, wrapper) -
        - Wraps the first function inside of the wrapper function, - passing it as the first argument. This allows the wrapper to - execute code before and after the function runs, adjust the arguments, - and execute it conditionally. -

        -
        -var hello = function(name) { return "hello: " + name; };
        -hello = _.wrap(hello, function(func) {
        -  return "before, " + func("moe") + ", after";
        -});
        -hello();
        -=> 'before, hello: moe, after'
        -
        - -

        - compose_.compose(*functions) -
        - Returns the composition of a list of functions, where each function - consumes the return value of the function that follows. In math terms, - composing the functions f(), g(), and h() produces - f(g(h())). -

        -
        -var greet    = function(name){ return "hi: " + name; };
        -var exclaim  = function(statement){ return statement + "!"; };
        -var welcome = _.compose(exclaim, greet);
        -welcome('moe');
        -=> 'hi: moe!'
        -
        - -

        Object Functions

        - -

        - keys_.keys(object) -
        - Retrieve all the names of the object's properties. -

        -
        -_.keys({one : 1, two : 2, three : 3});
        -=> ["one", "two", "three"]
        -
        - -

        - values_.values(object) -
        - Return all of the values of the object's properties. -

        -
        -_.values({one : 1, two : 2, three : 3});
        -=> [1, 2, 3]
        -
        - -

        - pairs_.pairs(object) -
        - Convert an object into a list of [key, value] pairs. -

        -
        -_.pairs({one: 1, two: 2, three: 3});
        -=> [["one", 1], ["two", 2], ["three", 3]]
        -
        - -

        - invert_.invert(object) -
        - Returns a copy of the object where the keys have become the values - and the values the keys. For this to work, all of your object's values - should be unique and string serializable. -

        -
        -_.invert({Moe: "Moses", Larry: "Louis", Curly: "Jerome"});
        -=> {Moses: "Moe", Louis: "Larry", Jerome: "Curly"};
        -
        - -

        - functions_.functions(object) - Alias: methods -
        - Returns a sorted list of the names of every method in an object — - that is to say, the name of every function property of the object. -

        -
        -_.functions(_);
        -=> ["all", "any", "bind", "bindAll", "clone", "compact", "compose" ...
        -
        - -

        - extend_.extend(destination, *sources) -
        - Copy all of the properties in the source objects over to the - destination object, and return the destination object. - It's in-order, so the last source will override properties of the same - name in previous arguments. -

        -
        -_.extend({name : 'moe'}, {age : 50});
        -=> {name : 'moe', age : 50}
        -
        - -

        - pick_.pick(object, *keys) -
        - Return a copy of the object, filtered to only have values for - the whitelisted keys (or array of valid keys). -

        -
        -_.pick({name : 'moe', age: 50, userid : 'moe1'}, 'name', 'age');
        -=> {name : 'moe', age : 50}
        -
        - -

        - omit_.omit(object, *keys) -
        - Return a copy of the object, filtered to omit the blacklisted - keys (or array of keys). -

        -
        -_.omit({name : 'moe', age : 50, userid : 'moe1'}, 'userid');
        -=> {name : 'moe', age : 50}
        -
        - -

        - defaults_.defaults(object, *defaults) -
        - Fill in null and undefined properties in object with values from the - defaults objects, and return the object. As soon as the - property is filled, further defaults will have no effect. -

        -
        -var iceCream = {flavor : "chocolate"};
        -_.defaults(iceCream, {flavor : "vanilla", sprinkles : "lots"});
        -=> {flavor : "chocolate", sprinkles : "lots"}
        -
        - -

        - clone_.clone(object) -
        - Create a shallow-copied clone of the object. Any nested objects - or arrays will be copied by reference, not duplicated. -

        -
        -_.clone({name : 'moe'});
        -=> {name : 'moe'};
        -
        - -

        - tap_.tap(object, interceptor) -
        - Invokes interceptor with the object, and then returns object. - The primary purpose of this method is to "tap into" a method chain, in order to perform operations on intermediate results within the chain. -

        -
        -_.chain([1,2,3,200])
        -  .filter(function(num) { return num % 2 == 0; })
        -  .tap(alert)
        -  .map(function(num) { return num * num })
        -  .value();
        -=> // [2, 200] (alerted)
        -=> [4, 40000]
        -
        - -

        - has_.has(object, key) -
        - Does the object contain the given key? Identical to - object.hasOwnProperty(key), but uses a safe reference to the - hasOwnProperty function, in case it's been - overridden accidentally. -

        -
        -_.has({a: 1, b: 2, c: 3}, "b");
        -=> true
        -
        - -

        - isEqual_.isEqual(object, other) -
        - Performs an optimized deep comparison between the two objects, to determine - if they should be considered equal. -

        -
        -var moe   = {name : 'moe', luckyNumbers : [13, 27, 34]};
        -var clone = {name : 'moe', luckyNumbers : [13, 27, 34]};
        -moe == clone;
        -=> false
        -_.isEqual(moe, clone);
        -=> true
        -
        - -

        - isEmpty_.isEmpty(object) -
        - Returns true if object contains no values. -

        -
        -_.isEmpty([1, 2, 3]);
        -=> false
        -_.isEmpty({});
        -=> true
        -
        - -

        - isElement_.isElement(object) -
        - Returns true if object is a DOM element. -

        -
        -_.isElement(jQuery('body')[0]);
        -=> true
        -
        - -

        - isArray_.isArray(object) -
        - Returns true if object is an Array. -

        -
        -(function(){ return _.isArray(arguments); })();
        -=> false
        -_.isArray([1,2,3]);
        -=> true
        -
        - -

        - isObject_.isObject(value) -
        - Returns true if value is an Object. Note that JavaScript - arrays and functions are objects, while (normal) strings and numbers are not. -

        -
        -_.isObject({});
        -=> true
        -_.isObject(1);
        -=> false
        -
        - -

        - isArguments_.isArguments(object) -
        - Returns true if object is an Arguments object. -

        -
        -(function(){ return _.isArguments(arguments); })(1, 2, 3);
        -=> true
        -_.isArguments([1,2,3]);
        -=> false
        -
        - -

        - isFunction_.isFunction(object) -
        - Returns true if object is a Function. -

        -
        -_.isFunction(alert);
        -=> true
        -
        - -

        - isString_.isString(object) -
        - Returns true if object is a String. -

        -
        -_.isString("moe");
        -=> true
        -
        - -

        - isNumber_.isNumber(object) -
        - Returns true if object is a Number (including NaN). -

        -
        -_.isNumber(8.4 * 5);
        -=> true
        -
        - -

        - isFinite_.isFinite(object) -
        - Returns true if object is a finite Number. -

        -
        -_.isFinite(-101);
        -=> true
        -
        -_.isFinite(-Infinity);
        -=> false
        -
        - -

        - isBoolean_.isBoolean(object) -
        - Returns true if object is either true or false. -

        -
        -_.isBoolean(null);
        -=> false
        -
        - -

        - isDate_.isDate(object) -
        - Returns true if object is a Date. -

        -
        -_.isDate(new Date());
        -=> true
        -
        - -

        - isRegExp_.isRegExp(object) -
        - Returns true if object is a RegExp. -

        -
        -_.isRegExp(/moe/);
        -=> true
        -
        - -

        - isNaN_.isNaN(object) -
        - Returns true if object is NaN.
        Note: this is not - the same as the native isNaN function, which will also return - true if the variable is undefined. -

        -
        -_.isNaN(NaN);
        -=> true
        -isNaN(undefined);
        -=> true
        -_.isNaN(undefined);
        -=> false
        -
        - -

        - isNull_.isNull(object) -
        - Returns true if the value of object is null. -

        -
        -_.isNull(null);
        -=> true
        -_.isNull(undefined);
        -=> false
        -
        - -

        - isUndefined_.isUndefined(value) -
        - Returns true if value is undefined. -

        -
        -_.isUndefined(window.missingVariable);
        -=> true
        -
        - -

        Utility Functions

        - -

        - noConflict_.noConflict() -
        - Give control of the "_" variable back to its previous owner. Returns - a reference to the Underscore object. -

        -
        -var underscore = _.noConflict();
        - -

        - identity_.identity(value) -
        - Returns the same value that is used as the argument. In math: - f(x) = x
        - This function looks useless, but is used throughout Underscore as - a default iterator. -

        -
        -var moe = {name : 'moe'};
        -moe === _.identity(moe);
        -=> true
        - -

        - times_.times(n, iterator, [context]) -
        - Invokes the given iterator function n times. Each invocation of - iterator is called with an index argument. -
        - Note: this example uses the chaining syntax. -

        -
        -_(3).times(function(n){ genie.grantWishNumber(n); });
        - -

        - random_.random(min, max) -
        - Returns a random integer between min and max, inclusive. - If you only pass one argument, it will return a number between 0 - and that number. -

        -
        -_.random(0, 100);
        -=> 42
        - -

        - mixin_.mixin(object) -
        - Allows you to extend Underscore with your own utility functions. Pass - a hash of {name: function} definitions to have your functions - added to the Underscore object, as well as the OOP wrapper. -

        -
        -_.mixin({
        -  capitalize : function(string) {
        -    return string.charAt(0).toUpperCase() + string.substring(1).toLowerCase();
        -  }
        -});
        -_("fabio").capitalize();
        -=> "Fabio"
        -
        - -

        - uniqueId_.uniqueId([prefix]) -
        - Generate a globally-unique id for client-side models or DOM elements - that need one. If prefix is passed, the id will be appended to it. -

        -
        -_.uniqueId('contact_');
        -=> 'contact_104'
        - -

        - escape_.escape(string) -
        - Escapes a string for insertion into HTML, replacing - &, <, >, ", ', and / characters. -

        -
        -_.escape('Curly, Larry & Moe');
        -=> "Curly, Larry &amp; Moe"
        - -

        - unescape_.unescape(string) -
        - The opposite of escape, replaces - &amp;, &lt;, &gt;, - &quot;, &#x27;, and &#x2F; - with their unescaped counterparts. -

        -
        -_.unescape('Curly, Larry &amp; Moe');
        -=> "Curly, Larry & Moe"
        - -

        - result_.result(object, property) -
        - If the value of the named property is a function then invoke it; otherwise, return it. -

        -
        -var object = {cheese: 'crumpets', stuff: function(){ return 'nonsense'; }};
        -_.result(object, 'cheese');
        -=> "crumpets"
        -_.result(object, 'stuff');
        -=> "nonsense"
        - -

        - template_.template(templateString, [data], [settings]) -
        - Compiles JavaScript templates into functions that can be evaluated - for rendering. Useful for rendering complicated bits of HTML from JSON - data sources. Template functions can both interpolate variables, using - <%= … %>, as well as execute arbitrary JavaScript code, with - <% … %>. If you wish to interpolate a value, and have - it be HTML-escaped, use <%- … %> When you evaluate a template function, pass in a - data object that has properties corresponding to the template's free - variables. If you're writing a one-off, you can pass the data - object as the second parameter to template in order to render - immediately instead of returning a template function. The settings argument - should be a hash containing any _.templateSettings that should be overridden. -

        - -
        -var compiled = _.template("hello: <%= name %>");
        -compiled({name : 'moe'});
        -=> "hello: moe"
        -
        -var list = "<% _.each(people, function(name) { %> <li><%= name %></li> <% }); %>";
        -_.template(list, {people : ['moe', 'curly', 'larry']});
        -=> "<li>moe</li><li>curly</li><li>larry</li>"
        -
        -var template = _.template("<b><%- value %></b>");
        -template({value : '<script>'});
        -=> "<b>&lt;script&gt;</b>"
        - -

        - You can also use print from within JavaScript code. This is - sometimes more convenient than using <%= ... %>. -

        - -
        -var compiled = _.template("<% print('Hello ' + epithet); %>");
        -compiled({epithet: "stooge"});
        -=> "Hello stooge."
        - -

        - If ERB-style delimiters aren't your cup of tea, you can change Underscore's - template settings to use different symbols to set off interpolated code. - Define an interpolate regex to match expressions that should be - interpolated verbatim, an escape regex to match expressions that should - be inserted after being HTML escaped, and an evaluate regex to match - expressions that should be evaluated without insertion into the resulting - string. You may define or omit any combination of the three. - For example, to perform - Mustache.js - style templating: -

        - -
        -_.templateSettings = {
        -  interpolate : /\{\{(.+?)\}\}/g
        -};
        -
        -var template = _.template("Hello {{ name }}!");
        -template({name : "Mustache"});
        -=> "Hello Mustache!"
        - -

        - By default, template places the values from your data in the local scope - via the with statement. However, you can specify a single variable name - with the variable setting. This can significantly improve the speed - at which a template is able to render. -

        - -
        -_.template("Using 'with': <%= data.answer %>", {answer: 'no'}, {variable: 'data'});
        -=> "Using 'with': no"
        - -

        - Precompiling your templates can be a big help when debugging errors you can't - reproduce. This is because precompiled templates can provide line numbers and - a stack trace, something that is not possible when compiling templates on the client. - The source property is available on the compiled template - function for easy precompilation. -

        - -
        <script>
        -  JST.project = <%= _.template(jstText).source %>;
        -</script>
        - - -

        Chaining

        - -

        - You can use Underscore in either an object-oriented or a functional style, - depending on your preference. The following two lines of code are - identical ways to double a list of numbers. -

        - -
        -_.map([1, 2, 3], function(n){ return n * 2; });
        -_([1, 2, 3]).map(function(n){ return n * 2; });
        - -

        - Calling chain will cause all future method calls to return - wrapped objects. When you've finished the computation, use - value to retrieve the final value. Here's an example of chaining - together a map/flatten/reduce, in order to get the word count of - every word in a song. -

        - -
        -var lyrics = [
        -  {line : 1, words : "I'm a lumberjack and I'm okay"},
        -  {line : 2, words : "I sleep all night and I work all day"},
        -  {line : 3, words : "He's a lumberjack and he's okay"},
        -  {line : 4, words : "He sleeps all night and he works all day"}
        -];
        -
        -_.chain(lyrics)
        -  .map(function(line) { return line.words.split(' '); })
        -  .flatten()
        -  .reduce(function(counts, word) {
        -    counts[word] = (counts[word] || 0) + 1;
        -    return counts;
        -  }, {})
        -  .value();
        -
        -=> {lumberjack : 2, all : 4, night : 2 ... }
        - -

        - In addition, the - Array prototype's methods - are proxied through the chained Underscore object, so you can slip a - reverse or a push into your chain, and continue to - modify the array. -

        - -

        - chain_.chain(obj) -
        - Returns a wrapped object. Calling methods on this object will continue - to return wrapped objects until value is used. -

        -
        -var stooges = [{name : 'curly', age : 25}, {name : 'moe', age : 21}, {name : 'larry', age : 23}];
        -var youngest = _.chain(stooges)
        -  .sortBy(function(stooge){ return stooge.age; })
        -  .map(function(stooge){ return stooge.name + ' is ' + stooge.age; })
        -  .first()
        -  .value();
        -=> "moe is 21"
        -
        - -

        - value_(obj).value() -
        - Extracts the value of a wrapped object. -

        -
        -_([1, 2, 3]).value();
        -=> [1, 2, 3]
        -
        - - - -

        - The Underscore documentation is also available in - Simplified Chinese. -

        - -

        - Underscore.lua, - a Lua port of the functions that are applicable in both languages. - Includes OOP-wrapping and chaining. - (source) -

        - -

        - Underscore.m, an Objective-C port - of many of the Underscore.js functions, using a syntax that encourages - chaining. - (source) -

        - -

        - _.m, an alternative - Objective-C port that tries to stick a little closer to the original - Underscore.js API. - (source) -

        - -

        - Underscore.php, - a PHP port of the functions that are applicable in both languages. - Includes OOP-wrapping and chaining. - (source) -

        - -

        - Underscore-perl, - a Perl port of many of the Underscore.js functions, - aimed at on Perl hashes and arrays. - (source) -

        - -

        - Underscore.cfc, - a Coldfusion port of many of the Underscore.js functions. - (source) -

        - -

        - Underscore.string, - an Underscore extension that adds functions for string-manipulation: - trim, startsWith, contains, capitalize, - reverse, sprintf, and more. -

        - -

        - Ruby's Enumerable module. -

        - -

        - Prototype.js, which provides - JavaScript with collection functions in the manner closest to Ruby's Enumerable. -

        - -

        - Oliver Steele's - Functional JavaScript, - which includes comprehensive higher-order function support as well as string lambdas. -

        - -

        - Michael Aufreiter's Data.js, - a data manipulation + persistence library for JavaScript. -

        - -

        - Python's itertools. -

        - -

        Change Log

        - -

        - 1.4.4Jan. 30, 2013Diff
        -

          -
        • - Added _.findWhere, for finding the first element in a list - that matches a particular set of keys and values. -
        • -
        • - Added _.partial, for partially applying a function without - changing its dynamic reference to this. -
        • -
        • - Simplified bind by removing some edge cases involving - constructor functions. In short: don't _.bind your - constructors. -
        • -
        • - A minor optimization to invoke. -
        • -
        • - Fix bug in the minified version due to the minifier incorrectly - optimizing-away isFunction. -
        • -
        -

        - -

        - 1.4.3Dec. 4, 2012Diff
        -

          -
        • - Improved Underscore compatibility with Adobe's JS engine that can be - used to script Illustrator, Photoshop, and friends. -
        • -
        • - Added a default _.identity iterator to countBy and - groupBy. -
        • -
        • - The uniq function can now take array, iterator, context - as the argument list. -
        • -
        • - The times function now returns the mapped array of iterator - results. -
        • -
        • - Simplified and fixed bugs in throttle. -
        • -
        -

        - -

        - 1.4.2Oct. 1, 2012Diff
        -

          -
        • - For backwards compatibility, returned to pre-1.4.0 behavior when - passing null to iteration functions. They now become no-ops - again. -
        • -
        -

        - -

        - 1.4.1Oct. 1, 2012Diff
        -

          -
        • - Fixed a 1.4.0 regression in the lastIndexOf function. -
        • -
        -

        - -

        - 1.4.0Sept. 27, 2012Diff
        -

          -
        • - Added a pairs function, for turning a JavaScript object - into [key, value] pairs ... as well as an object - function, for converting an array of [key, value] pairs - into an object. -
        • -
        • - Added a countBy function, for counting the number of objects - in a list that match a certain criteria. -
        • -
        • - Added an invert function, for performing a simple inversion - of the keys and values in an object. -
        • -
        • - Added a where function, for easy cases of filtering a list - for objects with specific values. -
        • -
        • - Added an omit function, for filtering an object to remove - certain keys. -
        • -
        • - Added a random function, to return a random number in a - given range. -
        • -
        • - _.debounce'd functions now return their last updated value, - just like _.throttle'd functions do. -
        • -
        • - The sortBy function now runs a stable sort algorithm. -
        • -
        • - Added the optional fromIndex option to indexOf and - lastIndexOf. -
        • -
        • - "Sparse" arrays are no longer supported in Underscore iteration - functions. Use a for loop instead (or better yet, an object). -
        • -
        • - The min and max functions may now be called on - very large arrays. -
        • -
        • - Interpolation in templates now represents null and - undefined as the empty string. -
        • -
        • - Underscore iteration functions no longer accept null values - as a no-op argument. You'll get an early error instead. -
        • -
        • - A number of edge-cases fixes and tweaks, which you can spot in the - diff. - Depending on how you're using Underscore, 1.4.0 may be more - backwards-incompatible than usual — please test when you upgrade. -
        • -
        -

        - -

        - 1.3.3April 10, 2012
        -

          -
        • - Many improvements to _.template, which now provides the - source of the template function as a property, for potentially - even more efficient pre-compilation on the server-side. You may now - also set the variable option when creating a template, - which will cause your passed-in data to be made available under the - variable you named, instead of using a with statement — - significantly improving the speed of rendering the template. -
        • -
        • - Added the pick function, which allows you to filter an - object literal with a whitelist of allowed property names. -
        • -
        • - Added the result function, for convenience when working - with APIs that allow either functions or raw properties. -
        • -
        • - Added the isFinite function, because sometimes knowing that - a value is a number just ain't quite enough. -
        • -
        • - The sortBy function may now also be passed the string name - of a property to use as the sort order on each object. -
        • -
        • - Fixed uniq to work with sparse arrays. -
        • -
        • - The difference function now performs a shallow flatten - instead of a deep one when computing array differences. -
        • -
        • - The debounce function now takes an immediate - parameter, which will cause the callback to fire on the leading - instead of the trailing edge. -
        • -
        -

        - -

        - 1.3.1Jan. 23, 2012
        -

          -
        • - Added an _.has function, as a safer way to use hasOwnProperty. -
        • -
        • - Added _.collect as an alias for _.map. Smalltalkers, rejoice. -
        • -
        • - Reverted an old change so that _.extend will correctly copy - over keys with undefined values again. -
        • -
        • - Bugfix to stop escaping slashes within interpolations in _.template. -
        • -
        -

        - -

        - 1.3.0Jan. 11, 2012
        -

          -
        • - Removed AMD (RequireJS) support from Underscore. If you'd like to use - Underscore with RequireJS, you can load it as a normal script, wrap - or patch your copy, or download a forked version. -
        • -
        -

        - -

        - 1.2.4Jan. 4, 2012
        -

          -
        • - You now can (and probably should, as it's simpler) - write _.chain(list) - instead of _(list).chain(). -
        • -
        • - Fix for escaped characters in Underscore templates, and for supporting - customizations of _.templateSettings that only define one or - two of the required regexes. -
        • -
        • - Fix for passing an array as the first argument to an _.wrap'd function. -
        • -
        • - Improved compatibility with ClojureScript, which adds a call - function to String.prototype. -
        • -
        -

        - -

        - 1.2.3Dec. 7, 2011
        -

          -
        • - Dynamic scope is now preserved for compiled _.template functions, - so you can use the value of this if you like. -
        • -
        • - Sparse array support of _.indexOf, _.lastIndexOf. -
        • -
        • - Both _.reduce and _.reduceRight can now be passed an - explicitly undefined value. (There's no reason why you'd - want to do this.) -
        • -
        -

        - -

        - 1.2.2Nov. 14, 2011
        -

          -
        • - Continued tweaks to _.isEqual semantics. Now JS primitives are - considered equivalent to their wrapped versions, and arrays are compared - by their numeric properties only (#351). -
        • -
        • - _.escape no longer tries to be smart about not double-escaping - already-escaped HTML entities. Now it just escapes regardless (#350). -
        • -
        • - In _.template, you may now leave semicolons out of evaluated - statements if you wish: <% }) %> (#369). -
        • -
        • - _.after(callback, 0) will now trigger the callback immediately, - making "after" easier to use with asynchronous APIs (#366). -
        • -
        -

        - -

        - 1.2.1Oct. 24, 2011
        -

          -
        • - Several important bug fixes for _.isEqual, which should now - do better on mutated Arrays, and on non-Array objects with - length properties. (#329) -
        • -
        • - jrburke contributed Underscore exporting for AMD module loaders, - and tonylukasavage for Appcelerator Titanium. - (#335, #338) -
        • -
        • - You can now _.groupBy(list, 'property') as a shortcut for - grouping values by a particular common property. -
        • -
        • - _.throttle'd functions now fire immediately upon invocation, - and are rate-limited thereafter (#170, #266). -
        • -
        • - Most of the _.is[Type] checks no longer ducktype. -
        • -
        • - The _.bind function now also works on constructors, a-la - ES5 ... but you would never want to use _.bind on a - constructor function. -
        • -
        • - _.clone no longer wraps non-object types in Objects. -
        • -
        • - _.find and _.filter are now the preferred names for - _.detect and _.select. -
        • -
        -

        - -

        - 1.2.0Oct. 5, 2011
        -

          -
        • - The _.isEqual function now - supports true deep equality comparisons, with checks for cyclic structures, - thanks to Kit Cambridge. -
        • -
        • - Underscore templates now support HTML escaping interpolations, using - <%- ... %> syntax. -
        • -
        • - Ryan Tenney contributed _.shuffle, which uses a modified - Fisher-Yates to give you a shuffled copy of an array. -
        • -
        • - _.uniq can now be passed an optional iterator, to determine by - what criteria an object should be considered unique. -
        • -
        • - _.last now takes an optional argument which will return the last - N elements of the list. -
        • -
        • - A new _.initial function was added, as a mirror of _.rest, - which returns all the initial values of a list (except the last N). -
        • -
        -

        - -

        - 1.1.7July 13, 2011
        - Added _.groupBy, which aggregates a collection into groups of like items. - Added _.union and _.difference, to complement the - (re-named) _.intersection. - Various improvements for support of sparse arrays. - _.toArray now returns a clone, if directly passed an array. - _.functions now also returns the names of functions that are present - in the prototype chain. -

        - -

        - 1.1.6April 18, 2011
        - Added _.after, which will return a function that only runs after - first being called a specified number of times. - _.invoke can now take a direct function reference. - _.every now requires an iterator function to be passed, which - mirrors the ECMA5 API. - _.extend no longer copies keys when the value is undefined. - _.bind now errors when trying to bind an undefined value. -

        - -

        - 1.1.5Mar 20, 2011
        - Added an _.defaults function, for use merging together JS objects - representing default options. - Added an _.once function, for manufacturing functions that should - only ever execute a single time. - _.bind now delegates to the native ECMAScript 5 version, - where available. - _.keys now throws an error when used on non-Object values, as in - ECMAScript 5. - Fixed a bug with _.keys when used over sparse arrays. -

        - -

        - 1.1.4Jan 9, 2011
        - Improved compliance with ES5's Array methods when passing null - as a value. _.wrap now correctly sets this for the - wrapped function. _.indexOf now takes an optional flag for - finding the insertion index in an array that is guaranteed to already - be sorted. Avoiding the use of .callee, to allow _.isArray - to work properly in ES5's strict mode. -

        - -

        - 1.1.3Dec 1, 2010
        - In CommonJS, Underscore may now be required with just:
        - var _ = require("underscore"). - Added _.throttle and _.debounce functions. - Removed _.breakLoop, in favor of an ECMA5-style un-break-able - each implementation — this removes the try/catch, and you'll now have - better stack traces for exceptions that are thrown within an Underscore iterator. - Improved the isType family of functions for better interoperability - with Internet Explorer host objects. - _.template now correctly escapes backslashes in templates. - Improved _.reduce compatibility with the ECMA5 version: - if you don't pass an initial value, the first item in the collection is used. - _.each no longer returns the iterated collection, for improved - consistency with ES5's forEach. -

        - -

        - 1.1.2
        - Fixed _.contains, which was mistakenly pointing at - _.intersect instead of _.include, like it should - have been. Added _.unique as an alias for _.uniq. -

        - -

        - 1.1.1
        - Improved the speed of _.template, and its handling of multiline - interpolations. Ryan Tenney contributed optimizations to many Underscore - functions. An annotated version of the source code is now available. -

        - -

        - 1.1.0
        - The method signature of _.reduce has been changed to match - the ECMAScript 5 signature, instead of the Ruby/Prototype.js version. - This is a backwards-incompatible change. _.template may now be - called with no arguments, and preserves whitespace. _.contains - is a new alias for _.include. -

        - -

        - 1.0.4
        - Andri Möll contributed the _.memoize - function, which can be used to speed up expensive repeated computations - by caching the results. -

        - -

        - 1.0.3
        - Patch that makes _.isEqual return false if any property - of the compared object has a NaN value. Technically the correct - thing to do, but of questionable semantics. Watch out for NaN comparisons. -

        - -

        - 1.0.2
        - Fixes _.isArguments in recent versions of Opera, which have - arguments objects as real Arrays. -

        - -

        - 1.0.1
        - Bugfix for _.isEqual, when comparing two objects with the same - number of undefined keys, but with different names. -

        - -

        - 1.0.0
        - Things have been stable for many months now, so Underscore is now - considered to be out of beta, at 1.0. Improvements since 0.6 - include _.isBoolean, and the ability to have _.extend - take multiple source objects. -

        - -

        - 0.6.0
        - Major release. Incorporates a number of - Mile Frawley's refactors for - safer duck-typing on collection functions, and cleaner internals. A new - _.mixin method that allows you to extend Underscore with utility - functions of your own. Added _.times, which works the same as in - Ruby or Prototype.js. Native support for ECMAScript 5's Array.isArray, - and Object.keys. -

        - -

        - 0.5.8
        - Fixed Underscore's collection functions to work on - NodeLists and - HTMLCollections - once more, thanks to - Justin Tulloss. -

        - -

        - 0.5.7
        - A safer implementation of _.isArguments, and a - faster _.isNumber,
        thanks to - Jed Schmidt. -

        - -

        - 0.5.6
        - Customizable delimiters for _.template, contributed by - Noah Sloan. -

        - -

        - 0.5.5
        - Fix for a bug in MobileSafari's OOP-wrapper, with the arguments object. -

        - -

        - 0.5.4
        - Fix for multiple single quotes within a template string for - _.template. See: - Rick Strahl's blog post. -

        - -

        - 0.5.2
        - New implementations of isArray, isDate, isFunction, - isNumber, isRegExp, and isString, thanks to - a suggestion from - Robert Kieffer. - Instead of doing Object#toString - comparisons, they now check for expected properties, which is less safe, - but more than an order of magnitude faster. Most other Underscore - functions saw minor speed improvements as a result. - Evgeniy Dolzhenko - contributed _.tap, - similar to Ruby 1.9's, - which is handy for injecting side effects (like logging) into chained calls. -

        - -

        - 0.5.1
        - Added an _.isArguments function. Lots of little safety checks - and optimizations contributed by - Noah Sloan and - Andri Möll. -

        - -

        - 0.5.0
        - [API Changes] _.bindAll now takes the context object as - its first parameter. If no method names are passed, all of the context - object's methods are bound to it, enabling chaining and easier binding. - _.functions now takes a single argument and returns the names - of its Function properties. Calling _.functions(_) will get you - the previous behavior. - Added _.isRegExp so that isEqual can now test for RegExp equality. - All of the "is" functions have been shrunk down into a single definition. - Karl Guertin contributed patches. -

        - -

        - 0.4.7
        - Added isDate, isNaN, and isNull, for completeness. - Optimizations for isEqual when checking equality between Arrays - or Dates. _.keys is now 25%–2X faster (depending on your - browser) which speeds up the functions that rely on it, such as _.each. -

        - -

        - 0.4.6
        - Added the range function, a port of the - Python - function of the same name, for generating flexibly-numbered lists - of integers. Original patch contributed by - Kirill Ishanov. -

        - -

        - 0.4.5
        - Added rest for Arrays and arguments objects, and aliased - first as head, and rest as tail, - thanks to Luke Sutton's patches. - Added tests ensuring that all Underscore Array functions also work on - arguments objects. -

        - -

        - 0.4.4
        - Added isString, and isNumber, for consistency. Fixed - _.isEqual(NaN, NaN) to return true (which is debatable). -

        - -

        - 0.4.3
        - Started using the native StopIteration object in browsers that support it. - Fixed Underscore setup for CommonJS environments. -

        - -

        - 0.4.2
        - Renamed the unwrapping function to value, for clarity. -

        - -

        - 0.4.1
        - Chained Underscore objects now support the Array prototype methods, so - that you can perform the full range of operations on a wrapped array - without having to break your chain. Added a breakLoop method - to break in the middle of any Underscore iteration. Added an - isEmpty function that works on arrays and objects. -

        - -

        - 0.4.0
        - All Underscore functions can now be called in an object-oriented style, - like so: _([1, 2, 3]).map(...);. Original patch provided by - Marc-André Cournoyer. - Wrapped objects can be chained through multiple - method invocations. A functions method - was added, providing a sorted list of all the functions in Underscore. -

        - -

        - 0.3.3
        - Added the JavaScript 1.8 function reduceRight. Aliased it - as foldr, and aliased reduce as foldl. -

        - -

        - 0.3.2
        - Now runs on stock Rhino - interpreters with: load("underscore.js"). - Added identity as a utility function. -

        - -

        - 0.3.1
        - All iterators are now passed in the original collection as their third - argument, the same as JavaScript 1.6's forEach. Iterating over - objects is now called with (value, key, collection), for details - see _.each. -

        - -

        - 0.3.0
        - Added Dmitry Baranovskiy's - comprehensive optimizations, merged in - Kris Kowal's patches to make Underscore - CommonJS and - Narwhal compliant. -

        - -

        - 0.2.0
        - Added compose and lastIndexOf, renamed inject to - reduce, added aliases for inject, filter, - every, some, and forEach. -

        - -

        - 0.1.1
        - Added noConflict, so that the "Underscore" object can be assigned to - other variables. -

        - -

        - 0.1.0
        - Initial release of Underscore.js. -

        - -

        - - A DocumentCloud Project - -

        - -
        - -
        - - - - - - diff --git a/Phaser/node_modules/grunt/node_modules/js-yaml/node_modules/argparse/node_modules/underscore/package.json b/Phaser/node_modules/grunt/node_modules/js-yaml/node_modules/argparse/node_modules/underscore/package.json deleted file mode 100644 index 8d6d7955..00000000 --- a/Phaser/node_modules/grunt/node_modules/js-yaml/node_modules/argparse/node_modules/underscore/package.json +++ /dev/null @@ -1,36 +0,0 @@ -{ - "name": "underscore", - "description": "JavaScript's functional programming helper library.", - "homepage": "http://underscorejs.org", - "keywords": [ - "util", - "functional", - "server", - "client", - "browser" - ], - "author": { - "name": "Jeremy Ashkenas", - "email": "jeremy@documentcloud.org" - }, - "repository": { - "type": "git", - "url": "git://github.com/documentcloud/underscore.git" - }, - "main": "underscore.js", - "version": "1.4.4", - "devDependencies": { - "phantomjs": "0.2.2" - }, - "scripts": { - "test": "phantomjs test/vendor/runner.js test/index.html?noglobals=true" - }, - "readme": " __\n /\\ \\ __\n __ __ ___ \\_\\ \\ __ _ __ ____ ___ ___ _ __ __ /\\_\\ ____\n /\\ \\/\\ \\ /' _ `\\ /'_ \\ /'__`\\/\\ __\\/ ,__\\ / ___\\ / __`\\/\\ __\\/'__`\\ \\/\\ \\ /',__\\\n \\ \\ \\_\\ \\/\\ \\/\\ \\/\\ \\ \\ \\/\\ __/\\ \\ \\//\\__, `\\/\\ \\__//\\ \\ \\ \\ \\ \\//\\ __/ __ \\ \\ \\/\\__, `\\\n \\ \\____/\\ \\_\\ \\_\\ \\___,_\\ \\____\\\\ \\_\\\\/\\____/\\ \\____\\ \\____/\\ \\_\\\\ \\____\\/\\_\\ _\\ \\ \\/\\____/\n \\/___/ \\/_/\\/_/\\/__,_ /\\/____/ \\/_/ \\/___/ \\/____/\\/___/ \\/_/ \\/____/\\/_//\\ \\_\\ \\/___/\n \\ \\____/\n \\/___/\n\nUnderscore.js is a utility-belt library for JavaScript that provides\nsupport for the usual functional suspects (each, map, reduce, filter...)\nwithout extending any core JavaScript objects.\n\nFor Docs, License, Tests, and pre-packed downloads, see:\nhttp://underscorejs.org\n\nMany thanks to our contributors:\nhttps://github.com/documentcloud/underscore/contributors\n", - "readmeFilename": "README.md", - "_id": "underscore@1.4.4", - "dist": { - "shasum": "401fc6bfa46b28a658d6e3ad7593aa91b0123f14" - }, - "_from": "underscore@~1.4.3", - "_resolved": "https://registry.npmjs.org/underscore/-/underscore-1.4.4.tgz" -} diff --git a/Phaser/node_modules/grunt/node_modules/js-yaml/node_modules/argparse/package.json b/Phaser/node_modules/grunt/node_modules/js-yaml/node_modules/argparse/package.json deleted file mode 100644 index b25fe8fc..00000000 --- a/Phaser/node_modules/grunt/node_modules/js-yaml/node_modules/argparse/package.json +++ /dev/null @@ -1,54 +0,0 @@ -{ - "name": "argparse", - "description": "Very powerful CLI arguments parser. Native port of argparse - python's options parsing library", - "version": "0.1.13", - "keywords": [ - "cli", - "parser", - "argparse", - "option", - "args" - ], - "homepage": "https://github.com/nodeca/argparse", - "contributors": [ - { - "name": "Eugene Shkuropat" - }, - { - "name": "Paul Jacobson" - } - ], - "bugs": { - "url": "https://github.com/nodeca/argparse/issues" - }, - "license": { - "type": "MIT", - "url": "https://github.com/nodeca/argparse/blob/master/LICENSE" - }, - "repository": { - "type": "git", - "url": "git://github.com/nodeca/argparse.git" - }, - "main": "./index.js", - "scripts": { - "test": "make test" - }, - "dependencies": { - "underscore": "~1.4.3", - "underscore.string": "~2.3.1" - }, - "devDependencies": { - "mocha": "*" - }, - "engines": { - "node": ">= 0.6.0" - }, - "readme": "argparse\n========\n\n[![Build Status](https://secure.travis-ci.org/nodeca/argparse.png?branch=master)](http://travis-ci.org/nodeca/argparse)\n\nCLI arguments parser for node.js. Javascript port of python's\n[argparse](http://docs.python.org/dev/library/argparse.html) module\n(original version 3.2). That's a full port, except some very rare options,\nrecorded in issue tracker.\n\n**NB.** Method names changed to camelCase. See [generated docs](http://nodeca.github.com/argparse/).\n\n\nExample\n=======\n\ntest.js file:\n\n```javascript\n#!/usr/bin/env node\n'use strict';\n\nvar ArgumentParser = require('../lib/argparse').ArgumentParser;\nvar parser = new ArgumentParser({\n version: '0.0.1',\n addHelp:true,\n description: 'Argparse example'\n});\nparser.addArgument(\n [ '-f', '--foo' ],\n {\n help: 'foo bar'\n }\n);\nparser.addArgument(\n [ '-b', '--bar' ],\n {\n help: 'bar foo'\n }\n);\nvar args = parser.parseArgs();\nconsole.dir(args);\n```\n\nDisplay help:\n\n```\n$ ./test.js -h\nusage: example.js [-h] [-v] [-f FOO] [-b BAR]\n\nArgparse example\n\nOptional arguments:\n -h, --help Show this help message and exit.\n -v, --version Show program's version number and exit.\n -f FOO, --foo FOO foo bar\n -b BAR, --bar BAR bar foo\n```\n\nParse arguments:\n\n```\n$ ./test.js -f=3 --bar=4\n{ foo: '3', bar: '4' }\n```\n\nMore [examples](https://github.com/nodeca/argparse/tree/master/examples).\n\n\nArgumentParser objects\n======================\n\n```\nnew ArgumentParser({paramters hash});\n```\n\nCreates a new ArgumentParser object.\n\n**Supported params:**\n\n- ```description``` - Text to display before the argument help.\n- ```epilog``` - Text to display after the argument help.\n- ```addHelp``` - Add a -h/–help option to the parser. (default: True)\n- ```argumentDefault``` - Set the global default value for arguments. (default: None)\n- ```parents``` - A list of ArgumentParser objects whose arguments should also be included.\n- ```prefixChars``` - The set of characters that prefix optional arguments. (default: ‘-‘)\n- ```formatterClass``` - A class for customizing the help output.\n- ```prog``` - The name of the program (default: sys.argv[0])\n- ```usage``` - The string describing the program usage (default: generated)\n- ```conflictHandler``` - Usually unnecessary, defines strategy for resolving conflicting optionals.\n\n**Not supportied yet**\n\n- ```fromfilePrefixChars``` - The set of characters that prefix files from which additional arguments should be read.\n\n\nDetails in [original ArgumentParser guide](http://docs.python.org/dev/library/argparse.html#argumentparser-objects)\n\n\naddArgument() method\n====================\n\n```\nArgumentParser.addArgument([names or flags], {options})\n```\n\nDefines how a single command-line argument should be parsed.\n\n- ```name or flags``` - Either a name or a list of option strings, e.g. foo or -f, --foo.\n\nOptions:\n\n- ```action``` - The basic type of action to be taken when this argument is encountered at the command line.\n- ```nargs```- The number of command-line arguments that should be consumed.\n- ```constant``` - A constant value required by some action and nargs selections.\n- ```defaultValue``` - The value produced if the argument is absent from the command line.\n- ```type``` - The type to which the command-line argument should be converted.\n- ```choices``` - A container of the allowable values for the argument.\n- ```required``` - Whether or not the command-line option may be omitted (optionals only).\n- ```help``` - A brief description of what the argument does.\n- ```metavar``` - A name for the argument in usage messages.\n- ```dest``` - The name of the attribute to be added to the object returned by parseArgs().\n\nDetails in [original add_argument guide](http://docs.python.org/dev/library/argparse.html#the-add-argument-method)\n\n\nAction (some details)\n================\n\nArgumentParser objects associate command-line arguments with actions.\nThese actions can do just about anything with the command-line arguments associated\nwith them, though most actions simply add an attribute to the object returned by\nparseArgs(). The action keyword argument specifies how the command-line arguments\nshould be handled. The supported actions are:\n\n- ```store``` - Just stores the argument’s value. This is the default action.\n- ```storeConst``` - Stores value, specified by the const keyword argument.\n (Note that the const keyword argument defaults to the rather unhelpful None.)\n The 'storeConst' action is most commonly used with optional arguments, that\n specify some sort of flag.\n- ```storeTrue``` and ```storeFalse``` - Stores values True and False\n respectively. These are special cases of 'storeConst'.\n- ```append``` - Stores a list, and appends each argument value to the list.\n This is useful to allow an option to be specified multiple times.\n- ```appendConst``` - Stores a list, and appends value, specified by the\n const keyword argument to the list. (Note, that the const keyword argument defaults\n is None.) The 'appendConst' action is typically used when multiple arguments need\n to store constants to the same list.\n- ```count``` - Counts the number of times a keyword argument occurs. For example,\n used for increasing verbosity levels.\n- ```help``` - Prints a complete help message for all the options in the current\n parser and then exits. By default a help action is automatically added to the parser.\n See ArgumentParser for details of how the output is created.\n- ```version``` - Prints version information and exit. Expects a `version=`\n keyword argument in the addArgument() call.\n\nDetails in [original action guide](http://docs.python.org/dev/library/argparse.html#action)\n\n\nSub-commands\n============\n\nArgumentParser.addSubparsers()\n\nMany programs split their functionality into a number of sub-commands, for\nexample, the svn program can invoke sub-commands like `svn checkout`, `svn update`,\nand `svn commit`. Splitting up functionality this way can be a particularly good\nidea when a program performs several different functions which require different\nkinds of command-line arguments. `ArgumentParser` supports creation of such\nsub-commands with `addSubparsers()` method. The `addSubparsers()` method is\nnormally called with no arguments and returns an special action object.\nThis object has a single method `addParser()`, which takes a command name and\nany `ArgumentParser` constructor arguments, and returns an `ArgumentParser` object\nthat can be modified as usual.\n\nExample:\n\nsub_commands.js\n```javascript\n#!/usr/bin/env node\n'use strict';\n\nvar ArgumentParser = require('../lib/argparse').ArgumentParser;\nvar parser = new ArgumentParser({\n version: '0.0.1',\n addHelp:true,\n description: 'Argparse examples: sub-commands',\n});\n\nvar subparsers = parser.addSubparsers({\n title:'subcommands',\n dest:\"subcommand_name\"\n});\n\nvar bar = subparsers.addParser('c1', {addHelp:true});\nbar.addArgument(\n [ '-f', '--foo' ],\n {\n action: 'store',\n help: 'foo3 bar3'\n }\n);\nvar bar = subparsers.addParser(\n 'c2',\n {aliases:['co'], addHelp:true}\n);\nbar.addArgument(\n [ '-b', '--bar' ],\n {\n action: 'store',\n type: 'int',\n help: 'foo3 bar3'\n }\n);\n\nvar args = parser.parseArgs();\nconsole.dir(args);\n\n```\n\nDetails in [original sub-commands guide](http://docs.python.org/dev/library/argparse.html#sub-commands)\n\n\nContributors\n============\n\n- [Eugene Shkuropat](https://github.com/shkuropat)\n- [Paul Jacobson](https://github.com/hpaulj)\n\n[others](https://github.com/nodeca/argparse/graphs/contributors)\n\nLicense\n=======\n\nCopyright (c) 2012 [Vitaly Puzrin](https://github.com/puzrin).\nReleased under the MIT license. See\n[LICENSE](https://github.com/nodeca/argparse/blob/master/LICENSE) for details.\n\n\n", - "readmeFilename": "README.md", - "_id": "argparse@0.1.13", - "dist": { - "shasum": "645c024a7b8ed80970450c2185c9864f79f8ada0" - }, - "_from": "argparse@~ 0.1.11", - "_resolved": "https://registry.npmjs.org/argparse/-/argparse-0.1.13.tgz" -} diff --git a/Phaser/node_modules/grunt/node_modules/js-yaml/package.json b/Phaser/node_modules/grunt/node_modules/js-yaml/package.json deleted file mode 100644 index 3343344c..00000000 --- a/Phaser/node_modules/grunt/node_modules/js-yaml/package.json +++ /dev/null @@ -1,63 +0,0 @@ -{ - "name": "js-yaml", - "version": "2.0.4", - "description": "YAML 1.2 parser and serializer", - "keywords": [ - "yaml", - "parser", - "serializer", - "pyyaml" - ], - "homepage": "https://github.com/nodeca/js-yaml", - "author": { - "name": "Dervus Grim", - "email": "dervus@lavabit.com" - }, - "contributors": [ - { - "name": "Aleksey V Zapparov", - "email": "ixti@member.fsf.org", - "url": "http://www.ixti.net/" - }, - { - "name": "Martin Grenfell", - "email": "martin.grenfell@gmail.com", - "url": "http://got-ravings.blogspot.com" - } - ], - "bugs": { - "url": "https://github.com/nodeca/js-yaml/issues" - }, - "license": { - "type": "MIT", - "url": "https://github.com/nodeca/js-yaml/blob/master/LICENSE" - }, - "repository": { - "type": "git", - "url": "git://github.com/nodeca/js-yaml.git" - }, - "main": "./index.js", - "bin": { - "js-yaml": "bin/js-yaml.js" - }, - "scripts": { - "test": "make test" - }, - "dependencies": { - "argparse": "~ 0.1.11" - }, - "devDependencies": { - "mocha": "*" - }, - "engines": { - "node": ">= 0.6.0" - }, - "readme": "JS-YAML - YAML 1.2 parser and serializer for JavaScript\n=======================================================\n\n[![Build Status](https://secure.travis-ci.org/nodeca/js-yaml.png)](http://travis-ci.org/nodeca/js-yaml)\n\n[Online Demo](http://nodeca.github.com/js-yaml/)\n\n\nThis is an implementation of [YAML](http://yaml.org/), a human friendly data\nserialization language. Started as [PyYAML](http://pyyaml.org/) port, it was\ncompletely rewritten from scratch. Now it's very fast, and supports 1.2 spec.\n\n\nBreaking changes in 1.x.x -> 2.0.x\n----------------------------------\n\nIf your have not used __custom__ tags or loader classes - no changes needed. Just\nupgrade library and enjoy high parse speed.\n\nIn other case, you should rewrite your tag constructors and custom loader\nclasses, to conform new schema-based API. See\n[examples](https://github.com/nodeca/js-yaml/tree/master/examples) and\n[wiki](https://github.com/nodeca/js-yaml/wiki) for details.\nNote, that parser internals were completely rewritten.\n\n\nInstallation\n------------\n\n### YAML module for node.js\n\n```\nnpm install js-yaml\n```\n\n\n### CLI executable\n\nIf you want to inspect your YAML files from CLI, install js-yaml globally:\n\n```\nnpm install js-yaml -g\n```\n\n#### Usage\n\n```\nusage: js-yaml [-h] [-v] [-c] [-j] [-t] file\n\nPositional arguments:\n file File with YAML document(s)\n\nOptional arguments:\n -h, --help Show this help message and exit.\n -v, --version Show program's version number and exit.\n -c, --compact Display errors in compact mode\n -j, --to-json Output a non-funky boring JSON\n -t, --trace Show stack trace on error\n```\n\n\n### Bundled YAML library for browsers\n\n``` html\n\n\n```\n\nBrowser support was done mostly for online demo. If you find any errors - feel\nfree to send pull requests with fixes. Also note, that IE and other old browsers\nneeds [es5-shims](https://github.com/kriskowal/es5-shim) to operate.\n\n\nAPI\n---\n\nHere we cover the most 'useful' methods. If you need advanced details (creating\nyour own tags), see [wiki](https://github.com/nodeca/js-yaml/wiki) and\n[examples](https://github.com/nodeca/js-yaml/tree/master/examples) for more\ninfo.\n\nIn node.js JS-YAML automatically registers handlers for `.yml` and `.yaml`\nfiles. You can load them just with `require`. That's mostly equivalent to\ncalling `load()` on fetched content of a file. Just with one string!\n\n``` javascript\nrequire('js-yaml');\n\n// Get document, or throw exception on error\ntry {\n var doc = require('/home/ixti/example.yml');\n console.log(doc);\n} catch (e) {\n console.log(e);\n}\n```\n\n\n### load (string [ , options ])\n\nParses `string` as single YAML document. Returns a JavaScript object or throws\n`YAMLException` on error.\n\nNOTE: This function **does not** understands multi-document sources, it throws\nexception on those.\n\noptions:\n\n- `filename` _(default: null)_ - string to be used as a file path in\n error/warning messages.\n- `strict` _(default - false)_ makes the loader to throw errors instead of\n warnings.\n- `schema` _(default: `DEFAULT_SCHEMA`)_ - specifies a schema to use.\n\n\n### loadAll (string, iterator [ , options ])\n\nSame as `load()`, but understands multi-document sources and apply `iterator` to\neach document.\n\n``` javascript\nvar yaml = require('js-yaml');\n\nyaml.loadAll(data, function (doc) {\n console.log(doc);\n});\n```\n\n\n### safeLoad (string [ , options ])\n\nSame as `load()` but uses `SAFE_SCHEMA` by default - only recommended tags of\nYAML specification (no JavaScript-specific tags, e.g. `!!js/regexp`).\n\n\n### safeLoadAll (string, iterator [ , options ])\n\nSame as `loadAll()` but uses `SAFE_SCHEMA` by default - only recommended tags of\nYAML specification (no JavaScript-specific tags, e.g. `!!js/regexp`).\n\n\n### dump (object [ , options ])\n\nSerializes `object` as YAML document.\n\noptions:\n\n- `indent` _(default: 2)_ - indentation width to use (in spaces).\n- `flowLevel` (default: -1) - specifies level of nesting, when to switch from\n block to flow style for collections. -1 means block style everwhere\n- `styles` - \"tag\" => \"style\" map. Each tag may have own set of styles.\n- `schema` _(default: `DEFAULT_SCHEMA`)_ specifies a schema to use.\n\nstyles:\n\n``` none\n!!null\n \"canonical\" => \"~\"\n\n!!int\n \"binary\" => \"0b1\", \"0b101010\", \"0b1110001111010\"\n \"octal\" => \"01\", \"052\", \"016172\"\n \"decimal\" => \"1\", \"42\", \"7290\"\n \"hexadecimal\" => \"0x1\", \"0x2A\", \"0x1C7A\"\n\n!!null, !!bool, !!float\n \"lowercase\" => \"null\", \"true\", \"false\", \".nan\", '.inf'\n \"uppercase\" => \"NULL\", \"TRUE\", \"FALSE\", \".NAN\", '.INF'\n \"camelcase\" => \"Null\", \"True\", \"False\", \".NaN\", '.Inf'\n```\n\nBy default, !!int uses `decimal`, and !!null, !!bool, !!float use `lowercase`.\n\n\n### safeDump (object [ , options ])\n\nSame as `dump()` but uses `SAFE_SCHEMA` by default - only recommended tags of\nYAML specification (no JavaScript-specific tags, e.g. `!!js/regexp`).\n\n\nSupported YAML types\n--------------------\n\nThe list of standard YAML tags and corresponding JavaScipt types. See also\n[YAML tag discussion](http://pyyaml.org/wiki/YAMLTagDiscussion) and\n[YAML types repository](http://yaml.org/type/).\n\n```\n!!null '' # null\n!!bool 'yes' # bool\n!!int '3...' # number\n!!float '3.14...' # number\n!!binary '...base64...' # buffer\n!!timestamp 'YYYY-...' # date\n!!omap [ ... ] # array of key-value pairs\n!!pairs [ ... ] # array or array pairs\n!!set { ... } # array of objects with given keys and null values\n!!str '...' # string\n!!seq [ ... ] # array\n!!map { ... } # object\n```\n\n**JavaScript-specific tags**\n\n```\n!!js/regexp /pattern/gim # RegExp\n!!js/undefined '' # Undefined\n!!js/function 'function () {...}' # Function\n```\n\n\n\n\n## Caveats\n\nNote, that you use arrays or objects as key in JS-YAML. JS do not allows objects\nor array as keys, and stringifies (by calling .toString method) them at the\nmoment of adding them.\n\n``` yaml\n---\n? [ foo, bar ]\n: - baz\n? { foo: bar }\n: - baz\n - baz\n```\n\n``` javascript\n{ \"foo,bar\": [\"baz\"], \"[object Object]\": [\"baz\", \"baz\"] }\n```\n\nAlso, reading of properties on implicit block mapping keys is not supported yet.\nSo, the following YAML document cannot be loaded.\n\n``` yaml\n&anchor foo:\n foo: bar\n *anchor: duplicate key\n baz: bat\n *anchor: duplicate key\n```\n\n## License\n\nView the [LICENSE](https://github.com/nodeca/js-yaml/blob/master/LICENSE) file\n(MIT).\n", - "readmeFilename": "README.md", - "_id": "js-yaml@2.0.4", - "dist": { - "shasum": "791f932f9c2267b6038d84784d3b8760e0120329" - }, - "_from": "js-yaml@~2.0.2", - "_resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-2.0.4.tgz" -} diff --git a/Phaser/node_modules/grunt/node_modules/lodash/LICENSE.txt b/Phaser/node_modules/grunt/node_modules/lodash/LICENSE.txt deleted file mode 100644 index b194ad1d..00000000 --- a/Phaser/node_modules/grunt/node_modules/lodash/LICENSE.txt +++ /dev/null @@ -1,22 +0,0 @@ -Copyright 2012 John-David Dalton -Based on Underscore.js 1.3.3, copyright 2009-2012 Jeremy Ashkenas, -DocumentCloud Inc. - -Permission is hereby granted, free of charge, to any person obtaining -a copy of this software and associated documentation files (the -"Software"), to deal in the Software without restriction, including -without limitation the rights to use, copy, modify, merge, publish, -distribute, sublicense, and/or sell copies of the Software, and to -permit persons to whom the Software is furnished to do so, subject to -the following conditions: - -The above copyright notice and this permission notice shall be -included in all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE -LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION -WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. \ No newline at end of file diff --git a/Phaser/node_modules/grunt/node_modules/lodash/README.md b/Phaser/node_modules/grunt/node_modules/lodash/README.md deleted file mode 100644 index cde0ebb9..00000000 --- a/Phaser/node_modules/grunt/node_modules/lodash/README.md +++ /dev/null @@ -1,247 +0,0 @@ -# Lo-Dash v0.9.2 -[![build status](https://secure.travis-ci.org/bestiejs/lodash.png)](http://travis-ci.org/bestiejs/lodash) - -A drop-in replacement[*](https://github.com/bestiejs/lodash/wiki/Drop-in-Disclaimer) for Underscore.js, from the devs behind [jsPerf.com](http://jsperf.com), delivering [performance](http://lodash.com/benchmarks), [bug fixes](https://github.com/bestiejs/lodash#resolved-underscorejs-issues), and [additional features](http://lodash.com/#features). - -Lo-Dash’s performance is gained by avoiding slower native methods, instead opting for simplified non-ES5 compliant methods optimized for common usage, and by leveraging function compilation to reduce the number of overall function calls. - -## Download - - * [Development build](https://raw.github.com/bestiejs/lodash/v0.9.2/lodash.js) - * [Production build](https://raw.github.com/bestiejs/lodash/v0.9.2/lodash.min.js) - * [Underscore build](https://raw.github.com/bestiejs/lodash/v0.9.2/lodash.underscore.min.js) tailored for projects already using Underscore - * CDN copies of ≤ v0.9.2’s [Production](http://cdnjs.cloudflare.com/ajax/libs/lodash.js/0.9.2/lodash.min.js), [Underscore](http://cdnjs.cloudflare.com/ajax/libs/lodash.js/0.9.2/lodash.underscore.min.js), and [Development](http://cdnjs.cloudflare.com/ajax/libs/lodash.js/0.9.2/lodash.js) builds are available on [cdnjs](http://cdnjs.com/) thanks to [CloudFlare](http://www.cloudflare.com/) - * For optimal file size, [create a custom build](https://github.com/bestiejs/lodash#custom-builds) with only the features you need - -## Dive in - -We’ve got [API docs](http://lodash.com/docs), [benchmarks](http://lodash.com/benchmarks), and [unit tests](http://lodash.com/tests). - -Create your own benchmarks at [jsPerf](http://jsperf.com), or [search](http://jsperf.com/search?q=lodash) for existing ones. - -For a list of upcoming features, check out our [roadmap](https://github.com/bestiejs/lodash/wiki/Roadmap). - -## Screencasts - -For more information check out these screencasts over Lo-Dash: - - * [Introducing Lo-Dash](https://vimeo.com/44154599) - * [Lo-Dash optimizations and custom builds](https://vimeo.com/44154601) - * [Lo-Dash’s origin and why it’s a better utility belt](https://vimeo.com/44154600) - * [Unit testing in Lo-Dash](https://vimeo.com/45865290) - * [Lo-Dash’s approach to native method use](https://vimeo.com/48576012) - -## Features - - * AMD loader support ([RequireJS](http://requirejs.org/), [curl.js](https://github.com/cujojs/curl), etc.) - * [_.clone](http://lodash.com/docs#clone) supports *“deepâ€* cloning - * [_.contains](http://lodash.com/docs#contains) accepts a `fromIndex` argument - * [_.forEach](http://lodash.com/docs#forEach) is chainable and supports exiting iteration early - * [_.forIn](http://lodash.com/docs#forIn) for iterating over an object’s own and inherited properties - * [_.forOwn](http://lodash.com/docs#forOwn) for iterating over an object’s own properties - * [_.isPlainObject](http://lodash.com/docs#isPlainObject) checks if values are created by the `Object` constructor - * [_.lateBind](http://lodash.com/docs#lateBind) for late binding - * [_.merge](http://lodash.com/docs#merge) for a *“deepâ€* [_.extend](http://lodash.com/docs#extend) - * [_.partial](http://lodash.com/docs#partial) for partial application without `this` binding - * [_.pick](http://lodash.com/docs#pick) and [_.omit](http://lodash.com/docs#omit) accepts `callback` and `thisArg` arguments - * [_.template](http://lodash.com/docs#template) supports [ES6 delimiters](http://people.mozilla.org/~jorendorff/es6-draft.html#sec-7.8.6) and utilizes [sourceURLs](http://www.html5rocks.com/en/tutorials/developertools/sourcemaps/#toc-sourceurl) for easier debugging - * [_.contains](http://lodash.com/docs#contains), [_.size](http://lodash.com/docs#size), [_.toArray](http://lodash.com/docs#toArray), - [and more…](http://lodash.com/docs "_.countBy, _.every, _.filter, _.find, _.forEach, _.groupBy, _.invoke, _.map, _.max, _.min, _.pluck, _.reduce, _.reduceRight, _.reject, _.shuffle, _.some, _.sortBy, _.where") accept strings - -## Support - -Lo-Dash has been tested in at least Chrome 5~23, Firefox 1~16, IE 6-10, Opera 9.25-12, Safari 3-6, Node.js 0.4.8-0.8.14, Narwhal 0.3.2, RingoJS 0.8, and Rhino 1.7RC5. - -## Custom builds - -Custom builds make it easy to create lightweight versions of Lo-Dash containing only the methods you need. -To top it off, we handle all method dependency and alias mapping for you. - - * Backbone builds, with only methods required by Backbone, may be created using the `backbone` modifier argument. -```bash -lodash backbone -``` - - * CSP builds, supporting default Content Security Policy restrictions, may be created using the `csp` modifier argument. -```bash -lodash csp -``` - - * Legacy builds, tailored for older browsers without [ES5 support](http://es5.github.com/), may be created using the `legacy` modifier argument. -```bash -lodash legacy -``` - - * Mobile builds, with IE < 9 bug fixes and method compilation removed, may be created using the `mobile` modifier argument. -```bash -lodash mobile -``` - - * Strict builds, with `_.bindAll`, `_.defaults`, and `_.extend` in [strict mode](http://es5.github.com/#C), may be created using the `strict` modifier argument. -```bash -lodash strict -``` - - * Underscore builds, tailored for projects already using Underscore, may be created using the `underscore` modifier argument. -```bash -lodash underscore -``` - -Custom builds may be created using the following commands: - - * Use the `category` argument to pass comma separated categories of methods to include in the build.
        - Valid categories (case-insensitive) are *“arraysâ€*, *“chainingâ€*, *“collectionsâ€*, *“functionsâ€*, *“objectsâ€*, and *“utilitiesâ€*. -```bash -lodash category=collections,functions -lodash category="collections, functions" -``` - - * Use the `exports` argument to pass comma separated names of ways to export the `LoDash` function.
        - Valid exports are *“amdâ€*, *“commonjsâ€*, *“globalâ€*, *“nodeâ€*, and *“noneâ€*. -```bash -lodash exports=amd,commonjs,node -lodash exports="amd, commonjs, node" -``` - - * Use the `iife` argument to specify code to replace the immediately-invoked function expression that wraps Lo-Dash. -```bash -lodash iife="!function(window,undefined){%output%}(this)" -``` - - * Use the `include` argument to pass comma separated method/category names to include in the build. -```bash -lodash include=each,filter,map -lodash include="each, filter, map" -``` - - * Use the `minus` argument to pass comma separated method/category names to remove from those included in the build. -```bash -lodash underscore minus=result,shuffle -lodash underscore minus="result, shuffle" -``` - - * Use the `plus` argument to pass comma separated method/category names to add to those included in the build. -```bash -lodash backbone plus=random,template -lodash backbone plus="random, template" -``` - - * Use the `template` argument to pass the file path pattern used to match template files to precompile. -```bash -lodash template="./*.jst" -``` - - * Use the `settings` argument to pass the template settings used when precompiling templates. -```bash -lodash settings="{interpolate:/\\{\\{([\\s\\S]+?)\\}\\}/g}" -``` - - * Use the `moduleId` argument to specify the AMD module ID of Lo-Dash, which defaults to “lodashâ€, used by precompiled templates. -```bash -lodash moduleId="underscore" -``` - -All arguments, except `legacy` with `csp` or `mobile`, may be combined.
        -Unless specified by `-o` or `--output`, all files created are saved to the current working directory. - -The following options are also supported: - - * `-c`, `--stdout`     Write output to standard output - * `-d`, `--debug`       Write only the debug output - * `-h`, `--help`         Display help information - * `-m`, `--minify`     Write only the minified output - * `-o`, `--output`     Write output to a given path/filename - * `-s`, `--silent`     Skip status updates normally logged to the console - * `-V`, `--version`   Output current version of Lo-Dash - -The `lodash` command-line utility is available when Lo-Dash is installed as a global package (i.e. `npm install -g lodash`). - -## Installation and usage - -In browsers: - -```html - -``` - -Using [npm](http://npmjs.org/): - -```bash -npm install lodash - -npm install -g lodash -npm link lodash -``` - -In [Node.js](http://nodejs.org/) and [RingoJS v0.8.0+](http://ringojs.org/): - -```js -var _ = require('lodash'); -``` - -**Note:** If Lo-Dash is installed globally, [run `npm link lodash`](http://blog.nodejs.org/2011/03/23/npm-1-0-global-vs-local-installation/) in your project’s root directory before requiring it. - -In [RingoJS v0.7.0-](http://ringojs.org/): - -```js -var _ = require('lodash')._; -``` - -In [Rhino](http://www.mozilla.org/rhino/): - -```js -load('lodash.js'); -``` - -In an AMD loader like [RequireJS](http://requirejs.org/): - -```js -require({ - 'paths': { - 'underscore': 'path/to/lodash' - } -}, -['underscore'], function(_) { - console.log(_.VERSION); -}); -``` - -## Resolved Underscore.js issues - - * Allow iteration of objects with a `length` property [[#799](https://github.com/documentcloud/underscore/pull/799), [test](https://github.com/bestiejs/lodash/blob/v0.9.2/test/test.js#L545-551)] - * Fix cross-browser object iteration bugs [[#60](https://github.com/documentcloud/underscore/issues/60), [#376](https://github.com/documentcloud/underscore/issues/376), [test](https://github.com/bestiejs/lodash/blob/v0.9.2/test/test.js#L558-582)] - * Methods should work on pages with incorrectly shimmed native methods [[#7](https://github.com/documentcloud/underscore/issues/7), [#742](https://github.com/documentcloud/underscore/issues/742), [test](https://github.com/bestiejs/lodash/blob/v0.9.2/test/test.js#L140-146)] - * `_.isEmpty` should support jQuery/MooTools DOM query collections [[#690](https://github.com/documentcloud/underscore/pull/690), [test](https://github.com/bestiejs/lodash/blob/v0.9.2/test/test.js#L747-752)] - * `_.isObject` should avoid V8 bug [#2291](http://code.google.com/p/v8/issues/detail?id=2291) [[#605](https://github.com/documentcloud/underscore/issues/605), [test](https://github.com/bestiejs/lodash/blob/v0.9.2/test/test.js#L828-840)] - * `_.keys` should work with `arguments` objects cross-browser [[#396](https://github.com/documentcloud/underscore/issues/396), [test](https://github.com/bestiejs/lodash/blob/v0.9.2/test/test.js#L921-923)] - * `_.range` should coerce arguments to numbers [[#634](https://github.com/documentcloud/underscore/issues/634), [#683](https://github.com/documentcloud/underscore/issues/683), [test](https://github.com/bestiejs/lodash/blob/v0.9.2/test/test.js#L1337-1340)] - -## Release Notes - -### v0.9.2 - - * Added `fromIndex` argument to `_.contains` - * Added `moduleId` build option - * Added Closure Compiler *“simpleâ€* optimizations to the build process - * Added support for strings in `_.max` and `_.min` - * Added support for ES6 template delimiters to `_.template` - * Ensured re-minification of Lo-Dash by third parties avoids Closure Compiler bugs - * Optimized `_.every`, `_.find`, `_.some`, and `_.uniq` - -The full changelog is available [here](https://github.com/bestiejs/lodash/wiki/Changelog). - -## BestieJS - -Lo-Dash is part of the BestieJS *“Best in Classâ€* module collection. This means we promote solid browser/environment support, ES5 precedents, unit testing, and plenty of documentation. - -## Author - -* [John-David Dalton](http://allyoucanleet.com/) - [![twitter/jdalton](http://gravatar.com/avatar/299a3d891ff1920b69c364d061007043?s=70)](https://twitter.com/jdalton "Follow @jdalton on Twitter") - -## Contributors - -* [Kit Cambridge](http://kitcambridge.github.com/) - [![twitter/kitcambridge](http://gravatar.com/avatar/6662a1d02f351b5ef2f8b4d815804661?s=70)](https://twitter.com/kitcambridge "Follow @kitcambridge on Twitter") -* [Mathias Bynens](http://mathiasbynens.be/) - [![twitter/mathias](http://gravatar.com/avatar/24e08a9ea84deb17ae121074d0f17125?s=70)](https://twitter.com/mathias "Follow @mathias on Twitter") diff --git a/Phaser/node_modules/grunt/node_modules/lodash/doc/README.md b/Phaser/node_modules/grunt/node_modules/lodash/doc/README.md deleted file mode 100644 index 8ad38fb4..00000000 --- a/Phaser/node_modules/grunt/node_modules/lodash/doc/README.md +++ /dev/null @@ -1,3095 +0,0 @@ -# Lo-Dash v0.9.2 - - - - - - -## `Arrays` -* [`_.compact`](#_compactarray) -* [`_.difference`](#_differencearray--array1-array2-) -* [`_.drop`](#_restarray--n1) -* [`_.first`](#_firstarray--n) -* [`_.flatten`](#_flattenarray-shallow) -* [`_.head`](#_firstarray--n) -* [`_.indexOf`](#_indexofarray-value--fromindex0) -* [`_.initial`](#_initialarray--n1) -* [`_.intersection`](#_intersectionarray1-array2-) -* [`_.last`](#_lastarray--n) -* [`_.lastIndexOf`](#_lastindexofarray-value--fromindexarraylength-1) -* [`_.object`](#_objectkeys--values) -* [`_.range`](#_rangestart0-end--step1) -* [`_.rest`](#_restarray--n1) -* [`_.sortedIndex`](#_sortedindexarray-value--callbackidentityproperty-thisarg) -* [`_.tail`](#_restarray--n1) -* [`_.take`](#_firstarray--n) -* [`_.union`](#_unionarray1-array2-) -* [`_.uniq`](#_uniqarray--issortedfalse-callbackidentity-thisarg) -* [`_.unique`](#_uniqarray--issortedfalse-callbackidentity-thisarg) -* [`_.without`](#_withoutarray--value1-value2-) -* [`_.zip`](#_ziparray1-array2-) - - - - - - -## `Chaining` -* [`_`](#_value) -* [`_.chain`](#_chainvalue) -* [`_.tap`](#_tapvalue-interceptor) -* [`_.prototype.chain`](#_prototypechain) -* [`_.prototype.value`](#_prototypevalue) - - - - - - -## `Collections` -* [`_.all`](#_everycollection--callbackidentity-thisarg) -* [`_.any`](#_somecollection--callbackidentity-thisarg) -* [`_.collect`](#_mapcollection--callbackidentity-thisarg) -* [`_.contains`](#_containscollection-target--fromindex0) -* [`_.countBy`](#_countbycollection-callbackproperty--thisarg) -* [`_.detect`](#_findcollection-callback--thisarg) -* [`_.each`](#_foreachcollection-callback--thisarg) -* [`_.every`](#_everycollection--callbackidentity-thisarg) -* [`_.filter`](#_filtercollection--callbackidentity-thisarg) -* [`_.find`](#_findcollection-callback--thisarg) -* [`_.foldl`](#_reducecollection-callback--accumulator-thisarg) -* [`_.foldr`](#_reducerightcollection-callback--accumulator-thisarg) -* [`_.forEach`](#_foreachcollection-callback--thisarg) -* [`_.groupBy`](#_groupbycollection-callbackproperty--thisarg) -* [`_.include`](#_containscollection-target--fromindex0) -* [`_.inject`](#_reducecollection-callback--accumulator-thisarg) -* [`_.invoke`](#_invokecollection-methodname--arg1-arg2-) -* [`_.map`](#_mapcollection--callbackidentity-thisarg) -* [`_.max`](#_maxcollection--callback-thisarg) -* [`_.min`](#_mincollection--callback-thisarg) -* [`_.pluck`](#_pluckcollection-property) -* [`_.reduce`](#_reducecollection-callback--accumulator-thisarg) -* [`_.reduceRight`](#_reducerightcollection-callback--accumulator-thisarg) -* [`_.reject`](#_rejectcollection--callbackidentity-thisarg) -* [`_.select`](#_filtercollection--callbackidentity-thisarg) -* [`_.shuffle`](#_shufflecollection) -* [`_.size`](#_sizecollection) -* [`_.some`](#_somecollection--callbackidentity-thisarg) -* [`_.sortBy`](#_sortbycollection-callbackproperty--thisarg) -* [`_.toArray`](#_toarraycollection) -* [`_.where`](#_wherecollection-properties) - - - - - - -## `Functions` -* [`_.after`](#_aftern-func) -* [`_.bind`](#_bindfunc--thisarg-arg1-arg2-) -* [`_.bindAll`](#_bindallobject--methodname1-methodname2-) -* [`_.compose`](#_composefunc1-func2-) -* [`_.debounce`](#_debouncefunc-wait-immediate) -* [`_.defer`](#_deferfunc--arg1-arg2-) -* [`_.delay`](#_delayfunc-wait--arg1-arg2-) -* [`_.lateBind`](#_latebindobject-methodname--arg1-arg2-) -* [`_.memoize`](#_memoizefunc--resolver) -* [`_.once`](#_oncefunc) -* [`_.partial`](#_partialfunc--arg1-arg2-) -* [`_.throttle`](#_throttlefunc-wait) -* [`_.wrap`](#_wrapvalue-wrapper) - - - - - - -## `Objects` -* [`_.clone`](#_clonevalue-deep) -* [`_.defaults`](#_defaultsobject--default1-default2-) -* [`_.extend`](#_extendobject--source1-source2-) -* [`_.forIn`](#_forinobject-callback--thisarg) -* [`_.forOwn`](#_forownobject-callback--thisarg) -* [`_.functions`](#_functionsobject) -* [`_.has`](#_hasobject-property) -* [`_.invert`](#_invertobject) -* [`_.isArguments`](#_isargumentsvalue) -* [`_.isArray`](#_isarrayvalue) -* [`_.isBoolean`](#_isbooleanvalue) -* [`_.isDate`](#_isdatevalue) -* [`_.isElement`](#_iselementvalue) -* [`_.isEmpty`](#_isemptyvalue) -* [`_.isEqual`](#_isequala-b) -* [`_.isFinite`](#_isfinitevalue) -* [`_.isFunction`](#_isfunctionvalue) -* [`_.isNaN`](#_isnanvalue) -* [`_.isNull`](#_isnullvalue) -* [`_.isNumber`](#_isnumbervalue) -* [`_.isObject`](#_isobjectvalue) -* [`_.isPlainObject`](#_isplainobjectvalue) -* [`_.isRegExp`](#_isregexpvalue) -* [`_.isString`](#_isstringvalue) -* [`_.isUndefined`](#_isundefinedvalue) -* [`_.keys`](#_keysobject) -* [`_.merge`](#_mergeobject--source1-source2-) -* [`_.methods`](#_functionsobject) -* [`_.omit`](#_omitobject-callback-prop1-prop2--thisarg) -* [`_.pairs`](#_pairsobject) -* [`_.pick`](#_pickobject-callback-prop1-prop2--thisarg) -* [`_.values`](#_valuesobject) - - - - - - -## `Utilities` -* [`_.escape`](#_escapestring) -* [`_.identity`](#_identityvalue) -* [`_.mixin`](#_mixinobject) -* [`_.noConflict`](#_noconflict) -* [`_.random`](#_randommin0-max1) -* [`_.result`](#_resultobject-property) -* [`_.template`](#_templatetext-data-options) -* [`_.times`](#_timesn-callback--thisarg) -* [`_.unescape`](#_unescapestring) -* [`_.uniqueId`](#_uniqueidprefix) - - - - - - -## `Properties` -* [`_.VERSION`](#_version) -* [`_.templateSettings`](#_templatesettings) -* [`_.templateSettings.escape`](#_templatesettingsescape) -* [`_.templateSettings.evaluate`](#_templatesettingsevaluate) -* [`_.templateSettings.interpolate`](#_templatesettingsinterpolate) -* [`_.templateSettings.variable`](#_templatesettingsvariable) - - - - - - - - - - - - -## `“Arrays†Methods` - - - -### `_.compact(array)` -# [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L2554 "View in source") [Ⓣ][1] - -Creates an array with all falsey values of `array` removed. The values `false`, `null`, `0`, `""`, `undefined` and `NaN` are all falsey. - -#### Arguments -1. `array` *(Array)*: The array to compact. - -#### Returns -*(Array)*: Returns a new filtered array. - -#### Example -```js -_.compact([0, 1, false, 2, '', 3]); -// => [1, 2, 3] -``` - -* * * - - - - - - -### `_.difference(array [, array1, array2, ...])` -# [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L2584 "View in source") [Ⓣ][1] - -Creates an array of `array` elements not present in the other arrays using strict equality for comparisons, i.e. `===`. - -#### Arguments -1. `array` *(Array)*: The array to process. -2. `[array1, array2, ...]` *(Array)*: Arrays to check. - -#### Returns -*(Array)*: Returns a new array of `array` elements not present in the other arrays. - -#### Example -```js -_.difference([1, 2, 3, 4, 5], [5, 2, 10]); -// => [1, 3, 4] -``` - -* * * - - - - - - -### `_.first(array [, n])` -# [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L2619 "View in source") [Ⓣ][1] - -Gets the first element of the `array`. Pass `n` to return the first `n` elements of the `array`. - -#### Aliases -*head, take* - -#### Arguments -1. `array` *(Array)*: The array to query. -2. `[n]` *(Number)*: The number of elements to return. - -#### Returns -*(Mixed)*: Returns the first element or an array of the first `n` elements of `array`. - -#### Example -```js -_.first([5, 4, 3, 2, 1]); -// => 5 -``` - -* * * - - - - - - -### `_.flatten(array, shallow)` -# [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L2643 "View in source") [Ⓣ][1] - -Flattens a nested array *(the nesting can be to any depth)*. If `shallow` is truthy, `array` will only be flattened a single level. - -#### Arguments -1. `array` *(Array)*: The array to compact. -2. `shallow` *(Boolean)*: A flag to indicate only flattening a single level. - -#### Returns -*(Array)*: Returns a new flattened array. - -#### Example -```js -_.flatten([1, [2], [3, [[4]]]]); -// => [1, 2, 3, 4]; - -_.flatten([1, [2], [3, [[4]]]], true); -// => [1, 2, 3, [[4]]]; -``` - -* * * - - - - - - -### `_.indexOf(array, value [, fromIndex=0])` -# [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L2685 "View in source") [Ⓣ][1] - -Gets the index at which the first occurrence of `value` is found using strict equality for comparisons, i.e. `===`. If the `array` is already sorted, passing `true` for `fromIndex` will run a faster binary search. - -#### Arguments -1. `array` *(Array)*: The array to search. -2. `value` *(Mixed)*: The value to search for. -3. `[fromIndex=0]` *(Boolean|Number)*: The index to search from or `true` to perform a binary search on a sorted `array`. - -#### Returns -*(Number)*: Returns the index of the matched value or `-1`. - -#### Example -```js -_.indexOf([1, 2, 3, 1, 2, 3], 2); -// => 1 - -_.indexOf([1, 2, 3, 1, 2, 3], 2, 3); -// => 4 - -_.indexOf([1, 1, 2, 2, 3, 3], 2, true); -// => 2 -``` - -* * * - - - - - - -### `_.initial(array [, n=1])` -# [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L2720 "View in source") [Ⓣ][1] - -Gets all but the last element of `array`. Pass `n` to exclude the last `n` elements from the result. - -#### Arguments -1. `array` *(Array)*: The array to query. -2. `[n=1]` *(Number)*: The number of elements to exclude. - -#### Returns -*(Array)*: Returns all but the last element or `n` elements of `array`. - -#### Example -```js -_.initial([3, 2, 1]); -// => [3, 2] -``` - -* * * - - - - - - -### `_.intersection([array1, array2, ...])` -# [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L2741 "View in source") [Ⓣ][1] - -Computes the intersection of all the passed-in arrays using strict equality for comparisons, i.e. `===`. - -#### Arguments -1. `[array1, array2, ...]` *(Array)*: Arrays to process. - -#### Returns -*(Array)*: Returns a new array of unique elements, in order, that are present in **all** of the arrays. - -#### Example -```js -_.intersection([1, 2, 3], [101, 2, 1, 10], [2, 1]); -// => [1, 2] -``` - -* * * - - - - - - -### `_.last(array [, n])` -# [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L2779 "View in source") [Ⓣ][1] - -Gets the last element of the `array`. Pass `n` to return the last `n` elements of the `array`. - -#### Arguments -1. `array` *(Array)*: The array to query. -2. `[n]` *(Number)*: The number of elements to return. - -#### Returns -*(Mixed)*: Returns the last element or an array of the last `n` elements of `array`. - -#### Example -```js -_.last([3, 2, 1]); -// => 1 -``` - -* * * - - - - - - -### `_.lastIndexOf(array, value [, fromIndex=array.length-1])` -# [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L2806 "View in source") [Ⓣ][1] - -Gets the index at which the last occurrence of `value` is found using strict equality for comparisons, i.e. `===`. If `fromIndex` is negative, it is used as the offset from the end of the collection. - -#### Arguments -1. `array` *(Array)*: The array to search. -2. `value` *(Mixed)*: The value to search for. -3. `[fromIndex=array.length-1]` *(Number)*: The index to search from. - -#### Returns -*(Number)*: Returns the index of the matched value or `-1`. - -#### Example -```js -_.lastIndexOf([1, 2, 3, 1, 2, 3], 2); -// => 4 - -_.lastIndexOf([1, 2, 3, 1, 2, 3], 2, 3); -// => 1 -``` - -* * * - - - - - - -### `_.object(keys [, values=[]])` -# [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L2836 "View in source") [Ⓣ][1] - -Creates an object composed from arrays of `keys` and `values`. Pass either a single two dimensional array, i.e. `[[key1, value1], [key2, value2]]`, or two arrays, one of `keys` and one of corresponding `values`. - -#### Arguments -1. `keys` *(Array)*: The array of keys. -2. `[values=[]]` *(Array)*: The array of values. - -#### Returns -*(Object)*: Returns an object composed of the given keys and corresponding values. - -#### Example -```js -_.object(['moe', 'larry', 'curly'], [30, 40, 50]); -// => { 'moe': 30, 'larry': 40, 'curly': 50 } -``` - -* * * - - - - - - -### `_.range([start=0], end [, step=1])` -# [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L2881 "View in source") [Ⓣ][1] - -Creates an array of numbers *(positive and/or negative)* progressing from `start` up to but not including `stop`. This method is a port of Python's `range()` function. See http://docs.python.org/library/functions.html#range. - -#### Arguments -1. `[start=0]` *(Number)*: The start of the range. -2. `end` *(Number)*: The end of the range. -3. `[step=1]` *(Number)*: The value to increment or descrement by. - -#### Returns -*(Array)*: Returns a new range array. - -#### Example -```js -_.range(10); -// => [0, 1, 2, 3, 4, 5, 6, 7, 8, 9] - -_.range(1, 11); -// => [1, 2, 3, 4, 5, 6, 7, 8, 9, 10] - -_.range(0, 30, 5); -// => [0, 5, 10, 15, 20, 25] - -_.range(0, -10, -1); -// => [0, -1, -2, -3, -4, -5, -6, -7, -8, -9] - -_.range(0); -// => [] -``` - -* * * - - - - - - -### `_.rest(array [, n=1])` -# [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L2920 "View in source") [Ⓣ][1] - -The opposite of `_.initial`, this method gets all but the first value of `array`. Pass `n` to exclude the first `n` values from the result. - -#### Aliases -*drop, tail* - -#### Arguments -1. `array` *(Array)*: The array to query. -2. `[n=1]` *(Number)*: The number of elements to exclude. - -#### Returns -*(Array)*: Returns all but the first value or `n` values of `array`. - -#### Example -```js -_.rest([3, 2, 1]); -// => [2, 1] -``` - -* * * - - - - - - -### `_.sortedIndex(array, value [, callback=identity|property, thisArg])` -# [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L2966 "View in source") [Ⓣ][1] - -Uses a binary search to determine the smallest index at which the `value` should be inserted into `array` in order to maintain the sort order of the sorted `array`. If `callback` is passed, it will be executed for `value` and each element in `array` to compute their sort ranking. The `callback` is bound to `thisArg` and invoked with one argument; *(value)*. The `callback` argument may also be the name of a property to order by. - -#### Arguments -1. `array` *(Array)*: The array to iterate over. -2. `value` *(Mixed)*: The value to evaluate. -3. `[callback=identity|property]` *(Function|String)*: The function called per iteration or property name to order by. -4. `[thisArg]` *(Mixed)*: The `this` binding of `callback`. - -#### Returns -*(Number)*: Returns the index at which the value should be inserted into `array`. - -#### Example -```js -_.sortedIndex([20, 30, 50], 40); -// => 2 - -_.sortedIndex([{ 'x': 20 }, { 'x': 30 }, { 'x': 50 }], { 'x': 40 }, 'x'); -// => 2 - -var dict = { - 'wordToNumber': { 'twenty': 20, 'thirty': 30, 'fourty': 40, 'fifty': 50 } -}; - -_.sortedIndex(['twenty', 'thirty', 'fifty'], 'fourty', function(word) { - return dict.wordToNumber[word]; -}); -// => 2 - -_.sortedIndex(['twenty', 'thirty', 'fifty'], 'fourty', function(word) { - return this.wordToNumber[word]; -}, dict); -// => 2 -``` - -* * * - - - - - - -### `_.union([array1, array2, ...])` -# [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L2997 "View in source") [Ⓣ][1] - -Computes the union of the passed-in arrays using strict equality for comparisons, i.e. `===`. - -#### Arguments -1. `[array1, array2, ...]` *(Array)*: Arrays to process. - -#### Returns -*(Array)*: Returns a new array of unique values, in order, that are present in one or more of the arrays. - -#### Example -```js -_.union([1, 2, 3], [101, 2, 1, 10], [2, 1]); -// => [1, 2, 3, 101, 10] -``` - -* * * - - - - - - -### `_.uniq(array [, isSorted=false, callback=identity, thisArg])` -# [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L3031 "View in source") [Ⓣ][1] - -Creates a duplicate-value-free version of the `array` using strict equality for comparisons, i.e. `===`. If the `array` is already sorted, passing `true` for `isSorted` will run a faster algorithm. If `callback` is passed, each element of `array` is passed through a callback` before uniqueness is computed. The `callback` is bound to `thisArg` and invoked with three arguments; *(value, index, array)*. - -#### Aliases -*unique* - -#### Arguments -1. `array` *(Array)*: The array to process. -2. `[isSorted=false]` *(Boolean)*: A flag to indicate that the `array` is already sorted. -3. `[callback=identity]` *(Function)*: The function called per iteration. -4. `[thisArg]` *(Mixed)*: The `this` binding of `callback`. - -#### Returns -*(Array)*: Returns a duplicate-value-free array. - -#### Example -```js -_.uniq([1, 2, 1, 3, 1]); -// => [1, 2, 3] - -_.uniq([1, 1, 2, 2, 3], true); -// => [1, 2, 3] - -_.uniq([1, 2, 1.5, 3, 2.5], function(num) { return Math.floor(num); }); -// => [1, 2, 3] - -_.uniq([1, 2, 1.5, 3, 2.5], function(num) { return this.floor(num); }, Math); -// => [1, 2, 3] -``` - -* * * - - - - - - -### `_.without(array [, value1, value2, ...])` -# [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L3089 "View in source") [Ⓣ][1] - -Creates an array with all occurrences of the passed values removed using strict equality for comparisons, i.e. `===`. - -#### Arguments -1. `array` *(Array)*: The array to filter. -2. `[value1, value2, ...]` *(Mixed)*: Values to remove. - -#### Returns -*(Array)*: Returns a new filtered array. - -#### Example -```js -_.without([1, 2, 1, 0, 3, 1, 4], 0, 1); -// => [2, 3, 4] -``` - -* * * - - - - - - -### `_.zip([array1, array2, ...])` -# [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L3120 "View in source") [Ⓣ][1] - -Groups the elements of each array at their corresponding indexes. Useful for separate data sources that are coordinated through matching array indexes. For a matrix of nested arrays, `_.zip.apply(...)` can transpose the matrix in a similar fashion. - -#### Arguments -1. `[array1, array2, ...]` *(Array)*: Arrays to process. - -#### Returns -*(Array)*: Returns a new array of grouped elements. - -#### Example -```js -_.zip(['moe', 'larry', 'curly'], [30, 40, 50], [true, false, false]); -// => [['moe', 30, true], ['larry', 40, false], ['curly', 50, false]] -``` - -* * * - - - - - - - - - -## `“Chaining†Methods` - - - -### `_(value)` -# [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L242 "View in source") [Ⓣ][1] - -The `lodash` function. - -#### Arguments -1. `value` *(Mixed)*: The value to wrap in a `lodash` instance. - -#### Returns -*(Object)*: Returns a `lodash` instance. - -* * * - - - - - - -### `_.chain(value)` -# [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L3985 "View in source") [Ⓣ][1] - -Wraps the value in a `lodash` wrapper object. - -#### Arguments -1. `value` *(Mixed)*: The value to wrap. - -#### Returns -*(Object)*: Returns the wrapper object. - -#### Example -```js -var stooges = [ - { 'name': 'moe', 'age': 40 }, - { 'name': 'larry', 'age': 50 }, - { 'name': 'curly', 'age': 60 } -]; - -var youngest = _.chain(stooges) - .sortBy(function(stooge) { return stooge.age; }) - .map(function(stooge) { return stooge.name + ' is ' + stooge.age; }) - .first() - .value(); -// => 'moe is 40' -``` - -* * * - - - - - - -### `_.tap(value, interceptor)` -# [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L4012 "View in source") [Ⓣ][1] - -Invokes `interceptor` with the `value` as the first argument, and then returns `value`. The purpose of this method is to "tap into" a method chain, in order to perform operations on intermediate results within the chain. - -#### Arguments -1. `value` *(Mixed)*: The value to pass to `interceptor`. -2. `interceptor` *(Function)*: The function to invoke. - -#### Returns -*(Mixed)*: Returns `value`. - -#### Example -```js -_.chain([1, 2, 3, 200]) - .filter(function(num) { return num % 2 == 0; }) - .tap(alert) - .map(function(num) { return num * num }) - .value(); -// => // [2, 200] (alerted) -// => [4, 40000] -``` - -* * * - - - - - - -### `_.prototype.chain()` -# [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L4030 "View in source") [Ⓣ][1] - -Enables method chaining on the wrapper object. - -#### Returns -*(Mixed)*: Returns the wrapper object. - -#### Example -```js -_([1, 2, 3]).value(); -// => [1, 2, 3] -``` - -* * * - - - - - - -### `_.prototype.value()` -# [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L4047 "View in source") [Ⓣ][1] - -Extracts the wrapped value. - -#### Returns -*(Mixed)*: Returns the wrapped value. - -#### Example -```js -_([1, 2, 3]).value(); -// => [1, 2, 3] -``` - -* * * - - - - - - - - - -## `“Collections†Methods` - - - -### `_.contains(collection, target [, fromIndex=0])` -# [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L1837 "View in source") [Ⓣ][1] - -Checks if a given `target` element is present in a `collection` using strict equality for comparisons, i.e. `===`. If `fromIndex` is negative, it is used as the offset from the end of the collection. - -#### Aliases -*include* - -#### Arguments -1. `collection` *(Array|Object|String)*: The collection to iterate over. -2. `target` *(Mixed)*: The value to check for. -3. `[fromIndex=0]` *(Number)*: The index to search from. - -#### Returns -*(Boolean)*: Returns `true` if the `target` element is found, else `false`. - -#### Example -```js -_.contains([1, 2, 3], 1); -// => true - -_.contains([1, 2, 3], 1, 2); -// => false - -_.contains({ 'name': 'moe', 'age': 40 }, 'moe'); -// => true - -_.contains('curly', 'ur'); -// => true -``` - -* * * - - - - - - -### `_.countBy(collection, callback|property [, thisArg])` -# [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L1879 "View in source") [Ⓣ][1] - -Creates an object composed of keys returned from running each element of `collection` through a `callback`. The corresponding value of each key is the number of times the key was returned by `callback`. The `callback` is bound to `thisArg` and invoked with three arguments; *(value, index|key, collection)*. The `callback` argument may also be the name of a property to count by *(e.g. 'length')*. - -#### Arguments -1. `collection` *(Array|Object|String)*: The collection to iterate over. -2. `callback|property` *(Function|String)*: The function called per iteration or property name to count by. -3. `[thisArg]` *(Mixed)*: The `this` binding of `callback`. - -#### Returns -*(Object)*: Returns the composed aggregate object. - -#### Example -```js -_.countBy([4.3, 6.1, 6.4], function(num) { return Math.floor(num); }); -// => { '4': 1, '6': 2 } - -_.countBy([4.3, 6.1, 6.4], function(num) { return this.floor(num); }, Math); -// => { '4': 1, '6': 2 } - -_.countBy(['one', 'two', 'three'], 'length'); -// => { '3': 2, '5': 1 } -``` - -* * * - - - - - - -### `_.every(collection [, callback=identity, thisArg])` -# [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L1908 "View in source") [Ⓣ][1] - -Checks if the `callback` returns a truthy value for **all** elements of a `collection`. The `callback` is bound to `thisArg` and invoked with three arguments; *(value, index|key, collection)*. - -#### Aliases -*all* - -#### Arguments -1. `collection` *(Array|Object|String)*: The collection to iterate over. -2. `[callback=identity]` *(Function)*: The function called per iteration. -3. `[thisArg]` *(Mixed)*: The `this` binding of `callback`. - -#### Returns -*(Boolean)*: Returns `true` if all elements pass the callback check, else `false`. - -#### Example -```js -_.every([true, 1, null, 'yes'], Boolean); -// => false -``` - -* * * - - - - - - -### `_.filter(collection [, callback=identity, thisArg])` -# [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L1947 "View in source") [Ⓣ][1] - -Examines each element in a `collection`, returning an array of all elements the `callback` returns truthy for. The `callback` is bound to `thisArg` and invoked with three arguments; *(value, index|key, collection)*. - -#### Aliases -*select* - -#### Arguments -1. `collection` *(Array|Object|String)*: The collection to iterate over. -2. `[callback=identity]` *(Function)*: The function called per iteration. -3. `[thisArg]` *(Mixed)*: The `this` binding of `callback`. - -#### Returns -*(Array)*: Returns a new array of elements that passed the callback check. - -#### Example -```js -var evens = _.filter([1, 2, 3, 4, 5, 6], function(num) { return num % 2 == 0; }); -// => [2, 4, 6] -``` - -* * * - - - - - - -### `_.find(collection, callback [, thisArg])` -# [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L1978 "View in source") [Ⓣ][1] - -Examines each element in a `collection`, returning the first one the `callback` returns truthy for. The function returns as soon as it finds an acceptable element, and does not iterate over the entire `collection`. The `callback` is bound to `thisArg` and invoked with three arguments; *(value, index|key, collection)*. - -#### Aliases -*detect* - -#### Arguments -1. `collection` *(Array|Object|String)*: The collection to iterate over. -2. `callback` *(Function)*: The function called per iteration. -3. `[thisArg]` *(Mixed)*: The `this` binding of `callback`. - -#### Returns -*(Mixed)*: Returns the element that passed the callback check, else `undefined`. - -#### Example -```js -var even = _.find([1, 2, 3, 4, 5, 6], function(num) { return num % 2 == 0; }); -// => 2 -``` - -* * * - - - - - - -### `_.forEach(collection, callback [, thisArg])` -# [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L2012 "View in source") [Ⓣ][1] - -Iterates over a `collection`, executing the `callback` for each element in the `collection`. The `callback` is bound to `thisArg` and invoked with three arguments; *(value, index|key, collection)*. Callbacks may exit iteration early by explicitly returning `false`. - -#### Aliases -*each* - -#### Arguments -1. `collection` *(Array|Object|String)*: The collection to iterate over. -2. `callback` *(Function)*: The function called per iteration. -3. `[thisArg]` *(Mixed)*: The `this` binding of `callback`. - -#### Returns -*(Array, Object, String)*: Returns `collection`. - -#### Example -```js -_([1, 2, 3]).forEach(alert).join(','); -// => alerts each number and returns '1,2,3' - -_.forEach({ 'one': 1, 'two': 2, 'three': 3 }, alert); -// => alerts each number (order is not guaranteed) -``` - -* * * - - - - - - -### `_.groupBy(collection, callback|property [, thisArg])` -# [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L2040 "View in source") [Ⓣ][1] - -Creates an object composed of keys returned from running each element of `collection` through a `callback`. The corresponding value of each key is an array of elements passed to `callback` that returned the key. The `callback` is bound to `thisArg` and invoked with three arguments; *(value, index|key, collection)*. The `callback` argument may also be the name of a property to group by *(e.g. 'length')*. - -#### Arguments -1. `collection` *(Array|Object|String)*: The collection to iterate over. -2. `callback|property` *(Function|String)*: The function called per iteration or property name to group by. -3. `[thisArg]` *(Mixed)*: The `this` binding of `callback`. - -#### Returns -*(Object)*: Returns the composed aggregate object. - -#### Example -```js -_.groupBy([4.2, 6.1, 6.4], function(num) { return Math.floor(num); }); -// => { '4': [4.2], '6': [6.1, 6.4] } - -_.groupBy([4.2, 6.1, 6.4], function(num) { return this.floor(num); }, Math); -// => { '4': [4.2], '6': [6.1, 6.4] } - -_.groupBy(['one', 'two', 'three'], 'length'); -// => { '3': ['one', 'two'], '5': ['three'] } -``` - -* * * - - - - - - -### `_.invoke(collection, methodName [, arg1, arg2, ...])` -# [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L2072 "View in source") [Ⓣ][1] - -Invokes the method named by `methodName` on each element in the `collection`, returning an array of the results of each invoked method. Additional arguments will be passed to each invoked method. If `methodName` is a function it will be invoked for, and `this` bound to, each element in the `collection`. - -#### Arguments -1. `collection` *(Array|Object|String)*: The collection to iterate over. -2. `methodName` *(Function|String)*: The name of the method to invoke or the function invoked per iteration. -3. `[arg1, arg2, ...]` *(Mixed)*: Arguments to invoke the method with. - -#### Returns -*(Array)*: Returns a new array of the results of each invoked method. - -#### Example -```js -_.invoke([[5, 1, 7], [3, 2, 1]], 'sort'); -// => [[1, 5, 7], [1, 2, 3]] - -_.invoke([123, 456], String.prototype.split, ''); -// => [['1', '2', '3'], ['4', '5', '6']] -``` - -* * * - - - - - - -### `_.map(collection [, callback=identity, thisArg])` -# [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L2104 "View in source") [Ⓣ][1] - -Creates an array of values by running each element in the `collection` through a `callback`. The `callback` is bound to `thisArg` and invoked with three arguments; *(value, index|key, collection)*. - -#### Aliases -*collect* - -#### Arguments -1. `collection` *(Array|Object|String)*: The collection to iterate over. -2. `[callback=identity]` *(Function)*: The function called per iteration. -3. `[thisArg]` *(Mixed)*: The `this` binding of `callback`. - -#### Returns -*(Array)*: Returns a new array of the results of each `callback` execution. - -#### Example -```js -_.map([1, 2, 3], function(num) { return num * 3; }); -// => [3, 6, 9] - -_.map({ 'one': 1, 'two': 2, 'three': 3 }, function(num) { return num * 3; }); -// => [3, 6, 9] (order is not guaranteed) -``` - -* * * - - - - - - -### `_.max(collection [, callback, thisArg])` -# [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L2146 "View in source") [Ⓣ][1] - -Retrieves the maximum value of an `array`. If `callback` is passed, it will be executed for each value in the `array` to generate the criterion by which the value is ranked. The `callback` is bound to `thisArg` and invoked with three arguments; *(value, index, collection)*. - -#### Arguments -1. `collection` *(Array|Object|String)*: The collection to iterate over. -2. `[callback]` *(Function)*: The function called per iteration. -3. `[thisArg]` *(Mixed)*: The `this` binding of `callback`. - -#### Returns -*(Mixed)*: Returns the maximum value. - -#### Example -```js -var stooges = [ - { 'name': 'moe', 'age': 40 }, - { 'name': 'larry', 'age': 50 }, - { 'name': 'curly', 'age': 60 } -]; - -_.max(stooges, function(stooge) { return stooge.age; }); -// => { 'name': 'curly', 'age': 60 }; -``` - -* * * - - - - - - -### `_.min(collection [, callback, thisArg])` -# [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L2192 "View in source") [Ⓣ][1] - -Retrieves the minimum value of an `array`. If `callback` is passed, it will be executed for each value in the `array` to generate the criterion by which the value is ranked. The `callback` is bound to `thisArg` and invoked with three arguments; *(value, index, collection)*. - -#### Arguments -1. `collection` *(Array|Object|String)*: The collection to iterate over. -2. `[callback]` *(Function)*: The function called per iteration. -3. `[thisArg]` *(Mixed)*: The `this` binding of `callback`. - -#### Returns -*(Mixed)*: Returns the minimum value. - -#### Example -```js -_.min([10, 5, 100, 2, 1000]); -// => 2 -``` - -* * * - - - - - - -### `_.pluck(collection, property)` -# [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L2241 "View in source") [Ⓣ][1] - -Retrieves the value of a specified property from all elements in the `collection`. - -#### Arguments -1. `collection` *(Array|Object|String)*: The collection to iterate over. -2. `property` *(String)*: The property to pluck. - -#### Returns -*(Array)*: Returns a new array of property values. - -#### Example -```js -var stooges = [ - { 'name': 'moe', 'age': 40 }, - { 'name': 'larry', 'age': 50 }, - { 'name': 'curly', 'age': 60 } -]; - -_.pluck(stooges, 'name'); -// => ['moe', 'larry', 'curly'] -``` - -* * * - - - - - - -### `_.reduce(collection, callback [, accumulator, thisArg])` -# [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L2269 "View in source") [Ⓣ][1] - -Boils down a `collection` to a single value. The initial state of the reduction is `accumulator` and each successive step of it should be returned by the `callback`. The `callback` is bound to `thisArg` and invoked with `4` arguments; for arrays they are *(accumulator, value, index|key, collection)*. - -#### Aliases -*foldl, inject* - -#### Arguments -1. `collection` *(Array|Object|String)*: The collection to iterate over. -2. `callback` *(Function)*: The function called per iteration. -3. `[accumulator]` *(Mixed)*: Initial value of the accumulator. -4. `[thisArg]` *(Mixed)*: The `this` binding of `callback`. - -#### Returns -*(Mixed)*: Returns the accumulated value. - -#### Example -```js -var sum = _.reduce([1, 2, 3], function(memo, num) { return memo + num; }); -// => 6 -``` - -* * * - - - - - - -### `_.reduceRight(collection, callback [, accumulator, thisArg])` -# [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L2298 "View in source") [Ⓣ][1] - -The right-associative version of `_.reduce`. - -#### Aliases -*foldr* - -#### Arguments -1. `collection` *(Array|Object|String)*: The collection to iterate over. -2. `callback` *(Function)*: The function called per iteration. -3. `[accumulator]` *(Mixed)*: Initial value of the accumulator. -4. `[thisArg]` *(Mixed)*: The `this` binding of `callback`. - -#### Returns -*(Mixed)*: Returns the accumulated value. - -#### Example -```js -var list = [[0, 1], [2, 3], [4, 5]]; -var flat = _.reduceRight(list, function(a, b) { return a.concat(b); }, []); -// => [4, 5, 2, 3, 0, 1] -``` - -* * * - - - - - - -### `_.reject(collection [, callback=identity, thisArg])` -# [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L2335 "View in source") [Ⓣ][1] - -The opposite of `_.filter`, this method returns the values of a `collection` that `callback` does **not** return truthy for. - -#### Arguments -1. `collection` *(Array|Object|String)*: The collection to iterate over. -2. `[callback=identity]` *(Function)*: The function called per iteration. -3. `[thisArg]` *(Mixed)*: The `this` binding of `callback`. - -#### Returns -*(Array)*: Returns a new array of elements that did **not** pass the callback check. - -#### Example -```js -var odds = _.reject([1, 2, 3, 4, 5, 6], function(num) { return num % 2 == 0; }); -// => [1, 3, 5] -``` - -* * * - - - - - - -### `_.shuffle(collection)` -# [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L2356 "View in source") [Ⓣ][1] - -Creates an array of shuffled `array` values, using a version of the Fisher-Yates shuffle. See http://en.wikipedia.org/wiki/Fisher-Yates_shuffle. - -#### Arguments -1. `collection` *(Array|Object|String)*: The collection to shuffle. - -#### Returns -*(Array)*: Returns a new shuffled collection. - -#### Example -```js -_.shuffle([1, 2, 3, 4, 5, 6]); -// => [4, 1, 6, 3, 5, 2] -``` - -* * * - - - - - - -### `_.size(collection)` -# [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L2388 "View in source") [Ⓣ][1] - -Gets the size of the `collection` by returning `collection.length` for arrays and array-like objects or the number of own enumerable properties for objects. - -#### Arguments -1. `collection` *(Array|Object|String)*: The collection to inspect. - -#### Returns -*(Number)*: Returns `collection.length` or number of own enumerable properties. - -#### Example -```js -_.size([1, 2]); -// => 2 - -_.size({ 'one': 1, 'two': 2, 'three': 3 }); -// => 3 - -_.size('curly'); -// => 5 -``` - -* * * - - - - - - -### `_.some(collection [, callback=identity, thisArg])` -# [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L2413 "View in source") [Ⓣ][1] - -Checks if the `callback` returns a truthy value for **any** element of a `collection`. The function returns as soon as it finds passing value, and does not iterate over the entire `collection`. The `callback` is bound to `thisArg` and invoked with three arguments; *(value, index|key, collection)*. - -#### Aliases -*any* - -#### Arguments -1. `collection` *(Array|Object|String)*: The collection to iterate over. -2. `[callback=identity]` *(Function)*: The function called per iteration. -3. `[thisArg]` *(Mixed)*: The `this` binding of `callback`. - -#### Returns -*(Boolean)*: Returns `true` if any element passes the callback check, else `false`. - -#### Example -```js -_.some([null, 0, 'yes', false]); -// => true -``` - -* * * - - - - - - -### `_.sortBy(collection, callback|property [, thisArg])` -# [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L2459 "View in source") [Ⓣ][1] - -Creates an array, stable sorted in ascending order by the results of running each element of `collection` through a `callback`. The `callback` is bound to `thisArg` and invoked with three arguments; *(value, index|key, collection)*. The `callback` argument may also be the name of a property to sort by *(e.g. 'length')*. - -#### Arguments -1. `collection` *(Array|Object|String)*: The collection to iterate over. -2. `callback|property` *(Function|String)*: The function called per iteration or property name to sort by. -3. `[thisArg]` *(Mixed)*: The `this` binding of `callback`. - -#### Returns -*(Array)*: Returns a new array of sorted elements. - -#### Example -```js -_.sortBy([1, 2, 3], function(num) { return Math.sin(num); }); -// => [3, 1, 2] - -_.sortBy([1, 2, 3], function(num) { return this.sin(num); }, Math); -// => [3, 1, 2] - -_.sortBy(['larry', 'brendan', 'moe'], 'length'); -// => ['moe', 'larry', 'brendan'] -``` - -* * * - - - - - - -### `_.toArray(collection)` -# [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L2491 "View in source") [Ⓣ][1] - -Converts the `collection`, to an array. - -#### Arguments -1. `collection` *(Array|Object|String)*: The collection to convert. - -#### Returns -*(Array)*: Returns the new converted array. - -#### Example -```js -(function() { return _.toArray(arguments).slice(1); })(1, 2, 3, 4); -// => [2, 3, 4] -``` - -* * * - - - - - - -### `_.where(collection, properties)` -# [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L2521 "View in source") [Ⓣ][1] - -Examines each element in a `collection`, returning an array of all elements that contain the given `properties`. - -#### Arguments -1. `collection` *(Array|Object|String)*: The collection to iterate over. -2. `properties` *(Object)*: The object of property values to filter by. - -#### Returns -*(Array)*: Returns a new array of elements that contain the given `properties`. - -#### Example -```js -var stooges = [ - { 'name': 'moe', 'age': 40 }, - { 'name': 'larry', 'age': 50 }, - { 'name': 'curly', 'age': 60 } -]; - -_.where(stooges, { 'age': 40 }); -// => [{ 'name': 'moe', 'age': 40 }] -``` - -* * * - - - - - - - - - -## `“Functions†Methods` - - - -### `_.after(n, func)` -# [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L3153 "View in source") [Ⓣ][1] - -Creates a function that is restricted to executing `func` only after it is called `n` times. The `func` is executed with the `this` binding of the created function. - -#### Arguments -1. `n` *(Number)*: The number of times the function must be called before it is executed. -2. `func` *(Function)*: The function to restrict. - -#### Returns -*(Function)*: Returns the new restricted function. - -#### Example -```js -var renderNotes = _.after(notes.length, render); -_.forEach(notes, function(note) { - note.asyncSave({ 'success': renderNotes }); -}); -// `renderNotes` is run once, after all notes have saved -``` - -* * * - - - - - - -### `_.bind(func [, thisArg, arg1, arg2, ...])` -# [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L3186 "View in source") [Ⓣ][1] - -Creates a function that, when called, invokes `func` with the `this` binding of `thisArg` and prepends any additional `bind` arguments to those passed to the bound function. - -#### Arguments -1. `func` *(Function)*: The function to bind. -2. `[thisArg]` *(Mixed)*: The `this` binding of `func`. -3. `[arg1, arg2, ...]` *(Mixed)*: Arguments to be partially applied. - -#### Returns -*(Function)*: Returns the new bound function. - -#### Example -```js -var func = function(greeting) { - return greeting + ' ' + this.name; -}; - -func = _.bind(func, { 'name': 'moe' }, 'hi'); -func(); -// => 'hi moe' -``` - -* * * - - - - - - -### `_.bindAll(object [, methodName1, methodName2, ...])` -# [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L3216 "View in source") [Ⓣ][1] - -Binds methods on `object` to `object`, overwriting the existing method. If no method names are provided, all the function properties of `object` will be bound. - -#### Arguments -1. `object` *(Object)*: The object to bind and assign the bound methods to. -2. `[methodName1, methodName2, ...]` *(String)*: Method names on the object to bind. - -#### Returns -*(Object)*: Returns `object`. - -#### Example -```js -var buttonView = { - 'label': 'lodash', - 'onClick': function() { alert('clicked: ' + this.label); } -}; - -_.bindAll(buttonView); -jQuery('#lodash_button').on('click', buttonView.onClick); -// => When the button is clicked, `this.label` will have the correct value -``` - -* * * - - - - - - -### `_.compose([func1, func2, ...])` -# [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L3247 "View in source") [Ⓣ][1] - -Creates a function that is the composition of the passed functions, where each function consumes the return value of the function that follows. In math terms, composing the functions `f()`, `g()`, and `h()` produces `f(g(h()))`. Each function is executed with the `this` binding of the composed function. - -#### Arguments -1. `[func1, func2, ...]` *(Function)*: Functions to compose. - -#### Returns -*(Function)*: Returns the new composed function. - -#### Example -```js -var greet = function(name) { return 'hi: ' + name; }; -var exclaim = function(statement) { return statement + '!'; }; -var welcome = _.compose(exclaim, greet); -welcome('moe'); -// => 'hi: moe!' -``` - -* * * - - - - - - -### `_.debounce(func, wait, immediate)` -# [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L3280 "View in source") [Ⓣ][1] - -Creates a function that will delay the execution of `func` until after `wait` milliseconds have elapsed since the last time it was invoked. Pass `true` for `immediate` to cause debounce to invoke `func` on the leading, instead of the trailing, edge of the `wait` timeout. Subsequent calls to the debounced function will return the result of the last `func` call. - -#### Arguments -1. `func` *(Function)*: The function to debounce. -2. `wait` *(Number)*: The number of milliseconds to delay. -3. `immediate` *(Boolean)*: A flag to indicate execution is on the leading edge of the timeout. - -#### Returns -*(Function)*: Returns the new debounced function. - -#### Example -```js -var lazyLayout = _.debounce(calculateLayout, 300); -jQuery(window).on('resize', lazyLayout); -``` - -* * * - - - - - - -### `_.defer(func [, arg1, arg2, ...])` -# [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L3344 "View in source") [Ⓣ][1] - -Defers executing the `func` function until the current call stack has cleared. Additional arguments will be passed to `func` when it is invoked. - -#### Arguments -1. `func` *(Function)*: The function to defer. -2. `[arg1, arg2, ...]` *(Mixed)*: Arguments to invoke the function with. - -#### Returns -*(Number)*: Returns the `setTimeout` timeout id. - -#### Example -```js -_.defer(function() { alert('deferred'); }); -// returns from the function before `alert` is called -``` - -* * * - - - - - - -### `_.delay(func, wait [, arg1, arg2, ...])` -# [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L3324 "View in source") [Ⓣ][1] - -Executes the `func` function after `wait` milliseconds. Additional arguments will be passed to `func` when it is invoked. - -#### Arguments -1. `func` *(Function)*: The function to delay. -2. `wait` *(Number)*: The number of milliseconds to delay execution. -3. `[arg1, arg2, ...]` *(Mixed)*: Arguments to invoke the function with. - -#### Returns -*(Number)*: Returns the `setTimeout` timeout id. - -#### Example -```js -var log = _.bind(console.log, console); -_.delay(log, 1000, 'logged later'); -// => 'logged later' (Appears after one second.) -``` - -* * * - - - - - - -### `_.lateBind(object, methodName [, arg1, arg2, ...])` -# [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L3382 "View in source") [Ⓣ][1] - -Creates a function that, when called, invokes `object[methodName]` and prepends any additional `lateBind` arguments to those passed to the bound function. This method differs from `_.bind` by allowing bound functions to reference methods that will be redefined or don't yet exist. - -#### Arguments -1. `object` *(Object)*: The object the method belongs to. -2. `methodName` *(String)*: The method name. -3. `[arg1, arg2, ...]` *(Mixed)*: Arguments to be partially applied. - -#### Returns -*(Function)*: Returns the new bound function. - -#### Example -```js -var object = { - 'name': 'moe', - 'greet': function(greeting) { - return greeting + ' ' + this.name; - } -}; - -var func = _.lateBind(object, 'greet', 'hi'); -func(); -// => 'hi moe' - -object.greet = function(greeting) { - return greeting + ', ' + this.name + '!'; -}; - -func(); -// => 'hi, moe!' -``` - -* * * - - - - - - -### `_.memoize(func [, resolver])` -# [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L3405 "View in source") [Ⓣ][1] - -Creates a function that memoizes the result of `func`. If `resolver` is passed, it will be used to determine the cache key for storing the result based on the arguments passed to the memoized function. By default, the first argument passed to the memoized function is used as the cache key. The `func` is executed with the `this` binding of the memoized function. - -#### Arguments -1. `func` *(Function)*: The function to have its output memoized. -2. `[resolver]` *(Function)*: A function used to resolve the cache key. - -#### Returns -*(Function)*: Returns the new memoizing function. - -#### Example -```js -var fibonacci = _.memoize(function(n) { - return n < 2 ? n : fibonacci(n - 1) + fibonacci(n - 2); -}); -``` - -* * * - - - - - - -### `_.once(func)` -# [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L3432 "View in source") [Ⓣ][1] - -Creates a function that is restricted to execute `func` once. Repeat calls to the function will return the value of the first call. The `func` is executed with the `this` binding of the created function. - -#### Arguments -1. `func` *(Function)*: The function to restrict. - -#### Returns -*(Function)*: Returns the new restricted function. - -#### Example -```js -var initialize = _.once(createApplication); -initialize(); -initialize(); -// Application is only created once. -``` - -* * * - - - - - - -### `_.partial(func [, arg1, arg2, ...])` -# [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L3467 "View in source") [Ⓣ][1] - -Creates a function that, when called, invokes `func` with any additional `partial` arguments prepended to those passed to the new function. This method is similar to `bind`, except it does **not** alter the `this` binding. - -#### Arguments -1. `func` *(Function)*: The function to partially apply arguments to. -2. `[arg1, arg2, ...]` *(Mixed)*: Arguments to be partially applied. - -#### Returns -*(Function)*: Returns the new partially applied function. - -#### Example -```js -var greet = function(greeting, name) { return greeting + ': ' + name; }; -var hi = _.partial(greet, 'hi'); -hi('moe'); -// => 'hi: moe' -``` - -* * * - - - - - - -### `_.throttle(func, wait)` -# [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L3489 "View in source") [Ⓣ][1] - -Creates a function that, when executed, will only call the `func` function at most once per every `wait` milliseconds. If the throttled function is invoked more than once during the `wait` timeout, `func` will also be called on the trailing edge of the timeout. Subsequent calls to the throttled function will return the result of the last `func` call. - -#### Arguments -1. `func` *(Function)*: The function to throttle. -2. `wait` *(Number)*: The number of milliseconds to throttle executions to. - -#### Returns -*(Function)*: Returns the new throttled function. - -#### Example -```js -var throttled = _.throttle(updatePosition, 100); -jQuery(window).on('scroll', throttled); -``` - -* * * - - - - - - -### `_.wrap(value, wrapper)` -# [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L3541 "View in source") [Ⓣ][1] - -Creates a function that passes `value` to the `wrapper` function as its first argument. Additional arguments passed to the function are appended to those passed to the `wrapper` function. The `wrapper` is executed with the `this` binding of the created function. - -#### Arguments -1. `value` *(Mixed)*: The value to wrap. -2. `wrapper` *(Function)*: The wrapper function. - -#### Returns -*(Function)*: Returns the new function. - -#### Example -```js -var hello = function(name) { return 'hello ' + name; }; -hello = _.wrap(hello, function(func) { - return 'before, ' + func('moe') + ', after'; -}); -hello(); -// => 'before, hello moe, after' -``` - -* * * - - - - - - - - - -## `“Objects†Methods` - - - -### `_.clone(value, deep)` -# [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L896 "View in source") [Ⓣ][1] - -Creates a clone of `value`. If `deep` is `true`, all nested objects will also be cloned otherwise they will be assigned by reference. Functions, DOM nodes, `arguments` objects, and objects created by constructors other than `Object` are **not** cloned. - -#### Arguments -1. `value` *(Mixed)*: The value to clone. -2. `deep` *(Boolean)*: A flag to indicate a deep clone. - -#### Returns -*(Mixed)*: Returns the cloned `value`. - -#### Example -```js -var stooges = [ - { 'name': 'moe', 'age': 40 }, - { 'name': 'larry', 'age': 50 }, - { 'name': 'curly', 'age': 60 } -]; - -_.clone({ 'name': 'moe' }); -// => { 'name': 'moe' } - -var shallow = _.clone(stooges); -shallow[0] === stooges[0]; -// => true - -var deep = _.clone(stooges, true); -shallow[0] === stooges[0]; -// => false -``` - -* * * - - - - - - -### `_.defaults(object [, default1, default2, ...])` -# [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L979 "View in source") [Ⓣ][1] - -Assigns enumerable properties of the default object(s) to the `destination` object for all `destination` properties that resolve to `null`/`undefined`. Once a property is set, additional defaults of the same property will be ignored. - -#### Arguments -1. `object` *(Object)*: The destination object. -2. `[default1, default2, ...]` *(Object)*: The default objects. - -#### Returns -*(Object)*: Returns the destination object. - -#### Example -```js -var iceCream = { 'flavor': 'chocolate' }; -_.defaults(iceCream, { 'flavor': 'vanilla', 'sprinkles': 'rainbow' }); -// => { 'flavor': 'chocolate', 'sprinkles': 'rainbow' } -``` - -* * * - - - - - - -### `_.extend(object [, source1, source2, ...])` -# [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L999 "View in source") [Ⓣ][1] - -Assigns enumerable properties of the source object(s) to the `destination` object. Subsequent sources will overwrite propery assignments of previous sources. - -#### Arguments -1. `object` *(Object)*: The destination object. -2. `[source1, source2, ...]` *(Object)*: The source objects. - -#### Returns -*(Object)*: Returns the destination object. - -#### Example -```js -_.extend({ 'name': 'moe' }, { 'age': 40 }); -// => { 'name': 'moe', 'age': 40 } -``` - -* * * - - - - - - -### `_.forIn(object, callback [, thisArg])` -# [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L754 "View in source") [Ⓣ][1] - -Iterates over `object`'s own and inherited enumerable properties, executing the `callback` for each property. The `callback` is bound to `thisArg` and invoked with three arguments; *(value, key, object)*. Callbacks may exit iteration early by explicitly returning `false`. - -#### Arguments -1. `object` *(Object)*: The object to iterate over. -2. `callback` *(Function)*: The function called per iteration. -3. `[thisArg]` *(Mixed)*: The `this` binding of `callback`. - -#### Returns -*(Object)*: Returns `object`. - -#### Example -```js -function Dog(name) { - this.name = name; -} - -Dog.prototype.bark = function() { - alert('Woof, woof!'); -}; - -_.forIn(new Dog('Dagny'), function(value, key) { - alert(key); -}); -// => alerts 'name' and 'bark' (order is not guaranteed) -``` - -* * * - - - - - - -### `_.forOwn(object, callback [, thisArg])` -# [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L778 "View in source") [Ⓣ][1] - -Iterates over `object`'s own enumerable properties, executing the `callback` for each property. The `callback` is bound to `thisArg` and invoked with three arguments; *(value, key, object)*. Callbacks may exit iteration early by explicitly returning `false`. - -#### Arguments -1. `object` *(Object)*: The object to iterate over. -2. `callback` *(Function)*: The function called per iteration. -3. `[thisArg]` *(Mixed)*: The `this` binding of `callback`. - -#### Returns -*(Object)*: Returns `object`. - -#### Example -```js -_.forOwn({ '0': 'zero', '1': 'one', 'length': 2 }, function(num, key) { - alert(key); -}); -// => alerts '0', '1', and 'length' (order is not guaranteed) -``` - -* * * - - - - - - -### `_.functions(object)` -# [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L1016 "View in source") [Ⓣ][1] - -Creates a sorted array of all enumerable properties, own and inherited, of `object` that have function values. - -#### Aliases -*methods* - -#### Arguments -1. `object` *(Object)*: The object to inspect. - -#### Returns -*(Array)*: Returns a new array of property names that have function values. - -#### Example -```js -_.functions(_); -// => ['all', 'any', 'bind', 'bindAll', 'clone', 'compact', 'compose', ...] -``` - -* * * - - - - - - -### `_.has(object, property)` -# [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L1041 "View in source") [Ⓣ][1] - -Checks if the specified object `property` exists and is a direct property, instead of an inherited property. - -#### Arguments -1. `object` *(Object)*: The object to check. -2. `property` *(String)*: The property to check for. - -#### Returns -*(Boolean)*: Returns `true` if key is a direct property, else `false`. - -#### Example -```js -_.has({ 'a': 1, 'b': 2, 'c': 3 }, 'b'); -// => true -``` - -* * * - - - - - - -### `_.invert(object)` -# [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L1058 "View in source") [Ⓣ][1] - -Creates an object composed of the inverted keys and values of the given `object`. - -#### Arguments -1. `object` *(Object)*: The object to invert. - -#### Returns -*(Object)*: Returns the created inverted object. - -#### Example -```js -_.invert({ 'first': 'Moe', 'second': 'Larry', 'third': 'Curly' }); -// => { 'Moe': 'first', 'Larry': 'second', 'Curly': 'third' } (order is not guaranteed) -``` - -* * * - - - - - - -### `_.isArguments(value)` -# [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L716 "View in source") [Ⓣ][1] - -Checks if `value` is an `arguments` object. - -#### Arguments -1. `value` *(Mixed)*: The value to check. - -#### Returns -*(Boolean)*: Returns `true` if the `value` is an `arguments` object, else `false`. - -#### Example -```js -(function() { return _.isArguments(arguments); })(1, 2, 3); -// => true - -_.isArguments([1, 2, 3]); -// => false -``` - -* * * - - - - - - -### `_.isArray(value)` -# [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L1082 "View in source") [Ⓣ][1] - -Checks if `value` is an array. - -#### Arguments -1. `value` *(Mixed)*: The value to check. - -#### Returns -*(Boolean)*: Returns `true` if the `value` is an array, else `false`. - -#### Example -```js -(function() { return _.isArray(arguments); })(); -// => false - -_.isArray([1, 2, 3]); -// => true -``` - -* * * - - - - - - -### `_.isBoolean(value)` -# [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L1099 "View in source") [Ⓣ][1] - -Checks if `value` is a boolean *(`true` or `false`)* value. - -#### Arguments -1. `value` *(Mixed)*: The value to check. - -#### Returns -*(Boolean)*: Returns `true` if the `value` is a boolean value, else `false`. - -#### Example -```js -_.isBoolean(null); -// => false -``` - -* * * - - - - - - -### `_.isDate(value)` -# [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L1116 "View in source") [Ⓣ][1] - -Checks if `value` is a date. - -#### Arguments -1. `value` *(Mixed)*: The value to check. - -#### Returns -*(Boolean)*: Returns `true` if the `value` is a date, else `false`. - -#### Example -```js -_.isDate(new Date); -// => true -``` - -* * * - - - - - - -### `_.isElement(value)` -# [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L1133 "View in source") [Ⓣ][1] - -Checks if `value` is a DOM element. - -#### Arguments -1. `value` *(Mixed)*: The value to check. - -#### Returns -*(Boolean)*: Returns `true` if the `value` is a DOM element, else `false`. - -#### Example -```js -_.isElement(document.body); -// => true -``` - -* * * - - - - - - -### `_.isEmpty(value)` -# [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L1158 "View in source") [Ⓣ][1] - -Checks if `value` is empty. Arrays, strings, or `arguments` objects with a length of `0` and objects with no own enumerable properties are considered "empty". - -#### Arguments -1. `value` *(Array|Object|String)*: The value to inspect. - -#### Returns -*(Boolean)*: Returns `true` if the `value` is empty, else `false`. - -#### Example -```js -_.isEmpty([1, 2, 3]); -// => false - -_.isEmpty({}); -// => true - -_.isEmpty(''); -// => true -``` - -* * * - - - - - - -### `_.isEqual(a, b)` -# [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L1200 "View in source") [Ⓣ][1] - -Performs a deep comparison between two values to determine if they are equivalent to each other. - -#### Arguments -1. `a` *(Mixed)*: The value to compare. -2. `b` *(Mixed)*: The other value to compare. - -#### Returns -*(Boolean)*: Returns `true` if the values are equvalent, else `false`. - -#### Example -```js -var moe = { 'name': 'moe', 'luckyNumbers': [13, 27, 34] }; -var clone = { 'name': 'moe', 'luckyNumbers': [13, 27, 34] }; - -moe == clone; -// => false - -_.isEqual(moe, clone); -// => true -``` - -* * * - - - - - - -### `_.isFinite(value)` -# [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L1362 "View in source") [Ⓣ][1] - -Checks if `value` is, or can be coerced to, a finite number. Note: This is not the same as native `isFinite`, which will return true for booleans and empty strings. See http://es5.github.com/#x15.1.2.5. - -#### Arguments -1. `value` *(Mixed)*: The value to check. - -#### Returns -*(Boolean)*: Returns `true` if the `value` is a finite number, else `false`. - -#### Example -```js -_.isFinite(-101); -// => true - -_.isFinite('10'); -// => true - -_.isFinite(true); -// => false - -_.isFinite(''); -// => false - -_.isFinite(Infinity); -// => false -``` - -* * * - - - - - - -### `_.isFunction(value)` -# [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L1379 "View in source") [Ⓣ][1] - -Checks if `value` is a function. - -#### Arguments -1. `value` *(Mixed)*: The value to check. - -#### Returns -*(Boolean)*: Returns `true` if the `value` is a function, else `false`. - -#### Example -```js -_.isFunction(_); -// => true -``` - -* * * - - - - - - -### `_.isNaN(value)` -# [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L1443 "View in source") [Ⓣ][1] - -Checks if `value` is `NaN`. Note: This is not the same as native `isNaN`, which will return true for `undefined` and other values. See http://es5.github.com/#x15.1.2.4. - -#### Arguments -1. `value` *(Mixed)*: The value to check. - -#### Returns -*(Boolean)*: Returns `true` if the `value` is `NaN`, else `false`. - -#### Example -```js -_.isNaN(NaN); -// => true - -_.isNaN(new Number(NaN)); -// => true - -isNaN(undefined); -// => true - -_.isNaN(undefined); -// => false -``` - -* * * - - - - - - -### `_.isNull(value)` -# [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L1466 "View in source") [Ⓣ][1] - -Checks if `value` is `null`. - -#### Arguments -1. `value` *(Mixed)*: The value to check. - -#### Returns -*(Boolean)*: Returns `true` if the `value` is `null`, else `false`. - -#### Example -```js -_.isNull(null); -// => true - -_.isNull(undefined); -// => false -``` - -* * * - - - - - - -### `_.isNumber(value)` -# [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L1483 "View in source") [Ⓣ][1] - -Checks if `value` is a number. - -#### Arguments -1. `value` *(Mixed)*: The value to check. - -#### Returns -*(Boolean)*: Returns `true` if the `value` is a number, else `false`. - -#### Example -```js -_.isNumber(8.4 * 5); -// => true -``` - -* * * - - - - - - -### `_.isObject(value)` -# [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L1409 "View in source") [Ⓣ][1] - -Checks if `value` is the language type of Object. *(e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`)* - -#### Arguments -1. `value` *(Mixed)*: The value to check. - -#### Returns -*(Boolean)*: Returns `true` if the `value` is an object, else `false`. - -#### Example -```js -_.isObject({}); -// => true - -_.isObject([1, 2, 3]); -// => true - -_.isObject(1); -// => false -``` - -* * * - - - - - - -### `_.isPlainObject(value)` -# [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L1511 "View in source") [Ⓣ][1] - -Checks if a given `value` is an object created by the `Object` constructor. - -#### Arguments -1. `value` *(Mixed)*: The value to check. - -#### Returns -*(Boolean)*: Returns `true` if `value` is a plain object, else `false`. - -#### Example -```js -function Stooge(name, age) { - this.name = name; - this.age = age; -} - -_.isPlainObject(new Stooge('moe', 40)); -// => false - -_.isPlainObject([1, 2, 3]); -// => false - -_.isPlainObject({ 'name': 'moe', 'age': 40 }); -// => true -``` - -* * * - - - - - - -### `_.isRegExp(value)` -# [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L1536 "View in source") [Ⓣ][1] - -Checks if `value` is a regular expression. - -#### Arguments -1. `value` *(Mixed)*: The value to check. - -#### Returns -*(Boolean)*: Returns `true` if the `value` is a regular expression, else `false`. - -#### Example -```js -_.isRegExp(/moe/); -// => true -``` - -* * * - - - - - - -### `_.isString(value)` -# [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L1553 "View in source") [Ⓣ][1] - -Checks if `value` is a string. - -#### Arguments -1. `value` *(Mixed)*: The value to check. - -#### Returns -*(Boolean)*: Returns `true` if the `value` is a string, else `false`. - -#### Example -```js -_.isString('moe'); -// => true -``` - -* * * - - - - - - -### `_.isUndefined(value)` -# [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L1571 "View in source") [Ⓣ][1] - -Checks if `value` is `undefined`. - -#### Arguments -1. `value` *(Mixed)*: The value to check. - -#### Returns -*(Boolean)*: Returns `true` if the `value` is `undefined`, else `false`. - -#### Example -```js -_.isUndefined(void 0); -// => true -``` - -* * * - - - - - - -### `_.keys(object)` -# [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L1588 "View in source") [Ⓣ][1] - -Creates an array composed of the own enumerable property names of `object`. - -#### Arguments -1. `object` *(Object)*: The object to inspect. - -#### Returns -*(Array)*: Returns a new array of property names. - -#### Example -```js -_.keys({ 'one': 1, 'two': 2, 'three': 3 }); -// => ['one', 'two', 'three'] (order is not guaranteed) -``` - -* * * - - - - - - -### `_.merge(object [, source1, source2, ...])` -# [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L1626 "View in source") [Ⓣ][1] - -Merges enumerable properties of the source object(s) into the `destination` object. Subsequent sources will overwrite propery assignments of previous sources. - -#### Arguments -1. `object` *(Object)*: The destination object. -2. `[source1, source2, ...]` *(Object)*: The source objects. - -#### Returns -*(Object)*: Returns the destination object. - -#### Example -```js -var stooges = [ - { 'name': 'moe' }, - { 'name': 'larry' } -]; - -var ages = [ - { 'age': 40 }, - { 'age': 50 } -]; - -_.merge(stooges, ages); -// => [{ 'name': 'moe', 'age': 40 }, { 'name': 'larry', 'age': 50 }] -``` - -* * * - - - - - - -### `_.omit(object, callback|[prop1, prop2, ..., thisArg])` -# [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L1696 "View in source") [Ⓣ][1] - -Creates a shallow clone of `object` excluding the specified properties. Property names may be specified as individual arguments or as arrays of property names. If `callback` is passed, it will be executed for each property in the `object`, omitting the properties `callback` returns truthy for. The `callback` is bound to `thisArg` and invoked with three arguments; *(value, key, object)*. - -#### Arguments -1. `object` *(Object)*: The source object. -2. `callback|[prop1, prop2, ...]` *(Function|String)*: The properties to omit or the function called per iteration. -3. `[thisArg]` *(Mixed)*: The `this` binding of `callback`. - -#### Returns -*(Object)*: Returns an object without the omitted properties. - -#### Example -```js -_.omit({ 'name': 'moe', 'age': 40, 'userid': 'moe1' }, 'userid'); -// => { 'name': 'moe', 'age': 40 } - -_.omit({ 'name': 'moe', '_hint': 'knucklehead', '_seed': '96c4eb' }, function(value, key) { - return key.charAt(0) == '_'; -}); -// => { 'name': 'moe' } -``` - -* * * - - - - - - -### `_.pairs(object)` -# [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L1730 "View in source") [Ⓣ][1] - -Creates a two dimensional array of the given object's key-value pairs, i.e. `[[key1, value1], [key2, value2]]`. - -#### Arguments -1. `object` *(Object)*: The object to inspect. - -#### Returns -*(Array)*: Returns new array of key-value pairs. - -#### Example -```js -_.pairs({ 'moe': 30, 'larry': 40, 'curly': 50 }); -// => [['moe', 30], ['larry', 40], ['curly', 50]] (order is not guaranteed) -``` - -* * * - - - - - - -### `_.pick(object, callback|[prop1, prop2, ..., thisArg])` -# [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L1763 "View in source") [Ⓣ][1] - -Creates a shallow clone of `object` composed of the specified properties. Property names may be specified as individual arguments or as arrays of property names. If `callback` is passed, it will be executed for each property in the `object`, picking the properties `callback` returns truthy for. The `callback` is bound to `thisArg` and invoked with three arguments; *(value, key, object)*. - -#### Arguments -1. `object` *(Object)*: The source object. -2. `callback|[prop1, prop2, ...]` *(Function|String)*: The properties to pick or the function called per iteration. -3. `[thisArg]` *(Mixed)*: The `this` binding of `callback`. - -#### Returns -*(Object)*: Returns an object composed of the picked properties. - -#### Example -```js -_.pick({ 'name': 'moe', 'age': 40, 'userid': 'moe1' }, 'name', 'age'); -// => { 'name': 'moe', 'age': 40 } - -_.pick({ 'name': 'moe', '_hint': 'knucklehead', '_seed': '96c4eb' }, function(value, key) { - return key.charAt(0) != '_'; -}); -// => { 'name': 'moe' } -``` - -* * * - - - - - - -### `_.values(object)` -# [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L1800 "View in source") [Ⓣ][1] - -Creates an array composed of the own enumerable property values of `object`. - -#### Arguments -1. `object` *(Object)*: The object to inspect. - -#### Returns -*(Array)*: Returns a new array of property values. - -#### Example -```js -_.values({ 'one': 1, 'two': 2, 'three': 3 }); -// => [1, 2, 3] -``` - -* * * - - - - - - - - - -## `“Utilities†Methods` - - - -### `_.escape(string)` -# [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L3565 "View in source") [Ⓣ][1] - -Converts the characters `&`, `<`, `>`, `"`, and `'` in `string` to their corresponding HTML entities. - -#### Arguments -1. `string` *(String)*: The string to escape. - -#### Returns -*(String)*: Returns the escaped string. - -#### Example -```js -_.escape('Moe, Larry & Curly'); -// => "Moe, Larry & Curly" -``` - -* * * - - - - - - -### `_.identity(value)` -# [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L3585 "View in source") [Ⓣ][1] - -This function returns the first argument passed to it. Note: It is used throughout Lo-Dash as a default callback. - -#### Arguments -1. `value` *(Mixed)*: Any value. - -#### Returns -*(Mixed)*: Returns `value`. - -#### Example -```js -var moe = { 'name': 'moe' }; -moe === _.identity(moe); -// => true -``` - -* * * - - - - - - -### `_.mixin(object)` -# [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L3611 "View in source") [Ⓣ][1] - -Adds functions properties of `object` to the `lodash` function and chainable wrapper. - -#### Arguments -1. `object` *(Object)*: The object of function properties to add to `lodash`. - -#### Example -```js -_.mixin({ - 'capitalize': function(string) { - return string.charAt(0).toUpperCase() + string.slice(1).toLowerCase(); - } -}); - -_.capitalize('larry'); -// => 'Larry' - -_('curly').capitalize(); -// => 'Curly' -``` - -* * * - - - - - - -### `_.noConflict()` -# [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L3641 "View in source") [Ⓣ][1] - -Reverts the '_' variable to its previous value and returns a reference to the `lodash` function. - -#### Returns -*(Function)*: Returns the `lodash` function. - -#### Example -```js -var lodash = _.noConflict(); -``` - -* * * - - - - - - -### `_.random([min=0, max=1])` -# [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L3664 "View in source") [Ⓣ][1] - -Produces a random number between `min` and `max` *(inclusive)*. If only one argument is passed, a number between `0` and the given number will be returned. - -#### Arguments -1. `[min=0]` *(Number)*: The minimum possible value. -2. `[max=1]` *(Number)*: The maximum possible value. - -#### Returns -*(Number)*: Returns a random number. - -#### Example -```js -_.random(0, 5); -// => a number between 1 and 5 - -_.random(5); -// => also a number between 1 and 5 -``` - -* * * - - - - - - -### `_.result(object, property)` -# [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L3703 "View in source") [Ⓣ][1] - -Resolves the value of `property` on `object`. If `property` is a function it will be invoked and its result returned, else the property value is returned. If `object` is falsey, then `null` is returned. - -#### Arguments -1. `object` *(Object)*: The object to inspect. -2. `property` *(String)*: The property to get the value of. - -#### Returns -*(Mixed)*: Returns the resolved value. - -#### Example -```js -var object = { - 'cheese': 'crumpets', - 'stuff': function() { - return 'nonsense'; - } -}; - -_.result(object, 'cheese'); -// => 'crumpets' - -_.result(object, 'stuff'); -// => 'nonsense' -``` - -* * * - - - - - - -### `_.template(text, data, options)` -# [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L3788 "View in source") [Ⓣ][1] - -A micro-templating method that handles arbitrary delimiters, preserves whitespace, and correctly escapes quotes within interpolated code. Note: In the development build `_.template` utilizes sourceURLs for easier debugging. See http://www.html5rocks.com/en/tutorials/developertools/sourcemaps/#toc-sourceurl Note: Lo-Dash may be used in Chrome extensions by either creating a `lodash csp` build and avoiding `_.template` use, or loading Lo-Dash in a sandboxed page. See http://developer.chrome.com/trunk/extensions/sandboxingEval.html - -#### Arguments -1. `text` *(String)*: The template text. -2. `data` *(Obect)*: The data object used to populate the text. -3. `options` *(Object)*: The options object. escape - The "escape" delimiter regexp. evaluate - The "evaluate" delimiter regexp. interpolate - The "interpolate" delimiter regexp. sourceURL - The sourceURL of the template's compiled source. variable - The data object variable name. - -#### Returns -*(Function, String)*: Returns a compiled function when no `data` object is given, else it returns the interpolated text. - -#### Example -```js -// using a compiled template -var compiled = _.template('hello <%= name %>'); -compiled({ 'name': 'moe' }); -// => 'hello moe' - -var list = '<% _.forEach(people, function(name) { %>
      1. <%= name %>
      2. <% }); %>'; -_.template(list, { 'people': ['moe', 'larry', 'curly'] }); -// => '
      3. moe
      4. larry
      5. curly
      6. ' - -// using the "escape" delimiter to escape HTML in data property values -_.template('<%- value %>', { 'value': '\n```\n\nUsing [npm](http://npmjs.org/):\n\n```bash\nnpm install lodash\n\nnpm install -g lodash\nnpm link lodash\n```\n\nIn [Node.js](http://nodejs.org/) and [RingoJS v0.8.0+](http://ringojs.org/):\n\n```js\nvar _ = require('lodash');\n```\n\n**Note:** If Lo-Dash is installed globally, [run `npm link lodash`](http://blog.nodejs.org/2011/03/23/npm-1-0-global-vs-local-installation/) in your project’s root directory before requiring it.\n\nIn [RingoJS v0.7.0-](http://ringojs.org/):\n\n```js\nvar _ = require('lodash')._;\n```\n\nIn [Rhino](http://www.mozilla.org/rhino/):\n\n```js\nload('lodash.js');\n```\n\nIn an AMD loader like [RequireJS](http://requirejs.org/):\n\n```js\nrequire({\n 'paths': {\n 'underscore': 'path/to/lodash'\n }\n},\n['underscore'], function(_) {\n console.log(_.VERSION);\n});\n```\n\n## Resolved Underscore.js issues\n\n * Allow iteration of objects with a `length` property [[#799](https://github.com/documentcloud/underscore/pull/799), [test](https://github.com/bestiejs/lodash/blob/v0.9.2/test/test.js#L545-551)]\n * Fix cross-browser object iteration bugs [[#60](https://github.com/documentcloud/underscore/issues/60), [#376](https://github.com/documentcloud/underscore/issues/376), [test](https://github.com/bestiejs/lodash/blob/v0.9.2/test/test.js#L558-582)]\n * Methods should work on pages with incorrectly shimmed native methods [[#7](https://github.com/documentcloud/underscore/issues/7), [#742](https://github.com/documentcloud/underscore/issues/742), [test](https://github.com/bestiejs/lodash/blob/v0.9.2/test/test.js#L140-146)]\n * `_.isEmpty` should support jQuery/MooTools DOM query collections [[#690](https://github.com/documentcloud/underscore/pull/690), [test](https://github.com/bestiejs/lodash/blob/v0.9.2/test/test.js#L747-752)]\n * `_.isObject` should avoid V8 bug [#2291](http://code.google.com/p/v8/issues/detail?id=2291) [[#605](https://github.com/documentcloud/underscore/issues/605), [test](https://github.com/bestiejs/lodash/blob/v0.9.2/test/test.js#L828-840)]\n * `_.keys` should work with `arguments` objects cross-browser [[#396](https://github.com/documentcloud/underscore/issues/396), [test](https://github.com/bestiejs/lodash/blob/v0.9.2/test/test.js#L921-923)]\n * `_.range` should coerce arguments to numbers [[#634](https://github.com/documentcloud/underscore/issues/634), [#683](https://github.com/documentcloud/underscore/issues/683), [test](https://github.com/bestiejs/lodash/blob/v0.9.2/test/test.js#L1337-1340)]\n\n## Release Notes\n\n### v0.9.2\n\n * Added `fromIndex` argument to `_.contains`\n * Added `moduleId` build option\n * Added Closure Compiler *“simpleâ€* optimizations to the build process\n * Added support for strings in `_.max` and `_.min`\n * Added support for ES6 template delimiters to `_.template`\n * Ensured re-minification of Lo-Dash by third parties avoids Closure Compiler bugs\n * Optimized `_.every`, `_.find`, `_.some`, and `_.uniq`\n\nThe full changelog is available [here](https://github.com/bestiejs/lodash/wiki/Changelog).\n\n## BestieJS\n\nLo-Dash is part of the BestieJS *“Best in Classâ€* module collection. This means we promote solid browser/environment support, ES5 precedents, unit testing, and plenty of documentation.\n\n## Author\n\n* [John-David Dalton](http://allyoucanleet.com/)\n [![twitter/jdalton](http://gravatar.com/avatar/299a3d891ff1920b69c364d061007043?s=70)](https://twitter.com/jdalton \"Follow @jdalton on Twitter\")\n\n## Contributors\n\n* [Kit Cambridge](http://kitcambridge.github.com/)\n [![twitter/kitcambridge](http://gravatar.com/avatar/6662a1d02f351b5ef2f8b4d815804661?s=70)](https://twitter.com/kitcambridge \"Follow @kitcambridge on Twitter\")\n* [Mathias Bynens](http://mathiasbynens.be/)\n [![twitter/mathias](http://gravatar.com/avatar/24e08a9ea84deb17ae121074d0f17125?s=70)](https://twitter.com/mathias \"Follow @mathias on Twitter\")\n", - "readmeFilename": "README.md", - "_id": "lodash@0.9.2", - "dist": { - "shasum": "06c33f4a57ff688efc7dbf08c42cf01e6bee0880" - }, - "_from": "lodash@~0.9.0", - "_resolved": "https://registry.npmjs.org/lodash/-/lodash-0.9.2.tgz" -} diff --git a/Phaser/node_modules/grunt/node_modules/lodash/test/template/a.jst b/Phaser/node_modules/grunt/node_modules/lodash/test/template/a.jst deleted file mode 100644 index a2a8b6e0..00000000 --- a/Phaser/node_modules/grunt/node_modules/lodash/test/template/a.jst +++ /dev/null @@ -1,3 +0,0 @@ -
          -<% _.forEach(people, function(name) { %>
        • <%= name %>
        • <% }); %> -
        \ No newline at end of file diff --git a/Phaser/node_modules/grunt/node_modules/lodash/test/template/b.jst b/Phaser/node_modules/grunt/node_modules/lodash/test/template/b.jst deleted file mode 100644 index cad081d1..00000000 --- a/Phaser/node_modules/grunt/node_modules/lodash/test/template/b.jst +++ /dev/null @@ -1 +0,0 @@ -<% print("Hello " + epithet); %>. \ No newline at end of file diff --git a/Phaser/node_modules/grunt/node_modules/lodash/test/template/c.tpl b/Phaser/node_modules/grunt/node_modules/lodash/test/template/c.tpl deleted file mode 100644 index c7a43bc1..00000000 --- a/Phaser/node_modules/grunt/node_modules/lodash/test/template/c.tpl +++ /dev/null @@ -1 +0,0 @@ -Hello {{ name }}! \ No newline at end of file diff --git a/Phaser/node_modules/grunt/node_modules/lodash/vendor/qunit-clib/LICENSE.txt b/Phaser/node_modules/grunt/node_modules/lodash/vendor/qunit-clib/LICENSE.txt deleted file mode 100644 index dadad22f..00000000 --- a/Phaser/node_modules/grunt/node_modules/lodash/vendor/qunit-clib/LICENSE.txt +++ /dev/null @@ -1,20 +0,0 @@ -Copyright 2011-2012 John-David Dalton - -Permission is hereby granted, free of charge, to any person obtaining -a copy of this software and associated documentation files (the -"Software"), to deal in the Software without restriction, including -without limitation the rights to use, copy, modify, merge, publish, -distribute, sublicense, and/or sell copies of the Software, and to -permit persons to whom the Software is furnished to do so, subject to -the following conditions: - -The above copyright notice and this permission notice shall be -included in all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE -LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION -WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. \ No newline at end of file diff --git a/Phaser/node_modules/grunt/node_modules/lodash/vendor/qunit-clib/README.md b/Phaser/node_modules/grunt/node_modules/lodash/vendor/qunit-clib/README.md deleted file mode 100644 index b84a21c9..00000000 --- a/Phaser/node_modules/grunt/node_modules/lodash/vendor/qunit-clib/README.md +++ /dev/null @@ -1,57 +0,0 @@ -# QUnit CLIB v1.0.0 -## command-line interface boilerplate - -QUnit CLIB helps extend QUnit's CLI support to many common CLI environments. - -## Screenshot - -![QUnit CLIB brings QUnit to your favorite shell.](http://i.imgur.com/jpu9l.png) - -## Support - -QUnit CLIB has been tested in at least Node.js 0.4.8-0.8.6, Narwhal v0.3.2, RingoJS v0.8.0, and Rhino v1.7RC3-RC5. - -## Usage - -```js -(function(window) { - - // use a single load function - var load = typeof require == 'function' ? require : window.load; - - // load QUnit and CLIB if needed - var QUnit = - window.QUnit || ( - window.setTimeout || (window.addEventListener = window.setTimeout = / /), - window.QUnit = load('path/to/qunit.js') || window.QUnit, - load('path/to/qunit-clib.js'), - (window.addEventListener || 0).test && delete window.addEventListener, - window.QUnit - ); - - // explicitly call `QUnit.module()` instead of `module()` - // in case we are in a CLI environment - QUnit.module('A Test Module'); - - test('A Test', function() { - // ... - }); - - // must call `QUnit.start()` if using QUnit < 1.3.0 with Node.js or any - // version of QUnit with Narwhal, Rhino, or RingoJS - if (!window.document) { - QUnit.start(); - } -}(typeof global == 'object' && global || this)); -``` - -## Footnotes - - 1. QUnit v1.3.0 does not work with Narwhal or Ringo < v0.8.0 - - 2. Rhino v1.7RC4 does not support timeout fallbacks `clearTimeout` and `setTimeout` - -## Author - -* [John-David Dalton](http://allyoucanleet.com/) - [![twitter/jdalton](http://gravatar.com/avatar/299a3d891ff1920b69c364d061007043?s=70)](https://twitter.com/jdalton "Follow @jdalton on Twitter") diff --git a/Phaser/node_modules/grunt/node_modules/lodash/vendor/qunit/README.md b/Phaser/node_modules/grunt/node_modules/lodash/vendor/qunit/README.md deleted file mode 100644 index 57ff29e1..00000000 --- a/Phaser/node_modules/grunt/node_modules/lodash/vendor/qunit/README.md +++ /dev/null @@ -1,59 +0,0 @@ -[QUnit](http://qunitjs.com) - A JavaScript Unit Testing framework. -================================ - -QUnit is a powerful, easy-to-use, JavaScript test suite. It's used by the jQuery -project to test its code and plugins but is capable of testing any generic -JavaScript code (and even capable of testing JavaScript code on the server-side). - -QUnit is especially useful for regression testing: Whenever a bug is reported, -write a test that asserts the existence of that particular bug. Then fix it and -commit both. Every time you work on the code again, run the tests. If the bug -comes up again - a regression - you'll spot it immediately and know how to fix -it, because you know what code you just changed. - -Having good unit test coverage makes safe refactoring easy and cheap. You can -run the tests after each small refactoring step and always know what change -broke something. - -QUnit is similar to other unit testing frameworks like JUnit, but makes use of -the features JavaScript provides and helps with testing code in the browser, e.g. -with its stop/start facilities for testing asynchronous code. - -If you are interested in helping developing QUnit, you are in the right place. -For related discussions, visit the -[QUnit and Testing forum](http://forum.jquery.com/qunit-and-testing). - -Planning for a qunitjs.com site and other testing tools related work now happens -on the [jQuery Testing Team planning wiki](http://jquerytesting.pbworks.com/w/page/41556026/FrontPage). - -Development ------------ - -To submit patches, fork the repository, create a branch for the change. Then implement -the change, run `grunt` to lint and test it, then commit, push and create a pull request. - -Include some background for the change in the commit message and `Fixes #nnn`, referring -to the issue number you're addressing. - -To run `grunt`, you need `node` and `npm`, then `npm install grunt -g`. That gives you a global -grunt binary. For additional grunt tasks, also run `npm install`. - -Releases --------- - -Install git-extras and run `git changelog` to update History.md. -Update qunit/qunit.js|css and package.json to the release version, commit and -tag, update them again to the next version, commit and push commits and tags -(`git push --tags origin master`). - -Put the 'v' in front of the tag, e.g. `v1.8.0`. Clean up the changelog, removing merge commits -or whitespace cleanups. - -To upload to code.jquery.com (replace $version accordingly): - - scp -q qunit/qunit.js jqadmin@code.origin.jquery.com:/var/www/html/code.jquery.com/qunit/qunit-$version.js - scp -q qunit/qunit.css jqadmin@code.origin.jquery.com:/var/www/html/code.jquery.com/qunit/qunit-$version.css - -Then update /var/www/html/code.jquery.com/index.html and purge it with: - - curl -s http://code.origin.jquery.com/?reload \ No newline at end of file diff --git a/Phaser/node_modules/grunt/node_modules/lodash/vendor/tar/LICENCE b/Phaser/node_modules/grunt/node_modules/lodash/vendor/tar/LICENCE deleted file mode 100644 index 74489e2e..00000000 --- a/Phaser/node_modules/grunt/node_modules/lodash/vendor/tar/LICENCE +++ /dev/null @@ -1,25 +0,0 @@ -Copyright (c) Isaac Z. Schlueter -All rights reserved. - -The BSD License - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions -are met: -1. Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. -2. Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - -THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS -``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED -TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS -BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR -CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF -SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS -INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN -CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) -ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE -POSSIBILITY OF SUCH DAMAGE. diff --git a/Phaser/node_modules/grunt/node_modules/lodash/vendor/tar/README.md b/Phaser/node_modules/grunt/node_modules/lodash/vendor/tar/README.md deleted file mode 100644 index 7cfe3bbc..00000000 --- a/Phaser/node_modules/grunt/node_modules/lodash/vendor/tar/README.md +++ /dev/null @@ -1,50 +0,0 @@ -# node-tar - -Tar for Node.js. - -## Goals of this project - -1. Be able to parse and reasonably extract the contents of any tar file - created by any program that creates tar files, period. - - At least, this includes every version of: - - * bsdtar - * gnutar - * solaris posix tar - * Joerg Schilling's star ("Schilly tar") - -2. Create tar files that can be extracted by any of the following tar - programs: - - * bsdtar/libarchive version 2.6.2 - * gnutar 1.15 and above - * SunOS Posix tar - * Joerg Schilling's star ("Schilly tar") - -3. 100% test coverage. Speed is important. Correctness is slightly - more important. - -4. Create the kind of tar interface that Node users would want to use. - -5. Satisfy npm's needs for a portable tar implementation with a - JavaScript interface. - -6. No excuses. No complaining. No tolerance for failure. - -## But isn't there already a tar.js? - -Yes, there are a few. This one is going to be better, and it will be -fanatically maintained, because npm will depend on it. - -That's why I need to write it from scratch. Creating and extracting -tarballs is such a large part of what npm does, I simply can't have it -be a black box any longer. - -## Didn't you have something already? Where'd it go? - -It's in the "old" folder. It's not functional. Don't use it. - -It was a useful exploration to learn the issues involved, but like most -software of any reasonable complexity, node-tar won't be useful until -it's been written at least 3 times. diff --git a/Phaser/node_modules/grunt/node_modules/lodash/vendor/tar/vendor/block-stream/LICENCE b/Phaser/node_modules/grunt/node_modules/lodash/vendor/tar/vendor/block-stream/LICENCE deleted file mode 100644 index 74489e2e..00000000 --- a/Phaser/node_modules/grunt/node_modules/lodash/vendor/tar/vendor/block-stream/LICENCE +++ /dev/null @@ -1,25 +0,0 @@ -Copyright (c) Isaac Z. Schlueter -All rights reserved. - -The BSD License - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions -are met: -1. Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. -2. Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - -THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS -``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED -TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS -BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR -CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF -SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS -INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN -CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) -ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE -POSSIBILITY OF SUCH DAMAGE. diff --git a/Phaser/node_modules/grunt/node_modules/lodash/vendor/tar/vendor/block-stream/README.md b/Phaser/node_modules/grunt/node_modules/lodash/vendor/tar/vendor/block-stream/README.md deleted file mode 100644 index c16e9c46..00000000 --- a/Phaser/node_modules/grunt/node_modules/lodash/vendor/tar/vendor/block-stream/README.md +++ /dev/null @@ -1,14 +0,0 @@ -# block-stream - -A stream of blocks. - -Write data into it, and it'll output data in buffer blocks the size you -specify, padding with zeroes if necessary. - -```javascript -var block = new BlockStream(512) -fs.createReadStream("some-file").pipe(block) -block.pipe(fs.createWriteStream("block-file")) -``` - -When `.end()` or `.flush()` is called, it'll pad the block with zeroes. diff --git a/Phaser/node_modules/grunt/node_modules/lodash/vendor/tar/vendor/fstream/LICENSE b/Phaser/node_modules/grunt/node_modules/lodash/vendor/tar/vendor/fstream/LICENSE deleted file mode 100644 index 0c44ae71..00000000 --- a/Phaser/node_modules/grunt/node_modules/lodash/vendor/tar/vendor/fstream/LICENSE +++ /dev/null @@ -1,27 +0,0 @@ -Copyright (c) Isaac Z. Schlueter ("Author") -All rights reserved. - -The BSD License - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions -are met: - -1. Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - -2. Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - -THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND -ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS -BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR -CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF -SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR -BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, -WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE -OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN -IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/Phaser/node_modules/grunt/node_modules/lodash/vendor/tar/vendor/fstream/README.md b/Phaser/node_modules/grunt/node_modules/lodash/vendor/tar/vendor/fstream/README.md deleted file mode 100644 index 9d8cb77e..00000000 --- a/Phaser/node_modules/grunt/node_modules/lodash/vendor/tar/vendor/fstream/README.md +++ /dev/null @@ -1,76 +0,0 @@ -Like FS streams, but with stat on them, and supporting directories and -symbolic links, as well as normal files. Also, you can use this to set -the stats on a file, even if you don't change its contents, or to create -a symlink, etc. - -So, for example, you can "write" a directory, and it'll call `mkdir`. You -can specify a uid and gid, and it'll call `chown`. You can specify a -`mtime` and `atime`, and it'll call `utimes`. You can call it a symlink -and provide a `linkpath` and it'll call `symlink`. - -Note that it won't automatically resolve symbolic links. So, if you -call `fstream.Reader('/some/symlink')` then you'll get an object -that stats and then ends immediately (since it has no data). To follow -symbolic links, do this: `fstream.Reader({path:'/some/symlink', follow: -true })`. - -There are various checks to make sure that the bytes emitted are the -same as the intended size, if the size is set. - -## Examples - -```javascript -fstream - .Writer({ path: "path/to/file" - , mode: 0755 - , size: 6 - }) - .write("hello\n") - .end() -``` - -This will create the directories if they're missing, and then write -`hello\n` into the file, chmod it to 0755, and assert that 6 bytes have -been written when it's done. - -```javascript -fstream - .Writer({ path: "path/to/file" - , mode: 0755 - , size: 6 - , flags: "a" - }) - .write("hello\n") - .end() -``` - -You can pass flags in, if you want to append to a file. - -```javascript -fstream - .Writer({ path: "path/to/symlink" - , linkpath: "./file" - , SymbolicLink: true - , mode: "0755" // octal strings supported - }) - .end() -``` - -If isSymbolicLink is a function, it'll be called, and if it returns -true, then it'll treat it as a symlink. If it's not a function, then -any truish value will make a symlink, or you can set `type: -'SymbolicLink'`, which does the same thing. - -Note that the linkpath is relative to the symbolic link location, not -the parent dir or cwd. - -```javascript -fstream - .Reader("path/to/dir") - .pipe(fstream.Writer("path/to/other/dir")) -``` - -This will do like `cp -Rp path/to/dir path/to/other/dir`. If the other -dir exists and isn't a directory, then it'll emit an error. It'll also -set the uid, gid, mode, etc. to be identical. In this way, it's more -like `rsync -a` than simply a copy. diff --git a/Phaser/node_modules/grunt/node_modules/lodash/vendor/tar/vendor/graceful-fs/LICENSE b/Phaser/node_modules/grunt/node_modules/lodash/vendor/tar/vendor/graceful-fs/LICENSE deleted file mode 100644 index 05a40109..00000000 --- a/Phaser/node_modules/grunt/node_modules/lodash/vendor/tar/vendor/graceful-fs/LICENSE +++ /dev/null @@ -1,23 +0,0 @@ -Copyright 2009, 2010, 2011 Isaac Z. Schlueter. -All rights reserved. - -Permission is hereby granted, free of charge, to any person -obtaining a copy of this software and associated documentation -files (the "Software"), to deal in the Software without -restriction, including without limitation the rights to use, -copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the -Software is furnished to do so, subject to the following -conditions: - -The above copyright notice and this permission notice shall be -included in all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES -OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT -HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, -WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING -FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR -OTHER DEALINGS IN THE SOFTWARE. diff --git a/Phaser/node_modules/grunt/node_modules/lodash/vendor/tar/vendor/graceful-fs/README.md b/Phaser/node_modules/grunt/node_modules/lodash/vendor/tar/vendor/graceful-fs/README.md deleted file mode 100644 index 7d2e681e..00000000 --- a/Phaser/node_modules/grunt/node_modules/lodash/vendor/tar/vendor/graceful-fs/README.md +++ /dev/null @@ -1,5 +0,0 @@ -Just like node's `fs` module, but it does an incremental back-off when -EMFILE is encountered. - -Useful in asynchronous situations where one needs to try to open lots -and lots of files. diff --git a/Phaser/node_modules/grunt/node_modules/lodash/vendor/tar/vendor/inherits/README.md b/Phaser/node_modules/grunt/node_modules/lodash/vendor/tar/vendor/inherits/README.md deleted file mode 100644 index b2beaed9..00000000 --- a/Phaser/node_modules/grunt/node_modules/lodash/vendor/tar/vendor/inherits/README.md +++ /dev/null @@ -1,51 +0,0 @@ -A dead simple way to do inheritance in JS. - - var inherits = require("inherits") - - function Animal () { - this.alive = true - } - Animal.prototype.say = function (what) { - console.log(what) - } - - inherits(Dog, Animal) - function Dog () { - Dog.super.apply(this) - } - Dog.prototype.sniff = function () { - this.say("sniff sniff") - } - Dog.prototype.bark = function () { - this.say("woof woof") - } - - inherits(Chihuahua, Dog) - function Chihuahua () { - Chihuahua.super.apply(this) - } - Chihuahua.prototype.bark = function () { - this.say("yip yip") - } - - // also works - function Cat () { - Cat.super.apply(this) - } - Cat.prototype.hiss = function () { - this.say("CHSKKSS!!") - } - inherits(Cat, Animal, { - meow: function () { this.say("miao miao") } - }) - Cat.prototype.purr = function () { - this.say("purr purr") - } - - - var c = new Chihuahua - assert(c instanceof Chihuahua) - assert(c instanceof Dog) - assert(c instanceof Animal) - -The actual function is laughably small. 10-lines small. diff --git a/Phaser/node_modules/grunt/node_modules/lodash/vendor/tar/vendor/mkdirp/LICENSE b/Phaser/node_modules/grunt/node_modules/lodash/vendor/tar/vendor/mkdirp/LICENSE deleted file mode 100644 index 432d1aeb..00000000 --- a/Phaser/node_modules/grunt/node_modules/lodash/vendor/tar/vendor/mkdirp/LICENSE +++ /dev/null @@ -1,21 +0,0 @@ -Copyright 2010 James Halliday (mail@substack.net) - -This project is free software released under the MIT/X11 license: - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. diff --git a/Phaser/node_modules/grunt/node_modules/lodash/vendor/tar/vendor/mkdirp/readme.markdown b/Phaser/node_modules/grunt/node_modules/lodash/vendor/tar/vendor/mkdirp/readme.markdown deleted file mode 100644 index 83b0216a..00000000 --- a/Phaser/node_modules/grunt/node_modules/lodash/vendor/tar/vendor/mkdirp/readme.markdown +++ /dev/null @@ -1,63 +0,0 @@ -# mkdirp - -Like `mkdir -p`, but in node.js! - -[![build status](https://secure.travis-ci.org/substack/node-mkdirp.png)](http://travis-ci.org/substack/node-mkdirp) - -# example - -## pow.js - -```js -var mkdirp = require('mkdirp'); - -mkdirp('/tmp/foo/bar/baz', function (err) { - if (err) console.error(err) - else console.log('pow!') -}); -``` - -Output - -``` -pow! -``` - -And now /tmp/foo/bar/baz exists, huzzah! - -# methods - -```js -var mkdirp = require('mkdirp'); -``` - -## mkdirp(dir, mode, cb) - -Create a new directory and any necessary subdirectories at `dir` with octal -permission string `mode`. - -If `mode` isn't specified, it defaults to `0777 & (~process.umask())`. - -`cb(err, made)` fires with the error or the first directory `made` -that had to be created, if any. - -## mkdirp.sync(dir, mode) - -Synchronously create a new directory and any necessary subdirectories at `dir` -with octal permission string `mode`. - -If `mode` isn't specified, it defaults to `0777 & (~process.umask())`. - -Returns the first directory that had to be created, if any. - -# install - -With [npm](http://npmjs.org) do: - -``` -npm install mkdirp -``` - -# license - -MIT diff --git a/Phaser/node_modules/grunt/node_modules/lodash/vendor/tar/vendor/rimraf/AUTHORS b/Phaser/node_modules/grunt/node_modules/lodash/vendor/tar/vendor/rimraf/AUTHORS deleted file mode 100644 index 247b7543..00000000 --- a/Phaser/node_modules/grunt/node_modules/lodash/vendor/tar/vendor/rimraf/AUTHORS +++ /dev/null @@ -1,6 +0,0 @@ -# Authors sorted by whether or not they're me. -Isaac Z. Schlueter (http://blog.izs.me) -Wayne Larsen (http://github.com/wvl) -ritch -Marcel Laverdet -Yosef Dinerstein diff --git a/Phaser/node_modules/grunt/node_modules/lodash/vendor/tar/vendor/rimraf/LICENSE b/Phaser/node_modules/grunt/node_modules/lodash/vendor/tar/vendor/rimraf/LICENSE deleted file mode 100644 index 05a40109..00000000 --- a/Phaser/node_modules/grunt/node_modules/lodash/vendor/tar/vendor/rimraf/LICENSE +++ /dev/null @@ -1,23 +0,0 @@ -Copyright 2009, 2010, 2011 Isaac Z. Schlueter. -All rights reserved. - -Permission is hereby granted, free of charge, to any person -obtaining a copy of this software and associated documentation -files (the "Software"), to deal in the Software without -restriction, including without limitation the rights to use, -copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the -Software is furnished to do so, subject to the following -conditions: - -The above copyright notice and this permission notice shall be -included in all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES -OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT -HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, -WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING -FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR -OTHER DEALINGS IN THE SOFTWARE. diff --git a/Phaser/node_modules/grunt/node_modules/lodash/vendor/tar/vendor/rimraf/README.md b/Phaser/node_modules/grunt/node_modules/lodash/vendor/tar/vendor/rimraf/README.md deleted file mode 100644 index 96ce9b2a..00000000 --- a/Phaser/node_modules/grunt/node_modules/lodash/vendor/tar/vendor/rimraf/README.md +++ /dev/null @@ -1,21 +0,0 @@ -A `rm -rf` for node. - -Install with `npm install rimraf`, or just drop rimraf.js somewhere. - -## API - -`rimraf(f, callback)` - -The callback will be called with an error if there is one. Certain -errors are handled for you: - -* `EBUSY` - rimraf will back off a maximum of opts.maxBusyTries times - before giving up. -* `EMFILE` - If too many file descriptors get opened, rimraf will - patiently wait until more become available. - - -## rimraf.sync - -It can remove stuff synchronously, too. But that's not so good. Use -the async API. It's better. diff --git a/Phaser/node_modules/grunt/node_modules/lodash/vendor/underscore/LICENSE b/Phaser/node_modules/grunt/node_modules/lodash/vendor/underscore/LICENSE deleted file mode 100644 index 61d28c08..00000000 --- a/Phaser/node_modules/grunt/node_modules/lodash/vendor/underscore/LICENSE +++ /dev/null @@ -1,22 +0,0 @@ -Copyright (c) 2009-2012 Jeremy Ashkenas, DocumentCloud - -Permission is hereby granted, free of charge, to any person -obtaining a copy of this software and associated documentation -files (the "Software"), to deal in the Software without -restriction, including without limitation the rights to use, -copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the -Software is furnished to do so, subject to the following -conditions: - -The above copyright notice and this permission notice shall be -included in all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES -OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT -HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, -WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING -FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR -OTHER DEALINGS IN THE SOFTWARE. \ No newline at end of file diff --git a/Phaser/node_modules/grunt/node_modules/lodash/vendor/underscore/README.md b/Phaser/node_modules/grunt/node_modules/lodash/vendor/underscore/README.md deleted file mode 100644 index b1f3e50a..00000000 --- a/Phaser/node_modules/grunt/node_modules/lodash/vendor/underscore/README.md +++ /dev/null @@ -1,19 +0,0 @@ - __ - /\ \ __ - __ __ ___ \_\ \ __ _ __ ____ ___ ___ _ __ __ /\_\ ____ - /\ \/\ \ /' _ `\ /'_ \ /'__`\/\ __\/ ,__\ / ___\ / __`\/\ __\/'__`\ \/\ \ /',__\ - \ \ \_\ \/\ \/\ \/\ \ \ \/\ __/\ \ \//\__, `\/\ \__//\ \ \ \ \ \//\ __/ __ \ \ \/\__, `\ - \ \____/\ \_\ \_\ \___,_\ \____\\ \_\\/\____/\ \____\ \____/\ \_\\ \____\/\_\ _\ \ \/\____/ - \/___/ \/_/\/_/\/__,_ /\/____/ \/_/ \/___/ \/____/\/___/ \/_/ \/____/\/_//\ \_\ \/___/ - \ \____/ - \/___/ - -Underscore.js is a utility-belt library for JavaScript that provides -support for the usual functional suspects (each, map, reduce, filter...) -without extending any core JavaScript objects. - -For Docs, License, Tests, and pre-packed downloads, see: -http://underscorejs.org - -Many thanks to our contributors: -https://github.com/documentcloud/underscore/contributors diff --git a/Phaser/node_modules/grunt/node_modules/minimatch/LICENSE b/Phaser/node_modules/grunt/node_modules/minimatch/LICENSE deleted file mode 100644 index 05a40109..00000000 --- a/Phaser/node_modules/grunt/node_modules/minimatch/LICENSE +++ /dev/null @@ -1,23 +0,0 @@ -Copyright 2009, 2010, 2011 Isaac Z. Schlueter. -All rights reserved. - -Permission is hereby granted, free of charge, to any person -obtaining a copy of this software and associated documentation -files (the "Software"), to deal in the Software without -restriction, including without limitation the rights to use, -copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the -Software is furnished to do so, subject to the following -conditions: - -The above copyright notice and this permission notice shall be -included in all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES -OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT -HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, -WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING -FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR -OTHER DEALINGS IN THE SOFTWARE. diff --git a/Phaser/node_modules/grunt/node_modules/minimatch/README.md b/Phaser/node_modules/grunt/node_modules/minimatch/README.md deleted file mode 100644 index 6fd07d2e..00000000 --- a/Phaser/node_modules/grunt/node_modules/minimatch/README.md +++ /dev/null @@ -1,218 +0,0 @@ -# minimatch - -A minimal matching utility. - -[![Build Status](https://secure.travis-ci.org/isaacs/minimatch.png)](http://travis-ci.org/isaacs/minimatch) - - -This is the matching library used internally by npm. - -Eventually, it will replace the C binding in node-glob. - -It works by converting glob expressions into JavaScript `RegExp` -objects. - -## Usage - -```javascript -var minimatch = require("minimatch") - -minimatch("bar.foo", "*.foo") // true! -minimatch("bar.foo", "*.bar") // false! -``` - -## Features - -Supports these glob features: - -* Brace Expansion -* Extended glob matching -* "Globstar" `**` matching - -See: - -* `man sh` -* `man bash` -* `man 3 fnmatch` -* `man 5 gitignore` - -### Comparisons to other fnmatch/glob implementations - -While strict compliance with the existing standards is a worthwhile -goal, some discrepancies exist between minimatch and other -implementations, and are intentional. - -If the pattern starts with a `!` character, then it is negated. Set the -`nonegate` flag to suppress this behavior, and treat leading `!` -characters normally. This is perhaps relevant if you wish to start the -pattern with a negative extglob pattern like `!(a|B)`. Multiple `!` -characters at the start of a pattern will negate the pattern multiple -times. - -If a pattern starts with `#`, then it is treated as a comment, and -will not match anything. Use `\#` to match a literal `#` at the -start of a line, or set the `nocomment` flag to suppress this behavior. - -The double-star character `**` is supported by default, unless the -`noglobstar` flag is set. This is supported in the manner of bsdglob -and bash 4.1, where `**` only has special significance if it is the only -thing in a path part. That is, `a/**/b` will match `a/x/y/b`, but -`a/**b` will not. **Note that this is different from the way that `**` is -handled by ruby's `Dir` class.** - -If an escaped pattern has no matches, and the `nonull` flag is set, -then minimatch.match returns the pattern as-provided, rather than -interpreting the character escapes. For example, -`minimatch.match([], "\\*a\\?")` will return `"\\*a\\?"` rather than -`"*a?"`. This is akin to setting the `nullglob` option in bash, except -that it does not resolve escaped pattern characters. - -If brace expansion is not disabled, then it is performed before any -other interpretation of the glob pattern. Thus, a pattern like -`+(a|{b),c)}`, which would not be valid in bash or zsh, is expanded -**first** into the set of `+(a|b)` and `+(a|c)`, and those patterns are -checked for validity. Since those two are valid, matching proceeds. - - -## Minimatch Class - -Create a minimatch object by instanting the `minimatch.Minimatch` class. - -```javascript -var Minimatch = require("minimatch").Minimatch -var mm = new Minimatch(pattern, options) -``` - -### Properties - -* `pattern` The original pattern the minimatch object represents. -* `options` The options supplied to the constructor. -* `set` A 2-dimensional array of regexp or string expressions. - Each row in the - array corresponds to a brace-expanded pattern. Each item in the row - corresponds to a single path-part. For example, the pattern - `{a,b/c}/d` would expand to a set of patterns like: - - [ [ a, d ] - , [ b, c, d ] ] - - If a portion of the pattern doesn't have any "magic" in it - (that is, it's something like `"foo"` rather than `fo*o?`), then it - will be left as a string rather than converted to a regular - expression. - -* `regexp` Created by the `makeRe` method. A single regular expression - expressing the entire pattern. This is useful in cases where you wish - to use the pattern somewhat like `fnmatch(3)` with `FNM_PATH` enabled. -* `negate` True if the pattern is negated. -* `comment` True if the pattern is a comment. -* `empty` True if the pattern is `""`. - -### Methods - -* `makeRe` Generate the `regexp` member if necessary, and return it. - Will return `false` if the pattern is invalid. -* `match(fname)` Return true if the filename matches the pattern, or - false otherwise. -* `matchOne(fileArray, patternArray, partial)` Take a `/`-split - filename, and match it against a single row in the `regExpSet`. This - method is mainly for internal use, but is exposed so that it can be - used by a glob-walker that needs to avoid excessive filesystem calls. - -All other methods are internal, and will be called as necessary. - -## Functions - -The top-level exported function has a `cache` property, which is an LRU -cache set to store 100 items. So, calling these methods repeatedly -with the same pattern and options will use the same Minimatch object, -saving the cost of parsing it multiple times. - -### minimatch(path, pattern, options) - -Main export. Tests a path against the pattern using the options. - -```javascript -var isJS = minimatch(file, "*.js", { matchBase: true }) -``` - -### minimatch.filter(pattern, options) - -Returns a function that tests its -supplied argument, suitable for use with `Array.filter`. Example: - -```javascript -var javascripts = fileList.filter(minimatch.filter("*.js", {matchBase: true})) -``` - -### minimatch.match(list, pattern, options) - -Match against the list of -files, in the style of fnmatch or glob. If nothing is matched, and -options.nonull is set, then return a list containing the pattern itself. - -```javascript -var javascripts = minimatch.match(fileList, "*.js", {matchBase: true})) -``` - -### minimatch.makeRe(pattern, options) - -Make a regular expression object from the pattern. - -## Options - -All options are `false` by default. - -### debug - -Dump a ton of stuff to stderr. - -### nobrace - -Do not expand `{a,b}` and `{1..3}` brace sets. - -### noglobstar - -Disable `**` matching against multiple folder names. - -### dot - -Allow patterns to match filenames starting with a period, even if -the pattern does not explicitly have a period in that spot. - -Note that by default, `a/**/b` will **not** match `a/.d/b`, unless `dot` -is set. - -### noext - -Disable "extglob" style patterns like `+(a|b)`. - -### nocase - -Perform a case-insensitive match. - -### nonull - -When a match is not found by `minimatch.match`, return a list containing -the pattern itself. When set, an empty list is returned if there are -no matches. - -### matchBase - -If set, then patterns without slashes will be matched -against the basename of the path if it contains slashes. For example, -`a?b` would match the path `/xyz/123/acb`, but not `/xyz/acb/123`. - -### nocomment - -Suppress the behavior of treating `#` at the start of a pattern as a -comment. - -### nonegate - -Suppress the behavior of treating a leading `!` character as negation. - -### flipNegate - -Returns from negate expressions the same as if they were not negated. -(Ie, true on a hit, false on a miss.) diff --git a/Phaser/node_modules/grunt/node_modules/minimatch/node_modules/lru-cache/.npmignore b/Phaser/node_modules/grunt/node_modules/minimatch/node_modules/lru-cache/.npmignore deleted file mode 100644 index 07e6e472..00000000 --- a/Phaser/node_modules/grunt/node_modules/minimatch/node_modules/lru-cache/.npmignore +++ /dev/null @@ -1 +0,0 @@ -/node_modules diff --git a/Phaser/node_modules/grunt/node_modules/minimatch/node_modules/lru-cache/AUTHORS b/Phaser/node_modules/grunt/node_modules/minimatch/node_modules/lru-cache/AUTHORS deleted file mode 100644 index 016d7fbe..00000000 --- a/Phaser/node_modules/grunt/node_modules/minimatch/node_modules/lru-cache/AUTHORS +++ /dev/null @@ -1,8 +0,0 @@ -# Authors, sorted by whether or not they are me -Isaac Z. Schlueter -Carlos Brito Lage -Marko Mikulicic -Trent Mick -Kevin O'Hara -Marco Rogers -Jesse Dailey diff --git a/Phaser/node_modules/grunt/node_modules/minimatch/node_modules/lru-cache/LICENSE b/Phaser/node_modules/grunt/node_modules/minimatch/node_modules/lru-cache/LICENSE deleted file mode 100644 index 05a40109..00000000 --- a/Phaser/node_modules/grunt/node_modules/minimatch/node_modules/lru-cache/LICENSE +++ /dev/null @@ -1,23 +0,0 @@ -Copyright 2009, 2010, 2011 Isaac Z. Schlueter. -All rights reserved. - -Permission is hereby granted, free of charge, to any person -obtaining a copy of this software and associated documentation -files (the "Software"), to deal in the Software without -restriction, including without limitation the rights to use, -copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the -Software is furnished to do so, subject to the following -conditions: - -The above copyright notice and this permission notice shall be -included in all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES -OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT -HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, -WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING -FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR -OTHER DEALINGS IN THE SOFTWARE. diff --git a/Phaser/node_modules/grunt/node_modules/minimatch/node_modules/lru-cache/README.md b/Phaser/node_modules/grunt/node_modules/minimatch/node_modules/lru-cache/README.md deleted file mode 100644 index 03ee0f98..00000000 --- a/Phaser/node_modules/grunt/node_modules/minimatch/node_modules/lru-cache/README.md +++ /dev/null @@ -1,97 +0,0 @@ -# lru cache - -A cache object that deletes the least-recently-used items. - -## Usage: - -```javascript -var LRU = require("lru-cache") - , options = { max: 500 - , length: function (n) { return n * 2 } - , dispose: function (key, n) { n.close() } - , maxAge: 1000 * 60 * 60 } - , cache = LRU(options) - , otherCache = LRU(50) // sets just the max size - -cache.set("key", "value") -cache.get("key") // "value" - -cache.reset() // empty the cache -``` - -If you put more stuff in it, then items will fall out. - -If you try to put an oversized thing in it, then it'll fall out right -away. - -## Options - -* `max` The maximum size of the cache, checked by applying the length - function to all values in the cache. Not setting this is kind of - silly, since that's the whole purpose of this lib, but it defaults - to `Infinity`. -* `maxAge` Maximum age in ms. Items are not pro-actively pruned out - as they age, but if you try to get an item that is too old, it'll - drop it and return undefined instead of giving it to you. -* `length` Function that is used to calculate the length of stored - items. If you're storing strings or buffers, then you probably want - to do something like `function(n){return n.length}`. The default is - `function(n){return 1}`, which is fine if you want to store `n` - like-sized things. -* `dispose` Function that is called on items when they are dropped - from the cache. This can be handy if you want to close file - descriptors or do other cleanup tasks when items are no longer - accessible. Called with `key, value`. It's called *before* - actually removing the item from the internal cache, so if you want - to immediately put it back in, you'll have to do that in a - `nextTick` or `setTimeout` callback or it won't do anything. -* `stale` By default, if you set a `maxAge`, it'll only actually pull - stale items out of the cache when you `get(key)`. (That is, it's - not pre-emptively doing a `setTimeout` or anything.) If you set - `stale:true`, it'll return the stale value before deleting it. If - you don't set this, then it'll return `undefined` when you try to - get a stale entry, as if it had already been deleted. - -## API - -* `set(key, value)` -* `get(key) => value` - - Both of these will update the "recently used"-ness of the key. - They do what you think. - -* `peek(key)` - - Returns the key value (or `undefined` if not found) without - updating the "recently used"-ness of the key. - - (If you find yourself using this a lot, you *might* be using the - wrong sort of data structure, but there are some use cases where - it's handy.) - -* `del(key)` - - Deletes a key out of the cache. - -* `reset()` - - Clear the cache entirely, throwing away all values. - -* `has(key)` - - Check if a key is in the cache, without updating the recent-ness - or deleting it for being stale. - -* `forEach(function(value,key,cache), [thisp])` - - Just like `Array.prototype.forEach`. Iterates over all the keys - in the cache, in order of recent-ness. (Ie, more recently used - items are iterated over first.) - -* `keys()` - - Return an array of the keys in the cache. - -* `values()` - - Return an array of the values in the cache. diff --git a/Phaser/node_modules/grunt/node_modules/minimatch/node_modules/lru-cache/package.json b/Phaser/node_modules/grunt/node_modules/minimatch/node_modules/lru-cache/package.json deleted file mode 100644 index 81e7c67c..00000000 --- a/Phaser/node_modules/grunt/node_modules/minimatch/node_modules/lru-cache/package.json +++ /dev/null @@ -1,63 +0,0 @@ -{ - "name": "lru-cache", - "description": "A cache object that deletes the least-recently-used items.", - "version": "2.3.0", - "author": { - "name": "Isaac Z. Schlueter", - "email": "i@izs.me" - }, - "scripts": { - "test": "tap test --gc" - }, - "main": "lib/lru-cache.js", - "repository": { - "type": "git", - "url": "git://github.com/isaacs/node-lru-cache.git" - }, - "devDependencies": { - "tap": "", - "weak": "" - }, - "license": { - "type": "MIT", - "url": "http://github.com/isaacs/node-lru-cache/raw/master/LICENSE" - }, - "contributors": [ - { - "name": "Isaac Z. Schlueter", - "email": "i@izs.me" - }, - { - "name": "Carlos Brito Lage", - "email": "carlos@carloslage.net" - }, - { - "name": "Marko Mikulicic", - "email": "marko.mikulicic@isti.cnr.it" - }, - { - "name": "Trent Mick", - "email": "trentm@gmail.com" - }, - { - "name": "Kevin O'Hara", - "email": "kevinohara80@gmail.com" - }, - { - "name": "Marco Rogers", - "email": "marco.rogers@gmail.com" - }, - { - "name": "Jesse Dailey", - "email": "jesse.dailey@gmail.com" - } - ], - "readme": "# lru cache\n\nA cache object that deletes the least-recently-used items.\n\n## Usage:\n\n```javascript\nvar LRU = require(\"lru-cache\")\n , options = { max: 500\n , length: function (n) { return n * 2 }\n , dispose: function (key, n) { n.close() }\n , maxAge: 1000 * 60 * 60 }\n , cache = LRU(options)\n , otherCache = LRU(50) // sets just the max size\n\ncache.set(\"key\", \"value\")\ncache.get(\"key\") // \"value\"\n\ncache.reset() // empty the cache\n```\n\nIf you put more stuff in it, then items will fall out.\n\nIf you try to put an oversized thing in it, then it'll fall out right\naway.\n\n## Options\n\n* `max` The maximum size of the cache, checked by applying the length\n function to all values in the cache. Not setting this is kind of\n silly, since that's the whole purpose of this lib, but it defaults\n to `Infinity`.\n* `maxAge` Maximum age in ms. Items are not pro-actively pruned out\n as they age, but if you try to get an item that is too old, it'll\n drop it and return undefined instead of giving it to you.\n* `length` Function that is used to calculate the length of stored\n items. If you're storing strings or buffers, then you probably want\n to do something like `function(n){return n.length}`. The default is\n `function(n){return 1}`, which is fine if you want to store `n`\n like-sized things.\n* `dispose` Function that is called on items when they are dropped\n from the cache. This can be handy if you want to close file\n descriptors or do other cleanup tasks when items are no longer\n accessible. Called with `key, value`. It's called *before*\n actually removing the item from the internal cache, so if you want\n to immediately put it back in, you'll have to do that in a\n `nextTick` or `setTimeout` callback or it won't do anything.\n* `stale` By default, if you set a `maxAge`, it'll only actually pull\n stale items out of the cache when you `get(key)`. (That is, it's\n not pre-emptively doing a `setTimeout` or anything.) If you set\n `stale:true`, it'll return the stale value before deleting it. If\n you don't set this, then it'll return `undefined` when you try to\n get a stale entry, as if it had already been deleted.\n\n## API\n\n* `set(key, value)`\n* `get(key) => value`\n\n Both of these will update the \"recently used\"-ness of the key.\n They do what you think.\n\n* `peek(key)`\n\n Returns the key value (or `undefined` if not found) without\n updating the \"recently used\"-ness of the key.\n\n (If you find yourself using this a lot, you *might* be using the\n wrong sort of data structure, but there are some use cases where\n it's handy.)\n\n* `del(key)`\n\n Deletes a key out of the cache.\n\n* `reset()`\n\n Clear the cache entirely, throwing away all values.\n\n* `has(key)`\n\n Check if a key is in the cache, without updating the recent-ness\n or deleting it for being stale.\n\n* `forEach(function(value,key,cache), [thisp])`\n\n Just like `Array.prototype.forEach`. Iterates over all the keys\n in the cache, in order of recent-ness. (Ie, more recently used\n items are iterated over first.)\n\n* `keys()`\n\n Return an array of the keys in the cache.\n\n* `values()`\n\n Return an array of the values in the cache.\n", - "readmeFilename": "README.md", - "_id": "lru-cache@2.3.0", - "dist": { - "shasum": "faa4f57cb4b8920c3505f420bddfdd882a3abaac" - }, - "_from": "lru-cache@2", - "_resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-2.3.0.tgz" -} diff --git a/Phaser/node_modules/grunt/node_modules/minimatch/node_modules/sigmund/LICENSE b/Phaser/node_modules/grunt/node_modules/minimatch/node_modules/sigmund/LICENSE deleted file mode 100644 index 0c44ae71..00000000 --- a/Phaser/node_modules/grunt/node_modules/minimatch/node_modules/sigmund/LICENSE +++ /dev/null @@ -1,27 +0,0 @@ -Copyright (c) Isaac Z. Schlueter ("Author") -All rights reserved. - -The BSD License - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions -are met: - -1. Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - -2. Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - -THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND -ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS -BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR -CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF -SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR -BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, -WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE -OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN -IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/Phaser/node_modules/grunt/node_modules/minimatch/node_modules/sigmund/README.md b/Phaser/node_modules/grunt/node_modules/minimatch/node_modules/sigmund/README.md deleted file mode 100644 index 7e365129..00000000 --- a/Phaser/node_modules/grunt/node_modules/minimatch/node_modules/sigmund/README.md +++ /dev/null @@ -1,53 +0,0 @@ -# sigmund - -Quick and dirty signatures for Objects. - -This is like a much faster `deepEquals` comparison, which returns a -string key suitable for caches and the like. - -## Usage - -```javascript -function doSomething (someObj) { - var key = sigmund(someObj, maxDepth) // max depth defaults to 10 - var cached = cache.get(key) - if (cached) return cached) - - var result = expensiveCalculation(someObj) - cache.set(key, result) - return result -} -``` - -The resulting key will be as unique and reproducible as calling -`JSON.stringify` or `util.inspect` on the object, but is much faster. -In order to achieve this speed, some differences are glossed over. -For example, the object `{0:'foo'}` will be treated identically to the -array `['foo']`. - -Also, just as there is no way to summon the soul from the scribblings -of a cocain-addled psychoanalyst, there is no way to revive the object -from the signature string that sigmund gives you. In fact, it's -barely even readable. - -As with `sys.inspect` and `JSON.stringify`, larger objects will -produce larger signature strings. - -Because sigmund is a bit less strict than the more thorough -alternatives, the strings will be shorter, and also there is a -slightly higher chance for collisions. For example, these objects -have the same signature: - - var obj1 = {a:'b',c:/def/,g:['h','i',{j:'',k:'l'}]} - var obj2 = {a:'b',c:'/def/',g:['h','i','{jkl']} - -Like a good Freudian, sigmund is most effective when you already have -some understanding of what you're looking for. It can help you help -yourself, but you must be willing to do some work as well. - -Cycles are handled, and cyclical objects are silently omitted (though -the key is included in the signature output.) - -The second argument is the maximum depth, which defaults to 10, -because that is the maximum object traversal depth covered by most -insurance carriers. diff --git a/Phaser/node_modules/grunt/node_modules/minimatch/node_modules/sigmund/package.json b/Phaser/node_modules/grunt/node_modules/minimatch/node_modules/sigmund/package.json deleted file mode 100644 index fcd0daf1..00000000 --- a/Phaser/node_modules/grunt/node_modules/minimatch/node_modules/sigmund/package.json +++ /dev/null @@ -1,42 +0,0 @@ -{ - "name": "sigmund", - "version": "1.0.0", - "description": "Quick and dirty signatures for Objects.", - "main": "sigmund.js", - "directories": { - "test": "test" - }, - "dependencies": {}, - "devDependencies": { - "tap": "~0.3.0" - }, - "scripts": { - "test": "tap test/*.js", - "bench": "node bench.js" - }, - "repository": { - "type": "git", - "url": "git://github.com/isaacs/sigmund" - }, - "keywords": [ - "object", - "signature", - "key", - "data", - "psychoanalysis" - ], - "author": { - "name": "Isaac Z. Schlueter", - "email": "i@izs.me", - "url": "http://blog.izs.me/" - }, - "license": "BSD", - "readme": "# sigmund\n\nQuick and dirty signatures for Objects.\n\nThis is like a much faster `deepEquals` comparison, which returns a\nstring key suitable for caches and the like.\n\n## Usage\n\n```javascript\nfunction doSomething (someObj) {\n var key = sigmund(someObj, maxDepth) // max depth defaults to 10\n var cached = cache.get(key)\n if (cached) return cached)\n\n var result = expensiveCalculation(someObj)\n cache.set(key, result)\n return result\n}\n```\n\nThe resulting key will be as unique and reproducible as calling\n`JSON.stringify` or `util.inspect` on the object, but is much faster.\nIn order to achieve this speed, some differences are glossed over.\nFor example, the object `{0:'foo'}` will be treated identically to the\narray `['foo']`.\n\nAlso, just as there is no way to summon the soul from the scribblings\nof a cocain-addled psychoanalyst, there is no way to revive the object\nfrom the signature string that sigmund gives you. In fact, it's\nbarely even readable.\n\nAs with `sys.inspect` and `JSON.stringify`, larger objects will\nproduce larger signature strings.\n\nBecause sigmund is a bit less strict than the more thorough\nalternatives, the strings will be shorter, and also there is a\nslightly higher chance for collisions. For example, these objects\nhave the same signature:\n\n var obj1 = {a:'b',c:/def/,g:['h','i',{j:'',k:'l'}]}\n var obj2 = {a:'b',c:'/def/',g:['h','i','{jkl']}\n\nLike a good Freudian, sigmund is most effective when you already have\nsome understanding of what you're looking for. It can help you help\nyourself, but you must be willing to do some work as well.\n\nCycles are handled, and cyclical objects are silently omitted (though\nthe key is included in the signature output.)\n\nThe second argument is the maximum depth, which defaults to 10,\nbecause that is the maximum object traversal depth covered by most\ninsurance carriers.\n", - "readmeFilename": "README.md", - "_id": "sigmund@1.0.0", - "dist": { - "shasum": "8b342a413c9a7c2c3b82a0f2ea4c56343bc4cb13" - }, - "_from": "sigmund@~1.0.0", - "_resolved": "https://registry.npmjs.org/sigmund/-/sigmund-1.0.0.tgz" -} diff --git a/Phaser/node_modules/grunt/node_modules/minimatch/package.json b/Phaser/node_modules/grunt/node_modules/minimatch/package.json deleted file mode 100644 index c1fa6237..00000000 --- a/Phaser/node_modules/grunt/node_modules/minimatch/package.json +++ /dev/null @@ -1,40 +0,0 @@ -{ - "author": { - "name": "Isaac Z. Schlueter", - "email": "i@izs.me", - "url": "http://blog.izs.me" - }, - "name": "minimatch", - "description": "a glob matcher in javascript", - "version": "0.2.12", - "repository": { - "type": "git", - "url": "git://github.com/isaacs/minimatch.git" - }, - "main": "minimatch.js", - "scripts": { - "test": "tap test" - }, - "engines": { - "node": "*" - }, - "dependencies": { - "lru-cache": "2", - "sigmund": "~1.0.0" - }, - "devDependencies": { - "tap": "" - }, - "license": { - "type": "MIT", - "url": "http://github.com/isaacs/minimatch/raw/master/LICENSE" - }, - "readme": "# minimatch\n\nA minimal matching utility.\n\n[![Build Status](https://secure.travis-ci.org/isaacs/minimatch.png)](http://travis-ci.org/isaacs/minimatch)\n\n\nThis is the matching library used internally by npm.\n\nEventually, it will replace the C binding in node-glob.\n\nIt works by converting glob expressions into JavaScript `RegExp`\nobjects.\n\n## Usage\n\n```javascript\nvar minimatch = require(\"minimatch\")\n\nminimatch(\"bar.foo\", \"*.foo\") // true!\nminimatch(\"bar.foo\", \"*.bar\") // false!\n```\n\n## Features\n\nSupports these glob features:\n\n* Brace Expansion\n* Extended glob matching\n* \"Globstar\" `**` matching\n\nSee:\n\n* `man sh`\n* `man bash`\n* `man 3 fnmatch`\n* `man 5 gitignore`\n\n### Comparisons to other fnmatch/glob implementations\n\nWhile strict compliance with the existing standards is a worthwhile\ngoal, some discrepancies exist between minimatch and other\nimplementations, and are intentional.\n\nIf the pattern starts with a `!` character, then it is negated. Set the\n`nonegate` flag to suppress this behavior, and treat leading `!`\ncharacters normally. This is perhaps relevant if you wish to start the\npattern with a negative extglob pattern like `!(a|B)`. Multiple `!`\ncharacters at the start of a pattern will negate the pattern multiple\ntimes.\n\nIf a pattern starts with `#`, then it is treated as a comment, and\nwill not match anything. Use `\\#` to match a literal `#` at the\nstart of a line, or set the `nocomment` flag to suppress this behavior.\n\nThe double-star character `**` is supported by default, unless the\n`noglobstar` flag is set. This is supported in the manner of bsdglob\nand bash 4.1, where `**` only has special significance if it is the only\nthing in a path part. That is, `a/**/b` will match `a/x/y/b`, but\n`a/**b` will not. **Note that this is different from the way that `**` is\nhandled by ruby's `Dir` class.**\n\nIf an escaped pattern has no matches, and the `nonull` flag is set,\nthen minimatch.match returns the pattern as-provided, rather than\ninterpreting the character escapes. For example,\n`minimatch.match([], \"\\\\*a\\\\?\")` will return `\"\\\\*a\\\\?\"` rather than\n`\"*a?\"`. This is akin to setting the `nullglob` option in bash, except\nthat it does not resolve escaped pattern characters.\n\nIf brace expansion is not disabled, then it is performed before any\nother interpretation of the glob pattern. Thus, a pattern like\n`+(a|{b),c)}`, which would not be valid in bash or zsh, is expanded\n**first** into the set of `+(a|b)` and `+(a|c)`, and those patterns are\nchecked for validity. Since those two are valid, matching proceeds.\n\n\n## Minimatch Class\n\nCreate a minimatch object by instanting the `minimatch.Minimatch` class.\n\n```javascript\nvar Minimatch = require(\"minimatch\").Minimatch\nvar mm = new Minimatch(pattern, options)\n```\n\n### Properties\n\n* `pattern` The original pattern the minimatch object represents.\n* `options` The options supplied to the constructor.\n* `set` A 2-dimensional array of regexp or string expressions.\n Each row in the\n array corresponds to a brace-expanded pattern. Each item in the row\n corresponds to a single path-part. For example, the pattern\n `{a,b/c}/d` would expand to a set of patterns like:\n\n [ [ a, d ]\n , [ b, c, d ] ]\n\n If a portion of the pattern doesn't have any \"magic\" in it\n (that is, it's something like `\"foo\"` rather than `fo*o?`), then it\n will be left as a string rather than converted to a regular\n expression.\n\n* `regexp` Created by the `makeRe` method. A single regular expression\n expressing the entire pattern. This is useful in cases where you wish\n to use the pattern somewhat like `fnmatch(3)` with `FNM_PATH` enabled.\n* `negate` True if the pattern is negated.\n* `comment` True if the pattern is a comment.\n* `empty` True if the pattern is `\"\"`.\n\n### Methods\n\n* `makeRe` Generate the `regexp` member if necessary, and return it.\n Will return `false` if the pattern is invalid.\n* `match(fname)` Return true if the filename matches the pattern, or\n false otherwise.\n* `matchOne(fileArray, patternArray, partial)` Take a `/`-split\n filename, and match it against a single row in the `regExpSet`. This\n method is mainly for internal use, but is exposed so that it can be\n used by a glob-walker that needs to avoid excessive filesystem calls.\n\nAll other methods are internal, and will be called as necessary.\n\n## Functions\n\nThe top-level exported function has a `cache` property, which is an LRU\ncache set to store 100 items. So, calling these methods repeatedly\nwith the same pattern and options will use the same Minimatch object,\nsaving the cost of parsing it multiple times.\n\n### minimatch(path, pattern, options)\n\nMain export. Tests a path against the pattern using the options.\n\n```javascript\nvar isJS = minimatch(file, \"*.js\", { matchBase: true })\n```\n\n### minimatch.filter(pattern, options)\n\nReturns a function that tests its\nsupplied argument, suitable for use with `Array.filter`. Example:\n\n```javascript\nvar javascripts = fileList.filter(minimatch.filter(\"*.js\", {matchBase: true}))\n```\n\n### minimatch.match(list, pattern, options)\n\nMatch against the list of\nfiles, in the style of fnmatch or glob. If nothing is matched, and\noptions.nonull is set, then return a list containing the pattern itself.\n\n```javascript\nvar javascripts = minimatch.match(fileList, \"*.js\", {matchBase: true}))\n```\n\n### minimatch.makeRe(pattern, options)\n\nMake a regular expression object from the pattern.\n\n## Options\n\nAll options are `false` by default.\n\n### debug\n\nDump a ton of stuff to stderr.\n\n### nobrace\n\nDo not expand `{a,b}` and `{1..3}` brace sets.\n\n### noglobstar\n\nDisable `**` matching against multiple folder names.\n\n### dot\n\nAllow patterns to match filenames starting with a period, even if\nthe pattern does not explicitly have a period in that spot.\n\nNote that by default, `a/**/b` will **not** match `a/.d/b`, unless `dot`\nis set.\n\n### noext\n\nDisable \"extglob\" style patterns like `+(a|b)`.\n\n### nocase\n\nPerform a case-insensitive match.\n\n### nonull\n\nWhen a match is not found by `minimatch.match`, return a list containing\nthe pattern itself. When set, an empty list is returned if there are\nno matches.\n\n### matchBase\n\nIf set, then patterns without slashes will be matched\nagainst the basename of the path if it contains slashes. For example,\n`a?b` would match the path `/xyz/123/acb`, but not `/xyz/acb/123`.\n\n### nocomment\n\nSuppress the behavior of treating `#` at the start of a pattern as a\ncomment.\n\n### nonegate\n\nSuppress the behavior of treating a leading `!` character as negation.\n\n### flipNegate\n\nReturns from negate expressions the same as if they were not negated.\n(Ie, true on a hit, false on a miss.)\n", - "readmeFilename": "README.md", - "_id": "minimatch@0.2.12", - "dist": { - "shasum": "308fb5bc9d1aabe4a0477f812ec820ee5fa8e25d" - }, - "_from": "minimatch@~0.2.6", - "_resolved": "https://registry.npmjs.org/minimatch/-/minimatch-0.2.12.tgz" -} diff --git a/Phaser/node_modules/grunt/node_modules/nopt/.npmignore b/Phaser/node_modules/grunt/node_modules/nopt/.npmignore deleted file mode 100644 index e69de29b..00000000 diff --git a/Phaser/node_modules/grunt/node_modules/nopt/LICENSE b/Phaser/node_modules/grunt/node_modules/nopt/LICENSE deleted file mode 100644 index 05a40109..00000000 --- a/Phaser/node_modules/grunt/node_modules/nopt/LICENSE +++ /dev/null @@ -1,23 +0,0 @@ -Copyright 2009, 2010, 2011 Isaac Z. Schlueter. -All rights reserved. - -Permission is hereby granted, free of charge, to any person -obtaining a copy of this software and associated documentation -files (the "Software"), to deal in the Software without -restriction, including without limitation the rights to use, -copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the -Software is furnished to do so, subject to the following -conditions: - -The above copyright notice and this permission notice shall be -included in all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES -OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT -HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, -WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING -FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR -OTHER DEALINGS IN THE SOFTWARE. diff --git a/Phaser/node_modules/grunt/node_modules/nopt/README.md b/Phaser/node_modules/grunt/node_modules/nopt/README.md deleted file mode 100644 index eeddfd4f..00000000 --- a/Phaser/node_modules/grunt/node_modules/nopt/README.md +++ /dev/null @@ -1,208 +0,0 @@ -If you want to write an option parser, and have it be good, there are -two ways to do it. The Right Way, and the Wrong Way. - -The Wrong Way is to sit down and write an option parser. We've all done -that. - -The Right Way is to write some complex configurable program with so many -options that you go half-insane just trying to manage them all, and put -it off with duct-tape solutions until you see exactly to the core of the -problem, and finally snap and write an awesome option parser. - -If you want to write an option parser, don't write an option parser. -Write a package manager, or a source control system, or a service -restarter, or an operating system. You probably won't end up with a -good one of those, but if you don't give up, and you are relentless and -diligent enough in your procrastination, you may just end up with a very -nice option parser. - -## USAGE - - // my-program.js - var nopt = require("nopt") - , Stream = require("stream").Stream - , path = require("path") - , knownOpts = { "foo" : [String, null] - , "bar" : [Stream, Number] - , "baz" : path - , "bloo" : [ "big", "medium", "small" ] - , "flag" : Boolean - , "pick" : Boolean - , "many" : [String, Array] - } - , shortHands = { "foofoo" : ["--foo", "Mr. Foo"] - , "b7" : ["--bar", "7"] - , "m" : ["--bloo", "medium"] - , "p" : ["--pick"] - , "f" : ["--flag"] - } - // everything is optional. - // knownOpts and shorthands default to {} - // arg list defaults to process.argv - // slice defaults to 2 - , parsed = nopt(knownOpts, shortHands, process.argv, 2) - console.log(parsed) - -This would give you support for any of the following: - -```bash -$ node my-program.js --foo "blerp" --no-flag -{ "foo" : "blerp", "flag" : false } - -$ node my-program.js ---bar 7 --foo "Mr. Hand" --flag -{ bar: 7, foo: "Mr. Hand", flag: true } - -$ node my-program.js --foo "blerp" -f -----p -{ foo: "blerp", flag: true, pick: true } - -$ node my-program.js -fp --foofoo -{ foo: "Mr. Foo", flag: true, pick: true } - -$ node my-program.js --foofoo -- -fp # -- stops the flag parsing. -{ foo: "Mr. Foo", argv: { remain: ["-fp"] } } - -$ node my-program.js --blatzk 1000 -fp # unknown opts are ok. -{ blatzk: 1000, flag: true, pick: true } - -$ node my-program.js --blatzk true -fp # but they need a value -{ blatzk: true, flag: true, pick: true } - -$ node my-program.js --no-blatzk -fp # unless they start with "no-" -{ blatzk: false, flag: true, pick: true } - -$ node my-program.js --baz b/a/z # known paths are resolved. -{ baz: "/Users/isaacs/b/a/z" } - -# if Array is one of the types, then it can take many -# values, and will always be an array. The other types provided -# specify what types are allowed in the list. - -$ node my-program.js --many 1 --many null --many foo -{ many: ["1", "null", "foo"] } - -$ node my-program.js --many foo -{ many: ["foo"] } -``` - -Read the tests at the bottom of `lib/nopt.js` for more examples of -what this puppy can do. - -## Types - -The following types are supported, and defined on `nopt.typeDefs` - -* String: A normal string. No parsing is done. -* path: A file system path. Gets resolved against cwd if not absolute. -* url: A url. If it doesn't parse, it isn't accepted. -* Number: Must be numeric. -* Date: Must parse as a date. If it does, and `Date` is one of the options, - then it will return a Date object, not a string. -* Boolean: Must be either `true` or `false`. If an option is a boolean, - then it does not need a value, and its presence will imply `true` as - the value. To negate boolean flags, do `--no-whatever` or `--whatever - false` -* NaN: Means that the option is strictly not allowed. Any value will - fail. -* Stream: An object matching the "Stream" class in node. Valuable - for use when validating programmatically. (npm uses this to let you - supply any WriteStream on the `outfd` and `logfd` config options.) -* Array: If `Array` is specified as one of the types, then the value - will be parsed as a list of options. This means that multiple values - can be specified, and that the value will always be an array. - -If a type is an array of values not on this list, then those are -considered valid values. For instance, in the example above, the -`--bloo` option can only be one of `"big"`, `"medium"`, or `"small"`, -and any other value will be rejected. - -When parsing unknown fields, `"true"`, `"false"`, and `"null"` will be -interpreted as their JavaScript equivalents, and numeric values will be -interpreted as a number. - -You can also mix types and values, or multiple types, in a list. For -instance `{ blah: [Number, null] }` would allow a value to be set to -either a Number or null. - -To define a new type, add it to `nopt.typeDefs`. Each item in that -hash is an object with a `type` member and a `validate` method. The -`type` member is an object that matches what goes in the type list. The -`validate` method is a function that gets called with `validate(data, -key, val)`. Validate methods should assign `data[key]` to the valid -value of `val` if it can be handled properly, or return boolean -`false` if it cannot. - -You can also call `nopt.clean(data, types, typeDefs)` to clean up a -config object and remove its invalid properties. - -## Error Handling - -By default, nopt outputs a warning to standard error when invalid -options are found. You can change this behavior by assigning a method -to `nopt.invalidHandler`. This method will be called with -the offending `nopt.invalidHandler(key, val, types)`. - -If no `nopt.invalidHandler` is assigned, then it will console.error -its whining. If it is assigned to boolean `false` then the warning is -suppressed. - -## Abbreviations - -Yes, they are supported. If you define options like this: - -```javascript -{ "foolhardyelephants" : Boolean -, "pileofmonkeys" : Boolean } -``` - -Then this will work: - -```bash -node program.js --foolhar --pil -node program.js --no-f --pileofmon -# etc. -``` - -## Shorthands - -Shorthands are a hash of shorter option names to a snippet of args that -they expand to. - -If multiple one-character shorthands are all combined, and the -combination does not unambiguously match any other option or shorthand, -then they will be broken up into their constituent parts. For example: - -```json -{ "s" : ["--loglevel", "silent"] -, "g" : "--global" -, "f" : "--force" -, "p" : "--parseable" -, "l" : "--long" -} -``` - -```bash -npm ls -sgflp -# just like doing this: -npm ls --loglevel silent --global --force --long --parseable -``` - -## The Rest of the args - -The config object returned by nopt is given a special member called -`argv`, which is an object with the following fields: - -* `remain`: The remaining args after all the parsing has occurred. -* `original`: The args as they originally appeared. -* `cooked`: The args after flags and shorthands are expanded. - -## Slicing - -Node programs are called with more or less the exact argv as it appears -in C land, after the v8 and node-specific options have been plucked off. -As such, `argv[0]` is always `node` and `argv[1]` is always the -JavaScript program being run. - -That's usually not very useful to you. So they're sliced off by -default. If you want them, then you can pass in `0` as the last -argument, or any other number that you'd like to slice off the start of -the list. diff --git a/Phaser/node_modules/grunt/node_modules/nopt/node_modules/abbrev/LICENSE b/Phaser/node_modules/grunt/node_modules/nopt/node_modules/abbrev/LICENSE deleted file mode 100644 index 05a40109..00000000 --- a/Phaser/node_modules/grunt/node_modules/nopt/node_modules/abbrev/LICENSE +++ /dev/null @@ -1,23 +0,0 @@ -Copyright 2009, 2010, 2011 Isaac Z. Schlueter. -All rights reserved. - -Permission is hereby granted, free of charge, to any person -obtaining a copy of this software and associated documentation -files (the "Software"), to deal in the Software without -restriction, including without limitation the rights to use, -copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the -Software is furnished to do so, subject to the following -conditions: - -The above copyright notice and this permission notice shall be -included in all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES -OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT -HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, -WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING -FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR -OTHER DEALINGS IN THE SOFTWARE. diff --git a/Phaser/node_modules/grunt/node_modules/nopt/node_modules/abbrev/README.md b/Phaser/node_modules/grunt/node_modules/nopt/node_modules/abbrev/README.md deleted file mode 100644 index 99746fe6..00000000 --- a/Phaser/node_modules/grunt/node_modules/nopt/node_modules/abbrev/README.md +++ /dev/null @@ -1,23 +0,0 @@ -# abbrev-js - -Just like [ruby's Abbrev](http://apidock.com/ruby/Abbrev). - -Usage: - - var abbrev = require("abbrev"); - abbrev("foo", "fool", "folding", "flop"); - - // returns: - { fl: 'flop' - , flo: 'flop' - , flop: 'flop' - , fol: 'folding' - , fold: 'folding' - , foldi: 'folding' - , foldin: 'folding' - , folding: 'folding' - , foo: 'foo' - , fool: 'fool' - } - -This is handy for command-line scripts, or other cases where you want to be able to accept shorthands. diff --git a/Phaser/node_modules/grunt/node_modules/nopt/node_modules/abbrev/package.json b/Phaser/node_modules/grunt/node_modules/nopt/node_modules/abbrev/package.json deleted file mode 100644 index a61f44fb..00000000 --- a/Phaser/node_modules/grunt/node_modules/nopt/node_modules/abbrev/package.json +++ /dev/null @@ -1,29 +0,0 @@ -{ - "name": "abbrev", - "version": "1.0.4", - "description": "Like ruby's abbrev module, but in js", - "author": { - "name": "Isaac Z. Schlueter", - "email": "i@izs.me" - }, - "main": "./lib/abbrev.js", - "scripts": { - "test": "node lib/abbrev.js" - }, - "repository": { - "type": "git", - "url": "http://github.com/isaacs/abbrev-js" - }, - "license": { - "type": "MIT", - "url": "https://github.com/isaacs/abbrev-js/raw/master/LICENSE" - }, - "readme": "# abbrev-js\n\nJust like [ruby's Abbrev](http://apidock.com/ruby/Abbrev).\n\nUsage:\n\n var abbrev = require(\"abbrev\");\n abbrev(\"foo\", \"fool\", \"folding\", \"flop\");\n \n // returns:\n { fl: 'flop'\n , flo: 'flop'\n , flop: 'flop'\n , fol: 'folding'\n , fold: 'folding'\n , foldi: 'folding'\n , foldin: 'folding'\n , folding: 'folding'\n , foo: 'foo'\n , fool: 'fool'\n }\n\nThis is handy for command-line scripts, or other cases where you want to be able to accept shorthands.\n", - "readmeFilename": "README.md", - "_id": "abbrev@1.0.4", - "dist": { - "shasum": "6a06399d0bddc97d51996c0a87936b866771ff38" - }, - "_from": "abbrev@1", - "_resolved": "https://registry.npmjs.org/abbrev/-/abbrev-1.0.4.tgz" -} diff --git a/Phaser/node_modules/grunt/node_modules/nopt/package.json b/Phaser/node_modules/grunt/node_modules/nopt/package.json deleted file mode 100644 index 747a1f80..00000000 --- a/Phaser/node_modules/grunt/node_modules/nopt/package.json +++ /dev/null @@ -1,36 +0,0 @@ -{ - "name": "nopt", - "version": "1.0.10", - "description": "Option parsing for Node, supporting types, shorthands, etc. Used by npm.", - "author": { - "name": "Isaac Z. Schlueter", - "email": "i@izs.me", - "url": "http://blog.izs.me/" - }, - "main": "lib/nopt.js", - "scripts": { - "test": "node lib/nopt.js" - }, - "repository": { - "type": "git", - "url": "http://github.com/isaacs/nopt" - }, - "bin": { - "nopt": "./bin/nopt.js" - }, - "license": { - "type": "MIT", - "url": "https://github.com/isaacs/nopt/raw/master/LICENSE" - }, - "dependencies": { - "abbrev": "1" - }, - "readme": "If you want to write an option parser, and have it be good, there are\ntwo ways to do it. The Right Way, and the Wrong Way.\n\nThe Wrong Way is to sit down and write an option parser. We've all done\nthat.\n\nThe Right Way is to write some complex configurable program with so many\noptions that you go half-insane just trying to manage them all, and put\nit off with duct-tape solutions until you see exactly to the core of the\nproblem, and finally snap and write an awesome option parser.\n\nIf you want to write an option parser, don't write an option parser.\nWrite a package manager, or a source control system, or a service\nrestarter, or an operating system. You probably won't end up with a\ngood one of those, but if you don't give up, and you are relentless and\ndiligent enough in your procrastination, you may just end up with a very\nnice option parser.\n\n## USAGE\n\n // my-program.js\n var nopt = require(\"nopt\")\n , Stream = require(\"stream\").Stream\n , path = require(\"path\")\n , knownOpts = { \"foo\" : [String, null]\n , \"bar\" : [Stream, Number]\n , \"baz\" : path\n , \"bloo\" : [ \"big\", \"medium\", \"small\" ]\n , \"flag\" : Boolean\n , \"pick\" : Boolean\n , \"many\" : [String, Array]\n }\n , shortHands = { \"foofoo\" : [\"--foo\", \"Mr. Foo\"]\n , \"b7\" : [\"--bar\", \"7\"]\n , \"m\" : [\"--bloo\", \"medium\"]\n , \"p\" : [\"--pick\"]\n , \"f\" : [\"--flag\"]\n }\n // everything is optional.\n // knownOpts and shorthands default to {}\n // arg list defaults to process.argv\n // slice defaults to 2\n , parsed = nopt(knownOpts, shortHands, process.argv, 2)\n console.log(parsed)\n\nThis would give you support for any of the following:\n\n```bash\n$ node my-program.js --foo \"blerp\" --no-flag\n{ \"foo\" : \"blerp\", \"flag\" : false }\n\n$ node my-program.js ---bar 7 --foo \"Mr. Hand\" --flag\n{ bar: 7, foo: \"Mr. Hand\", flag: true }\n\n$ node my-program.js --foo \"blerp\" -f -----p\n{ foo: \"blerp\", flag: true, pick: true }\n\n$ node my-program.js -fp --foofoo\n{ foo: \"Mr. Foo\", flag: true, pick: true }\n\n$ node my-program.js --foofoo -- -fp # -- stops the flag parsing.\n{ foo: \"Mr. Foo\", argv: { remain: [\"-fp\"] } }\n\n$ node my-program.js --blatzk 1000 -fp # unknown opts are ok.\n{ blatzk: 1000, flag: true, pick: true }\n\n$ node my-program.js --blatzk true -fp # but they need a value\n{ blatzk: true, flag: true, pick: true }\n\n$ node my-program.js --no-blatzk -fp # unless they start with \"no-\"\n{ blatzk: false, flag: true, pick: true }\n\n$ node my-program.js --baz b/a/z # known paths are resolved.\n{ baz: \"/Users/isaacs/b/a/z\" }\n\n# if Array is one of the types, then it can take many\n# values, and will always be an array. The other types provided\n# specify what types are allowed in the list.\n\n$ node my-program.js --many 1 --many null --many foo\n{ many: [\"1\", \"null\", \"foo\"] }\n\n$ node my-program.js --many foo\n{ many: [\"foo\"] }\n```\n\nRead the tests at the bottom of `lib/nopt.js` for more examples of\nwhat this puppy can do.\n\n## Types\n\nThe following types are supported, and defined on `nopt.typeDefs`\n\n* String: A normal string. No parsing is done.\n* path: A file system path. Gets resolved against cwd if not absolute.\n* url: A url. If it doesn't parse, it isn't accepted.\n* Number: Must be numeric.\n* Date: Must parse as a date. If it does, and `Date` is one of the options,\n then it will return a Date object, not a string.\n* Boolean: Must be either `true` or `false`. If an option is a boolean,\n then it does not need a value, and its presence will imply `true` as\n the value. To negate boolean flags, do `--no-whatever` or `--whatever\n false`\n* NaN: Means that the option is strictly not allowed. Any value will\n fail.\n* Stream: An object matching the \"Stream\" class in node. Valuable\n for use when validating programmatically. (npm uses this to let you\n supply any WriteStream on the `outfd` and `logfd` config options.)\n* Array: If `Array` is specified as one of the types, then the value\n will be parsed as a list of options. This means that multiple values\n can be specified, and that the value will always be an array.\n\nIf a type is an array of values not on this list, then those are\nconsidered valid values. For instance, in the example above, the\n`--bloo` option can only be one of `\"big\"`, `\"medium\"`, or `\"small\"`,\nand any other value will be rejected.\n\nWhen parsing unknown fields, `\"true\"`, `\"false\"`, and `\"null\"` will be\ninterpreted as their JavaScript equivalents, and numeric values will be\ninterpreted as a number.\n\nYou can also mix types and values, or multiple types, in a list. For\ninstance `{ blah: [Number, null] }` would allow a value to be set to\neither a Number or null.\n\nTo define a new type, add it to `nopt.typeDefs`. Each item in that\nhash is an object with a `type` member and a `validate` method. The\n`type` member is an object that matches what goes in the type list. The\n`validate` method is a function that gets called with `validate(data,\nkey, val)`. Validate methods should assign `data[key]` to the valid\nvalue of `val` if it can be handled properly, or return boolean\n`false` if it cannot.\n\nYou can also call `nopt.clean(data, types, typeDefs)` to clean up a\nconfig object and remove its invalid properties.\n\n## Error Handling\n\nBy default, nopt outputs a warning to standard error when invalid\noptions are found. You can change this behavior by assigning a method\nto `nopt.invalidHandler`. This method will be called with\nthe offending `nopt.invalidHandler(key, val, types)`.\n\nIf no `nopt.invalidHandler` is assigned, then it will console.error\nits whining. If it is assigned to boolean `false` then the warning is\nsuppressed.\n\n## Abbreviations\n\nYes, they are supported. If you define options like this:\n\n```javascript\n{ \"foolhardyelephants\" : Boolean\n, \"pileofmonkeys\" : Boolean }\n```\n\nThen this will work:\n\n```bash\nnode program.js --foolhar --pil\nnode program.js --no-f --pileofmon\n# etc.\n```\n\n## Shorthands\n\nShorthands are a hash of shorter option names to a snippet of args that\nthey expand to.\n\nIf multiple one-character shorthands are all combined, and the\ncombination does not unambiguously match any other option or shorthand,\nthen they will be broken up into their constituent parts. For example:\n\n```json\n{ \"s\" : [\"--loglevel\", \"silent\"]\n, \"g\" : \"--global\"\n, \"f\" : \"--force\"\n, \"p\" : \"--parseable\"\n, \"l\" : \"--long\"\n}\n```\n\n```bash\nnpm ls -sgflp\n# just like doing this:\nnpm ls --loglevel silent --global --force --long --parseable\n```\n\n## The Rest of the args\n\nThe config object returned by nopt is given a special member called\n`argv`, which is an object with the following fields:\n\n* `remain`: The remaining args after all the parsing has occurred.\n* `original`: The args as they originally appeared.\n* `cooked`: The args after flags and shorthands are expanded.\n\n## Slicing\n\nNode programs are called with more or less the exact argv as it appears\nin C land, after the v8 and node-specific options have been plucked off.\nAs such, `argv[0]` is always `node` and `argv[1]` is always the\nJavaScript program being run.\n\nThat's usually not very useful to you. So they're sliced off by\ndefault. If you want them, then you can pass in `0` as the last\nargument, or any other number that you'd like to slice off the start of\nthe list.\n", - "readmeFilename": "README.md", - "_id": "nopt@1.0.10", - "dist": { - "shasum": "82a43cbb79f29795a93f031ffa093819515ed248" - }, - "_from": "nopt@~1.0.10", - "_resolved": "https://registry.npmjs.org/nopt/-/nopt-1.0.10.tgz" -} diff --git a/Phaser/node_modules/grunt/node_modules/rimraf/AUTHORS b/Phaser/node_modules/grunt/node_modules/rimraf/AUTHORS deleted file mode 100644 index 247b7543..00000000 --- a/Phaser/node_modules/grunt/node_modules/rimraf/AUTHORS +++ /dev/null @@ -1,6 +0,0 @@ -# Authors sorted by whether or not they're me. -Isaac Z. Schlueter (http://blog.izs.me) -Wayne Larsen (http://github.com/wvl) -ritch -Marcel Laverdet -Yosef Dinerstein diff --git a/Phaser/node_modules/grunt/node_modules/rimraf/LICENSE b/Phaser/node_modules/grunt/node_modules/rimraf/LICENSE deleted file mode 100644 index 05a40109..00000000 --- a/Phaser/node_modules/grunt/node_modules/rimraf/LICENSE +++ /dev/null @@ -1,23 +0,0 @@ -Copyright 2009, 2010, 2011 Isaac Z. Schlueter. -All rights reserved. - -Permission is hereby granted, free of charge, to any person -obtaining a copy of this software and associated documentation -files (the "Software"), to deal in the Software without -restriction, including without limitation the rights to use, -copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the -Software is furnished to do so, subject to the following -conditions: - -The above copyright notice and this permission notice shall be -included in all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES -OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT -HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, -WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING -FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR -OTHER DEALINGS IN THE SOFTWARE. diff --git a/Phaser/node_modules/grunt/node_modules/rimraf/README.md b/Phaser/node_modules/grunt/node_modules/rimraf/README.md deleted file mode 100644 index 96ce9b2a..00000000 --- a/Phaser/node_modules/grunt/node_modules/rimraf/README.md +++ /dev/null @@ -1,21 +0,0 @@ -A `rm -rf` for node. - -Install with `npm install rimraf`, or just drop rimraf.js somewhere. - -## API - -`rimraf(f, callback)` - -The callback will be called with an error if there is one. Certain -errors are handled for you: - -* `EBUSY` - rimraf will back off a maximum of opts.maxBusyTries times - before giving up. -* `EMFILE` - If too many file descriptors get opened, rimraf will - patiently wait until more become available. - - -## rimraf.sync - -It can remove stuff synchronously, too. But that's not so good. Use -the async API. It's better. diff --git a/Phaser/node_modules/grunt/node_modules/rimraf/node_modules/graceful-fs/.npmignore b/Phaser/node_modules/grunt/node_modules/rimraf/node_modules/graceful-fs/.npmignore deleted file mode 100644 index c2658d7d..00000000 --- a/Phaser/node_modules/grunt/node_modules/rimraf/node_modules/graceful-fs/.npmignore +++ /dev/null @@ -1 +0,0 @@ -node_modules/ diff --git a/Phaser/node_modules/grunt/node_modules/rimraf/node_modules/graceful-fs/LICENSE b/Phaser/node_modules/grunt/node_modules/rimraf/node_modules/graceful-fs/LICENSE deleted file mode 100644 index 05a40109..00000000 --- a/Phaser/node_modules/grunt/node_modules/rimraf/node_modules/graceful-fs/LICENSE +++ /dev/null @@ -1,23 +0,0 @@ -Copyright 2009, 2010, 2011 Isaac Z. Schlueter. -All rights reserved. - -Permission is hereby granted, free of charge, to any person -obtaining a copy of this software and associated documentation -files (the "Software"), to deal in the Software without -restriction, including without limitation the rights to use, -copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the -Software is furnished to do so, subject to the following -conditions: - -The above copyright notice and this permission notice shall be -included in all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES -OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT -HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, -WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING -FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR -OTHER DEALINGS IN THE SOFTWARE. diff --git a/Phaser/node_modules/grunt/node_modules/rimraf/node_modules/graceful-fs/README.md b/Phaser/node_modules/grunt/node_modules/rimraf/node_modules/graceful-fs/README.md deleted file mode 100644 index 7d2e681e..00000000 --- a/Phaser/node_modules/grunt/node_modules/rimraf/node_modules/graceful-fs/README.md +++ /dev/null @@ -1,5 +0,0 @@ -Just like node's `fs` module, but it does an incremental back-off when -EMFILE is encountered. - -Useful in asynchronous situations where one needs to try to open lots -and lots of files. diff --git a/Phaser/node_modules/grunt/node_modules/rimraf/node_modules/graceful-fs/package.json b/Phaser/node_modules/grunt/node_modules/rimraf/node_modules/graceful-fs/package.json deleted file mode 100644 index 050d3e51..00000000 --- a/Phaser/node_modules/grunt/node_modules/rimraf/node_modules/graceful-fs/package.json +++ /dev/null @@ -1,40 +0,0 @@ -{ - "author": { - "name": "Isaac Z. Schlueter", - "email": "i@izs.me", - "url": "http://blog.izs.me" - }, - "name": "graceful-fs", - "description": "fs monkey-patching to avoid EMFILE and other problems", - "version": "1.1.14", - "repository": { - "type": "git", - "url": "git://github.com/isaacs/node-graceful-fs.git" - }, - "main": "graceful-fs.js", - "engines": { - "node": ">=0.4.0" - }, - "directories": { - "test": "test" - }, - "scripts": { - "test": "tap test/*.js" - }, - "keywords": [ - "fs", - "EMFILE", - "error", - "handling", - "monkeypatch" - ], - "license": "BSD", - "readme": "Just like node's `fs` module, but it does an incremental back-off when\nEMFILE is encountered.\n\nUseful in asynchronous situations where one needs to try to open lots\nand lots of files.\n", - "readmeFilename": "README.md", - "_id": "graceful-fs@1.1.14", - "dist": { - "shasum": "6876c83c31424763e36d1498a9157eff859e9c22" - }, - "_from": "graceful-fs@~1.1", - "_resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-1.1.14.tgz" -} diff --git a/Phaser/node_modules/grunt/node_modules/rimraf/package.json b/Phaser/node_modules/grunt/node_modules/rimraf/package.json deleted file mode 100644 index 43865083..00000000 --- a/Phaser/node_modules/grunt/node_modules/rimraf/package.json +++ /dev/null @@ -1,59 +0,0 @@ -{ - "name": "rimraf", - "version": "2.0.3", - "main": "rimraf.js", - "description": "A deep deletion module for node (like `rm -rf`)", - "author": { - "name": "Isaac Z. Schlueter", - "email": "i@izs.me", - "url": "http://blog.izs.me/" - }, - "license": { - "type": "MIT", - "url": "https://github.com/isaacs/rimraf/raw/master/LICENSE" - }, - "optionalDependencies": { - "graceful-fs": "~1.1" - }, - "repository": { - "type": "git", - "url": "git://github.com/isaacs/rimraf.git" - }, - "scripts": { - "test": "cd test && bash run.sh" - }, - "contributors": [ - { - "name": "Isaac Z. Schlueter", - "email": "i@izs.me", - "url": "http://blog.izs.me" - }, - { - "name": "Wayne Larsen", - "email": "wayne@larsen.st", - "url": "http://github.com/wvl" - }, - { - "name": "ritch", - "email": "skawful@gmail.com" - }, - { - "name": "Marcel Laverdet" - }, - { - "name": "Yosef Dinerstein", - "email": "yosefd@microsoft.com" - } - ], - "readme": "A `rm -rf` for node.\n\nInstall with `npm install rimraf`, or just drop rimraf.js somewhere.\n\n## API\n\n`rimraf(f, callback)`\n\nThe callback will be called with an error if there is one. Certain\nerrors are handled for you:\n\n* `EBUSY` - rimraf will back off a maximum of opts.maxBusyTries times\n before giving up.\n* `EMFILE` - If too many file descriptors get opened, rimraf will\n patiently wait until more become available.\n\n\n## rimraf.sync\n\nIt can remove stuff synchronously, too. But that's not so good. Use\nthe async API. It's better.\n", - "readmeFilename": "README.md", - "_id": "rimraf@2.0.3", - "dependencies": { - "graceful-fs": "~1.1" - }, - "dist": { - "shasum": "9c0d52e7f19c281e490308a405abaa81175d038e" - }, - "_from": "rimraf@~2.0.2", - "_resolved": "https://registry.npmjs.org/rimraf/-/rimraf-2.0.3.tgz" -} diff --git a/Phaser/node_modules/grunt/node_modules/rimraf/test/run.sh b/Phaser/node_modules/grunt/node_modules/rimraf/test/run.sh deleted file mode 100644 index 598f0163..00000000 --- a/Phaser/node_modules/grunt/node_modules/rimraf/test/run.sh +++ /dev/null @@ -1,10 +0,0 @@ -#!/bin/bash -set -e -for i in test-*.js; do - echo -n $i ... - bash setup.sh - node $i - ! [ -d target ] - echo "pass" -done -rm -rf target diff --git a/Phaser/node_modules/grunt/node_modules/rimraf/test/setup.sh b/Phaser/node_modules/grunt/node_modules/rimraf/test/setup.sh deleted file mode 100644 index 2602e631..00000000 --- a/Phaser/node_modules/grunt/node_modules/rimraf/test/setup.sh +++ /dev/null @@ -1,47 +0,0 @@ -#!/bin/bash - -set -e - -files=10 -folders=2 -depth=4 -target="$PWD/target" - -rm -rf target - -fill () { - local depth=$1 - local files=$2 - local folders=$3 - local target=$4 - - if ! [ -d $target ]; then - mkdir -p $target - fi - - local f - - f=$files - while [ $f -gt 0 ]; do - touch "$target/f-$depth-$f" - let f-- - done - - let depth-- - - if [ $depth -le 0 ]; then - return 0 - fi - - f=$folders - while [ $f -gt 0 ]; do - mkdir "$target/folder-$depth-$f" - fill $depth $files $folders "$target/d-$depth-$f" - let f-- - done -} - -fill $depth $files $folders $target - -# sanity assert -[ -d $target ] diff --git a/Phaser/node_modules/grunt/node_modules/underscore.string/.travis.yml b/Phaser/node_modules/grunt/node_modules/underscore.string/.travis.yml deleted file mode 100644 index ab27b29b..00000000 --- a/Phaser/node_modules/grunt/node_modules/underscore.string/.travis.yml +++ /dev/null @@ -1,8 +0,0 @@ -language: ruby -rvm: - - 1.9.3 - -before_script: - - "export DISPLAY=:99.0" - - "sh -e /etc/init.d/xvfb start" - - sleep 2 \ No newline at end of file diff --git a/Phaser/node_modules/grunt/node_modules/underscore.string/Gemfile b/Phaser/node_modules/grunt/node_modules/underscore.string/Gemfile deleted file mode 100644 index f0248273..00000000 --- a/Phaser/node_modules/grunt/node_modules/underscore.string/Gemfile +++ /dev/null @@ -1,5 +0,0 @@ -source :rubygems - -gem 'serve' -gem 'uglifier' -gem 'rake' \ No newline at end of file diff --git a/Phaser/node_modules/grunt/node_modules/underscore.string/Gemfile.lock b/Phaser/node_modules/grunt/node_modules/underscore.string/Gemfile.lock deleted file mode 100644 index a6bb1e73..00000000 --- a/Phaser/node_modules/grunt/node_modules/underscore.string/Gemfile.lock +++ /dev/null @@ -1,34 +0,0 @@ -GEM - remote: http://rubygems.org/ - specs: - activesupport (3.2.3) - i18n (~> 0.6) - multi_json (~> 1.0) - execjs (1.3.0) - multi_json (~> 1.0) - i18n (0.6.0) - multi_json (1.2.0) - rack (1.4.1) - rack-test (0.6.1) - rack (>= 1.0) - rake (0.9.2.2) - serve (1.5.1) - activesupport (~> 3.0) - i18n - rack (~> 1.2) - rack-test (~> 0.5) - tilt (~> 1.3) - tzinfo - tilt (1.3.3) - tzinfo (0.3.33) - uglifier (1.2.4) - execjs (>= 0.3.0) - multi_json (>= 1.0.2) - -PLATFORMS - ruby - -DEPENDENCIES - rake - serve - uglifier diff --git a/Phaser/node_modules/grunt/node_modules/underscore.string/README.markdown b/Phaser/node_modules/grunt/node_modules/underscore.string/README.markdown deleted file mode 100644 index d2244b57..00000000 --- a/Phaser/node_modules/grunt/node_modules/underscore.string/README.markdown +++ /dev/null @@ -1,668 +0,0 @@ -# Underscore.string [![Build Status](https://secure.travis-ci.org/epeli/underscore.string.png?branch=master)](http://travis-ci.org/epeli/underscore.string) # - - - -Javascript lacks complete string manipulation operations. -This an attempt to fill that gap. List of build-in methods can be found -for example from [Dive Into JavaScript][d]. - -[d]: http://www.diveintojavascript.com/core-javascript-reference/the-string-object - - -As name states this an extension for [Underscore.js][u], but it can be used -independently from **_s**-global variable. But with Underscore.js you can -use Object-Oriented style and chaining: - -[u]: http://documentcloud.github.com/underscore/ - -```javascript -_(" epeli ").chain().trim().capitalize().value() -=> "Epeli" -``` - -## Download ## - - * [Development version](https://raw.github.com/epeli/underscore.string/master/lib/underscore.string.js) *Uncompressed with Comments 18kb* - * [Production version](https://github.com/epeli/underscore.string/raw/master/dist/underscore.string.min.js) *Minified 7kb* - - -## Node.js installation ## - -**npm package** - - npm install underscore.string - -**Standalone usage**: - -```javascript -var _s = require('underscore.string'); -``` - -**Integrate with Underscore.js**: - -```javascript -var _ = require('underscore'); - -// Import Underscore.string to separate object, because there are conflict functions (include, reverse, contains) -_.str = require('underscore.string'); - -// Mix in non-conflict functions to Underscore namespace if you want -_.mixin(_.str.exports()); - -// All functions, include conflict, will be available through _.str object -_.str.include('Underscore.string', 'string'); // => true -``` - -## String Functions ## - -For availability of functions in this way you need to mix in Underscore.string functions: - -```javascript -_.mixin(_.string.exports()); -``` - -otherwise functions from examples will be available through _.string or _.str objects: - -```javascript -_.str.capitalize('epeli') -=> "Epeli" -``` - -**capitalize** _.capitalize(string) - -Converts first letter of the string to uppercase. - -```javascript -_.capitalize("foo Bar") -=> "Foo Bar" -``` - -**chop** _.chop(string, step) - -```javascript -_.chop('whitespace', 3) -=> ['whi','tes','pac','e'] -``` - -**clean** _.clean(str) - -Compress some whitespaces to one. - -```javascript -_.clean(" foo bar ") -=> 'foo bar' -``` - -**chars** _.chars(str) - -```javascript -_.chars('Hello') -=> ['H','e','l','l','o'] -``` - -**includes** _.includes(string, substring) - -Tests if string contains a substring. - -```javascript -_.includes("foobar", "ob") -=> true -``` - -**include** available only through _.str object, because Underscore has function with the same name. - -```javascript -_.str.include("foobar", "ob") -=> true -``` - -**includes** function was removed - -But you can create it in this way, for compatibility with previous versions: - -```javascript -_.includes = _.str.include -``` - -**count** _.count(string, substring) - -```javascript -_('Hello world').count('l') -=> 3 -``` - -**escapeHTML** _.escapeHTML(string) - -Converts HTML special characters to their entity equivalents. - -```javascript -_('
        Blah blah blah
        ').escapeHTML(); -=> '<div>Blah blah blah</div>' -``` - -**unescapeHTML** _.unescapeHTML(string) - -Converts entity characters to HTML equivalents. - -```javascript -_('<div>Blah blah blah</div>').unescapeHTML(); -=> '
        Blah blah blah
        ' -``` - -**insert** _.insert(string, index, substing) - -```javascript -_('Hello ').insert(6, 'world') -=> 'Hello world' -``` - -**isBlank** _.isBlank(string) - -```javascript -_('').isBlank(); // => true -_('\n').isBlank(); // => true -_(' ').isBlank(); // => true -_('a').isBlank(); // => false -``` - -**join** _.join(separator, *strings) - -Joins strings together with given separator - -```javascript -_.join(" ", "foo", "bar") -=> "foo bar" -``` - -**lines** _.lines(str) - -```javascript -_.lines("Hello\nWorld") -=> ["Hello", "World"] -``` - -**reverse** available only through _.str object, because Underscore has function with the same name. - -Return reversed string: - -```javascript -_.str.reverse("foobar") -=> 'raboof' -``` - -**splice** _.splice(string, index, howmany, substring) - -Like a array splice. - -```javascript -_('https://edtsech@bitbucket.org/edtsech/underscore.strings').splice(30, 7, 'epeli') -=> 'https://edtsech@bitbucket.org/epeli/underscore.strings' -``` - -**startsWith** _.startsWith(string, starts) - -This method checks whether string starts with starts. - -```javascript -_("image.gif").startsWith("image") -=> true -``` - -**endsWith** _.endsWith(string, ends) - -This method checks whether string ends with ends. - -```javascript -_("image.gif").endsWith("gif") -=> true -``` - -**succ** _.succ(str) - -Returns the successor to str. - -```javascript -_('a').succ() -=> 'b' - -_('A').succ() -=> 'B' -``` - -**supplant** - -Supplant function was removed, use Underscore.js [template function][p]. - -[p]: http://documentcloud.github.com/underscore/#template - -**strip** alias for *trim* - -**lstrip** alias for *ltrim* - -**rstrip** alias for *rtrim* - -**titleize** _.titleize(string) - -```javascript -_('my name is epeli').titleize() -=> 'My Name Is Epeli' -``` - -**camelize** _.camelize(string) - -Converts underscored or dasherized string to a camelized one - -```javascript -_('-moz-transform').camelize() -=> 'MozTransform' -``` - -**classify** _.classify(string) - -Converts string to camelized class name - -```javascript -_('some_class_name').classify() -=> 'SomeClassName' -``` - -**underscored** _.underscored(string) - -Converts a camelized or dasherized string into an underscored one - -```javascript -_('MozTransform').underscored() -=> 'moz_transform' -``` - -**dasherize** _.dasherize(string) - -Converts a underscored or camelized string into an dasherized one - -```javascript -_('MozTransform').dasherize() -=> '-moz-transform' -``` - -**humanize** _.humanize(string) - -Converts an underscored, camelized, or dasherized string into a humanized one. -Also removes beginning and ending whitespace, and removes the postfix '_id'. - -```javascript -_(' capitalize dash-CamelCase_underscore trim ').humanize() -=> 'Capitalize dash camel case underscore trim' -``` - -**trim** _.trim(string, [characters]) - -trims defined characters from begining and ending of the string. -Defaults to whitespace characters. - -```javascript -_.trim(" foobar ") -=> "foobar" - -_.trim("_-foobar-_", "_-") -=> "foobar" -``` - - -**ltrim** _.ltrim(string, [characters]) - -Left trim. Similar to trim, but only for left side. - - -**rtrim** _.rtrim(string, [characters]) - -Right trim. Similar to trim, but only for right side. - -**truncate** _.truncate(string, length, truncateString) - -```javascript -_('Hello world').truncate(5) -=> 'Hello...' - -_('Hello').truncate(10) -=> 'Hello' -``` - -**prune** _.prune(string, length, pruneString) - -Elegant version of truncate. -Makes sure the pruned string does not exceed the original length. -Avoid half-chopped words when truncating. - -```javascript -_('Hello, world').prune(5) -=> 'Hello...' - -_('Hello, world').prune(8) -=> 'Hello...' - -_('Hello, world').prune(5, ' (read a lot more)') -=> 'Hello, world' (as adding "(read a lot more)" would be longer than the original string) - -_('Hello, cruel world').prune(15) -=> 'Hello, cruel...' - -_('Hello').prune(10) -=> 'Hello' -``` - -**words** _.words(str, delimiter=" ") - -Split string by delimiter (String or RegExp), ' ' by default. - -```javascript -_.words("I love you") -=> ["I","love","you"] - -_.words("I_love_you", "_") -=> ["I","love","you"] - -_.words("I-love-you", /-/) -=> ["I","love","you"] -``` - -**sprintf** _.sprintf(string format, *arguments) - -C like string formatting. -Credits goes to [Alexandru Marasteanu][o]. -For more detailed documentation, see the [original page][o]. - -[o]: http://www.diveintojavascript.com/projects/sprintf-for-javascript - -```javascript -_.sprintf("%.1f", 1.17) -"1.2" -``` - -**pad** _.pad(str, length, [padStr, type]) - -pads the `str` with characters until the total string length is equal to the passed `length` parameter. By default, pads on the **left** with the space char (`" "`). `padStr` is truncated to a single character if necessary. - -```javascript -_.pad("1", 8) --> " 1"; - -_.pad("1", 8, '0') --> "00000001"; - -_.pad("1", 8, '0', 'right') --> "10000000"; - -_.pad("1", 8, '0', 'both') --> "00001000"; - -_.pad("1", 8, 'bleepblorp', 'both') --> "bbbb1bbb"; -``` - -**lpad** _.lpad(str, length, [padStr]) - -left-pad a string. Alias for `pad(str, length, padStr, 'left')` - -```javascript -_.lpad("1", 8, '0') --> "00000001"; -``` - -**rpad** _.rpad(str, length, [padStr]) - -right-pad a string. Alias for `pad(str, length, padStr, 'right')` - -```javascript -_.rpad("1", 8, '0') --> "10000000"; -``` - -**lrpad** _.lrpad(str, length, [padStr]) - -left/right-pad a string. Alias for `pad(str, length, padStr, 'both')` - -```javascript -_.lrpad("1", 8, '0') --> "00001000"; -``` - -**center** alias for **lrpad** - -**ljust** alias for *rpad* - -**rjust** alias for *lpad* - -**toNumber** _.toNumber(string, [decimals]) - -Parse string to number. Returns NaN if string can't be parsed to number. - -```javascript -_('2.556').toNumber() -=> 3 - -_('2.556').toNumber(1) -=> 2.6 -``` - -**strRight** _.strRight(string, pattern) - -Searches a string from left to right for a pattern and returns a substring consisting of the characters in the string that are to the right of the pattern or all string if no match found. - -```javascript -_('This_is_a_test_string').strRight('_') -=> "is_a_test_string"; -``` - -**strRightBack** _.strRightBack(string, pattern) - -Searches a string from right to left for a pattern and returns a substring consisting of the characters in the string that are to the right of the pattern or all string if no match found. - -```javascript -_('This_is_a_test_string').strRightBack('_') -=> "string"; -``` - -**strLeft** _.strLeft(string, pattern) - -Searches a string from left to right for a pattern and returns a substring consisting of the characters in the string that are to the left of the pattern or all string if no match found. - -```javascript -_('This_is_a_test_string').strLeft('_') -=> "This"; -``` - -**strLeftBack** _.strLeftBack(string, pattern) - -Searches a string from right to left for a pattern and returns a substring consisting of the characters in the string that are to the left of the pattern or all string if no match found. - -```javascript -_('This_is_a_test_string').strLeftBack('_') -=> "This_is_a_test"; -``` - -**stripTags** - -Removes all html tags from string. - -```javascript -_('a link').stripTags() -=> 'a link' - -_('a link').stripTags() -=> 'a linkalert("hello world!")' -``` - -**toSentence** _.toSentence(array, [delimiter, lastDelimiter]) - -Join an array into a human readable sentence. - -```javascript -_.toSentence(['jQuery', 'Mootools', 'Prototype']) -=> 'jQuery, Mootools and Prototype'; - -_.toSentence(['jQuery', 'Mootools', 'Prototype'], ', ', ' unt ') -=> 'jQuery, Mootools unt Prototype'; -``` - -**repeat** _.repeat(string, count, [separator]) - -Repeats a string count times. - -```javascript -_.repeat("foo", 3) -=> 'foofoofoo'; - -_.repeat("foo", 3, "bar") -=> 'foobarfoobarfoo' -``` - -**slugify** _.slugify(string) - -Transform text into a URL slug. Replaces whitespaces, accentuated, and special characters with a dash. - -```javascript -_.slugify("Un éléphant à l'orée du bois") -=> 'un-elephant-a-loree-du-bois'; -``` - -***Caution: this function is charset dependent*** - -## Roadmap ## - -Any suggestions or bug reports are welcome. Just email me or more preferably open an issue. - -## Changelog ## - -### 2.0.0 ### - -* Added prune, humanize functions -* Added _.string (_.str) namespace for Underscore.string library -* Removed includes function - -#### Problems - -We lose two things for `include` and `reverse` methods from `_.string`: - -* Calls like `_('foobar').include('bar')` aren't available; -* Chaining isn't available too. - -But if you need this functionality you can create aliases for conflict functions which will be convenient for you: - -```javascript -_.mixin({ - includeString: _.str.include, - reverseString: _.str.reverse -}) - -// Now wrapper calls and chaining are available. -_('foobar').chain().reverseString().includeString('rab').value() -``` - -#### Standalone Usage - -If you are using Underscore.string without Underscore. You also have `_.string` namespace for it and `_.str` alias -But of course you can just reassign `_` variable with `_.string` - -```javascript -_ = _.string -``` -### 2.2.0 ### - -* Capitalize method behavior changed -* Various perfomance tweaks - -### 2.1.1### - -* Fixed words method bug -* Added classify method - -### 2.1.0 ### - -* AMD support -* Added toSentence method -* Added slugify method -* Lots of speed optimizations - -### 2.0.0 ### - -For upgrading to this version you need to mix in Underscore.string library to Underscore object: - -```javascript -_.mixin(_.string.exports()); -``` - -and all non-conflict Underscore.string functions will be available through Underscore object. -Also function `includes` has been removed, you should replace this function by `_.str.include` -or create alias `_.includes = _.str.include` and all your code will work fine. - -### 1.1.6 ### - -* Fixed reverse and truncate -* Added isBlank, stripTags, inlude(alias for includes) -* Added uglifier compression - -### 1.1.5 ### - -* Added strRight, strRightBack, strLeft, strLeftBack - -### 1.1.4 ### - -* Added pad, lpad, rpad, lrpad methods and aliases center, ljust, rjust -* Integration with Underscore 1.1.6 - -### 1.1.3 ### - -* Added methods: underscored, camelize, dasherize -* Support newer version of npm - -### 1.1.2 ### - -* Created functions: lines, chars, words functions - -### 1.0.2 ### - -* Created integration test suite with underscore.js 1.1.4 (now it's absolutely compatible) -* Removed 'reverse' function, because this function override underscore.js 'reverse' - -## Contribute ## - -* Fork & pull request. Don't forget about tests. -* If you planning add some feature please create issue before. - -Otherwise changes will be rejected. - -## Contributors list ## - -* Esa-Matti Suuronen (), -* Edward Tsech , -* Sasha Koss (), -* Vladimir Dronnikov , -* Pete Kruckenberg (), -* Paul Chavard (), -* Ed Finkler () -* Pavel Pravosud -* Anton Lindqvist () - -## Licence ## - -The MIT License - -Copyright (c) 2011 Esa-Matti Suuronen esa-matti@suuronen.org - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. diff --git a/Phaser/node_modules/grunt/node_modules/underscore.string/Rakefile b/Phaser/node_modules/grunt/node_modules/underscore.string/Rakefile deleted file mode 100644 index baa164cd..00000000 --- a/Phaser/node_modules/grunt/node_modules/underscore.string/Rakefile +++ /dev/null @@ -1,28 +0,0 @@ -# encoding: utf-8 -task default: :test - -desc 'Use UglifyJS to compress Underscore.string' -task :build do - require 'uglifier' - source = File.read('lib/underscore.string.js') - compressed = Uglifier.compile(source, copyright: false) - File.open('dist/underscore.string.min.js', 'w'){ |f| f.write compressed } - compression_rate = compressed.length.to_f/source.length - puts "compressed dist/underscore.string.min.js: #{compressed.length}/#{source.length} #{(compression_rate * 100).round}%" -end - -desc 'Run tests' -task :test do - pid = spawn('bundle exec serve', err: '/dev/null') - sleep 2 - - puts "Running underscore.string test suite." - result1 = system %{phantomjs ./test/run-qunit.js "http://localhost:4000/test/test.html"} - - puts "Running Underscore test suite." - result2 = system %{phantomjs ./test/run-qunit.js "http://localhost:4000/test/test_underscore/test.html"} - - Process.kill 'INT', pid - - exit(result1 && result2 ? 0 : 1) -end \ No newline at end of file diff --git a/Phaser/node_modules/grunt/node_modules/underscore.string/package.json b/Phaser/node_modules/grunt/node_modules/underscore.string/package.json deleted file mode 100644 index 790c8306..00000000 --- a/Phaser/node_modules/grunt/node_modules/underscore.string/package.json +++ /dev/null @@ -1,76 +0,0 @@ -{ - "name": "underscore.string", - "version": "2.2.0rc", - "description": "String manipulation extensions for Underscore.js javascript library.", - "homepage": "http://epeli.github.com/underscore.string/", - "contributors": [ - { - "name": "Esa-Matti Suuronen", - "email": "esa-matti@suuronen.org", - "url": "http://esa-matti.suuronen.org/" - }, - { - "name": "Edward Tsech", - "email": "edtsech@gmail.com" - }, - { - "name": "Sasha Koss", - "email": "kossnocorp@gmail.com", - "url": "http://koss.nocorp.me/" - }, - { - "name": "Vladimir Dronnikov", - "email": "dronnikov@gmail.com" - }, - { - "name": "Pete Kruckenberg", - "email": "https://github.com/kruckenb", - "url": "" - }, - { - "name": "Paul Chavard", - "email": "paul@chavard.net", - "url": "" - }, - { - "name": "Ed Finkler", - "email": "coj@funkatron.com", - "url": "" - }, - { - "name": "Pavel Pravosud", - "email": "rwz@duckroll.ru" - } - ], - "keywords": [ - "underscore", - "string" - ], - "main": "./lib/underscore.string", - "directories": { - "lib": "./lib" - }, - "engines": { - "node": "*" - }, - "repository": { - "type": "git", - "url": "https://github.com/epeli/underscore.string.git" - }, - "bugs": { - "url": "https://github.com/epeli/underscore.string/issues" - }, - "licenses": [ - { - "type": "MIT" - } - ], - "readme": "# Underscore.string [![Build Status](https://secure.travis-ci.org/epeli/underscore.string.png?branch=master)](http://travis-ci.org/epeli/underscore.string) #\n\n\n\nJavascript lacks complete string manipulation operations.\nThis an attempt to fill that gap. List of build-in methods can be found\nfor example from [Dive Into JavaScript][d].\n\n[d]: http://www.diveintojavascript.com/core-javascript-reference/the-string-object\n\n\nAs name states this an extension for [Underscore.js][u], but it can be used\nindependently from **_s**-global variable. But with Underscore.js you can\nuse Object-Oriented style and chaining:\n\n[u]: http://documentcloud.github.com/underscore/\n\n```javascript\n_(\" epeli \").chain().trim().capitalize().value()\n=> \"Epeli\"\n```\n\n## Download ##\n\n * [Development version](https://raw.github.com/epeli/underscore.string/master/lib/underscore.string.js) *Uncompressed with Comments 18kb*\n * [Production version](https://github.com/epeli/underscore.string/raw/master/dist/underscore.string.min.js) *Minified 7kb*\n\n\n## Node.js installation ##\n\n**npm package**\n\n npm install underscore.string\n\n**Standalone usage**:\n\n```javascript\nvar _s = require('underscore.string');\n```\n\n**Integrate with Underscore.js**:\n\n```javascript\nvar _ = require('underscore');\n\n// Import Underscore.string to separate object, because there are conflict functions (include, reverse, contains)\n_.str = require('underscore.string');\n\n// Mix in non-conflict functions to Underscore namespace if you want\n_.mixin(_.str.exports());\n\n// All functions, include conflict, will be available through _.str object\n_.str.include('Underscore.string', 'string'); // => true\n```\n\n## String Functions ##\n\nFor availability of functions in this way you need to mix in Underscore.string functions:\n\n```javascript\n_.mixin(_.string.exports());\n```\n\notherwise functions from examples will be available through _.string or _.str objects:\n\n```javascript\n_.str.capitalize('epeli')\n=> \"Epeli\"\n```\n\n**capitalize** _.capitalize(string)\n\nConverts first letter of the string to uppercase.\n\n```javascript\n_.capitalize(\"foo Bar\")\n=> \"Foo Bar\"\n```\n\n**chop** _.chop(string, step)\n\n```javascript\n_.chop('whitespace', 3)\n=> ['whi','tes','pac','e']\n```\n\n**clean** _.clean(str)\n\nCompress some whitespaces to one.\n\n```javascript\n_.clean(\" foo bar \")\n=> 'foo bar'\n```\n\n**chars** _.chars(str)\n\n```javascript\n_.chars('Hello')\n=> ['H','e','l','l','o']\n```\n\n**includes** _.includes(string, substring)\n\nTests if string contains a substring.\n\n```javascript\n_.includes(\"foobar\", \"ob\")\n=> true\n```\n\n**include** available only through _.str object, because Underscore has function with the same name.\n\n```javascript\n_.str.include(\"foobar\", \"ob\")\n=> true\n```\n\n**includes** function was removed\n\nBut you can create it in this way, for compatibility with previous versions:\n\n```javascript\n_.includes = _.str.include\n```\n\n**count** _.count(string, substring)\n\n```javascript\n_('Hello world').count('l')\n=> 3\n```\n\n**escapeHTML** _.escapeHTML(string)\n\nConverts HTML special characters to their entity equivalents.\n\n```javascript\n_('
        Blah blah blah
        ').escapeHTML();\n=> '<div>Blah blah blah</div>'\n```\n\n**unescapeHTML** _.unescapeHTML(string)\n\nConverts entity characters to HTML equivalents.\n\n```javascript\n_('<div>Blah blah blah</div>').unescapeHTML();\n=> '
        Blah blah blah
        '\n```\n\n**insert** _.insert(string, index, substing)\n\n```javascript\n_('Hello ').insert(6, 'world')\n=> 'Hello world'\n```\n\n**isBlank** _.isBlank(string)\n\n```javascript\n_('').isBlank(); // => true\n_('\\n').isBlank(); // => true\n_(' ').isBlank(); // => true\n_('a').isBlank(); // => false\n```\n\n**join** _.join(separator, *strings)\n\nJoins strings together with given separator\n\n```javascript\n_.join(\" \", \"foo\", \"bar\")\n=> \"foo bar\"\n```\n\n**lines** _.lines(str)\n\n```javascript\n_.lines(\"Hello\\nWorld\")\n=> [\"Hello\", \"World\"]\n```\n\n**reverse** available only through _.str object, because Underscore has function with the same name.\n\nReturn reversed string:\n\n```javascript\n_.str.reverse(\"foobar\")\n=> 'raboof'\n```\n\n**splice** _.splice(string, index, howmany, substring)\n\nLike a array splice.\n\n```javascript\n_('https://edtsech@bitbucket.org/edtsech/underscore.strings').splice(30, 7, 'epeli')\n=> 'https://edtsech@bitbucket.org/epeli/underscore.strings'\n```\n\n**startsWith** _.startsWith(string, starts)\n\nThis method checks whether string starts with starts.\n\n```javascript\n_(\"image.gif\").startsWith(\"image\")\n=> true\n```\n\n**endsWith** _.endsWith(string, ends)\n\nThis method checks whether string ends with ends.\n\n```javascript\n_(\"image.gif\").endsWith(\"gif\")\n=> true\n```\n\n**succ** _.succ(str)\n\nReturns the successor to str.\n\n```javascript\n_('a').succ()\n=> 'b'\n\n_('A').succ()\n=> 'B'\n```\n\n**supplant**\n\nSupplant function was removed, use Underscore.js [template function][p].\n\n[p]: http://documentcloud.github.com/underscore/#template\n\n**strip** alias for *trim*\n\n**lstrip** alias for *ltrim*\n\n**rstrip** alias for *rtrim*\n\n**titleize** _.titleize(string)\n\n```javascript\n_('my name is epeli').titleize()\n=> 'My Name Is Epeli'\n```\n\n**camelize** _.camelize(string)\n\nConverts underscored or dasherized string to a camelized one\n\n```javascript\n_('-moz-transform').camelize()\n=> 'MozTransform'\n```\n\n**classify** _.classify(string)\n\nConverts string to camelized class name\n\n```javascript\n_('some_class_name').classify()\n=> 'SomeClassName'\n```\n\n**underscored** _.underscored(string)\n\nConverts a camelized or dasherized string into an underscored one\n\n```javascript\n_('MozTransform').underscored()\n=> 'moz_transform'\n```\n\n**dasherize** _.dasherize(string)\n\nConverts a underscored or camelized string into an dasherized one\n\n```javascript\n_('MozTransform').dasherize()\n=> '-moz-transform'\n```\n\n**humanize** _.humanize(string)\n\nConverts an underscored, camelized, or dasherized string into a humanized one.\nAlso removes beginning and ending whitespace, and removes the postfix '_id'.\n\n```javascript\n_(' capitalize dash-CamelCase_underscore trim ').humanize()\n=> 'Capitalize dash camel case underscore trim'\n```\n\n**trim** _.trim(string, [characters])\n\ntrims defined characters from begining and ending of the string.\nDefaults to whitespace characters.\n\n```javascript\n_.trim(\" foobar \")\n=> \"foobar\"\n\n_.trim(\"_-foobar-_\", \"_-\")\n=> \"foobar\"\n```\n\n\n**ltrim** _.ltrim(string, [characters])\n\nLeft trim. Similar to trim, but only for left side.\n\n\n**rtrim** _.rtrim(string, [characters])\n\nRight trim. Similar to trim, but only for right side.\n\n**truncate** _.truncate(string, length, truncateString)\n\n```javascript\n_('Hello world').truncate(5)\n=> 'Hello...'\n\n_('Hello').truncate(10)\n=> 'Hello'\n```\n\n**prune** _.prune(string, length, pruneString)\n\nElegant version of truncate.\nMakes sure the pruned string does not exceed the original length.\nAvoid half-chopped words when truncating.\n\n```javascript\n_('Hello, world').prune(5)\n=> 'Hello...'\n\n_('Hello, world').prune(8)\n=> 'Hello...'\n\n_('Hello, world').prune(5, ' (read a lot more)')\n=> 'Hello, world' (as adding \"(read a lot more)\" would be longer than the original string)\n\n_('Hello, cruel world').prune(15)\n=> 'Hello, cruel...'\n\n_('Hello').prune(10)\n=> 'Hello'\n```\n\n**words** _.words(str, delimiter=\" \")\n\nSplit string by delimiter (String or RegExp), ' ' by default.\n\n```javascript\n_.words(\"I love you\")\n=> [\"I\",\"love\",\"you\"]\n\n_.words(\"I_love_you\", \"_\")\n=> [\"I\",\"love\",\"you\"]\n\n_.words(\"I-love-you\", /-/)\n=> [\"I\",\"love\",\"you\"]\n```\n\n**sprintf** _.sprintf(string format, *arguments)\n\nC like string formatting.\nCredits goes to [Alexandru Marasteanu][o].\nFor more detailed documentation, see the [original page][o].\n\n[o]: http://www.diveintojavascript.com/projects/sprintf-for-javascript\n\n```javascript\n_.sprintf(\"%.1f\", 1.17)\n\"1.2\"\n```\n\n**pad** _.pad(str, length, [padStr, type])\n\npads the `str` with characters until the total string length is equal to the passed `length` parameter. By default, pads on the **left** with the space char (`\" \"`). `padStr` is truncated to a single character if necessary.\n\n```javascript\n_.pad(\"1\", 8)\n-> \" 1\";\n\n_.pad(\"1\", 8, '0')\n-> \"00000001\";\n\n_.pad(\"1\", 8, '0', 'right')\n-> \"10000000\";\n\n_.pad(\"1\", 8, '0', 'both')\n-> \"00001000\";\n\n_.pad(\"1\", 8, 'bleepblorp', 'both')\n-> \"bbbb1bbb\";\n```\n\n**lpad** _.lpad(str, length, [padStr])\n\nleft-pad a string. Alias for `pad(str, length, padStr, 'left')`\n\n```javascript\n_.lpad(\"1\", 8, '0')\n-> \"00000001\";\n```\n\n**rpad** _.rpad(str, length, [padStr])\n\nright-pad a string. Alias for `pad(str, length, padStr, 'right')`\n\n```javascript\n_.rpad(\"1\", 8, '0')\n-> \"10000000\";\n```\n\n**lrpad** _.lrpad(str, length, [padStr])\n\nleft/right-pad a string. Alias for `pad(str, length, padStr, 'both')`\n\n```javascript\n_.lrpad(\"1\", 8, '0')\n-> \"00001000\";\n```\n\n**center** alias for **lrpad**\n\n**ljust** alias for *rpad*\n\n**rjust** alias for *lpad*\n\n**toNumber** _.toNumber(string, [decimals])\n\nParse string to number. Returns NaN if string can't be parsed to number.\n\n```javascript\n_('2.556').toNumber()\n=> 3\n\n_('2.556').toNumber(1)\n=> 2.6\n```\n\n**strRight** _.strRight(string, pattern)\n\nSearches a string from left to right for a pattern and returns a substring consisting of the characters in the string that are to the right of the pattern or all string if no match found.\n\n```javascript\n_('This_is_a_test_string').strRight('_')\n=> \"is_a_test_string\";\n```\n\n**strRightBack** _.strRightBack(string, pattern)\n\nSearches a string from right to left for a pattern and returns a substring consisting of the characters in the string that are to the right of the pattern or all string if no match found.\n\n```javascript\n_('This_is_a_test_string').strRightBack('_')\n=> \"string\";\n```\n\n**strLeft** _.strLeft(string, pattern)\n\nSearches a string from left to right for a pattern and returns a substring consisting of the characters in the string that are to the left of the pattern or all string if no match found.\n\n```javascript\n_('This_is_a_test_string').strLeft('_')\n=> \"This\";\n```\n\n**strLeftBack** _.strLeftBack(string, pattern)\n\nSearches a string from right to left for a pattern and returns a substring consisting of the characters in the string that are to the left of the pattern or all string if no match found.\n\n```javascript\n_('This_is_a_test_string').strLeftBack('_')\n=> \"This_is_a_test\";\n```\n\n**stripTags**\n\nRemoves all html tags from string.\n\n```javascript\n_('a link').stripTags()\n=> 'a link'\n\n_('a link').stripTags()\n=> 'a linkalert(\"hello world!\")'\n```\n\n**toSentence** _.toSentence(array, [delimiter, lastDelimiter])\n\nJoin an array into a human readable sentence.\n\n```javascript\n_.toSentence(['jQuery', 'Mootools', 'Prototype'])\n=> 'jQuery, Mootools and Prototype';\n\n_.toSentence(['jQuery', 'Mootools', 'Prototype'], ', ', ' unt ')\n=> 'jQuery, Mootools unt Prototype';\n```\n\n**repeat** _.repeat(string, count, [separator])\n\nRepeats a string count times.\n\n```javascript\n_.repeat(\"foo\", 3)\n=> 'foofoofoo';\n\n_.repeat(\"foo\", 3, \"bar\")\n=> 'foobarfoobarfoo'\n```\n\n**slugify** _.slugify(string)\n\nTransform text into a URL slug. Replaces whitespaces, accentuated, and special characters with a dash.\n\n```javascript\n_.slugify(\"Un éléphant à l'orée du bois\")\n=> 'un-elephant-a-loree-du-bois';\n```\n\n***Caution: this function is charset dependent***\n\n## Roadmap ##\n\nAny suggestions or bug reports are welcome. Just email me or more preferably open an issue.\n\n## Changelog ##\n\n### 2.0.0 ###\n\n* Added prune, humanize functions\n* Added _.string (_.str) namespace for Underscore.string library\n* Removed includes function\n\n#### Problems\n\nWe lose two things for `include` and `reverse` methods from `_.string`:\n\n* Calls like `_('foobar').include('bar')` aren't available;\n* Chaining isn't available too.\n\nBut if you need this functionality you can create aliases for conflict functions which will be convenient for you:\n\n```javascript\n_.mixin({\n includeString: _.str.include,\n reverseString: _.str.reverse\n})\n\n// Now wrapper calls and chaining are available.\n_('foobar').chain().reverseString().includeString('rab').value()\n```\n\n#### Standalone Usage\n\nIf you are using Underscore.string without Underscore. You also have `_.string` namespace for it and `_.str` alias\nBut of course you can just reassign `_` variable with `_.string`\n\n```javascript\n_ = _.string\n```\n### 2.2.0 ###\n\n* Capitalize method behavior changed\n* Various perfomance tweaks\n\n### 2.1.1###\n\n* Fixed words method bug\n* Added classify method\n\n### 2.1.0 ###\n\n* AMD support\n* Added toSentence method\n* Added slugify method\n* Lots of speed optimizations\n\n### 2.0.0 ###\n\nFor upgrading to this version you need to mix in Underscore.string library to Underscore object:\n\n```javascript\n_.mixin(_.string.exports());\n```\n\nand all non-conflict Underscore.string functions will be available through Underscore object.\nAlso function `includes` has been removed, you should replace this function by `_.str.include`\nor create alias `_.includes = _.str.include` and all your code will work fine.\n\n### 1.1.6 ###\n\n* Fixed reverse and truncate\n* Added isBlank, stripTags, inlude(alias for includes)\n* Added uglifier compression\n\n### 1.1.5 ###\n\n* Added strRight, strRightBack, strLeft, strLeftBack\n\n### 1.1.4 ###\n\n* Added pad, lpad, rpad, lrpad methods and aliases center, ljust, rjust\n* Integration with Underscore 1.1.6\n\n### 1.1.3 ###\n\n* Added methods: underscored, camelize, dasherize\n* Support newer version of npm\n\n### 1.1.2 ###\n\n* Created functions: lines, chars, words functions\n\n### 1.0.2 ###\n\n* Created integration test suite with underscore.js 1.1.4 (now it's absolutely compatible)\n* Removed 'reverse' function, because this function override underscore.js 'reverse'\n\n## Contribute ##\n\n* Fork & pull request. Don't forget about tests.\n* If you planning add some feature please create issue before.\n\nOtherwise changes will be rejected.\n\n## Contributors list ##\n\n* Esa-Matti Suuronen (),\n* Edward Tsech ,\n* Sasha Koss (),\n* Vladimir Dronnikov ,\n* Pete Kruckenberg (),\n* Paul Chavard (),\n* Ed Finkler ()\n* Pavel Pravosud \n* Anton Lindqvist ()\n\n## Licence ##\n\nThe MIT License\n\nCopyright (c) 2011 Esa-Matti Suuronen esa-matti@suuronen.org\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in\nall copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\nTHE SOFTWARE.\n", - "readmeFilename": "README.markdown", - "_id": "underscore.string@2.2.0rc", - "dist": { - "shasum": "d7435955bf01537dc506d3ef49f0b3f4a6388a31" - }, - "_from": "underscore.string@~2.2.0rc", - "_resolved": "https://registry.npmjs.org/underscore.string/-/underscore.string-2.2.0rc.tgz" -} diff --git a/Phaser/node_modules/grunt/node_modules/underscore.string/test/test.html b/Phaser/node_modules/grunt/node_modules/underscore.string/test/test.html deleted file mode 100644 index c959a3a3..00000000 --- a/Phaser/node_modules/grunt/node_modules/underscore.string/test/test.html +++ /dev/null @@ -1,31 +0,0 @@ - - - - - Underscore.strings Test Suite - - - - - - - - - - -

        Underscore.string Test Suite

        -

        -

        -
          -
          -

          Underscore.string Speed Suite

          - -
          - - diff --git a/Phaser/node_modules/grunt/node_modules/underscore.string/test/test_standalone.html b/Phaser/node_modules/grunt/node_modules/underscore.string/test/test_standalone.html deleted file mode 100644 index 9854c171..00000000 --- a/Phaser/node_modules/grunt/node_modules/underscore.string/test/test_standalone.html +++ /dev/null @@ -1,18 +0,0 @@ - - - - Underscore.strings Test Suite - - - - - - - - -

          Underscore.string Test Suite

          -

          -

          -
            - - diff --git a/Phaser/node_modules/grunt/node_modules/underscore.string/test/test_underscore/temp_tests.html b/Phaser/node_modules/grunt/node_modules/underscore.string/test/test_underscore/temp_tests.html deleted file mode 100644 index bd34f9dd..00000000 --- a/Phaser/node_modules/grunt/node_modules/underscore.string/test/test_underscore/temp_tests.html +++ /dev/null @@ -1,19 +0,0 @@ - - - - Underscore Temporary Tests - - - - - - - -

            Underscore Temporary Tests

            -

            - A page for temporary speed tests, used for developing faster implementations - of existing Underscore methods. -

            -
            - - diff --git a/Phaser/node_modules/grunt/node_modules/underscore.string/test/test_underscore/test.html b/Phaser/node_modules/grunt/node_modules/underscore.string/test/test_underscore/test.html deleted file mode 100644 index 77f2f3a2..00000000 --- a/Phaser/node_modules/grunt/node_modules/underscore.string/test/test_underscore/test.html +++ /dev/null @@ -1,43 +0,0 @@ - - - - Underscore Test Suite - - - - - - - - - - - - - - - -
            -

            Underscore Test Suite

            -

            -

            -
              -
              -

              Underscore Speed Suite

              -

              - A representative sample of the functions are benchmarked here, to provide - a sense of how fast they might run in different browsers. - Each iteration runs on an array of 1000 elements.

              - For example, the 'intersect' test measures the number of times you can - find the intersection of two thousand-element arrays in one second. -

              -
              - - -
              - - diff --git a/Phaser/node_modules/grunt/node_modules/underscore.string/test/test_underscore/vendor/qunit.css b/Phaser/node_modules/grunt/node_modules/underscore.string/test/test_underscore/vendor/qunit.css deleted file mode 100644 index 8d0d3a24..00000000 --- a/Phaser/node_modules/grunt/node_modules/underscore.string/test/test_underscore/vendor/qunit.css +++ /dev/null @@ -1,196 +0,0 @@ -/** Font Family and Sizes */ - -#qunit-tests, #qunit-header, .qunit-header, #qunit-banner, #qunit-testrunner-toolbar, #qunit-userAgent, #qunit-testresult { - font-family: "Helvetica Neue Light", "HelveticaNeue-Light", "Helvetica Neue", Calibri, Helvetica, Arial; -} - -#qunit-testrunner-toolbar, #qunit-userAgent, #qunit-testresult, #qunit-tests li { font-size: small; } -#qunit-tests { font-size: smaller; } - - -/** Resets */ - -#qunit-tests, #qunit-tests ol, #qunit-header, #qunit-banner, #qunit-userAgent, #qunit-testresult { - margin: 0; - padding: 0; -} - - -/** Header */ - -#qunit-header, .qunit-header { - padding: 0.5em 0 0.5em 1em; - - color: #8699a4; - background-color: #0d3349; - - font-size: 1.5em; - line-height: 1em; - font-weight: normal; - - border-radius: 15px 15px 0 0; - -moz-border-radius: 15px 15px 0 0; - -webkit-border-top-right-radius: 15px; - -webkit-border-top-left-radius: 15px; -} - -#qunit-header a { - text-decoration: none; - color: #c2ccd1; -} - -#qunit-header a:hover, -#qunit-header a:focus { - color: #fff; -} - -#qunit-banner { - height: 5px; -} - -#qunit-testrunner-toolbar { - padding: 0em 0 0.5em 2em; -} - -#qunit-userAgent { - padding: 0.5em 0 0.5em 2.5em; - background-color: #2b81af; - color: #fff; - text-shadow: rgba(0, 0, 0, 0.5) 2px 2px 1px; -} - - -/** Tests: Pass/Fail */ - -#qunit-tests { - list-style-position: inside; -} - -#qunit-tests li { - padding: 0.4em 0.5em 0.4em 2.5em; - border-bottom: 1px solid #fff; - list-style-position: inside; -} - -#qunit-tests li strong { - cursor: pointer; -} - -#qunit-tests ol { - margin-top: 0.5em; - padding: 0.5em; - - background-color: #fff; - - border-radius: 15px; - -moz-border-radius: 15px; - -webkit-border-radius: 15px; - - box-shadow: inset 0px 2px 13px #999; - -moz-box-shadow: inset 0px 2px 13px #999; - -webkit-box-shadow: inset 0px 2px 13px #999; -} - -#qunit-tests table { - border-collapse: collapse; - margin-top: .2em; -} - -#qunit-tests th { - text-align: right; - vertical-align: top; - padding: 0 .5em 0 0; -} - -#qunit-tests td { - vertical-align: top; -} - -#qunit-tests pre { - margin: 0; - white-space: pre-wrap; - word-wrap: break-word; -} - -#qunit-tests del { - background-color: #e0f2be; - color: #374e0c; - text-decoration: none; -} - -#qunit-tests ins { - background-color: #ffcaca; - color: #500; - text-decoration: none; -} - -/*** Test Counts */ - -#qunit-tests b.counts { color: black; } -#qunit-tests b.passed { color: #5E740B; } -#qunit-tests b.failed { color: #710909; } - -#qunit-tests li li { - margin: 0.5em; - padding: 0.4em 0.5em 0.4em 0.5em; - background-color: #fff; - border-bottom: none; - list-style-position: inside; -} - -/*** Passing Styles */ - -#qunit-tests li li.pass { - color: #5E740B; - background-color: #fff; - border-left: 26px solid #C6E746; -} - -#qunit-tests .pass { color: #528CE0; background-color: #D2E0E6; } -#qunit-tests .pass .test-name { color: #366097; } - -#qunit-tests .pass .test-actual, -#qunit-tests .pass .test-expected { color: #999999; } - -#qunit-banner.qunit-pass { background-color: #C6E746; } - -/*** Failing Styles */ - -#qunit-tests li li.fail { - color: #710909; - background-color: #fff; - border-left: 26px solid #EE5757; -} - -#qunit-tests .fail { color: #000000; background-color: #EE5757; } -#qunit-tests .fail .test-name, -#qunit-tests .fail .module-name { color: #000000; } - -#qunit-tests .fail .test-actual { color: #EE5757; } -#qunit-tests .fail .test-expected { color: green; } - -#qunit-banner.qunit-fail, -#qunit-testrunner-toolbar { background-color: #EE5757; } - - -/** Footer */ - -#qunit-testresult { - padding: 0.5em 0.5em 0.5em 2.5em; - - color: #2b81af; - background-color: #D2E0E6; - - border-radius: 0 0 15px 15px; - -moz-border-radius: 0 0 15px 15px; - -webkit-border-bottom-right-radius: 15px; - -webkit-border-bottom-left-radius: 15px; -} - -/** Fixture */ - -#qunit-fixture { - position: absolute; - top: -10000px; - left: -10000px; -} \ No newline at end of file diff --git a/Phaser/node_modules/grunt/node_modules/which/LICENSE b/Phaser/node_modules/grunt/node_modules/which/LICENSE deleted file mode 100644 index 05a40109..00000000 --- a/Phaser/node_modules/grunt/node_modules/which/LICENSE +++ /dev/null @@ -1,23 +0,0 @@ -Copyright 2009, 2010, 2011 Isaac Z. Schlueter. -All rights reserved. - -Permission is hereby granted, free of charge, to any person -obtaining a copy of this software and associated documentation -files (the "Software"), to deal in the Software without -restriction, including without limitation the rights to use, -copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the -Software is furnished to do so, subject to the following -conditions: - -The above copyright notice and this permission notice shall be -included in all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES -OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT -HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, -WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING -FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR -OTHER DEALINGS IN THE SOFTWARE. diff --git a/Phaser/node_modules/grunt/node_modules/which/README.md b/Phaser/node_modules/grunt/node_modules/which/README.md deleted file mode 100644 index ff1eb531..00000000 --- a/Phaser/node_modules/grunt/node_modules/which/README.md +++ /dev/null @@ -1,5 +0,0 @@ -The "which" util from npm's guts. - -Finds the first instance of a specified executable in the PATH -environment variable. Does not cache the results, so `hash -r` is not -needed when the PATH changes. diff --git a/Phaser/node_modules/grunt/node_modules/which/package.json b/Phaser/node_modules/grunt/node_modules/which/package.json deleted file mode 100644 index 4854ed2b..00000000 --- a/Phaser/node_modules/grunt/node_modules/which/package.json +++ /dev/null @@ -1,31 +0,0 @@ -{ - "author": { - "name": "Isaac Z. Schlueter", - "email": "i@izs.me", - "url": "http://blog.izs.me" - }, - "name": "which", - "description": "Like which(1) unix command. Find the first instance of an executable in the PATH.", - "version": "1.0.5", - "repository": { - "type": "git", - "url": "git://github.com/isaacs/node-which.git" - }, - "main": "which.js", - "bin": { - "which": "./bin/which" - }, - "engines": { - "node": "*" - }, - "dependencies": {}, - "devDependencies": {}, - "readme": "The \"which\" util from npm's guts.\n\nFinds the first instance of a specified executable in the PATH\nenvironment variable. Does not cache the results, so `hash -r` is not\nneeded when the PATH changes.\n", - "readmeFilename": "README.md", - "_id": "which@1.0.5", - "dist": { - "shasum": "195619a6ad7e8fefd0aa76445a6d4c8d370a322c" - }, - "_from": "which@~1.0.5", - "_resolved": "https://registry.npmjs.org/which/-/which-1.0.5.tgz" -} diff --git a/Phaser/node_modules/grunt/package.json b/Phaser/node_modules/grunt/package.json deleted file mode 100644 index e59635f1..00000000 --- a/Phaser/node_modules/grunt/package.json +++ /dev/null @@ -1,100 +0,0 @@ -{ - "name": "grunt", - "description": "The JavaScript Task Runner", - "version": "0.4.1", - "author": { - "name": "\"Cowboy\" Ben Alman", - "url": "http://benalman.com/" - }, - "homepage": "http://gruntjs.com/", - "repository": { - "type": "git", - "url": "git://github.com/gruntjs/grunt.git" - }, - "bugs": { - "url": "http://github.com/gruntjs/grunt/issues" - }, - "licenses": [ - { - "type": "MIT", - "url": "http://github.com/gruntjs/grunt/blob/master/LICENSE-MIT" - } - ], - "main": "lib/grunt", - "scripts": { - "test": "grunt test" - }, - "engines": { - "node": ">= 0.8.0" - }, - "keywords": [ - "task", - "async", - "cli", - "minify", - "uglify", - "build", - "lodash", - "unit", - "test", - "qunit", - "nodeunit", - "server", - "init", - "scaffold", - "make", - "jake", - "tool" - ], - "dependencies": { - "async": "~0.1.22", - "coffee-script": "~1.3.3", - "colors": "~0.6.0-1", - "dateformat": "1.0.2-1.2.3", - "eventemitter2": "~0.4.9", - "findup-sync": "~0.1.0", - "glob": "~3.1.21", - "hooker": "~0.2.3", - "iconv-lite": "~0.2.5", - "minimatch": "~0.2.6", - "nopt": "~1.0.10", - "rimraf": "~2.0.2", - "lodash": "~0.9.0", - "underscore.string": "~2.2.0rc", - "which": "~1.0.5", - "js-yaml": "~2.0.2" - }, - "devDependencies": { - "temporary": "~0.0.4", - "grunt-contrib-jshint": "~0.1.1", - "grunt-contrib-nodeunit": "~0.1.2", - "grunt-contrib-watch": "~0.2.0", - "difflet": "~0.2.3" - }, - "contributors": [ - { - "name": "\"Cowboy\" Ben Alman", - "url": "http://benalman.com/" - }, - { - "name": "Kyle Robinson Young", - "url": "http://dontkry.com/" - }, - { - "name": "Tyler Kellen", - "url": "http://goingslowly.com" - }, - { - "name": "Sindre Sorhus", - "url": "http://sindresorhus.com" - } - ], - "readme": "# Grunt: The JavaScript Task Runner [![Build Status](https://secure.travis-ci.org/gruntjs/grunt.png?branch=master)](http://travis-ci.org/gruntjs/grunt)\n\n### Documentation\n\nVisit the [gruntjs.com](http://gruntjs.com/) website for all the things.\n\n### Support / Contributing\nBefore you make an issue, please read our [Contributing](http://gruntjs.com/contributing) guide.\n\nYou can find the grunt team in [#grunt on irc.freenode.net](irc://irc.freenode.net/#grunt).\n\n### Release History\nSee the [CHANGELOG](CHANGELOG).\n", - "readmeFilename": "README.md", - "_id": "grunt@0.4.1", - "dist": { - "shasum": "e8de3620333cbd39d1156a1d21d11d6c03b2f500" - }, - "_from": "grunt@", - "_resolved": "https://registry.npmjs.org/grunt/-/grunt-0.4.1.tgz" -} diff --git a/Phaser/node_modules/grunt/test/fixtures/BOM.txt b/Phaser/node_modules/grunt/test/fixtures/BOM.txt deleted file mode 100644 index e1fde783..00000000 --- a/Phaser/node_modules/grunt/test/fixtures/BOM.txt +++ /dev/null @@ -1 +0,0 @@ -foo \ No newline at end of file diff --git a/Phaser/node_modules/grunt/test/fixtures/exec.cmd b/Phaser/node_modules/grunt/test/fixtures/exec.cmd deleted file mode 100755 index 6e4a52bb..00000000 --- a/Phaser/node_modules/grunt/test/fixtures/exec.cmd +++ /dev/null @@ -1 +0,0 @@ -@echo done diff --git a/Phaser/node_modules/grunt/test/fixtures/exec.sh b/Phaser/node_modules/grunt/test/fixtures/exec.sh deleted file mode 100755 index 88907997..00000000 --- a/Phaser/node_modules/grunt/test/fixtures/exec.sh +++ /dev/null @@ -1,2 +0,0 @@ -#!/bin/bash -echo "done" diff --git a/Phaser/node_modules/grunt/test/fixtures/expand-mapping-ext/dir.ectory/file-no-extension b/Phaser/node_modules/grunt/test/fixtures/expand-mapping-ext/dir.ectory/file-no-extension deleted file mode 100644 index e69de29b..00000000 diff --git a/Phaser/node_modules/grunt/test/fixtures/expand-mapping-ext/dir.ectory/sub.dir.ectory/file.ext.ension b/Phaser/node_modules/grunt/test/fixtures/expand-mapping-ext/dir.ectory/sub.dir.ectory/file.ext.ension deleted file mode 100644 index e69de29b..00000000 diff --git a/Phaser/node_modules/grunt/test/fixtures/expand-mapping-ext/file.ext.ension b/Phaser/node_modules/grunt/test/fixtures/expand-mapping-ext/file.ext.ension deleted file mode 100644 index e69de29b..00000000 diff --git a/Phaser/node_modules/grunt/test/fixtures/expand/README.md b/Phaser/node_modules/grunt/test/fixtures/expand/README.md deleted file mode 100644 index e69de29b..00000000 diff --git a/Phaser/node_modules/grunt/test/fixtures/expand/css/baz.css b/Phaser/node_modules/grunt/test/fixtures/expand/css/baz.css deleted file mode 100644 index e69de29b..00000000 diff --git a/Phaser/node_modules/grunt/test/fixtures/expand/css/qux.css b/Phaser/node_modules/grunt/test/fixtures/expand/css/qux.css deleted file mode 100644 index e69de29b..00000000 diff --git a/Phaser/node_modules/grunt/test/fixtures/expand/deep/deep.txt b/Phaser/node_modules/grunt/test/fixtures/expand/deep/deep.txt deleted file mode 100644 index e69de29b..00000000 diff --git a/Phaser/node_modules/grunt/test/fixtures/expand/deep/deeper/deeper.txt b/Phaser/node_modules/grunt/test/fixtures/expand/deep/deeper/deeper.txt deleted file mode 100644 index e69de29b..00000000 diff --git a/Phaser/node_modules/grunt/test/fixtures/expand/deep/deeper/deepest/deepest.txt b/Phaser/node_modules/grunt/test/fixtures/expand/deep/deeper/deepest/deepest.txt deleted file mode 100644 index e69de29b..00000000 diff --git a/Phaser/node_modules/grunt/test/fixtures/iso-8859-1.json b/Phaser/node_modules/grunt/test/fixtures/iso-8859-1.json deleted file mode 100644 index 31e1dc34..00000000 --- a/Phaser/node_modules/grunt/test/fixtures/iso-8859-1.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "foo": "Ação é isso aí", - "bar": ["ømg", "pønies"] -} diff --git a/Phaser/node_modules/grunt/test/fixtures/iso-8859-1.txt b/Phaser/node_modules/grunt/test/fixtures/iso-8859-1.txt deleted file mode 100644 index c4a16844..00000000 --- a/Phaser/node_modules/grunt/test/fixtures/iso-8859-1.txt +++ /dev/null @@ -1 +0,0 @@ -Ação é isso aí diff --git a/Phaser/node_modules/grunt/test/fixtures/iso-8859-1.yaml b/Phaser/node_modules/grunt/test/fixtures/iso-8859-1.yaml deleted file mode 100644 index b869cc12..00000000 --- a/Phaser/node_modules/grunt/test/fixtures/iso-8859-1.yaml +++ /dev/null @@ -1,4 +0,0 @@ -foo: Ação é isso aí -bar: - - ømg - - pønies diff --git a/Phaser/node_modules/grunt/test/fixtures/lint.txt b/Phaser/node_modules/grunt/test/fixtures/lint.txt deleted file mode 100644 index 62b11566..00000000 Binary files a/Phaser/node_modules/grunt/test/fixtures/lint.txt and /dev/null differ diff --git a/Phaser/node_modules/grunt/test/fixtures/no_BOM.txt b/Phaser/node_modules/grunt/test/fixtures/no_BOM.txt deleted file mode 100644 index 19102815..00000000 --- a/Phaser/node_modules/grunt/test/fixtures/no_BOM.txt +++ /dev/null @@ -1 +0,0 @@ -foo \ No newline at end of file diff --git a/Phaser/node_modules/grunt/test/fixtures/octocat.png b/Phaser/node_modules/grunt/test/fixtures/octocat.png deleted file mode 100644 index 0b68cf0d..00000000 Binary files a/Phaser/node_modules/grunt/test/fixtures/octocat.png and /dev/null differ diff --git a/Phaser/node_modules/grunt/test/fixtures/template.txt b/Phaser/node_modules/grunt/test/fixtures/template.txt deleted file mode 100644 index 99342d67..00000000 --- a/Phaser/node_modules/grunt/test/fixtures/template.txt +++ /dev/null @@ -1 +0,0 @@ -Version: <%= grunt.version %>, today: <%= grunt.template.today("yyyy-mm-dd") %>. \ No newline at end of file diff --git a/Phaser/node_modules/grunt/test/fixtures/test.json b/Phaser/node_modules/grunt/test/fixtures/test.json deleted file mode 100644 index 098e7b84..00000000 --- a/Phaser/node_modules/grunt/test/fixtures/test.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "foo": "bar", - "baz": [1, 2, 3] -} diff --git a/Phaser/node_modules/grunt/test/fixtures/utf8.json b/Phaser/node_modules/grunt/test/fixtures/utf8.json deleted file mode 100644 index d10e9753..00000000 --- a/Phaser/node_modules/grunt/test/fixtures/utf8.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "foo": "Ação é isso aí", - "bar": ["ømg", "pønies"] -} diff --git a/Phaser/node_modules/grunt/test/fixtures/utf8.txt b/Phaser/node_modules/grunt/test/fixtures/utf8.txt deleted file mode 100644 index eadbdb40..00000000 --- a/Phaser/node_modules/grunt/test/fixtures/utf8.txt +++ /dev/null @@ -1 +0,0 @@ -Ação é isso aí diff --git a/Phaser/node_modules/grunt/test/fixtures/utf8.yaml b/Phaser/node_modules/grunt/test/fixtures/utf8.yaml deleted file mode 100644 index 7eb7321c..00000000 --- a/Phaser/node_modules/grunt/test/fixtures/utf8.yaml +++ /dev/null @@ -1,4 +0,0 @@ -foo: Ação é isso aí -bar: - - ømg - - pønies diff --git a/Phaser/phaser.js b/Phaser/phaser.js index 5aaf98fd..d2fe1029 100644 --- a/Phaser/phaser.js +++ b/Phaser/phaser.js @@ -7,7 +7,7 @@ * * Richard Davey (@photonstorm) * -* Many thanks to Adam Saltsman (@ADAMATOMIC) for the original Flixel AS3 code on which Phaser is based. +* Many thanks to Adam Saltsman (@ADAMATOMIC) for releasing Flixel on which Phaser took a lot of inspiration. * * "If you want your children to be intelligent, read them fairy tales." * "If you want them to be more intelligent, read them more fairy tales." diff --git a/Phaser/system/Camera.d.ts b/Phaser/system/Camera.d.ts new file mode 100644 index 00000000..63e7f02b --- /dev/null +++ b/Phaser/system/Camera.d.ts @@ -0,0 +1,80 @@ +/// +/// +module Phaser { + class Camera { + constructor(game: Game, id: number, x: number, y: number, width: number, height: number); + private _game; + private _clip; + private _stageX; + private _stageY; + private _rotation; + private _target; + private _sx; + private _sy; + private _fxFlashColor; + private _fxFlashComplete; + private _fxFlashDuration; + private _fxFlashAlpha; + private _fxFadeColor; + private _fxFadeComplete; + private _fxFadeDuration; + private _fxFadeAlpha; + private _fxShakeIntensity; + private _fxShakeDuration; + private _fxShakeComplete; + private _fxShakeOffset; + private _fxShakeDirection; + private _fxShakePrevX; + private _fxShakePrevY; + static STYLE_LOCKON: number; + static STYLE_PLATFORMER: number; + static STYLE_TOPDOWN: number; + static STYLE_TOPDOWN_TIGHT: number; + static SHAKE_BOTH_AXES: number; + static SHAKE_HORIZONTAL_ONLY: number; + static SHAKE_VERTICAL_ONLY: number; + public ID: number; + public worldView: Rectangle; + public totalSpritesRendered: number; + public scale: MicroPoint; + public scroll: MicroPoint; + public bounds: Rectangle; + public deadzone: Rectangle; + public showBorder: bool; + public borderColor: string; + public opaque: bool; + private _bgColor; + private _bgTexture; + private _bgTextureRepeat; + public showShadow: bool; + public shadowColor: string; + public shadowBlur: number; + public shadowOffset: MicroPoint; + public visible: bool; + public alpha: number; + public inputX: number; + public inputY: number; + public fx: FXManager; + public flash(color?: number, duration?: number, onComplete?, force?: bool): void; + public fade(color?: number, duration?: number, onComplete?, force?: bool): void; + public shake(intensity?: number, duration?: number, onComplete?, force?: bool, direction?: number): void; + public stopFX(): void; + public follow(target: Sprite, style?: number): void; + public focusOnXY(x: number, y: number): void; + public focusOn(point): void; + public setBounds(x?: number, y?: number, width?: number, height?: number): void; + public update(): void; + public render(): void; + public backgroundColor : string; + public setTexture(key: string, repeat?: string): void; + public setPosition(x: number, y: number): void; + public setSize(width: number, height: number): void; + public renderDebugInfo(x: number, y: number, color?: string): void; + public x : number; + public y : number; + public width : number; + public height : number; + public rotation : number; + private checkClip(); + } +} diff --git a/Phaser/system/Camera.ts b/Phaser/system/Camera.ts index fc6d3d08..11014c92 100644 --- a/Phaser/system/Camera.ts +++ b/Phaser/system/Camera.ts @@ -29,6 +29,7 @@ module Phaser { this.ID = id; this._stageX = x; this._stageY = y; + this.fx = new FXManager(this._game, this); // The view into the world canvas we wish to render this.worldView = new Rectangle(0, 0, width, height); @@ -47,33 +48,11 @@ module Phaser { private _sx: number = 0; private _sy: number = 0; - private _fxFlashColor: string; - private _fxFlashComplete = null; - private _fxFlashDuration: number = 0; - private _fxFlashAlpha: number = 0; - - private _fxFadeColor: string; - private _fxFadeComplete = null; - private _fxFadeDuration: number = 0; - private _fxFadeAlpha: number = 0; - - private _fxShakeIntensity: number = 0; - private _fxShakeDuration: number = 0; - private _fxShakeComplete = null; - private _fxShakeOffset: MicroPoint = new MicroPoint(0, 0); - private _fxShakeDirection: number = 0; - private _fxShakePrevX: number = 0; - private _fxShakePrevY: number = 0; - public static STYLE_LOCKON: number = 0; public static STYLE_PLATFORMER: number = 1; public static STYLE_TOPDOWN: number = 2; public static STYLE_TOPDOWN_TIGHT: number = 3; - public static SHAKE_BOTH_AXES: number = 0; - public static SHAKE_HORIZONTAL_ONLY: number = 1; - public static SHAKE_VERTICAL_ONLY: number = 2; - public ID: number; public worldView: Rectangle; public totalSpritesRendered: number; @@ -105,118 +84,7 @@ module Phaser { public inputX: number = 0; public inputY: number = 0; - /** - * The camera is filled with this color and returns to normal at the given duration. - * - * @param Color The color you want to use in 0xRRGGBB format, i.e. 0xffffff for white. - * @param Duration How long it takes for the flash to fade. - * @param OnComplete An optional function you want to run when the flash finishes. Set to null for no callback. - * @param Force Force an already running flash effect to reset. - */ - public flash(color: number = 0xffffff, duration: number = 1, onComplete = null, force: bool = false) { - - if (force === false && this._fxFlashAlpha > 0) - { - // You can't flash again unless you force it - return; - } - - if (duration <= 0) - { - duration = 1; - } - - var red = color >> 16 & 0xFF; - var green = color >> 8 & 0xFF; - var blue = color & 0xFF; - - this._fxFlashColor = 'rgba(' + red + ',' + green + ',' + blue + ','; - this._fxFlashDuration = duration; - this._fxFlashAlpha = 1; - this._fxFlashComplete = onComplete; - - } - - /** - * The camera is gradually filled with this color. - * - * @param Color The color you want to use in 0xRRGGBB format, i.e. 0xffffff for white. - * @param Duration How long it takes for the flash to fade. - * @param OnComplete An optional function you want to run when the flash finishes. Set to null for no callback. - * @param Force Force an already running flash effect to reset. - */ - public fade(color: number = 0x000000, duration: number = 1, onComplete = null, force: bool = false) { - - if (force === false && this._fxFadeAlpha > 0) - { - // You can't fade again unless you force it - return; - } - - if (duration <= 0) - { - duration = 1; - } - - var red = color >> 16 & 0xFF; - var green = color >> 8 & 0xFF; - var blue = color & 0xFF; - - this._fxFadeColor = 'rgba(' + red + ',' + green + ',' + blue + ','; - this._fxFadeDuration = duration; - this._fxFadeAlpha = 0.01; - this._fxFadeComplete = onComplete; - - } - - /** - * A simple screen-shake effect. - * - * @param Intensity Percentage of screen size representing the maximum distance that the screen can move while shaking. - * @param Duration The length in seconds that the shaking effect should last. - * @param OnComplete A function you want to run when the shake effect finishes. - * @param Force Force the effect to reset (default = true, unlike flash() and fade()!). - * @param Direction Whether to shake on both axes, just up and down, or just side to side (use class constants SHAKE_BOTH_AXES, SHAKE_VERTICAL_ONLY, or SHAKE_HORIZONTAL_ONLY). - */ - public shake(intensity: number = 0.05, duration: number = 0.5, onComplete = null, force: bool = true, direction: number = Camera.SHAKE_BOTH_AXES) { - - if (!force && ((this._fxShakeOffset.x != 0) || (this._fxShakeOffset.y != 0))) - { - return; - } - - // If a shake is not already running we need to store the offsets here - if (this._fxShakeOffset.x == 0 && this._fxShakeOffset.y == 0) - { - this._fxShakePrevX = this._stageX; - this._fxShakePrevY = this._stageY; - } - - this._fxShakeIntensity = intensity; - this._fxShakeDuration = duration; - this._fxShakeComplete = onComplete; - this._fxShakeDirection = direction; - this._fxShakeOffset.setTo(0, 0); - - } - - /** - * Just turns off all the camera effects instantly. - */ - public stopFX() { - - this._fxFlashAlpha = 0; - this._fxFadeAlpha = 0; - - if (this._fxShakeDuration !== 0) - { - this._fxShakeDuration = 0; - this._fxShakeOffset.setTo(0, 0); - this._stageX = this._fxShakePrevX; - this._stageY = this._fxShakePrevY; - } - - } + public fx: FXManager; public follow(target: Sprite, style?: number = Camera.STYLE_LOCKON) { @@ -291,6 +159,8 @@ module Phaser { public update() { + this.fx.preUpdate(); + if (this._target !== null) { if (this.deadzone == null) @@ -361,80 +231,11 @@ module Phaser { this.worldView.x = this.scroll.x; this.worldView.y = this.scroll.y; - //console.log(this.worldView.width, this.worldView.height); - // Input values this.inputX = this.worldView.x + this._game.input.x; this.inputY = this.worldView.y + this._game.input.y; - // Update the Flash effect - if (this._fxFlashAlpha > 0) - { - this._fxFlashAlpha -= this._game.time.elapsed / this._fxFlashDuration; - this._fxFlashAlpha = this._game.math.roundTo(this._fxFlashAlpha, -2); - - if (this._fxFlashAlpha <= 0) - { - this._fxFlashAlpha = 0; - - if (this._fxFlashComplete !== null) - { - this._fxFlashComplete(); - } - } - } - - // Update the Fade effect - if (this._fxFadeAlpha > 0) - { - this._fxFadeAlpha += this._game.time.elapsed / this._fxFadeDuration; - this._fxFadeAlpha = this._game.math.roundTo(this._fxFadeAlpha, -2); - - if (this._fxFadeAlpha >= 1) - { - this._fxFadeAlpha = 1; - - if (this._fxFadeComplete !== null) - { - this._fxFadeComplete(); - } - } - } - - // Update the "shake" special effect - if (this._fxShakeDuration > 0) - { - this._fxShakeDuration -= this._game.time.elapsed; - this._fxShakeDuration = this._game.math.roundTo(this._fxShakeDuration, -2); - - if (this._fxShakeDuration <= 0) - { - this._fxShakeDuration = 0; - this._fxShakeOffset.setTo(0, 0); - this._stageX = this._fxShakePrevX; - this._stageY = this._fxShakePrevY; - - if (this._fxShakeComplete != null) - { - this._fxShakeComplete(); - } - } - else - { - if ((this._fxShakeDirection == Camera.SHAKE_BOTH_AXES) || (this._fxShakeDirection == Camera.SHAKE_HORIZONTAL_ONLY)) - { - //this._fxShakeOffset.x = ((this._game.math.random() * this._fxShakeIntensity * this.worldView.width * 2 - this._fxShakeIntensity * this.worldView.width) * this._zoom; - this._fxShakeOffset.x = (this._game.math.random() * this._fxShakeIntensity * this.worldView.width * 2 - this._fxShakeIntensity * this.worldView.width); - } - - if ((this._fxShakeDirection == Camera.SHAKE_BOTH_AXES) || (this._fxShakeDirection == Camera.SHAKE_VERTICAL_ONLY)) - { - //this._fxShakeOffset.y = (this._game.math.random() * this._fxShakeIntensity * this.worldView.height * 2 - this._fxShakeIntensity * this.worldView.height) * this._zoom; - this._fxShakeOffset.y = (this._game.math.random() * this._fxShakeIntensity * this.worldView.height * 2 - this._fxShakeIntensity * this.worldView.height); - } - } - - } + this.fx.postUpdate(); } @@ -445,23 +246,16 @@ module Phaser { return; } - if ((this._fxShakeOffset.x != 0) || (this._fxShakeOffset.y != 0)) - { - //this._stageX = this._fxShakePrevX + (this.worldView.halfWidth * this._zoom) + this._fxShakeOffset.x; - //this._stageY = this._fxShakePrevY + (this.worldView.halfHeight * this._zoom) + this._fxShakeOffset.y; - this._stageX = this._fxShakePrevX + (this.worldView.halfWidth) + this._fxShakeOffset.x; - this._stageY = this._fxShakePrevY + (this.worldView.halfHeight) + this._fxShakeOffset.y; - //console.log('shake', this._fxShakeDuration, this._fxShakeIntensity, this._fxShakeOffset.x, this._fxShakeOffset.y); - } - //if (this._rotation !== 0 || this._clip || this.scale.x !== 1 || this.scale.y !== 1) //{ //this._game.stage.context.save(); //} - // It may be safe/quicker to just save the context every frame regardless + // It may be safer/quicker to just save the context every frame regardless (needs testing on mobile) this._game.stage.context.save(); + this.fx.preRender(this, this._stageX, this._stageY, this.worldView.width, this.worldView.height); + if (this.alpha !== 1) { this._game.stage.context.globalAlpha = this.alpha; @@ -520,6 +314,8 @@ module Phaser { this._game.stage.context.shadowOffsetY = 0; } + this.fx.render(this, this._stageX, this._stageY, this.worldView.width, this.worldView.height); + // Clip the camera so we don't get sprites appearing outside the edges if (this._clip) { @@ -539,32 +335,19 @@ module Phaser { this._game.stage.context.stroke(); } - // "Flash" FX - if (this._fxFlashAlpha > 0) - { - this._game.stage.context.fillStyle = this._fxFlashColor + this._fxFlashAlpha + ')'; - this._game.stage.context.fillRect(this._sx, this._sy, this.worldView.width, this.worldView.height); - } - - // "Fade" FX - if (this._fxFadeAlpha > 0) - { - this._game.stage.context.fillStyle = this._fxFadeColor + this._fxFadeAlpha + ')'; - this._game.stage.context.fillRect(this._sx, this._sy, this.worldView.width, this.worldView.height); - } - // Scale off if (this.scale.x !== 1 || this.scale.y !== 1) { this._game.stage.context.scale(1, 1); } + this.fx.postRender(this, this._sx, this._sy, this.worldView.width, this.worldView.height); + if (this._rotation !== 0 || this._clip) { this._game.stage.context.translate(0, 0); } - // maybe just do this every frame regardless? this._game.stage.context.restore(); if (this.alpha !== 1) @@ -606,8 +389,6 @@ module Phaser { this.worldView.height = height; this.checkClip(); - //console.log('Camera setSize', width, height); - } public renderDebugInfo(x: number, y: number, color?: string = 'rgb(255,255,255)') { diff --git a/Phaser/system/Device.d.ts b/Phaser/system/Device.d.ts new file mode 100644 index 00000000..793bd2ea --- /dev/null +++ b/Phaser/system/Device.d.ts @@ -0,0 +1,49 @@ +/// +module Phaser { + class Device { + constructor(); + public desktop: bool; + public iOS: bool; + public android: bool; + public chromeOS: bool; + public linux: bool; + public macOS: bool; + public windows: bool; + public canvas: bool; + public file: bool; + public fileSystem: bool; + public localStorage: bool; + public webGL: bool; + public worker: bool; + public touch: bool; + public css3D: bool; + public arora: bool; + public chrome: bool; + public epiphany: bool; + public firefox: bool; + public ie: bool; + public ieVersion: number; + public mobileSafari: bool; + public midori: bool; + public opera: bool; + public safari: bool; + public webApp: bool; + public audioData: bool; + public webaudio: bool; + public ogg: bool; + public mp3: bool; + public wav: bool; + public m4a: bool; + public iPhone: bool; + public iPhone4: bool; + public iPad: bool; + public pixelRatio: number; + private _checkOS(); + private _checkFeatures(); + private _checkBrowser(); + private _checkAudio(); + private _checkDevice(); + private _checkCSS3D(); + public getAll(): string; + } +} diff --git a/Phaser/system/LinkedList.d.ts b/Phaser/system/LinkedList.d.ts new file mode 100644 index 00000000..e5602ec3 --- /dev/null +++ b/Phaser/system/LinkedList.d.ts @@ -0,0 +1,9 @@ +/// +module Phaser { + class LinkedList { + constructor(); + public object: Basic; + public next: LinkedList; + public destroy(): void; + } +} diff --git a/Phaser/system/QuadTree.d.ts b/Phaser/system/QuadTree.d.ts new file mode 100644 index 00000000..48867e3b --- /dev/null +++ b/Phaser/system/QuadTree.d.ts @@ -0,0 +1,53 @@ +/// +/// +module Phaser { + class QuadTree extends Rectangle { + constructor(X: number, Y: number, Width: number, Height: number, Parent?: QuadTree); + static A_LIST: number; + static B_LIST: number; + static divisions: number; + private _canSubdivide; + private _headA; + private _tailA; + private _headB; + private _tailB; + private static _min; + private _northWestTree; + private _northEastTree; + private _southEastTree; + private _southWestTree; + private _leftEdge; + private _rightEdge; + private _topEdge; + private _bottomEdge; + private _halfWidth; + private _halfHeight; + private _midpointX; + private _midpointY; + private static _object; + private static _objectLeftEdge; + private static _objectTopEdge; + private static _objectRightEdge; + private static _objectBottomEdge; + private static _list; + private static _useBothLists; + private static _processingCallback; + private static _notifyCallback; + private static _iterator; + private static _objectHullX; + private static _objectHullY; + private static _objectHullWidth; + private static _objectHullHeight; + private static _checkObjectHullX; + private static _checkObjectHullY; + private static _checkObjectHullWidth; + private static _checkObjectHullHeight; + public destroy(): void; + public load(ObjectOrGroup1: Basic, ObjectOrGroup2?: Basic, NotifyCallback?, ProcessCallback?): void; + public add(ObjectOrGroup: Basic, List: number): void; + private addObject(); + private addToList(); + public execute(): bool; + private overlapNode(); + } +} diff --git a/Phaser/system/RandomDataGenerator.d.ts b/Phaser/system/RandomDataGenerator.d.ts new file mode 100644 index 00000000..4c61ff20 --- /dev/null +++ b/Phaser/system/RandomDataGenerator.d.ts @@ -0,0 +1,26 @@ +/// +module Phaser { + class RandomDataGenerator { + constructor(seeds?: string[]); + private s0; + private s1; + private s2; + private c; + private uint32(); + private fract32(); + private rnd(); + private hash(data); + public sow(seeds?: string[]): void; + public integer : number; + public frac : number; + public real : number; + public integerInRange(min: number, max: number): number; + public realInRange(min: number, max: number): number; + public normal : number; + public uuid : string; + public pick(array); + public weightedPick(array); + public timestamp(min?: number, max?: number): number; + public angle : number; + } +} diff --git a/Phaser/system/RequestAnimationFrame.d.ts b/Phaser/system/RequestAnimationFrame.d.ts new file mode 100644 index 00000000..c1e1a503 --- /dev/null +++ b/Phaser/system/RequestAnimationFrame.d.ts @@ -0,0 +1,20 @@ +/// +module Phaser { + class RequestAnimationFrame { + constructor(callback, callbackContext); + private _callback; + private _callbackContext; + public setCallback(callback): void; + private _timeOutID; + private _isSetTimeOut; + public isUsingSetTimeOut(): bool; + public isUsingRAF(): bool; + public lastTime: number; + public currentTime: number; + public isRunning: bool; + public start(callback?): void; + public stop(): void; + public RAFUpdate(): void; + public SetTimeoutUpdate(): void; + } +} diff --git a/Phaser/system/Sound.d.ts b/Phaser/system/Sound.d.ts new file mode 100644 index 00000000..e17ee97f --- /dev/null +++ b/Phaser/system/Sound.d.ts @@ -0,0 +1,23 @@ +/// +/// +module Phaser { + class Sound { + constructor(context, gainNode, data, volume?: number, loop?: bool); + private _context; + private _gainNode; + private _localGainNode; + private _buffer; + private _volume; + private _sound; + public loop: bool; + public duration: number; + public isPlaying: bool; + public isDecoding: bool; + public setDecodedBuffer(data): void; + public play(): void; + public stop(): void; + public mute(): void; + public unmute(): void; + public volume : number; + } +} diff --git a/Phaser/system/StageScaleMode.d.ts b/Phaser/system/StageScaleMode.d.ts new file mode 100644 index 00000000..bb8dc966 --- /dev/null +++ b/Phaser/system/StageScaleMode.d.ts @@ -0,0 +1,21 @@ +/// +module Phaser { + class StageScaleMode { + constructor(game: Game); + private _game; + private _startHeight; + private _iterations; + private _check; + static EXACT_FIT: number; + static NO_SCALE: number; + static SHOW_ALL: number; + public width: number; + public height: number; + public orientation; + public update(): void; + public isLandscape : bool; + private checkOrientation(event); + private refresh(); + private setScreenSize(); + } +} diff --git a/Phaser/system/Tile.d.ts b/Phaser/system/Tile.d.ts new file mode 100644 index 00000000..fdd124c6 --- /dev/null +++ b/Phaser/system/Tile.d.ts @@ -0,0 +1,22 @@ +/// +module Phaser { + class Tile { + constructor(game: Game, tilemap: Tilemap, index: number, width: number, height: number); + private _game; + public name: string; + public mass: number; + public width: number; + public height: number; + public allowCollisions: number; + public collideLeft: bool; + public collideRight: bool; + public collideUp: bool; + public collideDown: bool; + public tilemap: Tilemap; + public index: number; + public destroy(): void; + public setCollision(collision: number, resetCollisions: bool): void; + public resetCollision(): void; + public toString(): string; + } +} diff --git a/Phaser/system/TilemapLayer.d.ts b/Phaser/system/TilemapLayer.d.ts new file mode 100644 index 00000000..b9bda845 --- /dev/null +++ b/Phaser/system/TilemapLayer.d.ts @@ -0,0 +1,51 @@ +/// +module Phaser { + class TilemapLayer { + constructor(game: Game, parent: Tilemap, key: string, mapFormat: number, name: string, tileWidth: number, tileHeight: number); + private _game; + private _parent; + private _texture; + private _tileOffsets; + private _startX; + private _startY; + private _maxX; + private _maxY; + private _tx; + private _ty; + private _dx; + private _dy; + private _oldCameraX; + private _oldCameraY; + private _columnData; + private _tempTileX; + private _tempTileY; + private _tempTileW; + private _tempTileH; + public name: string; + public alpha: number; + public exists: bool; + public visible: bool; + public orientation: string; + public properties: {}; + public mapData; + public mapFormat: number; + public boundsInTiles: Rectangle; + public tileWidth: number; + public tileHeight: number; + public widthInTiles: number; + public heightInTiles: number; + public widthInPixels: number; + public heightInPixels: number; + public tileMargin: number; + public tileSpacing: number; + public getTileFromWorldXY(x: number, y: number): number; + public getTileOverlaps(object: GameObject): bool; + public getTileBlock(x: number, y: number, width: number, height: number): any[]; + public getTileIndex(x: number, y: number): number; + public addColumn(column): void; + public updateBounds(): void; + public parseTileOffsets(): number; + public renderDebugInfo(x: number, y: number, color?: string): void; + public render(camera: Camera, dx, dy): bool; + } +} diff --git a/Phaser/system/Tween.d.ts b/Phaser/system/Tween.d.ts new file mode 100644 index 00000000..2f032aa4 --- /dev/null +++ b/Phaser/system/Tween.d.ts @@ -0,0 +1,42 @@ +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +module Phaser { + class Tween { + constructor(object, game: Game); + private _game; + private _manager; + private _object; + private _pausedTime; + private _valuesStart; + private _valuesEnd; + private _duration; + private _delayTime; + private _startTime; + private _easingFunction; + private _interpolationFunction; + private _chainedTweens; + public onStart: Signal; + public onUpdate: Signal; + public onComplete: Signal; + public to(properties, duration?: number, ease?: any, autoStart?: bool): Tween; + public start(): Tween; + public stop(): Tween; + public parent : Game; + public delay : number; + public easing : any; + public interpolation : any; + public chain(tween: Tween): Tween; + public debugValue; + public update(time): bool; + } +} diff --git a/Phaser/system/animation/Animation.d.ts b/Phaser/system/animation/Animation.d.ts new file mode 100644 index 00000000..bc954451 --- /dev/null +++ b/Phaser/system/animation/Animation.d.ts @@ -0,0 +1,27 @@ +/// +module Phaser { + class Animation { + constructor(game: Game, parent: Sprite, frameData: FrameData, name: string, frames, delay: number, looped: bool); + private _game; + private _parent; + private _frames; + private _frameData; + private _frameIndex; + private _timeLastFrame; + private _timeNextFrame; + public name: string; + public currentFrame: Frame; + public isFinished: bool; + public isPlaying: bool; + public looped: bool; + public delay: number; + public frameTotal : number; + public frame : number; + public play(frameRate?: number, loop?: bool): void; + public restart(): void; + public stop(): void; + public update(): bool; + public destroy(): void; + private onComplete(); + } +} diff --git a/Phaser/system/animation/AnimationLoader.d.ts b/Phaser/system/animation/AnimationLoader.d.ts new file mode 100644 index 00000000..0a903681 --- /dev/null +++ b/Phaser/system/animation/AnimationLoader.d.ts @@ -0,0 +1,7 @@ +/// +module Phaser { + class AnimationLoader { + static parseSpriteSheet(game: Game, key: string, frameWidth: number, frameHeight: number, frameMax: number): FrameData; + static parseJSONData(game: Game, json): FrameData; + } +} diff --git a/Phaser/system/animation/Frame.d.ts b/Phaser/system/animation/Frame.d.ts new file mode 100644 index 00000000..57fe0396 --- /dev/null +++ b/Phaser/system/animation/Frame.d.ts @@ -0,0 +1,23 @@ +/// +module Phaser { + class Frame { + constructor(x: number, y: number, width: number, height: number, name: string); + public x: number; + public y: number; + public width: number; + public height: number; + public index: number; + public name: string; + public rotated: bool; + public rotationDirection: string; + public trimmed: bool; + public sourceSizeW: number; + public sourceSizeH: number; + public spriteSourceSizeX: number; + public spriteSourceSizeY: number; + public spriteSourceSizeW: number; + public spriteSourceSizeH: number; + public setRotation(rotated: bool, rotationDirection: string): void; + public setTrim(trimmed: bool, actualWidth, actualHeight, destX, destY, destWidth, destHeight): void; + } +} diff --git a/Phaser/system/animation/FrameData.d.ts b/Phaser/system/animation/FrameData.d.ts new file mode 100644 index 00000000..d648728b --- /dev/null +++ b/Phaser/system/animation/FrameData.d.ts @@ -0,0 +1,18 @@ +/// +module Phaser { + class FrameData { + constructor(); + private _frames; + private _frameNames; + public total : number; + public addFrame(frame: Frame): Frame; + public getFrame(index: number): Frame; + public getFrameByName(name: string): Frame; + public checkFrameName(name: string): bool; + public getFrameRange(start: number, end: number, output?: Frame[]): Frame[]; + public getFrameIndexes(output?: number[]): number[]; + public getFrameIndexesByName(input: string[]): number[]; + public getAllFrames(): Frame[]; + public getFrames(range: number[]): Frame[]; + } +} diff --git a/Phaser/system/easing/Back.d.ts b/Phaser/system/easing/Back.d.ts new file mode 100644 index 00000000..b111dd51 --- /dev/null +++ b/Phaser/system/easing/Back.d.ts @@ -0,0 +1,8 @@ +/// +module Phaser.Easing { + class Back { + static In(k): number; + static Out(k): number; + static InOut(k): number; + } +} diff --git a/Phaser/system/easing/Bounce.d.ts b/Phaser/system/easing/Bounce.d.ts new file mode 100644 index 00000000..a23a0f58 --- /dev/null +++ b/Phaser/system/easing/Bounce.d.ts @@ -0,0 +1,8 @@ +/// +module Phaser.Easing { + class Bounce { + static In(k): number; + static Out(k): number; + static InOut(k): number; + } +} diff --git a/Phaser/system/easing/Circular.d.ts b/Phaser/system/easing/Circular.d.ts new file mode 100644 index 00000000..0abe1ccf --- /dev/null +++ b/Phaser/system/easing/Circular.d.ts @@ -0,0 +1,8 @@ +/// +module Phaser.Easing { + class Circular { + static In(k): number; + static Out(k): number; + static InOut(k): number; + } +} diff --git a/Phaser/system/easing/Cubic.d.ts b/Phaser/system/easing/Cubic.d.ts new file mode 100644 index 00000000..7199265d --- /dev/null +++ b/Phaser/system/easing/Cubic.d.ts @@ -0,0 +1,8 @@ +/// +module Phaser.Easing { + class Cubic { + static In(k): number; + static Out(k): number; + static InOut(k): number; + } +} diff --git a/Phaser/system/easing/Elastic.d.ts b/Phaser/system/easing/Elastic.d.ts new file mode 100644 index 00000000..40deb36c --- /dev/null +++ b/Phaser/system/easing/Elastic.d.ts @@ -0,0 +1,8 @@ +/// +module Phaser.Easing { + class Elastic { + static In(k): number; + static Out(k): number; + static InOut(k): number; + } +} diff --git a/Phaser/system/easing/Exponential.d.ts b/Phaser/system/easing/Exponential.d.ts new file mode 100644 index 00000000..48bb9a87 --- /dev/null +++ b/Phaser/system/easing/Exponential.d.ts @@ -0,0 +1,8 @@ +/// +module Phaser.Easing { + class Exponential { + static In(k): number; + static Out(k): number; + static InOut(k): number; + } +} diff --git a/Phaser/system/easing/Linear.d.ts b/Phaser/system/easing/Linear.d.ts new file mode 100644 index 00000000..9ae91006 --- /dev/null +++ b/Phaser/system/easing/Linear.d.ts @@ -0,0 +1,6 @@ +/// +module Phaser.Easing { + class Linear { + static None(k); + } +} diff --git a/Phaser/system/easing/Quadratic.d.ts b/Phaser/system/easing/Quadratic.d.ts new file mode 100644 index 00000000..e3ccb3ac --- /dev/null +++ b/Phaser/system/easing/Quadratic.d.ts @@ -0,0 +1,8 @@ +/// +module Phaser.Easing { + class Quadratic { + static In(k): number; + static Out(k): number; + static InOut(k): number; + } +} diff --git a/Phaser/system/easing/Quartic.d.ts b/Phaser/system/easing/Quartic.d.ts new file mode 100644 index 00000000..342bb6b4 --- /dev/null +++ b/Phaser/system/easing/Quartic.d.ts @@ -0,0 +1,8 @@ +/// +module Phaser.Easing { + class Quartic { + static In(k): number; + static Out(k): number; + static InOut(k): number; + } +} diff --git a/Phaser/system/easing/Quintic.d.ts b/Phaser/system/easing/Quintic.d.ts new file mode 100644 index 00000000..7c3782de --- /dev/null +++ b/Phaser/system/easing/Quintic.d.ts @@ -0,0 +1,8 @@ +/// +module Phaser.Easing { + class Quintic { + static In(k): number; + static Out(k): number; + static InOut(k): number; + } +} diff --git a/Phaser/system/easing/Sinusoidal.d.ts b/Phaser/system/easing/Sinusoidal.d.ts new file mode 100644 index 00000000..1dfd2310 --- /dev/null +++ b/Phaser/system/easing/Sinusoidal.d.ts @@ -0,0 +1,8 @@ +/// +module Phaser.Easing { + class Sinusoidal { + static In(k): number; + static Out(k): number; + static InOut(k): number; + } +} diff --git a/Phaser/system/input/Finger.d.ts b/Phaser/system/input/Finger.d.ts new file mode 100644 index 00000000..1b21294c --- /dev/null +++ b/Phaser/system/input/Finger.d.ts @@ -0,0 +1,35 @@ +/// +module Phaser { + class Finger { + constructor(game: Game); + private _game; + public identifier: number; + public active: bool; + public point: Point; + public circle: Circle; + public withinGame: bool; + public clientX: number; + public clientY: number; + public pageX: number; + public pageY: number; + public screenX: number; + public screenY: number; + public x: number; + public y: number; + public target; + public isDown: bool; + public isUp: bool; + public timeDown: number; + public duration: number; + public timeUp: number; + public justPressedRate: number; + public justReleasedRate: number; + public start(event): void; + public move(event): void; + public leave(event): void; + public stop(event): void; + public justPressed(duration?: number): bool; + public justReleased(duration?: number): bool; + public toString(): string; + } +} diff --git a/Phaser/system/input/Input.d.ts b/Phaser/system/input/Input.d.ts new file mode 100644 index 00000000..ea10c690 --- /dev/null +++ b/Phaser/system/input/Input.d.ts @@ -0,0 +1,24 @@ +/// +/// +module Phaser { + class Input { + constructor(game: Game); + private _game; + public mouse: Mouse; + public keyboard: Keyboard; + public touch: Touch; + public x: number; + public y: number; + public scaleX: number; + public scaleY: number; + public worldX: number; + public worldY: number; + public onDown: Signal; + public onUp: Signal; + public update(): void; + public reset(): void; + public getWorldX(camera?: Camera): number; + public getWorldY(camera?: Camera): number; + public renderDebugInfo(x: number, y: number, color?: string): void; + } +} diff --git a/Phaser/system/input/Keyboard.d.ts b/Phaser/system/input/Keyboard.d.ts new file mode 100644 index 00000000..7419ab8e --- /dev/null +++ b/Phaser/system/input/Keyboard.d.ts @@ -0,0 +1,117 @@ +/// +module Phaser { + class Keyboard { + constructor(game: Game); + private _game; + private _keys; + private _capture; + public start(): void; + public addKeyCapture(keycode): void; + public removeKeyCapture(keycode: number): void; + public clearCaptures(): void; + public onKeyDown(event: KeyboardEvent): void; + public onKeyUp(event: KeyboardEvent): void; + public reset(): void; + public justPressed(keycode: number, duration?: number): bool; + public justReleased(keycode: number, duration?: number): bool; + public isDown(keycode: number): bool; + static A: number; + static B: number; + static C: number; + static D: number; + static E: number; + static F: number; + static G: number; + static H: number; + static I: number; + static J: number; + static K: number; + static L: number; + static M: number; + static N: number; + static O: number; + static P: number; + static Q: number; + static R: number; + static S: number; + static T: number; + static U: number; + static V: number; + static W: number; + static X: number; + static Y: number; + static Z: number; + static ZERO: number; + static ONE: number; + static TWO: number; + static THREE: number; + static FOUR: number; + static FIVE: number; + static SIX: number; + static SEVEN: number; + static EIGHT: number; + static NINE: number; + static NUMPAD_0: number; + static NUMPAD_1: number; + static NUMPAD_2: number; + static NUMPAD_3: number; + static NUMPAD_4: number; + static NUMPAD_5: number; + static NUMPAD_6: number; + static NUMPAD_7: number; + static NUMPAD_8: number; + static NUMPAD_9: number; + static NUMPAD_MULTIPLY: number; + static NUMPAD_ADD: number; + static NUMPAD_ENTER: number; + static NUMPAD_SUBTRACT: number; + static NUMPAD_DECIMAL: number; + static NUMPAD_DIVIDE: number; + static F1: number; + static F2: number; + static F3: number; + static F4: number; + static F5: number; + static F6: number; + static F7: number; + static F8: number; + static F9: number; + static F10: number; + static F11: number; + static F12: number; + static F13: number; + static F14: number; + static F15: number; + static COLON: number; + static EQUALS: number; + static UNDERSCORE: number; + static QUESTION_MARK: number; + static TILDE: number; + static OPEN_BRACKET: number; + static BACKWARD_SLASH: number; + static CLOSED_BRACKET: number; + static QUOTES: number; + static BACKSPACE: number; + static TAB: number; + static CLEAR: number; + static ENTER: number; + static SHIFT: number; + static CONTROL: number; + static ALT: number; + static CAPS_LOCK: number; + static ESC: number; + static SPACEBAR: number; + static PAGE_UP: number; + static PAGE_DOWN: number; + static END: number; + static HOME: number; + static LEFT: number; + static UP: number; + static RIGHT: number; + static DOWN: number; + static INSERT: number; + static DELETE: number; + static HELP: number; + static NUM_LOCK: number; + } +} diff --git a/Phaser/system/input/Mouse.d.ts b/Phaser/system/input/Mouse.d.ts new file mode 100644 index 00000000..5cc2c786 --- /dev/null +++ b/Phaser/system/input/Mouse.d.ts @@ -0,0 +1,24 @@ +/// +module Phaser { + class Mouse { + constructor(game: Game); + private _game; + private _x; + private _y; + public button: number; + static LEFT_BUTTON: number; + static MIDDLE_BUTTON: number; + static RIGHT_BUTTON: number; + public isDown: bool; + public isUp: bool; + public timeDown: number; + public duration: number; + public timeUp: number; + public start(): void; + public reset(): void; + public onMouseDown(event: MouseEvent): void; + public update(): void; + public onMouseMove(event: MouseEvent): void; + public onMouseUp(event: MouseEvent): void; + } +} diff --git a/Phaser/system/input/Touch.d.ts b/Phaser/system/input/Touch.d.ts new file mode 100644 index 00000000..e1129437 --- /dev/null +++ b/Phaser/system/input/Touch.d.ts @@ -0,0 +1,40 @@ +/// +/// +module Phaser { + class Touch { + constructor(game: Game); + private _game; + public x: number; + public y: number; + private _fingers; + public finger1: Finger; + public finger2: Finger; + public finger3: Finger; + public finger4: Finger; + public finger5: Finger; + public finger6: Finger; + public finger7: Finger; + public finger8: Finger; + public finger9: Finger; + public finger10: Finger; + public latestFinger: Finger; + public isDown: bool; + public isUp: bool; + public touchDown: Signal; + public touchUp: Signal; + public start(): void; + private consumeTouchMove(event); + private onTouchStart(event); + private onTouchCancel(event); + private onTouchEnter(event); + private onTouchLeave(event); + private onTouchMove(event); + private onTouchEnd(event); + public calculateDistance(finger1: Finger, finger2: Finger): void; + public calculateAngle(finger1: Finger, finger2: Finger): void; + public checkOverlap(finger1: Finger, finger2: Finger): void; + public update(): void; + public stop(): void; + public reset(): void; + } +} diff --git a/Phaser/system/screens/BootScreen.d.ts b/Phaser/system/screens/BootScreen.d.ts new file mode 100644 index 00000000..6a8b7094 --- /dev/null +++ b/Phaser/system/screens/BootScreen.d.ts @@ -0,0 +1,15 @@ +/// +module Phaser { + class BootScreen { + constructor(game: Game); + private _game; + private _logo; + private _logoData; + private _color1; + private _color2; + private _fade; + public update(): void; + public render(): void; + private colorCycle(); + } +} diff --git a/Phaser/system/screens/PauseScreen.d.ts b/Phaser/system/screens/PauseScreen.d.ts new file mode 100644 index 00000000..42ee5864 --- /dev/null +++ b/Phaser/system/screens/PauseScreen.d.ts @@ -0,0 +1,17 @@ +/// +module Phaser { + class PauseScreen { + constructor(game: Game, width: number, height: number); + private _game; + private _canvas; + private _context; + private _color; + private _fade; + public onPaused(): void; + public onResume(): void; + public update(): void; + public render(): void; + private fadeOut(); + private fadeIn(); + } +} diff --git a/README.md b/README.md index b9384cf5..cc2f8fd2 100644 --- a/README.md +++ b/README.md @@ -20,12 +20,20 @@ Latest Update V0.9.5 -* Moved the BootScreen and PauseScreen out of Stage into their own classes (system/screens/BootScreen and PauseScreen) +* Moved the BootScreen and PauseScreen out of Stage into their own classes (system/screens/BootScreen and PauseScreen). * Updated the PauseScreen to show a subtle animation effect, making it easier to create your own interesting pause screens. -* Modified Game so it splits into 3 loops - bootLoop, pauseLoop and loop (the core loop) -* Updated the BootScreen with the new logo and new color cycle effect -* Added Game.isRunning - set to true once the Game.boot process is over IF you gave some functions to the constructor or a state -* Fixed small bug in Signal.removeAll where it could try to shorten the _bindings even if undefined +* Modified Game so it splits into 3 loops - bootLoop, pauseLoop and loop (the core loop). +* Updated the BootScreen with the new logo and new color cycle effect. +* Added Game.isRunning - set to true once the Game.boot process is over IF you gave some functions to the constructor or a state. +* Fixed small bug in Signal.removeAll where it could try to shorten the _bindings even if undefined. +* Added the new FXManager which is used for handling all special effects on Cameras (and soon other game objects). +* Removed Flash, Fade and Shake from the Camera class and moved to the new SpecialFX project. +* SpecialFX compiles to phaser-fx.js in the build folder, which is copied over to Tests. If you don't need the FX, don't include the .js file. +* The project is now generating TypeScript declaration files and all Tests were updated to use them in their references. +* Fixed a bug in Flash, Fade and Shake where the duration would fail on anything above 3 seconds. +* Fixed a bug in Camera Shake that made it go a bit haywire, now shakes correctly. +* Added new Scanlines Camera FX. + Requirements ------------ @@ -43,7 +51,7 @@ Phaser is just 45KB gzipped and minified. Features -------- -Phaser was born from a cross-polination of the AS3 Flixel game library and our own internal HTML5 game framework. The objective was to allow you to make games _really_ quickly and remove some of the speed barriers HTML5 puts in your way. +Phaser was born from a cross-pollination of the AS3 Flixel game library and our own internal HTML5 game framework. The objective was to allow you to make games _really_ quickly and remove some of the speed barriers HTML5 puts in your way. Phaser fully or partially supports the following features. This list is growing constantly and we are aware there are still a number of essential features missing: @@ -132,7 +140,7 @@ Beyond this there are lots of other things we plan to add such as WebGL support, Test Suite ---------- -Phaser comes with an ever growing Test Suite. Personally we learn better by looking at small refined code examples, so we create lots of them to test each new feature we add. Inside the Tests folder you'll find the current set. If you write a particuarly good test then please send it to us. +Phaser comes with an ever growing Test Suite. Personally we learn better by looking at small refined code examples, so we create lots of them to test each new feature we add. Inside the Tests folder you'll find the current set. If you write a particularly good test then please send it to us. The tests need running through a local web server (to avoid file access permission errors from your browser). diff --git a/SpecialFX/.gitignore b/SpecialFX/.gitignore new file mode 100644 index 00000000..cc08b612 --- /dev/null +++ b/SpecialFX/.gitignore @@ -0,0 +1,38 @@ + +#ignore thumbnails created by windows +Thumbs.db +#Ignore files build by Visual Studio +*.obj +*.exe +*.pdb +*.user +*.aps +*.pch +*.vspscc +*_i.c +*_p.c +*.ncb +*.suo +*.sln +*.tlb +*.tlh +*.bak +*.cache +*.ilk +*.log +*.map +*.orig +*.map +*.config +*.sublime-workspace +.DS_Store +launcher.html +tests.html +[Bb]in +[Dd]ebug*/ +*.lib +*.sbr +obj/ +[Rr]elease*/ +_ReSharper*/ +[Tt]est[Rr]esult* diff --git a/SpecialFX/Camera/Fade.js b/SpecialFX/Camera/Fade.js new file mode 100644 index 00000000..98f6cf21 --- /dev/null +++ b/SpecialFX/Camera/Fade.js @@ -0,0 +1,17 @@ +var Shapes; +(function (Shapes) { + var Point = (function () { + function Point(x, y) { + this.x = x; + this.y = y; + } + Point.prototype.getDist = function () { + return Math.sqrt(this.x * this.x + this.y * this.y); + }; + Point.origin = new Point(0, 0); + return Point; + })(); + Shapes.Point = Point; +})(Shapes || (Shapes = {})); +var p = new Shapes.Point(3, 4); +var dist = p.getDist(); diff --git a/SpecialFX/Camera/Fade.ts b/SpecialFX/Camera/Fade.ts new file mode 100644 index 00000000..bb036d46 --- /dev/null +++ b/SpecialFX/Camera/Fade.ts @@ -0,0 +1,92 @@ +/// +/// + +/** +* Phaser - FX - Camera - Fade +* +* The camera is filled with the given color and returns to normal at the given duration. +*/ + +module Phaser.FX.Camera { + + export class Fade { + + constructor(game: Game) { + + this._game = game; + + } + + private _game: Game; + + private _fxFadeColor: string; + private _fxFadeComplete = null; + private _fxFadeDuration: number = 0; + private _fxFadeAlpha: number = 0; + + /** + * The camera is gradually filled with this color. + * + * @param Color The color you want to use in 0xRRGGBB format, i.e. 0xffffff for white. + * @param Duration How long it takes for the flash to fade. + * @param OnComplete An optional function you want to run when the flash finishes. Set to null for no callback. + * @param Force Force an already running flash effect to reset. + */ + public start(color: number = 0x000000, duration: number = 1, onComplete = null, force: bool = false) { + + if (force === false && this._fxFadeAlpha > 0) + { + // You can't fade again unless you force it + return; + } + + if (duration <= 0) + { + duration = 1; + } + + var red = color >> 16 & 0xFF; + var green = color >> 8 & 0xFF; + var blue = color & 0xFF; + + this._fxFadeColor = 'rgba(' + red + ',' + green + ',' + blue + ','; + this._fxFadeDuration = duration; + this._fxFadeAlpha = 0.01; + this._fxFadeComplete = onComplete; + + } + + public postUpdate() { + + // Update the Fade effect + if (this._fxFadeAlpha > 0) + { + this._fxFadeAlpha += this._game.time.elapsed / this._fxFadeDuration; + + if (this._game.math.roundTo(this._fxFadeAlpha, -2) >= 1) + { + this._fxFadeAlpha = 1; + + if (this._fxFadeComplete !== null) + { + this._fxFadeComplete(); + } + } + } + + } + + public postRender(camera: Phaser.Camera, cameraX: number, cameraY: number, cameraWidth: number, cameraHeight: number) { + + // "Fade" FX + if (this._fxFadeAlpha > 0) + { + this._game.stage.context.fillStyle = this._fxFadeColor + this._fxFadeAlpha + ')'; + this._game.stage.context.fillRect(cameraX, cameraY, cameraWidth, cameraHeight); + } + + } + + } + +} diff --git a/SpecialFX/Camera/Flash.d.ts b/SpecialFX/Camera/Flash.d.ts new file mode 100644 index 00000000..c3a9a200 --- /dev/null +++ b/SpecialFX/Camera/Flash.d.ts @@ -0,0 +1,15 @@ +/// +/// +module Phaser.FX.Camera { + class Flash { + constructor(game: Game); + private _game; + private _fxFlashColor; + private _fxFlashComplete; + private _fxFlashDuration; + private _fxFlashAlpha; + public start(color?: number, duration?: number, onComplete?, force?: bool): void; + public postUpdate(): void; + public postRender(cameraX: number, cameraY: number, cameraWidth: number, cameraHeight: number): void; + } +} diff --git a/SpecialFX/Camera/Flash.js b/SpecialFX/Camera/Flash.js new file mode 100644 index 00000000..2ff224b2 --- /dev/null +++ b/SpecialFX/Camera/Flash.js @@ -0,0 +1,56 @@ +var Phaser; +(function (Phaser) { + (function (FX) { + (function (Camera) { + var Flash = (function () { + function Flash(game) { + this._fxFlashComplete = null; + this._fxFlashDuration = 0; + this._fxFlashAlpha = 0; + this._game = game; + } + Flash.prototype.start = function (color, duration, onComplete, force) { + if (typeof color === "undefined") { color = 0xffffff; } + if (typeof duration === "undefined") { duration = 1; } + if (typeof onComplete === "undefined") { onComplete = null; } + if (typeof force === "undefined") { force = false; } + if(force === false && this._fxFlashAlpha > 0) { + return; + } + if(duration <= 0) { + duration = 1; + } + var red = color >> 16 & 0xFF; + var green = color >> 8 & 0xFF; + var blue = color & 0xFF; + this._fxFlashColor = 'rgba(' + red + ',' + green + ',' + blue + ','; + this._fxFlashDuration = duration; + this._fxFlashAlpha = 1; + this._fxFlashComplete = onComplete; + }; + Flash.prototype.postUpdate = function () { + if(this._fxFlashAlpha > 0) { + this._fxFlashAlpha -= this._game.time.elapsed / this._fxFlashDuration; + this._fxFlashAlpha = this._game.math.roundTo(this._fxFlashAlpha, -2); + if(this._fxFlashAlpha <= 0) { + this._fxFlashAlpha = 0; + if(this._fxFlashComplete !== null) { + this._fxFlashComplete(); + } + } + } + }; + Flash.prototype.postRender = function (cameraX, cameraY, cameraWidth, cameraHeight) { + if(this._fxFlashAlpha > 0) { + this._game.stage.context.fillStyle = this._fxFlashColor + this._fxFlashAlpha + ')'; + this._game.stage.context.fillRect(cameraX, cameraY, cameraWidth, cameraHeight); + } + }; + return Flash; + })(); + Camera.Flash = Flash; + })(FX.Camera || (FX.Camera = {})); + var Camera = FX.Camera; + })(Phaser.FX || (Phaser.FX = {})); + var FX = Phaser.FX; +})(Phaser || (Phaser = {})); diff --git a/SpecialFX/Camera/Flash.ts b/SpecialFX/Camera/Flash.ts new file mode 100644 index 00000000..e7dd6a8b --- /dev/null +++ b/SpecialFX/Camera/Flash.ts @@ -0,0 +1,91 @@ +/// +/// + +/** +* Phaser - FX - Camera - Flash +* +* The camera is filled with the given color and returns to normal at the given duration. +*/ + +module Phaser.FX.Camera { + + export class Flash { + + constructor(game: Game) { + + this._game = game; + + } + + private _game: Game; + + private _fxFlashColor: string; + private _fxFlashComplete = null; + private _fxFlashDuration: number = 0; + private _fxFlashAlpha: number = 0; + + /** + * The camera is filled with this color and returns to normal at the given duration. + * + * @param Color The color you want to use in 0xRRGGBB format, i.e. 0xffffff for white. + * @param Duration How long it takes for the flash to fade. + * @param OnComplete An optional function you want to run when the flash finishes. Set to null for no callback. + * @param Force Force an already running flash effect to reset. + */ + public start(color: number = 0xffffff, duration: number = 1, onComplete = null, force: bool = false) { + + if (force === false && this._fxFlashAlpha > 0) + { + // You can't flash again unless you force it + return; + } + + if (duration <= 0) + { + duration = 1; + } + + var red = color >> 16 & 0xFF; + var green = color >> 8 & 0xFF; + var blue = color & 0xFF; + + this._fxFlashColor = 'rgba(' + red + ',' + green + ',' + blue + ','; + this._fxFlashDuration = duration; + this._fxFlashAlpha = 1; + this._fxFlashComplete = onComplete; + + } + + public postUpdate() { + + // Update the Flash effect + if (this._fxFlashAlpha > 0) + { + this._fxFlashAlpha -= this._game.time.elapsed / this._fxFlashDuration; + + if (this._game.math.roundTo(this._fxFlashAlpha, -2) <= 0) + { + this._fxFlashAlpha = 0; + + if (this._fxFlashComplete !== null) + { + this._fxFlashComplete(); + } + } + } + + } + + public postRender(camera: Phaser.Camera, cameraX: number, cameraY: number, cameraWidth: number, cameraHeight: number) { + + if (this._fxFlashAlpha > 0) + { + this._game.stage.context.fillStyle = this._fxFlashColor + this._fxFlashAlpha + ')'; + this._game.stage.context.fillRect(cameraX, cameraY, cameraWidth, cameraHeight); + } + + } + + } + +} diff --git a/SpecialFX/Camera/Scanlines.js b/SpecialFX/Camera/Scanlines.js new file mode 100644 index 00000000..2f9b5688 --- /dev/null +++ b/SpecialFX/Camera/Scanlines.js @@ -0,0 +1,19 @@ +var Shapes; +(function (Shapes) { + + var Point = Shapes.Point = (function () { + function Point(x, y) { + this.x = x; + this.y = y; + } + Point.prototype.getDist = function () { + return Math.sqrt((this.x * this.x) + (this.y * this.y)); + }; + Point.origin = new Point(0, 0); + return Point; + })(); + +})(Shapes || (Shapes = {})); + +var p = new Shapes.Point(3, 4); +var dist = p.getDist(); diff --git a/SpecialFX/Camera/Scanlines.ts b/SpecialFX/Camera/Scanlines.ts new file mode 100644 index 00000000..f01cdec4 --- /dev/null +++ b/SpecialFX/Camera/Scanlines.ts @@ -0,0 +1,41 @@ +/// +/// +/// + +/** +* Phaser - FX - Camera - Scanlines +* +* Give your game that classic retro feel! +*/ + +module Phaser.FX.Camera { + + export class Scanlines { + + constructor(game: Game, parent: Camera) { + + this._game = game; + this._parent = parent; + + } + + private _game: Game; + private _parent: Camera; + + public spacing: number = 4; + public color: string = 'rgba(0, 0, 0, 0.3)'; + + public postRender(camera: Camera, cameraX: number, cameraY: number, cameraWidth: number, cameraHeight: number) { + + this._game.stage.context.fillStyle = this.color; + + for (var y = cameraY; y < cameraHeight; y += this.spacing) + { + this._game.stage.context.fillRect(cameraX, y, cameraWidth, 1); + } + + } + + } + +} diff --git a/SpecialFX/Camera/Shake.js b/SpecialFX/Camera/Shake.js new file mode 100644 index 00000000..2f9b5688 --- /dev/null +++ b/SpecialFX/Camera/Shake.js @@ -0,0 +1,19 @@ +var Shapes; +(function (Shapes) { + + var Point = Shapes.Point = (function () { + function Point(x, y) { + this.x = x; + this.y = y; + } + Point.prototype.getDist = function () { + return Math.sqrt((this.x * this.x) + (this.y * this.y)); + }; + Point.origin = new Point(0, 0); + return Point; + })(); + +})(Shapes || (Shapes = {})); + +var p = new Shapes.Point(3, 4); +var dist = p.getDist(); diff --git a/SpecialFX/Camera/Shake.ts b/SpecialFX/Camera/Shake.ts new file mode 100644 index 00000000..e1572b2f --- /dev/null +++ b/SpecialFX/Camera/Shake.ts @@ -0,0 +1,117 @@ +/// +/// + +/** +* Phaser - FX - Camera - Shake +* +* A simple camera shake effect. +*/ + +module Phaser.FX.Camera { + + export class Shake { + + constructor(game: Game, camera: Phaser.Camera) { + + this._game = game; + this._parent = camera; + + } + + private _game: Game; + private _parent: Phaser.Camera; + + private _fxShakeIntensity: number = 0; + private _fxShakeDuration: number = 0; + private _fxShakeComplete = null; + private _fxShakeOffset: MicroPoint = new MicroPoint(0, 0); + private _fxShakeDirection: number = 0; + private _fxShakePrevX: number = 0; + private _fxShakePrevY: number = 0; + + public static SHAKE_BOTH_AXES: number = 0; + public static SHAKE_HORIZONTAL_ONLY: number = 1; + public static SHAKE_VERTICAL_ONLY: number = 2; + + /** + * A simple camera shake effect. + * + * @param Intensity Percentage of screen size representing the maximum distance that the screen can move while shaking. + * @param Duration The length in seconds that the shaking effect should last. + * @param OnComplete A function you want to run when the shake effect finishes. + * @param Force Force the effect to reset (default = true, unlike flash() and fade()!). + * @param Direction Whether to shake on both axes, just up and down, or just side to side (use class constants SHAKE_BOTH_AXES, SHAKE_VERTICAL_ONLY, or SHAKE_HORIZONTAL_ONLY). + */ + public start(intensity: number = 0.05, duration: number = 0.5, onComplete = null, force: bool = true, direction: number = Shake.SHAKE_BOTH_AXES) { + + if (!force && ((this._fxShakeOffset.x != 0) || (this._fxShakeOffset.y != 0))) + { + return; + } + + // If a shake is not already running we need to store the offsets here + if (this._fxShakeOffset.x == 0 && this._fxShakeOffset.y == 0) + { + this._fxShakePrevX = this._parent.x; + this._fxShakePrevY = this._parent.y; + } + + this._fxShakeIntensity = intensity; + this._fxShakeDuration = duration; + this._fxShakeComplete = onComplete; + this._fxShakeDirection = direction; + this._fxShakeOffset.setTo(0, 0); + + } + + public postUpdate() { + + // Update the "shake" special effect + if (this._fxShakeDuration > 0) + { + this._fxShakeDuration -= this._game.time.elapsed; + + if (this._game.math.roundTo(this._fxShakeDuration, -2) <= 0) + { + this._fxShakeDuration = 0; + this._fxShakeOffset.setTo(0, 0); + this._parent.x = this._fxShakePrevX; + this._parent.y = this._fxShakePrevY; + + if (this._fxShakeComplete != null) + { + this._fxShakeComplete(); + } + } + else + { + if ((this._fxShakeDirection == Shake.SHAKE_BOTH_AXES) || (this._fxShakeDirection == Shake.SHAKE_HORIZONTAL_ONLY)) + { + //this._fxShakeOffset.x = ((this._game.math.random() * this._fxShakeIntensity * this.worldView.width * 2 - this._fxShakeIntensity * this.worldView.width) * this._zoom; + this._fxShakeOffset.x = (this._game.math.random() * this._fxShakeIntensity * this._parent.worldView.width * 2 - this._fxShakeIntensity * this._parent.worldView.width); + } + + if ((this._fxShakeDirection == Shake.SHAKE_BOTH_AXES) || (this._fxShakeDirection == Shake.SHAKE_VERTICAL_ONLY)) + { + //this._fxShakeOffset.y = (this._game.math.random() * this._fxShakeIntensity * this.worldView.height * 2 - this._fxShakeIntensity * this.worldView.height) * this._zoom; + this._fxShakeOffset.y = (this._game.math.random() * this._fxShakeIntensity * this._parent.worldView.height * 2 - this._fxShakeIntensity * this._parent.worldView.height); + } + } + + } + + } + + public preRender(camera: Phaser.Camera, cameraX: number, cameraY: number, cameraWidth: number, cameraHeight: number) { + + if ((this._fxShakeOffset.x != 0) || (this._fxShakeOffset.y != 0)) + { + this._parent.x = this._fxShakePrevX + this._fxShakeOffset.x; + this._parent.y = this._fxShakePrevY + this._fxShakeOffset.y; + } + + } + + } + +} diff --git a/SpecialFX/Camera/Template.js b/SpecialFX/Camera/Template.js new file mode 100644 index 00000000..2f9b5688 --- /dev/null +++ b/SpecialFX/Camera/Template.js @@ -0,0 +1,19 @@ +var Shapes; +(function (Shapes) { + + var Point = Shapes.Point = (function () { + function Point(x, y) { + this.x = x; + this.y = y; + } + Point.prototype.getDist = function () { + return Math.sqrt((this.x * this.x) + (this.y * this.y)); + }; + Point.origin = new Point(0, 0); + return Point; + })(); + +})(Shapes || (Shapes = {})); + +var p = new Shapes.Point(3, 4); +var dist = p.getDist(); diff --git a/SpecialFX/Camera/Template.ts b/SpecialFX/Camera/Template.ts new file mode 100644 index 00000000..e7b9312b --- /dev/null +++ b/SpecialFX/Camera/Template.ts @@ -0,0 +1,66 @@ +/// +/// +/// + +/** +* Phaser - FX - Camera - Template +* +* A Template FX file you can use to create your own Camera FX. +* If you don't use any of the methods below (i.e. preUpdate, render, etc) then DELETE THEM to avoid un-necessary calls by the FXManager. +*/ + +module Phaser.FX.Camera { + + export class Template { + + constructor(game: Game, parent: Camera) { + + this._game = game; + this._parent = parent; + + } + + private _game: Game; + private _parent: Camera; + + /** + * You can name the function that starts the effect whatever you like, but we used 'start' in our effects. + */ + public start() { + } + + /** + * Pre-update is called at the start of the objects update cycle, before any other updates have taken place. + */ + public preUpdate() { + } + + /** + * Post-update is called at the end of the objects update cycle, after other update logic has taken place. + */ + public postUpdate() { + } + + /** + * Pre-render is called at the start of the object render cycle, before any transforms have taken place. + * It happens directly AFTER a canvas context.save has happened if added to a Camera. + */ + public preRender(camera: Camera, cameraX: number, cameraY: number, cameraWidth: number, cameraHeight: number) { + } + + /** + * render is called during the objects render cycle, right after all transforms have finished, but before any children/image data is rendered. + */ + public render(camera: Camera, cameraX: number, cameraY: number, cameraWidth: number, cameraHeight: number) { + } + + /** + * Post-render is called during the objects render cycle, after the children/image data has been rendered. + * It happens directly BEFORE a canvas context.restore has happened if added to a Camera. + */ + public postRender(camera: Camera, cameraX: number, cameraY: number, cameraWidth: number, cameraHeight: number) { + } + + } + +} diff --git a/SpecialFX/SpecialFX.csproj b/SpecialFX/SpecialFX.csproj new file mode 100644 index 00000000..ce3499ee --- /dev/null +++ b/SpecialFX/SpecialFX.csproj @@ -0,0 +1,88 @@ + + + + Debug + {47390070-8027-4834-B50B-21119DC874DC} + {349c5851-65df-11da-9384-00065b846f21};{fae04ec0-301f-11d3-bf4b-00c04f79efbc} + Library + bin + v4.5 + full + true + true + + + + + + + 10.0 + $(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion) + + + SpecialFX + + + + + + + + True + True + 0 + / + http://localhost:64170/ + False + False + + + False + + + + + + ES5 + true + false + ../build/phaser-fx.js + true + + + ES5 + false + false + ../build/phaser-fx.js + true + + + + + + + Fade.ts + + + + Template.ts + + + + Scanlines.ts + + + Shake.ts + + + + + Flash.ts + + + + + cd $(ProjectDir)..\build +copy phaser-fx.js ..\Tests\ + + \ No newline at end of file diff --git a/Tests/Flash.js b/Tests/Flash.js new file mode 100644 index 00000000..21661d9d --- /dev/null +++ b/Tests/Flash.js @@ -0,0 +1,73 @@ +var Phaser; +(function (Phaser) { + (function (FX) { + /// + /// + /** + * Phaser - FX - Camera - Flash + * + * + */ + (function (Camera) { + var Flash = (function () { + function Flash(game) { + this._fxFlashComplete = null; + this._fxFlashDuration = 0; + this._fxFlashAlpha = 0; + this._game = game; + } + Flash.prototype.start = /** + * The camera is filled with this color and returns to normal at the given duration. + * + * @param Color The color you want to use in 0xRRGGBB format, i.e. 0xffffff for white. + * @param Duration How long it takes for the flash to fade. + * @param OnComplete An optional function you want to run when the flash finishes. Set to null for no callback. + * @param Force Force an already running flash effect to reset. + */ + function (color, duration, onComplete, force) { + if (typeof color === "undefined") { color = 0xffffff; } + if (typeof duration === "undefined") { duration = 1; } + if (typeof onComplete === "undefined") { onComplete = null; } + if (typeof force === "undefined") { force = false; } + if(force === false && this._fxFlashAlpha > 0) { + // You can't flash again unless you force it + return; + } + if(duration <= 0) { + duration = 1; + } + var red = color >> 16 & 0xFF; + var green = color >> 8 & 0xFF; + var blue = color & 0xFF; + this._fxFlashColor = 'rgba(' + red + ',' + green + ',' + blue + ','; + this._fxFlashDuration = duration; + this._fxFlashAlpha = 1; + this._fxFlashComplete = onComplete; + }; + Flash.prototype.postUpdate = function () { + // Update the Flash effect + if(this._fxFlashAlpha > 0) { + this._fxFlashAlpha -= this._game.time.elapsed / this._fxFlashDuration; + this._fxFlashAlpha = this._game.math.roundTo(this._fxFlashAlpha, -2); + if(this._fxFlashAlpha <= 0) { + this._fxFlashAlpha = 0; + if(this._fxFlashComplete !== null) { + this._fxFlashComplete(); + } + } + } + }; + Flash.prototype.postRender = function (cameraX, cameraY, cameraWidth, cameraHeight) { + if(this._fxFlashAlpha > 0) { + this._game.stage.context.fillStyle = this._fxFlashColor + this._fxFlashAlpha + ')'; + this._game.stage.context.fillRect(cameraX, cameraY, cameraWidth, cameraHeight); + } + }; + return Flash; + })(); + Camera.Flash = Flash; + })(FX.Camera || (FX.Camera = {})); + var Camera = FX.Camera; + })(Phaser.FX || (Phaser.FX = {})); + var FX = Phaser.FX; +})(Phaser || (Phaser = {})); diff --git a/Tests/Tests.csproj b/Tests/Tests.csproj index cd892911..509609db 100644 --- a/Tests/Tests.csproj +++ b/Tests/Tests.csproj @@ -53,6 +53,7 @@ false + @@ -60,15 +61,12 @@ - - - @@ -100,6 +98,21 @@ + + + fade.ts + + + flash.ts + + + + + scanlines.ts + + + shake.ts + bootscreen.ts diff --git a/Tests/assets/pics/ninja-masters2.png b/Tests/assets/pics/ninja-masters2.png new file mode 100644 index 00000000..3ab0fc6e Binary files /dev/null and b/Tests/assets/pics/ninja-masters2.png differ diff --git a/Tests/camera fx/fade.js b/Tests/camera fx/fade.js new file mode 100644 index 00000000..f01fd919 --- /dev/null +++ b/Tests/camera fx/fade.js @@ -0,0 +1,46 @@ +/// +/// +(function () { + var myGame = new Phaser.Game(this, 'game', 800, 600, init, create, update); + function init() { + myGame.loader.addImageFile('background', 'assets/pics/large-color-wheel.png'); + myGame.loader.addImageFile('car', 'assets/sprites/car90.png'); + myGame.loader.load(); + } + var car; + var fade; + function create() { + myGame.createSprite(0, 0, 'background'); + car = myGame.createSprite(400, 300, 'car'); + // Add our effect to the camera + fade = myGame.camera.fx.add(Phaser.FX.Camera.Fade); + } + function update() { + car.velocity.x = 0; + car.velocity.y = 0; + car.angularVelocity = 0; + if(myGame.input.keyboard.isDown(Phaser.Keyboard.LEFT)) { + car.angularVelocity = -200; + } else if(myGame.input.keyboard.isDown(Phaser.Keyboard.RIGHT)) { + car.angularVelocity = 200; + } + if(myGame.input.keyboard.isDown(Phaser.Keyboard.UP)) { + car.velocity.copyFrom(myGame.motion.velocityFromAngle(car.angle, 300)); + } + // Fade when the car hits the edges, a different colour per edge + if(car.x < 0) { + fade.start(0x330066, 3); + car.x = 0; + } else if(car.x > myGame.world.width) { + fade.start(0x000066, 3); + car.x = myGame.world.width - car.width; + } + if(car.y < 0) { + fade.start(0xffffff, 4); + car.y = 0; + } else if(car.y > myGame.world.height) { + fade.start(0x000000, 3); + car.y = myGame.world.height - car.height; + } + } +})(); diff --git a/Tests/cameras/fade fx.ts b/Tests/camera fx/fade.ts similarity index 70% rename from Tests/cameras/fade fx.ts rename to Tests/camera fx/fade.ts index 450cbdf1..ec9be765 100644 --- a/Tests/cameras/fade fx.ts +++ b/Tests/camera fx/fade.ts @@ -1,4 +1,5 @@ /// +/// (function () { @@ -14,6 +15,7 @@ } var car: Phaser.Sprite; + var fade: Phaser.FX.Camera.Fade; function create() { @@ -21,16 +23,16 @@ car = myGame.createSprite(400, 300, 'car'); + // Add our effect to the camera + fade = myGame.camera.fx.add(Phaser.FX.Camera.Fade); + } function update() { - car.renderDebugInfo(32, 32); - car.velocity.x = 0; car.velocity.y = 0; car.angularVelocity = 0; - car.angularAcceleration = 0; if (myGame.input.keyboard.isDown(Phaser.Keyboard.LEFT)) { @@ -43,27 +45,30 @@ if (myGame.input.keyboard.isDown(Phaser.Keyboard.UP)) { - var motion:Phaser.Point = myGame.motion.velocityFromAngle(car.angle, 300); - - car.velocity.copyFrom(motion); + car.velocity.copyFrom(myGame.motion.velocityFromAngle(car.angle, 300)); } // Fade when the car hits the edges, a different colour per edge if (car.x < 0) { - myGame.camera.fade(0x330066, 3); + fade.start(0x330066, 3); car.x = 0; } else if (car.x > myGame.world.width) { - myGame.camera.fade(0x000066, 3); + fade.start(0x000066, 3); car.x = myGame.world.width - car.width; } - if (car.y > myGame.world.height) + if (car.y < 0) { - myGame.camera.fade(0x000000, 3); + fade.start(0xffffff, 4); + car.y = 0; + } + else if (car.y > myGame.world.height) + { + fade.start(0x000000, 3); car.y = myGame.world.height - car.height; } diff --git a/Tests/camera fx/flash.js b/Tests/camera fx/flash.js new file mode 100644 index 00000000..12674071 --- /dev/null +++ b/Tests/camera fx/flash.js @@ -0,0 +1,46 @@ +/// +/// +(function () { + var myGame = new Phaser.Game(this, 'game', 800, 600, init, create, update); + function init() { + myGame.loader.addImageFile('background', 'assets/pics/large-color-wheel.png'); + myGame.loader.addImageFile('car', 'assets/sprites/car90.png'); + myGame.loader.load(); + } + var car; + var flash; + function create() { + myGame.createSprite(0, 0, 'background'); + car = myGame.createSprite(400, 300, 'car'); + // Add our effect to the camera + flash = myGame.camera.fx.add(Phaser.FX.Camera.Flash); + } + function update() { + car.velocity.x = 0; + car.velocity.y = 0; + car.angularVelocity = 0; + if(myGame.input.keyboard.isDown(Phaser.Keyboard.LEFT)) { + car.angularVelocity = -200; + } else if(myGame.input.keyboard.isDown(Phaser.Keyboard.RIGHT)) { + car.angularVelocity = 200; + } + if(myGame.input.keyboard.isDown(Phaser.Keyboard.UP)) { + car.velocity.copyFrom(myGame.motion.velocityFromAngle(car.angle, 300)); + } + // Flash when the car hits the edges, a different colour per edge + if(car.x < 0) { + flash.start(0xffffff, 1); + car.x = 0; + } else if(car.x > myGame.world.width) { + flash.start(0xff0000, 2); + car.x = myGame.world.width - car.width; + } + if(car.y < 0) { + flash.start(0xffff00, 2); + car.y = 0; + } else if(car.y > myGame.world.height) { + flash.start(0xff00ff, 3); + car.y = myGame.world.height - car.height; + } + } +})(); diff --git a/Tests/cameras/flash fx.ts b/Tests/camera fx/flash.ts similarity index 75% rename from Tests/cameras/flash fx.ts rename to Tests/camera fx/flash.ts index 62efa791..ca607c28 100644 --- a/Tests/cameras/flash fx.ts +++ b/Tests/camera fx/flash.ts @@ -1,4 +1,5 @@ /// +/// (function () { @@ -14,6 +15,7 @@ } var car: Phaser.Sprite; + var flash: Phaser.FX.Camera.Flash; function create() { @@ -21,16 +23,16 @@ car = myGame.createSprite(400, 300, 'car'); + // Add our effect to the camera + flash = myGame.camera.fx.add(Phaser.FX.Camera.Flash); + } function update() { - car.renderDebugInfo(32, 32); - car.velocity.x = 0; car.velocity.y = 0; car.angularVelocity = 0; - car.angularAcceleration = 0; if (myGame.input.keyboard.isDown(Phaser.Keyboard.LEFT)) { @@ -43,32 +45,30 @@ if (myGame.input.keyboard.isDown(Phaser.Keyboard.UP)) { - var motion:Phaser.Point = myGame.motion.velocityFromAngle(car.angle, 300); - - car.velocity.copyFrom(motion); + car.velocity.copyFrom(myGame.motion.velocityFromAngle(car.angle, 300)); } // Flash when the car hits the edges, a different colour per edge if (car.x < 0) { - myGame.camera.flash(0xffffff, 1); + flash.start(0xffffff, 1); car.x = 0; } else if (car.x > myGame.world.width) { - myGame.camera.flash(0xff0000, 2); + flash.start(0xff0000, 2); car.x = myGame.world.width - car.width; } if (car.y < 0) { - myGame.camera.flash(0xffff00, 2); + flash.start(0xffff00, 2); car.y = 0; } else if (car.y > myGame.world.height) { - myGame.camera.flash(0xff00ff, 3); + flash.start(0xff00ff, 3); car.y = myGame.world.height - car.height; } diff --git a/Tests/camera fx/scanlines.js b/Tests/camera fx/scanlines.js new file mode 100644 index 00000000..f1a3b175 --- /dev/null +++ b/Tests/camera fx/scanlines.js @@ -0,0 +1,30 @@ +/// +/// +(function () { + var myGame = new Phaser.Game(this, 'game', 800, 600, init, create, update); + function init() { + myGame.world.setSize(1216, 896); + myGame.loader.addImageFile('backdrop', 'assets/pics/ninja-masters2.png'); + myGame.loader.load(); + } + var scanlines; + function create() { + // Add our effect to the camera + scanlines = myGame.camera.fx.add(Phaser.FX.Camera.Scanlines); + scanlines.spacing = 3; + scanlines.color = 'rgba(0, 0, 0, 0.8)'; + myGame.createSprite(0, 0, 'backdrop'); + } + function update() { + if(myGame.input.keyboard.isDown(Phaser.Keyboard.LEFT)) { + myGame.camera.scroll.x -= 4; + } else if(myGame.input.keyboard.isDown(Phaser.Keyboard.RIGHT)) { + myGame.camera.scroll.x += 4; + } + if(myGame.input.keyboard.isDown(Phaser.Keyboard.UP)) { + myGame.camera.scroll.y -= 4; + } else if(myGame.input.keyboard.isDown(Phaser.Keyboard.DOWN)) { + myGame.camera.scroll.y += 4; + } + } +})(); diff --git a/Tests/camera fx/scanlines.ts b/Tests/camera fx/scanlines.ts new file mode 100644 index 00000000..4f87edbf --- /dev/null +++ b/Tests/camera fx/scanlines.ts @@ -0,0 +1,57 @@ +/// +/// + +(function () { + + var myGame = new Phaser.Game(this, 'game', 800, 600, init, create, update); + + function init() { + + myGame.world.setSize(1216, 896); + + myGame.loader.addImageFile('backdrop', 'assets/pics/ninja-masters2.png'); + + myGame.loader.load(); + + } + + var scanlines: Phaser.FX.Camera.Scanlines; + + function create() { + + // Add our effect to the camera + scanlines = myGame.camera.fx.add(Phaser.FX.Camera.Scanlines); + + // We'll have the scanlines spaced out every 2 pixels + scanlines.spacing = 2; + + // This is the color the lines will be drawn in + scanlines.color = 'rgba(0, 0, 0, 0.8)'; + + myGame.createSprite(0, 0, 'backdrop'); + + } + + function update() { + + if (myGame.input.keyboard.isDown(Phaser.Keyboard.LEFT)) + { + myGame.camera.scroll.x -= 4; + } + else if (myGame.input.keyboard.isDown(Phaser.Keyboard.RIGHT)) + { + myGame.camera.scroll.x += 4; + } + + if (myGame.input.keyboard.isDown(Phaser.Keyboard.UP)) + { + myGame.camera.scroll.y -= 4; + } + else if (myGame.input.keyboard.isDown(Phaser.Keyboard.DOWN)) + { + myGame.camera.scroll.y += 4; + } + + } + +})(); diff --git a/Tests/camera fx/shake.js b/Tests/camera fx/shake.js new file mode 100644 index 00000000..dde86e69 --- /dev/null +++ b/Tests/camera fx/shake.js @@ -0,0 +1,50 @@ +/// +/// +(function () { + var myGame = new Phaser.Game(this, 'game', 800, 600, init, create, update); + function init() { + myGame.loader.addImageFile('background', 'assets/pics/remember-me.jpg'); + myGame.loader.addImageFile('car', 'assets/sprites/car90.png'); + myGame.loader.load(); + } + var car; + var shake; + function create() { + myGame.createSprite(0, 0, 'background'); + car = myGame.createSprite(400, 300, 'car'); + // Add our effect to the camera + shake = myGame.camera.fx.add(Phaser.FX.Camera.Shake); + myGame.onRenderCallback = render; + } + function update() { + car.velocity.x = 0; + car.velocity.y = 0; + car.angularVelocity = 0; + if(myGame.input.keyboard.isDown(Phaser.Keyboard.LEFT)) { + car.angularVelocity = -200; + } else if(myGame.input.keyboard.isDown(Phaser.Keyboard.RIGHT)) { + car.angularVelocity = 200; + } + if(myGame.input.keyboard.isDown(Phaser.Keyboard.UP)) { + car.velocity.copyFrom(myGame.motion.velocityFromAngle(car.angle, 300)); + } + // Shake the camera when the car hits the edges, a different intensity per edge + if(car.x < 0) { + shake.start(); + car.x = 0; + } else if(car.x > myGame.world.width) { + shake.start(0.02); + car.x = myGame.world.width - car.width; + } + if(car.y < 0) { + shake.start(0.07, 1); + car.y = 0; + } else if(car.y > myGame.world.height) { + shake.start(0.1); + car.y = myGame.world.height - car.height; + } + } + function render() { + myGame.camera.renderDebugInfo(32, 32); + } +})(); diff --git a/Tests/cameras/shake fx.ts b/Tests/camera fx/shake.ts similarity index 74% rename from Tests/cameras/shake fx.ts rename to Tests/camera fx/shake.ts index fababf07..7162448d 100644 --- a/Tests/cameras/shake fx.ts +++ b/Tests/camera fx/shake.ts @@ -1,4 +1,5 @@ /// +/// (function () { @@ -14,6 +15,7 @@ } var car: Phaser.Sprite; + var shake: Phaser.FX.Camera.Shake; function create() { @@ -21,16 +23,18 @@ car = myGame.createSprite(400, 300, 'car'); + // Add our effect to the camera + shake = myGame.camera.fx.add(Phaser.FX.Camera.Shake); + + myGame.onRenderCallback = render; + } function update() { - myGame.camera.renderDebugInfo(32, 32); - car.velocity.x = 0; car.velocity.y = 0; car.angularVelocity = 0; - car.angularAcceleration = 0; if (myGame.input.keyboard.isDown(Phaser.Keyboard.LEFT)) { @@ -43,35 +47,39 @@ if (myGame.input.keyboard.isDown(Phaser.Keyboard.UP)) { - var motion:Phaser.Point = myGame.motion.velocityFromAngle(car.angle, 300); - - car.velocity.copyFrom(motion); + car.velocity.copyFrom(myGame.motion.velocityFromAngle(car.angle, 300)); } // Shake the camera when the car hits the edges, a different intensity per edge if (car.x < 0) { - myGame.camera.shake(); + shake.start(); car.x = 0; } else if (car.x > myGame.world.width) { - myGame.camera.shake(0.02); + shake.start(0.02); car.x = myGame.world.width - car.width; } if (car.y < 0) { - myGame.camera.shake(0.07, 1); + shake.start(0.07, 1); car.y = 0; } else if (car.y > myGame.world.height) { - myGame.camera.shake(0.1); + shake.start(0.1); car.y = myGame.world.height - car.height; } } + function render() { + + myGame.camera.renderDebugInfo(32, 32); + + } + })(); diff --git a/Tests/index.php b/Tests/index.php index 7ce46adc..d0c26357 100644 --- a/Tests/index.php +++ b/Tests/index.php @@ -43,6 +43,7 @@ if (isset($_GET['f'])) Phaser Test Runner: <?php echo $state?> + 0) { - echo "

              $key

              "; + echo "

              $key (" . count($value) . " examples)

              "; printJSLinks($key, $value); } diff --git a/Tests/phaser-fx.js b/Tests/phaser-fx.js new file mode 100644 index 00000000..a4d44bfb --- /dev/null +++ b/Tests/phaser-fx.js @@ -0,0 +1,329 @@ +var Phaser; +(function (Phaser) { + (function (FX) { + /// + /// + /** + * Phaser - FX - Camera - Flash + * + * The camera is filled with the given color and returns to normal at the given duration. + */ + (function (Camera) { + var Flash = (function () { + function Flash(game) { + this._fxFlashComplete = null; + this._fxFlashDuration = 0; + this._fxFlashAlpha = 0; + this._game = game; + } + Flash.prototype.start = /** + * The camera is filled with this color and returns to normal at the given duration. + * + * @param Color The color you want to use in 0xRRGGBB format, i.e. 0xffffff for white. + * @param Duration How long it takes for the flash to fade. + * @param OnComplete An optional function you want to run when the flash finishes. Set to null for no callback. + * @param Force Force an already running flash effect to reset. + */ + function (color, duration, onComplete, force) { + if (typeof color === "undefined") { color = 0xffffff; } + if (typeof duration === "undefined") { duration = 1; } + if (typeof onComplete === "undefined") { onComplete = null; } + if (typeof force === "undefined") { force = false; } + if(force === false && this._fxFlashAlpha > 0) { + // You can't flash again unless you force it + return; + } + if(duration <= 0) { + duration = 1; + } + var red = color >> 16 & 0xFF; + var green = color >> 8 & 0xFF; + var blue = color & 0xFF; + this._fxFlashColor = 'rgba(' + red + ',' + green + ',' + blue + ','; + this._fxFlashDuration = duration; + this._fxFlashAlpha = 1; + this._fxFlashComplete = onComplete; + }; + Flash.prototype.postUpdate = function () { + // Update the Flash effect + if(this._fxFlashAlpha > 0) { + this._fxFlashAlpha -= this._game.time.elapsed / this._fxFlashDuration; + if(this._game.math.roundTo(this._fxFlashAlpha, -2) <= 0) { + this._fxFlashAlpha = 0; + if(this._fxFlashComplete !== null) { + this._fxFlashComplete(); + } + } + } + }; + Flash.prototype.postRender = function (camera, cameraX, cameraY, cameraWidth, cameraHeight) { + if(this._fxFlashAlpha > 0) { + this._game.stage.context.fillStyle = this._fxFlashColor + this._fxFlashAlpha + ')'; + this._game.stage.context.fillRect(cameraX, cameraY, cameraWidth, cameraHeight); + } + }; + return Flash; + })(); + Camera.Flash = Flash; + })(FX.Camera || (FX.Camera = {})); + var Camera = FX.Camera; + })(Phaser.FX || (Phaser.FX = {})); + var FX = Phaser.FX; +})(Phaser || (Phaser = {})); +var Phaser; +(function (Phaser) { + (function (FX) { + /// + /// + /// + /** + * Phaser - FX - Camera - Template + * + * A Template FX file you can use to create your own Camera FX. + * If you don't use any of the methods below (i.e. preUpdate, render, etc) then DELETE THEM to avoid un-necessary calls by the FXManager. + */ + (function (Camera) { + var Template = (function () { + function Template(game, parent) { + this._game = game; + this._parent = parent; + } + Template.prototype.start = /** + * You can name the function that starts the effect whatever you like, but we used 'start' in our effects. + */ + function () { + }; + Template.prototype.preUpdate = /** + * Pre-update is called at the start of the objects update cycle, before any other updates have taken place. + */ + function () { + }; + Template.prototype.postUpdate = /** + * Post-update is called at the end of the objects update cycle, after other update logic has taken place. + */ + function () { + }; + Template.prototype.preRender = /** + * Pre-render is called at the start of the object render cycle, before any transforms have taken place. + * It happens directly AFTER a canvas context.save has happened if added to a Camera. + */ + function (camera, cameraX, cameraY, cameraWidth, cameraHeight) { + }; + Template.prototype.render = /** + * render is called during the objects render cycle, right after all transforms have finished, but before any children/image data is rendered. + */ + function (camera, cameraX, cameraY, cameraWidth, cameraHeight) { + }; + Template.prototype.postRender = /** + * Post-render is called during the objects render cycle, after the children/image data has been rendered. + * It happens directly BEFORE a canvas context.restore has happened if added to a Camera. + */ + function (camera, cameraX, cameraY, cameraWidth, cameraHeight) { + }; + return Template; + })(); + Camera.Template = Template; + })(FX.Camera || (FX.Camera = {})); + var Camera = FX.Camera; + })(Phaser.FX || (Phaser.FX = {})); + var FX = Phaser.FX; +})(Phaser || (Phaser = {})); +var Phaser; +(function (Phaser) { + (function (FX) { + /// + /// + /// + /** + * Phaser - FX - Camera - Scanlines + * + * Give your game that classic retro feel! + */ + (function (Camera) { + var Scanlines = (function () { + function Scanlines(game, parent) { + this.spacing = 4; + this.color = 'rgba(0, 0, 0, 0.3)'; + this._game = game; + this._parent = parent; + } + Scanlines.prototype.postRender = function (camera, cameraX, cameraY, cameraWidth, cameraHeight) { + this._game.stage.context.fillStyle = this.color; + for(var y = cameraY; y < cameraHeight; y += this.spacing) { + this._game.stage.context.fillRect(cameraX, y, cameraWidth, 1); + } + }; + return Scanlines; + })(); + Camera.Scanlines = Scanlines; + })(FX.Camera || (FX.Camera = {})); + var Camera = FX.Camera; + })(Phaser.FX || (Phaser.FX = {})); + var FX = Phaser.FX; +})(Phaser || (Phaser = {})); +var Phaser; +(function (Phaser) { + (function (FX) { + /// + /// + /** + * Phaser - FX - Camera - Shake + * + * A simple camera shake effect. + */ + (function (Camera) { + var Shake = (function () { + function Shake(game, camera) { + this._fxShakeIntensity = 0; + this._fxShakeDuration = 0; + this._fxShakeComplete = null; + this._fxShakeOffset = new Phaser.MicroPoint(0, 0); + this._fxShakeDirection = 0; + this._fxShakePrevX = 0; + this._fxShakePrevY = 0; + this._game = game; + this._parent = camera; + } + Shake.SHAKE_BOTH_AXES = 0; + Shake.SHAKE_HORIZONTAL_ONLY = 1; + Shake.SHAKE_VERTICAL_ONLY = 2; + Shake.prototype.start = /** + * A simple camera shake effect. + * + * @param Intensity Percentage of screen size representing the maximum distance that the screen can move while shaking. + * @param Duration The length in seconds that the shaking effect should last. + * @param OnComplete A function you want to run when the shake effect finishes. + * @param Force Force the effect to reset (default = true, unlike flash() and fade()!). + * @param Direction Whether to shake on both axes, just up and down, or just side to side (use class constants SHAKE_BOTH_AXES, SHAKE_VERTICAL_ONLY, or SHAKE_HORIZONTAL_ONLY). + */ + function (intensity, duration, onComplete, force, direction) { + if (typeof intensity === "undefined") { intensity = 0.05; } + if (typeof duration === "undefined") { duration = 0.5; } + if (typeof onComplete === "undefined") { onComplete = null; } + if (typeof force === "undefined") { force = true; } + if (typeof direction === "undefined") { direction = Shake.SHAKE_BOTH_AXES; } + if(!force && ((this._fxShakeOffset.x != 0) || (this._fxShakeOffset.y != 0))) { + return; + } + // If a shake is not already running we need to store the offsets here + if(this._fxShakeOffset.x == 0 && this._fxShakeOffset.y == 0) { + this._fxShakePrevX = this._parent.x; + this._fxShakePrevY = this._parent.y; + } + this._fxShakeIntensity = intensity; + this._fxShakeDuration = duration; + this._fxShakeComplete = onComplete; + this._fxShakeDirection = direction; + this._fxShakeOffset.setTo(0, 0); + }; + Shake.prototype.postUpdate = function () { + // Update the "shake" special effect + if(this._fxShakeDuration > 0) { + this._fxShakeDuration -= this._game.time.elapsed; + if(this._game.math.roundTo(this._fxShakeDuration, -2) <= 0) { + this._fxShakeDuration = 0; + this._fxShakeOffset.setTo(0, 0); + this._parent.x = this._fxShakePrevX; + this._parent.y = this._fxShakePrevY; + if(this._fxShakeComplete != null) { + this._fxShakeComplete(); + } + } else { + if((this._fxShakeDirection == Shake.SHAKE_BOTH_AXES) || (this._fxShakeDirection == Shake.SHAKE_HORIZONTAL_ONLY)) { + //this._fxShakeOffset.x = ((this._game.math.random() * this._fxShakeIntensity * this.worldView.width * 2 - this._fxShakeIntensity * this.worldView.width) * this._zoom; + this._fxShakeOffset.x = (this._game.math.random() * this._fxShakeIntensity * this._parent.worldView.width * 2 - this._fxShakeIntensity * this._parent.worldView.width); + } + if((this._fxShakeDirection == Shake.SHAKE_BOTH_AXES) || (this._fxShakeDirection == Shake.SHAKE_VERTICAL_ONLY)) { + //this._fxShakeOffset.y = (this._game.math.random() * this._fxShakeIntensity * this.worldView.height * 2 - this._fxShakeIntensity * this.worldView.height) * this._zoom; + this._fxShakeOffset.y = (this._game.math.random() * this._fxShakeIntensity * this._parent.worldView.height * 2 - this._fxShakeIntensity * this._parent.worldView.height); + } + } + } + }; + Shake.prototype.preRender = function (camera, cameraX, cameraY, cameraWidth, cameraHeight) { + if((this._fxShakeOffset.x != 0) || (this._fxShakeOffset.y != 0)) { + this._parent.x = this._fxShakePrevX + this._fxShakeOffset.x; + this._parent.y = this._fxShakePrevY + this._fxShakeOffset.y; + } + }; + return Shake; + })(); + Camera.Shake = Shake; + })(FX.Camera || (FX.Camera = {})); + var Camera = FX.Camera; + })(Phaser.FX || (Phaser.FX = {})); + var FX = Phaser.FX; +})(Phaser || (Phaser = {})); +var Phaser; +(function (Phaser) { + (function (FX) { + /// + /// + /** + * Phaser - FX - Camera - Fade + * + * The camera is filled with the given color and returns to normal at the given duration. + */ + (function (Camera) { + var Fade = (function () { + function Fade(game) { + this._fxFadeComplete = null; + this._fxFadeDuration = 0; + this._fxFadeAlpha = 0; + this._game = game; + } + Fade.prototype.start = /** + * The camera is gradually filled with this color. + * + * @param Color The color you want to use in 0xRRGGBB format, i.e. 0xffffff for white. + * @param Duration How long it takes for the flash to fade. + * @param OnComplete An optional function you want to run when the flash finishes. Set to null for no callback. + * @param Force Force an already running flash effect to reset. + */ + function (color, duration, onComplete, force) { + if (typeof color === "undefined") { color = 0x000000; } + if (typeof duration === "undefined") { duration = 1; } + if (typeof onComplete === "undefined") { onComplete = null; } + if (typeof force === "undefined") { force = false; } + if(force === false && this._fxFadeAlpha > 0) { + // You can't fade again unless you force it + return; + } + if(duration <= 0) { + duration = 1; + } + var red = color >> 16 & 0xFF; + var green = color >> 8 & 0xFF; + var blue = color & 0xFF; + this._fxFadeColor = 'rgba(' + red + ',' + green + ',' + blue + ','; + this._fxFadeDuration = duration; + this._fxFadeAlpha = 0.01; + this._fxFadeComplete = onComplete; + }; + Fade.prototype.postUpdate = function () { + // Update the Fade effect + if(this._fxFadeAlpha > 0) { + this._fxFadeAlpha += this._game.time.elapsed / this._fxFadeDuration; + if(this._game.math.roundTo(this._fxFadeAlpha, -2) >= 1) { + this._fxFadeAlpha = 1; + if(this._fxFadeComplete !== null) { + this._fxFadeComplete(); + } + } + } + }; + Fade.prototype.postRender = function (camera, cameraX, cameraY, cameraWidth, cameraHeight) { + // "Fade" FX + if(this._fxFadeAlpha > 0) { + this._game.stage.context.fillStyle = this._fxFadeColor + this._fxFadeAlpha + ')'; + this._game.stage.context.fillRect(cameraX, cameraY, cameraWidth, cameraHeight); + } + }; + return Fade; + })(); + Camera.Fade = Fade; + })(FX.Camera || (FX.Camera = {})); + var Camera = FX.Camera; + })(Phaser.FX || (Phaser.FX = {})); + var FX = Phaser.FX; +})(Phaser || (Phaser = {})); diff --git a/Tests/phaser.js b/Tests/phaser.js index 76b5a1d4..59fe8d15 100644 --- a/Tests/phaser.js +++ b/Tests/phaser.js @@ -920,19 +920,6 @@ var Phaser; this._target = null; this._sx = 0; this._sy = 0; - this._fxFlashComplete = null; - this._fxFlashDuration = 0; - this._fxFlashAlpha = 0; - this._fxFadeComplete = null; - this._fxFadeDuration = 0; - this._fxFadeAlpha = 0; - this._fxShakeIntensity = 0; - this._fxShakeDuration = 0; - this._fxShakeComplete = null; - this._fxShakeOffset = new Phaser.MicroPoint(0, 0); - this._fxShakeDirection = 0; - this._fxShakePrevX = 0; - this._fxShakePrevY = 0; this.scale = new Phaser.MicroPoint(1, 1); this.scroll = new Phaser.MicroPoint(0, 0); this.bounds = null; @@ -958,6 +945,7 @@ var Phaser; this.ID = id; this._stageX = x; this._stageY = y; + this.fx = new Phaser.FXManager(this._game, this); // The view into the world canvas we wish to render this.worldView = new Phaser.Rectangle(0, 0, width, height); this.checkClip(); @@ -966,107 +954,6 @@ var Phaser; Camera.STYLE_PLATFORMER = 1; Camera.STYLE_TOPDOWN = 2; Camera.STYLE_TOPDOWN_TIGHT = 3; - Camera.SHAKE_BOTH_AXES = 0; - Camera.SHAKE_HORIZONTAL_ONLY = 1; - Camera.SHAKE_VERTICAL_ONLY = 2; - Camera.prototype.flash = /** - * The camera is filled with this color and returns to normal at the given duration. - * - * @param Color The color you want to use in 0xRRGGBB format, i.e. 0xffffff for white. - * @param Duration How long it takes for the flash to fade. - * @param OnComplete An optional function you want to run when the flash finishes. Set to null for no callback. - * @param Force Force an already running flash effect to reset. - */ - function (color, duration, onComplete, force) { - if (typeof color === "undefined") { color = 0xffffff; } - if (typeof duration === "undefined") { duration = 1; } - if (typeof onComplete === "undefined") { onComplete = null; } - if (typeof force === "undefined") { force = false; } - if(force === false && this._fxFlashAlpha > 0) { - // You can't flash again unless you force it - return; - } - if(duration <= 0) { - duration = 1; - } - var red = color >> 16 & 0xFF; - var green = color >> 8 & 0xFF; - var blue = color & 0xFF; - this._fxFlashColor = 'rgba(' + red + ',' + green + ',' + blue + ','; - this._fxFlashDuration = duration; - this._fxFlashAlpha = 1; - this._fxFlashComplete = onComplete; - }; - Camera.prototype.fade = /** - * The camera is gradually filled with this color. - * - * @param Color The color you want to use in 0xRRGGBB format, i.e. 0xffffff for white. - * @param Duration How long it takes for the flash to fade. - * @param OnComplete An optional function you want to run when the flash finishes. Set to null for no callback. - * @param Force Force an already running flash effect to reset. - */ - function (color, duration, onComplete, force) { - if (typeof color === "undefined") { color = 0x000000; } - if (typeof duration === "undefined") { duration = 1; } - if (typeof onComplete === "undefined") { onComplete = null; } - if (typeof force === "undefined") { force = false; } - if(force === false && this._fxFadeAlpha > 0) { - // You can't fade again unless you force it - return; - } - if(duration <= 0) { - duration = 1; - } - var red = color >> 16 & 0xFF; - var green = color >> 8 & 0xFF; - var blue = color & 0xFF; - this._fxFadeColor = 'rgba(' + red + ',' + green + ',' + blue + ','; - this._fxFadeDuration = duration; - this._fxFadeAlpha = 0.01; - this._fxFadeComplete = onComplete; - }; - Camera.prototype.shake = /** - * A simple screen-shake effect. - * - * @param Intensity Percentage of screen size representing the maximum distance that the screen can move while shaking. - * @param Duration The length in seconds that the shaking effect should last. - * @param OnComplete A function you want to run when the shake effect finishes. - * @param Force Force the effect to reset (default = true, unlike flash() and fade()!). - * @param Direction Whether to shake on both axes, just up and down, or just side to side (use class constants SHAKE_BOTH_AXES, SHAKE_VERTICAL_ONLY, or SHAKE_HORIZONTAL_ONLY). - */ - function (intensity, duration, onComplete, force, direction) { - if (typeof intensity === "undefined") { intensity = 0.05; } - if (typeof duration === "undefined") { duration = 0.5; } - if (typeof onComplete === "undefined") { onComplete = null; } - if (typeof force === "undefined") { force = true; } - if (typeof direction === "undefined") { direction = Camera.SHAKE_BOTH_AXES; } - if(!force && ((this._fxShakeOffset.x != 0) || (this._fxShakeOffset.y != 0))) { - return; - } - // If a shake is not already running we need to store the offsets here - if(this._fxShakeOffset.x == 0 && this._fxShakeOffset.y == 0) { - this._fxShakePrevX = this._stageX; - this._fxShakePrevY = this._stageY; - } - this._fxShakeIntensity = intensity; - this._fxShakeDuration = duration; - this._fxShakeComplete = onComplete; - this._fxShakeDirection = direction; - this._fxShakeOffset.setTo(0, 0); - }; - Camera.prototype.stopFX = /** - * Just turns off all the camera effects instantly. - */ - function () { - this._fxFlashAlpha = 0; - this._fxFadeAlpha = 0; - if(this._fxShakeDuration !== 0) { - this._fxShakeDuration = 0; - this._fxShakeOffset.setTo(0, 0); - this._stageX = this._fxShakePrevX; - this._stageY = this._fxShakePrevY; - } - }; Camera.prototype.follow = function (target, style) { if (typeof style === "undefined") { style = Camera.STYLE_LOCKON; } this._target = target; @@ -1124,6 +1011,7 @@ var Phaser; this.update(); }; Camera.prototype.update = function () { + this.fx.preUpdate(); if(this._target !== null) { if(this.deadzone == null) { this.focusOnXY(this._target.x + this._target.origin.x, this._target.y + this._target.origin.y); @@ -1166,73 +1054,22 @@ var Phaser; } this.worldView.x = this.scroll.x; this.worldView.y = this.scroll.y; - //console.log(this.worldView.width, this.worldView.height); // Input values this.inputX = this.worldView.x + this._game.input.x; this.inputY = this.worldView.y + this._game.input.y; - // Update the Flash effect - if(this._fxFlashAlpha > 0) { - this._fxFlashAlpha -= this._game.time.elapsed / this._fxFlashDuration; - this._fxFlashAlpha = this._game.math.roundTo(this._fxFlashAlpha, -2); - if(this._fxFlashAlpha <= 0) { - this._fxFlashAlpha = 0; - if(this._fxFlashComplete !== null) { - this._fxFlashComplete(); - } - } - } - // Update the Fade effect - if(this._fxFadeAlpha > 0) { - this._fxFadeAlpha += this._game.time.elapsed / this._fxFadeDuration; - this._fxFadeAlpha = this._game.math.roundTo(this._fxFadeAlpha, -2); - if(this._fxFadeAlpha >= 1) { - this._fxFadeAlpha = 1; - if(this._fxFadeComplete !== null) { - this._fxFadeComplete(); - } - } - } - // Update the "shake" special effect - if(this._fxShakeDuration > 0) { - this._fxShakeDuration -= this._game.time.elapsed; - this._fxShakeDuration = this._game.math.roundTo(this._fxShakeDuration, -2); - if(this._fxShakeDuration <= 0) { - this._fxShakeDuration = 0; - this._fxShakeOffset.setTo(0, 0); - this._stageX = this._fxShakePrevX; - this._stageY = this._fxShakePrevY; - if(this._fxShakeComplete != null) { - this._fxShakeComplete(); - } - } else { - if((this._fxShakeDirection == Camera.SHAKE_BOTH_AXES) || (this._fxShakeDirection == Camera.SHAKE_HORIZONTAL_ONLY)) { - //this._fxShakeOffset.x = ((this._game.math.random() * this._fxShakeIntensity * this.worldView.width * 2 - this._fxShakeIntensity * this.worldView.width) * this._zoom; - this._fxShakeOffset.x = (this._game.math.random() * this._fxShakeIntensity * this.worldView.width * 2 - this._fxShakeIntensity * this.worldView.width); - } - if((this._fxShakeDirection == Camera.SHAKE_BOTH_AXES) || (this._fxShakeDirection == Camera.SHAKE_VERTICAL_ONLY)) { - //this._fxShakeOffset.y = (this._game.math.random() * this._fxShakeIntensity * this.worldView.height * 2 - this._fxShakeIntensity * this.worldView.height) * this._zoom; - this._fxShakeOffset.y = (this._game.math.random() * this._fxShakeIntensity * this.worldView.height * 2 - this._fxShakeIntensity * this.worldView.height); - } - } - } + this.fx.postUpdate(); }; Camera.prototype.render = function () { if(this.visible === false || this.alpha < 0.1) { return; } - if((this._fxShakeOffset.x != 0) || (this._fxShakeOffset.y != 0)) { - //this._stageX = this._fxShakePrevX + (this.worldView.halfWidth * this._zoom) + this._fxShakeOffset.x; - //this._stageY = this._fxShakePrevY + (this.worldView.halfHeight * this._zoom) + this._fxShakeOffset.y; - this._stageX = this._fxShakePrevX + (this.worldView.halfWidth) + this._fxShakeOffset.x; - this._stageY = this._fxShakePrevY + (this.worldView.halfHeight) + this._fxShakeOffset.y; - //console.log('shake', this._fxShakeDuration, this._fxShakeIntensity, this._fxShakeOffset.x, this._fxShakeOffset.y); - } //if (this._rotation !== 0 || this._clip || this.scale.x !== 1 || this.scale.y !== 1) //{ //this._game.stage.context.save(); //} - // It may be safe/quicker to just save the context every frame regardless + // It may be safer/quicker to just save the context every frame regardless (needs testing on mobile) this._game.stage.context.save(); + this.fx.preRender(this, this._stageX, this._stageY, this.worldView.width, this.worldView.height); if(this.alpha !== 1) { this._game.stage.context.globalAlpha = this.alpha; } @@ -1274,6 +1111,7 @@ var Phaser; this._game.stage.context.shadowOffsetX = 0; this._game.stage.context.shadowOffsetY = 0; } + this.fx.render(this, this._stageX, this._stageY, this.worldView.width, this.worldView.height); // Clip the camera so we don't get sprites appearing outside the edges if(this._clip) { this._game.stage.context.beginPath(); @@ -1288,24 +1126,14 @@ var Phaser; this._game.stage.context.rect(this._sx, this._sy, this.worldView.width, this.worldView.height); this._game.stage.context.stroke(); } - // "Flash" FX - if(this._fxFlashAlpha > 0) { - this._game.stage.context.fillStyle = this._fxFlashColor + this._fxFlashAlpha + ')'; - this._game.stage.context.fillRect(this._sx, this._sy, this.worldView.width, this.worldView.height); - } - // "Fade" FX - if(this._fxFadeAlpha > 0) { - this._game.stage.context.fillStyle = this._fxFadeColor + this._fxFadeAlpha + ')'; - this._game.stage.context.fillRect(this._sx, this._sy, this.worldView.width, this.worldView.height); - } // Scale off if(this.scale.x !== 1 || this.scale.y !== 1) { this._game.stage.context.scale(1, 1); } + this.fx.postRender(this, this._sx, this._sy, this.worldView.width, this.worldView.height); if(this._rotation !== 0 || this._clip) { this._game.stage.context.translate(0, 0); } - // maybe just do this every frame regardless? this._game.stage.context.restore(); if(this.alpha !== 1) { this._game.stage.context.globalAlpha = 1; @@ -1335,8 +1163,7 @@ var Phaser; this.worldView.width = width; this.worldView.height = height; this.checkClip(); - //console.log('Camera setSize', width, height); - }; + }; Camera.prototype.renderDebugInfo = function (x, y, color) { if (typeof color === "undefined") { color = 'rgb(255,255,255)'; } this._game.stage.context.fillStyle = color; @@ -7626,7 +7453,7 @@ var Phaser; * * Richard Davey (@photonstorm) * -* Many thanks to Adam Saltsman (@ADAMATOMIC) for the original Flixel AS3 code on which Phaser is based. +* Many thanks to Adam Saltsman (@ADAMATOMIC) for releasing Flixel on which Phaser took a lot of inspiration. * * "If you want your children to be intelligent, read them fairy tales." * "If you want them to be more intelligent, read them more fairy tales." @@ -11750,12 +11577,261 @@ var Phaser; // Delete tiles of certain type // Erase tiles })(Phaser || (Phaser = {})); +/// +/// +/** +* Phaser - ScrollRegion +* +* Creates a scrolling region within a ScrollZone. +* It is scrolled via the scrollSpeed.x/y properties. +*/ +var Phaser; +(function (Phaser) { + var ScrollRegion = (function () { + function ScrollRegion(x, y, width, height, speedX, speedY) { + this._anchorWidth = 0; + this._anchorHeight = 0; + this._inverseWidth = 0; + this._inverseHeight = 0; + this.visible = true; + // Our seamless scrolling quads + this._A = new Phaser.Quad(x, y, width, height); + this._B = new Phaser.Quad(x, y, width, height); + this._C = new Phaser.Quad(x, y, width, height); + this._D = new Phaser.Quad(x, y, width, height); + this._scroll = new Phaser.MicroPoint(); + this._bounds = new Phaser.Quad(x, y, width, height); + this.scrollSpeed = new Phaser.MicroPoint(speedX, speedY); + } + ScrollRegion.prototype.update = function (delta) { + this._scroll.x += this.scrollSpeed.x; + this._scroll.y += this.scrollSpeed.y; + if(this._scroll.x > this._bounds.right) { + this._scroll.x = this._bounds.x; + } + if(this._scroll.x < this._bounds.x) { + this._scroll.x = this._bounds.right; + } + if(this._scroll.y > this._bounds.bottom) { + this._scroll.y = this._bounds.y; + } + if(this._scroll.y < this._bounds.y) { + this._scroll.y = this._bounds.bottom; + } + // Anchor Dimensions + this._anchorWidth = (this._bounds.width - this._scroll.x) + this._bounds.x; + this._anchorHeight = (this._bounds.height - this._scroll.y) + this._bounds.y; + if(this._anchorWidth > this._bounds.width) { + this._anchorWidth = this._bounds.width; + } + if(this._anchorHeight > this._bounds.height) { + this._anchorHeight = this._bounds.height; + } + this._inverseWidth = this._bounds.width - this._anchorWidth; + this._inverseHeight = this._bounds.height - this._anchorHeight; + // Quad A + this._A.setTo(this._scroll.x, this._scroll.y, this._anchorWidth, this._anchorHeight); + // Quad B + this._B.y = this._scroll.y; + this._B.width = this._inverseWidth; + this._B.height = this._anchorHeight; + // Quad C + this._C.x = this._scroll.x; + this._C.width = this._anchorWidth; + this._C.height = this._inverseHeight; + // Quad D + this._D.width = this._inverseWidth; + this._D.height = this._inverseHeight; + }; + ScrollRegion.prototype.render = function (context, texture, dx, dy, dw, dh) { + if(this.visible == false) { + return; + } + // dx/dy are the world coordinates to render the FULL ScrollZone into. + // This ScrollRegion may be smaller than that and offset from the dx/dy coordinates. + this.crop(context, texture, this._A.x, this._A.y, this._A.width, this._A.height, dx, dy, dw, dh, 0, 0); + this.crop(context, texture, this._B.x, this._B.y, this._B.width, this._B.height, dx, dy, dw, dh, this._A.width, 0); + this.crop(context, texture, this._C.x, this._C.y, this._C.width, this._C.height, dx, dy, dw, dh, 0, this._A.height); + this.crop(context, texture, this._D.x, this._D.y, this._D.width, this._D.height, dx, dy, dw, dh, this._C.width, this._A.height); + //context.fillStyle = 'rgb(255,255,255)'; + //context.font = '18px Arial'; + //context.fillText('QuadA: ' + this._A.toString(), 32, 450); + //context.fillText('QuadB: ' + this._B.toString(), 32, 480); + //context.fillText('QuadC: ' + this._C.toString(), 32, 510); + //context.fillText('QuadD: ' + this._D.toString(), 32, 540); + }; + ScrollRegion.prototype.crop = function (context, texture, srcX, srcY, srcW, srcH, destX, destY, destW, destH, offsetX, offsetY) { + offsetX += destX; + offsetY += destY; + if(srcW > (destX + destW) - offsetX) { + srcW = (destX + destW) - offsetX; + } + if(srcH > (destY + destH) - offsetY) { + srcH = (destY + destH) - offsetY; + } + srcX = Math.floor(srcX); + srcY = Math.floor(srcY); + srcW = Math.floor(srcW); + srcH = Math.floor(srcH); + offsetX = Math.floor(offsetX + this._bounds.x); + offsetY = Math.floor(offsetY + this._bounds.y); + if(srcW > 0 && srcH > 0) { + context.drawImage(texture, srcX, srcY, srcW, srcH, offsetX, offsetY, srcW, srcH); + } + }; + return ScrollRegion; + })(); + Phaser.ScrollRegion = ScrollRegion; +})(Phaser || (Phaser = {})); +/// +/// +/// +/** +* Phaser - ScrollZone +* +* Creates a scrolling region of the given width and height from an image in the cache. +* The ScrollZone can be positioned anywhere in-world like a normal game object, re-act to physics, collision, etc. +* The image within it is scrolled via ScrollRegions and their scrollSpeed.x/y properties. +* If you create a scroll zone larger than the given source image it will create a DynamicTexture and fill it with a pattern of the source image. +*/ +var Phaser; +(function (Phaser) { + var ScrollZone = (function (_super) { + __extends(ScrollZone, _super); + function ScrollZone(game, key, x, y, width, height) { + if (typeof x === "undefined") { x = 0; } + if (typeof y === "undefined") { y = 0; } + if (typeof width === "undefined") { width = 0; } + if (typeof height === "undefined") { height = 0; } + _super.call(this, game, x, y, width, height); + this._dynamicTexture = null; + // local rendering related temp vars to help avoid gc spikes + this._dx = 0; + this._dy = 0; + this._dw = 0; + this._dh = 0; + this.flipped = false; + this.regions = []; + if(this._game.cache.getImage(key)) { + this._texture = this._game.cache.getImage(key); + this.width = this._texture.width; + this.height = this._texture.height; + if(width > this._texture.width || height > this._texture.height) { + // Create our repeating texture (as the source image wasn't large enough for the requested size) + this.createRepeatingTexture(width, height); + this.width = width; + this.height = height; + } + // Create a default ScrollRegion at the requested size + this.addRegion(0, 0, this.width, this.height); + // If the zone is smaller than the image itself then shrink the bounds + if((width < this._texture.width || height < this._texture.height) && width !== 0 && height !== 0) { + this.width = width; + this.height = height; + } + } + } + ScrollZone.prototype.addRegion = function (x, y, width, height, speedX, speedY) { + if (typeof speedX === "undefined") { speedX = 0; } + if (typeof speedY === "undefined") { speedY = 0; } + if(x > this.width || y > this.height || x < 0 || y < 0 || (x + width) > this.width || (y + height) > this.height) { + throw Error('Invalid ScrollRegion defined. Cannot be larger than parent ScrollZone'); + return; + } + this.currentRegion = new Phaser.ScrollRegion(x, y, width, height, speedX, speedY); + this.regions.push(this.currentRegion); + return this.currentRegion; + }; + ScrollZone.prototype.setSpeed = function (x, y) { + if(this.currentRegion) { + this.currentRegion.scrollSpeed.setTo(x, y); + } + return this; + }; + ScrollZone.prototype.update = function () { + for(var i = 0; i < this.regions.length; i++) { + this.regions[i].update(this._game.time.delta); + } + }; + ScrollZone.prototype.inCamera = function (camera) { + if(this.scrollFactor.x !== 1.0 || this.scrollFactor.y !== 1.0) { + this._dx = this.bounds.x - (camera.x * this.scrollFactor.x); + this._dy = this.bounds.y - (camera.y * this.scrollFactor.x); + this._dw = this.bounds.width * this.scale.x; + this._dh = this.bounds.height * this.scale.y; + return (camera.right > this._dx) && (camera.x < this._dx + this._dw) && (camera.bottom > this._dy) && (camera.y < this._dy + this._dh); + } else { + return camera.intersects(this.bounds, this.bounds.length); + } + }; + ScrollZone.prototype.render = function (camera, cameraOffsetX, cameraOffsetY) { + // Render checks + if(this.visible == false || this.scale.x == 0 || this.scale.y == 0 || this.alpha < 0.1 || this.cameraBlacklist.indexOf(camera.ID) !== -1 || this.inCamera(camera.worldView) == false) { + return false; + } + // Alpha + if(this.alpha !== 1) { + var globalAlpha = this._game.stage.context.globalAlpha; + this._game.stage.context.globalAlpha = this.alpha; + } + this._dx = cameraOffsetX + (this.bounds.topLeft.x - camera.worldView.x); + this._dy = cameraOffsetY + (this.bounds.topLeft.y - camera.worldView.y); + this._dw = this.bounds.width * this.scale.x; + this._dh = this.bounds.height * this.scale.y; + // Apply camera difference + if(this.scrollFactor.x !== 1.0 || this.scrollFactor.y !== 1.0) { + this._dx -= (camera.worldView.x * this.scrollFactor.x); + this._dy -= (camera.worldView.y * this.scrollFactor.y); + } + // Rotation - needs to work from origin point really, but for now from center + if(this.angle !== 0 || this.flipped == true) { + this._game.stage.context.save(); + this._game.stage.context.translate(this._dx + (this._dw / 2), this._dy + (this._dh / 2)); + if(this.angle !== 0) { + this._game.stage.context.rotate(this.angle * (Math.PI / 180)); + } + this._dx = -(this._dw / 2); + this._dy = -(this._dh / 2); + if(this.flipped == true) { + this._game.stage.context.scale(-1, 1); + } + } + this._dx = Math.round(this._dx); + this._dy = Math.round(this._dy); + this._dw = Math.round(this._dw); + this._dh = Math.round(this._dh); + for(var i = 0; i < this.regions.length; i++) { + if(this._dynamicTexture) { + this.regions[i].render(this._game.stage.context, this._dynamicTexture.canvas, this._dx, this._dy, this._dw, this._dh); + } else { + this.regions[i].render(this._game.stage.context, this._texture, this._dx, this._dy, this._dw, this._dh); + } + } + if(globalAlpha > -1) { + this._game.stage.context.globalAlpha = globalAlpha; + } + return true; + }; + ScrollZone.prototype.createRepeatingTexture = function (regionWidth, regionHeight) { + // Work out how many we'll need of the source image to make it tile properly + var tileWidth = Math.ceil(this._texture.width / regionWidth) * regionWidth; + var tileHeight = Math.ceil(this._texture.height / regionHeight) * regionHeight; + this._dynamicTexture = new Phaser.DynamicTexture(this._game, tileWidth, tileHeight); + this._dynamicTexture.context.rect(0, 0, tileWidth, tileHeight); + this._dynamicTexture.context.fillStyle = this._dynamicTexture.context.createPattern(this._texture, "repeat"); + this._dynamicTexture.context.fill(); + }; + return ScrollZone; + })(Phaser.GameObject); + Phaser.ScrollZone = ScrollZone; +})(Phaser || (Phaser = {})); /// /// /// /// /// /// +/// /// /// /// @@ -12104,253 +12180,143 @@ var Phaser; })(); Phaser.Game = Game; })(Phaser || (Phaser = {})); -/// -/// +/// /** -* Phaser - ScrollRegion +* Phaser - FXManager * -* Creates a scrolling region within a ScrollZone. -* It is scrolled via the scrollSpeed.x/y properties. +* The FXManager controls all special effects applied to game objects such as Cameras. */ var Phaser; (function (Phaser) { - var ScrollRegion = (function () { - function ScrollRegion(x, y, width, height, speedX, speedY) { - this._anchorWidth = 0; - this._anchorHeight = 0; - this._inverseWidth = 0; - this._inverseHeight = 0; + var FXManager = (function () { + function FXManager(game, parent) { + this._game = game; + this._parent = parent; + this._fx = []; + this.active = true; this.visible = true; - // Our seamless scrolling quads - this._A = new Phaser.Quad(x, y, width, height); - this._B = new Phaser.Quad(x, y, width, height); - this._C = new Phaser.Quad(x, y, width, height); - this._D = new Phaser.Quad(x, y, width, height); - this._scroll = new Phaser.MicroPoint(); - this._bounds = new Phaser.Quad(x, y, width, height); - this.scrollSpeed = new Phaser.MicroPoint(speedX, speedY); } - ScrollRegion.prototype.update = function (delta) { - this._scroll.x += this.scrollSpeed.x; - this._scroll.y += this.scrollSpeed.y; - if(this._scroll.x > this._bounds.right) { - this._scroll.x = this._bounds.x; - } - if(this._scroll.x < this._bounds.x) { - this._scroll.x = this._bounds.right; - } - if(this._scroll.y > this._bounds.bottom) { - this._scroll.y = this._bounds.y; - } - if(this._scroll.y < this._bounds.y) { - this._scroll.y = this._bounds.bottom; - } - // Anchor Dimensions - this._anchorWidth = (this._bounds.width - this._scroll.x) + this._bounds.x; - this._anchorHeight = (this._bounds.height - this._scroll.y) + this._bounds.y; - if(this._anchorWidth > this._bounds.width) { - this._anchorWidth = this._bounds.width; - } - if(this._anchorHeight > this._bounds.height) { - this._anchorHeight = this._bounds.height; - } - this._inverseWidth = this._bounds.width - this._anchorWidth; - this._inverseHeight = this._bounds.height - this._anchorHeight; - // Quad A - this._A.setTo(this._scroll.x, this._scroll.y, this._anchorWidth, this._anchorHeight); - // Quad B - this._B.y = this._scroll.y; - this._B.width = this._inverseWidth; - this._B.height = this._anchorHeight; - // Quad C - this._C.x = this._scroll.x; - this._C.width = this._anchorWidth; - this._C.height = this._inverseHeight; - // Quad D - this._D.width = this._inverseWidth; - this._D.height = this._inverseHeight; - }; - ScrollRegion.prototype.render = function (context, texture, dx, dy, dw, dh) { - if(this.visible == false) { - return; - } - // dx/dy are the world coordinates to render the FULL ScrollZone into. - // This ScrollRegion may be smaller than that and offset from the dx/dy coordinates. - this.crop(context, texture, this._A.x, this._A.y, this._A.width, this._A.height, dx, dy, dw, dh, 0, 0); - this.crop(context, texture, this._B.x, this._B.y, this._B.width, this._B.height, dx, dy, dw, dh, this._A.width, 0); - this.crop(context, texture, this._C.x, this._C.y, this._C.width, this._C.height, dx, dy, dw, dh, 0, this._A.height); - this.crop(context, texture, this._D.x, this._D.y, this._D.width, this._D.height, dx, dy, dw, dh, this._C.width, this._A.height); - //context.fillStyle = 'rgb(255,255,255)'; - //context.font = '18px Arial'; - //context.fillText('QuadA: ' + this._A.toString(), 32, 450); - //context.fillText('QuadB: ' + this._B.toString(), 32, 480); - //context.fillText('QuadC: ' + this._C.toString(), 32, 510); - //context.fillText('QuadD: ' + this._D.toString(), 32, 540); - }; - ScrollRegion.prototype.crop = function (context, texture, srcX, srcY, srcW, srcH, destX, destY, destW, destH, offsetX, offsetY) { - offsetX += destX; - offsetY += destY; - if(srcW > (destX + destW) - offsetX) { - srcW = (destX + destW) - offsetX; - } - if(srcH > (destY + destH) - offsetY) { - srcH = (destY + destH) - offsetY; - } - srcX = Math.floor(srcX); - srcY = Math.floor(srcY); - srcW = Math.floor(srcW); - srcH = Math.floor(srcH); - offsetX = Math.floor(offsetX + this._bounds.x); - offsetY = Math.floor(offsetY + this._bounds.y); - if(srcW > 0 && srcH > 0) { - context.drawImage(texture, srcX, srcY, srcW, srcH, offsetX, offsetY, srcW, srcH); - } - }; - return ScrollRegion; - })(); - Phaser.ScrollRegion = ScrollRegion; -})(Phaser || (Phaser = {})); -/// -/// -/// -/** -* Phaser - ScrollZone -* -* Creates a scrolling region of the given width and height from an image in the cache. -* The ScrollZone can be positioned anywhere in-world like a normal game object, re-act to physics, collision, etc. -* The image within it is scrolled via ScrollRegions and their scrollSpeed.x/y properties. -* If you create a scroll zone larger than the given source image it will create a DynamicTexture and fill it with a pattern of the source image. -*/ -var Phaser; -(function (Phaser) { - var ScrollZone = (function (_super) { - __extends(ScrollZone, _super); - function ScrollZone(game, key, x, y, width, height) { - if (typeof x === "undefined") { x = 0; } - if (typeof y === "undefined") { y = 0; } - if (typeof width === "undefined") { width = 0; } - if (typeof height === "undefined") { height = 0; } - _super.call(this, game, x, y, width, height); - this._dynamicTexture = null; - // local rendering related temp vars to help avoid gc spikes - this._dx = 0; - this._dy = 0; - this._dw = 0; - this._dh = 0; - this.flipped = false; - this.regions = []; - if(this._game.cache.getImage(key)) { - this._texture = this._game.cache.getImage(key); - this.width = this._texture.width; - this.height = this._texture.height; - if(width > this._texture.width || height > this._texture.height) { - // Create our repeating texture (as the source image wasn't large enough for the requested size) - this.createRepeatingTexture(width, height); - this.width = width; - this.height = height; - } - // Create a default ScrollRegion at the requested size - this.addRegion(0, 0, this.width, this.height); - // If the zone is smaller than the image itself then shrink the bounds - if((width < this._texture.width || height < this._texture.height) && width !== 0 && height !== 0) { - this.width = width; - this.height = height; - } - } - } - ScrollZone.prototype.addRegion = function (x, y, width, height, speedX, speedY) { - if (typeof speedX === "undefined") { speedX = 0; } - if (typeof speedY === "undefined") { speedY = 0; } - if(x > this.width || y > this.height || x < 0 || y < 0 || (x + width) > this.width || (y + height) > this.height) { - throw Error('Invalid ScrollRegion defined. Cannot be larger than parent ScrollZone'); - return; - } - this.currentRegion = new Phaser.ScrollRegion(x, y, width, height, speedX, speedY); - this.regions.push(this.currentRegion); - return this.currentRegion; - }; - ScrollZone.prototype.setSpeed = function (x, y) { - if(this.currentRegion) { - this.currentRegion.scrollSpeed.setTo(x, y); - } - return this; - }; - ScrollZone.prototype.update = function () { - for(var i = 0; i < this.regions.length; i++) { - this.regions[i].update(this._game.time.delta); - } - }; - ScrollZone.prototype.inCamera = function (camera) { - if(this.scrollFactor.x !== 1.0 || this.scrollFactor.y !== 1.0) { - this._dx = this.bounds.x - (camera.x * this.scrollFactor.x); - this._dy = this.bounds.y - (camera.y * this.scrollFactor.x); - this._dw = this.bounds.width * this.scale.x; - this._dh = this.bounds.height * this.scale.y; - return (camera.right > this._dx) && (camera.x < this._dx + this._dw) && (camera.bottom > this._dy) && (camera.y < this._dy + this._dh); + FXManager.prototype.add = /** + * Adds a new FX to the FXManager. + * The effect must be an object with at least one of the following methods: preUpdate, postUpdate, preRender, render or postRender. + * A new instance of the effect will be created and a reference to Game will be passed to the object constructor. + */ + function (effect) { + var result = false; + var newEffect = { + effect: { + }, + preUpdate: false, + postUpdate: false, + preRender: false, + render: false, + postRender: false + }; + if(typeof effect === 'function') { + newEffect.effect = new effect(this._game, this._parent); } else { - return camera.intersects(this.bounds, this.bounds.length); + throw new Error("Invalid object given to Phaser.FXManager.add"); + } + // Check for methods now to avoid having to do this every loop + if(typeof newEffect.effect['preUpdate'] === 'function') { + newEffect.preUpdate = true; + result = true; + } + if(typeof newEffect.effect['postUpdate'] === 'function') { + newEffect.postUpdate = true; + result = true; + } + if(typeof newEffect.effect['preRender'] === 'function') { + newEffect.preRender = true; + result = true; + } + if(typeof newEffect.effect['render'] === 'function') { + newEffect.render = true; + result = true; + } + if(typeof newEffect.effect['postRender'] === 'function') { + newEffect.postRender = true; + result = true; + } + if(result == true) { + this._length = this._fx.push(newEffect); + return newEffect.effect; + } else { + return result; } }; - ScrollZone.prototype.render = function (camera, cameraOffsetX, cameraOffsetY) { - // Render checks - if(this.visible == false || this.scale.x == 0 || this.scale.y == 0 || this.alpha < 0.1 || this.cameraBlacklist.indexOf(camera.ID) !== -1 || this.inCamera(camera.worldView) == false) { - return false; - } - // Alpha - if(this.alpha !== 1) { - var globalAlpha = this._game.stage.context.globalAlpha; - this._game.stage.context.globalAlpha = this.alpha; - } - this._dx = cameraOffsetX + (this.bounds.topLeft.x - camera.worldView.x); - this._dy = cameraOffsetY + (this.bounds.topLeft.y - camera.worldView.y); - this._dw = this.bounds.width * this.scale.x; - this._dh = this.bounds.height * this.scale.y; - // Apply camera difference - if(this.scrollFactor.x !== 1.0 || this.scrollFactor.y !== 1.0) { - this._dx -= (camera.worldView.x * this.scrollFactor.x); - this._dy -= (camera.worldView.y * this.scrollFactor.y); - } - // Rotation - needs to work from origin point really, but for now from center - if(this.angle !== 0 || this.flipped == true) { - this._game.stage.context.save(); - this._game.stage.context.translate(this._dx + (this._dw / 2), this._dy + (this._dh / 2)); - if(this.angle !== 0) { - this._game.stage.context.rotate(this.angle * (Math.PI / 180)); - } - this._dx = -(this._dw / 2); - this._dy = -(this._dh / 2); - if(this.flipped == true) { - this._game.stage.context.scale(-1, 1); + FXManager.prototype.preUpdate = /** + * Pre-update is called at the start of the objects update cycle, before any other updates have taken place. + */ + function () { + if(this.active) { + for(var i = 0; i < this._length; i++) { + if(this._fx[i].preUpdate) { + this._fx[i].effect.preUpdate(); + } } } - this._dx = Math.round(this._dx); - this._dy = Math.round(this._dy); - this._dw = Math.round(this._dw); - this._dh = Math.round(this._dh); - for(var i = 0; i < this.regions.length; i++) { - if(this._dynamicTexture) { - this.regions[i].render(this._game.stage.context, this._dynamicTexture.canvas, this._dx, this._dy, this._dw, this._dh); - } else { - this.regions[i].render(this._game.stage.context, this._texture, this._dx, this._dy, this._dw, this._dh); - } - } - if(globalAlpha > -1) { - this._game.stage.context.globalAlpha = globalAlpha; - } - return true; }; - ScrollZone.prototype.createRepeatingTexture = function (regionWidth, regionHeight) { - // Work out how many we'll need of the source image to make it tile properly - var tileWidth = Math.ceil(this._texture.width / regionWidth) * regionWidth; - var tileHeight = Math.ceil(this._texture.height / regionHeight) * regionHeight; - this._dynamicTexture = new Phaser.DynamicTexture(this._game, tileWidth, tileHeight); - this._dynamicTexture.context.rect(0, 0, tileWidth, tileHeight); - this._dynamicTexture.context.fillStyle = this._dynamicTexture.context.createPattern(this._texture, "repeat"); - this._dynamicTexture.context.fill(); + FXManager.prototype.postUpdate = /** + * Post-update is called at the end of the objects update cycle, after other update logic has taken place. + */ + function () { + if(this.active) { + for(var i = 0; i < this._length; i++) { + if(this._fx[i].postUpdate) { + this._fx[i].effect.postUpdate(); + } + } + } }; - return ScrollZone; - })(Phaser.GameObject); - Phaser.ScrollZone = ScrollZone; + FXManager.prototype.preRender = /** + * Pre-render is called at the start of the object render cycle, before any transforms have taken place. + * It happens directly AFTER a canvas context.save has happened if added to a Camera. + */ + function (camera, cameraX, cameraY, cameraWidth, cameraHeight) { + if(this.visible) { + for(var i = 0; i < this._length; i++) { + if(this._fx[i].preRender) { + this._fx[i].effect.preRender(camera, cameraX, cameraY, cameraWidth, cameraHeight); + } + } + } + }; + FXManager.prototype.render = /** + * render is called during the objects render cycle, right after all transforms have finished, but before any children/image data is rendered. + */ + function (camera, cameraX, cameraY, cameraWidth, cameraHeight) { + if(this.visible) { + for(var i = 0; i < this._length; i++) { + if(this._fx[i].preRender) { + this._fx[i].effect.preRender(camera, cameraX, cameraY, cameraWidth, cameraHeight); + } + } + } + }; + FXManager.prototype.postRender = /** + * Post-render is called during the objects render cycle, after the children/image data has been rendered. + * It happens directly BEFORE a canvas context.restore has happened if added to a Camera. + */ + function (camera, cameraX, cameraY, cameraWidth, cameraHeight) { + if(this.visible) { + for(var i = 0; i < this._length; i++) { + if(this._fx[i].postRender) { + this._fx[i].effect.postRender(camera, cameraX, cameraY, cameraWidth, cameraHeight); + } + } + } + }; + FXManager.prototype.destroy = /** + * Clear down this FXManager and null out references + */ + function () { + this._game = null; + this._fx = null; + }; + return FXManager; + })(); + Phaser.FXManager = FXManager; })(Phaser || (Phaser = {})); /// /** diff --git a/build/make-lib.bat b/build/make-lib.bat new file mode 100644 index 00000000..8b30b6c5 --- /dev/null +++ b/build/make-lib.bat @@ -0,0 +1,2 @@ +tsc --target ES5 --declaration ../Phaser/Game.ts +pause diff --git a/build/phaser-fx.d.ts b/build/phaser-fx.d.ts new file mode 100644 index 00000000..661c3f12 --- /dev/null +++ b/build/phaser-fx.d.ts @@ -0,0 +1,140 @@ +/** +* Phaser - FX - Camera - Flash +* +* The camera is filled with the given color and returns to normal at the given duration. +*/ +module Phaser.FX.Camera { + class Flash { + constructor(game: Game); + private _game; + private _fxFlashColor; + private _fxFlashComplete; + private _fxFlashDuration; + private _fxFlashAlpha; + /** + * The camera is filled with this color and returns to normal at the given duration. + * + * @param Color The color you want to use in 0xRRGGBB format, i.e. 0xffffff for white. + * @param Duration How long it takes for the flash to fade. + * @param OnComplete An optional function you want to run when the flash finishes. Set to null for no callback. + * @param Force Force an already running flash effect to reset. + */ + public start(color?: number, duration?: number, onComplete?, force?: bool): void; + public postUpdate(): void; + public postRender(camera: Camera, cameraX: number, cameraY: number, cameraWidth: number, cameraHeight: number): void; + } +} +/** +* Phaser - FX - Camera - Template +* +* A Template FX file you can use to create your own Camera FX. +* If you don't use any of the methods below (i.e. preUpdate, render, etc) then DELETE THEM to avoid un-necessary calls by the FXManager. +*/ +module Phaser.FX.Camera { + class Template { + constructor(game: Game, parent: Camera); + private _game; + private _parent; + /** + * You can name the function that starts the effect whatever you like, but we used 'start' in our effects. + */ + public start(): void; + /** + * Pre-update is called at the start of the objects update cycle, before any other updates have taken place. + */ + public preUpdate(): void; + /** + * Post-update is called at the end of the objects update cycle, after other update logic has taken place. + */ + public postUpdate(): void; + /** + * Pre-render is called at the start of the object render cycle, before any transforms have taken place. + * It happens directly AFTER a canvas context.save has happened if added to a Camera. + */ + public preRender(camera: Camera, cameraX: number, cameraY: number, cameraWidth: number, cameraHeight: number): void; + /** + * render is called during the objects render cycle, right after all transforms have finished, but before any children/image data is rendered. + */ + public render(camera: Camera, cameraX: number, cameraY: number, cameraWidth: number, cameraHeight: number): void; + /** + * Post-render is called during the objects render cycle, after the children/image data has been rendered. + * It happens directly BEFORE a canvas context.restore has happened if added to a Camera. + */ + public postRender(camera: Camera, cameraX: number, cameraY: number, cameraWidth: number, cameraHeight: number): void; + } +} +/** +* Phaser - FX - Camera - Scanlines +* +* Give your game that classic retro feel! +*/ +module Phaser.FX.Camera { + class Scanlines { + constructor(game: Game, parent: Camera); + private _game; + private _parent; + public spacing: number; + public color: string; + public postRender(camera: Camera, cameraX: number, cameraY: number, cameraWidth: number, cameraHeight: number): void; + } +} +/** +* Phaser - FX - Camera - Shake +* +* A simple camera shake effect. +*/ +module Phaser.FX.Camera { + class Shake { + constructor(game: Game, camera: Camera); + private _game; + private _parent; + private _fxShakeIntensity; + private _fxShakeDuration; + private _fxShakeComplete; + private _fxShakeOffset; + private _fxShakeDirection; + private _fxShakePrevX; + private _fxShakePrevY; + static SHAKE_BOTH_AXES: number; + static SHAKE_HORIZONTAL_ONLY: number; + static SHAKE_VERTICAL_ONLY: number; + /** + * A simple camera shake effect. + * + * @param Intensity Percentage of screen size representing the maximum distance that the screen can move while shaking. + * @param Duration The length in seconds that the shaking effect should last. + * @param OnComplete A function you want to run when the shake effect finishes. + * @param Force Force the effect to reset (default = true, unlike flash() and fade()!). + * @param Direction Whether to shake on both axes, just up and down, or just side to side (use class constants SHAKE_BOTH_AXES, SHAKE_VERTICAL_ONLY, or SHAKE_HORIZONTAL_ONLY). + */ + public start(intensity?: number, duration?: number, onComplete?, force?: bool, direction?: number): void; + public postUpdate(): void; + public preRender(camera: Camera, cameraX: number, cameraY: number, cameraWidth: number, cameraHeight: number): void; + } +} +/** +* Phaser - FX - Camera - Fade +* +* The camera is filled with the given color and returns to normal at the given duration. +*/ +module Phaser.FX.Camera { + class Fade { + constructor(game: Game); + private _game; + private _fxFadeColor; + private _fxFadeComplete; + private _fxFadeDuration; + private _fxFadeAlpha; + /** + * The camera is gradually filled with this color. + * + * @param Color The color you want to use in 0xRRGGBB format, i.e. 0xffffff for white. + * @param Duration How long it takes for the flash to fade. + * @param OnComplete An optional function you want to run when the flash finishes. Set to null for no callback. + * @param Force Force an already running flash effect to reset. + */ + public start(color?: number, duration?: number, onComplete?, force?: bool): void; + public postUpdate(): void; + public postRender(camera: Camera, cameraX: number, cameraY: number, cameraWidth: number, cameraHeight: number): void; + } +} diff --git a/build/phaser-fx.js b/build/phaser-fx.js new file mode 100644 index 00000000..a4d44bfb --- /dev/null +++ b/build/phaser-fx.js @@ -0,0 +1,329 @@ +var Phaser; +(function (Phaser) { + (function (FX) { + /// + /// + /** + * Phaser - FX - Camera - Flash + * + * The camera is filled with the given color and returns to normal at the given duration. + */ + (function (Camera) { + var Flash = (function () { + function Flash(game) { + this._fxFlashComplete = null; + this._fxFlashDuration = 0; + this._fxFlashAlpha = 0; + this._game = game; + } + Flash.prototype.start = /** + * The camera is filled with this color and returns to normal at the given duration. + * + * @param Color The color you want to use in 0xRRGGBB format, i.e. 0xffffff for white. + * @param Duration How long it takes for the flash to fade. + * @param OnComplete An optional function you want to run when the flash finishes. Set to null for no callback. + * @param Force Force an already running flash effect to reset. + */ + function (color, duration, onComplete, force) { + if (typeof color === "undefined") { color = 0xffffff; } + if (typeof duration === "undefined") { duration = 1; } + if (typeof onComplete === "undefined") { onComplete = null; } + if (typeof force === "undefined") { force = false; } + if(force === false && this._fxFlashAlpha > 0) { + // You can't flash again unless you force it + return; + } + if(duration <= 0) { + duration = 1; + } + var red = color >> 16 & 0xFF; + var green = color >> 8 & 0xFF; + var blue = color & 0xFF; + this._fxFlashColor = 'rgba(' + red + ',' + green + ',' + blue + ','; + this._fxFlashDuration = duration; + this._fxFlashAlpha = 1; + this._fxFlashComplete = onComplete; + }; + Flash.prototype.postUpdate = function () { + // Update the Flash effect + if(this._fxFlashAlpha > 0) { + this._fxFlashAlpha -= this._game.time.elapsed / this._fxFlashDuration; + if(this._game.math.roundTo(this._fxFlashAlpha, -2) <= 0) { + this._fxFlashAlpha = 0; + if(this._fxFlashComplete !== null) { + this._fxFlashComplete(); + } + } + } + }; + Flash.prototype.postRender = function (camera, cameraX, cameraY, cameraWidth, cameraHeight) { + if(this._fxFlashAlpha > 0) { + this._game.stage.context.fillStyle = this._fxFlashColor + this._fxFlashAlpha + ')'; + this._game.stage.context.fillRect(cameraX, cameraY, cameraWidth, cameraHeight); + } + }; + return Flash; + })(); + Camera.Flash = Flash; + })(FX.Camera || (FX.Camera = {})); + var Camera = FX.Camera; + })(Phaser.FX || (Phaser.FX = {})); + var FX = Phaser.FX; +})(Phaser || (Phaser = {})); +var Phaser; +(function (Phaser) { + (function (FX) { + /// + /// + /// + /** + * Phaser - FX - Camera - Template + * + * A Template FX file you can use to create your own Camera FX. + * If you don't use any of the methods below (i.e. preUpdate, render, etc) then DELETE THEM to avoid un-necessary calls by the FXManager. + */ + (function (Camera) { + var Template = (function () { + function Template(game, parent) { + this._game = game; + this._parent = parent; + } + Template.prototype.start = /** + * You can name the function that starts the effect whatever you like, but we used 'start' in our effects. + */ + function () { + }; + Template.prototype.preUpdate = /** + * Pre-update is called at the start of the objects update cycle, before any other updates have taken place. + */ + function () { + }; + Template.prototype.postUpdate = /** + * Post-update is called at the end of the objects update cycle, after other update logic has taken place. + */ + function () { + }; + Template.prototype.preRender = /** + * Pre-render is called at the start of the object render cycle, before any transforms have taken place. + * It happens directly AFTER a canvas context.save has happened if added to a Camera. + */ + function (camera, cameraX, cameraY, cameraWidth, cameraHeight) { + }; + Template.prototype.render = /** + * render is called during the objects render cycle, right after all transforms have finished, but before any children/image data is rendered. + */ + function (camera, cameraX, cameraY, cameraWidth, cameraHeight) { + }; + Template.prototype.postRender = /** + * Post-render is called during the objects render cycle, after the children/image data has been rendered. + * It happens directly BEFORE a canvas context.restore has happened if added to a Camera. + */ + function (camera, cameraX, cameraY, cameraWidth, cameraHeight) { + }; + return Template; + })(); + Camera.Template = Template; + })(FX.Camera || (FX.Camera = {})); + var Camera = FX.Camera; + })(Phaser.FX || (Phaser.FX = {})); + var FX = Phaser.FX; +})(Phaser || (Phaser = {})); +var Phaser; +(function (Phaser) { + (function (FX) { + /// + /// + /// + /** + * Phaser - FX - Camera - Scanlines + * + * Give your game that classic retro feel! + */ + (function (Camera) { + var Scanlines = (function () { + function Scanlines(game, parent) { + this.spacing = 4; + this.color = 'rgba(0, 0, 0, 0.3)'; + this._game = game; + this._parent = parent; + } + Scanlines.prototype.postRender = function (camera, cameraX, cameraY, cameraWidth, cameraHeight) { + this._game.stage.context.fillStyle = this.color; + for(var y = cameraY; y < cameraHeight; y += this.spacing) { + this._game.stage.context.fillRect(cameraX, y, cameraWidth, 1); + } + }; + return Scanlines; + })(); + Camera.Scanlines = Scanlines; + })(FX.Camera || (FX.Camera = {})); + var Camera = FX.Camera; + })(Phaser.FX || (Phaser.FX = {})); + var FX = Phaser.FX; +})(Phaser || (Phaser = {})); +var Phaser; +(function (Phaser) { + (function (FX) { + /// + /// + /** + * Phaser - FX - Camera - Shake + * + * A simple camera shake effect. + */ + (function (Camera) { + var Shake = (function () { + function Shake(game, camera) { + this._fxShakeIntensity = 0; + this._fxShakeDuration = 0; + this._fxShakeComplete = null; + this._fxShakeOffset = new Phaser.MicroPoint(0, 0); + this._fxShakeDirection = 0; + this._fxShakePrevX = 0; + this._fxShakePrevY = 0; + this._game = game; + this._parent = camera; + } + Shake.SHAKE_BOTH_AXES = 0; + Shake.SHAKE_HORIZONTAL_ONLY = 1; + Shake.SHAKE_VERTICAL_ONLY = 2; + Shake.prototype.start = /** + * A simple camera shake effect. + * + * @param Intensity Percentage of screen size representing the maximum distance that the screen can move while shaking. + * @param Duration The length in seconds that the shaking effect should last. + * @param OnComplete A function you want to run when the shake effect finishes. + * @param Force Force the effect to reset (default = true, unlike flash() and fade()!). + * @param Direction Whether to shake on both axes, just up and down, or just side to side (use class constants SHAKE_BOTH_AXES, SHAKE_VERTICAL_ONLY, or SHAKE_HORIZONTAL_ONLY). + */ + function (intensity, duration, onComplete, force, direction) { + if (typeof intensity === "undefined") { intensity = 0.05; } + if (typeof duration === "undefined") { duration = 0.5; } + if (typeof onComplete === "undefined") { onComplete = null; } + if (typeof force === "undefined") { force = true; } + if (typeof direction === "undefined") { direction = Shake.SHAKE_BOTH_AXES; } + if(!force && ((this._fxShakeOffset.x != 0) || (this._fxShakeOffset.y != 0))) { + return; + } + // If a shake is not already running we need to store the offsets here + if(this._fxShakeOffset.x == 0 && this._fxShakeOffset.y == 0) { + this._fxShakePrevX = this._parent.x; + this._fxShakePrevY = this._parent.y; + } + this._fxShakeIntensity = intensity; + this._fxShakeDuration = duration; + this._fxShakeComplete = onComplete; + this._fxShakeDirection = direction; + this._fxShakeOffset.setTo(0, 0); + }; + Shake.prototype.postUpdate = function () { + // Update the "shake" special effect + if(this._fxShakeDuration > 0) { + this._fxShakeDuration -= this._game.time.elapsed; + if(this._game.math.roundTo(this._fxShakeDuration, -2) <= 0) { + this._fxShakeDuration = 0; + this._fxShakeOffset.setTo(0, 0); + this._parent.x = this._fxShakePrevX; + this._parent.y = this._fxShakePrevY; + if(this._fxShakeComplete != null) { + this._fxShakeComplete(); + } + } else { + if((this._fxShakeDirection == Shake.SHAKE_BOTH_AXES) || (this._fxShakeDirection == Shake.SHAKE_HORIZONTAL_ONLY)) { + //this._fxShakeOffset.x = ((this._game.math.random() * this._fxShakeIntensity * this.worldView.width * 2 - this._fxShakeIntensity * this.worldView.width) * this._zoom; + this._fxShakeOffset.x = (this._game.math.random() * this._fxShakeIntensity * this._parent.worldView.width * 2 - this._fxShakeIntensity * this._parent.worldView.width); + } + if((this._fxShakeDirection == Shake.SHAKE_BOTH_AXES) || (this._fxShakeDirection == Shake.SHAKE_VERTICAL_ONLY)) { + //this._fxShakeOffset.y = (this._game.math.random() * this._fxShakeIntensity * this.worldView.height * 2 - this._fxShakeIntensity * this.worldView.height) * this._zoom; + this._fxShakeOffset.y = (this._game.math.random() * this._fxShakeIntensity * this._parent.worldView.height * 2 - this._fxShakeIntensity * this._parent.worldView.height); + } + } + } + }; + Shake.prototype.preRender = function (camera, cameraX, cameraY, cameraWidth, cameraHeight) { + if((this._fxShakeOffset.x != 0) || (this._fxShakeOffset.y != 0)) { + this._parent.x = this._fxShakePrevX + this._fxShakeOffset.x; + this._parent.y = this._fxShakePrevY + this._fxShakeOffset.y; + } + }; + return Shake; + })(); + Camera.Shake = Shake; + })(FX.Camera || (FX.Camera = {})); + var Camera = FX.Camera; + })(Phaser.FX || (Phaser.FX = {})); + var FX = Phaser.FX; +})(Phaser || (Phaser = {})); +var Phaser; +(function (Phaser) { + (function (FX) { + /// + /// + /** + * Phaser - FX - Camera - Fade + * + * The camera is filled with the given color and returns to normal at the given duration. + */ + (function (Camera) { + var Fade = (function () { + function Fade(game) { + this._fxFadeComplete = null; + this._fxFadeDuration = 0; + this._fxFadeAlpha = 0; + this._game = game; + } + Fade.prototype.start = /** + * The camera is gradually filled with this color. + * + * @param Color The color you want to use in 0xRRGGBB format, i.e. 0xffffff for white. + * @param Duration How long it takes for the flash to fade. + * @param OnComplete An optional function you want to run when the flash finishes. Set to null for no callback. + * @param Force Force an already running flash effect to reset. + */ + function (color, duration, onComplete, force) { + if (typeof color === "undefined") { color = 0x000000; } + if (typeof duration === "undefined") { duration = 1; } + if (typeof onComplete === "undefined") { onComplete = null; } + if (typeof force === "undefined") { force = false; } + if(force === false && this._fxFadeAlpha > 0) { + // You can't fade again unless you force it + return; + } + if(duration <= 0) { + duration = 1; + } + var red = color >> 16 & 0xFF; + var green = color >> 8 & 0xFF; + var blue = color & 0xFF; + this._fxFadeColor = 'rgba(' + red + ',' + green + ',' + blue + ','; + this._fxFadeDuration = duration; + this._fxFadeAlpha = 0.01; + this._fxFadeComplete = onComplete; + }; + Fade.prototype.postUpdate = function () { + // Update the Fade effect + if(this._fxFadeAlpha > 0) { + this._fxFadeAlpha += this._game.time.elapsed / this._fxFadeDuration; + if(this._game.math.roundTo(this._fxFadeAlpha, -2) >= 1) { + this._fxFadeAlpha = 1; + if(this._fxFadeComplete !== null) { + this._fxFadeComplete(); + } + } + } + }; + Fade.prototype.postRender = function (camera, cameraX, cameraY, cameraWidth, cameraHeight) { + // "Fade" FX + if(this._fxFadeAlpha > 0) { + this._game.stage.context.fillStyle = this._fxFadeColor + this._fxFadeAlpha + ')'; + this._game.stage.context.fillRect(cameraX, cameraY, cameraWidth, cameraHeight); + } + }; + return Fade; + })(); + Camera.Fade = Fade; + })(FX.Camera || (FX.Camera = {})); + var Camera = FX.Camera; + })(Phaser.FX || (Phaser.FX = {})); + var FX = Phaser.FX; +})(Phaser || (Phaser = {})); diff --git a/build/phaser.d.ts b/build/phaser.d.ts new file mode 100644 index 00000000..c89c85e3 --- /dev/null +++ b/build/phaser.d.ts @@ -0,0 +1,5672 @@ +/** +* Phaser - Basic +* +* A useful "generic" object on which all GameObjects and Groups are based. +* It has no size, position or graphical data. +*/ +module Phaser { + class Basic { + /** + * Instantiate the basic object. + */ + constructor(game: Game); + /** + * The essential reference to the main game object + */ + public _game: Game; + /** + * Allows you to give this object a name. Useful for debugging, but not actually used internally. + */ + public name: string; + /** + * IDs seem like they could be pretty useful, huh? + * They're not actually used for anything yet though. + */ + public ID: number; + /** + * A boolean to store if this object is a Group or not. + * Saves us an expensive typeof check inside of core loops. + */ + public isGroup: bool; + /** + * Controls whether update() and draw() are automatically called by State/Group. + */ + public exists: bool; + /** + * Controls whether update() is automatically called by State/Group. + */ + public active: bool; + /** + * Controls whether draw() is automatically called by State/Group. + */ + public visible: bool; + /** + * Useful state for many game objects - "dead" (!alive) vs alive. + * kill() and revive() both flip this switch (along with exists, but you can override that). + */ + public alive: bool; + /** + * Setting this to true will prevent the object from appearing + * when the visual debug mode in the debugger overlay is toggled on. + */ + public ignoreDrawDebug: bool; + /** + * Override this to null out iables or manually call + * destroy() on class members if necessary. + * Don't forget to call super.destroy()! + */ + public destroy(): void; + /** + * Pre-update is called right before update() on each object in the game loop. + */ + public preUpdate(): void; + /** + * Override this to update your class's position and appearance. + * This is where most of your game rules and behavioral code will go. + */ + public update(): void; + /** + * Post-update is called right after update() on each object in the game loop. + */ + public postUpdate(): void; + public render(camera: Camera, cameraOffsetX: number, cameraOffsetY: number): void; + /** + * Handy for "killing" game objects. + * Default behavior is to flag them as nonexistent AND dead. + * However, if you want the "corpse" to remain in the game, + * like to animate an effect or whatever, you should override this, + * setting only alive to false, and leaving exists true. + */ + public kill(): void; + /** + * Handy for bringing game objects "back to life". Just sets alive and exists back to true. + * In practice, this is most often called by Object.reset(). + */ + public revive(): void; + /** + * Convert object to readable string name. Useful for debugging, save games, etc. + */ + public toString(): string; + } +} +/** +* Phaser - SignalBinding +* +* An object that represents a binding between a Signal and a listener function. +* Based on JS Signals by Miller Medeiros. Converted by TypeScript by Richard Davey. +* Released under the MIT license +* http://millermedeiros.github.com/js-signals/ +*/ +module Phaser { + class SignalBinding { + /** + * Object that represents a binding between a Signal and a listener function. + *
              - This is an internal constructor and shouldn't be called by regular users. + *
              - inspired by Joa Ebert AS3 SignalBinding and Robert Penner's Slot classes. + * @author Miller Medeiros + * @constructor + * @internal + * @name SignalBinding + * @param {Signal} signal Reference to Signal object that listener is currently bound to. + * @param {Function} listener Handler function bound to the signal. + * @param {boolean} isOnce If binding should be executed just once. + * @param {Object} [listenerContext] Context on which listener will be executed (object that should represent the `this` variable inside listener function). + * @param {Number} [priority] The priority level of the event listener. (default = 0). + */ + constructor(signal: Signal, listener, isOnce: bool, listenerContext, priority?: number); + /** + * Handler function bound to the signal. + * @type Function + * @private + */ + private _listener; + /** + * If binding should be executed just once. + * @type boolean + * @private + */ + private _isOnce; + /** + * Context on which listener will be executed (object that should represent the `this` variable inside listener function). + * @memberOf SignalBinding.prototype + * @name context + * @type Object|undefined|null + */ + public context; + /** + * Reference to Signal object that listener is currently bound to. + * @type Signal + * @private + */ + private _signal; + /** + * Listener priority + * @type Number + */ + public priority: number; + /** + * If binding is active and should be executed. + * @type boolean + */ + public active: bool; + /** + * Default parameters passed to listener during `Signal.dispatch` and `SignalBinding.execute`. (curried parameters) + * @type Array|null + */ + public params; + /** + * Call listener passing arbitrary parameters. + *

              If binding was added using `Signal.addOnce()` it will be automatically removed from signal dispatch queue, this method is used internally for the signal dispatch.

              + * @param {Array} [paramsArr] Array of parameters that should be passed to the listener + * @return {*} Value returned by the listener. + */ + public execute(paramsArr?: any[]); + /** + * Detach binding from signal. + * - alias to: mySignal.remove(myBinding.getListener()); + * @return {Function|null} Handler function bound to the signal or `null` if binding was previously detached. + */ + public detach(); + /** + * @return {Boolean} `true` if binding is still bound to the signal and have a listener. + */ + public isBound(): bool; + /** + * @return {boolean} If SignalBinding will only be executed once. + */ + public isOnce(): bool; + /** + * @return {Function} Handler function bound to the signal. + */ + public getListener(); + /** + * @return {Signal} Signal that listener is currently bound to. + */ + public getSignal(): Signal; + /** + * Delete instance properties + * @private + */ + public _destroy(): void; + /** + * @return {string} String representation of the object. + */ + public toString(): string; + } +} +/** +* Phaser - Signal +* +* A Signal is used for object communication via a custom broadcaster instead of Events. +* Based on JS Signals by Miller Medeiros. Converted by TypeScript by Richard Davey. +* Released under the MIT license +* http://millermedeiros.github.com/js-signals/ +*/ +module Phaser { + class Signal { + /** + * + * @property _bindings + * @type Array + * @private + */ + private _bindings; + /** + * + * @property _prevParams + * @type Any + * @private + */ + private _prevParams; + /** + * Signals Version Number + * @property VERSION + * @type String + * @const + */ + static VERSION: string; + /** + * If Signal should keep record of previously dispatched parameters and + * automatically execute listener during `add()`/`addOnce()` if Signal was + * already dispatched before. + * @type boolean + */ + public memorize: bool; + /** + * @type boolean + * @private + */ + private _shouldPropagate; + /** + * If Signal is active and should broadcast events. + *

              IMPORTANT: Setting this property during a dispatch will only affect the next dispatch, if you want to stop the propagation of a signal use `halt()` instead.

              + * @type boolean + */ + public active: bool; + /** + * + * @method validateListener + * @param {Any} listener + * @param {Any} fnName + */ + public validateListener(listener, fnName): void; + /** + * @param {Function} listener + * @param {boolean} isOnce + * @param {Object} [listenerContext] + * @param {Number} [priority] + * @return {SignalBinding} + * @private + */ + private _registerListener(listener, isOnce, listenerContext, priority); + /** + * + * @method _addBinding + * @param {SignalBinding} binding + * @private + */ + private _addBinding(binding); + /** + * + * @method _indexOfListener + * @param {Function} listener + * @return {number} + * @private + */ + private _indexOfListener(listener, context); + /** + * Check if listener was attached to Signal. + * @param {Function} listener + * @param {Object} [context] + * @return {boolean} if Signal has the specified listener. + */ + public has(listener, context?: any): bool; + /** + * Add a listener to the signal. + * @param {Function} listener Signal handler function. + * @param {Object} [listenerContext] Context on which listener will be executed (object that should represent the `this` variable inside listener function). + * @param {Number} [priority] The priority level of the event listener. Listeners with higher priority will be executed before listeners with lower priority. Listeners with same priority level will be executed at the same order as they were added. (default = 0) + * @return {SignalBinding} An Object representing the binding between the Signal and listener. + */ + public add(listener, listenerContext?: any, priority?: number): SignalBinding; + /** + * Add listener to the signal that should be removed after first execution (will be executed only once). + * @param {Function} listener Signal handler function. + * @param {Object} [listenerContext] Context on which listener will be executed (object that should represent the `this` variable inside listener function). + * @param {Number} [priority] The priority level of the event listener. Listeners with higher priority will be executed before listeners with lower priority. Listeners with same priority level will be executed at the same order as they were added. (default = 0) + * @return {SignalBinding} An Object representing the binding between the Signal and listener. + */ + public addOnce(listener, listenerContext?: any, priority?: number): SignalBinding; + /** + * Remove a single listener from the dispatch queue. + * @param {Function} listener Handler function that should be removed. + * @param {Object} [context] Execution context (since you can add the same handler multiple times if executing in a different context). + * @return {Function} Listener handler function. + */ + public remove(listener, context?: any); + /** + * Remove all listeners from the Signal. + */ + public removeAll(): void; + /** + * @return {number} Number of listeners attached to the Signal. + */ + public getNumListeners(): number; + /** + * Stop propagation of the event, blocking the dispatch to next listeners on the queue. + *

              IMPORTANT: should be called only during signal dispatch, calling it before/after dispatch won't affect signal broadcast.

              + * @see Signal.prototype.disable + */ + public halt(): void; + /** + * Dispatch/Broadcast Signal to all listeners added to the queue. + * @param {...*} [params] Parameters that should be passed to each handler. + */ + public dispatch(...paramsArr: any[]): void; + /** + * Forget memorized arguments. + * @see Signal.memorize + */ + public forget(): void; + /** + * Remove all bindings from signal and destroy any reference to external objects (destroy Signal object). + *

              IMPORTANT: calling any method on the signal instance after calling dispose will throw errors.

              + */ + public dispose(): void; + /** + * @return {string} String representation of the object. + */ + public toString(): string; + } +} +/** +* Phaser - GameObject +* +* This is the base GameObject on which all other game objects are derived. It contains all the logic required for position, +* motion, size, collision and input. +*/ +module Phaser { + class GameObject extends Basic { + constructor(game: Game, x?: number, y?: number, width?: number, height?: number); + private _angle; + static ALIGN_TOP_LEFT: number; + static ALIGN_TOP_CENTER: number; + static ALIGN_TOP_RIGHT: number; + static ALIGN_CENTER_LEFT: number; + static ALIGN_CENTER: number; + static ALIGN_CENTER_RIGHT: number; + static ALIGN_BOTTOM_LEFT: number; + static ALIGN_BOTTOM_CENTER: number; + static ALIGN_BOTTOM_RIGHT: number; + static OUT_OF_BOUNDS_STOP: number; + static OUT_OF_BOUNDS_KILL: number; + public _point: MicroPoint; + public cameraBlacklist: number[]; + public bounds: Rectangle; + public worldBounds: Quad; + public outOfBoundsAction: number; + public align: number; + public facing: number; + public alpha: number; + public scale: MicroPoint; + public origin: MicroPoint; + public z: number; + public rotationOffset: number; + public renderRotation: bool; + public immovable: bool; + public velocity: MicroPoint; + public mass: number; + public elasticity: number; + public acceleration: MicroPoint; + public drag: MicroPoint; + public maxVelocity: MicroPoint; + public angularVelocity: number; + public angularAcceleration: number; + public angularDrag: number; + public maxAngular: number; + public scrollFactor: MicroPoint; + public health: number; + public moves: bool; + public touching: number; + public wasTouching: number; + public allowCollisions: number; + public last: MicroPoint; + public inputEnabled: bool; + private _inputOver; + public onInputOver: Signal; + public onInputOut: Signal; + public onInputDown: Signal; + public onInputUp: Signal; + public preUpdate(): void; + public update(): void; + public postUpdate(): void; + private updateInput(); + private updateMotion(); + /** + * Checks to see if some GameObject overlaps this GameObject or Group. + * If the group has a LOT of things in it, it might be faster to use Collision.overlaps(). + * WARNING: Currently tilemaps do NOT support screen space overlap checks! + * + * @param ObjectOrGroup The object or group being tested. + * @param InScreenSpace Whether to take scroll factors numbero account when checking for overlap. Default is false, or "only compare in world space." + * @param Camera Specify which game camera you want. If null getScreenXY() will just grab the first global camera. + * + * @return Whether or not the two objects overlap. + */ + public overlaps(ObjectOrGroup, InScreenSpace?: bool, Camera?: Camera): bool; + /** + * Checks to see if this GameObject were located at the given position, would it overlap the GameObject or Group? + * This is distinct from overlapsPoint(), which just checks that point, rather than taking the object's size numbero account. + * WARNING: Currently tilemaps do NOT support screen space overlap checks! + * + * @param X The X position you want to check. Pretends this object (the caller, not the parameter) is located here. + * @param Y The Y position you want to check. Pretends this object (the caller, not the parameter) is located here. + * @param ObjectOrGroup The object or group being tested. + * @param InScreenSpace Whether to take scroll factors numbero account when checking for overlap. Default is false, or "only compare in world space." + * @param Camera Specify which game camera you want. If null getScreenXY() will just grab the first global camera. + * + * @return Whether or not the two objects overlap. + */ + public overlapsAt(X: number, Y: number, ObjectOrGroup, InScreenSpace?: bool, Camera?: Camera): bool; + /** + * Checks to see if a point in 2D world space overlaps this GameObject. + * + * @param Point The point in world space you want to check. + * @param InScreenSpace Whether to take scroll factors into account when checking for overlap. + * @param Camera Specify which game camera you want. If null getScreenXY() will just grab the first global camera. + * + * @return Whether or not the point overlaps this object. + */ + public overlapsPoint(point: Point, InScreenSpace?: bool, Camera?: Camera): bool; + /** + * Check and see if this object is currently on screen. + * + * @param Camera Specify which game camera you want. If null getScreenXY() will just grab the first global camera. + * + * @return Whether the object is on screen or not. + */ + public onScreen(Camera?: Camera): bool; + /** + * Call this to figure out the on-screen position of the object. + * + * @param Camera Specify which game camera you want. If null getScreenXY() will just grab the first global camera. + * @param Point Takes a MicroPoint object and assigns the post-scrolled X and Y values of this object to it. + * + * @return The MicroPoint you passed in, or a new Point if you didn't pass one, containing the screen X and Y position of this object. + */ + public getScreenXY(point?: MicroPoint, Camera?: Camera): MicroPoint; + /** + * Whether the object collides or not. For more control over what directions + * the object will collide from, use collision constants (like LEFT, FLOOR, etc) + * to set the value of allowCollisions directly. + */ + /** + * @private + */ + public solid : bool; + /** + * Retrieve the midpoint of this object in world coordinates. + * + * @Point Allows you to pass in an existing Point object if you're so inclined. Otherwise a new one is created. + * + * @return A Point object containing the midpoint of this object in world coordinates. + */ + public getMidpoint(point?: MicroPoint): MicroPoint; + /** + * Handy for reviving game objects. + * Resets their existence flags and position. + * + * @param X The new X position of this object. + * @param Y The new Y position of this object. + */ + public reset(X: number, Y: number): void; + /** + * Handy for checking if this object is touching a particular surface. + * For slightly better performance you can just & the value directly numbero touching. + * However, this method is good for readability and accessibility. + * + * @param Direction Any of the collision flags (e.g. LEFT, FLOOR, etc). + * + * @return Whether the object is touching an object in (any of) the specified direction(s) this frame. + */ + public isTouching(Direction: number): bool; + /** + * Handy for checking if this object is just landed on a particular surface. + * + * @param Direction Any of the collision flags (e.g. LEFT, FLOOR, etc). + * + * @return Whether the object just landed on (any of) the specified surface(s) this frame. + */ + public justTouched(Direction: number): bool; + /** + * Reduces the "health" variable of this sprite by the amount specified in Damage. + * Calls kill() if health drops to or below zero. + * + * @param Damage How much health to take away (use a negative number to give a health bonus). + */ + public hurt(Damage: number): void; + /** + * Set the world bounds that this GameObject can exist within. By default a GameObject can exist anywhere + * in the world. But by setting the bounds (which are given in world dimensions, not screen dimensions) + * it can be stopped from leaving the world, or a section of it. + */ + public setBounds(x: number, y: number, width: number, height: number): void; + /** + * If you do not wish this object to be visible to a specific camera, pass the camera here. + */ + public hideFromCamera(camera: Camera): void; + public showToCamera(camera: Camera): void; + public clearCameraList(): void; + public destroy(): void; + public x : number; + public y : number; + public rotation : number; + public angle : number; + public width : number; + public height : number; + } +} +/** +* Phaser - Camera +* +* A Camera is your view into the game world. It has a position, size, scale and rotation and renders only those objects +* within its field of view. The game automatically creates a single Stage sized camera on boot, but it can be changed and +* additional cameras created via the CameraManager. +*/ +module Phaser { + class Camera { + /** + * Instantiates a new camera at the specified location, with the specified size and zoom level. + * + * @param X X location of the camera's display in pixels. Uses native, 1:1 resolution, ignores zoom. + * @param Y Y location of the camera's display in pixels. Uses native, 1:1 resolution, ignores zoom. + * @param Width The width of the camera display in pixels. + * @param Height The height of the camera display in pixels. + * @param Zoom The initial zoom level of the camera. A zoom level of 2 will make all pixels display at 2x resolution. + */ + constructor(game: Game, id: number, x: number, y: number, width: number, height: number); + private _game; + private _clip; + private _stageX; + private _stageY; + private _rotation; + private _target; + private _sx; + private _sy; + static STYLE_LOCKON: number; + static STYLE_PLATFORMER: number; + static STYLE_TOPDOWN: number; + static STYLE_TOPDOWN_TIGHT: number; + public ID: number; + public worldView: Rectangle; + public totalSpritesRendered: number; + public scale: MicroPoint; + public scroll: MicroPoint; + public bounds: Rectangle; + public deadzone: Rectangle; + public showBorder: bool; + public borderColor: string; + public opaque: bool; + private _bgColor; + private _bgTexture; + private _bgTextureRepeat; + public showShadow: bool; + public shadowColor: string; + public shadowBlur: number; + public shadowOffset: MicroPoint; + public visible: bool; + public alpha: number; + public inputX: number; + public inputY: number; + public fx: FXManager; + public follow(target: Sprite, style?: number): void; + public focusOnXY(x: number, y: number): void; + public focusOn(point): void; + /** + * Specify the boundaries of the world or where the camera is allowed to move. + * + * @param x The smallest X value of your world (usually 0). + * @param y The smallest Y value of your world (usually 0). + * @param width The largest X value of your world (usually the world width). + * @param height The largest Y value of your world (usually the world height). + */ + public setBounds(x?: number, y?: number, width?: number, height?: number): void; + public update(): void; + public render(): void; + public backgroundColor : string; + public setTexture(key: string, repeat?: string): void; + public setPosition(x: number, y: number): void; + public setSize(width: number, height: number): void; + public renderDebugInfo(x: number, y: number, color?: string): void; + public x : number; + public y : number; + public width : number; + public height : number; + public rotation : number; + private checkClip(); + } +} +/** +* Phaser - Sprite +* +* The Sprite GameObject is an extension of the core GameObject that includes support for animation and dynamic textures. +* It's probably the most used GameObject of all. +*/ +module Phaser { + class Sprite extends GameObject { + constructor(game: Game, x?: number, y?: number, key?: string); + private _texture; + private _dynamicTexture; + private _sx; + private _sy; + private _sw; + private _sh; + private _dx; + private _dy; + private _dw; + private _dh; + public animations: AnimationManager; + public renderDebug: bool; + public renderDebugColor: string; + public renderDebugPointColor: string; + public flipped: bool; + public loadGraphic(key: string): Sprite; + public loadDynamicTexture(texture: DynamicTexture): Sprite; + public makeGraphic(width: number, height: number, color?: number): Sprite; + public inCamera(camera: Rectangle): bool; + public postUpdate(): void; + public frame : number; + public frameName : string; + public render(camera: Camera, cameraOffsetX: number, cameraOffsetY: number): bool; + private renderBounds(camera, cameraOffsetX, cameraOffsetY); + public renderDebugInfo(x: number, y: number, color?: string): void; + } +} +/** +* Phaser - Animation +* +* An Animation is a single animation. It is created by the AnimationManager and belongs to Sprite objects. +*/ +module Phaser { + class Animation { + constructor(game: Game, parent: Sprite, frameData: FrameData, name: string, frames, delay: number, looped: bool); + private _game; + private _parent; + private _frames; + private _frameData; + private _frameIndex; + private _timeLastFrame; + private _timeNextFrame; + public name: string; + public currentFrame: Frame; + public isFinished: bool; + public isPlaying: bool; + public looped: bool; + public delay: number; + public frameTotal : number; + public frame : number; + public play(frameRate?: number, loop?: bool): void; + public restart(): void; + public stop(): void; + public update(): bool; + public destroy(): void; + private onComplete(); + } +} +/** +* Phaser - AnimationLoader +* +* Responsible for parsing sprite sheet and JSON data into the internal FrameData format that Phaser uses for animations. +*/ +module Phaser { + class AnimationLoader { + static parseSpriteSheet(game: Game, key: string, frameWidth: number, frameHeight: number, frameMax: number): FrameData; + static parseJSONData(game: Game, json): FrameData; + } +} +/** +* Phaser - Frame +* +* A Frame is a single frame of an animation and is part of a FrameData collection. +*/ +module Phaser { + class Frame { + constructor(x: number, y: number, width: number, height: number, name: string); + public x: number; + public y: number; + public width: number; + public height: number; + public index: number; + public name: string; + public rotated: bool; + public rotationDirection: string; + public trimmed: bool; + public sourceSizeW: number; + public sourceSizeH: number; + public spriteSourceSizeX: number; + public spriteSourceSizeY: number; + public spriteSourceSizeW: number; + public spriteSourceSizeH: number; + public setRotation(rotated: bool, rotationDirection: string): void; + public setTrim(trimmed: bool, actualWidth, actualHeight, destX, destY, destWidth, destHeight): void; + } +} +/** +* Phaser - FrameData +* +* FrameData is a container for Frame objects, the internal representation of animation data in Phaser. +*/ +module Phaser { + class FrameData { + constructor(); + private _frames; + private _frameNames; + public total : number; + public addFrame(frame: Frame): Frame; + public getFrame(index: number): Frame; + public getFrameByName(name: string): Frame; + public checkFrameName(name: string): bool; + public getFrameRange(start: number, end: number, output?: Frame[]): Frame[]; + public getFrameIndexes(output?: number[]): number[]; + public getFrameIndexesByName(input: string[]): number[]; + public getAllFrames(): Frame[]; + public getFrames(range: number[]): Frame[]; + } +} +/** +* Phaser - AnimationManager +* +* Any Sprite that has animation contains an instance of the AnimationManager, which is used to add, play and update +* sprite specific animations. +*/ +module Phaser { + class AnimationManager { + constructor(game: Game, parent: Sprite); + private _game; + private _parent; + private _anims; + private _frameIndex; + private _frameData; + public currentAnim: Animation; + public currentFrame: Frame; + public loadFrameData(frameData: FrameData): void; + public add(name: string, frames?: any[], frameRate?: number, loop?: bool, useNumericIndex?: bool): void; + private validateFrames(frames, useNumericIndex); + public play(name: string, frameRate?: number, loop?: bool): void; + public stop(name: string): void; + public update(): void; + public frameData : FrameData; + public frameTotal : number; + public frame : number; + public frameName : string; + } +} +/** +* Phaser - Cache +* +* A game only has one instance of a Cache and it is used to store all externally loaded assets such +* as images, sounds and data files as a result of Loader calls. Cache items use string based keys for look-up. +*/ +module Phaser { + class Cache { + constructor(game: Game); + private _game; + private _canvases; + private _images; + private _sounds; + private _text; + public addCanvas(key: string, canvas: HTMLCanvasElement, context: CanvasRenderingContext2D): void; + public addSpriteSheet(key: string, url: string, data, frameWidth: number, frameHeight: number, frameMax: number): void; + public addTextureAtlas(key: string, url: string, data, jsonData): void; + public addImage(key: string, url: string, data): void; + public addSound(key: string, url: string, data): void; + public decodedSound(key: string, data): void; + public addText(key: string, url: string, data): void; + public getCanvas(key: string); + public getImage(key: string); + public getFrameData(key: string): FrameData; + public getSound(key: string); + public isSoundDecoded(key: string): bool; + public isSpriteSheet(key: string): bool; + public getText(key: string); + public destroy(): void; + } +} +/** +* Phaser - CameraManager +* +* Your game only has one CameraManager instance and it's responsible for looking after, creating and destroying +* all of the cameras in the world. +* +* TODO: If the Camera is larger than the Stage size then the rotation offset isn't correct +* TODO: Texture Repeat doesn't scroll, because it's part of the camera not the world, need to think about this more +*/ +module Phaser { + class CameraManager { + constructor(game: Game, x: number, y: number, width: number, height: number); + private _game; + private _cameras; + private _cameraInstance; + public current: Camera; + public getAll(): Camera[]; + public update(): void; + public render(): void; + public addCamera(x: number, y: number, width: number, height: number): Camera; + public removeCamera(id: number): bool; + public destroy(): void; + } +} +/** +* Phaser - Point +* +* The Point object represents a location in a two-dimensional coordinate system, where x represents the horizontal axis and y represents the vertical axis. +*/ +module Phaser { + class Point { + /** + * Creates a new point. If you pass no parameters to this method, a point is created at (0,0). + * @class Point + * @constructor + * @param {Number} x The horizontal position of this point (default 0) + * @param {Number} y The vertical position of this point (default 0) + **/ + constructor(x?: number, y?: number); + /** + * The horizontal position of this point (default 0) + * @property x + * @type Number + **/ + public x: number; + /** + * The vertical position of this point (default 0) + * @property y + * @type Number + **/ + public y: number; + /** + * Adds the coordinates of another point to the coordinates of this point to create a new point. + * @method add + * @param {Point} point - The point to be added. + * @return {Point} The new Point object. + **/ + public add(toAdd: Point, output?: Point): Point; + /** + * Adds the given values to the coordinates of this point and returns it + * @method addTo + * @param {Number} x - The amount to add to the x value of the point + * @param {Number} y - The amount to add to the x value of the point + * @return {Point} This Point object. + **/ + public addTo(x?: number, y?: number): Point; + /** + * Adds the given values to the coordinates of this point and returns it + * @method addTo + * @param {Number} x - The amount to add to the x value of the point + * @param {Number} y - The amount to add to the x value of the point + * @return {Point} This Point object. + **/ + public subtractFrom(x?: number, y?: number): Point; + /** + * Inverts the x and y values of this point + * @method invert + * @return {Point} This Point object. + **/ + public invert(): Point; + /** + * Clamps this Point object to be between the given min and max + * @method clamp + * @param {number} The minimum value to clamp this Point to + * @param {number} The maximum value to clamp this Point to + * @return {Point} This Point object. + **/ + public clamp(min: number, max: number): Point; + /** + * Clamps the x value of this Point object to be between the given min and max + * @method clampX + * @param {number} The minimum value to clamp this Point to + * @param {number} The maximum value to clamp this Point to + * @return {Point} This Point object. + **/ + public clampX(min: number, max: number): Point; + /** + * Clamps the y value of this Point object to be between the given min and max + * @method clampY + * @param {number} The minimum value to clamp this Point to + * @param {number} The maximum value to clamp this Point to + * @return {Point} This Point object. + **/ + public clampY(min: number, max: number): Point; + /** + * Creates a copy of this Point. + * @method clone + * @param {Point} output Optional Point object. If given the values will be set into this object, otherwise a brand new Point object will be created and returned. + * @return {Point} The new Point object. + **/ + public clone(output?: Point): Point; + /** + * Copies the point data from the source Point object into this Point object. + * @method copyFrom + * @param {Point} source - The point to copy from. + * @return {Point} This Point object. Useful for chaining method calls. + **/ + public copyFrom(source: Point): Point; + /** + * Copies the point data from this Point object to the given target Point object. + * @method copyTo + * @param {Point} target - The point to copy to. + * @return {Point} The target Point object. + **/ + public copyTo(target: Point): Point; + /** + * Returns the distance from this Point object to the given Point object. + * @method distanceFrom + * @param {Point} target - The destination Point object. + * @param {Boolean} round - Round the distance to the nearest integer (default false) + * @return {Number} The distance between this Point object and the destination Point object. + **/ + public distanceTo(target: Point, round?: bool): number; + /** + * Returns the distance between the two Point objects. + * @method distanceBetween + * @param {Point} pointA - The first Point object. + * @param {Point} pointB - The second Point object. + * @param {Boolean} round - Round the distance to the nearest integer (default false) + * @return {Number} The distance between the two Point objects. + **/ + static distanceBetween(pointA: Point, pointB: Point, round?: bool): number; + /** + * Returns true if the distance between this point and a target point is greater than or equal a specified distance. + * This avoids using a costly square root operation + * @method distanceCompare + * @param {Point} target - The Point object to use for comparison. + * @param {Number} distance - The distance to use for comparison. + * @return {Boolena} True if distance is >= specified distance. + **/ + public distanceCompare(target: Point, distance: number): bool; + /** + * Determines whether this Point object and the given point object are equal. They are equal if they have the same x and y values. + * @method equals + * @param {Point} point - The point to compare against. + * @return {Boolean} A value of true if the object is equal to this Point object; false if it is not equal. + **/ + public equals(toCompare: Point): bool; + /** + * Determines a point between two specified points. The parameter f determines where the new interpolated point is located relative to the two end points specified by parameters pt1 and pt2. + * The closer the value of the parameter f is to 1.0, the closer the interpolated point is to the first point (parameter pt1). The closer the value of the parameter f is to 0, the closer the interpolated point is to the second point (parameter pt2). + * @method interpolate + * @param {Point} pointA - The first Point object. + * @param {Point} pointB - The second Point object. + * @param {Number} f - The level of interpolation between the two points. Indicates where the new point will be, along the line between pt1 and pt2. If f=1, pt1 is returned; if f=0, pt2 is returned. + * @return {Point} The new interpolated Point object. + **/ + public interpolate(pointA, pointB, f): void; + /** + * Offsets the Point object by the specified amount. The value of dx is added to the original value of x to create the new x value. + * The value of dy is added to the original value of y to create the new y value. + * @method offset + * @param {Number} dx - The amount by which to offset the horizontal coordinate, x. + * @param {Number} dy - The amount by which to offset the vertical coordinate, y. + * @return {Point} This Point object. Useful for chaining method calls. + **/ + public offset(dx: number, dy: number): Point; + /** + * Converts a pair of polar coordinates to a Cartesian point coordinate. + * @method polar + * @param {Number} length - The length coordinate of the polar pair. + * @param {Number} angle - The angle, in radians, of the polar pair. + * @return {Point} The new Cartesian Point object. + **/ + public polar(length, angle): void; + /** + * Sets the x and y values of this Point object to the given coordinates. + * @method setTo + * @param {Number} x - The horizontal position of this point. + * @param {Number} y - The vertical position of this point. + * @return {Point} This Point object. Useful for chaining method calls. + **/ + public setTo(x: number, y: number): Point; + /** + * Subtracts the coordinates of another point from the coordinates of this point to create a new point. + * @method subtract + * @param {Point} point - The point to be subtracted. + * @param {Point} output Optional Point object. If given the values will be set into this object, otherwise a brand new Point object will be created and returned. + * @return {Point} The new Point object. + **/ + public subtract(point: Point, output?: Point): Point; + /** + * Returns a string representation of this object. + * @method toString + * @return {string} a string representation of the instance. + **/ + public toString(): string; + } +} +/** +* Phaser - MicroPoint +* +* The MicroPoint object represents a location in a two-dimensional coordinate system, +* where x represents the horizontal axis and y represents the vertical axis. +* It is different to the Point class in that it doesn't contain any of the help methods like add/substract/distanceTo, etc. +* Use a MicroPoint when all you literally need is a solid container for x and y (such as in the Rectangle class). +*/ +module Phaser { + class MicroPoint { + /** + * Creates a new point. If you pass no parameters to this method, a point is created at (0,0). + * @class MicroPoint + * @constructor + * @param {Number} x The horizontal position of this point (default 0) + * @param {Number} y The vertical position of this point (default 0) + **/ + constructor(x?: number, y?: number, parent?: any); + private _x; + private _y; + public parent: any; + /** + * The x coordinate of the top-left corner of the rectangle + * @property x + * @type Number + **/ + /** + * The x coordinate of the top-left corner of the rectangle + * @property x + * @type Number + **/ + public x : number; + /** + * The y coordinate of the top-left corner of the rectangle + * @property y + * @type Number + **/ + /** + * The y coordinate of the top-left corner of the rectangle + * @property y + * @type Number + **/ + public y : number; + /** + * Copies the x and y values from any given object to this MicroPoint. + * @method copyFrom + * @param {any} source - The object to copy from. + * @return {MicroPoint} This MicroPoint object. Useful for chaining method calls. + **/ + public copyFrom(source: any): MicroPoint; + /** + * Copies the x and y values from this MicroPoint to any given object. + * @method copyTo + * @param {any} target - The object to copy to. + * @return {any} The target object. + **/ + public copyTo(target: any): MicroPoint; + /** + * Sets the x and y values of this MicroPoint object to the given coordinates. + * @method setTo + * @param {Number} x - The horizontal position of this point. + * @param {Number} y - The vertical position of this point. + * @return {MicroPoint} This MicroPoint object. Useful for chaining method calls. + **/ + public setTo(x: number, y: number, callParent?: bool): MicroPoint; + /** + * Determines whether this MicroPoint object and the given object are equal. They are equal if they have the same x and y values. + * @method equals + * @param {any} point - The object to compare against. Must have x and y properties. + * @return {Boolean} A value of true if the object is equal to this MicroPoin object; false if it is not equal. + **/ + public equals(toCompare): bool; + /** + * Returns a string representation of this object. + * @method toString + * @return {string} a string representation of the instance. + **/ + public toString(): string; + } +} +/** +* Phaser - Rectangle +* +* A Rectangle object is an area defined by its position, as indicated by its top-left corner (x,y) and width and height. +*/ +module Phaser { + class Rectangle { + /** + * Creates a new Rectangle object with the top-left corner specified by the x and y parameters and with the specified width and height parameters. + * If you call this function without parameters, a rectangle with x, y, width, and height properties set to 0 is created. + * @class Rectangle + * @constructor + * @param {Number} x The x coordinate of the top-left corner of the rectangle. + * @param {Number} y The y coordinate of the top-left corner of the rectangle. + * @param {Number} width The width of the rectangle. + * @param {Number} height The height of the rectangle. + * @return {Rectangle} This rectangle object + **/ + constructor(x?: number, y?: number, width?: number, height?: number); + private _tempX; + private _tempY; + private _tempWidth; + private _tempHeight; + /** + * The x coordinate of the top-left corner of the rectangle + * @property x + * @type Number + **/ + /** + * The x coordinate of the top-left corner of the rectangle + * @property x + * @type Number + **/ + public x : number; + /** + * The y coordinate of the top-left corner of the rectangle + * @property y + * @type Number + **/ + /** + * The y coordinate of the top-left corner of the rectangle + * @property y + * @type Number + **/ + public y : number; + /** + * The x and y coordinate of the top-left corner of the rectangle (same as x/y) + * @property topLeft + * @type MicroPoint + **/ + public topLeft: MicroPoint; + /** + * The x and y coordinate of the top-center of the rectangle + * @property topCenter + * @type MicroPoint + **/ + public topCenter: MicroPoint; + /** + * The x and y coordinate of the top-right corner of the rectangle + * @property topRight + * @type MicroPoint + **/ + public topRight: MicroPoint; + /** + * The x and y coordinate of the left-center of the rectangle + * @property leftCenter + * @type MicroPoint + **/ + public leftCenter: MicroPoint; + /** + * The x and y coordinate of the center of the rectangle + * @property center + * @type MicroPoint + **/ + public center: MicroPoint; + /** + * The x and y coordinate of the right-center of the rectangle + * @property rightCenter + * @type MicroPoint + **/ + public rightCenter: MicroPoint; + /** + * The x and y coordinate of the bottom-left corner of the rectangle + * @property bottomLeft + * @type MicroPoint + **/ + public bottomLeft: MicroPoint; + /** + * The x and y coordinate of the bottom-center of the rectangle + * @property bottomCenter + * @type MicroPoint + **/ + public bottomCenter: MicroPoint; + /** + * The x and y coordinate of the bottom-right corner of the rectangle + * @property bottomRight + * @type MicroPoint + **/ + public bottomRight: MicroPoint; + /** + * The width of the rectangle + * @property width + * @type Number + **/ + private _width; + /** + * The height of the rectangle + * @property height + * @type Number + **/ + private _height; + /** + * Half of the width of the rectangle + * @property halfWidth + * @type Number + **/ + private _halfWidth; + /** + * Half of the height of the rectangle + * @property halfHeight + * @type Number + **/ + private _halfHeight; + /** + * The size of the longest side (width or height) + * @property length + * @type Number + **/ + public length: number; + /** + * Updates all of the MicroPoints based on the values of width and height. + * You should not normally call this directly. + **/ + public updateBounds(): void; + /** + * The width of the rectangle + * @property width + * @type Number + **/ + /** + * The width of the rectangle + * @property width + * @type Number + **/ + public width : number; + /** + * The height of the rectangle + * @property height + * @type Number + **/ + /** + * The height of the rectangle + * @property height + * @type Number + **/ + public height : number; + /** + * Half of the width of the rectangle + * @property halfWidth + * @type Number + **/ + public halfWidth : number; + /** + * Half of the height of the rectangle + * @property halfHeight + * @type Number + **/ + public halfHeight : number; + /** + * The sum of the y and height properties. + * Changing the bottom property of a Rectangle object has no effect on the x, y and width properties, but does change the height property. + * @method bottom + * @return {Number} + **/ + /** + * The sum of the y and height properties. + * Changing the bottom property of a Rectangle object has no effect on the x, y and width properties, but does change the height property. + * @method bottom + * @param {Number} value + **/ + public bottom : number; + /** + * The x coordinate of the top-left corner of the rectangle. + * Changing the left property of a Rectangle object has no effect on the y and height properties. + * However it does affect the width property, whereas changing the x value does not affect the width property. + * @method left + * @ return {number} + **/ + /** + * The x coordinate of the top-left corner of the rectangle. + * Changing the left property of a Rectangle object has no effect on the y and height properties. + * However it does affect the width property, whereas changing the x value does not affect the width property. + * @method left + * @param {Number} value + **/ + public left : number; + /** + * The sum of the x and width properties. + * Changing the right property of a Rectangle object has no effect on the x, y and height properties. + * However it does affect the width property. + * @method right + * @return {Number} + **/ + /** + * The sum of the x and width properties. + * Changing the right property of a Rectangle object has no effect on the x, y and height properties. + * However it does affect the width property. + * @method right + * @param {Number} value + **/ + public right : number; + /** + * The size of the Rectangle object, expressed as a Point object with the values of the width and height properties. + * @method size + * @param {Point} output Optional Point object. If given the values will be set into the object, otherwise a brand new Point object will be created and returned. + * @return {Point} The size of the Rectangle object + **/ + public size(output?: Point): Point; + /** + * The volume of the Rectangle object in pixels, derived from width * height + * @method volume + * @return {Number} + **/ + public volume : number; + /** + * The perimeter size of the Rectangle object in pixels. This is the sum of all 4 sides. + * @method perimeter + * @return {Number} + **/ + public perimeter : number; + /** + * The y coordinate of the top-left corner of the rectangle. + * Changing the top property of a Rectangle object has no effect on the x and width properties. + * However it does affect the height property, whereas changing the y value does not affect the height property. + * @method top + * @return {Number} + **/ + /** + * The y coordinate of the top-left corner of the rectangle. + * Changing the top property of a Rectangle object has no effect on the x and width properties. + * However it does affect the height property, whereas changing the y value does not affect the height property. + * @method top + * @param {Number} value + **/ + public top : number; + /** + * Returns a new Rectangle object with the same values for the x, y, width, and height properties as the original Rectangle object. + * @method clone + * @param {Rectangle} output Optional Rectangle object. If given the values will be set into the object, otherwise a brand new Rectangle object will be created and returned. + * @return {Rectangle} + **/ + public clone(output?: Rectangle): Rectangle; + /** + * Determines whether the specified coordinates are contained within the region defined by this Rectangle object. + * @method contains + * @param {Number} x The x coordinate of the point to test. + * @param {Number} y The y coordinate of the point to test. + * @return {Boolean} A value of true if the Rectangle object contains the specified point; otherwise false. + **/ + public contains(x: number, y: number): bool; + /** + * Determines whether the specified point is contained within the rectangular region defined by this Rectangle object. + * This method is similar to the Rectangle.contains() method, except that it takes a Point object as a parameter. + * @method containsPoint + * @param {Point} point The point object being checked. Can be Point or any object with .x and .y values. + * @return {Boolean} A value of true if the Rectangle object contains the specified point; otherwise false. + **/ + public containsPoint(point: any): bool; + /** + * Determines whether the Rectangle object specified by the rect parameter is contained within this Rectangle object. + * A Rectangle object is said to contain another if the second Rectangle object falls entirely within the boundaries of the first. + * @method containsRect + * @param {Rectangle} rect The rectangle object being checked. + * @return {Boolean} A value of true if the Rectangle object contains the specified point; otherwise false. + **/ + public containsRect(rect: Rectangle): bool; + /** + * Copies all of rectangle data from the source Rectangle object into the calling Rectangle object. + * @method copyFrom + * @param {Rectangle} rect The source rectangle object to copy from + * @return {Rectangle} This rectangle object + **/ + public copyFrom(source: Rectangle): Rectangle; + /** + * Copies all the rectangle data from this Rectangle object into the destination Rectangle object. + * @method copyTo + * @param {Rectangle} rect The destination rectangle object to copy in to + * @return {Rectangle} The destination rectangle object + **/ + public copyTo(target: Rectangle): Rectangle; + /** + * Determines whether the object specified in the toCompare parameter is equal to this Rectangle object. + * This method compares the x, y, width, and height properties of an object against the same properties of this Rectangle object. + * @method equals + * @param {Rectangle} toCompare The rectangle to compare to this Rectangle object. + * @return {Boolean} A value of true if the object has exactly the same values for the x, y, width, and height properties as this Rectangle object; otherwise false. + **/ + public equals(toCompare: Rectangle): bool; + /** + * Increases the size of the Rectangle object by the specified amounts. + * The center point of the Rectangle object stays the same, and its size increases to the left and right by the dx value, + * and to the top and the bottom by the dy value. + * @method inflate + * @param {Number} dx The amount to be added to the left side of this Rectangle. + * @param {Number} dy The amount to be added to the bottom side of this Rectangle. + * @return {Rectangle} This Rectangle object. + **/ + public inflate(dx: number, dy: number): Rectangle; + /** + * Increases the size of the Rectangle object. + * This method is similar to the Rectangle.inflate() method except it takes a Point object as a parameter. + * @method inflatePoint + * @param {Point} point The x property of this Point object is used to increase the horizontal dimension of the Rectangle object. The y property is used to increase the vertical dimension of the Rectangle object. + * @return {Rectangle} This Rectangle object. + **/ + public inflatePoint(point: Point): Rectangle; + /** + * If the Rectangle object specified in the toIntersect parameter intersects with this Rectangle object, + * returns the area of intersection as a Rectangle object. If the rectangles do not intersect, this method + * returns an empty Rectangle object with its properties set to 0. + * @method intersection + * @param {Rectangle} toIntersect The Rectangle object to compare against to see if it intersects with this Rectangle object. + * @param {Rectangle} output Optional Rectangle object. If given the intersection values will be set into this object, otherwise a brand new Rectangle object will be created and returned. + * @return {Rectangle} A Rectangle object that equals the area of intersection. If the rectangles do not intersect, this method returns an empty Rectangle object; that is, a rectangle with its x, y, width, and height properties set to 0. + **/ + public intersection(toIntersect: Rectangle, output?: Rectangle): Rectangle; + /** + * Determines whether the object specified intersects (overlaps) with this Rectangle object. + * This method checks the x, y, width, and height properties of the specified Rectangle object to see if it intersects with this Rectangle object. + * @method intersects + * @param {Rectangle} r2 The Rectangle object to compare against to see if it intersects with this Rectangle object. + * @param {Number} t A tolerance value to allow for an intersection test with padding, default to 0 + * @return {Boolean} A value of true if the specified object intersects with this Rectangle object; otherwise false. + **/ + public intersects(r2: Rectangle, t?: number): bool; + /** + * Determines whether or not this Rectangle object is empty. + * @method isEmpty + * @return {Boolean} A value of true if the Rectangle object's width or height is less than or equal to 0; otherwise false. + **/ + public isEmpty : bool; + /** + * Adjusts the location of the Rectangle object, as determined by its top-left corner, by the specified amounts. + * @method offset + * @param {Number} dx Moves the x value of the Rectangle object by this amount. + * @param {Number} dy Moves the y value of the Rectangle object by this amount. + * @return {Rectangle} This Rectangle object. + **/ + public offset(dx: number, dy: number): Rectangle; + /** + * Adjusts the location of the Rectangle object using a Point object as a parameter. This method is similar to the Rectangle.offset() method, except that it takes a Point object as a parameter. + * @method offsetPoint + * @param {Point} point A Point object to use to offset this Rectangle object. + * @return {Rectangle} This Rectangle object. + **/ + public offsetPoint(point: Point): Rectangle; + /** + * Sets all of the Rectangle object's properties to 0. A Rectangle object is empty if its width or height is less than or equal to 0. + * @method setEmpty + * @return {Rectangle} This rectangle object + **/ + public setEmpty(): Rectangle; + /** + * Sets the members of Rectangle to the specified values. + * @method setTo + * @param {Number} x The x coordinate of the top-left corner of the rectangle. + * @param {Number} y The y coordinate of the top-left corner of the rectangle. + * @param {Number} width The width of the rectangle in pixels. + * @param {Number} height The height of the rectangle in pixels. + * @return {Rectangle} This rectangle object + **/ + public setTo(x: number, y: number, width: number, height: number): Rectangle; + /** + * Adds two rectangles together to create a new Rectangle object, by filling in the horizontal and vertical space between the two rectangles. + * @method union + * @param {Rectangle} toUnion A Rectangle object to add to this Rectangle object. + * @param {Rectangle} output Optional Rectangle object. If given the new values will be set into this object, otherwise a brand new Rectangle object will be created and returned. + * @return {Rectangle} A Rectangle object that is the union of the two rectangles. + **/ + public union(toUnion: Rectangle, output?: Rectangle): Rectangle; + /** + * Returns a string representation of this object. + * @method toString + * @return {string} a string representation of the instance. + **/ + public toString(): string; + } +} +/** +* Phaser - Quad +* +* A Quad object is an area defined by its position, as indicated by its top-left corner (x,y) and width and height. +* Very much like a Rectangle only without all of the additional methods and properties of that class. +*/ +module Phaser { + class Quad { + /** + * Creates a new Quad object with the top-left corner specified by the x and y parameters and with the specified width and height parameters. If you call this function without parameters, a rectangle with x, y, width, and height properties set to 0 is created. + * @class Quad + * @constructor + * @param {Number} x The x coordinate of the top-left corner of the quad. + * @param {Number} y The y coordinate of the top-left corner of the quad. + * @param {Number} width The width of the quad. + * @param {Number} height The height of the quad. + * @return {Quad } This object + **/ + constructor(x?: number, y?: number, width?: number, height?: number); + public x: number; + public y: number; + public width: number; + public height: number; + /** + * Sets the Quad to the specified size. + * @method setTo + * @param {Number} x The x coordinate of the top-left corner of the quad. + * @param {Number} y The y coordinate of the top-left corner of the quad. + * @param {Number} width The width of the quad. + * @param {Number} height The height of the quad. + * @return {Quad} This object + **/ + public setTo(x: number, y: number, width: number, height: number): Quad; + public left : number; + public right : number; + public top : number; + public bottom : number; + public halfWidth : number; + public halfHeight : number; + /** + * Determines whether the object specified intersects (overlaps) with this Quad object. + * This method checks the x, y, width, and height properties of the specified Quad object to see if it intersects with this Quad object. + * @method intersects + * @param {Object} q The object to check for intersection with this Quad. Must have left/right/top/bottom properties (Rectangle, Quad). + * @param {Number} t A tolerance value to allow for an intersection test with padding, default to 0 + * @return {Boolean} A value of true if the specified object intersects with this Quad; otherwise false. + **/ + public intersects(q, t?: number): bool; + /** + * Returns a string representation of this object. + * @method toString + * @return {string} a string representation of the object. + **/ + public toString(): string; + } +} +/** +* Phaser - Circle +* +* A Circle object is an area defined by its position, as indicated by its center point (x,y) and diameter. +*/ +module Phaser { + class Circle { + /** + * Creates a new Circle object with the center coordinate specified by the x and y parameters and the diameter specified by the diameter parameter. If you call this function without parameters, a circle with x, y, diameter and radius properties set to 0 is created. + * @class Circle + * @constructor + * @param {Number} x The x coordinate of the center of the circle. + * @param {Number} y The y coordinate of the center of the circle. + * @return {Circle} This circle object + **/ + constructor(x?: number, y?: number, diameter?: number); + private _diameter; + private _radius; + /** + * The x coordinate of the center of the circle + * @property x + * @type Number + **/ + public x: number; + /** + * The y coordinate of the center of the circle + * @property y + * @type Number + **/ + public y: number; + /** + * The diameter of the circle. The largest distance between any two points on the circle. The same as the radius * 2. + * @method diameter + * @return {Number} + **/ + /** + * The diameter of the circle. The largest distance between any two points on the circle. The same as the radius * 2. + * @method diameter + * @param {Number} The diameter of the circle. + **/ + public diameter : number; + /** + * The radius of the circle. The length of a line extending from the center of the circle to any point on the circle itself. The same as half the diameter. + * @method radius + * @return {Number} + **/ + /** + * The radius of the circle. The length of a line extending from the center of the circle to any point on the circle itself. The same as half the diameter. + * @method radius + * @param {Number} The radius of the circle. + **/ + public radius : number; + /** + * The circumference of the circle. + * @method circumference + * @return {Number} + **/ + public circumference(): number; + /** + * The sum of the y and radius properties. Changing the bottom property of a Circle object has no effect on the x and y properties, but does change the diameter. + * @method bottom + * @return {Number} + **/ + /** + * The sum of the y and radius properties. Changing the bottom property of a Circle object has no effect on the x and y properties, but does change the diameter. + * @method bottom + * @param {Number} The value to adjust the height of the circle by. + **/ + public bottom : number; + /** + * The x coordinate of the leftmost point of the circle. Changing the left property of a Circle object has no effect on the x and y properties. However it does affect the diameter, whereas changing the x value does not affect the diameter property. + * @method left + * @return {Number} The x coordinate of the leftmost point of the circle. + **/ + /** + * The x coordinate of the leftmost point of the circle. Changing the left property of a Circle object has no effect on the x and y properties. However it does affect the diameter, whereas changing the x value does not affect the diameter property. + * @method left + * @param {Number} The value to adjust the position of the leftmost point of the circle by. + **/ + public left : number; + /** + * The x coordinate of the rightmost point of the circle. Changing the right property of a Circle object has no effect on the x and y properties. However it does affect the diameter, whereas changing the x value does not affect the diameter property. + * @method right + * @return {Number} + **/ + /** + * The x coordinate of the rightmost point of the circle. Changing the right property of a Circle object has no effect on the x and y properties. However it does affect the diameter, whereas changing the x value does not affect the diameter property. + * @method right + * @param {Number} The amount to adjust the diameter of the circle by. + **/ + public right : number; + /** + * The sum of the y minus the radius property. Changing the top property of a Circle object has no effect on the x and y properties, but does change the diameter. + * @method bottom + * @return {Number} + **/ + /** + * The sum of the y minus the radius property. Changing the top property of a Circle object has no effect on the x and y properties, but does change the diameter. + * @method bottom + * @param {Number} The amount to adjust the height of the circle by. + **/ + public top : number; + /** + * Gets the area of this Circle. + * @method area + * @return {Number} This area of this circle. + **/ + public area : number; + /** + * Determines whether or not this Circle object is empty. + * @method isEmpty + * @return {Boolean} A value of true if the Circle objects diameter is less than or equal to 0; otherwise false. + **/ + public isEmpty : bool; + /** + * Whether the circle intersects with a line. Checks against infinite line defined by the two points on the line, not the line segment. + * If you need details about the intersection then use Collision.lineToCircle instead. + * @method intersectCircleLine + * @param {Object} the line object to check. + * @return {Boolean} + **/ + public intersectCircleLine(line: Line): bool; + /** + * Returns a new Circle object with the same values for the x, y, width, and height properties as the original Circle object. + * @method clone + * @param {Circle} output Optional Circle object. If given the values will be set into the object, otherwise a brand new Circle object will be created and returned. + * @return {Phaser.Circle} + **/ + public clone(output?: Circle): Circle; + /** + * Return true if the given x/y coordinates are within this Circle object. + * If you need details about the intersection then use Phaser.Intersect.circleContainsPoint instead. + * @method contains + * @param {Number} The X value of the coordinate to test. + * @param {Number} The Y value of the coordinate to test. + * @return {Boolean} True if the coordinates are within this circle, otherwise false. + **/ + public contains(x: number, y: number): bool; + /** + * Return true if the coordinates of the given Point object are within this Circle object. + * If you need details about the intersection then use Phaser.Intersect.circleContainsPoint instead. + * @method containsPoint + * @param {Phaser.Point} The Point object to test. + * @return {Boolean} True if the coordinates are within this circle, otherwise false. + **/ + public containsPoint(point: Point): bool; + /** + * Return true if the given Circle is contained entirely within this Circle object. + * If you need details about the intersection then use Phaser.Intersect.circleToCircle instead. + * @method containsCircle + * @param {Phaser.Circle} The Circle object to test. + * @return {Boolean} True if the coordinates are within this circle, otherwise false. + **/ + public containsCircle(circle: Circle): bool; + /** + * Copies all of circle data from the source Circle object into the calling Circle object. + * @method copyFrom + * @param {Circle} rect The source circle object to copy from + * @return {Circle} This circle object + **/ + public copyFrom(source: Circle): Circle; + /** + * Copies all of circle data from this Circle object into the destination Circle object. + * @method copyTo + * @param {Circle} circle The destination circle object to copy in to + * @return {Circle} The destination circle object + **/ + public copyTo(target: Circle): Circle; + /** + * Returns the distance from the center of this Circle object to the given object (can be Circle, Point or anything with x/y values) + * @method distanceFrom + * @param {Circle/Point} target - The destination Point object. + * @param {Boolean} round - Round the distance to the nearest integer (default false) + * @return {Number} The distance between this Point object and the destination Point object. + **/ + public distanceTo(target: any, round?: bool): number; + /** + * Determines whether the object specified in the toCompare parameter is equal to this Circle object. This method compares the x, y and diameter properties of an object against the same properties of this Circle object. + * @method equals + * @param {Circle} toCompare The circle to compare to this Circle object. + * @return {Boolean} A value of true if the object has exactly the same values for the x, y and diameter properties as this Circle object; otherwise false. + **/ + public equals(toCompare: Circle): bool; + /** + * Determines whether the Circle object specified in the toIntersect parameter intersects with this Circle object. This method checks the radius distances between the two Circle objects to see if they intersect. + * @method intersects + * @param {Circle} toIntersect The Circle object to compare against to see if it intersects with this Circle object. + * @return {Boolean} A value of true if the specified object intersects with this Circle object; otherwise false. + **/ + public intersects(toIntersect: Circle): bool; + /** + * Returns a Point object containing the coordinates of a point on the circumference of this Circle based on the given angle. + * @method circumferencePoint + * @param {Number} The angle in radians (unless asDegrees is true) to return the point from. + * @param {Boolean} Is the given angle in radians (false) or degrees (true)? + * @param {Phaser.Point} An optional Point object to put the result in to. If none specified a new Point object will be created. + * @return {Phaser.Point} The Point object holding the result. + **/ + public circumferencePoint(angle: number, asDegrees?: bool, output?: Point): Point; + /** + * Adjusts the location of the Circle object, as determined by its center coordinate, by the specified amounts. + * @method offset + * @param {Number} dx Moves the x value of the Circle object by this amount. + * @param {Number} dy Moves the y value of the Circle object by this amount. + * @return {Circle} This Circle object. + **/ + public offset(dx: number, dy: number): Circle; + /** + * Adjusts the location of the Circle object using a Point object as a parameter. This method is similar to the Circle.offset() method, except that it takes a Point object as a parameter. + * @method offsetPoint + * @param {Point} point A Point object to use to offset this Circle object. + * @return {Circle} This Circle object. + **/ + public offsetPoint(point: Point): Circle; + /** + * Sets the members of Circle to the specified values. + * @method setTo + * @param {Number} x The x coordinate of the center of the circle. + * @param {Number} y The y coordinate of the center of the circle. + * @param {Number} diameter The diameter of the circle in pixels. + * @return {Circle} This circle object + **/ + public setTo(x: number, y: number, diameter: number): Circle; + /** + * Returns a string representation of this object. + * @method toString + * @return {string} a string representation of the instance. + **/ + public toString(): string; + } +} +/** +* Phaser - Line +* +* A Line object is an infinte line through space. The two sets of x/y coordinates define the Line Segment. +*/ +module Phaser { + class Line { + /** + * + * @constructor + * @param {Number} x1 + * @param {Number} y1 + * @param {Number} x2 + * @param {Number} y2 + * @return {Phaser.Line} This Object + */ + constructor(x1?: number, y1?: number, x2?: number, y2?: number); + /** + * + * @property x1 + * @type Number + */ + public x1: number; + /** + * + * @property y1 + * @type Number + */ + public y1: number; + /** + * + * @property x2 + * @type Number + */ + public x2: number; + /** + * + * @property y2 + * @type Number + */ + public y2: number; + /** + * + * @method clone + * @param {Phaser.Line} [output] + * @return {Phaser.Line} + */ + public clone(output?: Line): Line; + /** + * + * @method copyFrom + * @param {Phaser.Line} source + * @return {Phaser.Line} + */ + public copyFrom(source: Line): Line; + /** + * + * @method copyTo + * @param {Phaser.Line} target + * @return {Phaser.Line} + */ + public copyTo(target: Line): Line; + /** + * + * @method setTo + * @param {Number} x1 + * @param {Number} y1 + * @param {Number} x2 + * @param {Number} y2 + * @return {Phaser.Line} + */ + public setTo(x1?: number, y1?: number, x2?: number, y2?: number): Line; + public width : number; + public height : number; + /** + * + * @method length + * @return {Number} + */ + public length : number; + /** + * + * @method getY + * @param {Number} x + * @return {Number} + */ + public getY(x: number): number; + /** + * + * @method angle + * @return {Number} + */ + public angle : number; + /** + * + * @method slope + * @return {Number} + */ + public slope : number; + /** + * + * @method perpSlope + * @return {Number} + */ + public perpSlope : number; + /** + * + * @method yIntercept + * @return {Number} + */ + public yIntercept : number; + /** + * + * @method isPointOnLine + * @param {Number} x + * @param {Number} y + * @return {Boolean} + */ + public isPointOnLine(x: number, y: number): bool; + /** + * + * @method isPointOnLineSegment + * @param {Number} x + * @param {Number} y + * @return {Boolean} + */ + public isPointOnLineSegment(x: number, y: number): bool; + /** + * + * @method intersectLineLine + * @param {Any} line + * @return {Any} + */ + public intersectLineLine(line): any; + /** + * + * @method perp + * @param {Number} x + * @param {Number} y + * @param {Phaser.Line} [output] + * @return {Phaser.Line} + */ + public perp(x: number, y: number, output?: Line): Line; + /** + * + * @method toString + * @return {String} + */ + public toString(): string; + } +} +/** +* Phaser - IntersectResult +* +* A light-weight result object to hold the results of an intersection. For when you need more than just true/false. +*/ +module Phaser { + class IntersectResult { + /** + * Did they intersect or not? + * @property result + * @type Boolean + */ + public result: bool; + /** + * @property x + * @type Number + */ + public x: number; + /** + * @property y + * @type Number + */ + public y: number; + /** + * @property x1 + * @type Number + */ + public x1: number; + /** + * @property y1 + * @type Number + */ + public y1: number; + /** + * @property x2 + * @type Number + */ + public x2: number; + /** + * @property y2 + * @type Number + */ + public y2: number; + /** + * @property width + * @type Number + */ + public width: number; + /** + * @property height + * @type Number + */ + public height: number; + /** + * + * @method setTo + * @param {Number} x1 + * @param {Number} y1 + * @param {Number} [x2] + * @param {Number} [y2] + * @param {Number} [width] + * @param {Number} [height] + */ + public setTo(x1: number, y1: number, x2?: number, y2?: number, width?: number, height?: number): void; + } +} +/** +* Phaser - LinkedList +* +* A miniature linked list class. Useful for optimizing time-critical or highly repetitive tasks! +*/ +module Phaser { + class LinkedList { + /** + * Creates a new link, and sets object and next to null. + */ + constructor(); + /** + * Stores a reference to an Basic. + */ + public object: Basic; + /** + * Stores a reference to the next link in the list. + */ + public next: LinkedList; + /** + * Clean up memory. + */ + public destroy(): void; + } +} +/** +* Phaser - QuadTree +* +* A fairly generic quad tree structure for rapid overlap checks. QuadTree is also configured for single or dual list operation. +* You can add items either to its A list or its B list. When you do an overlap check, you can compare the A list to itself, +* or the A list against the B list. Handy for different things! +*/ +module Phaser { + class QuadTree extends Rectangle { + /** + * Instantiate a new Quad Tree node. + * + * @param X The X-coordinate of the point in space. + * @param Y The Y-coordinate of the point in space. + * @param Width Desired width of this node. + * @param Height Desired height of this node. + * @param Parent The parent branch or node. Pass null to create a root. + */ + constructor(X: number, Y: number, Width: number, Height: number, Parent?: QuadTree); + /** + * Flag for specifying that you want to add an object to the A list. + */ + static A_LIST: number; + /** + * Flag for specifying that you want to add an object to the B list. + */ + static B_LIST: number; + /** + * Controls the granularity of the quad tree. Default is 6 (decent performance on large and small worlds). + */ + static divisions: number; + /** + * Whether this branch of the tree can be subdivided or not. + */ + private _canSubdivide; + /** + * Refers to the internal A and B linked lists, + * which are used to store objects in the leaves. + */ + private _headA; + /** + * Refers to the internal A and B linked lists, + * which are used to store objects in the leaves. + */ + private _tailA; + /** + * Refers to the internal A and B linked lists, + * which are used to store objects in the leaves. + */ + private _headB; + /** + * Refers to the internal A and B linked lists, + * which are used to store objects in the leaves. + */ + private _tailB; + /** + * Internal, governs and assists with the formation of the tree. + */ + private static _min; + /** + * Internal, governs and assists with the formation of the tree. + */ + private _northWestTree; + /** + * Internal, governs and assists with the formation of the tree. + */ + private _northEastTree; + /** + * Internal, governs and assists with the formation of the tree. + */ + private _southEastTree; + /** + * Internal, governs and assists with the formation of the tree. + */ + private _southWestTree; + /** + * Internal, governs and assists with the formation of the tree. + */ + private _leftEdge; + /** + * Internal, governs and assists with the formation of the tree. + */ + private _rightEdge; + /** + * Internal, governs and assists with the formation of the tree. + */ + private _topEdge; + /** + * Internal, governs and assists with the formation of the tree. + */ + private _bottomEdge; + /** + * Internal, governs and assists with the formation of the tree. + */ + private _halfWidth; + /** + * Internal, governs and assists with the formation of the tree. + */ + private _halfHeight; + /** + * Internal, governs and assists with the formation of the tree. + */ + private _midpointX; + /** + * Internal, governs and assists with the formation of the tree. + */ + private _midpointY; + /** + * Internal, used to reduce recursive method parameters during object placement and tree formation. + */ + private static _object; + /** + * Internal, used to reduce recursive method parameters during object placement and tree formation. + */ + private static _objectLeftEdge; + /** + * Internal, used to reduce recursive method parameters during object placement and tree formation. + */ + private static _objectTopEdge; + /** + * Internal, used to reduce recursive method parameters during object placement and tree formation. + */ + private static _objectRightEdge; + /** + * Internal, used to reduce recursive method parameters during object placement and tree formation. + */ + private static _objectBottomEdge; + /** + * Internal, used during tree processing and overlap checks. + */ + private static _list; + /** + * Internal, used during tree processing and overlap checks. + */ + private static _useBothLists; + /** + * Internal, used during tree processing and overlap checks. + */ + private static _processingCallback; + /** + * Internal, used during tree processing and overlap checks. + */ + private static _notifyCallback; + /** + * Internal, used during tree processing and overlap checks. + */ + private static _iterator; + /** + * Internal, helpers for comparing actual object-to-object overlap - see overlapNode(). + */ + private static _objectHullX; + /** + * Internal, helpers for comparing actual object-to-object overlap - see overlapNode(). + */ + private static _objectHullY; + /** + * Internal, helpers for comparing actual object-to-object overlap - see overlapNode(). + */ + private static _objectHullWidth; + /** + * Internal, helpers for comparing actual object-to-object overlap - see overlapNode(). + */ + private static _objectHullHeight; + /** + * Internal, helpers for comparing actual object-to-object overlap - see overlapNode(). + */ + private static _checkObjectHullX; + /** + * Internal, helpers for comparing actual object-to-object overlap - see overlapNode(). + */ + private static _checkObjectHullY; + /** + * Internal, helpers for comparing actual object-to-object overlap - see overlapNode(). + */ + private static _checkObjectHullWidth; + /** + * Internal, helpers for comparing actual object-to-object overlap - see overlapNode(). + */ + private static _checkObjectHullHeight; + /** + * Clean up memory. + */ + public destroy(): void; + /** + * Load objects and/or groups into the quad tree, and register notify and processing callbacks. + * + * @param ObjectOrGroup1 Any object that is or extends GameObject or Group. + * @param ObjectOrGroup2 Any object that is or extends GameObject or Group. If null, the first parameter will be checked against itself. + * @param NotifyCallback A function with the form myFunction(Object1:GameObject,Object2:GameObject) that is called whenever two objects are found to overlap in world space, and either no ProcessCallback is specified, or the ProcessCallback returns true. + * @param ProcessCallback A function with the form myFunction(Object1:GameObject,Object2:GameObject):bool that is called whenever two objects are found to overlap in world space. The NotifyCallback is only called if this function returns true. See GameObject.separate(). + */ + public load(ObjectOrGroup1: Basic, ObjectOrGroup2?: Basic, NotifyCallback?, ProcessCallback?): void; + /** + * Call this function to add an object to the root of the tree. + * This function will recursively add all group members, but + * not the groups themselves. + * + * @param ObjectOrGroup GameObjects are just added, Groups are recursed and their applicable members added accordingly. + * @param List A uint flag indicating the list to which you want to add the objects. Options are QuadTree.A_LIST and QuadTree.B_LIST. + */ + public add(ObjectOrGroup: Basic, List: number): void; + /** + * Internal function for recursively navigating and creating the tree + * while adding objects to the appropriate nodes. + */ + private addObject(); + /** + * Internal function for recursively adding objects to leaf lists. + */ + private addToList(); + /** + * QuadTree's other main function. Call this after adding objects + * using QuadTree.load() to compare the objects that you loaded. + * + * @return Whether or not any overlaps were found. + */ + public execute(): bool; + /** + * An private for comparing an object against the contents of a node. + * + * @return Whether or not any overlaps were found. + */ + private overlapNode(); + } +} +/** +* Phaser - Collision +* +* A set of extremely useful collision and geometry intersection functions. +*/ +module Phaser { + class Collision { + /** + * Collision constructor + * @param game A reference to the current Game + */ + constructor(game: Game); + /** + * Local private reference to Game + */ + private _game; + /** + * Flag used to allow GameObjects to collide on their left side + * @type {number} + */ + static LEFT: number; + /** + * Flag used to allow GameObjects to collide on their right side + * @type {number} + */ + static RIGHT: number; + /** + * Flag used to allow GameObjects to collide on their top side + * @type {number} + */ + static UP: number; + /** + * Flag used to allow GameObjects to collide on their bottom side + * @type {number} + */ + static DOWN: number; + /** + * Flag used with GameObjects to disable collision + * @type {number} + */ + static NONE: number; + /** + * Flag used to allow GameObjects to collide with a ceiling + * @type {number} + */ + static CEILING: number; + /** + * Flag used to allow GameObjects to collide with a floor + * @type {number} + */ + static FLOOR: number; + /** + * Flag used to allow GameObjects to collide with a wall (same as LEFT+RIGHT) + * @type {number} + */ + static WALL: number; + /** + * Flag used to allow GameObjects to collide on any face + * @type {number} + */ + static ANY: number; + /** + * The overlap bias is used when calculating hull overlap before separation - change it if you have especially small or large GameObjects + * @type {number} + */ + static OVERLAP_BIAS: number; + /** + * This holds the result of the tile separation check, true if the object was moved, otherwise false + * @type {boolean} + */ + static TILE_OVERLAP: bool; + /** + * A temporary Quad used in the separation process to help avoid gc spikes + * @type {Quad} + */ + static _tempBounds: Quad; + /** + * Checks for Line to Line intersection and returns an IntersectResult object containing the results of the intersection. + * @param line1 The first Line object to check + * @param line2 The second Line object to check + * @param output An optional IntersectResult object to store the intersection values in. One is created if none given. + * @returns {IntersectResult=} An IntersectResult object containing the results of the intersection + */ + static lineToLine(line1: Line, line2: Line, output?: IntersectResult): IntersectResult; + /** + * Checks for Line to Line Segment intersection and returns an IntersectResult object containing the results of the intersection. + * @param line The Line object to check + * @param seg The Line segment object to check + * @param output An optional IntersectResult object to store the intersection values in. One is created if none given. + * @returns {IntersectResult=} An IntersectResult object containing the results of the intersection + */ + static lineToLineSegment(line: Line, seg: Line, output?: IntersectResult): IntersectResult; + /** + * Checks for Line to Raw Line Segment intersection and returns the result in the IntersectResult object. + * @param line The Line object to check + * @param x1 The start x coordinate of the raw segment + * @param y1 The start y coordinate of the raw segment + * @param x2 The end x coordinate of the raw segment + * @param y2 The end y coordinate of the raw segment + * @param output An optional IntersectResult object to store the intersection values in. One is created if none given. + * @returns {IntersectResult=} An IntersectResult object containing the results of the intersection + */ + static lineToRawSegment(line: Line, x1: number, y1: number, x2: number, y2: number, output?: IntersectResult): IntersectResult; + /** + * Checks for Line to Ray intersection and returns the result in an IntersectResult object. + * @param line1 The Line object to check + * @param ray The Ray object to check + * @param output An optional IntersectResult object to store the intersection values in. One is created if none given. + * @returns {IntersectResult=} An IntersectResult object containing the results of the intersection + */ + static lineToRay(line1: Line, ray: Line, output?: IntersectResult): IntersectResult; + /** + * Check if the Line and Circle objects intersect + * @param line The Line object to check + * @param circle The Circle object to check + * @param output An optional IntersectResult object to store the intersection values in. One is created if none given. + * @returns {IntersectResult=} An IntersectResult object containing the results of the intersection + */ + static lineToCircle(line: Line, circle: Circle, output?: IntersectResult): IntersectResult; + /** + * Check if the Line intersects each side of the Rectangle + * @param line The Line object to check + * @param rect The Rectangle object to check + * @param output An optional IntersectResult object to store the intersection values in. One is created if none given. + * @returns {IntersectResult=} An IntersectResult object containing the results of the intersection + */ + static lineToRectangle(line: Line, rect: Rectangle, output?: IntersectResult): IntersectResult; + /** + * Check if the two Line Segments intersect and returns the result in an IntersectResult object. + * @param line1 The first Line Segment to check + * @param line2 The second Line Segment to check + * @param output An optional IntersectResult object to store the intersection values in. One is created if none given. + * @returns {IntersectResult=} An IntersectResult object containing the results of the intersection + */ + static lineSegmentToLineSegment(line1: Line, line2: Line, output?: IntersectResult): IntersectResult; + /** + * Check if the Line Segment intersects with the Ray and returns the result in an IntersectResult object. + * @param line The Line Segment to check. + * @param ray The Ray to check. + * @param output An optional IntersectResult object to store the intersection values in. One is created if none given. + * @returns {IntersectResult=} An IntersectResult object containing the results of the intersection + */ + static lineSegmentToRay(line: Line, ray: Line, output?: IntersectResult): IntersectResult; + /** + * Check if the Line Segment intersects with the Circle and returns the result in an IntersectResult object. + * @param seg The Line Segment to check. + * @param circle The Circle to check + * @param output An optional IntersectResult object to store the intersection values in. One is created if none given. + * @returns {IntersectResult=} An IntersectResult object containing the results of the intersection + */ + static lineSegmentToCircle(seg: Line, circle: Circle, output?: IntersectResult): IntersectResult; + /** + * Check if the Line Segment intersects with the Rectangle and returns the result in an IntersectResult object. + * @param seg The Line Segment to check. + * @param rect The Rectangle to check. + * @param output An optional IntersectResult object to store the intersection values in. One is created if none given. + * @returns {IntersectResult=} An IntersectResult object containing the results of the intersection + */ + static lineSegmentToRectangle(seg: Line, rect: Rectangle, output?: IntersectResult): IntersectResult; + /** + * Check for Ray to Rectangle intersection and returns the result in an IntersectResult object. + * @param ray The Ray to check. + * @param rect The Rectangle to check. + * @param output An optional IntersectResult object to store the intersection values in. One is created if none given. + * @returns {IntersectResult=} An IntersectResult object containing the results of the intersection + */ + static rayToRectangle(ray: Line, rect: Rectangle, output?: IntersectResult): IntersectResult; + /** + * Check whether a Ray intersects a Line segment and returns the parametric value where the intersection occurs in an IntersectResult object. + * @param rayX1 + * @param rayY1 + * @param rayX2 + * @param rayY2 + * @param lineX1 + * @param lineY1 + * @param lineX2 + * @param lineY2 + * @param output An optional IntersectResult object to store the intersection values in. One is created if none given. + * @returns {IntersectResult=} An IntersectResult object containing the results of the intersection + */ + static rayToLineSegment(rayX1, rayY1, rayX2, rayY2, lineX1, lineY1, lineX2, lineY2, output?: IntersectResult): IntersectResult; + /** + * Determines whether the specified point is contained within the rectangular region defined by the Rectangle object and returns the result in an IntersectResult object. + * @param point The Point or MicroPoint object to check, or any object with x and y properties. + * @param rect The Rectangle object to check the point against + * @param output An optional IntersectResult object to store the intersection values in. One is created if none given. + * @returns {IntersectResult=} An IntersectResult object containing the results of the intersection + */ + static pointToRectangle(point, rect: Rectangle, output?: IntersectResult): IntersectResult; + /** + * Check whether two axis aligned Rectangles intersect and returns the intersecting rectangle dimensions in an IntersectResult object if they do. + * @param rect1 The first Rectangle object. + * @param rect2 The second Rectangle object. + * @param output An optional IntersectResult object to store the intersection values in. One is created if none given. + * @returns {IntersectResult=} An IntersectResult object containing the results of the intersection + */ + static rectangleToRectangle(rect1: Rectangle, rect2: Rectangle, output?: IntersectResult): IntersectResult; + /** + * Checks if the Rectangle and Circle objects intersect and returns the result in an IntersectResult object. + * @param rect The Rectangle object to check + * @param circle The Circle object to check + * @param output An optional IntersectResult object to store the intersection values in. One is created if none given. + * @returns {IntersectResult=} An IntersectResult object containing the results of the intersection + */ + static rectangleToCircle(rect: Rectangle, circle: Circle, output?: IntersectResult): IntersectResult; + /** + * Checks if the two Circle objects intersect and returns the result in an IntersectResult object. + * @param circle1 The first Circle object to check + * @param circle2 The second Circle object to check + * @param output An optional IntersectResult object to store the intersection values in. One is created if none given. + * @returns {IntersectResult=} An IntersectResult object containing the results of the intersection + */ + static circleToCircle(circle1: Circle, circle2: Circle, output?: IntersectResult): IntersectResult; + /** + * Checks if the Circle object intersects with the Rectangle and returns the result in an IntersectResult object. + * @param circle The Circle object to check + * @param rect The Rectangle object to check + * @param output An optional IntersectResult object to store the intersection values in. One is created if none given. + * @returns {IntersectResult=} An IntersectResult object containing the results of the intersection + */ + static circleToRectangle(circle: Circle, rect: Rectangle, output?: IntersectResult): IntersectResult; + /** + * Checks if the Point object is contained within the Circle and returns the result in an IntersectResult object. + * @param circle The Circle object to check + * @param point A Point or MicroPoint object to check, or any object with x and y properties + * @param output An optional IntersectResult object to store the intersection values in. One is created if none given. + * @returns {IntersectResult=} An IntersectResult object containing the results of the intersection + */ + static circleContainsPoint(circle: Circle, point, output?: IntersectResult): IntersectResult; + /** + * Checks for overlaps between two objects using the world QuadTree. Can be GameObject vs. GameObject, GameObject vs. Group or Group vs. Group. + * Note: Does not take the objects scrollFactor into account. All overlaps are check in world space. + * @param object1 The first GameObject or Group to check. If null the world.group is used. + * @param object2 The second GameObject or Group to check. + * @param notifyCallback A callback function that is called if the objects overlap. The two objects will be passed to this function in the same order in which you passed them to Collision.overlap. + * @param processCallback A callback function that lets you perform additional checks against the two objects if they overlap. If this is set then notifyCallback will only be called if processCallback returns true. + * @returns {boolean} true if the objects overlap, otherwise false. + */ + public overlap(object1?: Basic, object2?: Basic, notifyCallback?, processCallback?): bool; + /** + * The core Collision separation function used by Collision.overlap. + * @param object1 The first GameObject to separate + * @param object2 The second GameObject to separate + * @returns {boolean} Returns true if the objects were separated, otherwise false. + */ + static separate(object1, object2): bool; + /** + * Collision resolution specifically for GameObjects vs. Tiles. + * @param object The GameObject to separate + * @param tile The Tile to separate + * @returns {boolean} Whether the objects in fact touched and were separated + */ + static separateTile(object: GameObject, x: number, y: number, width: number, height: number, mass: number, collideLeft: bool, collideRight: bool, collideUp: bool, collideDown: bool): bool; + /** + * Separates the two objects on their x axis + * @param object The GameObject to separate + * @param tile The Tile to separate + * @returns {boolean} Whether the objects in fact touched and were separated along the X axis. + */ + static separateTileX(object: GameObject, x: number, y: number, width: number, height: number, mass: number, collideLeft: bool, collideRight: bool): bool; + /** + * Separates the two objects on their y axis + * @param object The first GameObject to separate + * @param tile The second GameObject to separate + * @returns {boolean} Whether the objects in fact touched and were separated along the Y axis. + */ + static separateTileY(object: GameObject, x: number, y: number, width: number, height: number, mass: number, collideUp: bool, collideDown: bool): bool; + /** + * Separates the two objects on their x axis + * @param object1 The first GameObject to separate + * @param object2 The second GameObject to separate + * @returns {boolean} Whether the objects in fact touched and were separated along the X axis. + */ + static separateX(object1, object2): bool; + /** + * Separates the two objects on their y axis + * @param object1 The first GameObject to separate + * @param object2 The second GameObject to separate + * @returns {boolean} Whether the objects in fact touched and were separated along the Y axis. + */ + static separateY(object1, object2): bool; + /** + * Returns the distance between the two given coordinates. + * @param x1 The X value of the first coordinate + * @param y1 The Y value of the first coordinate + * @param x2 The X value of the second coordinate + * @param y2 The Y value of the second coordinate + * @returns {number} The distance between the two coordinates + */ + static distance(x1: number, y1: number, x2: number, y2: number): number; + /** + * Returns the distanced squared between the two given coordinates. + * @param x1 The X value of the first coordinate + * @param y1 The Y value of the first coordinate + * @param x2 The X value of the second coordinate + * @param y2 The Y value of the second coordinate + * @returns {number} The distance between the two coordinates + */ + static distanceSquared(x1: number, y1: number, x2: number, y2: number): number; + } +} +/** +* Phaser - DynamicTexture +* +* A DynamicTexture can be thought of as a mini canvas into which you can draw anything. +* Game Objects can be assigned a DynamicTexture, so when they render in the world they do so +* based on the contents of the texture at the time. This allows you to create powerful effects +* once and have them replicated across as many game objects as you like. +*/ +module Phaser { + class DynamicTexture { + constructor(game: Game, width: number, height: number); + private _game; + private _sx; + private _sy; + private _sw; + private _sh; + private _dx; + private _dy; + private _dw; + private _dh; + public bounds: Rectangle; + public canvas: HTMLCanvasElement; + public context: CanvasRenderingContext2D; + public getPixel(x: number, y: number): number; + public getPixel32(x: number, y: number): number; + public getPixels(rect: Rectangle): ImageData; + public setPixel(x: number, y: number, color: number): void; + public setPixel32(x: number, y: number, color: number): void; + public setPixels(rect: Rectangle, input): void; + public fillRect(rect: Rectangle, color: number): void; + public pasteImage(key: string, frame?: number, destX?: number, destY?: number, destWidth?: number, destHeight?: number): void; + public copyPixels(sourceTexture: DynamicTexture, sourceRect: Rectangle, destPoint: Point): void; + public clear(): void; + public width : number; + public height : number; + /** + * Given an alpha and 3 color values this will return an integer representation of it + * + * @param alpha The Alpha value (between 0 and 255) + * @param red The Red channel value (between 0 and 255) + * @param green The Green channel value (between 0 and 255) + * @param blue The Blue channel value (between 0 and 255) + * + * @return A native color value integer (format: 0xAARRGGBB) + */ + private getColor32(alpha, red, green, blue); + /** + * Given 3 color values this will return an integer representation of it + * + * @param red The Red channel value (between 0 and 255) + * @param green The Green channel value (between 0 and 255) + * @param blue The Blue channel value (between 0 and 255) + * + * @return A native color value integer (format: 0xRRGGBB) + */ + private getColor(red, green, blue); + } +} +/** +* Phaser - GameMath +* +* Adds a set of extra Math functions used through-out Phaser. +* Includes methods written by Dylan Engelman and Adam Saltsman. +*/ +module Phaser { + class GameMath { + constructor(game: Game); + private _game; + static PI: number; + static PI_2: number; + static PI_4: number; + static PI_8: number; + static PI_16: number; + static TWO_PI: number; + static THREE_PI_2: number; + static E: number; + static LN10: number; + static LN2: number; + static LOG10E: number; + static LOG2E: number; + static SQRT1_2: number; + static SQRT2: number; + static DEG_TO_RAD: number; + static RAD_TO_DEG: number; + static B_16: number; + static B_31: number; + static B_32: number; + static B_48: number; + static B_53: number; + static B_64: number; + static ONE_THIRD: number; + static TWO_THIRDS: number; + static ONE_SIXTH: number; + static COS_PI_3: number; + static SIN_2PI_3: number; + static CIRCLE_ALPHA: number; + static ON: bool; + static OFF: bool; + static SHORT_EPSILON: number; + static PERC_EPSILON: number; + static EPSILON: number; + static LONG_EPSILON: number; + public cosTable: any[]; + public sinTable: any[]; + public fuzzyEqual(a: number, b: number, epsilon?: number): bool; + public fuzzyLessThan(a: number, b: number, epsilon?: number): bool; + public fuzzyGreaterThan(a: number, b: number, epsilon?: number): bool; + public fuzzyCeil(val: number, epsilon?: number): number; + public fuzzyFloor(val: number, epsilon?: number): number; + public average(...args: any[]): number; + public slam(value: number, target: number, epsilon?: number): number; + /** + * ratio of value to a range + */ + public percentageMinMax(val: number, max: number, min?: number): number; + /** + * a value representing the sign of the value. + * -1 for negative, +1 for positive, 0 if value is 0 + */ + public sign(n: number): number; + public truncate(n: number): number; + public shear(n: number): number; + /** + * wrap a value around a range, similar to modulus with a floating minimum + */ + public wrap(val: number, max: number, min?: number): number; + /** + * arithmetic version of wrap... need to decide which is more efficient + */ + public arithWrap(value: number, max: number, min?: number): number; + /** + * force a value within the boundaries of two values + * + * if max < min, min is returned + */ + public clamp(input: number, max: number, min?: number): number; + /** + * Snap a value to nearest grid slice, using rounding. + * + * example if you have an interval gap of 5 and a position of 12... you will snap to 10. Where as 14 will snap to 15 + * + * @param input - the value to snap + * @param gap - the interval gap of the grid + * @param start - optional starting offset for gap + */ + public snapTo(input: number, gap: number, start?: number): number; + /** + * Snap a value to nearest grid slice, using floor. + * + * example if you have an interval gap of 5 and a position of 12... you will snap to 10. As will 14 snap to 10... but 16 will snap to 15 + * + * @param input - the value to snap + * @param gap - the interval gap of the grid + * @param start - optional starting offset for gap + */ + public snapToFloor(input: number, gap: number, start?: number): number; + /** + * Snap a value to nearest grid slice, using ceil. + * + * example if you have an interval gap of 5 and a position of 12... you will snap to 15. As will 14 will snap to 15... but 16 will snap to 20 + * + * @param input - the value to snap + * @param gap - the interval gap of the grid + * @param start - optional starting offset for gap + */ + public snapToCeil(input: number, gap: number, start?: number): number; + /** + * Snaps a value to the nearest value in an array. + */ + public snapToInArray(input: number, arr: number[], sort?: bool): number; + /** + * roundTo some place comparative to a 'base', default is 10 for decimal place + * + * 'place' is represented by the power applied to 'base' to get that place + * + * @param value - the value to round + * @param place - the place to round to + * @param base - the base to round in... default is 10 for decimal + * + * e.g. + * + * 2000/7 ~= 285.714285714285714285714 ~= (bin)100011101.1011011011011011 + * + * roundTo(2000/7,3) == 0 + * roundTo(2000/7,2) == 300 + * roundTo(2000/7,1) == 290 + * roundTo(2000/7,0) == 286 + * roundTo(2000/7,-1) == 285.7 + * roundTo(2000/7,-2) == 285.71 + * roundTo(2000/7,-3) == 285.714 + * roundTo(2000/7,-4) == 285.7143 + * roundTo(2000/7,-5) == 285.71429 + * + * roundTo(2000/7,3,2) == 288 -- 100100000 + * roundTo(2000/7,2,2) == 284 -- 100011100 + * roundTo(2000/7,1,2) == 286 -- 100011110 + * roundTo(2000/7,0,2) == 286 -- 100011110 + * roundTo(2000/7,-1,2) == 285.5 -- 100011101.1 + * roundTo(2000/7,-2,2) == 285.75 -- 100011101.11 + * roundTo(2000/7,-3,2) == 285.75 -- 100011101.11 + * roundTo(2000/7,-4,2) == 285.6875 -- 100011101.1011 + * roundTo(2000/7,-5,2) == 285.71875 -- 100011101.10111 + * + * note what occurs when we round to the 3rd space (8ths place), 100100000, this is to be assumed + * because we are rounding 100011.1011011011011011 which rounds up. + */ + public roundTo(value: number, place?: number, base?: number): number; + public floorTo(value: number, place?: number, base?: number): number; + public ceilTo(value: number, place?: number, base?: number): number; + /** + * a one dimensional linear interpolation of a value. + */ + public interpolateFloat(a: number, b: number, weight: number): number; + /** + * convert radians to degrees + */ + public radiansToDegrees(angle: number): number; + /** + * convert degrees to radians + */ + public degreesToRadians(angle: number): number; + /** + * Find the angle of a segment from (x1, y1) -> (x2, y2 ) + */ + public angleBetween(x1: number, y1: number, x2: number, y2: number): number; + /** + * set an angle with in the bounds of -PI to PI + */ + public normalizeAngle(angle: number, radians?: bool): number; + /** + * closest angle between two angles from a1 to a2 + * absolute value the return for exact angle + */ + public nearestAngleBetween(a1: number, a2: number, radians?: bool): number; + /** + * normalizes independent and then sets dep to the nearest value respective to independent + * + * for instance if dep=-170 and ind=170 then 190 will be returned as an alternative to -170 + */ + public normalizeAngleToAnother(dep: number, ind: number, radians?: bool): number; + /** + * normalize independent and dependent and then set dependent to an angle relative to 'after/clockwise' independent + * + * for instance dep=-170 and ind=170, then 190 will be reutrned as alternative to -170 + */ + public normalizeAngleAfterAnother(dep: number, ind: number, radians?: bool): number; + /** + * normalizes indendent and dependent and then sets dependent to an angle relative to 'before/counterclockwise' independent + * + * for instance dep = 190 and ind = 170, then -170 will be returned as an alternative to 190 + */ + public normalizeAngleBeforeAnother(dep: number, ind: number, radians?: bool): number; + /** + * interpolate across the shortest arc between two angles + */ + public interpolateAngles(a1: number, a2: number, weight: number, radians?: bool, ease?): number; + /** + * Compute the logarithm of any value of any base + * + * a logarithm is the exponent that some constant (base) would have to be raised to + * to be equal to value. + * + * i.e. + * 4 ^ x = 16 + * can be rewritten as to solve for x + * logB4(16) = x + * which with this function would be + * LoDMath.logBaseOf(16,4) + * + * which would return 2, because 4^2 = 16 + */ + public logBaseOf(value: number, base: number): number; + /** + * Greatest Common Denominator using Euclid's algorithm + */ + public GCD(m: number, n: number): number; + /** + * Lowest Common Multiple + */ + public LCM(m: number, n: number): number; + /** + * Factorial - N! + * + * simple product series + * + * by definition: + * 0! == 1 + */ + public factorial(value: number): number; + /** + * gamma function + * + * defined: gamma(N) == (N - 1)! + */ + public gammaFunction(value: number): number; + /** + * falling factorial + * + * defined: (N)! / (N - x)! + * + * written subscript: (N)x OR (base)exp + */ + public fallingFactorial(base: number, exp: number): number; + /** + * rising factorial + * + * defined: (N + x - 1)! / (N - 1)! + * + * written superscript N^(x) OR base^(exp) + */ + public risingFactorial(base: number, exp: number): number; + /** + * binomial coefficient + * + * defined: N! / (k!(N-k)!) + * reduced: N! / (N-k)! == (N)k (fallingfactorial) + * reduced: (N)k / k! + */ + public binCoef(n: number, k: number): number; + /** + * rising binomial coefficient + * + * as one can notice in the analysis of binCoef(...) that + * binCoef is the (N)k divided by k!. Similarly rising binCoef + * is merely N^(k) / k! + */ + public risingBinCoef(n: number, k: number): number; + /** + * Generate a random boolean result based on the chance value + *

              + * Returns true or false based on the chance value (default 50%). For example if you wanted a player to have a 30% chance + * of getting a bonus, call chanceRoll(30) - true means the chance passed, false means it failed. + *

              + * @param chance The chance of receiving the value. A number between 0 and 100 (effectively 0% to 100%) + * @return true if the roll passed, or false + */ + public chanceRoll(chance?: number): bool; + /** + * Adds the given amount to the value, but never lets the value go over the specified maximum + * + * @param value The value to add the amount to + * @param amount The amount to add to the value + * @param max The maximum the value is allowed to be + * @return The new value + */ + public maxAdd(value: number, amount: number, max: number): number; + /** + * Subtracts the given amount from the value, but never lets the value go below the specified minimum + * + * @param value The base value + * @param amount The amount to subtract from the base value + * @param min The minimum the value is allowed to be + * @return The new value + */ + public minSub(value: number, amount: number, min: number): number; + /** + * Adds value to amount and ensures that the result always stays between 0 and max, by wrapping the value around. + *

              Values must be positive integers, and are passed through Math.abs

              + * + * @param value The value to add the amount to + * @param amount The amount to add to the value + * @param max The maximum the value is allowed to be + * @return The wrapped value + */ + public wrapValue(value: number, amount: number, max: number): number; + /** + * Randomly returns either a 1 or -1 + * + * @return 1 or -1 + */ + public randomSign(): number; + /** + * Returns true if the number given is odd. + * + * @param n The number to check + * + * @return True if the given number is odd. False if the given number is even. + */ + public isOdd(n: number): bool; + /** + * Returns true if the number given is even. + * + * @param n The number to check + * + * @return True if the given number is even. False if the given number is odd. + */ + public isEven(n: number): bool; + /** + * Keeps an angle value between -180 and +180
              + * Should be called whenever the angle is updated on the Sprite to stop it from going insane. + * + * @param angle The angle value to check + * + * @return The new angle value, returns the same as the input angle if it was within bounds + */ + public wrapAngle(angle: number): number; + /** + * Keeps an angle value between the given min and max values + * + * @param angle The angle value to check. Must be between -180 and +180 + * @param min The minimum angle that is allowed (must be -180 or greater) + * @param max The maximum angle that is allowed (must be 180 or less) + * + * @return The new angle value, returns the same as the input angle if it was within bounds + */ + public angleLimit(angle: number, min: number, max: number): number; + /** + * @method linear + * @param {Any} v + * @param {Any} k + * @static + */ + public linearInterpolation(v, k); + /** + * @method Bezier + * @param {Any} v + * @param {Any} k + * @static + */ + public bezierInterpolation(v, k): number; + /** + * @method CatmullRom + * @param {Any} v + * @param {Any} k + * @static + */ + public catmullRomInterpolation(v, k); + /** + * @method Linear + * @param {Any} p0 + * @param {Any} p1 + * @param {Any} t + * @static + */ + public linear(p0, p1, t); + /** + * @method Bernstein + * @param {Any} n + * @param {Any} i + * @static + */ + public bernstein(n, i): number; + /** + * @method CatmullRom + * @param {Any} p0 + * @param {Any} p1 + * @param {Any} p2 + * @param {Any} p3 + * @param {Any} t + * @static + */ + public catmullRom(p0, p1, p2, p3, t); + public difference(a: number, b: number): number; + /** + * The global random number generator seed (for deterministic behavior in recordings and saves). + */ + public globalSeed: number; + /** + * Generates a random number. Deterministic, meaning safe + * to use if you want to record replays in random environments. + * + * @return A Number between 0 and 1. + */ + public random(): number; + /** + * Generates a random number based on the seed provided. + * + * @param Seed A number between 0 and 1, used to generate a predictable random number (very optional). + * + * @return A Number between 0 and 1. + */ + public srand(Seed: number): number; + /** + * Fetch a random entry from the given array. + * Will return null if random selection is missing, or array has no entries. + * G.getRandom() is deterministic and safe for use with replays/recordings. + * HOWEVER, U.getRandom() is NOT deterministic and unsafe for use with replays/recordings. + * + * @param Objects An array of objects. + * @param StartIndex Optional offset off the front of the array. Default value is 0, or the beginning of the array. + * @param Length Optional restriction on the number of values you want to randomly select from. + * + * @return The random object that was selected. + */ + public getRandom(Objects, StartIndex?: number, Length?: number); + /** + * Round down to the next whole number. E.g. floor(1.7) == 1, and floor(-2.7) == -2. + * + * @param Value Any number. + * + * @return The rounded value of that number. + */ + public floor(Value: number): number; + /** + * Round up to the next whole number. E.g. ceil(1.3) == 2, and ceil(-2.3) == -3. + * + * @param Value Any number. + * + * @return The rounded value of that number. + */ + public ceil(Value: number): number; + /** + * Generate a sine and cosine table simultaneously and extremely quickly. Based on research by Franky of scene.at + *

              + * The parameters allow you to specify the length, amplitude and frequency of the wave. Once you have called this function + * you should get the results via getSinTable() and getCosTable(). This generator is fast enough to be used in real-time. + *

              + * @param length The length of the wave + * @param sinAmplitude The amplitude to apply to the sine table (default 1.0) if you need values between say -+ 125 then give 125 as the value + * @param cosAmplitude The amplitude to apply to the cosine table (default 1.0) if you need values between say -+ 125 then give 125 as the value + * @param frequency The frequency of the sine and cosine table data + * @return Returns the sine table + * @see getSinTable + * @see getCosTable + */ + public sinCosGenerator(length: number, sinAmplitude?: number, cosAmplitude?: number, frequency?: number): any[]; + /** + * Shifts through the sin table data by one value and returns it. + * This effectively moves the position of the data from the start to the end of the table. + * @return The sin value. + */ + public shiftSinTable(): number; + /** + * Shifts through the cos table data by one value and returns it. + * This effectively moves the position of the data from the start to the end of the table. + * @return The cos value. + */ + public shiftCosTable(): number; + /** + * Finds the length of the given vector + * + * @param dx + * @param dy + * + * @return + */ + public vectorLength(dx: number, dy: number): number; + /** + * Finds the dot product value of two vectors + * + * @param ax Vector X + * @param ay Vector Y + * @param bx Vector X + * @param by Vector Y + * + * @return Dot product + */ + public dotProduct(ax: number, ay: number, bx: number, by: number): number; + } +} +/** +* Phaser - Group +* +* This class is used for organising, updating and sorting game objects. +* +*/ +module Phaser { + class Group extends Basic { + constructor(game: Game, MaxSize?: number); + /** + * Use with sort() to sort in ascending order. + */ + static ASCENDING: number; + /** + * Use with sort() to sort in descending order. + */ + static DESCENDING: number; + /** + * Array of all the Basics that exist in this group. + */ + public members: Basic[]; + /** + * The number of entries in the members array. + * For performance and safety you should check this variable + * instead of members.length unless you really know what you're doing! + */ + public length: number; + /** + * Internal tracker for the maximum capacity of the group. + * Default is 0, or no max capacity. + */ + private _maxSize; + /** + * Internal helper variable for recycling objects a la Emitter. + */ + private _marker; + /** + * Helper for sort. + */ + private _sortIndex; + /** + * Helper for sort. + */ + private _sortOrder; + /** + * Override this function to handle any deleting or "shutdown" type operations you might need, + * such as removing traditional Flash children like Basic objects. + */ + public destroy(): void; + /** + * Automatically goes through and calls update on everything you added. + */ + public update(): void; + /** + * Automatically goes through and calls render on everything you added. + */ + public render(camera: Camera, cameraOffsetX: number, cameraOffsetY: number): void; + /** + * The maximum capacity of this group. Default is 0, meaning no max capacity, and the group can just grow. + */ + /** + * @private + */ + public maxSize : number; + /** + * Adds a new Basic subclass (Basic, Basic, Enemy, etc) to the group. + * Group will try to replace a null member of the array first. + * Failing that, Group will add it to the end of the member array, + * assuming there is room for it, and doubling the size of the array if necessary. + * + *

              WARNING: If the group has a maxSize that has already been met, + * the object will NOT be added to the group!

              + * + * @param Object The object you want to add to the group. + * + * @return The same Basic object that was passed in. + */ + public add(Object: Basic): Basic; + /** + * Recycling is designed to help you reuse game objects without always re-allocating or "newing" them. + * + *

              If you specified a maximum size for this group (like in Emitter), + * then recycle will employ what we're calling "rotating" recycling. + * Recycle() will first check to see if the group is at capacity yet. + * If group is not yet at capacity, recycle() returns a new object. + * If the group IS at capacity, then recycle() just returns the next object in line.

              + * + *

              If you did NOT specify a maximum size for this group, + * then recycle() will employ what we're calling "grow-style" recycling. + * Recycle() will return either the first object with exists == false, + * or, finding none, add a new object to the array, + * doubling the size of the array if necessary.

              + * + *

              WARNING: If this function needs to create a new object, + * and no object class was provided, it will return null + * instead of a valid object!

              + * + * @param ObjectClass The class type you want to recycle (e.g. Basic, EvilRobot, etc). Do NOT "new" the class in the parameter! + * + * @return A reference to the object that was created. Don't forget to cast it back to the Class you want (e.g. myObject = myGroup.recycle(myObjectClass) as myObjectClass;). + */ + public recycle(ObjectClass?); + /** + * Removes an object from the group. + * + * @param Object The Basic you want to remove. + * @param Splice Whether the object should be cut from the array entirely or not. + * + * @return The removed object. + */ + public remove(Object: Basic, Splice?: bool): Basic; + /** + * Replaces an existing Basic with a new one. + * + * @param OldObject The object you want to replace. + * @param NewObject The new object you want to use instead. + * + * @return The new object. + */ + public replace(OldObject: Basic, NewObject: Basic): Basic; + /** + * Call this function to sort the group according to a particular value and order. + * For example, to sort game objects for Zelda-style overlaps you might call + * myGroup.sort("y",Group.ASCENDING) at the bottom of your + * State.update() override. To sort all existing objects after + * a big explosion or bomb attack, you might call myGroup.sort("exists",Group.DESCENDING). + * + * @param Index The string name of the member variable you want to sort on. Default value is "y". + * @param Order A Group constant that defines the sort order. Possible values are Group.ASCENDING and Group.DESCENDING. Default value is Group.ASCENDING. + */ + public sort(Index?: string, Order?: number): void; + /** + * Go through and set the specified variable to the specified value on all members of the group. + * + * @param VariableName The string representation of the variable name you want to modify, for example "visible" or "scrollFactor". + * @param Value The value you want to assign to that variable. + * @param Recurse Default value is true, meaning if setAll() encounters a member that is a group, it will call setAll() on that group rather than modifying its variable. + */ + public setAll(VariableName: string, Value: Object, Recurse?: bool): void; + /** + * Go through and call the specified function on all members of the group. + * Currently only works on functions that have no required parameters. + * + * @param FunctionName The string representation of the function you want to call on each object, for example "kill()" or "init()". + * @param Recurse Default value is true, meaning if callAll() encounters a member that is a group, it will call callAll() on that group rather than calling the group's function. + */ + public callAll(FunctionName: string, Recurse?: bool): void; + public forEach(callback, recursive?: bool): void; + public forEachAlive(context, callback, recursive?: bool): void; + /** + * Call this function to retrieve the first object with exists == false in the group. + * This is handy for recycling in general, e.g. respawning enemies. + * + * @param ObjectClass An optional parameter that lets you narrow the results to instances of this particular class. + * + * @return A Basic currently flagged as not existing. + */ + public getFirstAvailable(ObjectClass?); + /** + * Call this function to retrieve the first index set to 'null'. + * Returns -1 if no index stores a null object. + * + * @return An int indicating the first null slot in the group. + */ + public getFirstNull(): number; + /** + * Call this function to retrieve the first object with exists == true in the group. + * This is handy for checking if everything's wiped out, or choosing a squad leader, etc. + * + * @return A Basic currently flagged as existing. + */ + public getFirstExtant(): Basic; + /** + * Call this function to retrieve the first object with dead == false in the group. + * This is handy for checking if everything's wiped out, or choosing a squad leader, etc. + * + * @return A Basic currently flagged as not dead. + */ + public getFirstAlive(): Basic; + /** + * Call this function to retrieve the first object with dead == true in the group. + * This is handy for checking if everything's wiped out, or choosing a squad leader, etc. + * + * @return A Basic currently flagged as dead. + */ + public getFirstDead(): Basic; + /** + * Call this function to find out how many members of the group are not dead. + * + * @return The number of Basics flagged as not dead. Returns -1 if group is empty. + */ + public countLiving(): number; + /** + * Call this function to find out how many members of the group are dead. + * + * @return The number of Basics flagged as dead. Returns -1 if group is empty. + */ + public countDead(): number; + /** + * Returns a member at random from the group. + * + * @param StartIndex Optional offset off the front of the array. Default value is 0, or the beginning of the array. + * @param Length Optional restriction on the number of values you want to randomly select from. + * + * @return A Basic from the members list. + */ + public getRandom(StartIndex?: number, Length?: number): Basic; + /** + * Remove all instances of Basic subclass (Basic, Block, etc) from the list. + * WARNING: does not destroy() or kill() any of these objects! + */ + public clear(): void; + /** + * Calls kill on the group's members and then on the group itself. + */ + public kill(): void; + /** + * Helper function for the sort process. + * + * @param Obj1 The first object being sorted. + * @param Obj2 The second object being sorted. + * + * @return An integer value: -1 (Obj1 before Obj2), 0 (same), or 1 (Obj1 after Obj2). + */ + public sortHandler(Obj1: Basic, Obj2: Basic): number; + } +} +/** +* Phaser - Loader +* +* The Loader handles loading all external content such as Images, Sounds, Texture Atlases and data files. +* It uses a combination of Image() loading and xhr and provides for progress and completion callbacks. +*/ +module Phaser { + class Loader { + constructor(game: Game, callback); + private _game; + private _keys; + private _fileList; + private _gameCreateComplete; + private _onComplete; + private _onFileLoad; + private _progressChunk; + private _xhr; + private _queueSize; + public hasLoaded: bool; + public progress: number; + public reset(): void; + public queueSize : number; + public addImageFile(key: string, url: string): void; + public addSpriteSheet(key: string, url: string, frameWidth: number, frameHeight: number, frameMax?: number): void; + public addTextureAtlas(key: string, url: string, jsonURL?: string, jsonData?): void; + public addAudioFile(key: string, url: string): void; + public addTextFile(key: string, url: string): void; + public removeFile(key: string): void; + public removeAll(): void; + public load(onFileLoadCallback?, onCompleteCallback?): void; + private loadFile(); + private fileError(key); + private fileComplete(key); + private jsonLoadComplete(key); + private jsonLoadError(key); + private nextFile(previousKey, success); + private checkKeyExists(key); + } +} +/** +* Phaser - Motion +* +* The Motion class contains lots of useful functions for moving game objects around in world space. +*/ +module Phaser { + class Motion { + constructor(game: Game); + private _game; + /** + * A tween-like function that takes a starting velocity and some other factors and returns an altered velocity. + * + * @param Velocity Any component of velocity (e.g. 20). + * @param Acceleration Rate at which the velocity is changing. + * @param Drag Really kind of a deceleration, this is how much the velocity changes if Acceleration is not set. + * @param Max An absolute value cap for the velocity. + * + * @return The altered Velocity value. + */ + public computeVelocity(Velocity: number, Acceleration?: number, Drag?: number, Max?: number): number; + /** + * Given the angle and speed calculate the velocity and return it as a Point + * + * @param angle The angle (in degrees) calculated in clockwise positive direction (down = 90 degrees positive, right = 0 degrees positive, up = 90 degrees negative) + * @param speed The speed it will move, in pixels per second sq + * + * @return A Point where Point.x contains the velocity x value and Point.y contains the velocity y value + */ + public velocityFromAngle(angle: number, speed: number): Point; + /** + * Sets the source Sprite x/y velocity so it will move directly towards the destination Sprite at the speed given (in pixels per second)
              + * If you specify a maxTime then it will adjust the speed (over-writing what you set) so it arrives at the destination in that number of seconds.
              + * Timings are approximate due to the way Flash timers work, and irrespective of SWF frame rate. Allow for a variance of +- 50ms.
              + * The source object doesn't stop moving automatically should it ever reach the destination coordinates.
              + * If you need the object to accelerate, see accelerateTowardsObject() instead + * Note: Doesn't take into account acceleration, maxVelocity or drag (if you set drag or acceleration too high this object may not move at all) + * + * @param source The Sprite on which the velocity will be set + * @param dest The Sprite where the source object will move to + * @param speed The speed it will move, in pixels per second (default is 60 pixels/sec) + * @param maxTime Time given in milliseconds (1000 = 1 sec). If set the speed is adjusted so the source will arrive at destination in the given number of ms + */ + public moveTowardsObject(source: GameObject, dest: GameObject, speed?: number, maxTime?: number): void; + /** + * Sets the x/y acceleration on the source Sprite so it will move towards the destination Sprite at the speed given (in pixels per second)
              + * You must give a maximum speed value, beyond which the Sprite won't go any faster.
              + * If you don't need acceleration look at moveTowardsObject() instead. + * + * @param source The Sprite on which the acceleration will be set + * @param dest The Sprite where the source object will move towards + * @param speed The speed it will accelerate in pixels per second + * @param xSpeedMax The maximum speed in pixels per second in which the sprite can move horizontally + * @param ySpeedMax The maximum speed in pixels per second in which the sprite can move vertically + */ + public accelerateTowardsObject(source: GameObject, dest: GameObject, speed: number, xSpeedMax: number, ySpeedMax: number): void; + /** + * Move the given Sprite towards the mouse pointer coordinates at a steady velocity + * If you specify a maxTime then it will adjust the speed (over-writing what you set) so it arrives at the destination in that number of seconds.
              + * Timings are approximate due to the way Flash timers work, and irrespective of SWF frame rate. Allow for a variance of +- 50ms.
              + * The source object doesn't stop moving automatically should it ever reach the destination coordinates.
              + * + * @param source The Sprite to move + * @param speed The speed it will move, in pixels per second (default is 60 pixels/sec) + * @param maxTime Time given in milliseconds (1000 = 1 sec). If set the speed is adjusted so the source will arrive at destination in the given number of ms + */ + public moveTowardsMouse(source: GameObject, speed?: number, maxTime?: number): void; + /** + * Sets the x/y acceleration on the source Sprite so it will move towards the mouse coordinates at the speed given (in pixels per second)
              + * You must give a maximum speed value, beyond which the Sprite won't go any faster.
              + * If you don't need acceleration look at moveTowardsMouse() instead. + * + * @param source The Sprite on which the acceleration will be set + * @param speed The speed it will accelerate in pixels per second + * @param xSpeedMax The maximum speed in pixels per second in which the sprite can move horizontally + * @param ySpeedMax The maximum speed in pixels per second in which the sprite can move vertically + */ + public accelerateTowardsMouse(source: GameObject, speed: number, xSpeedMax: number, ySpeedMax: number): void; + /** + * Sets the x/y velocity on the source Sprite so it will move towards the target coordinates at the speed given (in pixels per second)
              + * If you specify a maxTime then it will adjust the speed (over-writing what you set) so it arrives at the destination in that number of seconds.
              + * Timings are approximate due to the way Flash timers work, and irrespective of SWF frame rate. Allow for a variance of +- 50ms.
              + * The source object doesn't stop moving automatically should it ever reach the destination coordinates.
              + * + * @param source The Sprite to move + * @param target The Point coordinates to move the source Sprite towards + * @param speed The speed it will move, in pixels per second (default is 60 pixels/sec) + * @param maxTime Time given in milliseconds (1000 = 1 sec). If set the speed is adjusted so the source will arrive at destination in the given number of ms + */ + public moveTowardsPoint(source: GameObject, target: Point, speed?: number, maxTime?: number): void; + /** + * Sets the x/y acceleration on the source Sprite so it will move towards the target coordinates at the speed given (in pixels per second)
              + * You must give a maximum speed value, beyond which the Sprite won't go any faster.
              + * If you don't need acceleration look at moveTowardsPoint() instead. + * + * @param source The Sprite on which the acceleration will be set + * @param target The Point coordinates to move the source Sprite towards + * @param speed The speed it will accelerate in pixels per second + * @param xSpeedMax The maximum speed in pixels per second in which the sprite can move horizontally + * @param ySpeedMax The maximum speed in pixels per second in which the sprite can move vertically + */ + public accelerateTowardsPoint(source: GameObject, target: Point, speed: number, xSpeedMax: number, ySpeedMax: number): void; + /** + * Find the distance (in pixels, rounded) between two Sprites, taking their origin into account + * + * @param a The first Sprite + * @param b The second Sprite + * @return int Distance (in pixels) + */ + public distanceBetween(a: GameObject, b: GameObject): number; + /** + * Find the distance (in pixels, rounded) from an Sprite to the given Point, taking the source origin into account + * + * @param a The Sprite + * @param target The Point + * @return int Distance (in pixels) + */ + public distanceToPoint(a: GameObject, target: Point): number; + /** + * Find the distance (in pixels, rounded) from the object x/y and the mouse x/y + * + * @param a The Sprite to test against + * @return int The distance between the given sprite and the mouse coordinates + */ + public distanceToMouse(a: GameObject): number; + /** + * Find the angle (in radians) between an Sprite and an Point. The source sprite takes its x/y and origin into account. + * The angle is calculated in clockwise positive direction (down = 90 degrees positive, right = 0 degrees positive, up = 90 degrees negative) + * + * @param a The Sprite to test from + * @param target The Point to angle the Sprite towards + * @param asDegrees If you need the value in degrees instead of radians, set to true + * + * @return Number The angle (in radians unless asDegrees is true) + */ + public angleBetweenPoint(a: GameObject, target: Point, asDegrees?: bool): number; + /** + * Find the angle (in radians) between the two Sprite, taking their x/y and origin into account. + * The angle is calculated in clockwise positive direction (down = 90 degrees positive, right = 0 degrees positive, up = 90 degrees negative) + * + * @param a The Sprite to test from + * @param b The Sprite to test to + * @param asDegrees If you need the value in degrees instead of radians, set to true + * + * @return Number The angle (in radians unless asDegrees is true) + */ + public angleBetween(a: GameObject, b: GameObject, asDegrees?: bool): number; + /** + * Given the GameObject and speed calculate the velocity and return it as an Point based on the direction the sprite is facing + * + * @param parent The Sprite to get the facing value from + * @param speed The speed it will move, in pixels per second sq + * + * @return An Point where Point.x contains the velocity x value and Point.y contains the velocity y value + */ + public velocityFromFacing(parent: GameObject, speed: number): Point; + /** + * Find the angle (in radians) between an Sprite and the mouse, taking their x/y and origin into account. + * The angle is calculated in clockwise positive direction (down = 90 degrees positive, right = 0 degrees positive, up = 90 degrees negative) + * + * @param a The Object to test from + * @param asDegrees If you need the value in degrees instead of radians, set to true + * + * @return Number The angle (in radians unless asDegrees is true) + */ + public angleBetweenMouse(a: GameObject, asDegrees?: bool): number; + } +} +/** +* Phaser - Sound +* +* A Sound file, used by the Game.SoundManager for playback. +*/ +module Phaser { + class Sound { + constructor(context, gainNode, data, volume?: number, loop?: bool); + private _context; + private _gainNode; + private _localGainNode; + private _buffer; + private _volume; + private _sound; + public loop: bool; + public duration: number; + public isPlaying: bool; + public isDecoding: bool; + public setDecodedBuffer(data): void; + public play(): void; + public stop(): void; + public mute(): void; + public unmute(): void; + public volume : number; + } +} +/** +* Phaser - SoundManager +* +* This is an embroyonic web audio sound management class. There is a lot of work still to do here. +*/ +module Phaser { + class SoundManager { + constructor(game: Game); + private _game; + private _context; + private _gainNode; + private _volume; + public mute(): void; + public unmute(): void; + public volume : number; + public decode(key: string, callback?, sound?: Sound): void; + public play(key: string, volume?: number, loop?: bool): Sound; + } +} +/** +* Phaser +* +* v0.9.5 - April 28th 2013 +* +* A small and feature-packed 2D canvas game framework born from the firey pits of Flixel and Kiwi. +* +* Richard Davey (@photonstorm) +* +* Many thanks to Adam Saltsman (@ADAMATOMIC) for releasing Flixel on which Phaser took a lot of inspiration. +* +* "If you want your children to be intelligent, read them fairy tales." +* "If you want them to be more intelligent, read them more fairy tales." +* -- Albert Einstein +*/ +module Phaser { + var VERSION: string; +} +/** +* Phaser - StageScaleMode +* +* This class controls the scaling of your game. On mobile devices it will also remove the URL bar and allow +* you to maintain proportion and aspect ratio. +* It is based on a technique taken from Viewporter v2.0 by Zynga Inc. http://github.com/zynga/viewporter +*/ +module Phaser { + class StageScaleMode { + constructor(game: Game); + private _game; + private _startHeight; + private _iterations; + private _check; + static EXACT_FIT: number; + static NO_SCALE: number; + static SHOW_ALL: number; + public width: number; + public height: number; + public orientation; + public update(): void; + public isLandscape : bool; + private checkOrientation(event); + private refresh(); + private setScreenSize(); + } +} +/** +* Phaser - BootScreen +* +* The BootScreen is displayed when Phaser is started without any default functions or State +*/ +module Phaser { + class BootScreen { + constructor(game: Game); + private _game; + private _logo; + private _logoData; + private _color1; + private _color2; + private _fade; + public update(): void; + public render(): void; + private colorCycle(); + } +} +/** +* Phaser - PauseScreen +* +* The PauseScreen is displayed whenever the game loses focus or the player switches to another browser tab. +*/ +module Phaser { + class PauseScreen { + constructor(game: Game, width: number, height: number); + private _game; + private _canvas; + private _context; + private _color; + private _fade; + public onPaused(): void; + public onResume(): void; + public update(): void; + public render(): void; + private fadeOut(); + private fadeIn(); + } +} +/** +* Phaser - Stage +* +* The Stage is the canvas on which everything is displayed. This class handles display within the web browser, focus handling, +* resizing, scaling and pause/boot screens. +*/ +module Phaser { + class Stage { + constructor(game: Game, parent: string, width: number, height: number); + private _game; + private _bgColor; + private _bootScreen; + private _pauseScreen; + static ORIENTATION_LANDSCAPE: number; + static ORIENTATION_PORTRAIT: number; + public bounds: Rectangle; + public aspectRatio: number; + public clear: bool; + public canvas: HTMLCanvasElement; + public context: CanvasRenderingContext2D; + public disablePauseScreen: bool; + public disableBootScreen: bool; + public offset: Point; + public scale: StageScaleMode; + public scaleMode: number; + public minScaleX: number; + public maxScaleX: number; + public minScaleY: number; + public maxScaleY: number; + public update(): void; + private visibilityChange(event); + private getOffset(element); + public strokeStyle: string; + public lineWidth: number; + public fillStyle: string; + public saveCanvasValues(): void; + public restoreCanvasValues(): void; + public backgroundColor : string; + public x : number; + public y : number; + public width : number; + public height : number; + public centerX : number; + public centerY : number; + public randomX : number; + public randomY : number; + } +} +/** +* Phaser - Time +* +* This is the game clock and it manages elapsed time and calculation of delta values, used for game object motion. +*/ +module Phaser { + class Time { + constructor(game: Game); + private _game; + private _started; + public timeScale: number; + public elapsed: number; + /** + * + * @property time + * @type Number + */ + public time: number; + /** + * + * @property now + * @type Number + */ + public now: number; + /** + * + * @property delta + * @type Number + */ + public delta: number; + /** + * + * @method totalElapsedSeconds + * @return {Number} + */ + public totalElapsedSeconds : number; + public fps: number; + public fpsMin: number; + public fpsMax: number; + public msMin: number; + public msMax: number; + public frames: number; + private _timeLastSecond; + /** + * + * @method update + */ + public update(): void; + /** + * + * @method elapsedSince + * @param {Number} since + * @return {Number} + */ + public elapsedSince(since: number): number; + /** + * + * @method elapsedSecondsSince + * @param {Number} since + * @return {Number} + */ + public elapsedSecondsSince(since: number): number; + /** + * + * @method reset + */ + public reset(): void; + } +} +/** +* Phaser - Easing - Back +* +* For use with Phaser.Tween +*/ +module Phaser.Easing { + class Back { + static In(k): number; + static Out(k): number; + static InOut(k): number; + } +} +/** +* Phaser - Easing - Bounce +* +* For use with Phaser.Tween +*/ +module Phaser.Easing { + class Bounce { + static In(k): number; + static Out(k): number; + static InOut(k): number; + } +} +/** +* Phaser - Easing - Circular +* +* For use with Phaser.Tween +*/ +module Phaser.Easing { + class Circular { + static In(k): number; + static Out(k): number; + static InOut(k): number; + } +} +/** +* Phaser - Easing - Cubic +* +* For use with Phaser.Tween +*/ +module Phaser.Easing { + class Cubic { + static In(k): number; + static Out(k): number; + static InOut(k): number; + } +} +/** +* Phaser - Easing - Elastic +* +* For use with Phaser.Tween +*/ +module Phaser.Easing { + class Elastic { + static In(k): number; + static Out(k): number; + static InOut(k): number; + } +} +/** +* Phaser - Easing - Exponential +* +* For use with Phaser.Tween +*/ +module Phaser.Easing { + class Exponential { + static In(k): number; + static Out(k): number; + static InOut(k): number; + } +} +/** +* Phaser - Easing - Linear +* +* For use with Phaser.Tween +*/ +module Phaser.Easing { + class Linear { + static None(k); + } +} +/** +* Phaser - Easing - Quadratic +* +* For use with Phaser.Tween +*/ +module Phaser.Easing { + class Quadratic { + static In(k): number; + static Out(k): number; + static InOut(k): number; + } +} +/** +* Phaser - Easing - Quartic +* +* For use with Phaser.Tween +*/ +module Phaser.Easing { + class Quartic { + static In(k): number; + static Out(k): number; + static InOut(k): number; + } +} +/** +* Phaser - Easing - Quintic +* +* For use with Phaser.Tween +*/ +module Phaser.Easing { + class Quintic { + static In(k): number; + static Out(k): number; + static InOut(k): number; + } +} +/** +* Phaser - Easing - Sinusoidal +* +* For use with Phaser.Tween +*/ +module Phaser.Easing { + class Sinusoidal { + static In(k): number; + static Out(k): number; + static InOut(k): number; + } +} +/** +* Phaser - Tween +* +* Based heavily on tween.js by sole (https://github.com/sole/tween.js) converted to TypeScript and integrated into Phaser +*/ +module Phaser { + class Tween { + constructor(object, game: Game); + private _game; + private _manager; + private _object; + private _pausedTime; + private _valuesStart; + private _valuesEnd; + private _duration; + private _delayTime; + private _startTime; + private _easingFunction; + private _interpolationFunction; + private _chainedTweens; + public onStart: Signal; + public onUpdate: Signal; + public onComplete: Signal; + public to(properties, duration?: number, ease?: any, autoStart?: bool): Tween; + public start(): Tween; + public stop(): Tween; + public parent : Game; + public delay : number; + public easing : any; + public interpolation : any; + public chain(tween: Tween): Tween; + public debugValue; + public update(time): bool; + } +} +/** +* Phaser - TweenManager +* +* The Game has a single instance of the TweenManager through which all Tween objects are created and updated. +* Tweens are hooked into the game clock and pause system, adjusting based on the game state. +* TweenManager is based heavily on tween.js by sole (http://soledadpenades.com). +* I converted it to TypeScript, swapped the callbacks for signals and patched a few issues with regard +* to properties and completion errors. Please see https://github.com/sole/tween.js for a full list of contributors. +*/ +module Phaser { + class TweenManager { + constructor(game: Game); + private _game; + private _tweens; + public getAll(): Tween[]; + public removeAll(): void; + public create(object): Tween; + public add(tween: Tween): Tween; + public remove(tween: Tween): void; + public update(): bool; + } +} +/** +* Phaser - World +* +* A game has only one world. The world is an abstract place in which all game objects live. It is not bound +* by stage limits and can be any size or dimension. You look into the world via cameras and all game objects +* live within the world at world-based coordinates. By default a world is created the same size as your Stage. +*/ +module Phaser { + class World { + constructor(game: Game, width: number, height: number); + private _game; + public cameras: CameraManager; + public group: Group; + public bounds: Rectangle; + public worldDivisions: number; + public update(): void; + public render(): void; + public destroy(): void; + public setSize(width: number, height: number, updateCameraBounds?: bool): void; + public width : number; + public height : number; + public centerX : number; + public centerY : number; + public randomX : number; + public randomY : number; + public createCamera(x: number, y: number, width: number, height: number): Camera; + public removeCamera(id: number): bool; + public getAllCameras(): Camera[]; + public createSprite(x: number, y: number, key?: string): Sprite; + public createGeomSprite(x: number, y: number): GeomSprite; + public createDynamicTexture(width: number, height: number): DynamicTexture; + public createGroup(MaxSize?: number): Group; + public createScrollZone(key: string, x?: number, y?: number, width?: number, height?: number): ScrollZone; + public createTilemap(key: string, mapData: string, format: number, resizeWorld?: bool, tileWidth?: number, tileHeight?: number): Tilemap; + public createParticle(): Particle; + public createEmitter(x?: number, y?: number, size?: number): Emitter; + } +} +/** +* Phaser - Device +* +* Detects device support capabilities. Using some elements from System.js by MrDoob and Modernizr +* https://github.com/Modernizr/Modernizr/blob/master/feature-detects/audio.js +*/ +module Phaser { + class Device { + /** + * + * @constructor + * @return {Device} This Object + */ + constructor(); + public desktop: bool; + /** + * + * @property iOS + * @type Boolean + */ + public iOS: bool; + /** + * + * @property android + * @type Boolean + */ + public android: bool; + /** + * + * @property chromeOS + * @type Boolean + */ + public chromeOS: bool; + /** + * + * @property linux + * @type Boolean + */ + public linux: bool; + /** + * + * @property maxOS + * @type Boolean + */ + public macOS: bool; + /** + * + * @property windows + * @type Boolean + */ + public windows: bool; + /** + * + * @property canvas + * @type Boolean + */ + public canvas: bool; + /** + * + * @property file + * @type Boolean + */ + public file: bool; + /** + * + * @property fileSystem + * @type Boolean + */ + public fileSystem: bool; + /** + * + * @property localStorage + * @type Boolean + */ + public localStorage: bool; + /** + * + * @property webGL + * @type Boolean + */ + public webGL: bool; + /** + * + * @property worker + * @type Boolean + */ + public worker: bool; + /** + * + * @property touch + * @type Boolean + */ + public touch: bool; + /** + * + * @property css3D + * @type Boolean + */ + public css3D: bool; + /** + * + * @property arora + * @type Boolean + */ + public arora: bool; + /** + * + * @property chrome + * @type Boolean + */ + public chrome: bool; + /** + * + * @property epiphany + * @type Boolean + */ + public epiphany: bool; + /** + * + * @property firefox + * @type Boolean + */ + public firefox: bool; + /** + * + * @property ie + * @type Boolean + */ + public ie: bool; + /** + * + * @property ieVersion + * @type Number + */ + public ieVersion: number; + /** + * + * @property mobileSafari + * @type Boolean + */ + public mobileSafari: bool; + /** + * + * @property midori + * @type Boolean + */ + public midori: bool; + /** + * + * @property opera + * @type Boolean + */ + public opera: bool; + /** + * + * @property safari + * @type Boolean + */ + public safari: bool; + public webApp: bool; + /** + * + * @property audioData + * @type Boolean + */ + public audioData: bool; + /** + * + * @property webaudio + * @type Boolean + */ + public webaudio: bool; + /** + * + * @property ogg + * @type Boolean + */ + public ogg: bool; + /** + * + * @property mp3 + * @type Boolean + */ + public mp3: bool; + /** + * + * @property wav + * @type Boolean + */ + public wav: bool; + /** + * + * @property m4a + * @type Boolean + */ + public m4a: bool; + /** + * + * @property iPhone + * @type Boolean + */ + public iPhone: bool; + /** + * + * @property iPhone4 + * @type Boolean + */ + public iPhone4: bool; + /** + * + * @property iPad + * @type Boolean + */ + public iPad: bool; + /** + * + * @property pixelRatio + * @type Number + */ + public pixelRatio: number; + /** + * + * @method _checkOS + * @private + */ + private _checkOS(); + /** + * + * @method _checkFeatures + * @private + */ + private _checkFeatures(); + /** + * + * @method _checkBrowser + * @private + */ + private _checkBrowser(); + /** + * + * @method _checkAudio + * @private + */ + private _checkAudio(); + /** + * + * @method _checkDevice + * @private + */ + private _checkDevice(); + /** + * + * @method _checkCSS3D + * @private + */ + private _checkCSS3D(); + /** + * + * @method getAll + * @return {String} + */ + public getAll(): string; + } +} +/** +* Phaser - RandomDataGenerator +* +* An extremely useful repeatable random data generator. Access it via Game.rnd +* Based on Nonsense by Josh Faul https://github.com/jocafa/Nonsense +* Random number generator from http://baagoe.org/en/wiki/Better_random_numbers_for_javascript +*/ +module Phaser { + class RandomDataGenerator { + /** + * @constructor + * @param {Array} seeds + * @return {Phaser.RandomDataGenerator} + */ + constructor(seeds?: string[]); + /** + * @property s0 + * @type Any + * @private + */ + private s0; + /** + * @property s1 + * @type Any + * @private + */ + private s1; + /** + * @property s2 + * @type Any + * @private + */ + private s2; + /** + * @property c + * @type Number + * @private + */ + private c; + /** + * @method uint32 + * @private + */ + private uint32(); + /** + * @method fract32 + * @private + */ + private fract32(); + /** + * @method rnd + * @private + */ + private rnd(); + /** + * @method hash + * @param {Any} data + * @private + */ + private hash(data); + /** + * Reset the seed of the random data generator + * @method sow + * @param {Array} seeds + */ + public sow(seeds?: string[]): void; + /** + * Returns a random integer between 0 and 2^32 + * @method integer + * @return {Number} + */ + public integer : number; + /** + * Returns a random real number between 0 and 1 + * @method frac + * @return {Number} + */ + public frac : number; + /** + * Returns a random real number between 0 and 2^32 + * @method real + * @return {Number} + */ + public real : number; + /** + * Returns a random integer between min and max + * @method integerInRange + * @param {Number} min + * @param {Number} max + * @return {Number} + */ + public integerInRange(min: number, max: number): number; + /** + * Returns a random real number between min and max + * @method realInRange + * @param {Number} min + * @param {Number} max + * @return {Number} + */ + public realInRange(min: number, max: number): number; + /** + * Returns a random real number between -1 and 1 + * @method normal + * @return {Number} + */ + public normal : number; + /** + * Returns a valid v4 UUID hex string (from https://gist.github.com/1308368) + * @method uuid + * @return {String} + */ + public uuid : string; + /** + * Returns a random member of `array` + * @method pick + * @param {Any} array + */ + public pick(array); + /** + * Returns a random member of `array`, favoring the earlier entries + * @method weightedPick + * @param {Any} array + */ + public weightedPick(array); + /** + * Returns a random timestamp between min and max, or between the beginning of 2000 and the end of 2020 if min and max aren't specified + * @method timestamp + * @param {Number} min + * @param {Number} max + */ + public timestamp(min?: number, max?: number): number; + /** + * Returns a random angle between -180 and 180 + * @method angle + */ + public angle : number; + } +} +/** +* Phaser - RequestAnimationFrame +* +* Abstracts away the use of RAF or setTimeOut for the core game update loop. The callback can be re-mapped on the fly. +*/ +module Phaser { + class RequestAnimationFrame { + /** + * Constructor + * @param {Any} callback + * @return {RequestAnimationFrame} This object. + */ + constructor(callback, callbackContext); + /** + * + * @property _callback + * @type Any + * @private + **/ + private _callback; + private _callbackContext; + /** + * + * @method callback + * @param {Any} callback + **/ + public setCallback(callback): void; + /** + * + * @property _timeOutID + * @type Any + * @private + **/ + private _timeOutID; + /** + * + * @property _isSetTimeOut + * @type Boolean + * @private + **/ + private _isSetTimeOut; + /** + * + * @method usingSetTimeOut + * @return Boolean + **/ + public isUsingSetTimeOut(): bool; + /** + * + * @method usingRAF + * @return Boolean + **/ + public isUsingRAF(): bool; + /** + * + * @property lastTime + * @type Number + **/ + public lastTime: number; + /** + * + * @property currentTime + * @type Number + **/ + public currentTime: number; + /** + * + * @property isRunning + * @type Boolean + **/ + public isRunning: bool; + /** + * + * @method start + * @param {Any} [callback] + **/ + public start(callback?): void; + /** + * + * @method stop + **/ + public stop(): void; + public RAFUpdate(): void; + /** + * + * @method SetTimeoutUpdate + **/ + public SetTimeoutUpdate(): void; + } +} +/** +* Phaser - Input +* +* A game specific Input manager that looks after the mouse, keyboard and touch objects. This is updated by the core game loop. +*/ +module Phaser { + class Input { + constructor(game: Game); + private _game; + public mouse: Mouse; + public keyboard: Keyboard; + public touch: Touch; + public x: number; + public y: number; + public scaleX: number; + public scaleY: number; + public worldX: number; + public worldY: number; + public onDown: Signal; + public onUp: Signal; + public update(): void; + public reset(): void; + public getWorldX(camera?: Camera): number; + public getWorldY(camera?: Camera): number; + public renderDebugInfo(x: number, y: number, color?: string): void; + } +} +/** +* Phaser - Keyboard +* +* The Keyboard class handles keyboard interactions with the game and the resulting events. +* The avoid stealing all browser input we don't use event.preventDefault. If you would like to trap a specific key however +* then use the addKeyCapture() method. +*/ +module Phaser { + class Keyboard { + constructor(game: Game); + private _game; + private _keys; + private _capture; + public start(): void; + public addKeyCapture(keycode): void; + public removeKeyCapture(keycode: number): void; + public clearCaptures(): void; + public onKeyDown(event: KeyboardEvent): void; + public onKeyUp(event: KeyboardEvent): void; + public reset(): void; + public justPressed(keycode: number, duration?: number): bool; + public justReleased(keycode: number, duration?: number): bool; + public isDown(keycode: number): bool; + static A: number; + static B: number; + static C: number; + static D: number; + static E: number; + static F: number; + static G: number; + static H: number; + static I: number; + static J: number; + static K: number; + static L: number; + static M: number; + static N: number; + static O: number; + static P: number; + static Q: number; + static R: number; + static S: number; + static T: number; + static U: number; + static V: number; + static W: number; + static X: number; + static Y: number; + static Z: number; + static ZERO: number; + static ONE: number; + static TWO: number; + static THREE: number; + static FOUR: number; + static FIVE: number; + static SIX: number; + static SEVEN: number; + static EIGHT: number; + static NINE: number; + static NUMPAD_0: number; + static NUMPAD_1: number; + static NUMPAD_2: number; + static NUMPAD_3: number; + static NUMPAD_4: number; + static NUMPAD_5: number; + static NUMPAD_6: number; + static NUMPAD_7: number; + static NUMPAD_8: number; + static NUMPAD_9: number; + static NUMPAD_MULTIPLY: number; + static NUMPAD_ADD: number; + static NUMPAD_ENTER: number; + static NUMPAD_SUBTRACT: number; + static NUMPAD_DECIMAL: number; + static NUMPAD_DIVIDE: number; + static F1: number; + static F2: number; + static F3: number; + static F4: number; + static F5: number; + static F6: number; + static F7: number; + static F8: number; + static F9: number; + static F10: number; + static F11: number; + static F12: number; + static F13: number; + static F14: number; + static F15: number; + static COLON: number; + static EQUALS: number; + static UNDERSCORE: number; + static QUESTION_MARK: number; + static TILDE: number; + static OPEN_BRACKET: number; + static BACKWARD_SLASH: number; + static CLOSED_BRACKET: number; + static QUOTES: number; + static BACKSPACE: number; + static TAB: number; + static CLEAR: number; + static ENTER: number; + static SHIFT: number; + static CONTROL: number; + static ALT: number; + static CAPS_LOCK: number; + static ESC: number; + static SPACEBAR: number; + static PAGE_UP: number; + static PAGE_DOWN: number; + static END: number; + static HOME: number; + static LEFT: number; + static UP: number; + static RIGHT: number; + static DOWN: number; + static INSERT: number; + static DELETE: number; + static HELP: number; + static NUM_LOCK: number; + } +} +/** +* Phaser - Mouse +* +* The Mouse class handles mouse interactions with the game and the resulting events. +*/ +module Phaser { + class Mouse { + constructor(game: Game); + private _game; + private _x; + private _y; + public button: number; + static LEFT_BUTTON: number; + static MIDDLE_BUTTON: number; + static RIGHT_BUTTON: number; + public isDown: bool; + public isUp: bool; + public timeDown: number; + public duration: number; + public timeUp: number; + public start(): void; + public reset(): void; + public onMouseDown(event: MouseEvent): void; + public update(): void; + public onMouseMove(event: MouseEvent): void; + public onMouseUp(event: MouseEvent): void; + } +} +/** +* Phaser - Finger +* +* A Finger object is used by the Touch manager and represents a single finger on the touch screen. +*/ +module Phaser { + class Finger { + /** + * Constructor + * @param {Phaser.Game} game. + * @return {Phaser.Finger} This object. + */ + constructor(game: Game); + /** + * + * @property _game + * @type Phaser.Game + * @private + **/ + private _game; + /** + * An identification number for each touch point. When a touch point becomes active, it must be assigned an identifier that is distinct from any other active touch point. While the touch point remains active, all events that refer to it must assign it the same identifier. + * @property identifier + * @type Number + */ + public identifier: number; + /** + * + * @property active + * @type Boolean + */ + public active: bool; + /** + * + * @property point + * @type Point + **/ + public point: Point; + /** + * + * @property circle + * @type Circle + **/ + public circle: Circle; + /** + * + * @property withinGame + * @type Boolean + */ + public withinGame: bool; + /** + * The horizontal coordinate of point relative to the viewport in pixels, excluding any scroll offset + * @property clientX + * @type Number + */ + public clientX: number; + /** + * The vertical coordinate of point relative to the viewport in pixels, excluding any scroll offset + * @property clientY + * @type Number + */ + public clientY: number; + /** + * The horizontal coordinate of point relative to the viewport in pixels, including any scroll offset + * @property pageX + * @type Number + */ + public pageX: number; + /** + * The vertical coordinate of point relative to the viewport in pixels, including any scroll offset + * @property pageY + * @type Number + */ + public pageY: number; + /** + * The horizontal coordinate of point relative to the screen in pixels + * @property screenX + * @type Number + */ + public screenX: number; + /** + * The vertical coordinate of point relative to the screen in pixels + * @property screenY + * @type Number + */ + public screenY: number; + /** + * The horizontal coordinate of point relative to the game element + * @property x + * @type Number + */ + public x: number; + /** + * The vertical coordinate of point relative to the game element + * @property y + * @type Number + */ + public y: number; + /** + * The Element on which the touch point started when it was first placed on the surface, even if the touch point has since moved outside the interactive area of that element. + * @property target + * @type Any + */ + public target; + /** + * + * @property isDown + * @type Boolean + **/ + public isDown: bool; + /** + * + * @property isUp + * @type Boolean + **/ + public isUp: bool; + /** + * + * @property timeDown + * @type Number + **/ + public timeDown: number; + /** + * + * @property duration + * @type Number + **/ + public duration: number; + /** + * + * @property timeUp + * @type Number + **/ + public timeUp: number; + /** + * + * @property justPressedRate + * @type Number + **/ + public justPressedRate: number; + /** + * + * @property justReleasedRate + * @type Number + **/ + public justReleasedRate: number; + /** + * + * @method start + * @param {Any} event + */ + public start(event): void; + /** + * + * @method move + * @param {Any} event + */ + public move(event): void; + /** + * + * @method leave + * @param {Any} event + */ + public leave(event): void; + /** + * + * @method stop + * @param {Any} event + */ + public stop(event): void; + /** + * + * @method justPressed + * @param {Number} [duration]. + * @return {Boolean} + */ + public justPressed(duration?: number): bool; + /** + * + * @method justReleased + * @param {Number} [duration]. + * @return {Boolean} + */ + public justReleased(duration?: number): bool; + /** + * Returns a string representation of this object. + * @method toString + * @return {string} a string representation of the instance. + **/ + public toString(): string; + } +} +/** +* Phaser - Touch +* +* The Touch class handles touch interactions with the game and the resulting Finger objects. +* http://www.w3.org/TR/touch-events/ +* https://developer.mozilla.org/en-US/docs/DOM/TouchList +* http://www.html5rocks.com/en/mobile/touchandmouse/ +* Note: Android 2.x only supports 1 touch event at once, no multi-touch +* +* @todo Try and resolve update lag in Chrome/Android +* Gestures (pinch, zoom, swipe) +* GameObject Touch +* Touch point within GameObject +* Input Zones (mouse and touch) - lock entities within them + axis aligned drags +*/ +module Phaser { + class Touch { + /** + * Constructor + * @param {Game} game. + * @return {Touch} This object. + */ + constructor(game: Game); + /** + * + * @property _game + * @type Game + * @private + **/ + private _game; + /** + * + * @property x + * @type Number + **/ + public x: number; + /** + * + * @property y + * @type Number + **/ + public y: number; + /** + * + * @property _fingers + * @type Array + * @private + **/ + private _fingers; + /** + * + * @property finger1 + * @type Finger + **/ + public finger1: Finger; + /** + * + * @property finger2 + * @type Finger + **/ + public finger2: Finger; + /** + * + * @property finger3 + * @type Finger + **/ + public finger3: Finger; + /** + * + * @property finger4 + * @type Finger + **/ + public finger4: Finger; + /** + * + * @property finger5 + * @type Finger + **/ + public finger5: Finger; + /** + * + * @property finger6 + * @type Finger + **/ + public finger6: Finger; + /** + * + * @property finger7 + * @type Finger + **/ + public finger7: Finger; + /** + * + * @property finger8 + * @type Finger + **/ + public finger8: Finger; + /** + * + * @property finger9 + * @type Finger + **/ + public finger9: Finger; + /** + * + * @property finger10 + * @type Finger + **/ + public finger10: Finger; + /** + * + * @property latestFinger + * @type Finger + **/ + public latestFinger: Finger; + /** + * + * @property isDown + * @type Boolean + **/ + public isDown: bool; + /** + * + * @property isUp + * @type Boolean + **/ + public isUp: bool; + public touchDown: Signal; + public touchUp: Signal; + /** + * + * @method start + */ + public start(): void; + /** + * Prevent iOS bounce-back (doesn't work?) + * @method consumeTouchMove + * @param {Any} event + **/ + private consumeTouchMove(event); + /** + * + * @method onTouchStart + * @param {Any} event + **/ + private onTouchStart(event); + /** + * Doesn't appear to be supported by most browsers yet + * @method onTouchCancel + * @param {Any} event + **/ + private onTouchCancel(event); + /** + * Doesn't appear to be supported by most browsers yet + * @method onTouchEnter + * @param {Any} event + **/ + private onTouchEnter(event); + /** + * Doesn't appear to be supported by most browsers yet + * @method onTouchLeave + * @param {Any} event + **/ + private onTouchLeave(event); + /** + * + * @method onTouchMove + * @param {Any} event + **/ + private onTouchMove(event); + /** + * + * @method onTouchEnd + * @param {Any} event + **/ + private onTouchEnd(event); + /** + * + * @method calculateDistance + * @param {Finger} finger1 + * @param {Finger} finger2 + **/ + public calculateDistance(finger1: Finger, finger2: Finger): void; + /** + * + * @method calculateAngle + * @param {Finger} finger1 + * @param {Finger} finger2 + **/ + public calculateAngle(finger1: Finger, finger2: Finger): void; + /** + * + * @method checkOverlap + * @param {Finger} finger1 + * @param {Finger} finger2 + **/ + public checkOverlap(finger1: Finger, finger2: Finger): void; + /** + * + * @method update + */ + public update(): void; + /** + * + * @method stop + */ + public stop(): void; + /** + * + * @method reset + **/ + public reset(): void; + } +} +/** +* Phaser - Emitter +* +* Emitter is a lightweight particle emitter. It can be used for one-time explosions or for +* continuous effects like rain and fire. All it really does is launch Particle objects out +* at set intervals, and fixes their positions and velocities accorindgly. +*/ +module Phaser { + class Emitter extends Group { + /** + * Creates a new Emitter object at a specific position. + * Does NOT automatically generate or attach particles! + * + * @param X The X position of the emitter. + * @param Y The Y position of the emitter. + * @param Size Optional, specifies a maximum capacity for this emitter. + */ + constructor(game: Game, X?: number, Y?: number, Size?: number); + /** + * The X position of the top left corner of the emitter in world space. + */ + public x: number; + /** + * The Y position of the top left corner of emitter in world space. + */ + public y: number; + /** + * The width of the emitter. Particles can be randomly generated from anywhere within this box. + */ + public width: number; + /** + * The height of the emitter. Particles can be randomly generated from anywhere within this box. + */ + public height: number; + /** + * The minimum possible velocity of a particle. + * The default value is (-100,-100). + */ + public minParticleSpeed: MicroPoint; + /** + * The maximum possible velocity of a particle. + * The default value is (100,100). + */ + public maxParticleSpeed: MicroPoint; + /** + * The X and Y drag component of particles launched from the emitter. + */ + public particleDrag: MicroPoint; + /** + * The minimum possible angular velocity of a particle. The default value is -360. + * NOTE: rotating particles are more expensive to draw than non-rotating ones! + */ + public minRotation: number; + /** + * The maximum possible angular velocity of a particle. The default value is 360. + * NOTE: rotating particles are more expensive to draw than non-rotating ones! + */ + public maxRotation: number; + /** + * Sets the acceleration.y member of each particle to this value on launch. + */ + public gravity: number; + /** + * Determines whether the emitter is currently emitting particles. + * It is totally safe to directly toggle this. + */ + public on: bool; + /** + * How often a particle is emitted (if emitter is started with Explode == false). + */ + public frequency: number; + /** + * How long each particle lives once it is emitted. + * Set lifespan to 'zero' for particles to live forever. + */ + public lifespan: number; + /** + * How much each particle should bounce. 1 = full bounce, 0 = no bounce. + */ + public bounce: number; + /** + * Set your own particle class type here. + * Default is Particle. + */ + public particleClass; + /** + * Internal helper for deciding how many particles to launch. + */ + private _quantity; + /** + * Internal helper for the style of particle emission (all at once, or one at a time). + */ + private _explode; + /** + * Internal helper for deciding when to launch particles or kill them. + */ + private _timer; + /** + * Internal counter for figuring out how many particles to launch. + */ + private _counter; + /** + * Internal point object, handy for reusing for memory mgmt purposes. + */ + private _point; + /** + * Clean up memory. + */ + public destroy(): void; + /** + * This function generates a new array of particle sprites to attach to the emitter. + * + * @param Graphics If you opted to not pre-configure an array of Sprite objects, you can simply pass in a particle image or sprite sheet. + * @param Quantity The number of particles to generate when using the "create from image" option. + * @param BakedRotations How many frames of baked rotation to use (boosts performance). Set to zero to not use baked rotations. + * @param Multiple Whether the image in the Graphics param is a single particle or a bunch of particles (if it's a bunch, they need to be square!). + * @param Collide Whether the particles should be flagged as not 'dead' (non-colliding particles are higher performance). 0 means no collisions, 0-1 controls scale of particle's bounding box. + * + * @return This Emitter instance (nice for chaining stuff together, if you're into that). + */ + public makeParticles(Graphics, Quantity?: number, BakedRotations?: number, Multiple?: bool, Collide?: number): Emitter; + /** + * Called automatically by the game loop, decides when to launch particles and when to "die". + */ + public update(): void; + /** + * Call this function to turn off all the particles and the emitter. + */ + public kill(): void; + /** + * Call this function to start emitting particles. + * + * @param Explode Whether the particles should all burst out at once. + * @param Lifespan How long each particle lives once emitted. 0 = forever. + * @param Frequency Ignored if Explode is set to true. Frequency is how often to emit a particle. 0 = never emit, 0.1 = 1 particle every 0.1 seconds, 5 = 1 particle every 5 seconds. + * @param Quantity How many particles to launch. 0 = "all of the particles". + */ + public start(Explode?: bool, Lifespan?: number, Frequency?: number, Quantity?: number): void; + /** + * This function can be used both internally and externally to emit the next particle. + */ + public emitParticle(): void; + /** + * A more compact way of setting the width and height of the emitter. + * + * @param Width The desired width of the emitter (particles are spawned randomly within these dimensions). + * @param Height The desired height of the emitter. + */ + public setSize(Width: number, Height: number): void; + /** + * A more compact way of setting the X velocity range of the emitter. + * + * @param Min The minimum value for this range. + * @param Max The maximum value for this range. + */ + public setXSpeed(Min?: number, Max?: number): void; + /** + * A more compact way of setting the Y velocity range of the emitter. + * + * @param Min The minimum value for this range. + * @param Max The maximum value for this range. + */ + public setYSpeed(Min?: number, Max?: number): void; + /** + * A more compact way of setting the angular velocity constraints of the emitter. + * + * @param Min The minimum value for this range. + * @param Max The maximum value for this range. + */ + public setRotation(Min?: number, Max?: number): void; + /** + * Change the emitter's midpoint to match the midpoint of a Object. + * + * @param Object The Object that you want to sync up with. + */ + public at(Object): void; + } +} +/** +* Phaser - GeomSprite +* +* A GeomSprite is a special kind of GameObject that contains a base geometry class (Circle, Line, Point, Rectangle). +* They can be rendered in the game and used for collision just like any other game object. Display of them is controlled +* via the lineWidth / lineColor / fillColor and renderOutline / renderFill properties. +*/ +module Phaser { + class GeomSprite extends GameObject { + constructor(game: Game, x?: number, y?: number); + private _dx; + private _dy; + private _dw; + private _dh; + public type: number; + static UNASSIGNED: number; + static CIRCLE: number; + static LINE: number; + static POINT: number; + static RECTANGLE: number; + public circle: Circle; + public line: Line; + public point: Point; + public rect: Rectangle; + public renderOutline: bool; + public renderFill: bool; + public lineWidth: number; + public lineColor: string; + public fillColor: string; + public loadCircle(circle: Circle): GeomSprite; + public loadLine(line: Line): GeomSprite; + public loadPoint(point: Point): GeomSprite; + public loadRectangle(rect: Rectangle): GeomSprite; + public createCircle(diameter: number): GeomSprite; + public createLine(x: number, y: number): GeomSprite; + public createPoint(): GeomSprite; + public createRectangle(width: number, height: number): GeomSprite; + public refresh(): void; + public update(): void; + public inCamera(camera: Rectangle): bool; + public render(camera: Camera, cameraOffsetX: number, cameraOffsetY: number): bool; + public renderPoint(offsetX, offsetY, point, size): void; + public renderDebugInfo(x: number, y: number, color?: string): void; + public collide(source: GeomSprite): bool; + } +} +/** +* Phaser - Particle +* +* This is a simple particle class that extends a Sprite to have a slightly more +* specialised behaviour. It is used exclusively by the Emitter class and can be extended as required. +*/ +module Phaser { + class Particle extends Sprite { + /** + * Instantiate a new particle. Like Sprite, all meaningful creation + * happens during loadGraphic() or makeGraphic() or whatever. + */ + constructor(game: Game); + /** + * How long this particle lives before it disappears. + * NOTE: this is a maximum, not a minimum; the object + * could get recycled before its lifespan is up. + */ + public lifespan: number; + /** + * Determines how quickly the particles come to rest on the ground. + * Only used if the particle has gravity-like acceleration applied. + * @default 500 + */ + public friction: number; + /** + * The particle's main update logic. Basically it checks to see if it should + * be dead yet, and then has some special bounce behavior if there is some gravity on it. + */ + public update(): void; + /** + * Triggered whenever this object is launched by a Emitter. + * You can override this to add custom behavior like a sound or AI or something. + */ + public onEmit(): void; + } +} +/** +* Phaser - TilemapLayer +* +* A Tilemap Layer. Tiled format maps can have multiple overlapping layers. +*/ +module Phaser { + class TilemapLayer { + constructor(game: Game, parent: Tilemap, key: string, mapFormat: number, name: string, tileWidth: number, tileHeight: number); + private _game; + private _parent; + private _texture; + private _tileOffsets; + private _startX; + private _startY; + private _maxX; + private _maxY; + private _tx; + private _ty; + private _dx; + private _dy; + private _oldCameraX; + private _oldCameraY; + private _columnData; + private _tempTileX; + private _tempTileY; + private _tempTileW; + private _tempTileH; + public name: string; + public alpha: number; + public exists: bool; + public visible: bool; + public orientation: string; + public properties: {}; + public mapData; + public mapFormat: number; + public boundsInTiles: Rectangle; + public tileWidth: number; + public tileHeight: number; + public widthInTiles: number; + public heightInTiles: number; + public widthInPixels: number; + public heightInPixels: number; + public tileMargin: number; + public tileSpacing: number; + public getTileFromWorldXY(x: number, y: number): number; + public getTileOverlaps(object: GameObject): bool; + public getTileBlock(x: number, y: number, width: number, height: number): any[]; + public getTileIndex(x: number, y: number): number; + public addColumn(column): void; + public updateBounds(): void; + public parseTileOffsets(): number; + public renderDebugInfo(x: number, y: number, color?: string): void; + public render(camera: Camera, dx, dy): bool; + } +} +/** +* Phaser - Tile +* +* A Tile is a single representation of a tile within a Tilemap +*/ +module Phaser { + class Tile { + constructor(game: Game, tilemap: Tilemap, index: number, width: number, height: number); + private _game; + public name: string; + public mass: number; + public width: number; + public height: number; + public allowCollisions: number; + public collideLeft: bool; + public collideRight: bool; + public collideUp: bool; + public collideDown: bool; + /** + * A reference to the tilemap this tile object belongs to. + */ + public tilemap: Tilemap; + /** + * The index of this tile type in the core map data. + * For example, if your map only has 16 kinds of tiles in it, + * this number is usually between 0 and 15. + */ + public index: number; + /** + * Clean up memory. + */ + public destroy(): void; + public setCollision(collision: number, resetCollisions: bool): void; + public resetCollision(): void; + /** + * Returns a string representation of this object. + * @method toString + * @return {string} a string representation of the object. + **/ + public toString(): string; + } +} +/** +* Phaser - Tilemap +* +* This GameObject allows for the display of a tilemap within the game world. Tile maps consist of an image, tile data and a size. +* Internally it creates a TilemapLayer for each layer in the tilemap. +*/ +module Phaser { + class Tilemap extends GameObject { + constructor(game: Game, key: string, mapData: string, format: number, resizeWorld?: bool, tileWidth?: number, tileHeight?: number); + static FORMAT_CSV: number; + static FORMAT_TILED_JSON: number; + public tiles: Tile[]; + public layers: TilemapLayer[]; + public currentLayer: TilemapLayer; + public collisionLayer: TilemapLayer; + public mapFormat: number; + public update(): void; + public render(camera: Camera, cameraOffsetX: number, cameraOffsetY: number): void; + private parseCSV(data, key, tileWidth, tileHeight); + private parseTiledJSON(data, key); + private generateTiles(qty); + public widthInPixels : number; + public heightInPixels : number; + public setCollisionRange(start: number, end: number, collision?: number, resetCollisions?: bool): void; + public setCollisionByIndex(values: number[], collision?: number, resetCollisions?: bool): void; + public getTile(x: number, y: number, layer?: number): Tile; + public getTileFromWorldXY(x: number, y: number, layer?: number): Tile; + public getTileFromInputXY(layer?: number): Tile; + public getTileOverlaps(object: GameObject): bool; + public collide(objectOrGroup?, callback?): bool; + public collideGameObject(object: GameObject): bool; + } +} +/** +* Phaser - ScrollRegion +* +* Creates a scrolling region within a ScrollZone. +* It is scrolled via the scrollSpeed.x/y properties. +*/ +module Phaser { + class ScrollRegion { + constructor(x: number, y: number, width: number, height: number, speedX: number, speedY: number); + private _A; + private _B; + private _C; + private _D; + private _bounds; + private _scroll; + private _anchorWidth; + private _anchorHeight; + private _inverseWidth; + private _inverseHeight; + public visible: bool; + public scrollSpeed: MicroPoint; + public update(delta: number): void; + public render(context: CanvasRenderingContext2D, texture, dx: number, dy: number, dw: number, dh: number): void; + private crop(context, texture, srcX, srcY, srcW, srcH, destX, destY, destW, destH, offsetX, offsetY); + } +} +/** +* Phaser - ScrollZone +* +* Creates a scrolling region of the given width and height from an image in the cache. +* The ScrollZone can be positioned anywhere in-world like a normal game object, re-act to physics, collision, etc. +* The image within it is scrolled via ScrollRegions and their scrollSpeed.x/y properties. +* If you create a scroll zone larger than the given source image it will create a DynamicTexture and fill it with a pattern of the source image. +*/ +module Phaser { + class ScrollZone extends GameObject { + constructor(game: Game, key: string, x?: number, y?: number, width?: number, height?: number); + private _texture; + private _dynamicTexture; + private _dx; + private _dy; + private _dw; + private _dh; + public currentRegion: ScrollRegion; + public regions: ScrollRegion[]; + public flipped: bool; + public addRegion(x: number, y: number, width: number, height: number, speedX?: number, speedY?: number): ScrollRegion; + public setSpeed(x: number, y: number): ScrollZone; + public update(): void; + public inCamera(camera: Rectangle): bool; + public render(camera: Camera, cameraOffsetX: number, cameraOffsetY: number): bool; + private createRepeatingTexture(regionWidth, regionHeight); + } +} +/** +* Phaser - Game +* +* This is where the magic happens. The Game object is the heart of your game, +* providing quick access to common functions and handling the boot process. +* +* "Hell, there are no rules here - we're trying to accomplish something." +* Thomas A. Edison +*/ +module Phaser { + class Game { + constructor(callbackContext, parent?: string, width?: number, height?: number, initCallback?, createCallback?, updateCallback?, renderCallback?); + private _raf; + private _maxAccumulation; + private _accumulator; + private _step; + private _loadComplete; + private _paused; + private _pendingState; + public callbackContext; + public onInitCallback; + public onCreateCallback; + public onUpdateCallback; + public onRenderCallback; + public onPausedCallback; + public cache: Cache; + public collision: Collision; + public input: Input; + public loader: Loader; + public math: GameMath; + public motion: Motion; + public sound: SoundManager; + public stage: Stage; + public time: Time; + public tweens: TweenManager; + public world: World; + public rnd: RandomDataGenerator; + public device: Device; + public isBooted: bool; + public isRunning: bool; + private boot(parent, width, height); + private loadComplete(); + private bootLoop(); + private pausedLoop(); + private loop(); + private startState(); + public setCallbacks(initCallback?, createCallback?, updateCallback?, renderCallback?): void; + public switchState(state, clearWorld?: bool, clearCache?: bool): void; + public destroy(): void; + public paused : bool; + public framerate : number; + public createCamera(x: number, y: number, width: number, height: number): Camera; + public createGeomSprite(x: number, y: number): GeomSprite; + public createSprite(x: number, y: number, key?: string): Sprite; + public createDynamicTexture(width: number, height: number): DynamicTexture; + public createGroup(MaxSize?: number): Group; + public createParticle(): Particle; + public createEmitter(x?: number, y?: number, size?: number): Emitter; + public createScrollZone(key: string, x?: number, y?: number, width?: number, height?: number): ScrollZone; + public createTilemap(key: string, mapData: string, format: number, resizeWorld?: bool, tileWidth?: number, tileHeight?: number): Tilemap; + public createTween(obj): Tween; + public collide(objectOrGroup1?: Basic, objectOrGroup2?: Basic, notifyCallback?): bool; + public camera : Camera; + } +} +/** +* Phaser - FXManager +* +* The FXManager controls all special effects applied to game objects such as Cameras. +*/ +module Phaser { + class FXManager { + constructor(game: Game, parent); + /** + * The essential reference to the main game object. + */ + private _game; + /** + * A reference to the object that owns this FXManager instance. + */ + private _parent; + /** + * The array in which we keep all of the registered FX + */ + private _fx; + /** + * Holds the size of the _fx array + */ + private _length; + /** + * Controls whether any of the FX have preUpdate, update or postUpdate called + */ + public active: bool; + /** + * Controls whether any of the FX have preRender, render or postRender called + */ + public visible: bool; + /** + * Adds a new FX to the FXManager. + * The effect must be an object with at least one of the following methods: preUpdate, postUpdate, preRender, render or postRender. + * A new instance of the effect will be created and a reference to Game will be passed to the object constructor. + */ + public add(effect): any; + /** + * Pre-update is called at the start of the objects update cycle, before any other updates have taken place. + */ + public preUpdate(): void; + /** + * Post-update is called at the end of the objects update cycle, after other update logic has taken place. + */ + public postUpdate(): void; + /** + * Pre-render is called at the start of the object render cycle, before any transforms have taken place. + * It happens directly AFTER a canvas context.save has happened if added to a Camera. + */ + public preRender(camera: Camera, cameraX: number, cameraY: number, cameraWidth: number, cameraHeight: number): void; + /** + * render is called during the objects render cycle, right after all transforms have finished, but before any children/image data is rendered. + */ + public render(camera: Camera, cameraX: number, cameraY: number, cameraWidth: number, cameraHeight: number): void; + /** + * Post-render is called during the objects render cycle, after the children/image data has been rendered. + * It happens directly BEFORE a canvas context.restore has happened if added to a Camera. + */ + public postRender(camera: Camera, cameraX: number, cameraY: number, cameraWidth: number, cameraHeight: number): void; + /** + * Clear down this FXManager and null out references + */ + public destroy(): void; + } +} +/** +* Phaser - State +* +* This is a base State class which can be extended if you are creating your game using TypeScript. +*/ +module Phaser { + class State { + constructor(game: Game); + public game: Game; + public camera: Camera; + public cache: Cache; + public collision: Collision; + public input: Input; + public loader: Loader; + public math: GameMath; + public motion: Motion; + public sound: SoundManager; + public stage: Stage; + public time: Time; + public tweens: TweenManager; + public world: World; + public init(): void; + public create(): void; + public update(): void; + public render(): void; + public paused(): void; + public createCamera(x: number, y: number, width: number, height: number): Camera; + public createGeomSprite(x: number, y: number): GeomSprite; + public createSprite(x: number, y: number, key?: string): Sprite; + public createDynamicTexture(width: number, height: number): DynamicTexture; + public createGroup(MaxSize?: number): Group; + public createParticle(): Particle; + public createEmitter(x?: number, y?: number, size?: number): Emitter; + public createScrollZone(key: string, x?: number, y?: number, width?: number, height?: number): ScrollZone; + public createTilemap(key: string, mapData: string, format: number, resizeWorld?: bool, tileWidth?: number, tileHeight?: number): Tilemap; + public createTween(obj): Tween; + public collide(ObjectOrGroup1?: Basic, ObjectOrGroup2?: Basic, NotifyCallback?): bool; + } +} diff --git a/build/phaser.js b/build/phaser.js index 76b5a1d4..59fe8d15 100644 --- a/build/phaser.js +++ b/build/phaser.js @@ -920,19 +920,6 @@ var Phaser; this._target = null; this._sx = 0; this._sy = 0; - this._fxFlashComplete = null; - this._fxFlashDuration = 0; - this._fxFlashAlpha = 0; - this._fxFadeComplete = null; - this._fxFadeDuration = 0; - this._fxFadeAlpha = 0; - this._fxShakeIntensity = 0; - this._fxShakeDuration = 0; - this._fxShakeComplete = null; - this._fxShakeOffset = new Phaser.MicroPoint(0, 0); - this._fxShakeDirection = 0; - this._fxShakePrevX = 0; - this._fxShakePrevY = 0; this.scale = new Phaser.MicroPoint(1, 1); this.scroll = new Phaser.MicroPoint(0, 0); this.bounds = null; @@ -958,6 +945,7 @@ var Phaser; this.ID = id; this._stageX = x; this._stageY = y; + this.fx = new Phaser.FXManager(this._game, this); // The view into the world canvas we wish to render this.worldView = new Phaser.Rectangle(0, 0, width, height); this.checkClip(); @@ -966,107 +954,6 @@ var Phaser; Camera.STYLE_PLATFORMER = 1; Camera.STYLE_TOPDOWN = 2; Camera.STYLE_TOPDOWN_TIGHT = 3; - Camera.SHAKE_BOTH_AXES = 0; - Camera.SHAKE_HORIZONTAL_ONLY = 1; - Camera.SHAKE_VERTICAL_ONLY = 2; - Camera.prototype.flash = /** - * The camera is filled with this color and returns to normal at the given duration. - * - * @param Color The color you want to use in 0xRRGGBB format, i.e. 0xffffff for white. - * @param Duration How long it takes for the flash to fade. - * @param OnComplete An optional function you want to run when the flash finishes. Set to null for no callback. - * @param Force Force an already running flash effect to reset. - */ - function (color, duration, onComplete, force) { - if (typeof color === "undefined") { color = 0xffffff; } - if (typeof duration === "undefined") { duration = 1; } - if (typeof onComplete === "undefined") { onComplete = null; } - if (typeof force === "undefined") { force = false; } - if(force === false && this._fxFlashAlpha > 0) { - // You can't flash again unless you force it - return; - } - if(duration <= 0) { - duration = 1; - } - var red = color >> 16 & 0xFF; - var green = color >> 8 & 0xFF; - var blue = color & 0xFF; - this._fxFlashColor = 'rgba(' + red + ',' + green + ',' + blue + ','; - this._fxFlashDuration = duration; - this._fxFlashAlpha = 1; - this._fxFlashComplete = onComplete; - }; - Camera.prototype.fade = /** - * The camera is gradually filled with this color. - * - * @param Color The color you want to use in 0xRRGGBB format, i.e. 0xffffff for white. - * @param Duration How long it takes for the flash to fade. - * @param OnComplete An optional function you want to run when the flash finishes. Set to null for no callback. - * @param Force Force an already running flash effect to reset. - */ - function (color, duration, onComplete, force) { - if (typeof color === "undefined") { color = 0x000000; } - if (typeof duration === "undefined") { duration = 1; } - if (typeof onComplete === "undefined") { onComplete = null; } - if (typeof force === "undefined") { force = false; } - if(force === false && this._fxFadeAlpha > 0) { - // You can't fade again unless you force it - return; - } - if(duration <= 0) { - duration = 1; - } - var red = color >> 16 & 0xFF; - var green = color >> 8 & 0xFF; - var blue = color & 0xFF; - this._fxFadeColor = 'rgba(' + red + ',' + green + ',' + blue + ','; - this._fxFadeDuration = duration; - this._fxFadeAlpha = 0.01; - this._fxFadeComplete = onComplete; - }; - Camera.prototype.shake = /** - * A simple screen-shake effect. - * - * @param Intensity Percentage of screen size representing the maximum distance that the screen can move while shaking. - * @param Duration The length in seconds that the shaking effect should last. - * @param OnComplete A function you want to run when the shake effect finishes. - * @param Force Force the effect to reset (default = true, unlike flash() and fade()!). - * @param Direction Whether to shake on both axes, just up and down, or just side to side (use class constants SHAKE_BOTH_AXES, SHAKE_VERTICAL_ONLY, or SHAKE_HORIZONTAL_ONLY). - */ - function (intensity, duration, onComplete, force, direction) { - if (typeof intensity === "undefined") { intensity = 0.05; } - if (typeof duration === "undefined") { duration = 0.5; } - if (typeof onComplete === "undefined") { onComplete = null; } - if (typeof force === "undefined") { force = true; } - if (typeof direction === "undefined") { direction = Camera.SHAKE_BOTH_AXES; } - if(!force && ((this._fxShakeOffset.x != 0) || (this._fxShakeOffset.y != 0))) { - return; - } - // If a shake is not already running we need to store the offsets here - if(this._fxShakeOffset.x == 0 && this._fxShakeOffset.y == 0) { - this._fxShakePrevX = this._stageX; - this._fxShakePrevY = this._stageY; - } - this._fxShakeIntensity = intensity; - this._fxShakeDuration = duration; - this._fxShakeComplete = onComplete; - this._fxShakeDirection = direction; - this._fxShakeOffset.setTo(0, 0); - }; - Camera.prototype.stopFX = /** - * Just turns off all the camera effects instantly. - */ - function () { - this._fxFlashAlpha = 0; - this._fxFadeAlpha = 0; - if(this._fxShakeDuration !== 0) { - this._fxShakeDuration = 0; - this._fxShakeOffset.setTo(0, 0); - this._stageX = this._fxShakePrevX; - this._stageY = this._fxShakePrevY; - } - }; Camera.prototype.follow = function (target, style) { if (typeof style === "undefined") { style = Camera.STYLE_LOCKON; } this._target = target; @@ -1124,6 +1011,7 @@ var Phaser; this.update(); }; Camera.prototype.update = function () { + this.fx.preUpdate(); if(this._target !== null) { if(this.deadzone == null) { this.focusOnXY(this._target.x + this._target.origin.x, this._target.y + this._target.origin.y); @@ -1166,73 +1054,22 @@ var Phaser; } this.worldView.x = this.scroll.x; this.worldView.y = this.scroll.y; - //console.log(this.worldView.width, this.worldView.height); // Input values this.inputX = this.worldView.x + this._game.input.x; this.inputY = this.worldView.y + this._game.input.y; - // Update the Flash effect - if(this._fxFlashAlpha > 0) { - this._fxFlashAlpha -= this._game.time.elapsed / this._fxFlashDuration; - this._fxFlashAlpha = this._game.math.roundTo(this._fxFlashAlpha, -2); - if(this._fxFlashAlpha <= 0) { - this._fxFlashAlpha = 0; - if(this._fxFlashComplete !== null) { - this._fxFlashComplete(); - } - } - } - // Update the Fade effect - if(this._fxFadeAlpha > 0) { - this._fxFadeAlpha += this._game.time.elapsed / this._fxFadeDuration; - this._fxFadeAlpha = this._game.math.roundTo(this._fxFadeAlpha, -2); - if(this._fxFadeAlpha >= 1) { - this._fxFadeAlpha = 1; - if(this._fxFadeComplete !== null) { - this._fxFadeComplete(); - } - } - } - // Update the "shake" special effect - if(this._fxShakeDuration > 0) { - this._fxShakeDuration -= this._game.time.elapsed; - this._fxShakeDuration = this._game.math.roundTo(this._fxShakeDuration, -2); - if(this._fxShakeDuration <= 0) { - this._fxShakeDuration = 0; - this._fxShakeOffset.setTo(0, 0); - this._stageX = this._fxShakePrevX; - this._stageY = this._fxShakePrevY; - if(this._fxShakeComplete != null) { - this._fxShakeComplete(); - } - } else { - if((this._fxShakeDirection == Camera.SHAKE_BOTH_AXES) || (this._fxShakeDirection == Camera.SHAKE_HORIZONTAL_ONLY)) { - //this._fxShakeOffset.x = ((this._game.math.random() * this._fxShakeIntensity * this.worldView.width * 2 - this._fxShakeIntensity * this.worldView.width) * this._zoom; - this._fxShakeOffset.x = (this._game.math.random() * this._fxShakeIntensity * this.worldView.width * 2 - this._fxShakeIntensity * this.worldView.width); - } - if((this._fxShakeDirection == Camera.SHAKE_BOTH_AXES) || (this._fxShakeDirection == Camera.SHAKE_VERTICAL_ONLY)) { - //this._fxShakeOffset.y = (this._game.math.random() * this._fxShakeIntensity * this.worldView.height * 2 - this._fxShakeIntensity * this.worldView.height) * this._zoom; - this._fxShakeOffset.y = (this._game.math.random() * this._fxShakeIntensity * this.worldView.height * 2 - this._fxShakeIntensity * this.worldView.height); - } - } - } + this.fx.postUpdate(); }; Camera.prototype.render = function () { if(this.visible === false || this.alpha < 0.1) { return; } - if((this._fxShakeOffset.x != 0) || (this._fxShakeOffset.y != 0)) { - //this._stageX = this._fxShakePrevX + (this.worldView.halfWidth * this._zoom) + this._fxShakeOffset.x; - //this._stageY = this._fxShakePrevY + (this.worldView.halfHeight * this._zoom) + this._fxShakeOffset.y; - this._stageX = this._fxShakePrevX + (this.worldView.halfWidth) + this._fxShakeOffset.x; - this._stageY = this._fxShakePrevY + (this.worldView.halfHeight) + this._fxShakeOffset.y; - //console.log('shake', this._fxShakeDuration, this._fxShakeIntensity, this._fxShakeOffset.x, this._fxShakeOffset.y); - } //if (this._rotation !== 0 || this._clip || this.scale.x !== 1 || this.scale.y !== 1) //{ //this._game.stage.context.save(); //} - // It may be safe/quicker to just save the context every frame regardless + // It may be safer/quicker to just save the context every frame regardless (needs testing on mobile) this._game.stage.context.save(); + this.fx.preRender(this, this._stageX, this._stageY, this.worldView.width, this.worldView.height); if(this.alpha !== 1) { this._game.stage.context.globalAlpha = this.alpha; } @@ -1274,6 +1111,7 @@ var Phaser; this._game.stage.context.shadowOffsetX = 0; this._game.stage.context.shadowOffsetY = 0; } + this.fx.render(this, this._stageX, this._stageY, this.worldView.width, this.worldView.height); // Clip the camera so we don't get sprites appearing outside the edges if(this._clip) { this._game.stage.context.beginPath(); @@ -1288,24 +1126,14 @@ var Phaser; this._game.stage.context.rect(this._sx, this._sy, this.worldView.width, this.worldView.height); this._game.stage.context.stroke(); } - // "Flash" FX - if(this._fxFlashAlpha > 0) { - this._game.stage.context.fillStyle = this._fxFlashColor + this._fxFlashAlpha + ')'; - this._game.stage.context.fillRect(this._sx, this._sy, this.worldView.width, this.worldView.height); - } - // "Fade" FX - if(this._fxFadeAlpha > 0) { - this._game.stage.context.fillStyle = this._fxFadeColor + this._fxFadeAlpha + ')'; - this._game.stage.context.fillRect(this._sx, this._sy, this.worldView.width, this.worldView.height); - } // Scale off if(this.scale.x !== 1 || this.scale.y !== 1) { this._game.stage.context.scale(1, 1); } + this.fx.postRender(this, this._sx, this._sy, this.worldView.width, this.worldView.height); if(this._rotation !== 0 || this._clip) { this._game.stage.context.translate(0, 0); } - // maybe just do this every frame regardless? this._game.stage.context.restore(); if(this.alpha !== 1) { this._game.stage.context.globalAlpha = 1; @@ -1335,8 +1163,7 @@ var Phaser; this.worldView.width = width; this.worldView.height = height; this.checkClip(); - //console.log('Camera setSize', width, height); - }; + }; Camera.prototype.renderDebugInfo = function (x, y, color) { if (typeof color === "undefined") { color = 'rgb(255,255,255)'; } this._game.stage.context.fillStyle = color; @@ -7626,7 +7453,7 @@ var Phaser; * * Richard Davey (@photonstorm) * -* Many thanks to Adam Saltsman (@ADAMATOMIC) for the original Flixel AS3 code on which Phaser is based. +* Many thanks to Adam Saltsman (@ADAMATOMIC) for releasing Flixel on which Phaser took a lot of inspiration. * * "If you want your children to be intelligent, read them fairy tales." * "If you want them to be more intelligent, read them more fairy tales." @@ -11750,12 +11577,261 @@ var Phaser; // Delete tiles of certain type // Erase tiles })(Phaser || (Phaser = {})); +/// +/// +/** +* Phaser - ScrollRegion +* +* Creates a scrolling region within a ScrollZone. +* It is scrolled via the scrollSpeed.x/y properties. +*/ +var Phaser; +(function (Phaser) { + var ScrollRegion = (function () { + function ScrollRegion(x, y, width, height, speedX, speedY) { + this._anchorWidth = 0; + this._anchorHeight = 0; + this._inverseWidth = 0; + this._inverseHeight = 0; + this.visible = true; + // Our seamless scrolling quads + this._A = new Phaser.Quad(x, y, width, height); + this._B = new Phaser.Quad(x, y, width, height); + this._C = new Phaser.Quad(x, y, width, height); + this._D = new Phaser.Quad(x, y, width, height); + this._scroll = new Phaser.MicroPoint(); + this._bounds = new Phaser.Quad(x, y, width, height); + this.scrollSpeed = new Phaser.MicroPoint(speedX, speedY); + } + ScrollRegion.prototype.update = function (delta) { + this._scroll.x += this.scrollSpeed.x; + this._scroll.y += this.scrollSpeed.y; + if(this._scroll.x > this._bounds.right) { + this._scroll.x = this._bounds.x; + } + if(this._scroll.x < this._bounds.x) { + this._scroll.x = this._bounds.right; + } + if(this._scroll.y > this._bounds.bottom) { + this._scroll.y = this._bounds.y; + } + if(this._scroll.y < this._bounds.y) { + this._scroll.y = this._bounds.bottom; + } + // Anchor Dimensions + this._anchorWidth = (this._bounds.width - this._scroll.x) + this._bounds.x; + this._anchorHeight = (this._bounds.height - this._scroll.y) + this._bounds.y; + if(this._anchorWidth > this._bounds.width) { + this._anchorWidth = this._bounds.width; + } + if(this._anchorHeight > this._bounds.height) { + this._anchorHeight = this._bounds.height; + } + this._inverseWidth = this._bounds.width - this._anchorWidth; + this._inverseHeight = this._bounds.height - this._anchorHeight; + // Quad A + this._A.setTo(this._scroll.x, this._scroll.y, this._anchorWidth, this._anchorHeight); + // Quad B + this._B.y = this._scroll.y; + this._B.width = this._inverseWidth; + this._B.height = this._anchorHeight; + // Quad C + this._C.x = this._scroll.x; + this._C.width = this._anchorWidth; + this._C.height = this._inverseHeight; + // Quad D + this._D.width = this._inverseWidth; + this._D.height = this._inverseHeight; + }; + ScrollRegion.prototype.render = function (context, texture, dx, dy, dw, dh) { + if(this.visible == false) { + return; + } + // dx/dy are the world coordinates to render the FULL ScrollZone into. + // This ScrollRegion may be smaller than that and offset from the dx/dy coordinates. + this.crop(context, texture, this._A.x, this._A.y, this._A.width, this._A.height, dx, dy, dw, dh, 0, 0); + this.crop(context, texture, this._B.x, this._B.y, this._B.width, this._B.height, dx, dy, dw, dh, this._A.width, 0); + this.crop(context, texture, this._C.x, this._C.y, this._C.width, this._C.height, dx, dy, dw, dh, 0, this._A.height); + this.crop(context, texture, this._D.x, this._D.y, this._D.width, this._D.height, dx, dy, dw, dh, this._C.width, this._A.height); + //context.fillStyle = 'rgb(255,255,255)'; + //context.font = '18px Arial'; + //context.fillText('QuadA: ' + this._A.toString(), 32, 450); + //context.fillText('QuadB: ' + this._B.toString(), 32, 480); + //context.fillText('QuadC: ' + this._C.toString(), 32, 510); + //context.fillText('QuadD: ' + this._D.toString(), 32, 540); + }; + ScrollRegion.prototype.crop = function (context, texture, srcX, srcY, srcW, srcH, destX, destY, destW, destH, offsetX, offsetY) { + offsetX += destX; + offsetY += destY; + if(srcW > (destX + destW) - offsetX) { + srcW = (destX + destW) - offsetX; + } + if(srcH > (destY + destH) - offsetY) { + srcH = (destY + destH) - offsetY; + } + srcX = Math.floor(srcX); + srcY = Math.floor(srcY); + srcW = Math.floor(srcW); + srcH = Math.floor(srcH); + offsetX = Math.floor(offsetX + this._bounds.x); + offsetY = Math.floor(offsetY + this._bounds.y); + if(srcW > 0 && srcH > 0) { + context.drawImage(texture, srcX, srcY, srcW, srcH, offsetX, offsetY, srcW, srcH); + } + }; + return ScrollRegion; + })(); + Phaser.ScrollRegion = ScrollRegion; +})(Phaser || (Phaser = {})); +/// +/// +/// +/** +* Phaser - ScrollZone +* +* Creates a scrolling region of the given width and height from an image in the cache. +* The ScrollZone can be positioned anywhere in-world like a normal game object, re-act to physics, collision, etc. +* The image within it is scrolled via ScrollRegions and their scrollSpeed.x/y properties. +* If you create a scroll zone larger than the given source image it will create a DynamicTexture and fill it with a pattern of the source image. +*/ +var Phaser; +(function (Phaser) { + var ScrollZone = (function (_super) { + __extends(ScrollZone, _super); + function ScrollZone(game, key, x, y, width, height) { + if (typeof x === "undefined") { x = 0; } + if (typeof y === "undefined") { y = 0; } + if (typeof width === "undefined") { width = 0; } + if (typeof height === "undefined") { height = 0; } + _super.call(this, game, x, y, width, height); + this._dynamicTexture = null; + // local rendering related temp vars to help avoid gc spikes + this._dx = 0; + this._dy = 0; + this._dw = 0; + this._dh = 0; + this.flipped = false; + this.regions = []; + if(this._game.cache.getImage(key)) { + this._texture = this._game.cache.getImage(key); + this.width = this._texture.width; + this.height = this._texture.height; + if(width > this._texture.width || height > this._texture.height) { + // Create our repeating texture (as the source image wasn't large enough for the requested size) + this.createRepeatingTexture(width, height); + this.width = width; + this.height = height; + } + // Create a default ScrollRegion at the requested size + this.addRegion(0, 0, this.width, this.height); + // If the zone is smaller than the image itself then shrink the bounds + if((width < this._texture.width || height < this._texture.height) && width !== 0 && height !== 0) { + this.width = width; + this.height = height; + } + } + } + ScrollZone.prototype.addRegion = function (x, y, width, height, speedX, speedY) { + if (typeof speedX === "undefined") { speedX = 0; } + if (typeof speedY === "undefined") { speedY = 0; } + if(x > this.width || y > this.height || x < 0 || y < 0 || (x + width) > this.width || (y + height) > this.height) { + throw Error('Invalid ScrollRegion defined. Cannot be larger than parent ScrollZone'); + return; + } + this.currentRegion = new Phaser.ScrollRegion(x, y, width, height, speedX, speedY); + this.regions.push(this.currentRegion); + return this.currentRegion; + }; + ScrollZone.prototype.setSpeed = function (x, y) { + if(this.currentRegion) { + this.currentRegion.scrollSpeed.setTo(x, y); + } + return this; + }; + ScrollZone.prototype.update = function () { + for(var i = 0; i < this.regions.length; i++) { + this.regions[i].update(this._game.time.delta); + } + }; + ScrollZone.prototype.inCamera = function (camera) { + if(this.scrollFactor.x !== 1.0 || this.scrollFactor.y !== 1.0) { + this._dx = this.bounds.x - (camera.x * this.scrollFactor.x); + this._dy = this.bounds.y - (camera.y * this.scrollFactor.x); + this._dw = this.bounds.width * this.scale.x; + this._dh = this.bounds.height * this.scale.y; + return (camera.right > this._dx) && (camera.x < this._dx + this._dw) && (camera.bottom > this._dy) && (camera.y < this._dy + this._dh); + } else { + return camera.intersects(this.bounds, this.bounds.length); + } + }; + ScrollZone.prototype.render = function (camera, cameraOffsetX, cameraOffsetY) { + // Render checks + if(this.visible == false || this.scale.x == 0 || this.scale.y == 0 || this.alpha < 0.1 || this.cameraBlacklist.indexOf(camera.ID) !== -1 || this.inCamera(camera.worldView) == false) { + return false; + } + // Alpha + if(this.alpha !== 1) { + var globalAlpha = this._game.stage.context.globalAlpha; + this._game.stage.context.globalAlpha = this.alpha; + } + this._dx = cameraOffsetX + (this.bounds.topLeft.x - camera.worldView.x); + this._dy = cameraOffsetY + (this.bounds.topLeft.y - camera.worldView.y); + this._dw = this.bounds.width * this.scale.x; + this._dh = this.bounds.height * this.scale.y; + // Apply camera difference + if(this.scrollFactor.x !== 1.0 || this.scrollFactor.y !== 1.0) { + this._dx -= (camera.worldView.x * this.scrollFactor.x); + this._dy -= (camera.worldView.y * this.scrollFactor.y); + } + // Rotation - needs to work from origin point really, but for now from center + if(this.angle !== 0 || this.flipped == true) { + this._game.stage.context.save(); + this._game.stage.context.translate(this._dx + (this._dw / 2), this._dy + (this._dh / 2)); + if(this.angle !== 0) { + this._game.stage.context.rotate(this.angle * (Math.PI / 180)); + } + this._dx = -(this._dw / 2); + this._dy = -(this._dh / 2); + if(this.flipped == true) { + this._game.stage.context.scale(-1, 1); + } + } + this._dx = Math.round(this._dx); + this._dy = Math.round(this._dy); + this._dw = Math.round(this._dw); + this._dh = Math.round(this._dh); + for(var i = 0; i < this.regions.length; i++) { + if(this._dynamicTexture) { + this.regions[i].render(this._game.stage.context, this._dynamicTexture.canvas, this._dx, this._dy, this._dw, this._dh); + } else { + this.regions[i].render(this._game.stage.context, this._texture, this._dx, this._dy, this._dw, this._dh); + } + } + if(globalAlpha > -1) { + this._game.stage.context.globalAlpha = globalAlpha; + } + return true; + }; + ScrollZone.prototype.createRepeatingTexture = function (regionWidth, regionHeight) { + // Work out how many we'll need of the source image to make it tile properly + var tileWidth = Math.ceil(this._texture.width / regionWidth) * regionWidth; + var tileHeight = Math.ceil(this._texture.height / regionHeight) * regionHeight; + this._dynamicTexture = new Phaser.DynamicTexture(this._game, tileWidth, tileHeight); + this._dynamicTexture.context.rect(0, 0, tileWidth, tileHeight); + this._dynamicTexture.context.fillStyle = this._dynamicTexture.context.createPattern(this._texture, "repeat"); + this._dynamicTexture.context.fill(); + }; + return ScrollZone; + })(Phaser.GameObject); + Phaser.ScrollZone = ScrollZone; +})(Phaser || (Phaser = {})); /// /// /// /// /// /// +/// /// /// /// @@ -12104,253 +12180,143 @@ var Phaser; })(); Phaser.Game = Game; })(Phaser || (Phaser = {})); -/// -/// +/// /** -* Phaser - ScrollRegion +* Phaser - FXManager * -* Creates a scrolling region within a ScrollZone. -* It is scrolled via the scrollSpeed.x/y properties. +* The FXManager controls all special effects applied to game objects such as Cameras. */ var Phaser; (function (Phaser) { - var ScrollRegion = (function () { - function ScrollRegion(x, y, width, height, speedX, speedY) { - this._anchorWidth = 0; - this._anchorHeight = 0; - this._inverseWidth = 0; - this._inverseHeight = 0; + var FXManager = (function () { + function FXManager(game, parent) { + this._game = game; + this._parent = parent; + this._fx = []; + this.active = true; this.visible = true; - // Our seamless scrolling quads - this._A = new Phaser.Quad(x, y, width, height); - this._B = new Phaser.Quad(x, y, width, height); - this._C = new Phaser.Quad(x, y, width, height); - this._D = new Phaser.Quad(x, y, width, height); - this._scroll = new Phaser.MicroPoint(); - this._bounds = new Phaser.Quad(x, y, width, height); - this.scrollSpeed = new Phaser.MicroPoint(speedX, speedY); } - ScrollRegion.prototype.update = function (delta) { - this._scroll.x += this.scrollSpeed.x; - this._scroll.y += this.scrollSpeed.y; - if(this._scroll.x > this._bounds.right) { - this._scroll.x = this._bounds.x; - } - if(this._scroll.x < this._bounds.x) { - this._scroll.x = this._bounds.right; - } - if(this._scroll.y > this._bounds.bottom) { - this._scroll.y = this._bounds.y; - } - if(this._scroll.y < this._bounds.y) { - this._scroll.y = this._bounds.bottom; - } - // Anchor Dimensions - this._anchorWidth = (this._bounds.width - this._scroll.x) + this._bounds.x; - this._anchorHeight = (this._bounds.height - this._scroll.y) + this._bounds.y; - if(this._anchorWidth > this._bounds.width) { - this._anchorWidth = this._bounds.width; - } - if(this._anchorHeight > this._bounds.height) { - this._anchorHeight = this._bounds.height; - } - this._inverseWidth = this._bounds.width - this._anchorWidth; - this._inverseHeight = this._bounds.height - this._anchorHeight; - // Quad A - this._A.setTo(this._scroll.x, this._scroll.y, this._anchorWidth, this._anchorHeight); - // Quad B - this._B.y = this._scroll.y; - this._B.width = this._inverseWidth; - this._B.height = this._anchorHeight; - // Quad C - this._C.x = this._scroll.x; - this._C.width = this._anchorWidth; - this._C.height = this._inverseHeight; - // Quad D - this._D.width = this._inverseWidth; - this._D.height = this._inverseHeight; - }; - ScrollRegion.prototype.render = function (context, texture, dx, dy, dw, dh) { - if(this.visible == false) { - return; - } - // dx/dy are the world coordinates to render the FULL ScrollZone into. - // This ScrollRegion may be smaller than that and offset from the dx/dy coordinates. - this.crop(context, texture, this._A.x, this._A.y, this._A.width, this._A.height, dx, dy, dw, dh, 0, 0); - this.crop(context, texture, this._B.x, this._B.y, this._B.width, this._B.height, dx, dy, dw, dh, this._A.width, 0); - this.crop(context, texture, this._C.x, this._C.y, this._C.width, this._C.height, dx, dy, dw, dh, 0, this._A.height); - this.crop(context, texture, this._D.x, this._D.y, this._D.width, this._D.height, dx, dy, dw, dh, this._C.width, this._A.height); - //context.fillStyle = 'rgb(255,255,255)'; - //context.font = '18px Arial'; - //context.fillText('QuadA: ' + this._A.toString(), 32, 450); - //context.fillText('QuadB: ' + this._B.toString(), 32, 480); - //context.fillText('QuadC: ' + this._C.toString(), 32, 510); - //context.fillText('QuadD: ' + this._D.toString(), 32, 540); - }; - ScrollRegion.prototype.crop = function (context, texture, srcX, srcY, srcW, srcH, destX, destY, destW, destH, offsetX, offsetY) { - offsetX += destX; - offsetY += destY; - if(srcW > (destX + destW) - offsetX) { - srcW = (destX + destW) - offsetX; - } - if(srcH > (destY + destH) - offsetY) { - srcH = (destY + destH) - offsetY; - } - srcX = Math.floor(srcX); - srcY = Math.floor(srcY); - srcW = Math.floor(srcW); - srcH = Math.floor(srcH); - offsetX = Math.floor(offsetX + this._bounds.x); - offsetY = Math.floor(offsetY + this._bounds.y); - if(srcW > 0 && srcH > 0) { - context.drawImage(texture, srcX, srcY, srcW, srcH, offsetX, offsetY, srcW, srcH); - } - }; - return ScrollRegion; - })(); - Phaser.ScrollRegion = ScrollRegion; -})(Phaser || (Phaser = {})); -/// -/// -/// -/** -* Phaser - ScrollZone -* -* Creates a scrolling region of the given width and height from an image in the cache. -* The ScrollZone can be positioned anywhere in-world like a normal game object, re-act to physics, collision, etc. -* The image within it is scrolled via ScrollRegions and their scrollSpeed.x/y properties. -* If you create a scroll zone larger than the given source image it will create a DynamicTexture and fill it with a pattern of the source image. -*/ -var Phaser; -(function (Phaser) { - var ScrollZone = (function (_super) { - __extends(ScrollZone, _super); - function ScrollZone(game, key, x, y, width, height) { - if (typeof x === "undefined") { x = 0; } - if (typeof y === "undefined") { y = 0; } - if (typeof width === "undefined") { width = 0; } - if (typeof height === "undefined") { height = 0; } - _super.call(this, game, x, y, width, height); - this._dynamicTexture = null; - // local rendering related temp vars to help avoid gc spikes - this._dx = 0; - this._dy = 0; - this._dw = 0; - this._dh = 0; - this.flipped = false; - this.regions = []; - if(this._game.cache.getImage(key)) { - this._texture = this._game.cache.getImage(key); - this.width = this._texture.width; - this.height = this._texture.height; - if(width > this._texture.width || height > this._texture.height) { - // Create our repeating texture (as the source image wasn't large enough for the requested size) - this.createRepeatingTexture(width, height); - this.width = width; - this.height = height; - } - // Create a default ScrollRegion at the requested size - this.addRegion(0, 0, this.width, this.height); - // If the zone is smaller than the image itself then shrink the bounds - if((width < this._texture.width || height < this._texture.height) && width !== 0 && height !== 0) { - this.width = width; - this.height = height; - } - } - } - ScrollZone.prototype.addRegion = function (x, y, width, height, speedX, speedY) { - if (typeof speedX === "undefined") { speedX = 0; } - if (typeof speedY === "undefined") { speedY = 0; } - if(x > this.width || y > this.height || x < 0 || y < 0 || (x + width) > this.width || (y + height) > this.height) { - throw Error('Invalid ScrollRegion defined. Cannot be larger than parent ScrollZone'); - return; - } - this.currentRegion = new Phaser.ScrollRegion(x, y, width, height, speedX, speedY); - this.regions.push(this.currentRegion); - return this.currentRegion; - }; - ScrollZone.prototype.setSpeed = function (x, y) { - if(this.currentRegion) { - this.currentRegion.scrollSpeed.setTo(x, y); - } - return this; - }; - ScrollZone.prototype.update = function () { - for(var i = 0; i < this.regions.length; i++) { - this.regions[i].update(this._game.time.delta); - } - }; - ScrollZone.prototype.inCamera = function (camera) { - if(this.scrollFactor.x !== 1.0 || this.scrollFactor.y !== 1.0) { - this._dx = this.bounds.x - (camera.x * this.scrollFactor.x); - this._dy = this.bounds.y - (camera.y * this.scrollFactor.x); - this._dw = this.bounds.width * this.scale.x; - this._dh = this.bounds.height * this.scale.y; - return (camera.right > this._dx) && (camera.x < this._dx + this._dw) && (camera.bottom > this._dy) && (camera.y < this._dy + this._dh); + FXManager.prototype.add = /** + * Adds a new FX to the FXManager. + * The effect must be an object with at least one of the following methods: preUpdate, postUpdate, preRender, render or postRender. + * A new instance of the effect will be created and a reference to Game will be passed to the object constructor. + */ + function (effect) { + var result = false; + var newEffect = { + effect: { + }, + preUpdate: false, + postUpdate: false, + preRender: false, + render: false, + postRender: false + }; + if(typeof effect === 'function') { + newEffect.effect = new effect(this._game, this._parent); } else { - return camera.intersects(this.bounds, this.bounds.length); + throw new Error("Invalid object given to Phaser.FXManager.add"); + } + // Check for methods now to avoid having to do this every loop + if(typeof newEffect.effect['preUpdate'] === 'function') { + newEffect.preUpdate = true; + result = true; + } + if(typeof newEffect.effect['postUpdate'] === 'function') { + newEffect.postUpdate = true; + result = true; + } + if(typeof newEffect.effect['preRender'] === 'function') { + newEffect.preRender = true; + result = true; + } + if(typeof newEffect.effect['render'] === 'function') { + newEffect.render = true; + result = true; + } + if(typeof newEffect.effect['postRender'] === 'function') { + newEffect.postRender = true; + result = true; + } + if(result == true) { + this._length = this._fx.push(newEffect); + return newEffect.effect; + } else { + return result; } }; - ScrollZone.prototype.render = function (camera, cameraOffsetX, cameraOffsetY) { - // Render checks - if(this.visible == false || this.scale.x == 0 || this.scale.y == 0 || this.alpha < 0.1 || this.cameraBlacklist.indexOf(camera.ID) !== -1 || this.inCamera(camera.worldView) == false) { - return false; - } - // Alpha - if(this.alpha !== 1) { - var globalAlpha = this._game.stage.context.globalAlpha; - this._game.stage.context.globalAlpha = this.alpha; - } - this._dx = cameraOffsetX + (this.bounds.topLeft.x - camera.worldView.x); - this._dy = cameraOffsetY + (this.bounds.topLeft.y - camera.worldView.y); - this._dw = this.bounds.width * this.scale.x; - this._dh = this.bounds.height * this.scale.y; - // Apply camera difference - if(this.scrollFactor.x !== 1.0 || this.scrollFactor.y !== 1.0) { - this._dx -= (camera.worldView.x * this.scrollFactor.x); - this._dy -= (camera.worldView.y * this.scrollFactor.y); - } - // Rotation - needs to work from origin point really, but for now from center - if(this.angle !== 0 || this.flipped == true) { - this._game.stage.context.save(); - this._game.stage.context.translate(this._dx + (this._dw / 2), this._dy + (this._dh / 2)); - if(this.angle !== 0) { - this._game.stage.context.rotate(this.angle * (Math.PI / 180)); - } - this._dx = -(this._dw / 2); - this._dy = -(this._dh / 2); - if(this.flipped == true) { - this._game.stage.context.scale(-1, 1); + FXManager.prototype.preUpdate = /** + * Pre-update is called at the start of the objects update cycle, before any other updates have taken place. + */ + function () { + if(this.active) { + for(var i = 0; i < this._length; i++) { + if(this._fx[i].preUpdate) { + this._fx[i].effect.preUpdate(); + } } } - this._dx = Math.round(this._dx); - this._dy = Math.round(this._dy); - this._dw = Math.round(this._dw); - this._dh = Math.round(this._dh); - for(var i = 0; i < this.regions.length; i++) { - if(this._dynamicTexture) { - this.regions[i].render(this._game.stage.context, this._dynamicTexture.canvas, this._dx, this._dy, this._dw, this._dh); - } else { - this.regions[i].render(this._game.stage.context, this._texture, this._dx, this._dy, this._dw, this._dh); - } - } - if(globalAlpha > -1) { - this._game.stage.context.globalAlpha = globalAlpha; - } - return true; }; - ScrollZone.prototype.createRepeatingTexture = function (regionWidth, regionHeight) { - // Work out how many we'll need of the source image to make it tile properly - var tileWidth = Math.ceil(this._texture.width / regionWidth) * regionWidth; - var tileHeight = Math.ceil(this._texture.height / regionHeight) * regionHeight; - this._dynamicTexture = new Phaser.DynamicTexture(this._game, tileWidth, tileHeight); - this._dynamicTexture.context.rect(0, 0, tileWidth, tileHeight); - this._dynamicTexture.context.fillStyle = this._dynamicTexture.context.createPattern(this._texture, "repeat"); - this._dynamicTexture.context.fill(); + FXManager.prototype.postUpdate = /** + * Post-update is called at the end of the objects update cycle, after other update logic has taken place. + */ + function () { + if(this.active) { + for(var i = 0; i < this._length; i++) { + if(this._fx[i].postUpdate) { + this._fx[i].effect.postUpdate(); + } + } + } }; - return ScrollZone; - })(Phaser.GameObject); - Phaser.ScrollZone = ScrollZone; + FXManager.prototype.preRender = /** + * Pre-render is called at the start of the object render cycle, before any transforms have taken place. + * It happens directly AFTER a canvas context.save has happened if added to a Camera. + */ + function (camera, cameraX, cameraY, cameraWidth, cameraHeight) { + if(this.visible) { + for(var i = 0; i < this._length; i++) { + if(this._fx[i].preRender) { + this._fx[i].effect.preRender(camera, cameraX, cameraY, cameraWidth, cameraHeight); + } + } + } + }; + FXManager.prototype.render = /** + * render is called during the objects render cycle, right after all transforms have finished, but before any children/image data is rendered. + */ + function (camera, cameraX, cameraY, cameraWidth, cameraHeight) { + if(this.visible) { + for(var i = 0; i < this._length; i++) { + if(this._fx[i].preRender) { + this._fx[i].effect.preRender(camera, cameraX, cameraY, cameraWidth, cameraHeight); + } + } + } + }; + FXManager.prototype.postRender = /** + * Post-render is called during the objects render cycle, after the children/image data has been rendered. + * It happens directly BEFORE a canvas context.restore has happened if added to a Camera. + */ + function (camera, cameraX, cameraY, cameraWidth, cameraHeight) { + if(this.visible) { + for(var i = 0; i < this._length; i++) { + if(this._fx[i].postRender) { + this._fx[i].effect.postRender(camera, cameraX, cameraY, cameraWidth, cameraHeight); + } + } + } + }; + FXManager.prototype.destroy = /** + * Clear down this FXManager and null out references + */ + function () { + this._game = null; + this._fx = null; + }; + return FXManager; + })(); + Phaser.FXManager = FXManager; })(Phaser || (Phaser = {})); /// /**