當前位置: 首頁>>代碼示例>>TypeScript>>正文


TypeScript isString.default函數代碼示例

本文整理匯總了TypeScript中lodash-es/isString.default函數的典型用法代碼示例。如果您正苦於以下問題:TypeScript default函數的具體用法?TypeScript default怎麽用?TypeScript default使用的例子?那麽, 這裏精選的函數代碼示例或許可以為您提供幫助。


在下文中一共展示了default函數的4個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的TypeScript代碼示例。

示例1: detachComponent

    /**
     * Detaches a component from this container and returns it.
     *
     * Once component is detached, a `detachComponent` event is fired with following arguments.
     * 1. The newly created component
     * 2. This container
     * 3. Additional params passed in to this call
     *
     * @param pos The position from which component should be detached
     * @param params additional params to be passed down the the `detachComponent` event
     */
    public detachComponent(pos: number, params: any = {}): Component {
        if (isString(pos)) {
            const id = pos;
            let i;
            for (i = 0; i < this.components.length; i++) {
                if (this.components[i].getId() === id) {
                    pos = i;
                    break;
                }
            }
            if (i === this.components.length) {
                return;
            }
        }
        const component = this.components[pos];
        this.components.splice(pos, 1);

        params = defaults({pos}, params);
        this.emit("detachComponent", component, this, params);
        return component;
    }
開發者ID:azeem,項目名稱:webvs,代碼行數:32,代碼來源:Container.ts

示例2: drop

 const args = drop(entry).map(arg => {
     if (isString(arg)) {
         if (arg.substring(0, 5) === "__REG") {
             return this.registerBank[arg];
         } else {
             return this[arg];
         }
     } else {
         return arg;
     }
 });
開發者ID:idleberg,項目名稱:webvs,代碼行數:11,代碼來源:CodeInstance.ts

示例3: findIndex

 private findIndex(arg: string | number): number {
     let index;
     if (isString(arg) && arg in this.names) {
         index = this.names[arg].index;
     } else if (isNumber(arg) && arg >= 0 && arg < this.textures.length) {
         index = arg;
     } else {
         // tslint:disable-next-line:no-console
         console.log("arg = ", typeof(arg), "textures = ", this.textures);
         throw new Error("Unknown texture '" + arg + "'");
     }
     return index;
 }
開發者ID:azeem,項目名稱:webvs,代碼行數:13,代碼來源:TextureSetManager.ts

示例4: removeTexture

 /**
  * Removes a texture
  * @param nameOrIndex name or index of the texture to be removed
  */
 public removeTexture(nameOrIndex: string | number) {
     if (isString(nameOrIndex) && nameOrIndex in this.names) {
         if (this.names[nameOrIndex].refCount > 1) {
             this.names[nameOrIndex].refCount--;
             return;
         }
     }
     const index = this.findIndex(nameOrIndex);
     if (index === this.curTex && (this.oldTexture || this.oldFrameBuffer)) {
         throw new Error("Cannot remove current texture when set as render target");
     }
     const gl = this.rctx.getGl();
     gl.deleteTexture(this.textures[index]);
     this.textures.splice(index, 1);
     if (this.curTex >= this.textures.length) {
         this.curTex = this.textures.length - 1;
     }
     if (typeof nameOrIndex === "string") {
         delete this.names[nameOrIndex];
     }
 }
開發者ID:azeem,項目名稱:webvs,代碼行數:25,代碼來源:TextureSetManager.ts


注:本文中的lodash-es/isString.default函數示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。