diff --git a/assets/Script/Sdk.meta b/assets/Script/Sdk.meta new file mode 100644 index 0000000..4f30dc1 --- /dev/null +++ b/assets/Script/Sdk.meta @@ -0,0 +1,13 @@ +{ + "ver": "1.1.3", + "uuid": "ec0a44ff-c813-4573-8b85-268526211437", + "importer": "folder", + "isBundle": false, + "bundleName": "", + "priority": 1, + "compressionType": {}, + "optimizeHotUpdate": {}, + "inlineSpriteFrames": {}, + "isRemoteBundle": {}, + "subMetas": {} +} \ No newline at end of file diff --git a/assets/Script/Sdk/DouyinEntranceView.ts b/assets/Script/Sdk/DouyinEntranceView.ts new file mode 100644 index 0000000..0a5a334 --- /dev/null +++ b/assets/Script/Sdk/DouyinEntranceView.ts @@ -0,0 +1,29 @@ +import { MiniGameSdk } from "./MiniGameSdk"; +const { ccclass, property } = cc._decorator; + + +@ccclass +export class DouyinEntranceView extends cc.Component { + start() { + + } + + update(deltaTime: number) { + + } + + onCloseClick() { + this.node.active = false; + } + + onNavigateToDouyinClick() { + + MiniGameSdk.BytedanceSidebar.navigateToSidebar((success: boolean) => { // 跳转到抖音侧边栏 + if (success) { + console.log('跳转成功'); + } else { + console.log('跳转失败'); + } + }); + } +} diff --git a/assets/Script/Sdk/DouyinEntranceView.ts.meta b/assets/Script/Sdk/DouyinEntranceView.ts.meta new file mode 100644 index 0000000..43bb3f1 --- /dev/null +++ b/assets/Script/Sdk/DouyinEntranceView.ts.meta @@ -0,0 +1,10 @@ +{ + "ver": "1.1.0", + "uuid": "8a024faa-e4af-4cae-9c5c-693bee7120c1", + "importer": "typescript", + "isPlugin": false, + "loadPluginInWeb": true, + "loadPluginInNative": true, + "loadPluginInEditor": false, + "subMetas": {} +} \ No newline at end of file diff --git a/assets/Script/Sdk/MiniGameManager.ts b/assets/Script/Sdk/MiniGameManager.ts new file mode 100644 index 0000000..cf30206 --- /dev/null +++ b/assets/Script/Sdk/MiniGameManager.ts @@ -0,0 +1,340 @@ + +import { MiniGameSdk } from "./MiniGameSdk"; +const { ccclass, property } = cc._decorator; +enum EWechatAD { + CUMSTOM_01 = 'adunit-f7c2417eb2c2e473' +} + +@ccclass +export class MiniGameManager extends cc.Component { + + @property(cc.Node) + entranceView: cc.Node = null; + /** + * 开始游戏前的初始化操作。 + * 主要负责检查并处理游戏入口按钮的激活状态,以及在特定环境下设置侧边栏的监听器。 + * + * @remarks + * 此方法首先将游戏入口视图设为非激活状态,以准备进行后续的检查和设置。 + * 如果当前环境是抖音小游戏,会检查是否存在侧边栏,并根据检查结果激活或禁用游戏入口按钮。 + * 对于非抖音小游戏环境,直接激活游戏入口按钮。 + * 此外,无论环境如何,都会设置一个监听器,以处理来自侧边栏的事件,如成功触发时显示奖励提示。 + */ + private _id:any; + private _userData:any; + + private static _instance: MiniGameManager; + static get instance(): MiniGameManager { + if (!MiniGameManager._instance) { + MiniGameManager._instance = new MiniGameManager(); + } + return MiniGameManager._instance; + } + + start() { + // 禁用游戏入口视图 + // this.entranceView.active = false; + // MiniGameSdk.API.getUserProfile(this.setUserId); + // cc.fx.GameTool.setUserInfo(""); + this.onGetLoginCode(); + // 尝试获取游戏入口按钮,如果存在则直接返回,不进行后续操作 + // let buttonEntrance = this.node.getChildByName('Btns')?.getChildByName('Button_EntranceView'); + // if (buttonEntrance) { + // return; + // } + + // 如果是字节跳动小游戏环境,检查侧边栏是否存在 + + if (MiniGameSdk.isBytedance()) { + //抖音环境,检测侧边栏存在 + MiniGameSdk.BytedanceSidebar.checkSideBar((success: boolean) => { + // 根据侧边栏存在性激活或禁用游戏入口按钮 + // buttonEntrance.active = success; + }); + } else { + // 非抖音小游戏环境,直接激活游戏入口按钮 + // 非抖音环境,正常显示按钮 + // buttonEntrance.active = true; + } + + // 设置监听器,以处理来自侧边栏的交互事件 + MiniGameSdk.BytedanceSidebar.listenFromSidebar((success: boolean) => { + // 如果交互成功,显示奖励提示 + if (success) { + MiniGameSdk.API.showToast('侧边栏奖励', 5); + } + }); + } + + update(deltaTime: number) { + + } + + /** + * 弹出广告横幅。 + * 此方法用于加载并显示广告横幅。它首先加载指定广告位的横幅广告,然后显示广告。 + * 加载广告和显示广告是通过MiniGameSdk.AdvertManager的实例方法来实现的。 + * + * @remarks + * 此方法提供了两种显示横幅广告的方式: + * 1. 默认方式:调用showBanner方法显示广告,系统会自动选择显示位置。 + * 2. 指定位置方式:可以通过传入额外的参数来指定广告显示在屏幕的顶部或底部,或者通过坐标指定显示位置。 + * + * 示例代码中注释掉了两种显示广告的具体方法,可以根据实际需求选择使用。 + */ + onShowBanner() { + // 加载指定广告位的横幅广告。 + MiniGameSdk.AdvertManager.instance.loadBanner('adunit-4e7ef467e3eaab51'); + + // 默认方式显示横幅广告。 + // 方法1:默认调用 + MiniGameSdk.AdvertManager.instance.showBanner(); + + // 示例:指定屏幕底部正中显示横幅广告。 + // 方法2:指定屏幕顶部或底部正中 + // MiniGameSdk.AdvertManager.instance.showBanner('adunit-4e7ef467e3eaab51', MiniGameSdk.EAdBannerLocation.BOTTOM); + + // 示例:通过坐标指定位置显示横幅广告。 + // 方法2:指定坐标 + // MiniGameSdk.AdvertManager.instance.showBanner('adunit-4e7ef467e3eaab51', { top: 10, left: 10 }); + } + + /** + * 隐藏广告横幅的函数。 + * + * 该函数调用MiniGameSdk.AdvertManager实例的方法,用于隐藏广告横幅。 + * 当需要暂时停止展示广告或用户主动请求隐藏广告时,可以调用此函数。 + * + * @remarks + * 此函数不接受任何参数,也不返回任何值。 + * 它单纯地触发广告横幅的隐藏操作,具体实现依赖于AdvertManager的实现。 + */ + onHideBanner() { + MiniGameSdk.AdvertManager.instance.hideBanner(); + } + + /** + * 显示插屏广告的函数。 + * + * 此函数调用MiniGameSdk.AdvertManager实例的方法,以显示一个指定的插屏广告。 + * 它使用了硬编码的广告单元标识符,这意味着它专为特定的广告位设计。 + * 在实际应用中,可能需要根据应用的配置或用户的特定条件来动态选择广告单元标识符。 + */ + onShowInterstitial() { + MiniGameSdk.AdvertManager.instance.showInterstitial('adunit-eadd67851d3050ad'); + } + + /** + * 调用广告管理器加载并展示自定义广告。 + * 此方法首先通过广告管理器的实例加载指定的自定义广告单元,然后展示这个自定义广告。 + * 加载和展示广告是广告管理系统中的常见操作,这里通过两步分别完成加载和展示的过程, + * 以确保广告在展示前正确且充分地被加载。 + */ + onShowCustom() { + // 加载指定的自定义广告单元。 + MiniGameSdk.AdvertManager.instance.loadCustom(EWechatAD.CUMSTOM_01); + // 展示已加载的自定义广告。 + MiniGameSdk.AdvertManager.instance.showCustom(EWechatAD.CUMSTOM_01); + } + + /** + * 隐藏自定义广告。 + * + * 本函数调用MiniGameSdk.AdvertManager.instance.hideCustom()来隐藏自定义广告。 + * 这是对接广告管理系统的一部分,用于控制广告的显示与隐藏。 + * 在需要隐藏自定义广告的场景下,调用此函数即可实现相应功能。 + */ + onHideCustom() { + MiniGameSdk.AdvertManager.instance.hideCustom(EWechatAD.CUMSTOM_01); + } + + /** + * 触发显示视频广告的函数。 + * 通过调用MiniGameSdk.AdvertManager.instance.showVideo方法,显示一个视频广告,并根据用户观看广告的情况执行相应的逻辑。 + * + * @remarks + * 此函数首先传入一个广告单元ID,用于标识要显示的视频广告。然后传入一个回调函数,该回调函数在用户观看广告后被调用,无论用户是完成了观看、拒绝了观看还是观看过程中发生了错误。 + * 回调函数接收两个参数:一个是用户观看广告的结果,另一个是用户观看的广告数量。根据观看结果的不同,显示不同的提示信息。 + */ + onShowVideo() { + // 广告单元ID,用于标识要显示的视频广告 + // 广告单元ID的样例 + //抖音形如: 1re3nfqkmy81m4m8ge + //微信形如: adunit-a7718f6e195e42fe + MiniGameSdk.AdvertManager.instance.showVideo('1re3nfqkmy81m4m8ge', (res: MiniGameSdk.EAdVideoResult, count: number) => { + // 输出用户观看的广告数量 + console.log('用户看的视频广告个数是:', count); + + // 根据用户观看广告的结果,执行不同的逻辑 + switch (res) { + case MiniGameSdk.EAdVideoResult.ACCEPT: + // 用户完成了广告观看,显示奖励提示 + MiniGameSdk.API.showToast('用户看完广告,可以奖励'); + break; + case MiniGameSdk.EAdVideoResult.REJECT: + // 用户拒绝了广告观看,显示不奖励提示 + MiniGameSdk.API.showToast('用户拒绝掉广告,不奖励'); + break; + case MiniGameSdk.EAdVideoResult.ERROR: + // 广告播放发生错误,显示错误提示 + MiniGameSdk.API.showToast('播放广告发生错误,不奖励'); + break; + default: + // 其他情况,不作处理 + break; + } + }); + } + + /** + * 引导用户分享应用给朋友。 + * + * 通过调用MiniGameSdk的API分享功能,向用户的朋友圈发送邀请,邀请他们一起玩游戏。 + * 这是一个重要的推广手段,可以增加应用的曝光度和用户量。 + * + * @remarks + * 此方法中调用的API依赖于特定的小游戏平台,因此在不同的平台上可能需要不同的实现。 + */ + onShare() { + MiniGameSdk.API.shareAppToFriends('来玩游戏吧'); + } + + /** + * 显示一个toast提示。 + * + * 通过调用MiniGameSdk的API方法来显示一个简短的提示信息。toast是一种轻量级的提示方式,用于在界面上短暂地展示一些信息,不影响用户操作。 + * 这里使用了固定的提示文本 '这是一个toast',在实际应用中,可以根据需要动态设置提示文本。 + */ + onShowToast() { + MiniGameSdk.API.showToast('这是一个toast'); + } + + /** + * 触发设备振动功能。 + * + * 该方法用于调用MiniGameSdk提供的API,以实现设备的振动功能。当需要提醒用户或提供触觉反馈时,可以调用此方法。 + * 例如,在游戏或应用中,当用户完成特定操作或发生特定事件时,可以通过振动给予用户反馈。 + * + * @remarks + * 此方法无参数,也不返回任何值。 + */ + onVirbrate() { + MiniGameSdk.API.vibrate(); + } + + /** + * 重新启动游戏实例。 + * + * 此函数调用MiniGameSdk中的API重新启动游戏。重新启动操作可能是为了初始化游戏环境、重置游戏状态或处理其他需要重启的场景。 + * 调用此函数后,游戏将会重新开始,当前的游戏状态将会被清除。 + * + * @remarks + * 此函数不接受任何参数。 + * + * @returns 无返回值。 + */ + onReboot() { + MiniGameSdk.API.reboot(); + } + + /** + * 当前函数用于在迷你游戏中实现退出功能。 + * 它调用了MiniGameSdk提供的API方法来触发退出操作。 + * 该方法通常在需要结束当前迷你游戏或返回到上一级菜单时被调用。 + */ + onExit() { + MiniGameSdk.API.exit(); + } + + /** + * 显示分享菜单。 + * + * 通过调用MiniGameSdk的API方法,触发显示分享菜单的操作。此函数旨在提供一个统一的入口, + * 以便在需要时轻松调用分享功能,而无需直接与具体的SDK接口交互。 + * + * @remarks + * 此方法不接受任何参数,也不返回任何值。 + */ + onShowShareMenu() { + MiniGameSdk.API.showShareMenu(); + } + + /** + * 导航到指定的小游戏。 + * + * 本函数用于触发导航到一个特定的小游戏。这需要提供目标小游戏的ID, + * 以便系统能够正确地将用户重定向到目标小游戏。 + * + * 注意:这里的'xxx'是占位符,实际使用时需要替换为具体的小游戏ID。 + */ + onNavigate() { + MiniGameSdk.API.navigateTo('xxx'); // xxx替换为你的小游戏id + } + + /** + * 激活字节跳动入口视图。 + * + * 此方法用于将字节跳动入口视图设置为活跃状态。当需要在用户界面中显示字节跳动的入口时, + * 可以调用此方法来激活相应的视图元素,使其对用户可见。 + */ + onBytedanceEntranceView() { + // this.entranceView.active = true; + } + + /** + * 请求登录代码 + * + * 本函数用于触发小程序的登录流程,获取微信或头条等第三方平台的登录代码。 + * 这些代码可以用于后续的用户身份验证和数据同步流程。 + */ + onGetLoginCode() { + // 调用MiniGameSdk的API登录方法,传入一个回调函数处理登录结果 + MiniGameSdk.API.login((code: string, anonymousCode: string) => { + // 打印微信或头条的登录代码 + console.log('Wechat Or Bytedance Code:', code); + // 打印头条的匿名登录代码 + // console.log('Bytedance Anonymous Code:', anonymousCode); + if(code){ + cc.fx.GameTool.getUserId(code, data => this.setUserId(data)); + } + }); + } + + setUserId(data){ + cc.fx.GameConfig.GM_INFO.userId = data.data.userId; + MiniGameSdk.API.getUserInfo(this.setUserInfo); + } + + setUserInfo(data){ + console.log("获取到的用户信息",data.userInfo); + var useData = { + "gameId": cc.fx.GameConfig.GM_INFO.gameId, + "userId": cc.fx.GameConfig.GM_INFO.userId, + "nickName":data.userInfo.nickName, + "pic": data.userInfo.avatarUrl + + } + console.log("即将上传的用户信息:",cc.fx.GameConfig.GM_INFO.userId,data.userInfo.nickName,data.userInfo.avatarUrl); + console.log("Post数据:",useData); + cc.fx.HttpUtil.setUserInfo(useData,(res)=>{ + console.log("上传成功:",res); + }); + } + + /** + * 创建并显示游戏圈按钮 + * + * 本函数通过调用MiniGameSdk的GameClub实例方法,实现游戏俱乐部的创建和显示。 + * 它首先配置俱乐部的图标类型和位置大小,然后创建俱乐部,最后显示俱乐部。 + * 这样做是为了在小游戏内创建并展示一个游戏俱乐部的图标,供玩家加入或互动。 + */ + onCreateClub() { + // 配置俱乐部图标为绿色,设置图标的位置为顶部200像素,左侧0像素 + MiniGameSdk.GameClub.instance.create( + MiniGameSdk.EGameClubIcon.GREEN, + { top: 200, left: 0 }, + { width: 50, height: 50 }); + // 显示游戏俱乐部图标 + MiniGameSdk.GameClub.instance.show(); + } +} diff --git a/assets/Script/Sdk/MiniGameManager.ts.meta b/assets/Script/Sdk/MiniGameManager.ts.meta new file mode 100644 index 0000000..84df67f --- /dev/null +++ b/assets/Script/Sdk/MiniGameManager.ts.meta @@ -0,0 +1,10 @@ +{ + "ver": "1.1.0", + "uuid": "0d272a57-5428-450e-a8b9-1574c3d89951", + "importer": "typescript", + "isPlugin": false, + "loadPluginInWeb": true, + "loadPluginInNative": true, + "loadPluginInEditor": false, + "subMetas": {} +} \ No newline at end of file diff --git a/assets/Script/Sdk/MiniGameSdk.ts b/assets/Script/Sdk/MiniGameSdk.ts new file mode 100644 index 0000000..911c9ea --- /dev/null +++ b/assets/Script/Sdk/MiniGameSdk.ts @@ -0,0 +1,1130 @@ +/** + * 小游戏平台SDK工具封装,目前只支持微信和抖音平台 + */ +export namespace MiniGameSdk { + + interface ISize { + width: number; + height: number; + } + + export interface IPosition { + top: number; + left: number; + } + + export function isWechat(): boolean { + //@ts-ignore + return window.wx !== null && window.wx !== undefined; + } + + export function isBytedance(): boolean { + //@ts-ignore + return window.tt !== null && window.tt !== undefined; + } + + + function getSysWinSize(): ISize { + let sys: any; + if (isWechat()) { + // @ts-ignore + sys = wx.getSystemInfoSync(); + } else if (isBytedance()) { + // @ts-ignore + sys = tt.getSystemInfoSync(); + } + + let size: ISize = { width: 0, height: 0 }; + if (sys) { + size.width = sys.windowWidth; + size.height = sys.windowHeight; + } + + return size; + } + + /** + * 插屏广告。微信抖音都支持! + */ + class ADInterstitial { + private _adUid: string; + private _interstitial: any; + + get aduid() { + return this._adUid; + } + + constructor(adUid: string) { + this._adUid = adUid; + } + + show() { + // @ts-ignore + if (isWechat() && !wx.createInterstitialAd) { + console.warn('wechat unsupport interstitial AD!'); + this._interstitial = null; + return; + } + + // @ts-ignore + if (isBytedance() && !tt.createInterstitialAd) { + console.warn('bytedance unsupport interstitial AD!'); + this._interstitial = null; + return; + } + + + if (this._interstitial) { + this._interstitial.load(); + } else { + if (isWechat()) { + // @ts-ignore + this._interstitial = wx.createInterstitialAd({ adUnitId: this._adUid }); + } else if (isBytedance()) { + // @ts-ignore + this._interstitial = tt.createInterstitialAd({ adUnitId: this._adUid }); + } else { + this._interstitial = null; + } + + this._interstitial?.onLoad(() => { + console.log('load interstitial ad success'); + this._interstitial.show().catch((err: any) => { + console.log('catch interstitial ad error:', err); + }); + }); + + this._interstitial?.onError((err: any) => { + console.log('interstitial ad on error:', err); + }); + } + } + destory() { + this._interstitial?.destroy(); + } + } + + class ADBanner { + private _adUid: string; + private _banner: any; + + get aduid() { + return this._adUid; + } + + /** + * 抖音和微信都支持 + * 横幅广告。预估宽度默认为300,预估高度为140。如果你不确定就按默认值来。 + * @param adUid 广告UID,后端配置 + * @param isTop 是否在屏幕顶部展示。内部会自动居中计算位置。 + * @param bannerWidth 横幅广告的预估宽度。默认300 + * @param autoShow 广告加载完成后是否立刻显示,默认为不显示 + */ + constructor(adUid: string, param: boolean | IPosition, bannerWidth: number = 300, autoShow: boolean = false) { + this._adUid = adUid; + this.create(autoShow, bannerWidth, param); // 默认300比较合适 + } + + private create(autoShow: boolean, bannerWidth: number, param: boolean | IPosition) { + if (!isWechat() && !isBytedance()) { + this._banner = null; + return; + } + + this.destroy(); + + let winSize = getSysWinSize(); + + let height = bannerWidth * 0.4; + let top = 0, left = 0; + + if (typeof param === "boolean") { + left = (winSize.width - bannerWidth) / 2 + top = param ? 5 : (winSize.height - height); + } else { + left = param.left; + top = param.top; + } + + let params = { + adUnitId: this._adUid, + adIntervals: 30,// 自动刷新频率不能小于30秒 + style: { left: left, top: top, width: bannerWidth } + } + + if (isWechat()) { + // @ts-ignore + this._banner = wx.createBannerAd(params); + } else if (isBytedance()) { + // @ts-ignore + this._banner = tt.createBannerAd(params); + } else { + this._banner = null; + } + + this._banner?.onError((err: any) => { + console.log('ad banner error:', err); + }); + + this._banner?.onLoad(() => { + autoShow && this._banner.show(); + }); + } + + show() { + this._banner?.show(); + } + + hide() { + this._banner?.hide(); + } + + destroy() { + this._banner?.destroy(); + } + } + + class ADCustom { + private _adUid: string; + private _adCustom: any; + + get aduid() { + return this._adUid; + } + /** + * 由于原生模板广告在微信服务后端可以定制宽度大小,个数,缩放比例等,所以位置调整要根据设置的宽度来定。抖音不支持! + * @param adUid 广告UID,后端配置 + * @param top 从左上角开始,距离屏幕顶部的距离。注意:这个数据为设备屏幕宽度width。如果需要获取屏幕的像素,需要乘以设备像素比Pixel-Ratio,例如iPhone 13 Pro的Pixel-Ratio为3,像素为Width*3。 + * @param left 从左上角开始,距离屏幕最左边的距离。注意:这个数据为设备屏幕宽度width。如果需要获取屏幕的像素,需要乘以设备像素比Pixel-Ratio,例如iPhone 13 Pro的Pixel-Ratio为3,像素为Width*3。 + * @param scale 原生模板广告的尺寸,默认为1,即100%。此值在微信服务后端广告中获得,默认为100%,目前有100%,90%,80%三种,一般情况不用修改。若有修改,记得传入值,例如90%就传入0.9。 + */ + constructor(adUid: string, top: number = 0, left: number = 0, scale: number = 1.0) { + this._adUid = adUid; + this.createCustomAd(top, left, scale); + } + + private createCustomAd(top: number, left: number, scale: number) { + if (!isWechat()) { // only wechat support custom ad + this._adCustom = null; + console.log('Only wechat support Custom Ad'); + return; + } + + this.destroy(); + // 原生模板5个应用宽度为375,若设置了缩放比例,则宽度也需要设置 + // let width = 375 * this._scale; + // let newLeft = (sys.windowWidth - width) / 2; + // let newTop = sys.windowHeight / 2; // 120是预估高度 + + // @ts-ignore + this._adCustom = wx.createCustomAd({ + adUnitId: this._adUid, + style: { left: left, top: top, fixed: true } + }); + + this._adCustom?.onError((err: any) => { + console.log('ad custom error:', err); + }); + } + show() { + this._adCustom?.show(); + } + + hide() { + this._adCustom?.hide(); + } + + destroy() { + this._adCustom?.destroy(); + } + } + + + /** + * 视频广告用户点击行为结果 + */ + export enum EAdVideoResult { + /** + * 用户看完了广告,游戏可发放奖励。 + */ + ACCEPT, + + /** + * 用户中途关闭了广告,即未看完状态。不可发放奖励。 + */ + REJECT, + + /** + * 广告组件内部发生了错误。不可发放奖励。 + */ + ERROR, + } + + class ADVideo { + private _adUid: string; + private _adVideo: any = null; + + get aduid() { + return this._adUid; + } + + constructor(adUid: string) { + this._adUid = adUid; + } + + /** + * 由于微信和抖音视频广告机制不同,微信可以看的视频广告个数只有0和1个,抖音平台则可以看0~maxVideoCount + * @param onResult 两个参数:第一个res是EAdVideoResult定义,第二count是用户看了多少个视频广告。 + * @param target onResult的拥有者 + * @param maxVideoCount 可以连续看最大视频个数,可最大化商业效率。默认为3个。 + * @returns + */ + show(onResult: (res: EAdVideoResult, count: number) => void, target?: any, maxVideoCount: number = 3): void { + let callback = (state: EAdVideoResult, count: number) => { + onResult?.call(target, state, count); + } + + if (!isWechat() && !isBytedance()) { + callback(EAdVideoResult.ACCEPT, 1); + this._adVideo = null; + return; + } + + let onAdVideoClosed = (res: any) => { + this._adVideo?.offClose(onAdVideoClosed); + if (isWechat()) { + if (res && res.isEnded || res === undefined) { + callback(EAdVideoResult.ACCEPT, 1); + } else { + callback(EAdVideoResult.REJECT, 0); + } + } else if (isBytedance()) { + let resConverted = res as { isEnded: boolean, count: number }; + if (resConverted && resConverted.count > 0) { + callback(EAdVideoResult.ACCEPT, resConverted.count); + } else { + callback(EAdVideoResult.REJECT, 0); + } + } + } + + this._adVideo?.offClose(onAdVideoClosed); + + if (isWechat()) { + // @ts-ignore + this._adVideo = wx.createRewardedVideoAd({ + adUnitId: this._adUid + }); + } else if (isBytedance()) { + // @ts-ignore + this._adVideo = tt.createRewardedVideoAd({ + adUnitId: this._adUid, + multiton: true, + multitonRewardMsg: ['多1次奖励', '再多一次奖励', '再多一次奖励'], + multitonRewardTimes: maxVideoCount, + }); + } else { + this._adVideo = null; + } + + + this._adVideo?.onLoad(() => { + console.log('Ad load success'); + }); + + this._adVideo?.onError((err: { errMsg: string, errCode: number }) => { + console.log('Ad video error:', err); + callback(EAdVideoResult.ERROR, 0); + }); + + this._adVideo?.onClose(onAdVideoClosed); + + this._adVideo?.show().catch(() => { + this._adVideo?.load().then(() => + this._adVideo?.show()).catch((err: { errMsg: string, errCode: number }) => { + console.log('Catch video ad error:', err); + callback(EAdVideoResult.ERROR, 0); + }); + }); + } + + destory() { + this._adVideo?.destory(); + } + } + + export enum EAdBannerLocation { + /** + * 屏幕顶部 + */ + TOP, + + /** + * 屏幕底部 + */ + BOTTOM, + } + + export class AdvertManager { + + private static _instance: AdvertManager; + + static get instance(): AdvertManager { + if (!AdvertManager._instance) { + AdvertManager._instance = new AdvertManager(); + } + return AdvertManager._instance; + } + + private _video: ADVideo; + private _interstitial: ADInterstitial; + private _banner: ADBanner; + private _customs: Record = {}; + + private constructor() { + + } + + /** + * 预加载横幅广告,不会显示。只有你在调用showBanner时才会显示。 + * 可重复调用,但是会销毁上一次的实例。一般情况,全局有一个就行了,太多占用内存,而且没必要。 + * @param adUid 广告UID + * @param location 位置有两种情况:1、可以传入枚举值,默认上方; 2、可以自定义位置传入IPosition,注意IPosition中的top和left跟平台的top,left是一致(没有乘以设备像素比ratio),需要开发者自己调试位置 + * @param scale 默认为跟屏幕一样的宽度,可以通过设置缩放比例来调整大小。当然,平台有规定最大或最小宽度,函数内部会自动计算。 + */ + public loadBanner(adUid: string, location: EAdBannerLocation | IPosition = EAdBannerLocation.TOP, scale: number = 1.0) { + this._banner?.destroy(); + let size: ISize = getSysWinSize(); + // 当 style.width 小于 300 时,会取作 300。 当 style.width 大于屏幕宽度时,会取作屏幕宽度。 + let width = size.width * scale; + width = width < 300 ? 300 : width; // 最小值矫正 + width = width > size.width ? size.width : width; //最大值矫正 + this._banner = typeof location === 'number' ? new ADBanner(adUid, location === EAdBannerLocation.TOP, width, false) : new ADBanner(adUid, location, width, false); + } + + /** + * 显示横幅广告 + */ + public showBanner() { + if (this._banner) { + this._banner.show(); + } else { + console.warn('MiniGameSDK: banner is null, you must call loadBanner(...) first!'); + } + } + + /** + * 隐藏横幅广告 + */ + public hideBanner() { + this._banner?.hide(); + } + + /** + * 弹出插屏广告 + * @param adUid 广告单元id + */ + public showInterstitial(adUid: string) { + if (this._interstitial && this._interstitial.aduid === adUid) { + this._interstitial.show(); + } else { + this._interstitial?.destory(); + this._interstitial = new ADInterstitial(adUid); + this._interstitial.show(); + } + } + + /** + * 加载原生模板广告,不会显示。只有你在调用showCustom时才会显示。 + * 由于原生模板广告在微信服务后端可以定制宽度大小,个数,缩放比例等,所以位置调整要根据设置的宽度来定。抖音不支持本函数,会调用无效! + * @param adUid 广告ID + * @param location 位置有两种情况:1、可以传入枚举值,默认上方; 2、可以自定义位置传入IPosition,注意IPosition中的top和left跟平台的top,left是一致(没有乘以设备像素比ratio),需要开发者自己调试位置 + * @param scale 缩放比例,默认是1,即不缩放。这个缩放并不是自己填,而是根据微信MP后台你配置的原生模板广告的缩放比例填,目前有100%,90%,80%三种,一般情况不用修改。若有后台修改,记得传入值,例如90%就传入0.9。 + */ + public loadCustom(adUid: string, location: IPosition = { top: 0, left: 0 }, scale: number = 1) { + // this._custom?.destroy(); + // this._custom = new ADCustom(adUid, location.top, location.left, scale); + if (this._customs[adUid]) { + console.log(`${adUid} has been loaded.`); + return; + } + + this._customs[adUid] = new ADCustom(adUid, location.top, location.left, scale); + } + + /** + * 显示自定义广告。 + * @param adUid 广告的唯一标识符。使用此标识符来查找和显示特定的自定义广告。 + * + * 此方法尝试根据提供的adUid显示一个自定义广告。如果给定的adUid对应的自定义广告已加载, + * 则调用该广告的显示方法。如果广告未加载,则在控制台输出警告信息。 + */ + public showCustom(adUid: string) { + if (this._customs[adUid]) { + this._customs[adUid].show(); + } else { + console.warn(`You have not load ${adUid} of Custom AD, can not show!`); + } + } + + /** + * 隐藏指定的自定义广告单元 + * + * 此方法用于隐藏通过广告单元标识符(adUid)指定的自定义广告。如果指定的广告单元已加载并显示, + * 则将其隐藏;如果广告单元未加载,则在控制台输出警告信息。 + * + * @param adUid 广告单元标识符,用于唯一标识一个自定义广告单元。 + */ + public hideCustom(adUid: string) { + if (this._customs[adUid]) { + this._customs[adUid].hide(); + } else { + console.warn(`You have not load ${adUid} of Custom AD, can not hide!`); + } + } + + /** + * 由于微信和抖音视频广告机制不同,微信可以看的视频广告个数只有0和1个,抖音平台则可以看0~maxVideoCount + * @param adUid 广告ID。如果与上一次UID不同,则内部会重新创建实例。开发者完全不用关心这个细节。 + * @param onVideoResult 两个参数:第一个res是EAdVideoResult定义,第二count是用户看了多少个视频广告。 + * @param target onVideoResult的拥有者 + * @param maxVideoCount 最大视频个数。默认是3,仅对抖音平台生效。微信平台看完视频count的结果永远是1或0 + */ + public showVideo(adUid: string, onVideoResult: (res: EAdVideoResult, count: number) => void, target?: any, maxVideoCount: number = 3) { + if (this._video && this._video.aduid === adUid) { + this._video.show(onVideoResult, target, maxVideoCount); + } else { + this._video?.destory(); + this._video = new ADVideo(adUid); + this._video.show(onVideoResult, target, maxVideoCount); + } + } + + /** + * 销毁内部所有实例,清空内存 + */ + public destroyAll() { + this._banner?.destroy(); + this._banner = null; + + this._interstitial?.destory(); + this._interstitial = null; + + this._video?.destory(); + this._video = null; + + if (this._customs) { + for (let val in this._customs) { + this._customs[val]?.destroy(); + } + this._customs = {}; + } + } + } + + export enum EGameClubIcon { + /** 绿色图标 */ + GREEN = 'green', + + /** 红色图标 */ + WHITE = 'white', + + /** 有黑色圆角背景的白色图标 */ + DARK = 'dark', + + /** 有白色圆角背景的绿色图标 */ + LIGHT = 'light' + } + + export class GameClub { + private static _instance: GameClub; + + static get instance(): GameClub { + if (!this._instance) { + this._instance = new GameClub(); + } + return this._instance; + } + + private _club: any; + + private constructor() { + + } + + /** + * 创建游戏圈按钮 + * @param icon + * @param position + * @param size + * @param openLink + */ + create(icon: EGameClubIcon = EGameClubIcon.GREEN, position: IPosition = { top: 0, left: 0 }, size: ISize = { width: 40, height: 40 }, openLink?: string) { + if (isWechat()) { + // @ts-ignore + this._club = wx.createGameClubButton({ + icon: icon, + style: { + left: position.left, + top: position.top, + width: size.width, + height: size.height + }, + openlink: openLink + }); + } + } + + show() { + this._club?.show(); + } + + hide() { + this._club?.hide(); + } + + destory() { + this._club?.destroy(); + } + } + + + /** + * 振动类型 + */ + export enum EVirbrateType { + /** + * 短振动 + */ + SHORT, + + /** + * 长振动 + */ + LONG + } + + /** + * 平台常用API合集 + */ + export class API { + private static _loginCode: string = null; + private static _loginAnonymousCode: string = null; + private static _hasInitWechatCloudFunction: boolean = false; + private static _userInfo: any = null; + + /** + * 分享app给朋友,微信小游戏分享是没有onSuccess回调的。 + * @param title 标题 + * @param description 细节描述信息 + * @param imageUrl 图片地址 + * @param query 查询信息 + * @param onSuccess 抖音会回调,微信不会回调 + */ + static shareAppToFriends(title: string, description: string = '', imageUrl?: string, query?: string, onSuccess?: () => void) { + if (isWechat()) { + try { + //@ts-ignore + wx.shareAppMessage({ + title: title, + imageUrl: imageUrl, + query: query, + }); + } catch (err) { + console.log(`share faild: ${err}`); + } + } + + if (isBytedance()) { + //@ts-ignore + tt.shareAppMessage({ + title: title, + desc: description, + imageUrl: imageUrl ?? '', + query: query ?? '', + success(res: any) { + console.log('share success:', res); + onSuccess?.(); + }, + fail(res: any) { + console.log('share fail:', res); + } + }); + } + } + + /** + * 显示提示信息 + * @param title 标题 + * @param duration 时长(单位:秒) + * @returns + */ + static showToast(title: string, duration: number = 2) { + if (isWechat()) { + // @ts-ignore + wx.showToast({ + title: title, + icon: 'success', + duration: duration * 1000 + }); + } + + if (isBytedance()) { + //@ts-ignore + tt.showToast({ + title: title, + duration: duration * 1000, + success(res: any) { + console.log(`${res}`); + }, + fail(res: any) { + console.log(`showToast调用失败`); + }, + }); + } + } + + /** + * 设备震动效果,默认为短震动。注意:可能一些机型不会生效,具体看平台方的说明 + * @param type MiniGameSdk.API.EVirbrateType + */ + static vibrate(type: EVirbrateType = EVirbrateType.SHORT) { + if (isWechat()) { + switch (type) { + case EVirbrateType.SHORT: + //@ts-ignore + wx.vibrateShort({ + success(res: any) { + console.log('vibrate success:', res); + }, + fail(res: any) { + console.log('vibrateShort failed', res); + }, + }); + break; + case EVirbrateType.LONG: + //@ts-ignore + wx.vibrateLong({ + success(res: any) { + console.log('vibrate success', res); + }, + fail(res: any) { + console.log(`vibrateLong failed`, res); + }, + }); + break; + default: + break; + } + } + + if (isBytedance()) { + switch (type) { + case EVirbrateType.SHORT: + //@ts-ignore + tt.vibrateShort({ + success(res: any) { + console.log('vibrate success:', res); + }, + fail(res: any) { + console.log('vibrateShort failed', res); + }, + }); + break; + case EVirbrateType.LONG: + //@ts-ignore + tt.vibrateLong({ + success(res: any) { + console.log('vibrate success', res); + }, + fail(res: any) { + console.log(`vibrateLong failed`, res); + }, + }); + break; + default: + break; + } + } + } + + /** + * 重启小游戏 + */ + static reboot() { + if (isWechat()) { + //@ts-ignore + wx.restartMiniProgram({ + success: () => { + console.log('restart success'); + }, + + fail: () => { + console.log('restart failed'); + } + }) + } + + if (isBytedance()) { + try { + // @ts-ignore + tt.restartMiniProgramSync(); + } catch (error) { + console.log(`restartMiniProgramSync`, error); + } + } + } + + /** + * 退出小游戏 + */ + static exit() { + if (isWechat()) { + //@ts-ignore + wx.exitMiniProgram({ + success: () => { + console.log('exit success'); + }, + fail: () => { + console.log('exit failed'); + } + }); + } + + if (isBytedance()) { + // @ts-ignore + tt.exitMiniProgram({ + success(res: any) { + console.log("exit success:", res?.data); + }, + fail(res: any) { + console.log("exit fail:", res?.errMsg); + }, + }); + } + } + + /** + * 显示转发按钮。通常在刚进入游戏的时候调用。 + * 主要是打开平台“...”这个按钮里面的分享菜单,一般默认是关闭的,需要调用这个函数打开。可以让用户分享你的游戏入口。 + */ + static showShareMenu() { + if (isWechat()) { + //@ts-ignore + wx.showShareMenu({ + withShareTicket: true, + menus: ['shareAppMessage', 'shareTimeline'], + success: () => { }, + fail: () => { }, + complete: () => { } + }); + } + + if (isBytedance()) { + //@ts-ignore + tt.showShareMenu({ + success(res: any) { + console.log("show menu is showing"); + }, + fail(err: any) { + console.log("showShareMenu:", err.errMsg); + }, + complete(res: any) { + console.log("showShareMenu complete"); + }, + }); + } + } + + /** + * 微信小游戏:跳转到另外一款小游戏 + * 抖音小游戏:跳转到指定的视频界面 + * @param targetId 微信小游戏appid或者视频界面 + */ + static navigateTo(targetId: string, onSuccess?: () => void) { + if (isWechat()) { + // @ts-ignore + wx.navigateToMiniProgram({ + appId: targetId, + extraData: { + foo: 'bar' + }, + envVersion: 'develop', + success(res: any) { + onSuccess?.(); + } + }); + } + + if (isBytedance()) { + // @ts-ignore + tt.navigateToVideoView({ + videoId: targetId, + success: (res: any) => { + onSuccess?.(); + }, + fail: (err: any) => { + console.log("bytedance navigateToVideoView fail", err); + }, + }); + } + } + + + /** + * 小游戏平台登录功能。微信返回code,抖音返回code和anonymousCode。用于登录的凭证,需要把这个code传回你的服务器程序中去调用code2Session + * @param callback (code, anonymousCode) 第一个参数为code,微信和抖音都支持;第二个参数为匿名设备ID,仅抖音支持,失败都返回null + */ + static login(callback: (code: string, anonymousCode: string) => void) { + let loginPlatform = () => { + if (isWechat()) { + //@ts-ignore + wx.login({ + success: (res: { code: any; errMsg: any; }) => { + if (res.code) { + API._loginCode = res.code; + API._loginAnonymousCode = null; + callback?.(API._loginCode, API._loginAnonymousCode); + } else { + console.log('login error:', res.errMsg) + } + }, + + fail: () => { + API._loginCode = null; + API._loginAnonymousCode = null; + callback?.(API._loginCode, API._loginAnonymousCode); + console.log('login fail') + } + }); + } else if (isBytedance()) { + //@ts-ignore + tt.login({ + force: true, + success(res: any) { + console.log(`login ${res.code} ${res.anonymousCode}`); + if (res.code) { + API._loginCode = res.code?.toString(); + API._loginAnonymousCode = res.anonymousCode?.toString(); + callback?.(API._loginCode, API._loginAnonymousCode); + } else { + console.log('login error:', res.errMsg) + } + }, + fail(res: any) { + API._loginCode = null; + API._loginAnonymousCode = null; + callback?.(API._loginCode, API._loginAnonymousCode); + console.log(`login fail`, res); + }, + }); + } else { + API._loginCode = null; + API._loginAnonymousCode = null; + callback?.(API._loginCode, API._loginAnonymousCode); + console.log('not mini game platform, login codes are all null'); + } + } + + + + if (!API._loginCode) { + loginPlatform(); + } else { + if (isWechat()) { + //@ts-ignore + wx.checkSession({ + success() { + console.log(`session is valid, use current code:`, API._loginCode); + callback?.(API._loginCode, API._loginAnonymousCode); + }, + fail() { + console.log(`session expired`); + loginPlatform(); + } + }); + } else if (isBytedance()) { + //@ts-ignore + tt.checkSession({ + success() { + console.log(`session is valid, user current code: ${API._loginCode}, ${API._loginAnonymousCode}`); + callback?.(API._loginCode, API._loginAnonymousCode); + }, + fail() { + console.log(`session expired`); + loginPlatform(); + }, + }); + + } else { + console.log('not mini game platform, login null'); + callback?.(null, null); + } + } + } + + /** + * 小游戏平台登录功能。微信返回code,抖音返回code和anonymousCode。用于登录的凭证,需要把这个code传回你的服务器程序中去调用code2Session + * @param callback (code, anonymousCode) 第一个参数为code,微信和抖音都支持;第二个参数为匿名设备ID,仅抖音支持,失败都返回null + */ + static getUserInfo(callback: (userInfo: any) => void) { + //@ts-ignore + tt.getUserInfo({ + withCredentials: true, + success: (res: any) => { + API._userInfo = res; + callback(API._userInfo); + }, + fail: (err: any) =>{ + callback(err); + } + }); + } + + /** + * 调用微信云函数。由于参数需要自定义,所以为any,需要自行解释。函数只完成通道和处理一场的作用 + * @param callback 返回云函数调用结果。需要检查返回参数是否为空,失败的时候为空 + * @param name 云函数的名字 + * @param data 云函数的内容 + */ + static callWechatCloudFunction(callback: (res: any) => void, name: string, data: {}) { + if (!isWechat()) { + console.log('Not wechat platform, not support callWechatCloudFunction'); + return; + } + + this.login((code: string, anonymousCode: string) => { + if (!API._hasInitWechatCloudFunction) { + //@ts-ignore + wx.cloud.init(); + API._hasInitWechatCloudFunction = true; + } + //@ts-ignore + wx.cloud.callFunction({ + name: name, + data: data, + success: (res: any) => callback?.(res), + fail: (err: any) => { + console.log('wechat cloud function error:', err); + callback?.(null); + } + }); + }); + } + + /** + * 存储用户信息,数据量不能大。可以考虑用于分数排行榜。用户之间可共享排行数据。 + * @param key + * @param value + */ + static setUserCloudStorage(key: string, value: string) { + if (isWechat()) { + // @ts-ignore + wx.setUserCloudStorage({ + KVDataList: [{ key: key, value: value }], + success: () => console.log(`set cloud storage success:${key}, value:${value}`), + fail: (err: any) => console.log('set cloud storage error:', err) + }); + } + + if (isBytedance()) { + // @ts-ignore + tt.setUserCloudStorage({ + KVDataList: [{ key: key, value: value, }], + success: () => console.log(`set cloud storage success:${key}, value:${value}`), + fail: (err: any) => console.log('set cloud storage error:', err) + }); + } + } + } + + + /** + * 抖音侧边栏专属接口 + */ + export class BytedanceSidebar { + /** + * 本游戏在抖音环境下启动监控,需要放在全局环境中,保证能第一时间启动。因为可能监听抖音失败(抖音小游戏官方的说明)! + * @param onResult 包含一个boolean参数的函数 + * @param target 上述函数的拥有者,如果是类的成员函数,需要传入this。普通或匿名函数忽略即可。 + */ + static listenFromSidebar(onResult: (success: boolean) => void, target?: any) { + if (!isBytedance()) { + onResult?.call(target, false); + return; + } + // @ts-ignore + tt.onShow((res: any) => { + console.log('onShow launch res:', res); + if (res.scene === '021036') { + onResult?.call(target, true); + console.log('launch from sidebar'); + } else { + onResult?.call(target, false); + console.log('NOT launch from douyin sidebar!'); + } + }); + + // @ts-ignore + let options = tt.getLaunchOptionsSync(); + if (options && options.scene === '021036') { + onResult?.call(target, true); + } + } + + /** + * 检测抖音侧边栏是否存在 + * @param onResult 包含一个boolean参数的函数 + * @param target 上述函数的拥有者,如果是类的成员函数,需要传入this。普通或匿名函数忽略即可。 + * @returns + */ + static checkSideBar(onResult: (success: boolean) => void, target?: any) { + if (!isBytedance()) { + onResult?.call(target, false); + return; + } + + //@ts-ignore + tt.checkScene({ + scene: "sidebar", + success: (res: any) => { + console.log("check scene success: ", res.isExist); + onResult?.call(target, res.isExist); + + }, + fail: (res: any) => { + console.log("check scene fail:", res); + onResult?.call(target, false); + } + }); + } + + /** + * 跳转到抖音侧边栏 + * @param onResult 包含一个boolean参数的函数 + * @param target 上述函数的拥有者,如果是类的成员函数,需要传入this。普通或匿名函数忽略即可。 + * @returns + */ + static navigateToSidebar(onResult: (success: boolean) => void, target?: any) { + if (!isBytedance()) { + console.log("not douyin platform!"); + onResult?.call(target, false); + return; + } + + // @ts-ignore + tt.navigateToScene({ + scene: "sidebar", + success: () => { + console.log("navigate success"); + onResult?.call(target, true); + }, + fail: (res: any) => { + console.log("navigate failed reason:", res); + onResult?.call(target, false); + }, + }); + } + } + +} \ No newline at end of file diff --git a/assets/Script/Sdk/MiniGameSdk.ts.meta b/assets/Script/Sdk/MiniGameSdk.ts.meta new file mode 100644 index 0000000..42a905b --- /dev/null +++ b/assets/Script/Sdk/MiniGameSdk.ts.meta @@ -0,0 +1,10 @@ +{ + "ver": "1.1.0", + "uuid": "c1af99dd-ee03-40f7-9609-d3887d0dd357", + "importer": "typescript", + "isPlugin": false, + "loadPluginInWeb": true, + "loadPluginInNative": true, + "loadPluginInEditor": false, + "subMetas": {} +} \ No newline at end of file diff --git a/assets/Script/module/Config/GameConfig.ts b/assets/Script/module/Config/GameConfig.ts index 61fa1b8..e4ffa18 100644 --- a/assets/Script/module/Config/GameConfig.ts +++ b/assets/Script/module/Config/GameConfig.ts @@ -52,6 +52,7 @@ export class GameConfig { currSeed: number; //用于随机数种子 gameId: string; //游戏ID userId: number; //用户ID + scode: string; //scode guide: boolean; //是否有引导 url: string; //访问域名 success: boolean; //用户游戏成功与否 @@ -63,11 +64,15 @@ export class GameConfig { successList: any[]; //整局胜负 fen: number; //小局得分 score: number; //总得分 - igniteCount: number; + igniteCount: number; //玩家总计成功点火数 + min_Steps: number; //每次上一把最小步数 + min_Time: number; //每一把上次距离洪峰到来时间 }; + + //游戏内信息 @@ -80,12 +85,26 @@ export class GameConfig { } return this._instance; } + + static getKey(key){ + var reg = new RegExp('(^|&)' + key + '=([^&]*)(&|$)', 'i'); + var r = window.location.search.substr(1).match(reg); + if (r != null) { + return unescape(r[2]); + } + return ""; + } + + //getSeedRandom static init(Authentication){ this.CLICK_init(); this.LEVEL_INFO_init(); this.GM_INFO_init(); - var self = this; + if(!Authentication) this.Authentication(); + // @ts-ignore + if(window.wx !== null && window.wx !== undefined) WeChat.setShare(location.href); + // var self = this; // cc.resources.load('Json/CLICK_DATA', (err: any, res: cc.JsonAsset) => { // if (err) { // return; @@ -104,13 +123,16 @@ export class GameConfig { // cc.resources.load('Json/GM_INFO', (err: any, res: cc.JsonAsset) => { // if (err) { // if(!Authentication) self.Authentication(); + // if(window.wx !== null && window.wx !== undefined) WeChat.setShare(location.href); // return; // } // let jsonData: object = res.json!; // self.GM_INFO = jsonData["data"]; + // self.setCode(self.getKey("scode")); // cc.fx.GameTool.getCustom(false); // if(!Authentication) self.Authentication(); + // if(window.wx !== null && window.wx !== undefined) WeChat.setShare(location.href); // }) //GAME_DATA 废弃了,暂时不删除以防后面修改回 一整局传一次 @@ -178,6 +200,9 @@ export class GameConfig { fastPath: 5 //最短路径 } ] + // @ts-ignore + if(window.wx !== null && window.wx !== undefined) WeChat.setShare(location.href); + if(!Authentication) this.Authentication(); } //数据备用 @@ -187,9 +212,10 @@ export class GameConfig { mean_Time: 0, //平均放箭速度 total: 0, //总共对的个数 currSeed: 200000, //用于随机数种子 - gameId: "100010", //游戏ID - userId: 0, //用户ID - guide: true, //是否有引导 + gameId: "100012", //游戏ID + userId: 0, //用户ID + scode:"", //scode + guide: false, //是否有引导 url: "https://api.sparkus.cn",//访问域名 success: false, //用户游戏成功与否 matchId: null, //用于埋点上传的ID @@ -201,11 +227,13 @@ export class GameConfig { fen:0, //小局得分 score:0, //总得分 igniteCount: 0, //玩家总计成功点火数 + min_Steps:0, //每次上一把最小步数 + min_Time:0 //每一把上次距离洪峰到来时间 }; + this.setCode(this.getKey("scode")); } static GM_INFO_SET(key,value) { - this.GM_INFO[key] = value; } static CLICK_init() { @@ -221,8 +249,8 @@ export class GameConfig { optimizedSteps: 0, //关卡最短步数 usedSteps: 0, //玩家修建总步数 stepList: [], //U、D、L、R X 息壤 F 加固 - startTime:0, //从游戏开始到玩家操作的第一步截止时间 单位毫秒 - submitTime:0, //从第一步操作到提交时间,如果未提交为-1 单位毫秒 + startTime:-1, //从游戏开始到玩家操作的第一步截止时间 单位毫秒 + submitTime:-1, //从第一步操作到提交时间,如果未提交为-1 单位毫秒 duration:0, //游戏总用时(截止到提交) 单位毫秒 如果未他移交则为时间上限 drawingBack:0, //后退次数 drawingReset:0, //清空次数 @@ -237,7 +265,7 @@ export class GameConfig { static LEVEL_INFO_init() { this.TIME_INFO = { waterSpeed:[0.3,0.25,0.2,0.18,0.16,0.14,0.12,0.1], //洪峰速度 - totalTime:120, //游戏总时长 + totalTime: 20, //游戏总时长 waterTime:[10,12,14,16,18,20,20,20], //洪峰来的倒计时 roadSpeed:0.2, //河道修筑速度 ReinforceSpeed:0.2, //加固时间速度 @@ -280,7 +308,7 @@ export class GameConfig { // ] - this.LEVEL_INFO = [[{"id":"1001","map":[[0,4,0,0],[0,0,0,0],[0,0,0,0],[0,0,1,0]],"min_steps":4},{"id":"1002","map":[[1,0,0,0],[0,0,0,4],[0,0,0,0],[0,0,0,0]],"min_steps":4},{"id":"1003","map":[[1,0,0,0],[0,0,0,0],[0,0,0,0],[0,0,0,4]],"min_steps":6},{"id":"1004","map":[[1,0,0,0],[0,0,0,0],[0,0,0,0],[0,4,0,0]],"min_steps":4},{"id":"1005","map":[[1,0,0,0],[0,0,0,0],[0,0,0,4],[0,0,0,0]],"min_steps":5},{"id":"1006","map":[[4,0,0,0],[0,0,0,0],[0,0,0,0],[0,1,0,0]],"min_steps":4},{"id":"1007","map":[[0,4,0,0],[0,0,0,0],[0,0,0,0],[0,0,0,1]],"min_steps":5},{"id":"1008","map":[[0,0,0,4],[0,0,0,0],[0,0,0,0],[1,0,0,0]],"min_steps":6}],[{"id":"2001","map":[[0,0,0,0,1],[0,0,0,0,0],[0,0,3,0,3],[0,0,0,0,0],[4,0,0,0,3]],"min_steps":8},{"id":"2002","map":[[0,1,0,0,0],[0,0,0,0,0],[3,3,0,0,4],[0,0,0,0,0],[3,0,0,0,0]],"min_steps":8},{"id":"2003","map":[[1,0,0,3,0],[0,0,3,0,0],[0,0,0,0,0],[0,0,0,0,0],[0,3,0,4,0]],"min_steps":7},{"id":"2004","map":[[1,0,0,0,0],[0,0,0,0,3],[3,0,0,0,0],[0,0,0,0,0],[0,0,0,3,4]],"min_steps":8},{"id":"2005","map":[[0,3,0,0,0],[1,0,0,0,0],[0,0,0,3,0],[0,0,0,0,0],[0,3,0,4,0]],"min_steps":6},{"id":"2006","map":[[0,1,0,0,0],[0,0,0,0,3],[0,0,0,0,3],[0,0,0,0,0],[0,0,0,3,4]],"min_steps":7},{"id":"2007","map":[[3,0,0,0,1],[0,0,0,0,3],[0,0,0,0,0],[0,0,0,0,0],[4,3,0,0,0]],"min_steps":8},{"id":"2008","map":[[3,4,0,0,0],[0,0,0,0,3],[0,0,0,3,1],[0,0,0,0,0],[0,0,0,0,0]],"min_steps":7}],[{"id":"3001","map":[[0,0,2,0,2,4],[0,2,0,0,0,0],[0,0,2,0,0,0],[1,2,2,0,0,0],[0,0,0,0,2,0],[0,2,2,0,0,2]],"min_steps":4},{"id":"3002","map":[[0,2,0,0,2,0],[0,0,0,0,0,0],[0,2,0,0,2,1],[0,2,0,0,0,0],[0,0,0,0,0,2],[2,0,2,4,2,2]],"min_steps":4}],[{"id":"4001","map":[[3,0,2,3,4],[0,0,0,2,2],[2,3,3,3,3],[0,0,2,0,2],[1,0,2,3,0]],"min_steps":5},{"id":"4002","map":[[3,0,3,2,0],[1,2,0,3,2],[2,3,0,0,4],[2,0,2,2,0],[3,3,0,3,0]],"min_steps":5},{"id":"4003","map":[[0,2,3,3,4],[2,2,0,0,0],[1,3,3,3,2],[2,2,3,2,3],[0,0,0,0,0]],"min_steps":5},{"id":"4004","map":[[3,2,2,1,0],[0,0,3,2,2],[3,0,2,3,0],[3,0,0,3,3],[0,2,4,0,2]],"min_steps":5},{"id":"4005","map":[[3,0,3,0,0],[2,3,0,0,1],[0,2,2,2,3],[4,2,0,0,2],[3,3,0,3,2]],"min_steps":5},{"id":"4006","map":[[2,0,2,2,0],[1,2,3,0,0],[3,3,0,3,2],[3,0,0,3,2],[2,0,3,0,4]],"min_steps":6},{"id":"4007","map":[[1,2,0,3,3],[2,2,0,2,0],[2,3,2,0,3],[0,3,2,0,4],[0,0,3,0,3]],"min_steps":6},{"id":"4008","map":[[3,3,3,0,1],[0,0,0,0,3],[2,2,3,2,2],[0,2,3,0,3],[4,2,2,0,0]],"min_steps":5},{"id":"4009","map":[[1,0,3,3,2],[3,0,2,0,0],[0,3,3,2,4],[0,0,3,0,2],[2,2,2,0,3]],"min_steps":5},{"id":"4010","map":[[3,0,2,0,4],[1,2,3,0,3],[2,0,3,2,0],[0,3,0,0,3],[2,0,2,3,2]],"min_steps":5}],[{"id":"5001","map":[[1,3,0,0,2,0],[0,3,0,0,2,0],[0,0,2,0,3,4],[0,0,0,2,0,0],[3,3,0,0,2,0,3],[0,0,2,2,2,0]],"min_steps":5},{"id":"5002","map":[[0,2,2,2,2,0],[1,0,0,0,2,0],[0,0,0,0,0,3],[0,0,0,0,2,0],[0,3,3,0,2,0],[3,0,0,4,2,0]],"min_steps":5},{"id":"5003","map":[[0,0,0,0,0,0],[2,0,0,0,0,2],[0,3,3,3,2,4],[0,3,0,3,2,0],[0,0,0,0,0,3],[0,0,2,3,0,1]],"min_steps":6},{"id":"5004","map":[[2,0,3,0,0,4],[0,2,3,3,0,0],[0,3,0,0,0,0],[3,0,0,0,2,2],[3,0,0,2,0,0],[1,0,0,3,0,0]],"min_steps":6},{"id":"5005","map":[[1,0,0,0,0,2],[0,0,0,2,0,0],[3,2,0,0,0,0],[0,3,0,0,2,3],[0,0,3,3,0,0],[3,0,0,2,3,4]],"min_steps":8},{"id":"5006","map":[[4,3,0,3,0,0],[0,2,0,3,0,0],[3,0,0,0,3,2],[0,3,0,0,2,1],[0,0,2,0,0,0],[0,0,0,0,2,3]],"min_steps":7},{"id":"5007","map":[[4,2,2,0,2,0],[0,3,0,2,0,0],[0,2,3,0,3,0],[0,0,3,0,0,3],[0,0,3,0,0,0],[0,0,0,3,0,1]],"min_steps":7},{"id":"5008","map":[[0,0,2,3,0,0],[0,3,0,2,3,2],[3,0,0,0,0,0],[0,3,0,0,3,4],[0,0,0,0,0,3],[0,2,0,2,0,1]],"min_steps":8},{"id":"5009","map":[[0,3,3,0,0,4],[2,0,0,3,0,0],[2,0,0,3,0,0],[1,0,0,0,3,0],[0,0,2,3,0,2],[2,3,0,0,0,0]],"min_steps":8},{"id":"5010","map":[[0,0,1,3,2,0],[3,0,0,0,3,2],[3,0,0,0,0,3],[2,0,0,0,0,0],[0,2,0,0,3,0],[0,2,0,3,4,0]],"min_steps":8},{"id":"5011","map":[[1,0,0,0,0,0],[3,3,0,0,0,2],[0,0,0,3,0,2],[2,0,3,0,3,0],[2,0,3,0,0,3],[4,0,0,0,0,2]],"min_steps":8},{"id":"5012","map":[[2,2,3,0,2,0],[0,3,0,0,0,0],[0,0,0,0,3,4],[0,2,0,3,0,3],[0,0,0,0,0,0],[0,0,2,3,3,1]],"min_steps":9},{"id":"5013","map":[[0,0,0,0,3,0],[4,2,0,3,0,0],[3,2,0,0,0,0],[1,3,0,3,0,0],[2,0,0,2,0,0],[3,0,0,3,2,0]],"min_steps":9},{"id":"5014","map":[[0,0,3,0,2,2],[0,2,3,0,0,1],[0,3,3,0,0,3],[0,2,0,0,0,0],[0,0,0,3,3,0],[2,0,4,0,0,0]],"min_steps":7},{"id":"5015","map":[[2,0,0,0,0,0],[0,0,0,0,3,1],[3,0,2,0,0,3],[2,0,0,2,3,0],[3,0,3,0,0,0],[2,0,0,3,4,0]],"min_steps":7},{"id":"5016","map":[[0,0,3,0,0,1],[2,3,0,0,3,0],[2,0,0,0,0,2],[0,3,0,0,0,0],[0,3,0,0,2,0],[0,4,3,0,2,3]],"min_steps":8},{"id":"5017","map":[[1,2,3,0,3,2],[3,0,0,0,0,0],[0,0,0,0,0,3],[3,3,0,3,2,0],[0,2,0,0,0,0],[4,0,0,2,0,0]],"min_steps":8},{"id":"5018","map":[[0,0,1,0,2,0],[0,0,0,0,0,0],[0,0,3,2,3,0],[3,0,0,3,0,0],[2,3,0,2,0,0],[4,2,0,3,3,0]],"min_steps":8}],[{"id":"6001","map":[[1,0,0,0,0,0],[0,2,2,3,0,2],[3,2,0,0,3,3],[0,0,0,0,0,4],[0,0,0,2,2,0],[3,0,2,2,0,0]],"min_steps":7},{"id":"6002","map":[[0,0,0,0,4,3],[3,2,3,0,0,0],[0,2,0,2,3,0],[2,2,0,0,0,0],[3,2,0,0,0,0],[3,0,0,2,0,3],[2,0,0,3,0,1]],"min_steps":7},{"id":"6003","map":[[0,0,1,3,0,2],[0,3,3,0,0,0],[0,0,3,2,0,0],[0,0,3,0,0,0],[3,0,0,0,2,2],[0,0,2,3,0,0],[0,2,0,3,0,4]],"min_steps":10},{"id":"6004","map":[[0,3,3,2,3,0],[2,0,2,0,3,0],[1,0,3,2,0,0],[3,3,0,0,0,2],[0,0,0,0,0,0],[0,2,0,0,0,0],[0,0,0,3,4,0]],"min_steps":8},{"id":"6005","map":[[0,0,0,0,0,1],[0,0,2,0,2,0],[3,2,2,0,0,0],[3,0,0,3,0,0],[3,3,0,0,0,3],[4,3,0,0,0,0],[2,0,0,2,3,0]],"min_steps":8},{"id":"6006","map":[[0,3,0,0,0,0],[1,0,0,0,3,0],[0,0,3,2,0,0],[3,0,0,2,2,0],[0,3,0,3,3,0],[0,2,0,0,0,0],[4,0,3,0,2,2]],"min_steps":9},{"id":"6007","map":[[0,2,0,3,0,0],[1,2,0,2,0,0],[0,3,0,3,0,0],[3,0,0,0,0,3],[0,0,3,2,0,2],[4,0,0,3,0,3],[0,2,0,0,0,0]],"min_steps":9},{"id":"6008","map":[[3,0,3,2,0,4],[0,3,0,2,0,2],[0,0,3,0,0,0],[2,0,0,2,0,0],[0,0,3,0,0,0],[0,0,0,3,0,0],[3,2,1,3,0,0]],"min_steps":8},{"id":"6009","map":[[0,2,0,0,0,3],[0,0,3,3,3,4],[0,3,0,0,0,0],[0,3,2,0,0,0],[1,2,3,2,0,3],[2,0,0,0,0,0],[0,0,0,0,2,0]],"min_steps":10},{"id":"6010","map":[[0,3,1,0,0,0],[0,2,3,3,0,0],[0,2,0,3,0,0],[0,2,0,2,0,3],[0,2,0,0,3,0],[0,3,0,0,0,0],[0,2,4,0,0,3]],"min_steps":9},{"id":"6011","map":[[1,0,3,0,3,0],[0,2,0,0,0,0],[2,0,2,0,3,0],[0,3,2,0,0,0],[3,0,0,0,0,2],[4,0,3,0,0,0],[3,2,0,0,0,3]],"min_steps":9},{"id":"6012","map":[[2,3,0,2,0,1],[2,0,0,0,0,0],[2,0,0,3,0,2],[3,0,3,0,0,3],[0,0,0,0,3,3],[3,0,0,0,2,0],[0,0,0,0,0,4]],"min_steps":8},{"id":"6013","map":[[0,0,2,1,2,0],[0,3,0,0,0,0],[2,0,0,0,0,0],[0,0,0,3,0,0],[3,0,0,2,3,0],[3,3,3,2,0,2],[0,0,4,0,0,3]],"min_steps":8},{"id":"6014","map":[[0,1,0,0,0,0],[2,0,2,0,0,2],[2,3,0,3,0,0],[0,3,0,0,0,3],[0,0,0,2,0,3],[0,0,3,0,3,0],[2,0,3,0,0,4]],"min_steps":9},{"id":"6015","map":[[1,2,3,2,2,0],[3,0,0,0,0,3],[0,0,0,0,0,0],[0,0,0,0,0,2],[0,3,0,3,2,0],[0,0,0,0,0,0],[0,2,0,4,0,3]],"min_steps":7},{"id":"6016","map":[[3,0,1,0,0,0],[0,2,0,2,0,0],[0,2,0,2,0,3],[0,0,0,0,0,0],[0,2,0,0,3,3],[0,0,0,0,2,3],[0,0,0,3,0,4]],"min_steps":7},{"id":"6017","map":[[0,0,0,0,0,0],[1,2,3,0,0,2],[0,0,2,0,0,2],[3,0,2,3,0,0],[0,3,3,0,2,0],[0,0,0,0,0,0],[4,0,3,0,0,0]],"min_steps":9},{"id":"6018","map":[[0,2,0,1,0,0],[2,0,0,3,0,0],[0,0,0,0,0,0],[3,0,0,0,0,0],[2,3,0,2,3,3],[2,0,0,0,0,2],[4,3,0,0,0,0]],"min_steps":8},{"id":"6019","map":[[1,3,0,2,3,0],[0,0,0,0,0,2],[0,0,0,0,0,0],[0,0,2,0,0,2],[3,3,0,3,0,2],[4,0,2,0,0,0],[0,0,0,3,0,0]],"min_steps":8},{"id":"6020","map":[[0,0,0,2,0,0],[0,3,0,0,0,3],[0,2,0,0,3,0],[2,0,0,2,3,4],[0,2,3,0,0,0],[0,0,0,3,0,0],[3,2,0,1,3,0]],"min_steps":11}],[{"id":"7001","map":[[0,0,3,3,4,2],[0,0,0,2,0,0],[2,3,3,2,0,0],[0,3,0,0,0,2],[0,0,0,3,2,2],[2,0,0,3,0,2],[1,3,2,0,0,0],[0,0,0,3,0,0]],"min_steps":9},{"id":"7002","map":[[0,0,3,3,4,2],[0,0,0,2,0,0],[2,3,3,2,0,0],[0,3,0,0,0,2],[0,0,0,3,2,2],[2,0,0,3,0,2],[1,3,2,0,0,0],[0,0,0,3,0,0]],"min_steps":11},{"id":"7003","map":[[0,2,2,0,0,4],[0,3,3,0,0,0],[3,2,0,0,0,0],[0,3,0,0,3,3],[0,2,0,3,0,0],[2,3,0,0,0,0],[0,2,3,0,0,0],[1,2,3,0,2,0]],"min_steps":12},{"id":"7004","map":[[0,3,0,2,2,0],[0,0,0,0,0,2],[3,0,0,0,0,0],[0,3,0,0,0,0],[0,3,3,0,3,0],[2,0,0,0,3,2],[2,0,0,0,3,1],[4,3,0,2,3,2]],"min_steps":13},{"id":"7005","map":[[2,2,4,2,3,0],[0,3,3,2,0,0],[3,0,0,3,0,2],[3,0,2,3,3,0],[0,0,0,0,0,0],[0,0,0,0,2,3],[3,2,0,0,0,1],[0,0,0,0,0,0]],"min_steps":13},{"id":"7006","map":[[1,0,2,0,0,3],[0,0,0,0,3,0],[3,0,0,3,2,0],[2,3,0,0,0,3],[0,0,3,2,0,3],[0,2,0,3,0,0],[2,3,0,2,0,0],[0,4,0,2,0,0]],"min_steps":11},{"id":"7007","map":[[3,2,0,0,3,4],[0,2,0,0,3,0],[0,0,2,0,2,0],[2,0,0,3,0,3],[0,0,2,0,3,2],[0,2,3,3,0,1],[0,0,0,0,0,3],[0,0,0,3,0,0]],"min_steps":13},{"id":"7008","map":[[0,0,2,0,3,4],[3,3,2,3,0,0],[0,0,0,0,0,3],[0,0,2,3,2,0],[0,0,2,0,3,2],[3,3,0,0,0,2],[0,3,0,0,0,0],[2,1,0,0,0,0]],"min_steps":10},{"id":"7009","map":[[4,3,0,0,3,0],[0,0,0,0,0,0],[3,3,0,2,0,2],[3,0,0,2,2,0],[2,3,2,0,0,0],[1,3,3,0,0,0],[2,0,0,0,0,0],[3,3,0,0,0,2]],"min_steps":11},{"id":"7010","map":[[0,3,1,0,0,0],[0,2,3,3,0,0],[2,0,0,3,0,0],[0,2,0,0,3,2],[3,0,0,0,0,2],[3,2,0,0,0,0],[4,0,0,3,2,0],[0,3,0,3,2,0]],"min_steps":13},{"id":"7011","map":[[3,0,2,2,3,2],[1,0,0,0,0,3],[0,0,3,2,3,0],[3,0,3,0,0,0],[4,3,2,3,0,2],[0,0,2,0,2,3],[2,0,0,0,0,3],[0,0,0,2,0,3]],"min_steps":12},{"id":"7012","map":[[3,0,0,0,2,0],[0,3,0,3,0,0],[0,3,0,0,0,3],[2,0,0,3,2,0],[3,2,2,2,0,0],[3,0,2,0,3,0],[1,2,3,0,2,0],[2,3,0,0,3,4]],"min_steps":9},{"id":"7013","map":[[3,0,0,2,2,0],[0,2,0,3,0,2],[0,0,3,2,3,0],[0,3,0,0,3,0],[2,2,3,2,0,0],[0,0,3,3,0,0],[0,2,0,3,2,0],[4,3,3,0,1,0]],"min_steps":10},{"id":"7014","map":[[4,3,0,0,0,0],[0,2,2,2,3,0],[0,3,0,0,0,0],[2,3,2,3,0,0],[3,3,0,0,0,3],[0,0,0,2,3,0],[0,3,2,0,2,2],[2,3,3,0,0,1]],"min_steps":12},{"id":"7015","map":[[4,0,0,0,2,3],[0,0,3,0,0,3],[2,2,3,2,0,0],[3,0,0,0,3,2],[2,3,0,3,0,2],[0,0,3,0,2,3],[0,0,0,0,0,3],[1,2,2,3,0,0]],"min_steps":14},{"id":"7016","map":[[0,0,1,0,2,3],[0,3,2,0,2,0],[3,3,3,3,0,0],[3,0,0,0,0,0],[2,2,3,0,3,3],[0,0,2,0,2,0],[0,2,0,2,0,3],[3,0,2,0,0,4]],"min_steps":9},{"id":"7017","map":[[4,0,0,0,0,3],[0,3,3,0,0,0],[3,0,2,2,0,0],[3,0,2,3,3,2],[3,2,0,2,3,3],[2,0,2,0,0,0],[0,0,0,0,0,3],[2,3,0,2,0,1]],"min_steps":10},{"id":"7018","map":[[2,3,0,0,2,3],[2,0,0,3,0,4],[2,0,0,0,0,0],[0,3,2,0,2,3],[0,0,0,0,0,3],[2,0,3,3,2,3],[0,0,0,3,2,0],[2,3,1,3,0,0]],"min_steps":11},{"id":"7019","map":[[4,0,0,0,2,3],[0,0,3,0,0,3],[2,2,3,2,0,0],[3,0,0,0,3,2],[2,3,0,3,0,2],[0,0,3,0,2,3],[0,0,0,0,0,3],[1,2,2,3,0,0]],"min_steps":14},{"id":"7020","map":[[3,2,0,0,0,0],[4,0,2,0,2,0],[3,3,0,0,2,2],[0,0,3,0,2,0],[0,0,0,0,2,3],[0,2,3,3,0,0],[2,3,0,0,3,3],[1,3,3,2,0,0]],"min_steps":12},{"id":"7021","map":[[4,3,0,0,0,0],[0,2,2,2,3,0],[0,3,0,0,0,0],[2,3,2,3,0,0],[3,3,0,0,0,3],[0,0,0,2,3,0],[0,3,2,0,2,2],[2,3,3,0,0,1]],"min_steps":12}],[{"id":"8001","map":[[0,2,0,0,2,0],[3,3,0,2,0,4],[0,0,0,0,0,3],[0,0,0,0,3,2],[0,0,0,0,0,2],[3,3,0,0,0,2],[0,3,3,2,2,0],[0,3,2,2,0,3],[1,2,0,0,2,0]],"min_steps":9},{"id":"8002","map":[[1,0,3,2,0,2],[0,3,0,0,0,2],[0,2,0,3,2,2],[0,3,0,0,0,0],[0,2,0,3,3,0],[3,2,2,0,0,3],[0,3,2,3,0,2],[0,0,0,0,0,0],[2,0,0,2,3,4]],"min_steps":11},{"id":"8003","map":[[1,3,2,0,0,0],[0,0,0,2,0,0],[0,3,0,2,0,0],[3,3,3,2,0,3],[2,3,3,0,3,0],[0,0,0,0,0,2],[3,0,2,2,3,2],[4,2,0,0,2,0],[0,0,2,0,0,2]],"min_steps":10},{"id":"8004","map":[[2,0,0,2,0,0],[0,3,0,0,0,1],[0,2,0,0,0,0],[0,0,0,0,2,0],[0,0,3,3,3,2],[0,0,0,3,2,3],[0,0,2,0,0,3],[0,2,3,2,2,4],[3,2,2,0,3,0]],"min_steps":13},{"id":"8005","map":[[0,0,0,0,0,0],[0,0,0,3,2,4],[0,3,0,0,3,3],[3,3,0,2,0,3],[0,2,2,0,3,2],[0,0,3,0,2,0],[0,2,0,2,0,0],[3,0,0,2,2,0],[0,0,2,2,0,1]],"min_steps":11},{"id":"8006","map":[[0,0,0,0,2,3],[3,2,0,0,0,0],[0,2,0,3,3,4],[0,0,0,2,2,3],[2,0,0,0,0,0],[0,0,0,0,3,0],[3,0,3,3,0,2],[3,0,2,2,0,2],[0,0,2,2,0,1]],"min_steps":11},{"id":"8007","map":[[2,0,2,0,2,0],[0,0,2,0,3,2],[0,0,0,3,3,0],[0,2,0,0,3,2],[3,0,0,2,0,0],[3,3,0,0,0,2],[0,2,0,3,2,0],[0,2,3,0,0,0],[4,3,0,0,1,0]],"min_steps":11},{"id":"8008","map":[[1,0,0,0,2,0],[3,3,2,0,3,0],[3,0,3,0,0,0],[0,0,3,0,0,3],[2,2,0,3,0,3],[2,0,2,0,0,0],[2,0,2,0,0,2],[2,0,0,2,0,0],[4,3,0,0,0,2]],"min_steps":12},{"id":"8009","map":[[4,0,3,1,0,2],[0,2,3,3,3,0],[0,2,3,2,2,0],[3,0,3,0,0,2],[0,0,0,0,0,0],[3,2,0,0,2,0],[3,2,0,0,2,0],[0,0,2,2,2,0],[0,0,0,0,3,0]],"min_steps":13},{"id":"8010","map":[[4,3,0,3,1,0],[0,0,3,3,0,0],[0,3,0,0,2,2],[2,0,3,0,0,2],[3,2,0,2,3,0],[0,0,0,0,0,0],[0,2,0,2,2,0],[0,2,0,3,0,2],[0,2,0,0,0,3]],"min_steps":12},{"id":"8011","map":[[0,1,0,0,2,0],[3,0,3,3,2,3],[0,3,3,2,0,0],[0,0,2,0,3,3],[2,3,2,0,0,0],[3,2,2,3,3,0],[2,0,2,2,0,4],[0,2,0,3,0,0],[0,0,0,3,0,3]],"min_steps":14},{"id":"8012","map":[[1,3,3,3,0,0],[0,3,0,2,0,0],[0,0,0,3,0,2],[3,0,0,3,2,3],[0,0,2,0,0,3],[0,0,2,3,2,0],[2,2,3,2,3,2],[0,3,0,2,0,2],[0,3,4,3,0,0]],"min_steps":17},{"id":"8013","map":[[0,1,0,0,3,3],[0,2,0,3,0,0],[2,3,0,0,0,0],[0,0,0,3,0,3],[0,3,0,2,3,2],[2,0,3,3,2,0],[0,2,2,3,0,2],[2,3,2,0,3,0],[0,3,3,0,2,4]],"min_steps":17},{"id":"8014","map":[[3,4,2,3,0,0],[2,3,0,3,0,0],[0,2,2,0,0,0],[0,3,3,0,3,3],[0,0,0,0,0,0],[3,2,0,0,2,2],[2,2,2,2,0,3],[0,0,3,3,0,3],[1,2,0,3,3,0]],"min_steps":13},{"id":"8015","map":[[2,3,4,0,3,0],[1,2,3,2,3,0],[0,0,3,0,2,0],[2,0,0,3,0,0],[2,2,0,2,0,3],[0,0,2,0,0,0],[3,0,0,3,3,0],[0,0,3,0,2,3],[3,0,3,2,3,2]],"min_steps":13},{"id":"8016","map":[[2,3,4,0,0,3],[0,3,2,2,3,1],[0,2,2,3,0,0],[3,0,3,0,2,0],[3,0,0,0,2,2],[0,0,3,3,0,0],[0,3,0,3,2,0],[0,0,3,0,3,2],[0,2,2,3,0,0]],"min_steps":12},{"id":"8017","map":[[2,0,0,3,0,3],[4,3,0,2,0,3],[3,0,0,0,3,0],[2,0,0,2,0,0],[3,0,0,3,0,0],[2,3,0,2,2,2],[1,3,3,0,2,2],[0,3,0,0,3,0],[0,2,0,3,3,2]],"min_steps":14},{"id":"8018","map":[[0,0,0,0,0,2],[1,0,3,3,0,2],[3,3,0,3,2,3],[0,3,0,2,0,0],[0,3,0,0,2,2],[3,0,0,2,3,0],[0,3,3,3,0,0],[2,0,3,0,0,2],[2,4,2,0,3,2]],"min_steps":17},{"id":"8019","map":[[0,3,0,2,3,1],[0,3,0,2,0,2],[0,2,2,0,3,3],[0,0,3,2,0,3],[0,0,3,2,2,0],[2,2,3,0,2,2],[0,3,0,0,3,0],[3,0,0,3,3,0],[0,0,0,3,0,4]],"min_steps":14},{"id":"8020","map":[[2,3,0,4,3,3],[3,3,0,0,3,0],[0,2,0,3,2,0],[0,3,0,0,0,2],[3,2,0,0,0,0],[0,0,3,2,0,3],[0,3,0,3,2,0],[3,2,2,0,0,2],[0,0,2,1,3,2]],"min_steps":12},{"id":"8021","map":[[0,0,0,0,2,4],[3,0,2,0,0,0],[3,0,2,3,3,3],[2,0,3,3,3,0],[2,0,0,0,2,3],[3,3,0,0,0,2],[1,0,3,0,2,2],[2,2,0,2,0,0],[0,0,3,3,0,3]],"min_steps":14},{"id":"8022","map":[[4,0,0,0,0,0],[0,0,0,0,3,2],[3,3,2,3,3,2],[2,0,0,0,0,2],[0,0,3,0,3,3],[2,0,2,3,2,1],[3,2,3,0,0,3],[2,0,0,3,2,2],[3,3,0,0,0,0]],"min_steps":15},{"id":"8023","map":[[3,2,0,2,0,1],[0,3,3,2,3,3],[0,3,3,0,3,0],[0,2,2,2,0,3],[0,3,2,0,0,3],[0,0,0,0,2,0],[2,2,2,3,0,0],[2,0,3,0,3,0],[0,0,3,0,0,4]],"min_steps":9},{"id":"8024","map":[[1,3,2,0,0,3],[2,3,2,0,0,0],[0,2,3,0,3,3],[3,0,0,2,0,3],[2,3,0,0,0,3],[3,3,0,0,0,0],[2,0,3,0,0,2],[0,0,2,0,2,2],[4,2,3,0,3,0]],"min_steps":12},{"id":"8025","map":[[2,3,1,0,3,3],[0,0,2,3,2,0],[0,2,0,0,0,3],[0,3,0,0,0,3],[2,0,0,3,2,0],[0,0,2,3,0,2],[2,0,3,2,0,3],[3,3,0,0,3,3],[2,4,0,2,0,0]],"min_steps":13},{"id":"8026","map":[[2,4,2,0,0,0],[0,3,3,0,3,0],[3,3,3,0,0,3],[2,0,3,0,0,2],[0,2,2,3,0,3],[1,0,2,0,2,0],[3,3,0,0,0,0],[2,0,0,0,3,2],[2,0,3,2,3,0]],"min_steps":11},{"id":"8027","map":[[2,0,0,0,0,2],[0,0,3,3,2,3],[0,0,3,0,0,1],[0,3,0,3,3,3],[0,0,0,0,0,2],[3,3,2,0,0,2],[3,3,0,2,0,3],[0,3,2,2,2,0],[0,3,4,2,2,0]],"min_steps":11},{"id":"8028","map":[[0,2,1,3,0,2],[0,3,3,3,0,2],[0,0,0,3,0,2],[3,0,0,3,2,4],[2,0,0,3,2,2],[2,2,3,0,0,3],[0,2,0,0,0,0],[0,3,3,3,2,0],[0,3,0,3,0,0]],"min_steps":16},{"id":"8029","map":[[0,0,1,0,0,0],[3,3,0,0,3,2],[3,0,0,0,2,0],[0,2,0,2,2,0],[2,3,3,3,0,3],[3,2,2,3,0,0],[2,0,3,0,0,3],[3,2,0,0,0,3],[4,2,0,0,3,2]],"min_steps":11},{"id":"8030","map":[[2,0,1,2,0,0],[0,2,3,3,0,2],[2,3,3,3,0,2],[3,0,0,2,2,0],[0,3,0,3,2,0],[0,0,2,0,2,3],[3,3,0,3,3,2],[4,3,0,0,0,0],[0,0,0,0,0,3]],"min_steps":13},{"id":"8031","map":[[0,2,2,3,4,2],[3,3,0,0,2,2],[0,0,0,3,2,0],[0,3,0,0,3,3],[0,2,0,2,3,0],[2,3,0,0,0,0],[3,3,0,3,0,2],[0,0,2,3,3,3],[1,0,2,0,0,0]],"min_steps":13},{"id":"8032","map":[[0,0,0,0,3,4],[0,0,3,3,3,2],[2,2,3,3,0,0],[0,0,3,2,0,0],[0,2,0,2,3,2],[0,2,3,0,0,3],[2,3,3,0,0,2],[1,0,3,0,3,2],[0,0,3,0,0,2]],"min_steps":12},{"id":"8033","map":[[1,0,0,3,0,3],[3,3,2,0,2,0],[0,3,3,2,0,2],[3,2,0,3,0,0],[4,2,2,2,0,0],[0,3,0,0,0,0],[3,3,3,0,0,2],[3,0,3,2,0,3],[2,0,0,0,0,2]],"min_steps":12},{"id":"8034","map":[[1,0,0,3,2,0],[0,2,2,3,3,0],[3,0,0,2,0,3],[2,3,2,2,0,3],[0,0,3,0,0,3],[3,0,0,0,3,0],[2,3,0,3,2,4],[0,3,0,0,0,3],[0,2,0,0,2,2]],"min_steps":16},{"id":"8035","map":[[3,0,0,2,0,4],[3,0,2,3,3,3],[0,0,2,3,0,2],[3,0,3,3,3,0],[2,2,0,0,0,0],[2,2,3,0,0,0],[0,0,2,3,0,0],[0,2,0,3,2,3],[0,0,3,1,2,0]],"min_steps":12},{"id":"8036","map":[[2,3,1,0,0,2],[0,3,0,0,0,0],[2,0,2,0,0,3],[0,0,3,3,0,3],[0,2,2,0,0,3],[0,3,2,3,3,0],[0,3,2,0,0,2],[0,3,2,0,2,3],[2,0,3,3,4,0]],"min_steps":12},{"id":"8037","map":[[2,0,0,0,0,3],[0,2,3,0,2,2],[0,0,3,0,2,0],[0,2,2,0,0,0],[3,2,3,0,0,3],[0,0,3,3,0,3],[3,2,3,0,0,3],[0,0,3,3,2,0],[4,3,1,2,0,2]],"min_steps":12},{"id":"8038","map":[[4,2,3,3,2,3],[0,3,0,2,3,0],[0,0,0,2,0,2],[3,3,2,3,0,0],[0,3,0,3,2,3],[0,2,2,2,0,0],[1,3,0,0,3,0],[2,0,0,0,3,2],[0,0,3,0,0,0]],"min_steps":13},{"id":"8039","map":[[2,0,3,3,2,0],[0,0,0,0,2,3],[1,3,0,0,0,2],[0,2,3,2,2,2],[0,0,3,0,0,0],[0,3,0,0,3,0],[3,0,0,2,3,2],[2,0,3,0,2,3],[0,4,3,0,3,3]],"min_steps":12},{"id":"8040","map":[[0,2,3,3,4,0],[0,2,0,0,3,2],[0,0,3,0,2,0],[3,0,2,0,0,3],[2,0,0,3,0,3],[3,3,0,2,2,0],[2,2,3,0,2,0],[1,3,0,0,2,3],[0,0,0,3,0,3]],"min_steps":12},{"id":"8041","map":[[3,3,0,2,3,1],[0,3,3,2,0,2],[0,2,0,0,0,0],[0,0,0,0,0,0],[3,3,3,2,3,0],[0,3,3,2,3,2],[4,0,3,0,2,0],[2,2,2,0,0,0],[0,3,2,0,3,0]],"min_steps":12}]] + this.LEVEL_INFO = [[{"id":"1001","map":[[0,4,0,0],[0,0,0,0],[0,0,0,0],[0,0,1,0]],"min_steps":3},{"id":"1002","map":[[1,0,0,0],[0,0,0,4],[0,0,0,0],[0,0,0,0]],"min_steps":3},{"id":"1004","map":[[1,0,0,0],[0,0,0,0],[0,0,0,0],[0,4,0,0]],"min_steps":3},{"id":"1006","map":[[4,0,0,0],[0,0,0,0],[0,0,0,0],[0,1,0,0]],"min_steps":3},{"id":"1003","map":[[1,0,0,0],[0,0,0,0],[0,0,0,0],[0,0,0,4]],"min_steps":4},{"id":"1005","map":[[1,0,0,0],[0,0,0,0],[0,0,0,4],[0,0,0,0]],"min_steps":4},{"id":"1007","map":[[0,4,0,0],[0,0,0,0],[0,0,0,0],[0,0,0,1]],"min_steps":4},{"id":"1008","map":[[0,0,0,4],[0,0,0,0],[0,0,0,0],[1,0,0,0]],"min_steps":4}],[{"id":"2001","map":[[0,0,0,0,1],[0,0,0,0,0],[0,0,3,0,3],[0,0,0,0,0],[4,0,0,0,3]],"min_steps":4},{"id":"2002","map":[[0,1,0,0,0],[0,0,0,0,0],[3,3,0,0,4],[0,0,0,0,0],[3,0,0,0,0]],"min_steps":4},{"id":"2009","map":[[0,3,0,0,4],[3,0,0,0,0],[0,0,0,0,0],[1,0,0,0,0],[0,3,0,0,0]],"min_steps":4},{"id":"2010","map":[[0,0,0,0,1],[0,0,0,0,0],[0,0,0,0,0],[0,3,0,3,0],[4,0,3,0,0]],"min_steps":4},{"id":"2011","map":[[4,3,1,0,0],[0,0,0,0,3],[0,0,0,3,0],[0,0,0,0,0],[0,0,0,0,0]],"min_steps":4},{"id":"2021","map":[[0,0,0,1,0],[0,0,3,0,0],[0,0,0,3,3],[0,0,0,0,0],[0,4,0,0,0]],"min_steps":4},{"id":"2004","map":[[1,0,0,0,0],[0,0,0,0,3],[3,0,0,0,0],[0,0,0,0,0],[0,0,0,0,4]],"min_steps":5},{"id":"2012","map":[[0,3,0,4,0],[0,0,0,3,0],[1,0,3,0,0],[0,0,0,0,0],[0,0,0,0,0]],"min_steps":5},{"id":"2013","map":[[0,0,0,0,0],[1,0,0,0,0],[0,0,0,3,3],[3,0,0,0,0],[0,0,0,4,0]],"min_steps":5},{"id":"2014","map":[[3,0,1,0,0],[0,3,0,0,0],[0,0,0,0,0],[4,0,0,3,0],[0,0,0,0,0]],"min_steps":5},{"id":"2015","map":[[3,0,0,0,1],[3,0,0,0,0],[0,0,0,0,0],[4,3,0,0,0],[3,0,0,0,0]],"min_steps":5},{"id":"2016","map":[[0,0,0,0,0],[1,0,3,0,0],[3,0,0,0,3],[0,0,0,0,0],[0,0,0,0,4]],"min_steps":5},{"id":"2017","map":[[0,3,0,0,0],[4,0,0,0,0],[0,0,0,0,0],[3,0,3,0,0],[3,0,0,0,1]],"min_steps":5},{"id":"2018","map":[[0,3,4,3,3],[0,0,0,0,0],[0,0,0,0,0],[0,0,0,0,0],[0,0,3,0,1]],"min_steps":5},{"id":"2019","map":[[3,0,0,4,0],[0,0,0,3,0],[0,0,0,0,0],[0,0,0,0,0],[1,0,3,0,0]],"min_steps":5},{"id":"2020","map":[[4,0,3,0,1],[0,0,0,0,3],[0,0,0,0,0],[0,0,0,0,0],[0,0,3,0,0]],"min_steps":5},{"id":"2003","map":[[1,0,0,3,0],[0,0,3,0,0],[0,0,0,0,0],[0,0,0,0,0],[0,3,0,4,0]],"min_steps":6},{"id":"2005","map":[[0,3,0,0,0],[1,0,0,0,0],[0,0,0,3,0],[0,0,0,0,0],[0,3,0,4,0]],"min_steps":6},{"id":"2006","map":[[0,1,0,0,0],[0,0,0,0,3],[0,0,0,0,3],[0,0,0,0,0],[0,0,0,3,4]],"min_steps":6},{"id":"2007","map":[[3,0,0,0,1],[0,0,0,0,3],[0,0,0,0,0],[0,0,0,0,0],[4,3,0,0,0]],"min_steps":6},{"id":"2008","map":[[3,4,0,0,0],[0,0,0,0,3],[0,0,0,3,1],[0,0,0,0,0],[0,0,0,0,0]],"min_steps":6},{"id":"2022","map":[[0,0,0,0,0],[1,3,0,0,3],[0,0,0,0,0],[0,0,0,0,0],[0,0,3,4,0]],"min_steps":6}],[{"id":"3001","map":[[3,0,2,3,4],[0,0,0,2,2],[2,3,3,3,3],[0,0,2,0,2],[1,0,2,3,0]],"min_steps":5},{"id":"3002","map":[[3,0,3,2,0],[1,2,0,3,2],[2,3,0,0,4],[2,0,2,2,0],[3,3,0,3,0]],"min_steps":5},{"id":"3003","map":[[0,2,3,3,4],[2,2,0,0,0],[1,3,3,3,2],[2,2,3,2,3],[0,0,0,0,0]],"min_steps":5},{"id":"3004","map":[[3,2,2,1,0],[0,0,3,2,2],[3,0,2,3,0],[3,0,0,3,3],[0,2,4,0,2]],"min_steps":5},{"id":"3005","map":[[3,0,3,0,0],[2,3,0,0,1],[0,2,2,2,3],[4,2,0,0,2],[3,3,0,3,2]],"min_steps":5},{"id":"3008","map":[[3,3,3,0,1],[0,0,0,0,3],[2,2,3,2,2],[0,2,3,0,3],[4,2,2,0,0]],"min_steps":5},{"id":"3009","map":[[1,0,3,3,2],[3,0,2,0,0],[0,3,3,2,4],[0,0,3,0,2],[2,2,2,0,3]],"min_steps":5},{"id":"3010","map":[[3,0,2,0,4],[1,2,3,0,3],[2,0,3,2,0],[0,3,0,0,3],[2,0,2,3,2]],"min_steps":5},{"id":"3006","map":[[2,0,2,2,0],[1,2,3,0,0],[3,3,0,3,2],[3,0,0,3,2],[2,0,3,0,4]],"min_steps":6},{"id":"3007","map":[[1,2,0,3,3],[2,2,0,2,0],[2,3,2,0,3],[0,3,2,0,4],[0,0,3,0,3]],"min_steps":6},{"id":"3011","map":[[2,3,0,1,0],[0,0,0,0,0],[3,0,0,0,3],[0,2,0,3,2],[4,3,3,2,2]],"min_steps":6},{"id":"3012","map":[[0,2,1,0,3],[0,3,0,0,3],[3,2,3,2,0],[0,2,0,3,0],[2,0,0,0,4]],"min_steps":6},{"id":"3013","map":[[0,2,1,0,3],[0,3,0,0,3],[3,2,3,2,0],[0,2,0,3,0],[2,0,0,0,4]],"min_steps":6},{"id":"3014","map":[[1,0,3,3,4],[2,3,0,3,0],[0,2,2,0,0],[3,3,0,0,2],[2,0,0,0,0]],"min_steps":6},{"id":"3015","map":[[2,3,0,0,0],[0,0,2,3,0],[4,0,3,0,3],[2,0,2,2,3],[0,3,0,0,1]],"min_steps":6},{"id":"3016","map":[[3,0,2,0,2],[2,0,0,0,3],[0,2,3,0,1],[4,0,0,3,0],[3,3,0,0,2]],"min_steps":6},{"id":"3017","map":[[0,3,0,0,2],[3,0,2,0,4],[1,3,3,0,0],[2,0,0,2,0],[3,2,3,0,0]],"min_steps":6},{"id":"3018","map":[[4,2,0,0,0],[0,0,0,3,2],[0,3,0,0,3],[3,2,3,2,0],[3,0,2,1,0]],"min_steps":7},{"id":"3019","map":[[0,4,0,3,2],[0,2,0,0,0],[3,0,3,0,2],[3,3,2,3,1],[2,0,0,0,0]],"min_steps":7},{"id":"3020","map":[[0,2,0,1,0],[0,0,0,3,2],[3,0,3,3,3],[3,0,0,0,2],[0,2,2,4,0]],"min_steps":7},{"id":"3021","map":[[3,2,0,2,1],[3,2,0,3,2],[3,0,0,2,3],[0,0,0,0,4],[0,0,3,0,0]],"min_steps":7},{"id":"3022","map":[[2,0,2,2,2],[0,0,3,0,0],[3,0,3,0,0],[1,0,3,2,4],[0,0,3,3,0]],"min_steps":7},{"id":"3023","map":[[1,2,0,2,0],[3,3,3,0,0],[0,2,3,2,0],[4,0,0,0,3],[0,0,2,0,3]],"min_steps":7},{"id":"3024","map":[[1,0,3,0,3],[2,2,0,0,0],[0,3,0,3,0],[2,0,3,2,0],[2,3,0,4,0]],"min_steps":7}],[{"id":"4001","map":[[1,3,0,0,2,0],[0,3,0,0,2,0],[0,0,2,0,3,4],[0,0,0,2,0,0],[3,3,0,0,2,0,3],[0,0,2,2,2,0]],"min_steps":5},{"id":"4002","map":[[0,2,2,2,2,0],[1,0,0,0,2,0],[0,0,0,0,0,3],[0,0,0,0,2,0],[0,3,3,0,2,0],[3,0,0,4,2,0]],"min_steps":5},{"id":"4003","map":[[0,0,0,0,0,0],[2,0,0,0,0,2],[0,3,3,3,2,4],[0,3,0,3,2,0],[0,0,0,0,0,3],[0,0,2,3,0,1]],"min_steps":6},{"id":"4004","map":[[2,0,3,0,0,4],[0,2,3,3,0,0],[0,3,0,0,0,0],[3,0,0,0,2,2],[3,0,0,2,0,0],[1,0,0,3,0,0]],"min_steps":6},{"id":"4006","map":[[4,3,0,3,0,0],[0,2,0,3,0,0],[3,0,0,0,3,2],[0,3,0,0,2,1],[0,0,2,0,0,0],[0,0,0,0,2,3]],"min_steps":7},{"id":"4007","map":[[4,2,2,0,2,0],[0,3,0,2,0,0],[0,2,3,0,3,0],[0,0,3,0,0,3],[0,0,3,0,0,0],[0,0,0,3,0,1]],"min_steps":7},{"id":"4014","map":[[0,0,3,0,2,2],[0,2,3,0,0,1],[0,3,3,0,0,3],[0,2,0,0,0,0],[0,0,0,3,3,0],[2,0,4,0,0,0]],"min_steps":7},{"id":"4015","map":[[2,0,0,0,0,0],[0,0,0,0,3,1],[3,0,2,0,0,3],[2,0,0,2,3,0],[3,0,3,0,0,0],[2,0,0,3,4,0]],"min_steps":7},{"id":"4005","map":[[1,0,0,0,0,2],[0,0,0,2,0,0],[3,2,0,0,0,0],[0,3,0,0,2,3],[0,0,3,3,0,0],[3,0,0,2,3,4]],"min_steps":8},{"id":"4008","map":[[0,0,2,3,0,0],[0,3,0,2,3,2],[3,0,0,0,0,0],[0,3,0,0,3,4],[0,0,0,0,0,3],[0,2,0,2,0,1]],"min_steps":8},{"id":"4009","map":[[0,3,3,0,0,4],[2,0,0,3,0,0],[2,0,0,3,0,0],[1,0,0,0,3,0],[0,0,2,3,0,2],[2,3,0,0,0,0]],"min_steps":8},{"id":"4010","map":[[0,0,1,3,2,0],[3,0,0,0,3,2],[3,0,0,0,0,3],[2,0,0,0,0,0],[0,2,0,0,3,0],[0,2,0,3,4,0]],"min_steps":8},{"id":"4011","map":[[1,0,0,0,0,0],[3,3,0,0,0,2],[0,0,0,3,0,2],[2,0,3,0,3,0],[2,0,3,0,0,3],[4,0,0,0,0,2]],"min_steps":8},{"id":"4016","map":[[0,0,3,0,0,1],[2,3,0,0,3,0],[2,0,0,0,0,2],[0,3,0,0,0,0],[0,3,0,0,2,0],[0,4,3,0,2,3]],"min_steps":8},{"id":"4017","map":[[1,2,3,0,3,2],[3,0,0,0,0,0],[0,0,0,0,0,3],[3,3,0,3,2,0],[0,2,0,0,0,0],[4,0,0,2,0,0]],"min_steps":8},{"id":"4018","map":[[0,0,1,0,2,0],[0,0,0,0,0,0],[0,0,3,2,3,0],[3,0,0,3,0,0],[2,3,0,2,0,0],[4,2,0,3,3,0]],"min_steps":8},{"id":"4012","map":[[2,2,3,0,2,0],[0,3,0,0,0,0],[0,0,0,0,3,4],[0,2,0,3,0,3],[0,0,0,0,0,0],[0,0,2,3,3,1]],"min_steps":9},{"id":"4013","map":[[0,0,0,0,3,0],[4,2,0,3,0,0],[3,2,0,0,0,0],[1,3,0,3,0,0],[2,0,0,2,0,0],[3,0,0,3,2,0]],"min_steps":9},{"id":"4019","map":[[3,4,0,0,0,2],[3,2,0,0,2,0],[0,3,0,3,0,2],[0,0,3,0,0,0],[0,0,0,0,3,0],[1,3,0,0,0,2]],"min_steps":9},{"id":"4020","map":[[0,2,0,1,0,0],[2,3,0,0,2,0],[3,0,0,0,0,0],[0,3,3,0,0,3],[2,0,0,3,0,0],[4,3,0,0,0,2]],"min_steps":9}],[{"id":"5001","map":[[1,0,0,0,0,0],[0,2,2,3,0,2],[3,2,0,0,3,3],[0,0,0,0,0,4],[0,0,0,2,2,0],[3,0,2,2,0,0]],"min_steps":7},{"id":"5002","map":[[0,0,0,0,4,3],[3,2,3,0,0,0],[0,2,0,2,3,0],[2,2,0,0,0,0],[3,2,0,0,0,0],[3,0,0,2,0,3],[2,0,0,3,0,1]],"min_steps":7},{"id":"5015","map":[[1,2,3,2,2,0],[3,0,0,0,0,3],[0,0,0,0,0,0],[0,0,0,0,0,2],[0,3,0,3,2,0],[0,0,0,0,0,0],[0,2,0,4,0,3]],"min_steps":7},{"id":"5016","map":[[3,0,1,0,0,0],[0,2,0,2,0,0],[0,2,0,2,0,3],[0,0,0,0,0,0],[0,2,0,0,3,3],[0,0,0,0,2,3],[0,0,0,3,0,4]],"min_steps":7},{"id":"5004","map":[[0,3,3,2,3,0],[2,0,2,0,3,0],[1,0,3,2,0,0],[3,3,0,0,0,2],[0,0,0,0,0,0],[0,2,0,0,0,0],[0,0,0,3,4,0]],"min_steps":8},{"id":"5005","map":[[0,0,0,0,0,1],[0,0,2,0,2,0],[3,2,2,0,0,0],[3,0,0,3,0,0],[3,3,0,0,0,3],[4,3,0,0,0,0],[2,0,0,2,3,0]],"min_steps":8},{"id":"5008","map":[[3,0,3,2,0,4],[0,3,0,2,0,2],[0,0,3,0,0,0],[2,0,0,2,0,0],[0,0,3,0,0,0],[0,0,0,3,0,0],[3,2,1,3,0,0]],"min_steps":8},{"id":"5012","map":[[2,3,0,2,0,1],[2,0,0,0,0,0],[2,0,0,3,0,2],[3,0,3,0,0,3],[0,0,0,0,3,3],[3,0,0,0,2,0],[0,0,0,0,0,4]],"min_steps":8},{"id":"5013","map":[[0,0,2,1,2,0],[0,3,0,0,0,0],[2,0,0,0,0,0],[0,0,0,3,0,0],[3,0,0,2,3,0],[3,3,3,2,0,2],[0,0,4,0,0,3]],"min_steps":8},{"id":"5018","map":[[0,2,0,1,0,0],[2,0,0,3,0,0],[0,0,0,0,0,0],[3,0,0,0,0,0],[2,3,0,2,3,3],[2,0,0,0,0,2],[4,3,0,0,0,0]],"min_steps":8},{"id":"5019","map":[[1,3,0,2,3,0],[0,0,0,0,0,2],[0,0,0,0,0,0],[0,0,2,0,0,2],[3,3,0,3,0,2],[4,0,2,0,0,0],[0,0,0,3,0,0]],"min_steps":8},{"id":"5029","map":[[4,3,0,0,0,0],[2,0,0,3,0,2],[3,2,0,3,3,0],[2,0,0,3,0,0],[0,2,0,0,0,0],[2,0,0,0,0,0],[3,0,3,3,0,1]],"min_steps":8},{"id":"5030","map":[[0,0,0,0,0,0],[0,0,2,3,2,0],[0,3,0,0,0,0],[2,2,0,3,0,0],[0,3,3,0,3,4],[0,0,2,0,0,3],[3,1,0,3,0,2]],"min_steps":8},{"id":"5006","map":[[0,3,0,0,0,0],[1,0,0,0,3,0],[0,0,3,2,0,0],[3,0,0,2,2,0],[0,3,0,3,3,0],[0,2,0,0,0,0],[4,0,3,0,2,2]],"min_steps":9},{"id":"5007","map":[[0,2,0,3,0,0],[1,2,0,2,0,0],[0,3,0,3,0,0],[3,0,0,0,0,3],[0,0,3,2,0,2],[4,0,0,3,0,3],[0,2,0,0,0,0]],"min_steps":9},{"id":"5010","map":[[0,3,1,0,0,0],[0,2,3,3,0,0],[0,2,0,3,0,0],[0,2,0,2,0,3],[0,2,0,0,3,0],[0,3,0,0,0,0],[0,2,4,0,0,3]],"min_steps":9},{"id":"5011","map":[[1,0,3,0,3,0],[0,2,0,0,0,0],[2,0,2,0,3,0],[0,3,2,0,0,0],[3,0,0,0,0,2],[4,0,3,0,0,0],[3,2,0,0,0,3]],"min_steps":9},{"id":"5014","map":[[0,1,0,0,0,0],[2,0,2,0,0,2],[2,3,0,3,0,0],[0,3,0,0,0,3],[0,0,0,2,0,3],[0,0,3,0,3,0],[2,0,3,0,0,4]],"min_steps":9},{"id":"5017","map":[[0,0,0,0,0,0],[1,2,3,0,0,2],[0,0,2,0,0,2],[3,0,2,3,0,0],[0,3,3,0,2,0],[0,0,0,0,0,0],[4,0,3,0,0,0]],"min_steps":9},{"id":"5028","map":[[0,0,1,0,0,3],[3,0,0,0,3,4],[0,2,0,2,3,2],[0,3,2,3,3,0],[0,0,0,3,0,0],[0,0,3,0,0,2],[0,0,2,0,0,0]],"min_steps":9},{"id":"5003","map":[[0,0,1,3,0,2],[0,3,3,0,0,0],[0,0,3,2,0,0],[0,0,3,0,0,0],[3,0,0,0,2,2],[0,0,2,3,0,0],[0,2,0,3,0,4]],"min_steps":10},{"id":"5009","map":[[0,2,0,0,0,3],[0,0,3,3,3,4],[0,3,0,0,0,0],[0,3,2,0,0,0],[1,2,3,2,0,3],[2,0,0,0,0,0],[0,0,0,0,2,0]],"min_steps":10},{"id":"5021","map":[[0,0,0,0,0,0],[0,0,0,0,3,0],[3,0,0,0,2,0],[2,0,0,2,3,0],[0,3,0,0,0,2],[0,2,3,0,0,0],[4,3,1,2,0,0]],"min_steps":10},{"id":"5022","map":[[4,0,3,0,0,2],[0,0,0,0,2,0],[0,3,0,2,3,2],[3,0,3,0,3,0],[0,2,0,0,0,0],[0,3,0,3,0,3],[0,2,1,0,0,0]],"min_steps":10},{"id":"5023","map":[[3,0,0,3,3,0],[0,0,3,0,0,3],[2,3,0,0,0,0],[2,2,0,0,2,0],[0,3,0,0,0,0],[2,0,3,0,0,4],[0,1,3,0,2,0]],"min_steps":10},{"id":"5024","map":[[3,0,2,3,0,0],[4,2,0,0,0,3],[2,2,0,0,0,0],[0,0,3,0,0,2],[0,0,0,3,0,3],[0,3,3,0,2,0],[3,0,1,0,0,0]],"min_steps":10},{"id":"5020","map":[[0,0,0,2,0,0],[0,3,0,0,0,3],[0,2,0,0,3,0],[2,0,0,2,3,4],[0,2,3,0,0,0],[0,0,0,3,0,0],[3,2,0,1,3,0]],"min_steps":11},{"id":"5025","map":[[1,0,0,0,3,0],[0,0,0,3,3,2],[3,3,2,0,0,2],[0,0,0,0,0,3],[0,0,2,0,2,0],[0,0,0,0,3,4],[0,3,2,3,0,0]],"min_steps":11},{"id":"5026","map":[[0,3,2,0,0,0],[0,0,2,3,3,0],[2,0,0,2,0,0],[3,2,0,0,3,2],[0,0,0,3,3,1],[0,0,3,0,0,3],[0,0,0,0,0,4]],"min_steps":11},{"id":"5027","map":[[0,0,3,0,0,1],[0,0,0,0,0,3],[2,0,2,0,2,3],[0,0,3,3,0,3],[0,0,0,2,3,0],[0,0,0,2,0,3],[2,0,3,0,4,0]],"min_steps":11}],[{"id":"6028","map":[[0,0,3,0,0,2],[1,3,2,2,0,3],[0,0,3,0,0,2],[0,0,0,0,0,0],[0,0,2,0,3,3],[3,3,3,0,0,0],[4,0,0,0,0,2]],"min_steps":8},{"id":"6029","map":[[0,0,2,0,0,1],[3,2,3,0,0,3],[2,0,3,0,3,0],[3,3,0,0,0,0],[0,0,0,3,3,2],[0,0,0,0,0,2],[0,0,0,4,2,0]],"min_steps":8},{"id":"6030","map":[[0,3,3,0,1,0],[2,3,0,0,3,0],[0,0,0,3,0,2],[0,0,3,0,2,0],[0,0,2,3,3,3],[0,0,0,0,0,0],[4,0,0,2,0,2]],"min_steps":8},{"id":"6001","map":[[0,0,3,3,4,2],[0,0,0,2,0,0],[2,3,3,2,0,0],[0,3,0,0,0,2],[0,0,0,3,2,2],[2,0,0,3,0,2],[1,3,2,0,0,0],[0,0,0,3,0,0]],"min_steps":9},{"id":"6012","map":[[3,0,0,0,2,0],[0,3,0,3,0,0],[0,3,0,0,0,3],[2,0,0,3,2,0],[3,2,2,2,0,0],[3,0,2,0,3,0],[1,2,3,0,2,0],[2,3,0,0,3,4]],"min_steps":9},{"id":"6016","map":[[0,0,1,0,2,3],[0,3,2,0,2,0],[3,3,3,3,0,0],[3,0,0,0,0,0],[2,2,3,0,3,3],[0,0,2,0,2,0],[0,2,0,2,0,3],[3,0,2,0,0,4]],"min_steps":9},{"id":"6008","map":[[0,0,2,0,3,4],[3,3,2,3,0,0],[0,0,0,0,0,3],[0,0,2,3,2,0],[0,0,2,0,3,2],[3,3,0,0,0,2],[0,3,0,0,0,0],[2,1,0,0,0,0]],"min_steps":10},{"id":"6013","map":[[3,0,0,2,2,0],[0,2,0,3,0,2],[0,0,3,2,3,0],[0,3,0,0,3,0],[2,2,3,2,0,0],[0,0,3,3,0,0],[0,2,0,3,2,0],[4,3,3,0,1,0]],"min_steps":10},{"id":"6017","map":[[4,0,0,0,0,3],[0,3,3,0,0,0],[3,0,2,2,0,0],[3,0,2,3,3,2],[3,2,0,2,3,3],[2,0,2,0,0,0],[0,0,0,0,0,3],[2,3,0,2,0,1]],"min_steps":10},{"id":"6022","map":[[0,0,3,4,3,0],[0,3,0,2,2,0],[2,0,2,0,0,3],[0,0,0,0,0,0],[2,3,0,3,2,0],[0,3,0,0,0,0],[0,1,3,0,0,3]],"min_steps":10},{"id":"6023","map":[[0,0,3,1,0,2],[0,0,2,3,0,0],[4,0,3,0,0,0],[2,0,3,0,0,3],[2,0,3,0,3,0],[0,0,0,0,0,0],[2,3,0,2,3,0]],"min_steps":10},{"id":"6024","map":[[0,3,0,2,0,4],[3,0,0,3,3,3],[0,0,2,0,0,0],[2,3,3,0,0,0],[2,0,0,0,0,3],[2,0,3,0,0,1],[0,0,0,0,0,2]],"min_steps":10},{"id":"6025","map":[[4,0,2,0,0,0],[0,0,3,3,0,2],[3,3,0,0,0,3],[0,2,0,2,0,0],[0,0,0,0,3,0],[1,3,0,0,2,2],[0,3,0,0,0,3]],"min_steps":10},{"id":"6002","map":[[0,0,3,3,4,2],[0,0,0,2,0,0],[2,3,3,2,0,0],[0,3,0,0,0,2],[0,0,0,3,2,2],[2,0,0,3,0,2],[1,3,2,0,0,0],[0,0,0,3,0,0]],"min_steps":11},{"id":"6006","map":[[1,0,2,0,0,3],[0,0,0,0,3,0],[3,0,0,3,2,0],[2,3,0,0,0,3],[0,0,3,2,0,3],[0,2,0,3,0,0],[2,3,0,2,0,0],[0,4,0,2,0,0]],"min_steps":11},{"id":"6009","map":[[4,3,0,0,3,0],[0,0,0,0,0,0],[3,3,0,2,0,2],[3,0,0,2,2,0],[2,3,2,0,0,0],[1,3,3,0,0,0],[2,0,0,0,0,0],[3,3,0,0,0,2]],"min_steps":11},{"id":"6018","map":[[2,3,0,0,2,3],[2,0,0,3,0,4],[2,0,0,0,0,0],[0,3,2,0,2,3],[0,0,0,0,0,3],[2,0,3,3,2,3],[0,0,0,3,2,0],[2,3,1,3,0,0]],"min_steps":11},{"id":"6026","map":[[0,1,0,3,0,4],[0,0,3,0,3,0],[2,2,3,2,0,0],[0,0,3,0,3,3],[2,0,0,0,0,2],[0,3,0,0,0,2],[0,0,0,0,0,3]],"min_steps":11},{"id":"6027","map":[[2,1,3,0,0,0],[0,0,0,0,3,0],[3,3,0,0,0,0],[2,2,3,3,3,0],[0,2,0,0,0,0],[3,2,0,0,0,0],[0,4,0,2,3,0]],"min_steps":11},{"id":"6031","map":[[0,1,0,3,0,4],[0,0,3,0,3,0],[2,2,3,2,0,0],[0,0,3,0,3,3],[2,0,0,0,0,2],[0,3,0,0,0,2],[0,0,0,0,0,3]],"min_steps":11},{"id":"6003","map":[[0,2,2,0,0,4],[0,3,3,0,0,0],[3,2,0,0,0,0],[0,3,0,0,3,3],[0,2,0,3,0,0],[2,3,0,0,0,0],[0,2,3,0,0,0],[1,2,3,0,2,0]],"min_steps":12},{"id":"6011","map":[[3,0,2,2,3,2],[1,0,0,0,0,3],[0,0,3,2,3,0],[3,0,3,0,0,0],[4,3,2,3,0,2],[0,0,2,0,2,3],[2,0,0,0,0,3],[0,0,0,2,0,3]],"min_steps":12},{"id":"6014","map":[[4,3,0,0,0,0],[0,2,2,2,3,0],[0,3,0,0,0,0],[2,3,2,3,0,0],[3,3,0,0,0,3],[0,0,0,2,3,0],[0,3,2,0,2,2],[2,3,3,0,0,1]],"min_steps":12},{"id":"6020","map":[[3,2,0,0,0,0],[4,0,2,0,2,0],[3,3,0,0,2,2],[0,0,3,0,2,0],[0,0,0,0,2,3],[0,2,3,3,0,0],[2,3,0,0,3,3],[1,3,3,2,0,0]],"min_steps":12},{"id":"6021","map":[[4,3,0,0,0,0],[0,2,2,2,3,0],[0,3,0,0,0,0],[2,3,2,3,0,0],[3,3,0,0,0,3],[0,0,0,2,3,0],[0,3,2,0,2,2],[2,3,3,0,0,1]],"min_steps":12},{"id":"6004","map":[[0,3,0,2,2,0],[0,0,0,0,0,2],[3,0,0,0,0,0],[0,3,0,0,0,0],[0,3,3,0,3,0],[2,0,0,0,3,2],[2,0,0,0,3,1],[4,3,0,2,3,2]],"min_steps":13},{"id":"6005","map":[[2,2,4,2,3,0],[0,3,3,2,0,0],[3,0,0,3,0,2],[3,0,2,3,3,0],[0,0,0,0,0,0],[0,0,0,0,2,3],[3,2,0,0,0,1],[0,0,0,0,0,0]],"min_steps":13},{"id":"6007","map":[[3,2,0,0,3,4],[0,2,0,0,3,0],[0,0,2,0,2,0],[2,0,0,3,0,3],[0,0,2,0,3,2],[0,2,3,3,0,1],[0,0,0,0,0,3],[0,0,0,3,0,0]],"min_steps":13},{"id":"6010","map":[[0,3,1,0,0,0],[0,2,3,3,0,0],[2,0,0,3,0,0],[0,2,0,0,3,2],[3,0,0,0,0,2],[3,2,0,0,0,0],[4,0,0,3,2,0],[0,3,0,3,2,0]],"min_steps":13},{"id":"6015","map":[[4,0,0,0,2,3],[0,0,3,0,0,3],[2,2,3,2,0,0],[3,0,0,0,3,2],[2,3,0,3,0,2],[0,0,3,0,2,3],[0,0,0,0,0,3],[1,2,2,3,0,0]],"min_steps":14},{"id":"6019","map":[[4,0,0,0,2,3],[0,0,3,0,0,3],[2,2,3,2,0,0],[3,0,0,0,3,2],[2,3,0,3,0,2],[0,0,3,0,2,3],[0,0,0,0,0,3],[1,2,2,3,0,0]],"min_steps":14}],[{"id":"7001","map":[[0,2,0,0,2,0],[3,3,0,2,0,4],[0,0,0,0,0,3],[0,0,0,0,3,2],[0,0,0,0,0,2],[3,3,0,0,0,2],[0,3,3,2,2,0],[0,3,2,2,0,3],[1,2,0,0,2,0]],"min_steps":9},{"id":"7023","map":[[3,2,0,2,0,1],[0,3,3,2,3,3],[0,3,3,0,3,0],[0,2,2,2,0,3],[0,3,2,0,0,3],[0,0,0,0,2,0],[2,2,2,3,0,0],[2,0,3,0,3,0],[0,0,3,0,0,4]],"min_steps":9},{"id":"7003","map":[[1,3,2,0,0,0],[0,0,0,2,0,0],[0,3,0,2,0,0],[3,3,3,2,0,3],[2,3,3,0,3,0],[0,0,0,0,0,2],[3,0,2,2,3,2],[4,2,0,0,2,0],[0,0,2,0,0,2]],"min_steps":10},{"id":"7002","map":[[1,0,3,2,0,2],[0,3,0,0,0,2],[0,2,0,3,2,2],[0,3,0,0,0,0],[0,2,0,3,3,0],[3,2,2,0,0,3],[0,3,2,3,0,2],[0,0,0,0,0,0],[2,0,0,2,3,4]],"min_steps":11},{"id":"7005","map":[[0,0,0,0,0,0],[0,0,0,3,2,4],[0,3,0,0,3,3],[3,3,0,2,0,3],[0,2,2,0,3,2],[0,0,3,0,2,0],[0,2,0,2,0,0],[3,0,0,2,2,0],[0,0,2,2,0,1]],"min_steps":11},{"id":"7006","map":[[0,0,0,0,2,3],[3,2,0,0,0,0],[0,2,0,3,3,4],[0,0,0,2,2,3],[2,0,0,0,0,0],[0,0,0,0,3,0],[3,0,3,3,0,2],[3,0,2,2,0,2],[0,0,2,2,0,1]],"min_steps":11},{"id":"7007","map":[[2,0,2,0,2,0],[0,0,2,0,3,2],[0,0,0,3,3,0],[0,2,0,0,3,2],[3,0,0,2,0,0],[3,3,0,0,0,2],[0,2,0,3,2,0],[0,2,3,0,0,0],[4,3,0,0,1,0]],"min_steps":11},{"id":"7026","map":[[2,4,2,0,0,0],[0,3,3,0,3,0],[3,3,3,0,0,3],[2,0,3,0,0,2],[0,2,2,3,0,3],[1,0,2,0,2,0],[3,3,0,0,0,0],[2,0,0,0,3,2],[2,0,3,2,3,0]],"min_steps":11},{"id":"7027","map":[[2,0,0,0,0,2],[0,0,3,3,2,3],[0,0,3,0,0,1],[0,3,0,3,3,3],[0,0,0,0,0,2],[3,3,2,0,0,2],[3,3,0,2,0,3],[0,3,2,2,2,0],[0,3,4,2,2,0]],"min_steps":11},{"id":"7029","map":[[0,0,1,0,0,0],[3,3,0,0,3,2],[3,0,0,0,2,0],[0,2,0,2,2,0],[2,3,3,3,0,3],[3,2,2,3,0,0],[2,0,3,0,0,3],[3,2,0,0,0,3],[4,2,0,0,3,2]],"min_steps":11},{"id":"7008","map":[[1,0,0,0,2,0],[3,3,2,0,3,0],[3,0,3,0,0,0],[0,0,3,0,0,3],[2,2,0,3,0,3],[2,0,2,0,0,0],[2,0,2,0,0,2],[2,0,0,2,0,0],[4,3,0,0,0,2]],"min_steps":12},{"id":"7010","map":[[4,3,0,3,1,0],[0,0,3,3,0,0],[0,3,0,0,2,2],[2,0,3,0,0,2],[3,2,0,2,3,0],[0,0,0,0,0,0],[0,2,0,2,2,0],[0,2,0,3,0,2],[0,2,0,0,0,3]],"min_steps":12},{"id":"7016","map":[[2,3,4,0,0,3],[0,3,2,2,3,1],[0,2,2,3,0,0],[3,0,3,0,2,0],[3,0,0,0,2,2],[0,0,3,3,0,0],[0,3,0,3,2,0],[0,0,3,0,3,2],[0,2,2,3,0,0]],"min_steps":12},{"id":"7020","map":[[2,3,0,4,3,3],[3,3,0,0,3,0],[0,2,0,3,2,0],[0,3,0,0,0,2],[3,2,0,0,0,0],[0,0,3,2,0,3],[0,3,0,3,2,0],[3,2,2,0,0,2],[0,0,2,1,3,2]],"min_steps":12},{"id":"7024","map":[[1,3,2,0,0,3],[2,3,2,0,0,0],[0,2,3,0,3,3],[3,0,0,2,0,3],[2,3,0,0,0,3],[3,3,0,0,0,0],[2,0,3,0,0,2],[0,0,2,0,2,2],[4,2,3,0,3,0]],"min_steps":12},{"id":"7032","map":[[0,0,0,0,3,4],[0,0,3,3,3,2],[2,2,3,3,0,0],[0,0,3,2,0,0],[0,2,0,2,3,2],[0,2,3,0,0,3],[2,3,3,0,0,2],[1,0,3,0,3,2],[0,0,3,0,0,2]],"min_steps":12},{"id":"7033","map":[[1,0,0,3,0,3],[3,3,2,0,2,0],[0,3,3,2,0,2],[3,2,0,3,0,0],[4,2,2,2,0,0],[0,3,0,0,0,0],[3,3,3,0,0,2],[3,0,3,2,0,3],[2,0,0,0,0,2]],"min_steps":12},{"id":"7035","map":[[3,0,0,2,0,4],[3,0,2,3,3,3],[0,0,2,3,0,2],[3,0,3,3,3,0],[2,2,0,0,0,0],[2,2,3,0,0,0],[0,0,2,3,0,0],[0,2,0,3,2,3],[0,0,3,1,2,0]],"min_steps":12},{"id":"7036","map":[[2,3,1,0,0,2],[0,3,0,0,0,0],[2,0,2,0,0,3],[0,0,3,3,0,3],[0,2,2,0,0,3],[0,3,2,3,3,0],[0,3,2,0,0,2],[0,3,2,0,2,3],[2,0,3,3,4,0]],"min_steps":12},{"id":"7037","map":[[2,0,0,0,0,3],[0,2,3,0,2,2],[0,0,3,0,2,0],[0,2,2,0,0,0],[3,2,3,0,0,3],[0,0,3,3,0,3],[3,2,3,0,0,3],[0,0,3,3,2,0],[4,3,1,2,0,2]],"min_steps":12},{"id":"7039","map":[[2,0,3,3,2,0],[0,0,0,0,2,3],[1,3,0,0,0,2],[0,2,3,2,2,2],[0,0,3,0,0,0],[0,3,0,0,3,0],[3,0,0,2,3,2],[2,0,3,0,2,3],[0,4,3,0,3,3]],"min_steps":12},{"id":"7040","map":[[0,2,3,3,4,0],[0,2,0,0,3,2],[0,0,3,0,2,0],[3,0,2,0,0,3],[2,0,0,3,0,3],[3,3,0,2,2,0],[2,2,3,0,2,0],[1,3,0,0,2,3],[0,0,0,3,0,3]],"min_steps":12},{"id":"7041","map":[[3,3,0,2,3,1],[0,3,3,2,0,2],[0,2,0,0,0,0],[0,0,0,0,0,0],[3,3,3,2,3,0],[0,3,3,2,3,2],[4,0,3,0,2,0],[2,2,2,0,0,0],[0,3,2,0,3,0]],"min_steps":12},{"id":"7004","map":[[2,0,0,2,0,0],[0,3,0,0,0,1],[0,2,0,0,0,0],[0,0,0,0,2,0],[0,0,3,3,3,2],[0,0,0,3,2,3],[0,0,2,0,0,3],[0,2,3,2,2,4],[3,2,2,0,3,0]],"min_steps":13},{"id":"7009","map":[[4,0,3,1,0,2],[0,2,3,3,3,0],[0,2,3,2,2,0],[3,0,3,0,0,2],[0,0,0,0,0,0],[3,2,0,0,2,0],[3,2,0,0,2,0],[0,0,2,2,2,0],[0,0,0,0,3,0]],"min_steps":13},{"id":"7014","map":[[3,4,2,3,0,0],[2,3,0,3,0,0],[0,2,2,0,0,0],[0,3,3,0,3,3],[0,0,0,0,0,0],[3,2,0,0,2,2],[2,2,2,2,0,3],[0,0,3,3,0,3],[1,2,0,3,3,0]],"min_steps":13},{"id":"7015","map":[[2,3,4,0,3,0],[1,2,3,2,3,0],[0,0,3,0,2,0],[2,0,0,3,0,0],[2,2,0,2,0,3],[0,0,2,0,0,0],[3,0,0,3,3,0],[0,0,3,0,2,3],[3,0,3,2,3,2]],"min_steps":13},{"id":"7025","map":[[2,3,1,0,3,3],[0,0,2,3,2,0],[0,2,0,0,0,3],[0,3,0,0,0,3],[2,0,0,3,2,0],[0,0,2,3,0,2],[2,0,3,2,0,3],[3,3,0,0,3,3],[2,4,0,2,0,0]],"min_steps":13},{"id":"7030","map":[[2,0,1,2,0,0],[0,2,3,3,0,2],[2,3,3,3,0,2],[3,0,0,2,2,0],[0,3,0,3,2,0],[0,0,2,0,2,3],[3,3,0,3,3,2],[4,3,0,0,0,0],[0,0,0,0,0,3]],"min_steps":13},{"id":"7031","map":[[0,2,2,3,4,2],[3,3,0,0,2,2],[0,0,0,3,2,0],[0,3,0,0,3,3],[0,2,0,2,3,0],[2,3,0,0,0,0],[3,3,0,3,0,2],[0,0,2,3,3,3],[1,0,2,0,0,0]],"min_steps":13},{"id":"7038","map":[[4,2,3,3,2,3],[0,3,0,2,3,0],[0,0,0,2,0,2],[3,3,2,3,0,0],[0,3,0,3,2,3],[0,2,2,2,0,0],[1,3,0,0,3,0],[2,0,0,0,3,2],[0,0,3,0,0,0]],"min_steps":13},{"id":"7011","map":[[0,1,0,0,2,0],[3,0,3,3,2,3],[0,3,3,2,0,0],[0,0,2,0,3,3],[2,3,2,0,0,0],[3,2,2,3,3,0],[2,0,2,2,0,4],[0,2,0,3,0,0],[0,0,0,3,0,3]],"min_steps":14},{"id":"7017","map":[[2,0,0,3,0,3],[4,3,0,2,0,3],[3,0,0,0,3,0],[2,0,0,2,0,0],[3,0,0,3,0,0],[2,3,0,2,2,2],[1,3,3,0,2,2],[0,3,0,0,3,0],[0,2,0,3,3,2]],"min_steps":14},{"id":"7019","map":[[0,3,0,2,3,1],[0,3,0,2,0,2],[0,2,2,0,3,3],[0,0,3,2,0,3],[0,0,3,2,2,0],[2,2,3,0,2,2],[0,3,0,0,3,0],[3,0,0,3,3,0],[0,0,0,3,0,4]],"min_steps":14},{"id":"7021","map":[[0,0,0,0,2,4],[3,0,2,0,0,0],[3,0,2,3,3,3],[2,0,3,3,3,0],[2,0,0,0,2,3],[3,3,0,0,0,2],[1,0,3,0,2,2],[2,2,0,2,0,0],[0,0,3,3,0,3]],"min_steps":14},{"id":"7022","map":[[4,0,0,0,0,0],[0,0,0,0,3,2],[3,3,2,3,3,2],[2,0,0,0,0,2],[0,0,3,0,3,3],[2,0,2,3,2,1],[3,2,3,0,0,3],[2,0,0,3,2,2],[3,3,0,0,0,0]],"min_steps":15},{"id":"7028","map":[[0,2,1,3,0,2],[0,3,3,3,0,2],[0,0,0,3,0,2],[3,0,0,3,2,4],[2,0,0,3,2,2],[2,2,3,0,0,3],[0,2,0,0,0,0],[0,3,3,3,2,0],[0,3,0,3,0,0]],"min_steps":16},{"id":"7034","map":[[1,0,0,3,2,0],[0,2,2,3,3,0],[3,0,0,2,0,3],[2,3,2,2,0,3],[0,0,3,0,0,3],[3,0,0,0,3,0],[2,3,0,3,2,4],[0,3,0,0,0,3],[0,2,0,0,2,2]],"min_steps":16},{"id":"7012","map":[[1,3,3,3,0,0],[0,3,0,2,0,0],[0,0,0,3,0,2],[3,0,0,3,2,3],[0,0,2,0,0,3],[0,0,2,3,2,0],[2,2,3,2,3,2],[0,3,0,2,0,2],[0,3,4,3,0,0]],"min_steps":17},{"id":"7013","map":[[0,1,0,0,3,3],[0,2,0,3,0,0],[2,3,0,0,0,0],[0,0,0,3,0,3],[0,3,0,2,3,2],[2,0,3,3,2,0],[0,2,2,3,0,2],[2,3,2,0,3,0],[0,3,3,0,2,4]],"min_steps":17},{"id":"7018","map":[[0,0,0,0,0,2],[1,0,3,3,0,2],[3,3,0,3,2,3],[0,3,0,2,0,0],[0,3,0,0,2,2],[3,0,0,2,3,0],[0,3,3,3,0,0],[2,0,3,0,0,2],[2,4,2,0,3,2]],"min_steps":17}]] this.LEVEL_INFO.unshift([{"id":"0001","map":[[3, 2, 2, 0, 2],[0, 0, 3, 3, 0],[1, 3, 0, 3, 2],[3, 0, 2, 3, 4],[3, 2, 3, 3, 2]],"min_steps":4}]); @@ -294,5 +322,10 @@ export class GameConfig { static Authentication(){ cc.fx.GameTool.Authentication(); } + + + static setCode(code){ + this.GM_INFO.scode = code; + } } diff --git a/assets/Script/module/Crypto/HttpUtil.ts b/assets/Script/module/Crypto/HttpUtil.ts index 4bdc444..c4de654 100644 --- a/assets/Script/module/Crypto/HttpUtil.ts +++ b/assets/Script/module/Crypto/HttpUtil.ts @@ -6,40 +6,37 @@ const BASE_URL = "https://api.sparkus.cn"; //只负责网络接口 次类只负责和后端交互,不负责处理数据 数据处理在GameTool @ccclass export default class HttpUtil extends cc.Component { - static async getShareInfo(shareUrl: string): Promise { - console.log("设置分享链接:",shareUrl); - const time = Math.floor((new Date().getTime()) / 1000) - const url = HttpUtil.apiSign(`/api/share/cfg?gameId=${config.gameId}&time=${time}&url=${shareUrl}`,{}) - return this.post(url,null,null); - } //排行榜 static async rankData(type,callback,data): Promise { const time = Math.floor((new Date().getTime()) / 1000) const url = HttpUtil.apiSign(`/api/get/rank/data?gameId=${config.gameId}&dataType=${type}&time=${time}`, data) - this.post(url,data,callback); + this.post(url,data,callback,0); } static async uploadUserLogData(data,callback): Promise { const url = '/log/collect/data'; - this.post(url,data,callback); + this.post(url,data,callback,3); } //暂时用不到 static async getUserRecord(data,callback): Promise { const time = Math.floor((new Date().getTime()) / 1000) const url = HttpUtil.apiSign(`/api/get/user/data?gameId=${config.gameId}&time=${time}`, data) - this.post(url,data,callback); + this.post(url,data,callback,0); } - static async post(url, data, callback) { - const response = await this.fetchData(url, data, 'POST'); + + static async get(url, callback,count) { + let repeat = count?count:0; + const response = await this.fetchData(url, null, 'GET',repeat); callback && callback(response); } - static async get(url, callback) { - const response = await this.fetchData(url, null, 'GET'); + static async post(url, data, callback,count) { + let repeat = count?count:0; + const response = await this.fetchData(url, data, 'POST',repeat); callback && callback(response); } - static async fetchData(url, data, method) { + static async fetchData(url, data, method,repeat) { const fullUrl = `${BASE_URL}${url}`; const headers = { 'Content-Type': 'application/json' }; const options = { @@ -49,15 +46,36 @@ export default class HttpUtil extends cc.Component { }; try { - const response = await fetch(fullUrl, options); + var response = await this.fetchWithTimeout(fullUrl,options); if (!response.ok) { - throw new Error(`HTTP error! status: ${response.status}`); + throw new Error(`HTTP_______________error! status: ${response.status}`); } return await response.json(); } catch (error) { - console.error('Fetch error:', error); - return null; + console.error('Fetch_______________error:', error); + if(repeat > 0){ + repeat -= 1; + const timeOut = (3-repeat)*5000; + setTimeout(async () => { + response = await this.fetchData(url, data, method,repeat); + }, timeOut); + } + else{ + return null; + } } + } + + static async fetchWithTimeout(resource, options = {}) { + const controller = new AbortController(); + const id = setTimeout(() => controller.abort(), 5000); + const response = await fetch(resource, { + ...options, + signal: controller.signal + }); + clearTimeout(id); + + return response; } /** @@ -91,8 +109,8 @@ function responseHandler(response: { data: any }) { // 响应拦截器 // Rq.interceptors.response.use(responseHandler) const config = { - gameId: "100012", - secretKey: "onnfPKJW", + gameId: "100010", + secretKey: "wozrGKsL", EK:"hui231%1" }; diff --git a/assets/Script/module/GameStart/GameAppStart.ts b/assets/Script/module/GameStart/GameAppStart.ts index 915b725..e2226b6 100644 --- a/assets/Script/module/GameStart/GameAppStart.ts +++ b/assets/Script/module/GameStart/GameAppStart.ts @@ -36,20 +36,6 @@ window.initMgr = function() { queryId : -1 //分享id }; - cc.fx.Message = { - control: "10001", //传递操作控制 - startGame:"10002", //传递开始建筑 - next: "10003" , //传递执行下一个格子洪水流过 - changePath: "10004", //传递操作控制 - changeMap: "10005", //改变那地图 - nextWater: "10006" , //传递执行下一个格子洪水流过 - addEnd: "10007" , //添加结束点 - setData: "10008" , //上传分数 - guideNext: "10009" , //引导进入下一步 - showResult: "10010", //展示治水结果 - removeTip: "10011" //执行撤回或者后退动作,移除提示 - } - /* * 客户端埋点分享类型 */ @@ -104,5 +90,30 @@ window.initMgr = function() { tipErrLast: '之前确实看到过{植物},但最近一次似乎不是看到的呢', }); + //暂时不用 + // cc.fx.clickStatEventType = { + // clickStatEventTypeVideoAD : 20173201,//视频播放完成 + // clickStatEventTypeClickAdVideo : 20173202,//视频播放为完成 + // clickStatEventTypeBannerAD : 20173203,//banner播放为完成 + // clickStatEventTypeUserFrom : 99990001,//用户来源 + // clickStatEventTypeShare : 99990002,//用户分享 + // clickStatEventTypeClickAdBtn : 99990007,//点击分流icon + // clickStatEventTypeBannerAD2 : 67890033, // banner广告干预 + // clickStatEventTypeSubmitVersionInfo : 9999, //上报微信版本及基础库信息 + // clickStatEventTypeClickFirstAd : 99990003, //分流icon显示 + // clickStatEventTypeClickSecondAd : 99990004, //玩家点击分流按钮 + // clickStatEventTypeWxLoginStart : 10001,//微信登录开始 + // clickStatEventTypeWxLoginSuccess : 10002,//微信登录成功 + // clickStatEventTypeWxLoginFailed : 10003,//微信登录失败 + // clickStatEventTypeAuthorizationStart : 10003,//授权开始 + // clickStatEventTypeAuthorizationSuccess : 10004,//授权成功 + // clickStatEventTypeAuthorizationFailed : 10005,//授权失败 + // clickStatEventTypeLoginSDKStart : 10007,//登录SDK开始 + // clickStatEventTypeLoginSDKSuccess : 10008,//登录SDK成功 + // clickStatEventTypeLoginSDKFailed : 10009,//登录SDK时失败 + // clickStatEventTypeTCP_Start : 10009,//TCP连接开始 + // clickStatEventTypeTCP_Success : 10010,//TCP连接成功 + // clickStatEventTypeTCP_Failed : 10011,//TCP连接失败 + // }; }; \ No newline at end of file diff --git a/assets/Script/module/Music/AudioManager.ts b/assets/Script/module/Music/AudioManager.ts index cccdecb..c49e23a 100644 --- a/assets/Script/module/Music/AudioManager.ts +++ b/assets/Script/module/Music/AudioManager.ts @@ -9,55 +9,21 @@ export default class AudioManager extends cc.Component { audioGameBgm0: cc.AudioClip = null; @property(cc.AudioClip) - baishao_audio: cc.AudioClip = null; + chehui: cc.AudioClip = null; @property(cc.AudioClip) - cha_audio: cc.AudioClip = null; + jineng: cc.AudioClip = null; @property(cc.AudioClip) - chixiaodou_audio: cc.AudioClip = null; + qingkong: cc.AudioClip = null; @property(cc.AudioClip) - danggui_audio: cc.AudioClip = null; + fangxiang: cc.AudioClip = null; @property(cc.AudioClip) - danshen_audio: cc.AudioClip = null; + build: cc.AudioClip = null; @property(cc.AudioClip) - dazao_audio: cc.AudioClip = null; + win: cc.AudioClip = null; @property(cc.AudioClip) - gancao_audio: cc.AudioClip = null; - @property(cc.AudioClip) - ganjiang_audio: cc.AudioClip = null; - @property(cc.AudioClip) - gouqi_audio: cc.AudioClip = null; - @property(cc.AudioClip) - jingjie_audio: cc.AudioClip = null; - @property(cc.AudioClip) - jinju_audio: cc.AudioClip = null; - @property(cc.AudioClip) - lizhi_audio: cc.AudioClip = null; - @property(cc.AudioClip) - lizi_audio: cc.AudioClip = null; - @property(cc.AudioClip) - longyan_audio: cc.AudioClip = null; - @property(cc.AudioClip) - moli_audio: cc.AudioClip = null; - @property(cc.AudioClip) - muchai_audio: cc.AudioClip = null; - @property(cc.AudioClip) - mudan_audio: cc.AudioClip = null; - @property(cc.AudioClip) - mulan_audio: cc.AudioClip = null; - @property(cc.AudioClip) - pugongying_audio: cc.AudioClip = null; - @property(cc.AudioClip) - putao_audio: cc.AudioClip = null; - @property(cc.AudioClip) - renshen_audio: cc.AudioClip = null; - @property(cc.AudioClip) - taozi_audio: cc.AudioClip = null; - @property(cc.AudioClip) - zhuye_audio: cc.AudioClip = null; - @property(cc.AudioClip) - err: cc.AudioClip = null; - @property(cc.AudioClip) - yes: cc.AudioClip = null; + lose: cc.AudioClip = null; + + mAudioMap: {}; @@ -111,7 +77,12 @@ export default class AudioManager extends cc.Component { volume = 1; cc.audioEngine.setEffectsVolume(1); cc.audioEngine.setMusicVolume(1); - + if(audioSource.name == "lose"){ + cc.audioEngine.setEffectsVolume(0.5); + } + else{ + cc.audioEngine.setEffectsVolume(1); + } var context = cc.audioEngine.playEffect(audioSource, loop); if (callback){ cc.audioEngine.setFinishCallback(context, function(){ diff --git a/assets/Script/module/RankList/ItemRender.ts b/assets/Script/module/RankList/ItemRender.ts index 7d8752a..b8857eb 100644 --- a/assets/Script/module/RankList/ItemRender.ts +++ b/assets/Script/module/RankList/ItemRender.ts @@ -8,16 +8,16 @@ export default class ItemRender extends cc.Component { /**数据 */ public data:any = null; /**索引 0表示第一项*/ - public itemIndex:number = 0; + public itemIndex:number = 0; /**数据改变时调用 */ public dataChanged(){ - cc.fx.GameTool.subName(this.data.name,6); + let name = cc.fx.GameTool.subName(this.data.name,6); this.node.getChildByName("rankLab").getComponent(cc.Label).string = this.data.rank + ""; - this.node.getChildByName("nameLab").getComponent(cc.Label).string = this.data.name + ""; - this.node.getChildByName("totalLab").getComponent(cc.Label).string = this.data.total; + this.node.getChildByName("nameLab").getComponent(cc.Label).string = name + ""; + this.node.getChildByName("totalLab").getComponent(cc.Label).string = this.data.total + "%"; let timeTemp = cc.fx.GameTool.getTimeShenNong(this.data.time); - // this.node.getChildByName("timeLab").getComponent(cc.Label).string = timeTemp + ""; + this.node.getChildByName("timeLab").getComponent(cc.Label).string = timeTemp + ""; this.node.getChildByName("rank").getChildByName("one").active = false; this.node.getChildByName("rank").getChildByName("two").active = false; this.node.getChildByName("rank").getChildByName("three").active = false; @@ -67,7 +67,7 @@ export default class ItemRender extends cc.Component { } else{ // console.log("设置头像失败",url); - console.log(err,texture) + // console.log(err,texture) } }) } diff --git a/assets/Script/module/Share.zip b/assets/Script/module/Share.zip deleted file mode 100644 index 705f190..0000000 Binary files a/assets/Script/module/Share.zip and /dev/null differ diff --git a/assets/Script/module/Share/share.ts b/assets/Script/module/Share/share.ts index e8e7c36..6ab0262 100644 --- a/assets/Script/module/Share/share.ts +++ b/assets/Script/module/Share/share.ts @@ -1,7 +1,7 @@ var shareConfig = { - gameId: "100010", + gameId: "100009", shareLine: "zDLsruVI", EK:"hui231%1" }; @@ -26,6 +26,7 @@ export class WeChat { static getResult(res){ if(res){ var data = res.data; + // @ts-ignore wx.config({ debug: false, appId: data.appId, @@ -34,41 +35,48 @@ export class WeChat { signature: data.signature, jsApiList: ['onMenuShareTimeline','updateAppMessageShareData', 'updateTimelineShareData', 'onMenuShareAppMessage'] }); + // @ts-ignore wx.checkJsApi({ jsApiList: ['updateAppMessageShareData'], // 需要检测的JS接口列表,所有JS接口列表见附录2, success: function(res) { setTimeout(() => { WeChat.changeShare(); - }, 100); + }, 200); setTimeout(() => { WeChat.changeShare(); - }, 200); + }, 500); } }); } } static changeShare(){ + // @ts-ignore wx.ready(() => { + // @ts-ignore wx.updateAppMessageShareData({ title: '记忆力认知测评', // 分享标题 - desc: '你的认知灵活性和选择注意有问题吗', // 分享描述 + desc: '你的注意力和工作记忆有问题吗?', // 分享描述 link: shareConfig.shareLine, // 分享链接,该链接域名或路径必须与当前页面对应的公众号JS安全域名一致 - imgUrl: 'https://static.sparkus.cn/public/shennong.jpg', // 分享图标 + imgUrl: 'https://static.sparkus.cn/public/shootsun.jpg', // 分享图标 success: function () { // 设置成功 console.log("分享好友成功回调"); } }); - wx.updateTimelineShareData({ - title: '记忆力认知测评', // 分享标题 - link: shareConfig.shareLine, // 分享链接,该链接域名或路径必须与当前页面对应的公众号JS安全域名一致 - imgUrl: 'https://static.sparkus.cn/public/shennong.jpg', // 分享图标 - success: function () { - // 设置成功 - console.log("分享朋友圈成功回调"); - } - }) + setTimeout(() => { + // @ts-ignore + wx.updateTimelineShareData({ + title: '记忆力认知测评', // 分享标题 + link: shareConfig.shareLine, // 分享链接,该链接域名或路径必须与当前页面对应的公众号JS安全域名一致 + imgUrl: 'https://static.sparkus.cn/public/shootsun.jpg', // 分享图标 + success: function () { + // 设置成功 + console.log("分享朋友圈成功回调"); + } + }) + }, 200); + }); } @@ -79,8 +87,8 @@ export class WeChat { } static async getShareInfo(shareUrl: string, callback:Function): Promise { const time = Math.floor((new Date().getTime()) / 1000) - const url = cc.fx.HttpUtil.apiSign(`/api/share/cfg?gameId=${shareConfig.gameId}&time=${time}&url=${shareUrl}`,{}) - return cc.fx.HttpUtil.get(url,callback) + const url = cc.fx.HttpUtil.apiSign(`/api/share/cfg?gameId=${cc.fx.GameConfig.GM_INFO.gameId}&time=${time}&url=${shareUrl}`,{}) + return cc.fx.HttpUtil.get(url,callback,3) } diff --git a/assets/Script/module/Tool/GameTool.ts b/assets/Script/module/Tool/GameTool.ts index 09cf6ae..1e00d35 100644 --- a/assets/Script/module/Tool/GameTool.ts +++ b/assets/Script/module/Tool/GameTool.ts @@ -29,11 +29,12 @@ var GameTool = { let postData = { "gameId":cc.fx.GameConfig.GM_INFO.gameId, "userId":cc.fx.GameConfig.GM_INFO.userId, + "scode":cc.fx.GameConfig.GM_INFO.scode, "matchId":matchId, "data": data }; - console.log("上传数据:",data); + // console.log("上传数据:",data); cc.fx.HttpUtil.uploadUserLogData(postData,function(){}) }, //上传排行榜 type为1 @@ -312,7 +313,7 @@ var GameTool = { //获取时间戳 getTime(){ - const timestamp = Math.floor((new Date().getTime()) / 1000) + const timestamp = (new Date().getTime()) return timestamp; }, pushLister:function () { diff --git a/assets/res/SourceHanSerifCN-Bold.ttf b/assets/res/SourceHanSerifCN-Bold.ttf new file mode 100644 index 0000000..3db6ff8 Binary files /dev/null and b/assets/res/SourceHanSerifCN-Bold.ttf differ diff --git a/assets/res/SourceHanSerifCN-Bold.ttf.meta b/assets/res/SourceHanSerifCN-Bold.ttf.meta new file mode 100644 index 0000000..c3ae5aa --- /dev/null +++ b/assets/res/SourceHanSerifCN-Bold.ttf.meta @@ -0,0 +1,6 @@ +{ + "ver": "1.1.2", + "uuid": "8162ee52-27a1-40fa-b8d8-b05e309020cd", + "importer": "ttf-font", + "subMetas": {} +} \ No newline at end of file diff --git a/assets/res/SourceHanSerifCN-Medium.ttf b/assets/res/SourceHanSerifCN-Medium.ttf new file mode 100644 index 0000000..fa97e07 Binary files /dev/null and b/assets/res/SourceHanSerifCN-Medium.ttf differ diff --git a/assets/res/SourceHanSerifCN-Medium.ttf.meta b/assets/res/SourceHanSerifCN-Medium.ttf.meta new file mode 100644 index 0000000..e3ff5d4 --- /dev/null +++ b/assets/res/SourceHanSerifCN-Medium.ttf.meta @@ -0,0 +1,6 @@ +{ + "ver": "1.1.2", + "uuid": "ba08509d-1972-42d5-aa39-2bcd83804450", + "importer": "ttf-font", + "subMetas": {} +} \ No newline at end of file diff --git a/build-templates/web-mobile/index.html b/build-templates/web-mobile/index.html new file mode 100644 index 0000000..f6b9f59 --- /dev/null +++ b/build-templates/web-mobile/index.html @@ -0,0 +1,253 @@ + + + + + + + 神农寻百草 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + 记忆力 +
+
+
+
+
+
+
+
+ + + + + + + + + + diff --git a/build-templates/web-mobile2/main.js b/build-templates/web-mobile/main.js similarity index 97% rename from build-templates/web-mobile2/main.js rename to build-templates/web-mobile/main.js index 4f63691..74cc341 100644 --- a/build-templates/web-mobile2/main.js +++ b/build-templates/web-mobile/main.js @@ -5,8 +5,8 @@ window.boot = function () { window._CCSettings = undefined; var onProgress = null; - var RESOURCES = remote_url + cc.AssetManager.BuiltinBundleName.RESOURCES; - // var RESOURCES = cc.AssetManager.BuiltinBundleName.RESOURCES; + // var RESOURCES = remote_url + cc.AssetManager.BuiltinBundleName.RESOURCES; + var RESOURCES = cc.AssetManager.BuiltinBundleName.RESOURCES; var INTERNAL = cc.AssetManager.BuiltinBundleName.INTERNAL; var MAIN = cc.AssetManager.BuiltinBundleName.MAIN; function setLoadingDisplay () { diff --git a/build-templates/web-mobile/splash.jpg b/build-templates/web-mobile/splash.jpg new file mode 100644 index 0000000..116d70f Binary files /dev/null and b/build-templates/web-mobile/splash.jpg differ diff --git a/build-templates/web-mobile2/style-mobile.css b/build-templates/web-mobile/style-mobile.css similarity index 100% rename from build-templates/web-mobile2/style-mobile.css rename to build-templates/web-mobile/style-mobile.css diff --git a/build-templates/web-mobile2/index.html b/build-templates/web-mobile2/index.html deleted file mode 100644 index bd7eb98..0000000 --- a/build-templates/web-mobile2/index.html +++ /dev/null @@ -1,240 +0,0 @@ - - - - - - - 后裔逐日 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - 注意力 -
-
-
-
-
-
-
-
- - - - - - - - - - - - diff --git a/build-templates/web-mobile2/splash.jpg b/build-templates/web-mobile2/splash.jpg deleted file mode 100644 index 7c72e9a..0000000 Binary files a/build-templates/web-mobile2/splash.jpg and /dev/null differ diff --git a/library/imports/0d/0d272a57-5428-450e-a8b9-1574c3d89951.js b/library/imports/0d/0d272a57-5428-450e-a8b9-1574c3d89951.js new file mode 100644 index 0000000..8583864 --- /dev/null +++ b/library/imports/0d/0d272a57-5428-450e-a8b9-1574c3d89951.js @@ -0,0 +1,339 @@ +"use strict"; +cc._RF.push(module, '0d272pXVChFDqi5FXTD2JlR', 'MiniGameManager'); +// Script/Sdk/MiniGameManager.ts + +"use strict"; +var __extends = (this && this.__extends) || (function () { + var extendStatics = function (d, b) { + extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; }; + return extendStatics(d, b); + }; + return function (d, b) { + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); +var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) { + var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); + else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; + return c > 3 && r && Object.defineProperty(target, key, r), r; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.MiniGameManager = void 0; +var MiniGameSdk_1 = require("./MiniGameSdk"); +var _a = cc._decorator, ccclass = _a.ccclass, property = _a.property; +var EWechatAD; +(function (EWechatAD) { + EWechatAD["CUMSTOM_01"] = "adunit-f7c2417eb2c2e473"; +})(EWechatAD || (EWechatAD = {})); +var MiniGameManager = /** @class */ (function (_super) { + __extends(MiniGameManager, _super); + function MiniGameManager() { + var _this = _super !== null && _super.apply(this, arguments) || this; + _this.entranceView = null; + return _this; + } + MiniGameManager_1 = MiniGameManager; + Object.defineProperty(MiniGameManager, "instance", { + get: function () { + if (!MiniGameManager_1._instance) { + MiniGameManager_1._instance = new MiniGameManager_1(); + } + return MiniGameManager_1._instance; + }, + enumerable: false, + configurable: true + }); + MiniGameManager.prototype.start = function () { + // 禁用游戏入口视图 + // this.entranceView.active = false; + // MiniGameSdk.API.getUserProfile(this.setUserId); + // cc.fx.GameTool.setUserInfo(""); + this.onGetLoginCode(); + // 尝试获取游戏入口按钮,如果存在则直接返回,不进行后续操作 + // let buttonEntrance = this.node.getChildByName('Btns')?.getChildByName('Button_EntranceView'); + // if (buttonEntrance) { + // return; + // } + // 如果是字节跳动小游戏环境,检查侧边栏是否存在 + if (MiniGameSdk_1.MiniGameSdk.isBytedance()) { + //抖音环境,检测侧边栏存在 + MiniGameSdk_1.MiniGameSdk.BytedanceSidebar.checkSideBar(function (success) { + // 根据侧边栏存在性激活或禁用游戏入口按钮 + // buttonEntrance.active = success; + }); + } + else { + // 非抖音小游戏环境,直接激活游戏入口按钮 + // 非抖音环境,正常显示按钮 + // buttonEntrance.active = true; + } + // 设置监听器,以处理来自侧边栏的交互事件 + MiniGameSdk_1.MiniGameSdk.BytedanceSidebar.listenFromSidebar(function (success) { + // 如果交互成功,显示奖励提示 + if (success) { + MiniGameSdk_1.MiniGameSdk.API.showToast('侧边栏奖励', 5); + } + }); + }; + MiniGameManager.prototype.update = function (deltaTime) { + }; + /** + * 弹出广告横幅。 + * 此方法用于加载并显示广告横幅。它首先加载指定广告位的横幅广告,然后显示广告。 + * 加载广告和显示广告是通过MiniGameSdk.AdvertManager的实例方法来实现的。 + * + * @remarks + * 此方法提供了两种显示横幅广告的方式: + * 1. 默认方式:调用showBanner方法显示广告,系统会自动选择显示位置。 + * 2. 指定位置方式:可以通过传入额外的参数来指定广告显示在屏幕的顶部或底部,或者通过坐标指定显示位置。 + * + * 示例代码中注释掉了两种显示广告的具体方法,可以根据实际需求选择使用。 + */ + MiniGameManager.prototype.onShowBanner = function () { + // 加载指定广告位的横幅广告。 + MiniGameSdk_1.MiniGameSdk.AdvertManager.instance.loadBanner('adunit-4e7ef467e3eaab51'); + // 默认方式显示横幅广告。 + // 方法1:默认调用 + MiniGameSdk_1.MiniGameSdk.AdvertManager.instance.showBanner(); + // 示例:指定屏幕底部正中显示横幅广告。 + // 方法2:指定屏幕顶部或底部正中 + // MiniGameSdk.AdvertManager.instance.showBanner('adunit-4e7ef467e3eaab51', MiniGameSdk.EAdBannerLocation.BOTTOM); + // 示例:通过坐标指定位置显示横幅广告。 + // 方法2:指定坐标 + // MiniGameSdk.AdvertManager.instance.showBanner('adunit-4e7ef467e3eaab51', { top: 10, left: 10 }); + }; + /** + * 隐藏广告横幅的函数。 + * + * 该函数调用MiniGameSdk.AdvertManager实例的方法,用于隐藏广告横幅。 + * 当需要暂时停止展示广告或用户主动请求隐藏广告时,可以调用此函数。 + * + * @remarks + * 此函数不接受任何参数,也不返回任何值。 + * 它单纯地触发广告横幅的隐藏操作,具体实现依赖于AdvertManager的实现。 + */ + MiniGameManager.prototype.onHideBanner = function () { + MiniGameSdk_1.MiniGameSdk.AdvertManager.instance.hideBanner(); + }; + /** + * 显示插屏广告的函数。 + * + * 此函数调用MiniGameSdk.AdvertManager实例的方法,以显示一个指定的插屏广告。 + * 它使用了硬编码的广告单元标识符,这意味着它专为特定的广告位设计。 + * 在实际应用中,可能需要根据应用的配置或用户的特定条件来动态选择广告单元标识符。 + */ + MiniGameManager.prototype.onShowInterstitial = function () { + MiniGameSdk_1.MiniGameSdk.AdvertManager.instance.showInterstitial('adunit-eadd67851d3050ad'); + }; + /** + * 调用广告管理器加载并展示自定义广告。 + * 此方法首先通过广告管理器的实例加载指定的自定义广告单元,然后展示这个自定义广告。 + * 加载和展示广告是广告管理系统中的常见操作,这里通过两步分别完成加载和展示的过程, + * 以确保广告在展示前正确且充分地被加载。 + */ + MiniGameManager.prototype.onShowCustom = function () { + // 加载指定的自定义广告单元。 + MiniGameSdk_1.MiniGameSdk.AdvertManager.instance.loadCustom(EWechatAD.CUMSTOM_01); + // 展示已加载的自定义广告。 + MiniGameSdk_1.MiniGameSdk.AdvertManager.instance.showCustom(EWechatAD.CUMSTOM_01); + }; + /** + * 隐藏自定义广告。 + * + * 本函数调用MiniGameSdk.AdvertManager.instance.hideCustom()来隐藏自定义广告。 + * 这是对接广告管理系统的一部分,用于控制广告的显示与隐藏。 + * 在需要隐藏自定义广告的场景下,调用此函数即可实现相应功能。 + */ + MiniGameManager.prototype.onHideCustom = function () { + MiniGameSdk_1.MiniGameSdk.AdvertManager.instance.hideCustom(EWechatAD.CUMSTOM_01); + }; + /** + * 触发显示视频广告的函数。 + * 通过调用MiniGameSdk.AdvertManager.instance.showVideo方法,显示一个视频广告,并根据用户观看广告的情况执行相应的逻辑。 + * + * @remarks + * 此函数首先传入一个广告单元ID,用于标识要显示的视频广告。然后传入一个回调函数,该回调函数在用户观看广告后被调用,无论用户是完成了观看、拒绝了观看还是观看过程中发生了错误。 + * 回调函数接收两个参数:一个是用户观看广告的结果,另一个是用户观看的广告数量。根据观看结果的不同,显示不同的提示信息。 + */ + MiniGameManager.prototype.onShowVideo = function () { + // 广告单元ID,用于标识要显示的视频广告 + // 广告单元ID的样例 + //抖音形如: 1re3nfqkmy81m4m8ge + //微信形如: adunit-a7718f6e195e42fe + MiniGameSdk_1.MiniGameSdk.AdvertManager.instance.showVideo('1re3nfqkmy81m4m8ge', function (res, count) { + // 输出用户观看的广告数量 + console.log('用户看的视频广告个数是:', count); + // 根据用户观看广告的结果,执行不同的逻辑 + switch (res) { + case MiniGameSdk_1.MiniGameSdk.EAdVideoResult.ACCEPT: + // 用户完成了广告观看,显示奖励提示 + MiniGameSdk_1.MiniGameSdk.API.showToast('用户看完广告,可以奖励'); + break; + case MiniGameSdk_1.MiniGameSdk.EAdVideoResult.REJECT: + // 用户拒绝了广告观看,显示不奖励提示 + MiniGameSdk_1.MiniGameSdk.API.showToast('用户拒绝掉广告,不奖励'); + break; + case MiniGameSdk_1.MiniGameSdk.EAdVideoResult.ERROR: + // 广告播放发生错误,显示错误提示 + MiniGameSdk_1.MiniGameSdk.API.showToast('播放广告发生错误,不奖励'); + break; + default: + // 其他情况,不作处理 + break; + } + }); + }; + /** + * 引导用户分享应用给朋友。 + * + * 通过调用MiniGameSdk的API分享功能,向用户的朋友圈发送邀请,邀请他们一起玩游戏。 + * 这是一个重要的推广手段,可以增加应用的曝光度和用户量。 + * + * @remarks + * 此方法中调用的API依赖于特定的小游戏平台,因此在不同的平台上可能需要不同的实现。 + */ + MiniGameManager.prototype.onShare = function () { + MiniGameSdk_1.MiniGameSdk.API.shareAppToFriends('来玩游戏吧'); + }; + /** + * 显示一个toast提示。 + * + * 通过调用MiniGameSdk的API方法来显示一个简短的提示信息。toast是一种轻量级的提示方式,用于在界面上短暂地展示一些信息,不影响用户操作。 + * 这里使用了固定的提示文本 '这是一个toast',在实际应用中,可以根据需要动态设置提示文本。 + */ + MiniGameManager.prototype.onShowToast = function () { + MiniGameSdk_1.MiniGameSdk.API.showToast('这是一个toast'); + }; + /** + * 触发设备振动功能。 + * + * 该方法用于调用MiniGameSdk提供的API,以实现设备的振动功能。当需要提醒用户或提供触觉反馈时,可以调用此方法。 + * 例如,在游戏或应用中,当用户完成特定操作或发生特定事件时,可以通过振动给予用户反馈。 + * + * @remarks + * 此方法无参数,也不返回任何值。 + */ + MiniGameManager.prototype.onVirbrate = function () { + MiniGameSdk_1.MiniGameSdk.API.vibrate(); + }; + /** + * 重新启动游戏实例。 + * + * 此函数调用MiniGameSdk中的API重新启动游戏。重新启动操作可能是为了初始化游戏环境、重置游戏状态或处理其他需要重启的场景。 + * 调用此函数后,游戏将会重新开始,当前的游戏状态将会被清除。 + * + * @remarks + * 此函数不接受任何参数。 + * + * @returns 无返回值。 + */ + MiniGameManager.prototype.onReboot = function () { + MiniGameSdk_1.MiniGameSdk.API.reboot(); + }; + /** + * 当前函数用于在迷你游戏中实现退出功能。 + * 它调用了MiniGameSdk提供的API方法来触发退出操作。 + * 该方法通常在需要结束当前迷你游戏或返回到上一级菜单时被调用。 + */ + MiniGameManager.prototype.onExit = function () { + MiniGameSdk_1.MiniGameSdk.API.exit(); + }; + /** + * 显示分享菜单。 + * + * 通过调用MiniGameSdk的API方法,触发显示分享菜单的操作。此函数旨在提供一个统一的入口, + * 以便在需要时轻松调用分享功能,而无需直接与具体的SDK接口交互。 + * + * @remarks + * 此方法不接受任何参数,也不返回任何值。 + */ + MiniGameManager.prototype.onShowShareMenu = function () { + MiniGameSdk_1.MiniGameSdk.API.showShareMenu(); + }; + /** + * 导航到指定的小游戏。 + * + * 本函数用于触发导航到一个特定的小游戏。这需要提供目标小游戏的ID, + * 以便系统能够正确地将用户重定向到目标小游戏。 + * + * 注意:这里的'xxx'是占位符,实际使用时需要替换为具体的小游戏ID。 + */ + MiniGameManager.prototype.onNavigate = function () { + MiniGameSdk_1.MiniGameSdk.API.navigateTo('xxx'); // xxx替换为你的小游戏id + }; + /** + * 激活字节跳动入口视图。 + * + * 此方法用于将字节跳动入口视图设置为活跃状态。当需要在用户界面中显示字节跳动的入口时, + * 可以调用此方法来激活相应的视图元素,使其对用户可见。 + */ + MiniGameManager.prototype.onBytedanceEntranceView = function () { + // this.entranceView.active = true; + }; + /** + * 请求登录代码 + * + * 本函数用于触发小程序的登录流程,获取微信或头条等第三方平台的登录代码。 + * 这些代码可以用于后续的用户身份验证和数据同步流程。 + */ + MiniGameManager.prototype.onGetLoginCode = function () { + var _this = this; + // 调用MiniGameSdk的API登录方法,传入一个回调函数处理登录结果 + MiniGameSdk_1.MiniGameSdk.API.login(function (code, anonymousCode) { + // 打印微信或头条的登录代码 + console.log('Wechat Or Bytedance Code:', code); + // 打印头条的匿名登录代码 + // console.log('Bytedance Anonymous Code:', anonymousCode); + if (code) { + cc.fx.GameTool.getUserId(code, function (data) { return _this.setUserId(data); }); + } + }); + }; + MiniGameManager.prototype.setUserId = function (data) { + cc.fx.GameConfig.GM_INFO.userId = data.data.userId; + MiniGameSdk_1.MiniGameSdk.API.getUserInfo(this.setUserInfo); + }; + MiniGameManager.prototype.setUserInfo = function (data) { + console.log("获取到的用户信息", data.userInfo); + var useData = { + "gameId": cc.fx.GameConfig.GM_INFO.gameId, + "userId": cc.fx.GameConfig.GM_INFO.userId, + "nickName": data.userInfo.nickName, + "pic": data.userInfo.avatarUrl + }; + console.log("即将上传的用户信息:", cc.fx.GameConfig.GM_INFO.userId, data.userInfo.nickName, data.userInfo.avatarUrl); + console.log("Post数据:", useData); + cc.fx.HttpUtil.setUserInfo(useData, function (res) { + console.log("上传成功:", res); + }); + }; + /** + * 创建并显示游戏圈按钮 + * + * 本函数通过调用MiniGameSdk的GameClub实例方法,实现游戏俱乐部的创建和显示。 + * 它首先配置俱乐部的图标类型和位置大小,然后创建俱乐部,最后显示俱乐部。 + * 这样做是为了在小游戏内创建并展示一个游戏俱乐部的图标,供玩家加入或互动。 + */ + MiniGameManager.prototype.onCreateClub = function () { + // 配置俱乐部图标为绿色,设置图标的位置为顶部200像素,左侧0像素 + MiniGameSdk_1.MiniGameSdk.GameClub.instance.create(MiniGameSdk_1.MiniGameSdk.EGameClubIcon.GREEN, { top: 200, left: 0 }, { width: 50, height: 50 }); + // 显示游戏俱乐部图标 + MiniGameSdk_1.MiniGameSdk.GameClub.instance.show(); + }; + var MiniGameManager_1; + __decorate([ + property(cc.Node) + ], MiniGameManager.prototype, "entranceView", void 0); + MiniGameManager = MiniGameManager_1 = __decorate([ + ccclass + ], MiniGameManager); + return MiniGameManager; +}(cc.Component)); +exports.MiniGameManager = MiniGameManager; + +cc._RF.pop(); \ No newline at end of file diff --git a/library/imports/0d/0d272a57-5428-450e-a8b9-1574c3d89951.js.map b/library/imports/0d/0d272a57-5428-450e-a8b9-1574c3d89951.js.map new file mode 100644 index 0000000..26ac13c --- /dev/null +++ b/library/imports/0d/0d272a57-5428-450e-a8b9-1574c3d89951.js.map @@ -0,0 +1 @@ +{"version":3,"sources":["assets\\Script\\Sdk\\MiniGameManager.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AACA,6CAA4C;A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GAAG,CAAC,SAAS,EAAC,OAAO,CAAC,CAAC;QAC/B,EAAE,CAAC,EAAE,CAAC,QAAQ,CAAC,WAAW,CAAC,OAAO,EAAC,UAAC,GAAG;YACnC,OAAO,CAAC,GAAG,CAAC,OAAO,EAAC,GAAG,CAAC,CAAC;QAC7B,CAAC,CAAC,CAAC;IACP,CAAC;IAED;;;;;;OAMG;IACH,sCAAY,GAAZ;QACI,mCAAmC;QACnC,yBAAW,CAAC,QAAQ,CAAC,QAAQ,CAAC,MAAM,CAChC,yBAAW,CAAC,aAAa,CAAC,KAAK,EAC/B,EAAE,GAAG,EAAE,GAAG,EAAE,IAAI,EAAE,CAAC,EAAE,EACrB,EAAE,KAAK,EAAE,EAAE,EAAE,MAAM,EAAE,EAAE,EAAE,CAAC,CAAC;QAC/B,YAAY;QACZ,yBAAW,CAAC,QAAQ,CAAC,QAAQ,CAAC,IAAI,EAAE,CAAC;IACzC,CAAC;;IAvUD;QADC,QAAQ,CAAC,EAAE,CAAC,IAAI,CAAC;yDACW;IAHpB,eAAe;QAD3B,OAAO;OACK,eAAe,CA2U3B;IAAD,sBAAC;CA3UD,AA2UC,CA3UoC,EAAE,CAAC,SAAS,GA2UhD;AA3UY,0CAAe","file":"","sourceRoot":"/","sourcesContent":["\r\nimport { MiniGameSdk } from \"./MiniGameSdk\";\r\nconst { ccclass, property } = cc._decorator;\r\nenum EWechatAD {\r\n CUMSTOM_01 = 'adunit-f7c2417eb2c2e473'\r\n}\r\n\r\n@ccclass\r\nexport class MiniGameManager extends cc.Component {\r\n\r\n @property(cc.Node)\r\n entranceView: cc.Node = null;\r\n /**\r\n * 开始游戏前的初始化操作。\r\n * 主要负责检查并处理游戏入口按钮的激活状态,以及在特定环境下设置侧边栏的监听器。\r\n * \r\n * @remarks\r\n * 此方法首先将游戏入口视图设为非激活状态,以准备进行后续的检查和设置。\r\n * 如果当前环境是抖音小游戏,会检查是否存在侧边栏,并根据检查结果激活或禁用游戏入口按钮。\r\n * 对于非抖音小游戏环境,直接激活游戏入口按钮。\r\n * 此外,无论环境如何,都会设置一个监听器,以处理来自侧边栏的事件,如成功触发时显示奖励提示。\r\n */\r\n private _id:any;\r\n private _userData:any;\r\n\r\n private static _instance: MiniGameManager;\r\n static get instance(): MiniGameManager {\r\n if (!MiniGameManager._instance) {\r\n MiniGameManager._instance = new MiniGameManager();\r\n }\r\n return MiniGameManager._instance;\r\n }\r\n\r\n start() {\r\n // 禁用游戏入口视图\r\n // this.entranceView.active = false;\r\n // MiniGameSdk.API.getUserProfile(this.setUserId);\r\n // cc.fx.GameTool.setUserInfo(\"\");\r\n this.onGetLoginCode();\r\n // 尝试获取游戏入口按钮,如果存在则直接返回,不进行后续操作\r\n // let buttonEntrance = this.node.getChildByName('Btns')?.getChildByName('Button_EntranceView');\r\n // if (buttonEntrance) {\r\n // return;\r\n // }\r\n\r\n // 如果是字节跳动小游戏环境,检查侧边栏是否存在\r\n\r\n if (MiniGameSdk.isBytedance()) {\r\n //抖音环境,检测侧边栏存在\r\n MiniGameSdk.BytedanceSidebar.checkSideBar((success: boolean) => {\r\n // 根据侧边栏存在性激活或禁用游戏入口按钮\r\n // buttonEntrance.active = success;\r\n });\r\n } else {\r\n // 非抖音小游戏环境,直接激活游戏入口按钮\r\n // 非抖音环境,正常显示按钮\r\n // buttonEntrance.active = true;\r\n }\r\n\r\n // 设置监听器,以处理来自侧边栏的交互事件\r\n MiniGameSdk.BytedanceSidebar.listenFromSidebar((success: boolean) => {\r\n // 如果交互成功,显示奖励提示\r\n if (success) {\r\n MiniGameSdk.API.showToast('侧边栏奖励', 5);\r\n }\r\n });\r\n }\r\n\r\n update(deltaTime: number) {\r\n\r\n }\r\n\r\n /**\r\n * 弹出广告横幅。\r\n * 此方法用于加载并显示广告横幅。它首先加载指定广告位的横幅广告,然后显示广告。\r\n * 加载广告和显示广告是通过MiniGameSdk.AdvertManager的实例方法来实现的。\r\n * \r\n * @remarks\r\n * 此方法提供了两种显示横幅广告的方式:\r\n * 1. 默认方式:调用showBanner方法显示广告,系统会自动选择显示位置。\r\n * 2. 指定位置方式:可以通过传入额外的参数来指定广告显示在屏幕的顶部或底部,或者通过坐标指定显示位置。\r\n * \r\n * 示例代码中注释掉了两种显示广告的具体方法,可以根据实际需求选择使用。\r\n */\r\n onShowBanner() {\r\n // 加载指定广告位的横幅广告。\r\n MiniGameSdk.AdvertManager.instance.loadBanner('adunit-4e7ef467e3eaab51');\r\n\r\n // 默认方式显示横幅广告。\r\n // 方法1:默认调用\r\n MiniGameSdk.AdvertManager.instance.showBanner();\r\n\r\n // 示例:指定屏幕底部正中显示横幅广告。\r\n // 方法2:指定屏幕顶部或底部正中\r\n // MiniGameSdk.AdvertManager.instance.showBanner('adunit-4e7ef467e3eaab51', MiniGameSdk.EAdBannerLocation.BOTTOM); \r\n\r\n // 示例:通过坐标指定位置显示横幅广告。\r\n // 方法2:指定坐标\r\n // MiniGameSdk.AdvertManager.instance.showBanner('adunit-4e7ef467e3eaab51', { top: 10, left: 10 }); \r\n }\r\n\r\n /**\r\n * 隐藏广告横幅的函数。\r\n * \r\n * 该函数调用MiniGameSdk.AdvertManager实例的方法,用于隐藏广告横幅。\r\n * 当需要暂时停止展示广告或用户主动请求隐藏广告时,可以调用此函数。\r\n * \r\n * @remarks\r\n * 此函数不接受任何参数,也不返回任何值。\r\n * 它单纯地触发广告横幅的隐藏操作,具体实现依赖于AdvertManager的实现。\r\n */\r\n onHideBanner() {\r\n MiniGameSdk.AdvertManager.instance.hideBanner();\r\n }\r\n\r\n /**\r\n * 显示插屏广告的函数。\r\n * \r\n * 此函数调用MiniGameSdk.AdvertManager实例的方法,以显示一个指定的插屏广告。\r\n * 它使用了硬编码的广告单元标识符,这意味着它专为特定的广告位设计。\r\n * 在实际应用中,可能需要根据应用的配置或用户的特定条件来动态选择广告单元标识符。\r\n */\r\n onShowInterstitial() {\r\n MiniGameSdk.AdvertManager.instance.showInterstitial('adunit-eadd67851d3050ad');\r\n }\r\n\r\n /**\r\n * 调用广告管理器加载并展示自定义广告。\r\n * 此方法首先通过广告管理器的实例加载指定的自定义广告单元,然后展示这个自定义广告。\r\n * 加载和展示广告是广告管理系统中的常见操作,这里通过两步分别完成加载和展示的过程,\r\n * 以确保广告在展示前正确且充分地被加载。\r\n */\r\n onShowCustom() {\r\n // 加载指定的自定义广告单元。\r\n MiniGameSdk.AdvertManager.instance.loadCustom(EWechatAD.CUMSTOM_01);\r\n // 展示已加载的自定义广告。\r\n MiniGameSdk.AdvertManager.instance.showCustom(EWechatAD.CUMSTOM_01);\r\n }\r\n\r\n /**\r\n * 隐藏自定义广告。\r\n * \r\n * 本函数调用MiniGameSdk.AdvertManager.instance.hideCustom()来隐藏自定义广告。\r\n * 这是对接广告管理系统的一部分,用于控制广告的显示与隐藏。\r\n * 在需要隐藏自定义广告的场景下,调用此函数即可实现相应功能。\r\n */\r\n onHideCustom() {\r\n MiniGameSdk.AdvertManager.instance.hideCustom(EWechatAD.CUMSTOM_01);\r\n }\r\n\r\n /**\r\n * 触发显示视频广告的函数。\r\n * 通过调用MiniGameSdk.AdvertManager.instance.showVideo方法,显示一个视频广告,并根据用户观看广告的情况执行相应的逻辑。\r\n * \r\n * @remarks\r\n * 此函数首先传入一个广告单元ID,用于标识要显示的视频广告。然后传入一个回调函数,该回调函数在用户观看广告后被调用,无论用户是完成了观看、拒绝了观看还是观看过程中发生了错误。\r\n * 回调函数接收两个参数:一个是用户观看广告的结果,另一个是用户观看的广告数量。根据观看结果的不同,显示不同的提示信息。\r\n */\r\n onShowVideo() {\r\n // 广告单元ID,用于标识要显示的视频广告\r\n // 广告单元ID的样例\r\n //抖音形如: 1re3nfqkmy81m4m8ge\r\n //微信形如: adunit-a7718f6e195e42fe\r\n MiniGameSdk.AdvertManager.instance.showVideo('1re3nfqkmy81m4m8ge', (res: MiniGameSdk.EAdVideoResult, count: number) => {\r\n // 输出用户观看的广告数量\r\n console.log('用户看的视频广告个数是:', count);\r\n\r\n // 根据用户观看广告的结果,执行不同的逻辑\r\n switch (res) {\r\n case MiniGameSdk.EAdVideoResult.ACCEPT:\r\n // 用户完成了广告观看,显示奖励提示\r\n MiniGameSdk.API.showToast('用户看完广告,可以奖励');\r\n break;\r\n case MiniGameSdk.EAdVideoResult.REJECT:\r\n // 用户拒绝了广告观看,显示不奖励提示\r\n MiniGameSdk.API.showToast('用户拒绝掉广告,不奖励');\r\n break;\r\n case MiniGameSdk.EAdVideoResult.ERROR:\r\n // 广告播放发生错误,显示错误提示\r\n MiniGameSdk.API.showToast('播放广告发生错误,不奖励');\r\n break;\r\n default:\r\n // 其他情况,不作处理\r\n break;\r\n }\r\n });\r\n }\r\n\r\n /**\r\n * 引导用户分享应用给朋友。\r\n * \r\n * 通过调用MiniGameSdk的API分享功能,向用户的朋友圈发送邀请,邀请他们一起玩游戏。\r\n * 这是一个重要的推广手段,可以增加应用的曝光度和用户量。\r\n * \r\n * @remarks\r\n * 此方法中调用的API依赖于特定的小游戏平台,因此在不同的平台上可能需要不同的实现。\r\n */\r\n onShare() {\r\n MiniGameSdk.API.shareAppToFriends('来玩游戏吧');\r\n }\r\n\r\n /**\r\n * 显示一个toast提示。\r\n * \r\n * 通过调用MiniGameSdk的API方法来显示一个简短的提示信息。toast是一种轻量级的提示方式,用于在界面上短暂地展示一些信息,不影响用户操作。\r\n * 这里使用了固定的提示文本 '这是一个toast',在实际应用中,可以根据需要动态设置提示文本。\r\n */\r\n onShowToast() {\r\n MiniGameSdk.API.showToast('这是一个toast');\r\n }\r\n\r\n /**\r\n * 触发设备振动功能。\r\n * \r\n * 该方法用于调用MiniGameSdk提供的API,以实现设备的振动功能。当需要提醒用户或提供触觉反馈时,可以调用此方法。\r\n * 例如,在游戏或应用中,当用户完成特定操作或发生特定事件时,可以通过振动给予用户反馈。\r\n * \r\n * @remarks\r\n * 此方法无参数,也不返回任何值。\r\n */\r\n onVirbrate() {\r\n MiniGameSdk.API.vibrate();\r\n }\r\n\r\n /**\r\n * 重新启动游戏实例。\r\n * \r\n * 此函数调用MiniGameSdk中的API重新启动游戏。重新启动操作可能是为了初始化游戏环境、重置游戏状态或处理其他需要重启的场景。\r\n * 调用此函数后,游戏将会重新开始,当前的游戏状态将会被清除。\r\n * \r\n * @remarks\r\n * 此函数不接受任何参数。\r\n * \r\n * @returns 无返回值。\r\n */\r\n onReboot() {\r\n MiniGameSdk.API.reboot();\r\n }\r\n\r\n /**\r\n * 当前函数用于在迷你游戏中实现退出功能。\r\n * 它调用了MiniGameSdk提供的API方法来触发退出操作。\r\n * 该方法通常在需要结束当前迷你游戏或返回到上一级菜单时被调用。\r\n */\r\n onExit() {\r\n MiniGameSdk.API.exit();\r\n }\r\n\r\n /**\r\n * 显示分享菜单。\r\n * \r\n * 通过调用MiniGameSdk的API方法,触发显示分享菜单的操作。此函数旨在提供一个统一的入口,\r\n * 以便在需要时轻松调用分享功能,而无需直接与具体的SDK接口交互。\r\n * \r\n * @remarks\r\n * 此方法不接受任何参数,也不返回任何值。\r\n */\r\n onShowShareMenu() {\r\n MiniGameSdk.API.showShareMenu();\r\n }\r\n\r\n /**\r\n * 导航到指定的小游戏。\r\n * \r\n * 本函数用于触发导航到一个特定的小游戏。这需要提供目标小游戏的ID,\r\n * 以便系统能够正确地将用户重定向到目标小游戏。\r\n * \r\n * 注意:这里的'xxx'是占位符,实际使用时需要替换为具体的小游戏ID。\r\n */\r\n onNavigate() {\r\n MiniGameSdk.API.navigateTo('xxx'); // xxx替换为你的小游戏id\r\n }\r\n\r\n /**\r\n * 激活字节跳动入口视图。\r\n * \r\n * 此方法用于将字节跳动入口视图设置为活跃状态。当需要在用户界面中显示字节跳动的入口时,\r\n * 可以调用此方法来激活相应的视图元素,使其对用户可见。\r\n */\r\n onBytedanceEntranceView() {\r\n // this.entranceView.active = true;\r\n }\r\n\r\n /**\r\n * 请求登录代码\r\n * \r\n * 本函数用于触发小程序的登录流程,获取微信或头条等第三方平台的登录代码。\r\n * 这些代码可以用于后续的用户身份验证和数据同步流程。\r\n */\r\n onGetLoginCode() {\r\n // 调用MiniGameSdk的API登录方法,传入一个回调函数处理登录结果\r\n MiniGameSdk.API.login((code: string, anonymousCode: string) => {\r\n // 打印微信或头条的登录代码\r\n console.log('Wechat Or Bytedance Code:', code);\r\n // 打印头条的匿名登录代码\r\n // console.log('Bytedance Anonymous Code:', anonymousCode);\r\n if(code){\r\n cc.fx.GameTool.getUserId(code, data => this.setUserId(data)); \r\n }\r\n });\r\n }\r\n\r\n setUserId(data){\r\n cc.fx.GameConfig.GM_INFO.userId = data.data.userId;\r\n MiniGameSdk.API.getUserInfo(this.setUserInfo);\r\n }\r\n\r\n setUserInfo(data){\r\n console.log(\"获取到的用户信息\",data.userInfo);\r\n var useData = {\r\n \"gameId\": cc.fx.GameConfig.GM_INFO.gameId,\r\n \"userId\": cc.fx.GameConfig.GM_INFO.userId,\r\n \"nickName\":data.userInfo.nickName,\r\n \"pic\": data.userInfo.avatarUrl\r\n \r\n }\r\n console.log(\"即将上传的用户信息:\",cc.fx.GameConfig.GM_INFO.userId,data.userInfo.nickName,data.userInfo.avatarUrl);\r\n console.log(\"Post数据:\",useData);\r\n cc.fx.HttpUtil.setUserInfo(useData,(res)=>{\r\n console.log(\"上传成功:\",res);\r\n });\r\n }\r\n\r\n /**\r\n * 创建并显示游戏圈按钮\r\n * \r\n * 本函数通过调用MiniGameSdk的GameClub实例方法,实现游戏俱乐部的创建和显示。\r\n * 它首先配置俱乐部的图标类型和位置大小,然后创建俱乐部,最后显示俱乐部。\r\n * 这样做是为了在小游戏内创建并展示一个游戏俱乐部的图标,供玩家加入或互动。\r\n */\r\n onCreateClub() {\r\n // 配置俱乐部图标为绿色,设置图标的位置为顶部200像素,左侧0像素\r\n MiniGameSdk.GameClub.instance.create(\r\n MiniGameSdk.EGameClubIcon.GREEN,\r\n { top: 200, left: 0 },\r\n { width: 50, height: 50 });\r\n // 显示游戏俱乐部图标\r\n MiniGameSdk.GameClub.instance.show();\r\n }\r\n}\r\n"]} \ No newline at end of file diff --git a/library/imports/43/43bfc27a-ff6e-45b3-87c7-504d0f781397.js b/library/imports/43/43bfc27a-ff6e-45b3-87c7-504d0f781397.js index b5ea6c7..7500bd2 100644 --- a/library/imports/43/43bfc27a-ff6e-45b3-87c7-504d0f781397.js +++ b/library/imports/43/43bfc27a-ff6e-45b3-87c7-504d0f781397.js @@ -34,10 +34,11 @@ var GameTool = { var postData = { "gameId": cc.fx.GameConfig.GM_INFO.gameId, "userId": cc.fx.GameConfig.GM_INFO.userId, + "scode": cc.fx.GameConfig.GM_INFO.scode, "matchId": matchId, "data": data }; - console.log("上传数据:"); + // console.log("上传数据:",data); cc.fx.HttpUtil.uploadUserLogData(postData, function () { }); }, //上传排行榜 type为1 @@ -47,8 +48,8 @@ var GameTool = { "gameId": cc.fx.GameConfig.GM_INFO.gameId, "userId": cc.fx.GameConfig.GM_INFO.userId, "type": 1, - "totleTimes": data.totleTimes, - "accuracy": data.accuracy, + "score": data.score, + "accuracy": data.date, "success": cc.fx.GameConfig.GM_INFO.success }; cc.fx.HttpUtil.rankData(1, function () { }, postData); @@ -140,10 +141,10 @@ var GameTool = { } }) .catch(function (error) { - console.error('Error fetching X-Info:', error); + // console.error('Error fetching X-Info:', error); }); }, 100); - cc.assetManager.loadRemote(url, { ext: '.jpg' }, function (err, texture) { + cc.assetManager.loadRemote(url, { ext: '.png' }, function (err, texture) { if (texture) { node.active = true; node.getComponent(cc.Sprite).spriteFrame = new cc.SpriteFrame(texture); @@ -162,7 +163,7 @@ var GameTool = { var self = false; cc.fx.GameTool.setPic(target.selfNode.getChildByName("pic").getChildByName("icon"), target.selfData.pic); for (var i = 0; i <= target.listData.length - 1; i++) { - rankData.push({ rank: (i + 1), name: target.listData[i].nickName, total: target.listData[i].accuracy, time: target.listData[i].totleTimes, pic: target.listData[i].pic }); + rankData.push({ rank: (i + 1), name: target.listData[i].nickName, total: target.listData[i].score, time: null, pic: target.listData[i].pic }); if (cc.fx.GameConfig.GM_INFO.userId == target.listData[i].userId) { self = true; target.rankNumber = i; @@ -175,9 +176,9 @@ var GameTool = { } cc.fx.GameTool.subName(target.selfData.nickName, nameLength); target.selfNode.getChildByName("nameLab").getComponent(cc.Label).string = target.selfData.nickName; - target.selfNode.getChildByName("totalLab").getComponent(cc.Label).string = target.selfData.accuracy + "%"; + target.selfNode.getChildByName("totalLab").getComponent(cc.Label).string = target.selfData.score; var timeTemp = cc.fx.GameTool.getTimeShenNong(target.selfData.totleTimes); - target.selfNode.getChildByName("timeLab").getComponent(cc.Label).string = timeTemp + ""; + // target.selfNode.getChildByName("timeLab").getComponent(cc.Label).string = timeTemp + ""; switch (target.selfNode.getChildByName("rankLab").getComponent(cc.Label).string) { case "1": target.selfNode.getChildByName("rank").getChildByName("one").active = true; @@ -236,81 +237,6 @@ var GameTool = { cc.fx.GameConfig.GM_INFO_SET("custom", arrayList[0]); cc.fx.StorageMessage.setStorage(cc.fx.storageType.storageTypeCustom, arrayList); }, - getFoodName: function (food) { - var name = "葡萄"; - switch (food) { - case "baishao": - name = "白芍"; - break; - case "jingjie": - name = "荆芥"; - break; - case "renshen": - name = "人参"; - break; - case "danshen": - name = "丹参"; - break; - case "danggui": - name = "当归"; - break; - case "gouqi": - name = "枸杞"; - break; - case "mudan": - name = "牡丹"; - break; - case "mulan": - name = "木兰"; - break; - case "pugongying": - name = "蒲公英"; - break; - case "moli": - name = "茉莉"; - break; - case "jinju": - name = "金桔"; - break; - case "dazao": - name = "大枣"; - break; - case "lizi": - name = "李子"; - break; - case "lizhi": - name = "荔枝"; - break; - case "taozi": - name = "桃子"; - break; - case "putao": - name = "葡萄"; - break; - case "muchai": - name = "木柴"; - break; - case "ganjiang": - name = "干姜"; - break; - case "zhuye": - name = "竹叶"; - break; - case "longyan": - name = "龙眼"; - break; - case "chixiaodou": - name = "赤小豆"; - break; - case "gancao": - name = "甘草"; - break; - case "cha": - name = "茶"; - break; - } - return name; - }, getSetScreenResolutionFlag: function () { var size = cc.winSize; var width = size.width; @@ -388,7 +314,7 @@ var GameTool = { }, //获取时间戳 getTime: function () { - var timestamp = new Date().getTime(); + var timestamp = (new Date().getTime()); return timestamp; }, pushLister: function () { diff --git a/library/imports/43/43bfc27a-ff6e-45b3-87c7-504d0f781397.js.map b/library/imports/43/43bfc27a-ff6e-45b3-87c7-504d0f781397.js.map index 8d01876..575204f 100644 --- a/library/imports/43/43bfc27a-ff6e-45b3-87c7-504d0f781397.js.map +++ b/library/imports/43/43bfc27a-ff6e-45b3-87c7-504d0f781397.js.map @@ -1 +1 @@ -{"version":3,"sources":["assets\\Script\\module\\Tool\\GameTool.ts"],"names":[],"mappings":";;;;;;;AACA,+BAA+B;AAC/B,IAAI,QAAQ,GAAG;IACX,UAAU,EAAE,CAAC;IACb,QAAQ,EAAE,CAAC;IACX,UAAU,EAAE,CAAC;IACb,UAAU;IACV,cAAc;QACV,IAAI,IAAI,GAAG,OAAO,GAAG,EAAE,CAAC,EAAE,CAAC,UAAU,CAAC,OAAO,CAAC,MAAM,CAAC;QACrD,IAAI,IAAI,GAAG,IAAI,CAAC,KAAK,CAAC,YAAY,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC;QAClD,IAAG,IAAI,IAAI,UAAU,IAAI,IAAI,IAAE,IAAI,IAAI,IAAI,IAAI,EAAE,EAAC;YAC9C,IAAI,GAAG,GAAG,8EAA8E,GAAC,QAAQ,CAAC,IAAI,CAAC;YACvG,MAAM,CAAC,QAAQ,CAAC,IAAI,GAAG,GAAG,CAAC;SAC9B;aACG;YACA,EAAE,CAAC,EAAE,CAAC,cAAc,CAAC,UAAU,CAAC,IAAI,EAAC,IAAI,CAAC,CAAC;YAC3C,EAAE,CAAC,EAAE,CAAC,UAAU,CAAC,OAAO,CAAC,MAAM,GAAG,QAAQ,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;SAC3D;IACL,CAAC;IAED,MAAM;IACN,WAAW;QACP,oBAAoB;QACpB,EAAE,CAAC,EAAE,CAAC,UAAU,CAAC,SAAS,GAAG,EAAE,CAAC;QAChC,EAAE,CAAC,EAAE,CAA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hB,CAAC;CAEJ,CAAC;AACO,4BAAQ","file":"","sourceRoot":"/","sourcesContent":["\r\n//最大工具类 各种公共方法,以及处理上传,获取后端接口数据\r\nvar GameTool = {\r\n _startTime: 0,\r\n _endTime: 0,\r\n _totalTime: 0,\r\n //获取userId\r\n Authentication(){\r\n let name = \"user_\" + cc.fx.GameConfig.GM_INFO.gameId;\r\n var data = JSON.parse(localStorage.getItem(name));\r\n if(data == \"undifend\" || data==null || data == \"\"){\r\n let url = \"https://api.sparkus.cn/api/user/auth/login?domain=hui32579WdYPsgYq&callback=\"+location.href;\r\n window.location.href = url;\r\n }\r\n else{\r\n cc.fx.StorageMessage.setStorage(name,data);\r\n cc.fx.GameConfig.GM_INFO.userId = parseInt(data.userId);\r\n }\r\n },\r\n\r\n //埋点上传\r\n setGameData(){\r\n //GAME_DATA 初始化 每次清零\r\n cc.fx.GameConfig.GAME_DATA = [];\r\n cc.fx.GameConfig.GAME_DATA.push(cc.fx.GameConfig.CLICK_DATA);\r\n cc.fx.GameConfig.CLICK_init();\r\n let data = cc.fx.GameConfig.GAME_DATA;\r\n let matchId = this.getMatchId();\r\n let postData = {\r\n \"gameId\":cc.fx.GameConfig.GM_INFO.gameId,\r\n \"userId\":cc.fx.GameConfig.GM_INFO.userId,\r\n \"matchId\":matchId,\r\n \"data\": data\r\n };\r\n\r\n console.log(\"上传数据:\");\r\n cc.fx.HttpUtil.uploadUserLogData(postData,function(){})\r\n },\r\n //上传排行榜 type为1\r\n setRank(data){\r\n //GAME_DATA 初始化 每次清零\r\n let postData = {\r\n \"gameId\":cc.fx.GameConfig.GM_INFO.gameId,\r\n \"userId\":cc.fx.GameConfig.GM_INFO.userId,\r\n \"type\":1,\r\n \"totleTimes\": data.totleTimes,\r\n \"accuracy\": data.accuracy,\r\n \"success\": cc.fx.GameConfig.GM_INFO.success\r\n };\r\n cc.fx.HttpUtil.rankData(1,function(){},postData);\r\n },\r\n //获取排行榜 type为2\r\n getRank(data,callback){\r\n let rankLength = data.length;\r\n let postData = {\r\n \"gameId\":cc.fx.GameConfig.GM_INFO.gameId,\r\n \"userId\":cc.fx.GameConfig.GM_INFO.userId,\r\n \"page\":1,\r\n \"pageSize\":rankLength\r\n }; \r\n //回调进getRankData\r\n cc.fx.HttpUtil.rankData(2,data =>{callback(data)},postData);\r\n },\r\n //获取matchId 用于上传每次点击数据里面记录id方便查询\r\n getMatchId (){\r\n let matchId = cc.sys.localStorage.getItem(\"matchId\");\r\n let tempId = matchId;\r\n if(matchId == \"undifend\" || matchId==null){\r\n matchId = this.setMatchId();\r\n }\r\n else{\r\n if(this.containsNanana(matchId) == true){\r\n matchId = this.setMatchId();\r\n }\r\n else{\r\n let char = parseInt(tempId.substring(10,tempId.length));\r\n if(cc.fx.GameConfig.GM_INFO.level == 1){\r\n char += 1;\r\n matchId = tempId.slice(0, 10) + char + \"\";\r\n if(this.containsNanana(matchId)) matchId = this.setMatchId();\r\n cc.fx.GameConfig.GM_INFO.matchId = matchId;\r\n cc.sys.localStorage.setItem(\"matchId\",matchId);\r\n }\r\n }\r\n }\r\n\r\n if(this.containsNanana(matchId) == true){\r\n matchId = this.setMatchId();\r\n }\r\n return matchId;\r\n },\r\n //检测matchId 如果有缓存以前的nanana数据清除\r\n containsNanana(str) {\r\n return /na/i.test(str);\r\n },\r\n //重新设置MatchId\r\n setMatchId (){\r\n // 定义包含可用字符的字符集\r\n const characters = 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789';\r\n // 创建一个数组以保存随机字符\r\n const uuidArray = [];\r\n // 循环10次 生成10位的UUID\r\n for (let i = 0; i < 10; i++) {\r\n // 生成随机索引,范围是字符集的长度\r\n const randomIndex = Math.floor(Math.random() * characters.length);\r\n // 从字符集中获取随机字符\r\n const randomChar = characters.charAt(randomIndex);\r\n // 将字符添加到数组中\r\n uuidArray.push(randomChar);\r\n }\r\n let data = uuidArray.join('') + 1 + \"\";\r\n cc.sys.localStorage.setItem(\"matchNumber\",1);\r\n cc.sys.localStorage.setItem(\"matchId\",data);\r\n cc.fx.GameConfig.GM_INFO.matchId = data;\r\n return data;\r\n },\r\n //截取名字\r\n subName(name,length){\r\n if(name.length > length){\r\n name = name.substring(0,length) + \"...\"\r\n }\r\n return name;\r\n },\r\n //设置头像\r\n setPic(node,pic){\r\n node.active = false;\r\n let url = pic;\r\n setTimeout(() => {\r\n fetch(url)\r\n .then(response => {\r\n return response.headers.get('Content-Length');\r\n })\r\n .then(errNo => {\r\n if(errNo == \"5093\"){\r\n node.active = true;\r\n }\r\n })\r\n .catch(error => {\r\n console.error('Error fetching X-Info:', error);\r\n });\r\n }, 100);\r\n cc.assetManager.loadRemote(url, {ext:'.jpg'},(err, texture:cc.Texture2D) => {\r\n if(texture){\r\n node.active = true;\r\n node.getComponent(cc.Sprite).spriteFrame = new cc.SpriteFrame(texture);\r\n }\r\n else{\r\n console.log(err,texture)\r\n }\r\n })\r\n },\r\n //第一个参数把目标带进来处理,第二个参数为名字长度,不同场景不同需求\r\n //名字4短,小排行,名字6长,大排行\r\n getRankData(data,target,nameLength){\r\n target.listData = data.data.list;\r\n target.selfData = data.data.info;\r\n let rankData = [];\r\n let self = false;\r\n cc.fx.GameTool.setPic(target.selfNode.getChildByName(\"pic\").getChildByName(\"icon\"),target.selfData.pic);\r\n for(let i=0;i<=target.listData.length-1;i++){\r\n rankData.push({rank:(i+1), name:target.listData[i].nickName, total:target.listData[i].accuracy,time:target.listData[i].totleTimes, pic:target.listData[i].pic});\r\n if(cc.fx.GameConfig.GM_INFO.userId == target.listData[i].userId){\r\n self = true;\r\n target.rankNumber = i;\r\n target.selfNode.getChildByName(\"rankLab\").getComponent(cc.Label).string =(i+1) + \"\"; \r\n }\r\n if(i == (target.listData.length-1) && self == false){\r\n target.rankNumber = i;\r\n target.selfNode.getChildByName(\"rankLab\").getComponent(cc.Label).string = \"99+\"; \r\n }\r\n }\r\n cc.fx.GameTool.subName(target.selfData.nickName,nameLength);\r\n target.selfNode.getChildByName(\"nameLab\").getComponent(cc.Label).string = target.selfData.nickName;\r\n target.selfNode.getChildByName(\"totalLab\").getComponent(cc.Label).string = target.selfData.accuracy + \"%\";\r\n let timeTemp = cc.fx.GameTool.getTimeShenNong(target.selfData.totleTimes);\r\n target.selfNode.getChildByName(\"timeLab\").getComponent(cc.Label).string = timeTemp + \"\";\r\n switch(target.selfNode.getChildByName(\"rankLab\").getComponent(cc.Label).string){\r\n case \"1\":\r\n target.selfNode.getChildByName(\"rank\").getChildByName(\"one\").active = true;\r\n break;\r\n case \"2\":\r\n target.selfNode.getChildByName(\"rank\").getChildByName(\"two\").active = true;\r\n break;\r\n case \"3\":\r\n target.selfNode.getChildByName(\"rank\").getChildByName(\"three\").active = true;\r\n break;\r\n }\r\n // 大排行\r\n if(nameLength == 6){\r\n target.rankList.setData(rankData);\r\n target.selfNode.opacity = 255;\r\n if(target.selfData.totalSunCount == 0) target.selfNode.opacity = 0;\r\n }\r\n },\r\n\r\n getSeedRandom: function (min, max) {//包含min 不包含max\r\n console.log(\"随机数:\",cc.fx.GameConfig.GM_INFO.currSeed);\r\n max = max || 1;\r\n min = min || 0;\r\n cc.fx.GameConfig.GM_INFO.currSeed = (cc.fx.GameConfig.GM_INFO.currSeed * 9301 + 49297) % 233280;\r\n let rnd = cc.fx.GameConfig.GM_INFO.currSeed / 233280.0;\r\n let tmp = min + rnd * (max - min);\r\n return parseInt(tmp);\r\n },\r\n //获取关卡配置的那个关卡数\r\n getCustom(type){\r\n let custom = cc.fx.StorageMessage.getStorage(cc.fx.storageType.storageTypeCustom);\r\n if(custom == \"undifend\" || custom==null || custom == \"\"){\r\n this.setCustom();\r\n }\r\n else{\r\n cc.fx.GameConfig.GM_INFO_SET(\"custom\",custom[0]);\r\n if(custom[0] != 0 || type == true){\r\n custom.shift();\r\n if(custom.length == 0){\r\n this.setCustom();\r\n }\r\n else cc.fx.StorageMessage.setStorage(cc.fx.storageType.storageTypeCustom,custom);\r\n }\r\n }\r\n },\r\n //本地没有存储到配置,或者配置用完,重新创建配置\r\n setCustom(){\r\n let arrayLength = cc.fx.GameConfig.LEVEL_INFO.length;\r\n let arrayList = [];\r\n for(let i=1; i Math.random() - 0.5);\r\n arrayList.unshift(0)\r\n cc.fx.GameConfig.GM_INFO_SET(\"custom\",arrayList[0]);\r\n cc.fx.StorageMessage.setStorage(cc.fx.storageType.storageTypeCustom,arrayList);\r\n },\r\n\r\n getFoodName(food){\r\n var name = \"葡萄\";\r\n switch(food){\r\n case \"baishao\":\r\n name = \"白芍\";\r\n break;\r\n case \"jingjie\":\r\n name = \"荆芥\";\r\n break;\r\n case \"renshen\":\r\n name = \"人参\";\r\n break;\r\n case \"danshen\":\r\n name = \"丹参\";\r\n break;\r\n case \"danggui\":\r\n name = \"当归\";\r\n break;\r\n case \"gouqi\":\r\n name = \"枸杞\";\r\n break;\r\n case \"mudan\":\r\n name = \"牡丹\";\r\n break;\r\n case \"mulan\":\r\n name = \"木兰\";\r\n break;\r\n case \"pugongying\":\r\n name = \"蒲公英\";\r\n break;\r\n case \"moli\":\r\n name = \"茉莉\";\r\n break;\r\n case \"jinju\":\r\n name = \"金桔\";\r\n break;\r\n case \"dazao\":\r\n name = \"大枣\";\r\n break;\r\n case \"lizi\":\r\n name = \"李子\";\r\n break;\r\n case \"lizhi\":\r\n name = \"荔枝\";\r\n break;\r\n case \"taozi\":\r\n name = \"桃子\";\r\n break;\r\n case \"putao\":\r\n name = \"葡萄\";\r\n break;\r\n case \"muchai\":\r\n name = \"木柴\";\r\n break;\r\n case \"ganjiang\":\r\n name = \"干姜\";\r\n break;\r\n case \"zhuye\":\r\n name = \"竹叶\";\r\n break;\r\n case \"longyan\":\r\n name = \"龙眼\";\r\n break;\r\n case \"chixiaodou\":\r\n name = \"赤小豆\";\r\n break;\r\n case \"gancao\":\r\n name = \"甘草\";\r\n break;\r\n case \"cha\":\r\n name = \"茶\";\r\n break;\r\n }\r\n return name;\r\n },\r\n\r\n getSetScreenResolutionFlag: function () {\r\n let size = cc.winSize;\r\n let width = size.width;\r\n let height = size.height;\r\n if ((height / width) > (16.2 / 9)) return false;\r\n return true;\r\n },\r\n //判断全面屏适配\r\n setFit: function (canvas) {\r\n let flag = cc.fx.GameTool.getSetScreenResolutionFlag();\r\n if (flag) {\r\n \t// console.log(\"不是全面屏\");\r\n } else {\r\n \t// console.log(\"是全面屏\");\r\n }\r\n return flag;\r\n },\r\n //获取游戏信息\r\n getGameInfo: function(node){\r\n var jg = false;\r\n return jg;\r\n },\r\n //设置游戏信息\r\n setGameInfo: function(pd){\r\n \r\n },\r\n\r\n //打字机效果\r\n typingAni(label,text,cb,target){\r\n var self = target;\r\n var html = '';\r\n var arr = text.split('');\r\n var len = arr.length;\r\n var step = 0;\r\n self.func = ()=>{\r\n html += arr[step];\r\n label.string = html;\r\n if (++step == len) {\r\n self.unschedule(self.func);\r\n cb && cb();\r\n }\r\n }\r\n self.schedule(self.func,0.1, cc.macro.REPEAT_FOREVER, 0)\r\n },\r\n\r\n //输入秒,返回需要展示时间格式\r\n getTimeMargin:(second) => {\r\n let total = 0;\r\n total = second;\r\n let hour = 0;\r\n hour = parseInt((total / 3600) + \"\");//计算整数小时数\r\n let afterHour = total - hour * 60 * 60;//取得算出小时数后剩余的秒数\r\n let min = parseInt((afterHour / 60)+\"\");//计算整数分\r\n let m = \"\" + min; \r\n if(min < 10) m = \"0\"+min;\r\n let afterMin = total - hour * 60 * 60 - min * 60;//取得算出分后剩余的秒数\r\n let miao = afterMin + \"\";\r\n if(afterMin < 10) miao = \"0\" + afterMin;\r\n return m + ':' + miao\r\n },\r\n\r\n //输入秒,返回需要展示时间格式\r\n getTimeShenNong:(second) => {\r\n second = parseInt(second/1000+\"\");\r\n let total = 0;\r\n total = second;\r\n let min = 0;\r\n if(total > 60){\r\n min = parseInt((total / 60)+\"\");//计算整数分\r\n }\r\n let m = min + \"'\"; \r\n\r\n let afterMin = total - min * 60;//取得算出分后剩余的秒数\r\n let miao = afterMin + \"''\";\r\n return m + miao\r\n },\r\n\r\n //获取时间戳\r\n getTime(){\r\n const timestamp = new Date().getTime();\r\n return timestamp;\r\n },\r\n pushLister:function () {\r\n \r\n },\r\n removeAllLister:function () {\r\n \r\n },\r\n\r\n};\r\nexport { GameTool };"]} \ No newline at end of file +{"version":3,"sources":["assets\\Script\\module\\Tool\\GameTool.ts"],"names":[],"mappings":";;;;;;;AACA,+BAA+B;AAC/B,IAAI,QAAQ,GAAG;IACX,UAAU,EAAE,CAAC;IACb,QAAQ,EAAE,CAAC;IACX,UAAU,EAAE,CAAC;IACb,UAAU;IACV,cAAc;QACV,IAAI,IAAI,GAAG,OAAO,GAAG,EAAE,CAAC,EAAE,CAAC,UAAU,CAAC,OAAO,CAAC,MAAM,CAAC;QACrD,IAAI,IAAI,GAAG,IAAI,CAAC,KAAK,CAAC,YAAY,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC;QAClD,IAAG,IAAI,IAAI,UAAU,IAAI,IAAI,IAAE,IAAI,IAAI,IAAI,IAAI,EAAE,EAAC;YAC9C,IAAI,GAAG,GAAG,8EAA8E,GAAC,QAAQ,CAAC,IAAI,CAAC;YACvG,MAAM,CAAC,QAAQ,CAAC,IAAI,GAAG,GAAG,CAAC;SAC9B;aACG;YACA,EAAE,CAAC,EAAE,CAAC,cAAc,CAAC,UAAU,CAAC,IAAI,EAAC,IAAI,CAAC,CAAC;YAC3C,EAAE,CAAC,EAAE,CAAC,UAAU,CAAC,OAAO,CAAC,MAAM,GAAG,QAAQ,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;SAC3D;IACL,CAAC;IAED,MAAM;IACN,WAAW;QACP,oBAAoB;QACpB,EAAE,CAAC,EAAE,CAAC,UAAU,CAAC,SAAS,GAAG,EAAE,CAAC;QAChC,EAAE,CAAC,EAAE,CAAC,UAAU,CAAC,SAAS,CAAC,IAAI,CAAC,EAAE,CAAC,EAAE,CAAC,UAAU,CAAC,UAAU,CAAC,CAAC;QAC7D,EAAE,CAAC,EAAE,CAAC,UAAU,CAAC,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,IAAI,KAAK,GAAG,CAAC,CAAC;QACd,KAAK,GAAG,MAAM,CAAC;QACf,IAAI,GAAG,GAAG,CAAC,CAAC;QACZ,IAAG,KAAK,GAAG,EAAE,EAAC;YACV,GAAG,GAAG,QAAQ,CAAC,CAAC,KAAK,GAAG,EAAE,CAAC,GAAC,EAAE,CAAC,CAAC,CAAA,OAAO;SAC1C;QACD,IAAI,CAAC,GAAI,GAAG,GAAG,GAAG,CAAC;QAEnB,IAAI,QAAQ,GAAG,KAAK,GAAG,GAAG,GAAG,EAAE,CAAC,CAAA,aAAa;QAC7C,IAAI,IAAI,GAAG,QAAQ,GAAG,IAAI,CAAC;QAC3B,OAAO,CAAC,GAAG,IAAI,CAAA;IACnB,CAAC;IAED,OAAO;IACP,OAAO;QACH,IAAM,SAAS,GAAI,CAAC,IAAI,IAAI,EAAE,CAAC,OAAO,EAAE,CAAC,CAAA;QACzC,OAAO,SAAS,CAAC;IACrB,CAAC;IACD,UAAU,EAAC;IAEX,CAAC;IACD,eAAe,EAAC;IAEhB,CAAC;CAEJ,CAAC;AACO,4BAAQ","file":"","sourceRoot":"/","sourcesContent":["\r\n//最大工具类 各种公共方法,以及处理上传,获取后端接口数据\r\nvar GameTool = {\r\n _startTime: 0,\r\n _endTime: 0,\r\n _totalTime: 0,\r\n //获取userId\r\n Authentication(){\r\n let name = \"user_\" + cc.fx.GameConfig.GM_INFO.gameId;\r\n var data = JSON.parse(localStorage.getItem(name));\r\n if(data == \"undifend\" || data==null || data == \"\"){\r\n let url = \"https://api.sparkus.cn/api/user/auth/login?domain=hui32579WdYPsgYq&callback=\"+location.href;\r\n window.location.href = url;\r\n }\r\n else{\r\n cc.fx.StorageMessage.setStorage(name,data);\r\n cc.fx.GameConfig.GM_INFO.userId = parseInt(data.userId);\r\n }\r\n },\r\n\r\n //埋点上传\r\n setGameData(){\r\n //GAME_DATA 初始化 每次清零\r\n cc.fx.GameConfig.GAME_DATA = [];\r\n cc.fx.GameConfig.GAME_DATA.push(cc.fx.GameConfig.CLICK_DATA);\r\n cc.fx.GameConfig.CLICK_init();\r\n let data = cc.fx.GameConfig.GAME_DATA;\r\n let matchId = this.getMatchId();\r\n let postData = {\r\n \"gameId\":cc.fx.GameConfig.GM_INFO.gameId,\r\n \"userId\":cc.fx.GameConfig.GM_INFO.userId,\r\n \"scode\":cc.fx.GameConfig.GM_INFO.scode,\r\n \"matchId\":matchId,\r\n \"data\": data\r\n };\r\n\r\n // console.log(\"上传数据:\",data);\r\n cc.fx.HttpUtil.uploadUserLogData(postData,function(){})\r\n },\r\n //上传排行榜 type为1\r\n setRank(data){\r\n //GAME_DATA 初始化 每次清零\r\n let postData = {\r\n \"gameId\":cc.fx.GameConfig.GM_INFO.gameId,\r\n \"userId\":cc.fx.GameConfig.GM_INFO.userId,\r\n \"type\":1,\r\n \"score\": data.score,\r\n \"accuracy\": data.date,\r\n \"success\": cc.fx.GameConfig.GM_INFO.success\r\n };\r\n cc.fx.HttpUtil.rankData(1,function(){},postData);\r\n },\r\n //获取排行榜 type为2\r\n getRank(data,callback){\r\n let rankLength = data.length;\r\n let postData = {\r\n \"gameId\":cc.fx.GameConfig.GM_INFO.gameId,\r\n \"userId\":cc.fx.GameConfig.GM_INFO.userId,\r\n \"page\":1,\r\n \"pageSize\":rankLength\r\n }; \r\n //回调进getRankData\r\n cc.fx.HttpUtil.rankData(2,data =>{callback(data)},postData);\r\n },\r\n //获取matchId 用于上传每次点击数据里面记录id方便查询\r\n getMatchId (){\r\n let matchId = cc.sys.localStorage.getItem(\"matchId\");\r\n let tempId = matchId;\r\n if(matchId == \"undifend\" || matchId==null){\r\n matchId = this.setMatchId();\r\n }\r\n else{\r\n if(this.containsNanana(matchId) == true){\r\n matchId = this.setMatchId();\r\n }\r\n else{\r\n let char = parseInt(tempId.substring(10,tempId.length));\r\n if(cc.fx.GameConfig.GM_INFO.level == 1){\r\n char += 1;\r\n matchId = tempId.slice(0, 10) + char + \"\";\r\n if(this.containsNanana(matchId)) matchId = this.setMatchId();\r\n cc.fx.GameConfig.GM_INFO.matchId = matchId;\r\n cc.sys.localStorage.setItem(\"matchId\",matchId);\r\n }\r\n }\r\n }\r\n\r\n if(this.containsNanana(matchId) == true){\r\n matchId = this.setMatchId();\r\n }\r\n return matchId;\r\n },\r\n //检测matchId 如果有缓存以前的nanana数据清除\r\n containsNanana(str) {\r\n return /na/i.test(str);\r\n },\r\n //重新设置MatchId\r\n setMatchId (){\r\n // 定义包含可用字符的字符集\r\n const characters = 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789';\r\n // 创建一个数组以保存随机字符\r\n const uuidArray = [];\r\n // 循环10次 生成10位的UUID\r\n for (let i = 0; i < 10; i++) {\r\n // 生成随机索引,范围是字符集的长度\r\n const randomIndex = Math.floor(Math.random() * characters.length);\r\n // 从字符集中获取随机字符\r\n const randomChar = characters.charAt(randomIndex);\r\n // 将字符添加到数组中\r\n uuidArray.push(randomChar);\r\n }\r\n let data = uuidArray.join('') + 1 + \"\";\r\n cc.sys.localStorage.setItem(\"matchNumber\",1);\r\n cc.sys.localStorage.setItem(\"matchId\",data);\r\n cc.fx.GameConfig.GM_INFO.matchId = data;\r\n return data;\r\n },\r\n //截取名字\r\n subName(name,length){\r\n if(name.length > length){\r\n name = name.substring(0,length) + \"...\"\r\n }\r\n return name;\r\n },\r\n //设置头像\r\n setPic(node,pic){\r\n node.active = false;\r\n let url = pic;\r\n setTimeout(() => {\r\n fetch(url)\r\n .then(response => {\r\n return response.headers.get('Content-Length');\r\n })\r\n .then(errNo => {\r\n if(errNo == \"5093\"){\r\n node.active = true;\r\n }\r\n })\r\n .catch(error => {\r\n // console.error('Error fetching X-Info:', error);\r\n });\r\n }, 100);\r\n cc.assetManager.loadRemote(url, {ext:'.png'},(err, texture:cc.Texture2D) => {\r\n if(texture){\r\n node.active = true;\r\n node.getComponent(cc.Sprite).spriteFrame = new cc.SpriteFrame(texture);\r\n }\r\n else{\r\n console.log(err,texture)\r\n }\r\n })\r\n },\r\n //第一个参数把目标带进来处理,第二个参数为名字长度,不同场景不同需求\r\n //名字4短,小排行,名字6长,大排行\r\n getRankData(data,target,nameLength){\r\n target.listData = data.data.list;\r\n target.selfData = data.data.info;\r\n let rankData = [];\r\n let self = false;\r\n cc.fx.GameTool.setPic(target.selfNode.getChildByName(\"pic\").getChildByName(\"icon\"),target.selfData.pic);\r\n for(let i=0;i<=target.listData.length-1;i++){\r\n rankData.push({rank:(i+1), name:target.listData[i].nickName, total:target.listData[i].score,time:null, pic:target.listData[i].pic});\r\n if(cc.fx.GameConfig.GM_INFO.userId == target.listData[i].userId){\r\n self = true;\r\n target.rankNumber = i;\r\n target.selfNode.getChildByName(\"rankLab\").getComponent(cc.Label).string =(i+1) + \"\"; \r\n }\r\n if(i == (target.listData.length-1) && self == false){\r\n target.rankNumber = i;\r\n target.selfNode.getChildByName(\"rankLab\").getComponent(cc.Label).string = \"99+\"; \r\n }\r\n }\r\n cc.fx.GameTool.subName(target.selfData.nickName,nameLength);\r\n target.selfNode.getChildByName(\"nameLab\").getComponent(cc.Label).string = target.selfData.nickName;\r\n target.selfNode.getChildByName(\"totalLab\").getComponent(cc.Label).string = target.selfData.score;\r\n let timeTemp = cc.fx.GameTool.getTimeShenNong(target.selfData.totleTimes);\r\n // target.selfNode.getChildByName(\"timeLab\").getComponent(cc.Label).string = timeTemp + \"\";\r\n switch(target.selfNode.getChildByName(\"rankLab\").getComponent(cc.Label).string){\r\n case \"1\":\r\n target.selfNode.getChildByName(\"rank\").getChildByName(\"one\").active = true;\r\n break;\r\n case \"2\":\r\n target.selfNode.getChildByName(\"rank\").getChildByName(\"two\").active = true;\r\n break;\r\n case \"3\":\r\n target.selfNode.getChildByName(\"rank\").getChildByName(\"three\").active = true;\r\n break;\r\n }\r\n // 大排行\r\n if(nameLength == 6){\r\n target.rankList.setData(rankData);\r\n target.selfNode.opacity = 255;\r\n if(target.selfData.totalSunCount == 0) target.selfNode.opacity = 0;\r\n }\r\n },\r\n\r\n getSeedRandom: function (min, max) {//包含min 不包含max\r\n console.log(\"随机数:\",cc.fx.GameConfig.GM_INFO.currSeed);\r\n max = max || 1;\r\n min = min || 0;\r\n cc.fx.GameConfig.GM_INFO.currSeed = (cc.fx.GameConfig.GM_INFO.currSeed * 9301 + 49297) % 233280;\r\n let rnd = cc.fx.GameConfig.GM_INFO.currSeed / 233280.0;\r\n let tmp = min + rnd * (max - min);\r\n return parseInt(tmp);\r\n },\r\n //获取关卡配置的那个关卡数\r\n getCustom(type){\r\n let custom = cc.fx.StorageMessage.getStorage(cc.fx.storageType.storageTypeCustom);\r\n if(custom == \"undifend\" || custom==null || custom == \"\"){\r\n this.setCustom();\r\n }\r\n else{\r\n cc.fx.GameConfig.GM_INFO_SET(\"custom\",custom[0]);\r\n if(custom[0] != 0 || type == true){\r\n custom.shift();\r\n if(custom.length == 0){\r\n this.setCustom();\r\n }\r\n else cc.fx.StorageMessage.setStorage(cc.fx.storageType.storageTypeCustom,custom);\r\n }\r\n }\r\n },\r\n //本地没有存储到配置,或者配置用完,重新创建配置\r\n setCustom(){\r\n let arrayLength = cc.fx.GameConfig.LEVEL_INFO.length;\r\n let arrayList = [];\r\n for(let i=1; i Math.random() - 0.5);\r\n arrayList.unshift(0)\r\n cc.fx.GameConfig.GM_INFO_SET(\"custom\",arrayList[0]);\r\n cc.fx.StorageMessage.setStorage(cc.fx.storageType.storageTypeCustom,arrayList);\r\n },\r\n\r\n\r\n getSetScreenResolutionFlag: function () {\r\n let size = cc.winSize;\r\n let width = size.width;\r\n let height = size.height;\r\n if ((height / width) > (16.2 / 9)) return false;\r\n return true;\r\n },\r\n //判断全面屏适配\r\n setFit: function (canvas) {\r\n let flag = cc.fx.GameTool.getSetScreenResolutionFlag();\r\n if (flag) {\r\n \t// console.log(\"不是全面屏\");\r\n } else {\r\n \t// console.log(\"是全面屏\");\r\n }\r\n return flag;\r\n },\r\n //获取游戏信息\r\n getGameInfo: function(node){\r\n var jg = false;\r\n return jg;\r\n },\r\n //设置游戏信息\r\n setGameInfo: function(pd){\r\n \r\n },\r\n\r\n //打字机效果\r\n typingAni(label,text,cb,target){\r\n var self = target;\r\n var html = '';\r\n var arr = text.split('');\r\n var len = arr.length;\r\n var step = 0;\r\n self.func = ()=>{\r\n html += arr[step];\r\n label.string = html;\r\n if (++step == len) {\r\n self.unschedule(self.func);\r\n cb && cb();\r\n }\r\n }\r\n self.schedule(self.func,0.1, cc.macro.REPEAT_FOREVER, 0)\r\n },\r\n\r\n //输入秒,返回需要展示时间格式\r\n getTimeMargin:(second) => {\r\n let total = 0;\r\n total = second;\r\n let hour = 0;\r\n hour = parseInt((total / 3600) + \"\");//计算整数小时数\r\n let afterHour = total - hour * 60 * 60;//取得算出小时数后剩余的秒数\r\n let min = parseInt((afterHour / 60)+\"\");//计算整数分\r\n let m = \"\" + min; \r\n if(min < 10) m = \"0\"+min;\r\n let afterMin = total - hour * 60 * 60 - min * 60;//取得算出分后剩余的秒数\r\n let miao = afterMin + \"\";\r\n if(afterMin < 10) miao = \"0\" + afterMin;\r\n return m + ':' + miao\r\n },\r\n\r\n //输入秒,返回需要展示时间格式\r\n getTimeShenNong:(second) => {\r\n second = parseInt(second/1000+\"\");\r\n let total = 0;\r\n total = second;\r\n let min = 0;\r\n if(total > 60){\r\n min = parseInt((total / 60)+\"\");//计算整数分\r\n }\r\n let m = min + \"'\"; \r\n\r\n let afterMin = total - min * 60;//取得算出分后剩余的秒数\r\n let miao = afterMin + \"''\";\r\n return m + miao\r\n },\r\n\r\n //获取时间戳\r\n getTime(){\r\n const timestamp = (new Date().getTime())\r\n return timestamp;\r\n },\r\n pushLister:function () {\r\n \r\n },\r\n removeAllLister:function () {\r\n \r\n },\r\n\r\n};\r\nexport { GameTool };"]} \ No newline at end of file diff --git a/library/imports/45/454ad829-851a-40ea-8ab9-941e828357ca.js b/library/imports/45/454ad829-851a-40ea-8ab9-941e828357ca.js index d7b3e68..fa98e6b 100644 --- a/library/imports/45/454ad829-851a-40ea-8ab9-941e828357ca.js +++ b/library/imports/45/454ad829-851a-40ea-8ab9-941e828357ca.js @@ -35,7 +35,6 @@ var NewClass = /** @class */ (function (_super) { } NewClass.prototype.start = function () { window.initMgr(); - debugger; cc.fx.GameConfig.init(true); // cc.fx.AudioManager.Instance.init(); this.testVersion.string = this.clientTestVersion; diff --git a/library/imports/45/454ad829-851a-40ea-8ab9-941e828357ca.js.map b/library/imports/45/454ad829-851a-40ea-8ab9-941e828357ca.js.map index 4803351..e7c435f 100644 --- a/library/imports/45/454ad829-851a-40ea-8ab9-941e828357ca.js.map +++ b/library/imports/45/454ad829-851a-40ea-8ab9-941e828357ca.js.map @@ -1 +1 @@ -{"version":3,"sources":["assets\\Script\\Load.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AACM,IAAA,KAAwC,EAAE,CAAC,UAAU,EAApD,OAAO,aAAA,EAAE,QAAQ,cAAA,EAAE,gBAAgB,sBAAiB,CAAC;AAG5D;IAAsC,4BAAY;IAAlD;QAAA,qEAoCC;QAjCG,eAAS,GAAY,KAAK,CAAC;QAG3B,uBAAiB,GAAW,OAAO,CAAC;QAGpC,iBAAW,GAAa,IAAI,CAAC;;IA2BjC,CAAC;IAzBG,wBAAK,GAAL;QACI,MAAM,CAAC,OAAO,EAAE,CAAC;QACjB,QAAQ,CAAC;QACT,EAAE,CAAC,EAAE,CAAC,UAAU,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;QAC5B,sCAAsC;QACtC,IAAI,CAAC,WAAW,CAAC,MAAM,GAAG,IAAI,CAAC,iBAAiB,CAAC;IACrD,CAAC;IAED,cAAc;IACd,4BAAS,GAAT;QACI,EAAE,CAAC,QAAQ,CAAC,SAAS,CAAC,WAAW,CAAC,CAAC;QACnC,uCAAuC;IAC3C,CAAC;IACD,gBAAgB;IAChB,2BAAQ,GAAR,UAAS,KAAK,EAAC,IAAI;QACf,EAAE,CAAC,EAAE,CAAC,UAAU,CAAC,OAAO,CAAC,MAAM,GAAG,QAAQ,CAAC,IAAI,CAAC,CAAC;QACjD,EAAE,CAAC,QAAQ,CAAC,SAAS,CAAC,WAAW,CAAC,CAAC;IACvC,CAAC;IACD,OAAO;IACP,2BAAQ,GAAR;QACI,EAAE,CAAC,QAAQ,CAAC,SAAS,CAAC,WAAW,CAAC,CAAC;IACvC,CAAC;IAES,yBAAM,GAAhB,UAAiB,EAAU;IAC3B,CAAC;IAhCD;QADC,QAAQ,CAAC,KAAK,CAAC;+CACW;IAG3B;QADC,QAAQ,CAAC,EAAE,CAAC;uDACuB;IAGpC;QADC,QAAQ,CAAC,EAAE,CAAC,KAAK,CAAC;iDACU;IATZ,QAAQ;QAD5B,OAAO;OACa,QAAQ,CAoC5B;IAAD,eAAC;CApCD,AAoCC,CApCqC,EAAE,CAAC,SAAS,GAoCjD;kBApCoB,QAAQ","file":"","sourceRoot":"/","sourcesContent":["\r\nconst {ccclass, property, requireComponent} = cc._decorator;\r\n\r\n@ccclass\r\nexport default class NewClass extends cc.Component {\r\n\r\n @property(false)\r\n localTest: boolean = false;\r\n\r\n @property(\"\")\r\n clientTestVersion: string = \"1.0.0\";\r\n\r\n @property(cc.Label)\r\n testVersion: cc.Label = null;\r\n\r\n start () {\r\n window.initMgr();\r\n debugger;\r\n cc.fx.GameConfig.init(true);\r\n // cc.fx.AudioManager.Instance.init();\r\n this.testVersion.string = this.clientTestVersion;\r\n }\r\n\r\n //开始游戏,跳转至引导页面\r\n startGame(){\r\n cc.director.loadScene(\"GameScene\");\r\n // cc.director.loadScene(\"GuideScene\");\r\n }\r\n //备用,用来测试跳转 指定关卡\r\n clickBtn(event,data){\r\n cc.fx.GameConfig.GM_INFO.custom = parseInt(data);\r\n cc.director.loadScene(\"GameScene\");\r\n } \r\n //打开排行榜\r\n openRank(){\r\n cc.director.loadScene(\"RankScene\");\r\n }\r\n \r\n protected update(dt: number): void {\r\n }\r\n}\r\n"]} \ No newline at end of file +{"version":3,"sources":["assets\\Script\\Load.ts"],"names":[],"mappings":";;;;;;;;;;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AS,GAmCjD;kBAnCoB,QAAQ","file":"","sourceRoot":"/","sourcesContent":["\r\nconst {ccclass, property, requireComponent} = cc._decorator;\r\n\r\n@ccclass\r\nexport default class NewClass extends cc.Component {\r\n\r\n @property(false)\r\n localTest: boolean = false;\r\n\r\n @property(\"\")\r\n clientTestVersion: string = \"1.0.0\";\r\n\r\n @property(cc.Label)\r\n testVersion: cc.Label = null;\r\n\r\n start () {\r\n window.initMgr();\r\n cc.fx.GameConfig.init(true);\r\n // cc.fx.AudioManager.Instance.init();\r\n this.testVersion.string = this.clientTestVersion;\r\n }\r\n\r\n //开始游戏,跳转至引导页面\r\n startGame(){\r\n cc.director.loadScene(\"GameScene\");\r\n // cc.director.loadScene(\"GuideScene\");\r\n }\r\n //备用,用来测试跳转 指定关卡\r\n clickBtn(event,data){\r\n cc.fx.GameConfig.GM_INFO.custom = parseInt(data);\r\n cc.director.loadScene(\"GameScene\");\r\n } \r\n //打开排行榜\r\n openRank(){\r\n cc.director.loadScene(\"RankScene\");\r\n }\r\n \r\n protected update(dt: number): void {\r\n }\r\n}\r\n"]} \ No newline at end of file diff --git a/library/imports/58/58403fe7-d7a2-426b-9b19-84d3236731a8.js b/library/imports/58/58403fe7-d7a2-426b-9b19-84d3236731a8.js index a0f47ac..8b62d87 100644 --- a/library/imports/58/58403fe7-d7a2-426b-9b19-84d3236731a8.js +++ b/library/imports/58/58403fe7-d7a2-426b-9b19-84d3236731a8.js @@ -30,31 +30,13 @@ var AudioManager = /** @class */ (function (_super) { var _this = _super !== null && _super.apply(this, arguments) || this; //背景音乐 _this.audioGameBgm0 = null; - _this.baishao_audio = null; - _this.cha_audio = null; - _this.chixiaodou_audio = null; - _this.danggui_audio = null; - _this.danshen_audio = null; - _this.dazao_audio = null; - _this.gancao_audio = null; - _this.ganjiang_audio = null; - _this.gouqi_audio = null; - _this.jingjie_audio = null; - _this.jinju_audio = null; - _this.lizhi_audio = null; - _this.lizi_audio = null; - _this.longyan_audio = null; - _this.moli_audio = null; - _this.muchai_audio = null; - _this.mudan_audio = null; - _this.mulan_audio = null; - _this.pugongying_audio = null; - _this.putao_audio = null; - _this.renshen_audio = null; - _this.taozi_audio = null; - _this.zhuye_audio = null; - _this.err = null; - _this.yes = null; + _this.chehui = null; + _this.jineng = null; + _this.qingkong = null; + _this.fangxiang = null; + _this.build = null; + _this.win = null; + _this.lose = null; return _this; } AudioManager_1 = AudioManager; @@ -94,6 +76,12 @@ var AudioManager = /** @class */ (function (_super) { volume = 1; cc.audioEngine.setEffectsVolume(1); cc.audioEngine.setMusicVolume(1); + if (audioSource.name == "lose") { + cc.audioEngine.setEffectsVolume(0.5); + } + else { + cc.audioEngine.setEffectsVolume(1); + } var context = cc.audioEngine.playEffect(audioSource, loop); if (callback) { cc.audioEngine.setFinishCallback(context, function () { @@ -231,79 +219,25 @@ var AudioManager = /** @class */ (function (_super) { ], AudioManager.prototype, "audioGameBgm0", void 0); __decorate([ property(cc.AudioClip) - ], AudioManager.prototype, "baishao_audio", void 0); + ], AudioManager.prototype, "chehui", void 0); __decorate([ property(cc.AudioClip) - ], AudioManager.prototype, "cha_audio", void 0); + ], AudioManager.prototype, "jineng", void 0); __decorate([ property(cc.AudioClip) - ], AudioManager.prototype, "chixiaodou_audio", void 0); + ], AudioManager.prototype, "qingkong", void 0); __decorate([ property(cc.AudioClip) - ], AudioManager.prototype, "danggui_audio", void 0); + ], AudioManager.prototype, "fangxiang", void 0); __decorate([ property(cc.AudioClip) - ], AudioManager.prototype, "danshen_audio", void 0); + ], AudioManager.prototype, "build", void 0); __decorate([ property(cc.AudioClip) - ], AudioManager.prototype, "dazao_audio", void 0); + ], AudioManager.prototype, "win", void 0); __decorate([ property(cc.AudioClip) - ], AudioManager.prototype, "gancao_audio", void 0); - __decorate([ - property(cc.AudioClip) - ], AudioManager.prototype, "ganjiang_audio", void 0); - __decorate([ - property(cc.AudioClip) - ], AudioManager.prototype, "gouqi_audio", void 0); - __decorate([ - property(cc.AudioClip) - ], AudioManager.prototype, "jingjie_audio", void 0); - __decorate([ - property(cc.AudioClip) - ], AudioManager.prototype, "jinju_audio", void 0); - __decorate([ - property(cc.AudioClip) - ], AudioManager.prototype, "lizhi_audio", void 0); - __decorate([ - property(cc.AudioClip) - ], AudioManager.prototype, "lizi_audio", void 0); - __decorate([ - property(cc.AudioClip) - ], AudioManager.prototype, "longyan_audio", void 0); - __decorate([ - property(cc.AudioClip) - ], AudioManager.prototype, "moli_audio", void 0); - __decorate([ - property(cc.AudioClip) - ], AudioManager.prototype, "muchai_audio", void 0); - __decorate([ - property(cc.AudioClip) - ], AudioManager.prototype, "mudan_audio", void 0); - __decorate([ - property(cc.AudioClip) - ], AudioManager.prototype, "mulan_audio", void 0); - __decorate([ - property(cc.AudioClip) - ], AudioManager.prototype, "pugongying_audio", void 0); - __decorate([ - property(cc.AudioClip) - ], AudioManager.prototype, "putao_audio", void 0); - __decorate([ - property(cc.AudioClip) - ], AudioManager.prototype, "renshen_audio", void 0); - __decorate([ - property(cc.AudioClip) - ], AudioManager.prototype, "taozi_audio", void 0); - __decorate([ - property(cc.AudioClip) - ], AudioManager.prototype, "zhuye_audio", void 0); - __decorate([ - property(cc.AudioClip) - ], AudioManager.prototype, "err", void 0); - __decorate([ - property(cc.AudioClip) - ], AudioManager.prototype, "yes", void 0); + ], AudioManager.prototype, "lose", void 0); AudioManager = AudioManager_1 = __decorate([ ccclass ], AudioManager); diff --git a/library/imports/58/58403fe7-d7a2-426b-9b19-84d3236731a8.js.map b/library/imports/58/58403fe7-d7a2-426b-9b19-84d3236731a8.js.map index 018a452..d5c3c5d 100644 --- a/library/imports/58/58403fe7-d7a2-426b-9b19-84d3236731a8.js.map +++ b/library/imports/58/58403fe7-d7a2-426b-9b19-84d3236731a8.js.map @@ -1 +1 @@ -{"version":3,"sources":["assets\\Script\\module\\Music\\AudioManager.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AAEM,IAAA,KAAsB,EAAE,CAAC,UAAU,EAAlC,OAAO,aAAA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AC,EAAE,CAAC,SAAS,CAAC;oDACS;IAEhC;QADC,QAAQ,CAAC,EAAE,CAAC,SAAS,CAAC;sDACW;IAElC;QADC,QAAQ,CAAC,EAAE,CAAC,SAAS,CAAC;qDACU;IAEjC;QADC,QAAQ,CAAC,EAAE,CAAC,SAAS,CAAC;qDACU;IAEjC;QADC,QAAQ,CAAC,EAAE,CAAC,SAAS,CAAC;0DACe;IAEtC;QADC,QAAQ,CAAC,EAAE,CAAC,SAAS,CAAC;qDACU;IAEjC;QADC,QAAQ,CAAC,EAAE,CAAC,SAAS,CAAC;uDACY;IAEnC;QADC,QAAQ,CAAC,EAAE,CAAC,SAAS,CAAC;qDACU;IAEjC;QADC,QAAQ,CAAC,EAAE,CAAC,SAAS,CAAC;qDACU;IAEjC;QADC,QAAQ,CAAC,EAAE,CAAC,SAAS,CAAC;6CACE;IAEzB;QADC,QAAQ,CAAC,EAAE,CAAC,SAAS,CAAC;6CACE;IAvDR,YAAY;QADhC,OAAO;OACa,YAAY,CA2QhC;IAAD,mBAAC;CA3QD,AA2QC,CA3QyC,EAAE,CAAC,SAAS,GA2QrD;kBA3QoB,YAAY;AA2QhC,CAAC;AAEF,2BAA2B","file":"","sourceRoot":"/","sourcesContent":["\n\nconst {ccclass, property} = cc._decorator;\n@ccclass\nexport default class AudioManager extends cc.Component {\n static _instance: any;\n //背景音乐\n @property(cc.AudioClip)\n audioGameBgm0: cc.AudioClip = null;\n\n @property(cc.AudioClip)\n baishao_audio: cc.AudioClip = null;\n @property(cc.AudioClip)\n cha_audio: cc.AudioClip = null;\n @property(cc.AudioClip)\n chixiaodou_audio: cc.AudioClip = null;\n @property(cc.AudioClip)\n danggui_audio: cc.AudioClip = null;\n @property(cc.AudioClip)\n danshen_audio: cc.AudioClip = null;\n @property(cc.AudioClip)\n dazao_audio: cc.AudioClip = null;\n @property(cc.AudioClip)\n gancao_audio: cc.AudioClip = null;\n @property(cc.AudioClip)\n ganjiang_audio: cc.AudioClip = null;\n @property(cc.AudioClip)\n gouqi_audio: cc.AudioClip = null;\n @property(cc.AudioClip)\n jingjie_audio: cc.AudioClip = null;\n @property(cc.AudioClip)\n jinju_audio: cc.AudioClip = null;\n @property(cc.AudioClip)\n lizhi_audio: cc.AudioClip = null;\n @property(cc.AudioClip)\n lizi_audio: cc.AudioClip = null;\n @property(cc.AudioClip)\n longyan_audio: cc.AudioClip = null;\n @property(cc.AudioClip)\n moli_audio: cc.AudioClip = null;\n @property(cc.AudioClip)\n muchai_audio: cc.AudioClip = null;\n @property(cc.AudioClip)\n mudan_audio: cc.AudioClip = null;\n @property(cc.AudioClip)\n mulan_audio: cc.AudioClip = null;\n @property(cc.AudioClip)\n pugongying_audio: cc.AudioClip = null;\n @property(cc.AudioClip)\n putao_audio: cc.AudioClip = null;\n @property(cc.AudioClip)\n renshen_audio: cc.AudioClip = null;\n @property(cc.AudioClip)\n taozi_audio: cc.AudioClip = null;\n @property(cc.AudioClip)\n zhuye_audio: cc.AudioClip = null;\n @property(cc.AudioClip)\n err: cc.AudioClip = null;\n @property(cc.AudioClip)\n yes: cc.AudioClip = null;\n\n\n mAudioMap: {};\n bgMusicVolume: number;\n effectMusicVolume: number;\n mMusicSwitch: number;\n mEffectSwitch: number;\n brickSound: any;\n reward: boolean;\n finish: boolean;\n rewardCount: number;\n mMusicKey: any;\n\n onLoad() {\n if (AudioManager._instance == null) {\n AudioManager._instance = this;\n cc.game.addPersistRootNode(this.node);\n }\n else {\n return;\n }\n this.reward = false;\n this.finish = false;\n this.rewardCount = 0;\n this.ctor();\n\n this.preload();\n }\n\n ctor () {\n this.mAudioMap = {};\n /**\n * 默认音量大小\n * @type {number}\n */\n this.bgMusicVolume = 0.1;\n this.effectMusicVolume = 1;\n\n this.mMusicSwitch = 1;\n this.mEffectSwitch = 1;\n }\n play (audioSource, loop, callback, isBgMusic) {\n // if (isBgMusic && !this.mMusicSwitch) return;\n // if (!isBgMusic && !this.mEffectSwitch) return;\n var volume = isBgMusic ? this.bgMusicVolume : this.effectMusicVolume;\n\n // if (cc.sys.isBrowser) {\n // if(audioSource == this.brickSound){\n // volume = 0.1;\n // } \n volume = 1;\n cc.audioEngine.setEffectsVolume(1);\n cc.audioEngine.setMusicVolume(1);\n \n var context = cc.audioEngine.playEffect(audioSource, loop);\n if (callback){\n cc.audioEngine.setFinishCallback(context, function(){\n callback.call(this);\n }.bind(this));\n }\n // cc.wwx.OutPut.log('play audio effect isBrowser: ' + context.src);\n\n this.mAudioMap[audioSource] = context;\n return audioSource;\n // } else {\n // return audioSource;\n // }\n }\n\n save () {\n // cc.wwx.Storage.setItem(cc.wwx.Storage.Key_Setting_Music_Volume, this.mMusicSwitch);\n // cc.wwx.Storage.setItem(cc.wwx.Storage.Key_Setting_Effect_Volume, this.mEffectSwitch);\n }\n\n // static get Instance()\n // {\n // if (this._instance == null)\n // {\n // this._instance = new AudioManager();\n // }\n // return this._instance;\n // }\n\n preload () {\n if (!(cc.sys.platform === cc.sys.WECHAT_GAME)) { return; }\n\n var musics = [\n this.audioGameBgm0,\n ];\n musics.forEach(function(path) {\n })\n }\n\n getAudioMusicSwitch()\n {\n return this.mMusicSwitch;\n\n }\n getAudioEffectSwitch()\n {\n return this.mEffectSwitch;\n }\n trunAudioSound(on)\n {\n this.switchMusic(on);\n this.switchEffect(on)\n }\n switchMusic (on) {\n if (this.mMusicSwitch != (on?1:0))\n {\n this.mMusicSwitch = 1-this.mMusicSwitch;\n // this.save();\n }\n if(on)\n {\n this.playMusicGame();\n }\n else\n {\n this.stopMusic();\n }\n }\n switchEffect (on) {\n if (this.mEffectSwitch != (on?1:0)){\n this.mEffectSwitch = 1-this.mEffectSwitch;\n // this.save();\n\n }\n }\n onHide () {\n cc.audioEngine.pauseAll();\n }\n\n onShow () {\n cc.audioEngine.resumeAll();\n }\n\n //播放音效\n playEffect(name,callback){\n if(this[name])\n return this.play(this[name], false,callback,this.mEffectSwitch);\n }\n playMusic (key, callback, loop) {\n loop = typeof loop == 'undefined' || loop ? true : false;\n this.stopMusic();\n this.mMusicKey = this.play(key, loop, callback, true);\n }\n /**\n * 游戏背景音乐\n */\n playMusicGame () {\n this.playMusic(this.audioGameBgm0,{},true);\n }\n /**\n * 停止背景音乐播放\n */\n stopMusic () {\n // cc.wwx.OutPut.log('stopMusic audio effect wx: ' + this.mMusicKey);\n\n var context = this.mAudioMap[this.mMusicKey];\n\n if (typeof(context) != 'undefined') {\n if (cc.sys.isBrowser) {\n cc.audioEngine.stop(context);\n } else {\n context.stop();\n }\n cc.audioEngine.stop(context);\n\n }\n }\n\n /*\n * 游戏开始音效\n *\n */\n playGameStart()\n {\n \n }\n /*\n * 失败的游戏结束\n */\n playGameOver()\n {\n\n }\n /*\n * 成功的游戏结束\n */\n playGameResultFailed()\n {\n\n }\n /*\n * 成功的游戏结束\n */\n playGameResultSuccess()\n {\n\n }\n /**\n * 报警的音效\n */\n\n /**\n * 按钮\n */\n playAudioButton () {\n // return this.play(this.audioButtonClick, false,null,this.mEffectSwitch);\n }\n};\n\n// export { AudioManager };\n"]} \ No newline at end of file +{"version":3,"sources":["assets\\Script\\module\\Music\\AudioManager.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AAEM,IAAA,KAAsB,EAAE,CAAC,UAAU,EAAlC,OAAO,aAAA,EAAE,QAAQ,cAAiB,CAAC;AAE1C;IAA0C,gCAAY;IAAtD;QAAA,qEA8OC;QA5OG,MAAM;QAEN,mBAAa,GAAiB,IAAI,CAAC;QAGnC,YAAM,GAAiB,IAAI,CAAC;QAE5B,YAAM,GAAiB,IAAI,CAAC;QAE5B,cAAQ,GAAiB,IAAI,CAAC;QAE9B,eAAS,GAAiB,IAAI,CAAC;QAE/B,WAAK,GAAiB,IAAI,CAAC;QAE3B,SAAG,GAAiB,IAAI,CAAC;QAEzB,UAAI,GAAiB,IAAI,CAAC;;IA2N9B,CAAC;qBA9OoB,YAAY;IAmC7B,6BAAM,GAAN;QACI,IAAI,cAAY,CAAC,SAAS,IAAI,IAAI,EAAE;YAChC,c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mBAAC;CA9OD,AA8OC,CA9OyC,EAAE,CAAC,SAAS,GA8OrD;kBA9OoB,YAAY;AA8OhC,CAAC;AAEF,2BAA2B","file":"","sourceRoot":"/","sourcesContent":["\n\nconst {ccclass, property} = cc._decorator;\n@ccclass\nexport default class AudioManager extends cc.Component {\n static _instance: any;\n //背景音乐\n @property(cc.AudioClip)\n audioGameBgm0: cc.AudioClip = null;\n\n @property(cc.AudioClip)\n chehui: cc.AudioClip = null;\n @property(cc.AudioClip)\n jineng: cc.AudioClip = null;\n @property(cc.AudioClip)\n qingkong: cc.AudioClip = null;\n @property(cc.AudioClip)\n fangxiang: cc.AudioClip = null;\n @property(cc.AudioClip)\n build: cc.AudioClip = null;\n @property(cc.AudioClip)\n win: cc.AudioClip = null;\n @property(cc.AudioClip)\n lose: cc.AudioClip = null;\n\n\n\n\n mAudioMap: {};\n bgMusicVolume: number;\n effectMusicVolume: number;\n mMusicSwitch: number;\n mEffectSwitch: number;\n brickSound: any;\n reward: boolean;\n finish: boolean;\n rewardCount: number;\n mMusicKey: any;\n\n onLoad() {\n if (AudioManager._instance == null) {\n AudioManager._instance = this;\n cc.game.addPersistRootNode(this.node);\n }\n else {\n return;\n }\n this.reward = false;\n this.finish = false;\n this.rewardCount = 0;\n this.ctor();\n\n this.preload();\n }\n\n ctor () {\n this.mAudioMap = {};\n /**\n * 默认音量大小\n * @type {number}\n */\n this.bgMusicVolume = 0.1;\n this.effectMusicVolume = 1;\n\n this.mMusicSwitch = 1;\n this.mEffectSwitch = 1;\n }\n play (audioSource, loop, callback, isBgMusic) {\n // if (isBgMusic && !this.mMusicSwitch) return;\n // if (!isBgMusic && !this.mEffectSwitch) return;\n var volume = isBgMusic ? this.bgMusicVolume : this.effectMusicVolume;\n\n // if (cc.sys.isBrowser) {\n // if(audioSource == this.brickSound){\n // volume = 0.1;\n // } \n volume = 1;\n cc.audioEngine.setEffectsVolume(1);\n cc.audioEngine.setMusicVolume(1);\n if(audioSource.name == \"lose\"){\n cc.audioEngine.setEffectsVolume(0.5);\n }\n else{\n cc.audioEngine.setEffectsVolume(1);\n }\n var context = cc.audioEngine.playEffect(audioSource, loop);\n if (callback){\n cc.audioEngine.setFinishCallback(context, function(){\n callback.call(this);\n }.bind(this));\n }\n // cc.wwx.OutPut.log('play audio effect isBrowser: ' + context.src);\n\n this.mAudioMap[audioSource] = context;\n return audioSource;\n // } else {\n // return audioSource;\n // }\n }\n\n save () {\n // cc.wwx.Storage.setItem(cc.wwx.Storage.Key_Setting_Music_Volume, this.mMusicSwitch);\n // cc.wwx.Storage.setItem(cc.wwx.Storage.Key_Setting_Effect_Volume, this.mEffectSwitch);\n }\n\n // static get Instance()\n // {\n // if (this._instance == null)\n // {\n // this._instance = new AudioManager();\n // }\n // return this._instance;\n // }\n\n preload () {\n if (!(cc.sys.platform === cc.sys.WECHAT_GAME)) { return; }\n\n var musics = [\n this.audioGameBgm0,\n ];\n musics.forEach(function(path) {\n })\n }\n\n getAudioMusicSwitch()\n {\n return this.mMusicSwitch;\n\n }\n getAudioEffectSwitch()\n {\n return this.mEffectSwitch;\n }\n trunAudioSound(on)\n {\n this.switchMusic(on);\n this.switchEffect(on)\n }\n switchMusic (on) {\n if (this.mMusicSwitch != (on?1:0))\n {\n this.mMusicSwitch = 1-this.mMusicSwitch;\n // this.save();\n }\n if(on)\n {\n this.playMusicGame();\n }\n else\n {\n this.stopMusic();\n }\n }\n switchEffect (on) {\n if (this.mEffectSwitch != (on?1:0)){\n this.mEffectSwitch = 1-this.mEffectSwitch;\n // this.save();\n\n }\n }\n onHide () {\n cc.audioEngine.pauseAll();\n }\n\n onShow () {\n cc.audioEngine.resumeAll();\n }\n\n //播放音效\n playEffect(name,callback){\n if(this[name])\n return this.play(this[name], false,callback,this.mEffectSwitch);\n }\n playMusic (key, callback, loop) {\n loop = typeof loop == 'undefined' || loop ? true : false;\n this.stopMusic();\n this.mMusicKey = this.play(key, loop, callback, true);\n }\n /**\n * 游戏背景音乐\n */\n playMusicGame () {\n this.playMusic(this.audioGameBgm0,{},true);\n }\n /**\n * 停止背景音乐播放\n */\n stopMusic () {\n // cc.wwx.OutPut.log('stopMusic audio effect wx: ' + this.mMusicKey);\n\n var context = this.mAudioMap[this.mMusicKey];\n\n if (typeof(context) != 'undefined') {\n if (cc.sys.isBrowser) {\n cc.audioEngine.stop(context);\n } else {\n context.stop();\n }\n cc.audioEngine.stop(context);\n\n }\n }\n\n /*\n * 游戏开始音效\n *\n */\n playGameStart()\n {\n \n }\n /*\n * 失败的游戏结束\n */\n playGameOver()\n {\n\n }\n /*\n * 成功的游戏结束\n */\n playGameResultFailed()\n {\n\n }\n /*\n * 成功的游戏结束\n */\n playGameResultSuccess()\n {\n\n }\n /**\n * 报警的音效\n */\n\n /**\n * 按钮\n */\n playAudioButton () {\n // return this.play(this.audioButtonClick, false,null,this.mEffectSwitch);\n }\n};\n\n// export { AudioManager };\n"]} \ No newline at end of file diff --git a/library/imports/72/7290c680-dfdc-4c59-9736-a614cc2a8bcf.js b/library/imports/72/7290c680-dfdc-4c59-9736-a614cc2a8bcf.js index 8a939b2..f5052fb 100644 --- a/library/imports/72/7290c680-dfdc-4c59-9736-a614cc2a8bcf.js +++ b/library/imports/72/7290c680-dfdc-4c59-9736-a614cc2a8bcf.js @@ -42,7 +42,7 @@ var __generator = (this && this.__generator) || function (thisArg, body) { Object.defineProperty(exports, "__esModule", { value: true }); exports.WeChat = void 0; var shareConfig = { - gameId: "100010", + gameId: "100009", shareLine: "zDLsruVI", EK: "hui231%1" }; @@ -58,6 +58,7 @@ var WeChat = /** @class */ (function () { WeChat.getResult = function (res) { if (res) { var data = res.data; + // @ts-ignore wx.config({ debug: false, appId: data.appId, @@ -66,40 +67,46 @@ var WeChat = /** @class */ (function () { signature: data.signature, jsApiList: ['onMenuShareTimeline', 'updateAppMessageShareData', 'updateTimelineShareData', 'onMenuShareAppMessage'] }); + // @ts-ignore wx.checkJsApi({ jsApiList: ['updateAppMessageShareData'], success: function (res) { setTimeout(function () { WeChat.changeShare(); - }, 100); + }, 200); setTimeout(function () { WeChat.changeShare(); - }, 200); + }, 500); } }); } }; WeChat.changeShare = function () { + // @ts-ignore wx.ready(function () { + // @ts-ignore wx.updateAppMessageShareData({ title: '记忆力认知测评', - desc: '你的认知灵活性和选择注意有问题吗', + desc: '你的注意力和工作记忆有问题吗?', link: shareConfig.shareLine, - imgUrl: 'https://static.sparkus.cn/public/shennong.jpg', + imgUrl: 'https://static.sparkus.cn/public/shootsun.jpg', success: function () { // 设置成功 console.log("分享好友成功回调"); } }); - wx.updateTimelineShareData({ - title: '记忆力认知测评', - link: shareConfig.shareLine, - imgUrl: 'https://static.sparkus.cn/public/shennong.jpg', - success: function () { - // 设置成功 - console.log("分享朋友圈成功回调"); - } - }); + setTimeout(function () { + // @ts-ignore + wx.updateTimelineShareData({ + title: '记忆力认知测评', + link: shareConfig.shareLine, + imgUrl: 'https://static.sparkus.cn/public/shootsun.jpg', + success: function () { + // 设置成功 + console.log("分享朋友圈成功回调"); + } + }); + }, 200); }); }; WeChat.getSignature = function (url) { @@ -112,8 +119,8 @@ var WeChat = /** @class */ (function () { var time, url; return __generator(this, function (_a) { time = Math.floor((new Date().getTime()) / 1000); - url = cc.fx.HttpUtil.apiSign("/api/share/cfg?gameId=" + shareConfig.gameId + "&time=" + time + "&url=" + shareUrl, {}); - return [2 /*return*/, cc.fx.HttpUtil.get(url, callback)]; + url = cc.fx.HttpUtil.apiSign("/api/share/cfg?gameId=" + cc.fx.GameConfig.GM_INFO.gameId + "&time=" + time + "&url=" + shareUrl, {}); + return [2 /*return*/, cc.fx.HttpUtil.get(url, callback, 3)]; }); }); }; diff --git a/library/imports/72/7290c680-dfdc-4c59-9736-a614cc2a8bcf.js.map b/library/imports/72/7290c680-dfdc-4c59-9736-a614cc2a8bcf.js.map index 2551206..cf521a7 100644 --- a/library/imports/72/7290c680-dfdc-4c59-9736-a614cc2a8bcf.js.map +++ b/library/imports/72/7290c680-dfdc-4c59-9736-a614cc2a8bcf.js.map @@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ACrB,OAAO,OAAO,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;IAC7B,CAAC;IAEM,wBAAiB,GAAxB,UAAyB,GAAG;QACxB,OAAO,GAAG,CAAC,OAAO,CAAC,OAAO,EAAE,EAAE,CAAC,CAAC;IACpC,CAAC;IAEL,aAAC;AAAD,CA5EA,AA4EC,IAAA;AA5EY,wBAAM","file":"","sourceRoot":"/","sourcesContent":["\n\nvar shareConfig = {\n gameId: \"100010\",\n shareLine: \"zDLsruVI\",\n EK:\"hui231%1\"\n };\n\n// 定义微信配置数据的接口\ninterface IWeChatConfig {\n appId: string;\n timestamp: number;\n nonceStr: string;\n signature: string;\n jsApiList: [];\n}\n\n// 微信操作类\nexport class WeChat {\n static setShare(url) {\n var urlTemp = this.removeQueryParams(url);\n shareConfig.shareLine = urlTemp;\n WeChat.getSignature(url);\n }\n\n static getResult(res){\n if(res){\n var data = res.data;\n wx.config({\n debug: false,\n appId: data.appId,\n timestamp: data.timestamp,\n nonceStr: data.nonceStr,\n signature: data.signature,\n jsApiList: ['onMenuShareTimeline','updateAppMessageShareData', 'updateTimelineShareData', 'onMenuShareAppMessage']\n });\n wx.checkJsApi({\n jsApiList: ['updateAppMessageShareData'], // 需要检测的JS接口列表,所有JS接口列表见附录2,\n success: function(res) {\n setTimeout(() => { \n WeChat.changeShare();\n }, 100);\n setTimeout(() => {\n WeChat.changeShare();\n }, 200);\n }\n });\n }\n }\n\n static changeShare(){\n wx.ready(() => {\n wx.updateAppMessageShareData({ \n title: '记忆力认知测评', // 分享标题\n desc: '你的认知灵活性和选择注意有问题吗', // 分享描述\n link: shareConfig.shareLine, // 分享链接,该链接域名或路径必须与当前页面对应的公众号JS安全域名一致\n imgUrl: 'https://static.sparkus.cn/public/shennong.jpg', // 分享图标\n success: function () {\n // 设置成功\n console.log(\"分享好友成功回调\");\n }\n });\n wx.updateTimelineShareData({ \n title: '记忆力认知测评', // 分享标题\n link: shareConfig.shareLine, // 分享链接,该链接域名或路径必须与当前页面对应的公众号JS安全域名一致\n imgUrl: 'https://static.sparkus.cn/public/shennong.jpg', // 分享图标\n success: function () {\n // 设置成功\n console.log(\"分享朋友圈成功回调\");\n }\n })\n }); \n }\n\n static getSignature(url: string): Promise {\n return new Promise((resolve) => {\n WeChat.getShareInfo((encodeURIComponent(url)),WeChat.getResult);\n });\n }\n static async getShareInfo(shareUrl: string, callback:Function): Promise {\n const time = Math.floor((new Date().getTime()) / 1000)\n const url = cc.fx.HttpUtil.apiSign(`/api/share/cfg?gameId=${shareConfig.gameId}&time=${time}&url=${shareUrl}`,{})\n return cc.fx.HttpUtil.get(url,callback)\n }\n\n \n static containsNanana(str) {\n return /test/i.test(str);\n }\n\n static removeQueryParams(url) {\n return url.replace(/\\?.*$/, '');\n }\n\n}\n"]} \ No newline at end of file +{"version":3,"sources":["assets\\Script\\module\\Share\\share.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAEA,IAAI,WAAW,GAAG;IACd,MAAM,EAAE,QAAQ;IAChB,SAAS,EAAE,UAAU;IACrB,EAAE,EAAC,UAAU;CACd,CAAC;AAWJ,QAAQ;AACR;IAAA;IAoFA,CAAC;IAnFU,eAAQ,GAAf,UAAgB,GAAG;QACf,IAAI,OAAO,GAAG,IAAI,CAAC,iBAAiB,CAAC,GAAG,CAAC,CAAC;QAC1C,WAAW,CAAC,SAAS,GAAG,OAAO,CAAC;QAChC,MAAM,CAAC,YAAY,CAAC,GAAG,CAAC,CAAC;IAC7B,CAAC;IAEM,gBAAS,GAAhB,UAAiB,GAAG;QAChB,IAAG,GAAG,EAAC;YACH,IAAI,IAAI,GAAG,GAAG,CAAC,IAAI,CAAC;YACpB,aAAa;YACb,EAAE,CAAC,MAAM,CAAC;gBACN,KAAK,EAAE,KAAK;gBACZ,KAAK,EAAE,IAAI,CAAC,KAAK;gBACjB,SAAS,EAAE,IAAI,CAAC,SAAS;gBACzB,QAAQ,EAAE,IAAI,CAAC,QAAQ;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AAM,CAAC,YAAY,CAAC,CAAC,kBAAkB,CAAC,GAAG,CAAC,CAAC,EAAC,MAAM,CAAC,SAAS,CAAC,CAAC;QACpE,CAAC,CAAC,CAAC;IACP,CAAC;IACY,mBAAY,GAAzB,UAA0B,QAAgB,EAAE,QAAiB;uCAAG,OAAO;;;gBAC7D,IAAI,GAAG,IAAI,CAAC,KAAK,CAAC,CAAC,IAAI,IAAI,EAAE,CAAC,OAAO,EAAE,CAAC,GAAG,IAAI,CAAC,CAAA;gBAChD,GAAG,GAAG,EAAE,CAAC,EAAE,CAAC,QAAQ,CAAC,OAAO,CAAC,2BAAyB,EAAE,CAAC,EAAE,CAAC,UAAU,CAAC,OAAO,CAAC,MAAM,cAAS,IAAI,aAAQ,QAAU,EAAC,EAAE,CAAC,CAAA;gBAC9H,sBAAO,EAAE,CAAC,EAAE,CAAC,QAAQ,CAAC,GAAG,CAAC,GAAG,EAAC,QAAQ,EAAC,CAAC,CAAC,EAAA;;;KAC5C;IAGM,qBAAc,GAArB,UAAsB,GAAG;QACrB,OAAO,OAAO,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;IAC7B,CAAC;IAEM,wBAAiB,GAAxB,UAAyB,GAAG;QACxB,OAAO,GAAG,CAAC,OAAO,CAAC,OAAO,EAAE,EAAE,CAAC,CAAC;IACpC,CAAC;IAEL,aAAC;AAAD,CApFA,AAoFC,IAAA;AApFY,wBAAM","file":"","sourceRoot":"/","sourcesContent":["\n\nvar shareConfig = {\n gameId: \"100009\",\n shareLine: \"zDLsruVI\",\n EK:\"hui231%1\"\n };\n\n// 定义微信配置数据的接口\ninterface IWeChatConfig {\n appId: string;\n timestamp: number;\n nonceStr: string;\n signature: string;\n jsApiList: [];\n}\n\n// 微信操作类\nexport class WeChat {\n static setShare(url) {\n var urlTemp = this.removeQueryParams(url);\n shareConfig.shareLine = urlTemp;\n WeChat.getSignature(url);\n }\n\n static getResult(res){\n if(res){\n var data = res.data;\n // @ts-ignore\n wx.config({\n debug: false,\n appId: data.appId,\n timestamp: data.timestamp,\n nonceStr: data.nonceStr,\n signature: data.signature,\n jsApiList: ['onMenuShareTimeline','updateAppMessageShareData', 'updateTimelineShareData', 'onMenuShareAppMessage']\n });\n // @ts-ignore\n wx.checkJsApi({\n jsApiList: ['updateAppMessageShareData'], // 需要检测的JS接口列表,所有JS接口列表见附录2,\n success: function(res) {\n setTimeout(() => { \n WeChat.changeShare();\n }, 200);\n setTimeout(() => {\n WeChat.changeShare();\n }, 500);\n }\n });\n }\n }\n\n static changeShare(){\n // @ts-ignore\n wx.ready(() => {\n // @ts-ignore\n wx.updateAppMessageShareData({ \n title: '记忆力认知测评', // 分享标题\n desc: '你的注意力和工作记忆有问题吗?', // 分享描述\n link: shareConfig.shareLine, // 分享链接,该链接域名或路径必须与当前页面对应的公众号JS安全域名一致\n imgUrl: 'https://static.sparkus.cn/public/shootsun.jpg', // 分享图标\n success: function () {\n // 设置成功\n console.log(\"分享好友成功回调\");\n }\n });\n setTimeout(() => {\n // @ts-ignore\n wx.updateTimelineShareData({ \n title: '记忆力认知测评', // 分享标题\n link: shareConfig.shareLine, // 分享链接,该链接域名或路径必须与当前页面对应的公众号JS安全域名一致\n imgUrl: 'https://static.sparkus.cn/public/shootsun.jpg', // 分享图标\n success: function () {\n // 设置成功\n console.log(\"分享朋友圈成功回调\");\n }\n })\n }, 200);\n\n }); \n }\n\n static getSignature(url: string): Promise {\n return new Promise((resolve) => {\n WeChat.getShareInfo((encodeURIComponent(url)),WeChat.getResult);\n });\n }\n static async getShareInfo(shareUrl: string, callback:Function): Promise {\n const time = Math.floor((new Date().getTime()) / 1000)\n const url = cc.fx.HttpUtil.apiSign(`/api/share/cfg?gameId=${cc.fx.GameConfig.GM_INFO.gameId}&time=${time}&url=${shareUrl}`,{})\n return cc.fx.HttpUtil.get(url,callback,3)\n }\n\n \n static containsNanana(str) {\n return /test/i.test(str);\n }\n\n static removeQueryParams(url) {\n return url.replace(/\\?.*$/, '');\n }\n\n}\n"]} \ No newline at end of file diff --git a/library/imports/77/771a3d9a-4013-4654-a777-fbaea0c93280.js b/library/imports/77/771a3d9a-4013-4654-a777-fbaea0c93280.js index d8487ec..2b8bc2f 100644 --- a/library/imports/77/771a3d9a-4013-4654-a777-fbaea0c93280.js +++ b/library/imports/77/771a3d9a-4013-4654-a777-fbaea0c93280.js @@ -16,6 +16,17 @@ var __extends = (this && this.__extends) || (function () { d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; })(); +var __assign = (this && this.__assign) || function () { + __assign = Object.assign || function(t) { + for (var s, i = 1, n = arguments.length; i < n; i++) { + s = arguments[i]; + for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) + t[p] = s[p]; + } + return t; + }; + return __assign.apply(this, arguments); +}; var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) { var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); @@ -69,17 +80,6 @@ var HttpUtil = /** @class */ (function (_super) { return _super !== null && _super.apply(this, arguments) || this; } HttpUtil_1 = HttpUtil; - HttpUtil.getShareInfo = function (shareUrl) { - return __awaiter(this, void 0, Promise, function () { - var time, url; - return __generator(this, function (_a) { - console.log("设置分享链接:", shareUrl); - time = Math.floor((new Date().getTime()) / 1000); - url = HttpUtil_1.apiSign("/api/share/cfg?gameId=" + config.gameId + "&time=" + time + "&url=" + shareUrl, {}); - return [2 /*return*/, this.post(url, null, null)]; - }); - }); - }; //排行榜 HttpUtil.rankData = function (type, callback, data) { return __awaiter(this, void 0, Promise, function () { @@ -87,7 +87,7 @@ var HttpUtil = /** @class */ (function (_super) { return __generator(this, function (_a) { time = Math.floor((new Date().getTime()) / 1000); url = HttpUtil_1.apiSign("/api/get/rank/data?gameId=" + config.gameId + "&dataType=" + type + "&time=" + time, data); - this.post(url, data, callback); + this.post(url, data, callback, 0); return [2 /*return*/]; }); }); @@ -97,7 +97,7 @@ var HttpUtil = /** @class */ (function (_super) { var url; return __generator(this, function (_a) { url = '/log/collect/data'; - this.post(url, data, callback); + this.post(url, data, callback, 3); return [2 /*return*/]; }); }); @@ -109,17 +109,19 @@ var HttpUtil = /** @class */ (function (_super) { return __generator(this, function (_a) { time = Math.floor((new Date().getTime()) / 1000); url = HttpUtil_1.apiSign("/api/get/user/data?gameId=" + config.gameId + "&time=" + time, data); - this.post(url, data, callback); + this.post(url, data, callback, 0); return [2 /*return*/]; }); }); }; - HttpUtil.post = function (url, data, callback) { + HttpUtil.get = function (url, callback, count) { return __awaiter(this, void 0, void 0, function () { - var response; + var repeat, response; return __generator(this, function (_a) { switch (_a.label) { - case 0: return [4 /*yield*/, this.fetchData(url, data, 'POST')]; + case 0: + repeat = count ? count : 0; + return [4 /*yield*/, this.fetchData(url, null, 'GET', repeat)]; case 1: response = _a.sent(); callback && callback(response); @@ -128,12 +130,14 @@ var HttpUtil = /** @class */ (function (_super) { }); }); }; - HttpUtil.get = function (url, callback) { + HttpUtil.post = function (url, data, callback, count) { return __awaiter(this, void 0, void 0, function () { - var response; + var repeat, response; return __generator(this, function (_a) { switch (_a.label) { - case 0: return [4 /*yield*/, this.fetchData(url, null, 'GET')]; + case 0: + repeat = count ? count : 0; + return [4 /*yield*/, this.fetchData(url, data, 'POST', repeat)]; case 1: response = _a.sent(); callback && callback(response); @@ -142,9 +146,10 @@ var HttpUtil = /** @class */ (function (_super) { }); }); }; - HttpUtil.fetchData = function (url, data, method) { + HttpUtil.fetchData = function (url, data, method, repeat) { return __awaiter(this, void 0, void 0, function () { - var fullUrl, headers, options, response, error_1; + var fullUrl, headers, options, response, error_1, timeOut; + var _this = this; return __generator(this, function (_a) { switch (_a.label) { case 0: @@ -158,23 +163,58 @@ var HttpUtil = /** @class */ (function (_super) { _a.label = 1; case 1: _a.trys.push([1, 4, , 5]); - return [4 /*yield*/, fetch(fullUrl, options)]; + return [4 /*yield*/, this.fetchWithTimeout(fullUrl, options)]; case 2: response = _a.sent(); if (!response.ok) { - throw new Error("HTTP error! status: " + response.status); + throw new Error("HTTP_______________error! status: " + response.status); } return [4 /*yield*/, response.json()]; case 3: return [2 /*return*/, _a.sent()]; case 4: error_1 = _a.sent(); - console.error('Fetch error:', error_1); - return [2 /*return*/, null]; + console.error('Fetch_______________error:', error_1); + if (repeat > 0) { + repeat -= 1; + timeOut = (3 - repeat) * 5000; + setTimeout(function () { return __awaiter(_this, void 0, void 0, function () { + return __generator(this, function (_a) { + switch (_a.label) { + case 0: return [4 /*yield*/, this.fetchData(url, data, method, repeat)]; + case 1: + response = _a.sent(); + return [2 /*return*/]; + } + }); + }); }, timeOut); + } + else { + return [2 /*return*/, null]; + } + return [3 /*break*/, 5]; case 5: return [2 /*return*/]; } }); }); }; + HttpUtil.fetchWithTimeout = function (resource, options) { + if (options === void 0) { options = {}; } + return __awaiter(this, void 0, void 0, function () { + var controller, id, response; + return __generator(this, function (_a) { + switch (_a.label) { + case 0: + controller = new AbortController(); + id = setTimeout(function () { return controller.abort(); }, 5000); + return [4 /*yield*/, fetch(resource, __assign(__assign({}, options), { signal: controller.signal }))]; + case 1: + response = _a.sent(); + clearTimeout(id); + return [2 /*return*/, response]; + } + }); + }); + }; /** * * @param url {string} 接口地址 diff --git a/library/imports/77/771a3d9a-4013-4654-a777-fbaea0c93280.js.map b/library/imports/77/771a3d9a-4013-4654-a777-fbaea0c93280.js.map index a99e184..dd97975 100644 --- a/library/imports/77/771a3d9a-4013-4654-a777-fbaea0c93280.js.map +++ b/library/imports/77/771a3d9a-4013-4654-a777-fbaea0c93280.js.map @@ -1 +1 @@ -{"version":3,"sources":["assets\\Script\\module\\Crypto\\HttpUtil.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AACM,IAAA,KAAsB,EAAE,CAAC,UAAU,EAAlC,OAAO,aAAA,EAAE,QAAQ,cAAiB,CAAC;AAC1C,6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,CAAC,CAAC,CAAC,CAAC,EAAE;YAC/B,SAAS;SACV;QACD,SAAS,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC,GAAG,GAAG,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC,CAAC;KAC/C;IAED,oBAAoB;IACpB,IAAM,MAAM,GAAG,EAAE,CAAC;IAClB,KAAK,IAAM,GAAG,IAAI,SAAS,EAAE;QAC3B,MAAM,CAAC,IAAI,CAAI,kBAAkB,CAAC,GAAG,CAAC,SAAI,kBAAkB,CAAC,SAAS,CAAC,GAAG,CAAC,CAAG,CAAC,CAAC;KACjF;IACD,OAAO,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;AAC1B,CAAC;AAGD;;;;;GAKG;AAEH,SAAS,UAAU,CAAC,GAAW,EAAE,OAAe;IAC9C,IAAI,OAAO,GAAG,GAAG,CAAC,OAAO,CAAC,GAAG,EAAE,EAAE,CAAC,CAAA;IAClC,OAAO,GAAG,OAAO,GAAG,GAAG,GAAG,OAAO,CAAA;IACjC,OAAO,kBAAkB,CAAC,KAAK,CAAC,UAAU,CAAC,OAAO,CAAC,CAAC,CAAA;AACtD,CAAC;AACD,mBAAmB;AACnB,SAAS,SAAS,CAAC,GAAW;IACtB,IAAA,KAAyB,GAAG,CAAC,KAAK,CAAC,GAAG,EAAE,CAAC,CAAC,EAAzC,OAAO,QAAA,EAAE,WAAW,QAAqB,CAAC;IACjD,IAAM,MAAM,GAAG,IAAI,eAAe,CAAC,WAAW,CAAC,CAAC;IAChD,OAAU,OAAO,SAAI,MAAM,CAAC,QAAQ,EAAI,CAAC;AAC3C,CAAC","file":"","sourceRoot":"/","sourcesContent":["\r\nconst {ccclass, property} = cc._decorator;\r\nimport CryptoJS = require('./crypto-js.min.js'); //引用AES源码js\r\n\r\nconst BASE_URL = \"https://api.sparkus.cn\";\r\n//只负责网络接口 次类只负责和后端交互,不负责处理数据 数据处理在GameTool\r\n@ccclass\r\nexport default class HttpUtil extends cc.Component {\r\n static async getShareInfo(shareUrl: string): Promise {\r\n console.log(\"设置分享链接:\",shareUrl);\r\n const time = Math.floor((new Date().getTime()) / 1000)\r\n const url = HttpUtil.apiSign(`/api/share/cfg?gameId=${config.gameId}&time=${time}&url=${shareUrl}`,{})\r\n return this.post(url,null,null);\r\n }\r\n //排行榜\r\n static async rankData(type,callback,data): Promise {\r\n const time = Math.floor((new Date().getTime()) / 1000)\r\n const url = HttpUtil.apiSign(`/api/get/rank/data?gameId=${config.gameId}&dataType=${type}&time=${time}`, data)\r\n this.post(url,data,callback);\r\n }\r\n \r\n static async uploadUserLogData(data,callback): Promise {\r\n const url = '/log/collect/data';\r\n this.post(url,data,callback);\r\n }\r\n //暂时用不到\r\n static async getUserRecord(data,callback): Promise {\r\n const time = Math.floor((new Date().getTime()) / 1000)\r\n const url = HttpUtil.apiSign(`/api/get/user/data?gameId=${config.gameId}&time=${time}`, data)\r\n this.post(url,data,callback);\r\n }\r\n static async post(url, data, callback) {\r\n const response = await this.fetchData(url, data, 'POST');\r\n callback && callback(response);\r\n }\r\n\r\n static async get(url, callback) {\r\n const response = await this.fetchData(url, null, 'GET');\r\n callback && callback(response);\r\n }\r\n\r\n static async fetchData(url, data, method) {\r\n const fullUrl = `${BASE_URL}${url}`;\r\n const headers = { 'Content-Type': 'application/json' };\r\n const options = {\r\n method,\r\n headers,\r\n body: data ? JSON.stringify(data) : null,\r\n };\r\n\r\n try {\r\n const response = await fetch(fullUrl, options);\r\n if (!response.ok) {\r\n throw new Error(`HTTP error! status: ${response.status}`);\r\n }\r\n return await response.json();\r\n } catch (error) {\r\n console.error('Fetch error:', error);\r\n return null;\r\n }\r\n }\r\n\r\n /**\r\n * \r\n * @param url {string} 接口地址\r\n * @param params {object} 需要加密的参数对象\r\n */\r\n static apiSign(url: string, params = {}) {\r\n\r\n let convertUrl = url.trim()\r\n if (convertUrl.indexOf('?') === -1) {\r\n convertUrl += '?'\r\n }\r\n \r\n // 传入参数转换拼接字符串\r\n let postStr = getQueryString(params)\r\n \r\n const signedStr = genSignStr(convertUrl, postStr)\r\n const encryptStr = `sign=${signedStr}`\r\n\r\n let encryptSignStr = fxCry.encryptByDES(encryptStr, config.secretKey)\r\n encryptSignStr = encodeURIComponent(encryptSignStr)\r\n\r\n return `${urlencode(convertUrl)}&_p=${encryptSignStr}`\r\n }\r\n}\r\n\r\nfunction responseHandler(response: { data: any }) {\r\n return response.data\r\n}\r\n// 响应拦截器\r\n// Rq.interceptors.response.use(responseHandler)\r\nconst config = {\r\n gameId: \"100010\",\r\n secretKey: \"wozrGKsL\",\r\n EK:\"hui231%1\"\r\n};\r\n\r\ninterface CrypotoType {\r\n encryptByDES: any\r\n decryptByDES: any\r\n hmacSha256: any\r\n}\r\n \r\nclass Crypoto implements CrypotoType {\r\n // 加密的向明值,自己根据项目实际情况定,需要跟后端开发保持一致\r\n private keyHex = this.getHetKey()\r\n private getHetKey() {\r\n return CryptoJS.enc.Utf8.parse(config.EK);\r\n }\r\n\r\n /** DES加密 */\r\n encryptByDES(message: string, secret?: string) {\r\n if(!message) {\r\n return message\r\n }\r\n const key = secret? CryptoJS.enc.Utf8.parse(secret): this.keyHex\r\n const encrypted = CryptoJS.DES.encrypt(message, key, {\r\n mode: CryptoJS.mode.ECB,\r\n padding: CryptoJS.pad.Pkcs7\r\n });\r\n return encrypted.toString()\r\n }\r\n\r\n /** DES解密 */\r\n decryptByDES(message: string, secret?: string) {\r\n const key = secret? CryptoJS.enc.Utf8.parse(secret): this.keyHex\r\n\r\n const decrypted = CryptoJS.DES.decrypt({\r\n ciphertext: CryptoJS.enc.Base64.parse(message)\r\n }, key, {\r\n mode: CryptoJS.mode.ECB,\r\n padding: CryptoJS.pad.Pkcs7\r\n })\r\n\r\n return decrypted.toString(CryptoJS.enc.Utf8)\r\n }\r\n\r\n /** hmacSHA256加密 */\r\n hmacSha256(message: string, secret?: string) {\r\n const keyHex = secret? CryptoJS.enc.Utf8.parse(secret): this.keyHex\r\n \r\n const hash = CryptoJS.HmacSHA256(message, keyHex);\r\n return hash.toString()\r\n }\r\n\r\n /** hmacSHA256验证 */\r\n verifyHmacSha256(message: string, signature: string) {\r\n const hash = CryptoJS.HmacSHA256(message, this.keyHex);\r\n return hash.toString() === signature\r\n }\r\n \r\n /** CBC加密 */\r\n encryptCBC(word: string) {\r\n if (!word) {\r\n return word;\r\n }\r\n const srcs = CryptoJS.enc.Utf8.parse(word);\r\n const encrypted = CryptoJS.AES.encrypt(srcs, this.keyHex, {\r\n iv: this.keyHex,\r\n mode: CryptoJS.mode.CBC,\r\n padding: CryptoJS.pad.ZeroPadding\r\n });\r\n return encrypted.toString(); \r\n }\r\n \r\n /** CBC解密 */\r\n decryptCBC(word: string) {\r\n if (!word) {\r\n return word;\r\n }\r\n const encryptedHexStr = CryptoJS.enc.Hex.parse(word);\r\n const srcs = CryptoJS.enc.Base64.stringify(encryptedHexStr);\r\n const decrypt = CryptoJS.AES.decrypt(srcs, this.keyHex, {\r\n iv: this.keyHex,\r\n mode: CryptoJS.mode.CBC,\r\n padding: CryptoJS.pad.ZeroPadding\r\n });\r\n const decryptedStr = decrypt.toString(CryptoJS.enc.Utf8);\r\n return decryptedStr.toString();\r\n }\r\n}\r\nconst fxCry = new Crypoto();\r\n\r\nfunction isEmpty(data) {\r\n return data === \"\" || data === null || data === undefined || data.length === 0 || JSON.stringify(data) == \"{}\"\r\n}\r\n\r\nfunction getQueryString(obj) {\r\n // 首先对对象的键进行排序并过滤空值\r\n const sortedKeys = Object.keys(obj).sort();\r\n const sortedObj = {};\r\n for (let i = 0; i < sortedKeys.length; i++) {\r\n if (isEmpty(obj[sortedKeys[i]])) {\r\n continue;\r\n }\r\n sortedObj[sortedKeys[i]] = obj[sortedKeys[i]];\r\n }\r\n \r\n // 然后将排序后的对象转换为查询字符串\r\n const params = [];\r\n for (const key in sortedObj) {\r\n params.push(`${encodeURIComponent(key)}=${encodeURIComponent(sortedObj[key])}`);\r\n }\r\n return params.join('&');\r\n}\r\n\r\n\r\n/**\r\n * 组装签名字符串\r\n * @param string url: 请求地址 \r\n * @param string postStr: post参数的a=1&b=2 \r\n * @returns \r\n */\r\n\r\nfunction genSignStr(url: string, postStr: string): string {\r\n let lessUrl = url.replace('?', '')\r\n lessUrl = lessUrl + \"&\" + postStr\r\n return encodeURIComponent(fxCry.hmacSha256(lessUrl))\r\n}\r\n// 对参数进行统一urlencode\r\nfunction urlencode(url: string): string {\r\n const [baseUrl, queryString] = url.split(\"?\", 2);\r\n const params = new URLSearchParams(queryString);\r\n return `${baseUrl}?${params.toString()}`;\r\n}\r\n\r\n\r\n\r\n"]} \ No newline at end of file +{"version":3,"sources":["assets\\Script\\module\\Crypto\\HttpUtil.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AACM,IAAA,KAAsB,EAAE,CAAC,UAAU,EAAlC,OAAO,aAAA,EAAE,QAAQ,cAAiB,CAAC;AAC1C,6CAAgD,CAAE,WAAW;AAE7D,IAAM,QAAQ,GAAG,wBAAwB,CAAC;AAC1C,0CAA0C;AAE1C;IAAsC,4BAAY;IAAlD;;IAgGA,CAAC;iBAhGoB,QAAQ;IACzB,KAAK;IACQ,iBAAQ,GAArB,UAAsB,IAAI,EAAC,QAAQ,EAAC,IAAI;uCAAG,OAAO;;;gBAC1C,IAAI,GAAG,IAAI,CAAC,KAAK,CAAC,CAAC,IAAI,IAAI,EAAE,CAAC,OAAO,EAAE,CAAC,GAAG,IAAI,CAAC,CAAA;gBAChD,GAAG,GAAG,UAAQ,CAAC,OAAO,CAAC,+BAA6B,MAAM,CAAC,MAAM,kBAAa,IAAI,cAAS,IAAM,EAAE,IAAI,CAAC,CAAA;gBAC9G,IAAI,CAAC,IAAI,CAAC,GAAG,EAAC,IAAI,EAAC,QAAQ,EAAC,CAAC,CAAC,CAAC;;;;KAChC;IAEY,0BAAiB,GAA9B,UAA+B,IAAI,EAAC,QAAQ;uCAAG,OAAO;;;gBAC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C,EAAE;YAC/B,SAAS;SACV;QACD,SAAS,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC,GAAG,GAAG,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC,CAAC;KAC/C;IAED,oBAAoB;IACpB,IAAM,MAAM,GAAG,EAAE,CAAC;IAClB,KAAK,IAAM,GAAG,IAAI,SAAS,EAAE;QAC3B,MAAM,CAAC,IAAI,CAAI,kBAAkB,CAAC,GAAG,CAAC,SAAI,kBAAkB,CAAC,SAAS,CAAC,GAAG,CAAC,CAAG,CAAC,CAAC;KACjF;IACD,OAAO,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;AAC1B,CAAC;AAGD;;;;;GAKG;AAEH,SAAS,UAAU,CAAC,GAAW,EAAE,OAAe;IAC9C,IAAI,OAAO,GAAG,GAAG,CAAC,OAAO,CAAC,GAAG,EAAE,EAAE,CAAC,CAAA;IAClC,OAAO,GAAG,OAAO,GAAG,GAAG,GAAG,OAAO,CAAA;IACjC,OAAO,kBAAkB,CAAC,KAAK,CAAC,UAAU,CAAC,OAAO,CAAC,CAAC,CAAA;AACtD,CAAC;AACD,mBAAmB;AACnB,SAAS,SAAS,CAAC,GAAW;IACtB,IAAA,KAAyB,GAAG,CAAC,KAAK,CAAC,GAAG,EAAE,CAAC,CAAC,EAAzC,OAAO,QAAA,EAAE,WAAW,QAAqB,CAAC;IACjD,IAAM,MAAM,GAAG,IAAI,eAAe,CAAC,WAAW,CAAC,CAAC;IAChD,OAAU,OAAO,SAAI,MAAM,CAAC,QAAQ,EAAI,CAAC;AAC3C,CAAC","file":"","sourceRoot":"/","sourcesContent":["\r\nconst {ccclass, property} = cc._decorator;\r\nimport CryptoJS = require('./crypto-js.min.js'); //引用AES源码js\r\n\r\nconst BASE_URL = \"https://api.sparkus.cn\";\r\n//只负责网络接口 次类只负责和后端交互,不负责处理数据 数据处理在GameTool\r\n@ccclass\r\nexport default class HttpUtil extends cc.Component {\r\n //排行榜\r\n static async rankData(type,callback,data): Promise {\r\n const time = Math.floor((new Date().getTime()) / 1000)\r\n const url = HttpUtil.apiSign(`/api/get/rank/data?gameId=${config.gameId}&dataType=${type}&time=${time}`, data)\r\n this.post(url,data,callback,0);\r\n }\r\n \r\n static async uploadUserLogData(data,callback): Promise {\r\n const url = '/log/collect/data';\r\n this.post(url,data,callback,3);\r\n }\r\n //暂时用不到\r\n static async getUserRecord(data,callback): Promise {\r\n const time = Math.floor((new Date().getTime()) / 1000)\r\n const url = HttpUtil.apiSign(`/api/get/user/data?gameId=${config.gameId}&time=${time}`, data)\r\n this.post(url,data,callback,0);\r\n }\r\n\r\n static async get(url, callback,count) {\r\n let repeat = count?count:0;\r\n const response = await this.fetchData(url, null, 'GET',repeat);\r\n callback && callback(response);\r\n }\r\n\r\n static async post(url, data, callback,count) {\r\n let repeat = count?count:0;\r\n const response = await this.fetchData(url, data, 'POST',repeat);\r\n callback && callback(response);\r\n }\r\n\r\n static async fetchData(url, data, method,repeat) {\r\n const fullUrl = `${BASE_URL}${url}`;\r\n const headers = { 'Content-Type': 'application/json' };\r\n const options = {\r\n method,\r\n headers,\r\n body: data ? JSON.stringify(data) : null,\r\n };\r\n\r\n try {\r\n var response = await this.fetchWithTimeout(fullUrl,options);\r\n if (!response.ok) {\r\n throw new Error(`HTTP_______________error! status: ${response.status}`);\r\n }\r\n return await response.json();\r\n } catch (error) {\r\n console.error('Fetch_______________error:', error);\r\n if(repeat > 0){\r\n repeat -= 1;\r\n const timeOut = (3-repeat)*5000;\r\n setTimeout(async () => {\r\n response = await this.fetchData(url, data, method,repeat);\r\n }, timeOut);\r\n }\r\n else{\r\n return null;\r\n }\r\n }\r\n } \r\n\r\n static async fetchWithTimeout(resource, options = {}) {\r\n const controller = new AbortController();\r\n const id = setTimeout(() => controller.abort(), 5000);\r\n const response = await fetch(resource, {\r\n ...options,\r\n signal: controller.signal\r\n });\r\n clearTimeout(id);\r\n\r\n return response;\r\n }\r\n\r\n /**\r\n * \r\n * @param url {string} 接口地址\r\n * @param params {object} 需要加密的参数对象\r\n */\r\n static apiSign(url: string, params = {}) {\r\n\r\n let convertUrl = url.trim()\r\n if (convertUrl.indexOf('?') === -1) {\r\n convertUrl += '?'\r\n }\r\n \r\n // 传入参数转换拼接字符串\r\n let postStr = getQueryString(params)\r\n \r\n const signedStr = genSignStr(convertUrl, postStr)\r\n const encryptStr = `sign=${signedStr}`\r\n\r\n let encryptSignStr = fxCry.encryptByDES(encryptStr, config.secretKey)\r\n encryptSignStr = encodeURIComponent(encryptSignStr)\r\n\r\n return `${urlencode(convertUrl)}&_p=${encryptSignStr}`\r\n }\r\n}\r\n\r\nfunction responseHandler(response: { data: any }) {\r\n return response.data\r\n}\r\n// 响应拦截器\r\n// Rq.interceptors.response.use(responseHandler)\r\nconst config = {\r\n gameId: \"100010\",\r\n secretKey: \"wozrGKsL\",\r\n EK:\"hui231%1\"\r\n};\r\n\r\ninterface CrypotoType {\r\n encryptByDES: any\r\n decryptByDES: any\r\n hmacSha256: any\r\n}\r\n \r\nclass Crypoto implements CrypotoType {\r\n // 加密的向明值,自己根据项目实际情况定,需要跟后端开发保持一致\r\n private keyHex = this.getHetKey()\r\n private getHetKey() {\r\n return CryptoJS.enc.Utf8.parse(config.EK);\r\n }\r\n\r\n /** DES加密 */\r\n encryptByDES(message: string, secret?: string) {\r\n if(!message) {\r\n return message\r\n }\r\n const key = secret? CryptoJS.enc.Utf8.parse(secret): this.keyHex\r\n const encrypted = CryptoJS.DES.encrypt(message, key, {\r\n mode: CryptoJS.mode.ECB,\r\n padding: CryptoJS.pad.Pkcs7\r\n });\r\n return encrypted.toString()\r\n }\r\n\r\n /** DES解密 */\r\n decryptByDES(message: string, secret?: string) {\r\n const key = secret? CryptoJS.enc.Utf8.parse(secret): this.keyHex\r\n\r\n const decrypted = CryptoJS.DES.decrypt({\r\n ciphertext: CryptoJS.enc.Base64.parse(message)\r\n }, key, {\r\n mode: CryptoJS.mode.ECB,\r\n padding: CryptoJS.pad.Pkcs7\r\n })\r\n\r\n return decrypted.toString(CryptoJS.enc.Utf8)\r\n }\r\n\r\n /** hmacSHA256加密 */\r\n hmacSha256(message: string, secret?: string) {\r\n const keyHex = secret? CryptoJS.enc.Utf8.parse(secret): this.keyHex\r\n \r\n const hash = CryptoJS.HmacSHA256(message, keyHex);\r\n return hash.toString()\r\n }\r\n\r\n /** hmacSHA256验证 */\r\n verifyHmacSha256(message: string, signature: string) {\r\n const hash = CryptoJS.HmacSHA256(message, this.keyHex);\r\n return hash.toString() === signature\r\n }\r\n \r\n /** CBC加密 */\r\n encryptCBC(word: string) {\r\n if (!word) {\r\n return word;\r\n }\r\n const srcs = CryptoJS.enc.Utf8.parse(word);\r\n const encrypted = CryptoJS.AES.encrypt(srcs, this.keyHex, {\r\n iv: this.keyHex,\r\n mode: CryptoJS.mode.CBC,\r\n padding: CryptoJS.pad.ZeroPadding\r\n });\r\n return encrypted.toString(); \r\n }\r\n \r\n /** CBC解密 */\r\n decryptCBC(word: string) {\r\n if (!word) {\r\n return word;\r\n }\r\n const encryptedHexStr = CryptoJS.enc.Hex.parse(word);\r\n const srcs = CryptoJS.enc.Base64.stringify(encryptedHexStr);\r\n const decrypt = CryptoJS.AES.decrypt(srcs, this.keyHex, {\r\n iv: this.keyHex,\r\n mode: CryptoJS.mode.CBC,\r\n padding: CryptoJS.pad.ZeroPadding\r\n });\r\n const decryptedStr = decrypt.toString(CryptoJS.enc.Utf8);\r\n return decryptedStr.toString();\r\n }\r\n}\r\nconst fxCry = new Crypoto();\r\n\r\nfunction isEmpty(data) {\r\n return data === \"\" || data === null || data === undefined || data.length === 0 || JSON.stringify(data) == \"{}\"\r\n}\r\n\r\nfunction getQueryString(obj) {\r\n // 首先对对象的键进行排序并过滤空值\r\n const sortedKeys = Object.keys(obj).sort();\r\n const sortedObj = {};\r\n for (let i = 0; i < sortedKeys.length; i++) {\r\n if (isEmpty(obj[sortedKeys[i]])) {\r\n continue;\r\n }\r\n sortedObj[sortedKeys[i]] = obj[sortedKeys[i]];\r\n }\r\n \r\n // 然后将排序后的对象转换为查询字符串\r\n const params = [];\r\n for (const key in sortedObj) {\r\n params.push(`${encodeURIComponent(key)}=${encodeURIComponent(sortedObj[key])}`);\r\n }\r\n return params.join('&');\r\n}\r\n\r\n\r\n/**\r\n * 组装签名字符串\r\n * @param string url: 请求地址 \r\n * @param string postStr: post参数的a=1&b=2 \r\n * @returns \r\n */\r\n\r\nfunction genSignStr(url: string, postStr: string): string {\r\n let lessUrl = url.replace('?', '')\r\n lessUrl = lessUrl + \"&\" + postStr\r\n return encodeURIComponent(fxCry.hmacSha256(lessUrl))\r\n}\r\n// 对参数进行统一urlencode\r\nfunction urlencode(url: string): string {\r\n const [baseUrl, queryString] = url.split(\"?\", 2);\r\n const params = new URLSearchParams(queryString);\r\n return `${baseUrl}?${params.toString()}`;\r\n}\r\n\r\n\r\n\r\n"]} \ No newline at end of file diff --git a/library/imports/81/8162ee52-27a1-40fa-b8d8-b05e309020cd.json b/library/imports/81/8162ee52-27a1-40fa-b8d8-b05e309020cd.json new file mode 100644 index 0000000..75aab63 --- /dev/null +++ b/library/imports/81/8162ee52-27a1-40fa-b8d8-b05e309020cd.json @@ -0,0 +1,7 @@ +{ + "__type__": "cc.TTFFont", + "_name": "SourceHanSerifCN-Bold", + "_objFlags": 0, + "_native": "SourceHanSerifCN-Bold.ttf", + "_fontFamily": null +} \ No newline at end of file diff --git a/library/imports/81/8162ee52-27a1-40fa-b8d8-b05e309020cd/SourceHanSerifCN-Bold.ttf b/library/imports/81/8162ee52-27a1-40fa-b8d8-b05e309020cd/SourceHanSerifCN-Bold.ttf new file mode 100644 index 0000000..3db6ff8 Binary files /dev/null and b/library/imports/81/8162ee52-27a1-40fa-b8d8-b05e309020cd/SourceHanSerifCN-Bold.ttf differ diff --git a/library/imports/8a/8a024faa-e4af-4cae-9c5c-693bee7120c1.js b/library/imports/8a/8a024faa-e4af-4cae-9c5c-693bee7120c1.js new file mode 100644 index 0000000..b86ded8 --- /dev/null +++ b/library/imports/8a/8a024faa-e4af-4cae-9c5c-693bee7120c1.js @@ -0,0 +1,58 @@ +"use strict"; +cc._RF.push(module, '8a024+q5K9MrpxcaTvucSDB', 'DouyinEntranceView'); +// Script/Sdk/DouyinEntranceView.ts + +"use strict"; +var __extends = (this && this.__extends) || (function () { + var extendStatics = function (d, b) { + extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; }; + return extendStatics(d, b); + }; + return function (d, b) { + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); +var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) { + var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); + else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; + return c > 3 && r && Object.defineProperty(target, key, r), r; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.DouyinEntranceView = void 0; +var MiniGameSdk_1 = require("./MiniGameSdk"); +var _a = cc._decorator, ccclass = _a.ccclass, property = _a.property; +var DouyinEntranceView = /** @class */ (function (_super) { + __extends(DouyinEntranceView, _super); + function DouyinEntranceView() { + return _super !== null && _super.apply(this, arguments) || this; + } + DouyinEntranceView.prototype.start = function () { + }; + DouyinEntranceView.prototype.update = function (deltaTime) { + }; + DouyinEntranceView.prototype.onCloseClick = function () { + this.node.active = false; + }; + DouyinEntranceView.prototype.onNavigateToDouyinClick = function () { + MiniGameSdk_1.MiniGameSdk.BytedanceSidebar.navigateToSidebar(function (success) { + if (success) { + console.log('跳转成功'); + } + else { + console.log('跳转失败'); + } + }); + }; + DouyinEntranceView = __decorate([ + ccclass + ], DouyinEntranceView); + return DouyinEntranceView; +}(cc.Component)); +exports.DouyinEntranceView = DouyinEntranceView; + +cc._RF.pop(); \ No newline at end of file diff --git a/library/imports/8a/8a024faa-e4af-4cae-9c5c-693bee7120c1.js.map b/library/imports/8a/8a024faa-e4af-4cae-9c5c-693bee7120c1.js.map new file mode 100644 index 0000000..fff5f0d --- /dev/null +++ b/library/imports/8a/8a024faa-e4af-4cae-9c5c-693bee7120c1.js.map @@ -0,0 +1 @@ +{"version":3,"sources":["assets\\Script\\Sdk\\DouyinEntranceView.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,6CAA4C;AACtC,IAAA,KAAwB,EAAE,CAAC,UAAU,EAAnC,OAAO,aAAA,EAAE,QAAQ,cAAkB,CAAC;AAI5C;IAAwC,sCAAY;IAApD;;IAuBA,CAAC;IAtBG,kCAAK,GAAL;IAEA,CAAC;IAED,mCAAM,GAAN,UAAO,SAAiB;IAExB,CAAC;IAED,yCAAY,GAAZ;QACI,IAAI,CAAC,IAAI,CAAC,MAAM,GAAG,KAAK,CAAC;IAC7B,CAAC;IAED,oDAAuB,GAAvB;QAEI,yBAAW,CAAC,gBAAgB,CAAC,iBAAiB,CAAC,UAAC,OAAgB;YAC5D,IAAI,OAAO,EAAE;gBACT,OAAO,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC;aACvB;iBAAM;gBACH,OAAO,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC;aACvB;QACL,CAAC,CAAC,CAAC;IACP,CAAC;IAtBQ,kBAAkB;QAD9B,OAAO;OACK,kBAAkB,CAuB9B;IAAD,yBAAC;CAvBD,AAuBC,CAvBuC,EAAE,CAAC,SAAS,GAuBnD;AAvBY,gDAAkB","file":"","sourceRoot":"/","sourcesContent":["import { MiniGameSdk } from \"./MiniGameSdk\";\r\nconst { ccclass, property } = cc._decorator;\r\n\r\n\r\n@ccclass\r\nexport class DouyinEntranceView extends cc.Component {\r\n start() {\r\n\r\n }\r\n\r\n update(deltaTime: number) {\r\n\r\n }\r\n\r\n onCloseClick() {\r\n this.node.active = false;\r\n }\r\n\r\n onNavigateToDouyinClick() {\r\n\r\n MiniGameSdk.BytedanceSidebar.navigateToSidebar((success: boolean) => { // 跳转到抖音侧边栏\r\n if (success) {\r\n console.log('跳转成功');\r\n } else {\r\n console.log('跳转失败');\r\n }\r\n });\r\n }\r\n}\r\n"]} \ No newline at end of file diff --git a/library/imports/b4/b42c4fc1-4cd1-4b12-b206-930cea3d49ca.json b/library/imports/b4/b42c4fc1-4cd1-4b12-b206-930cea3d49ca.json deleted file mode 100644 index 56f1e57..0000000 --- a/library/imports/b4/b42c4fc1-4cd1-4b12-b206-930cea3d49ca.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "__type__": "cc.Asset", - "_name": "Share", - "_objFlags": 0, - "_native": ".zip" -} \ No newline at end of file diff --git a/library/imports/b4/b42c4fc1-4cd1-4b12-b206-930cea3d49ca.zip b/library/imports/b4/b42c4fc1-4cd1-4b12-b206-930cea3d49ca.zip deleted file mode 100644 index 705f190..0000000 Binary files a/library/imports/b4/b42c4fc1-4cd1-4b12-b206-930cea3d49ca.zip and /dev/null differ diff --git a/library/imports/ba/ba08509d-1972-42d5-aa39-2bcd83804450.json b/library/imports/ba/ba08509d-1972-42d5-aa39-2bcd83804450.json new file mode 100644 index 0000000..9ab9452 --- /dev/null +++ b/library/imports/ba/ba08509d-1972-42d5-aa39-2bcd83804450.json @@ -0,0 +1,7 @@ +{ + "__type__": "cc.TTFFont", + "_name": "SourceHanSerifCN-Medium", + "_objFlags": 0, + "_native": "SourceHanSerifCN-Medium.ttf", + "_fontFamily": null +} \ No newline at end of file diff --git a/library/imports/ba/ba08509d-1972-42d5-aa39-2bcd83804450/SourceHanSerifCN-Medium.ttf b/library/imports/ba/ba08509d-1972-42d5-aa39-2bcd83804450/SourceHanSerifCN-Medium.ttf new file mode 100644 index 0000000..fa97e07 Binary files /dev/null and b/library/imports/ba/ba08509d-1972-42d5-aa39-2bcd83804450/SourceHanSerifCN-Medium.ttf differ diff --git a/library/imports/c1/c1af99dd-ee03-40f7-9609-d3887d0dd357.js b/library/imports/c1/c1af99dd-ee03-40f7-9609-d3887d0dd357.js new file mode 100644 index 0000000..3859c24 --- /dev/null +++ b/library/imports/c1/c1af99dd-ee03-40f7-9609-d3887d0dd357.js @@ -0,0 +1,1102 @@ +"use strict"; +cc._RF.push(module, 'c1af9nd7gNA95YJ04h9DdNX', 'MiniGameSdk'); +// Script/Sdk/MiniGameSdk.ts + +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.MiniGameSdk = void 0; +/** + * 小游戏平台SDK工具封装,目前只支持微信和抖音平台 + */ +var MiniGameSdk; +(function (MiniGameSdk) { + function isWechat() { + //@ts-ignore + return window.wx !== null && window.wx !== undefined; + } + MiniGameSdk.isWechat = isWechat; + function isBytedance() { + //@ts-ignore + return window.tt !== null && window.tt !== undefined; + } + MiniGameSdk.isBytedance = isBytedance; + function getSysWinSize() { + var sys; + if (isWechat()) { + // @ts-ignore + sys = wx.getSystemInfoSync(); + } + else if (isBytedance()) { + // @ts-ignore + sys = tt.getSystemInfoSync(); + } + var size = { width: 0, height: 0 }; + if (sys) { + size.width = sys.windowWidth; + size.height = sys.windowHeight; + } + return size; + } + /** + * 插屏广告。微信抖音都支持! + */ + var ADInterstitial = /** @class */ (function () { + function ADInterstitial(adUid) { + this._adUid = adUid; + } + Object.defineProperty(ADInterstitial.prototype, "aduid", { + get: function () { + return this._adUid; + }, + enumerable: false, + configurable: true + }); + ADInterstitial.prototype.show = function () { + var _this = this; + var _a, _b; + // @ts-ignore + if (isWechat() && !wx.createInterstitialAd) { + console.warn('wechat unsupport interstitial AD!'); + this._interstitial = null; + return; + } + // @ts-ignore + if (isBytedance() && !tt.createInterstitialAd) { + console.warn('bytedance unsupport interstitial AD!'); + this._interstitial = null; + return; + } + if (this._interstitial) { + this._interstitial.load(); + } + else { + if (isWechat()) { + // @ts-ignore + this._interstitial = wx.createInterstitialAd({ adUnitId: this._adUid }); + } + else if (isBytedance()) { + // @ts-ignore + this._interstitial = tt.createInterstitialAd({ adUnitId: this._adUid }); + } + else { + this._interstitial = null; + } + (_a = this._interstitial) === null || _a === void 0 ? void 0 : _a.onLoad(function () { + console.log('load interstitial ad success'); + _this._interstitial.show().catch(function (err) { + console.log('catch interstitial ad error:', err); + }); + }); + (_b = this._interstitial) === null || _b === void 0 ? void 0 : _b.onError(function (err) { + console.log('interstitial ad on error:', err); + }); + } + }; + ADInterstitial.prototype.destory = function () { + var _a; + (_a = this._interstitial) === null || _a === void 0 ? void 0 : _a.destroy(); + }; + return ADInterstitial; + }()); + var ADBanner = /** @class */ (function () { + /** + * 抖音和微信都支持 + * 横幅广告。预估宽度默认为300,预估高度为140。如果你不确定就按默认值来。 + * @param adUid 广告UID,后端配置 + * @param isTop 是否在屏幕顶部展示。内部会自动居中计算位置。 + * @param bannerWidth 横幅广告的预估宽度。默认300 + * @param autoShow 广告加载完成后是否立刻显示,默认为不显示 + */ + function ADBanner(adUid, param, bannerWidth, autoShow) { + if (bannerWidth === void 0) { bannerWidth = 300; } + if (autoShow === void 0) { autoShow = false; } + this._adUid = adUid; + this.create(autoShow, bannerWidth, param); // 默认300比较合适 + } + Object.defineProperty(ADBanner.prototype, "aduid", { + get: function () { + return this._adUid; + }, + enumerable: false, + configurable: true + }); + ADBanner.prototype.create = function (autoShow, bannerWidth, param) { + var _this = this; + var _a, _b; + if (!isWechat() && !isBytedance()) { + this._banner = null; + return; + } + this.destroy(); + var winSize = getSysWinSize(); + var height = bannerWidth * 0.4; + var top = 0, left = 0; + if (typeof param === "boolean") { + left = (winSize.width - bannerWidth) / 2; + top = param ? 5 : (winSize.height - height); + } + else { + left = param.left; + top = param.top; + } + var params = { + adUnitId: this._adUid, + adIntervals: 30, + style: { left: left, top: top, width: bannerWidth } + }; + if (isWechat()) { + // @ts-ignore + this._banner = wx.createBannerAd(params); + } + else if (isBytedance()) { + // @ts-ignore + this._banner = tt.createBannerAd(params); + } + else { + this._banner = null; + } + (_a = this._banner) === null || _a === void 0 ? void 0 : _a.onError(function (err) { + console.log('ad banner error:', err); + }); + (_b = this._banner) === null || _b === void 0 ? void 0 : _b.onLoad(function () { + autoShow && _this._banner.show(); + }); + }; + ADBanner.prototype.show = function () { + var _a; + (_a = this._banner) === null || _a === void 0 ? void 0 : _a.show(); + }; + ADBanner.prototype.hide = function () { + var _a; + (_a = this._banner) === null || _a === void 0 ? void 0 : _a.hide(); + }; + ADBanner.prototype.destroy = function () { + var _a; + (_a = this._banner) === null || _a === void 0 ? void 0 : _a.destroy(); + }; + return ADBanner; + }()); + var ADCustom = /** @class */ (function () { + /** + * 由于原生模板广告在微信服务后端可以定制宽度大小,个数,缩放比例等,所以位置调整要根据设置的宽度来定。抖音不支持! + * @param adUid 广告UID,后端配置 + * @param top 从左上角开始,距离屏幕顶部的距离。注意:这个数据为设备屏幕宽度width。如果需要获取屏幕的像素,需要乘以设备像素比Pixel-Ratio,例如iPhone 13 Pro的Pixel-Ratio为3,像素为Width*3。 + * @param left 从左上角开始,距离屏幕最左边的距离。注意:这个数据为设备屏幕宽度width。如果需要获取屏幕的像素,需要乘以设备像素比Pixel-Ratio,例如iPhone 13 Pro的Pixel-Ratio为3,像素为Width*3。 + * @param scale 原生模板广告的尺寸,默认为1,即100%。此值在微信服务后端广告中获得,默认为100%,目前有100%,90%,80%三种,一般情况不用修改。若有修改,记得传入值,例如90%就传入0.9。 + */ + function ADCustom(adUid, top, left, scale) { + if (top === void 0) { top = 0; } + if (left === void 0) { left = 0; } + if (scale === void 0) { scale = 1.0; } + this._adUid = adUid; + this.createCustomAd(top, left, scale); + } + Object.defineProperty(ADCustom.prototype, "aduid", { + get: function () { + return this._adUid; + }, + enumerable: false, + configurable: true + }); + ADCustom.prototype.createCustomAd = function (top, left, scale) { + var _a; + if (!isWechat()) { // only wechat support custom ad + this._adCustom = null; + console.log('Only wechat support Custom Ad'); + return; + } + this.destroy(); + // 原生模板5个应用宽度为375,若设置了缩放比例,则宽度也需要设置 + // let width = 375 * this._scale; + // let newLeft = (sys.windowWidth - width) / 2; + // let newTop = sys.windowHeight / 2; // 120是预估高度 + // @ts-ignore + this._adCustom = wx.createCustomAd({ + adUnitId: this._adUid, + style: { left: left, top: top, fixed: true } + }); + (_a = this._adCustom) === null || _a === void 0 ? void 0 : _a.onError(function (err) { + console.log('ad custom error:', err); + }); + }; + ADCustom.prototype.show = function () { + var _a; + (_a = this._adCustom) === null || _a === void 0 ? void 0 : _a.show(); + }; + ADCustom.prototype.hide = function () { + var _a; + (_a = this._adCustom) === null || _a === void 0 ? void 0 : _a.hide(); + }; + ADCustom.prototype.destroy = function () { + var _a; + (_a = this._adCustom) === null || _a === void 0 ? void 0 : _a.destroy(); + }; + return ADCustom; + }()); + /** + * 视频广告用户点击行为结果 + */ + var EAdVideoResult; + (function (EAdVideoResult) { + /** + * 用户看完了广告,游戏可发放奖励。 + */ + EAdVideoResult[EAdVideoResult["ACCEPT"] = 0] = "ACCEPT"; + /** + * 用户中途关闭了广告,即未看完状态。不可发放奖励。 + */ + EAdVideoResult[EAdVideoResult["REJECT"] = 1] = "REJECT"; + /** + * 广告组件内部发生了错误。不可发放奖励。 + */ + EAdVideoResult[EAdVideoResult["ERROR"] = 2] = "ERROR"; + })(EAdVideoResult = MiniGameSdk.EAdVideoResult || (MiniGameSdk.EAdVideoResult = {})); + var ADVideo = /** @class */ (function () { + function ADVideo(adUid) { + this._adVideo = null; + this._adUid = adUid; + } + Object.defineProperty(ADVideo.prototype, "aduid", { + get: function () { + return this._adUid; + }, + enumerable: false, + configurable: true + }); + /** + * 由于微信和抖音视频广告机制不同,微信可以看的视频广告个数只有0和1个,抖音平台则可以看0~maxVideoCount + * @param onResult 两个参数:第一个res是EAdVideoResult定义,第二count是用户看了多少个视频广告。 + * @param target onResult的拥有者 + * @param maxVideoCount 可以连续看最大视频个数,可最大化商业效率。默认为3个。 + * @returns + */ + ADVideo.prototype.show = function (onResult, target, maxVideoCount) { + var _this = this; + var _a, _b, _c, _d, _e; + if (maxVideoCount === void 0) { maxVideoCount = 3; } + var callback = function (state, count) { + onResult === null || onResult === void 0 ? void 0 : onResult.call(target, state, count); + }; + if (!isWechat() && !isBytedance()) { + callback(EAdVideoResult.ACCEPT, 1); + this._adVideo = null; + return; + } + var onAdVideoClosed = function (res) { + var _a; + (_a = _this._adVideo) === null || _a === void 0 ? void 0 : _a.offClose(onAdVideoClosed); + if (isWechat()) { + if (res && res.isEnded || res === undefined) { + callback(EAdVideoResult.ACCEPT, 1); + } + else { + callback(EAdVideoResult.REJECT, 0); + } + } + else if (isBytedance()) { + var resConverted = res; + if (resConverted && resConverted.count > 0) { + callback(EAdVideoResult.ACCEPT, resConverted.count); + } + else { + callback(EAdVideoResult.REJECT, 0); + } + } + }; + (_a = this._adVideo) === null || _a === void 0 ? void 0 : _a.offClose(onAdVideoClosed); + if (isWechat()) { + // @ts-ignore + this._adVideo = wx.createRewardedVideoAd({ + adUnitId: this._adUid + }); + } + else if (isBytedance()) { + // @ts-ignore + this._adVideo = tt.createRewardedVideoAd({ + adUnitId: this._adUid, + multiton: true, + multitonRewardMsg: ['多1次奖励', '再多一次奖励', '再多一次奖励'], + multitonRewardTimes: maxVideoCount, + }); + } + else { + this._adVideo = null; + } + (_b = this._adVideo) === null || _b === void 0 ? void 0 : _b.onLoad(function () { + console.log('Ad load success'); + }); + (_c = this._adVideo) === null || _c === void 0 ? void 0 : _c.onError(function (err) { + console.log('Ad video error:', err); + callback(EAdVideoResult.ERROR, 0); + }); + (_d = this._adVideo) === null || _d === void 0 ? void 0 : _d.onClose(onAdVideoClosed); + (_e = this._adVideo) === null || _e === void 0 ? void 0 : _e.show().catch(function () { + var _a; + (_a = _this._adVideo) === null || _a === void 0 ? void 0 : _a.load().then(function () { var _a; return (_a = _this._adVideo) === null || _a === void 0 ? void 0 : _a.show(); }).catch(function (err) { + console.log('Catch video ad error:', err); + callback(EAdVideoResult.ERROR, 0); + }); + }); + }; + ADVideo.prototype.destory = function () { + var _a; + (_a = this._adVideo) === null || _a === void 0 ? void 0 : _a.destory(); + }; + return ADVideo; + }()); + var EAdBannerLocation; + (function (EAdBannerLocation) { + /** + * 屏幕顶部 + */ + EAdBannerLocation[EAdBannerLocation["TOP"] = 0] = "TOP"; + /** + * 屏幕底部 + */ + EAdBannerLocation[EAdBannerLocation["BOTTOM"] = 1] = "BOTTOM"; + })(EAdBannerLocation = MiniGameSdk.EAdBannerLocation || (MiniGameSdk.EAdBannerLocation = {})); + var AdvertManager = /** @class */ (function () { + function AdvertManager() { + this._customs = {}; + } + Object.defineProperty(AdvertManager, "instance", { + get: function () { + if (!AdvertManager._instance) { + AdvertManager._instance = new AdvertManager(); + } + return AdvertManager._instance; + }, + enumerable: false, + configurable: true + }); + /** + * 预加载横幅广告,不会显示。只有你在调用showBanner时才会显示。 + * 可重复调用,但是会销毁上一次的实例。一般情况,全局有一个就行了,太多占用内存,而且没必要。 + * @param adUid 广告UID + * @param location 位置有两种情况:1、可以传入枚举值,默认上方; 2、可以自定义位置传入IPosition,注意IPosition中的top和left跟平台的top,left是一致(没有乘以设备像素比ratio),需要开发者自己调试位置 + * @param scale 默认为跟屏幕一样的宽度,可以通过设置缩放比例来调整大小。当然,平台有规定最大或最小宽度,函数内部会自动计算。 + */ + AdvertManager.prototype.loadBanner = function (adUid, location, scale) { + var _a; + if (location === void 0) { location = EAdBannerLocation.TOP; } + if (scale === void 0) { scale = 1.0; } + (_a = this._banner) === null || _a === void 0 ? void 0 : _a.destroy(); + var size = getSysWinSize(); + // 当 style.width 小于 300 时,会取作 300。 当 style.width 大于屏幕宽度时,会取作屏幕宽度。 + var width = size.width * scale; + width = width < 300 ? 300 : width; // 最小值矫正 + width = width > size.width ? size.width : width; //最大值矫正 + this._banner = typeof location === 'number' ? new ADBanner(adUid, location === EAdBannerLocation.TOP, width, false) : new ADBanner(adUid, location, width, false); + }; + /** + * 显示横幅广告 + */ + AdvertManager.prototype.showBanner = function () { + if (this._banner) { + this._banner.show(); + } + else { + console.warn('MiniGameSDK: banner is null, you must call loadBanner(...) first!'); + } + }; + /** + * 隐藏横幅广告 + */ + AdvertManager.prototype.hideBanner = function () { + var _a; + (_a = this._banner) === null || _a === void 0 ? void 0 : _a.hide(); + }; + /** + * 弹出插屏广告 + * @param adUid 广告单元id + */ + AdvertManager.prototype.showInterstitial = function (adUid) { + var _a; + if (this._interstitial && this._interstitial.aduid === adUid) { + this._interstitial.show(); + } + else { + (_a = this._interstitial) === null || _a === void 0 ? void 0 : _a.destory(); + this._interstitial = new ADInterstitial(adUid); + this._interstitial.show(); + } + }; + /** + * 加载原生模板广告,不会显示。只有你在调用showCustom时才会显示。 + * 由于原生模板广告在微信服务后端可以定制宽度大小,个数,缩放比例等,所以位置调整要根据设置的宽度来定。抖音不支持本函数,会调用无效! + * @param adUid 广告ID + * @param location 位置有两种情况:1、可以传入枚举值,默认上方; 2、可以自定义位置传入IPosition,注意IPosition中的top和left跟平台的top,left是一致(没有乘以设备像素比ratio),需要开发者自己调试位置 + * @param scale 缩放比例,默认是1,即不缩放。这个缩放并不是自己填,而是根据微信MP后台你配置的原生模板广告的缩放比例填,目前有100%,90%,80%三种,一般情况不用修改。若有后台修改,记得传入值,例如90%就传入0.9。 + */ + AdvertManager.prototype.loadCustom = function (adUid, location, scale) { + if (location === void 0) { location = { top: 0, left: 0 }; } + if (scale === void 0) { scale = 1; } + // this._custom?.destroy(); + // this._custom = new ADCustom(adUid, location.top, location.left, scale); + if (this._customs[adUid]) { + console.log(adUid + " has been loaded."); + return; + } + this._customs[adUid] = new ADCustom(adUid, location.top, location.left, scale); + }; + /** + * 显示自定义广告。 + * @param adUid 广告的唯一标识符。使用此标识符来查找和显示特定的自定义广告。 + * + * 此方法尝试根据提供的adUid显示一个自定义广告。如果给定的adUid对应的自定义广告已加载, + * 则调用该广告的显示方法。如果广告未加载,则在控制台输出警告信息。 + */ + AdvertManager.prototype.showCustom = function (adUid) { + if (this._customs[adUid]) { + this._customs[adUid].show(); + } + else { + console.warn("You have not load " + adUid + " of Custom AD, can not show!"); + } + }; + /** + * 隐藏指定的自定义广告单元 + * + * 此方法用于隐藏通过广告单元标识符(adUid)指定的自定义广告。如果指定的广告单元已加载并显示, + * 则将其隐藏;如果广告单元未加载,则在控制台输出警告信息。 + * + * @param adUid 广告单元标识符,用于唯一标识一个自定义广告单元。 + */ + AdvertManager.prototype.hideCustom = function (adUid) { + if (this._customs[adUid]) { + this._customs[adUid].hide(); + } + else { + console.warn("You have not load " + adUid + " of Custom AD, can not hide!"); + } + }; + /** + * 由于微信和抖音视频广告机制不同,微信可以看的视频广告个数只有0和1个,抖音平台则可以看0~maxVideoCount + * @param adUid 广告ID。如果与上一次UID不同,则内部会重新创建实例。开发者完全不用关心这个细节。 + * @param onVideoResult 两个参数:第一个res是EAdVideoResult定义,第二count是用户看了多少个视频广告。 + * @param target onVideoResult的拥有者 + * @param maxVideoCount 最大视频个数。默认是3,仅对抖音平台生效。微信平台看完视频count的结果永远是1或0 + */ + AdvertManager.prototype.showVideo = function (adUid, onVideoResult, target, maxVideoCount) { + var _a; + if (maxVideoCount === void 0) { maxVideoCount = 3; } + if (this._video && this._video.aduid === adUid) { + this._video.show(onVideoResult, target, maxVideoCount); + } + else { + (_a = this._video) === null || _a === void 0 ? void 0 : _a.destory(); + this._video = new ADVideo(adUid); + this._video.show(onVideoResult, target, maxVideoCount); + } + }; + /** + * 销毁内部所有实例,清空内存 + */ + AdvertManager.prototype.destroyAll = function () { + var _a, _b, _c, _d; + (_a = this._banner) === null || _a === void 0 ? void 0 : _a.destroy(); + this._banner = null; + (_b = this._interstitial) === null || _b === void 0 ? void 0 : _b.destory(); + this._interstitial = null; + (_c = this._video) === null || _c === void 0 ? void 0 : _c.destory(); + this._video = null; + if (this._customs) { + for (var val in this._customs) { + (_d = this._customs[val]) === null || _d === void 0 ? void 0 : _d.destroy(); + } + this._customs = {}; + } + }; + return AdvertManager; + }()); + MiniGameSdk.AdvertManager = AdvertManager; + var EGameClubIcon; + (function (EGameClubIcon) { + /** 绿色图标 */ + EGameClubIcon["GREEN"] = "green"; + /** 红色图标 */ + EGameClubIcon["WHITE"] = "white"; + /** 有黑色圆角背景的白色图标 */ + EGameClubIcon["DARK"] = "dark"; + /** 有白色圆角背景的绿色图标 */ + EGameClubIcon["LIGHT"] = "light"; + })(EGameClubIcon = MiniGameSdk.EGameClubIcon || (MiniGameSdk.EGameClubIcon = {})); + var GameClub = /** @class */ (function () { + function GameClub() { + } + Object.defineProperty(GameClub, "instance", { + get: function () { + if (!this._instance) { + this._instance = new GameClub(); + } + return this._instance; + }, + enumerable: false, + configurable: true + }); + /** + * 创建游戏圈按钮 + * @param icon + * @param position + * @param size + * @param openLink + */ + GameClub.prototype.create = function (icon, position, size, openLink) { + if (icon === void 0) { icon = EGameClubIcon.GREEN; } + if (position === void 0) { position = { top: 0, left: 0 }; } + if (size === void 0) { size = { width: 40, height: 40 }; } + if (isWechat()) { + // @ts-ignore + this._club = wx.createGameClubButton({ + icon: icon, + style: { + left: position.left, + top: position.top, + width: size.width, + height: size.height + }, + openlink: openLink + }); + } + }; + GameClub.prototype.show = function () { + var _a; + (_a = this._club) === null || _a === void 0 ? void 0 : _a.show(); + }; + GameClub.prototype.hide = function () { + var _a; + (_a = this._club) === null || _a === void 0 ? void 0 : _a.hide(); + }; + GameClub.prototype.destory = function () { + var _a; + (_a = this._club) === null || _a === void 0 ? void 0 : _a.destroy(); + }; + return GameClub; + }()); + MiniGameSdk.GameClub = GameClub; + /** + * 振动类型 + */ + var EVirbrateType; + (function (EVirbrateType) { + /** + * 短振动 + */ + EVirbrateType[EVirbrateType["SHORT"] = 0] = "SHORT"; + /** + * 长振动 + */ + EVirbrateType[EVirbrateType["LONG"] = 1] = "LONG"; + })(EVirbrateType = MiniGameSdk.EVirbrateType || (MiniGameSdk.EVirbrateType = {})); + /** + * 平台常用API合集 + */ + var API = /** @class */ (function () { + function API() { + } + /** + * 分享app给朋友,微信小游戏分享是没有onSuccess回调的。 + * @param title 标题 + * @param description 细节描述信息 + * @param imageUrl 图片地址 + * @param query 查询信息 + * @param onSuccess 抖音会回调,微信不会回调 + */ + API.shareAppToFriends = function (title, description, imageUrl, query, onSuccess) { + if (description === void 0) { description = ''; } + if (isWechat()) { + try { + //@ts-ignore + wx.shareAppMessage({ + title: title, + imageUrl: imageUrl, + query: query, + }); + } + catch (err) { + console.log("share faild: " + err); + } + } + if (isBytedance()) { + //@ts-ignore + tt.shareAppMessage({ + title: title, + desc: description, + imageUrl: imageUrl !== null && imageUrl !== void 0 ? imageUrl : '', + query: query !== null && query !== void 0 ? query : '', + success: function (res) { + console.log('share success:', res); + onSuccess === null || onSuccess === void 0 ? void 0 : onSuccess(); + }, + fail: function (res) { + console.log('share fail:', res); + } + }); + } + }; + /** + * 显示提示信息 + * @param title 标题 + * @param duration 时长(单位:秒) + * @returns + */ + API.showToast = function (title, duration) { + if (duration === void 0) { duration = 2; } + if (isWechat()) { + // @ts-ignore + wx.showToast({ + title: title, + icon: 'success', + duration: duration * 1000 + }); + } + if (isBytedance()) { + //@ts-ignore + tt.showToast({ + title: title, + duration: duration * 1000, + success: function (res) { + console.log("" + res); + }, + fail: function (res) { + console.log("showToast\u8C03\u7528\u5931\u8D25"); + }, + }); + } + }; + /** + * 设备震动效果,默认为短震动。注意:可能一些机型不会生效,具体看平台方的说明 + * @param type MiniGameSdk.API.EVirbrateType + */ + API.vibrate = function (type) { + if (type === void 0) { type = EVirbrateType.SHORT; } + if (isWechat()) { + switch (type) { + case EVirbrateType.SHORT: + //@ts-ignore + wx.vibrateShort({ + success: function (res) { + console.log('vibrate success:', res); + }, + fail: function (res) { + console.log('vibrateShort failed', res); + }, + }); + break; + case EVirbrateType.LONG: + //@ts-ignore + wx.vibrateLong({ + success: function (res) { + console.log('vibrate success', res); + }, + fail: function (res) { + console.log("vibrateLong failed", res); + }, + }); + break; + default: + break; + } + } + if (isBytedance()) { + switch (type) { + case EVirbrateType.SHORT: + //@ts-ignore + tt.vibrateShort({ + success: function (res) { + console.log('vibrate success:', res); + }, + fail: function (res) { + console.log('vibrateShort failed', res); + }, + }); + break; + case EVirbrateType.LONG: + //@ts-ignore + tt.vibrateLong({ + success: function (res) { + console.log('vibrate success', res); + }, + fail: function (res) { + console.log("vibrateLong failed", res); + }, + }); + break; + default: + break; + } + } + }; + /** + * 重启小游戏 + */ + API.reboot = function () { + if (isWechat()) { + //@ts-ignore + wx.restartMiniProgram({ + success: function () { + console.log('restart success'); + }, + fail: function () { + console.log('restart failed'); + } + }); + } + if (isBytedance()) { + try { + // @ts-ignore + tt.restartMiniProgramSync(); + } + catch (error) { + console.log("restartMiniProgramSync", error); + } + } + }; + /** + * 退出小游戏 + */ + API.exit = function () { + if (isWechat()) { + //@ts-ignore + wx.exitMiniProgram({ + success: function () { + console.log('exit success'); + }, + fail: function () { + console.log('exit failed'); + } + }); + } + if (isBytedance()) { + // @ts-ignore + tt.exitMiniProgram({ + success: function (res) { + console.log("exit success:", res === null || res === void 0 ? void 0 : res.data); + }, + fail: function (res) { + console.log("exit fail:", res === null || res === void 0 ? void 0 : res.errMsg); + }, + }); + } + }; + /** + * 显示转发按钮。通常在刚进入游戏的时候调用。 + * 主要是打开平台“...”这个按钮里面的分享菜单,一般默认是关闭的,需要调用这个函数打开。可以让用户分享你的游戏入口。 + */ + API.showShareMenu = function () { + if (isWechat()) { + //@ts-ignore + wx.showShareMenu({ + withShareTicket: true, + menus: ['shareAppMessage', 'shareTimeline'], + success: function () { }, + fail: function () { }, + complete: function () { } + }); + } + if (isBytedance()) { + //@ts-ignore + tt.showShareMenu({ + success: function (res) { + console.log("show menu is showing"); + }, + fail: function (err) { + console.log("showShareMenu:", err.errMsg); + }, + complete: function (res) { + console.log("showShareMenu complete"); + }, + }); + } + }; + /** + * 微信小游戏:跳转到另外一款小游戏 + * 抖音小游戏:跳转到指定的视频界面 + * @param targetId 微信小游戏appid或者视频界面 + */ + API.navigateTo = function (targetId, onSuccess) { + if (isWechat()) { + // @ts-ignore + wx.navigateToMiniProgram({ + appId: targetId, + extraData: { + foo: 'bar' + }, + envVersion: 'develop', + success: function (res) { + onSuccess === null || onSuccess === void 0 ? void 0 : onSuccess(); + } + }); + } + if (isBytedance()) { + // @ts-ignore + tt.navigateToVideoView({ + videoId: targetId, + success: function (res) { + onSuccess === null || onSuccess === void 0 ? void 0 : onSuccess(); + }, + fail: function (err) { + console.log("bytedance navigateToVideoView fail", err); + }, + }); + } + }; + /** + * 小游戏平台登录功能。微信返回code,抖音返回code和anonymousCode。用于登录的凭证,需要把这个code传回你的服务器程序中去调用code2Session + * @param callback (code, anonymousCode) 第一个参数为code,微信和抖音都支持;第二个参数为匿名设备ID,仅抖音支持,失败都返回null + */ + API.login = function (callback) { + var loginPlatform = function () { + if (isWechat()) { + //@ts-ignore + wx.login({ + success: function (res) { + if (res.code) { + API._loginCode = res.code; + API._loginAnonymousCode = null; + callback === null || callback === void 0 ? void 0 : callback(API._loginCode, API._loginAnonymousCode); + } + else { + console.log('login error:', res.errMsg); + } + }, + fail: function () { + API._loginCode = null; + API._loginAnonymousCode = null; + callback === null || callback === void 0 ? void 0 : callback(API._loginCode, API._loginAnonymousCode); + console.log('login fail'); + } + }); + } + else if (isBytedance()) { + //@ts-ignore + tt.login({ + force: true, + success: function (res) { + var _a, _b; + console.log("login " + res.code + " " + res.anonymousCode); + if (res.code) { + API._loginCode = (_a = res.code) === null || _a === void 0 ? void 0 : _a.toString(); + API._loginAnonymousCode = (_b = res.anonymousCode) === null || _b === void 0 ? void 0 : _b.toString(); + callback === null || callback === void 0 ? void 0 : callback(API._loginCode, API._loginAnonymousCode); + } + else { + console.log('login error:', res.errMsg); + } + }, + fail: function (res) { + API._loginCode = null; + API._loginAnonymousCode = null; + callback === null || callback === void 0 ? void 0 : callback(API._loginCode, API._loginAnonymousCode); + console.log("login fail", res); + }, + }); + } + else { + API._loginCode = null; + API._loginAnonymousCode = null; + callback === null || callback === void 0 ? void 0 : callback(API._loginCode, API._loginAnonymousCode); + console.log('not mini game platform, login codes are all null'); + } + }; + if (!API._loginCode) { + loginPlatform(); + } + else { + if (isWechat()) { + //@ts-ignore + wx.checkSession({ + success: function () { + console.log("session is valid, use current code:", API._loginCode); + callback === null || callback === void 0 ? void 0 : callback(API._loginCode, API._loginAnonymousCode); + }, + fail: function () { + console.log("session expired"); + loginPlatform(); + } + }); + } + else if (isBytedance()) { + //@ts-ignore + tt.checkSession({ + success: function () { + console.log("session is valid, user current code: " + API._loginCode + ", " + API._loginAnonymousCode); + callback === null || callback === void 0 ? void 0 : callback(API._loginCode, API._loginAnonymousCode); + }, + fail: function () { + console.log("session expired"); + loginPlatform(); + }, + }); + } + else { + console.log('not mini game platform, login null'); + callback === null || callback === void 0 ? void 0 : callback(null, null); + } + } + }; + /** + * 小游戏平台登录功能。微信返回code,抖音返回code和anonymousCode。用于登录的凭证,需要把这个code传回你的服务器程序中去调用code2Session + * @param callback (code, anonymousCode) 第一个参数为code,微信和抖音都支持;第二个参数为匿名设备ID,仅抖音支持,失败都返回null + */ + API.getUserInfo = function (callback) { + //@ts-ignore + tt.getUserInfo({ + withCredentials: true, + success: function (res) { + API._userInfo = res; + callback(API._userInfo); + }, + fail: function (err) { + callback(err); + } + }); + }; + /** + * 调用微信云函数。由于参数需要自定义,所以为any,需要自行解释。函数只完成通道和处理一场的作用 + * @param callback 返回云函数调用结果。需要检查返回参数是否为空,失败的时候为空 + * @param name 云函数的名字 + * @param data 云函数的内容 + */ + API.callWechatCloudFunction = function (callback, name, data) { + if (!isWechat()) { + console.log('Not wechat platform, not support callWechatCloudFunction'); + return; + } + this.login(function (code, anonymousCode) { + if (!API._hasInitWechatCloudFunction) { + //@ts-ignore + wx.cloud.init(); + API._hasInitWechatCloudFunction = true; + } + //@ts-ignore + wx.cloud.callFunction({ + name: name, + data: data, + success: function (res) { return callback === null || callback === void 0 ? void 0 : callback(res); }, + fail: function (err) { + console.log('wechat cloud function error:', err); + callback === null || callback === void 0 ? void 0 : callback(null); + } + }); + }); + }; + /** + * 存储用户信息,数据量不能大。可以考虑用于分数排行榜。用户之间可共享排行数据。 + * @param key + * @param value + */ + API.setUserCloudStorage = function (key, value) { + if (isWechat()) { + // @ts-ignore + wx.setUserCloudStorage({ + KVDataList: [{ key: key, value: value }], + success: function () { return console.log("set cloud storage success:" + key + ", value:" + value); }, + fail: function (err) { return console.log('set cloud storage error:', err); } + }); + } + if (isBytedance()) { + // @ts-ignore + tt.setUserCloudStorage({ + KVDataList: [{ key: key, value: value, }], + success: function () { return console.log("set cloud storage success:" + key + ", value:" + value); }, + fail: function (err) { return console.log('set cloud storage error:', err); } + }); + } + }; + API._loginCode = null; + API._loginAnonymousCode = null; + API._hasInitWechatCloudFunction = false; + API._userInfo = null; + return API; + }()); + MiniGameSdk.API = API; + /** + * 抖音侧边栏专属接口 + */ + var BytedanceSidebar = /** @class */ (function () { + function BytedanceSidebar() { + } + /** + * 本游戏在抖音环境下启动监控,需要放在全局环境中,保证能第一时间启动。因为可能监听抖音失败(抖音小游戏官方的说明)! + * @param onResult 包含一个boolean参数的函数 + * @param target 上述函数的拥有者,如果是类的成员函数,需要传入this。普通或匿名函数忽略即可。 + */ + BytedanceSidebar.listenFromSidebar = function (onResult, target) { + if (!isBytedance()) { + onResult === null || onResult === void 0 ? void 0 : onResult.call(target, false); + return; + } + // @ts-ignore + tt.onShow(function (res) { + console.log('onShow launch res:', res); + if (res.scene === '021036') { + onResult === null || onResult === void 0 ? void 0 : onResult.call(target, true); + console.log('launch from sidebar'); + } + else { + onResult === null || onResult === void 0 ? void 0 : onResult.call(target, false); + console.log('NOT launch from douyin sidebar!'); + } + }); + // @ts-ignore + var options = tt.getLaunchOptionsSync(); + if (options && options.scene === '021036') { + onResult === null || onResult === void 0 ? void 0 : onResult.call(target, true); + } + }; + /** + * 检测抖音侧边栏是否存在 + * @param onResult 包含一个boolean参数的函数 + * @param target 上述函数的拥有者,如果是类的成员函数,需要传入this。普通或匿名函数忽略即可。 + * @returns + */ + BytedanceSidebar.checkSideBar = function (onResult, target) { + if (!isBytedance()) { + onResult === null || onResult === void 0 ? void 0 : onResult.call(target, false); + return; + } + //@ts-ignore + tt.checkScene({ + scene: "sidebar", + success: function (res) { + console.log("check scene success: ", res.isExist); + onResult === null || onResult === void 0 ? void 0 : onResult.call(target, res.isExist); + }, + fail: function (res) { + console.log("check scene fail:", res); + onResult === null || onResult === void 0 ? void 0 : onResult.call(target, false); + } + }); + }; + /** + * 跳转到抖音侧边栏 + * @param onResult 包含一个boolean参数的函数 + * @param target 上述函数的拥有者,如果是类的成员函数,需要传入this。普通或匿名函数忽略即可。 + * @returns + */ + BytedanceSidebar.navigateToSidebar = function (onResult, target) { + if (!isBytedance()) { + console.log("not douyin platform!"); + onResult === null || onResult === void 0 ? void 0 : onResult.call(target, false); + return; + } + // @ts-ignore + tt.navigateToScene({ + scene: "sidebar", + success: function () { + console.log("navigate success"); + onResult === null || onResult === void 0 ? void 0 : onResult.call(target, true); + }, + fail: function (res) { + console.log("navigate failed reason:", res); + onResult === null || onResult === void 0 ? void 0 : onResult.call(target, false); + }, + }); + }; + return BytedanceSidebar; + }()); + MiniGameSdk.BytedanceSidebar = BytedanceSidebar; +})(MiniGameSdk = exports.MiniGameSdk || (exports.MiniGameSdk = {})); + +cc._RF.pop(); \ No newline at end of file diff --git a/library/imports/c1/c1af99dd-ee03-40f7-9609-d3887d0dd357.js.map b/library/imports/c1/c1af99dd-ee03-40f7-9609-d3887d0dd357.js.map new file mode 100644 index 0000000..8b1f333 --- /dev/null +++ b/library/imports/c1/c1af99dd-ee03-40f7-9609-d3887d0dd357.js.map @@ -0,0 +1 @@ +{"version":3,"sources":["assets\\Script\\Sdk\\MiniGameSdk.ts"],"names":[],"mappings":";;;;;;;AAAA;;GAEG;AACH,IAAiB,WAAW,CAsmC3B;AAtmCD,WAAiB,WAAW;IAYxB,SAAgB,QAAQ;QACpB,YAAY;QACZ,OAAO,MAAM,CAAC,EAAE,KAAK,IAAI,IAAI,MAAM,CAAC,EAAE,KAAK,S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UAAC,GAAQ;oBACX,OAAO,CAAC,GAAG,CAAC,mBAAmB,EAAE,GAAG,CAAC,CAAC;oBACtC,QAAQ,aAAR,QAAQ,uBAAR,QAAQ,CAAE,IAAI,CAAC,MAAM,EAAE,KAAK,EAAE;gBAClC,CAAC;aACJ,CAAC,CAAC;QACP,CAAC;QAED;;;;;WAKG;QACI,kCAAiB,GAAxB,UAAyB,QAAoC,EAAE,MAAY;YACvE,IAAI,CAAC,WAAW,EAAE,EAAE;gBAChB,OAAO,CAAC,GAAG,CAAC,sBAAsB,CAAC,CAAC;gBACpC,QAAQ,aAAR,QAAQ,uBAAR,QAAQ,CAAE,IAAI,CAAC,MAAM,EAAE,KAAK,EAAE;gBAC9B,OAAO;aACV;YAED,aAAa;YACb,EAAE,CAAC,eAAe,CAAC;gBACf,KAAK,EAAE,SAAS;gBAChB,OAAO,EAAE;oBACL,OAAO,CAAC,GAAG,CAAC,kBAAkB,CAAC,CAAC;oBAChC,QAAQ,aAAR,QAAQ,uBAAR,QAAQ,CAAE,IAAI,CAAC,MAAM,EAAE,IAAI,EAAE;gBACjC,CAAC;gBACD,IAAI,EAAE,UAAC,GAAQ;oBACX,OAAO,CAAC,GAAG,CAAC,yBAAyB,EAAE,GAAG,CAAC,CAAC;oBAC5C,QAAQ,aAAR,QAAQ,uBAAR,QAAQ,CAAE,IAAI,CAAC,MAAM,EAAE,KAAK,EAAE;gBAClC,CAAC;aACJ,CAAC,CAAC;QACP,CAAC;QACL,uBAAC;IAAD,CAnFA,AAmFC,IAAA;IAnFY,4BAAgB,mBAmF5B,CAAA;AAEL,CAAC,EAtmCgB,WAAW,GAAX,mBAAW,KAAX,mBAAW,QAsmC3B","file":"","sourceRoot":"/","sourcesContent":["/**\r\n * 小游戏平台SDK工具封装,目前只支持微信和抖音平台\r\n */\r\nexport namespace MiniGameSdk {\r\n\r\n interface ISize {\r\n width: number;\r\n height: number;\r\n }\r\n\r\n export interface IPosition {\r\n top: number;\r\n left: number;\r\n }\r\n\r\n export function isWechat(): boolean {\r\n //@ts-ignore\r\n return window.wx !== null && window.wx !== undefined;\r\n }\r\n\r\n export function isBytedance(): boolean {\r\n //@ts-ignore\r\n return window.tt !== null && window.tt !== undefined;\r\n }\r\n\r\n\r\n function getSysWinSize(): ISize {\r\n let sys: any;\r\n if (isWechat()) {\r\n // @ts-ignore\r\n sys = wx.getSystemInfoSync();\r\n } else if (isBytedance()) {\r\n // @ts-ignore\r\n sys = tt.getSystemInfoSync();\r\n }\r\n\r\n let size: ISize = { width: 0, height: 0 };\r\n if (sys) {\r\n size.width = sys.windowWidth;\r\n size.height = sys.windowHeight;\r\n }\r\n\r\n return size;\r\n }\r\n\r\n /**\r\n * 插屏广告。微信抖音都支持!\r\n */\r\n class ADInterstitial {\r\n private _adUid: string;\r\n private _interstitial: any;\r\n\r\n get aduid() {\r\n return this._adUid;\r\n }\r\n\r\n constructor(adUid: string) {\r\n this._adUid = adUid;\r\n }\r\n\r\n show() {\r\n // @ts-ignore\r\n if (isWechat() && !wx.createInterstitialAd) {\r\n console.warn('wechat unsupport interstitial AD!');\r\n this._interstitial = null;\r\n return;\r\n }\r\n\r\n // @ts-ignore\r\n if (isBytedance() && !tt.createInterstitialAd) {\r\n console.warn('bytedance unsupport interstitial AD!');\r\n this._interstitial = null;\r\n return;\r\n }\r\n\r\n\r\n if (this._interstitial) {\r\n this._interstitial.load();\r\n } else {\r\n if (isWechat()) {\r\n // @ts-ignore\r\n this._interstitial = wx.createInterstitialAd({ adUnitId: this._adUid });\r\n } else if (isBytedance()) {\r\n // @ts-ignore\r\n this._interstitial = tt.createInterstitialAd({ adUnitId: this._adUid });\r\n } else {\r\n this._interstitial = null;\r\n }\r\n\r\n this._interstitial?.onLoad(() => {\r\n console.log('load interstitial ad success');\r\n this._interstitial.show().catch((err: any) => {\r\n console.log('catch interstitial ad error:', err);\r\n });\r\n });\r\n\r\n this._interstitial?.onError((err: any) => {\r\n console.log('interstitial ad on error:', err);\r\n });\r\n }\r\n }\r\n destory() {\r\n this._interstitial?.destroy();\r\n }\r\n }\r\n\r\n class ADBanner {\r\n private _adUid: string;\r\n private _banner: any;\r\n\r\n get aduid() {\r\n return this._adUid;\r\n }\r\n\r\n /**\r\n * 抖音和微信都支持\r\n * 横幅广告。预估宽度默认为300,预估高度为140。如果你不确定就按默认值来。\r\n * @param adUid 广告UID,后端配置\r\n * @param isTop 是否在屏幕顶部展示。内部会自动居中计算位置。\r\n * @param bannerWidth 横幅广告的预估宽度。默认300\r\n * @param autoShow 广告加载完成后是否立刻显示,默认为不显示\r\n */\r\n constructor(adUid: string, param: boolean | IPosition, bannerWidth: number = 300, autoShow: boolean = false) {\r\n this._adUid = adUid;\r\n this.create(autoShow, bannerWidth, param); // 默认300比较合适\r\n }\r\n\r\n private create(autoShow: boolean, bannerWidth: number, param: boolean | IPosition) {\r\n if (!isWechat() && !isBytedance()) {\r\n this._banner = null;\r\n return;\r\n }\r\n\r\n this.destroy();\r\n\r\n let winSize = getSysWinSize();\r\n\r\n let height = bannerWidth * 0.4;\r\n let top = 0, left = 0;\r\n\r\n if (typeof param === \"boolean\") {\r\n left = (winSize.width - bannerWidth) / 2\r\n top = param ? 5 : (winSize.height - height);\r\n } else {\r\n left = param.left;\r\n top = param.top;\r\n }\r\n\r\n let params = {\r\n adUnitId: this._adUid,\r\n adIntervals: 30,// 自动刷新频率不能小于30秒\r\n style: { left: left, top: top, width: bannerWidth }\r\n }\r\n\r\n if (isWechat()) {\r\n // @ts-ignore\r\n this._banner = wx.createBannerAd(params);\r\n } else if (isBytedance()) {\r\n // @ts-ignore\r\n this._banner = tt.createBannerAd(params);\r\n } else {\r\n this._banner = null;\r\n }\r\n\r\n this._banner?.onError((err: any) => {\r\n console.log('ad banner error:', err);\r\n });\r\n\r\n this._banner?.onLoad(() => {\r\n autoShow && this._banner.show();\r\n });\r\n }\r\n\r\n show() {\r\n this._banner?.show();\r\n }\r\n\r\n hide() {\r\n this._banner?.hide();\r\n }\r\n\r\n destroy() {\r\n this._banner?.destroy();\r\n }\r\n }\r\n\r\n class ADCustom {\r\n private _adUid: string;\r\n private _adCustom: any;\r\n\r\n get aduid() {\r\n return this._adUid;\r\n }\r\n /**\r\n * 由于原生模板广告在微信服务后端可以定制宽度大小,个数,缩放比例等,所以位置调整要根据设置的宽度来定。抖音不支持!\r\n * @param adUid 广告UID,后端配置\r\n * @param top 从左上角开始,距离屏幕顶部的距离。注意:这个数据为设备屏幕宽度width。如果需要获取屏幕的像素,需要乘以设备像素比Pixel-Ratio,例如iPhone 13 Pro的Pixel-Ratio为3,像素为Width*3。\r\n * @param left 从左上角开始,距离屏幕最左边的距离。注意:这个数据为设备屏幕宽度width。如果需要获取屏幕的像素,需要乘以设备像素比Pixel-Ratio,例如iPhone 13 Pro的Pixel-Ratio为3,像素为Width*3。\r\n * @param scale 原生模板广告的尺寸,默认为1,即100%。此值在微信服务后端广告中获得,默认为100%,目前有100%,90%,80%三种,一般情况不用修改。若有修改,记得传入值,例如90%就传入0.9。\r\n */\r\n constructor(adUid: string, top: number = 0, left: number = 0, scale: number = 1.0) {\r\n this._adUid = adUid;\r\n this.createCustomAd(top, left, scale);\r\n }\r\n\r\n private createCustomAd(top: number, left: number, scale: number) {\r\n if (!isWechat()) { // only wechat support custom ad\r\n this._adCustom = null;\r\n console.log('Only wechat support Custom Ad');\r\n return;\r\n }\r\n\r\n this.destroy();\r\n // 原生模板5个应用宽度为375,若设置了缩放比例,则宽度也需要设置\r\n // let width = 375 * this._scale;\r\n // let newLeft = (sys.windowWidth - width) / 2;\r\n // let newTop = sys.windowHeight / 2; // 120是预估高度\r\n\r\n // @ts-ignore\r\n this._adCustom = wx.createCustomAd({\r\n adUnitId: this._adUid,\r\n style: { left: left, top: top, fixed: true }\r\n });\r\n\r\n this._adCustom?.onError((err: any) => {\r\n console.log('ad custom error:', err);\r\n });\r\n }\r\n show() {\r\n this._adCustom?.show();\r\n }\r\n\r\n hide() {\r\n this._adCustom?.hide();\r\n }\r\n\r\n destroy() {\r\n this._adCustom?.destroy();\r\n }\r\n }\r\n\r\n\r\n /**\r\n * 视频广告用户点击行为结果\r\n */\r\n export enum EAdVideoResult {\r\n /**\r\n * 用户看完了广告,游戏可发放奖励。\r\n */\r\n ACCEPT,\r\n\r\n /**\r\n * 用户中途关闭了广告,即未看完状态。不可发放奖励。\r\n */\r\n REJECT,\r\n\r\n /**\r\n * 广告组件内部发生了错误。不可发放奖励。\r\n */\r\n ERROR,\r\n }\r\n\r\n class ADVideo {\r\n private _adUid: string;\r\n private _adVideo: any = null;\r\n\r\n get aduid() {\r\n return this._adUid;\r\n }\r\n\r\n constructor(adUid: string) {\r\n this._adUid = adUid;\r\n }\r\n\r\n /**\r\n * 由于微信和抖音视频广告机制不同,微信可以看的视频广告个数只有0和1个,抖音平台则可以看0~maxVideoCount\r\n * @param onResult 两个参数:第一个res是EAdVideoResult定义,第二count是用户看了多少个视频广告。\r\n * @param target onResult的拥有者\r\n * @param maxVideoCount 可以连续看最大视频个数,可最大化商业效率。默认为3个。\r\n * @returns \r\n */\r\n show(onResult: (res: EAdVideoResult, count: number) => void, target?: any, maxVideoCount: number = 3): void {\r\n let callback = (state: EAdVideoResult, count: number) => {\r\n onResult?.call(target, state, count);\r\n }\r\n\r\n if (!isWechat() && !isBytedance()) {\r\n callback(EAdVideoResult.ACCEPT, 1);\r\n this._adVideo = null;\r\n return;\r\n }\r\n\r\n let onAdVideoClosed = (res: any) => {\r\n this._adVideo?.offClose(onAdVideoClosed);\r\n if (isWechat()) {\r\n if (res && res.isEnded || res === undefined) {\r\n callback(EAdVideoResult.ACCEPT, 1);\r\n } else {\r\n callback(EAdVideoResult.REJECT, 0);\r\n }\r\n } else if (isBytedance()) {\r\n let resConverted = res as { isEnded: boolean, count: number };\r\n if (resConverted && resConverted.count > 0) {\r\n callback(EAdVideoResult.ACCEPT, resConverted.count);\r\n } else {\r\n callback(EAdVideoResult.REJECT, 0);\r\n }\r\n }\r\n }\r\n\r\n this._adVideo?.offClose(onAdVideoClosed);\r\n\r\n if (isWechat()) {\r\n // @ts-ignore\r\n this._adVideo = wx.createRewardedVideoAd({\r\n adUnitId: this._adUid\r\n });\r\n } else if (isBytedance()) {\r\n // @ts-ignore\r\n this._adVideo = tt.createRewardedVideoAd({\r\n adUnitId: this._adUid,\r\n multiton: true,\r\n multitonRewardMsg: ['多1次奖励', '再多一次奖励', '再多一次奖励'],\r\n multitonRewardTimes: maxVideoCount,\r\n });\r\n } else {\r\n this._adVideo = null;\r\n }\r\n\r\n\r\n this._adVideo?.onLoad(() => {\r\n console.log('Ad load success');\r\n });\r\n\r\n this._adVideo?.onError((err: { errMsg: string, errCode: number }) => {\r\n console.log('Ad video error:', err);\r\n callback(EAdVideoResult.ERROR, 0);\r\n });\r\n\r\n this._adVideo?.onClose(onAdVideoClosed);\r\n\r\n this._adVideo?.show().catch(() => {\r\n this._adVideo?.load().then(() =>\r\n this._adVideo?.show()).catch((err: { errMsg: string, errCode: number }) => {\r\n console.log('Catch video ad error:', err);\r\n callback(EAdVideoResult.ERROR, 0);\r\n });\r\n });\r\n }\r\n\r\n destory() {\r\n this._adVideo?.destory();\r\n }\r\n }\r\n\r\n export enum EAdBannerLocation {\r\n /**\r\n * 屏幕顶部\r\n */\r\n TOP,\r\n\r\n /**\r\n * 屏幕底部\r\n */\r\n BOTTOM,\r\n }\r\n\r\n export class AdvertManager {\r\n\r\n private static _instance: AdvertManager;\r\n\r\n static get instance(): AdvertManager {\r\n if (!AdvertManager._instance) {\r\n AdvertManager._instance = new AdvertManager();\r\n }\r\n return AdvertManager._instance;\r\n }\r\n\r\n private _video: ADVideo;\r\n private _interstitial: ADInterstitial;\r\n private _banner: ADBanner;\r\n private _customs: Record = {};\r\n\r\n private constructor() {\r\n\r\n }\r\n\r\n /**\r\n * 预加载横幅广告,不会显示。只有你在调用showBanner时才会显示。\r\n * 可重复调用,但是会销毁上一次的实例。一般情况,全局有一个就行了,太多占用内存,而且没必要。\r\n * @param adUid 广告UID\r\n * @param location 位置有两种情况:1、可以传入枚举值,默认上方; 2、可以自定义位置传入IPosition,注意IPosition中的top和left跟平台的top,left是一致(没有乘以设备像素比ratio),需要开发者自己调试位置\r\n * @param scale 默认为跟屏幕一样的宽度,可以通过设置缩放比例来调整大小。当然,平台有规定最大或最小宽度,函数内部会自动计算。\r\n */\r\n public loadBanner(adUid: string, location: EAdBannerLocation | IPosition = EAdBannerLocation.TOP, scale: number = 1.0) {\r\n this._banner?.destroy();\r\n let size: ISize = getSysWinSize();\r\n // 当 style.width 小于 300 时,会取作 300。 当 style.width 大于屏幕宽度时,会取作屏幕宽度。\r\n let width = size.width * scale;\r\n width = width < 300 ? 300 : width; // 最小值矫正\r\n width = width > size.width ? size.width : width; //最大值矫正\r\n this._banner = typeof location === 'number' ? new ADBanner(adUid, location === EAdBannerLocation.TOP, width, false) : new ADBanner(adUid, location, width, false);\r\n }\r\n\r\n /**\r\n * 显示横幅广告\r\n */\r\n public showBanner() {\r\n if (this._banner) {\r\n this._banner.show();\r\n } else {\r\n console.warn('MiniGameSDK: banner is null, you must call loadBanner(...) first!');\r\n }\r\n }\r\n\r\n /**\r\n * 隐藏横幅广告\r\n */\r\n public hideBanner() {\r\n this._banner?.hide();\r\n }\r\n\r\n /**\r\n * 弹出插屏广告\r\n * @param adUid 广告单元id\r\n */\r\n public showInterstitial(adUid: string) {\r\n if (this._interstitial && this._interstitial.aduid === adUid) {\r\n this._interstitial.show();\r\n } else {\r\n this._interstitial?.destory();\r\n this._interstitial = new ADInterstitial(adUid);\r\n this._interstitial.show();\r\n }\r\n }\r\n\r\n /**\r\n * 加载原生模板广告,不会显示。只有你在调用showCustom时才会显示。\r\n * 由于原生模板广告在微信服务后端可以定制宽度大小,个数,缩放比例等,所以位置调整要根据设置的宽度来定。抖音不支持本函数,会调用无效!\r\n * @param adUid 广告ID\r\n * @param location 位置有两种情况:1、可以传入枚举值,默认上方; 2、可以自定义位置传入IPosition,注意IPosition中的top和left跟平台的top,left是一致(没有乘以设备像素比ratio),需要开发者自己调试位置\r\n * @param scale 缩放比例,默认是1,即不缩放。这个缩放并不是自己填,而是根据微信MP后台你配置的原生模板广告的缩放比例填,目前有100%,90%,80%三种,一般情况不用修改。若有后台修改,记得传入值,例如90%就传入0.9。\r\n */\r\n public loadCustom(adUid: string, location: IPosition = { top: 0, left: 0 }, scale: number = 1) {\r\n // this._custom?.destroy();\r\n // this._custom = new ADCustom(adUid, location.top, location.left, scale);\r\n if (this._customs[adUid]) {\r\n console.log(`${adUid} has been loaded.`);\r\n return;\r\n }\r\n\r\n this._customs[adUid] = new ADCustom(adUid, location.top, location.left, scale);\r\n }\r\n\r\n /**\r\n * 显示自定义广告。\r\n * @param adUid 广告的唯一标识符。使用此标识符来查找和显示特定的自定义广告。\r\n * \r\n * 此方法尝试根据提供的adUid显示一个自定义广告。如果给定的adUid对应的自定义广告已加载,\r\n * 则调用该广告的显示方法。如果广告未加载,则在控制台输出警告信息。\r\n */\r\n public showCustom(adUid: string) {\r\n if (this._customs[adUid]) {\r\n this._customs[adUid].show();\r\n } else {\r\n console.warn(`You have not load ${adUid} of Custom AD, can not show!`);\r\n }\r\n }\r\n\r\n /**\r\n * 隐藏指定的自定义广告单元\r\n * \r\n * 此方法用于隐藏通过广告单元标识符(adUid)指定的自定义广告。如果指定的广告单元已加载并显示,\r\n * 则将其隐藏;如果广告单元未加载,则在控制台输出警告信息。\r\n * \r\n * @param adUid 广告单元标识符,用于唯一标识一个自定义广告单元。\r\n */\r\n public hideCustom(adUid: string) {\r\n if (this._customs[adUid]) {\r\n this._customs[adUid].hide();\r\n } else {\r\n console.warn(`You have not load ${adUid} of Custom AD, can not hide!`);\r\n }\r\n }\r\n\r\n /**\r\n * 由于微信和抖音视频广告机制不同,微信可以看的视频广告个数只有0和1个,抖音平台则可以看0~maxVideoCount\r\n * @param adUid 广告ID。如果与上一次UID不同,则内部会重新创建实例。开发者完全不用关心这个细节。\r\n * @param onVideoResult 两个参数:第一个res是EAdVideoResult定义,第二count是用户看了多少个视频广告。 \r\n * @param target onVideoResult的拥有者\r\n * @param maxVideoCount 最大视频个数。默认是3,仅对抖音平台生效。微信平台看完视频count的结果永远是1或0\r\n */\r\n public showVideo(adUid: string, onVideoResult: (res: EAdVideoResult, count: number) => void, target?: any, maxVideoCount: number = 3) {\r\n if (this._video && this._video.aduid === adUid) {\r\n this._video.show(onVideoResult, target, maxVideoCount);\r\n } else {\r\n this._video?.destory();\r\n this._video = new ADVideo(adUid);\r\n this._video.show(onVideoResult, target, maxVideoCount);\r\n }\r\n }\r\n\r\n /**\r\n * 销毁内部所有实例,清空内存\r\n */\r\n public destroyAll() {\r\n this._banner?.destroy();\r\n this._banner = null;\r\n\r\n this._interstitial?.destory();\r\n this._interstitial = null;\r\n\r\n this._video?.destory();\r\n this._video = null;\r\n\r\n if (this._customs) {\r\n for (let val in this._customs) {\r\n this._customs[val]?.destroy();\r\n }\r\n this._customs = {};\r\n }\r\n }\r\n }\r\n\r\n export enum EGameClubIcon {\r\n /** 绿色图标 */\r\n GREEN = 'green',\r\n\r\n /** 红色图标 */\r\n WHITE = 'white',\r\n\r\n /** 有黑色圆角背景的白色图标 */\r\n DARK = 'dark',\r\n\r\n /** 有白色圆角背景的绿色图标 */\r\n LIGHT = 'light'\r\n }\r\n\r\n export class GameClub {\r\n private static _instance: GameClub;\r\n\r\n static get instance(): GameClub {\r\n if (!this._instance) {\r\n this._instance = new GameClub();\r\n }\r\n return this._instance;\r\n }\r\n\r\n private _club: any;\r\n\r\n private constructor() {\r\n\r\n }\r\n\r\n /**\r\n * 创建游戏圈按钮\r\n * @param icon \r\n * @param position \r\n * @param size \r\n * @param openLink \r\n */\r\n create(icon: EGameClubIcon = EGameClubIcon.GREEN, position: IPosition = { top: 0, left: 0 }, size: ISize = { width: 40, height: 40 }, openLink?: string) {\r\n if (isWechat()) {\r\n // @ts-ignore\r\n this._club = wx.createGameClubButton({\r\n icon: icon,\r\n style: {\r\n left: position.left,\r\n top: position.top,\r\n width: size.width,\r\n height: size.height\r\n },\r\n openlink: openLink\r\n });\r\n }\r\n }\r\n\r\n show() {\r\n this._club?.show();\r\n }\r\n\r\n hide() {\r\n this._club?.hide();\r\n }\r\n\r\n destory() {\r\n this._club?.destroy();\r\n }\r\n }\r\n\r\n\r\n /**\r\n * 振动类型\r\n */\r\n export enum EVirbrateType {\r\n /**\r\n * 短振动\r\n */\r\n SHORT,\r\n\r\n /**\r\n * 长振动\r\n */\r\n LONG\r\n }\r\n\r\n /**\r\n * 平台常用API合集\r\n */\r\n export class API {\r\n private static _loginCode: string = null;\r\n private static _loginAnonymousCode: string = null;\r\n private static _hasInitWechatCloudFunction: boolean = false;\r\n private static _userInfo: any = null;\r\n\r\n /**\r\n * 分享app给朋友,微信小游戏分享是没有onSuccess回调的。\r\n * @param title 标题\r\n * @param description 细节描述信息 \r\n * @param imageUrl 图片地址\r\n * @param query 查询信息\r\n * @param onSuccess 抖音会回调,微信不会回调\r\n */\r\n static shareAppToFriends(title: string, description: string = '', imageUrl?: string, query?: string, onSuccess?: () => void) {\r\n if (isWechat()) {\r\n try {\r\n //@ts-ignore\r\n wx.shareAppMessage({\r\n title: title,\r\n imageUrl: imageUrl,\r\n query: query,\r\n });\r\n } catch (err) {\r\n console.log(`share faild: ${err}`);\r\n }\r\n }\r\n\r\n if (isBytedance()) {\r\n //@ts-ignore\r\n tt.shareAppMessage({\r\n title: title,\r\n desc: description,\r\n imageUrl: imageUrl ?? '',\r\n query: query ?? '',\r\n success(res: any) {\r\n console.log('share success:', res);\r\n onSuccess?.();\r\n },\r\n fail(res: any) {\r\n console.log('share fail:', res);\r\n }\r\n });\r\n }\r\n }\r\n\r\n /**\r\n * 显示提示信息\r\n * @param title 标题\r\n * @param duration 时长(单位:秒)\r\n * @returns \r\n */\r\n static showToast(title: string, duration: number = 2) {\r\n if (isWechat()) {\r\n // @ts-ignore\r\n wx.showToast({\r\n title: title,\r\n icon: 'success',\r\n duration: duration * 1000\r\n });\r\n }\r\n\r\n if (isBytedance()) {\r\n //@ts-ignore\r\n tt.showToast({\r\n title: title,\r\n duration: duration * 1000,\r\n success(res: any) {\r\n console.log(`${res}`);\r\n },\r\n fail(res: any) {\r\n console.log(`showToast调用失败`);\r\n },\r\n });\r\n }\r\n }\r\n\r\n /**\r\n * 设备震动效果,默认为短震动。注意:可能一些机型不会生效,具体看平台方的说明\r\n * @param type MiniGameSdk.API.EVirbrateType\r\n */\r\n static vibrate(type: EVirbrateType = EVirbrateType.SHORT) {\r\n if (isWechat()) {\r\n switch (type) {\r\n case EVirbrateType.SHORT:\r\n //@ts-ignore\r\n wx.vibrateShort({\r\n success(res: any) {\r\n console.log('vibrate success:', res);\r\n },\r\n fail(res: any) {\r\n console.log('vibrateShort failed', res);\r\n },\r\n });\r\n break;\r\n case EVirbrateType.LONG:\r\n //@ts-ignore\r\n wx.vibrateLong({\r\n success(res: any) {\r\n console.log('vibrate success', res);\r\n },\r\n fail(res: any) {\r\n console.log(`vibrateLong failed`, res);\r\n },\r\n });\r\n break;\r\n default:\r\n break;\r\n }\r\n }\r\n\r\n if (isBytedance()) {\r\n switch (type) {\r\n case EVirbrateType.SHORT:\r\n //@ts-ignore\r\n tt.vibrateShort({\r\n success(res: any) {\r\n console.log('vibrate success:', res);\r\n },\r\n fail(res: any) {\r\n console.log('vibrateShort failed', res);\r\n },\r\n });\r\n break;\r\n case EVirbrateType.LONG:\r\n //@ts-ignore\r\n tt.vibrateLong({\r\n success(res: any) {\r\n console.log('vibrate success', res);\r\n },\r\n fail(res: any) {\r\n console.log(`vibrateLong failed`, res);\r\n },\r\n });\r\n break;\r\n default:\r\n break;\r\n }\r\n }\r\n }\r\n\r\n /**\r\n * 重启小游戏\r\n */\r\n static reboot() {\r\n if (isWechat()) {\r\n //@ts-ignore\r\n wx.restartMiniProgram({\r\n success: () => {\r\n console.log('restart success');\r\n },\r\n\r\n fail: () => {\r\n console.log('restart failed');\r\n }\r\n })\r\n }\r\n\r\n if (isBytedance()) {\r\n try {\r\n // @ts-ignore\r\n tt.restartMiniProgramSync();\r\n } catch (error) {\r\n console.log(`restartMiniProgramSync`, error);\r\n }\r\n }\r\n }\r\n\r\n /**\r\n * 退出小游戏\r\n */\r\n static exit() {\r\n if (isWechat()) {\r\n //@ts-ignore\r\n wx.exitMiniProgram({\r\n success: () => {\r\n console.log('exit success');\r\n },\r\n fail: () => {\r\n console.log('exit failed');\r\n }\r\n });\r\n }\r\n\r\n if (isBytedance()) {\r\n // @ts-ignore\r\n tt.exitMiniProgram({\r\n success(res: any) {\r\n console.log(\"exit success:\", res?.data);\r\n },\r\n fail(res: any) {\r\n console.log(\"exit fail:\", res?.errMsg);\r\n },\r\n });\r\n }\r\n }\r\n\r\n /**\r\n * 显示转发按钮。通常在刚进入游戏的时候调用。\r\n * 主要是打开平台“...”这个按钮里面的分享菜单,一般默认是关闭的,需要调用这个函数打开。可以让用户分享你的游戏入口。\r\n */\r\n static showShareMenu() {\r\n if (isWechat()) {\r\n //@ts-ignore\r\n wx.showShareMenu({\r\n withShareTicket: true,\r\n menus: ['shareAppMessage', 'shareTimeline'],\r\n success: () => { },\r\n fail: () => { },\r\n complete: () => { }\r\n });\r\n }\r\n\r\n if (isBytedance()) {\r\n //@ts-ignore\r\n tt.showShareMenu({\r\n success(res: any) {\r\n console.log(\"show menu is showing\");\r\n },\r\n fail(err: any) {\r\n console.log(\"showShareMenu:\", err.errMsg);\r\n },\r\n complete(res: any) {\r\n console.log(\"showShareMenu complete\");\r\n },\r\n });\r\n }\r\n }\r\n\r\n /**\r\n * 微信小游戏:跳转到另外一款小游戏\r\n * 抖音小游戏:跳转到指定的视频界面\r\n * @param targetId 微信小游戏appid或者视频界面\r\n */\r\n static navigateTo(targetId: string, onSuccess?: () => void) {\r\n if (isWechat()) {\r\n // @ts-ignore\r\n wx.navigateToMiniProgram({\r\n appId: targetId,\r\n extraData: {\r\n foo: 'bar'\r\n },\r\n envVersion: 'develop',\r\n success(res: any) {\r\n onSuccess?.();\r\n }\r\n });\r\n }\r\n\r\n if (isBytedance()) {\r\n // @ts-ignore\r\n tt.navigateToVideoView({\r\n videoId: targetId,\r\n success: (res: any) => {\r\n onSuccess?.();\r\n },\r\n fail: (err: any) => {\r\n console.log(\"bytedance navigateToVideoView fail\", err);\r\n },\r\n });\r\n }\r\n }\r\n\r\n\r\n /**\r\n * 小游戏平台登录功能。微信返回code,抖音返回code和anonymousCode。用于登录的凭证,需要把这个code传回你的服务器程序中去调用code2Session\r\n * @param callback (code, anonymousCode) 第一个参数为code,微信和抖音都支持;第二个参数为匿名设备ID,仅抖音支持,失败都返回null\r\n */\r\n static login(callback: (code: string, anonymousCode: string) => void) {\r\n let loginPlatform = () => {\r\n if (isWechat()) {\r\n //@ts-ignore\r\n wx.login({\r\n success: (res: { code: any; errMsg: any; }) => {\r\n if (res.code) {\r\n API._loginCode = res.code;\r\n API._loginAnonymousCode = null;\r\n callback?.(API._loginCode, API._loginAnonymousCode);\r\n } else {\r\n console.log('login error:', res.errMsg)\r\n }\r\n },\r\n\r\n fail: () => {\r\n API._loginCode = null;\r\n API._loginAnonymousCode = null;\r\n callback?.(API._loginCode, API._loginAnonymousCode);\r\n console.log('login fail')\r\n }\r\n });\r\n } else if (isBytedance()) {\r\n //@ts-ignore\r\n tt.login({\r\n force: true,\r\n success(res: any) {\r\n console.log(`login ${res.code} ${res.anonymousCode}`);\r\n if (res.code) {\r\n API._loginCode = res.code?.toString();\r\n API._loginAnonymousCode = res.anonymousCode?.toString();\r\n callback?.(API._loginCode, API._loginAnonymousCode);\r\n } else {\r\n console.log('login error:', res.errMsg)\r\n }\r\n },\r\n fail(res: any) {\r\n API._loginCode = null;\r\n API._loginAnonymousCode = null;\r\n callback?.(API._loginCode, API._loginAnonymousCode);\r\n console.log(`login fail`, res);\r\n },\r\n });\r\n } else {\r\n API._loginCode = null;\r\n API._loginAnonymousCode = null;\r\n callback?.(API._loginCode, API._loginAnonymousCode);\r\n console.log('not mini game platform, login codes are all null');\r\n }\r\n }\r\n\r\n\r\n\r\n if (!API._loginCode) {\r\n loginPlatform();\r\n } else {\r\n if (isWechat()) {\r\n //@ts-ignore\r\n wx.checkSession({\r\n success() {\r\n console.log(`session is valid, use current code:`, API._loginCode);\r\n callback?.(API._loginCode, API._loginAnonymousCode);\r\n },\r\n fail() {\r\n console.log(`session expired`);\r\n loginPlatform();\r\n }\r\n });\r\n } else if (isBytedance()) {\r\n //@ts-ignore\r\n tt.checkSession({\r\n success() {\r\n console.log(`session is valid, user current code: ${API._loginCode}, ${API._loginAnonymousCode}`);\r\n callback?.(API._loginCode, API._loginAnonymousCode);\r\n },\r\n fail() {\r\n console.log(`session expired`);\r\n loginPlatform();\r\n },\r\n });\r\n\r\n } else {\r\n console.log('not mini game platform, login null');\r\n callback?.(null, null);\r\n }\r\n }\r\n }\r\n\r\n /**\r\n * 小游戏平台登录功能。微信返回code,抖音返回code和anonymousCode。用于登录的凭证,需要把这个code传回你的服务器程序中去调用code2Session\r\n * @param callback (code, anonymousCode) 第一个参数为code,微信和抖音都支持;第二个参数为匿名设备ID,仅抖音支持,失败都返回null\r\n */\r\n static getUserInfo(callback: (userInfo: any) => void) {\r\n //@ts-ignore\r\n tt.getUserInfo({\r\n withCredentials: true,\r\n success: (res: any) => {\r\n API._userInfo = res;\r\n callback(API._userInfo);\r\n },\r\n fail: (err: any) =>{\r\n callback(err);\r\n }\r\n });\r\n }\r\n\r\n /**\r\n * 调用微信云函数。由于参数需要自定义,所以为any,需要自行解释。函数只完成通道和处理一场的作用\r\n * @param callback 返回云函数调用结果。需要检查返回参数是否为空,失败的时候为空\r\n * @param name 云函数的名字\r\n * @param data 云函数的内容\r\n */\r\n static callWechatCloudFunction(callback: (res: any) => void, name: string, data: {}) {\r\n if (!isWechat()) {\r\n console.log('Not wechat platform, not support callWechatCloudFunction');\r\n return;\r\n }\r\n\r\n this.login((code: string, anonymousCode: string) => {\r\n if (!API._hasInitWechatCloudFunction) {\r\n //@ts-ignore\r\n wx.cloud.init();\r\n API._hasInitWechatCloudFunction = true;\r\n }\r\n //@ts-ignore\r\n wx.cloud.callFunction({\r\n name: name,\r\n data: data,\r\n success: (res: any) => callback?.(res),\r\n fail: (err: any) => {\r\n console.log('wechat cloud function error:', err);\r\n callback?.(null);\r\n }\r\n });\r\n });\r\n }\r\n\r\n /**\r\n * 存储用户信息,数据量不能大。可以考虑用于分数排行榜。用户之间可共享排行数据。\r\n * @param key \r\n * @param value \r\n */\r\n static setUserCloudStorage(key: string, value: string) {\r\n if (isWechat()) {\r\n // @ts-ignore\r\n wx.setUserCloudStorage({\r\n KVDataList: [{ key: key, value: value }],\r\n success: () => console.log(`set cloud storage success:${key}, value:${value}`),\r\n fail: (err: any) => console.log('set cloud storage error:', err)\r\n });\r\n }\r\n\r\n if (isBytedance()) {\r\n // @ts-ignore\r\n tt.setUserCloudStorage({\r\n KVDataList: [{ key: key, value: value, }],\r\n success: () => console.log(`set cloud storage success:${key}, value:${value}`),\r\n fail: (err: any) => console.log('set cloud storage error:', err)\r\n });\r\n }\r\n }\r\n }\r\n\r\n\r\n /**\r\n * 抖音侧边栏专属接口\r\n */\r\n export class BytedanceSidebar {\r\n /**\r\n * 本游戏在抖音环境下启动监控,需要放在全局环境中,保证能第一时间启动。因为可能监听抖音失败(抖音小游戏官方的说明)!\r\n * @param onResult 包含一个boolean参数的函数\r\n * @param target 上述函数的拥有者,如果是类的成员函数,需要传入this。普通或匿名函数忽略即可。\r\n */\r\n static listenFromSidebar(onResult: (success: boolean) => void, target?: any) {\r\n if (!isBytedance()) {\r\n onResult?.call(target, false);\r\n return;\r\n }\r\n // @ts-ignore\r\n tt.onShow((res: any) => {\r\n console.log('onShow launch res:', res);\r\n if (res.scene === '021036') {\r\n onResult?.call(target, true);\r\n console.log('launch from sidebar');\r\n } else {\r\n onResult?.call(target, false);\r\n console.log('NOT launch from douyin sidebar!');\r\n }\r\n });\r\n\r\n // @ts-ignore\r\n let options = tt.getLaunchOptionsSync();\r\n if (options && options.scene === '021036') {\r\n onResult?.call(target, true);\r\n }\r\n }\r\n\r\n /**\r\n * 检测抖音侧边栏是否存在\r\n * @param onResult 包含一个boolean参数的函数\r\n * @param target 上述函数的拥有者,如果是类的成员函数,需要传入this。普通或匿名函数忽略即可。\r\n * @returns \r\n */\r\n static checkSideBar(onResult: (success: boolean) => void, target?: any) {\r\n if (!isBytedance()) {\r\n onResult?.call(target, false);\r\n return;\r\n }\r\n\r\n //@ts-ignore\r\n tt.checkScene({\r\n scene: \"sidebar\",\r\n success: (res: any) => {\r\n console.log(\"check scene success: \", res.isExist);\r\n onResult?.call(target, res.isExist);\r\n\r\n },\r\n fail: (res: any) => {\r\n console.log(\"check scene fail:\", res);\r\n onResult?.call(target, false);\r\n }\r\n });\r\n }\r\n\r\n /**\r\n * 跳转到抖音侧边栏\r\n * @param onResult 包含一个boolean参数的函数\r\n * @param target 上述函数的拥有者,如果是类的成员函数,需要传入this。普通或匿名函数忽略即可。\r\n * @returns \r\n */\r\n static navigateToSidebar(onResult: (success: boolean) => void, target?: any) {\r\n if (!isBytedance()) {\r\n console.log(\"not douyin platform!\");\r\n onResult?.call(target, false);\r\n return;\r\n }\r\n\r\n // @ts-ignore\r\n tt.navigateToScene({\r\n scene: \"sidebar\",\r\n success: () => {\r\n console.log(\"navigate success\");\r\n onResult?.call(target, true);\r\n },\r\n fail: (res: any) => {\r\n console.log(\"navigate failed reason:\", res);\r\n onResult?.call(target, false);\r\n },\r\n });\r\n }\r\n }\r\n\r\n}"]} \ No newline at end of file diff --git a/library/imports/c5/c5692be7-8703-45e4-9f67-23b54d290356.js b/library/imports/c5/c5692be7-8703-45e4-9f67-23b54d290356.js index 74ce5af..44c4739 100644 --- a/library/imports/c5/c5692be7-8703-45e4-9f67-23b54d290356.js +++ b/library/imports/c5/c5692be7-8703-45e4-9f67-23b54d290356.js @@ -11,6 +11,7 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key, }; Object.defineProperty(exports, "__esModule", { value: true }); exports.GameConfig = void 0; +var share_1 = require("../Share/share"); var _a = cc._decorator, ccclass = _a.ccclass, property = _a.property; var GameConfig = /** @class */ (function () { function GameConfig() { @@ -27,13 +28,25 @@ var GameConfig = /** @class */ (function () { enumerable: false, configurable: true }); + GameConfig.getKey = function (key) { + var reg = new RegExp('(^|&)' + key + '=([^&]*)(&|$)', 'i'); + var r = window.location.search.substr(1).match(reg); + if (r != null) { + return unescape(r[2]); + } + return ""; + }; //getSeedRandom GameConfig.init = function (Authentication) { - debugger; this.CLICK_init(); this.LEVEL_INFO_init(); this.GM_INFO_init(); - var self = this; + if (!Authentication) + this.Authentication(); + // @ts-ignore + if (window.wx !== null && window.wx !== undefined) + share_1.WeChat.setShare(location.href); + // var self = this; // cc.resources.load('Json/CLICK_DATA', (err: any, res: cc.JsonAsset) => { // if (err) { // return; @@ -51,15 +64,85 @@ var GameConfig = /** @class */ (function () { // cc.resources.load('Json/GM_INFO', (err: any, res: cc.JsonAsset) => { // if (err) { // if(!Authentication) self.Authentication(); + // if(window.wx !== null && window.wx !== undefined) WeChat.setShare(location.href); // return; // } // let jsonData: object = res.json!; // self.GM_INFO = jsonData["data"]; + // self.setCode(self.getKey("scode")); // cc.fx.GameTool.getCustom(false); // if(!Authentication) self.Authentication(); + // if(window.wx !== null && window.wx !== undefined) WeChat.setShare(location.href); // }) //GAME_DATA 废弃了,暂时不删除以防后面修改回 一整局传一次 - self.GAME_DATA = []; + this.GAME_DATA = []; + this.CUSTOM_INFO = [ + //第一难度 + { + moveSpeed: 0, + waitTime: 20, + fastPath: 5 //最短路径 + }, + //第二难度 + { + moveSpeed: 0, + waitTime: 20, + fastPath: 5 //最短路径 + }, + //第三难度 + { + moveSpeed: 0, + waitTime: 20, + fastPath: 5 //最短路径 + }, + //第四难度 + { + moveSpeed: 0, + waitTime: 20, + fastPath: 5 //最短路径 + }, + //第五难度 + { + moveSpeed: 0, + waitTime: 20, + fastPath: 5 //最短路径 + }, + //第六难度 + { + moveSpeed: 0, + waitTime: 20, + fastPath: 5 //最短路径 + }, + //第七难度 + { + moveSpeed: 0, + waitTime: 20, + fastPath: 5 //最短路径 + }, + //第八难度 + { + moveSpeed: 0, + waitTime: 20, + fastPath: 5 //最短路径 + }, + //第九难度 + { + moveSpeed: 0, + waitTime: 20, + fastPath: 5 //最短路径 + }, + //第十难度 + { + moveSpeed: 0, + waitTime: 20, + fastPath: 5 //最短路径 + } + ]; + // @ts-ignore + if (window.wx !== null && window.wx !== undefined) + share_1.WeChat.setShare(location.href); + if (!Authentication) + this.Authentication(); }; //数据备用 GameConfig.GM_INFO_init = function () { @@ -68,19 +151,25 @@ var GameConfig = /** @class */ (function () { mean_Time: 0, total: 0, currSeed: 200000, - gameId: "100010", - userId: 200139, - guide: true, + gameId: "100012", + userId: 0, + scode: "", + guide: false, url: "https://api.sparkus.cn", success: false, matchId: null, custom: 0, + round: 0, level: 0, stepTimeList: 0, successList: [], - gameTime: 5, + fen: 0, + score: 0, igniteCount: 0, + min_Steps: 0, + min_Time: 0 //每一把上次距离洪峰到来时间 }; + this.setCode(this.getKey("scode")); }; GameConfig.GM_INFO_SET = function (key, value) { this.GM_INFO[key] = value; @@ -91,2520 +180,76 @@ var GameConfig = /** @class */ (function () { type: 1, success: false, round: 0, - choice: 0, - rightChoice: 0, - item: "", - roundType: 0, - stepTime: 0, - levelConfig: 0, - ignite: false, - igniteCount: 0, + getScore: 0, + cumulativeScore: 0, + mapId: "", + difficulty: 0, + optimizedSteps: 0, + usedSteps: 0, + stepList: [], + startTime: -1, + submitTime: -1, + duration: 0, + drawingBack: 0, + drawingReset: 0, + timer: 0, }; }; GameConfig.CLICK_SET = function (key, value) { this.CLICK_DATA[key] = value; }; GameConfig.LEVEL_INFO_init = function () { - this.LEVEL_INFO = [ - { - "custom": [ - { - "id": 1001, - "item": "danggui", - "type": 2, - "flammable": 0 - }, - { - "id": 1002, - "item": "cha", - "type": 1, - "flammable": 0 - }, - { - "id": 1003, - "item": "mudan", - "type": 2, - "flammable": 0 - }, - { - "id": 1004, - "item": "mulan", - "type": 2, - "flammable": 0 - }, - { - "id": 1005, - "item": "putao", - "type": 2, - "flammable": 0 - }, - { - "id": 1006, - "item": "cha", - "type": 1, - "flammable": 0 - }, - { - "id": 1007, - "item": "zhuye", - "type": 1, - "flammable": 0 - }, - { - "id": 1008, - "item": "mulan", - "type": 2, - "flammable": 0 - }, - { - "id": 1009, - "item": "mudan", - "type": 2, - "flammable": 0 - }, - { - "id": 1010, - "item": "zhuye", - "type": 1, - "flammable": 0 - }, - { - "id": 1011, - "item": "cha", - "type": 2, - "flammable": 0 - }, - { - "id": 1012, - "item": "mudan", - "type": 2, - "flammable": 0 - }, - { - "id": 1013, - "item": "moli", - "type": 1, - "flammable": 0 - }, - { - "id": 1014, - "item": "mulan", - "type": 2, - "flammable": 0 - }, - { - "id": 1015, - "item": "muchai", - "type": 1, - "flammable": 1 - }, - { - "id": 1016, - "item": "cha", - "type": 2, - "flammable": 0 - }, - { - "id": 1017, - "item": "renshen", - "type": 2, - "flammable": 0 - }, - { - "id": 1018, - "item": "jinju", - "type": 2, - "flammable": 0 - }, - { - "id": 1019, - "item": "lizi", - "type": 2, - "flammable": 0 - }, - { - "id": 1020, - "item": "gouqi", - "type": 1, - "flammable": 0 - }, - { - "id": 1021, - "item": "renshen", - "type": 1, - "flammable": 0 - }, - { - "id": 1022, - "item": "pugongying", - "type": 1, - "flammable": 0 - }, - { - "id": 1023, - "item": "lizhi", - "type": 2, - "flammable": 0 - }, - { - "id": 1024, - "item": "gancao", - "type": 2, - "flammable": 0 - }, - { - "id": 1025, - "item": "chixiaodou", - "type": 1, - "flammable": 0 - }, - { - "id": 1026, - "item": "dazao", - "type": 1, - "flammable": 0 - }, - { - "id": 1027, - "item": "putao", - "type": 2, - "flammable": 0 - }, - { - "id": 1028, - "item": "pugongying", - "type": 1, - "flammable": 0 - }, - { - "id": 1029, - "item": "longyan", - "type": 1, - "flammable": 0 - }, - { - "id": 1030, - "item": "ganjiang", - "type": 1, - "flammable": 0 - }, - { - "id": 1031, - "item": "gancao", - "type": 2, - "flammable": 0 - }, - { - "id": 1032, - "item": "dazao", - "type": 2, - "flammable": 0 - }, - { - "id": 1033, - "item": "lizhi", - "type": 1, - "flammable": 0 - }, - { - "id": 1034, - "item": "lizi", - "type": 2, - "flammable": 0 - }, - { - "id": 1035, - "item": "muchai", - "type": 2, - "flammable": 1 - }, - { - "id": 1036, - "item": "ganjiang", - "type": 1, - "flammable": 0 - }, - { - "id": 1037, - "item": "gancao", - "type": 2, - "flammable": 0 - }, - { - "id": 1038, - "item": "dazao", - "type": 1, - "flammable": 0 - }, - { - "id": 1039, - "item": "lizhi", - "type": 2, - "flammable": 0 - }, - { - "id": 1040, - "item": "renshen", - "type": 2, - "flammable": 0 - } - ] - }, - { - "custom": [ - { - "id": 2000, - "item": "cha", - "type": 2, - "flammable": 0 - }, - { - "id": 2001, - "item": "mudan", - "type": 2, - "flammable": 0 - }, - { - "id": 2002, - "item": "moli", - "type": 1, - "flammable": 0 - }, - { - "id": 2003, - "item": "mulan", - "type": 2, - "flammable": 0 - }, - { - "id": 2004, - "item": "muchai", - "type": 1, - "flammable": 1 - }, - { - "id": 2005, - "item": "cha", - "type": 2, - "flammable": 0 - }, - { - "id": 2006, - "item": "renshen", - "type": 2, - "flammable": 0 - }, - { - "id": 2007, - "item": "jinju", - "type": 2, - "flammable": 0 - }, - { - "id": 2008, - "item": "lizi", - "type": 2, - "flammable": 0 - }, - { - "id": 2009, - "item": "gouqi", - "type": 1, - "flammable": 0 - }, - { - "id": 2010, - "item": "renshen", - "type": 1, - "flammable": 0 - }, - { - "id": 2011, - "item": "pugongying", - "type": 1, - "flammable": 0 - }, - { - "id": 2012, - "item": "lizhi", - "type": 2, - "flammable": 0 - }, - { - "id": 2013, - "item": "gancao", - "type": 2, - "flammable": 0 - }, - { - "id": 2014, - "item": "chixiaodou", - "type": 1, - "flammable": 0 - }, - { - "id": 2015, - "item": "dazao", - "type": 1, - "flammable": 0 - }, - { - "id": 2016, - "item": "putao", - "type": 2, - "flammable": 0 - }, - { - "id": 2017, - "item": "pugongying", - "type": 1, - "flammable": 0 - }, - { - "id": 2018, - "item": "longyan", - "type": 1, - "flammable": 0 - }, - { - "id": 2019, - "item": "ganjiang", - "type": 1, - "flammable": 0 - }, - { - "id": 2020, - "item": "gancao", - "type": 2, - "flammable": 0 - }, - { - "id": 2021, - "item": "dazao", - "type": 2, - "flammable": 0 - }, - { - "id": 2022, - "item": "lizhi", - "type": 1, - "flammable": 0 - }, - { - "id": 2023, - "item": "lizi", - "type": 2, - "flammable": 0 - }, - { - "id": 2024, - "item": "muchai", - "type": 2, - "flammable": 1 - }, - { - "id": 2025, - "item": "ganjiang", - "type": 1, - "flammable": 0 - }, - { - "id": 2026, - "item": "gancao", - "type": 2, - "flammable": 0 - }, - { - "id": 2027, - "item": "dazao", - "type": 1, - "flammable": 0 - }, - { - "id": 2028, - "item": "lizhi", - "type": 2, - "flammable": 0 - }, - { - "id": 2029, - "item": "renshen", - "type": 2, - "flammable": 0 - }, - { - "id": 2030, - "item": "danshen", - "type": 1, - "flammable": 0 - }, - { - "id": 2031, - "item": "danggui", - "type": 2, - "flammable": 0 - }, - { - "id": 2032, - "item": "cha", - "type": 1, - "flammable": 0 - }, - { - "id": 2033, - "item": "mudan", - "type": 2, - "flammable": 0 - }, - { - "id": 2034, - "item": "mulan", - "type": 2, - "flammable": 0 - }, - { - "id": 2035, - "item": "putao", - "type": 2, - "flammable": 0 - }, - { - "id": 2036, - "item": "cha", - "type": 1, - "flammable": 0 - }, - { - "id": 2037, - "item": "zhuye", - "type": 1, - "flammable": 0 - }, - { - "id": 2038, - "item": "mulan", - "type": 2, - "flammable": 0 - }, - { - "id": 2039, - "item": "mudan", - "type": 2, - "flammable": 0 - }, - { - "id": 2040, - "item": "zhuye", - "type": 1, - "flammable": 0 - } - ] - }, - { - "custom": [ - { - "id": 3000, - "item": "danggui", - "type": 1, - "flammable": 0 - }, - { - "id": 3001, - "item": "moli", - "type": 1, - "flammable": 0 - }, - { - "id": 3002, - "item": "pugongying", - "type": 2, - "flammable": 0 - }, - { - "id": 3003, - "item": "danggui", - "type": 2, - "flammable": 0 - }, - { - "id": 3004, - "item": "taozi", - "type": 1, - "flammable": 0 - }, - { - "id": 3005, - "item": "putao", - "type": 2, - "flammable": 0 - }, - { - "id": 3006, - "item": "mudan", - "type": 2, - "flammable": 0 - }, - { - "id": 3007, - "item": "taozi", - "type": 1, - "flammable": 0 - }, - { - "id": 3008, - "item": "mulan", - "type": 2, - "flammable": 0 - }, - { - "id": 3009, - "item": "cha", - "type": 1, - "flammable": 0 - }, - { - "id": 3010, - "item": "mudan", - "type": 2, - "flammable": 0 - }, - { - "id": 3011, - "item": "longyan", - "type": 1, - "flammable": 0 - }, - { - "id": 3012, - "item": "ganjiang", - "type": 1, - "flammable": 0 - }, - { - "id": 3013, - "item": "zhuye", - "type": 1, - "flammable": 0 - }, - { - "id": 3014, - "item": "putao", - "type": 2, - "flammable": 0 - }, - { - "id": 3015, - "item": "gancao", - "type": 2, - "flammable": 0 - }, - { - "id": 3016, - "item": "taozi", - "type": 1, - "flammable": 0 - }, - { - "id": 3017, - "item": "muchai", - "type": 1, - "flammable": 1 - }, - { - "id": 3018, - "item": "cha", - "type": 2, - "flammable": 0 - }, - { - "id": 3019, - "item": "danshen", - "type": 2, - "flammable": 0 - }, - { - "id": 3020, - "item": "cha", - "type": 2, - "flammable": 0 - }, - { - "id": 3021, - "item": "zhuye", - "type": 1, - "flammable": 0 - }, - { - "id": 3022, - "item": "renshen", - "type": 1, - "flammable": 0 - }, - { - "id": 3023, - "item": "taozi", - "type": 2, - "flammable": 0 - }, - { - "id": 3024, - "item": "putao", - "type": 1, - "flammable": 0 - }, - { - "id": 3025, - "item": "gouqi", - "type": 2, - "flammable": 0 - }, - { - "id": 3026, - "item": "chixiaodou", - "type": 1, - "flammable": 0 - }, - { - "id": 3027, - "item": "muchai", - "type": 1, - "flammable": 1 - }, - { - "id": 3028, - "item": "jinju", - "type": 1, - "flammable": 0 - }, - { - "id": 3029, - "item": "cha", - "type": 2, - "flammable": 0 - }, - { - "id": 3030, - "item": "renshen", - "type": 2, - "flammable": 0 - }, - { - "id": 3031, - "item": "baishao", - "type": 1, - "flammable": 0 - }, - { - "id": 3032, - "item": "danshen", - "type": 1, - "flammable": 0 - }, - { - "id": 3033, - "item": "jingjie", - "type": 2, - "flammable": 0 - }, - { - "id": 3034, - "item": "zhuye", - "type": 1, - "flammable": 0 - }, - { - "id": 3035, - "item": "cha", - "type": 1, - "flammable": 0 - }, - { - "id": 3036, - "item": "gouqi", - "type": 1, - "flammable": 0 - }, - { - "id": 3037, - "item": "ganjiang", - "type": 1, - "flammable": 0 - }, - { - "id": 3038, - "item": "cha", - "type": 1, - "flammable": 0 - }, - { - "id": 3039, - "item": "jingjie", - "type": 2, - "flammable": 0 - }, - { - "id": 3040, - "item": "mudan", - "type": 2, - "flammable": 0 - } - ] - }, - { - "custom": [ - { - "id": 4000, - "item": "baishao", - "type": 1, - "flammable": 0 - }, - { - "id": 4001, - "item": "cha", - "type": 1, - "flammable": 0 - }, - { - "id": 4002, - "item": "putao", - "type": 2, - "flammable": 0 - }, - { - "id": 4003, - "item": "jinju", - "type": 2, - "flammable": 0 - }, - { - "id": 4004, - "item": "dazao", - "type": 1, - "flammable": 0 - }, - { - "id": 4005, - "item": "cha", - "type": 1, - "flammable": 0 - }, - { - "id": 4006, - "item": "baishao", - "type": 2, - "flammable": 0 - }, - { - "id": 4007, - "item": "ganjiang", - "type": 2, - "flammable": 0 - }, - { - "id": 4008, - "item": "taozi", - "type": 2, - "flammable": 0 - }, - { - "id": 4009, - "item": "dazao", - "type": 2, - "flammable": 0 - }, - { - "id": 4010, - "item": "moli", - "type": 1, - "flammable": 0 - }, - { - "id": 4011, - "item": "mudan", - "type": 2, - "flammable": 0 - }, - { - "id": 4012, - "item": "zhuye", - "type": 2, - "flammable": 0 - }, - { - "id": 4013, - "item": "muchai", - "type": 1, - "flammable": 1 - }, - { - "id": 4014, - "item": "gouqi", - "type": 1, - "flammable": 0 - }, - { - "id": 4015, - "item": "dazao", - "type": 2, - "flammable": 0 - }, - { - "id": 4016, - "item": "danggui", - "type": 1, - "flammable": 0 - }, - { - "id": 4017, - "item": "chixiaodou", - "type": 1, - "flammable": 0 - }, - { - "id": 4018, - "item": "baishao", - "type": 1, - "flammable": 0 - }, - { - "id": 4019, - "item": "jingjie", - "type": 2, - "flammable": 0 - }, - { - "id": 4020, - "item": "jinju", - "type": 2, - "flammable": 0 - }, - { - "id": 4021, - "item": "gouqi", - "type": 1, - "flammable": 0 - }, - { - "id": 4022, - "item": "pugongying", - "type": 2, - "flammable": 0 - }, - { - "id": 4023, - "item": "cha", - "type": 2, - "flammable": 0 - }, - { - "id": 4024, - "item": "moli", - "type": 2, - "flammable": 0 - }, - { - "id": 4025, - "item": "gancao", - "type": 2, - "flammable": 0 - }, - { - "id": 4026, - "item": "dazao", - "type": 2, - "flammable": 0 - }, - { - "id": 4027, - "item": "gouqi", - "type": 2, - "flammable": 0 - }, - { - "id": 4028, - "item": "jingjie", - "type": 2, - "flammable": 0 - }, - { - "id": 4029, - "item": "zhuye", - "type": 1, - "flammable": 0 - }, - { - "id": 4030, - "item": "pugongying", - "type": 1, - "flammable": 0 - }, - { - "id": 4031, - "item": "renshen", - "type": 1, - "flammable": 0 - }, - { - "id": 4032, - "item": "cha", - "type": 2, - "flammable": 0 - }, - { - "id": 4033, - "item": "zhuye", - "type": 1, - "flammable": 0 - }, - { - "id": 4034, - "item": "muchai", - "type": 2, - "flammable": 1 - }, - { - "id": 4035, - "item": "longyan", - "type": 1, - "flammable": 0 - }, - { - "id": 4036, - "item": "ganjiang", - "type": 2, - "flammable": 0 - }, - { - "id": 4037, - "item": "moli", - "type": 1, - "flammable": 0 - }, - { - "id": 4038, - "item": "lizhi", - "type": 1, - "flammable": 0 - }, - { - "id": 4039, - "item": "pugongying", - "type": 2, - "flammable": 0 - }, - { - "id": 4040, - "item": "cha", - "type": 1, - "flammable": 0 - } - ] - }, - { - "custom": [ - { - "id": 5000, - "item": "lizhi", - "type": 1, - "flammable": 0 - }, - { - "id": 5001, - "item": "pugongying", - "type": 2, - "flammable": 0 - }, - { - "id": 5002, - "item": "putao", - "type": 2, - "flammable": 0 - }, - { - "id": 5003, - "item": "cha", - "type": 1, - "flammable": 0 - }, - { - "id": 5004, - "item": "longyan", - "type": 2, - "flammable": 0 - }, - { - "id": 5005, - "item": "lizi", - "type": 2, - "flammable": 0 - }, - { - "id": 5006, - "item": "moli", - "type": 1, - "flammable": 0 - }, - { - "id": 5007, - "item": "gancao", - "type": 2, - "flammable": 0 - }, - { - "id": 5008, - "item": "mulan", - "type": 2, - "flammable": 0 - }, - { - "id": 5009, - "item": "zhuye", - "type": 1, - "flammable": 0 - }, - { - "id": 5010, - "item": "cha", - "type": 2, - "flammable": 0 - }, - { - "id": 5011, - "item": "lizhi", - "type": 1, - "flammable": 0 - }, - { - "id": 5012, - "item": "gouqi", - "type": 2, - "flammable": 0 - }, - { - "id": 5013, - "item": "renshen", - "type": 1, - "flammable": 0 - }, - { - "id": 5014, - "item": "chixiaodou", - "type": 1, - "flammable": 0 - }, - { - "id": 5015, - "item": "dazao", - "type": 2, - "flammable": 0 - }, - { - "id": 5016, - "item": "muchai", - "type": 2, - "flammable": 1 - }, - { - "id": 5017, - "item": "mulan", - "type": 2, - "flammable": 0 - }, - { - "id": 5018, - "item": "longyan", - "type": 1, - "flammable": 0 - }, - { - "id": 5019, - "item": "cha", - "type": 1, - "flammable": 0 - }, - { - "id": 5020, - "item": "lizi", - "type": 2, - "flammable": 0 - }, - { - "id": 5021, - "item": "baishao", - "type": 2, - "flammable": 0 - }, - { - "id": 5022, - "item": "danggui", - "type": 2, - "flammable": 0 - }, - { - "id": 5023, - "item": "renshen", - "type": 1, - "flammable": 0 - }, - { - "id": 5024, - "item": "chixiaodou", - "type": 2, - "flammable": 0 - }, - { - "id": 5025, - "item": "dazao", - "type": 1, - "flammable": 0 - }, - { - "id": 5026, - "item": "longyan", - "type": 1, - "flammable": 0 - }, - { - "id": 5027, - "item": "cha", - "type": 2, - "flammable": 0 - }, - { - "id": 5028, - "item": "danshen", - "type": 2, - "flammable": 0 - }, - { - "id": 5029, - "item": "renshen", - "type": 1, - "flammable": 0 - }, - { - "id": 5030, - "item": "baishao", - "type": 2, - "flammable": 0 - }, - { - "id": 5031, - "item": "muchai", - "type": 2, - "flammable": 1 - }, - { - "id": 5032, - "item": "jinju", - "type": 2, - "flammable": 0 - }, - { - "id": 5033, - "item": "lizi", - "type": 2, - "flammable": 0 - }, - { - "id": 5034, - "item": "cha", - "type": 1, - "flammable": 0 - }, - { - "id": 5035, - "item": "pugongying", - "type": 1, - "flammable": 0 - }, - { - "id": 5036, - "item": "danshen", - "type": 1, - "flammable": 0 - }, - { - "id": 5037, - "item": "gouqi", - "type": 1, - "flammable": 0 - }, - { - "id": 5038, - "item": "renshen", - "type": 1, - "flammable": 0 - }, - { - "id": 5039, - "item": "jingjie", - "type": 2, - "flammable": 0 - }, - { - "id": 5040, - "item": "cha", - "type": 2, - "flammable": 0 - } - ] - }, - { - "custom": [ - { - "id": 6000, - "item": "cha", - "type": 1, - "flammable": 0 - }, - { - "id": 6001, - "item": "lizhi", - "type": 1, - "flammable": 0 - }, - { - "id": 6002, - "item": "gouqi", - "type": 2, - "flammable": 0 - }, - { - "id": 6003, - "item": "renshen", - "type": 2, - "flammable": 0 - }, - { - "id": 6004, - "item": "dazao", - "type": 1, - "flammable": 0 - }, - { - "id": 6005, - "item": "chixiaodou", - "type": 1, - "flammable": 0 - }, - { - "id": 6006, - "item": "dazao", - "type": 2, - "flammable": 0 - }, - { - "id": 6007, - "item": "longyan", - "type": 1, - "flammable": 0 - }, - { - "id": 6008, - "item": "cha", - "type": 1, - "flammable": 0 - }, - { - "id": 6009, - "item": "danshen", - "type": 2, - "flammable": 0 - }, - { - "id": 6010, - "item": "renshen", - "type": 1, - "flammable": 0 - }, - { - "id": 6011, - "item": "baishao", - "type": 2, - "flammable": 0 - }, - { - "id": 6012, - "item": "muchai", - "type": 1, - "flammable": 1 - }, - { - "id": 6013, - "item": "jinju", - "type": 1, - "flammable": 0 - }, - { - "id": 6014, - "item": "gancao", - "type": 2, - "flammable": 0 - }, - { - "id": 6015, - "item": "lizi", - "type": 2, - "flammable": 0 - }, - { - "id": 6016, - "item": "moli", - "type": 1, - "flammable": 0 - }, - { - "id": 6017, - "item": "gancao", - "type": 2, - "flammable": 0 - }, - { - "id": 6018, - "item": "mulan", - "type": 2, - "flammable": 0 - }, - { - "id": 6019, - "item": "zhuye", - "type": 1, - "flammable": 0 - }, - { - "id": 6020, - "item": "cha", - "type": 2, - "flammable": 0 - }, - { - "id": 6021, - "item": "lizhi", - "type": 1, - "flammable": 0 - }, - { - "id": 6022, - "item": "gouqi", - "type": 2, - "flammable": 0 - }, - { - "id": 6023, - "item": "renshen", - "type": 1, - "flammable": 0 - }, - { - "id": 6024, - "item": "cha", - "type": 1, - "flammable": 0 - }, - { - "id": 6025, - "item": "jinjie", - "type": 2, - "flammable": 0 - }, - { - "id": 6026, - "item": "mudan", - "type": 2, - "flammable": 0 - }, - { - "id": 6027, - "item": "lizi", - "type": 2, - "flammable": 0 - }, - { - "id": 6028, - "item": "zhuye", - "type": 1, - "flammable": 0 - }, - { - "id": 6029, - "item": "jinju", - "type": 2, - "flammable": 0 - }, - { - "id": 6030, - "item": "muchai", - "type": 2, - "flammable": 1 - }, - { - "id": 6031, - "item": "baishao", - "type": 1, - "flammable": 0 - }, - { - "id": 6032, - "item": "chixiaodou", - "type": 1, - "flammable": 0 - }, - { - "id": 6033, - "item": "moli", - "type": 1, - "flammable": 0 - }, - { - "id": 6034, - "item": "danshen", - "type": 2, - "flammable": 0 - }, - { - "id": 6035, - "item": "gouqi", - "type": 1, - "flammable": 0 - }, - { - "id": 6036, - "item": "zhuye", - "type": 2, - "flammable": 0 - }, - { - "id": 6037, - "item": "taozi", - "type": 1, - "flammable": 0 - }, - { - "id": 6038, - "item": "putao", - "type": 1, - "flammable": 0 - }, - { - "id": 6039, - "item": "longyan", - "type": 1, - "flammable": 0 - }, - { - "id": 6040, - "item": "cha", - "type": 2, - "flammable": 0 - } - ] - }, - { - "custom": [ - { - "id": 7000, - "item": "chixiaodou", - "type": 1, - "flammable": 0 - }, - { - "id": 7001, - "item": "moli", - "type": 1, - "flammable": 0 - }, - { - "id": 7002, - "item": "danshen", - "type": 2, - "flammable": 0 - }, - { - "id": 7003, - "item": "gouqi", - "type": 1, - "flammable": 0 - }, - { - "id": 7004, - "item": "zhuye", - "type": 2, - "flammable": 0 - }, - { - "id": 7005, - "item": "taozi", - "type": 1, - "flammable": 0 - }, - { - "id": 7006, - "item": "putao", - "type": 1, - "flammable": 0 - }, - { - "id": 7007, - "item": "longyan", - "type": 1, - "flammable": 0 - }, - { - "id": 7008, - "item": "cha", - "type": 2, - "flammable": 0 - }, - { - "id": 7009, - "item": "putao", - "type": 1, - "flammable": 0 - }, - { - "id": 7010, - "item": "cha", - "type": 2, - "flammable": 0 - }, - { - "id": 7011, - "item": "mudan", - "type": 2, - "flammable": 0 - }, - { - "id": 7012, - "item": "lizi", - "type": 2, - "flammable": 0 - }, - { - "id": 7013, - "item": "zhuye", - "type": 1, - "flammable": 0 - }, - { - "id": 7014, - "item": "jinju", - "type": 2, - "flammable": 0 - }, - { - "id": 7015, - "item": "muchai", - "type": 2, - "flammable": 1 - }, - { - "id": 7016, - "item": "baishao", - "type": 1, - "flammable": 0 - }, - { - "id": 7017, - "item": "chixiaodou", - "type": 1, - "flammable": 0 - }, - { - "id": 7018, - "item": "moli", - "type": 1, - "flammable": 0 - }, - { - "id": 7019, - "item": "pugongying", - "type": 2, - "flammable": 0 - }, - { - "id": 7020, - "item": "cha", - "type": 1, - "flammable": 0 - }, - { - "id": 7021, - "item": "lizhi", - "type": 1, - "flammable": 0 - }, - { - "id": 7022, - "item": "gouqi", - "type": 2, - "flammable": 0 - }, - { - "id": 7023, - "item": "renshen", - "type": 2, - "flammable": 0 - }, - { - "id": 7024, - "item": "dazao", - "type": 1, - "flammable": 0 - }, - { - "id": 7025, - "item": "chixiaodou", - "type": 1, - "flammable": 0 - }, - { - "id": 7026, - "item": "dazao", - "type": 2, - "flammable": 0 - }, - { - "id": 7027, - "item": "longyan", - "type": 1, - "flammable": 0 - }, - { - "id": 7028, - "item": "cha", - "type": 1, - "flammable": 0 - }, - { - "id": 7029, - "item": "danshen", - "type": 2, - "flammable": 0 - }, - { - "id": 7030, - "item": "baishao", - "type": 2, - "flammable": 0 - }, - { - "id": 7031, - "item": "ganjiang", - "type": 2, - "flammable": 0 - }, - { - "id": 7032, - "item": "taozi", - "type": 2, - "flammable": 0 - }, - { - "id": 7033, - "item": "dazao", - "type": 2, - "flammable": 0 - }, - { - "id": 7034, - "item": "moli", - "type": 1, - "flammable": 0 - }, - { - "id": 7035, - "item": "mudan", - "type": 2, - "flammable": 0 - }, - { - "id": 7036, - "item": "zhuye", - "type": 2, - "flammable": 0 - }, - { - "id": 7037, - "item": "muchai", - "type": 1, - "flammable": 1 - }, - { - "id": 7038, - "item": "jingjie", - "type": 2, - "flammable": 0 - }, - { - "id": 7039, - "item": "lizi", - "type": 2, - "flammable": 0 - }, - { - "id": 7040, - "item": "cha", - "type": 1, - "flammable": 0 - } - ] - }, - { - "custom": [ - { - "id": 8000, - "item": "chixiaodou", - "type": 2, - "flammable": 0 - }, - { - "id": 8001, - "item": "moli", - "type": 2, - "flammable": 0 - }, - { - "id": 8002, - "item": "danshen", - "type": 2, - "flammable": 0 - }, - { - "id": 8003, - "item": "gouqi", - "type": 2, - "flammable": 0 - }, - { - "id": 8004, - "item": "zhuye", - "type": 2, - "flammable": 0 - }, - { - "id": 8005, - "item": "taozi", - "type": 1, - "flammable": 0 - }, - { - "id": 8006, - "item": "putao", - "type": 2, - "flammable": 0 - }, - { - "id": 8007, - "item": "longyan", - "type": 2, - "flammable": 0 - }, - { - "id": 8008, - "item": "cha", - "type": 1, - "flammable": 0 - }, - { - "id": 8009, - "item": "putao", - "type": 2, - "flammable": 0 - }, - { - "id": 8010, - "item": "renshen", - "type": 2, - "flammable": 0 - }, - { - "id": 8011, - "item": "baishao", - "type": 1, - "flammable": 0 - }, - { - "id": 8012, - "item": "muchai", - "type": 1, - "flammable": 1 - }, - { - "id": 8013, - "item": "jinju", - "type": 1, - "flammable": 0 - }, - { - "id": 8014, - "item": "gancao", - "type": 2, - "flammable": 0 - }, - { - "id": 8015, - "item": "lizi", - "type": 2, - "flammable": 0 - }, - { - "id": 8016, - "item": "moli", - "type": 1, - "flammable": 0 - }, - { - "id": 8017, - "item": "gancao", - "type": 2, - "flammable": 0 - }, - { - "id": 8018, - "item": "mulan", - "type": 2, - "flammable": 0 - }, - { - "id": 8019, - "item": "zhuye", - "type": 1, - "flammable": 0 - }, - { - "id": 8020, - "item": "pugongying", - "type": 2, - "flammable": 0 - }, - { - "id": 8021, - "item": "cha", - "type": 1, - "flammable": 0 - }, - { - "id": 8022, - "item": "moli", - "type": 1, - "flammable": 0 - }, - { - "id": 8023, - "item": "gancao", - "type": 2, - "flammable": 0 - }, - { - "id": 8024, - "item": "dazao", - "type": 1, - "flammable": 0 - }, - { - "id": 8025, - "item": "gouqi", - "type": 2, - "flammable": 0 - }, - { - "id": 8026, - "item": "jingjie", - "type": 2, - "flammable": 0 - }, - { - "id": 8027, - "item": "zhuye", - "type": 1, - "flammable": 0 - }, - { - "id": 8028, - "item": "pugongying", - "type": 2, - "flammable": 0 - }, - { - "id": 8029, - "item": "renshen", - "type": 1, - "flammable": 0 - }, - { - "id": 8030, - "item": "cha", - "type": 1, - "flammable": 0 - }, - { - "id": 8031, - "item": "taozi", - "type": 1, - "flammable": 0 - }, - { - "id": 8032, - "item": "putao", - "type": 2, - "flammable": 0 - }, - { - "id": 8033, - "item": "dazao", - "type": 2, - "flammable": 0 - }, - { - "id": 8034, - "item": "muchai", - "type": 1, - "flammable": 1 - }, - { - "id": 8035, - "item": "moli", - "type": 2, - "flammable": 0 - }, - { - "id": 8036, - "item": "pugongying", - "type": 1, - "flammable": 0 - }, - { - "id": 8037, - "item": "cha", - "type": 2, - "flammable": 0 - }, - { - "id": 8038, - "item": "lizhi", - "type": 1, - "flammable": 0 - }, - { - "id": 8039, - "item": "mulan", - "type": 2, - "flammable": 0 - }, - { - "id": 8040, - "item": "gancao", - "type": 2, - "flammable": 0 - } - ] - }, - { - "custom": [ - { - "id": 9000, - "item": "cha", - "type": 1, - "flammable": 0 - }, - { - "id": 9001, - "item": "taozi", - "type": 1, - "flammable": 0 - }, - { - "id": 9002, - "item": "putao", - "type": 2, - "flammable": 0 - }, - { - "id": 9003, - "item": "dazao", - "type": 2, - "flammable": 0 - }, - { - "id": 9004, - "item": "danshen", - "type": 1, - "flammable": 0 - }, - { - "id": 9005, - "item": "moli", - "type": 2, - "flammable": 0 - }, - { - "id": 9006, - "item": "pugongying", - "type": 1, - "flammable": 0 - }, - { - "id": 9007, - "item": "cha", - "type": 2, - "flammable": 0 - }, - { - "id": 9008, - "item": "lizhi", - "type": 1, - "flammable": 0 - }, - { - "id": 9009, - "item": "mulan", - "type": 2, - "flammable": 0 - }, - { - "id": 9010, - "item": "gancao", - "type": 2, - "flammable": 0 - }, - { - "id": 9011, - "item": "renshen", - "type": 1, - "flammable": 0 - }, - { - "id": 9012, - "item": "danggui", - "type": 2, - "flammable": 0 - }, - { - "id": 9013, - "item": "mulan", - "type": 2, - "flammable": 0 - }, - { - "id": 9014, - "item": "moli", - "type": 1, - "flammable": 0 - }, - { - "id": 9015, - "item": "cha", - "type": 1, - "flammable": 0 - }, - { - "id": 9016, - "item": "jinju", - "type": 1, - "flammable": 0 - }, - { - "id": 9017, - "item": "pugongying", - "type": 2, - "flammable": 0 - }, - { - "id": 9018, - "item": "chixiaodou", - "type": 2, - "flammable": 0 - }, - { - "id": 9019, - "item": "mudan", - "type": 2, - "flammable": 0 - }, - { - "id": 9020, - "item": "jingjie", - "type": 2, - "flammable": 0 - }, - { - "id": 9021, - "item": "longyan", - "type": 1, - "flammable": 0 - }, - { - "id": 9022, - "item": "gouqi", - "type": 1, - "flammable": 0 - }, - { - "id": 9023, - "item": "cha", - "type": 2, - "flammable": 0 - }, - { - "id": 9024, - "item": "muchai", - "type": 2, - "flammable": 1 - }, - { - "id": 9025, - "item": "ganjiang", - "type": 1, - "flammable": 0 - }, - { - "id": 9026, - "item": "moli", - "type": 1, - "flammable": 0 - }, - { - "id": 9027, - "item": "dazao", - "type": 2, - "flammable": 0 - }, - { - "id": 9028, - "item": "danshen", - "type": 2, - "flammable": 0 - }, - { - "id": 9029, - "item": "longyan", - "type": 1, - "flammable": 0 - }, - { - "id": 9030, - "item": "gouqi", - "type": 1, - "flammable": 0 - }, - { - "id": 9031, - "item": "muchai", - "type": 1, - "flammable": 1 - }, - { - "id": 9032, - "item": "gancao", - "type": 2, - "flammable": 0 - }, - { - "id": 9033, - "item": "ganjiang", - "type": 1, - "flammable": 0 - }, - { - "id": 9034, - "item": "cha", - "type": 2, - "flammable": 0 - }, - { - "id": 9035, - "item": "lizhi", - "type": 2, - "flammable": 0 - }, - { - "id": 9036, - "item": "danggui", - "type": 2, - "flammable": 0 - }, - { - "id": 9037, - "item": "gouqi", - "type": 2, - "flammable": 0 - }, - { - "id": 9038, - "item": "cha", - "type": 1, - "flammable": 0 - }, - { - "id": 9039, - "item": "dazao", - "type": 1, - "flammable": 0 - }, - { - "id": 9040, - "item": "danggui", - "type": 1, - "flammable": 0 - } - ] - }, - { - "custom": [ - { - "id": 10000, - "item": "gouqi", - "type": 1, - "flammable": 0 - }, - { - "id": 10001, - "item": "gancao", - "type": 2, - "flammable": 0 - }, - { - "id": 10002, - "item": "ganjiang", - "type": 1, - "flammable": 0 - }, - { - "id": 10003, - "item": "cha", - "type": 2, - "flammable": 0 - }, - { - "id": 10004, - "item": "lizhi", - "type": 1, - "flammable": 0 - }, - { - "id": 10005, - "item": "danggui", - "type": 2, - "flammable": 0 - }, - { - "id": 10006, - "item": "gouqi", - "type": 2, - "flammable": 0 - }, - { - "id": 10007, - "item": "cha", - "type": 2, - "flammable": 0 - }, - { - "id": 10008, - "item": "dazao", - "type": 1, - "flammable": 0 - }, - { - "id": 10009, - "item": "danggui", - "type": 1, - "flammable": 0 - }, - { - "id": 10010, - "item": "lizi", - "type": 2, - "flammable": 0 - }, - { - "id": 10011, - "item": "longyan", - "type": 1, - "flammable": 0 - }, - { - "id": 10012, - "item": "cha", - "type": 2, - "flammable": 0 - }, - { - "id": 10013, - "item": "putao", - "type": 2, - "flammable": 0 - }, - { - "id": 10014, - "item": "renshen", - "type": 1, - "flammable": 0 - }, - { - "id": 10015, - "item": "baishao", - "type": 1, - "flammable": 0 - }, - { - "id": 10016, - "item": "danshen", - "type": 2, - "flammable": 0 - }, - { - "id": 10017, - "item": "gancao", - "type": 2, - "flammable": 0 - }, - { - "id": 10018, - "item": "lizhi", - "type": 1, - "flammable": 0 - }, - { - "id": 10019, - "item": "lizi", - "type": 2, - "flammable": 0 - }, - { - "id": 10020, - "item": "mudan", - "type": 2, - "flammable": 0 - }, - { - "id": 10021, - "item": "danggui", - "type": 1, - "flammable": 0 - }, - { - "id": 10022, - "item": "cha", - "type": 2, - "flammable": 0 - }, - { - "id": 10023, - "item": "muchai", - "type": 2, - "flammable": 1 - }, - { - "id": 10024, - "item": "gancao", - "type": 2, - "flammable": 0 - }, - { - "id": 10025, - "item": "mudan", - "type": 2, - "flammable": 0 - }, - { - "id": 10026, - "item": "zhuye", - "type": 1, - "flammable": 0 - }, - { - "id": 10027, - "item": "danshen", - "type": 2, - "flammable": 0 - }, - { - "id": 10028, - "item": "renshen", - "type": 2, - "flammable": 0 - }, - { - "id": 10029, - "item": "danggui", - "type": 1, - "flammable": 0 - }, - { - "id": 10030, - "item": "baishao", - "type": 2, - "flammable": 0 - }, - { - "id": 10031, - "item": "muchai", - "type": 2, - "flammable": 1 - }, - { - "id": 10032, - "item": "ganjiang", - "type": 1, - "flammable": 0 - }, - { - "id": 10033, - "item": "putao", - "type": 1, - "flammable": 0 - }, - { - "id": 10034, - "item": "cha", - "type": 2, - "flammable": 0 - }, - { - "id": 10035, - "item": "mulan", - "type": 2, - "flammable": 0 - }, - { - "id": 10036, - "item": "danggui", - "type": 2, - "flammable": 0 - }, - { - "id": 10037, - "item": "taozi", - "type": 1, - "flammable": 0 - }, - { - "id": 10038, - "item": "lizhi", - "type": 1, - "flammable": 0 - }, - { - "id": 10039, - "item": "putao", - "type": 1, - "flammable": 0 - }, - { - "id": 10040, - "item": "gouqi", - "type": 2, - "flammable": 0 - } - ] - } - ]; + this.TIME_INFO = { + waterSpeed: [0.3, 0.25, 0.2, 0.18, 0.16, 0.14, 0.12, 0.1], + totalTime: 20, + waterTime: [10, 12, 14, 16, 18, 20, 20, 20], + roadSpeed: 0.2, + ReinforceSpeed: 0.2, + Xi_SoilSpeed: 0.2, + }; + /* + moveSpeed: 0, //洪峰移动速度 + waitTime: 20, //洪峰冲击倒计时 + fastPath: 5 //最短路径 + */ + // this.LEVEL_INFO = [ + // [ + // { + // "id": 1001, + // "map": [ + // [0,0,0,0,0,0], + // [0,0,0,0,0,4], + // [0,0,3,0,3,0], + // [0,0,0,0,0,0], + // [0,0,0,3,0,0], + // [0,0,0,0,0,0], + // [0,0,2,0,0,0], + // [0,0,0,0,0,0], + // [1,0,0,0,0,0] + // ] + // }, + // { + // "id": 1002, + // "map": [ + // [0,0,0,0,0,0,0,0,4], + // [0,0,0,0,0,0,0,0,0], + // [0,0,0,0,0,0,0,0,0], + // [0,0,0,0,0,0,0,0,0], + // [0,0,0,0,0,0,0,0,0], + // [0,1,0,0,0,0,0,0,0] + // ] + // } + // ], + // ] + this.LEVEL_INFO = [[{ "id": "1001", "map": [[0, 4, 0, 0], [0, 0, 0, 0], [0, 0, 0, 0], [0, 0, 1, 0]], "min_steps": 3 }, { "id": "1002", "map": [[1, 0, 0, 0], [0, 0, 0, 4], [0, 0, 0, 0], [0, 0, 0, 0]], "min_steps": 3 }, { "id": "1004", "map": [[1, 0, 0, 0], [0, 0, 0, 0], [0, 0, 0, 0], [0, 4, 0, 0]], "min_steps": 3 }, { "id": "1006", "map": [[4, 0, 0, 0], [0, 0, 0, 0], [0, 0, 0, 0], [0, 1, 0, 0]], "min_steps": 3 }, { "id": "1003", "map": [[1, 0, 0, 0], [0, 0, 0, 0], [0, 0, 0, 0], [0, 0, 0, 4]], "min_steps": 4 }, { "id": "1005", "map": [[1, 0, 0, 0], [0, 0, 0, 0], [0, 0, 0, 4], [0, 0, 0, 0]], "min_steps": 4 }, { "id": "1007", "map": [[0, 4, 0, 0], [0, 0, 0, 0], [0, 0, 0, 0], [0, 0, 0, 1]], "min_steps": 4 }, { "id": "1008", "map": [[0, 0, 0, 4], [0, 0, 0, 0], [0, 0, 0, 0], [1, 0, 0, 0]], "min_steps": 4 }], [{ "id": "2001", "map": [[0, 0, 0, 0, 1], [0, 0, 0, 0, 0], [0, 0, 3, 0, 3], [0, 0, 0, 0, 0], [4, 0, 0, 0, 3]], "min_steps": 4 }, { "id": "2002", "map": [[0, 1, 0, 0, 0], [0, 0, 0, 0, 0], [3, 3, 0, 0, 4], [0, 0, 0, 0, 0], [3, 0, 0, 0, 0]], "min_steps": 4 }, { "id": "2009", "map": [[0, 3, 0, 0, 4], [3, 0, 0, 0, 0], [0, 0, 0, 0, 0], [1, 0, 0, 0, 0], [0, 3, 0, 0, 0]], "min_steps": 4 }, { "id": "2010", "map": [[0, 0, 0, 0, 1], [0, 0, 0, 0, 0], [0, 0, 0, 0, 0], [0, 3, 0, 3, 0], [4, 0, 3, 0, 0]], "min_steps": 4 }, { "id": "2011", "map": [[4, 3, 1, 0, 0], [0, 0, 0, 0, 3], [0, 0, 0, 3, 0], [0, 0, 0, 0, 0], [0, 0, 0, 0, 0]], "min_steps": 4 }, { "id": "2021", "map": [[0, 0, 0, 1, 0], [0, 0, 3, 0, 0], [0, 0, 0, 3, 3], [0, 0, 0, 0, 0], [0, 4, 0, 0, 0]], "min_steps": 4 }, { "id": "2004", "map": [[1, 0, 0, 0, 0], [0, 0, 0, 0, 3], [3, 0, 0, 0, 0], [0, 0, 0, 0, 0], [0, 0, 0, 0, 4]], "min_steps": 5 }, { "id": "2012", "map": [[0, 3, 0, 4, 0], [0, 0, 0, 3, 0], [1, 0, 3, 0, 0], [0, 0, 0, 0, 0], [0, 0, 0, 0, 0]], "min_steps": 5 }, { "id": "2013", "map": [[0, 0, 0, 0, 0], [1, 0, 0, 0, 0], [0, 0, 0, 3, 3], [3, 0, 0, 0, 0], [0, 0, 0, 4, 0]], "min_steps": 5 }, { "id": "2014", "map": [[3, 0, 1, 0, 0], [0, 3, 0, 0, 0], [0, 0, 0, 0, 0], [4, 0, 0, 3, 0], [0, 0, 0, 0, 0]], "min_steps": 5 }, { "id": "2015", "map": [[3, 0, 0, 0, 1], [3, 0, 0, 0, 0], [0, 0, 0, 0, 0], [4, 3, 0, 0, 0], [3, 0, 0, 0, 0]], "min_steps": 5 }, { "id": "2016", "map": [[0, 0, 0, 0, 0], [1, 0, 3, 0, 0], [3, 0, 0, 0, 3], [0, 0, 0, 0, 0], [0, 0, 0, 0, 4]], "min_steps": 5 }, { "id": "2017", "map": [[0, 3, 0, 0, 0], [4, 0, 0, 0, 0], [0, 0, 0, 0, 0], [3, 0, 3, 0, 0], [3, 0, 0, 0, 1]], "min_steps": 5 }, { "id": "2018", "map": [[0, 3, 4, 3, 3], [0, 0, 0, 0, 0], [0, 0, 0, 0, 0], [0, 0, 0, 0, 0], [0, 0, 3, 0, 1]], "min_steps": 5 }, { "id": "2019", "map": [[3, 0, 0, 4, 0], [0, 0, 0, 3, 0], [0, 0, 0, 0, 0], [0, 0, 0, 0, 0], [1, 0, 3, 0, 0]], "min_steps": 5 }, { "id": "2020", "map": [[4, 0, 3, 0, 1], [0, 0, 0, 0, 3], [0, 0, 0, 0, 0], [0, 0, 0, 0, 0], [0, 0, 3, 0, 0]], "min_steps": 5 }, { "id": "2003", "map": [[1, 0, 0, 3, 0], [0, 0, 3, 0, 0], [0, 0, 0, 0, 0], [0, 0, 0, 0, 0], [0, 3, 0, 4, 0]], "min_steps": 6 }, { "id": "2005", "map": [[0, 3, 0, 0, 0], [1, 0, 0, 0, 0], [0, 0, 0, 3, 0], [0, 0, 0, 0, 0], [0, 3, 0, 4, 0]], "min_steps": 6 }, { "id": "2006", "map": [[0, 1, 0, 0, 0], [0, 0, 0, 0, 3], [0, 0, 0, 0, 3], [0, 0, 0, 0, 0], [0, 0, 0, 3, 4]], "min_steps": 6 }, { "id": "2007", "map": [[3, 0, 0, 0, 1], [0, 0, 0, 0, 3], [0, 0, 0, 0, 0], [0, 0, 0, 0, 0], [4, 3, 0, 0, 0]], "min_steps": 6 }, { "id": "2008", "map": [[3, 4, 0, 0, 0], [0, 0, 0, 0, 3], [0, 0, 0, 3, 1], [0, 0, 0, 0, 0], [0, 0, 0, 0, 0]], "min_steps": 6 }, { "id": "2022", "map": [[0, 0, 0, 0, 0], [1, 3, 0, 0, 3], [0, 0, 0, 0, 0], [0, 0, 0, 0, 0], [0, 0, 3, 4, 0]], "min_steps": 6 }], [{ "id": "3001", "map": [[3, 0, 2, 3, 4], [0, 0, 0, 2, 2], [2, 3, 3, 3, 3], [0, 0, 2, 0, 2], [1, 0, 2, 3, 0]], "min_steps": 5 }, { "id": "3002", "map": [[3, 0, 3, 2, 0], [1, 2, 0, 3, 2], [2, 3, 0, 0, 4], [2, 0, 2, 2, 0], [3, 3, 0, 3, 0]], "min_steps": 5 }, { "id": "3003", "map": [[0, 2, 3, 3, 4], [2, 2, 0, 0, 0], [1, 3, 3, 3, 2], [2, 2, 3, 2, 3], [0, 0, 0, 0, 0]], "min_steps": 5 }, { "id": "3004", "map": [[3, 2, 2, 1, 0], [0, 0, 3, 2, 2], [3, 0, 2, 3, 0], [3, 0, 0, 3, 3], [0, 2, 4, 0, 2]], "min_steps": 5 }, { "id": "3005", "map": [[3, 0, 3, 0, 0], [2, 3, 0, 0, 1], [0, 2, 2, 2, 3], [4, 2, 0, 0, 2], [3, 3, 0, 3, 2]], "min_steps": 5 }, { "id": "3008", "map": [[3, 3, 3, 0, 1], [0, 0, 0, 0, 3], [2, 2, 3, 2, 2], [0, 2, 3, 0, 3], [4, 2, 2, 0, 0]], "min_steps": 5 }, { "id": "3009", "map": [[1, 0, 3, 3, 2], [3, 0, 2, 0, 0], [0, 3, 3, 2, 4], [0, 0, 3, 0, 2], [2, 2, 2, 0, 3]], "min_steps": 5 }, { "id": "3010", "map": [[3, 0, 2, 0, 4], [1, 2, 3, 0, 3], [2, 0, 3, 2, 0], [0, 3, 0, 0, 3], [2, 0, 2, 3, 2]], "min_steps": 5 }, { "id": "3006", "map": [[2, 0, 2, 2, 0], [1, 2, 3, 0, 0], [3, 3, 0, 3, 2], [3, 0, 0, 3, 2], [2, 0, 3, 0, 4]], "min_steps": 6 }, { "id": "3007", "map": [[1, 2, 0, 3, 3], [2, 2, 0, 2, 0], [2, 3, 2, 0, 3], [0, 3, 2, 0, 4], [0, 0, 3, 0, 3]], "min_steps": 6 }, { "id": "3011", "map": [[2, 3, 0, 1, 0], [0, 0, 0, 0, 0], [3, 0, 0, 0, 3], [0, 2, 0, 3, 2], [4, 3, 3, 2, 2]], "min_steps": 6 }, { "id": "3012", "map": [[0, 2, 1, 0, 3], [0, 3, 0, 0, 3], [3, 2, 3, 2, 0], [0, 2, 0, 3, 0], [2, 0, 0, 0, 4]], "min_steps": 6 }, { "id": "3013", "map": [[0, 2, 1, 0, 3], [0, 3, 0, 0, 3], [3, 2, 3, 2, 0], [0, 2, 0, 3, 0], [2, 0, 0, 0, 4]], "min_steps": 6 }, { "id": "3014", "map": [[1, 0, 3, 3, 4], [2, 3, 0, 3, 0], [0, 2, 2, 0, 0], [3, 3, 0, 0, 2], [2, 0, 0, 0, 0]], "min_steps": 6 }, { "id": "3015", "map": [[2, 3, 0, 0, 0], [0, 0, 2, 3, 0], [4, 0, 3, 0, 3], [2, 0, 2, 2, 3], [0, 3, 0, 0, 1]], "min_steps": 6 }, { "id": "3016", "map": [[3, 0, 2, 0, 2], [2, 0, 0, 0, 3], [0, 2, 3, 0, 1], [4, 0, 0, 3, 0], [3, 3, 0, 0, 2]], "min_steps": 6 }, { "id": "3017", "map": [[0, 3, 0, 0, 2], [3, 0, 2, 0, 4], [1, 3, 3, 0, 0], [2, 0, 0, 2, 0], [3, 2, 3, 0, 0]], "min_steps": 6 }, { "id": "3018", "map": [[4, 2, 0, 0, 0], [0, 0, 0, 3, 2], [0, 3, 0, 0, 3], [3, 2, 3, 2, 0], [3, 0, 2, 1, 0]], "min_steps": 7 }, { "id": "3019", "map": [[0, 4, 0, 3, 2], [0, 2, 0, 0, 0], [3, 0, 3, 0, 2], [3, 3, 2, 3, 1], [2, 0, 0, 0, 0]], "min_steps": 7 }, { "id": "3020", "map": [[0, 2, 0, 1, 0], [0, 0, 0, 3, 2], [3, 0, 3, 3, 3], [3, 0, 0, 0, 2], [0, 2, 2, 4, 0]], "min_steps": 7 }, { "id": "3021", "map": [[3, 2, 0, 2, 1], [3, 2, 0, 3, 2], [3, 0, 0, 2, 3], [0, 0, 0, 0, 4], [0, 0, 3, 0, 0]], "min_steps": 7 }, { "id": "3022", "map": [[2, 0, 2, 2, 2], [0, 0, 3, 0, 0], [3, 0, 3, 0, 0], [1, 0, 3, 2, 4], [0, 0, 3, 3, 0]], "min_steps": 7 }, { "id": "3023", "map": [[1, 2, 0, 2, 0], [3, 3, 3, 0, 0], [0, 2, 3, 2, 0], [4, 0, 0, 0, 3], [0, 0, 2, 0, 3]], "min_steps": 7 }, { "id": "3024", "map": [[1, 0, 3, 0, 3], [2, 2, 0, 0, 0], [0, 3, 0, 3, 0], [2, 0, 3, 2, 0], [2, 3, 0, 4, 0]], "min_steps": 7 }], [{ "id": "4001", "map": [[1, 3, 0, 0, 2, 0], [0, 3, 0, 0, 2, 0], [0, 0, 2, 0, 3, 4], [0, 0, 0, 2, 0, 0], [3, 3, 0, 0, 2, 0, 3], [0, 0, 2, 2, 2, 0]], "min_steps": 5 }, { "id": "4002", "map": [[0, 2, 2, 2, 2, 0], [1, 0, 0, 0, 2, 0], [0, 0, 0, 0, 0, 3], [0, 0, 0, 0, 2, 0], [0, 3, 3, 0, 2, 0], [3, 0, 0, 4, 2, 0]], "min_steps": 5 }, { "id": "4003", "map": [[0, 0, 0, 0, 0, 0], [2, 0, 0, 0, 0, 2], [0, 3, 3, 3, 2, 4], [0, 3, 0, 3, 2, 0], [0, 0, 0, 0, 0, 3], [0, 0, 2, 3, 0, 1]], "min_steps": 6 }, { "id": "4004", "map": [[2, 0, 3, 0, 0, 4], [0, 2, 3, 3, 0, 0], [0, 3, 0, 0, 0, 0], [3, 0, 0, 0, 2, 2], [3, 0, 0, 2, 0, 0], [1, 0, 0, 3, 0, 0]], "min_steps": 6 }, { "id": "4006", "map": [[4, 3, 0, 3, 0, 0], [0, 2, 0, 3, 0, 0], [3, 0, 0, 0, 3, 2], [0, 3, 0, 0, 2, 1], [0, 0, 2, 0, 0, 0], [0, 0, 0, 0, 2, 3]], "min_steps": 7 }, { "id": "4007", "map": [[4, 2, 2, 0, 2, 0], [0, 3, 0, 2, 0, 0], [0, 2, 3, 0, 3, 0], [0, 0, 3, 0, 0, 3], [0, 0, 3, 0, 0, 0], [0, 0, 0, 3, 0, 1]], "min_steps": 7 }, { "id": "4014", "map": [[0, 0, 3, 0, 2, 2], [0, 2, 3, 0, 0, 1], [0, 3, 3, 0, 0, 3], [0, 2, 0, 0, 0, 0], [0, 0, 0, 3, 3, 0], [2, 0, 4, 0, 0, 0]], "min_steps": 7 }, { "id": "4015", "map": [[2, 0, 0, 0, 0, 0], [0, 0, 0, 0, 3, 1], [3, 0, 2, 0, 0, 3], [2, 0, 0, 2, 3, 0], [3, 0, 3, 0, 0, 0], [2, 0, 0, 3, 4, 0]], "min_steps": 7 }, { "id": "4005", "map": [[1, 0, 0, 0, 0, 2], [0, 0, 0, 2, 0, 0], [3, 2, 0, 0, 0, 0], [0, 3, 0, 0, 2, 3], [0, 0, 3, 3, 0, 0], [3, 0, 0, 2, 3, 4]], "min_steps": 8 }, { "id": "4008", "map": [[0, 0, 2, 3, 0, 0], [0, 3, 0, 2, 3, 2], [3, 0, 0, 0, 0, 0], [0, 3, 0, 0, 3, 4], [0, 0, 0, 0, 0, 3], [0, 2, 0, 2, 0, 1]], "min_steps": 8 }, { "id": "4009", "map": [[0, 3, 3, 0, 0, 4], [2, 0, 0, 3, 0, 0], [2, 0, 0, 3, 0, 0], [1, 0, 0, 0, 3, 0], [0, 0, 2, 3, 0, 2], [2, 3, 0, 0, 0, 0]], "min_steps": 8 }, { "id": "4010", "map": [[0, 0, 1, 3, 2, 0], [3, 0, 0, 0, 3, 2], [3, 0, 0, 0, 0, 3], [2, 0, 0, 0, 0, 0], [0, 2, 0, 0, 3, 0], [0, 2, 0, 3, 4, 0]], "min_steps": 8 }, { "id": "4011", "map": [[1, 0, 0, 0, 0, 0], [3, 3, 0, 0, 0, 2], [0, 0, 0, 3, 0, 2], [2, 0, 3, 0, 3, 0], [2, 0, 3, 0, 0, 3], [4, 0, 0, 0, 0, 2]], "min_steps": 8 }, { "id": "4016", "map": [[0, 0, 3, 0, 0, 1], [2, 3, 0, 0, 3, 0], [2, 0, 0, 0, 0, 2], [0, 3, 0, 0, 0, 0], [0, 3, 0, 0, 2, 0], [0, 4, 3, 0, 2, 3]], "min_steps": 8 }, { "id": "4017", "map": [[1, 2, 3, 0, 3, 2], [3, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 3], [3, 3, 0, 3, 2, 0], [0, 2, 0, 0, 0, 0], [4, 0, 0, 2, 0, 0]], "min_steps": 8 }, { "id": "4018", "map": [[0, 0, 1, 0, 2, 0], [0, 0, 0, 0, 0, 0], [0, 0, 3, 2, 3, 0], [3, 0, 0, 3, 0, 0], [2, 3, 0, 2, 0, 0], [4, 2, 0, 3, 3, 0]], "min_steps": 8 }, { "id": "4012", "map": [[2, 2, 3, 0, 2, 0], [0, 3, 0, 0, 0, 0], [0, 0, 0, 0, 3, 4], [0, 2, 0, 3, 0, 3], [0, 0, 0, 0, 0, 0], [0, 0, 2, 3, 3, 1]], "min_steps": 9 }, { "id": "4013", "map": [[0, 0, 0, 0, 3, 0], [4, 2, 0, 3, 0, 0], [3, 2, 0, 0, 0, 0], [1, 3, 0, 3, 0, 0], [2, 0, 0, 2, 0, 0], [3, 0, 0, 3, 2, 0]], "min_steps": 9 }, { "id": "4019", "map": [[3, 4, 0, 0, 0, 2], [3, 2, 0, 0, 2, 0], [0, 3, 0, 3, 0, 2], [0, 0, 3, 0, 0, 0], [0, 0, 0, 0, 3, 0], [1, 3, 0, 0, 0, 2]], "min_steps": 9 }, { "id": "4020", "map": [[0, 2, 0, 1, 0, 0], [2, 3, 0, 0, 2, 0], [3, 0, 0, 0, 0, 0], [0, 3, 3, 0, 0, 3], [2, 0, 0, 3, 0, 0], [4, 3, 0, 0, 0, 2]], "min_steps": 9 }], [{ "id": "5001", "map": [[1, 0, 0, 0, 0, 0], [0, 2, 2, 3, 0, 2], [3, 2, 0, 0, 3, 3], [0, 0, 0, 0, 0, 4], [0, 0, 0, 2, 2, 0], [3, 0, 2, 2, 0, 0]], "min_steps": 7 }, { "id": "5002", "map": [[0, 0, 0, 0, 4, 3], [3, 2, 3, 0, 0, 0], [0, 2, 0, 2, 3, 0], [2, 2, 0, 0, 0, 0], [3, 2, 0, 0, 0, 0], [3, 0, 0, 2, 0, 3], [2, 0, 0, 3, 0, 1]], "min_steps": 7 }, { "id": "5015", "map": [[1, 2, 3, 2, 2, 0], [3, 0, 0, 0, 0, 3], [0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 2], [0, 3, 0, 3, 2, 0], [0, 0, 0, 0, 0, 0], [0, 2, 0, 4, 0, 3]], "min_steps": 7 }, { "id": "5016", "map": [[3, 0, 1, 0, 0, 0], [0, 2, 0, 2, 0, 0], [0, 2, 0, 2, 0, 3], [0, 0, 0, 0, 0, 0], [0, 2, 0, 0, 3, 3], [0, 0, 0, 0, 2, 3], [0, 0, 0, 3, 0, 4]], "min_steps": 7 }, { "id": "5004", "map": [[0, 3, 3, 2, 3, 0], [2, 0, 2, 0, 3, 0], [1, 0, 3, 2, 0, 0], [3, 3, 0, 0, 0, 2], [0, 0, 0, 0, 0, 0], [0, 2, 0, 0, 0, 0], [0, 0, 0, 3, 4, 0]], "min_steps": 8 }, { "id": "5005", "map": [[0, 0, 0, 0, 0, 1], [0, 0, 2, 0, 2, 0], [3, 2, 2, 0, 0, 0], [3, 0, 0, 3, 0, 0], [3, 3, 0, 0, 0, 3], [4, 3, 0, 0, 0, 0], [2, 0, 0, 2, 3, 0]], "min_steps": 8 }, { "id": "5008", "map": [[3, 0, 3, 2, 0, 4], [0, 3, 0, 2, 0, 2], [0, 0, 3, 0, 0, 0], [2, 0, 0, 2, 0, 0], [0, 0, 3, 0, 0, 0], [0, 0, 0, 3, 0, 0], [3, 2, 1, 3, 0, 0]], "min_steps": 8 }, { "id": "5012", "map": [[2, 3, 0, 2, 0, 1], [2, 0, 0, 0, 0, 0], [2, 0, 0, 3, 0, 2], [3, 0, 3, 0, 0, 3], [0, 0, 0, 0, 3, 3], [3, 0, 0, 0, 2, 0], [0, 0, 0, 0, 0, 4]], "min_steps": 8 }, { "id": "5013", "map": [[0, 0, 2, 1, 2, 0], [0, 3, 0, 0, 0, 0], [2, 0, 0, 0, 0, 0], [0, 0, 0, 3, 0, 0], [3, 0, 0, 2, 3, 0], [3, 3, 3, 2, 0, 2], [0, 0, 4, 0, 0, 3]], "min_steps": 8 }, { "id": "5018", "map": [[0, 2, 0, 1, 0, 0], [2, 0, 0, 3, 0, 0], [0, 0, 0, 0, 0, 0], [3, 0, 0, 0, 0, 0], [2, 3, 0, 2, 3, 3], [2, 0, 0, 0, 0, 2], [4, 3, 0, 0, 0, 0]], "min_steps": 8 }, { "id": "5019", "map": [[1, 3, 0, 2, 3, 0], [0, 0, 0, 0, 0, 2], [0, 0, 0, 0, 0, 0], [0, 0, 2, 0, 0, 2], [3, 3, 0, 3, 0, 2], [4, 0, 2, 0, 0, 0], [0, 0, 0, 3, 0, 0]], "min_steps": 8 }, { "id": "5029", "map": [[4, 3, 0, 0, 0, 0], [2, 0, 0, 3, 0, 2], [3, 2, 0, 3, 3, 0], [2, 0, 0, 3, 0, 0], [0, 2, 0, 0, 0, 0], [2, 0, 0, 0, 0, 0], [3, 0, 3, 3, 0, 1]], "min_steps": 8 }, { "id": "5030", "map": [[0, 0, 0, 0, 0, 0], [0, 0, 2, 3, 2, 0], [0, 3, 0, 0, 0, 0], [2, 2, 0, 3, 0, 0], [0, 3, 3, 0, 3, 4], [0, 0, 2, 0, 0, 3], [3, 1, 0, 3, 0, 2]], "min_steps": 8 }, { "id": "5006", "map": [[0, 3, 0, 0, 0, 0], [1, 0, 0, 0, 3, 0], [0, 0, 3, 2, 0, 0], [3, 0, 0, 2, 2, 0], [0, 3, 0, 3, 3, 0], [0, 2, 0, 0, 0, 0], [4, 0, 3, 0, 2, 2]], "min_steps": 9 }, { "id": "5007", "map": [[0, 2, 0, 3, 0, 0], [1, 2, 0, 2, 0, 0], [0, 3, 0, 3, 0, 0], [3, 0, 0, 0, 0, 3], [0, 0, 3, 2, 0, 2], [4, 0, 0, 3, 0, 3], [0, 2, 0, 0, 0, 0]], "min_steps": 9 }, { "id": "5010", "map": [[0, 3, 1, 0, 0, 0], [0, 2, 3, 3, 0, 0], [0, 2, 0, 3, 0, 0], [0, 2, 0, 2, 0, 3], [0, 2, 0, 0, 3, 0], [0, 3, 0, 0, 0, 0], [0, 2, 4, 0, 0, 3]], "min_steps": 9 }, { "id": "5011", "map": [[1, 0, 3, 0, 3, 0], [0, 2, 0, 0, 0, 0], [2, 0, 2, 0, 3, 0], [0, 3, 2, 0, 0, 0], [3, 0, 0, 0, 0, 2], [4, 0, 3, 0, 0, 0], [3, 2, 0, 0, 0, 3]], "min_steps": 9 }, { "id": "5014", "map": [[0, 1, 0, 0, 0, 0], [2, 0, 2, 0, 0, 2], [2, 3, 0, 3, 0, 0], [0, 3, 0, 0, 0, 3], [0, 0, 0, 2, 0, 3], [0, 0, 3, 0, 3, 0], [2, 0, 3, 0, 0, 4]], "min_steps": 9 }, { "id": "5017", "map": [[0, 0, 0, 0, 0, 0], [1, 2, 3, 0, 0, 2], [0, 0, 2, 0, 0, 2], [3, 0, 2, 3, 0, 0], [0, 3, 3, 0, 2, 0], [0, 0, 0, 0, 0, 0], [4, 0, 3, 0, 0, 0]], "min_steps": 9 }, { "id": "5028", "map": [[0, 0, 1, 0, 0, 3], [3, 0, 0, 0, 3, 4], [0, 2, 0, 2, 3, 2], [0, 3, 2, 3, 3, 0], [0, 0, 0, 3, 0, 0], [0, 0, 3, 0, 0, 2], [0, 0, 2, 0, 0, 0]], "min_steps": 9 }, { "id": "5003", "map": [[0, 0, 1, 3, 0, 2], [0, 3, 3, 0, 0, 0], [0, 0, 3, 2, 0, 0], [0, 0, 3, 0, 0, 0], [3, 0, 0, 0, 2, 2], [0, 0, 2, 3, 0, 0], [0, 2, 0, 3, 0, 4]], "min_steps": 10 }, { "id": "5009", "map": [[0, 2, 0, 0, 0, 3], [0, 0, 3, 3, 3, 4], [0, 3, 0, 0, 0, 0], [0, 3, 2, 0, 0, 0], [1, 2, 3, 2, 0, 3], [2, 0, 0, 0, 0, 0], [0, 0, 0, 0, 2, 0]], "min_steps": 10 }, { "id": "5021", "map": [[0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 3, 0], [3, 0, 0, 0, 2, 0], [2, 0, 0, 2, 3, 0], [0, 3, 0, 0, 0, 2], [0, 2, 3, 0, 0, 0], [4, 3, 1, 2, 0, 0]], "min_steps": 10 }, { "id": "5022", "map": [[4, 0, 3, 0, 0, 2], [0, 0, 0, 0, 2, 0], [0, 3, 0, 2, 3, 2], [3, 0, 3, 0, 3, 0], [0, 2, 0, 0, 0, 0], [0, 3, 0, 3, 0, 3], [0, 2, 1, 0, 0, 0]], "min_steps": 10 }, { "id": "5023", "map": [[3, 0, 0, 3, 3, 0], [0, 0, 3, 0, 0, 3], [2, 3, 0, 0, 0, 0], [2, 2, 0, 0, 2, 0], [0, 3, 0, 0, 0, 0], [2, 0, 3, 0, 0, 4], [0, 1, 3, 0, 2, 0]], "min_steps": 10 }, { "id": "5024", "map": [[3, 0, 2, 3, 0, 0], [4, 2, 0, 0, 0, 3], [2, 2, 0, 0, 0, 0], [0, 0, 3, 0, 0, 2], [0, 0, 0, 3, 0, 3], [0, 3, 3, 0, 2, 0], [3, 0, 1, 0, 0, 0]], "min_steps": 10 }, { "id": "5020", "map": [[0, 0, 0, 2, 0, 0], [0, 3, 0, 0, 0, 3], [0, 2, 0, 0, 3, 0], [2, 0, 0, 2, 3, 4], [0, 2, 3, 0, 0, 0], [0, 0, 0, 3, 0, 0], [3, 2, 0, 1, 3, 0]], "min_steps": 11 }, { "id": "5025", "map": [[1, 0, 0, 0, 3, 0], [0, 0, 0, 3, 3, 2], [3, 3, 2, 0, 0, 2], [0, 0, 0, 0, 0, 3], [0, 0, 2, 0, 2, 0], [0, 0, 0, 0, 3, 4], [0, 3, 2, 3, 0, 0]], "min_steps": 11 }, { "id": "5026", "map": [[0, 3, 2, 0, 0, 0], [0, 0, 2, 3, 3, 0], [2, 0, 0, 2, 0, 0], [3, 2, 0, 0, 3, 2], [0, 0, 0, 3, 3, 1], [0, 0, 3, 0, 0, 3], [0, 0, 0, 0, 0, 4]], "min_steps": 11 }, { "id": "5027", "map": [[0, 0, 3, 0, 0, 1], [0, 0, 0, 0, 0, 3], [2, 0, 2, 0, 2, 3], [0, 0, 3, 3, 0, 3], [0, 0, 0, 2, 3, 0], [0, 0, 0, 2, 0, 3], [2, 0, 3, 0, 4, 0]], "min_steps": 11 }], [{ "id": "6028", "map": [[0, 0, 3, 0, 0, 2], [1, 3, 2, 2, 0, 3], [0, 0, 3, 0, 0, 2], [0, 0, 0, 0, 0, 0], [0, 0, 2, 0, 3, 3], [3, 3, 3, 0, 0, 0], [4, 0, 0, 0, 0, 2]], "min_steps": 8 }, { "id": "6029", "map": [[0, 0, 2, 0, 0, 1], [3, 2, 3, 0, 0, 3], [2, 0, 3, 0, 3, 0], [3, 3, 0, 0, 0, 0], [0, 0, 0, 3, 3, 2], [0, 0, 0, 0, 0, 2], [0, 0, 0, 4, 2, 0]], "min_steps": 8 }, { "id": "6030", "map": [[0, 3, 3, 0, 1, 0], [2, 3, 0, 0, 3, 0], [0, 0, 0, 3, 0, 2], [0, 0, 3, 0, 2, 0], [0, 0, 2, 3, 3, 3], [0, 0, 0, 0, 0, 0], [4, 0, 0, 2, 0, 2]], "min_steps": 8 }, { "id": "6001", "map": [[0, 0, 3, 3, 4, 2], [0, 0, 0, 2, 0, 0], [2, 3, 3, 2, 0, 0], [0, 3, 0, 0, 0, 2], [0, 0, 0, 3, 2, 2], [2, 0, 0, 3, 0, 2], [1, 3, 2, 0, 0, 0], [0, 0, 0, 3, 0, 0]], "min_steps": 9 }, { "id": "6012", "map": [[3, 0, 0, 0, 2, 0], [0, 3, 0, 3, 0, 0], [0, 3, 0, 0, 0, 3], [2, 0, 0, 3, 2, 0], [3, 2, 2, 2, 0, 0], [3, 0, 2, 0, 3, 0], [1, 2, 3, 0, 2, 0], [2, 3, 0, 0, 3, 4]], "min_steps": 9 }, { "id": "6016", "map": [[0, 0, 1, 0, 2, 3], [0, 3, 2, 0, 2, 0], [3, 3, 3, 3, 0, 0], [3, 0, 0, 0, 0, 0], [2, 2, 3, 0, 3, 3], [0, 0, 2, 0, 2, 0], [0, 2, 0, 2, 0, 3], [3, 0, 2, 0, 0, 4]], "min_steps": 9 }, { "id": "6008", "map": [[0, 0, 2, 0, 3, 4], [3, 3, 2, 3, 0, 0], [0, 0, 0, 0, 0, 3], [0, 0, 2, 3, 2, 0], [0, 0, 2, 0, 3, 2], [3, 3, 0, 0, 0, 2], [0, 3, 0, 0, 0, 0], [2, 1, 0, 0, 0, 0]], "min_steps": 10 }, { "id": "6013", "map": [[3, 0, 0, 2, 2, 0], [0, 2, 0, 3, 0, 2], [0, 0, 3, 2, 3, 0], [0, 3, 0, 0, 3, 0], [2, 2, 3, 2, 0, 0], [0, 0, 3, 3, 0, 0], [0, 2, 0, 3, 2, 0], [4, 3, 3, 0, 1, 0]], "min_steps": 10 }, { "id": "6017", "map": [[4, 0, 0, 0, 0, 3], [0, 3, 3, 0, 0, 0], [3, 0, 2, 2, 0, 0], [3, 0, 2, 3, 3, 2], [3, 2, 0, 2, 3, 3], [2, 0, 2, 0, 0, 0], [0, 0, 0, 0, 0, 3], [2, 3, 0, 2, 0, 1]], "min_steps": 10 }, { "id": "6022", "map": [[0, 0, 3, 4, 3, 0], [0, 3, 0, 2, 2, 0], [2, 0, 2, 0, 0, 3], [0, 0, 0, 0, 0, 0], [2, 3, 0, 3, 2, 0], [0, 3, 0, 0, 0, 0], [0, 1, 3, 0, 0, 3]], "min_steps": 10 }, { "id": "6023", "map": [[0, 0, 3, 1, 0, 2], [0, 0, 2, 3, 0, 0], [4, 0, 3, 0, 0, 0], [2, 0, 3, 0, 0, 3], [2, 0, 3, 0, 3, 0], [0, 0, 0, 0, 0, 0], [2, 3, 0, 2, 3, 0]], "min_steps": 10 }, { "id": "6024", "map": [[0, 3, 0, 2, 0, 4], [3, 0, 0, 3, 3, 3], [0, 0, 2, 0, 0, 0], [2, 3, 3, 0, 0, 0], [2, 0, 0, 0, 0, 3], [2, 0, 3, 0, 0, 1], [0, 0, 0, 0, 0, 2]], "min_steps": 10 }, { "id": "6025", "map": [[4, 0, 2, 0, 0, 0], [0, 0, 3, 3, 0, 2], [3, 3, 0, 0, 0, 3], [0, 2, 0, 2, 0, 0], [0, 0, 0, 0, 3, 0], [1, 3, 0, 0, 2, 2], [0, 3, 0, 0, 0, 3]], "min_steps": 10 }, { "id": "6002", "map": [[0, 0, 3, 3, 4, 2], [0, 0, 0, 2, 0, 0], [2, 3, 3, 2, 0, 0], [0, 3, 0, 0, 0, 2], [0, 0, 0, 3, 2, 2], [2, 0, 0, 3, 0, 2], [1, 3, 2, 0, 0, 0], [0, 0, 0, 3, 0, 0]], "min_steps": 11 }, { "id": "6006", "map": [[1, 0, 2, 0, 0, 3], [0, 0, 0, 0, 3, 0], [3, 0, 0, 3, 2, 0], [2, 3, 0, 0, 0, 3], [0, 0, 3, 2, 0, 3], [0, 2, 0, 3, 0, 0], [2, 3, 0, 2, 0, 0], [0, 4, 0, 2, 0, 0]], "min_steps": 11 }, { "id": "6009", "map": [[4, 3, 0, 0, 3, 0], [0, 0, 0, 0, 0, 0], [3, 3, 0, 2, 0, 2], [3, 0, 0, 2, 2, 0], [2, 3, 2, 0, 0, 0], [1, 3, 3, 0, 0, 0], [2, 0, 0, 0, 0, 0], [3, 3, 0, 0, 0, 2]], "min_steps": 11 }, { "id": "6018", "map": [[2, 3, 0, 0, 2, 3], [2, 0, 0, 3, 0, 4], [2, 0, 0, 0, 0, 0], [0, 3, 2, 0, 2, 3], [0, 0, 0, 0, 0, 3], [2, 0, 3, 3, 2, 3], [0, 0, 0, 3, 2, 0], [2, 3, 1, 3, 0, 0]], "min_steps": 11 }, { "id": "6026", "map": [[0, 1, 0, 3, 0, 4], [0, 0, 3, 0, 3, 0], [2, 2, 3, 2, 0, 0], [0, 0, 3, 0, 3, 3], [2, 0, 0, 0, 0, 2], [0, 3, 0, 0, 0, 2], [0, 0, 0, 0, 0, 3]], "min_steps": 11 }, { "id": "6027", "map": [[2, 1, 3, 0, 0, 0], [0, 0, 0, 0, 3, 0], [3, 3, 0, 0, 0, 0], [2, 2, 3, 3, 3, 0], [0, 2, 0, 0, 0, 0], [3, 2, 0, 0, 0, 0], [0, 4, 0, 2, 3, 0]], "min_steps": 11 }, { "id": "6031", "map": [[0, 1, 0, 3, 0, 4], [0, 0, 3, 0, 3, 0], [2, 2, 3, 2, 0, 0], [0, 0, 3, 0, 3, 3], [2, 0, 0, 0, 0, 2], [0, 3, 0, 0, 0, 2], [0, 0, 0, 0, 0, 3]], "min_steps": 11 }, { "id": "6003", "map": [[0, 2, 2, 0, 0, 4], [0, 3, 3, 0, 0, 0], [3, 2, 0, 0, 0, 0], [0, 3, 0, 0, 3, 3], [0, 2, 0, 3, 0, 0], [2, 3, 0, 0, 0, 0], [0, 2, 3, 0, 0, 0], [1, 2, 3, 0, 2, 0]], "min_steps": 12 }, { "id": "6011", "map": [[3, 0, 2, 2, 3, 2], [1, 0, 0, 0, 0, 3], [0, 0, 3, 2, 3, 0], [3, 0, 3, 0, 0, 0], [4, 3, 2, 3, 0, 2], [0, 0, 2, 0, 2, 3], [2, 0, 0, 0, 0, 3], [0, 0, 0, 2, 0, 3]], "min_steps": 12 }, { "id": "6014", "map": [[4, 3, 0, 0, 0, 0], [0, 2, 2, 2, 3, 0], [0, 3, 0, 0, 0, 0], [2, 3, 2, 3, 0, 0], [3, 3, 0, 0, 0, 3], [0, 0, 0, 2, 3, 0], [0, 3, 2, 0, 2, 2], [2, 3, 3, 0, 0, 1]], "min_steps": 12 }, { "id": "6020", "map": [[3, 2, 0, 0, 0, 0], [4, 0, 2, 0, 2, 0], [3, 3, 0, 0, 2, 2], [0, 0, 3, 0, 2, 0], [0, 0, 0, 0, 2, 3], [0, 2, 3, 3, 0, 0], [2, 3, 0, 0, 3, 3], [1, 3, 3, 2, 0, 0]], "min_steps": 12 }, { "id": "6021", "map": [[4, 3, 0, 0, 0, 0], [0, 2, 2, 2, 3, 0], [0, 3, 0, 0, 0, 0], [2, 3, 2, 3, 0, 0], [3, 3, 0, 0, 0, 3], [0, 0, 0, 2, 3, 0], [0, 3, 2, 0, 2, 2], [2, 3, 3, 0, 0, 1]], "min_steps": 12 }, { "id": "6004", "map": [[0, 3, 0, 2, 2, 0], [0, 0, 0, 0, 0, 2], [3, 0, 0, 0, 0, 0], [0, 3, 0, 0, 0, 0], [0, 3, 3, 0, 3, 0], [2, 0, 0, 0, 3, 2], [2, 0, 0, 0, 3, 1], [4, 3, 0, 2, 3, 2]], "min_steps": 13 }, { "id": "6005", "map": [[2, 2, 4, 2, 3, 0], [0, 3, 3, 2, 0, 0], [3, 0, 0, 3, 0, 2], [3, 0, 2, 3, 3, 0], [0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 2, 3], [3, 2, 0, 0, 0, 1], [0, 0, 0, 0, 0, 0]], "min_steps": 13 }, { "id": "6007", "map": [[3, 2, 0, 0, 3, 4], [0, 2, 0, 0, 3, 0], [0, 0, 2, 0, 2, 0], [2, 0, 0, 3, 0, 3], [0, 0, 2, 0, 3, 2], [0, 2, 3, 3, 0, 1], [0, 0, 0, 0, 0, 3], [0, 0, 0, 3, 0, 0]], "min_steps": 13 }, { "id": "6010", "map": [[0, 3, 1, 0, 0, 0], [0, 2, 3, 3, 0, 0], [2, 0, 0, 3, 0, 0], [0, 2, 0, 0, 3, 2], [3, 0, 0, 0, 0, 2], [3, 2, 0, 0, 0, 0], [4, 0, 0, 3, 2, 0], [0, 3, 0, 3, 2, 0]], "min_steps": 13 }, { "id": "6015", "map": [[4, 0, 0, 0, 2, 3], [0, 0, 3, 0, 0, 3], [2, 2, 3, 2, 0, 0], [3, 0, 0, 0, 3, 2], [2, 3, 0, 3, 0, 2], [0, 0, 3, 0, 2, 3], [0, 0, 0, 0, 0, 3], [1, 2, 2, 3, 0, 0]], "min_steps": 14 }, { "id": "6019", "map": [[4, 0, 0, 0, 2, 3], [0, 0, 3, 0, 0, 3], [2, 2, 3, 2, 0, 0], [3, 0, 0, 0, 3, 2], [2, 3, 0, 3, 0, 2], [0, 0, 3, 0, 2, 3], [0, 0, 0, 0, 0, 3], [1, 2, 2, 3, 0, 0]], "min_steps": 14 }], [{ "id": "7001", "map": [[0, 2, 0, 0, 2, 0], [3, 3, 0, 2, 0, 4], [0, 0, 0, 0, 0, 3], [0, 0, 0, 0, 3, 2], [0, 0, 0, 0, 0, 2], [3, 3, 0, 0, 0, 2], [0, 3, 3, 2, 2, 0], [0, 3, 2, 2, 0, 3], [1, 2, 0, 0, 2, 0]], "min_steps": 9 }, { "id": "7023", "map": [[3, 2, 0, 2, 0, 1], [0, 3, 3, 2, 3, 3], [0, 3, 3, 0, 3, 0], [0, 2, 2, 2, 0, 3], [0, 3, 2, 0, 0, 3], [0, 0, 0, 0, 2, 0], [2, 2, 2, 3, 0, 0], [2, 0, 3, 0, 3, 0], [0, 0, 3, 0, 0, 4]], "min_steps": 9 }, { "id": "7003", "map": [[1, 3, 2, 0, 0, 0], [0, 0, 0, 2, 0, 0], [0, 3, 0, 2, 0, 0], [3, 3, 3, 2, 0, 3], [2, 3, 3, 0, 3, 0], [0, 0, 0, 0, 0, 2], [3, 0, 2, 2, 3, 2], [4, 2, 0, 0, 2, 0], [0, 0, 2, 0, 0, 2]], "min_steps": 10 }, { "id": "7002", "map": [[1, 0, 3, 2, 0, 2], [0, 3, 0, 0, 0, 2], [0, 2, 0, 3, 2, 2], [0, 3, 0, 0, 0, 0], [0, 2, 0, 3, 3, 0], [3, 2, 2, 0, 0, 3], [0, 3, 2, 3, 0, 2], [0, 0, 0, 0, 0, 0], [2, 0, 0, 2, 3, 4]], "min_steps": 11 }, { "id": "7005", "map": [[0, 0, 0, 0, 0, 0], [0, 0, 0, 3, 2, 4], [0, 3, 0, 0, 3, 3], [3, 3, 0, 2, 0, 3], [0, 2, 2, 0, 3, 2], [0, 0, 3, 0, 2, 0], [0, 2, 0, 2, 0, 0], [3, 0, 0, 2, 2, 0], [0, 0, 2, 2, 0, 1]], "min_steps": 11 }, { "id": "7006", "map": [[0, 0, 0, 0, 2, 3], [3, 2, 0, 0, 0, 0], [0, 2, 0, 3, 3, 4], [0, 0, 0, 2, 2, 3], [2, 0, 0, 0, 0, 0], [0, 0, 0, 0, 3, 0], [3, 0, 3, 3, 0, 2], [3, 0, 2, 2, 0, 2], [0, 0, 2, 2, 0, 1]], "min_steps": 11 }, { "id": "7007", "map": [[2, 0, 2, 0, 2, 0], [0, 0, 2, 0, 3, 2], [0, 0, 0, 3, 3, 0], [0, 2, 0, 0, 3, 2], [3, 0, 0, 2, 0, 0], [3, 3, 0, 0, 0, 2], [0, 2, 0, 3, 2, 0], [0, 2, 3, 0, 0, 0], [4, 3, 0, 0, 1, 0]], "min_steps": 11 }, { "id": "7026", "map": [[2, 4, 2, 0, 0, 0], [0, 3, 3, 0, 3, 0], [3, 3, 3, 0, 0, 3], [2, 0, 3, 0, 0, 2], [0, 2, 2, 3, 0, 3], [1, 0, 2, 0, 2, 0], [3, 3, 0, 0, 0, 0], [2, 0, 0, 0, 3, 2], [2, 0, 3, 2, 3, 0]], "min_steps": 11 }, { "id": "7027", "map": [[2, 0, 0, 0, 0, 2], [0, 0, 3, 3, 2, 3], [0, 0, 3, 0, 0, 1], [0, 3, 0, 3, 3, 3], [0, 0, 0, 0, 0, 2], [3, 3, 2, 0, 0, 2], [3, 3, 0, 2, 0, 3], [0, 3, 2, 2, 2, 0], [0, 3, 4, 2, 2, 0]], "min_steps": 11 }, { "id": "7029", "map": [[0, 0, 1, 0, 0, 0], [3, 3, 0, 0, 3, 2], [3, 0, 0, 0, 2, 0], [0, 2, 0, 2, 2, 0], [2, 3, 3, 3, 0, 3], [3, 2, 2, 3, 0, 0], [2, 0, 3, 0, 0, 3], [3, 2, 0, 0, 0, 3], [4, 2, 0, 0, 3, 2]], "min_steps": 11 }, { "id": "7008", "map": [[1, 0, 0, 0, 2, 0], [3, 3, 2, 0, 3, 0], [3, 0, 3, 0, 0, 0], [0, 0, 3, 0, 0, 3], [2, 2, 0, 3, 0, 3], [2, 0, 2, 0, 0, 0], [2, 0, 2, 0, 0, 2], [2, 0, 0, 2, 0, 0], [4, 3, 0, 0, 0, 2]], "min_steps": 12 }, { "id": "7010", "map": [[4, 3, 0, 3, 1, 0], [0, 0, 3, 3, 0, 0], [0, 3, 0, 0, 2, 2], [2, 0, 3, 0, 0, 2], [3, 2, 0, 2, 3, 0], [0, 0, 0, 0, 0, 0], [0, 2, 0, 2, 2, 0], [0, 2, 0, 3, 0, 2], [0, 2, 0, 0, 0, 3]], "min_steps": 12 }, { "id": "7016", "map": [[2, 3, 4, 0, 0, 3], [0, 3, 2, 2, 3, 1], [0, 2, 2, 3, 0, 0], [3, 0, 3, 0, 2, 0], [3, 0, 0, 0, 2, 2], [0, 0, 3, 3, 0, 0], [0, 3, 0, 3, 2, 0], [0, 0, 3, 0, 3, 2], [0, 2, 2, 3, 0, 0]], "min_steps": 12 }, { "id": "7020", "map": [[2, 3, 0, 4, 3, 3], [3, 3, 0, 0, 3, 0], [0, 2, 0, 3, 2, 0], [0, 3, 0, 0, 0, 2], [3, 2, 0, 0, 0, 0], [0, 0, 3, 2, 0, 3], [0, 3, 0, 3, 2, 0], [3, 2, 2, 0, 0, 2], [0, 0, 2, 1, 3, 2]], "min_steps": 12 }, { "id": "7024", "map": [[1, 3, 2, 0, 0, 3], [2, 3, 2, 0, 0, 0], [0, 2, 3, 0, 3, 3], [3, 0, 0, 2, 0, 3], [2, 3, 0, 0, 0, 3], [3, 3, 0, 0, 0, 0], [2, 0, 3, 0, 0, 2], [0, 0, 2, 0, 2, 2], [4, 2, 3, 0, 3, 0]], "min_steps": 12 }, { "id": "7032", "map": [[0, 0, 0, 0, 3, 4], [0, 0, 3, 3, 3, 2], [2, 2, 3, 3, 0, 0], [0, 0, 3, 2, 0, 0], [0, 2, 0, 2, 3, 2], [0, 2, 3, 0, 0, 3], [2, 3, 3, 0, 0, 2], [1, 0, 3, 0, 3, 2], [0, 0, 3, 0, 0, 2]], "min_steps": 12 }, { "id": "7033", "map": [[1, 0, 0, 3, 0, 3], [3, 3, 2, 0, 2, 0], [0, 3, 3, 2, 0, 2], [3, 2, 0, 3, 0, 0], [4, 2, 2, 2, 0, 0], [0, 3, 0, 0, 0, 0], [3, 3, 3, 0, 0, 2], [3, 0, 3, 2, 0, 3], [2, 0, 0, 0, 0, 2]], "min_steps": 12 }, { "id": "7035", "map": [[3, 0, 0, 2, 0, 4], [3, 0, 2, 3, 3, 3], [0, 0, 2, 3, 0, 2], [3, 0, 3, 3, 3, 0], [2, 2, 0, 0, 0, 0], [2, 2, 3, 0, 0, 0], [0, 0, 2, 3, 0, 0], [0, 2, 0, 3, 2, 3], [0, 0, 3, 1, 2, 0]], "min_steps": 12 }, { "id": "7036", "map": [[2, 3, 1, 0, 0, 2], [0, 3, 0, 0, 0, 0], [2, 0, 2, 0, 0, 3], [0, 0, 3, 3, 0, 3], [0, 2, 2, 0, 0, 3], [0, 3, 2, 3, 3, 0], [0, 3, 2, 0, 0, 2], [0, 3, 2, 0, 2, 3], [2, 0, 3, 3, 4, 0]], "min_steps": 12 }, { "id": "7037", "map": [[2, 0, 0, 0, 0, 3], [0, 2, 3, 0, 2, 2], [0, 0, 3, 0, 2, 0], [0, 2, 2, 0, 0, 0], [3, 2, 3, 0, 0, 3], [0, 0, 3, 3, 0, 3], [3, 2, 3, 0, 0, 3], [0, 0, 3, 3, 2, 0], [4, 3, 1, 2, 0, 2]], "min_steps": 12 }, { "id": "7039", "map": [[2, 0, 3, 3, 2, 0], [0, 0, 0, 0, 2, 3], [1, 3, 0, 0, 0, 2], [0, 2, 3, 2, 2, 2], [0, 0, 3, 0, 0, 0], [0, 3, 0, 0, 3, 0], [3, 0, 0, 2, 3, 2], [2, 0, 3, 0, 2, 3], [0, 4, 3, 0, 3, 3]], "min_steps": 12 }, { "id": "7040", "map": [[0, 2, 3, 3, 4, 0], [0, 2, 0, 0, 3, 2], [0, 0, 3, 0, 2, 0], [3, 0, 2, 0, 0, 3], [2, 0, 0, 3, 0, 3], [3, 3, 0, 2, 2, 0], [2, 2, 3, 0, 2, 0], [1, 3, 0, 0, 2, 3], [0, 0, 0, 3, 0, 3]], "min_steps": 12 }, { "id": "7041", "map": [[3, 3, 0, 2, 3, 1], [0, 3, 3, 2, 0, 2], [0, 2, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0], [3, 3, 3, 2, 3, 0], [0, 3, 3, 2, 3, 2], [4, 0, 3, 0, 2, 0], [2, 2, 2, 0, 0, 0], [0, 3, 2, 0, 3, 0]], "min_steps": 12 }, { "id": "7004", "map": [[2, 0, 0, 2, 0, 0], [0, 3, 0, 0, 0, 1], [0, 2, 0, 0, 0, 0], [0, 0, 0, 0, 2, 0], [0, 0, 3, 3, 3, 2], [0, 0, 0, 3, 2, 3], [0, 0, 2, 0, 0, 3], [0, 2, 3, 2, 2, 4], [3, 2, 2, 0, 3, 0]], "min_steps": 13 }, { "id": "7009", "map": [[4, 0, 3, 1, 0, 2], [0, 2, 3, 3, 3, 0], [0, 2, 3, 2, 2, 0], [3, 0, 3, 0, 0, 2], [0, 0, 0, 0, 0, 0], [3, 2, 0, 0, 2, 0], [3, 2, 0, 0, 2, 0], [0, 0, 2, 2, 2, 0], [0, 0, 0, 0, 3, 0]], "min_steps": 13 }, { "id": "7014", "map": [[3, 4, 2, 3, 0, 0], [2, 3, 0, 3, 0, 0], [0, 2, 2, 0, 0, 0], [0, 3, 3, 0, 3, 3], [0, 0, 0, 0, 0, 0], [3, 2, 0, 0, 2, 2], [2, 2, 2, 2, 0, 3], [0, 0, 3, 3, 0, 3], [1, 2, 0, 3, 3, 0]], "min_steps": 13 }, { "id": "7015", "map": [[2, 3, 4, 0, 3, 0], [1, 2, 3, 2, 3, 0], [0, 0, 3, 0, 2, 0], [2, 0, 0, 3, 0, 0], [2, 2, 0, 2, 0, 3], [0, 0, 2, 0, 0, 0], [3, 0, 0, 3, 3, 0], [0, 0, 3, 0, 2, 3], [3, 0, 3, 2, 3, 2]], "min_steps": 13 }, { "id": "7025", "map": [[2, 3, 1, 0, 3, 3], [0, 0, 2, 3, 2, 0], [0, 2, 0, 0, 0, 3], [0, 3, 0, 0, 0, 3], [2, 0, 0, 3, 2, 0], [0, 0, 2, 3, 0, 2], [2, 0, 3, 2, 0, 3], [3, 3, 0, 0, 3, 3], [2, 4, 0, 2, 0, 0]], "min_steps": 13 }, { "id": "7030", "map": [[2, 0, 1, 2, 0, 0], [0, 2, 3, 3, 0, 2], [2, 3, 3, 3, 0, 2], [3, 0, 0, 2, 2, 0], [0, 3, 0, 3, 2, 0], [0, 0, 2, 0, 2, 3], [3, 3, 0, 3, 3, 2], [4, 3, 0, 0, 0, 0], [0, 0, 0, 0, 0, 3]], "min_steps": 13 }, { "id": "7031", "map": [[0, 2, 2, 3, 4, 2], [3, 3, 0, 0, 2, 2], [0, 0, 0, 3, 2, 0], [0, 3, 0, 0, 3, 3], [0, 2, 0, 2, 3, 0], [2, 3, 0, 0, 0, 0], [3, 3, 0, 3, 0, 2], [0, 0, 2, 3, 3, 3], [1, 0, 2, 0, 0, 0]], "min_steps": 13 }, { "id": "7038", "map": [[4, 2, 3, 3, 2, 3], [0, 3, 0, 2, 3, 0], [0, 0, 0, 2, 0, 2], [3, 3, 2, 3, 0, 0], [0, 3, 0, 3, 2, 3], [0, 2, 2, 2, 0, 0], [1, 3, 0, 0, 3, 0], [2, 0, 0, 0, 3, 2], [0, 0, 3, 0, 0, 0]], "min_steps": 13 }, { "id": "7011", "map": [[0, 1, 0, 0, 2, 0], [3, 0, 3, 3, 2, 3], [0, 3, 3, 2, 0, 0], [0, 0, 2, 0, 3, 3], [2, 3, 2, 0, 0, 0], [3, 2, 2, 3, 3, 0], [2, 0, 2, 2, 0, 4], [0, 2, 0, 3, 0, 0], [0, 0, 0, 3, 0, 3]], "min_steps": 14 }, { "id": "7017", "map": [[2, 0, 0, 3, 0, 3], [4, 3, 0, 2, 0, 3], [3, 0, 0, 0, 3, 0], [2, 0, 0, 2, 0, 0], [3, 0, 0, 3, 0, 0], [2, 3, 0, 2, 2, 2], [1, 3, 3, 0, 2, 2], [0, 3, 0, 0, 3, 0], [0, 2, 0, 3, 3, 2]], "min_steps": 14 }, { "id": "7019", "map": [[0, 3, 0, 2, 3, 1], [0, 3, 0, 2, 0, 2], [0, 2, 2, 0, 3, 3], [0, 0, 3, 2, 0, 3], [0, 0, 3, 2, 2, 0], [2, 2, 3, 0, 2, 2], [0, 3, 0, 0, 3, 0], [3, 0, 0, 3, 3, 0], [0, 0, 0, 3, 0, 4]], "min_steps": 14 }, { "id": "7021", "map": [[0, 0, 0, 0, 2, 4], [3, 0, 2, 0, 0, 0], [3, 0, 2, 3, 3, 3], [2, 0, 3, 3, 3, 0], [2, 0, 0, 0, 2, 3], [3, 3, 0, 0, 0, 2], [1, 0, 3, 0, 2, 2], [2, 2, 0, 2, 0, 0], [0, 0, 3, 3, 0, 3]], "min_steps": 14 }, { "id": "7022", "map": [[4, 0, 0, 0, 0, 0], [0, 0, 0, 0, 3, 2], [3, 3, 2, 3, 3, 2], [2, 0, 0, 0, 0, 2], [0, 0, 3, 0, 3, 3], [2, 0, 2, 3, 2, 1], [3, 2, 3, 0, 0, 3], [2, 0, 0, 3, 2, 2], [3, 3, 0, 0, 0, 0]], "min_steps": 15 }, { "id": "7028", "map": [[0, 2, 1, 3, 0, 2], [0, 3, 3, 3, 0, 2], [0, 0, 0, 3, 0, 2], [3, 0, 0, 3, 2, 4], [2, 0, 0, 3, 2, 2], [2, 2, 3, 0, 0, 3], [0, 2, 0, 0, 0, 0], [0, 3, 3, 3, 2, 0], [0, 3, 0, 3, 0, 0]], "min_steps": 16 }, { "id": "7034", "map": [[1, 0, 0, 3, 2, 0], [0, 2, 2, 3, 3, 0], [3, 0, 0, 2, 0, 3], [2, 3, 2, 2, 0, 3], [0, 0, 3, 0, 0, 3], [3, 0, 0, 0, 3, 0], [2, 3, 0, 3, 2, 4], [0, 3, 0, 0, 0, 3], [0, 2, 0, 0, 2, 2]], "min_steps": 16 }, { "id": "7012", "map": [[1, 3, 3, 3, 0, 0], [0, 3, 0, 2, 0, 0], [0, 0, 0, 3, 0, 2], [3, 0, 0, 3, 2, 3], [0, 0, 2, 0, 0, 3], [0, 0, 2, 3, 2, 0], [2, 2, 3, 2, 3, 2], [0, 3, 0, 2, 0, 2], [0, 3, 4, 3, 0, 0]], "min_steps": 17 }, { "id": "7013", "map": [[0, 1, 0, 0, 3, 3], [0, 2, 0, 3, 0, 0], [2, 3, 0, 0, 0, 0], [0, 0, 0, 3, 0, 3], [0, 3, 0, 2, 3, 2], [2, 0, 3, 3, 2, 0], [0, 2, 2, 3, 0, 2], [2, 3, 2, 0, 3, 0], [0, 3, 3, 0, 2, 4]], "min_steps": 17 }, { "id": "7018", "map": [[0, 0, 0, 0, 0, 2], [1, 0, 3, 3, 0, 2], [3, 3, 0, 3, 2, 3], [0, 3, 0, 2, 0, 0], [0, 3, 0, 0, 2, 2], [3, 0, 0, 2, 3, 0], [0, 3, 3, 3, 0, 0], [2, 0, 3, 0, 0, 2], [2, 4, 2, 0, 3, 2]], "min_steps": 17 }]]; + this.LEVEL_INFO.unshift([{ "id": "0001", "map": [[3, 2, 2, 0, 2], [0, 0, 3, 3, 0], [1, 3, 0, 3, 2], [3, 0, 2, 3, 4], [3, 2, 3, 3, 2]], "min_steps": 4 }]); }; GameConfig.Authentication = function () { cc.fx.GameTool.Authentication(); }; + GameConfig.setCode = function (code) { + this.GM_INFO.scode = code; + }; var GameConfig_1; //所有控制信息都通过GameAppStart内控制 GameConfig._instance = null; diff --git a/library/imports/c5/c5692be7-8703-45e4-9f67-23b54d290356.js.map b/library/imports/c5/c5692be7-8703-45e4-9f67-23b54d290356.js.map index 5b88d3c..4aec667 100644 --- a/library/imports/c5/c5692be7-8703-45e4-9f67-23b54d290356.js.map +++ b/library/imports/c5/c5692be7-8703-45e4-9f67-23b54d290356.js.map @@ -1 +1 @@ -{"version":3,"sources":["assets\\Script\\module\\Config\\GameConfig.ts"],"names":[],"mappings":";;;;;;;;;;;;;AAIM,IAAA,KAAwB,EAAE,CAAC,UAAU,EAAnC,OAAO,aAAA,EAAE,QAAQ,cAAkB,CAAC;AAE5C;IAAA;IAulFA,CAAC;mBAvlFY,UAAU;IAkDnB,sBAAW,sBAAQ;QAJnB,OAAO;aAIP;YAEI,IAAI,IAAI,CAAC,SAAS,IAAI,IAAI,EAC1B;gBACI,IAAI,CAAC,SAAS,GAAG,IAAI,YAAU,EAAE,CAAC;aACrC;YACD,OAAO,IAAI,CAAC,SAAS,CAAC;QAC1B,CAAC;;;OAAA;IACD,eAAe;IACR,eAAI,GAAX,UAAY,cAAc;QACtB,QAAQ,CAAC;QACT,IAAI,CAAC,UAAU,EAAE,CAAC;QAClB,IAAI,CAAC,eAAe,EAAE,CAAC;QACvB,IAAI,CAAC,YAAY,EAAE,CAAC;QACpB,IAAI,IAAI,GAAG,IAAI,CAAC;QAChB,0EAA0E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,CAAC;wBACT,WAAW,EAAE,CAAC;qBACjB;iBACJ;aACJ;SACJ,CAAA;IAEL,CAAC;IAEM,yBAAc,GAArB;QACI,EAAE,CAAC,EAAE,CAAC,QAAQ,CAAC,cAAc,EAAE,CAAC;IACpC,CAAC;;IArlFD,0BAA0B;IACX,oBAAS,GAAgB,IAAI,CAAC;IAFpC,UAAU;QADtB,OAAO,CAAC,YAAY,CAAC;OACT,UAAU,CAulFtB;IAAD,iBAAC;CAvlFD,AAulFC,IAAA;AAvlFY,gCAAU","file":"","sourceRoot":"/","sourcesContent":["import { WeChat } from \"../Share/share\";\r\nimport { GameTool } from \"../Tool/GameTool\";\r\n\r\n\r\nconst { ccclass, property } = cc._decorator;\r\n@ccclass('GameConfig')\r\nexport class GameConfig {\r\n //所有控制信息都通过GameAppStart内控制\r\n private static _instance : GameConfig = null;\r\n //用于盛放埋点数据上传,每次上传后清空\r\n static CLICK_DATA: {\r\n type: number; //上传数据类型\r\n success: boolean; //此局游戏正确与否\r\n round: number; //回合数\r\n choice: number; //玩家选择,0:时间截止前未做选择,1,2,3:三个按钮从上到下依次对应\r\n rightChoice: number; //本轮的按正确答案,含义与choice相同\r\n item: string; //此关展示的物品\r\n roundType: number; //展示方式。1:图像 2:音频\r\n stepTime: number; //玩家每一关用时毫秒数 音频关卡从播放结束开始计时\r\n levelConfig: number; //使用的是哪一套关卡配置\r\n ignite: boolean; //玩家此轮有没有点火\r\n igniteCount: number; //玩家总计成功点火数\r\n };\r\n static GAME_DATA: any[];\r\n //关卡数据\r\n static LEVEL_INFO: {\r\n custom: {\r\n id: number; //植物ID\r\n item: string; //植物名稱\r\n type: number; //種類1为头像2是音频\r\n flammable: number; //是否有柴火\r\n }[];\r\n }[];\r\n static GM_INFO: {\r\n // isEnd: false,\r\n mean_Time: number; //平均放箭速度\r\n total: number; //总共对的个数\r\n currSeed: number; //用于随机数种子\r\n gameId: string; //游戏ID\r\n userId: number; //用户ID\r\n guide: boolean; //是否有引导\r\n url: string; //访问域名\r\n success: boolean; //用户游戏成功与否\r\n matchId: any; //用于埋点上传的ID\r\n custom: number; //用于测试跳关卡\r\n level: number; //具体游戏内进行到第几步 \r\n stepTimeList: number; //整局游戏用时,由于涉及场景切换,数据需要保留\r\n successList: any[]; //整局胜负\r\n gameTime: number; //单次游戏倒计时时间\r\n igniteCount: number; //玩家总计成功点火数\r\n \r\n };\r\n //游戏内信息\r\n\r\n\r\n\r\n static get Instance()\r\n {\r\n if (this._instance == null)\r\n {\r\n this._instance = new GameConfig();\r\n }\r\n return this._instance;\r\n }\r\n //getSeedRandom\r\n static init(Authentication){\r\n debugger;\r\n this.CLICK_init();\r\n this.LEVEL_INFO_init();\r\n this.GM_INFO_init();\r\n var self = this;\r\n // cc.resources.load('Json/CLICK_DATA', (err: any, res: cc.JsonAsset) => {\r\n // if (err) {\r\n // return;\r\n // }\r\n // let jsonData: object = res.json!;\r\n // self.CLICK_DATA = jsonData[\"data\"];\r\n // })\r\n // cc.resources.load('Json/LEVEL_INFO', (err: any, res: cc.JsonAsset) => {\r\n // if (err) {\r\n // return;\r\n // }\r\n \r\n // let jsonData: object = res.json!;\r\n // self.LEVEL_INFO = jsonData[\"data\"];\r\n // })\r\n // cc.resources.load('Json/GM_INFO', (err: any, res: cc.JsonAsset) => {\r\n // if (err) {\r\n // if(!Authentication) self.Authentication();\r\n // return;\r\n // }\r\n \r\n // let jsonData: object = res.json!;\r\n // self.GM_INFO = jsonData[\"data\"];\r\n // cc.fx.GameTool.getCustom(false);\r\n // if(!Authentication) self.Authentication();\r\n // })\r\n\r\n //GAME_DATA 废弃了,暂时不删除以防后面修改回 一整局传一次\r\n self.GAME_DATA = [\r\n ]\r\n }\r\n \r\n //数据备用\r\n static GM_INFO_init() {\r\n this.GM_INFO = {\r\n // isEnd: false,\r\n mean_Time: 0, //平均放箭速度\r\n total: 0, //总共对的个数\r\n currSeed: 200000, //用于随机数种子\r\n gameId: \"100010\", //游戏ID\r\n userId: 200139, //用户ID\r\n guide: true, //是否有引导\r\n url: \"https://api.sparkus.cn\",//访问域名\r\n success: false, //用户游戏成功与否\r\n matchId: null, //用于埋点上传的ID\r\n custom: 0, //用于测试跳关卡\r\n level: 0, //具体游戏内进行到第几步 \r\n stepTimeList:0, //整局游戏用时,由于涉及场景切换,数据需要保留\r\n successList:[], //整局胜负\r\n gameTime:5,\r\n igniteCount: 0, //玩家总计成功点火数\r\n };\r\n\r\n }\r\n static GM_INFO_SET(key,value) {\r\n\r\n this.GM_INFO[key] = value;\r\n }\r\n static CLICK_init() {\r\n this.CLICK_DATA =\r\n {\r\n type: 1, //上传数据类型\r\n success: false, //此局游戏正确与否\r\n round: 0, //回合数\r\n choice: 0, //玩家选择,0:时间截止前未做选择,1,2,3:三个按钮从上到下依次对应\r\n rightChoice: 0, //本轮的按正确答案,含义与choice相同\r\n item: \"\", //此关展示的物品\r\n roundType: 0, //展示方式。1:图像 2:音频\r\n stepTime: 0, //玩家每一关用时毫秒数 音频关卡从播放结束开始计时\r\n levelConfig: 0, //使用的是哪一套关卡配置\r\n ignite: false, //玩家此轮有没有点火\r\n igniteCount: 0, //玩家总计成功点火数\r\n }\r\n }\r\n\r\n static CLICK_SET(key,value) {\r\n this.CLICK_DATA[key] = value;\r\n }\r\n\r\n static LEVEL_INFO_init() {\r\n this.LEVEL_INFO = [\r\n {\r\n \"custom\": [\r\n {\r\n \"id\": 1001,\r\n \"item\": \"danggui\",\r\n \"type\": 2,\r\n \"flammable\": 0\r\n },\r\n {\r\n \"id\": 1002,\r\n \"item\": \"cha\",\r\n \"type\": 1,\r\n \"flammable\": 0\r\n },\r\n {\r\n \"id\": 1003,\r\n \"item\": \"mudan\",\r\n \"type\": 2,\r\n \"flammable\": 0\r\n },\r\n {\r\n \"id\": 1004,\r\n \"item\": \"mulan\",\r\n \"type\": 2,\r\n \"flammable\": 0\r\n },\r\n {\r\n \"id\": 1005,\r\n \"item\": \"putao\",\r\n \"type\": 2,\r\n \"flammable\": 0\r\n },\r\n {\r\n \"id\": 1006,\r\n \"item\": \"cha\",\r\n \"type\": 1,\r\n \"flammable\": 0\r\n },\r\n {\r\n \"id\": 1007,\r\n \"item\": \"zhuye\",\r\n \"type\": 1,\r\n \"flammable\": 0\r\n },\r\n {\r\n \"id\": 1008,\r\n \"item\": \"mulan\",\r\n \"type\": 2,\r\n \"flammable\": 0\r\n },\r\n {\r\n \"id\": 1009,\r\n \"item\": \"mudan\",\r\n \"type\": 2,\r\n \"flammable\": 0\r\n },\r\n {\r\n \"id\": 1010,\r\n \"item\": \"zhuye\",\r\n \"type\": 1,\r\n \"flammable\": 0\r\n },\r\n {\r\n \"id\": 1011,\r\n \"item\": \"cha\",\r\n \"type\": 2,\r\n \"flammable\": 0\r\n },\r\n {\r\n \"id\": 1012,\r\n \"item\": \"mudan\",\r\n \"type\": 2,\r\n \"flammable\": 0\r\n },\r\n {\r\n \"id\": 1013,\r\n \"item\": \"moli\",\r\n \"type\": 1,\r\n \"flammable\": 0\r\n },\r\n {\r\n \"id\": 1014,\r\n \"item\": \"mulan\",\r\n \"type\": 2,\r\n \"flammable\": 0\r\n },\r\n {\r\n \"id\": 1015,\r\n \"item\": \"muchai\",\r\n \"type\": 1,\r\n \"flammable\": 1\r\n },\r\n {\r\n \"id\": 1016,\r\n \"item\": \"cha\",\r\n \"type\": 2,\r\n \"flammable\": 0\r\n },\r\n {\r\n \"id\": 1017,\r\n \"item\": \"renshen\",\r\n \"type\": 2,\r\n \"flammable\": 0\r\n },\r\n {\r\n \"id\": 1018,\r\n \"item\": \"jinju\",\r\n \"type\": 2,\r\n \"flammable\": 0\r\n },\r\n {\r\n \"id\": 1019,\r\n \"item\": \"lizi\",\r\n \"type\": 2,\r\n \"flammable\": 0\r\n },\r\n {\r\n \"id\": 1020,\r\n \"item\": \"gouqi\",\r\n \"type\": 1,\r\n \"flammable\": 0\r\n },\r\n {\r\n \"id\": 1021,\r\n \"item\": \"renshen\",\r\n \"type\": 1,\r\n \"flammable\": 0\r\n },\r\n {\r\n \"id\": 1022,\r\n \"item\": \"pugongying\",\r\n \"type\": 1,\r\n \"flammable\": 0\r\n },\r\n {\r\n \"id\": 1023,\r\n \"item\": \"lizhi\",\r\n \"type\": 2,\r\n \"flammable\": 0\r\n },\r\n {\r\n \"id\": 1024,\r\n \"item\": \"gancao\",\r\n \"type\": 2,\r\n \"flammable\": 0\r\n },\r\n {\r\n \"id\": 1025,\r\n \"item\": \"chixiaodou\",\r\n \"type\": 1,\r\n \"flammable\": 0\r\n },\r\n {\r\n \"id\": 1026,\r\n \"item\": \"dazao\",\r\n \"type\": 1,\r\n \"flammable\": 0\r\n },\r\n {\r\n \"id\": 1027,\r\n \"item\": \"putao\",\r\n \"type\": 2,\r\n \"flammable\": 0\r\n },\r\n {\r\n \"id\": 1028,\r\n \"item\": \"pugongying\",\r\n \"type\": 1,\r\n \"flammable\": 0\r\n },\r\n {\r\n \"id\": 1029,\r\n \"item\": \"longyan\",\r\n \"type\": 1,\r\n \"flammable\": 0\r\n },\r\n {\r\n \"id\": 1030,\r\n \"item\": \"ganjiang\",\r\n \"type\": 1,\r\n \"flammable\": 0\r\n },\r\n {\r\n \"id\": 1031,\r\n \"item\": \"gancao\",\r\n \"type\": 2,\r\n \"flammable\": 0\r\n },\r\n {\r\n \"id\": 1032,\r\n \"item\": \"dazao\",\r\n \"type\": 2,\r\n \"flammable\": 0\r\n },\r\n {\r\n \"id\": 1033,\r\n \"item\": \"lizhi\",\r\n \"type\": 1,\r\n \"flammable\": 0\r\n },\r\n {\r\n \"id\": 1034,\r\n \"item\": \"lizi\",\r\n \"type\": 2,\r\n \"flammable\": 0\r\n },\r\n {\r\n \"id\": 1035,\r\n \"item\": \"muchai\",\r\n \"type\": 2,\r\n \"flammable\": 1\r\n },\r\n {\r\n \"id\": 1036,\r\n \"item\": \"ganjiang\",\r\n \"type\": 1,\r\n \"flammable\": 0\r\n },\r\n {\r\n \"id\": 1037,\r\n \"item\": \"gancao\",\r\n \"type\": 2,\r\n \"flammable\": 0\r\n },\r\n {\r\n \"id\": 1038,\r\n \"item\": \"dazao\",\r\n \"type\": 1,\r\n \"flammable\": 0\r\n },\r\n {\r\n \"id\": 1039,\r\n \"item\": \"lizhi\",\r\n \"type\": 2,\r\n \"flammable\": 0\r\n },\r\n {\r\n \"id\": 1040,\r\n \"item\": \"renshen\",\r\n \"type\": 2,\r\n \"flammable\": 0\r\n }\r\n ]\r\n },\r\n {\r\n \"custom\": [\r\n {\r\n \"id\": 2000,\r\n \"item\": \"cha\",\r\n \"type\": 2,\r\n \"flammable\": 0\r\n },\r\n {\r\n \"id\": 2001,\r\n \"item\": \"mudan\",\r\n \"type\": 2,\r\n \"flammable\": 0\r\n },\r\n {\r\n \"id\": 2002,\r\n \"item\": \"moli\",\r\n \"type\": 1,\r\n \"flammable\": 0\r\n },\r\n {\r\n \"id\": 2003,\r\n \"item\": \"mulan\",\r\n \"type\": 2,\r\n \"flammable\": 0\r\n },\r\n {\r\n \"id\": 2004,\r\n \"item\": \"muchai\",\r\n \"type\": 1,\r\n \"flammable\": 1\r\n },\r\n {\r\n \"id\": 2005,\r\n \"item\": \"cha\",\r\n \"type\": 2,\r\n \"flammable\": 0\r\n },\r\n {\r\n \"id\": 2006,\r\n \"item\": \"renshen\",\r\n \"type\": 2,\r\n \"flammable\": 0\r\n },\r\n {\r\n \"id\": 2007,\r\n \"item\": \"jinju\",\r\n \"type\": 2,\r\n \"flammable\": 0\r\n },\r\n {\r\n \"id\": 2008,\r\n \"item\": \"lizi\",\r\n \"type\": 2,\r\n \"flammable\": 0\r\n },\r\n {\r\n \"id\": 2009,\r\n \"item\": \"gouqi\",\r\n \"type\": 1,\r\n \"flammable\": 0\r\n },\r\n {\r\n \"id\": 2010,\r\n \"item\": \"renshen\",\r\n \"type\": 1,\r\n \"flammable\": 0\r\n },\r\n {\r\n \"id\": 2011,\r\n \"item\": \"pugongying\",\r\n \"type\": 1,\r\n \"flammable\": 0\r\n },\r\n {\r\n \"id\": 2012,\r\n \"item\": \"lizhi\",\r\n \"type\": 2,\r\n \"flammable\": 0\r\n },\r\n {\r\n \"id\": 2013,\r\n \"item\": \"gancao\",\r\n \"type\": 2,\r\n \"flammable\": 0\r\n },\r\n {\r\n \"id\": 2014,\r\n \"item\": \"chixiaodou\",\r\n \"type\": 1,\r\n \"flammable\": 0\r\n },\r\n {\r\n \"id\": 2015,\r\n \"item\": \"dazao\",\r\n \"type\": 1,\r\n \"flammable\": 0\r\n },\r\n {\r\n \"id\": 2016,\r\n \"item\": \"putao\",\r\n \"type\": 2,\r\n \"flammable\": 0\r\n },\r\n {\r\n \"id\": 2017,\r\n \"item\": \"pugongying\",\r\n \"type\": 1,\r\n \"flammable\": 0\r\n },\r\n {\r\n \"id\": 2018,\r\n \"item\": \"longyan\",\r\n \"type\": 1,\r\n \"flammable\": 0\r\n },\r\n {\r\n \"id\": 2019,\r\n \"item\": \"ganjiang\",\r\n \"type\": 1,\r\n \"flammable\": 0\r\n },\r\n {\r\n \"id\": 2020,\r\n \"item\": \"gancao\",\r\n \"type\": 2,\r\n \"flammable\": 0\r\n },\r\n {\r\n \"id\": 2021,\r\n \"item\": \"dazao\",\r\n \"type\": 2,\r\n \"flammable\": 0\r\n },\r\n {\r\n \"id\": 2022,\r\n \"item\": \"lizhi\",\r\n \"type\": 1,\r\n \"flammable\": 0\r\n },\r\n {\r\n \"id\": 2023,\r\n \"item\": \"lizi\",\r\n \"type\": 2,\r\n \"flammable\": 0\r\n },\r\n {\r\n \"id\": 2024,\r\n \"item\": \"muchai\",\r\n \"type\": 2,\r\n \"flammable\": 1\r\n },\r\n {\r\n \"id\": 2025,\r\n \"item\": \"ganjiang\",\r\n \"type\": 1,\r\n \"flammable\": 0\r\n },\r\n {\r\n \"id\": 2026,\r\n \"item\": \"gancao\",\r\n \"type\": 2,\r\n \"flammable\": 0\r\n },\r\n {\r\n \"id\": 2027,\r\n \"item\": \"dazao\",\r\n \"type\": 1,\r\n \"flammable\": 0\r\n },\r\n {\r\n \"id\": 2028,\r\n \"item\": \"lizhi\",\r\n \"type\": 2,\r\n \"flammable\": 0\r\n },\r\n {\r\n \"id\": 2029,\r\n \"item\": \"renshen\",\r\n \"type\": 2,\r\n \"flammable\": 0\r\n },\r\n {\r\n \"id\": 2030,\r\n \"item\": \"danshen\",\r\n \"type\": 1,\r\n \"flammable\": 0\r\n },\r\n {\r\n \"id\": 2031,\r\n \"item\": \"danggui\",\r\n \"type\": 2,\r\n \"flammable\": 0\r\n },\r\n {\r\n \"id\": 2032,\r\n \"item\": \"cha\",\r\n \"type\": 1,\r\n \"flammable\": 0\r\n },\r\n {\r\n \"id\": 2033,\r\n \"item\": \"mudan\",\r\n \"type\": 2,\r\n \"flammable\": 0\r\n },\r\n {\r\n \"id\": 2034,\r\n \"item\": \"mulan\",\r\n \"type\": 2,\r\n \"flammable\": 0\r\n },\r\n {\r\n \"id\": 2035,\r\n \"item\": \"putao\",\r\n \"type\": 2,\r\n \"flammable\": 0\r\n },\r\n {\r\n \"id\": 2036,\r\n \"item\": \"cha\",\r\n \"type\": 1,\r\n \"flammable\": 0\r\n },\r\n {\r\n \"id\": 2037,\r\n \"item\": \"zhuye\",\r\n \"type\": 1,\r\n \"flammable\": 0\r\n },\r\n {\r\n \"id\": 2038,\r\n \"item\": \"mulan\",\r\n \"type\": 2,\r\n \"flammable\": 0\r\n },\r\n {\r\n \"id\": 2039,\r\n \"item\": \"mudan\",\r\n \"type\": 2,\r\n \"flammable\": 0\r\n },\r\n {\r\n \"id\": 2040,\r\n \"item\": \"zhuye\",\r\n \"type\": 1,\r\n \"flammable\": 0\r\n }\r\n ]\r\n },\r\n {\r\n \"custom\": [\r\n {\r\n \"id\": 3000,\r\n \"item\": \"danggui\",\r\n \"type\": 1,\r\n \"flammable\": 0\r\n },\r\n {\r\n \"id\": 3001,\r\n \"item\": \"moli\",\r\n \"type\": 1,\r\n \"flammable\": 0\r\n },\r\n {\r\n \"id\": 3002,\r\n \"item\": \"pugongying\",\r\n \"type\": 2,\r\n \"flammable\": 0\r\n },\r\n {\r\n \"id\": 3003,\r\n \"item\": \"danggui\",\r\n \"type\": 2,\r\n \"flammable\": 0\r\n },\r\n {\r\n \"id\": 3004,\r\n \"item\": \"taozi\",\r\n \"type\": 1,\r\n \"flammable\": 0\r\n },\r\n {\r\n \"id\": 3005,\r\n \"item\": \"putao\",\r\n \"type\": 2,\r\n \"flammable\": 0\r\n },\r\n {\r\n \"id\": 3006,\r\n \"item\": \"mudan\",\r\n \"type\": 2,\r\n \"flammable\": 0\r\n },\r\n {\r\n \"id\": 3007,\r\n \"item\": \"taozi\",\r\n \"type\": 1,\r\n \"flammable\": 0\r\n },\r\n {\r\n \"id\": 3008,\r\n \"item\": \"mulan\",\r\n \"type\": 2,\r\n \"flammable\": 0\r\n },\r\n {\r\n \"id\": 3009,\r\n \"item\": \"cha\",\r\n \"type\": 1,\r\n \"flammable\": 0\r\n },\r\n {\r\n \"id\": 3010,\r\n \"item\": \"mudan\",\r\n \"type\": 2,\r\n \"flammable\": 0\r\n },\r\n {\r\n \"id\": 3011,\r\n \"item\": \"longyan\",\r\n \"type\": 1,\r\n \"flammable\": 0\r\n },\r\n {\r\n \"id\": 3012,\r\n \"item\": \"ganjiang\",\r\n \"type\": 1,\r\n \"flammable\": 0\r\n },\r\n {\r\n \"id\": 3013,\r\n \"item\": \"zhuye\",\r\n \"type\": 1,\r\n \"flammable\": 0\r\n },\r\n {\r\n \"id\": 3014,\r\n \"item\": \"putao\",\r\n \"type\": 2,\r\n \"flammable\": 0\r\n },\r\n {\r\n \"id\": 3015,\r\n \"item\": \"gancao\",\r\n \"type\": 2,\r\n \"flammable\": 0\r\n },\r\n {\r\n \"id\": 3016,\r\n \"item\": \"taozi\",\r\n \"type\": 1,\r\n \"flammable\": 0\r\n },\r\n {\r\n \"id\": 3017,\r\n \"item\": \"muchai\",\r\n \"type\": 1,\r\n \"flammable\": 1\r\n },\r\n {\r\n \"id\": 3018,\r\n \"item\": \"cha\",\r\n \"type\": 2,\r\n \"flammable\": 0\r\n },\r\n {\r\n \"id\": 3019,\r\n \"item\": \"danshen\",\r\n \"type\": 2,\r\n \"flammable\": 0\r\n },\r\n {\r\n \"id\": 3020,\r\n \"item\": \"cha\",\r\n \"type\": 2,\r\n \"flammable\": 0\r\n },\r\n {\r\n \"id\": 3021,\r\n \"item\": \"zhuye\",\r\n \"type\": 1,\r\n \"flammable\": 0\r\n },\r\n {\r\n \"id\": 3022,\r\n \"item\": \"renshen\",\r\n \"type\": 1,\r\n \"flammable\": 0\r\n },\r\n {\r\n \"id\": 3023,\r\n \"item\": \"taozi\",\r\n \"type\": 2,\r\n \"flammable\": 0\r\n },\r\n {\r\n \"id\": 3024,\r\n \"item\": \"putao\",\r\n \"type\": 1,\r\n \"flammable\": 0\r\n },\r\n {\r\n \"id\": 3025,\r\n \"item\": \"gouqi\",\r\n \"type\": 2,\r\n \"flammable\": 0\r\n },\r\n {\r\n \"id\": 3026,\r\n \"item\": \"chixiaodou\",\r\n \"type\": 1,\r\n \"flammable\": 0\r\n },\r\n {\r\n \"id\": 3027,\r\n \"item\": \"muchai\",\r\n \"type\": 1,\r\n \"flammable\": 1\r\n },\r\n {\r\n \"id\": 3028,\r\n \"item\": \"jinju\",\r\n \"type\": 1,\r\n \"flammable\": 0\r\n },\r\n {\r\n \"id\": 3029,\r\n \"item\": \"cha\",\r\n \"type\": 2,\r\n \"flammable\": 0\r\n },\r\n {\r\n \"id\": 3030,\r\n \"item\": \"renshen\",\r\n \"type\": 2,\r\n \"flammable\": 0\r\n },\r\n {\r\n \"id\": 3031,\r\n \"item\": \"baishao\",\r\n \"type\": 1,\r\n \"flammable\": 0\r\n },\r\n {\r\n \"id\": 3032,\r\n \"item\": \"danshen\",\r\n \"type\": 1,\r\n \"flammable\": 0\r\n },\r\n {\r\n \"id\": 3033,\r\n \"item\": \"jingjie\",\r\n \"type\": 2,\r\n \"flammable\": 0\r\n },\r\n {\r\n \"id\": 3034,\r\n \"item\": \"zhuye\",\r\n \"type\": 1,\r\n \"flammable\": 0\r\n },\r\n {\r\n \"id\": 3035,\r\n \"item\": \"cha\",\r\n \"type\": 1,\r\n \"flammable\": 0\r\n },\r\n {\r\n \"id\": 3036,\r\n \"item\": \"gouqi\",\r\n \"type\": 1,\r\n \"flammable\": 0\r\n },\r\n {\r\n \"id\": 3037,\r\n \"item\": \"ganjiang\",\r\n \"type\": 1,\r\n \"flammable\": 0\r\n },\r\n {\r\n \"id\": 3038,\r\n \"item\": \"cha\",\r\n \"type\": 1,\r\n \"flammable\": 0\r\n },\r\n {\r\n \"id\": 3039,\r\n \"item\": \"jingjie\",\r\n \"type\": 2,\r\n \"flammable\": 0\r\n },\r\n {\r\n \"id\": 3040,\r\n \"item\": \"mudan\",\r\n \"type\": 2,\r\n \"flammable\": 0\r\n }\r\n ]\r\n },\r\n {\r\n \"custom\": [\r\n {\r\n \"id\": 4000,\r\n \"item\": \"baishao\",\r\n \"type\": 1,\r\n \"flammable\": 0\r\n },\r\n {\r\n \"id\": 4001,\r\n \"item\": \"cha\",\r\n \"type\": 1,\r\n \"flammable\": 0\r\n },\r\n {\r\n \"id\": 4002,\r\n \"item\": \"putao\",\r\n \"type\": 2,\r\n \"flammable\": 0\r\n },\r\n {\r\n \"id\": 4003,\r\n \"item\": \"jinju\",\r\n \"type\": 2,\r\n \"flammable\": 0\r\n },\r\n {\r\n \"id\": 4004,\r\n \"item\": \"dazao\",\r\n \"type\": 1,\r\n \"flammable\": 0\r\n },\r\n {\r\n \"id\": 4005,\r\n \"item\": \"cha\",\r\n \"type\": 1,\r\n \"flammable\": 0\r\n },\r\n {\r\n \"id\": 4006,\r\n \"item\": \"baishao\",\r\n \"type\": 2,\r\n \"flammable\": 0\r\n },\r\n {\r\n \"id\": 4007,\r\n \"item\": \"ganjiang\",\r\n \"type\": 2,\r\n \"flammable\": 0\r\n },\r\n {\r\n \"id\": 4008,\r\n \"item\": \"taozi\",\r\n \"type\": 2,\r\n \"flammable\": 0\r\n },\r\n {\r\n \"id\": 4009,\r\n \"item\": \"dazao\",\r\n \"type\": 2,\r\n \"flammable\": 0\r\n },\r\n {\r\n \"id\": 4010,\r\n \"item\": \"moli\",\r\n \"type\": 1,\r\n \"flammable\": 0\r\n },\r\n {\r\n \"id\": 4011,\r\n \"item\": \"mudan\",\r\n \"type\": 2,\r\n \"flammable\": 0\r\n },\r\n {\r\n \"id\": 4012,\r\n \"item\": \"zhuye\",\r\n \"type\": 2,\r\n \"flammable\": 0\r\n },\r\n {\r\n \"id\": 4013,\r\n \"item\": \"muchai\",\r\n \"type\": 1,\r\n \"flammable\": 1\r\n },\r\n {\r\n \"id\": 4014,\r\n \"item\": \"gouqi\",\r\n \"type\": 1,\r\n \"flammable\": 0\r\n },\r\n {\r\n \"id\": 4015,\r\n \"item\": \"dazao\",\r\n \"type\": 2,\r\n \"flammable\": 0\r\n },\r\n {\r\n \"id\": 4016,\r\n \"item\": \"danggui\",\r\n \"type\": 1,\r\n \"flammable\": 0\r\n },\r\n {\r\n \"id\": 4017,\r\n \"item\": \"chixiaodou\",\r\n \"type\": 1,\r\n \"flammable\": 0\r\n },\r\n {\r\n \"id\": 4018,\r\n \"item\": \"baishao\",\r\n \"type\": 1,\r\n \"flammable\": 0\r\n },\r\n {\r\n \"id\": 4019,\r\n \"item\": \"jingjie\",\r\n \"type\": 2,\r\n \"flammable\": 0\r\n },\r\n {\r\n \"id\": 4020,\r\n \"item\": \"jinju\",\r\n \"type\": 2,\r\n \"flammable\": 0\r\n },\r\n {\r\n \"id\": 4021,\r\n \"item\": \"gouqi\",\r\n \"type\": 1,\r\n \"flammable\": 0\r\n },\r\n {\r\n \"id\": 4022,\r\n \"item\": \"pugongying\",\r\n \"type\": 2,\r\n \"flammable\": 0\r\n },\r\n {\r\n \"id\": 4023,\r\n \"item\": \"cha\",\r\n \"type\": 2,\r\n \"flammable\": 0\r\n },\r\n {\r\n \"id\": 4024,\r\n \"item\": \"moli\",\r\n \"type\": 2,\r\n \"flammable\": 0\r\n },\r\n {\r\n \"id\": 4025,\r\n \"item\": \"gancao\",\r\n \"type\": 2,\r\n \"flammable\": 0\r\n },\r\n {\r\n \"id\": 4026,\r\n \"item\": \"dazao\",\r\n \"type\": 2,\r\n \"flammable\": 0\r\n },\r\n {\r\n \"id\": 4027,\r\n \"item\": \"gouqi\",\r\n \"type\": 2,\r\n \"flammable\": 0\r\n },\r\n {\r\n \"id\": 4028,\r\n \"item\": \"jingjie\",\r\n \"type\": 2,\r\n \"flammable\": 0\r\n },\r\n {\r\n \"id\": 4029,\r\n \"item\": \"zhuye\",\r\n \"type\": 1,\r\n \"flammable\": 0\r\n },\r\n {\r\n \"id\": 4030,\r\n \"item\": \"pugongying\",\r\n \"type\": 1,\r\n \"flammable\": 0\r\n },\r\n {\r\n \"id\": 4031,\r\n \"item\": \"renshen\",\r\n \"type\": 1,\r\n \"flammable\": 0\r\n },\r\n {\r\n \"id\": 4032,\r\n \"item\": \"cha\",\r\n \"type\": 2,\r\n \"flammable\": 0\r\n },\r\n {\r\n \"id\": 4033,\r\n \"item\": \"zhuye\",\r\n \"type\": 1,\r\n \"flammable\": 0\r\n },\r\n {\r\n \"id\": 4034,\r\n \"item\": \"muchai\",\r\n \"type\": 2,\r\n \"flammable\": 1\r\n },\r\n {\r\n \"id\": 4035,\r\n \"item\": \"longyan\",\r\n \"type\": 1,\r\n \"flammable\": 0\r\n },\r\n {\r\n \"id\": 4036,\r\n \"item\": \"ganjiang\",\r\n \"type\": 2,\r\n \"flammable\": 0\r\n },\r\n {\r\n \"id\": 4037,\r\n \"item\": \"moli\",\r\n \"type\": 1,\r\n \"flammable\": 0\r\n },\r\n {\r\n \"id\": 4038,\r\n \"item\": \"lizhi\",\r\n \"type\": 1,\r\n \"flammable\": 0\r\n },\r\n {\r\n \"id\": 4039,\r\n \"item\": \"pugongying\",\r\n \"type\": 2,\r\n \"flammable\": 0\r\n },\r\n {\r\n \"id\": 4040,\r\n \"item\": \"cha\",\r\n \"type\": 1,\r\n \"flammable\": 0\r\n }\r\n ]\r\n },\r\n {\r\n \"custom\": [\r\n {\r\n \"id\": 5000,\r\n \"item\": \"lizhi\",\r\n \"type\": 1,\r\n \"flammable\": 0\r\n },\r\n {\r\n \"id\": 5001,\r\n \"item\": \"pugongying\",\r\n \"type\": 2,\r\n \"flammable\": 0\r\n },\r\n {\r\n \"id\": 5002,\r\n \"item\": \"putao\",\r\n \"type\": 2,\r\n \"flammable\": 0\r\n },\r\n {\r\n \"id\": 5003,\r\n \"item\": \"cha\",\r\n \"type\": 1,\r\n \"flammable\": 0\r\n },\r\n {\r\n \"id\": 5004,\r\n \"item\": \"longyan\",\r\n \"type\": 2,\r\n \"flammable\": 0\r\n },\r\n {\r\n \"id\": 5005,\r\n \"item\": \"lizi\",\r\n \"type\": 2,\r\n \"flammable\": 0\r\n },\r\n {\r\n \"id\": 5006,\r\n \"item\": \"moli\",\r\n \"type\": 1,\r\n \"flammable\": 0\r\n },\r\n {\r\n \"id\": 5007,\r\n \"item\": \"gancao\",\r\n \"type\": 2,\r\n \"flammable\": 0\r\n },\r\n {\r\n \"id\": 5008,\r\n \"item\": \"mulan\",\r\n \"type\": 2,\r\n \"flammable\": 0\r\n },\r\n {\r\n \"id\": 5009,\r\n \"item\": \"zhuye\",\r\n \"type\": 1,\r\n \"flammable\": 0\r\n },\r\n {\r\n \"id\": 5010,\r\n \"item\": \"cha\",\r\n \"type\": 2,\r\n \"flammable\": 0\r\n },\r\n {\r\n \"id\": 5011,\r\n \"item\": \"lizhi\",\r\n \"type\": 1,\r\n \"flammable\": 0\r\n },\r\n {\r\n \"id\": 5012,\r\n \"item\": \"gouqi\",\r\n \"type\": 2,\r\n \"flammable\": 0\r\n },\r\n {\r\n \"id\": 5013,\r\n \"item\": \"renshen\",\r\n \"type\": 1,\r\n \"flammable\": 0\r\n },\r\n {\r\n \"id\": 5014,\r\n \"item\": \"chixiaodou\",\r\n \"type\": 1,\r\n \"flammable\": 0\r\n },\r\n {\r\n \"id\": 5015,\r\n \"item\": \"dazao\",\r\n \"type\": 2,\r\n \"flammable\": 0\r\n },\r\n {\r\n \"id\": 5016,\r\n \"item\": \"muchai\",\r\n \"type\": 2,\r\n \"flammable\": 1\r\n },\r\n {\r\n \"id\": 5017,\r\n \"item\": \"mulan\",\r\n \"type\": 2,\r\n \"flammable\": 0\r\n },\r\n {\r\n \"id\": 5018,\r\n \"item\": \"longyan\",\r\n \"type\": 1,\r\n \"flammable\": 0\r\n },\r\n {\r\n \"id\": 5019,\r\n \"item\": \"cha\",\r\n \"type\": 1,\r\n \"flammable\": 0\r\n },\r\n {\r\n \"id\": 5020,\r\n \"item\": \"lizi\",\r\n \"type\": 2,\r\n \"flammable\": 0\r\n },\r\n {\r\n \"id\": 5021,\r\n \"item\": \"baishao\",\r\n \"type\": 2,\r\n \"flammable\": 0\r\n },\r\n {\r\n \"id\": 5022,\r\n \"item\": \"danggui\",\r\n \"type\": 2,\r\n \"flammable\": 0\r\n },\r\n {\r\n \"id\": 5023,\r\n \"item\": \"renshen\",\r\n \"type\": 1,\r\n \"flammable\": 0\r\n },\r\n {\r\n \"id\": 5024,\r\n \"item\": \"chixiaodou\",\r\n \"type\": 2,\r\n \"flammable\": 0\r\n },\r\n {\r\n \"id\": 5025,\r\n \"item\": \"dazao\",\r\n \"type\": 1,\r\n \"flammable\": 0\r\n },\r\n {\r\n \"id\": 5026,\r\n \"item\": \"longyan\",\r\n \"type\": 1,\r\n \"flammable\": 0\r\n },\r\n {\r\n \"id\": 5027,\r\n \"item\": \"cha\",\r\n \"type\": 2,\r\n \"flammable\": 0\r\n },\r\n {\r\n \"id\": 5028,\r\n \"item\": \"danshen\",\r\n \"type\": 2,\r\n \"flammable\": 0\r\n },\r\n {\r\n \"id\": 5029,\r\n \"item\": \"renshen\",\r\n \"type\": 1,\r\n \"flammable\": 0\r\n },\r\n {\r\n \"id\": 5030,\r\n \"item\": \"baishao\",\r\n \"type\": 2,\r\n \"flammable\": 0\r\n },\r\n {\r\n \"id\": 5031,\r\n \"item\": \"muchai\",\r\n \"type\": 2,\r\n \"flammable\": 1\r\n },\r\n {\r\n \"id\": 5032,\r\n \"item\": \"jinju\",\r\n \"type\": 2,\r\n \"flammable\": 0\r\n },\r\n {\r\n \"id\": 5033,\r\n \"item\": \"lizi\",\r\n \"type\": 2,\r\n \"flammable\": 0\r\n },\r\n {\r\n \"id\": 5034,\r\n \"item\": \"cha\",\r\n \"type\": 1,\r\n \"flammable\": 0\r\n },\r\n {\r\n \"id\": 5035,\r\n \"item\": \"pugongying\",\r\n \"type\": 1,\r\n \"flammable\": 0\r\n },\r\n {\r\n \"id\": 5036,\r\n \"item\": \"danshen\",\r\n \"type\": 1,\r\n \"flammable\": 0\r\n },\r\n {\r\n \"id\": 5037,\r\n \"item\": \"gouqi\",\r\n \"type\": 1,\r\n \"flammable\": 0\r\n },\r\n {\r\n \"id\": 5038,\r\n \"item\": \"renshen\",\r\n \"type\": 1,\r\n \"flammable\": 0\r\n },\r\n {\r\n \"id\": 5039,\r\n \"item\": \"jingjie\",\r\n \"type\": 2,\r\n \"flammable\": 0\r\n },\r\n {\r\n \"id\": 5040,\r\n \"item\": \"cha\",\r\n \"type\": 2,\r\n \"flammable\": 0\r\n }\r\n ]\r\n },\r\n {\r\n \"custom\": [\r\n {\r\n \"id\": 6000,\r\n \"item\": \"cha\",\r\n \"type\": 1,\r\n \"flammable\": 0\r\n },\r\n {\r\n \"id\": 6001,\r\n \"item\": \"lizhi\",\r\n \"type\": 1,\r\n \"flammable\": 0\r\n },\r\n {\r\n \"id\": 6002,\r\n \"item\": \"gouqi\",\r\n \"type\": 2,\r\n \"flammable\": 0\r\n },\r\n {\r\n \"id\": 6003,\r\n \"item\": \"renshen\",\r\n \"type\": 2,\r\n \"flammable\": 0\r\n },\r\n {\r\n \"id\": 6004,\r\n \"item\": \"dazao\",\r\n \"type\": 1,\r\n \"flammable\": 0\r\n },\r\n {\r\n \"id\": 6005,\r\n \"item\": \"chixiaodou\",\r\n \"type\": 1,\r\n \"flammable\": 0\r\n },\r\n {\r\n \"id\": 6006,\r\n \"item\": \"dazao\",\r\n \"type\": 2,\r\n \"flammable\": 0\r\n },\r\n {\r\n \"id\": 6007,\r\n \"item\": \"longyan\",\r\n \"type\": 1,\r\n \"flammable\": 0\r\n },\r\n {\r\n \"id\": 6008,\r\n \"item\": \"cha\",\r\n \"type\": 1,\r\n \"flammable\": 0\r\n },\r\n {\r\n \"id\": 6009,\r\n \"item\": \"danshen\",\r\n \"type\": 2,\r\n \"flammable\": 0\r\n },\r\n {\r\n \"id\": 6010,\r\n \"item\": \"renshen\",\r\n \"type\": 1,\r\n \"flammable\": 0\r\n },\r\n {\r\n \"id\": 6011,\r\n \"item\": \"baishao\",\r\n \"type\": 2,\r\n \"flammable\": 0\r\n },\r\n {\r\n \"id\": 6012,\r\n \"item\": \"muchai\",\r\n \"type\": 1,\r\n \"flammable\": 1\r\n },\r\n {\r\n \"id\": 6013,\r\n \"item\": \"jinju\",\r\n \"type\": 1,\r\n \"flammable\": 0\r\n },\r\n {\r\n \"id\": 6014,\r\n \"item\": \"gancao\",\r\n \"type\": 2,\r\n \"flammable\": 0\r\n },\r\n {\r\n \"id\": 6015,\r\n \"item\": \"lizi\",\r\n \"type\": 2,\r\n \"flammable\": 0\r\n },\r\n {\r\n \"id\": 6016,\r\n \"item\": \"moli\",\r\n \"type\": 1,\r\n \"flammable\": 0\r\n },\r\n {\r\n \"id\": 6017,\r\n \"item\": \"gancao\",\r\n \"type\": 2,\r\n \"flammable\": 0\r\n },\r\n {\r\n \"id\": 6018,\r\n \"item\": \"mulan\",\r\n \"type\": 2,\r\n \"flammable\": 0\r\n },\r\n {\r\n \"id\": 6019,\r\n \"item\": \"zhuye\",\r\n \"type\": 1,\r\n \"flammable\": 0\r\n },\r\n {\r\n \"id\": 6020,\r\n \"item\": \"cha\",\r\n \"type\": 2,\r\n \"flammable\": 0\r\n },\r\n {\r\n \"id\": 6021,\r\n \"item\": \"lizhi\",\r\n \"type\": 1,\r\n \"flammable\": 0\r\n },\r\n {\r\n \"id\": 6022,\r\n \"item\": \"gouqi\",\r\n \"type\": 2,\r\n \"flammable\": 0\r\n },\r\n {\r\n \"id\": 6023,\r\n \"item\": \"renshen\",\r\n \"type\": 1,\r\n \"flammable\": 0\r\n },\r\n {\r\n \"id\": 6024,\r\n \"item\": \"cha\",\r\n \"type\": 1,\r\n \"flammable\": 0\r\n },\r\n {\r\n \"id\": 6025,\r\n \"item\": \"jinjie\",\r\n \"type\": 2,\r\n \"flammable\": 0\r\n },\r\n {\r\n \"id\": 6026,\r\n \"item\": \"mudan\",\r\n \"type\": 2,\r\n \"flammable\": 0\r\n },\r\n {\r\n \"id\": 6027,\r\n \"item\": \"lizi\",\r\n \"type\": 2,\r\n \"flammable\": 0\r\n },\r\n {\r\n \"id\": 6028,\r\n \"item\": \"zhuye\",\r\n \"type\": 1,\r\n \"flammable\": 0\r\n },\r\n {\r\n \"id\": 6029,\r\n \"item\": \"jinju\",\r\n \"type\": 2,\r\n \"flammable\": 0\r\n },\r\n {\r\n \"id\": 6030,\r\n \"item\": \"muchai\",\r\n \"type\": 2,\r\n \"flammable\": 1\r\n },\r\n {\r\n \"id\": 6031,\r\n \"item\": \"baishao\",\r\n \"type\": 1,\r\n \"flammable\": 0\r\n },\r\n {\r\n \"id\": 6032,\r\n \"item\": \"chixiaodou\",\r\n \"type\": 1,\r\n \"flammable\": 0\r\n },\r\n {\r\n \"id\": 6033,\r\n \"item\": \"moli\",\r\n \"type\": 1,\r\n \"flammable\": 0\r\n },\r\n {\r\n \"id\": 6034,\r\n \"item\": \"danshen\",\r\n \"type\": 2,\r\n \"flammable\": 0\r\n },\r\n {\r\n \"id\": 6035,\r\n \"item\": \"gouqi\",\r\n \"type\": 1,\r\n \"flammable\": 0\r\n },\r\n {\r\n \"id\": 6036,\r\n \"item\": \"zhuye\",\r\n \"type\": 2,\r\n \"flammable\": 0\r\n },\r\n {\r\n \"id\": 6037,\r\n \"item\": \"taozi\",\r\n \"type\": 1,\r\n \"flammable\": 0\r\n },\r\n {\r\n \"id\": 6038,\r\n \"item\": \"putao\",\r\n \"type\": 1,\r\n \"flammable\": 0\r\n },\r\n {\r\n \"id\": 6039,\r\n \"item\": \"longyan\",\r\n \"type\": 1,\r\n \"flammable\": 0\r\n },\r\n {\r\n \"id\": 6040,\r\n \"item\": \"cha\",\r\n \"type\": 2,\r\n \"flammable\": 0\r\n }\r\n ]\r\n },\r\n {\r\n \"custom\": [\r\n {\r\n \"id\": 7000,\r\n \"item\": \"chixiaodou\",\r\n \"type\": 1,\r\n \"flammable\": 0\r\n },\r\n {\r\n \"id\": 7001,\r\n \"item\": \"moli\",\r\n \"type\": 1,\r\n \"flammable\": 0\r\n },\r\n {\r\n \"id\": 7002,\r\n \"item\": \"danshen\",\r\n \"type\": 2,\r\n \"flammable\": 0\r\n },\r\n {\r\n \"id\": 7003,\r\n \"item\": \"gouqi\",\r\n \"type\": 1,\r\n \"flammable\": 0\r\n },\r\n {\r\n \"id\": 7004,\r\n \"item\": \"zhuye\",\r\n \"type\": 2,\r\n \"flammable\": 0\r\n },\r\n {\r\n \"id\": 7005,\r\n \"item\": \"taozi\",\r\n \"type\": 1,\r\n \"flammable\": 0\r\n },\r\n {\r\n \"id\": 7006,\r\n \"item\": \"putao\",\r\n \"type\": 1,\r\n \"flammable\": 0\r\n },\r\n {\r\n \"id\": 7007,\r\n \"item\": \"longyan\",\r\n \"type\": 1,\r\n \"flammable\": 0\r\n },\r\n {\r\n \"id\": 7008,\r\n \"item\": \"cha\",\r\n \"type\": 2,\r\n \"flammable\": 0\r\n },\r\n {\r\n \"id\": 7009,\r\n \"item\": \"putao\",\r\n \"type\": 1,\r\n \"flammable\": 0\r\n },\r\n {\r\n \"id\": 7010,\r\n \"item\": \"cha\",\r\n \"type\": 2,\r\n \"flammable\": 0\r\n },\r\n {\r\n \"id\": 7011,\r\n \"item\": \"mudan\",\r\n \"type\": 2,\r\n \"flammable\": 0\r\n },\r\n {\r\n \"id\": 7012,\r\n \"item\": \"lizi\",\r\n \"type\": 2,\r\n \"flammable\": 0\r\n },\r\n {\r\n \"id\": 7013,\r\n \"item\": \"zhuye\",\r\n \"type\": 1,\r\n \"flammable\": 0\r\n },\r\n {\r\n \"id\": 7014,\r\n \"item\": \"jinju\",\r\n \"type\": 2,\r\n \"flammable\": 0\r\n },\r\n {\r\n \"id\": 7015,\r\n \"item\": \"muchai\",\r\n \"type\": 2,\r\n \"flammable\": 1\r\n },\r\n {\r\n \"id\": 7016,\r\n \"item\": \"baishao\",\r\n \"type\": 1,\r\n \"flammable\": 0\r\n },\r\n {\r\n \"id\": 7017,\r\n \"item\": \"chixiaodou\",\r\n \"type\": 1,\r\n \"flammable\": 0\r\n },\r\n {\r\n \"id\": 7018,\r\n \"item\": \"moli\",\r\n \"type\": 1,\r\n \"flammable\": 0\r\n },\r\n {\r\n \"id\": 7019,\r\n \"item\": \"pugongying\",\r\n \"type\": 2,\r\n \"flammable\": 0\r\n },\r\n {\r\n \"id\": 7020,\r\n \"item\": \"cha\",\r\n \"type\": 1,\r\n \"flammable\": 0\r\n },\r\n {\r\n \"id\": 7021,\r\n \"item\": \"lizhi\",\r\n \"type\": 1,\r\n \"flammable\": 0\r\n },\r\n {\r\n \"id\": 7022,\r\n \"item\": \"gouqi\",\r\n \"type\": 2,\r\n \"flammable\": 0\r\n },\r\n {\r\n \"id\": 7023,\r\n \"item\": \"renshen\",\r\n \"type\": 2,\r\n \"flammable\": 0\r\n },\r\n {\r\n \"id\": 7024,\r\n \"item\": \"dazao\",\r\n \"type\": 1,\r\n \"flammable\": 0\r\n },\r\n {\r\n \"id\": 7025,\r\n \"item\": \"chixiaodou\",\r\n \"type\": 1,\r\n \"flammable\": 0\r\n },\r\n {\r\n \"id\": 7026,\r\n \"item\": \"dazao\",\r\n \"type\": 2,\r\n \"flammable\": 0\r\n },\r\n {\r\n \"id\": 7027,\r\n \"item\": \"longyan\",\r\n \"type\": 1,\r\n \"flammable\": 0\r\n },\r\n {\r\n \"id\": 7028,\r\n \"item\": \"cha\",\r\n \"type\": 1,\r\n \"flammable\": 0\r\n },\r\n {\r\n \"id\": 7029,\r\n \"item\": \"danshen\",\r\n \"type\": 2,\r\n \"flammable\": 0\r\n },\r\n {\r\n \"id\": 7030,\r\n \"item\": \"baishao\",\r\n \"type\": 2,\r\n \"flammable\": 0\r\n },\r\n {\r\n \"id\": 7031,\r\n \"item\": \"ganjiang\",\r\n \"type\": 2,\r\n \"flammable\": 0\r\n },\r\n {\r\n \"id\": 7032,\r\n \"item\": \"taozi\",\r\n \"type\": 2,\r\n \"flammable\": 0\r\n },\r\n {\r\n \"id\": 7033,\r\n \"item\": \"dazao\",\r\n \"type\": 2,\r\n \"flammable\": 0\r\n },\r\n {\r\n \"id\": 7034,\r\n \"item\": \"moli\",\r\n \"type\": 1,\r\n \"flammable\": 0\r\n },\r\n {\r\n \"id\": 7035,\r\n \"item\": \"mudan\",\r\n \"type\": 2,\r\n \"flammable\": 0\r\n },\r\n {\r\n \"id\": 7036,\r\n \"item\": \"zhuye\",\r\n \"type\": 2,\r\n \"flammable\": 0\r\n },\r\n {\r\n \"id\": 7037,\r\n \"item\": \"muchai\",\r\n \"type\": 1,\r\n \"flammable\": 1\r\n },\r\n {\r\n \"id\": 7038,\r\n \"item\": \"jingjie\",\r\n \"type\": 2,\r\n \"flammable\": 0\r\n },\r\n {\r\n \"id\": 7039,\r\n \"item\": \"lizi\",\r\n \"type\": 2,\r\n \"flammable\": 0\r\n },\r\n {\r\n \"id\": 7040,\r\n \"item\": \"cha\",\r\n \"type\": 1,\r\n \"flammable\": 0\r\n }\r\n ]\r\n },\r\n {\r\n \"custom\": [\r\n {\r\n \"id\": 8000,\r\n \"item\": \"chixiaodou\",\r\n \"type\": 2,\r\n \"flammable\": 0\r\n },\r\n {\r\n \"id\": 8001,\r\n \"item\": \"moli\",\r\n \"type\": 2,\r\n \"flammable\": 0\r\n },\r\n {\r\n \"id\": 8002,\r\n \"item\": \"danshen\",\r\n \"type\": 2,\r\n \"flammable\": 0\r\n },\r\n {\r\n \"id\": 8003,\r\n \"item\": \"gouqi\",\r\n \"type\": 2,\r\n \"flammable\": 0\r\n },\r\n {\r\n \"id\": 8004,\r\n \"item\": \"zhuye\",\r\n \"type\": 2,\r\n \"flammable\": 0\r\n },\r\n {\r\n \"id\": 8005,\r\n \"item\": \"taozi\",\r\n \"type\": 1,\r\n \"flammable\": 0\r\n },\r\n {\r\n \"id\": 8006,\r\n \"item\": \"putao\",\r\n \"type\": 2,\r\n \"flammable\": 0\r\n },\r\n {\r\n \"id\": 8007,\r\n \"item\": \"longyan\",\r\n \"type\": 2,\r\n \"flammable\": 0\r\n },\r\n {\r\n \"id\": 8008,\r\n \"item\": \"cha\",\r\n \"type\": 1,\r\n \"flammable\": 0\r\n },\r\n {\r\n \"id\": 8009,\r\n \"item\": \"putao\",\r\n \"type\": 2,\r\n \"flammable\": 0\r\n },\r\n {\r\n \"id\": 8010,\r\n \"item\": \"renshen\",\r\n \"type\": 2,\r\n \"flammable\": 0\r\n },\r\n {\r\n \"id\": 8011,\r\n \"item\": \"baishao\",\r\n \"type\": 1,\r\n \"flammable\": 0\r\n },\r\n {\r\n \"id\": 8012,\r\n \"item\": \"muchai\",\r\n \"type\": 1,\r\n \"flammable\": 1\r\n },\r\n {\r\n \"id\": 8013,\r\n \"item\": \"jinju\",\r\n \"type\": 1,\r\n \"flammable\": 0\r\n },\r\n {\r\n \"id\": 8014,\r\n \"item\": \"gancao\",\r\n \"type\": 2,\r\n \"flammable\": 0\r\n },\r\n {\r\n \"id\": 8015,\r\n \"item\": \"lizi\",\r\n \"type\": 2,\r\n \"flammable\": 0\r\n },\r\n {\r\n \"id\": 8016,\r\n \"item\": \"moli\",\r\n \"type\": 1,\r\n \"flammable\": 0\r\n },\r\n {\r\n \"id\": 8017,\r\n \"item\": \"gancao\",\r\n \"type\": 2,\r\n \"flammable\": 0\r\n },\r\n {\r\n \"id\": 8018,\r\n \"item\": \"mulan\",\r\n \"type\": 2,\r\n \"flammable\": 0\r\n },\r\n {\r\n \"id\": 8019,\r\n \"item\": \"zhuye\",\r\n \"type\": 1,\r\n \"flammable\": 0\r\n },\r\n {\r\n \"id\": 8020,\r\n \"item\": \"pugongying\",\r\n \"type\": 2,\r\n \"flammable\": 0\r\n },\r\n {\r\n \"id\": 8021,\r\n \"item\": \"cha\",\r\n \"type\": 1,\r\n \"flammable\": 0\r\n },\r\n {\r\n \"id\": 8022,\r\n \"item\": \"moli\",\r\n \"type\": 1,\r\n \"flammable\": 0\r\n },\r\n {\r\n \"id\": 8023,\r\n \"item\": \"gancao\",\r\n \"type\": 2,\r\n \"flammable\": 0\r\n },\r\n {\r\n \"id\": 8024,\r\n \"item\": \"dazao\",\r\n \"type\": 1,\r\n \"flammable\": 0\r\n },\r\n {\r\n \"id\": 8025,\r\n \"item\": \"gouqi\",\r\n \"type\": 2,\r\n \"flammable\": 0\r\n },\r\n {\r\n \"id\": 8026,\r\n \"item\": \"jingjie\",\r\n \"type\": 2,\r\n \"flammable\": 0\r\n },\r\n {\r\n \"id\": 8027,\r\n \"item\": \"zhuye\",\r\n \"type\": 1,\r\n \"flammable\": 0\r\n },\r\n {\r\n \"id\": 8028,\r\n \"item\": \"pugongying\",\r\n \"type\": 2,\r\n \"flammable\": 0\r\n },\r\n {\r\n \"id\": 8029,\r\n \"item\": \"renshen\",\r\n \"type\": 1,\r\n \"flammable\": 0\r\n },\r\n {\r\n \"id\": 8030,\r\n \"item\": \"cha\",\r\n \"type\": 1,\r\n \"flammable\": 0\r\n },\r\n {\r\n \"id\": 8031,\r\n \"item\": \"taozi\",\r\n \"type\": 1,\r\n \"flammable\": 0\r\n },\r\n {\r\n \"id\": 8032,\r\n \"item\": \"putao\",\r\n \"type\": 2,\r\n \"flammable\": 0\r\n },\r\n {\r\n \"id\": 8033,\r\n \"item\": \"dazao\",\r\n \"type\": 2,\r\n \"flammable\": 0\r\n },\r\n {\r\n \"id\": 8034,\r\n \"item\": \"muchai\",\r\n \"type\": 1,\r\n \"flammable\": 1\r\n },\r\n {\r\n \"id\": 8035,\r\n \"item\": \"moli\",\r\n \"type\": 2,\r\n \"flammable\": 0\r\n },\r\n {\r\n \"id\": 8036,\r\n \"item\": \"pugongying\",\r\n \"type\": 1,\r\n \"flammable\": 0\r\n },\r\n {\r\n \"id\": 8037,\r\n \"item\": \"cha\",\r\n \"type\": 2,\r\n \"flammable\": 0\r\n },\r\n {\r\n \"id\": 8038,\r\n \"item\": \"lizhi\",\r\n \"type\": 1,\r\n \"flammable\": 0\r\n },\r\n {\r\n \"id\": 8039,\r\n \"item\": \"mulan\",\r\n \"type\": 2,\r\n \"flammable\": 0\r\n },\r\n {\r\n \"id\": 8040,\r\n \"item\": \"gancao\",\r\n \"type\": 2,\r\n \"flammable\": 0\r\n }\r\n ]\r\n },\r\n {\r\n \"custom\": [\r\n {\r\n \"id\": 9000,\r\n \"item\": \"cha\",\r\n \"type\": 1,\r\n \"flammable\": 0\r\n },\r\n {\r\n \"id\": 9001,\r\n \"item\": \"taozi\",\r\n \"type\": 1,\r\n \"flammable\": 0\r\n },\r\n {\r\n \"id\": 9002,\r\n \"item\": \"putao\",\r\n \"type\": 2,\r\n \"flammable\": 0\r\n },\r\n {\r\n \"id\": 9003,\r\n \"item\": \"dazao\",\r\n \"type\": 2,\r\n \"flammable\": 0\r\n },\r\n {\r\n \"id\": 9004,\r\n \"item\": \"danshen\",\r\n \"type\": 1,\r\n \"flammable\": 0\r\n },\r\n {\r\n \"id\": 9005,\r\n \"item\": \"moli\",\r\n \"type\": 2,\r\n \"flammable\": 0\r\n },\r\n {\r\n \"id\": 9006,\r\n \"item\": \"pugongying\",\r\n \"type\": 1,\r\n \"flammable\": 0\r\n },\r\n {\r\n \"id\": 9007,\r\n \"item\": \"cha\",\r\n \"type\": 2,\r\n \"flammable\": 0\r\n },\r\n {\r\n \"id\": 9008,\r\n \"item\": \"lizhi\",\r\n \"type\": 1,\r\n \"flammable\": 0\r\n },\r\n {\r\n \"id\": 9009,\r\n \"item\": \"mulan\",\r\n \"type\": 2,\r\n \"flammable\": 0\r\n },\r\n {\r\n \"id\": 9010,\r\n \"item\": \"gancao\",\r\n \"type\": 2,\r\n \"flammable\": 0\r\n },\r\n {\r\n \"id\": 9011,\r\n \"item\": \"renshen\",\r\n \"type\": 1,\r\n \"flammable\": 0\r\n },\r\n {\r\n \"id\": 9012,\r\n \"item\": \"danggui\",\r\n \"type\": 2,\r\n \"flammable\": 0\r\n },\r\n {\r\n \"id\": 9013,\r\n \"item\": \"mulan\",\r\n \"type\": 2,\r\n \"flammable\": 0\r\n },\r\n {\r\n \"id\": 9014,\r\n \"item\": \"moli\",\r\n \"type\": 1,\r\n \"flammable\": 0\r\n },\r\n {\r\n \"id\": 9015,\r\n \"item\": \"cha\",\r\n \"type\": 1,\r\n \"flammable\": 0\r\n },\r\n {\r\n \"id\": 9016,\r\n \"item\": \"jinju\",\r\n \"type\": 1,\r\n \"flammable\": 0\r\n },\r\n {\r\n \"id\": 9017,\r\n \"item\": \"pugongying\",\r\n \"type\": 2,\r\n \"flammable\": 0\r\n },\r\n {\r\n \"id\": 9018,\r\n \"item\": \"chixiaodou\",\r\n \"type\": 2,\r\n \"flammable\": 0\r\n },\r\n {\r\n \"id\": 9019,\r\n \"item\": \"mudan\",\r\n \"type\": 2,\r\n \"flammable\": 0\r\n },\r\n {\r\n \"id\": 9020,\r\n \"item\": \"jingjie\",\r\n \"type\": 2,\r\n \"flammable\": 0\r\n },\r\n {\r\n \"id\": 9021,\r\n \"item\": \"longyan\",\r\n \"type\": 1,\r\n \"flammable\": 0\r\n },\r\n {\r\n \"id\": 9022,\r\n \"item\": \"gouqi\",\r\n \"type\": 1,\r\n \"flammable\": 0\r\n },\r\n {\r\n \"id\": 9023,\r\n \"item\": \"cha\",\r\n \"type\": 2,\r\n \"flammable\": 0\r\n },\r\n {\r\n \"id\": 9024,\r\n \"item\": \"muchai\",\r\n \"type\": 2,\r\n \"flammable\": 1\r\n },\r\n {\r\n \"id\": 9025,\r\n \"item\": \"ganjiang\",\r\n \"type\": 1,\r\n \"flammable\": 0\r\n },\r\n {\r\n \"id\": 9026,\r\n \"item\": \"moli\",\r\n \"type\": 1,\r\n \"flammable\": 0\r\n },\r\n {\r\n \"id\": 9027,\r\n \"item\": \"dazao\",\r\n \"type\": 2,\r\n \"flammable\": 0\r\n },\r\n {\r\n \"id\": 9028,\r\n \"item\": \"danshen\",\r\n \"type\": 2,\r\n \"flammable\": 0\r\n },\r\n {\r\n \"id\": 9029,\r\n \"item\": \"longyan\",\r\n \"type\": 1,\r\n \"flammable\": 0\r\n },\r\n {\r\n \"id\": 9030,\r\n \"item\": \"gouqi\",\r\n \"type\": 1,\r\n \"flammable\": 0\r\n },\r\n {\r\n \"id\": 9031,\r\n \"item\": \"muchai\",\r\n \"type\": 1,\r\n \"flammable\": 1\r\n },\r\n {\r\n \"id\": 9032,\r\n \"item\": \"gancao\",\r\n \"type\": 2,\r\n \"flammable\": 0\r\n },\r\n {\r\n \"id\": 9033,\r\n \"item\": \"ganjiang\",\r\n \"type\": 1,\r\n \"flammable\": 0\r\n },\r\n {\r\n \"id\": 9034,\r\n \"item\": \"cha\",\r\n \"type\": 2,\r\n \"flammable\": 0\r\n },\r\n {\r\n \"id\": 9035,\r\n \"item\": \"lizhi\",\r\n \"type\": 2,\r\n \"flammable\": 0\r\n },\r\n {\r\n \"id\": 9036,\r\n \"item\": \"danggui\",\r\n \"type\": 2,\r\n \"flammable\": 0\r\n },\r\n {\r\n \"id\": 9037,\r\n \"item\": \"gouqi\",\r\n \"type\": 2,\r\n \"flammable\": 0\r\n },\r\n {\r\n \"id\": 9038,\r\n \"item\": \"cha\",\r\n \"type\": 1,\r\n \"flammable\": 0\r\n },\r\n {\r\n \"id\": 9039,\r\n \"item\": \"dazao\",\r\n \"type\": 1,\r\n \"flammable\": 0\r\n },\r\n {\r\n \"id\": 9040,\r\n \"item\": \"danggui\",\r\n \"type\": 1,\r\n \"flammable\": 0\r\n }\r\n ]\r\n },\r\n {\r\n \"custom\": [\r\n {\r\n \"id\": 10000,\r\n \"item\": \"gouqi\",\r\n \"type\": 1,\r\n \"flammable\": 0\r\n },\r\n {\r\n \"id\": 10001,\r\n \"item\": \"gancao\",\r\n \"type\": 2,\r\n \"flammable\": 0\r\n },\r\n {\r\n \"id\": 10002,\r\n \"item\": \"ganjiang\",\r\n \"type\": 1,\r\n \"flammable\": 0\r\n },\r\n {\r\n \"id\": 10003,\r\n \"item\": \"cha\",\r\n \"type\": 2,\r\n \"flammable\": 0\r\n },\r\n {\r\n \"id\": 10004,\r\n \"item\": \"lizhi\",\r\n \"type\": 1,\r\n \"flammable\": 0\r\n },\r\n {\r\n \"id\": 10005,\r\n \"item\": \"danggui\",\r\n \"type\": 2,\r\n \"flammable\": 0\r\n },\r\n {\r\n \"id\": 10006,\r\n \"item\": \"gouqi\",\r\n \"type\": 2,\r\n \"flammable\": 0\r\n },\r\n {\r\n \"id\": 10007,\r\n \"item\": \"cha\",\r\n \"type\": 2,\r\n \"flammable\": 0\r\n },\r\n {\r\n \"id\": 10008,\r\n \"item\": \"dazao\",\r\n \"type\": 1,\r\n \"flammable\": 0\r\n },\r\n {\r\n \"id\": 10009,\r\n \"item\": \"danggui\",\r\n \"type\": 1,\r\n \"flammable\": 0\r\n },\r\n {\r\n \"id\": 10010,\r\n \"item\": \"lizi\",\r\n \"type\": 2,\r\n \"flammable\": 0\r\n },\r\n {\r\n \"id\": 10011,\r\n \"item\": \"longyan\",\r\n \"type\": 1,\r\n \"flammable\": 0\r\n },\r\n {\r\n \"id\": 10012,\r\n \"item\": \"cha\",\r\n \"type\": 2,\r\n \"flammable\": 0\r\n },\r\n {\r\n \"id\": 10013,\r\n \"item\": \"putao\",\r\n \"type\": 2,\r\n \"flammable\": 0\r\n },\r\n {\r\n \"id\": 10014,\r\n \"item\": \"renshen\",\r\n \"type\": 1,\r\n \"flammable\": 0\r\n },\r\n {\r\n \"id\": 10015,\r\n \"item\": \"baishao\",\r\n \"type\": 1,\r\n \"flammable\": 0\r\n },\r\n {\r\n \"id\": 10016,\r\n \"item\": \"danshen\",\r\n \"type\": 2,\r\n \"flammable\": 0\r\n },\r\n {\r\n \"id\": 10017,\r\n \"item\": \"gancao\",\r\n \"type\": 2,\r\n \"flammable\": 0\r\n },\r\n {\r\n \"id\": 10018,\r\n \"item\": \"lizhi\",\r\n \"type\": 1,\r\n \"flammable\": 0\r\n },\r\n {\r\n \"id\": 10019,\r\n \"item\": \"lizi\",\r\n \"type\": 2,\r\n \"flammable\": 0\r\n },\r\n {\r\n \"id\": 10020,\r\n \"item\": \"mudan\",\r\n \"type\": 2,\r\n \"flammable\": 0\r\n },\r\n {\r\n \"id\": 10021,\r\n \"item\": \"danggui\",\r\n \"type\": 1,\r\n \"flammable\": 0\r\n },\r\n {\r\n \"id\": 10022,\r\n \"item\": \"cha\",\r\n \"type\": 2,\r\n \"flammable\": 0\r\n },\r\n {\r\n \"id\": 10023,\r\n \"item\": \"muchai\",\r\n \"type\": 2,\r\n \"flammable\": 1\r\n },\r\n {\r\n \"id\": 10024,\r\n \"item\": \"gancao\",\r\n \"type\": 2,\r\n \"flammable\": 0\r\n },\r\n {\r\n \"id\": 10025,\r\n \"item\": \"mudan\",\r\n \"type\": 2,\r\n \"flammable\": 0\r\n },\r\n {\r\n \"id\": 10026,\r\n \"item\": \"zhuye\",\r\n \"type\": 1,\r\n \"flammable\": 0\r\n },\r\n {\r\n \"id\": 10027,\r\n \"item\": \"danshen\",\r\n \"type\": 2,\r\n \"flammable\": 0\r\n },\r\n {\r\n \"id\": 10028,\r\n \"item\": \"renshen\",\r\n \"type\": 2,\r\n \"flammable\": 0\r\n },\r\n {\r\n \"id\": 10029,\r\n \"item\": \"danggui\",\r\n \"type\": 1,\r\n \"flammable\": 0\r\n },\r\n {\r\n \"id\": 10030,\r\n \"item\": \"baishao\",\r\n \"type\": 2,\r\n \"flammable\": 0\r\n },\r\n {\r\n \"id\": 10031,\r\n \"item\": \"muchai\",\r\n \"type\": 2,\r\n \"flammable\": 1\r\n },\r\n {\r\n \"id\": 10032,\r\n \"item\": \"ganjiang\",\r\n \"type\": 1,\r\n \"flammable\": 0\r\n },\r\n {\r\n \"id\": 10033,\r\n \"item\": \"putao\",\r\n \"type\": 1,\r\n \"flammable\": 0\r\n },\r\n {\r\n \"id\": 10034,\r\n \"item\": \"cha\",\r\n \"type\": 2,\r\n \"flammable\": 0\r\n },\r\n {\r\n \"id\": 10035,\r\n \"item\": \"mulan\",\r\n \"type\": 2,\r\n \"flammable\": 0\r\n },\r\n {\r\n \"id\": 10036,\r\n \"item\": \"danggui\",\r\n \"type\": 2,\r\n \"flammable\": 0\r\n },\r\n {\r\n \"id\": 10037,\r\n \"item\": \"taozi\",\r\n \"type\": 1,\r\n \"flammable\": 0\r\n },\r\n {\r\n \"id\": 10038,\r\n \"item\": \"lizhi\",\r\n \"type\": 1,\r\n \"flammable\": 0\r\n },\r\n {\r\n \"id\": 10039,\r\n \"item\": \"putao\",\r\n \"type\": 1,\r\n \"flammable\": 0\r\n },\r\n {\r\n \"id\": 10040,\r\n \"item\": \"gouqi\",\r\n \"type\": 2,\r\n \"flammable\": 0\r\n }\r\n ]\r\n }\r\n ]\r\n \r\n }\r\n\r\n static Authentication(){\r\n cc.fx.GameTool.Authentication();\r\n }\r\n}\r\n\r\n"]} \ No newline at end of file +{"version":3,"sources":["assets\\Script\\module\\Config\\GameConfig.ts"],"names":[],"mappings":";;;;;;;;;;;;;AAAA,wCAAwC;AAIlC,IAAA,KAAwB,EAAE,CAAC,UAAU,EAAnC,OAAO,aAAA,EAAE,QAAQ,cAAkB,CAAC;AAE5C;IAAA;IAmUA,CAAC;mBAnUY,UAAU;IAyEnB,sBAAW,sBAAQ;QAJnB,OAAO;aAIP;YAEI,IAAI,IAAI,CAAC,SAAS,IAAI,IAAI,EAC1B;gBACI,IAAI,CAAC,SAAS,GAAG,IAAI,YAAU,EAAE,CAAC;aACrC;YACD,OAAO,IAAI,CAAC,SAAS,CAAC;QAC1B,CAAC;;;OAAA;IAEM,iBAAM,GAAb,UAAc,GAAG;QACb,IAAI,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,IAAI,CAAC,UAAU,CAAC,OAAO,CAAC,CAAC,EAAC,IAAI,EAAC,MAAM,EAAC,KAAK,EAAC,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,EAAC,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,EAAC,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,EAAC,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,EAAC,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC,EAAC,WAAW,EAAC,CAAC,EAAC,CAAC,CAAC,CAAC;IAKnJ,CAAC;IAGM,yBAAc,GAArB;QACI,EAAE,CAAC,EAAE,CAAC,QAAQ,CAAC,cAAc,EAAE,CAAC;IACpC,CAAC;IAGM,kBAAO,GAAd,UAAe,IAAI;QACf,IAAI,CAAC,OAAO,CAAC,KAAK,GAAG,IAAI,CAAC;IAC9B,CAAC;;IAjUD,0BAA0B;IACX,oBAAS,GAAgB,IAAI,CAAC;IAFpC,UAAU;QADtB,OAAO,CAAC,YAAY,CAAC;OACT,UAAU,CAmUtB;IAAD,iBAAC;CAnUD,AAmUC,IAAA;AAnUY,gCAAU","file":"","sourceRoot":"/","sourcesContent":["import { WeChat } from \"../Share/share\";\r\nimport { GameTool } from \"../Tool/GameTool\";\r\n\r\n\r\nconst { ccclass, property } = cc._decorator;\r\n@ccclass('GameConfig')\r\nexport class GameConfig {\r\n //所有控制信息都通过GameAppStart内控制\r\n private static _instance : GameConfig = null;\r\n\r\n static GAME_DATA: any[];\r\n //关卡数据\r\n\r\n\r\n static LEVEL_INFO: { id: string; map: number[][]; min_steps: number}[][];\r\n static CUSTOM_INFO: {\r\n moveSpeed: number; //洪峰移动速度\r\n waitTime: number; //洪峰冲击倒计时\r\n fastPath: number; //最短路径\r\n }[];\r\n static TIME_INFO: {\r\n waterSpeed: number[]; //洪峰速度\r\n totalTime: number; //游戏总时长\r\n waterTime: number[]; //洪峰来的倒计时\r\n roadSpeed: number; //河道修筑速度\r\n ReinforceSpeed: number; //加固时间速度\r\n Xi_SoilSpeed: number;\r\n };\r\n //用于盛放埋点数据上传,每次上传后清空\r\n static CLICK_DATA: {\r\n type: number; //上传数据类型\r\n success: boolean; //此局游戏正确与否\r\n round: number; //回合数轮次\r\n getScore: number; //本轮得分,失败为0分\r\n cumulativeScore: number; //本剧游戏总计得分\r\n mapId: string; //地图ID\r\n difficulty: number; //地图难度\r\n optimizedSteps: number; //关卡最短步数\r\n usedSteps: number; //玩家修建总步数\r\n stepList: any[]; //U、D、L、R X 息壤 F 加固\r\n startTime: number; //从游戏开始到玩家操作的第一步截止时间 单位毫秒\r\n submitTime: number; //从第一步操作到提交时间,如果未提交为-1 单位毫秒\r\n duration: number; //游戏总用时(截止到提交) 单位毫秒\r\n drawingBack: number; //后退次数\r\n drawingReset: number; //清空次数\r\n timer: number; //游戏倒计时剩余时长 秒\r\n };\r\n static GM_INFO: {\r\n // isEnd: false,\r\n mean_Time: number; //平均放箭速度\r\n total: number; //总共对的个数\r\n currSeed: number; //用于随机数种子\r\n gameId: string; //游戏ID\r\n userId: number; //用户ID\r\n scode: string; //scode\r\n guide: boolean; //是否有引导\r\n url: string; //访问域名\r\n success: boolean; //用户游戏成功与否\r\n matchId: any; //用于埋点上传的ID\r\n custom: number; //用于测试跳关卡\r\n round: number; //回合数\r\n level: number; //具体游戏内进行到第几步 \r\n stepTimeList: number; //整局游戏用时,由于涉及场景切换,数据需要保留\r\n successList: any[]; //整局胜负\r\n fen: number; //小局得分\r\n score: number; //总得分\r\n igniteCount: number; //玩家总计成功点火数\r\n min_Steps: number; //每次上一把最小步数\r\n min_Time: number; //每一把上次距离洪峰到来时间\r\n };\r\n\r\n\r\n\r\n\r\n\r\n //游戏内信息\r\n\r\n\r\n\r\n static get Instance()\r\n {\r\n if (this._instance == null)\r\n {\r\n this._instance = new GameConfig();\r\n }\r\n return this._instance;\r\n }\r\n\r\n static getKey(key){\r\n var reg = new RegExp('(^|&)' + key + '=([^&]*)(&|$)', 'i');\r\n var r = window.location.search.substr(1).match(reg);\r\n if (r != null) {\r\n return unescape(r[2]);\r\n }\r\n return \"\";\r\n }\r\n\r\n\r\n //getSeedRandom\r\n static init(Authentication){\r\n this.CLICK_init();\r\n this.LEVEL_INFO_init();\r\n this.GM_INFO_init();\r\n if(!Authentication) this.Authentication();\r\n // @ts-ignore\r\n if(window.wx !== null && window.wx !== undefined) WeChat.setShare(location.href);\r\n // var self = this;\r\n // cc.resources.load('Json/CLICK_DATA', (err: any, res: cc.JsonAsset) => {\r\n // if (err) {\r\n // return;\r\n // }\r\n // let jsonData: object = res.json!;\r\n // self.CLICK_DATA = jsonData[\"data\"];\r\n // })\r\n // cc.resources.load('Json/LEVEL_INFO', (err: any, res: cc.JsonAsset) => {\r\n // if (err) {\r\n // return;\r\n // }\r\n \r\n // let jsonData: object = res.json!;\r\n // self.LEVEL_INFO = jsonData[\"data\"];\r\n // })\r\n // cc.resources.load('Json/GM_INFO', (err: any, res: cc.JsonAsset) => {\r\n // if (err) {\r\n // if(!Authentication) self.Authentication();\r\n // if(window.wx !== null && window.wx !== undefined) WeChat.setShare(location.href);\r\n // return;\r\n // }\r\n \r\n // let jsonData: object = res.json!;\r\n // self.GM_INFO = jsonData[\"data\"];\r\n // self.setCode(self.getKey(\"scode\"));\r\n // cc.fx.GameTool.getCustom(false);\r\n // if(!Authentication) self.Authentication();\r\n // if(window.wx !== null && window.wx !== undefined) WeChat.setShare(location.href);\r\n // })\r\n\r\n //GAME_DATA 废弃了,暂时不删除以防后面修改回 一整局传一次\r\n this.GAME_DATA = [\r\n ]\r\n this.CUSTOM_INFO = [\r\n //第一难度\r\n {\r\n moveSpeed: 0, //洪峰移动速度\r\n waitTime: 20, //洪峰冲击倒计时\r\n fastPath: 5 //最短路径\r\n },\r\n //第二难度\r\n {\r\n moveSpeed: 0, //洪峰移动速度\r\n waitTime: 20, //洪峰冲击倒计时\r\n fastPath: 5 //最短路径\r\n },\r\n //第三难度\r\n {\r\n moveSpeed: 0, //洪峰移动速度\r\n waitTime: 20, //洪峰冲击倒计时\r\n fastPath: 5 //最短路径\r\n },\r\n //第四难度\r\n {\r\n moveSpeed: 0, //洪峰移动速度\r\n waitTime: 20, //洪峰冲击倒计时\r\n fastPath: 5 //最短路径\r\n },\r\n //第五难度\r\n {\r\n moveSpeed: 0, //洪峰移动速度\r\n waitTime: 20, //洪峰冲击倒计时\r\n fastPath: 5 //最短路径\r\n },\r\n //第六难度\r\n {\r\n moveSpeed: 0, //洪峰移动速度\r\n waitTime: 20, //洪峰冲击倒计时\r\n fastPath: 5 //最短路径\r\n },\r\n //第七难度 \r\n {\r\n moveSpeed: 0, //洪峰移动速度\r\n waitTime: 20, //洪峰冲击倒计时\r\n fastPath: 5 //最短路径\r\n },\r\n //第八难度\r\n {\r\n moveSpeed: 0, //洪峰移动速度\r\n waitTime: 20, //洪峰冲击倒计时\r\n fastPath: 5 //最短路径\r\n },\r\n //第九难度\r\n {\r\n moveSpeed: 0, //洪峰移动速度\r\n waitTime: 20, //洪峰冲击倒计时\r\n fastPath: 5 //最短路径\r\n },\r\n //第十难度\r\n {\r\n moveSpeed: 0, //洪峰移动速度\r\n waitTime: 20, //洪峰冲击倒计时\r\n fastPath: 5 //最短路径\r\n } \r\n ]\r\n // @ts-ignore\r\n if(window.wx !== null && window.wx !== undefined) WeChat.setShare(location.href);\r\n if(!Authentication) this.Authentication();\r\n }\r\n \r\n //数据备用\r\n static GM_INFO_init() {\r\n this.GM_INFO = {\r\n // isEnd: false,\r\n mean_Time: 0, //平均放箭速度\r\n total: 0, //总共对的个数\r\n currSeed: 200000, //用于随机数种子\r\n gameId: \"100012\", //游戏ID\r\n userId: 0, //用户ID\r\n scode:\"\", //scode\r\n guide: false, //是否有引导\r\n url: \"https://api.sparkus.cn\",//访问域名\r\n success: false, //用户游戏成功与否\r\n matchId: null, //用于埋点上传的ID\r\n custom: 0, //用于测试跳关卡\r\n round:0, //回合数\r\n level: 0, //具体游戏内进行到第几步 \r\n stepTimeList:0, //整局游戏用时,由于涉及场景切换,数据需要保留\r\n successList:[], //整局胜负\r\n fen:0, //小局得分\r\n score:0, //总得分\r\n igniteCount: 0, //玩家总计成功点火数\r\n min_Steps:0, //每次上一把最小步数\r\n min_Time:0 //每一把上次距离洪峰到来时间\r\n };\r\n this.setCode(this.getKey(\"scode\"));\r\n\r\n }\r\n static GM_INFO_SET(key,value) {\r\n this.GM_INFO[key] = value;\r\n }\r\n static CLICK_init() {\r\n this.CLICK_DATA =\r\n {\r\n type: 1, //上传数据类型\r\n success: false, //此局游戏正确与否\r\n round: 0, //回合数轮次\r\n getScore: 0, //本轮得分,失败为0分\r\n cumulativeScore: 0, //本剧游戏总计得分\r\n mapId: \"\", //地图ID\r\n difficulty: 0, //地图难度\r\n optimizedSteps: 0, //关卡最短步数\r\n usedSteps: 0, //玩家修建总步数\r\n stepList: [], //U、D、L、R X 息壤 F 加固\r\n startTime:-1, //从游戏开始到玩家操作的第一步截止时间 单位毫秒\r\n submitTime:-1, //从第一步操作到提交时间,如果未提交为-1 单位毫秒\r\n duration:0, //游戏总用时(截止到提交) 单位毫秒 如果未他移交则为时间上限\r\n drawingBack:0, //后退次数\r\n drawingReset:0, //清空次数\r\n timer: 0, //测评倒计时剩余时间 去秒\r\n }\r\n }\r\n\r\n static CLICK_SET(key,value) {\r\n this.CLICK_DATA[key] = value;\r\n }\r\n\r\n static LEVEL_INFO_init() {\r\n this.TIME_INFO = {\r\n waterSpeed:[0.3,0.25,0.2,0.18,0.16,0.14,0.12,0.1], //洪峰速度\r\n totalTime: 20, //游戏总时长\r\n waterTime:[10,12,14,16,18,20,20,20], //洪峰来的倒计时\r\n roadSpeed:0.2, //河道修筑速度\r\n ReinforceSpeed:0.2, //加固时间速度\r\n Xi_SoilSpeed:0.2, //息壤时间速度\r\n }\r\n /*\r\n moveSpeed: 0, //洪峰移动速度\r\n waitTime: 20, //洪峰冲击倒计时\r\n fastPath: 5 //最短路径\r\n */ \r\n // this.LEVEL_INFO = [\r\n // [ \r\n // {\r\n // \"id\": 1001,\r\n // \"map\": [\r\n // [0,0,0,0,0,0],\r\n // [0,0,0,0,0,4],\r\n // [0,0,3,0,3,0],\r\n // [0,0,0,0,0,0],\r\n // [0,0,0,3,0,0],\r\n // [0,0,0,0,0,0],\r\n // [0,0,2,0,0,0],\r\n // [0,0,0,0,0,0],\r\n // [1,0,0,0,0,0]\r\n // ]\r\n // },\r\n // {\r\n // \"id\": 1002,\r\n // \"map\": [\r\n // [0,0,0,0,0,0,0,0,4],\r\n // [0,0,0,0,0,0,0,0,0],\r\n // [0,0,0,0,0,0,0,0,0],\r\n // [0,0,0,0,0,0,0,0,0],\r\n // [0,0,0,0,0,0,0,0,0],\r\n // [0,1,0,0,0,0,0,0,0]\r\n // ]\r\n // }\r\n // ],\r\n\r\n \r\n // ]\r\n\r\n this.LEVEL_INFO = [[{\"id\":\"1001\",\"map\":[[0,4,0,0],[0,0,0,0],[0,0,0,0],[0,0,1,0]],\"min_steps\":3},{\"id\":\"1002\",\"map\":[[1,0,0,0],[0,0,0,4],[0,0,0,0],[0,0,0,0]],\"min_steps\":3},{\"id\":\"1004\",\"map\":[[1,0,0,0],[0,0,0,0],[0,0,0,0],[0,4,0,0]],\"min_steps\":3},{\"id\":\"1006\",\"map\":[[4,0,0,0],[0,0,0,0],[0,0,0,0],[0,1,0,0]],\"min_steps\":3},{\"id\":\"1003\",\"map\":[[1,0,0,0],[0,0,0,0],[0,0,0,0],[0,0,0,4]],\"min_steps\":4},{\"id\":\"1005\",\"map\":[[1,0,0,0],[0,0,0,0],[0,0,0,4],[0,0,0,0]],\"min_steps\":4},{\"id\":\"1007\",\"map\":[[0,4,0,0],[0,0,0,0],[0,0,0,0],[0,0,0,1]],\"min_steps\":4},{\"id\":\"1008\",\"map\":[[0,0,0,4],[0,0,0,0],[0,0,0,0],[1,0,0,0]],\"min_steps\":4}],[{\"id\":\"2001\",\"map\":[[0,0,0,0,1],[0,0,0,0,0],[0,0,3,0,3],[0,0,0,0,0],[4,0,0,0,3]],\"min_steps\":4},{\"id\":\"2002\",\"map\":[[0,1,0,0,0],[0,0,0,0,0],[3,3,0,0,4],[0,0,0,0,0],[3,0,0,0,0]],\"min_steps\":4},{\"id\":\"2009\",\"map\":[[0,3,0,0,4],[3,0,0,0,0],[0,0,0,0,0],[1,0,0,0,0],[0,3,0,0,0]],\"min_steps\":4},{\"id\":\"2010\",\"map\":[[0,0,0,0,1],[0,0,0,0,0],[0,0,0,0,0],[0,3,0,3,0],[4,0,3,0,0]],\"min_steps\":4},{\"id\":\"2011\",\"map\":[[4,3,1,0,0],[0,0,0,0,3],[0,0,0,3,0],[0,0,0,0,0],[0,0,0,0,0]],\"min_steps\":4},{\"id\":\"2021\",\"map\":[[0,0,0,1,0],[0,0,3,0,0],[0,0,0,3,3],[0,0,0,0,0],[0,4,0,0,0]],\"min_steps\":4},{\"id\":\"2004\",\"map\":[[1,0,0,0,0],[0,0,0,0,3],[3,0,0,0,0],[0,0,0,0,0],[0,0,0,0,4]],\"min_steps\":5},{\"id\":\"2012\",\"map\":[[0,3,0,4,0],[0,0,0,3,0],[1,0,3,0,0],[0,0,0,0,0],[0,0,0,0,0]],\"min_steps\":5},{\"id\":\"2013\",\"map\":[[0,0,0,0,0],[1,0,0,0,0],[0,0,0,3,3],[3,0,0,0,0],[0,0,0,4,0]],\"min_steps\":5},{\"id\":\"2014\",\"map\":[[3,0,1,0,0],[0,3,0,0,0],[0,0,0,0,0],[4,0,0,3,0],[0,0,0,0,0]],\"min_steps\":5},{\"id\":\"2015\",\"map\":[[3,0,0,0,1],[3,0,0,0,0],[0,0,0,0,0],[4,3,0,0,0],[3,0,0,0,0]],\"min_steps\":5},{\"id\":\"2016\",\"map\":[[0,0,0,0,0],[1,0,3,0,0],[3,0,0,0,3],[0,0,0,0,0],[0,0,0,0,4]],\"min_steps\":5},{\"id\":\"2017\",\"map\":[[0,3,0,0,0],[4,0,0,0,0],[0,0,0,0,0],[3,0,3,0,0],[3,0,0,0,1]],\"min_steps\":5},{\"id\":\"2018\",\"map\":[[0,3,4,3,3],[0,0,0,0,0],[0,0,0,0,0],[0,0,0,0,0],[0,0,3,0,1]],\"min_steps\":5},{\"id\":\"2019\",\"map\":[[3,0,0,4,0],[0,0,0,3,0],[0,0,0,0,0],[0,0,0,0,0],[1,0,3,0,0]],\"min_steps\":5},{\"id\":\"2020\",\"map\":[[4,0,3,0,1],[0,0,0,0,3],[0,0,0,0,0],[0,0,0,0,0],[0,0,3,0,0]],\"min_steps\":5},{\"id\":\"2003\",\"map\":[[1,0,0,3,0],[0,0,3,0,0],[0,0,0,0,0],[0,0,0,0,0],[0,3,0,4,0]],\"min_steps\":6},{\"id\":\"2005\",\"map\":[[0,3,0,0,0],[1,0,0,0,0],[0,0,0,3,0],[0,0,0,0,0],[0,3,0,4,0]],\"min_steps\":6},{\"id\":\"2006\",\"map\":[[0,1,0,0,0],[0,0,0,0,3],[0,0,0,0,3],[0,0,0,0,0],[0,0,0,3,4]],\"min_steps\":6},{\"id\":\"2007\",\"map\":[[3,0,0,0,1],[0,0,0,0,3],[0,0,0,0,0],[0,0,0,0,0],[4,3,0,0,0]],\"min_steps\":6},{\"id\":\"2008\",\"map\":[[3,4,0,0,0],[0,0,0,0,3],[0,0,0,3,1],[0,0,0,0,0],[0,0,0,0,0]],\"min_steps\":6},{\"id\":\"2022\",\"map\":[[0,0,0,0,0],[1,3,0,0,3],[0,0,0,0,0],[0,0,0,0,0],[0,0,3,4,0]],\"min_steps\":6}],[{\"id\":\"3001\",\"map\":[[3,0,2,3,4],[0,0,0,2,2],[2,3,3,3,3],[0,0,2,0,2],[1,0,2,3,0]],\"min_steps\":5},{\"id\":\"3002\",\"map\":[[3,0,3,2,0],[1,2,0,3,2],[2,3,0,0,4],[2,0,2,2,0],[3,3,0,3,0]],\"min_steps\":5},{\"id\":\"3003\",\"map\":[[0,2,3,3,4],[2,2,0,0,0],[1,3,3,3,2],[2,2,3,2,3],[0,0,0,0,0]],\"min_steps\":5},{\"id\":\"3004\",\"map\":[[3,2,2,1,0],[0,0,3,2,2],[3,0,2,3,0],[3,0,0,3,3],[0,2,4,0,2]],\"min_steps\":5},{\"id\":\"3005\",\"map\":[[3,0,3,0,0],[2,3,0,0,1],[0,2,2,2,3],[4,2,0,0,2],[3,3,0,3,2]],\"min_steps\":5},{\"id\":\"3008\",\"map\":[[3,3,3,0,1],[0,0,0,0,3],[2,2,3,2,2],[0,2,3,0,3],[4,2,2,0,0]],\"min_steps\":5},{\"id\":\"3009\",\"map\":[[1,0,3,3,2],[3,0,2,0,0],[0,3,3,2,4],[0,0,3,0,2],[2,2,2,0,3]],\"min_steps\":5},{\"id\":\"3010\",\"map\":[[3,0,2,0,4],[1,2,3,0,3],[2,0,3,2,0],[0,3,0,0,3],[2,0,2,3,2]],\"min_steps\":5},{\"id\":\"3006\",\"map\":[[2,0,2,2,0],[1,2,3,0,0],[3,3,0,3,2],[3,0,0,3,2],[2,0,3,0,4]],\"min_steps\":6},{\"id\":\"3007\",\"map\":[[1,2,0,3,3],[2,2,0,2,0],[2,3,2,0,3],[0,3,2,0,4],[0,0,3,0,3]],\"min_steps\":6},{\"id\":\"3011\",\"map\":[[2,3,0,1,0],[0,0,0,0,0],[3,0,0,0,3],[0,2,0,3,2],[4,3,3,2,2]],\"min_steps\":6},{\"id\":\"3012\",\"map\":[[0,2,1,0,3],[0,3,0,0,3],[3,2,3,2,0],[0,2,0,3,0],[2,0,0,0,4]],\"min_steps\":6},{\"id\":\"3013\",\"map\":[[0,2,1,0,3],[0,3,0,0,3],[3,2,3,2,0],[0,2,0,3,0],[2,0,0,0,4]],\"min_steps\":6},{\"id\":\"3014\",\"map\":[[1,0,3,3,4],[2,3,0,3,0],[0,2,2,0,0],[3,3,0,0,2],[2,0,0,0,0]],\"min_steps\":6},{\"id\":\"3015\",\"map\":[[2,3,0,0,0],[0,0,2,3,0],[4,0,3,0,3],[2,0,2,2,3],[0,3,0,0,1]],\"min_steps\":6},{\"id\":\"3016\",\"map\":[[3,0,2,0,2],[2,0,0,0,3],[0,2,3,0,1],[4,0,0,3,0],[3,3,0,0,2]],\"min_steps\":6},{\"id\":\"3017\",\"map\":[[0,3,0,0,2],[3,0,2,0,4],[1,3,3,0,0],[2,0,0,2,0],[3,2,3,0,0]],\"min_steps\":6},{\"id\":\"3018\",\"map\":[[4,2,0,0,0],[0,0,0,3,2],[0,3,0,0,3],[3,2,3,2,0],[3,0,2,1,0]],\"min_steps\":7},{\"id\":\"3019\",\"map\":[[0,4,0,3,2],[0,2,0,0,0],[3,0,3,0,2],[3,3,2,3,1],[2,0,0,0,0]],\"min_steps\":7},{\"id\":\"3020\",\"map\":[[0,2,0,1,0],[0,0,0,3,2],[3,0,3,3,3],[3,0,0,0,2],[0,2,2,4,0]],\"min_steps\":7},{\"id\":\"3021\",\"map\":[[3,2,0,2,1],[3,2,0,3,2],[3,0,0,2,3],[0,0,0,0,4],[0,0,3,0,0]],\"min_steps\":7},{\"id\":\"3022\",\"map\":[[2,0,2,2,2],[0,0,3,0,0],[3,0,3,0,0],[1,0,3,2,4],[0,0,3,3,0]],\"min_steps\":7},{\"id\":\"3023\",\"map\":[[1,2,0,2,0],[3,3,3,0,0],[0,2,3,2,0],[4,0,0,0,3],[0,0,2,0,3]],\"min_steps\":7},{\"id\":\"3024\",\"map\":[[1,0,3,0,3],[2,2,0,0,0],[0,3,0,3,0],[2,0,3,2,0],[2,3,0,4,0]],\"min_steps\":7}],[{\"id\":\"4001\",\"map\":[[1,3,0,0,2,0],[0,3,0,0,2,0],[0,0,2,0,3,4],[0,0,0,2,0,0],[3,3,0,0,2,0,3],[0,0,2,2,2,0]],\"min_steps\":5},{\"id\":\"4002\",\"map\":[[0,2,2,2,2,0],[1,0,0,0,2,0],[0,0,0,0,0,3],[0,0,0,0,2,0],[0,3,3,0,2,0],[3,0,0,4,2,0]],\"min_steps\":5},{\"id\":\"4003\",\"map\":[[0,0,0,0,0,0],[2,0,0,0,0,2],[0,3,3,3,2,4],[0,3,0,3,2,0],[0,0,0,0,0,3],[0,0,2,3,0,1]],\"min_steps\":6},{\"id\":\"4004\",\"map\":[[2,0,3,0,0,4],[0,2,3,3,0,0],[0,3,0,0,0,0],[3,0,0,0,2,2],[3,0,0,2,0,0],[1,0,0,3,0,0]],\"min_steps\":6},{\"id\":\"4006\",\"map\":[[4,3,0,3,0,0],[0,2,0,3,0,0],[3,0,0,0,3,2],[0,3,0,0,2,1],[0,0,2,0,0,0],[0,0,0,0,2,3]],\"min_steps\":7},{\"id\":\"4007\",\"map\":[[4,2,2,0,2,0],[0,3,0,2,0,0],[0,2,3,0,3,0],[0,0,3,0,0,3],[0,0,3,0,0,0],[0,0,0,3,0,1]],\"min_steps\":7},{\"id\":\"4014\",\"map\":[[0,0,3,0,2,2],[0,2,3,0,0,1],[0,3,3,0,0,3],[0,2,0,0,0,0],[0,0,0,3,3,0],[2,0,4,0,0,0]],\"min_steps\":7},{\"id\":\"4015\",\"map\":[[2,0,0,0,0,0],[0,0,0,0,3,1],[3,0,2,0,0,3],[2,0,0,2,3,0],[3,0,3,0,0,0],[2,0,0,3,4,0]],\"min_steps\":7},{\"id\":\"4005\",\"map\":[[1,0,0,0,0,2],[0,0,0,2,0,0],[3,2,0,0,0,0],[0,3,0,0,2,3],[0,0,3,3,0,0],[3,0,0,2,3,4]],\"min_steps\":8},{\"id\":\"4008\",\"map\":[[0,0,2,3,0,0],[0,3,0,2,3,2],[3,0,0,0,0,0],[0,3,0,0,3,4],[0,0,0,0,0,3],[0,2,0,2,0,1]],\"min_steps\":8},{\"id\":\"4009\",\"map\":[[0,3,3,0,0,4],[2,0,0,3,0,0],[2,0,0,3,0,0],[1,0,0,0,3,0],[0,0,2,3,0,2],[2,3,0,0,0,0]],\"min_steps\":8},{\"id\":\"4010\",\"map\":[[0,0,1,3,2,0],[3,0,0,0,3,2],[3,0,0,0,0,3],[2,0,0,0,0,0],[0,2,0,0,3,0],[0,2,0,3,4,0]],\"min_steps\":8},{\"id\":\"4011\",\"map\":[[1,0,0,0,0,0],[3,3,0,0,0,2],[0,0,0,3,0,2],[2,0,3,0,3,0],[2,0,3,0,0,3],[4,0,0,0,0,2]],\"min_steps\":8},{\"id\":\"4016\",\"map\":[[0,0,3,0,0,1],[2,3,0,0,3,0],[2,0,0,0,0,2],[0,3,0,0,0,0],[0,3,0,0,2,0],[0,4,3,0,2,3]],\"min_steps\":8},{\"id\":\"4017\",\"map\":[[1,2,3,0,3,2],[3,0,0,0,0,0],[0,0,0,0,0,3],[3,3,0,3,2,0],[0,2,0,0,0,0],[4,0,0,2,0,0]],\"min_steps\":8},{\"id\":\"4018\",\"map\":[[0,0,1,0,2,0],[0,0,0,0,0,0],[0,0,3,2,3,0],[3,0,0,3,0,0],[2,3,0,2,0,0],[4,2,0,3,3,0]],\"min_steps\":8},{\"id\":\"4012\",\"map\":[[2,2,3,0,2,0],[0,3,0,0,0,0],[0,0,0,0,3,4],[0,2,0,3,0,3],[0,0,0,0,0,0],[0,0,2,3,3,1]],\"min_steps\":9},{\"id\":\"4013\",\"map\":[[0,0,0,0,3,0],[4,2,0,3,0,0],[3,2,0,0,0,0],[1,3,0,3,0,0],[2,0,0,2,0,0],[3,0,0,3,2,0]],\"min_steps\":9},{\"id\":\"4019\",\"map\":[[3,4,0,0,0,2],[3,2,0,0,2,0],[0,3,0,3,0,2],[0,0,3,0,0,0],[0,0,0,0,3,0],[1,3,0,0,0,2]],\"min_steps\":9},{\"id\":\"4020\",\"map\":[[0,2,0,1,0,0],[2,3,0,0,2,0],[3,0,0,0,0,0],[0,3,3,0,0,3],[2,0,0,3,0,0],[4,3,0,0,0,2]],\"min_steps\":9}],[{\"id\":\"5001\",\"map\":[[1,0,0,0,0,0],[0,2,2,3,0,2],[3,2,0,0,3,3],[0,0,0,0,0,4],[0,0,0,2,2,0],[3,0,2,2,0,0]],\"min_steps\":7},{\"id\":\"5002\",\"map\":[[0,0,0,0,4,3],[3,2,3,0,0,0],[0,2,0,2,3,0],[2,2,0,0,0,0],[3,2,0,0,0,0],[3,0,0,2,0,3],[2,0,0,3,0,1]],\"min_steps\":7},{\"id\":\"5015\",\"map\":[[1,2,3,2,2,0],[3,0,0,0,0,3],[0,0,0,0,0,0],[0,0,0,0,0,2],[0,3,0,3,2,0],[0,0,0,0,0,0],[0,2,0,4,0,3]],\"min_steps\":7},{\"id\":\"5016\",\"map\":[[3,0,1,0,0,0],[0,2,0,2,0,0],[0,2,0,2,0,3],[0,0,0,0,0,0],[0,2,0,0,3,3],[0,0,0,0,2,3],[0,0,0,3,0,4]],\"min_steps\":7},{\"id\":\"5004\",\"map\":[[0,3,3,2,3,0],[2,0,2,0,3,0],[1,0,3,2,0,0],[3,3,0,0,0,2],[0,0,0,0,0,0],[0,2,0,0,0,0],[0,0,0,3,4,0]],\"min_steps\":8},{\"id\":\"5005\",\"map\":[[0,0,0,0,0,1],[0,0,2,0,2,0],[3,2,2,0,0,0],[3,0,0,3,0,0],[3,3,0,0,0,3],[4,3,0,0,0,0],[2,0,0,2,3,0]],\"min_steps\":8},{\"id\":\"5008\",\"map\":[[3,0,3,2,0,4],[0,3,0,2,0,2],[0,0,3,0,0,0],[2,0,0,2,0,0],[0,0,3,0,0,0],[0,0,0,3,0,0],[3,2,1,3,0,0]],\"min_steps\":8},{\"id\":\"5012\",\"map\":[[2,3,0,2,0,1],[2,0,0,0,0,0],[2,0,0,3,0,2],[3,0,3,0,0,3],[0,0,0,0,3,3],[3,0,0,0,2,0],[0,0,0,0,0,4]],\"min_steps\":8},{\"id\":\"5013\",\"map\":[[0,0,2,1,2,0],[0,3,0,0,0,0],[2,0,0,0,0,0],[0,0,0,3,0,0],[3,0,0,2,3,0],[3,3,3,2,0,2],[0,0,4,0,0,3]],\"min_steps\":8},{\"id\":\"5018\",\"map\":[[0,2,0,1,0,0],[2,0,0,3,0,0],[0,0,0,0,0,0],[3,0,0,0,0,0],[2,3,0,2,3,3],[2,0,0,0,0,2],[4,3,0,0,0,0]],\"min_steps\":8},{\"id\":\"5019\",\"map\":[[1,3,0,2,3,0],[0,0,0,0,0,2],[0,0,0,0,0,0],[0,0,2,0,0,2],[3,3,0,3,0,2],[4,0,2,0,0,0],[0,0,0,3,0,0]],\"min_steps\":8},{\"id\":\"5029\",\"map\":[[4,3,0,0,0,0],[2,0,0,3,0,2],[3,2,0,3,3,0],[2,0,0,3,0,0],[0,2,0,0,0,0],[2,0,0,0,0,0],[3,0,3,3,0,1]],\"min_steps\":8},{\"id\":\"5030\",\"map\":[[0,0,0,0,0,0],[0,0,2,3,2,0],[0,3,0,0,0,0],[2,2,0,3,0,0],[0,3,3,0,3,4],[0,0,2,0,0,3],[3,1,0,3,0,2]],\"min_steps\":8},{\"id\":\"5006\",\"map\":[[0,3,0,0,0,0],[1,0,0,0,3,0],[0,0,3,2,0,0],[3,0,0,2,2,0],[0,3,0,3,3,0],[0,2,0,0,0,0],[4,0,3,0,2,2]],\"min_steps\":9},{\"id\":\"5007\",\"map\":[[0,2,0,3,0,0],[1,2,0,2,0,0],[0,3,0,3,0,0],[3,0,0,0,0,3],[0,0,3,2,0,2],[4,0,0,3,0,3],[0,2,0,0,0,0]],\"min_steps\":9},{\"id\":\"5010\",\"map\":[[0,3,1,0,0,0],[0,2,3,3,0,0],[0,2,0,3,0,0],[0,2,0,2,0,3],[0,2,0,0,3,0],[0,3,0,0,0,0],[0,2,4,0,0,3]],\"min_steps\":9},{\"id\":\"5011\",\"map\":[[1,0,3,0,3,0],[0,2,0,0,0,0],[2,0,2,0,3,0],[0,3,2,0,0,0],[3,0,0,0,0,2],[4,0,3,0,0,0],[3,2,0,0,0,3]],\"min_steps\":9},{\"id\":\"5014\",\"map\":[[0,1,0,0,0,0],[2,0,2,0,0,2],[2,3,0,3,0,0],[0,3,0,0,0,3],[0,0,0,2,0,3],[0,0,3,0,3,0],[2,0,3,0,0,4]],\"min_steps\":9},{\"id\":\"5017\",\"map\":[[0,0,0,0,0,0],[1,2,3,0,0,2],[0,0,2,0,0,2],[3,0,2,3,0,0],[0,3,3,0,2,0],[0,0,0,0,0,0],[4,0,3,0,0,0]],\"min_steps\":9},{\"id\":\"5028\",\"map\":[[0,0,1,0,0,3],[3,0,0,0,3,4],[0,2,0,2,3,2],[0,3,2,3,3,0],[0,0,0,3,0,0],[0,0,3,0,0,2],[0,0,2,0,0,0]],\"min_steps\":9},{\"id\":\"5003\",\"map\":[[0,0,1,3,0,2],[0,3,3,0,0,0],[0,0,3,2,0,0],[0,0,3,0,0,0],[3,0,0,0,2,2],[0,0,2,3,0,0],[0,2,0,3,0,4]],\"min_steps\":10},{\"id\":\"5009\",\"map\":[[0,2,0,0,0,3],[0,0,3,3,3,4],[0,3,0,0,0,0],[0,3,2,0,0,0],[1,2,3,2,0,3],[2,0,0,0,0,0],[0,0,0,0,2,0]],\"min_steps\":10},{\"id\":\"5021\",\"map\":[[0,0,0,0,0,0],[0,0,0,0,3,0],[3,0,0,0,2,0],[2,0,0,2,3,0],[0,3,0,0,0,2],[0,2,3,0,0,0],[4,3,1,2,0,0]],\"min_steps\":10},{\"id\":\"5022\",\"map\":[[4,0,3,0,0,2],[0,0,0,0,2,0],[0,3,0,2,3,2],[3,0,3,0,3,0],[0,2,0,0,0,0],[0,3,0,3,0,3],[0,2,1,0,0,0]],\"min_steps\":10},{\"id\":\"5023\",\"map\":[[3,0,0,3,3,0],[0,0,3,0,0,3],[2,3,0,0,0,0],[2,2,0,0,2,0],[0,3,0,0,0,0],[2,0,3,0,0,4],[0,1,3,0,2,0]],\"min_steps\":10},{\"id\":\"5024\",\"map\":[[3,0,2,3,0,0],[4,2,0,0,0,3],[2,2,0,0,0,0],[0,0,3,0,0,2],[0,0,0,3,0,3],[0,3,3,0,2,0],[3,0,1,0,0,0]],\"min_steps\":10},{\"id\":\"5020\",\"map\":[[0,0,0,2,0,0],[0,3,0,0,0,3],[0,2,0,0,3,0],[2,0,0,2,3,4],[0,2,3,0,0,0],[0,0,0,3,0,0],[3,2,0,1,3,0]],\"min_steps\":11},{\"id\":\"5025\",\"map\":[[1,0,0,0,3,0],[0,0,0,3,3,2],[3,3,2,0,0,2],[0,0,0,0,0,3],[0,0,2,0,2,0],[0,0,0,0,3,4],[0,3,2,3,0,0]],\"min_steps\":11},{\"id\":\"5026\",\"map\":[[0,3,2,0,0,0],[0,0,2,3,3,0],[2,0,0,2,0,0],[3,2,0,0,3,2],[0,0,0,3,3,1],[0,0,3,0,0,3],[0,0,0,0,0,4]],\"min_steps\":11},{\"id\":\"5027\",\"map\":[[0,0,3,0,0,1],[0,0,0,0,0,3],[2,0,2,0,2,3],[0,0,3,3,0,3],[0,0,0,2,3,0],[0,0,0,2,0,3],[2,0,3,0,4,0]],\"min_steps\":11}],[{\"id\":\"6028\",\"map\":[[0,0,3,0,0,2],[1,3,2,2,0,3],[0,0,3,0,0,2],[0,0,0,0,0,0],[0,0,2,0,3,3],[3,3,3,0,0,0],[4,0,0,0,0,2]],\"min_steps\":8},{\"id\":\"6029\",\"map\":[[0,0,2,0,0,1],[3,2,3,0,0,3],[2,0,3,0,3,0],[3,3,0,0,0,0],[0,0,0,3,3,2],[0,0,0,0,0,2],[0,0,0,4,2,0]],\"min_steps\":8},{\"id\":\"6030\",\"map\":[[0,3,3,0,1,0],[2,3,0,0,3,0],[0,0,0,3,0,2],[0,0,3,0,2,0],[0,0,2,3,3,3],[0,0,0,0,0,0],[4,0,0,2,0,2]],\"min_steps\":8},{\"id\":\"6001\",\"map\":[[0,0,3,3,4,2],[0,0,0,2,0,0],[2,3,3,2,0,0],[0,3,0,0,0,2],[0,0,0,3,2,2],[2,0,0,3,0,2],[1,3,2,0,0,0],[0,0,0,3,0,0]],\"min_steps\":9},{\"id\":\"6012\",\"map\":[[3,0,0,0,2,0],[0,3,0,3,0,0],[0,3,0,0,0,3],[2,0,0,3,2,0],[3,2,2,2,0,0],[3,0,2,0,3,0],[1,2,3,0,2,0],[2,3,0,0,3,4]],\"min_steps\":9},{\"id\":\"6016\",\"map\":[[0,0,1,0,2,3],[0,3,2,0,2,0],[3,3,3,3,0,0],[3,0,0,0,0,0],[2,2,3,0,3,3],[0,0,2,0,2,0],[0,2,0,2,0,3],[3,0,2,0,0,4]],\"min_steps\":9},{\"id\":\"6008\",\"map\":[[0,0,2,0,3,4],[3,3,2,3,0,0],[0,0,0,0,0,3],[0,0,2,3,2,0],[0,0,2,0,3,2],[3,3,0,0,0,2],[0,3,0,0,0,0],[2,1,0,0,0,0]],\"min_steps\":10},{\"id\":\"6013\",\"map\":[[3,0,0,2,2,0],[0,2,0,3,0,2],[0,0,3,2,3,0],[0,3,0,0,3,0],[2,2,3,2,0,0],[0,0,3,3,0,0],[0,2,0,3,2,0],[4,3,3,0,1,0]],\"min_steps\":10},{\"id\":\"6017\",\"map\":[[4,0,0,0,0,3],[0,3,3,0,0,0],[3,0,2,2,0,0],[3,0,2,3,3,2],[3,2,0,2,3,3],[2,0,2,0,0,0],[0,0,0,0,0,3],[2,3,0,2,0,1]],\"min_steps\":10},{\"id\":\"6022\",\"map\":[[0,0,3,4,3,0],[0,3,0,2,2,0],[2,0,2,0,0,3],[0,0,0,0,0,0],[2,3,0,3,2,0],[0,3,0,0,0,0],[0,1,3,0,0,3]],\"min_steps\":10},{\"id\":\"6023\",\"map\":[[0,0,3,1,0,2],[0,0,2,3,0,0],[4,0,3,0,0,0],[2,0,3,0,0,3],[2,0,3,0,3,0],[0,0,0,0,0,0],[2,3,0,2,3,0]],\"min_steps\":10},{\"id\":\"6024\",\"map\":[[0,3,0,2,0,4],[3,0,0,3,3,3],[0,0,2,0,0,0],[2,3,3,0,0,0],[2,0,0,0,0,3],[2,0,3,0,0,1],[0,0,0,0,0,2]],\"min_steps\":10},{\"id\":\"6025\",\"map\":[[4,0,2,0,0,0],[0,0,3,3,0,2],[3,3,0,0,0,3],[0,2,0,2,0,0],[0,0,0,0,3,0],[1,3,0,0,2,2],[0,3,0,0,0,3]],\"min_steps\":10},{\"id\":\"6002\",\"map\":[[0,0,3,3,4,2],[0,0,0,2,0,0],[2,3,3,2,0,0],[0,3,0,0,0,2],[0,0,0,3,2,2],[2,0,0,3,0,2],[1,3,2,0,0,0],[0,0,0,3,0,0]],\"min_steps\":11},{\"id\":\"6006\",\"map\":[[1,0,2,0,0,3],[0,0,0,0,3,0],[3,0,0,3,2,0],[2,3,0,0,0,3],[0,0,3,2,0,3],[0,2,0,3,0,0],[2,3,0,2,0,0],[0,4,0,2,0,0]],\"min_steps\":11},{\"id\":\"6009\",\"map\":[[4,3,0,0,3,0],[0,0,0,0,0,0],[3,3,0,2,0,2],[3,0,0,2,2,0],[2,3,2,0,0,0],[1,3,3,0,0,0],[2,0,0,0,0,0],[3,3,0,0,0,2]],\"min_steps\":11},{\"id\":\"6018\",\"map\":[[2,3,0,0,2,3],[2,0,0,3,0,4],[2,0,0,0,0,0],[0,3,2,0,2,3],[0,0,0,0,0,3],[2,0,3,3,2,3],[0,0,0,3,2,0],[2,3,1,3,0,0]],\"min_steps\":11},{\"id\":\"6026\",\"map\":[[0,1,0,3,0,4],[0,0,3,0,3,0],[2,2,3,2,0,0],[0,0,3,0,3,3],[2,0,0,0,0,2],[0,3,0,0,0,2],[0,0,0,0,0,3]],\"min_steps\":11},{\"id\":\"6027\",\"map\":[[2,1,3,0,0,0],[0,0,0,0,3,0],[3,3,0,0,0,0],[2,2,3,3,3,0],[0,2,0,0,0,0],[3,2,0,0,0,0],[0,4,0,2,3,0]],\"min_steps\":11},{\"id\":\"6031\",\"map\":[[0,1,0,3,0,4],[0,0,3,0,3,0],[2,2,3,2,0,0],[0,0,3,0,3,3],[2,0,0,0,0,2],[0,3,0,0,0,2],[0,0,0,0,0,3]],\"min_steps\":11},{\"id\":\"6003\",\"map\":[[0,2,2,0,0,4],[0,3,3,0,0,0],[3,2,0,0,0,0],[0,3,0,0,3,3],[0,2,0,3,0,0],[2,3,0,0,0,0],[0,2,3,0,0,0],[1,2,3,0,2,0]],\"min_steps\":12},{\"id\":\"6011\",\"map\":[[3,0,2,2,3,2],[1,0,0,0,0,3],[0,0,3,2,3,0],[3,0,3,0,0,0],[4,3,2,3,0,2],[0,0,2,0,2,3],[2,0,0,0,0,3],[0,0,0,2,0,3]],\"min_steps\":12},{\"id\":\"6014\",\"map\":[[4,3,0,0,0,0],[0,2,2,2,3,0],[0,3,0,0,0,0],[2,3,2,3,0,0],[3,3,0,0,0,3],[0,0,0,2,3,0],[0,3,2,0,2,2],[2,3,3,0,0,1]],\"min_steps\":12},{\"id\":\"6020\",\"map\":[[3,2,0,0,0,0],[4,0,2,0,2,0],[3,3,0,0,2,2],[0,0,3,0,2,0],[0,0,0,0,2,3],[0,2,3,3,0,0],[2,3,0,0,3,3],[1,3,3,2,0,0]],\"min_steps\":12},{\"id\":\"6021\",\"map\":[[4,3,0,0,0,0],[0,2,2,2,3,0],[0,3,0,0,0,0],[2,3,2,3,0,0],[3,3,0,0,0,3],[0,0,0,2,3,0],[0,3,2,0,2,2],[2,3,3,0,0,1]],\"min_steps\":12},{\"id\":\"6004\",\"map\":[[0,3,0,2,2,0],[0,0,0,0,0,2],[3,0,0,0,0,0],[0,3,0,0,0,0],[0,3,3,0,3,0],[2,0,0,0,3,2],[2,0,0,0,3,1],[4,3,0,2,3,2]],\"min_steps\":13},{\"id\":\"6005\",\"map\":[[2,2,4,2,3,0],[0,3,3,2,0,0],[3,0,0,3,0,2],[3,0,2,3,3,0],[0,0,0,0,0,0],[0,0,0,0,2,3],[3,2,0,0,0,1],[0,0,0,0,0,0]],\"min_steps\":13},{\"id\":\"6007\",\"map\":[[3,2,0,0,3,4],[0,2,0,0,3,0],[0,0,2,0,2,0],[2,0,0,3,0,3],[0,0,2,0,3,2],[0,2,3,3,0,1],[0,0,0,0,0,3],[0,0,0,3,0,0]],\"min_steps\":13},{\"id\":\"6010\",\"map\":[[0,3,1,0,0,0],[0,2,3,3,0,0],[2,0,0,3,0,0],[0,2,0,0,3,2],[3,0,0,0,0,2],[3,2,0,0,0,0],[4,0,0,3,2,0],[0,3,0,3,2,0]],\"min_steps\":13},{\"id\":\"6015\",\"map\":[[4,0,0,0,2,3],[0,0,3,0,0,3],[2,2,3,2,0,0],[3,0,0,0,3,2],[2,3,0,3,0,2],[0,0,3,0,2,3],[0,0,0,0,0,3],[1,2,2,3,0,0]],\"min_steps\":14},{\"id\":\"6019\",\"map\":[[4,0,0,0,2,3],[0,0,3,0,0,3],[2,2,3,2,0,0],[3,0,0,0,3,2],[2,3,0,3,0,2],[0,0,3,0,2,3],[0,0,0,0,0,3],[1,2,2,3,0,0]],\"min_steps\":14}],[{\"id\":\"7001\",\"map\":[[0,2,0,0,2,0],[3,3,0,2,0,4],[0,0,0,0,0,3],[0,0,0,0,3,2],[0,0,0,0,0,2],[3,3,0,0,0,2],[0,3,3,2,2,0],[0,3,2,2,0,3],[1,2,0,0,2,0]],\"min_steps\":9},{\"id\":\"7023\",\"map\":[[3,2,0,2,0,1],[0,3,3,2,3,3],[0,3,3,0,3,0],[0,2,2,2,0,3],[0,3,2,0,0,3],[0,0,0,0,2,0],[2,2,2,3,0,0],[2,0,3,0,3,0],[0,0,3,0,0,4]],\"min_steps\":9},{\"id\":\"7003\",\"map\":[[1,3,2,0,0,0],[0,0,0,2,0,0],[0,3,0,2,0,0],[3,3,3,2,0,3],[2,3,3,0,3,0],[0,0,0,0,0,2],[3,0,2,2,3,2],[4,2,0,0,2,0],[0,0,2,0,0,2]],\"min_steps\":10},{\"id\":\"7002\",\"map\":[[1,0,3,2,0,2],[0,3,0,0,0,2],[0,2,0,3,2,2],[0,3,0,0,0,0],[0,2,0,3,3,0],[3,2,2,0,0,3],[0,3,2,3,0,2],[0,0,0,0,0,0],[2,0,0,2,3,4]],\"min_steps\":11},{\"id\":\"7005\",\"map\":[[0,0,0,0,0,0],[0,0,0,3,2,4],[0,3,0,0,3,3],[3,3,0,2,0,3],[0,2,2,0,3,2],[0,0,3,0,2,0],[0,2,0,2,0,0],[3,0,0,2,2,0],[0,0,2,2,0,1]],\"min_steps\":11},{\"id\":\"7006\",\"map\":[[0,0,0,0,2,3],[3,2,0,0,0,0],[0,2,0,3,3,4],[0,0,0,2,2,3],[2,0,0,0,0,0],[0,0,0,0,3,0],[3,0,3,3,0,2],[3,0,2,2,0,2],[0,0,2,2,0,1]],\"min_steps\":11},{\"id\":\"7007\",\"map\":[[2,0,2,0,2,0],[0,0,2,0,3,2],[0,0,0,3,3,0],[0,2,0,0,3,2],[3,0,0,2,0,0],[3,3,0,0,0,2],[0,2,0,3,2,0],[0,2,3,0,0,0],[4,3,0,0,1,0]],\"min_steps\":11},{\"id\":\"7026\",\"map\":[[2,4,2,0,0,0],[0,3,3,0,3,0],[3,3,3,0,0,3],[2,0,3,0,0,2],[0,2,2,3,0,3],[1,0,2,0,2,0],[3,3,0,0,0,0],[2,0,0,0,3,2],[2,0,3,2,3,0]],\"min_steps\":11},{\"id\":\"7027\",\"map\":[[2,0,0,0,0,2],[0,0,3,3,2,3],[0,0,3,0,0,1],[0,3,0,3,3,3],[0,0,0,0,0,2],[3,3,2,0,0,2],[3,3,0,2,0,3],[0,3,2,2,2,0],[0,3,4,2,2,0]],\"min_steps\":11},{\"id\":\"7029\",\"map\":[[0,0,1,0,0,0],[3,3,0,0,3,2],[3,0,0,0,2,0],[0,2,0,2,2,0],[2,3,3,3,0,3],[3,2,2,3,0,0],[2,0,3,0,0,3],[3,2,0,0,0,3],[4,2,0,0,3,2]],\"min_steps\":11},{\"id\":\"7008\",\"map\":[[1,0,0,0,2,0],[3,3,2,0,3,0],[3,0,3,0,0,0],[0,0,3,0,0,3],[2,2,0,3,0,3],[2,0,2,0,0,0],[2,0,2,0,0,2],[2,0,0,2,0,0],[4,3,0,0,0,2]],\"min_steps\":12},{\"id\":\"7010\",\"map\":[[4,3,0,3,1,0],[0,0,3,3,0,0],[0,3,0,0,2,2],[2,0,3,0,0,2],[3,2,0,2,3,0],[0,0,0,0,0,0],[0,2,0,2,2,0],[0,2,0,3,0,2],[0,2,0,0,0,3]],\"min_steps\":12},{\"id\":\"7016\",\"map\":[[2,3,4,0,0,3],[0,3,2,2,3,1],[0,2,2,3,0,0],[3,0,3,0,2,0],[3,0,0,0,2,2],[0,0,3,3,0,0],[0,3,0,3,2,0],[0,0,3,0,3,2],[0,2,2,3,0,0]],\"min_steps\":12},{\"id\":\"7020\",\"map\":[[2,3,0,4,3,3],[3,3,0,0,3,0],[0,2,0,3,2,0],[0,3,0,0,0,2],[3,2,0,0,0,0],[0,0,3,2,0,3],[0,3,0,3,2,0],[3,2,2,0,0,2],[0,0,2,1,3,2]],\"min_steps\":12},{\"id\":\"7024\",\"map\":[[1,3,2,0,0,3],[2,3,2,0,0,0],[0,2,3,0,3,3],[3,0,0,2,0,3],[2,3,0,0,0,3],[3,3,0,0,0,0],[2,0,3,0,0,2],[0,0,2,0,2,2],[4,2,3,0,3,0]],\"min_steps\":12},{\"id\":\"7032\",\"map\":[[0,0,0,0,3,4],[0,0,3,3,3,2],[2,2,3,3,0,0],[0,0,3,2,0,0],[0,2,0,2,3,2],[0,2,3,0,0,3],[2,3,3,0,0,2],[1,0,3,0,3,2],[0,0,3,0,0,2]],\"min_steps\":12},{\"id\":\"7033\",\"map\":[[1,0,0,3,0,3],[3,3,2,0,2,0],[0,3,3,2,0,2],[3,2,0,3,0,0],[4,2,2,2,0,0],[0,3,0,0,0,0],[3,3,3,0,0,2],[3,0,3,2,0,3],[2,0,0,0,0,2]],\"min_steps\":12},{\"id\":\"7035\",\"map\":[[3,0,0,2,0,4],[3,0,2,3,3,3],[0,0,2,3,0,2],[3,0,3,3,3,0],[2,2,0,0,0,0],[2,2,3,0,0,0],[0,0,2,3,0,0],[0,2,0,3,2,3],[0,0,3,1,2,0]],\"min_steps\":12},{\"id\":\"7036\",\"map\":[[2,3,1,0,0,2],[0,3,0,0,0,0],[2,0,2,0,0,3],[0,0,3,3,0,3],[0,2,2,0,0,3],[0,3,2,3,3,0],[0,3,2,0,0,2],[0,3,2,0,2,3],[2,0,3,3,4,0]],\"min_steps\":12},{\"id\":\"7037\",\"map\":[[2,0,0,0,0,3],[0,2,3,0,2,2],[0,0,3,0,2,0],[0,2,2,0,0,0],[3,2,3,0,0,3],[0,0,3,3,0,3],[3,2,3,0,0,3],[0,0,3,3,2,0],[4,3,1,2,0,2]],\"min_steps\":12},{\"id\":\"7039\",\"map\":[[2,0,3,3,2,0],[0,0,0,0,2,3],[1,3,0,0,0,2],[0,2,3,2,2,2],[0,0,3,0,0,0],[0,3,0,0,3,0],[3,0,0,2,3,2],[2,0,3,0,2,3],[0,4,3,0,3,3]],\"min_steps\":12},{\"id\":\"7040\",\"map\":[[0,2,3,3,4,0],[0,2,0,0,3,2],[0,0,3,0,2,0],[3,0,2,0,0,3],[2,0,0,3,0,3],[3,3,0,2,2,0],[2,2,3,0,2,0],[1,3,0,0,2,3],[0,0,0,3,0,3]],\"min_steps\":12},{\"id\":\"7041\",\"map\":[[3,3,0,2,3,1],[0,3,3,2,0,2],[0,2,0,0,0,0],[0,0,0,0,0,0],[3,3,3,2,3,0],[0,3,3,2,3,2],[4,0,3,0,2,0],[2,2,2,0,0,0],[0,3,2,0,3,0]],\"min_steps\":12},{\"id\":\"7004\",\"map\":[[2,0,0,2,0,0],[0,3,0,0,0,1],[0,2,0,0,0,0],[0,0,0,0,2,0],[0,0,3,3,3,2],[0,0,0,3,2,3],[0,0,2,0,0,3],[0,2,3,2,2,4],[3,2,2,0,3,0]],\"min_steps\":13},{\"id\":\"7009\",\"map\":[[4,0,3,1,0,2],[0,2,3,3,3,0],[0,2,3,2,2,0],[3,0,3,0,0,2],[0,0,0,0,0,0],[3,2,0,0,2,0],[3,2,0,0,2,0],[0,0,2,2,2,0],[0,0,0,0,3,0]],\"min_steps\":13},{\"id\":\"7014\",\"map\":[[3,4,2,3,0,0],[2,3,0,3,0,0],[0,2,2,0,0,0],[0,3,3,0,3,3],[0,0,0,0,0,0],[3,2,0,0,2,2],[2,2,2,2,0,3],[0,0,3,3,0,3],[1,2,0,3,3,0]],\"min_steps\":13},{\"id\":\"7015\",\"map\":[[2,3,4,0,3,0],[1,2,3,2,3,0],[0,0,3,0,2,0],[2,0,0,3,0,0],[2,2,0,2,0,3],[0,0,2,0,0,0],[3,0,0,3,3,0],[0,0,3,0,2,3],[3,0,3,2,3,2]],\"min_steps\":13},{\"id\":\"7025\",\"map\":[[2,3,1,0,3,3],[0,0,2,3,2,0],[0,2,0,0,0,3],[0,3,0,0,0,3],[2,0,0,3,2,0],[0,0,2,3,0,2],[2,0,3,2,0,3],[3,3,0,0,3,3],[2,4,0,2,0,0]],\"min_steps\":13},{\"id\":\"7030\",\"map\":[[2,0,1,2,0,0],[0,2,3,3,0,2],[2,3,3,3,0,2],[3,0,0,2,2,0],[0,3,0,3,2,0],[0,0,2,0,2,3],[3,3,0,3,3,2],[4,3,0,0,0,0],[0,0,0,0,0,3]],\"min_steps\":13},{\"id\":\"7031\",\"map\":[[0,2,2,3,4,2],[3,3,0,0,2,2],[0,0,0,3,2,0],[0,3,0,0,3,3],[0,2,0,2,3,0],[2,3,0,0,0,0],[3,3,0,3,0,2],[0,0,2,3,3,3],[1,0,2,0,0,0]],\"min_steps\":13},{\"id\":\"7038\",\"map\":[[4,2,3,3,2,3],[0,3,0,2,3,0],[0,0,0,2,0,2],[3,3,2,3,0,0],[0,3,0,3,2,3],[0,2,2,2,0,0],[1,3,0,0,3,0],[2,0,0,0,3,2],[0,0,3,0,0,0]],\"min_steps\":13},{\"id\":\"7011\",\"map\":[[0,1,0,0,2,0],[3,0,3,3,2,3],[0,3,3,2,0,0],[0,0,2,0,3,3],[2,3,2,0,0,0],[3,2,2,3,3,0],[2,0,2,2,0,4],[0,2,0,3,0,0],[0,0,0,3,0,3]],\"min_steps\":14},{\"id\":\"7017\",\"map\":[[2,0,0,3,0,3],[4,3,0,2,0,3],[3,0,0,0,3,0],[2,0,0,2,0,0],[3,0,0,3,0,0],[2,3,0,2,2,2],[1,3,3,0,2,2],[0,3,0,0,3,0],[0,2,0,3,3,2]],\"min_steps\":14},{\"id\":\"7019\",\"map\":[[0,3,0,2,3,1],[0,3,0,2,0,2],[0,2,2,0,3,3],[0,0,3,2,0,3],[0,0,3,2,2,0],[2,2,3,0,2,2],[0,3,0,0,3,0],[3,0,0,3,3,0],[0,0,0,3,0,4]],\"min_steps\":14},{\"id\":\"7021\",\"map\":[[0,0,0,0,2,4],[3,0,2,0,0,0],[3,0,2,3,3,3],[2,0,3,3,3,0],[2,0,0,0,2,3],[3,3,0,0,0,2],[1,0,3,0,2,2],[2,2,0,2,0,0],[0,0,3,3,0,3]],\"min_steps\":14},{\"id\":\"7022\",\"map\":[[4,0,0,0,0,0],[0,0,0,0,3,2],[3,3,2,3,3,2],[2,0,0,0,0,2],[0,0,3,0,3,3],[2,0,2,3,2,1],[3,2,3,0,0,3],[2,0,0,3,2,2],[3,3,0,0,0,0]],\"min_steps\":15},{\"id\":\"7028\",\"map\":[[0,2,1,3,0,2],[0,3,3,3,0,2],[0,0,0,3,0,2],[3,0,0,3,2,4],[2,0,0,3,2,2],[2,2,3,0,0,3],[0,2,0,0,0,0],[0,3,3,3,2,0],[0,3,0,3,0,0]],\"min_steps\":16},{\"id\":\"7034\",\"map\":[[1,0,0,3,2,0],[0,2,2,3,3,0],[3,0,0,2,0,3],[2,3,2,2,0,3],[0,0,3,0,0,3],[3,0,0,0,3,0],[2,3,0,3,2,4],[0,3,0,0,0,3],[0,2,0,0,2,2]],\"min_steps\":16},{\"id\":\"7012\",\"map\":[[1,3,3,3,0,0],[0,3,0,2,0,0],[0,0,0,3,0,2],[3,0,0,3,2,3],[0,0,2,0,0,3],[0,0,2,3,2,0],[2,2,3,2,3,2],[0,3,0,2,0,2],[0,3,4,3,0,0]],\"min_steps\":17},{\"id\":\"7013\",\"map\":[[0,1,0,0,3,3],[0,2,0,3,0,0],[2,3,0,0,0,0],[0,0,0,3,0,3],[0,3,0,2,3,2],[2,0,3,3,2,0],[0,2,2,3,0,2],[2,3,2,0,3,0],[0,3,3,0,2,4]],\"min_steps\":17},{\"id\":\"7018\",\"map\":[[0,0,0,0,0,2],[1,0,3,3,0,2],[3,3,0,3,2,3],[0,3,0,2,0,0],[0,3,0,0,2,2],[3,0,0,2,3,0],[0,3,3,3,0,0],[2,0,3,0,0,2],[2,4,2,0,3,2]],\"min_steps\":17}]]\r\n\r\n\r\n this.LEVEL_INFO.unshift([{\"id\":\"0001\",\"map\":[[3, 2, 2, 0, 2],[0, 0, 3, 3, 0],[1, 3, 0, 3, 2],[3, 0, 2, 3, 4],[3, 2, 3, 3, 2]],\"min_steps\":4}]);\r\n \r\n\r\n \r\n \r\n }\r\n\r\n\r\n static Authentication(){\r\n cc.fx.GameTool.Authentication();\r\n }\r\n\r\n \r\n static setCode(code){\r\n this.GM_INFO.scode = code;\r\n }\r\n}\r\n\r\n"]} \ No newline at end of file diff --git a/library/imports/ca/ca0f9934-a015-436e-9402-f8e30d4c5de6.js b/library/imports/ca/ca0f9934-a015-436e-9402-f8e30d4c5de6.js index 5ce5b65..3d55d19 100644 --- a/library/imports/ca/ca0f9934-a015-436e-9402-f8e30d4c5de6.js +++ b/library/imports/ca/ca0f9934-a015-436e-9402-f8e30d4c5de6.js @@ -36,9 +36,9 @@ var ItemRender = /** @class */ (function (_super) { } /**数据改变时调用 */ ItemRender.prototype.dataChanged = function () { - cc.fx.GameTool.subName(this.data.name, 6); + var name = cc.fx.GameTool.subName(this.data.name, 6); this.node.getChildByName("rankLab").getComponent(cc.Label).string = this.data.rank + ""; - this.node.getChildByName("nameLab").getComponent(cc.Label).string = this.data.name + ""; + this.node.getChildByName("nameLab").getComponent(cc.Label).string = name + ""; this.node.getChildByName("totalLab").getComponent(cc.Label).string = this.data.total + "%"; var timeTemp = cc.fx.GameTool.getTimeShenNong(this.data.time); this.node.getChildByName("timeLab").getComponent(cc.Label).string = timeTemp + ""; @@ -80,7 +80,7 @@ var ItemRender = /** @class */ (function (_super) { } }) .catch(function (error) { - console.error('Error fetching X-Info:', error); + // console.error('Error fetching X-Info:', error); }); cc.assetManager.loadRemote(url, { ext: '.png' }, function (err, texture) { if (texture) { @@ -91,7 +91,7 @@ var ItemRender = /** @class */ (function (_super) { } else { // console.log("设置头像失败",url); - console.log(err, texture); + // console.log(err,texture) } }); }; diff --git a/library/imports/ca/ca0f9934-a015-436e-9402-f8e30d4c5de6.js.map b/library/imports/ca/ca0f9934-a015-436e-9402-f8e30d4c5de6.js.map index 8423ada..5a8a663 100644 --- a/library/imports/ca/ca0f9934-a015-436e-9402-f8e30d4c5de6.js.map +++ b/library/imports/ca/ca0f9934-a015-436e-9402-f8e30d4c5de6.js.map @@ -1 +1 @@ -{"version":3,"sources":["assets\\Script\\module\\RankList\\ItemRender.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AAGM,IAAA,KAAwB,EAAE,CAAC,UAAU,EAAnC,OAAO,aAAA,EAAE,QAAQ,cAAkB,CAAC;AAG5C;IAAwC,8BAAY;IAApD;QAAA,qEAqEC;QApEG,QAAQ;QACD,UAAI,GAAO,IAAI,CAAC;QACvB,cAAc;QACP,eAAS,GAAU,CAAC,CAAC;;IAiEhC,CAAC;IA/DG,aAAa;IACN,gCAAW,GAAlB;QACI,EAAE,CAAC,EAAE,CAAC,QAAQ,CAAC,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,IAAI,EAAC,CAAC,CAAC,CAAC;QACzC,IAAI,CAAC,IAAI,CAAC,cAAc,CAAC,SAAS,CAAC,CAAC,YAAY,CAAC,EAAE,CAAC,KAAK,CAAC,CAAC,MAAM,GAAG,IAAI,CAAC,IAAI,CAAC,IAAI,GAAG,EAAE,CAAC;QACxF,IAAI,CAAC,IAAI,CAAC,cAAc,CAAC,SAAS,CAAC,CAAC,YAAY,CAAC,EAAE,CAAC,KAAK,CAAC,CAAC,MAAM,GAAG,IAAI,CAAC,IAAI,CAAC,IAAI,GAAG,EAAE,CAAC;QACxF,IAAI,CAAC,IAAI,CAAC,cAAc,CAAC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AE,KAAK,CAAC,CAAC;QACnD,CAAC,CAAC,CAAC;QACH,EAAE,CAAC,YAAY,CAAC,UAAU,CAAC,GAAG,EAAE,EAAC,GAAG,EAAC,MAAM,EAAC,EAAC,UAAC,GAAG,EAAE,OAAoB;YACnE,IAAG,OAAO,EAAC;gBACP,KAAI,CAAC,IAAI,CAAC,cAAc,CAAC,KAAK,CAAC,CAAC,cAAc,CAAC,KAAK,CAAC,CAAC,MAAM,GAAE,IAAI,CAAC;gBACnE,IAAI,MAAM,GAAG,KAAI,CAAC,IAAI,CAAC,cAAc,CAAC,KAAK,CAAC,CAAC,cAAc,CAAC,KAAK,CAAC,CAAC,YAAY,CAAC,EAAE,CAAC,MAAM,CAAC,CAAC;gBAC3F,MAAM,CAAC,WAAW,GAAG,IAAI,EAAE,CAAC,WAAW,CAAC,OAAO,CAAC,CAAC;gBACjD,4CAA4C;aAC/C;iBACG;gBACA,6BAA6B;gBAC7B,OAAO,CAAC,GAAG,CAAC,GAAG,EAAC,OAAO,CAAC,CAAA;aAC3B;QACL,CAAC,CAAC,CAAA;IACN,CAAC;IAlEgB,UAAU;QAD9B,OAAO;OACa,UAAU,CAqE9B;IAAD,iBAAC;CArED,AAqEC,CArEuC,EAAE,CAAC,SAAS,GAqEnD;kBArEoB,UAAU","file":"","sourceRoot":"/","sourcesContent":["\r\nimport List, { ListType } from \"./List\";\r\n\r\nconst { ccclass, property } = cc._decorator;\r\n\r\n@ccclass\r\nexport default class ItemRender extends cc.Component {\r\n /**数据 */\r\n public data:any = null;\r\n /**索引 0表示第一项*/\r\n public itemIndex:number = 0;\r\n\r\n /**数据改变时调用 */\r\n public dataChanged(){\r\n cc.fx.GameTool.subName(this.data.name,6);\r\n this.node.getChildByName(\"rankLab\").getComponent(cc.Label).string = this.data.rank + \"\";\r\n this.node.getChildByName(\"nameLab\").getComponent(cc.Label).string = this.data.name + \"\";\r\n this.node.getChildByName(\"totalLab\").getComponent(cc.Label).string = this.data.total + \"%\";\r\n let timeTemp = cc.fx.GameTool.getTimeShenNong(this.data.time);\r\n this.node.getChildByName(\"timeLab\").getComponent(cc.Label).string = timeTemp + \"\";\r\n this.node.getChildByName(\"rank\").getChildByName(\"one\").active = false;\r\n this.node.getChildByName(\"rank\").getChildByName(\"two\").active = false;\r\n this.node.getChildByName(\"rank\").getChildByName(\"three\").active = false;\r\n if(this.data.rank == 1){\r\n this.node.getChildByName(\"rank\").getChildByName(\"one\").active = true;\r\n this.node.getChildByName(\"rankLab\").active = false;\r\n }\r\n else if(this.data.rank == 2){\r\n this.node.getChildByName(\"rank\").getChildByName(\"two\").active = true;\r\n this.node.getChildByName(\"rankLab\").active = false;\r\n }\r\n else if(this.data.rank == 3){\r\n this.node.getChildByName(\"rank\").getChildByName(\"three\").active = true;\r\n this.node.getChildByName(\"rankLab\").active = false;\r\n }else{\r\n this.node.getChildByName(\"rankLab\").active = true;\r\n }\r\n this.setPic();\r\n } \r\n \r\n public setPic(){\r\n this.node.getChildByName(\"pic\").getChildByName(\"icon\").active = false;\r\n this.node.getChildByName(\"pic\").getChildByName(\"pic\").active= false;\r\n var self = this;\r\n let url = this.data.pic;\r\n fetch(url)\r\n .then(response => {\r\n return response.headers.get('Content-Length');\r\n })\r\n\r\n .then(errNo => {\r\n // console.log(this.data.rank,'X-Info:', errNo); // 输出X-ErrNo的值\r\n if(errNo == \"5093\"){\r\n // console.log(this.data.rank,\"没头像\");\r\n this.node.getChildByName(\"pic\").getChildByName(\"icon\").active = true;\r\n }\r\n })\r\n .catch(error => {\r\n console.error('Error fetching X-Info:', error);\r\n });\r\n cc.assetManager.loadRemote(url, {ext:'.png'},(err, texture:cc.Texture2D) => {\r\n if(texture){\r\n this.node.getChildByName(\"pic\").getChildByName(\"pic\").active= true;\r\n var sprite = this.node.getChildByName(\"pic\").getChildByName(\"pic\").getComponent(cc.Sprite);\r\n sprite.spriteFrame = new cc.SpriteFrame(texture);\r\n // console.log(this.data.rank,\"设置头像成功\",err);\r\n }\r\n else{\r\n // console.log(\"设置头像失败\",url);\r\n console.log(err,texture)\r\n }\r\n })\r\n }\r\n\r\n\r\n}\r\n"]} \ No newline at end of file +{"version":3,"sources":["assets\\Script\\module\\RankList\\ItemRender.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AAGM,IAAA,KAAwB,EAAE,CAAC,UAAU,EAAnC,OAAO,aAAA,EAAE,QAAQ,cAAkB,CAAC;AAG5C;IAAwC,8BAAY;IAApD;QAAA,qEAqEC;QApEG,QAAQ;QACD,UAAI,GAAO,IAAI,CAAC;QACvB,cAAc;QACP,eAAS,GAAU,CAAC,CAAC;;IAiEhC,CAAC;IA/DG,aAAa;IACN,gCAAW,GAAlB;QACI,IAAI,IAAI,GAAG,EAAE,CAAC,EAAE,CAAC,QAAQ,CAAC,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,IAAI,EAAC,CAAC,CAAC,CAAC;QACpD,IAAI,CAAC,IAAI,CAAC,cAAc,CAAC,SAAS,CAAC,CAAC,YAAY,CAAC,EAAE,CAAC,KAAK,CAAC,CAAC,MAAM,GAAG,IAAI,CAAC,IAAI,CAAC,IAAI,GAAG,EAAE,CAAC;QACxF,IAAI,CAAC,IAAI,CAAC,cAAc,CAAC,SAAS,CAAC,CAAC,YAAY,CAAC,EAAE,CAAC,KAAK,CAAC,CAAC,MAAM,GAAG,IAAI,GAAG,EAAE,CAAC;QAC9E,IAAI,CAAC,IAAI,CAAC,cAAc,CAAC,UAAU,CAAC,CAAC,YAAY,CAAC,EAAE,CAAC,KAAK,CAAC,CAAC,MAAM,GAAG,IAAI,CAAC,IAAI,CAAC,KAAK,GAAG,GAAG,CAAC;QAC3F,IAAI,QAAQ,GAAG,EAAE,CAAC,EAAE,CAAC,QAAQ,CAAC,eAAe,CAAC,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;QAC9D,IAAI,CAAC,IAAI,CAAC,cAAc,CAAC,SAAS,CAAC,CAAC,YAAY,CAAC,EAAE,CAAC,KAAK,CAAC,C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AC,KAAK,CAAC,CAAC,YAAY,CAAC,EAAE,CAAC,MAAM,CAAC,CAAC;gBAC3F,MAAM,CAAC,WAAW,GAAG,IAAI,EAAE,CAAC,WAAW,CAAC,OAAO,CAAC,CAAC;gBACjD,4CAA4C;aAC/C;iBACG;gBACA,6BAA6B;gBAC7B,2BAA2B;aAC9B;QACL,CAAC,CAAC,CAAA;IACN,CAAC;IAlEgB,UAAU;QAD9B,OAAO;OACa,UAAU,CAqE9B;IAAD,iBAAC;CArED,AAqEC,CArEuC,EAAE,CAAC,SAAS,GAqEnD;kBArEoB,UAAU","file":"","sourceRoot":"/","sourcesContent":["\r\nimport List, { ListType } from \"./List\";\r\n\r\nconst { ccclass, property } = cc._decorator;\r\n\r\n@ccclass\r\nexport default class ItemRender extends cc.Component {\r\n /**数据 */\r\n public data:any = null;\r\n /**索引 0表示第一项*/\r\n public itemIndex:number = 0;\r\n\r\n /**数据改变时调用 */\r\n public dataChanged(){\r\n let name = cc.fx.GameTool.subName(this.data.name,6);\r\n this.node.getChildByName(\"rankLab\").getComponent(cc.Label).string = this.data.rank + \"\";\r\n this.node.getChildByName(\"nameLab\").getComponent(cc.Label).string = name + \"\";\r\n this.node.getChildByName(\"totalLab\").getComponent(cc.Label).string = this.data.total + \"%\";\r\n let timeTemp = cc.fx.GameTool.getTimeShenNong(this.data.time);\r\n this.node.getChildByName(\"timeLab\").getComponent(cc.Label).string = timeTemp + \"\";\r\n this.node.getChildByName(\"rank\").getChildByName(\"one\").active = false;\r\n this.node.getChildByName(\"rank\").getChildByName(\"two\").active = false;\r\n this.node.getChildByName(\"rank\").getChildByName(\"three\").active = false;\r\n if(this.data.rank == 1){\r\n this.node.getChildByName(\"rank\").getChildByName(\"one\").active = true;\r\n this.node.getChildByName(\"rankLab\").active = false;\r\n }\r\n else if(this.data.rank == 2){\r\n this.node.getChildByName(\"rank\").getChildByName(\"two\").active = true;\r\n this.node.getChildByName(\"rankLab\").active = false;\r\n }\r\n else if(this.data.rank == 3){\r\n this.node.getChildByName(\"rank\").getChildByName(\"three\").active = true;\r\n this.node.getChildByName(\"rankLab\").active = false;\r\n }else{\r\n this.node.getChildByName(\"rankLab\").active = true;\r\n }\r\n this.setPic();\r\n } \r\n \r\n public setPic(){\r\n this.node.getChildByName(\"pic\").getChildByName(\"icon\").active = false;\r\n this.node.getChildByName(\"pic\").getChildByName(\"pic\").active= false;\r\n var self = this;\r\n let url = this.data.pic;\r\n fetch(url)\r\n .then(response => {\r\n return response.headers.get('Content-Length');\r\n })\r\n\r\n .then(errNo => {\r\n // console.log(this.data.rank,'X-Info:', errNo); // 输出X-ErrNo的值\r\n if(errNo == \"5093\"){\r\n // console.log(this.data.rank,\"没头像\");\r\n this.node.getChildByName(\"pic\").getChildByName(\"icon\").active = true;\r\n }\r\n })\r\n .catch(error => {\r\n // console.error('Error fetching X-Info:', error);\r\n });\r\n cc.assetManager.loadRemote(url, {ext:'.png'},(err, texture:cc.Texture2D) => {\r\n if(texture){\r\n this.node.getChildByName(\"pic\").getChildByName(\"pic\").active= true;\r\n var sprite = this.node.getChildByName(\"pic\").getChildByName(\"pic\").getComponent(cc.Sprite);\r\n sprite.spriteFrame = new cc.SpriteFrame(texture);\r\n // console.log(this.data.rank,\"设置头像成功\",err);\r\n }\r\n else{\r\n // console.log(\"设置头像失败\",url);\r\n // console.log(err,texture)\r\n }\r\n })\r\n }\r\n\r\n\r\n}\r\n"]} \ No newline at end of file diff --git a/library/uuid-to-mtime.json b/library/uuid-to-mtime.json index 928694b..6c26c58 100644 --- a/library/uuid-to-mtime.json +++ b/library/uuid-to-mtime.json @@ -10,8 +10,8 @@ "relativePath": "Scene" }, "4734c20c-0db8-4eb2-92ea-e692f4d70934": { - "asset": 1718679055991, - "meta": 1720605517840, + "asset": 1724813915381, + "meta": 1724814258404, "relativePath": "Script" }, "7b81d4e8-ec84-4716-968d-500ac1d78a54": { @@ -70,8 +70,8 @@ "relativePath": "Shader" }, "2880dc26-5b38-48bd-baba-daaec97499cb": { - "asset": 1718619532615, - "meta": 1718619583056, + "asset": 1724742919592, + "meta": 1724814258403, "relativePath": "res" }, "4eaf518b-35ec-4262-928d-4d497c3f2830": { @@ -80,48 +80,48 @@ "relativePath": "Scene\\GameScene.fire" }, "eaa8b84d-69d0-4170-9f7d-8179ea948cde": { - "asset": 1720605318013, - "meta": 1720605517842, + "asset": 1724814258376, + "meta": 1724814258404, "relativePath": "Script\\module" }, "8848cd9b-8115-456d-a656-2abcda1dadbe": { "asset": 1718619692450, - "meta": 1720605517844, + "meta": 1723434815937, "relativePath": "Script\\module\\Config" }, "13a0b173-d59e-4a9d-b5e3-4dbe4dc37cc1": { "asset": 1718619692458, - "meta": 1720605517844, + "meta": 1723434815938, "relativePath": "Script\\module\\Crypto" }, "b4e113c6-a987-4133-bfa0-3355d8ab4bd1": { "asset": 1718619692462, - "meta": 1720605517845, + "meta": 1723434815940, "relativePath": "Script\\module\\GameStart" }, "0487cacb-b94a-4ab6-a301-b6402ab0ac5d": { "asset": 1718619692462, - "meta": 1720605517846, + "meta": 1723434815942, "relativePath": "Script\\module\\Music" }, "ff6560d9-676d-42ad-8ec7-e44acb84ad9e": { "asset": 1718619692466, - "meta": 1720605517847, + "meta": 1723434815943, "relativePath": "Script\\module\\Notification" }, "d3520299-33dc-43d2-b522-d424efb5575d": { "asset": 1718619692474, - "meta": 1720605517847, + "meta": 1723434815944, "relativePath": "Script\\module\\RankList" }, "2af8f2ef-b8a0-43ad-a144-ef4a887f2fa9": { "asset": 1718619692478, - "meta": 1720605517849, + "meta": 1723434815946, "relativePath": "Script\\module\\Storage" }, "2a81f82d-8d16-44af-b947-44eea4dde54f": { "asset": 1718619692482, - "meta": 1720605517850, + "meta": 1723434815946, "relativePath": "Script\\module\\Tool" }, "e64e1a97-c93f-4257-ab34-80341d8ff79d": { @@ -136,7 +136,7 @@ }, "d54211e0-2d28-4528-88e3-e5fd7c9b59a2": { "asset": 1716189341583, - "meta": 1718260711351, + "meta": 1724814258871, "relativePath": "Script\\module\\RankList\\List.ts" }, "5c9b8159-89a3-4b32-b303-b3d4f7ac1c9f": { @@ -150,18 +150,18 @@ "relativePath": "Script\\module\\Storage\\Storage.ts" }, "771a3d9a-4013-4654-a777-fbaea0c93280": { - "asset": 1720412209513, - "meta": 1720605518151, + "asset": 1724210582706, + "meta": 1724814258706, "relativePath": "Script\\module\\Crypto\\HttpUtil.ts" }, "58403fe7-d7a2-426b-9b19-84d3236731a8": { - "asset": 1720174805252, - "meta": 1720605518223, + "asset": 1723016663003, + "meta": 1723434816622, "relativePath": "Script\\module\\Music\\AudioManager.ts" }, "9c08062d-4cf1-4b6e-a8ba-4a3881cc7e7d": { - "asset": 1720606674576, - "meta": 1720606674582, + "asset": 1723436390364, + "meta": 1723436390368, "relativePath": "Scene\\LoadScene.fire" }, "805c69df-dfdf-4759-97ae-5a7341f424c7": { @@ -171,17 +171,17 @@ }, "61d4c718-db3b-4b31-8221-f16bea3cf030": { "asset": 1720411081997, - "meta": 1720605518172, + "meta": 1724814258720, "relativePath": "Script\\module\\GameStart\\GameAppStart.ts" }, "ca0f9934-a015-436e-9402-f8e30d4c5de6": { - "asset": 1719476024626, - "meta": 1720605518248, + "asset": 1722331848349, + "meta": 1724814258746, "relativePath": "Script\\module\\RankList\\ItemRender.ts" }, "43bfc27a-ff6e-45b3-87c7-504d0f781397": { - "asset": 1720412213923, - "meta": 1720605518351, + "asset": 1724814168087, + "meta": 1724814258928, "relativePath": "Script\\module\\Tool\\GameTool.ts" }, "e74a9f7d-2031-4e69-bcb2-9998174088b2": { @@ -226,502 +226,502 @@ }, "9836134e-b892-4283-b6b2-78b5acf3ed45": { "asset": 1714966328642, - "meta": 1720605515002, + "meta": 1724814255818, "relativePath": "effects" }, "abc2cb62-7852-4525-a90d-d474487b88f2": { "asset": 1714966328642, - "meta": 1720605515140, + "meta": 1724814255938, "relativePath": "effects\\builtin-phong.effect" }, "e2f00085-c597-422d-9759-52c360279106": { "asset": 1714966328642, - "meta": 1720605515198, + "meta": 1724814255986, "relativePath": "effects\\builtin-toon.effect" }, "430eccbf-bf2c-4e6e-8c0c-884bbb487f32": { "asset": 1714966328642, - "meta": 1720605515216, + "meta": 1724814255994, "relativePath": "effects\\__builtin-editor-gizmo-line.effect" }, "6c5cf6e1-b044-4eac-9431-835644d57381": { "asset": 1714966328642, - "meta": 1720605515225, + "meta": 1724814256003, "relativePath": "effects\\__builtin-editor-gizmo-unlit.effect" }, "115286d1-2e10-49ee-aab4-341583f607e8": { "asset": 1714966328642, - "meta": 1720605515260, + "meta": 1724814256032, "relativePath": "effects\\__builtin-editor-gizmo.effect" }, "f8e6b000-5643-4b86-9080-aa680ce1f599": { "asset": 1714966328706, - "meta": 1720605515003, + "meta": 1724814255818, "relativePath": "image" }, "5c3eedba-6c41-4c0c-9ba7-d91f813cbd1c": { "asset": 1714966328721, - "meta": 1720605515005, + "meta": 1724814255818, "relativePath": "materials" }, "fc09f9bd-2cce-4605-b630-8145ef809ed6": { "asset": 1714966328721, - "meta": 1720605515006, + "meta": 1724814255818, "relativePath": "misc" }, "e851e89b-faa2-4484-bea6-5c01dd9f06e2": { "asset": 1714966328658, - "meta": 1720605515325, + "meta": 1724814256125, "relativePath": "image\\default_btn_normal.png" }, "db019bf7-f71c-4111-98cf-918ea180cb48": { "asset": 1714966328737, - "meta": 1720605515008, + "meta": 1724814255822, "relativePath": "model" }, "4bab67cb-18e6-4099-b840-355f0473f890": { "asset": 1714966328689, - "meta": 1720605515395, + "meta": 1724814256121, "relativePath": "image\\default_scrollbar_bg.png" }, "e39e96e6-6f6e-413f-bcf1-ac7679bb648a": { "asset": 1714966328737, - "meta": 1720605515333, + "meta": 1724814256093, "relativePath": "model\\prefab" }, "617323dd-11f4-4dd3-8eec-0caf6b3b45b9": { "asset": 1714966328689, - "meta": 1720605515383, + "meta": 1724814256133, "relativePath": "image\\default_scrollbar_vertical_bg.png" }, "71561142-4c83-4933-afca-cb7a17f67053": { "asset": 1714966328658, - "meta": 1720605515331, + "meta": 1724814256077, "relativePath": "image\\default_btn_disabled.png" }, "600301aa-3357-4a10-b086-84f011fa32ba": { "asset": 1714966328642, - "meta": 1720605515379, + "meta": 1724814256085, "relativePath": "image\\default-particle.png" }, "edd215b9-2796-4a05-aaf5-81f96c9281ce": { "asset": 1714966328658, - "meta": 1720605515317, + "meta": 1724814256073, "relativePath": "image\\default_editbox_bg.png" }, "b43ff3c2-02bb-4874-81f7-f2dea6970f18": { "asset": 1714966328658, - "meta": 1720605515329, + "meta": 1724814256077, "relativePath": "image\\default_btn_pressed.png" }, "567dcd80-8bf4-4535-8a5a-313f1caf078a": { "asset": 1714966328673, - "meta": 1720605515315, + "meta": 1724814256093, "relativePath": "image\\default_radio_button_off.png" }, "cfef78f1-c8df-49b7-8ed0-4c953ace2621": { "asset": 1714966328673, - "meta": 1720605515320, + "meta": 1724814256089, "relativePath": "image\\default_progressbar.png" }, "f6e6dd15-71d1-4ffe-ace7-24fd39942c05": { "asset": 1714966328752, - "meta": 1720605515009, + "meta": 1724814255822, "relativePath": "obsolete" }, "0291c134-b3da-4098-b7b5-e397edbe947f": { "asset": 1714966328689, - "meta": 1720605515377, + "meta": 1724814256121, "relativePath": "image\\default_scrollbar.png" }, "c4480a0a-6ac5-443f-8b40-361a14257fc8": { "asset": 1714966328706, - "meta": 1720605515755, + "meta": 1724814256400, "relativePath": "materials\\builtin-phong.mtl" }, "f743d2b6-b7ea-4c14-a55b-547ed4d0a045": { "asset": 1714966328752, - "meta": 1720605515010, + "meta": 1724814255822, "relativePath": "particle" }, "9d60001f-b5f4-4726-a629-2659e3ded0b8": { "asset": 1714966328673, - "meta": 1720605515381, + "meta": 1724814256125, "relativePath": "image\\default_radio_button_on.png" }, "a87cc147-01b2-43f8-8e42-a7ca90b0c757": { "asset": 1714966328721, - "meta": 1720605515674, + "meta": 1724814256319, "relativePath": "model\\prefab\\box.prefab" }, "d81ec8ad-247c-4e62-aa3c-d35c4193c7af": { "asset": 1714966328673, - "meta": 1720605515386, + "meta": 1724814256129, "relativePath": "image\\default_panel.png" }, "fe1417b6-fe6b-46a4-ae7c-9fd331f33a2a": { "asset": 1714966328737, - "meta": 1720605515677, + "meta": 1724814256323, "relativePath": "model\\prefab\\capsule.prefab" }, "ae6c6c98-11e4-452f-8758-75f5c6a56e83": { "asset": 1714966328831, - "meta": 1720605515011, + "meta": 1724814255822, "relativePath": "prefab" }, "d6d3ca85-4681-47c1-b5dd-d036a9d39ea2": { "asset": 1714966328689, - "meta": 1720605515392, + "meta": 1724814256089, "relativePath": "image\\default_scrollbar_vertical.png" }, "b5fc2cf2-7942-483d-be1f-bbeadc4714ad": { "asset": 1714966328737, - "meta": 1720605515670, + "meta": 1724814256339, "relativePath": "model\\prefab\\cone.prefab" }, "1c5e4038-953a-44c2-b620-0bbfc6170477": { "asset": 1714966328737, - "meta": 1720605515680, + "meta": 1724814256343, "relativePath": "model\\prefab\\cylinder.prefab" }, "99170b0b-d210-46f1-b213-7d9e3f23098a": { "asset": 1714966328673, - "meta": 1720605515322, + "meta": 1724814256129, "relativePath": "image\\default_progressbar_bg.png" }, "3f376125-a699-40ca-ad05-04d662eaa1f2": { "asset": 1714966328737, - "meta": 1720605515672, + "meta": 1724814256343, "relativePath": "model\\prefab\\plane.prefab" }, "6c9ef10d-b479-420b-bfe6-39cdda6a8ae0": { "asset": 1714966328737, - "meta": 1720605515684, + "meta": 1724814256343, "relativePath": "model\\prefab\\quad.prefab" }, "6e056173-d285-473c-b206-40a7fff5386e": { "asset": 1714966328689, - "meta": 1720605515390, + "meta": 1724814256129, "relativePath": "image\\default_sprite.png" }, "2d9a4b85-b0ab-4c46-84c5-18f393ab2058": { "asset": 1714966328737, - "meta": 1720605515689, + "meta": 1724814256347, "relativePath": "model\\prefab\\sphere.prefab" }, "de510076-056b-484f-b94c-83bef217d0e1": { "asset": 1714966328737, - "meta": 1720605515675, + "meta": 1724814256347, "relativePath": "model\\prefab\\torus.prefab" }, "0275e94c-56a7-410f-bd1a-fc7483f7d14a": { "asset": 1714966328705, - "meta": 1720605515388, + "meta": 1724814256133, "relativePath": "image\\default_sprite_splash.png" }, "897ef7a1-4860-4f64-968d-f5924b18668a": { "asset": 1714966328752, - "meta": 1720605515401, + "meta": 1724814256141, "relativePath": "prefab\\2d-camera.prefab" }, "70d7cdb0-04cd-41bb-9480-c06a4785f386": { "asset": 1714966328768, - "meta": 1720605515404, + "meta": 1724814256141, "relativePath": "prefab\\3d-camera.prefab" }, "a3ee0214-b432-4865-9666-4a3211814282": { "asset": 1714966328800, - "meta": 1720605515405, + "meta": 1724814256141, "relativePath": "prefab\\light" }, "ed88f13d-fcad-4848-aa35-65a2cb973584": { "asset": 1714966328768, - "meta": 1720605515412, + "meta": 1724814256145, "relativePath": "prefab\\3d-stage.prefab" }, "61aeb05b-3b32-452b-8eed-2b76deeed554": { "asset": 1714966328783, - "meta": 1720605515419, + "meta": 1724814256153, "relativePath": "prefab\\editbox.prefab" }, "972b9a4d-47ee-4c74-b5c3-61d8a69bc29f": { "asset": 1714966328768, - "meta": 1720605515407, + "meta": 1724814256149, "relativePath": "prefab\\button.prefab" }, "70bbeb73-6dc2-4ee4-8faf-76b3a0e34ec4": { "asset": 1714966328768, - "meta": 1720605515410, + "meta": 1724814256149, "relativePath": "prefab\\3d-particle.prefab" }, "2c937608-2562-40ea-b264-7395df6f0cea": { "asset": 1714966328768, - "meta": 1720605515416, + "meta": 1724814256149, "relativePath": "prefab\\canvas.prefab" }, "27756ebb-3d33-44b0-9b96-e858fadd4dd4": { "asset": 1714966328783, - "meta": 1720605515424, + "meta": 1724814256157, "relativePath": "prefab\\label.prefab" }, "785a442c-3ceb-45be-a46e-7317f625f3b9": { "asset": 1714966328783, - "meta": 1720605515427, + "meta": 1724814256162, "relativePath": "prefab\\layout.prefab" }, "2be36297-9abb-4fee-8049-9ed5e271da8a": { "asset": 1714966328721, - "meta": 1720605515487, + "meta": 1724814256198, "relativePath": "misc\\default_video.mp4" }, "4a37dd57-78cd-4cec-aad4-f11a73d12b63": { "asset": 1714966328800, - "meta": 1720605515432, + "meta": 1724814256170, "relativePath": "prefab\\richtext.prefab" }, "cd33edea-55f5-46c2-958d-357a01384a36": { "asset": 1714966328800, - "meta": 1720605515429, + "meta": 1724814256162, "relativePath": "prefab\\particlesystem.prefab" }, "ca8401fe-ad6e-41a8-bd46-8e3e4e9945be": { "asset": 1714966328800, - "meta": 1720605515434, + "meta": 1724814256166, "relativePath": "prefab\\pageview.prefab" }, "5965ffac-69da-4b55-bcde-9225d0613c28": { "asset": 1714966328800, - "meta": 1720605515436, + "meta": 1724814256166, "relativePath": "prefab\\progressBar.prefab" }, "c25b9d50-c8fc-4d27-beeb-6e7c1f2e5c0f": { "asset": 1714966328706, - "meta": 1720605515463, + "meta": 1724814256198, "relativePath": "image\\default_toggle_disabled.png" }, "32044bd2-481f-4cf1-a656-e2b2fb1594eb": { "asset": 1714966328800, - "meta": 1720605515439, + "meta": 1724814256174, "relativePath": "prefab\\scrollview.prefab" }, "0004d1cf-a0ad-47d8-ab17-34d3db9d35a3": { "asset": 1714966328800, - "meta": 1720605515441, + "meta": 1724814256170, "relativePath": "prefab\\slider.prefab" }, "96083d03-c332-4a3f-9386-d03e2d19e8ee": { "asset": 1714966328815, - "meta": 1720605515450, + "meta": 1724814256182, "relativePath": "prefab\\sprite.prefab" }, "b181c1e4-0a72-4a91-bfb0-ae6f36ca60bd": { "asset": 1714966328706, - "meta": 1720605515472, + "meta": 1724814256190, "relativePath": "image\\default_toggle_pressed.png" }, "d8afc78c-4eac-4a9f-83dd-67bc70344d33": { "asset": 1714966328862, - "meta": 1720605515012, + "meta": 1724814255822, "relativePath": "resources" }, "294c1663-4adf-4a1e-a795-53808011a38a": { "asset": 1714966328862, - "meta": 1720605515464, + "meta": 1724814256190, "relativePath": "resources\\effects" }, "73a0903d-d80e-4e3c-aa67-f999543c08f5": { "asset": 1714966328706, - "meta": 1720605515492, + "meta": 1724814256190, "relativePath": "image\\default_toggle_checkmark.png" }, "bbee2217-c261-49bd-a8ce-708d6bcc3500": { "asset": 1714966328893, - "meta": 1720605515466, + "meta": 1724814256194, "relativePath": "resources\\materials" }, "d29077ba-1627-4a72-9579-7b56a235340c": { "asset": 1714966328706, - "meta": 1720605515506, + "meta": 1724814256194, "relativePath": "image\\default_toggle_normal.png" }, "30682f87-9f0d-4f17-8a44-72863791461b": { "asset": 1714966328831, - "meta": 1720605515505, + "meta": 1724814256222, "relativePath": "resources\\effects\\builtin-2d-graphics.effect" }, "144c3297-af63-49e8-b8ef-1cfa29b3be28": { "asset": 1714966328831, - "meta": 1720605515516, + "meta": 1724814256230, "relativePath": "resources\\effects\\builtin-2d-gray-sprite.effect" }, "1f55e3be-b89b-4b79-88de-47fd31018044": { "asset": 1714966328815, - "meta": 1720605515473, + "meta": 1724814256198, "relativePath": "prefab\\sprite_splash.prefab" }, "f18742d7-56d2-4eb5-ae49-2d9d710b37c8": { "asset": 1714966328831, - "meta": 1720605515528, + "meta": 1724814256239, "relativePath": "resources\\effects\\builtin-2d-label.effect" }, "7de03a80-4457-438d-95a7-3e7cdffd6086": { "asset": 1714966328815, - "meta": 1720605515476, + "meta": 1724814256206, "relativePath": "prefab\\tiledmap.prefab" }, "0e93aeaa-0b53-4e40-b8e0-6268b4e07bd7": { "asset": 1714966328831, - "meta": 1720605515539, + "meta": 1724814256247, "relativePath": "resources\\effects\\builtin-2d-spine.effect" }, "2874f8dd-416c-4440-81b7-555975426e93": { "asset": 1714966328846, - "meta": 1720605515552, + "meta": 1724814256255, "relativePath": "resources\\effects\\builtin-2d-sprite.effect" }, "829a282c-b049-4019-bd38-5ace8d8a6417": { "asset": 1714966328846, - "meta": 1720605515617, + "meta": 1724814256299, "relativePath": "resources\\effects\\builtin-3d-particle.effect" }, "2a7c0036-e0b3-4fe1-8998-89a54b8a2bec": { "asset": 1714966328846, - "meta": 1720605515639, + "meta": 1724814256315, "relativePath": "resources\\effects\\builtin-3d-trail.effect" }, "8a96b965-2dc0-4e03-aa90-3b79cb93b5b4": { "asset": 1714966328752, - "meta": 1720605515468, + "meta": 1724814256202, "relativePath": "obsolete\\atom.png" }, "c0040c95-c57f-49cd-9cbc-12316b73d0d4": { "asset": 1714966328846, - "meta": 1720605515647, + "meta": 1724814256323, "relativePath": "resources\\effects\\builtin-clear-stencil.effect" }, "6d91e591-4ce0-465c-809f-610ec95019c6": { "asset": 1714966328862, - "meta": 1720605515664, + "meta": 1724814256335, "relativePath": "resources\\effects\\builtin-unlit.effect" }, "0e42ba95-1fa1-46aa-b2cf-143cd1bcee2c": { "asset": 1714966328815, - "meta": 1720605515478, + "meta": 1724814256210, "relativePath": "prefab\\tiledtile.prefab" }, "0d784963-d024-4ea6-a7db-03be0ad63010": { "asset": 1714966328815, - "meta": 1720605515481, + "meta": 1724814256206, "relativePath": "prefab\\toggle.prefab" }, "bf0a434c-84dd-4a8e-a08a-7a36f180cc75": { "asset": 1714966328815, - "meta": 1720605515483, + "meta": 1724814256210, "relativePath": "prefab\\toggleContainer.prefab" }, "d1b8be49-b0a0-435c-83b7-552bed4bbe35": { "asset": 1714966328815, - "meta": 1720605515485, + "meta": 1724814256222, "relativePath": "prefab\\toggleGroup.prefab" }, "232d2782-c4bd-4bb4-9e01-909f03d6d3b9": { "asset": 1714966328815, - "meta": 1720605515490, + "meta": 1724814256210, "relativePath": "prefab\\videoplayer.prefab" }, "61906da3-7003-4bda-9abc-5769c76faee4": { "asset": 1714966328783, - "meta": 1720605515682, + "meta": 1724814256351, "relativePath": "prefab\\light\\ambient.prefab" }, "8c5001fd-07ee-4a4b-a8a0-63e15195e94d": { "asset": 1714966328831, - "meta": 1720605515541, + "meta": 1724814256303, "relativePath": "prefab\\webview.prefab" }, "d0a82d39-bede-46c4-b698-c81ff0dedfff": { "asset": 1714966328752, - "meta": 1720605515470, + "meta": 1724814256202, "relativePath": "particle\\atom.png" }, "f5331fd2-bf42-4ee3-a3fd-3e1657600eff": { "asset": 1714966328800, - "meta": 1720605515691, + "meta": 1724814256351, "relativePath": "prefab\\light\\spot.prefab" }, "0cf30284-9073-46bc-9eba-e62b69dbbff3": { "asset": 1714966328800, - "meta": 1720605515687, + "meta": 1724814256347, "relativePath": "prefab\\light\\point.prefab" }, "ddb99b39-7004-47cd-9705-751905c43c46": { "asset": 1714966328800, - "meta": 1720605515686, + "meta": 1724814256351, "relativePath": "prefab\\light\\directional.prefab" }, "6f801092-0c37-4f30-89ef-c8d960825b36": { "asset": 1714966328862, - "meta": 1720605515785, + "meta": 1724814256420, "relativePath": "resources\\materials\\builtin-2d-base.mtl" }, "a153945d-2511-4c14-be7b-05d242f47d57": { "asset": 1714966328862, - "meta": 1720605515784, + "meta": 1724814256420, "relativePath": "resources\\materials\\builtin-2d-graphics.mtl" }, "eca5d2f2-8ef6-41c2-bbe6-f9c79d09c432": { "asset": 1714966328878, - "meta": 1720605515791, + "meta": 1724814256424, "relativePath": "resources\\materials\\builtin-2d-sprite.mtl" }, "7afd064b-113f-480e-b793-8817d19f63c3": { "asset": 1714966328878, - "meta": 1720605515792, + "meta": 1724814256420, "relativePath": "resources\\materials\\builtin-2d-spine.mtl" }, "432fa09c-cf03-4cff-a186-982604408a07": { "asset": 1714966328878, - "meta": 1720605515793, + "meta": 1724814256424, "relativePath": "resources\\materials\\builtin-3d-particle.mtl" }, "466d4f9b-e5f4-4ea8-85d5-3c6e9a65658a": { "asset": 1714966328878, - "meta": 1720605515787, + "meta": 1724814256420, "relativePath": "resources\\materials\\builtin-3d-trail.mtl" }, "2a296057-247c-4a1c-bbeb-0548b6c98650": { "asset": 1714966328893, - "meta": 1720605515789, + "meta": 1724814256424, "relativePath": "resources\\materials\\builtin-unlit.mtl" }, "cf7e0bb8-a81c-44a9-ad79-d28d43991032": { "asset": 1714966328878, - "meta": 1720605515788, + "meta": 1724814256424, "relativePath": "resources\\materials\\builtin-clear-stencil.mtl" }, "e02d87d4-e599-4d16-8001-e14891ac6506": { "asset": 1714966328878, - "meta": 1720605515786, + "meta": 1724814256420, "relativePath": "resources\\materials\\builtin-2d-label.mtl" }, "3a7bb79f-32fd-422e-ada2-96f518fed422": { "asset": 1714966328862, - "meta": 1720605515790, + "meta": 1724814256420, "relativePath": "resources\\materials\\builtin-2d-gray-sprite.mtl" }, "b2687ac4-099e-403c-a192-ff477686f4f5": { "asset": 1714966328752, - "meta": 1720605515817, + "meta": 1724814256446, "relativePath": "particle\\atom.plist" }, "b8223619-7e38-47c4-841f-9160c232495a": { "asset": 1714966328752, - "meta": 1720605515818, + "meta": 1724814256446, "relativePath": "obsolete\\atom.plist" }, "954fec8b-cd16-4bb9-a3b7-7719660e7558": { "asset": 1714966328737, - "meta": 1720605517778, + "meta": 1724814258345, "relativePath": "model\\primitives.fbx" }, "e8b23e56-8d10-44ad-a8f0-2e637cc45533": { @@ -731,27 +731,52 @@ }, "bdc76845-baea-4381-911e-af437cccf839": { "asset": 1720605318016, - "meta": 1720605517848, + "meta": 1723434815945, "relativePath": "Script\\module\\Share" }, "7290c680-dfdc-4c59-9736-a614cc2a8bcf": { - "asset": 1720427814120, - "meta": 1720605518270, + "asset": 1724747593286, + "meta": 1724814258892, "relativePath": "Script\\module\\Share\\share.ts" }, - "b42c4fc1-4cd1-4b12-b206-930cea3d49ca": { - "asset": 1720419330469, - "meta": 1720605518358, - "relativePath": "Script\\module\\Share.zip" - }, "454ad829-851a-40ea-8ab9-941e828357ca": { - "asset": 1720606628700, - "meta": 1720606629712, + "asset": 1720606689492, + "meta": 1722936011378, "relativePath": "Script\\Load.ts" }, "c5692be7-8703-45e4-9f67-23b54d290356": { - "asset": 1720606662600, - "meta": 1720606663284, + "asset": 1724814244271, + "meta": 1724814258643, "relativePath": "Script\\module\\Config\\GameConfig.ts" + }, + "ec0a44ff-c813-4573-8b85-268526211437": { + "asset": 1723434789315, + "meta": 1723434815936, + "relativePath": "Script\\Sdk" + }, + "8a024faa-e4af-4cae-9c5c-693bee7120c1": { + "asset": 1723104058083, + "meta": 1723434815965, + "relativePath": "Script\\Sdk\\DouyinEntranceView.ts" + }, + "0d272a57-5428-450e-a8b9-1574c3d89951": { + "asset": 1723192822148, + "meta": 1723434816030, + "relativePath": "Script\\Sdk\\MiniGameManager.ts" + }, + "c1af99dd-ee03-40f7-9609-d3887d0dd357": { + "asset": 1723176553474, + "meta": 1723434816251, + "relativePath": "Script\\Sdk\\MiniGameSdk.ts" + }, + "8162ee52-27a1-40fa-b8d8-b05e309020cd": { + "asset": 1724742760071, + "meta": 1724742919602, + "relativePath": "res\\SourceHanSerifCN-Bold.ttf" + }, + "ba08509d-1972-42d5-aa39-2bcd83804450": { + "asset": 1724742934631, + "meta": 1724742968972, + "relativePath": "res\\SourceHanSerifCN-Medium.ttf" } } \ No newline at end of file diff --git a/local/layout.editor.json b/local/layout.editor.json index b217a60..c91f981 100644 --- a/local/layout.editor.json +++ b/local/layout.editor.json @@ -13,13 +13,13 @@ "type": "dock-h", "children": [ { - "width": 205, + "width": 252, "height": 556.3333740234375, "type": "dock-v", "children": [ { - "width": 205, - "height": 300.1770935058594, + "width": 252, + "height": 300.2708435058594, "type": "panel", "active": 0, "children": [ @@ -27,8 +27,8 @@ ] }, { - "width": 205, - "height": 253.15625, + "width": 252, + "height": 253.0625, "type": "panel", "active": 0, "children": [ @@ -38,7 +38,7 @@ ] }, { - "width": 750.9896240234375, + "width": 704, "height": 556.3333740234375, "type": "panel", "active": 0, @@ -92,6 +92,12 @@ "y": 0, "width": 1016, "height": 672 + }, + "mini_font": { + "x": 374, + "y": 0, + "width": 516, + "height": 672 } }, "panelLabelWidth": {} diff --git a/packages/字体精简工具/dist/index.js b/packages/字体精简工具/dist/index.js new file mode 100644 index 0000000..08bc975 --- /dev/null +++ b/packages/字体精简工具/dist/index.js @@ -0,0 +1 @@ +global.pluginNodeModulesPath=Editor.url("packages://mini_font/node_modules"),global.pluginDistPath="packages://mini_font/dist";var t=Editor.url("packages://mini_font/libs/fixrequire.js");t&&""!==t&&require(t);var e=require("fs"),n=require("path");function i(t){if(t&&t.__esModule)return t;var e=Object.create(null);return t&&Object.keys(t).forEach((function(n){if("default"!==n){var i=Object.getOwnPropertyDescriptor(t,n);Object.defineProperty(e,n,i.get?i:{enumerable:!0,get:function(){return t[n]}})}})),e.default=t,Object.freeze(e)}var s=i(e),a=i(n),r=require("fontmin"),o=function(){this.input_path="",this.out_path="",this.text_content="",this.text_content2="",this.switch_number=!0,this.switch_lowercase_letters=!0,this.switch_capital_letters=!0,this.switch_symbol_letters=!0,this.switch_find_ts=!0,this.switch_find_js=!0,this.switch_find_json=!0},_=["0","1","2","3","4","5","6","7","8","9"],c=["a","b","c","d","e","f","g","h","i","j","k","l","m","n","o","p","q","r","s","t","u","v","w","x","y","z"],l=["A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z"],h=['!@#$%^&*()_+;.,<>:"{}[]=-|`'],u=function(){function t(){}return t.init=function(t){var e=this;this.panel_context=t,this.cfg_path=Editor.Project.path+"/settings/font_cfg.json",s.existsSync(this.cfg_path)?this.setting_data=JSON.parse(s.readFileSync(this.cfg_path,"utf-8").toString()):this.setting_data=new o,this.read_path(),this.panel_context.$btn_find.addEventListener("confirm",(function(){e.panel_context.$text_content2.value="";var t="";e.dir(Editor.Project.path+"/assets",(function(n){var i=function(n){s.readFile(n,(function(n,i){if(n)Editor.error(n);else for(var s=i.toString(),a=0;a=0){var s=Editor.remote.assetdb.fspathToUrl(i.path);Editor.remote.assetdb.refresh(s)}e.save()}}))}else Editor.warn("\u8f93\u51fa\u8def\u5f84\u4e0d\u80fd\u4e3a\u7a7a!");else Editor.warn("\u8f93\u5165\u8def\u5f84\u4e0d\u80fd\u4e3a\u7a7a!");else Editor.warn("\u5185\u5bb9\u4e0d\u80fd\u4e3a\u7a7a!")}))},t.save=function(){this.setting_data.text_content=this.panel_context.$text_content.value,this.setting_data.text_content2=this.panel_context.$text_content2.value,this.setting_data.switch_number=this.panel_context.$switch_number.value,this.setting_data.switch_symbol_letters=this.panel_context.$switch_symbol_letters.value,this.setting_data.switch_capital_letters=this.panel_context.$switch_capital_letters.value,this.setting_data.switch_lowercase_letters=this.panel_context.$switch_lowercase_letters.value,this.setting_data.switch_find_js=this.panel_context.$switch_find_js.value,this.setting_data.switch_find_json=this.panel_context.$switch_find_json.value,this.setting_data.switch_find_ts=this.panel_context.$switch_find_ts.value,s.writeFile(this.cfg_path,JSON.stringify(this.setting_data),(function(t){t&&Editor.error(t)}))},t.read_path=function(){this.panel_context.$input_path.value=this.setting_data.input_path,this.panel_context.$out_path.value=this.setting_data.out_path,this.panel_context.$text_content.value=this.setting_data.text_content,this.panel_context.$text_content2.value=this.setting_data.text_content2,this.panel_context.$switch_number.value=this.setting_data.switch_number,this.panel_context.$switch_symbol_letters.value=this.setting_data.switch_symbol_letters,this.panel_context.$switch_capital_letters.value=this.setting_data.switch_capital_letters,this.panel_context.$switch_lowercase_letters.value=this.setting_data.switch_lowercase_letters,this.panel_context.$switch_find_js.value=this.setting_data.switch_find_js,this.panel_context.$switch_find_json.value=this.setting_data.switch_find_json,this.panel_context.$switch_find_ts.value=this.setting_data.switch_find_ts},t.check_number=function(t){for(var e=0;e<_.length;e++){var n=_[e];this.panel_context.$switch_number.value&&-1===t.indexOf(n)&&(t+=n)}return t},t.check_lowercase_letters=function(t){for(var e=0;e\r\n\r\n\r\n \r\n \u5b57\u4f53\u7626\u8eab\u5de5\u5177\r\n\r\n\r\n
\r\n
\u8f93\u5165\u8def\u5f84
\r\n \r\n \u9009\u62e9\r\n
\r\n\r\n
\r\n
\u8f93\u51fa\u8def\u5f84
\r\n \r\n \u9009\u62e9\r\n
\r\n
\r\n \r\n \r\n \r\n \r\n
\r\n \r\n
\u67e5\u627e\u5f53\u524d\u9879\u76ee\u4e2d\u6240\u6709\u6c49\u5b57
\r\n
\r\n json\r\n ts\r\n js\r\n \u67e5\u627e\r\n
\r\n
\r\n
\r\n
\r\n\x3c!--clear both\u89e3\u51b3float\u7684\u9519\u4e71\u95ee\u9898--\x3e\r\n
\r\n
\r\n \u6570\u5b57\r\n \u5927\u5199\u5b57\u6bcd\r\n \u5c0f\u5199\u5b57\u6bcd\r\n \u7b26\u53f7\r\n
\r\n
\r\n \u751f\u6210\r\n
\r\n\r\n\r\n\r\n',$:{input_path:"#input_path",out_path:"#out_path",btn_input_path:"#btn_input_path",btn_out_path:"#btn_out_path",text_content:"#text_content",text_content2:"#text_content2",btn_ok:"#btn_ok",btn_find:"#btn_find",switch_number:"#switch_number",switch_lowercase_letters:"#switch_lowercase_letters",switch_capital_letters:"#switch_capital_letters",switch_symbol_letters:"#switch_symbol_letters",switch_find_js:"#switch_find_js",switch_find_ts:"#switch_find_ts",switch_find_json:"#switch_find_json"},ready:function(){u.init(this)},messages:{}}); diff --git a/packages/字体精简工具/dist/main.js b/packages/字体精简工具/dist/main.js new file mode 100644 index 0000000..d8d839e --- /dev/null +++ b/packages/字体精简工具/dist/main.js @@ -0,0 +1 @@ +global.pluginNodeModulesPath=Editor.url("packages://mini_font/node_modules"),global.pluginDistPath="packages://mini_font/dist";var e=Editor.url("packages://mini_font/libs/fixrequire.js");e&&""!==e&&require(e),Object.defineProperty(exports,"__esModule",{value:!0});var o={open:function(){Editor.Panel.open("mini_font")}};exports.load=function(){},exports.messages=o,exports.unload=function(){}; diff --git a/packages/字体精简工具/libs/fixrequire.js b/packages/字体精简工具/libs/fixrequire.js new file mode 100644 index 0000000..29a85ee --- /dev/null +++ b/packages/字体精简工具/libs/fixrequire.js @@ -0,0 +1,61 @@ +// 'index.' character codes +if (Editor.remote.App.version === "2.4.5") return; +const pluginDistPath = Editor.url(global.pluginDistPath); +const Module = require.main.constructor; +const NativeModule = process.NativeModule; +const pluginNodeModulesPath = global.pluginNodeModulesPath; +// const panelId +if (!process.mainModule.paths.includes(pluginNodeModulesPath)) { + process.mainModule.paths.push(pluginNodeModulesPath) +} +Module._resolveFilename = function(request, parent, isMain, options) { + if (NativeModule.canBeRequiredByUsers(request)) { + return request; + } + + var paths; + + if (typeof options === 'object' && options !== null && + Array.isArray(options.paths)) { + const fakeParent = new Module('', null); + + paths = []; + + for (var i = 0; i < options.paths.length; i++) { + const path = options.paths[i]; + fakeParent.paths = Module._nodeModulePaths(path); + const lookupPaths = Module._resolveLookupPaths(request, fakeParent, true); + + for (var j = 0; j < lookupPaths.length; j++) { + if (!paths.includes(lookupPaths[j])) + paths.push(lookupPaths[j]); + } + } + } else { + paths = Module._resolveLookupPaths(request, parent, true); + } + + // Look up the filename first, since that's the cache key. + let filename = Module._findPath(request, paths, isMain); + if (!filename) { + //找不到,尝试去插件目录找啊--------- + filename = Module._findPath(request, [pluginDistPath], isMain); + if (!filename) { + const requireStack = []; + for (var cursor = parent; cursor; cursor = cursor.parent) { + requireStack.push(cursor.filename || cursor.id); + } + let message = `Cannot find module '${request}'`; + if (requireStack.length > 0) { + message = message + '\nRequire stack:\n- ' + requireStack.join('\n- '); + } + // eslint-disable-next-line no-restricted-syntax + var err = new Error(message); + err.code = 'MODULE_NOT_FOUND'; + err.requireStack = requireStack; + throw err; + } + + } + return filename; +}; \ No newline at end of file diff --git a/packages/字体精简工具/node_modules/.bin/fontmin b/packages/字体精简工具/node_modules/.bin/fontmin new file mode 100644 index 0000000..f438a7e --- /dev/null +++ b/packages/字体精简工具/node_modules/.bin/fontmin @@ -0,0 +1,15 @@ +#!/bin/sh +basedir=$(dirname "$(echo "$0" | sed -e 's,\\,/,g')") + +case `uname` in + *CYGWIN*|*MINGW*|*MSYS*) basedir=`cygpath -w "$basedir"`;; +esac + +if [ -x "$basedir/node" ]; then + "$basedir/node" "$basedir/../fontmin/cli.js" "$@" + ret=$? +else + node "$basedir/../fontmin/cli.js" "$@" + ret=$? +fi +exit $ret diff --git a/packages/字体精简工具/node_modules/.bin/fontmin.cmd b/packages/字体精简工具/node_modules/.bin/fontmin.cmd new file mode 100644 index 0000000..76cd84f --- /dev/null +++ b/packages/字体精简工具/node_modules/.bin/fontmin.cmd @@ -0,0 +1,17 @@ +@ECHO off +SETLOCAL +CALL :find_dp0 + +IF EXIST "%dp0%\node.exe" ( + SET "_prog=%dp0%\node.exe" +) ELSE ( + SET "_prog=node" + SET PATHEXT=%PATHEXT:;.JS;=;% +) + +"%_prog%" "%dp0%\..\fontmin\cli.js" %* +ENDLOCAL +EXIT /b %errorlevel% +:find_dp0 +SET dp0=%~dp0 +EXIT /b diff --git a/packages/字体精简工具/node_modules/.bin/fontmin.ps1 b/packages/字体精简工具/node_modules/.bin/fontmin.ps1 new file mode 100644 index 0000000..c4a740f --- /dev/null +++ b/packages/字体精简工具/node_modules/.bin/fontmin.ps1 @@ -0,0 +1,18 @@ +#!/usr/bin/env pwsh +$basedir=Split-Path $MyInvocation.MyCommand.Definition -Parent + +$exe="" +if ($PSVersionTable.PSVersion -lt "6.0" -or $IsWindows) { + # Fix case when both the Windows and Linux builds of Node + # are installed in the same directory + $exe=".exe" +} +$ret=0 +if (Test-Path "$basedir/node$exe") { + & "$basedir/node$exe" "$basedir/../fontmin/cli.js" $args + $ret=$LASTEXITCODE +} else { + & "node$exe" "$basedir/../fontmin/cli.js" $args + $ret=$LASTEXITCODE +} +exit $ret diff --git a/packages/字体精简工具/node_modules/.bin/mkdirp b/packages/字体精简工具/node_modules/.bin/mkdirp new file mode 100644 index 0000000..bcd333f --- /dev/null +++ b/packages/字体精简工具/node_modules/.bin/mkdirp @@ -0,0 +1,15 @@ +#!/bin/sh +basedir=$(dirname "$(echo "$0" | sed -e 's,\\,/,g')") + +case `uname` in + *CYGWIN*|*MINGW*|*MSYS*) basedir=`cygpath -w "$basedir"`;; +esac + +if [ -x "$basedir/node" ]; then + "$basedir/node" "$basedir/../mkdirp/bin/cmd.js" "$@" + ret=$? +else + node "$basedir/../mkdirp/bin/cmd.js" "$@" + ret=$? +fi +exit $ret diff --git a/packages/字体精简工具/node_modules/.bin/mkdirp.cmd b/packages/字体精简工具/node_modules/.bin/mkdirp.cmd new file mode 100644 index 0000000..c2c9350 --- /dev/null +++ b/packages/字体精简工具/node_modules/.bin/mkdirp.cmd @@ -0,0 +1,17 @@ +@ECHO off +SETLOCAL +CALL :find_dp0 + +IF EXIST "%dp0%\node.exe" ( + SET "_prog=%dp0%\node.exe" +) ELSE ( + SET "_prog=node" + SET PATHEXT=%PATHEXT:;.JS;=;% +) + +"%_prog%" "%dp0%\..\mkdirp\bin\cmd.js" %* +ENDLOCAL +EXIT /b %errorlevel% +:find_dp0 +SET dp0=%~dp0 +EXIT /b diff --git a/packages/字体精简工具/node_modules/.bin/mkdirp.ps1 b/packages/字体精简工具/node_modules/.bin/mkdirp.ps1 new file mode 100644 index 0000000..35ce690 --- /dev/null +++ b/packages/字体精简工具/node_modules/.bin/mkdirp.ps1 @@ -0,0 +1,18 @@ +#!/usr/bin/env pwsh +$basedir=Split-Path $MyInvocation.MyCommand.Definition -Parent + +$exe="" +if ($PSVersionTable.PSVersion -lt "6.0" -or $IsWindows) { + # Fix case when both the Windows and Linux builds of Node + # are installed in the same directory + $exe=".exe" +} +$ret=0 +if (Test-Path "$basedir/node$exe") { + & "$basedir/node$exe" "$basedir/../mkdirp/bin/cmd.js" $args + $ret=$LASTEXITCODE +} else { + & "node$exe" "$basedir/../mkdirp/bin/cmd.js" $args + $ret=$LASTEXITCODE +} +exit $ret diff --git a/packages/字体精简工具/node_modules/.bin/node-gyp b/packages/字体精简工具/node_modules/.bin/node-gyp new file mode 100644 index 0000000..68303f9 --- /dev/null +++ b/packages/字体精简工具/node_modules/.bin/node-gyp @@ -0,0 +1,15 @@ +#!/bin/sh +basedir=$(dirname "$(echo "$0" | sed -e 's,\\,/,g')") + +case `uname` in + *CYGWIN*|*MINGW*|*MSYS*) basedir=`cygpath -w "$basedir"`;; +esac + +if [ -x "$basedir/node" ]; then + "$basedir/node" "$basedir/../node-gyp/bin/node-gyp.js" "$@" + ret=$? +else + node "$basedir/../node-gyp/bin/node-gyp.js" "$@" + ret=$? +fi +exit $ret diff --git a/packages/字体精简工具/node_modules/.bin/node-gyp.cmd b/packages/字体精简工具/node_modules/.bin/node-gyp.cmd new file mode 100644 index 0000000..9025417 --- /dev/null +++ b/packages/字体精简工具/node_modules/.bin/node-gyp.cmd @@ -0,0 +1,17 @@ +@ECHO off +SETLOCAL +CALL :find_dp0 + +IF EXIST "%dp0%\node.exe" ( + SET "_prog=%dp0%\node.exe" +) ELSE ( + SET "_prog=node" + SET PATHEXT=%PATHEXT:;.JS;=;% +) + +"%_prog%" "%dp0%\..\node-gyp\bin\node-gyp.js" %* +ENDLOCAL +EXIT /b %errorlevel% +:find_dp0 +SET dp0=%~dp0 +EXIT /b diff --git a/packages/字体精简工具/node_modules/.bin/node-gyp.ps1 b/packages/字体精简工具/node_modules/.bin/node-gyp.ps1 new file mode 100644 index 0000000..5367845 --- /dev/null +++ b/packages/字体精简工具/node_modules/.bin/node-gyp.ps1 @@ -0,0 +1,18 @@ +#!/usr/bin/env pwsh +$basedir=Split-Path $MyInvocation.MyCommand.Definition -Parent + +$exe="" +if ($PSVersionTable.PSVersion -lt "6.0" -or $IsWindows) { + # Fix case when both the Windows and Linux builds of Node + # are installed in the same directory + $exe=".exe" +} +$ret=0 +if (Test-Path "$basedir/node$exe") { + & "$basedir/node$exe" "$basedir/../node-gyp/bin/node-gyp.js" $args + $ret=$LASTEXITCODE +} else { + & "node$exe" "$basedir/../node-gyp/bin/node-gyp.js" $args + $ret=$LASTEXITCODE +} +exit $ret diff --git a/packages/字体精简工具/node_modules/.bin/nopt b/packages/字体精简工具/node_modules/.bin/nopt new file mode 100644 index 0000000..e658aac --- /dev/null +++ b/packages/字体精简工具/node_modules/.bin/nopt @@ -0,0 +1,15 @@ +#!/bin/sh +basedir=$(dirname "$(echo "$0" | sed -e 's,\\,/,g')") + +case `uname` in + *CYGWIN*|*MINGW*|*MSYS*) basedir=`cygpath -w "$basedir"`;; +esac + +if [ -x "$basedir/node" ]; then + "$basedir/node" "$basedir/../nopt/bin/nopt.js" "$@" + ret=$? +else + node "$basedir/../nopt/bin/nopt.js" "$@" + ret=$? +fi +exit $ret diff --git a/packages/字体精简工具/node_modules/.bin/nopt.cmd b/packages/字体精简工具/node_modules/.bin/nopt.cmd new file mode 100644 index 0000000..c92ec03 --- /dev/null +++ b/packages/字体精简工具/node_modules/.bin/nopt.cmd @@ -0,0 +1,17 @@ +@ECHO off +SETLOCAL +CALL :find_dp0 + +IF EXIST "%dp0%\node.exe" ( + SET "_prog=%dp0%\node.exe" +) ELSE ( + SET "_prog=node" + SET PATHEXT=%PATHEXT:;.JS;=;% +) + +"%_prog%" "%dp0%\..\nopt\bin\nopt.js" %* +ENDLOCAL +EXIT /b %errorlevel% +:find_dp0 +SET dp0=%~dp0 +EXIT /b diff --git a/packages/字体精简工具/node_modules/.bin/nopt.ps1 b/packages/字体精简工具/node_modules/.bin/nopt.ps1 new file mode 100644 index 0000000..68c40bf --- /dev/null +++ b/packages/字体精简工具/node_modules/.bin/nopt.ps1 @@ -0,0 +1,18 @@ +#!/usr/bin/env pwsh +$basedir=Split-Path $MyInvocation.MyCommand.Definition -Parent + +$exe="" +if ($PSVersionTable.PSVersion -lt "6.0" -or $IsWindows) { + # Fix case when both the Windows and Linux builds of Node + # are installed in the same directory + $exe=".exe" +} +$ret=0 +if (Test-Path "$basedir/node$exe") { + & "$basedir/node$exe" "$basedir/../nopt/bin/nopt.js" $args + $ret=$LASTEXITCODE +} else { + & "node$exe" "$basedir/../nopt/bin/nopt.js" $args + $ret=$LASTEXITCODE +} +exit $ret diff --git a/packages/字体精简工具/node_modules/.bin/rimraf b/packages/字体精简工具/node_modules/.bin/rimraf new file mode 100644 index 0000000..a3e9f71 --- /dev/null +++ b/packages/字体精简工具/node_modules/.bin/rimraf @@ -0,0 +1,15 @@ +#!/bin/sh +basedir=$(dirname "$(echo "$0" | sed -e 's,\\,/,g')") + +case `uname` in + *CYGWIN*|*MINGW*|*MSYS*) basedir=`cygpath -w "$basedir"`;; +esac + +if [ -x "$basedir/node" ]; then + "$basedir/node" "$basedir/../rimraf/bin.js" "$@" + ret=$? +else + node "$basedir/../rimraf/bin.js" "$@" + ret=$? +fi +exit $ret diff --git a/packages/字体精简工具/node_modules/.bin/rimraf.cmd b/packages/字体精简工具/node_modules/.bin/rimraf.cmd new file mode 100644 index 0000000..698f4ba --- /dev/null +++ b/packages/字体精简工具/node_modules/.bin/rimraf.cmd @@ -0,0 +1,17 @@ +@ECHO off +SETLOCAL +CALL :find_dp0 + +IF EXIST "%dp0%\node.exe" ( + SET "_prog=%dp0%\node.exe" +) ELSE ( + SET "_prog=node" + SET PATHEXT=%PATHEXT:;.JS;=;% +) + +"%_prog%" "%dp0%\..\rimraf\bin.js" %* +ENDLOCAL +EXIT /b %errorlevel% +:find_dp0 +SET dp0=%~dp0 +EXIT /b diff --git a/packages/字体精简工具/node_modules/.bin/rimraf.ps1 b/packages/字体精简工具/node_modules/.bin/rimraf.ps1 new file mode 100644 index 0000000..a244a80 --- /dev/null +++ b/packages/字体精简工具/node_modules/.bin/rimraf.ps1 @@ -0,0 +1,18 @@ +#!/usr/bin/env pwsh +$basedir=Split-Path $MyInvocation.MyCommand.Definition -Parent + +$exe="" +if ($PSVersionTable.PSVersion -lt "6.0" -or $IsWindows) { + # Fix case when both the Windows and Linux builds of Node + # are installed in the same directory + $exe=".exe" +} +$ret=0 +if (Test-Path "$basedir/node$exe") { + & "$basedir/node$exe" "$basedir/../rimraf/bin.js" $args + $ret=$LASTEXITCODE +} else { + & "node$exe" "$basedir/../rimraf/bin.js" $args + $ret=$LASTEXITCODE +} +exit $ret diff --git a/packages/字体精简工具/node_modules/.bin/semver b/packages/字体精简工具/node_modules/.bin/semver new file mode 100644 index 0000000..10497aa --- /dev/null +++ b/packages/字体精简工具/node_modules/.bin/semver @@ -0,0 +1,15 @@ +#!/bin/sh +basedir=$(dirname "$(echo "$0" | sed -e 's,\\,/,g')") + +case `uname` in + *CYGWIN*|*MINGW*|*MSYS*) basedir=`cygpath -w "$basedir"`;; +esac + +if [ -x "$basedir/node" ]; then + "$basedir/node" "$basedir/../semver/bin/semver" "$@" + ret=$? +else + node "$basedir/../semver/bin/semver" "$@" + ret=$? +fi +exit $ret diff --git a/packages/字体精简工具/node_modules/.bin/semver.cmd b/packages/字体精简工具/node_modules/.bin/semver.cmd new file mode 100644 index 0000000..eb3aaa1 --- /dev/null +++ b/packages/字体精简工具/node_modules/.bin/semver.cmd @@ -0,0 +1,17 @@ +@ECHO off +SETLOCAL +CALL :find_dp0 + +IF EXIST "%dp0%\node.exe" ( + SET "_prog=%dp0%\node.exe" +) ELSE ( + SET "_prog=node" + SET PATHEXT=%PATHEXT:;.JS;=;% +) + +"%_prog%" "%dp0%\..\semver\bin\semver" %* +ENDLOCAL +EXIT /b %errorlevel% +:find_dp0 +SET dp0=%~dp0 +EXIT /b diff --git a/packages/字体精简工具/node_modules/.bin/semver.ps1 b/packages/字体精简工具/node_modules/.bin/semver.ps1 new file mode 100644 index 0000000..a3315ff --- /dev/null +++ b/packages/字体精简工具/node_modules/.bin/semver.ps1 @@ -0,0 +1,18 @@ +#!/usr/bin/env pwsh +$basedir=Split-Path $MyInvocation.MyCommand.Definition -Parent + +$exe="" +if ($PSVersionTable.PSVersion -lt "6.0" -or $IsWindows) { + # Fix case when both the Windows and Linux builds of Node + # are installed in the same directory + $exe=".exe" +} +$ret=0 +if (Test-Path "$basedir/node$exe") { + & "$basedir/node$exe" "$basedir/../semver/bin/semver" $args + $ret=$LASTEXITCODE +} else { + & "node$exe" "$basedir/../semver/bin/semver" $args + $ret=$LASTEXITCODE +} +exit $ret diff --git a/packages/字体精简工具/node_modules/.bin/sshpk-conv b/packages/字体精简工具/node_modules/.bin/sshpk-conv new file mode 100644 index 0000000..91957fa --- /dev/null +++ b/packages/字体精简工具/node_modules/.bin/sshpk-conv @@ -0,0 +1,15 @@ +#!/bin/sh +basedir=$(dirname "$(echo "$0" | sed -e 's,\\,/,g')") + +case `uname` in + *CYGWIN*|*MINGW*|*MSYS*) basedir=`cygpath -w "$basedir"`;; +esac + +if [ -x "$basedir/node" ]; then + "$basedir/node" "$basedir/../sshpk/bin/sshpk-conv" "$@" + ret=$? +else + node "$basedir/../sshpk/bin/sshpk-conv" "$@" + ret=$? +fi +exit $ret diff --git a/packages/字体精简工具/node_modules/.bin/sshpk-conv.cmd b/packages/字体精简工具/node_modules/.bin/sshpk-conv.cmd new file mode 100644 index 0000000..42f9ce4 --- /dev/null +++ b/packages/字体精简工具/node_modules/.bin/sshpk-conv.cmd @@ -0,0 +1,17 @@ +@ECHO off +SETLOCAL +CALL :find_dp0 + +IF EXIST "%dp0%\node.exe" ( + SET "_prog=%dp0%\node.exe" +) ELSE ( + SET "_prog=node" + SET PATHEXT=%PATHEXT:;.JS;=;% +) + +"%_prog%" "%dp0%\..\sshpk\bin\sshpk-conv" %* +ENDLOCAL +EXIT /b %errorlevel% +:find_dp0 +SET dp0=%~dp0 +EXIT /b diff --git a/packages/字体精简工具/node_modules/.bin/sshpk-conv.ps1 b/packages/字体精简工具/node_modules/.bin/sshpk-conv.ps1 new file mode 100644 index 0000000..d27c311 --- /dev/null +++ b/packages/字体精简工具/node_modules/.bin/sshpk-conv.ps1 @@ -0,0 +1,18 @@ +#!/usr/bin/env pwsh +$basedir=Split-Path $MyInvocation.MyCommand.Definition -Parent + +$exe="" +if ($PSVersionTable.PSVersion -lt "6.0" -or $IsWindows) { + # Fix case when both the Windows and Linux builds of Node + # are installed in the same directory + $exe=".exe" +} +$ret=0 +if (Test-Path "$basedir/node$exe") { + & "$basedir/node$exe" "$basedir/../sshpk/bin/sshpk-conv" $args + $ret=$LASTEXITCODE +} else { + & "node$exe" "$basedir/../sshpk/bin/sshpk-conv" $args + $ret=$LASTEXITCODE +} +exit $ret diff --git a/packages/字体精简工具/node_modules/.bin/sshpk-sign b/packages/字体精简工具/node_modules/.bin/sshpk-sign new file mode 100644 index 0000000..0dd7644 --- /dev/null +++ b/packages/字体精简工具/node_modules/.bin/sshpk-sign @@ -0,0 +1,15 @@ +#!/bin/sh +basedir=$(dirname "$(echo "$0" | sed -e 's,\\,/,g')") + +case `uname` in + *CYGWIN*|*MINGW*|*MSYS*) basedir=`cygpath -w "$basedir"`;; +esac + +if [ -x "$basedir/node" ]; then + "$basedir/node" "$basedir/../sshpk/bin/sshpk-sign" "$@" + ret=$? +else + node "$basedir/../sshpk/bin/sshpk-sign" "$@" + ret=$? +fi +exit $ret diff --git a/packages/字体精简工具/node_modules/.bin/sshpk-sign.cmd b/packages/字体精简工具/node_modules/.bin/sshpk-sign.cmd new file mode 100644 index 0000000..17f60de --- /dev/null +++ b/packages/字体精简工具/node_modules/.bin/sshpk-sign.cmd @@ -0,0 +1,17 @@ +@ECHO off +SETLOCAL +CALL :find_dp0 + +IF EXIST "%dp0%\node.exe" ( + SET "_prog=%dp0%\node.exe" +) ELSE ( + SET "_prog=node" + SET PATHEXT=%PATHEXT:;.JS;=;% +) + +"%_prog%" "%dp0%\..\sshpk\bin\sshpk-sign" %* +ENDLOCAL +EXIT /b %errorlevel% +:find_dp0 +SET dp0=%~dp0 +EXIT /b diff --git a/packages/字体精简工具/node_modules/.bin/sshpk-sign.ps1 b/packages/字体精简工具/node_modules/.bin/sshpk-sign.ps1 new file mode 100644 index 0000000..10d9186 --- /dev/null +++ b/packages/字体精简工具/node_modules/.bin/sshpk-sign.ps1 @@ -0,0 +1,18 @@ +#!/usr/bin/env pwsh +$basedir=Split-Path $MyInvocation.MyCommand.Definition -Parent + +$exe="" +if ($PSVersionTable.PSVersion -lt "6.0" -or $IsWindows) { + # Fix case when both the Windows and Linux builds of Node + # are installed in the same directory + $exe=".exe" +} +$ret=0 +if (Test-Path "$basedir/node$exe") { + & "$basedir/node$exe" "$basedir/../sshpk/bin/sshpk-sign" $args + $ret=$LASTEXITCODE +} else { + & "node$exe" "$basedir/../sshpk/bin/sshpk-sign" $args + $ret=$LASTEXITCODE +} +exit $ret diff --git a/packages/字体精简工具/node_modules/.bin/sshpk-verify b/packages/字体精简工具/node_modules/.bin/sshpk-verify new file mode 100644 index 0000000..04f5d05 --- /dev/null +++ b/packages/字体精简工具/node_modules/.bin/sshpk-verify @@ -0,0 +1,15 @@ +#!/bin/sh +basedir=$(dirname "$(echo "$0" | sed -e 's,\\,/,g')") + +case `uname` in + *CYGWIN*|*MINGW*|*MSYS*) basedir=`cygpath -w "$basedir"`;; +esac + +if [ -x "$basedir/node" ]; then + "$basedir/node" "$basedir/../sshpk/bin/sshpk-verify" "$@" + ret=$? +else + node "$basedir/../sshpk/bin/sshpk-verify" "$@" + ret=$? +fi +exit $ret diff --git a/packages/字体精简工具/node_modules/.bin/sshpk-verify.cmd b/packages/字体精简工具/node_modules/.bin/sshpk-verify.cmd new file mode 100644 index 0000000..4b81f35 --- /dev/null +++ b/packages/字体精简工具/node_modules/.bin/sshpk-verify.cmd @@ -0,0 +1,17 @@ +@ECHO off +SETLOCAL +CALL :find_dp0 + +IF EXIST "%dp0%\node.exe" ( + SET "_prog=%dp0%\node.exe" +) ELSE ( + SET "_prog=node" + SET PATHEXT=%PATHEXT:;.JS;=;% +) + +"%_prog%" "%dp0%\..\sshpk\bin\sshpk-verify" %* +ENDLOCAL +EXIT /b %errorlevel% +:find_dp0 +SET dp0=%~dp0 +EXIT /b diff --git a/packages/字体精简工具/node_modules/.bin/sshpk-verify.ps1 b/packages/字体精简工具/node_modules/.bin/sshpk-verify.ps1 new file mode 100644 index 0000000..d5a23e2 --- /dev/null +++ b/packages/字体精简工具/node_modules/.bin/sshpk-verify.ps1 @@ -0,0 +1,18 @@ +#!/usr/bin/env pwsh +$basedir=Split-Path $MyInvocation.MyCommand.Definition -Parent + +$exe="" +if ($PSVersionTable.PSVersion -lt "6.0" -or $IsWindows) { + # Fix case when both the Windows and Linux builds of Node + # are installed in the same directory + $exe=".exe" +} +$ret=0 +if (Test-Path "$basedir/node$exe") { + & "$basedir/node$exe" "$basedir/../sshpk/bin/sshpk-verify" $args + $ret=$LASTEXITCODE +} else { + & "node$exe" "$basedir/../sshpk/bin/sshpk-verify" $args + $ret=$LASTEXITCODE +} +exit $ret diff --git a/packages/字体精简工具/node_modules/.bin/strip-indent b/packages/字体精简工具/node_modules/.bin/strip-indent new file mode 100644 index 0000000..0f0810a --- /dev/null +++ b/packages/字体精简工具/node_modules/.bin/strip-indent @@ -0,0 +1,15 @@ +#!/bin/sh +basedir=$(dirname "$(echo "$0" | sed -e 's,\\,/,g')") + +case `uname` in + *CYGWIN*|*MINGW*|*MSYS*) basedir=`cygpath -w "$basedir"`;; +esac + +if [ -x "$basedir/node" ]; then + "$basedir/node" "$basedir/../strip-indent/cli.js" "$@" + ret=$? +else + node "$basedir/../strip-indent/cli.js" "$@" + ret=$? +fi +exit $ret diff --git a/packages/字体精简工具/node_modules/.bin/strip-indent.cmd b/packages/字体精简工具/node_modules/.bin/strip-indent.cmd new file mode 100644 index 0000000..a5c6285 --- /dev/null +++ b/packages/字体精简工具/node_modules/.bin/strip-indent.cmd @@ -0,0 +1,17 @@ +@ECHO off +SETLOCAL +CALL :find_dp0 + +IF EXIST "%dp0%\node.exe" ( + SET "_prog=%dp0%\node.exe" +) ELSE ( + SET "_prog=node" + SET PATHEXT=%PATHEXT:;.JS;=;% +) + +"%_prog%" "%dp0%\..\strip-indent\cli.js" %* +ENDLOCAL +EXIT /b %errorlevel% +:find_dp0 +SET dp0=%~dp0 +EXIT /b diff --git a/packages/字体精简工具/node_modules/.bin/strip-indent.ps1 b/packages/字体精简工具/node_modules/.bin/strip-indent.ps1 new file mode 100644 index 0000000..2185fab --- /dev/null +++ b/packages/字体精简工具/node_modules/.bin/strip-indent.ps1 @@ -0,0 +1,18 @@ +#!/usr/bin/env pwsh +$basedir=Split-Path $MyInvocation.MyCommand.Definition -Parent + +$exe="" +if ($PSVersionTable.PSVersion -lt "6.0" -or $IsWindows) { + # Fix case when both the Windows and Linux builds of Node + # are installed in the same directory + $exe=".exe" +} +$ret=0 +if (Test-Path "$basedir/node$exe") { + & "$basedir/node$exe" "$basedir/../strip-indent/cli.js" $args + $ret=$LASTEXITCODE +} else { + & "node$exe" "$basedir/../strip-indent/cli.js" $args + $ret=$LASTEXITCODE +} +exit $ret diff --git a/packages/字体精简工具/node_modules/.bin/ttf2woff2 b/packages/字体精简工具/node_modules/.bin/ttf2woff2 new file mode 100644 index 0000000..b052887 --- /dev/null +++ b/packages/字体精简工具/node_modules/.bin/ttf2woff2 @@ -0,0 +1,15 @@ +#!/bin/sh +basedir=$(dirname "$(echo "$0" | sed -e 's,\\,/,g')") + +case `uname` in + *CYGWIN*|*MINGW*|*MSYS*) basedir=`cygpath -w "$basedir"`;; +esac + +if [ -x "$basedir/node" ]; then + "$basedir/node" "$basedir/../ttf2woff2/bin/ttf2woff2.js" "$@" + ret=$? +else + node "$basedir/../ttf2woff2/bin/ttf2woff2.js" "$@" + ret=$? +fi +exit $ret diff --git a/packages/字体精简工具/node_modules/.bin/ttf2woff2.cmd b/packages/字体精简工具/node_modules/.bin/ttf2woff2.cmd new file mode 100644 index 0000000..6d46365 --- /dev/null +++ b/packages/字体精简工具/node_modules/.bin/ttf2woff2.cmd @@ -0,0 +1,17 @@ +@ECHO off +SETLOCAL +CALL :find_dp0 + +IF EXIST "%dp0%\node.exe" ( + SET "_prog=%dp0%\node.exe" +) ELSE ( + SET "_prog=node" + SET PATHEXT=%PATHEXT:;.JS;=;% +) + +"%_prog%" "%dp0%\..\ttf2woff2\bin\ttf2woff2.js" %* +ENDLOCAL +EXIT /b %errorlevel% +:find_dp0 +SET dp0=%~dp0 +EXIT /b diff --git a/packages/字体精简工具/node_modules/.bin/ttf2woff2.ps1 b/packages/字体精简工具/node_modules/.bin/ttf2woff2.ps1 new file mode 100644 index 0000000..18d64b3 --- /dev/null +++ b/packages/字体精简工具/node_modules/.bin/ttf2woff2.ps1 @@ -0,0 +1,18 @@ +#!/usr/bin/env pwsh +$basedir=Split-Path $MyInvocation.MyCommand.Definition -Parent + +$exe="" +if ($PSVersionTable.PSVersion -lt "6.0" -or $IsWindows) { + # Fix case when both the Windows and Linux builds of Node + # are installed in the same directory + $exe=".exe" +} +$ret=0 +if (Test-Path "$basedir/node$exe") { + & "$basedir/node$exe" "$basedir/../ttf2woff2/bin/ttf2woff2.js" $args + $ret=$LASTEXITCODE +} else { + & "node$exe" "$basedir/../ttf2woff2/bin/ttf2woff2.js" $args + $ret=$LASTEXITCODE +} +exit $ret diff --git a/packages/字体精简工具/node_modules/.bin/which b/packages/字体精简工具/node_modules/.bin/which new file mode 100644 index 0000000..12cde79 --- /dev/null +++ b/packages/字体精简工具/node_modules/.bin/which @@ -0,0 +1,15 @@ +#!/bin/sh +basedir=$(dirname "$(echo "$0" | sed -e 's,\\,/,g')") + +case `uname` in + *CYGWIN*|*MINGW*|*MSYS*) basedir=`cygpath -w "$basedir"`;; +esac + +if [ -x "$basedir/node" ]; then + "$basedir/node" "$basedir/../which/bin/which" "$@" + ret=$? +else + node "$basedir/../which/bin/which" "$@" + ret=$? +fi +exit $ret diff --git a/packages/字体精简工具/node_modules/.bin/which.cmd b/packages/字体精简工具/node_modules/.bin/which.cmd new file mode 100644 index 0000000..0664965 --- /dev/null +++ b/packages/字体精简工具/node_modules/.bin/which.cmd @@ -0,0 +1,17 @@ +@ECHO off +SETLOCAL +CALL :find_dp0 + +IF EXIST "%dp0%\node.exe" ( + SET "_prog=%dp0%\node.exe" +) ELSE ( + SET "_prog=node" + SET PATHEXT=%PATHEXT:;.JS;=;% +) + +"%_prog%" "%dp0%\..\which\bin\which" %* +ENDLOCAL +EXIT /b %errorlevel% +:find_dp0 +SET dp0=%~dp0 +EXIT /b diff --git a/packages/字体精简工具/node_modules/.bin/which.ps1 b/packages/字体精简工具/node_modules/.bin/which.ps1 new file mode 100644 index 0000000..d023170 --- /dev/null +++ b/packages/字体精简工具/node_modules/.bin/which.ps1 @@ -0,0 +1,18 @@ +#!/usr/bin/env pwsh +$basedir=Split-Path $MyInvocation.MyCommand.Definition -Parent + +$exe="" +if ($PSVersionTable.PSVersion -lt "6.0" -or $IsWindows) { + # Fix case when both the Windows and Linux builds of Node + # are installed in the same directory + $exe=".exe" +} +$ret=0 +if (Test-Path "$basedir/node$exe") { + & "$basedir/node$exe" "$basedir/../which/bin/which" $args + $ret=$LASTEXITCODE +} else { + & "node$exe" "$basedir/../which/bin/which" $args + $ret=$LASTEXITCODE +} +exit $ret diff --git a/packages/字体精简工具/node_modules/@ailhc/egf-core/CHANGELOG.md b/packages/字体精简工具/node_modules/@ailhc/egf-core/CHANGELOG.md new file mode 100644 index 0000000..f198788 --- /dev/null +++ b/packages/字体精简工具/node_modules/@ailhc/egf-core/CHANGELOG.md @@ -0,0 +1,140 @@ +# Change Log + +All notable changes to this project will be documented in this file. +See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. + +## [1.2.4](https://github.com/AILHC/EasyGameFrameworkOpen/compare/@ailhc/egf-core@1.2.3...@ailhc/egf-core@1.2.4) (2021-05-15) + + +### Bug Fixes + +* 修复iife规范的.d.ts声明错误 ([5deed01](https://github.com/AILHC/EasyGameFrameworkOpen/commit/5deed01795ca4abab2bbafbb7b55664d4d23be8f)) + + + + + +## [1.2.3](https://github.com/AILHC/EasyGameFrameworkOpen/compare/@ailhc/egf-core@1.2.2...@ailhc/egf-core@1.2.3) (2021-05-09) + +**Note:** Version bump only for package @ailhc/egf-core + + + + + +## [1.2.2](https://github.com/AILHC/EasyGameFrameworkOpen/compare/@ailhc/egf-core@1.2.1...@ailhc/egf-core@1.2.2) (2021-04-23) + + +### Bug Fixes + +* 重新导出,修复声明识别错误的问题 ([4139c9e](https://github.com/AILHC/EasyGameFrameworkOpen/commit/4139c9ece90ef11d12374a42065bf89ebe44d053)) + + + + + +## [1.2.1](https://github.com/AILHC/EasyGameFrameworkOpen/compare/@ailhc/egf-core@1.2.0...@ailhc/egf-core@1.2.1) (2021-03-31) + + +### Bug Fixes + +* 修复package.json的exports字段,这会导致cocoscreator2.4.5import报错 ([6c22d71](https://github.com/AILHC/EasyGameFrameworkOpen/commit/6c22d71f6f32ec566b95e7b299ec91e732e99585)) + + + + + +# [1.2.0](https://github.com/AILHC/EasyGameFrameworkOpen/compare/@ailhc/egf-core@1.1.4...@ailhc/egf-core@1.2.0) (2021-03-27) + + +### Features + +* 多入口编译支持 ([fb7a70f](https://github.com/AILHC/EasyGameFrameworkOpen/commit/fb7a70f11d77ede4938b72931e9aac63b059e500)) + + + + + +## [1.1.4](https://github.com/AILHC/EasyGameFrameworkOpen/compare/@ailhc/egf-core@1.1.3...@ailhc/egf-core@1.1.4) (2021-02-21) + + +### Bug Fixes + +* 修复构建出iife规范的bug ([dc435c8](https://github.com/AILHC/EasyGameFrameworkOpen/commit/dc435c8ed264447b8a80263e7d157b1576c414b3)) + + + + + +## [1.1.3](https://github.com/AILHC/EasyGameFrameworkOpen/compare/@ailhc/egf-core@1.1.2...@ailhc/egf-core@1.1.3) (2021-02-18) + +**Note:** Version bump only for package @ailhc/egf-core + + + + + +## [1.1.2](https://github.com/AILHC/EasyGameFrameworkOpen/compare/@ailhc/egf-core@1.1.1...@ailhc/egf-core@1.1.2) (2021-02-15) + + +### Bug Fixes + +* 修复状态切换bug setState 增加切换状态判断 ([52cd947](https://github.com/AILHC/EasyGameFrameworkOpen/commit/52cd947c6532cb811ec6fc9ac8cbd449b079e580)) + + + + + +## [1.1.1](https://github.com/AILHC/EasyGameFrameworkOpen/compare/@ailhc/egf-core@1.1.0...@ailhc/egf-core@1.1.1) (2021-02-15) + +**Note:** Version bump only for package @ailhc/egf-core + + + + + +# [1.1.0](https://github.com/AILHC/EasyGameFrameworkOpen/compare/@ailhc/egf-core@1.0.1...@ailhc/egf-core@1.1.0) (2021-02-07) + + +### Features + +* 同时支持CommonJs和ES Modules ([409a819](https://github.com/AILHC/EasyGameFrameworkOpen/commit/409a819cfca6808a4070abcbc8acc80a2caf1c84)) + + + + + +## [1.0.1](https://github.com/AILHC/EasyGameFrameworkOpen/compare/@ailhc/egf-core@1.0.0...@ailhc/egf-core@1.0.1) (2021-02-07) + +**Note:** Version bump only for package @ailhc/egf-core + + + + + + + +# 1.0.0 (2021-01-27) +1. 去掉proxy + +# 0.1.6 (2020-12-02) +1. 修改类型声明使getModule也能有更好的类型提示 + +# 0.1.5 (2020-11-25) +更新iife的声明文件 +删除多余的声明文件 + +# 0.1.4 (2020-11-25) +重新发布,更新github地址 + +# 0.1.3 (2020-11-25) +重新发布,更新声明文件 + +# 0.1.2 (2020-10-07) +移除加载子程序的逻辑,整理声明文件 + +# 0.0.1 (2020-10-07) +完善iife格式的声明文件 + +# 0.0.1 (2020-10-07) +第一次发布 diff --git a/packages/字体精简工具/node_modules/@ailhc/egf-core/LICENSE b/packages/字体精简工具/node_modules/@ailhc/egf-core/LICENSE new file mode 100644 index 0000000..5b70f4a --- /dev/null +++ b/packages/字体精简工具/node_modules/@ailhc/egf-core/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2020 AILHC + +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/packages/字体精简工具/node_modules/@ailhc/egf-core/README.md b/packages/字体精简工具/node_modules/@ailhc/egf-core/README.md new file mode 100644 index 0000000..0cc7a29 --- /dev/null +++ b/packages/字体精简工具/node_modules/@ailhc/egf-core/README.md @@ -0,0 +1,119 @@ +# `@ailhc/egf-core` + +## 简介 + +EasyGameFramework 的核心模块,用于H5游戏/应用程序的渐进式模块化开发 + +EasyGameFramework core module for progressive modular development of H5 games/applications +## 特性 +1. 模块注册、初始化管理机制 +2. 智能提示 + +## Demo + +1. [CocosCreator2.4.2 模板](https://github.com/AILHC/egf-ccc-empty) +2. [CocosCreator3D 1.2 模板](https://github.com/AILHC/egf-ccc3d-empty) (ps:使用systemjs+插件模式使用) +3. [CocosCreator3.0 模板](https://github.com/AILHC/egf-ccc3-empty) (ps:使用npm方式使用) +4. [Egret 5.3 支持npm的模板](https://github.com/AILHC/egf-egret-empty) +5. [Laya 2.7.1 支持npm的模板](https://github.com/AILHC/egf-laya-empty) + +## 使用 +0. 安装 + + 通过npm安装 + npm install @ailhc/egf-core + + 如果支持使用npm模块,则 通过导入npm模块的方式 + ```ts + import { App } from "@ailhc/egf-core" + + ``` + 如果不支持,则使用dist下的iife格式,声明文件则需要自己整理一下 + 或者直接复制src下的源码 + +1. 基础使用 + ```ts + export class XXXLoader implements egf.IBootLoader { + onBoot(app: egf.IApp, bootEnd: egf.BootEndCallback): void { + app.loadModule(moduleIns,"moduleName"); + bootEnd(true); + } + + } + + import { App } from "@ailhc/egf-core" + const app = new App(); + //启动 + app.bootstrap([new XXXLoader()]); + //初始化 + app.init(); + ``` +2. 智能提示和接口提示 + ```ts + //智能提示的基础,可以在任意模块文件里进行声明比如 + //ModuleA.ts + declare global { + interface IModuleMap { + moduleAName :IXXXModuleA + } + } + //ModuleB.ts + declare global { + interface IModuleMap { + moduleBName :IXXXModuleB + } + } + + const app = new App(); + //在运行时也可调用,这里的moduleIns可以是任意实例,moduleName可以有智能提示 + app.loadModule(moduleIns,"moduleName"); + ``` +3. 全局模块调用 + ```ts + // 可以将模块实例的字典赋值给全局的对象,比如 + //setModuleMap.ts + export let m: IModuleMap; + export function setModuleMap(moduleMap: IModuleMap) { + m = moduleMap; + } + //AppMain.ts + import { setModuleMap, m } from "./ModuleMap"; + + setModuleMap(app.moduleMap); + + //在别的逻辑里可以通过 + import { m } from "./ModuleMap"; + //调用模块逻辑 + m.moduleA.doSometing() + ``` +## [CHANGELOG](packages/core/CHANGELOG.md) + +## 我在哪? + +**游戏开发之路有趣但不易,** + +**玩起来才能一直热情洋溢。** + +关注我, 一起玩转游戏开发! + +你的关注是我持续更新的动力~ + +让我们在这游戏开发的道路上并肩前行 + +在以下这些渠道可以找到我和我的创作: + +公众号搜索:玩转游戏开发 + +或扫码:img + + + +一起讨论技术的 QQ 群: 1103157878 + + + +博客主页: https://pgd.vercel.app/ + +掘金: https://juejin.cn/user/3069492195769469 + +github: https://github.com/AILHC \ No newline at end of file diff --git a/packages/字体精简工具/node_modules/@ailhc/egf-core/dist/cjs/lib/index.js b/packages/字体精简工具/node_modules/@ailhc/egf-core/dist/cjs/lib/index.js new file mode 100644 index 0000000..e2584c3 --- /dev/null +++ b/packages/字体精简工具/node_modules/@ailhc/egf-core/dist/cjs/lib/index.js @@ -0,0 +1,215 @@ +'use strict'; + +Object.defineProperty(exports, '__esModule', { value: true }); + +/*! ***************************************************************************** +Copyright (c) Microsoft Corporation. All rights reserved. +Licensed under the Apache License, Version 2.0 (the "License"); you may not use +this file except in compliance with the License. You may obtain a copy of the +License at http://www.apache.org/licenses/LICENSE-2.0 + +THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED +WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE, +MERCHANTABLITY OR NON-INFRINGEMENT. + +See the Apache Version 2.0 License for specific language governing permissions +and limitations under the License. +***************************************************************************** */ + +function __awaiter(thisArg, _arguments, P, generator) { + return new (P || (P = Promise))(function (resolve, reject) { + function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } + function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } + function step(result) { result.done ? resolve(result.value) : new P(function (resolve) { resolve(result.value); }).then(fulfilled, rejected); } + step((generator = generator.apply(thisArg, _arguments || [])).next()); + }); +} + +function __generator(thisArg, body) { + var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g; + return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g; + function verb(n) { return function (v) { return step([n, v]); }; } + function step(op) { + if (f) throw new TypeError("Generator is already executing."); + while (_) try { + if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t; + if (y = 0, t) op = [op[0] & 2, t.value]; + switch (op[0]) { + case 0: case 1: t = op; break; + case 4: _.label++; return { value: op[1], done: false }; + case 5: _.label++; y = op[1]; op = [0]; continue; + case 7: op = _.ops.pop(); _.trys.pop(); continue; + default: + if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; } + if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; } + if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; } + if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; } + if (t[2]) _.ops.pop(); + _.trys.pop(); continue; + } + op = body.call(thisArg, _); + } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; } + if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true }; + } +} + +var App = (function () { + function App() { + this._state = 0; + this._moduleMap = {}; + } + Object.defineProperty(App.prototype, "state", { + get: function () { + return this._state; + }, + enumerable: false, + configurable: true + }); + Object.defineProperty(App.prototype, "moduleMap", { + get: function () { + return this._moduleMap; + }, + enumerable: false, + configurable: true + }); + App.prototype.bootstrap = function (bootLoaders) { + return __awaiter(this, void 0, void 0, function () { + var bootPromises, _loop_1, i, e_1; + var _this = this; + return __generator(this, function (_a) { + switch (_a.label) { + case 0: + this.setState(App.BOOTING); + if (!bootLoaders || bootLoaders.length <= 0) { + this.setState(App.BOOTEND); + return [2, true]; + } + if (!(bootLoaders && bootLoaders.length > 0)) return [3, 4]; + bootPromises = []; + _loop_1 = function (i) { + var bootLoader = bootLoaders[i]; + bootPromises.push(new Promise(function (res, rej) { + bootLoader.onBoot(_this, function (isOk) { + if (isOk) { + res(); + } + else { + rej(); + } + }); + })); + }; + for (i = 0; i < bootLoaders.length; i++) { + _loop_1(i); + } + _a.label = 1; + case 1: + _a.trys.push([1, 3, , 4]); + return [4, Promise.all(bootPromises)]; + case 2: + _a.sent(); + this.setState(App.BOOTEND); + return [2, true]; + case 3: + e_1 = _a.sent(); + console.error(e_1); + this.setState(App.BOOTEND); + return [2, false]; + case 4: return [2]; + } + }); + }); + }; + App.prototype.init = function () { + var moduleMap = this._moduleMap; + var moduleIns; + if (this.state === App.RUNING) + return; + for (var key in moduleMap) { + moduleIns = moduleMap[key]; + moduleIns.onInit && moduleIns.onInit(this); + } + for (var key in moduleMap) { + moduleIns = moduleMap[key]; + moduleIns.onAfterInit && moduleIns.onAfterInit(this); + } + this.setState(App.RUNING); + }; + App.prototype.loadModule = function (moduleIns, key) { + if (this._state === App.STOP) + return false; + var res = false; + if (!key) { + key = moduleIns.key; + } + if (key && typeof key === "string") { + if (moduleIns) { + if (!this._moduleMap[key]) { + this._moduleMap[key] = moduleIns; + res = true; + if (this._state === App.RUNING) { + moduleIns.onInit && moduleIns.onInit(this); + moduleIns.onAfterInit && moduleIns.onAfterInit(); + } + } + else { + this._log("\u52A0\u8F7D\u6A21\u5757:\u6A21\u5757:" + key + "\u5DF2\u7ECF\u5B58\u5728,\u4E0D\u91CD\u590D\u52A0\u8F7D"); + } + } + else { + this._log("\u52A0\u8F7D\u6A21\u5757:\u6A21\u5757:" + key + "\u5B9E\u4F8B\u4E3A\u7A7A"); + } + } + else { + this._log("\u52A0\u8F7D\u6A21\u5757:\u6A21\u5757key\u4E3A\u7A7A"); + } + return res; + }; + App.prototype.hasModule = function (moduleKey) { + return !!this._moduleMap[moduleKey]; + }; + App.prototype.stop = function () { + var moduleMap = this._moduleMap; + var moduleIns; + this.setState(App.STOP); + for (var key in moduleMap) { + moduleIns = moduleMap[key]; + moduleIns.onStop && moduleIns.onStop(); + } + }; + App.prototype.getModule = function (moduleKey) { + return this._moduleMap[moduleKey]; + }; + App.prototype.setState = function (state) { + if (!isNaN(this._state)) { + if (this._state >= state) + return; + } + this._state = state; + }; + App.prototype._log = function (msg, level) { + switch (level) { + case 1: + console.warn("\u3010\u4E3B\u7A0B\u5E8F\u3011" + msg); + break; + case 2: + console.error("\u3010\u4E3B\u7A0B\u5E8F\u3011" + msg); + break; + default: + console.warn("\u3010\u4E3B\u7A0B\u5E8F\u3011" + msg); + break; + } + }; + App.UN_RUN = 0; + App.BOOTING = 1; + App.BOOTEND = 2; + App.RUNING = 3; + App.STOP = 4; + return App; +}()); + +exports.App = App; + + +//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaW5kZXguanMiLCJzb3VyY2VzIjpbIkBhaWxoYy9lZ2YtY29yZS9zcmMvZWdmLWFwcC50cyJdLCJzb3VyY2VzQ29udGVudCI6WyJleHBvcnQgY2xhc3MgQXBwPE1vZHVsZU1hcCA9IGFueT4gaW1wbGVtZW50cyBlZ2YuSUFwcDxNb2R1bGVNYXA+IHtcbiAgICBwdWJsaWMgc3RhdGljIHJlYWRvbmx5IFVOX1JVTjogbnVtYmVyID0gMDtcbiAgICBwdWJsaWMgc3RhdGljIHJlYWRvbmx5IEJPT1RJTkc6IG51bWJlciA9IDE7XG4gICAgcHVibGljIHN0YXRpYyByZWFkb25seSBCT09URU5EOiBudW1iZXIgPSAyO1xuICAgIHB1YmxpYyBzdGF0aWMgcmVhZG9ubHkgUlVOSU5HOiBudW1iZXIgPSAzO1xuICAgIHB1YmxpYyBzdGF0aWMgcmVhZG9ubHkgU1RPUDogbnVtYmVyID0gNDtcbiAgICBwcm90ZWN0ZWQgX3N0YXRlOiBudW1iZXIgPSAwO1xuICAgIHByb3RlY3RlZCBfbW9kdWxlTWFwOiB7IFtrZXk6IHN0cmluZ106IGVnZi5JTW9kdWxlIH0gPSB7fTtcbiAgICBwdWJsaWMgZ2V0IHN0YXRlKCk6IG51bWJlciB7XG4gICAgICAgIHJldHVybiB0aGlzLl9zdGF0ZTtcbiAgICB9XG4gICAgcHVibGljIGdldCBtb2R1bGVNYXAoKTogTW9kdWxlTWFwIHtcbiAgICAgICAgcmV0dXJuIHRoaXMuX21vZHVsZU1hcCBhcyBhbnk7XG4gICAgfVxuICAgIHB1YmxpYyBhc3luYyBib290c3RyYXAoYm9vdExvYWRlcnM/OiBlZ2YuSUJvb3RMb2FkZXJbXSk6IFByb21pc2U8Ym9vbGVhbj4ge1xuICAgICAgICB0aGlzLnNldFN0YXRlKEFwcC5CT09USU5HKTtcbiAgICAgICAgaWYgKCFib290TG9hZGVycyB8fCBib290TG9hZGVycy5sZW5ndGggPD0gMCkge1xuICAgICAgICAgICAgdGhpcy5zZXRTdGF0ZShBcHAuQk9PVEVORCk7XG4gICAgICAgICAgICByZXR1cm4gdHJ1ZTtcbiAgICAgICAgfVxuICAgICAgICBpZiAoYm9vdExvYWRlcnMgJiYgYm9vdExvYWRlcnMubGVuZ3RoID4gMCkge1xuICAgICAgICAgICAgY29uc3QgYm9vdFByb21pc2VzOiBQcm9taXNlPHZvaWQ+W10gPSBbXTtcbiAgICAgICAgICAgIGZvciAobGV0IGkgPSAwOyBpIDwgYm9vdExvYWRlcnMubGVuZ3RoOyBpKyspIHtcbiAgICAgICAgICAgICAgICBjb25zdCBib290TG9hZGVyOiBlZ2YuSUJvb3RMb2FkZXIgPSBib290TG9hZGVyc1tpXTtcbiAgICAgICAgICAgICAgICBib290UHJvbWlzZXMucHVzaChcbiAgICAgICAgICAgICAgICAgICAgbmV3IFByb21pc2UoKHJlcywgcmVqKSA9PiB7XG4gICAgICAgICAgICAgICAgICAgICAgICBib290TG9hZGVyLm9uQm9vdCh0aGlzIGFzIGFueSwgKGlzT2spID0+IHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoaXNPaykge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXMoKTtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICByZWooKTtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgICAgICB9KTtcbiAgICAgICAgICAgICAgICAgICAgfSlcbiAgICAgICAgICAgICAgICApO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgdHJ5IHtcbiAgICAgICAgICAgICAgICBhd2FpdCBQcm9taXNlLmFsbChib290UHJvbWlzZXMpO1xuICAgICAgICAgICAgICAgIHRoaXMuc2V0U3RhdGUoQXBwLkJPT1RFTkQpO1xuICAgICAgICAgICAgICAgIHJldHVybiB0cnVlO1xuICAgICAgICAgICAgfSBjYXRjaCAoZSkge1xuICAgICAgICAgICAgICAgIGNvbnNvbGUuZXJyb3IoZSk7XG4gICAgICAgICAgICAgICAgdGhpcy5zZXRTdGF0ZShBcHAuQk9PVEVORCk7XG4gICAgICAgICAgICAgICAgcmV0dXJuIGZhbHNlO1xuICAgICAgICAgICAgfVxuICAgICAgICB9XG4gICAgfVxuXG4gICAgcHVibGljIGluaXQoKTogdm9pZCB7XG4gICAgICAgIGNvbnN0IG1vZHVsZU1hcCA9IHRoaXMuX21vZHVsZU1hcDtcbiAgICAgICAgbGV0IG1vZHVsZUluczogZWdmLklNb2R1bGU7XG4gICAgICAgIGlmICh0aGlzLnN0YXRlID09PSBBcHAuUlVOSU5HKSByZXR1cm47XG4gICAgICAgIGZvciAoY29uc3Qga2V5IGluIG1vZHVsZU1hcCkge1xuICAgICAgICAgICAgbW9kdWxlSW5zID0gbW9kdWxlTWFwW2tleV07XG4gICAgICAgICAgICBtb2R1bGVJbnMub25Jbml0ICYmIG1vZHVsZUlucy5vbkluaXQodGhpcyBhcyBhbnkpO1xuICAgICAgICB9XG4gICAgICAgIGZvciAoY29uc3Qga2V5IGluIG1vZHVsZU1hcCkge1xuICAgICAgICAgICAgbW9kdWxlSW5zID0gbW9kdWxlTWFwW2tleV07XG4gICAgICAgICAgICBtb2R1bGVJbnMub25BZnRlckluaXQgJiYgbW9kdWxlSW5zLm9uQWZ0ZXJJbml0KHRoaXMgYXMgYW55KTtcbiAgICAgICAgfVxuICAgICAgICB0aGlzLnNldFN0YXRlKEFwcC5SVU5JTkcpO1xuICAgIH1cbiAgICBwdWJsaWMgbG9hZE1vZHVsZShtb2R1bGVJbnM6IGFueSB8IGVnZi5JTW9kdWxlLCBrZXk/OiBrZXlvZiBNb2R1bGVNYXApOiBib29sZWFuIHtcbiAgICAgICAgaWYgKHRoaXMuX3N0YXRlID09PSBBcHAuU1RPUCkgcmV0dXJuIGZhbHNlO1xuICAgICAgICBsZXQgcmVzOiBib29sZWFuID0gZmFsc2U7XG4gICAgICAgIGlmICgha2V5KSB7XG4gICAgICAgICAgICBrZXkgPSBtb2R1bGVJbnMua2V5IGFzIG5ldmVyO1xuICAgICAgICB9XG4gICAgICAgIGlmIChrZXkgJiYgdHlwZW9mIGtleSA9PT0gXCJzdHJpbmdcIikge1xuICAgICAgICAgICAgaWYgKG1vZHVsZUlucykge1xuICAgICAgICAgICAgICAgIGlmICghdGhpcy5fbW9kdWxlTWFwW2tleV0pIHtcbiAgICAgICAgICAgICAgICAgICAgdGhpcy5fbW9kdWxlTWFwW2tleV0gPSBtb2R1bGVJbnM7XG4gICAgICAgICAgICAgICAgICAgIHJlcyA9IHRydWU7XG4gICAgICAgICAgICAgICAgICAgIGlmICh0aGlzLl9zdGF0ZSA9PT0gQXBwLlJVTklORykge1xuICAgICAgICAgICAgICAgICAgICAgICAgbW9kdWxlSW5zLm9uSW5pdCAmJiBtb2R1bGVJbnMub25Jbml0KHRoaXMpO1xuICAgICAgICAgICAgICAgICAgICAgICAgbW9kdWxlSW5zLm9uQWZ0ZXJJbml0ICYmIG1vZHVsZUlucy5vbkFmdGVySW5pdCgpO1xuICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgICAgICAgICAgdGhpcy5fbG9nKGDliqDovb3mqKHlnZc65qih5Z2XOiR7a2V5feW3sue7j+WtmOWcqCzkuI3ph43lpI3liqDovb1gKTtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICAgIHRoaXMuX2xvZyhg5Yqg6L295qih5Z2XOuaooeWdlzoke2tleX3lrp7kvovkuLrnqbpgKTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgIHRoaXMuX2xvZyhg5Yqg6L295qih5Z2XOuaooeWdl2tleeS4uuepumApO1xuICAgICAgICB9XG4gICAgICAgIHJldHVybiByZXM7XG4gICAgfVxuICAgIHB1YmxpYyBoYXNNb2R1bGUobW9kdWxlS2V5OiBrZXlvZiBNb2R1bGVNYXApOiBib29sZWFuIHtcbiAgICAgICAgcmV0dXJuICEhdGhpcy5fbW9kdWxlTWFwW21vZHVsZUtleSBhcyBhbnldO1xuICAgIH1cbiAgICBwdWJsaWMgc3RvcCgpOiB2b2lkIHtcbiAgICAgICAgY29uc3QgbW9kdWxlTWFwID0gdGhpcy5fbW9kdWxlTWFwO1xuICAgICAgICBsZXQgbW9kdWxlSW5zOiBlZ2YuSU1vZHVsZTtcbiAgICAgICAgdGhpcy5zZXRTdGF0ZShBcHAuU1RPUCk7XG4gICAgICAgIGZvciAoY29uc3Qga2V5IGluIG1vZHVsZU1hcCkge1xuICAgICAgICAgICAgbW9kdWxlSW5zID0gbW9kdWxlTWFwW2tleV07XG4gICAgICAgICAgICBtb2R1bGVJbnMub25TdG9wICYmIG1vZHVsZUlucy5vblN0b3AoKTtcbiAgICAgICAgfVxuICAgIH1cbiAgICBwdWJsaWMgZ2V0TW9kdWxlPEsgZXh0ZW5kcyBrZXlvZiBNb2R1bGV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0FBQztnQkFDRixPQUFPLENBQUMsSUFBSSxDQUFDLG1DQUFRLEdBQUssQ0FBQyxDQUFDO2dCQUM1QixNQUFNO1lBQ1YsS0FBSyxDQUFDO2dCQUNGLE9BQU8sQ0FBQyxLQUFLLENBQUMsbUNBQVEsR0FBSyxDQUFDLENBQUM7Z0JBQzdCLE1BQU07WUFDVjtnQkFDSSxPQUFPLENBQUMsSUFBSSxDQUFDLG1DQUFRLEdBQUssQ0FBQyxDQUFDO2dCQUM1QixNQUFNO1NBQ2I7S0FDSjtJQTlIc0IsVUFBTSxHQUFXLENBQUMsQ0FBQztJQUNuQixXQUFPLEdBQVcsQ0FBQyxDQUFDO0lBQ3BCLFdBQU8sR0FBVyxDQUFDLENBQUM7SUFDcEIsVUFBTSxHQUFXLENBQUMsQ0FBQztJQUNuQixRQUFJLEdBQVcsQ0FBQyxDQUFDO0lBMkg1QyxVQUFDO0NBaElEOzs7Ozs7OzsifQ== diff --git a/packages/字体精简工具/node_modules/@ailhc/egf-core/dist/cjs/lib/index.min.js b/packages/字体精简工具/node_modules/@ailhc/egf-core/dist/cjs/lib/index.min.js new file mode 100644 index 0000000..1bca987 --- /dev/null +++ b/packages/字体精简工具/node_modules/@ailhc/egf-core/dist/cjs/lib/index.min.js @@ -0,0 +1,16 @@ +"use strict";function t(t,e){var n,o,r,i,s={label:0,sent:function(){if(1&r[0])throw r[1];return r[1]},trys:[],ops:[]};return i={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function a(i){return function(a){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;s;)try{if(n=1,o&&(r=2&i[0]?o.return:i[0]?o.throw||((r=o.return)&&r.call(o),0):o.next)&&!(r=r.call(o,i[1])).done)return r;switch(o=0,r&&(i=[2&i[0],r.value]),i[0]){case 0:case 1:r=i;break;case 4:return s.label++,{value:i[1],done:!1};case 5:s.label++,o=i[1],i=[0];continue;case 7:i=s.ops.pop(),s.trys.pop();continue;default:if(!(r=s.trys,(r=r.length>0&&r[r.length-1])||6!==i[0]&&2!==i[0])){s=0;continue}if(3===i[0]&&(!r||i[1]>r[0]&&i[1]0))return[3,4];for(o=[],r=function(t){var e=n[t];o.push(new Promise((function(t,n){e.onBoot(a,(function(e){e?t():n()}))})))},i=0;i=t||(this._state=t)},e.prototype._log=function(t,e){switch(e){case 1:console.warn("\u3010\u4e3b\u7a0b\u5e8f\u3011"+t);break;case 2:console.error("\u3010\u4e3b\u7a0b\u5e8f\u3011"+t);break;default:console.warn("\u3010\u4e3b\u7a0b\u5e8f\u3011"+t)}},e.UN_RUN=0,e.BOOTING=1,e.BOOTEND=2,e.RUNING=3,e.STOP=4,e}();exports.App=e; diff --git a/packages/字体精简工具/node_modules/@ailhc/egf-core/dist/cjs/types/index.d.ts b/packages/字体精简工具/node_modules/@ailhc/egf-core/dist/cjs/types/index.d.ts new file mode 100644 index 0000000..821b951 --- /dev/null +++ b/packages/字体精简工具/node_modules/@ailhc/egf-core/dist/cjs/types/index.d.ts @@ -0,0 +1,111 @@ +declare module '@ailhc/egf-core' { + export class App implements egf.IApp { + static readonly UN_RUN: number; + static readonly BOOTING: number; + static readonly BOOTEND: number; + static readonly RUNING: number; + static readonly STOP: number; + protected _state: number; + protected _moduleMap: { + [key: string]: egf.IModule; + }; + get state(): number; + get moduleMap(): ModuleMap; + bootstrap(bootLoaders?: egf.IBootLoader[]): Promise; + init(): void; + loadModule(moduleIns: any | egf.IModule, key?: keyof ModuleMap): boolean; + hasModule(moduleKey: keyof ModuleMap): boolean; + stop(): void; + getModule(moduleKey: K): ModuleMap[K]; + protected setState(state: number): void; + /** + * 输出 + * @param level 1 warn 2 error + * @param msg + */ + protected _log(msg: string, level?: number): void; + } + +} +declare module '@ailhc/egf-core' { + global { + namespace egf { + interface IModule { + /**模块名 */ + key?: string; + /** + * 当初始化时 + */ + onInit?(app: IApp): void; + /** + * 所有模块初始化完成时 + */ + onAfterInit?(app: IApp): void; + /** + * 模块停止时 + */ + onStop?(): void; + } + type BootEndCallback = (isSuccess: boolean) => void; + /** + * 引导程序 + */ + interface IBootLoader { + /** + * 引导 + * @param app + */ + onBoot(app: IApp, bootEnd: BootEndCallback): void; + } + /** + * 主程序 + */ + interface IApp { + /** + * 程序状态 + * 0 未启动 1 引导中, 2 初始化, 3 运行中 + */ + state: number; + /** + * 模块字典 + */ + moduleMap: ModuleMap; + /** + * 引导 + * @param bootLoaders + */ + bootstrap(bootLoaders: egf.IBootLoader[]): Promise; + /** + * 初始化 + */ + init(): void; + /** + * 加载模块 + * @param module + */ + loadModule(module: IModule | any, key?: keyof ModuleMap): void; + /** + * 停止 + */ + stop(): void; + /** + * 获取模块实例 + * @param moduleKey + */ + getModule(moduleKey: K): ModuleMap[K]; + /** + * 判断有没有这个模块 + * @param moduleKey + */ + hasModule(moduleKey: keyof ModuleMap): boolean; + } + } + } + export {}; + +} +declare module '@ailhc/egf-core' { + export * from '@ailhc/egf-core'; + export * from '@ailhc/egf-core'; + +} diff --git a/packages/字体精简工具/node_modules/@ailhc/egf-core/dist/es/lib/index.min.mjs b/packages/字体精简工具/node_modules/@ailhc/egf-core/dist/es/lib/index.min.mjs new file mode 100644 index 0000000..ea140ee --- /dev/null +++ b/packages/字体精简工具/node_modules/@ailhc/egf-core/dist/es/lib/index.min.mjs @@ -0,0 +1,15 @@ +/*! ***************************************************************************** +Copyright (c) Microsoft Corporation. All rights reserved. +Licensed under the Apache License, Version 2.0 (the "License"); you may not use +this file except in compliance with the License. You may obtain a copy of the +License at http://www.apache.org/licenses/LICENSE-2.0 + +THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED +WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE, +MERCHANTABLITY OR NON-INFRINGEMENT. + +See the Apache Version 2.0 License for specific language governing permissions +and limitations under the License. +***************************************************************************** */ +function t(t,e){var n,o,r,i,a={label:0,sent:function(){if(1&r[0])throw r[1];return r[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(i){return function(s){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,o&&(r=2&i[0]?o.return:i[0]?o.throw||((r=o.return)&&r.call(o),0):o.next)&&!(r=r.call(o,i[1])).done)return r;switch(o=0,r&&(i=[2&i[0],r.value]),i[0]){case 0:case 1:r=i;break;case 4:return a.label++,{value:i[1],done:!1};case 5:a.label++,o=i[1],i=[0];continue;case 7:i=a.ops.pop(),a.trys.pop();continue;default:if(!(r=a.trys,(r=r.length>0&&r[r.length-1])||6!==i[0]&&2!==i[0])){a=0;continue}if(3===i[0]&&(!r||i[1]>r[0]&&i[1]0))return[3,4];for(o=[],r=function(t){var e=n[t];o.push(new Promise((function(t,n){e.onBoot(s,(function(e){e?t():n()}))})))},i=0;i=t||(this._state=t)},e.prototype._log=function(t,e){switch(e){case 1:console.warn("\u3010\u4e3b\u7a0b\u5e8f\u3011"+t);break;case 2:console.error("\u3010\u4e3b\u7a0b\u5e8f\u3011"+t);break;default:console.warn("\u3010\u4e3b\u7a0b\u5e8f\u3011"+t)}},e.UN_RUN=0,e.BOOTING=1,e.BOOTEND=2,e.RUNING=3,e.STOP=4,e}();export{e as App}; diff --git a/packages/字体精简工具/node_modules/@ailhc/egf-core/dist/es/lib/index.mjs b/packages/字体精简工具/node_modules/@ailhc/egf-core/dist/es/lib/index.mjs new file mode 100644 index 0000000..d0e2f37 --- /dev/null +++ b/packages/字体精简工具/node_modules/@ailhc/egf-core/dist/es/lib/index.mjs @@ -0,0 +1,211 @@ +/*! ***************************************************************************** +Copyright (c) Microsoft Corporation. All rights reserved. +Licensed under the Apache License, Version 2.0 (the "License"); you may not use +this file except in compliance with the License. You may obtain a copy of the +License at http://www.apache.org/licenses/LICENSE-2.0 + +THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED +WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE, +MERCHANTABLITY OR NON-INFRINGEMENT. + +See the Apache Version 2.0 License for specific language governing permissions +and limitations under the License. +***************************************************************************** */ + +function __awaiter(thisArg, _arguments, P, generator) { + return new (P || (P = Promise))(function (resolve, reject) { + function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } + function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } + function step(result) { result.done ? resolve(result.value) : new P(function (resolve) { resolve(result.value); }).then(fulfilled, rejected); } + step((generator = generator.apply(thisArg, _arguments || [])).next()); + }); +} + +function __generator(thisArg, body) { + var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g; + return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g; + function verb(n) { return function (v) { return step([n, v]); }; } + function step(op) { + if (f) throw new TypeError("Generator is already executing."); + while (_) try { + if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t; + if (y = 0, t) op = [op[0] & 2, t.value]; + switch (op[0]) { + case 0: case 1: t = op; break; + case 4: _.label++; return { value: op[1], done: false }; + case 5: _.label++; y = op[1]; op = [0]; continue; + case 7: op = _.ops.pop(); _.trys.pop(); continue; + default: + if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; } + if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; } + if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; } + if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; } + if (t[2]) _.ops.pop(); + _.trys.pop(); continue; + } + op = body.call(thisArg, _); + } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; } + if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true }; + } +} + +var App = (function () { + function App() { + this._state = 0; + this._moduleMap = {}; + } + Object.defineProperty(App.prototype, "state", { + get: function () { + return this._state; + }, + enumerable: false, + configurable: true + }); + Object.defineProperty(App.prototype, "moduleMap", { + get: function () { + return this._moduleMap; + }, + enumerable: false, + configurable: true + }); + App.prototype.bootstrap = function (bootLoaders) { + return __awaiter(this, void 0, void 0, function () { + var bootPromises, _loop_1, i, e_1; + var _this = this; + return __generator(this, function (_a) { + switch (_a.label) { + case 0: + this.setState(App.BOOTING); + if (!bootLoaders || bootLoaders.length <= 0) { + this.setState(App.BOOTEND); + return [2, true]; + } + if (!(bootLoaders && bootLoaders.length > 0)) return [3, 4]; + bootPromises = []; + _loop_1 = function (i) { + var bootLoader = bootLoaders[i]; + bootPromises.push(new Promise(function (res, rej) { + bootLoader.onBoot(_this, function (isOk) { + if (isOk) { + res(); + } + else { + rej(); + } + }); + })); + }; + for (i = 0; i < bootLoaders.length; i++) { + _loop_1(i); + } + _a.label = 1; + case 1: + _a.trys.push([1, 3, , 4]); + return [4, Promise.all(bootPromises)]; + case 2: + _a.sent(); + this.setState(App.BOOTEND); + return [2, true]; + case 3: + e_1 = _a.sent(); + console.error(e_1); + this.setState(App.BOOTEND); + return [2, false]; + case 4: return [2]; + } + }); + }); + }; + App.prototype.init = function () { + var moduleMap = this._moduleMap; + var moduleIns; + if (this.state === App.RUNING) + return; + for (var key in moduleMap) { + moduleIns = moduleMap[key]; + moduleIns.onInit && moduleIns.onInit(this); + } + for (var key in moduleMap) { + moduleIns = moduleMap[key]; + moduleIns.onAfterInit && moduleIns.onAfterInit(this); + } + this.setState(App.RUNING); + }; + App.prototype.loadModule = function (moduleIns, key) { + if (this._state === App.STOP) + return false; + var res = false; + if (!key) { + key = moduleIns.key; + } + if (key && typeof key === "string") { + if (moduleIns) { + if (!this._moduleMap[key]) { + this._moduleMap[key] = moduleIns; + res = true; + if (this._state === App.RUNING) { + moduleIns.onInit && moduleIns.onInit(this); + moduleIns.onAfterInit && moduleIns.onAfterInit(); + } + } + else { + this._log("\u52A0\u8F7D\u6A21\u5757:\u6A21\u5757:" + key + "\u5DF2\u7ECF\u5B58\u5728,\u4E0D\u91CD\u590D\u52A0\u8F7D"); + } + } + else { + this._log("\u52A0\u8F7D\u6A21\u5757:\u6A21\u5757:" + key + "\u5B9E\u4F8B\u4E3A\u7A7A"); + } + } + else { + this._log("\u52A0\u8F7D\u6A21\u5757:\u6A21\u5757key\u4E3A\u7A7A"); + } + return res; + }; + App.prototype.hasModule = function (moduleKey) { + return !!this._moduleMap[moduleKey]; + }; + App.prototype.stop = function () { + var moduleMap = this._moduleMap; + var moduleIns; + this.setState(App.STOP); + for (var key in moduleMap) { + moduleIns = moduleMap[key]; + moduleIns.onStop && moduleIns.onStop(); + } + }; + App.prototype.getModule = function (moduleKey) { + return this._moduleMap[moduleKey]; + }; + App.prototype.setState = function (state) { + if (!isNaN(this._state)) { + if (this._state >= state) + return; + } + this._state = state; + }; + App.prototype._log = function (msg, level) { + switch (level) { + case 1: + console.warn("\u3010\u4E3B\u7A0B\u5E8F\u3011" + msg); + break; + case 2: + console.error("\u3010\u4E3B\u7A0B\u5E8F\u3011" + msg); + break; + default: + console.warn("\u3010\u4E3B\u7A0B\u5E8F\u3011" + msg); + break; + } + }; + App.UN_RUN = 0; + App.BOOTING = 1; + App.BOOTEND = 2; + App.RUNING = 3; + App.STOP = 4; + return App; +}()); + +export { App }; + + +//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaW5kZXgubWpzIiwic291cmNlcyI6WyJAYWlsaGMvZWdmLWNvcmUvc3JjL2VnZi1hcHAudHMiXSwic291cmNlc0NvbnRlbnQiOlsiZXhwb3J0IGN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GJvb3RMb2FkZXJzLmxlbmd0aCA+IDApIHtcbiAgICAgICAgICAgIGNvbnN0IGJvb3RQcm9taXNlczogUHJvbWlzZTx2b2lkPltdID0gW107XG4gICAgICAgICAgICBmb3IgKGxldCBpID0gMDsgaSA8IGJvb3RMb2FkZXJzLmxlbmd0aDsgaSsrKSB7XG4gICAgICAgICAgICAgICAgY29uc3QgYm9vdExvYWRlcjogZWdmLklCb290TG9hZGVyID0gYm9vdExvYWRlcnNbaV07XG4gICAgICAgICAgICAgICAgYm9vdFByb21pc2VzLnB1c2goXG4gICAgICAgICAgICAgICAgICAgIG5ldyBQcm9taXNlKChyZXMsIHJlaikgPT4ge1xuICAgICAgICAgICAgICAgICAgICAgICAgYm9vdExvYWRlci5vbkJvb3QodGhpcyBhcyBhbnksIChpc09rKSA9PiB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKGlzT2spIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcmVzKCk7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcmVqKCk7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICAgICAgfSk7XG4gICAgICAgICAgICAgICAgICAgIH0pXG4gICAgICAgICAgICAgICAgKTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIHRyeSB7XG4gICAgICAgICAgICAgICAgYXdhaXQgUHJvbWlzZS5hbGwoYm9vdFByb21pc2VzKTtcbiAgICAgICAgICAgICAgICB0aGlzLnNldFN0YXRlKEFwcC5CT09URU5EKTtcbiAgICAgICAgICAgICAgICByZXR1cm4gdHJ1ZTtcbiAgICAgICAgICAgIH0gY2F0Y2ggKGUpIHtcbiAgICAgICAgICAgICAgICBjb25zb2xlLmVycm9yKGUpO1xuICAgICAgICAgICAgICAgIHRoaXMuc2V0U3RhdGUoQXBwLkJPT1RFTkQpO1xuIC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gICBpZiAoa2V5ICYmIHR5cGVvZiBrZXkgPT09IFwic3RyaW5nXCIpIHtcbiAgICAgICAgICAgIGlmIChtb2R1bGVJbnMpIHtcbiAgICAgICAgICAgICAgICBpZiAoIXRoaXMuX21vZHVsZU1hcFtrZXldKSB7XG4gICAgICAgICAgICAgICAgICAgIHRoaXMuX21vZHVsZU1hcFtrZXldID0gbW9kdWxlSW5zO1xuICAgICAgICAgICAgICAgICAgICByZXMgPSB0cnVlO1xuICAgICAgICAgICAgICAgICAgICBpZiAodGhpcy5fc3RhdGUgPT09IEFwcC5SVU5JTkcpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIG1vZHVsZUlucy5vbkluaXQgJiYgbW9kdWxlSW5zLm9uSW5pdCh0aGlzKTtcbiAgICAgICAgICAgICAgICAgICAgICAgIG1vZHVsZUlucy5vbkFmdGVySW5pdCAmJiBtb2R1bGVJbnMub25BZnRlckluaXQoKTtcbiAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgICAgICAgIHRoaXMuX2xvZyhg5Yqg6L295qih5Z2XOuaooeWdlzoke2tleX3lt7Lnu4/lrZjlnKgs5LiN6YeN5aSN5Yqg6L29YCk7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgICAgICB0aGlzLl9sb2coYOWKoOi9veaooeWdlzrmqKHlnZc6JHtrZXl95a6e5L6L5Li656m6YCk7XG4gICAgICAgICAgICB9XG4gICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICB0aGlzLl9sb2coYOWKoOi9veaooeWdlzrmqKHlnZdrZXnkuLrnqbpgKTtcbiAgICAgICAgfVxuICAgICAgICByZXR1cm4gcmVzO1xuICAgIH1cbiAgICBwdWJsaWMgaGFzTW9kdWxlKG1vZHVsZUtleToga2V5b2YgTW9kdWxlTWFwKTogYm9vbGVhbiB7XG4gICAgICAgIHJldHVybiAhIXRoaX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7U0FDMUM7S0FDSjtJQUNNLHVCQUFTLEdBQWhCLFVBQTRDLFNBQVk7UUFDcEQsT0FBTyxJQUFJLENBQUMsVUFBVSxDQUFDLFNBQWdCLENBQVEsQ0FBQztLQUNuRDtJQUVTLHNCQUFRLEdBQWxCLFVBQW1CLEtBQWE7UUFDNUIsSUFBSSxDQUFDLEtBQUssQ0FBQyxJQUFJLENBQUMsTUFBTSxDQUFDLEVBQUU7WUFDckIsSUFBSSxJQUFJLENBQUMsTUFBTSxJQUFJLEtBQUs7Z0JBQUUsT0FBTztTQUNwQztRQUNELElBQUksQ0FBQyxNQUFNLEdBQUcsS0FBSyxDQUFDO0tBQ3ZCO0lBTVMsa0JBQUksR0FBZCxVQUFlLEdBQVcsRUFBRSxLQUFjO1FBQ3RDLFFBQVEsS0FBSztZQUNULEtBQUssQ0FBQztnQkFDRixPQUFPLENBQUMsSUFBSSxDQUFDLG1DQUFRLEdBQUssQ0FBQyxDQUFDO2dCQUM1QixNQUFNO1lBQ1YsS0FBSyxDQUFDO2dCQUNGLE9BQU8sQ0FBQyxLQUFLLENBQUMsbUNBQVEsR0FBSyxDQUFDLENBQUM7Z0JBQzdCLE1BQU07WUFDVjtnQkFDSSxPQUFPLENBQUMsSUFBSSxDQUFDLG1DQUFRLEdBQUssQ0FBQyxDQUFDO2dCQUM1QixNQUFNO1NBQ2I7S0FDSjtJQTlIc0IsVUFBTSxHQUFXLENBQUMsQ0FBQztJQUNuQixXQUFPLEdBQVcsQ0FBQyxDQUFDO0lBQ3BCLFdBQU8sR0FBVyxDQUFDLENBQUM7SUFDcEIsVUFBTSxHQUFXLENBQUMsQ0FBQztJQUNuQixRQUFJLEdBQVcsQ0FBQyxDQUFDO0lBMkg1QyxVQUFDO0NBaElEOzs7Ozs7OzsifQ== diff --git a/packages/字体精简工具/node_modules/@ailhc/egf-core/dist/es/types/index.d.ts b/packages/字体精简工具/node_modules/@ailhc/egf-core/dist/es/types/index.d.ts new file mode 100644 index 0000000..821b951 --- /dev/null +++ b/packages/字体精简工具/node_modules/@ailhc/egf-core/dist/es/types/index.d.ts @@ -0,0 +1,111 @@ +declare module '@ailhc/egf-core' { + export class App implements egf.IApp { + static readonly UN_RUN: number; + static readonly BOOTING: number; + static readonly BOOTEND: number; + static readonly RUNING: number; + static readonly STOP: number; + protected _state: number; + protected _moduleMap: { + [key: string]: egf.IModule; + }; + get state(): number; + get moduleMap(): ModuleMap; + bootstrap(bootLoaders?: egf.IBootLoader[]): Promise; + init(): void; + loadModule(moduleIns: any | egf.IModule, key?: keyof ModuleMap): boolean; + hasModule(moduleKey: keyof ModuleMap): boolean; + stop(): void; + getModule(moduleKey: K): ModuleMap[K]; + protected setState(state: number): void; + /** + * 输出 + * @param level 1 warn 2 error + * @param msg + */ + protected _log(msg: string, level?: number): void; + } + +} +declare module '@ailhc/egf-core' { + global { + namespace egf { + interface IModule { + /**模块名 */ + key?: string; + /** + * 当初始化时 + */ + onInit?(app: IApp): void; + /** + * 所有模块初始化完成时 + */ + onAfterInit?(app: IApp): void; + /** + * 模块停止时 + */ + onStop?(): void; + } + type BootEndCallback = (isSuccess: boolean) => void; + /** + * 引导程序 + */ + interface IBootLoader { + /** + * 引导 + * @param app + */ + onBoot(app: IApp, bootEnd: BootEndCallback): void; + } + /** + * 主程序 + */ + interface IApp { + /** + * 程序状态 + * 0 未启动 1 引导中, 2 初始化, 3 运行中 + */ + state: number; + /** + * 模块字典 + */ + moduleMap: ModuleMap; + /** + * 引导 + * @param bootLoaders + */ + bootstrap(bootLoaders: egf.IBootLoader[]): Promise; + /** + * 初始化 + */ + init(): void; + /** + * 加载模块 + * @param module + */ + loadModule(module: IModule | any, key?: keyof ModuleMap): void; + /** + * 停止 + */ + stop(): void; + /** + * 获取模块实例 + * @param moduleKey + */ + getModule(moduleKey: K): ModuleMap[K]; + /** + * 判断有没有这个模块 + * @param moduleKey + */ + hasModule(moduleKey: keyof ModuleMap): boolean; + } + } + } + export {}; + +} +declare module '@ailhc/egf-core' { + export * from '@ailhc/egf-core'; + export * from '@ailhc/egf-core'; + +} diff --git a/packages/字体精简工具/node_modules/@ailhc/egf-core/dist/iife/egfCore.d.ts b/packages/字体精简工具/node_modules/@ailhc/egf-core/dist/iife/egfCore.d.ts new file mode 100644 index 0000000..2436145 --- /dev/null +++ b/packages/字体精简工具/node_modules/@ailhc/egf-core/dist/iife/egfCore.d.ts @@ -0,0 +1,116 @@ +declare module 'egfCore' { + class App implements egf.IApp { + static readonly UN_RUN: number; + static readonly BOOTING: number; + static readonly BOOTEND: number; + static readonly RUNING: number; + static readonly STOP: number; + protected _state: number; + protected _moduleMap: { + [key: string]: egf.IModule; + }; + get state(): number; + get moduleMap(): ModuleMap; + bootstrap(bootLoaders?: egf.IBootLoader[]): Promise; + init(): void; + loadModule(moduleIns: any | egf.IModule, key?: keyof ModuleMap): boolean; + hasModule(moduleKey: keyof ModuleMap): boolean; + stop(): void; + getModule(moduleKey: K): ModuleMap[K]; + protected setState(state: number): void; + /** + * 输出 + * @param level 1 warn 2 error + * @param msg + */ + protected _log(msg: string, level?: number): void; + } + +} +declare module 'egfCore' { + global { + namespace egf { + interface IModule { + /**模块名 */ + key?: string; + /** + * 当初始化时 + */ + onInit?(app: IApp): void; + /** + * 所有模块初始化完成时 + */ + onAfterInit?(app: IApp): void; + /** + * 模块停止时 + */ + onStop?(): void; + } + type BootEndCallback = (isSuccess: boolean) => void; + /** + * 引导程序 + */ + interface IBootLoader { + /** + * 引导 + * @param app + */ + onBoot(app: IApp, bootEnd: BootEndCallback): void; + } + /** + * 主程序 + */ + interface IApp { + /** + * 程序状态 + * 0 未启动 1 引导中, 2 初始化, 3 运行中 + */ + state: number; + /** + * 模块字典 + */ + moduleMap: ModuleMap; + /** + * 引导 + * @param bootLoaders + */ + bootstrap(bootLoaders: egf.IBootLoader[]): Promise; + /** + * 初始化 + */ + init(): void; + /** + * 加载模块 + * @param module + */ + loadModule(module: IModule | any, key?: keyof ModuleMap): void; + /** + * 停止 + */ + stop(): void; + /** + * 获取模块实例 + * @param moduleKey + */ + getModule(moduleKey: K): ModuleMap[K]; + /** + * 判断有没有这个模块 + * @param moduleKey + */ + hasModule(moduleKey: keyof ModuleMap): boolean; + } + } + } + + +} +declare module 'egfCore' { + + + +} + +declare namespace egfCore { + type App = import('egfCore').App; +} +declare const egfCore:typeof import("egfCore"); \ No newline at end of file diff --git a/packages/字体精简工具/node_modules/@ailhc/egf-core/dist/iife/egfCore.js b/packages/字体精简工具/node_modules/@ailhc/egf-core/dist/iife/egfCore.js new file mode 100644 index 0000000..c4197e6 --- /dev/null +++ b/packages/字体精简工具/node_modules/@ailhc/egf-core/dist/iife/egfCore.js @@ -0,0 +1,221 @@ +var egfCore = (function (exports) { + 'use strict'; + + /*! ***************************************************************************** + Copyright (c) Microsoft Corporation. All rights reserved. + Licensed under the Apache License, Version 2.0 (the "License"); you may not use + this file except in compliance with the License. You may obtain a copy of the + License at http://www.apache.org/licenses/LICENSE-2.0 + + THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED + WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE, + MERCHANTABLITY OR NON-INFRINGEMENT. + + See the Apache Version 2.0 License for specific language governing permissions + and limitations under the License. + ***************************************************************************** */ + + function __awaiter(thisArg, _arguments, P, generator) { + return new (P || (P = Promise))(function (resolve, reject) { + function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } + function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } + function step(result) { result.done ? resolve(result.value) : new P(function (resolve) { resolve(result.value); }).then(fulfilled, rejected); } + step((generator = generator.apply(thisArg, _arguments || [])).next()); + }); + } + + function __generator(thisArg, body) { + var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g; + return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g; + function verb(n) { return function (v) { return step([n, v]); }; } + function step(op) { + if (f) throw new TypeError("Generator is already executing."); + while (_) try { + if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t; + if (y = 0, t) op = [op[0] & 2, t.value]; + switch (op[0]) { + case 0: case 1: t = op; break; + case 4: _.label++; return { value: op[1], done: false }; + case 5: _.label++; y = op[1]; op = [0]; continue; + case 7: op = _.ops.pop(); _.trys.pop(); continue; + default: + if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; } + if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; } + if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; } + if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; } + if (t[2]) _.ops.pop(); + _.trys.pop(); continue; + } + op = body.call(thisArg, _); + } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; } + if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true }; + } + } + + var App = (function () { + function App() { + this._state = 0; + this._moduleMap = {}; + } + Object.defineProperty(App.prototype, "state", { + get: function () { + return this._state; + }, + enumerable: false, + configurable: true + }); + Object.defineProperty(App.prototype, "moduleMap", { + get: function () { + return this._moduleMap; + }, + enumerable: false, + configurable: true + }); + App.prototype.bootstrap = function (bootLoaders) { + return __awaiter(this, void 0, void 0, function () { + var bootPromises, _loop_1, i, e_1; + var _this = this; + return __generator(this, function (_a) { + switch (_a.label) { + case 0: + this.setState(App.BOOTING); + if (!bootLoaders || bootLoaders.length <= 0) { + this.setState(App.BOOTEND); + return [2, true]; + } + if (!(bootLoaders && bootLoaders.length > 0)) return [3, 4]; + bootPromises = []; + _loop_1 = function (i) { + var bootLoader = bootLoaders[i]; + bootPromises.push(new Promise(function (res, rej) { + bootLoader.onBoot(_this, function (isOk) { + if (isOk) { + res(); + } + else { + rej(); + } + }); + })); + }; + for (i = 0; i < bootLoaders.length; i++) { + _loop_1(i); + } + _a.label = 1; + case 1: + _a.trys.push([1, 3, , 4]); + return [4, Promise.all(bootPromises)]; + case 2: + _a.sent(); + this.setState(App.BOOTEND); + return [2, true]; + case 3: + e_1 = _a.sent(); + console.error(e_1); + this.setState(App.BOOTEND); + return [2, false]; + case 4: return [2]; + } + }); + }); + }; + App.prototype.init = function () { + var moduleMap = this._moduleMap; + var moduleIns; + if (this.state === App.RUNING) + return; + for (var key in moduleMap) { + moduleIns = moduleMap[key]; + moduleIns.onInit && moduleIns.onInit(this); + } + for (var key in moduleMap) { + moduleIns = moduleMap[key]; + moduleIns.onAfterInit && moduleIns.onAfterInit(this); + } + this.setState(App.RUNING); + }; + App.prototype.loadModule = function (moduleIns, key) { + if (this._state === App.STOP) + return false; + var res = false; + if (!key) { + key = moduleIns.key; + } + if (key && typeof key === "string") { + if (moduleIns) { + if (!this._moduleMap[key]) { + this._moduleMap[key] = moduleIns; + res = true; + if (this._state === App.RUNING) { + moduleIns.onInit && moduleIns.onInit(this); + moduleIns.onAfterInit && moduleIns.onAfterInit(); + } + } + else { + this._log("\u52A0\u8F7D\u6A21\u5757:\u6A21\u5757:" + key + "\u5DF2\u7ECF\u5B58\u5728,\u4E0D\u91CD\u590D\u52A0\u8F7D"); + } + } + else { + this._log("\u52A0\u8F7D\u6A21\u5757:\u6A21\u5757:" + key + "\u5B9E\u4F8B\u4E3A\u7A7A"); + } + } + else { + this._log("\u52A0\u8F7D\u6A21\u5757:\u6A21\u5757key\u4E3A\u7A7A"); + } + return res; + }; + App.prototype.hasModule = function (moduleKey) { + return !!this._moduleMap[moduleKey]; + }; + App.prototype.stop = function () { + var moduleMap = this._moduleMap; + var moduleIns; + this.setState(App.STOP); + for (var key in moduleMap) { + moduleIns = moduleMap[key]; + moduleIns.onStop && moduleIns.onStop(); + } + }; + App.prototype.getModule = function (moduleKey) { + return this._moduleMap[moduleKey]; + }; + App.prototype.setState = function (state) { + if (!isNaN(this._state)) { + if (this._state >= state) + return; + } + this._state = state; + }; + App.prototype._log = function (msg, level) { + switch (level) { + case 1: + console.warn("\u3010\u4E3B\u7A0B\u5E8F\u3011" + msg); + break; + case 2: + console.error("\u3010\u4E3B\u7A0B\u5E8F\u3011" + msg); + break; + default: + console.warn("\u3010\u4E3B\u7A0B\u5E8F\u3011" + msg); + break; + } + }; + App.UN_RUN = 0; + App.BOOTING = 1; + App.BOOTEND = 2; + App.RUNING = 3; + App.STOP = 4; + return App; + }()); + + exports.App = App; + + Object.defineProperty(exports, '__esModule', { value: true }); + + return exports; + +}({})); + + var globalTarget =window?window:global; + globalTarget.egfCore?Object.assign({},globalTarget.egfCore):(globalTarget.egfCore = egfCore) +//# sourceMappingURL=egfCore.js.map diff --git a/packages/字体精简工具/node_modules/@ailhc/egf-core/dist/iife/egfCore.js.map b/packages/字体精简工具/node_modules/@ailhc/egf-core/dist/iife/egfCore.js.map new file mode 100644 index 0000000..0dc650b --- /dev/null +++ b/packages/字体精简工具/node_modules/@ailhc/egf-core/dist/iife/egfCore.js.map @@ -0,0 +1 @@ +{"version":3,"file":"egfCore.js","sources":["@ailhc/egf-core/src/egf-app.ts"],"sourcesContent":["export class App implements egf.IApp {\n public static readonly UN_RUN: number = 0;\n public static readonly BOOTING: number = 1;\n public static readonly BOOTEND: number = 2;\n public static readonly RUNING: number = 3;\n public static readonly STOP: number = 4;\n protected _state: number = 0;\n protected _moduleMap: { [key: string]: egf.IModule } = {};\n public get state(): number {\n return this._state;\n }\n public get moduleMap(): ModuleMap {\n return this._moduleMap as any;\n }\n public async bootstrap(bootLoaders?: egf.IBootLoader[]): Promise {\n this.setState(App.BOOTING);\n if (!bootLoaders || bootLoaders.length <= 0) {\n this.setState(App.BOOTEND);\n return true;\n }\n if (bootLoaders && bootLoaders.length > 0) {\n const bootPromises: Promise[] = [];\n for (let i = 0; i < bootLoaders.length; i++) {\n const bootLoader: egf.IBootLoader = bootLoaders[i];\n bootPromises.push(\n new Promise((res, rej) => {\n bootLoader.onBoot(this as any, (isOk) => {\n if (isOk) {\n res();\n } else {\n rej();\n }\n });\n })\n );\n }\n try {\n await Promise.all(bootPromises);\n this.setState(App.BOOTEND);\n return true;\n } catch (e) {\n console.error(e);\n this.setState(App.BOOTEND);\n return false;\n }\n }\n }\n\n public init(): void {\n const moduleMap = this._moduleMap;\n let moduleIns: egf.IModule;\n if (this.state === App.RUNING) return;\n for (const key in moduleMap) {\n moduleIns = moduleMap[key];\n moduleIns.onInit && moduleIns.onInit(this as any);\n }\n for (const key in moduleMap) {\n moduleIns = moduleMap[key];\n moduleIns.onAfterInit && moduleIns.onAfterInit(this as any);\n }\n this.setState(App.RUNING);\n }\n public loadModule(moduleIns: any | egf.IModule, key?: keyof ModuleMap): boolean {\n if (this._state === App.STOP) return false;\n let res: boolean = false;\n if (!key) {\n key = moduleIns.key as never;\n }\n if (key && typeof key === \"string\") {\n if (moduleIns) {\n if (!this._moduleMap[key]) {\n this._moduleMap[key] = moduleIns;\n res = true;\n if (this._state === App.RUNING) {\n moduleIns.onInit && moduleIns.onInit(this);\n moduleIns.onAfterInit && moduleIns.onAfterInit();\n }\n } else {\n this._log(`加载模块:模块:${key}已经存在,不重复加载`);\n }\n } else {\n this._log(`加载模块:模块:${key}实例为空`);\n }\n } else {\n this._log(`加载模块:模块key为空`);\n }\n return res;\n }\n public hasModule(moduleKey: keyof ModuleMap): boolean {\n return !!this._moduleMap[moduleKey as any];\n }\n public stop(): void {\n const moduleMap = this._moduleMap;\n let moduleIns: egf.IModule;\n this.setState(App.STOP);\n for (const key in moduleMap) {\n moduleIns = moduleMap[key];\n moduleIns.onStop && moduleIns.onStop();\n }\n }\n public getModule(moduleKey: K): ModuleMap[K] {\n return this._moduleMap[moduleKey as any] as any;\n }\n\n protected setState(state: number) {\n if (!isNaN(this._state)) {\n if (this._state >= state) return;\n }\n this._state = state;\n }\n /**\n * 输出\n * @param level 1 warn 2 error\n * @param msg\n */\n protected _log(msg: string, level?: number): void {\n switch (level) {\n case 1:\n console.warn(`【主程序】${msg}`);\n break;\n case 2:\n console.error(`【主程序】${msg}`);\n break;\n default:\n console.warn(`【主程序】${msg}`);\n break;\n }\n }\n}\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;QAAA;YAMc,WAAM,GAAW,CAAC,CAAC;YACnB,eAAU,GAAmC,EAAE,CAAC;SAyH7D;QAxHG,sBAAW,sBAAK;iBAAhB;gBACI,OAAO,IAAI,CAAC,MAAM,CAAC;aACtB;;;WAAA;QACD,sBAAW,0BAAS;iBAApB;gBACI,OAAO,IAAI,CAAC,UAAiB,CAAC;aACjC;;;WAAA;QACY,uBAAS,GAAtB,UAAuB,WAA+B;;;;;;;4BAClD,IAAI,CAAC,QAAQ,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC;4BAC3B,IAAI,CAAC,WAAW,IAAI,WAAW,CAAC,MAAM,IAAI,CAAC,EAAE;gCACzC,IAAI,CAAC,QAAQ,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC;gCAC3B,WAAO,IAAI,EAAC;6BACf;kCACG,WAAW,IAAI,WAAW,CAAC,MAAM,GAAG,CAAC,CAAA,EAArC,cAAqC;4BAC/B,YAAY,GAAoB,EAAE,CAAC;gDAChC,CAAC;gCACN,IAAM,UAAU,GAAoB,WAAW,CAAC,CAAC,CAAC,CAAC;gCACnD,YAAY,CAAC,IAAI,CACb,IAAI,OAAO,CAAC,UAAC,GAAG,EAAE,GAAG;oCACjB,UAAU,CAAC,MAAM,CAAC,KAAW,EAAE,UAAC,IAAI;wCAChC,IAAI,IAAI,EAAE;4CACN,GAAG,EAAE,CAAC;yCACT;6CAAM;4CACH,GAAG,EAAE,CAAC;yCACT;qCACJ,CAAC,CAAC;iCACN,CAAC,CACL,CAAC;;4BAZN,KAAS,CA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AQ,GAAlB,UAAmB,KAAa;YAC5B,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,MAAM,CAAC,EAAE;gBACrB,IAAI,IAAI,CAAC,MAAM,IAAI,KAAK;oBAAE,OAAO;aACpC;YACD,IAAI,CAAC,MAAM,GAAG,KAAK,CAAC;SACvB;QAMS,kBAAI,GAAd,UAAe,GAAW,EAAE,KAAc;YACtC,QAAQ,KAAK;gBACT,KAAK,CAAC;oBACF,OAAO,CAAC,IAAI,CAAC,mCAAQ,GAAK,CAAC,CAAC;oBAC5B,MAAM;gBACV,KAAK,CAAC;oBACF,OAAO,CAAC,KAAK,CAAC,mCAAQ,GAAK,CAAC,CAAC;oBAC7B,MAAM;gBACV;oBACI,OAAO,CAAC,IAAI,CAAC,mCAAQ,GAAK,CAAC,CAAC;oBAC5B,MAAM;aACb;SACJ;QA9HsB,UAAM,GAAW,CAAC,CAAC;QACnB,WAAO,GAAW,CAAC,CAAC;QACpB,WAAO,GAAW,CAAC,CAAC;QACpB,UAAM,GAAW,CAAC,CAAC;QACnB,QAAI,GAAW,CAAC,CAAC;QA2H5C,UAAC;KAhID;;;;;;;;;;;;;;;;;"} \ No newline at end of file diff --git a/packages/字体精简工具/node_modules/@ailhc/egf-core/dist/iife/egfCore.min.js b/packages/字体精简工具/node_modules/@ailhc/egf-core/dist/iife/egfCore.min.js new file mode 100644 index 0000000..4477c05 --- /dev/null +++ b/packages/字体精简工具/node_modules/@ailhc/egf-core/dist/iife/egfCore.min.js @@ -0,0 +1,15 @@ +var egfCore=function(t){"use strict"; +/*! ***************************************************************************** + Copyright (c) Microsoft Corporation. All rights reserved. + Licensed under the Apache License, Version 2.0 (the "License"); you may not use + this file except in compliance with the License. You may obtain a copy of the + License at http://www.apache.org/licenses/LICENSE-2.0 + + THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED + WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE, + MERCHANTABLITY OR NON-INFRINGEMENT. + + See the Apache Version 2.0 License for specific language governing permissions + and limitations under the License. + ***************************************************************************** */function e(t,e){var n,o,r,i,a={label:0,sent:function(){if(1&r[0])throw r[1];return r[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(i){return function(s){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,o&&(r=2&i[0]?o.return:i[0]?o.throw||((r=o.return)&&r.call(o),0):o.next)&&!(r=r.call(o,i[1])).done)return r;switch(o=0,r&&(i=[2&i[0],r.value]),i[0]){case 0:case 1:r=i;break;case 4:return a.label++,{value:i[1],done:!1};case 5:a.label++,o=i[1],i=[0];continue;case 7:i=a.ops.pop(),a.trys.pop();continue;default:if(!(r=a.trys,(r=r.length>0&&r[r.length-1])||6!==i[0]&&2!==i[0])){a=0;continue}if(3===i[0]&&(!r||i[1]>r[0]&&i[1]0))return[3,4];for(o=[],r=function(t){var e=n[t];o.push(new Promise((function(t,n){e.onBoot(s,(function(e){e?t():n()}))})))},i=0;i=t||(this._state=t)},t.prototype._log=function(t,e){switch(e){case 1:console.warn("\u3010\u4e3b\u7a0b\u5e8f\u3011"+t);break;case 2:console.error("\u3010\u4e3b\u7a0b\u5e8f\u3011"+t);break;default:console.warn("\u3010\u4e3b\u7a0b\u5e8f\u3011"+t)}},t.UN_RUN=0,t.BOOTING=1,t.BOOTEND=2,t.RUNING=3,t.STOP=4,t}();return t.App=n,Object.defineProperty(t,"__esModule",{value:!0}),t}({}),globalTarget=window||global;globalTarget.egfCore?Object.assign({},globalTarget.egfCore):globalTarget.egfCore=egfCore; diff --git a/packages/字体精简工具/node_modules/@ailhc/egf-core/dist/system/lib/index.js b/packages/字体精简工具/node_modules/@ailhc/egf-core/dist/system/lib/index.js new file mode 100644 index 0000000..9e95cd5 --- /dev/null +++ b/packages/字体精简工具/node_modules/@ailhc/egf-core/dist/system/lib/index.js @@ -0,0 +1,218 @@ +System.register('@ailhc/egf-core', [], function (exports) { + 'use strict'; + return { + execute: function () { + + /*! ***************************************************************************** + Copyright (c) Microsoft Corporation. All rights reserved. + Licensed under the Apache License, Version 2.0 (the "License"); you may not use + this file except in compliance with the License. You may obtain a copy of the + License at http://www.apache.org/licenses/LICENSE-2.0 + + THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED + WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE, + MERCHANTABLITY OR NON-INFRINGEMENT. + + See the Apache Version 2.0 License for specific language governing permissions + and limitations under the License. + ***************************************************************************** */ + + function __awaiter(thisArg, _arguments, P, generator) { + return new (P || (P = Promise))(function (resolve, reject) { + function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } + function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } + function step(result) { result.done ? resolve(result.value) : new P(function (resolve) { resolve(result.value); }).then(fulfilled, rejected); } + step((generator = generator.apply(thisArg, _arguments || [])).next()); + }); + } + + function __generator(thisArg, body) { + var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g; + return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g; + function verb(n) { return function (v) { return step([n, v]); }; } + function step(op) { + if (f) throw new TypeError("Generator is already executing."); + while (_) try { + if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t; + if (y = 0, t) op = [op[0] & 2, t.value]; + switch (op[0]) { + case 0: case 1: t = op; break; + case 4: _.label++; return { value: op[1], done: false }; + case 5: _.label++; y = op[1]; op = [0]; continue; + case 7: op = _.ops.pop(); _.trys.pop(); continue; + default: + if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; } + if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; } + if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; } + if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; } + if (t[2]) _.ops.pop(); + _.trys.pop(); continue; + } + op = body.call(thisArg, _); + } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; } + if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true }; + } + } + + var App = exports('App', (function () { + function App() { + this._state = 0; + this._moduleMap = {}; + } + Object.defineProperty(App.prototype, "state", { + get: function () { + return this._state; + }, + enumerable: false, + configurable: true + }); + Object.defineProperty(App.prototype, "moduleMap", { + get: function () { + return this._moduleMap; + }, + enumerable: false, + configurable: true + }); + App.prototype.bootstrap = function (bootLoaders) { + return __awaiter(this, void 0, void 0, function () { + var bootPromises, _loop_1, i, e_1; + var _this = this; + return __generator(this, function (_a) { + switch (_a.label) { + case 0: + this.setState(App.BOOTING); + if (!bootLoaders || bootLoaders.length <= 0) { + this.setState(App.BOOTEND); + return [2, true]; + } + if (!(bootLoaders && bootLoaders.length > 0)) return [3, 4]; + bootPromises = []; + _loop_1 = function (i) { + var bootLoader = bootLoaders[i]; + bootPromises.push(new Promise(function (res, rej) { + bootLoader.onBoot(_this, function (isOk) { + if (isOk) { + res(); + } + else { + rej(); + } + }); + })); + }; + for (i = 0; i < bootLoaders.length; i++) { + _loop_1(i); + } + _a.label = 1; + case 1: + _a.trys.push([1, 3, , 4]); + return [4, Promise.all(bootPromises)]; + case 2: + _a.sent(); + this.setState(App.BOOTEND); + return [2, true]; + case 3: + e_1 = _a.sent(); + console.error(e_1); + this.setState(App.BOOTEND); + return [2, false]; + case 4: return [2]; + } + }); + }); + }; + App.prototype.init = function () { + var moduleMap = this._moduleMap; + var moduleIns; + if (this.state === App.RUNING) + return; + for (var key in moduleMap) { + moduleIns = moduleMap[key]; + moduleIns.onInit && moduleIns.onInit(this); + } + for (var key in moduleMap) { + moduleIns = moduleMap[key]; + moduleIns.onAfterInit && moduleIns.onAfterInit(this); + } + this.setState(App.RUNING); + }; + App.prototype.loadModule = function (moduleIns, key) { + if (this._state === App.STOP) + return false; + var res = false; + if (!key) { + key = moduleIns.key; + } + if (key && typeof key === "string") { + if (moduleIns) { + if (!this._moduleMap[key]) { + this._moduleMap[key] = moduleIns; + res = true; + if (this._state === App.RUNING) { + moduleIns.onInit && moduleIns.onInit(this); + moduleIns.onAfterInit && moduleIns.onAfterInit(); + } + } + else { + this._log("\u52A0\u8F7D\u6A21\u5757:\u6A21\u5757:" + key + "\u5DF2\u7ECF\u5B58\u5728,\u4E0D\u91CD\u590D\u52A0\u8F7D"); + } + } + else { + this._log("\u52A0\u8F7D\u6A21\u5757:\u6A21\u5757:" + key + "\u5B9E\u4F8B\u4E3A\u7A7A"); + } + } + else { + this._log("\u52A0\u8F7D\u6A21\u5757:\u6A21\u5757key\u4E3A\u7A7A"); + } + return res; + }; + App.prototype.hasModule = function (moduleKey) { + return !!this._moduleMap[moduleKey]; + }; + App.prototype.stop = function () { + var moduleMap = this._moduleMap; + var moduleIns; + this.setState(App.STOP); + for (var key in moduleMap) { + moduleIns = moduleMap[key]; + moduleIns.onStop && moduleIns.onStop(); + } + }; + App.prototype.getModule = function (moduleKey) { + return this._moduleMap[moduleKey]; + }; + App.prototype.setState = function (state) { + if (!isNaN(this._state)) { + if (this._state >= state) + return; + } + this._state = state; + }; + App.prototype._log = function (msg, level) { + switch (level) { + case 1: + console.warn("\u3010\u4E3B\u7A0B\u5E8F\u3011" + msg); + break; + case 2: + console.error("\u3010\u4E3B\u7A0B\u5E8F\u3011" + msg); + break; + default: + console.warn("\u3010\u4E3B\u7A0B\u5E8F\u3011" + msg); + break; + } + }; + App.UN_RUN = 0; + App.BOOTING = 1; + App.BOOTEND = 2; + App.RUNING = 3; + App.STOP = 4; + return App; + }())); + + } + }; +}); + + +//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaW5kZXguanMiLCJzb3VyY2VzIjpbIkBhaWxoYy9lZ2YtY29yZS9zcmMvZWdmLWFwcC50cyJdLCJzb3VyY2VzQ29udGVudCI6WyJleHBvcnQgY2xhc3MgQXBwPE1vZHVsZU1hcCA9IGFueT4gaW1wbGVtZW50cyBlZ2YuSUFwcDxNb2R1bGVNYXA+IHtcbiAgICBwdWJsaWMgc3RhdGljIHJlYWRvbmx5IFVOX1JVTjogbnVtYmVyID0gMDtcbiAgICBwdWJsaWMgc3RhdGljIHJlYWRvbmx5IEJPT1RJTkc6IG51bWJlciA9IDE7XG4gICAgcHVibGljIHN0YXRpYyByZWFkb25seSBCT09URU5EOiBudW1iZXIgPSAyO1xuICAgIHB1YmxpYyBzdGF0aWMgcmVhZG9ubHkgUlVOSU5HOiBudW1iZXIgPSAzO1xuICAgIHB1YmxpYyBzdGF0aWMgcmVhZG9ubHkgU1RPUDogbnVtYmVyID0gNDtcbiAgICBwcm90ZWN0ZWQgX3N0YXRlOiBudW1iZXIgPSAwO1xuICAgIHByb3RlY3RlZCBfbW9kdWxlTWFwOiB7IFtrZXk6IHN0cmluZ106IGVnZi5JTW9kdWxlIH0gPSB7fTtcbiAgICBwdWJsaWMgZ2V0IHN0YXRlKCk6IG51bWJlciB7XG4gICAgICAgIHJldHVybiB0aGlzLl9zdGF0ZTtcbiAgICB9XG4gICAgcHVibGljIGdldCBtb2R1bGVNYXAoKTogTW9kdWxlTWFwIHtcbiAgICAgICAgcmV0dXJuIHRoaXMuX21vZHVsZU1hcCBhcyBhbnk7XG4gICAgfVxuICAgIHB1YmxpYyBhc3luYyBib290c3RyYXAoYm9vdExvYWRlcnM/OiBlZ2YuSUJvb3RMb2FkZXJbXSk6IFByb21pc2U8Ym9vbGVhbj4ge1xuICAgICAgICB0aGlzLnNldFN0YXRlKEFwcC5CT09USU5HKTtcbiAgICAgICAgaWYgKCFib290TG9hZGVycyB8fCBib290TG9hZGVycy5sZW5ndGggPD0gMCkge1xuICAgICAgICAgICAgdGhpcy5zZXRTdGF0ZShBcHAuQk9PVEVORCk7XG4gICAgICAgICAgICByZXR1cm4gdHJ1ZTtcbiAgICAgICAgfVxuICAgICAgICBpZiAoYm9vdExvYWRlcnMgJiYgYm9vdExvYWRlcnMubGVuZ3RoID4gMCkge1xuICAgICAgICAgICAgY29uc3QgYm9vdFByb21pc2VzOiBQcm9taXNlPHZvaWQ+W10gPSBbXTtcbiAgICAgICAgICAgIGZvciAobGV0IGkgPSAwOyBpIDwgYm9vdExvYWRlcnMubGVuZ3RoOyBpKyspIHtcbiAgICAgICAgICAgICAgICBjb25zdCBib290TG9hZGVyOiBlZ2YuSUJvb3RMb2FkZXIgPSBib290TG9hZGVyc1tpXTtcbiAgICAgICAgICAgICAgICBib290UHJvbWlzZXMucHVzaChcbiAgICAgICAgICAgICAgICAgICAgbmV3IFByb21pc2UoKHJlcywgcmVqKSA9PiB7XG4gICAgICAgICAgICAgICAgICAgICAgICBib290TG9hZGVyLm9uQm9vdCh0aGlzIGFzIGFueSwgKGlzT2spID0+IHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoaXNPaykge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXMoKTtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICByZWooKTtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgICAgICB9KTtcbiAgICAgICAgICAgICAgICAgICAgfSlcbiAgICAgICAgICAgICAgICApO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgdHJ5IHtcbiAgICAgICAgICAgICAgICBhd2FpdCBQcm9taXNlLmFsbChib290UHJvbWlzZXMpO1xuICAgICAgICAgICAgICAgIHRoaXMuc2V0U3RhdGUoQXBwLkJPT1RFTkQpO1xuICAgICAgICAgICAgICAgIHJldHVybiB0cnVlO1xuICAgICAgICAgICAgfSBjYXRjaCAoZSkge1xuICAgICAgICAgICAgICAgIGNvbnNvbGUuZXJyb3IoZSk7XG4gICAgICAgICAgICAgICAgdGhpcy5zZXRTdGF0ZShBcHAuQk9PVEVORCk7XG4gICAgICAgICAgICAgICAgcmV0dXJuIGZhbHNlO1xuICAgICAgICAgICAgfVxuICAgICAgICB9XG4gICAgfVxuXG4gICAgcHVibGljIGluaXQoKTogdm9pZCB7XG4gICAgICAgIGNvbnN0IG1vZHVsZU1hcCA9IHRoaXMuX21vZHVsZU1hcDtcbiAgICAgICAgbGV0IG1vZHVsZUluczogZWdmLklNb2R1bGU7XG4gICAgICAgIGlmICh0aGlzLnN0YXRlID09PSBBcHAuUlVOSU5HKSByZXR1cm47XG4gICAgICAgIGZvciAoY29uc3Qga2V5IGluIG1vZHVsZU1hcCkge1xuICAgICAgICAgICAgbW9kdWxlSW5zID0gbW9kdWxlTWFwW2tleV07XG4gICAgICAgICAgICBtb2R1bGVJbnMub25Jbml0ICYmIG1vZHVsZUlucy5vbkluaXQodGhpcyBhcyBhbnkpO1xuICAgICAgICB9XG4gICAgICAgIGZvciAoY29uc3Qga2V5IGluIG1vZHVsZU1hcCkge1xuICAgICAgICAgICAgbW9kdWxlSW5zID0gbW9kdWxlTWFwW2tleV07XG4gICAgICAgICAgICBtb2R1bGVJbnMub25BZnRlckluaXQgJiYgbW9kdWxlSW5zLm9uQWZ0ZXJJbml0KHRoaXMgYXMgYW55KTtcbiAgICAgICAgfVxuICAgICAgICB0aGlzLnNldFN0YXRlKEFwcC5SVU5JTkcpO1xuICAgIH1cbiAgICBwdWJsaWMgbG9hZE1vZHVsZShtb2R1bGVJbnM6IGFueSB8IGVnZi5JTW9kdWxlLCBrZXk/OiBrZXlvZiBNb2R1bGVNYXApOiBib29sZWFuIHtcbiAgICAgICAgaWYgKHRoaXMuX3N0YXRlID09PSBBcHAuU1RPUCkgcmV0dXJuIGZhbHNlO1xuICAgICAgICBsZXQgcmVzOiBib29sZWFuID0gZmFsc2U7XG4gICAgICAgIGlmICgha2V5KSB7XG4gICAgICAgICAgICBrZXkgPSBtb2R1bGVJbnMua2V5IGFzIG5ldmVyO1xuICAgICAgICB9XG4gICAgICAgIGlmIChrZXkgJiYgdHlwZW9mIGtleSA9PT0gXCJzdHJpbmdcIikge1xuICAgICAgICAgICAgaWYgKG1vZHVsZUlucykge1xuICAgICAgICAgICAgICAgIGlmICghdGhpcy5fbW9kdWxlTWFwW2tleV0pIHtcbiAgICAgICAgICAgICAgICAgICAgdGhpcy5fbW9kdWxlTWFwW2tleV0gPSBtb2R1bGVJbnM7XG4gICAgICAgICAgICAgICAgICAgIHJlcyA9IHRydWU7XG4gICAgICAgICAgICAgICAgICAgIGlmICh0aGlzLl9zdGF0ZSA9PT0gQXBwLlJVTklORykge1xuICAgICAgICAgICAgICAgICAgICAgICAgbW9kdWxlSW5zLm9uSW5pdCAmJiBtb2R1bGVJbnMub25Jbml0KHRoaXMpO1xuICAgICAgICAgICAgICAgICAgICAgICAgbW9kdWxlSW5zLm9uQWZ0ZXJJbml0ICYmIG1vZHVsZUlucy5vbkFmdGVySW5pdCgpO1xuICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgICAgICAgICAgdGhpcy5fbG9nKGDliqDovb3mqKHlnZc65qih5Z2XOiR7a2V5feW3sue7j+WtmOWcqCzkuI3ph43lpI3liqDovb1gKTtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICAgIHRoaXMuX2xvZyhg5Yqg6L295qih5Z2XOuaooeWdlzoke2tleX3lrp7kvovkuLrnqbpgKTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgfSBlbHNlIHtc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0FBQyxDQUFDOzRCQUM1QixNQUFNO3FCQUNiO2lCQUNKO2dCQTlIc0IsVUFBTSxHQUFXLENBQUMsQ0FBQztnQkFDbkIsV0FBTyxHQUFXLENBQUMsQ0FBQztnQkFDcEIsV0FBTyxHQUFXLENBQUMsQ0FBQztnQkFDcEIsVUFBTSxHQUFXLENBQUMsQ0FBQztnQkFDbkIsUUFBSSxHQUFXLENBQUMsQ0FBQztnQkEySDVDLFVBQUM7YUFoSUQ7Ozs7Ozs7Ozs7In0= diff --git a/packages/字体精简工具/node_modules/@ailhc/egf-core/dist/system/lib/index.min.js b/packages/字体精简工具/node_modules/@ailhc/egf-core/dist/system/lib/index.min.js new file mode 100644 index 0000000..f4f2f5a --- /dev/null +++ b/packages/字体精简工具/node_modules/@ailhc/egf-core/dist/system/lib/index.min.js @@ -0,0 +1,16 @@ +System.register("@ailhc/egf-core",[],(function(t){"use strict";return{execute:function(){function e(t,e){var n,o,r,i,s={label:0,sent:function(){if(1&r[0])throw r[1];return r[1]},trys:[],ops:[]};return i={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function a(i){return function(a){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;s;)try{if(n=1,o&&(r=2&i[0]?o.return:i[0]?o.throw||((r=o.return)&&r.call(o),0):o.next)&&!(r=r.call(o,i[1])).done)return r;switch(o=0,r&&(i=[2&i[0],r.value]),i[0]){case 0:case 1:r=i;break;case 4:return s.label++,{value:i[1],done:!1};case 5:s.label++,o=i[1],i=[0];continue;case 7:i=s.ops.pop(),s.trys.pop();continue;default:if(!(r=s.trys,(r=r.length>0&&r[r.length-1])||6!==i[0]&&2!==i[0])){s=0;continue}if(3===i[0]&&(!r||i[1]>r[0]&&i[1]0))return[3,4];for(o=[],r=function(t){var e=n[t];o.push(new Promise((function(t,n){e.onBoot(a,(function(e){e?t():n()}))})))},i=0;i=t||(this._state=t)},t.prototype._log=function(t,e){switch(e){case 1:console.warn("\u3010\u4e3b\u7a0b\u5e8f\u3011"+t);break;case 2:console.error("\u3010\u4e3b\u7a0b\u5e8f\u3011"+t);break;default:console.warn("\u3010\u4e3b\u7a0b\u5e8f\u3011"+t)}},t.UN_RUN=0,t.BOOTING=1,t.BOOTEND=2,t.RUNING=3,t.STOP=4,t}())}}})); diff --git a/packages/字体精简工具/node_modules/@ailhc/egf-core/dist/system/types/index.d.ts b/packages/字体精简工具/node_modules/@ailhc/egf-core/dist/system/types/index.d.ts new file mode 100644 index 0000000..821b951 --- /dev/null +++ b/packages/字体精简工具/node_modules/@ailhc/egf-core/dist/system/types/index.d.ts @@ -0,0 +1,111 @@ +declare module '@ailhc/egf-core' { + export class App implements egf.IApp { + static readonly UN_RUN: number; + static readonly BOOTING: number; + static readonly BOOTEND: number; + static readonly RUNING: number; + static readonly STOP: number; + protected _state: number; + protected _moduleMap: { + [key: string]: egf.IModule; + }; + get state(): number; + get moduleMap(): ModuleMap; + bootstrap(bootLoaders?: egf.IBootLoader[]): Promise; + init(): void; + loadModule(moduleIns: any | egf.IModule, key?: keyof ModuleMap): boolean; + hasModule(moduleKey: keyof ModuleMap): boolean; + stop(): void; + getModule(moduleKey: K): ModuleMap[K]; + protected setState(state: number): void; + /** + * 输出 + * @param level 1 warn 2 error + * @param msg + */ + protected _log(msg: string, level?: number): void; + } + +} +declare module '@ailhc/egf-core' { + global { + namespace egf { + interface IModule { + /**模块名 */ + key?: string; + /** + * 当初始化时 + */ + onInit?(app: IApp): void; + /** + * 所有模块初始化完成时 + */ + onAfterInit?(app: IApp): void; + /** + * 模块停止时 + */ + onStop?(): void; + } + type BootEndCallback = (isSuccess: boolean) => void; + /** + * 引导程序 + */ + interface IBootLoader { + /** + * 引导 + * @param app + */ + onBoot(app: IApp, bootEnd: BootEndCallback): void; + } + /** + * 主程序 + */ + interface IApp { + /** + * 程序状态 + * 0 未启动 1 引导中, 2 初始化, 3 运行中 + */ + state: number; + /** + * 模块字典 + */ + moduleMap: ModuleMap; + /** + * 引导 + * @param bootLoaders + */ + bootstrap(bootLoaders: egf.IBootLoader[]): Promise; + /** + * 初始化 + */ + init(): void; + /** + * 加载模块 + * @param module + */ + loadModule(module: IModule | any, key?: keyof ModuleMap): void; + /** + * 停止 + */ + stop(): void; + /** + * 获取模块实例 + * @param moduleKey + */ + getModule(moduleKey: K): ModuleMap[K]; + /** + * 判断有没有这个模块 + * @param moduleKey + */ + hasModule(moduleKey: keyof ModuleMap): boolean; + } + } + } + export {}; + +} +declare module '@ailhc/egf-core' { + export * from '@ailhc/egf-core'; + export * from '@ailhc/egf-core'; + +} diff --git a/packages/字体精简工具/node_modules/@ailhc/egf-core/dist/umd/egfCore.d.ts b/packages/字体精简工具/node_modules/@ailhc/egf-core/dist/umd/egfCore.d.ts new file mode 100644 index 0000000..2436145 --- /dev/null +++ b/packages/字体精简工具/node_modules/@ailhc/egf-core/dist/umd/egfCore.d.ts @@ -0,0 +1,116 @@ +declare module 'egfCore' { + class App implements egf.IApp { + static readonly UN_RUN: number; + static readonly BOOTING: number; + static readonly BOOTEND: number; + static readonly RUNING: number; + static readonly STOP: number; + protected _state: number; + protected _moduleMap: { + [key: string]: egf.IModule; + }; + get state(): number; + get moduleMap(): ModuleMap; + bootstrap(bootLoaders?: egf.IBootLoader[]): Promise; + init(): void; + loadModule(moduleIns: any | egf.IModule, key?: keyof ModuleMap): boolean; + hasModule(moduleKey: keyof ModuleMap): boolean; + stop(): void; + getModule(moduleKey: K): ModuleMap[K]; + protected setState(state: number): void; + /** + * 输出 + * @param level 1 warn 2 error + * @param msg + */ + protected _log(msg: string, level?: number): void; + } + +} +declare module 'egfCore' { + global { + namespace egf { + interface IModule { + /**模块名 */ + key?: string; + /** + * 当初始化时 + */ + onInit?(app: IApp): void; + /** + * 所有模块初始化完成时 + */ + onAfterInit?(app: IApp): void; + /** + * 模块停止时 + */ + onStop?(): void; + } + type BootEndCallback = (isSuccess: boolean) => void; + /** + * 引导程序 + */ + interface IBootLoader { + /** + * 引导 + * @param app + */ + onBoot(app: IApp, bootEnd: BootEndCallback): void; + } + /** + * 主程序 + */ + interface IApp { + /** + * 程序状态 + * 0 未启动 1 引导中, 2 初始化, 3 运行中 + */ + state: number; + /** + * 模块字典 + */ + moduleMap: ModuleMap; + /** + * 引导 + * @param bootLoaders + */ + bootstrap(bootLoaders: egf.IBootLoader[]): Promise; + /** + * 初始化 + */ + init(): void; + /** + * 加载模块 + * @param module + */ + loadModule(module: IModule | any, key?: keyof ModuleMap): void; + /** + * 停止 + */ + stop(): void; + /** + * 获取模块实例 + * @param moduleKey + */ + getModule(moduleKey: K): ModuleMap[K]; + /** + * 判断有没有这个模块 + * @param moduleKey + */ + hasModule(moduleKey: keyof ModuleMap): boolean; + } + } + } + + +} +declare module 'egfCore' { + + + +} + +declare namespace egfCore { + type App = import('egfCore').App; +} +declare const egfCore:typeof import("egfCore"); \ No newline at end of file diff --git a/packages/字体精简工具/node_modules/@ailhc/egf-core/dist/umd/egfCore.js b/packages/字体精简工具/node_modules/@ailhc/egf-core/dist/umd/egfCore.js new file mode 100644 index 0000000..2ad8d5b --- /dev/null +++ b/packages/字体精简工具/node_modules/@ailhc/egf-core/dist/umd/egfCore.js @@ -0,0 +1,222 @@ +(function (global, factory) { + typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports) : + typeof define === 'function' && define.amd ? define(['exports'], factory) : + (global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory(global.egfCore = {})); +}(this, (function (exports) { 'use strict'; + + /*! ***************************************************************************** + Copyright (c) Microsoft Corporation. All rights reserved. + Licensed under the Apache License, Version 2.0 (the "License"); you may not use + this file except in compliance with the License. You may obtain a copy of the + License at http://www.apache.org/licenses/LICENSE-2.0 + + THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED + WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE, + MERCHANTABLITY OR NON-INFRINGEMENT. + + See the Apache Version 2.0 License for specific language governing permissions + and limitations under the License. + ***************************************************************************** */ + + function __awaiter(thisArg, _arguments, P, generator) { + return new (P || (P = Promise))(function (resolve, reject) { + function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } + function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } + function step(result) { result.done ? resolve(result.value) : new P(function (resolve) { resolve(result.value); }).then(fulfilled, rejected); } + step((generator = generator.apply(thisArg, _arguments || [])).next()); + }); + } + + function __generator(thisArg, body) { + var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g; + return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g; + function verb(n) { return function (v) { return step([n, v]); }; } + function step(op) { + if (f) throw new TypeError("Generator is already executing."); + while (_) try { + if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t; + if (y = 0, t) op = [op[0] & 2, t.value]; + switch (op[0]) { + case 0: case 1: t = op; break; + case 4: _.label++; return { value: op[1], done: false }; + case 5: _.label++; y = op[1]; op = [0]; continue; + case 7: op = _.ops.pop(); _.trys.pop(); continue; + default: + if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; } + if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; } + if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; } + if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; } + if (t[2]) _.ops.pop(); + _.trys.pop(); continue; + } + op = body.call(thisArg, _); + } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; } + if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true }; + } + } + + var App = (function () { + function App() { + this._state = 0; + this._moduleMap = {}; + } + Object.defineProperty(App.prototype, "state", { + get: function () { + return this._state; + }, + enumerable: false, + configurable: true + }); + Object.defineProperty(App.prototype, "moduleMap", { + get: function () { + return this._moduleMap; + }, + enumerable: false, + configurable: true + }); + App.prototype.bootstrap = function (bootLoaders) { + return __awaiter(this, void 0, void 0, function () { + var bootPromises, _loop_1, i, e_1; + var _this = this; + return __generator(this, function (_a) { + switch (_a.label) { + case 0: + this.setState(App.BOOTING); + if (!bootLoaders || bootLoaders.length <= 0) { + this.setState(App.BOOTEND); + return [2, true]; + } + if (!(bootLoaders && bootLoaders.length > 0)) return [3, 4]; + bootPromises = []; + _loop_1 = function (i) { + var bootLoader = bootLoaders[i]; + bootPromises.push(new Promise(function (res, rej) { + bootLoader.onBoot(_this, function (isOk) { + if (isOk) { + res(); + } + else { + rej(); + } + }); + })); + }; + for (i = 0; i < bootLoaders.length; i++) { + _loop_1(i); + } + _a.label = 1; + case 1: + _a.trys.push([1, 3, , 4]); + return [4, Promise.all(bootPromises)]; + case 2: + _a.sent(); + this.setState(App.BOOTEND); + return [2, true]; + case 3: + e_1 = _a.sent(); + console.error(e_1); + this.setState(App.BOOTEND); + return [2, false]; + case 4: return [2]; + } + }); + }); + }; + App.prototype.init = function () { + var moduleMap = this._moduleMap; + var moduleIns; + if (this.state === App.RUNING) + return; + for (var key in moduleMap) { + moduleIns = moduleMap[key]; + moduleIns.onInit && moduleIns.onInit(this); + } + for (var key in moduleMap) { + moduleIns = moduleMap[key]; + moduleIns.onAfterInit && moduleIns.onAfterInit(this); + } + this.setState(App.RUNING); + }; + App.prototype.loadModule = function (moduleIns, key) { + if (this._state === App.STOP) + return false; + var res = false; + if (!key) { + key = moduleIns.key; + } + if (key && typeof key === "string") { + if (moduleIns) { + if (!this._moduleMap[key]) { + this._moduleMap[key] = moduleIns; + res = true; + if (this._state === App.RUNING) { + moduleIns.onInit && moduleIns.onInit(this); + moduleIns.onAfterInit && moduleIns.onAfterInit(); + } + } + else { + this._log("\u52A0\u8F7D\u6A21\u5757:\u6A21\u5757:" + key + "\u5DF2\u7ECF\u5B58\u5728,\u4E0D\u91CD\u590D\u52A0\u8F7D"); + } + } + else { + this._log("\u52A0\u8F7D\u6A21\u5757:\u6A21\u5757:" + key + "\u5B9E\u4F8B\u4E3A\u7A7A"); + } + } + else { + this._log("\u52A0\u8F7D\u6A21\u5757:\u6A21\u5757key\u4E3A\u7A7A"); + } + return res; + }; + App.prototype.hasModule = function (moduleKey) { + return !!this._moduleMap[moduleKey]; + }; + App.prototype.stop = function () { + var moduleMap = this._moduleMap; + var moduleIns; + this.setState(App.STOP); + for (var key in moduleMap) { + moduleIns = moduleMap[key]; + moduleIns.onStop && moduleIns.onStop(); + } + }; + App.prototype.getModule = function (moduleKey) { + return this._moduleMap[moduleKey]; + }; + App.prototype.setState = function (state) { + if (!isNaN(this._state)) { + if (this._state >= state) + return; + } + this._state = state; + }; + App.prototype._log = function (msg, level) { + switch (level) { + case 1: + console.warn("\u3010\u4E3B\u7A0B\u5E8F\u3011" + msg); + break; + case 2: + console.error("\u3010\u4E3B\u7A0B\u5E8F\u3011" + msg); + break; + default: + console.warn("\u3010\u4E3B\u7A0B\u5E8F\u3011" + msg); + break; + } + }; + App.UN_RUN = 0; + App.BOOTING = 1; + App.BOOTEND = 2; + App.RUNING = 3; + App.STOP = 4; + return App; + }()); + + exports.App = App; + + Object.defineProperty(exports, '__esModule', { value: true }); + +}))); + + var globalTarget =window?window:global; + globalTarget.egfCore?Object.assign({},globalTarget.egfCore):(globalTarget.egfCore = egfCore) +//# sourceMappingURL=egfCore.js.map diff --git a/packages/字体精简工具/node_modules/@ailhc/egf-core/dist/umd/egfCore.js.map b/packages/字体精简工具/node_modules/@ailhc/egf-core/dist/umd/egfCore.js.map new file mode 100644 index 0000000..67dd0ab --- /dev/null +++ b/packages/字体精简工具/node_modules/@ailhc/egf-core/dist/umd/egfCore.js.map @@ -0,0 +1 @@ +{"version":3,"file":"egfCore.js","sources":["@ailhc/egf-core/src/egf-app.ts"],"sourcesContent":["export class App implements egf.IApp {\n public static readonly UN_RUN: number = 0;\n public static readonly BOOTING: number = 1;\n public static readonly BOOTEND: number = 2;\n public static readonly RUNING: number = 3;\n public static readonly STOP: number = 4;\n protected _state: number = 0;\n protected _moduleMap: { [key: string]: egf.IModule } = {};\n public get state(): number {\n return this._state;\n }\n public get moduleMap(): ModuleMap {\n return this._moduleMap as any;\n }\n public async bootstrap(bootLoaders?: egf.IBootLoader[]): Promise {\n this.setState(App.BOOTING);\n if (!bootLoaders || bootLoaders.length <= 0) {\n this.setState(App.BOOTEND);\n return true;\n }\n if (bootLoaders && bootLoaders.length > 0) {\n const bootPromises: Promise[] = [];\n for (let i = 0; i < bootLoaders.length; i++) {\n const bootLoader: egf.IBootLoader = bootLoaders[i];\n bootPromises.push(\n new Promise((res, rej) => {\n bootLoader.onBoot(this as any, (isOk) => {\n if (isOk) {\n res();\n } else {\n rej();\n }\n });\n })\n );\n }\n try {\n await Promise.all(bootPromises);\n this.setState(App.BOOTEND);\n return true;\n } catch (e) {\n console.error(e);\n this.setState(App.BOOTEND);\n return false;\n }\n }\n }\n\n public init(): void {\n const moduleMap = this._moduleMap;\n let moduleIns: egf.IModule;\n if (this.state === App.RUNING) return;\n for (const key in moduleMap) {\n moduleIns = moduleMap[key];\n moduleIns.onInit && moduleIns.onInit(this as any);\n }\n for (const key in moduleMap) {\n moduleIns = moduleMap[key];\n moduleIns.onAfterInit && moduleIns.onAfterInit(this as any);\n }\n this.setState(App.RUNING);\n }\n public loadModule(moduleIns: any | egf.IModule, key?: keyof ModuleMap): boolean {\n if (this._state === App.STOP) return false;\n let res: boolean = false;\n if (!key) {\n key = moduleIns.key as never;\n }\n if (key && typeof key === \"string\") {\n if (moduleIns) {\n if (!this._moduleMap[key]) {\n this._moduleMap[key] = moduleIns;\n res = true;\n if (this._state === App.RUNING) {\n moduleIns.onInit && moduleIns.onInit(this);\n moduleIns.onAfterInit && moduleIns.onAfterInit();\n }\n } else {\n this._log(`加载模块:模块:${key}已经存在,不重复加载`);\n }\n } else {\n this._log(`加载模块:模块:${key}实例为空`);\n }\n } else {\n this._log(`加载模块:模块key为空`);\n }\n return res;\n }\n public hasModule(moduleKey: keyof ModuleMap): boolean {\n return !!this._moduleMap[moduleKey as any];\n }\n public stop(): void {\n const moduleMap = this._moduleMap;\n let moduleIns: egf.IModule;\n this.setState(App.STOP);\n for (const key in moduleMap) {\n moduleIns = moduleMap[key];\n moduleIns.onStop && moduleIns.onStop();\n }\n }\n public getModule(moduleKey: K): ModuleMap[K] {\n return this._moduleMap[moduleKey as any] as any;\n }\n\n protected setState(state: number) {\n if (!isNaN(this._state)) {\n if (this._state >= state) return;\n }\n this._state = state;\n }\n /**\n * 输出\n * @param level 1 warn 2 error\n * @param msg\n */\n protected _log(msg: string, level?: number): void {\n switch (level) {\n case 1:\n console.warn(`【主程序】${msg}`);\n break;\n case 2:\n console.error(`【主程序】${msg}`);\n break;\n default:\n console.warn(`【主程序】${msg}`);\n break;\n }\n }\n}\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;QAAA;YAMc,WAAM,GAAW,CAAC,CAAC;YACnB,eAAU,GAAmC,EAAE,CAAC;SAyH7D;QAxHG,sBAAW,sBAAK;iBAAhB;gBACI,OAAO,IAAI,CAAC,MAAM,CAAC;aACtB;;;WAAA;QACD,sBAAW,0BAAS;iBAApB;gBACI,OAAO,IAAI,CAAC,UAAiB,CAAC;aACjC;;;WAAA;QACY,uBAAS,GAAtB,UAAuB,WAA+B;;;;;;;4BAClD,IAAI,CAAC,QAAQ,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC;4BAC3B,IAAI,CAAC,WAAW,IAAI,WAAW,CAAC,MAAM,IAAI,CAAC,EAAE;gCACzC,IAAI,CAAC,QAAQ,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC;gCAC3B,WAAO,IAAI,EAA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fCore.min.js b/packages/字体精简工具/node_modules/@ailhc/egf-core/dist/umd/egfCore.min.js new file mode 100644 index 0000000..2f246d0 --- /dev/null +++ b/packages/字体精简工具/node_modules/@ailhc/egf-core/dist/umd/egfCore.min.js @@ -0,0 +1,15 @@ +!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports):"function"==typeof define&&define.amd?define(["exports"],e):e((t="undefined"!=typeof globalThis?globalThis:t||self).egfCore={})}(this,(function(t){"use strict"; +/*! ***************************************************************************** + Copyright (c) Microsoft Corporation. All rights reserved. + Licensed under the Apache License, Version 2.0 (the "License"); you may not use + this file except in compliance with the License. You may obtain a copy of the + License at http://www.apache.org/licenses/LICENSE-2.0 + + THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED + WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE, + MERCHANTABLITY OR NON-INFRINGEMENT. + + See the Apache Version 2.0 License for specific language governing permissions + and limitations under the License. + ***************************************************************************** */function e(t,e){var n,o,r,i,a={label:0,sent:function(){if(1&r[0])throw r[1];return r[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(i){return function(s){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,o&&(r=2&i[0]?o.return:i[0]?o.throw||((r=o.return)&&r.call(o),0):o.next)&&!(r=r.call(o,i[1])).done)return r;switch(o=0,r&&(i=[2&i[0],r.value]),i[0]){case 0:case 1:r=i;break;case 4:return a.label++,{value:i[1],done:!1};case 5:a.label++,o=i[1],i=[0];continue;case 7:i=a.ops.pop(),a.trys.pop();continue;default:if(!(r=a.trys,(r=r.length>0&&r[r.length-1])||6!==i[0]&&2!==i[0])){a=0;continue}if(3===i[0]&&(!r||i[1]>r[0]&&i[1]0))return[3,4];for(o=[],r=function(t){var e=n[t];o.push(new Promise((function(t,n){e.onBoot(s,(function(e){e?t():n()}))})))},i=0;i=t||(this._state=t)},t.prototype._log=function(t,e){switch(e){case 1:console.warn("\u3010\u4e3b\u7a0b\u5e8f\u3011"+t);break;case 2:console.error("\u3010\u4e3b\u7a0b\u5e8f\u3011"+t);break;default:console.warn("\u3010\u4e3b\u7a0b\u5e8f\u3011"+t)}},t.UN_RUN=0,t.BOOTING=1,t.BOOTEND=2,t.RUNING=3,t.STOP=4,t}();t.App=n,Object.defineProperty(t,"__esModule",{value:!0})}));var globalTarget=window||global;globalTarget.egfCore?Object.assign({},globalTarget.egfCore):globalTarget.egfCore=egfCore; diff --git a/packages/字体精简工具/node_modules/@ailhc/egf-core/package.json b/packages/字体精简工具/node_modules/@ailhc/egf-core/package.json new file mode 100644 index 0000000..7e060eb --- /dev/null +++ b/packages/字体精简工具/node_modules/@ailhc/egf-core/package.json @@ -0,0 +1,75 @@ +{ + "_from": "@ailhc/egf-core@^1.2.0", + "_id": "@ailhc/egf-core@1.2.4", + "_inBundle": false, + "_integrity": "sha1-7s7WrU086rB93VvcDbu01+ilhQk=", + "_location": "/@ailhc/egf-core", + "_phantomChildren": {}, + "_requested": { + "type": "range", + "registry": true, + "raw": "@ailhc/egf-core@^1.2.0", + "name": "@ailhc/egf-core", + "escapedName": "@ailhc%2fegf-core", + "scope": "@ailhc", + "rawSpec": "^1.2.0", + "saveSpec": null, + "fetchSpec": "^1.2.0" + }, + "_requiredBy": [ + "/" + ], + "_resolved": "https://registry.nlark.com/@ailhc/egf-core/download/@ailhc/egf-core-1.2.4.tgz", + "_shasum": "eeced6ad4d3ceab07ddd5bdc0dbbb4d7e8a58509", + "_spec": "@ailhc/egf-core@^1.2.0", + "_where": "D:\\workspace\\plugin\\mini_font\\packages\\mini_font\\publish\\mini_font", + "author": { + "name": "AILHC", + "email": "505126057@qq.com" + }, + "bugs": { + "url": "https://github.com/AILHC/EasyGameFrameworkOpen/issues" + }, + "bundleDependencies": false, + "deprecated": false, + "description": "This is the core of EasyGameFramework, which provides the ability to register modules, get module instances, and load subroutine scripts", + "exports": { + "require": "./dist/cjs/lib/index.js", + "import": "./dist/es/lib/index.mjs" + }, + "files": [ + "dist" + ], + "homepage": "https://github.com/AILHC/EasyGameFrameworkOpen/tree/main/packages/core#readme", + "keywords": [ + "module", + "framework", + "game", + "manager" + ], + "license": "MIT", + "main": "dist/cjs/lib/index.js", + "module": "dist/es/lib/index.mjs", + "name": "@ailhc/egf-core", + "publishConfig": { + "registry": "https://registry.npmjs.org", + "access": "public" + }, + "repository": { + "type": "git", + "url": "git+https://github.com/AILHC/EasyGameFrameworkOpen.git" + }, + "scripts": { + "build:all": "npm run clean-dist && npm run build:cjs&&npm run build:es&&npm run build:umd&&npm run build:iife&&npm run build:system", + "build:cjs": "egf build -f cjs -m true -s inline", + "build:es": "egf build -f es -m true -s inline", + "build:iife": "egf build -f iife -m true", + "build:system": "egf build -f system -m true -s inline", + "build:umd": "egf build -f umd -m true", + "clean-dist": "rimraf dist", + "test": "cross-var lerna exec --scope $npm_package_name --concurrency 1 -- jest --config=../../jest.config.js --roots $PWD", + "watch:cjs": "egf build -w true -f cjs -s inline" + }, + "typings": "dist/cjs/types", + "version": "1.2.4" +} diff --git a/packages/字体精简工具/node_modules/abbrev/LICENSE b/packages/字体精简工具/node_modules/abbrev/LICENSE new file mode 100644 index 0000000..9bcfa9d --- /dev/null +++ b/packages/字体精简工具/node_modules/abbrev/LICENSE @@ -0,0 +1,46 @@ +This software is dual-licensed under the ISC and MIT licenses. +You may use this software under EITHER of the following licenses. + +---------- + +The ISC License + +Copyright (c) Isaac Z. Schlueter and Contributors + +Permission to use, copy, modify, and/or distribute this software for any +purpose with or without fee is hereby granted, provided that the above +copyright notice and this permission notice appear in all copies. + +THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES +WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF +MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR +ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES +WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN +ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR +IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + +---------- + +Copyright Isaac Z. Schlueter and Contributors +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/packages/字体精简工具/node_modules/abbrev/README.md b/packages/字体精简工具/node_modules/abbrev/README.md new file mode 100644 index 0000000..99746fe --- /dev/null +++ b/packages/字体精简工具/node_modules/abbrev/README.md @@ -0,0 +1,23 @@ +# 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/packages/字体精简工具/node_modules/abbrev/abbrev.js b/packages/字体精简工具/node_modules/abbrev/abbrev.js new file mode 100644 index 0000000..7b1dc5d --- /dev/null +++ b/packages/字体精简工具/node_modules/abbrev/abbrev.js @@ -0,0 +1,61 @@ +module.exports = exports = abbrev.abbrev = abbrev + +abbrev.monkeyPatch = monkeyPatch + +function monkeyPatch () { + Object.defineProperty(Array.prototype, 'abbrev', { + value: function () { return abbrev(this) }, + enumerable: false, configurable: true, writable: true + }) + + Object.defineProperty(Object.prototype, 'abbrev', { + value: function () { return abbrev(Object.keys(this)) }, + enumerable: false, configurable: true, writable: true + }) +} + +function abbrev (list) { + if (arguments.length !== 1 || !Array.isArray(list)) { + list = Array.prototype.slice.call(arguments, 0) + } + for (var i = 0, l = list.length, args = [] ; i < l ; i ++) { + args[i] = typeof list[i] === "string" ? list[i] : String(list[i]) + } + + // sort them lexicographically, so that they're next to their nearest kin + args = args.sort(lexSort) + + // walk through each, seeing how much it has in common with the next and previous + var abbrevs = {} + , prev = "" + for (var i = 0, l = args.length ; i < l ; i ++) { + var current = args[i] + , next = args[i + 1] || "" + , nextMatches = true + , prevMatches = true + if (current === next) continue + for (var j = 0, cl = current.length ; j < cl ; j ++) { + var curChar = current.charAt(j) + nextMatches = nextMatches && curChar === next.charAt(j) + prevMatches = prevMatches && curChar === prev.charAt(j) + if (!nextMatches && !prevMatches) { + j ++ + break + } + } + prev = current + if (j === cl) { + abbrevs[current] = current + continue + } + for (var a = current.substr(0, j) ; j <= cl ; j ++) { + abbrevs[a] = current + a += current.charAt(j) + } + } + return abbrevs +} + +function lexSort (a, b) { + return a === b ? 0 : a > b ? 1 : -1 +} diff --git a/packages/字体精简工具/node_modules/abbrev/package.json b/packages/字体精简工具/node_modules/abbrev/package.json new file mode 100644 index 0000000..e9b851d --- /dev/null +++ b/packages/字体精简工具/node_modules/abbrev/package.json @@ -0,0 +1,56 @@ +{ + "_from": "abbrev@1", + "_id": "abbrev@1.1.1", + "_inBundle": false, + "_integrity": "sha1-+PLIh60Qv2f2NPAFtph/7TF5qsg=", + "_location": "/abbrev", + "_phantomChildren": {}, + "_requested": { + "type": "range", + "registry": true, + "raw": "abbrev@1", + "name": "abbrev", + "escapedName": "abbrev", + "rawSpec": "1", + "saveSpec": null, + "fetchSpec": "1" + }, + "_requiredBy": [ + "/nopt" + ], + "_resolved": "https://registry.nlark.com/abbrev/download/abbrev-1.1.1.tgz", + "_shasum": "f8f2c887ad10bf67f634f005b6987fed3179aac8", + "_spec": "abbrev@1", + "_where": "D:\\workspace\\plugin\\mini_font\\packages\\mini_font\\publish\\mini_font\\node_modules\\nopt", + "author": { + "name": "Isaac Z. Schlueter", + "email": "i@izs.me" + }, + "bugs": { + "url": "https://github.com/isaacs/abbrev-js/issues" + }, + "bundleDependencies": false, + "deprecated": false, + "description": "Like ruby's abbrev module, but in js", + "devDependencies": { + "tap": "^10.1" + }, + "files": [ + "abbrev.js" + ], + "homepage": "https://github.com/isaacs/abbrev-js#readme", + "license": "ISC", + "main": "abbrev.js", + "name": "abbrev", + "repository": { + "type": "git", + "url": "git+ssh://git@github.com/isaacs/abbrev-js.git" + }, + "scripts": { + "postpublish": "git push origin --all; git push origin --tags", + "postversion": "npm publish", + "preversion": "npm test", + "test": "tap test.js --100" + }, + "version": "1.1.1" +} diff --git a/packages/字体精简工具/node_modules/ajv/.tonic_example.js b/packages/字体精简工具/node_modules/ajv/.tonic_example.js new file mode 100644 index 0000000..aa11812 --- /dev/null +++ b/packages/字体精简工具/node_modules/ajv/.tonic_example.js @@ -0,0 +1,20 @@ +var Ajv = require('ajv'); +var ajv = new Ajv({allErrors: true}); + +var schema = { + "properties": { + "foo": { "type": "string" }, + "bar": { "type": "number", "maximum": 3 } + } +}; + +var validate = ajv.compile(schema); + +test({"foo": "abc", "bar": 2}); +test({"foo": 2, "bar": 4}); + +function test(data) { + var valid = validate(data); + if (valid) console.log('Valid!'); + else console.log('Invalid: ' + ajv.errorsText(validate.errors)); +} \ No newline at end of file diff --git a/packages/字体精简工具/node_modules/ajv/LICENSE b/packages/字体精简工具/node_modules/ajv/LICENSE new file mode 100644 index 0000000..96ee719 --- /dev/null +++ b/packages/字体精简工具/node_modules/ajv/LICENSE @@ -0,0 +1,22 @@ +The MIT License (MIT) + +Copyright (c) 2015-2017 Evgeny Poberezkin + +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/packages/字体精简工具/node_modules/ajv/README.md b/packages/字体精简工具/node_modules/ajv/README.md new file mode 100644 index 0000000..5aa2078 --- /dev/null +++ b/packages/字体精简工具/node_modules/ajv/README.md @@ -0,0 +1,1497 @@ +Ajv logo + +# Ajv: Another JSON Schema Validator + +The fastest JSON Schema validator for Node.js and browser. Supports draft-04/06/07. + +[![Build Status](https://travis-ci.org/ajv-validator/ajv.svg?branch=master)](https://travis-ci.org/ajv-validator/ajv) +[![npm](https://img.shields.io/npm/v/ajv.svg)](https://www.npmjs.com/package/ajv) +[![npm (beta)](https://img.shields.io/npm/v/ajv/beta)](https://www.npmjs.com/package/ajv/v/7.0.0-beta.0) +[![npm downloads](https://img.shields.io/npm/dm/ajv.svg)](https://www.npmjs.com/package/ajv) +[![Coverage Status](https://coveralls.io/repos/github/ajv-validator/ajv/badge.svg?branch=master)](https://coveralls.io/github/ajv-validator/ajv?branch=master) +[![Gitter](https://img.shields.io/gitter/room/ajv-validator/ajv.svg)](https://gitter.im/ajv-validator/ajv) +[![GitHub Sponsors](https://img.shields.io/badge/$-sponsors-brightgreen)](https://github.com/sponsors/epoberezkin) + + +## Ajv v7 beta is released + +[Ajv version 7.0.0-beta.0](https://github.com/ajv-validator/ajv/tree/v7-beta) is released with these changes: + +- to reduce the mistakes in JSON schemas and unexpected validation results, [strict mode](./docs/strict-mode.md) is added - it prohibits ignored or ambiguous JSON Schema elements. +- to make code injection from untrusted schemas impossible, [code generation](./docs/codegen.md) is fully re-written to be safe. +- to simplify Ajv extensions, the new keyword API that is used by pre-defined keywords is available to user-defined keywords - it is much easier to define any keywords now, especially with subschemas. +- schemas are compiled to ES6 code (ES5 code generation is supported with an option). +- to improve reliability and maintainability the code is migrated to TypeScript. + +**Please note**: + +- the support for JSON-Schema draft-04 is removed - if you have schemas using "id" attributes you have to replace them with "\$id" (or continue using version 6 that will be supported until 02/28/2021). +- all formats are separated to ajv-formats package - they have to be explicitely added if you use them. + +See [release notes](https://github.com/ajv-validator/ajv/releases/tag/v7.0.0-beta.0) for the details. + +To install the new version: + +```bash +npm install ajv@beta +``` + +See [Getting started with v7](https://github.com/ajv-validator/ajv/tree/v7-beta#usage) for code example. + + +## Mozilla MOSS grant and OpenJS Foundation + +[](https://www.mozilla.org/en-US/moss/)     [](https://openjsf.org/blog/2020/08/14/ajv-joins-openjs-foundation-as-an-incubation-project/) + +Ajv has been awarded a grant from Mozilla’s [Open Source Support (MOSS) program](https://www.mozilla.org/en-US/moss/) in the “Foundational Technology” track! It will sponsor the development of Ajv support of [JSON Schema version 2019-09](https://tools.ietf.org/html/draft-handrews-json-schema-02) and of [JSON Type Definition](https://tools.ietf.org/html/draft-ucarion-json-type-definition-04). + +Ajv also joined [OpenJS Foundation](https://openjsf.org/) – having this support will help ensure the longevity and stability of Ajv for all its users. + +This [blog post](https://www.poberezkin.com/posts/2020-08-14-ajv-json-validator-mozilla-open-source-grant-openjs-foundation.html) has more details. + +I am looking for the long term maintainers of Ajv – working with [ReadySet](https://www.thereadyset.co/), also sponsored by Mozilla, to establish clear guidelines for the role of a "maintainer" and the contribution standards, and to encourage a wider, more inclusive, contribution from the community. + + +## Please [sponsor Ajv development](https://github.com/sponsors/epoberezkin) + +Since I asked to support Ajv development 40 people and 6 organizations contributed via GitHub and OpenCollective - this support helped receiving the MOSS grant! + +Your continuing support is very important - the funds will be used to develop and maintain Ajv once the next major version is released. + +Please sponsor Ajv via: +- [GitHub sponsors page](https://github.com/sponsors/epoberezkin) (GitHub will match it) +- [Ajv Open Collective️](https://opencollective.com/ajv) + +Thank you. + + +#### Open Collective sponsors + + + + + + + + + + + + + + + +## Using version 6 + +[JSON Schema draft-07](http://json-schema.org/latest/json-schema-validation.html) is published. + +[Ajv version 6.0.0](https://github.com/ajv-validator/ajv/releases/tag/v6.0.0) that supports draft-07 is released. It may require either migrating your schemas or updating your code (to continue using draft-04 and v5 schemas, draft-06 schemas will be supported without changes). + +__Please note__: To use Ajv with draft-06 schemas you need to explicitly add the meta-schema to the validator instance: + +```javascript +ajv.addMetaSchema(require('ajv/lib/refs/json-schema-draft-06.json')); +``` + +To use Ajv with draft-04 schemas in addition to explicitly adding meta-schema you also need to use option schemaId: + +```javascript +var ajv = new Ajv({schemaId: 'id'}); +// If you want to use both draft-04 and draft-06/07 schemas: +// var ajv = new Ajv({schemaId: 'auto'}); +ajv.addMetaSchema(require('ajv/lib/refs/json-schema-draft-04.json')); +``` + + +## Contents + +- [Performance](#performance) +- [Features](#features) +- [Getting started](#getting-started) +- [Frequently Asked Questions](https://github.com/ajv-validator/ajv/blob/master/FAQ.md) +- [Using in browser](#using-in-browser) + - [Ajv and Content Security Policies (CSP)](#ajv-and-content-security-policies-csp) +- [Command line interface](#command-line-interface) +- Validation + - [Keywords](#validation-keywords) + - [Annotation keywords](#annotation-keywords) + - [Formats](#formats) + - [Combining schemas with $ref](#ref) + - [$data reference](#data-reference) + - NEW: [$merge and $patch keywords](#merge-and-patch-keywords) + - [Defining custom keywords](#defining-custom-keywords) + - [Asynchronous schema compilation](#asynchronous-schema-compilation) + - [Asynchronous validation](#asynchronous-validation) +- [Security considerations](#security-considerations) + - [Security contact](#security-contact) + - [Untrusted schemas](#untrusted-schemas) + - [Circular references in objects](#circular-references-in-javascript-objects) + - [Trusted schemas](#security-risks-of-trusted-schemas) + - [ReDoS attack](#redos-attack) +- Modifying data during validation + - [Filtering data](#filtering-data) + - [Assigning defaults](#assigning-defaults) + - [Coercing data types](#coercing-data-types) +- API + - [Methods](#api) + - [Options](#options) + - [Validation errors](#validation-errors) +- [Plugins](#plugins) +- [Related packages](#related-packages) +- [Some packages using Ajv](#some-packages-using-ajv) +- [Tests, Contributing, Changes history](#tests) +- [Support, Code of conduct, License](#open-source-software-support) + + +## Performance + +Ajv generates code using [doT templates](https://github.com/olado/doT) to turn JSON Schemas into super-fast validation functions that are efficient for v8 optimization. + +Currently Ajv is the fastest and the most standard compliant validator according to these benchmarks: + +- [json-schema-benchmark](https://github.com/ebdrup/json-schema-benchmark) - 50% faster than the second place +- [jsck benchmark](https://github.com/pandastrike/jsck#benchmarks) - 20-190% faster +- [z-schema benchmark](https://rawgit.com/zaggino/z-schema/master/benchmark/results.html) +- [themis benchmark](https://cdn.rawgit.com/playlyfe/themis/master/benchmark/results.html) + + +Performance of different validators by [json-schema-benchmark](https://github.com/ebdrup/json-schema-benchmark): + +[![performance](https://chart.googleapis.com/chart?chxt=x,y&cht=bhs&chco=76A4FB&chls=2.0&chbh=32,4,1&chs=600x416&chxl=-1:|djv|ajv|json-schema-validator-generator|jsen|is-my-json-valid|themis|z-schema|jsck|skeemas|json-schema-library|tv4&chd=t:100,98,72.1,66.8,50.1,15.1,6.1,3.8,1.2,0.7,0.2)](https://github.com/ebdrup/json-schema-benchmark/blob/master/README.md#performance) + + +## Features + +- Ajv implements full JSON Schema [draft-06/07](http://json-schema.org/) and draft-04 standards: + - all validation keywords (see [JSON Schema validation keywords](https://github.com/ajv-validator/ajv/blob/master/KEYWORDS.md)) + - full support of remote refs (remote schemas have to be added with `addSchema` or compiled to be available) + - support of circular references between schemas + - correct string lengths for strings with unicode pairs (can be turned off) + - [formats](#formats) defined by JSON Schema draft-07 standard and custom formats (can be turned off) + - [validates schemas against meta-schema](#api-validateschema) +- supports [browsers](#using-in-browser) and Node.js 0.10-14.x +- [asynchronous loading](#asynchronous-schema-compilation) of referenced schemas during compilation +- "All errors" validation mode with [option allErrors](#options) +- [error messages with parameters](#validation-errors) describing error reasons to allow creating custom error messages +- i18n error messages support with [ajv-i18n](https://github.com/ajv-validator/ajv-i18n) package +- [filtering data](#filtering-data) from additional properties +- [assigning defaults](#assigning-defaults) to missing properties and items +- [coercing data](#coercing-data-types) to the types specified in `type` keywords +- [custom keywords](#defining-custom-keywords) +- draft-06/07 keywords `const`, `contains`, `propertyNames` and `if/then/else` +- draft-06 boolean schemas (`true`/`false` as a schema to always pass/fail). +- keywords `switch`, `patternRequired`, `formatMaximum` / `formatMinimum` and `formatExclusiveMaximum` / `formatExclusiveMinimum` from [JSON Schema extension proposals](https://github.com/json-schema/json-schema/wiki/v5-Proposals) with [ajv-keywords](https://github.com/ajv-validator/ajv-keywords) package +- [$data reference](#data-reference) to use values from the validated data as values for the schema keywords +- [asynchronous validation](#asynchronous-validation) of custom formats and keywords + + +## Install + +``` +npm install ajv +``` + + +## Getting started + +Try it in the Node.js REPL: https://tonicdev.com/npm/ajv + + +The fastest validation call: + +```javascript +// Node.js require: +var Ajv = require('ajv'); +// or ESM/TypeScript import +import Ajv from 'ajv'; + +var ajv = new Ajv(); // options can be passed, e.g. {allErrors: true} +var validate = ajv.compile(schema); +var valid = validate(data); +if (!valid) console.log(validate.errors); +``` + +or with less code + +```javascript +// ... +var valid = ajv.validate(schema, data); +if (!valid) console.log(ajv.errors); +// ... +``` + +or + +```javascript +// ... +var valid = ajv.addSchema(schema, 'mySchema') + .validate('mySchema', data); +if (!valid) console.log(ajv.errorsText()); +// ... +``` + +See [API](#api) and [Options](#options) for more details. + +Ajv compiles schemas to functions and caches them in all cases (using schema serialized with [fast-json-stable-stringify](https://github.com/epoberezkin/fast-json-stable-stringify) or a custom function as a key), so that the next time the same schema is used (not necessarily the same object instance) it won't be compiled again. + +The best performance is achieved when using compiled functions returned by `compile` or `getSchema` methods (there is no additional function call). + +__Please note__: every time a validation function or `ajv.validate` are called `errors` property is overwritten. You need to copy `errors` array reference to another variable if you want to use it later (e.g., in the callback). See [Validation errors](#validation-errors) + +__Note for TypeScript users__: `ajv` provides its own TypeScript declarations +out of the box, so you don't need to install the deprecated `@types/ajv` +module. + + +## Using in browser + +You can require Ajv directly from the code you browserify - in this case Ajv will be a part of your bundle. + +If you need to use Ajv in several bundles you can create a separate UMD bundle using `npm run bundle` script (thanks to [siddo420](https://github.com/siddo420)). + +Then you need to load Ajv in the browser: +```html + +``` + +This bundle can be used with different module systems; it creates global `Ajv` if no module system is found. + +The browser bundle is available on [cdnjs](https://cdnjs.com/libraries/ajv). + +Ajv is tested with these browsers: + +[![Sauce Test Status](https://saucelabs.com/browser-matrix/epoberezkin.svg)](https://saucelabs.com/u/epoberezkin) + +__Please note__: some frameworks, e.g. Dojo, may redefine global require in such way that is not compatible with CommonJS module format. In such case Ajv bundle has to be loaded before the framework and then you can use global Ajv (see issue [#234](https://github.com/ajv-validator/ajv/issues/234)). + + +### Ajv and Content Security Policies (CSP) + +If you're using Ajv to compile a schema (the typical use) in a browser document that is loaded with a Content Security Policy (CSP), that policy will require a `script-src` directive that includes the value `'unsafe-eval'`. +:warning: NOTE, however, that `unsafe-eval` is NOT recommended in a secure CSP[[1]](https://developer.chrome.com/extensions/contentSecurityPolicy#relaxing-eval), as it has the potential to open the document to cross-site scripting (XSS) attacks. + +In order to make use of Ajv without easing your CSP, you can [pre-compile a schema using the CLI](https://github.com/ajv-validator/ajv-cli#compile-schemas). This will transpile the schema JSON into a JavaScript file that exports a `validate` function that works simlarly to a schema compiled at runtime. + +Note that pre-compilation of schemas is performed using [ajv-pack](https://github.com/ajv-validator/ajv-pack) and there are [some limitations to the schema features it can compile](https://github.com/ajv-validator/ajv-pack#limitations). A successfully pre-compiled schema is equivalent to the same schema compiled at runtime. + + +## Command line interface + +CLI is available as a separate npm package [ajv-cli](https://github.com/ajv-validator/ajv-cli). It supports: + +- compiling JSON Schemas to test their validity +- BETA: generating standalone module exporting a validation function to be used without Ajv (using [ajv-pack](https://github.com/ajv-validator/ajv-pack)) +- migrate schemas to draft-07 (using [json-schema-migrate](https://github.com/epoberezkin/json-schema-migrate)) +- validating data file(s) against JSON Schema +- testing expected validity of data against JSON Schema +- referenced schemas +- custom meta-schemas +- files in JSON, JSON5, YAML, and JavaScript format +- all Ajv options +- reporting changes in data after validation in [JSON-patch](https://tools.ietf.org/html/rfc6902) format + + +## Validation keywords + +Ajv supports all validation keywords from draft-07 of JSON Schema standard: + +- [type](https://github.com/ajv-validator/ajv/blob/master/KEYWORDS.md#type) +- [for numbers](https://github.com/ajv-validator/ajv/blob/master/KEYWORDS.md#keywords-for-numbers) - maximum, minimum, exclusiveMaximum, exclusiveMinimum, multipleOf +- [for strings](https://github.com/ajv-validator/ajv/blob/master/KEYWORDS.md#keywords-for-strings) - maxLength, minLength, pattern, format +- [for arrays](https://github.com/ajv-validator/ajv/blob/master/KEYWORDS.md#keywords-for-arrays) - maxItems, minItems, uniqueItems, items, additionalItems, [contains](https://github.com/ajv-validator/ajv/blob/master/KEYWORDS.md#contains) +- [for objects](https://github.com/ajv-validator/ajv/blob/master/KEYWORDS.md#keywords-for-objects) - maxProperties, minProperties, required, properties, patternProperties, additionalProperties, dependencies, [propertyNames](https://github.com/ajv-validator/ajv/blob/master/KEYWORDS.md#propertynames) +- [for all types](https://github.com/ajv-validator/ajv/blob/master/KEYWORDS.md#keywords-for-all-types) - enum, [const](https://github.com/ajv-validator/ajv/blob/master/KEYWORDS.md#const) +- [compound keywords](https://github.com/ajv-validator/ajv/blob/master/KEYWORDS.md#compound-keywords) - not, oneOf, anyOf, allOf, [if/then/else](https://github.com/ajv-validator/ajv/blob/master/KEYWORDS.md#ifthenelse) + +With [ajv-keywords](https://github.com/ajv-validator/ajv-keywords) package Ajv also supports validation keywords from [JSON Schema extension proposals](https://github.com/json-schema/json-schema/wiki/v5-Proposals) for JSON Schema standard: + +- [patternRequired](https://github.com/ajv-validator/ajv/blob/master/KEYWORDS.md#patternrequired-proposed) - like `required` but with patterns that some property should match. +- [formatMaximum, formatMinimum, formatExclusiveMaximum, formatExclusiveMinimum](https://github.com/ajv-validator/ajv/blob/master/KEYWORDS.md#formatmaximum--formatminimum-and-exclusiveformatmaximum--exclusiveformatminimum-proposed) - setting limits for date, time, etc. + +See [JSON Schema validation keywords](https://github.com/ajv-validator/ajv/blob/master/KEYWORDS.md) for more details. + + +## Annotation keywords + +JSON Schema specification defines several annotation keywords that describe schema itself but do not perform any validation. + +- `title` and `description`: information about the data represented by that schema +- `$comment` (NEW in draft-07): information for developers. With option `$comment` Ajv logs or passes the comment string to the user-supplied function. See [Options](#options). +- `default`: a default value of the data instance, see [Assigning defaults](#assigning-defaults). +- `examples` (NEW in draft-06): an array of data instances. Ajv does not check the validity of these instances against the schema. +- `readOnly` and `writeOnly` (NEW in draft-07): marks data-instance as read-only or write-only in relation to the source of the data (database, api, etc.). +- `contentEncoding`: [RFC 2045](https://tools.ietf.org/html/rfc2045#section-6.1 ), e.g., "base64". +- `contentMediaType`: [RFC 2046](https://tools.ietf.org/html/rfc2046), e.g., "image/png". + +__Please note__: Ajv does not implement validation of the keywords `examples`, `contentEncoding` and `contentMediaType` but it reserves them. If you want to create a plugin that implements some of them, it should remove these keywords from the instance. + + +## Formats + +Ajv implements formats defined by JSON Schema specification and several other formats. It is recommended NOT to use "format" keyword implementations with untrusted data, as they use potentially unsafe regular expressions - see [ReDoS attack](#redos-attack). + +__Please note__: if you need to use "format" keyword to validate untrusted data, you MUST assess their suitability and safety for your validation scenarios. + +The following formats are implemented for string validation with "format" keyword: + +- _date_: full-date according to [RFC3339](http://tools.ietf.org/html/rfc3339#section-5.6). +- _time_: time with optional time-zone. +- _date-time_: date-time from the same source (time-zone is mandatory). `date`, `time` and `date-time` validate ranges in `full` mode and only regexp in `fast` mode (see [options](#options)). +- _uri_: full URI. +- _uri-reference_: URI reference, including full and relative URIs. +- _uri-template_: URI template according to [RFC6570](https://tools.ietf.org/html/rfc6570) +- _url_ (deprecated): [URL record](https://url.spec.whatwg.org/#concept-url). +- _email_: email address. +- _hostname_: host name according to [RFC1034](http://tools.ietf.org/html/rfc1034#section-3.5). +- _ipv4_: IP address v4. +- _ipv6_: IP address v6. +- _regex_: tests whether a string is a valid regular expression by passing it to RegExp constructor. +- _uuid_: Universally Unique IDentifier according to [RFC4122](http://tools.ietf.org/html/rfc4122). +- _json-pointer_: JSON-pointer according to [RFC6901](https://tools.ietf.org/html/rfc6901). +- _relative-json-pointer_: relative JSON-pointer according to [this draft](http://tools.ietf.org/html/draft-luff-relative-json-pointer-00). + +__Please note__: JSON Schema draft-07 also defines formats `iri`, `iri-reference`, `idn-hostname` and `idn-email` for URLs, hostnames and emails with international characters. Ajv does not implement these formats. If you create Ajv plugin that implements them please make a PR to mention this plugin here. + +There are two modes of format validation: `fast` and `full`. This mode affects formats `date`, `time`, `date-time`, `uri`, `uri-reference`, and `email`. See [Options](#options) for details. + +You can add additional formats and replace any of the formats above using [addFormat](#api-addformat) method. + +The option `unknownFormats` allows changing the default behaviour when an unknown format is encountered. In this case Ajv can either fail schema compilation (default) or ignore it (default in versions before 5.0.0). You also can allow specific format(s) that will be ignored. See [Options](#options) for details. + +You can find regular expressions used for format validation and the sources that were used in [formats.js](https://github.com/ajv-validator/ajv/blob/master/lib/compile/formats.js). + + +## Combining schemas with $ref + +You can structure your validation logic across multiple schema files and have schemas reference each other using `$ref` keyword. + +Example: + +```javascript +var schema = { + "$id": "http://example.com/schemas/schema.json", + "type": "object", + "properties": { + "foo": { "$ref": "defs.json#/definitions/int" }, + "bar": { "$ref": "defs.json#/definitions/str" } + } +}; + +var defsSchema = { + "$id": "http://example.com/schemas/defs.json", + "definitions": { + "int": { "type": "integer" }, + "str": { "type": "string" } + } +}; +``` + +Now to compile your schema you can either pass all schemas to Ajv instance: + +```javascript +var ajv = new Ajv({schemas: [schema, defsSchema]}); +var validate = ajv.getSchema('http://example.com/schemas/schema.json'); +``` + +or use `addSchema` method: + +```javascript +var ajv = new Ajv; +var validate = ajv.addSchema(defsSchema) + .compile(schema); +``` + +See [Options](#options) and [addSchema](#api) method. + +__Please note__: +- `$ref` is resolved as the uri-reference using schema $id as the base URI (see the example). +- References can be recursive (and mutually recursive) to implement the schemas for different data structures (such as linked lists, trees, graphs, etc.). +- You don't have to host your schema files at the URIs that you use as schema $id. These URIs are only used to identify the schemas, and according to JSON Schema specification validators should not expect to be able to download the schemas from these URIs. +- The actual location of the schema file in the file system is not used. +- You can pass the identifier of the schema as the second parameter of `addSchema` method or as a property name in `schemas` option. This identifier can be used instead of (or in addition to) schema $id. +- You cannot have the same $id (or the schema identifier) used for more than one schema - the exception will be thrown. +- You can implement dynamic resolution of the referenced schemas using `compileAsync` method. In this way you can store schemas in any system (files, web, database, etc.) and reference them without explicitly adding to Ajv instance. See [Asynchronous schema compilation](#asynchronous-schema-compilation). + + +## $data reference + +With `$data` option you can use values from the validated data as the values for the schema keywords. See [proposal](https://github.com/json-schema-org/json-schema-spec/issues/51) for more information about how it works. + +`$data` reference is supported in the keywords: const, enum, format, maximum/minimum, exclusiveMaximum / exclusiveMinimum, maxLength / minLength, maxItems / minItems, maxProperties / minProperties, formatMaximum / formatMinimum, formatExclusiveMaximum / formatExclusiveMinimum, multipleOf, pattern, required, uniqueItems. + +The value of "$data" should be a [JSON-pointer](https://tools.ietf.org/html/rfc6901) to the data (the root is always the top level data object, even if the $data reference is inside a referenced subschema) or a [relative JSON-pointer](http://tools.ietf.org/html/draft-luff-relative-json-pointer-00) (it is relative to the current point in data; if the $data reference is inside a referenced subschema it cannot point to the data outside of the root level for this subschema). + +Examples. + +This schema requires that the value in property `smaller` is less or equal than the value in the property larger: + +```javascript +var ajv = new Ajv({$data: true}); + +var schema = { + "properties": { + "smaller": { + "type": "number", + "maximum": { "$data": "1/larger" } + }, + "larger": { "type": "number" } + } +}; + +var validData = { + smaller: 5, + larger: 7 +}; + +ajv.validate(schema, validData); // true +``` + +This schema requires that the properties have the same format as their field names: + +```javascript +var schema = { + "additionalProperties": { + "type": "string", + "format": { "$data": "0#" } + } +}; + +var validData = { + 'date-time': '1963-06-19T08:30:06.283185Z', + email: 'joe.bloggs@example.com' +} +``` + +`$data` reference is resolved safely - it won't throw even if some property is undefined. If `$data` resolves to `undefined` the validation succeeds (with the exclusion of `const` keyword). If `$data` resolves to incorrect type (e.g. not "number" for maximum keyword) the validation fails. + + +## $merge and $patch keywords + +With the package [ajv-merge-patch](https://github.com/ajv-validator/ajv-merge-patch) you can use the keywords `$merge` and `$patch` that allow extending JSON Schemas with patches using formats [JSON Merge Patch (RFC 7396)](https://tools.ietf.org/html/rfc7396) and [JSON Patch (RFC 6902)](https://tools.ietf.org/html/rfc6902). + +To add keywords `$merge` and `$patch` to Ajv instance use this code: + +```javascript +require('ajv-merge-patch')(ajv); +``` + +Examples. + +Using `$merge`: + +```json +{ + "$merge": { + "source": { + "type": "object", + "properties": { "p": { "type": "string" } }, + "additionalProperties": false + }, + "with": { + "properties": { "q": { "type": "number" } } + } + } +} +``` + +Using `$patch`: + +```json +{ + "$patch": { + "source": { + "type": "object", + "properties": { "p": { "type": "string" } }, + "additionalProperties": false + }, + "with": [ + { "op": "add", "path": "/properties/q", "value": { "type": "number" } } + ] + } +} +``` + +The schemas above are equivalent to this schema: + +```json +{ + "type": "object", + "properties": { + "p": { "type": "string" }, + "q": { "type": "number" } + }, + "additionalProperties": false +} +``` + +The properties `source` and `with` in the keywords `$merge` and `$patch` can use absolute or relative `$ref` to point to other schemas previously added to the Ajv instance or to the fragments of the current schema. + +See the package [ajv-merge-patch](https://github.com/ajv-validator/ajv-merge-patch) for more information. + + +## Defining custom keywords + +The advantages of using custom keywords are: + +- allow creating validation scenarios that cannot be expressed using JSON Schema +- simplify your schemas +- help bringing a bigger part of the validation logic to your schemas +- make your schemas more expressive, less verbose and closer to your application domain +- implement custom data processors that modify your data (`modifying` option MUST be used in keyword definition) and/or create side effects while the data is being validated + +If a keyword is used only for side-effects and its validation result is pre-defined, use option `valid: true/false` in keyword definition to simplify both generated code (no error handling in case of `valid: true`) and your keyword functions (no need to return any validation result). + +The concerns you have to be aware of when extending JSON Schema standard with custom keywords are the portability and understanding of your schemas. You will have to support these custom keywords on other platforms and to properly document these keywords so that everybody can understand them in your schemas. + +You can define custom keywords with [addKeyword](#api-addkeyword) method. Keywords are defined on the `ajv` instance level - new instances will not have previously defined keywords. + +Ajv allows defining keywords with: +- validation function +- compilation function +- macro function +- inline compilation function that should return code (as string) that will be inlined in the currently compiled schema. + +Example. `range` and `exclusiveRange` keywords using compiled schema: + +```javascript +ajv.addKeyword('range', { + type: 'number', + compile: function (sch, parentSchema) { + var min = sch[0]; + var max = sch[1]; + + return parentSchema.exclusiveRange === true + ? function (data) { return data > min && data < max; } + : function (data) { return data >= min && data <= max; } + } +}); + +var schema = { "range": [2, 4], "exclusiveRange": true }; +var validate = ajv.compile(schema); +console.log(validate(2.01)); // true +console.log(validate(3.99)); // true +console.log(validate(2)); // false +console.log(validate(4)); // false +``` + +Several custom keywords (typeof, instanceof, range and propertyNames) are defined in [ajv-keywords](https://github.com/ajv-validator/ajv-keywords) package - they can be used for your schemas and as a starting point for your own custom keywords. + +See [Defining custom keywords](https://github.com/ajv-validator/ajv/blob/master/CUSTOM.md) for more details. + + +## Asynchronous schema compilation + +During asynchronous compilation remote references are loaded using supplied function. See `compileAsync` [method](#api-compileAsync) and `loadSchema` [option](#options). + +Example: + +```javascript +var ajv = new Ajv({ loadSchema: loadSchema }); + +ajv.compileAsync(schema).then(function (validate) { + var valid = validate(data); + // ... +}); + +function loadSchema(uri) { + return request.json(uri).then(function (res) { + if (res.statusCode >= 400) + throw new Error('Loading error: ' + res.statusCode); + return res.body; + }); +} +``` + +__Please note__: [Option](#options) `missingRefs` should NOT be set to `"ignore"` or `"fail"` for asynchronous compilation to work. + + +## Asynchronous validation + +Example in Node.js REPL: https://tonicdev.com/esp/ajv-asynchronous-validation + +You can define custom formats and keywords that perform validation asynchronously by accessing database or some other service. You should add `async: true` in the keyword or format definition (see [addFormat](#api-addformat), [addKeyword](#api-addkeyword) and [Defining custom keywords](#defining-custom-keywords)). + +If your schema uses asynchronous formats/keywords or refers to some schema that contains them it should have `"$async": true` keyword so that Ajv can compile it correctly. If asynchronous format/keyword or reference to asynchronous schema is used in the schema without `$async` keyword Ajv will throw an exception during schema compilation. + +__Please note__: all asynchronous subschemas that are referenced from the current or other schemas should have `"$async": true` keyword as well, otherwise the schema compilation will fail. + +Validation function for an asynchronous custom format/keyword should return a promise that resolves with `true` or `false` (or rejects with `new Ajv.ValidationError(errors)` if you want to return custom errors from the keyword function). + +Ajv compiles asynchronous schemas to [es7 async functions](http://tc39.github.io/ecmascript-asyncawait/) that can optionally be transpiled with [nodent](https://github.com/MatAtBread/nodent). Async functions are supported in Node.js 7+ and all modern browsers. You can also supply any other transpiler as a function via `processCode` option. See [Options](#options). + +The compiled validation function has `$async: true` property (if the schema is asynchronous), so you can differentiate these functions if you are using both synchronous and asynchronous schemas. + +Validation result will be a promise that resolves with validated data or rejects with an exception `Ajv.ValidationError` that contains the array of validation errors in `errors` property. + + +Example: + +```javascript +var ajv = new Ajv; +// require('ajv-async')(ajv); + +ajv.addKeyword('idExists', { + async: true, + type: 'number', + validate: checkIdExists +}); + + +function checkIdExists(schema, data) { + return knex(schema.table) + .select('id') + .where('id', data) + .then(function (rows) { + return !!rows.length; // true if record is found + }); +} + +var schema = { + "$async": true, + "properties": { + "userId": { + "type": "integer", + "idExists": { "table": "users" } + }, + "postId": { + "type": "integer", + "idExists": { "table": "posts" } + } + } +}; + +var validate = ajv.compile(schema); + +validate({ userId: 1, postId: 19 }) +.then(function (data) { + console.log('Data is valid', data); // { userId: 1, postId: 19 } +}) +.catch(function (err) { + if (!(err instanceof Ajv.ValidationError)) throw err; + // data is invalid + console.log('Validation errors:', err.errors); +}); +``` + +### Using transpilers with asynchronous validation functions. + +[ajv-async](https://github.com/ajv-validator/ajv-async) uses [nodent](https://github.com/MatAtBread/nodent) to transpile async functions. To use another transpiler you should separately install it (or load its bundle in the browser). + + +#### Using nodent + +```javascript +var ajv = new Ajv; +require('ajv-async')(ajv); +// in the browser if you want to load ajv-async bundle separately you can: +// window.ajvAsync(ajv); +var validate = ajv.compile(schema); // transpiled es7 async function +validate(data).then(successFunc).catch(errorFunc); +``` + + +#### Using other transpilers + +```javascript +var ajv = new Ajv({ processCode: transpileFunc }); +var validate = ajv.compile(schema); // transpiled es7 async function +validate(data).then(successFunc).catch(errorFunc); +``` + +See [Options](#options). + + +## Security considerations + +JSON Schema, if properly used, can replace data sanitisation. It doesn't replace other API security considerations. It also introduces additional security aspects to consider. + + +##### Security contact + +To report a security vulnerability, please use the +[Tidelift security contact](https://tidelift.com/security). +Tidelift will coordinate the fix and disclosure. Please do NOT report security vulnerabilities via GitHub issues. + + +##### Untrusted schemas + +Ajv treats JSON schemas as trusted as your application code. This security model is based on the most common use case, when the schemas are static and bundled together with the application. + +If your schemas are received from untrusted sources (or generated from untrusted data) there are several scenarios you need to prevent: +- compiling schemas can cause stack overflow (if they are too deep) +- compiling schemas can be slow (e.g. [#557](https://github.com/ajv-validator/ajv/issues/557)) +- validating certain data can be slow + +It is difficult to predict all the scenarios, but at the very least it may help to limit the size of untrusted schemas (e.g. limit JSON string length) and also the maximum schema object depth (that can be high for relatively small JSON strings). You also may want to mitigate slow regular expressions in `pattern` and `patternProperties` keywords. + +Regardless the measures you take, using untrusted schemas increases security risks. + + +##### Circular references in JavaScript objects + +Ajv does not support schemas and validated data that have circular references in objects. See [issue #802](https://github.com/ajv-validator/ajv/issues/802). + +An attempt to compile such schemas or validate such data would cause stack overflow (or will not complete in case of asynchronous validation). Depending on the parser you use, untrusted data can lead to circular references. + + +##### Security risks of trusted schemas + +Some keywords in JSON Schemas can lead to very slow validation for certain data. These keywords include (but may be not limited to): + +- `pattern` and `format` for large strings - in some cases using `maxLength` can help mitigate it, but certain regular expressions can lead to exponential validation time even with relatively short strings (see [ReDoS attack](#redos-attack)). +- `patternProperties` for large property names - use `propertyNames` to mitigate, but some regular expressions can have exponential evaluation time as well. +- `uniqueItems` for large non-scalar arrays - use `maxItems` to mitigate + +__Please note__: The suggestions above to prevent slow validation would only work if you do NOT use `allErrors: true` in production code (using it would continue validation after validation errors). + +You can validate your JSON schemas against [this meta-schema](https://github.com/ajv-validator/ajv/blob/master/lib/refs/json-schema-secure.json) to check that these recommendations are followed: + +```javascript +const isSchemaSecure = ajv.compile(require('ajv/lib/refs/json-schema-secure.json')); + +const schema1 = {format: 'email'}; +isSchemaSecure(schema1); // false + +const schema2 = {format: 'email', maxLength: MAX_LENGTH}; +isSchemaSecure(schema2); // true +``` + +__Please note__: following all these recommendation is not a guarantee that validation of untrusted data is safe - it can still lead to some undesirable results. + + +##### Content Security Policies (CSP) +See [Ajv and Content Security Policies (CSP)](#ajv-and-content-security-policies-csp) + + +## ReDoS attack + +Certain regular expressions can lead to the exponential evaluation time even with relatively short strings. + +Please assess the regular expressions you use in the schemas on their vulnerability to this attack - see [safe-regex](https://github.com/substack/safe-regex), for example. + +__Please note__: some formats that Ajv implements use [regular expressions](https://github.com/ajv-validator/ajv/blob/master/lib/compile/formats.js) that can be vulnerable to ReDoS attack, so if you use Ajv to validate data from untrusted sources __it is strongly recommended__ to consider the following: + +- making assessment of "format" implementations in Ajv. +- using `format: 'fast'` option that simplifies some of the regular expressions (although it does not guarantee that they are safe). +- replacing format implementations provided by Ajv with your own implementations of "format" keyword that either uses different regular expressions or another approach to format validation. Please see [addFormat](#api-addformat) method. +- disabling format validation by ignoring "format" keyword with option `format: false` + +Whatever mitigation you choose, please assume all formats provided by Ajv as potentially unsafe and make your own assessment of their suitability for your validation scenarios. + + +## Filtering data + +With [option `removeAdditional`](#options) (added by [andyscott](https://github.com/andyscott)) you can filter data during the validation. + +This option modifies original data. + +Example: + +```javascript +var ajv = new Ajv({ removeAdditional: true }); +var schema = { + "additionalProperties": false, + "properties": { + "foo": { "type": "number" }, + "bar": { + "additionalProperties": { "type": "number" }, + "properties": { + "baz": { "type": "string" } + } + } + } +} + +var data = { + "foo": 0, + "additional1": 1, // will be removed; `additionalProperties` == false + "bar": { + "baz": "abc", + "additional2": 2 // will NOT be removed; `additionalProperties` != false + }, +} + +var validate = ajv.compile(schema); + +console.log(validate(data)); // true +console.log(data); // { "foo": 0, "bar": { "baz": "abc", "additional2": 2 } +``` + +If `removeAdditional` option in the example above were `"all"` then both `additional1` and `additional2` properties would have been removed. + +If the option were `"failing"` then property `additional1` would have been removed regardless of its value and property `additional2` would have been removed only if its value were failing the schema in the inner `additionalProperties` (so in the example above it would have stayed because it passes the schema, but any non-number would have been removed). + +__Please note__: If you use `removeAdditional` option with `additionalProperties` keyword inside `anyOf`/`oneOf` keywords your validation can fail with this schema, for example: + +```json +{ + "type": "object", + "oneOf": [ + { + "properties": { + "foo": { "type": "string" } + }, + "required": [ "foo" ], + "additionalProperties": false + }, + { + "properties": { + "bar": { "type": "integer" } + }, + "required": [ "bar" ], + "additionalProperties": false + } + ] +} +``` + +The intention of the schema above is to allow objects with either the string property "foo" or the integer property "bar", but not with both and not with any other properties. + +With the option `removeAdditional: true` the validation will pass for the object `{ "foo": "abc"}` but will fail for the object `{"bar": 1}`. It happens because while the first subschema in `oneOf` is validated, the property `bar` is removed because it is an additional property according to the standard (because it is not included in `properties` keyword in the same schema). + +While this behaviour is unexpected (issues [#129](https://github.com/ajv-validator/ajv/issues/129), [#134](https://github.com/ajv-validator/ajv/issues/134)), it is correct. To have the expected behaviour (both objects are allowed and additional properties are removed) the schema has to be refactored in this way: + +```json +{ + "type": "object", + "properties": { + "foo": { "type": "string" }, + "bar": { "type": "integer" } + }, + "additionalProperties": false, + "oneOf": [ + { "required": [ "foo" ] }, + { "required": [ "bar" ] } + ] +} +``` + +The schema above is also more efficient - it will compile into a faster function. + + +## Assigning defaults + +With [option `useDefaults`](#options) Ajv will assign values from `default` keyword in the schemas of `properties` and `items` (when it is the array of schemas) to the missing properties and items. + +With the option value `"empty"` properties and items equal to `null` or `""` (empty string) will be considered missing and assigned defaults. + +This option modifies original data. + +__Please note__: the default value is inserted in the generated validation code as a literal, so the value inserted in the data will be the deep clone of the default in the schema. + + +Example 1 (`default` in `properties`): + +```javascript +var ajv = new Ajv({ useDefaults: true }); +var schema = { + "type": "object", + "properties": { + "foo": { "type": "number" }, + "bar": { "type": "string", "default": "baz" } + }, + "required": [ "foo", "bar" ] +}; + +var data = { "foo": 1 }; + +var validate = ajv.compile(schema); + +console.log(validate(data)); // true +console.log(data); // { "foo": 1, "bar": "baz" } +``` + +Example 2 (`default` in `items`): + +```javascript +var schema = { + "type": "array", + "items": [ + { "type": "number" }, + { "type": "string", "default": "foo" } + ] +} + +var data = [ 1 ]; + +var validate = ajv.compile(schema); + +console.log(validate(data)); // true +console.log(data); // [ 1, "foo" ] +``` + +`default` keywords in other cases are ignored: + +- not in `properties` or `items` subschemas +- in schemas inside `anyOf`, `oneOf` and `not` (see [#42](https://github.com/ajv-validator/ajv/issues/42)) +- in `if` subschema of `switch` keyword +- in schemas generated by custom macro keywords + +The [`strictDefaults` option](#options) customizes Ajv's behavior for the defaults that Ajv ignores (`true` raises an error, and `"log"` outputs a warning). + + +## Coercing data types + +When you are validating user inputs all your data properties are usually strings. The option `coerceTypes` allows you to have your data types coerced to the types specified in your schema `type` keywords, both to pass the validation and to use the correctly typed data afterwards. + +This option modifies original data. + +__Please note__: if you pass a scalar value to the validating function its type will be coerced and it will pass the validation, but the value of the variable you pass won't be updated because scalars are passed by value. + + +Example 1: + +```javascript +var ajv = new Ajv({ coerceTypes: true }); +var schema = { + "type": "object", + "properties": { + "foo": { "type": "number" }, + "bar": { "type": "boolean" } + }, + "required": [ "foo", "bar" ] +}; + +var data = { "foo": "1", "bar": "false" }; + +var validate = ajv.compile(schema); + +console.log(validate(data)); // true +console.log(data); // { "foo": 1, "bar": false } +``` + +Example 2 (array coercions): + +```javascript +var ajv = new Ajv({ coerceTypes: 'array' }); +var schema = { + "properties": { + "foo": { "type": "array", "items": { "type": "number" } }, + "bar": { "type": "boolean" } + } +}; + +var data = { "foo": "1", "bar": ["false"] }; + +var validate = ajv.compile(schema); + +console.log(validate(data)); // true +console.log(data); // { "foo": [1], "bar": false } +``` + +The coercion rules, as you can see from the example, are different from JavaScript both to validate user input as expected and to have the coercion reversible (to correctly validate cases where different types are defined in subschemas of "anyOf" and other compound keywords). + +See [Coercion rules](https://github.com/ajv-validator/ajv/blob/master/COERCION.md) for details. + + +## API + +##### new Ajv(Object options) -> Object + +Create Ajv instance. + + +##### .compile(Object schema) -> Function<Object data> + +Generate validating function and cache the compiled schema for future use. + +Validating function returns a boolean value. This function has properties `errors` and `schema`. Errors encountered during the last validation are assigned to `errors` property (it is assigned `null` if there was no errors). `schema` property contains the reference to the original schema. + +The schema passed to this method will be validated against meta-schema unless `validateSchema` option is false. If schema is invalid, an error will be thrown. See [options](#options). + + +##### .compileAsync(Object schema [, Boolean meta] [, Function callback]) -> Promise + +Asynchronous version of `compile` method that loads missing remote schemas using asynchronous function in `options.loadSchema`. This function returns a Promise that resolves to a validation function. An optional callback passed to `compileAsync` will be called with 2 parameters: error (or null) and validating function. The returned promise will reject (and the callback will be called with an error) when: + +- missing schema can't be loaded (`loadSchema` returns a Promise that rejects). +- a schema containing a missing reference is loaded, but the reference cannot be resolved. +- schema (or some loaded/referenced schema) is invalid. + +The function compiles schema and loads the first missing schema (or meta-schema) until all missing schemas are loaded. + +You can asynchronously compile meta-schema by passing `true` as the second parameter. + +See example in [Asynchronous compilation](#asynchronous-schema-compilation). + + +##### .validate(Object schema|String key|String ref, data) -> Boolean + +Validate data using passed schema (it will be compiled and cached). + +Instead of the schema you can use the key that was previously passed to `addSchema`, the schema id if it was present in the schema or any previously resolved reference. + +Validation errors will be available in the `errors` property of Ajv instance (`null` if there were no errors). + +__Please note__: every time this method is called the errors are overwritten so you need to copy them to another variable if you want to use them later. + +If the schema is asynchronous (has `$async` keyword on the top level) this method returns a Promise. See [Asynchronous validation](#asynchronous-validation). + + +##### .addSchema(Array<Object>|Object schema [, String key]) -> Ajv + +Add schema(s) to validator instance. This method does not compile schemas (but it still validates them). Because of that dependencies can be added in any order and circular dependencies are supported. It also prevents unnecessary compilation of schemas that are containers for other schemas but not used as a whole. + +Array of schemas can be passed (schemas should have ids), the second parameter will be ignored. + +Key can be passed that can be used to reference the schema and will be used as the schema id if there is no id inside the schema. If the key is not passed, the schema id will be used as the key. + + +Once the schema is added, it (and all the references inside it) can be referenced in other schemas and used to validate data. + +Although `addSchema` does not compile schemas, explicit compilation is not required - the schema will be compiled when it is used first time. + +By default the schema is validated against meta-schema before it is added, and if the schema does not pass validation the exception is thrown. This behaviour is controlled by `validateSchema` option. + +__Please note__: Ajv uses the [method chaining syntax](https://en.wikipedia.org/wiki/Method_chaining) for all methods with the prefix `add*` and `remove*`. +This allows you to do nice things like the following. + +```javascript +var validate = new Ajv().addSchema(schema).addFormat(name, regex).getSchema(uri); +``` + +##### .addMetaSchema(Array<Object>|Object schema [, String key]) -> Ajv + +Adds meta schema(s) that can be used to validate other schemas. That function should be used instead of `addSchema` because there may be instance options that would compile a meta schema incorrectly (at the moment it is `removeAdditional` option). + +There is no need to explicitly add draft-07 meta schema (http://json-schema.org/draft-07/schema) - it is added by default, unless option `meta` is set to `false`. You only need to use it if you have a changed meta-schema that you want to use to validate your schemas. See `validateSchema`. + + +##### .validateSchema(Object schema) -> Boolean + +Validates schema. This method should be used to validate schemas rather than `validate` due to the inconsistency of `uri` format in JSON Schema standard. + +By default this method is called automatically when the schema is added, so you rarely need to use it directly. + +If schema doesn't have `$schema` property, it is validated against draft 6 meta-schema (option `meta` should not be false). + +If schema has `$schema` property, then the schema with this id (that should be previously added) is used to validate passed schema. + +Errors will be available at `ajv.errors`. + + +##### .getSchema(String key) -> Function<Object data> + +Retrieve compiled schema previously added with `addSchema` by the key passed to `addSchema` or by its full reference (id). The returned validating function has `schema` property with the reference to the original schema. + + +##### .removeSchema([Object schema|String key|String ref|RegExp pattern]) -> Ajv + +Remove added/cached schema. Even if schema is referenced by other schemas it can be safely removed as dependent schemas have local references. + +Schema can be removed using: +- key passed to `addSchema` +- it's full reference (id) +- RegExp that should match schema id or key (meta-schemas won't be removed) +- actual schema object that will be stable-stringified to remove schema from cache + +If no parameter is passed all schemas but meta-schemas will be removed and the cache will be cleared. + + +##### .addFormat(String name, String|RegExp|Function|Object format) -> Ajv + +Add custom format to validate strings or numbers. It can also be used to replace pre-defined formats for Ajv instance. + +Strings are converted to RegExp. + +Function should return validation result as `true` or `false`. + +If object is passed it should have properties `validate`, `compare` and `async`: + +- _validate_: a string, RegExp or a function as described above. +- _compare_: an optional comparison function that accepts two strings and compares them according to the format meaning. This function is used with keywords `formatMaximum`/`formatMinimum` (defined in [ajv-keywords](https://github.com/ajv-validator/ajv-keywords) package). It should return `1` if the first value is bigger than the second value, `-1` if it is smaller and `0` if it is equal. +- _async_: an optional `true` value if `validate` is an asynchronous function; in this case it should return a promise that resolves with a value `true` or `false`. +- _type_: an optional type of data that the format applies to. It can be `"string"` (default) or `"number"` (see https://github.com/ajv-validator/ajv/issues/291#issuecomment-259923858). If the type of data is different, the validation will pass. + +Custom formats can be also added via `formats` option. + + +##### .addKeyword(String keyword, Object definition) -> Ajv + +Add custom validation keyword to Ajv instance. + +Keyword should be different from all standard JSON Schema keywords and different from previously defined keywords. There is no way to redefine keywords or to remove keyword definition from the instance. + +Keyword must start with a letter, `_` or `$`, and may continue with letters, numbers, `_`, `$`, or `-`. +It is recommended to use an application-specific prefix for keywords to avoid current and future name collisions. + +Example Keywords: +- `"xyz-example"`: valid, and uses prefix for the xyz project to avoid name collisions. +- `"example"`: valid, but not recommended as it could collide with future versions of JSON Schema etc. +- `"3-example"`: invalid as numbers are not allowed to be the first character in a keyword + +Keyword definition is an object with the following properties: + +- _type_: optional string or array of strings with data type(s) that the keyword applies to. If not present, the keyword will apply to all types. +- _validate_: validating function +- _compile_: compiling function +- _macro_: macro function +- _inline_: compiling function that returns code (as string) +- _schema_: an optional `false` value used with "validate" keyword to not pass schema +- _metaSchema_: an optional meta-schema for keyword schema +- _dependencies_: an optional list of properties that must be present in the parent schema - it will be checked during schema compilation +- _modifying_: `true` MUST be passed if keyword modifies data +- _statements_: `true` can be passed in case inline keyword generates statements (as opposed to expression) +- _valid_: pass `true`/`false` to pre-define validation result, the result returned from validation function will be ignored. This option cannot be used with macro keywords. +- _$data_: an optional `true` value to support [$data reference](#data-reference) as the value of custom keyword. The reference will be resolved at validation time. If the keyword has meta-schema it would be extended to allow $data and it will be used to validate the resolved value. Supporting $data reference requires that keyword has validating function (as the only option or in addition to compile, macro or inline function). +- _async_: an optional `true` value if the validation function is asynchronous (whether it is compiled or passed in _validate_ property); in this case it should return a promise that resolves with a value `true` or `false`. This option is ignored in case of "macro" and "inline" keywords. +- _errors_: an optional boolean or string `"full"` indicating whether keyword returns errors. If this property is not set Ajv will determine if the errors were set in case of failed validation. + +_compile_, _macro_ and _inline_ are mutually exclusive, only one should be used at a time. _validate_ can be used separately or in addition to them to support $data reference. + +__Please note__: If the keyword is validating data type that is different from the type(s) in its definition, the validation function will not be called (and expanded macro will not be used), so there is no need to check for data type inside validation function or inside schema returned by macro function (unless you want to enforce a specific type and for some reason do not want to use a separate `type` keyword for that). In the same way as standard keywords work, if the keyword does not apply to the data type being validated, the validation of this keyword will succeed. + +See [Defining custom keywords](#defining-custom-keywords) for more details. + + +##### .getKeyword(String keyword) -> Object|Boolean + +Returns custom keyword definition, `true` for pre-defined keywords and `false` if the keyword is unknown. + + +##### .removeKeyword(String keyword) -> Ajv + +Removes custom or pre-defined keyword so you can redefine them. + +While this method can be used to extend pre-defined keywords, it can also be used to completely change their meaning - it may lead to unexpected results. + +__Please note__: schemas compiled before the keyword is removed will continue to work without changes. To recompile schemas use `removeSchema` method and compile them again. + + +##### .errorsText([Array<Object> errors [, Object options]]) -> String + +Returns the text with all errors in a String. + +Options can have properties `separator` (string used to separate errors, ", " by default) and `dataVar` (the variable name that dataPaths are prefixed with, "data" by default). + + +## Options + +Defaults: + +```javascript +{ + // validation and reporting options: + $data: false, + allErrors: false, + verbose: false, + $comment: false, // NEW in Ajv version 6.0 + jsonPointers: false, + uniqueItems: true, + unicode: true, + nullable: false, + format: 'fast', + formats: {}, + unknownFormats: true, + schemas: {}, + logger: undefined, + // referenced schema options: + schemaId: '$id', + missingRefs: true, + extendRefs: 'ignore', // recommended 'fail' + loadSchema: undefined, // function(uri: string): Promise {} + // options to modify validated data: + removeAdditional: false, + useDefaults: false, + coerceTypes: false, + // strict mode options + strictDefaults: false, + strictKeywords: false, + strictNumbers: false, + // asynchronous validation options: + transpile: undefined, // requires ajv-async package + // advanced options: + meta: true, + validateSchema: true, + addUsedSchema: true, + inlineRefs: true, + passContext: false, + loopRequired: Infinity, + ownProperties: false, + multipleOfPrecision: false, + errorDataPath: 'object', // deprecated + messages: true, + sourceCode: false, + processCode: undefined, // function (str: string, schema: object): string {} + cache: new Cache, + serialize: undefined +} +``` + +##### Validation and reporting options + +- _$data_: support [$data references](#data-reference). Draft 6 meta-schema that is added by default will be extended to allow them. If you want to use another meta-schema you need to use $dataMetaSchema method to add support for $data reference. See [API](#api). +- _allErrors_: check all rules collecting all errors. Default is to return after the first error. +- _verbose_: include the reference to the part of the schema (`schema` and `parentSchema`) and validated data in errors (false by default). +- _$comment_ (NEW in Ajv version 6.0): log or pass the value of `$comment` keyword to a function. Option values: + - `false` (default): ignore $comment keyword. + - `true`: log the keyword value to console. + - function: pass the keyword value, its schema path and root schema to the specified function +- _jsonPointers_: set `dataPath` property of errors using [JSON Pointers](https://tools.ietf.org/html/rfc6901) instead of JavaScript property access notation. +- _uniqueItems_: validate `uniqueItems` keyword (true by default). +- _unicode_: calculate correct length of strings with unicode pairs (true by default). Pass `false` to use `.length` of strings that is faster, but gives "incorrect" lengths of strings with unicode pairs - each unicode pair is counted as two characters. +- _nullable_: support keyword "nullable" from [Open API 3 specification](https://swagger.io/docs/specification/data-models/data-types/). +- _format_: formats validation mode. Option values: + - `"fast"` (default) - simplified and fast validation (see [Formats](#formats) for details of which formats are available and affected by this option). + - `"full"` - more restrictive and slow validation. E.g., 25:00:00 and 2015/14/33 will be invalid time and date in 'full' mode but it will be valid in 'fast' mode. + - `false` - ignore all format keywords. +- _formats_: an object with custom formats. Keys and values will be passed to `addFormat` method. +- _keywords_: an object with custom keywords. Keys and values will be passed to `addKeyword` method. +- _unknownFormats_: handling of unknown formats. Option values: + - `true` (default) - if an unknown format is encountered the exception is thrown during schema compilation. If `format` keyword value is [$data reference](#data-reference) and it is unknown the validation will fail. + - `[String]` - an array of unknown format names that will be ignored. This option can be used to allow usage of third party schemas with format(s) for which you don't have definitions, but still fail if another unknown format is used. If `format` keyword value is [$data reference](#data-reference) and it is not in this array the validation will fail. + - `"ignore"` - to log warning during schema compilation and always pass validation (the default behaviour in versions before 5.0.0). This option is not recommended, as it allows to mistype format name and it won't be validated without any error message. This behaviour is required by JSON Schema specification. +- _schemas_: an array or object of schemas that will be added to the instance. In case you pass the array the schemas must have IDs in them. When the object is passed the method `addSchema(value, key)` will be called for each schema in this object. +- _logger_: sets the logging method. Default is the global `console` object that should have methods `log`, `warn` and `error`. See [Error logging](#error-logging). Option values: + - custom logger - it should have methods `log`, `warn` and `error`. If any of these methods is missing an exception will be thrown. + - `false` - logging is disabled. + + +##### Referenced schema options + +- _schemaId_: this option defines which keywords are used as schema URI. Option value: + - `"$id"` (default) - only use `$id` keyword as schema URI (as specified in JSON Schema draft-06/07), ignore `id` keyword (if it is present a warning will be logged). + - `"id"` - only use `id` keyword as schema URI (as specified in JSON Schema draft-04), ignore `$id` keyword (if it is present a warning will be logged). + - `"auto"` - use both `$id` and `id` keywords as schema URI. If both are present (in the same schema object) and different the exception will be thrown during schema compilation. +- _missingRefs_: handling of missing referenced schemas. Option values: + - `true` (default) - if the reference cannot be resolved during compilation the exception is thrown. The thrown error has properties `missingRef` (with hash fragment) and `missingSchema` (without it). Both properties are resolved relative to the current base id (usually schema id, unless it was substituted). + - `"ignore"` - to log error during compilation and always pass validation. + - `"fail"` - to log error and successfully compile schema but fail validation if this rule is checked. +- _extendRefs_: validation of other keywords when `$ref` is present in the schema. Option values: + - `"ignore"` (default) - when `$ref` is used other keywords are ignored (as per [JSON Reference](https://tools.ietf.org/html/draft-pbryan-zyp-json-ref-03#section-3) standard). A warning will be logged during the schema compilation. + - `"fail"` (recommended) - if other validation keywords are used together with `$ref` the exception will be thrown when the schema is compiled. This option is recommended to make sure schema has no keywords that are ignored, which can be confusing. + - `true` - validate all keywords in the schemas with `$ref` (the default behaviour in versions before 5.0.0). +- _loadSchema_: asynchronous function that will be used to load remote schemas when `compileAsync` [method](#api-compileAsync) is used and some reference is missing (option `missingRefs` should NOT be 'fail' or 'ignore'). This function should accept remote schema uri as a parameter and return a Promise that resolves to a schema. See example in [Asynchronous compilation](#asynchronous-schema-compilation). + + +##### Options to modify validated data + +- _removeAdditional_: remove additional properties - see example in [Filtering data](#filtering-data). This option is not used if schema is added with `addMetaSchema` method. Option values: + - `false` (default) - not to remove additional properties + - `"all"` - all additional properties are removed, regardless of `additionalProperties` keyword in schema (and no validation is made for them). + - `true` - only additional properties with `additionalProperties` keyword equal to `false` are removed. + - `"failing"` - additional properties that fail schema validation will be removed (where `additionalProperties` keyword is `false` or schema). +- _useDefaults_: replace missing or undefined properties and items with the values from corresponding `default` keywords. Default behaviour is to ignore `default` keywords. This option is not used if schema is added with `addMetaSchema` method. See examples in [Assigning defaults](#assigning-defaults). Option values: + - `false` (default) - do not use defaults + - `true` - insert defaults by value (object literal is used). + - `"empty"` - in addition to missing or undefined, use defaults for properties and items that are equal to `null` or `""` (an empty string). + - `"shared"` (deprecated) - insert defaults by reference. If the default is an object, it will be shared by all instances of validated data. If you modify the inserted default in the validated data, it will be modified in the schema as well. +- _coerceTypes_: change data type of data to match `type` keyword. See the example in [Coercing data types](#coercing-data-types) and [coercion rules](https://github.com/ajv-validator/ajv/blob/master/COERCION.md). Option values: + - `false` (default) - no type coercion. + - `true` - coerce scalar data types. + - `"array"` - in addition to coercions between scalar types, coerce scalar data to an array with one element and vice versa (as required by the schema). + + +##### Strict mode options + +- _strictDefaults_: report ignored `default` keywords in schemas. Option values: + - `false` (default) - ignored defaults are not reported + - `true` - if an ignored default is present, throw an error + - `"log"` - if an ignored default is present, log warning +- _strictKeywords_: report unknown keywords in schemas. Option values: + - `false` (default) - unknown keywords are not reported + - `true` - if an unknown keyword is present, throw an error + - `"log"` - if an unknown keyword is present, log warning +- _strictNumbers_: validate numbers strictly, failing validation for NaN and Infinity. Option values: + - `false` (default) - NaN or Infinity will pass validation for numeric types + - `true` - NaN or Infinity will not pass validation for numeric types + +##### Asynchronous validation options + +- _transpile_: Requires [ajv-async](https://github.com/ajv-validator/ajv-async) package. It determines whether Ajv transpiles compiled asynchronous validation function. Option values: + - `undefined` (default) - transpile with [nodent](https://github.com/MatAtBread/nodent) if async functions are not supported. + - `true` - always transpile with nodent. + - `false` - do not transpile; if async functions are not supported an exception will be thrown. + + +##### Advanced options + +- _meta_: add [meta-schema](http://json-schema.org/documentation.html) so it can be used by other schemas (true by default). If an object is passed, it will be used as the default meta-schema for schemas that have no `$schema` keyword. This default meta-schema MUST have `$schema` keyword. +- _validateSchema_: validate added/compiled schemas against meta-schema (true by default). `$schema` property in the schema can be http://json-schema.org/draft-07/schema or absent (draft-07 meta-schema will be used) or can be a reference to the schema previously added with `addMetaSchema` method. Option values: + - `true` (default) - if the validation fails, throw the exception. + - `"log"` - if the validation fails, log error. + - `false` - skip schema validation. +- _addUsedSchema_: by default methods `compile` and `validate` add schemas to the instance if they have `$id` (or `id`) property that doesn't start with "#". If `$id` is present and it is not unique the exception will be thrown. Set this option to `false` to skip adding schemas to the instance and the `$id` uniqueness check when these methods are used. This option does not affect `addSchema` method. +- _inlineRefs_: Affects compilation of referenced schemas. Option values: + - `true` (default) - the referenced schemas that don't have refs in them are inlined, regardless of their size - that substantially improves performance at the cost of the bigger size of compiled schema functions. + - `false` - to not inline referenced schemas (they will be compiled as separate functions). + - integer number - to limit the maximum number of keywords of the schema that will be inlined. +- _passContext_: pass validation context to custom keyword functions. If this option is `true` and you pass some context to the compiled validation function with `validate.call(context, data)`, the `context` will be available as `this` in your custom keywords. By default `this` is Ajv instance. +- _loopRequired_: by default `required` keyword is compiled into a single expression (or a sequence of statements in `allErrors` mode). In case of a very large number of properties in this keyword it may result in a very big validation function. Pass integer to set the number of properties above which `required` keyword will be validated in a loop - smaller validation function size but also worse performance. +- _ownProperties_: by default Ajv iterates over all enumerable object properties; when this option is `true` only own enumerable object properties (i.e. found directly on the object rather than on its prototype) are iterated. Contributed by @mbroadst. +- _multipleOfPrecision_: by default `multipleOf` keyword is validated by comparing the result of division with parseInt() of that result. It works for dividers that are bigger than 1. For small dividers such as 0.01 the result of the division is usually not integer (even when it should be integer, see issue [#84](https://github.com/ajv-validator/ajv/issues/84)). If you need to use fractional dividers set this option to some positive integer N to have `multipleOf` validated using this formula: `Math.abs(Math.round(division) - division) < 1e-N` (it is slower but allows for float arithmetics deviations). +- _errorDataPath_ (deprecated): set `dataPath` to point to 'object' (default) or to 'property' when validating keywords `required`, `additionalProperties` and `dependencies`. +- _messages_: Include human-readable messages in errors. `true` by default. `false` can be passed when custom messages are used (e.g. with [ajv-i18n](https://github.com/ajv-validator/ajv-i18n)). +- _sourceCode_: add `sourceCode` property to validating function (for debugging; this code can be different from the result of toString call). +- _processCode_: an optional function to process generated code before it is passed to Function constructor. It can be used to either beautify (the validating function is generated without line-breaks) or to transpile code. Starting from version 5.0.0 this option replaced options: + - `beautify` that formatted the generated function using [js-beautify](https://github.com/beautify-web/js-beautify). If you want to beautify the generated code pass a function calling `require('js-beautify').js_beautify` as `processCode: code => js_beautify(code)`. + - `transpile` that transpiled asynchronous validation function. You can still use `transpile` option with [ajv-async](https://github.com/ajv-validator/ajv-async) package. See [Asynchronous validation](#asynchronous-validation) for more information. +- _cache_: an optional instance of cache to store compiled schemas using stable-stringified schema as a key. For example, set-associative cache [sacjs](https://github.com/epoberezkin/sacjs) can be used. If not passed then a simple hash is used which is good enough for the common use case (a limited number of statically defined schemas). Cache should have methods `put(key, value)`, `get(key)`, `del(key)` and `clear()`. +- _serialize_: an optional function to serialize schema to cache key. Pass `false` to use schema itself as a key (e.g., if WeakMap used as a cache). By default [fast-json-stable-stringify](https://github.com/epoberezkin/fast-json-stable-stringify) is used. + + +## Validation errors + +In case of validation failure, Ajv assigns the array of errors to `errors` property of validation function (or to `errors` property of Ajv instance when `validate` or `validateSchema` methods were called). In case of [asynchronous validation](#asynchronous-validation), the returned promise is rejected with exception `Ajv.ValidationError` that has `errors` property. + + +### Error objects + +Each error is an object with the following properties: + +- _keyword_: validation keyword. +- _dataPath_: the path to the part of the data that was validated. By default `dataPath` uses JavaScript property access notation (e.g., `".prop[1].subProp"`). When the option `jsonPointers` is true (see [Options](#options)) `dataPath` will be set using JSON pointer standard (e.g., `"/prop/1/subProp"`). +- _schemaPath_: the path (JSON-pointer as a URI fragment) to the schema of the keyword that failed validation. +- _params_: the object with the additional information about error that can be used to create custom error messages (e.g., using [ajv-i18n](https://github.com/ajv-validator/ajv-i18n) package). See below for parameters set by all keywords. +- _message_: the standard error message (can be excluded with option `messages` set to false). +- _schema_: the schema of the keyword (added with `verbose` option). +- _parentSchema_: the schema containing the keyword (added with `verbose` option) +- _data_: the data validated by the keyword (added with `verbose` option). + +__Please note__: `propertyNames` keyword schema validation errors have an additional property `propertyName`, `dataPath` points to the object. After schema validation for each property name, if it is invalid an additional error is added with the property `keyword` equal to `"propertyNames"`. + + +### Error parameters + +Properties of `params` object in errors depend on the keyword that failed validation. + +- `maxItems`, `minItems`, `maxLength`, `minLength`, `maxProperties`, `minProperties` - property `limit` (number, the schema of the keyword). +- `additionalItems` - property `limit` (the maximum number of allowed items in case when `items` keyword is an array of schemas and `additionalItems` is false). +- `additionalProperties` - property `additionalProperty` (the property not used in `properties` and `patternProperties` keywords). +- `dependencies` - properties: + - `property` (dependent property), + - `missingProperty` (required missing dependency - only the first one is reported currently) + - `deps` (required dependencies, comma separated list as a string), + - `depsCount` (the number of required dependencies). +- `format` - property `format` (the schema of the keyword). +- `maximum`, `minimum` - properties: + - `limit` (number, the schema of the keyword), + - `exclusive` (boolean, the schema of `exclusiveMaximum` or `exclusiveMinimum`), + - `comparison` (string, comparison operation to compare the data to the limit, with the data on the left and the limit on the right; can be "<", "<=", ">", ">=") +- `multipleOf` - property `multipleOf` (the schema of the keyword) +- `pattern` - property `pattern` (the schema of the keyword) +- `required` - property `missingProperty` (required property that is missing). +- `propertyNames` - property `propertyName` (an invalid property name). +- `patternRequired` (in ajv-keywords) - property `missingPattern` (required pattern that did not match any property). +- `type` - property `type` (required type(s), a string, can be a comma-separated list) +- `uniqueItems` - properties `i` and `j` (indices of duplicate items). +- `const` - property `allowedValue` pointing to the value (the schema of the keyword). +- `enum` - property `allowedValues` pointing to the array of values (the schema of the keyword). +- `$ref` - property `ref` with the referenced schema URI. +- `oneOf` - property `passingSchemas` (array of indices of passing schemas, null if no schema passes). +- custom keywords (in case keyword definition doesn't create errors) - property `keyword` (the keyword name). + + +### Error logging + +Using the `logger` option when initiallizing Ajv will allow you to define custom logging. Here you can build upon the exisiting logging. The use of other logging packages is supported as long as the package or its associated wrapper exposes the required methods. If any of the required methods are missing an exception will be thrown. +- **Required Methods**: `log`, `warn`, `error` + +```javascript +var otherLogger = new OtherLogger(); +var ajv = new Ajv({ + logger: { + log: console.log.bind(console), + warn: function warn() { + otherLogger.logWarn.apply(otherLogger, arguments); + }, + error: function error() { + otherLogger.logError.apply(otherLogger, arguments); + console.error.apply(console, arguments); + } + } +}); +``` + + +## Plugins + +Ajv can be extended with plugins that add custom keywords, formats or functions to process generated code. When such plugin is published as npm package it is recommended that it follows these conventions: + +- it exports a function +- this function accepts ajv instance as the first parameter and returns the same instance to allow chaining +- this function can accept an optional configuration as the second parameter + +If you have published a useful plugin please submit a PR to add it to the next section. + + +## Related packages + +- [ajv-async](https://github.com/ajv-validator/ajv-async) - plugin to configure async validation mode +- [ajv-bsontype](https://github.com/BoLaMN/ajv-bsontype) - plugin to validate mongodb's bsonType formats +- [ajv-cli](https://github.com/jessedc/ajv-cli) - command line interface +- [ajv-errors](https://github.com/ajv-validator/ajv-errors) - plugin for custom error messages +- [ajv-i18n](https://github.com/ajv-validator/ajv-i18n) - internationalised error messages +- [ajv-istanbul](https://github.com/ajv-validator/ajv-istanbul) - plugin to instrument generated validation code to measure test coverage of your schemas +- [ajv-keywords](https://github.com/ajv-validator/ajv-keywords) - plugin with custom validation keywords (select, typeof, etc.) +- [ajv-merge-patch](https://github.com/ajv-validator/ajv-merge-patch) - plugin with keywords $merge and $patch +- [ajv-pack](https://github.com/ajv-validator/ajv-pack) - produces a compact module exporting validation functions +- [ajv-formats-draft2019](https://github.com/luzlab/ajv-formats-draft2019) - format validators for draft2019 that aren't already included in ajv (ie. `idn-hostname`, `idn-email`, `iri`, `iri-reference` and `duration`). + +## Some packages using Ajv + +- [webpack](https://github.com/webpack/webpack) - a module bundler. Its main purpose is to bundle JavaScript files for usage in a browser +- [jsonscript-js](https://github.com/JSONScript/jsonscript-js) - the interpreter for [JSONScript](http://www.jsonscript.org) - scripted processing of existing endpoints and services +- [osprey-method-handler](https://github.com/mulesoft-labs/osprey-method-handler) - Express middleware for validating requests and responses based on a RAML method object, used in [osprey](https://github.com/mulesoft/osprey) - validating API proxy generated from a RAML definition +- [har-validator](https://github.com/ahmadnassri/har-validator) - HTTP Archive (HAR) validator +- [jsoneditor](https://github.com/josdejong/jsoneditor) - a web-based tool to view, edit, format, and validate JSON http://jsoneditoronline.org +- [JSON Schema Lint](https://github.com/nickcmaynard/jsonschemalint) - a web tool to validate JSON/YAML document against a single JSON Schema http://jsonschemalint.com +- [objection](https://github.com/vincit/objection.js) - SQL-friendly ORM for Node.js +- [table](https://github.com/gajus/table) - formats data into a string table +- [ripple-lib](https://github.com/ripple/ripple-lib) - a JavaScript API for interacting with [Ripple](https://ripple.com) in Node.js and the browser +- [restbase](https://github.com/wikimedia/restbase) - distributed storage with REST API & dispatcher for backend services built to provide a low-latency & high-throughput API for Wikipedia / Wikimedia content +- [hippie-swagger](https://github.com/CacheControl/hippie-swagger) - [Hippie](https://github.com/vesln/hippie) wrapper that provides end to end API testing with swagger validation +- [react-form-controlled](https://github.com/seeden/react-form-controlled) - React controlled form components with validation +- [rabbitmq-schema](https://github.com/tjmehta/rabbitmq-schema) - a schema definition module for RabbitMQ graphs and messages +- [@query/schema](https://www.npmjs.com/package/@query/schema) - stream filtering with a URI-safe query syntax parsing to JSON Schema +- [chai-ajv-json-schema](https://github.com/peon374/chai-ajv-json-schema) - chai plugin to us JSON Schema with expect in mocha tests +- [grunt-jsonschema-ajv](https://github.com/SignpostMarv/grunt-jsonschema-ajv) - Grunt plugin for validating files against JSON Schema +- [extract-text-webpack-plugin](https://github.com/webpack-contrib/extract-text-webpack-plugin) - extract text from bundle into a file +- [electron-builder](https://github.com/electron-userland/electron-builder) - a solution to package and build a ready for distribution Electron app +- [addons-linter](https://github.com/mozilla/addons-linter) - Mozilla Add-ons Linter +- [gh-pages-generator](https://github.com/epoberezkin/gh-pages-generator) - multi-page site generator converting markdown files to GitHub pages +- [ESLint](https://github.com/eslint/eslint) - the pluggable linting utility for JavaScript and JSX + + +## Tests + +``` +npm install +git submodule update --init +npm test +``` + +## Contributing + +All validation functions are generated using doT templates in [dot](https://github.com/ajv-validator/ajv/tree/master/lib/dot) folder. Templates are precompiled so doT is not a run-time dependency. + +`npm run build` - compiles templates to [dotjs](https://github.com/ajv-validator/ajv/tree/master/lib/dotjs) folder. + +`npm run watch` - automatically compiles templates when files in dot folder change + +Please see [Contributing guidelines](https://github.com/ajv-validator/ajv/blob/master/CONTRIBUTING.md) + + +## Changes history + +See https://github.com/ajv-validator/ajv/releases + +__Please note__: [Changes in version 7.0.0-beta](https://github.com/ajv-validator/ajv/releases/tag/v7.0.0-beta.0) + +[Version 6.0.0](https://github.com/ajv-validator/ajv/releases/tag/v6.0.0). + +## Code of conduct + +Please review and follow the [Code of conduct](https://github.com/ajv-validator/ajv/blob/master/CODE_OF_CONDUCT.md). + +Please report any unacceptable behaviour to ajv.validator@gmail.com - it will be reviewed by the project team. + + +## Open-source software support + +Ajv is a part of [Tidelift subscription](https://tidelift.com/subscription/pkg/npm-ajv?utm_source=npm-ajv&utm_medium=referral&utm_campaign=readme) - it provides a centralised support to open-source software users, in addition to the support provided by software maintainers. + + +## License + +[MIT](https://github.com/ajv-validator/ajv/blob/master/LICENSE) diff --git a/packages/字体精简工具/node_modules/ajv/dist/ajv.bundle.js b/packages/字体精简工具/node_modules/ajv/dist/ajv.bundle.js new file mode 100644 index 0000000..e4d9d15 --- /dev/null +++ b/packages/字体精简工具/node_modules/ajv/dist/ajv.bundle.js @@ -0,0 +1,7189 @@ +(function(f){if(typeof exports==="object"&&typeof module!=="undefined"){module.exports=f()}else if(typeof define==="function"&&define.amd){define([],f)}else{var g;if(typeof window!=="undefined"){g=window}else if(typeof global!=="undefined"){g=global}else if(typeof self!=="undefined"){g=self}else{g=this}g.Ajv = f()}})(function(){var define,module,exports;return (function(){function r(e,n,t){function o(i,f){if(!n[i]){if(!e[i]){var c="function"==typeof require&&require;if(!f&&c)return c(i,!0);if(u)return u(i,!0);var a=new Error("Cannot find module '"+i+"'");throw a.code="MODULE_NOT_FOUND",a}var p=n[i]={exports:{}};e[i][0].call(p.exports,function(r){var n=e[i][1][r];return o(n||r)},p,p.exports,r,e,n,t)}return n[i].exports}for(var u="function"==typeof require&&require,i=0;i%\\^`{|}]|%[0-9a-f]{2})|\{[+#./;?&=,!@|]?(?:[a-z0-9_]|%[0-9a-f]{2})+(?::[1-9][0-9]{0,3}|\*)?(?:,(?:[a-z0-9_]|%[0-9a-f]{2})+(?::[1-9][0-9]{0,3}|\*)?)*\})*$/i; +// For the source: https://gist.github.com/dperini/729294 +// For test cases: https://mathiasbynens.be/demo/url-regex +// @todo Delete current URL in favour of the commented out URL rule when this issue is fixed https://github.com/eslint/eslint/issues/7983. +// var URL = /^(?:(?:https?|ftp):\/\/)(?:\S+(?::\S*)?@)?(?:(?!10(?:\.\d{1,3}){3})(?!127(?:\.\d{1,3}){3})(?!169\.254(?:\.\d{1,3}){2})(?!192\.168(?:\.\d{1,3}){2})(?!172\.(?:1[6-9]|2\d|3[0-1])(?:\.\d{1,3}){2})(?:[1-9]\d?|1\d\d|2[01]\d|22[0-3])(?:\.(?:1?\d{1,2}|2[0-4]\d|25[0-5])){2}(?:\.(?:[1-9]\d?|1\d\d|2[0-4]\d|25[0-4]))|(?:(?:[a-z\u{00a1}-\u{ffff}0-9]+-)*[a-z\u{00a1}-\u{ffff}0-9]+)(?:\.(?:[a-z\u{00a1}-\u{ffff}0-9]+-)*[a-z\u{00a1}-\u{ffff}0-9]+)*(?:\.(?:[a-z\u{00a1}-\u{ffff}]{2,})))(?::\d{2,5})?(?:\/[^\s]*)?$/iu; +var URL = /^(?:(?:http[s\u017F]?|ftp):\/\/)(?:(?:[\0-\x08\x0E-\x1F!-\x9F\xA1-\u167F\u1681-\u1FFF\u200B-\u2027\u202A-\u202E\u2030-\u205E\u2060-\u2FFF\u3001-\uD7FF\uE000-\uFEFE\uFF00-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])+(?::(?:[\0-\x08\x0E-\x1F!-\x9F\xA1-\u167F\u1681-\u1FFF\u200B-\u2027\u202A-\u202E\u2030-\u205E\u2060-\u2FFF\u3001-\uD7FF\uE000-\uFEFE\uFF00-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])*)?@)?(?:(?!10(?:\.[0-9]{1,3}){3})(?!127(?:\.[0-9]{1,3}){3})(?!169\.254(?:\.[0-9]{1,3}){2})(?!192\.168(?:\.[0-9]{1,3}){2})(?!172\.(?:1[6-9]|2[0-9]|3[01])(?:\.[0-9]{1,3}){2})(?:[1-9][0-9]?|1[0-9][0-9]|2[01][0-9]|22[0-3])(?:\.(?:1?[0-9]{1,2}|2[0-4][0-9]|25[0-5])){2}(?:\.(?:[1-9][0-9]?|1[0-9][0-9]|2[0-4][0-9]|25[0-4]))|(?:(?:(?:[0-9a-z\xA1-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])+-)*(?:[0-9a-z\xA1-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])+)(?:\.(?:(?:[0-9a-z\xA1-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])+-)*(?:[0-9a-z\xA1-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])+)*(?:\.(?:(?:[a-z\xA1-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]){2,})))(?::[0-9]{2,5})?(?:\/(?:[\0-\x08\x0E-\x1F!-\x9F\xA1-\u167F\u1681-\u1FFF\u200B-\u2027\u202A-\u202E\u2030-\u205E\u2060-\u2FFF\u3001-\uD7FF\uE000-\uFEFE\uFF00-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])*)?$/i; +var UUID = /^(?:urn:uuid:)?[0-9a-f]{8}-(?:[0-9a-f]{4}-){3}[0-9a-f]{12}$/i; +var JSON_POINTER = /^(?:\/(?:[^~/]|~0|~1)*)*$/; +var JSON_POINTER_URI_FRAGMENT = /^#(?:\/(?:[a-z0-9_\-.!$&'()*+,;:=@]|%[0-9a-f]{2}|~0|~1)*)*$/i; +var RELATIVE_JSON_POINTER = /^(?:0|[1-9][0-9]*)(?:#|(?:\/(?:[^~/]|~0|~1)*)*)$/; + + +module.exports = formats; + +function formats(mode) { + mode = mode == 'full' ? 'full' : 'fast'; + return util.copy(formats[mode]); +} + + +formats.fast = { + // date: http://tools.ietf.org/html/rfc3339#section-5.6 + date: /^\d\d\d\d-[0-1]\d-[0-3]\d$/, + // date-time: http://tools.ietf.org/html/rfc3339#section-5.6 + time: /^(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)?$/i, + 'date-time': /^\d\d\d\d-[0-1]\d-[0-3]\d[t\s](?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)$/i, + // uri: https://github.com/mafintosh/is-my-json-valid/blob/master/formats.js + uri: /^(?:[a-z][a-z0-9+\-.]*:)(?:\/?\/)?[^\s]*$/i, + 'uri-reference': /^(?:(?:[a-z][a-z0-9+\-.]*:)?\/?\/)?(?:[^\\\s#][^\s#]*)?(?:#[^\\\s]*)?$/i, + 'uri-template': URITEMPLATE, + url: URL, + // email (sources from jsen validator): + // http://stackoverflow.com/questions/201323/using-a-regular-expression-to-validate-an-email-address#answer-8829363 + // http://www.w3.org/TR/html5/forms.html#valid-e-mail-address (search for 'willful violation') + email: /^[a-z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?(?:\.[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?)*$/i, + hostname: HOSTNAME, + // optimized https://www.safaribooksonline.com/library/view/regular-expressions-cookbook/9780596802837/ch07s16.html + ipv4: /^(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?)$/, + // optimized http://stackoverflow.com/questions/53497/regular-expression-that-matches-valid-ipv6-addresses + ipv6: /^\s*(?:(?:(?:[0-9a-f]{1,4}:){7}(?:[0-9a-f]{1,4}|:))|(?:(?:[0-9a-f]{1,4}:){6}(?::[0-9a-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(?:(?:[0-9a-f]{1,4}:){5}(?:(?:(?::[0-9a-f]{1,4}){1,2})|:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(?:(?:[0-9a-f]{1,4}:){4}(?:(?:(?::[0-9a-f]{1,4}){1,3})|(?:(?::[0-9a-f]{1,4})?:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(?:(?:[0-9a-f]{1,4}:){3}(?:(?:(?::[0-9a-f]{1,4}){1,4})|(?:(?::[0-9a-f]{1,4}){0,2}:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(?:(?:[0-9a-f]{1,4}:){2}(?:(?:(?::[0-9a-f]{1,4}){1,5})|(?:(?::[0-9a-f]{1,4}){0,3}:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(?:(?:[0-9a-f]{1,4}:){1}(?:(?:(?::[0-9a-f]{1,4}){1,6})|(?:(?::[0-9a-f]{1,4}){0,4}:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(?::(?:(?:(?::[0-9a-f]{1,4}){1,7})|(?:(?::[0-9a-f]{1,4}){0,5}:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:)))(?:%.+)?\s*$/i, + regex: regex, + // uuid: http://tools.ietf.org/html/rfc4122 + uuid: UUID, + // JSON-pointer: https://tools.ietf.org/html/rfc6901 + // uri fragment: https://tools.ietf.org/html/rfc3986#appendix-A + 'json-pointer': JSON_POINTER, + 'json-pointer-uri-fragment': JSON_POINTER_URI_FRAGMENT, + // relative JSON-pointer: http://tools.ietf.org/html/draft-luff-relative-json-pointer-00 + 'relative-json-pointer': RELATIVE_JSON_POINTER +}; + + +formats.full = { + date: date, + time: time, + 'date-time': date_time, + uri: uri, + 'uri-reference': URIREF, + 'uri-template': URITEMPLATE, + url: URL, + email: /^[a-z0-9!#$%&'*+/=?^_`{|}~-]+(?:\.[a-z0-9!#$%&'*+/=?^_`{|}~-]+)*@(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\.)+[a-z0-9](?:[a-z0-9-]*[a-z0-9])?$/i, + hostname: HOSTNAME, + ipv4: /^(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?)$/, + ipv6: /^\s*(?:(?:(?:[0-9a-f]{1,4}:){7}(?:[0-9a-f]{1,4}|:))|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d)){3}))|:)))(?:%.+)?\s*$/i, + regex: regex, + uuid: UUID, + 'json-pointer': JSON_POINTER, + 'json-pointer-uri-fragment': JSON_POINTER_URI_FRAGMENT, + 'relative-json-pointer': RELATIVE_JSON_POINTER +}; + + +function isLeapYear(year) { + // https://tools.ietf.org/html/rfc3339#appendix-C + return year % 4 === 0 && (year % 100 !== 0 || year % 400 === 0); +} + + +function date(str) { + // full-date from http://tools.ietf.org/html/rfc3339#section-5.6 + var matches = str.match(DATE); + if (!matches) return false; + + var year = +matches[1]; + var month = +matches[2]; + var day = +matches[3]; + + return month >= 1 && month <= 12 && day >= 1 && + day <= (month == 2 && isLeapYear(year) ? 29 : DAYS[month]); +} + + +function time(str, full) { + var matches = str.match(TIME); + if (!matches) return false; + + var hour = matches[1]; + var minute = matches[2]; + var second = matches[3]; + var timeZone = matches[5]; + return ((hour <= 23 && minute <= 59 && second <= 59) || + (hour == 23 && minute == 59 && second == 60)) && + (!full || timeZone); +} + + +var DATE_TIME_SEPARATOR = /t|\s/i; +function date_time(str) { + // http://tools.ietf.org/html/rfc3339#section-5.6 + var dateTime = str.split(DATE_TIME_SEPARATOR); + return dateTime.length == 2 && date(dateTime[0]) && time(dateTime[1], true); +} + + +var NOT_URI_FRAGMENT = /\/|:/; +function uri(str) { + // http://jmrware.com/articles/2009/uri_regexp/URI_regex.html + optional protocol + required "." + return NOT_URI_FRAGMENT.test(str) && URI.test(str); +} + + +var Z_ANCHOR = /[^\\]\\Z/; +function regex(str) { + if (Z_ANCHOR.test(str)) return false; + try { + new RegExp(str); + return true; + } catch(e) { + return false; + } +} + +},{"./util":10}],5:[function(require,module,exports){ +'use strict'; + +var resolve = require('./resolve') + , util = require('./util') + , errorClasses = require('./error_classes') + , stableStringify = require('fast-json-stable-stringify'); + +var validateGenerator = require('../dotjs/validate'); + +/** + * Functions below are used inside compiled validations function + */ + +var ucs2length = util.ucs2length; +var equal = require('fast-deep-equal'); + +// this error is thrown by async schemas to return validation errors via exception +var ValidationError = errorClasses.Validation; + +module.exports = compile; + + +/** + * Compiles schema to validation function + * @this Ajv + * @param {Object} schema schema object + * @param {Object} root object with information about the root schema for this schema + * @param {Object} localRefs the hash of local references inside the schema (created by resolve.id), used for inline resolution + * @param {String} baseId base ID for IDs in the schema + * @return {Function} validation function + */ +function compile(schema, root, localRefs, baseId) { + /* jshint validthis: true, evil: true */ + /* eslint no-shadow: 0 */ + var self = this + , opts = this._opts + , refVal = [ undefined ] + , refs = {} + , patterns = [] + , patternsHash = {} + , defaults = [] + , defaultsHash = {} + , customRules = []; + + root = root || { schema: schema, refVal: refVal, refs: refs }; + + var c = checkCompiling.call(this, schema, root, baseId); + var compilation = this._compilations[c.index]; + if (c.compiling) return (compilation.callValidate = callValidate); + + var formats = this._formats; + var RULES = this.RULES; + + try { + var v = localCompile(schema, root, localRefs, baseId); + compilation.validate = v; + var cv = compilation.callValidate; + if (cv) { + cv.schema = v.schema; + cv.errors = null; + cv.refs = v.refs; + cv.refVal = v.refVal; + cv.root = v.root; + cv.$async = v.$async; + if (opts.sourceCode) cv.source = v.source; + } + return v; + } finally { + endCompiling.call(this, schema, root, baseId); + } + + /* @this {*} - custom context, see passContext option */ + function callValidate() { + /* jshint validthis: true */ + var validate = compilation.validate; + var result = validate.apply(this, arguments); + callValidate.errors = validate.errors; + return result; + } + + function localCompile(_schema, _root, localRefs, baseId) { + var isRoot = !_root || (_root && _root.schema == _schema); + if (_root.schema != root.schema) + return compile.call(self, _schema, _root, localRefs, baseId); + + var $async = _schema.$async === true; + + var sourceCode = validateGenerator({ + isTop: true, + schema: _schema, + isRoot: isRoot, + baseId: baseId, + root: _root, + schemaPath: '', + errSchemaPath: '#', + errorPath: '""', + MissingRefError: errorClasses.MissingRef, + RULES: RULES, + validate: validateGenerator, + util: util, + resolve: resolve, + resolveRef: resolveRef, + usePattern: usePattern, + useDefault: useDefault, + useCustomRule: useCustomRule, + opts: opts, + formats: formats, + logger: self.logger, + self: self + }); + + sourceCode = vars(refVal, refValCode) + vars(patterns, patternCode) + + vars(defaults, defaultCode) + vars(customRules, customRuleCode) + + sourceCode; + + if (opts.processCode) sourceCode = opts.processCode(sourceCode, _schema); + // console.log('\n\n\n *** \n', JSON.stringify(sourceCode)); + var validate; + try { + var makeValidate = new Function( + 'self', + 'RULES', + 'formats', + 'root', + 'refVal', + 'defaults', + 'customRules', + 'equal', + 'ucs2length', + 'ValidationError', + sourceCode + ); + + validate = makeValidate( + self, + RULES, + formats, + root, + refVal, + defaults, + customRules, + equal, + ucs2length, + ValidationError + ); + + refVal[0] = validate; + } catch(e) { + self.logger.error('Error compiling schema, function code:', sourceCode); + throw e; + } + + validate.schema = _schema; + validate.errors = null; + validate.refs = refs; + validate.refVal = refVal; + validate.root = isRoot ? validate : _root; + if ($async) validate.$async = true; + if (opts.sourceCode === true) { + validate.source = { + code: sourceCode, + patterns: patterns, + defaults: defaults + }; + } + + return validate; + } + + function resolveRef(baseId, ref, isRoot) { + ref = resolve.url(baseId, ref); + var refIndex = refs[ref]; + var _refVal, refCode; + if (refIndex !== undefined) { + _refVal = refVal[refIndex]; + refCode = 'refVal[' + refIndex + ']'; + return resolvedRef(_refVal, refCode); + } + if (!isRoot && root.refs) { + var rootRefId = root.refs[ref]; + if (rootRefId !== undefined) { + _refVal = root.refVal[rootRefId]; + refCode = addLocalRef(ref, _refVal); + return resolvedRef(_refVal, refCode); + } + } + + refCode = addLocalRef(ref); + var v = resolve.call(self, localCompile, root, ref); + if (v === undefined) { + var localSchema = localRefs && localRefs[ref]; + if (localSchema) { + v = resolve.inlineRef(localSchema, opts.inlineRefs) + ? localSchema + : compile.call(self, localSchema, root, localRefs, baseId); + } + } + + if (v === undefined) { + removeLocalRef(ref); + } else { + replaceLocalRef(ref, v); + return resolvedRef(v, refCode); + } + } + + function addLocalRef(ref, v) { + var refId = refVal.length; + refVal[refId] = v; + refs[ref] = refId; + return 'refVal' + refId; + } + + function removeLocalRef(ref) { + delete refs[ref]; + } + + function replaceLocalRef(ref, v) { + var refId = refs[ref]; + refVal[refId] = v; + } + + function resolvedRef(refVal, code) { + return typeof refVal == 'object' || typeof refVal == 'boolean' + ? { code: code, schema: refVal, inline: true } + : { code: code, $async: refVal && !!refVal.$async }; + } + + function usePattern(regexStr) { + var index = patternsHash[regexStr]; + if (index === undefined) { + index = patternsHash[regexStr] = patterns.length; + patterns[index] = regexStr; + } + return 'pattern' + index; + } + + function useDefault(value) { + switch (typeof value) { + case 'boolean': + case 'number': + return '' + value; + case 'string': + return util.toQuotedString(value); + case 'object': + if (value === null) return 'null'; + var valueStr = stableStringify(value); + var index = defaultsHash[valueStr]; + if (index === undefined) { + index = defaultsHash[valueStr] = defaults.length; + defaults[index] = value; + } + return 'default' + index; + } + } + + function useCustomRule(rule, schema, parentSchema, it) { + if (self._opts.validateSchema !== false) { + var deps = rule.definition.dependencies; + if (deps && !deps.every(function(keyword) { + return Object.prototype.hasOwnProperty.call(parentSchema, keyword); + })) + throw new Error('parent schema must have all required keywords: ' + deps.join(',')); + + var validateSchema = rule.definition.validateSchema; + if (validateSchema) { + var valid = validateSchema(schema); + if (!valid) { + var message = 'keyword schema is invalid: ' + self.errorsText(validateSchema.errors); + if (self._opts.validateSchema == 'log') self.logger.error(message); + else throw new Error(message); + } + } + } + + var compile = rule.definition.compile + , inline = rule.definition.inline + , macro = rule.definition.macro; + + var validate; + if (compile) { + validate = compile.call(self, schema, parentSchema, it); + } else if (macro) { + validate = macro.call(self, schema, parentSchema, it); + if (opts.validateSchema !== false) self.validateSchema(validate, true); + } else if (inline) { + validate = inline.call(self, it, rule.keyword, schema, parentSchema); + } else { + validate = rule.definition.validate; + if (!validate) return; + } + + if (validate === undefined) + throw new Error('custom keyword "' + rule.keyword + '"failed to compile'); + + var index = customRules.length; + customRules[index] = validate; + + return { + code: 'customRule' + index, + validate: validate + }; + } +} + + +/** + * Checks if the schema is currently compiled + * @this Ajv + * @param {Object} schema schema to compile + * @param {Object} root root object + * @param {String} baseId base schema ID + * @return {Object} object with properties "index" (compilation index) and "compiling" (boolean) + */ +function checkCompiling(schema, root, baseId) { + /* jshint validthis: true */ + var index = compIndex.call(this, schema, root, baseId); + if (index >= 0) return { index: index, compiling: true }; + index = this._compilations.length; + this._compilations[index] = { + schema: schema, + root: root, + baseId: baseId + }; + return { index: index, compiling: false }; +} + + +/** + * Removes the schema from the currently compiled list + * @this Ajv + * @param {Object} schema schema to compile + * @param {Object} root root object + * @param {String} baseId base schema ID + */ +function endCompiling(schema, root, baseId) { + /* jshint validthis: true */ + var i = compIndex.call(this, schema, root, baseId); + if (i >= 0) this._compilations.splice(i, 1); +} + + +/** + * Index of schema compilation in the currently compiled list + * @this Ajv + * @param {Object} schema schema to compile + * @param {Object} root root object + * @param {String} baseId base schema ID + * @return {Integer} compilation index + */ +function compIndex(schema, root, baseId) { + /* jshint validthis: true */ + for (var i=0; i= 0xD800 && value <= 0xDBFF && pos < len) { + // high surrogate, and there is a next character + value = str.charCodeAt(pos); + if ((value & 0xFC00) == 0xDC00) pos++; // low surrogate + } + } + return length; +}; + +},{}],10:[function(require,module,exports){ +'use strict'; + + +module.exports = { + copy: copy, + checkDataType: checkDataType, + checkDataTypes: checkDataTypes, + coerceToTypes: coerceToTypes, + toHash: toHash, + getProperty: getProperty, + escapeQuotes: escapeQuotes, + equal: require('fast-deep-equal'), + ucs2length: require('./ucs2length'), + varOccurences: varOccurences, + varReplace: varReplace, + schemaHasRules: schemaHasRules, + schemaHasRulesExcept: schemaHasRulesExcept, + schemaUnknownRules: schemaUnknownRules, + toQuotedString: toQuotedString, + getPathExpr: getPathExpr, + getPath: getPath, + getData: getData, + unescapeFragment: unescapeFragment, + unescapeJsonPointer: unescapeJsonPointer, + escapeFragment: escapeFragment, + escapeJsonPointer: escapeJsonPointer +}; + + +function copy(o, to) { + to = to || {}; + for (var key in o) to[key] = o[key]; + return to; +} + + +function checkDataType(dataType, data, strictNumbers, negate) { + var EQUAL = negate ? ' !== ' : ' === ' + , AND = negate ? ' || ' : ' && ' + , OK = negate ? '!' : '' + , NOT = negate ? '' : '!'; + switch (dataType) { + case 'null': return data + EQUAL + 'null'; + case 'array': return OK + 'Array.isArray(' + data + ')'; + case 'object': return '(' + OK + data + AND + + 'typeof ' + data + EQUAL + '"object"' + AND + + NOT + 'Array.isArray(' + data + '))'; + case 'integer': return '(typeof ' + data + EQUAL + '"number"' + AND + + NOT + '(' + data + ' % 1)' + + AND + data + EQUAL + data + + (strictNumbers ? (AND + OK + 'isFinite(' + data + ')') : '') + ')'; + case 'number': return '(typeof ' + data + EQUAL + '"' + dataType + '"' + + (strictNumbers ? (AND + OK + 'isFinite(' + data + ')') : '') + ')'; + default: return 'typeof ' + data + EQUAL + '"' + dataType + '"'; + } +} + + +function checkDataTypes(dataTypes, data, strictNumbers) { + switch (dataTypes.length) { + case 1: return checkDataType(dataTypes[0], data, strictNumbers, true); + default: + var code = ''; + var types = toHash(dataTypes); + if (types.array && types.object) { + code = types.null ? '(': '(!' + data + ' || '; + code += 'typeof ' + data + ' !== "object")'; + delete types.null; + delete types.array; + delete types.object; + } + if (types.number) delete types.integer; + for (var t in types) + code += (code ? ' && ' : '' ) + checkDataType(t, data, strictNumbers, true); + + return code; + } +} + + +var COERCE_TO_TYPES = toHash([ 'string', 'number', 'integer', 'boolean', 'null' ]); +function coerceToTypes(optionCoerceTypes, dataTypes) { + if (Array.isArray(dataTypes)) { + var types = []; + for (var i=0; i= lvl) throw new Error('Cannot access property/index ' + up + ' levels up, current level is ' + lvl); + return paths[lvl - up]; + } + + if (up > lvl) throw new Error('Cannot access data ' + up + ' levels up, current level is ' + lvl); + data = 'data' + ((lvl - up) || ''); + if (!jsonPointer) return data; + } + + var expr = data; + var segments = jsonPointer.split('/'); + for (var i=0; i', + $notOp = $isMax ? '>' : '<', + $errorKeyword = undefined; + if (!($isData || typeof $schema == 'number' || $schema === undefined)) { + throw new Error($keyword + ' must be number'); + } + if (!($isDataExcl || $schemaExcl === undefined || typeof $schemaExcl == 'number' || typeof $schemaExcl == 'boolean')) { + throw new Error($exclusiveKeyword + ' must be number or boolean'); + } + if ($isDataExcl) { + var $schemaValueExcl = it.util.getData($schemaExcl.$data, $dataLvl, it.dataPathArr), + $exclusive = 'exclusive' + $lvl, + $exclType = 'exclType' + $lvl, + $exclIsNumber = 'exclIsNumber' + $lvl, + $opExpr = 'op' + $lvl, + $opStr = '\' + ' + $opExpr + ' + \''; + out += ' var schemaExcl' + ($lvl) + ' = ' + ($schemaValueExcl) + '; '; + $schemaValueExcl = 'schemaExcl' + $lvl; + out += ' var ' + ($exclusive) + '; var ' + ($exclType) + ' = typeof ' + ($schemaValueExcl) + '; if (' + ($exclType) + ' != \'boolean\' && ' + ($exclType) + ' != \'undefined\' && ' + ($exclType) + ' != \'number\') { '; + var $errorKeyword = $exclusiveKeyword; + var $$outStack = $$outStack || []; + $$outStack.push(out); + out = ''; /* istanbul ignore else */ + if (it.createErrors !== false) { + out += ' { keyword: \'' + ($errorKeyword || '_exclusiveLimit') + '\' , dataPath: (dataPath || \'\') + ' + (it.errorPath) + ' , schemaPath: ' + (it.util.toQuotedString($errSchemaPath)) + ' , params: {} '; + if (it.opts.messages !== false) { + out += ' , message: \'' + ($exclusiveKeyword) + ' should be boolean\' '; + } + if (it.opts.verbose) { + out += ' , schema: validate.schema' + ($schemaPath) + ' , parentSchema: validate.schema' + (it.schemaPath) + ' , data: ' + ($data) + ' '; + } + out += ' } '; + } else { + out += ' {} '; + } + var __err = out; + out = $$outStack.pop(); + if (!it.compositeRule && $breakOnError) { + /* istanbul ignore if */ + if (it.async) { + out += ' throw new ValidationError([' + (__err) + ']); '; + } else { + out += ' validate.errors = [' + (__err) + ']; return false; '; + } + } else { + out += ' var err = ' + (__err) + '; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; '; + } + out += ' } else if ( '; + if ($isData) { + out += ' (' + ($schemaValue) + ' !== undefined && typeof ' + ($schemaValue) + ' != \'number\') || '; + } + out += ' ' + ($exclType) + ' == \'number\' ? ( (' + ($exclusive) + ' = ' + ($schemaValue) + ' === undefined || ' + ($schemaValueExcl) + ' ' + ($op) + '= ' + ($schemaValue) + ') ? ' + ($data) + ' ' + ($notOp) + '= ' + ($schemaValueExcl) + ' : ' + ($data) + ' ' + ($notOp) + ' ' + ($schemaValue) + ' ) : ( (' + ($exclusive) + ' = ' + ($schemaValueExcl) + ' === true) ? ' + ($data) + ' ' + ($notOp) + '= ' + ($schemaValue) + ' : ' + ($data) + ' ' + ($notOp) + ' ' + ($schemaValue) + ' ) || ' + ($data) + ' !== ' + ($data) + ') { var op' + ($lvl) + ' = ' + ($exclusive) + ' ? \'' + ($op) + '\' : \'' + ($op) + '=\'; '; + if ($schema === undefined) { + $errorKeyword = $exclusiveKeyword; + $errSchemaPath = it.errSchemaPath + '/' + $exclusiveKeyword; + $schemaValue = $schemaValueExcl; + $isData = $isDataExcl; + } + } else { + var $exclIsNumber = typeof $schemaExcl == 'number', + $opStr = $op; + if ($exclIsNumber && $isData) { + var $opExpr = '\'' + $opStr + '\''; + out += ' if ( '; + if ($isData) { + out += ' (' + ($schemaValue) + ' !== undefined && typeof ' + ($schemaValue) + ' != \'number\') || '; + } + out += ' ( ' + ($schemaValue) + ' === undefined || ' + ($schemaExcl) + ' ' + ($op) + '= ' + ($schemaValue) + ' ? ' + ($data) + ' ' + ($notOp) + '= ' + ($schemaExcl) + ' : ' + ($data) + ' ' + ($notOp) + ' ' + ($schemaValue) + ' ) || ' + ($data) + ' !== ' + ($data) + ') { '; + } else { + if ($exclIsNumber && $schema === undefined) { + $exclusive = true; + $errorKeyword = $exclusiveKeyword; + $errSchemaPath = it.errSchemaPath + '/' + $exclusiveKeyword; + $schemaValue = $schemaExcl; + $notOp += '='; + } else { + if ($exclIsNumber) $schemaValue = Math[$isMax ? 'min' : 'max']($schemaExcl, $schema); + if ($schemaExcl === ($exclIsNumber ? $schemaValue : true)) { + $exclusive = true; + $errorKeyword = $exclusiveKeyword; + $errSchemaPath = it.errSchemaPath + '/' + $exclusiveKeyword; + $notOp += '='; + } else { + $exclusive = false; + $opStr += '='; + } + } + var $opExpr = '\'' + $opStr + '\''; + out += ' if ( '; + if ($isData) { + out += ' (' + ($schemaValue) + ' !== undefined && typeof ' + ($schemaValue) + ' != \'number\') || '; + } + out += ' ' + ($data) + ' ' + ($notOp) + ' ' + ($schemaValue) + ' || ' + ($data) + ' !== ' + ($data) + ') { '; + } + } + $errorKeyword = $errorKeyword || $keyword; + var $$outStack = $$outStack || []; + $$outStack.push(out); + out = ''; /* istanbul ignore else */ + if (it.createErrors !== false) { + out += ' { keyword: \'' + ($errorKeyword || '_limit') + '\' , dataPath: (dataPath || \'\') + ' + (it.errorPath) + ' , schemaPath: ' + (it.util.toQuotedString($errSchemaPath)) + ' , params: { comparison: ' + ($opExpr) + ', limit: ' + ($schemaValue) + ', exclusive: ' + ($exclusive) + ' } '; + if (it.opts.messages !== false) { + out += ' , message: \'should be ' + ($opStr) + ' '; + if ($isData) { + out += '\' + ' + ($schemaValue); + } else { + out += '' + ($schemaValue) + '\''; + } + } + if (it.opts.verbose) { + out += ' , schema: '; + if ($isData) { + out += 'validate.schema' + ($schemaPath); + } else { + out += '' + ($schema); + } + out += ' , parentSchema: validate.schema' + (it.schemaPath) + ' , data: ' + ($data) + ' '; + } + out += ' } '; + } else { + out += ' {} '; + } + var __err = out; + out = $$outStack.pop(); + if (!it.compositeRule && $breakOnError) { + /* istanbul ignore if */ + if (it.async) { + out += ' throw new ValidationError([' + (__err) + ']); '; + } else { + out += ' validate.errors = [' + (__err) + ']; return false; '; + } + } else { + out += ' var err = ' + (__err) + '; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; '; + } + out += ' } '; + if ($breakOnError) { + out += ' else { '; + } + return out; +} + +},{}],14:[function(require,module,exports){ +'use strict'; +module.exports = function generate__limitItems(it, $keyword, $ruleType) { + var out = ' '; + var $lvl = it.level; + var $dataLvl = it.dataLevel; + var $schema = it.schema[$keyword]; + var $schemaPath = it.schemaPath + it.util.getProperty($keyword); + var $errSchemaPath = it.errSchemaPath + '/' + $keyword; + var $breakOnError = !it.opts.allErrors; + var $errorKeyword; + var $data = 'data' + ($dataLvl || ''); + var $isData = it.opts.$data && $schema && $schema.$data, + $schemaValue; + if ($isData) { + out += ' var schema' + ($lvl) + ' = ' + (it.util.getData($schema.$data, $dataLvl, it.dataPathArr)) + '; '; + $schemaValue = 'schema' + $lvl; + } else { + $schemaValue = $schema; + } + if (!($isData || typeof $schema == 'number')) { + throw new Error($keyword + ' must be number'); + } + var $op = $keyword == 'maxItems' ? '>' : '<'; + out += 'if ( '; + if ($isData) { + out += ' (' + ($schemaValue) + ' !== undefined && typeof ' + ($schemaValue) + ' != \'number\') || '; + } + out += ' ' + ($data) + '.length ' + ($op) + ' ' + ($schemaValue) + ') { '; + var $errorKeyword = $keyword; + var $$outStack = $$outStack || []; + $$outStack.push(out); + out = ''; /* istanbul ignore else */ + if (it.createErrors !== false) { + out += ' { keyword: \'' + ($errorKeyword || '_limitItems') + '\' , dataPath: (dataPath || \'\') + ' + (it.errorPath) + ' , schemaPath: ' + (it.util.toQuotedString($errSchemaPath)) + ' , params: { limit: ' + ($schemaValue) + ' } '; + if (it.opts.messages !== false) { + out += ' , message: \'should NOT have '; + if ($keyword == 'maxItems') { + out += 'more'; + } else { + out += 'fewer'; + } + out += ' than '; + if ($isData) { + out += '\' + ' + ($schemaValue) + ' + \''; + } else { + out += '' + ($schema); + } + out += ' items\' '; + } + if (it.opts.verbose) { + out += ' , schema: '; + if ($isData) { + out += 'validate.schema' + ($schemaPath); + } else { + out += '' + ($schema); + } + out += ' , parentSchema: validate.schema' + (it.schemaPath) + ' , data: ' + ($data) + ' '; + } + out += ' } '; + } else { + out += ' {} '; + } + var __err = out; + out = $$outStack.pop(); + if (!it.compositeRule && $breakOnError) { + /* istanbul ignore if */ + if (it.async) { + out += ' throw new ValidationError([' + (__err) + ']); '; + } else { + out += ' validate.errors = [' + (__err) + ']; return false; '; + } + } else { + out += ' var err = ' + (__err) + '; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; '; + } + out += '} '; + if ($breakOnError) { + out += ' else { '; + } + return out; +} + +},{}],15:[function(require,module,exports){ +'use strict'; +module.exports = function generate__limitLength(it, $keyword, $ruleType) { + var out = ' '; + var $lvl = it.level; + var $dataLvl = it.dataLevel; + var $schema = it.schema[$keyword]; + var $schemaPath = it.schemaPath + it.util.getProperty($keyword); + var $errSchemaPath = it.errSchemaPath + '/' + $keyword; + var $breakOnError = !it.opts.allErrors; + var $errorKeyword; + var $data = 'data' + ($dataLvl || ''); + var $isData = it.opts.$data && $schema && $schema.$data, + $schemaValue; + if ($isData) { + out += ' var schema' + ($lvl) + ' = ' + (it.util.getData($schema.$data, $dataLvl, it.dataPathArr)) + '; '; + $schemaValue = 'schema' + $lvl; + } else { + $schemaValue = $schema; + } + if (!($isData || typeof $schema == 'number')) { + throw new Error($keyword + ' must be number'); + } + var $op = $keyword == 'maxLength' ? '>' : '<'; + out += 'if ( '; + if ($isData) { + out += ' (' + ($schemaValue) + ' !== undefined && typeof ' + ($schemaValue) + ' != \'number\') || '; + } + if (it.opts.unicode === false) { + out += ' ' + ($data) + '.length '; + } else { + out += ' ucs2length(' + ($data) + ') '; + } + out += ' ' + ($op) + ' ' + ($schemaValue) + ') { '; + var $errorKeyword = $keyword; + var $$outStack = $$outStack || []; + $$outStack.push(out); + out = ''; /* istanbul ignore else */ + if (it.createErrors !== false) { + out += ' { keyword: \'' + ($errorKeyword || '_limitLength') + '\' , dataPath: (dataPath || \'\') + ' + (it.errorPath) + ' , schemaPath: ' + (it.util.toQuotedString($errSchemaPath)) + ' , params: { limit: ' + ($schemaValue) + ' } '; + if (it.opts.messages !== false) { + out += ' , message: \'should NOT be '; + if ($keyword == 'maxLength') { + out += 'longer'; + } else { + out += 'shorter'; + } + out += ' than '; + if ($isData) { + out += '\' + ' + ($schemaValue) + ' + \''; + } else { + out += '' + ($schema); + } + out += ' characters\' '; + } + if (it.opts.verbose) { + out += ' , schema: '; + if ($isData) { + out += 'validate.schema' + ($schemaPath); + } else { + out += '' + ($schema); + } + out += ' , parentSchema: validate.schema' + (it.schemaPath) + ' , data: ' + ($data) + ' '; + } + out += ' } '; + } else { + out += ' {} '; + } + var __err = out; + out = $$outStack.pop(); + if (!it.compositeRule && $breakOnError) { + /* istanbul ignore if */ + if (it.async) { + out += ' throw new ValidationError([' + (__err) + ']); '; + } else { + out += ' validate.errors = [' + (__err) + ']; return false; '; + } + } else { + out += ' var err = ' + (__err) + '; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; '; + } + out += '} '; + if ($breakOnError) { + out += ' else { '; + } + return out; +} + +},{}],16:[function(require,module,exports){ +'use strict'; +module.exports = function generate__limitProperties(it, $keyword, $ruleType) { + var out = ' '; + var $lvl = it.level; + var $dataLvl = it.dataLevel; + var $schema = it.schema[$keyword]; + var $schemaPath = it.schemaPath + it.util.getProperty($keyword); + var $errSchemaPath = it.errSchemaPath + '/' + $keyword; + var $breakOnError = !it.opts.allErrors; + var $errorKeyword; + var $data = 'data' + ($dataLvl || ''); + var $isData = it.opts.$data && $schema && $schema.$data, + $schemaValue; + if ($isData) { + out += ' var schema' + ($lvl) + ' = ' + (it.util.getData($schema.$data, $dataLvl, it.dataPathArr)) + '; '; + $schemaValue = 'schema' + $lvl; + } else { + $schemaValue = $schema; + } + if (!($isData || typeof $schema == 'number')) { + throw new Error($keyword + ' must be number'); + } + var $op = $keyword == 'maxProperties' ? '>' : '<'; + out += 'if ( '; + if ($isData) { + out += ' (' + ($schemaValue) + ' !== undefined && typeof ' + ($schemaValue) + ' != \'number\') || '; + } + out += ' Object.keys(' + ($data) + ').length ' + ($op) + ' ' + ($schemaValue) + ') { '; + var $errorKeyword = $keyword; + var $$outStack = $$outStack || []; + $$outStack.push(out); + out = ''; /* istanbul ignore else */ + if (it.createErrors !== false) { + out += ' { keyword: \'' + ($errorKeyword || '_limitProperties') + '\' , dataPath: (dataPath || \'\') + ' + (it.errorPath) + ' , schemaPath: ' + (it.util.toQuotedString($errSchemaPath)) + ' , params: { limit: ' + ($schemaValue) + ' } '; + if (it.opts.messages !== false) { + out += ' , message: \'should NOT have '; + if ($keyword == 'maxProperties') { + out += 'more'; + } else { + out += 'fewer'; + } + out += ' than '; + if ($isData) { + out += '\' + ' + ($schemaValue) + ' + \''; + } else { + out += '' + ($schema); + } + out += ' properties\' '; + } + if (it.opts.verbose) { + out += ' , schema: '; + if ($isData) { + out += 'validate.schema' + ($schemaPath); + } else { + out += '' + ($schema); + } + out += ' , parentSchema: validate.schema' + (it.schemaPath) + ' , data: ' + ($data) + ' '; + } + out += ' } '; + } else { + out += ' {} '; + } + var __err = out; + out = $$outStack.pop(); + if (!it.compositeRule && $breakOnError) { + /* istanbul ignore if */ + if (it.async) { + out += ' throw new ValidationError([' + (__err) + ']); '; + } else { + out += ' validate.errors = [' + (__err) + ']; return false; '; + } + } else { + out += ' var err = ' + (__err) + '; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; '; + } + out += '} '; + if ($breakOnError) { + out += ' else { '; + } + return out; +} + +},{}],17:[function(require,module,exports){ +'use strict'; +module.exports = function generate_allOf(it, $keyword, $ruleType) { + var out = ' '; + var $schema = it.schema[$keyword]; + var $schemaPath = it.schemaPath + it.util.getProperty($keyword); + var $errSchemaPath = it.errSchemaPath + '/' + $keyword; + var $breakOnError = !it.opts.allErrors; + var $it = it.util.copy(it); + var $closingBraces = ''; + $it.level++; + var $nextValid = 'valid' + $it.level; + var $currentBaseId = $it.baseId, + $allSchemasEmpty = true; + var arr1 = $schema; + if (arr1) { + var $sch, $i = -1, + l1 = arr1.length - 1; + while ($i < l1) { + $sch = arr1[$i += 1]; + if ((it.opts.strictKeywords ? (typeof $sch == 'object' && Object.keys($sch).length > 0) || $sch === false : it.util.schemaHasRules($sch, it.RULES.all))) { + $allSchemasEmpty = false; + $it.schema = $sch; + $it.schemaPath = $schemaPath + '[' + $i + ']'; + $it.errSchemaPath = $errSchemaPath + '/' + $i; + out += ' ' + (it.validate($it)) + ' '; + $it.baseId = $currentBaseId; + if ($breakOnError) { + out += ' if (' + ($nextValid) + ') { '; + $closingBraces += '}'; + } + } + } + } + if ($breakOnError) { + if ($allSchemasEmpty) { + out += ' if (true) { '; + } else { + out += ' ' + ($closingBraces.slice(0, -1)) + ' '; + } + } + return out; +} + +},{}],18:[function(require,module,exports){ +'use strict'; +module.exports = function generate_anyOf(it, $keyword, $ruleType) { + var out = ' '; + var $lvl = it.level; + var $dataLvl = it.dataLevel; + var $schema = it.schema[$keyword]; + var $schemaPath = it.schemaPath + it.util.getProperty($keyword); + var $errSchemaPath = it.errSchemaPath + '/' + $keyword; + var $breakOnError = !it.opts.allErrors; + var $data = 'data' + ($dataLvl || ''); + var $valid = 'valid' + $lvl; + var $errs = 'errs__' + $lvl; + var $it = it.util.copy(it); + var $closingBraces = ''; + $it.level++; + var $nextValid = 'valid' + $it.level; + var $noEmptySchema = $schema.every(function($sch) { + return (it.opts.strictKeywords ? (typeof $sch == 'object' && Object.keys($sch).length > 0) || $sch === false : it.util.schemaHasRules($sch, it.RULES.all)); + }); + if ($noEmptySchema) { + var $currentBaseId = $it.baseId; + out += ' var ' + ($errs) + ' = errors; var ' + ($valid) + ' = false; '; + var $wasComposite = it.compositeRule; + it.compositeRule = $it.compositeRule = true; + var arr1 = $schema; + if (arr1) { + var $sch, $i = -1, + l1 = arr1.length - 1; + while ($i < l1) { + $sch = arr1[$i += 1]; + $it.schema = $sch; + $it.schemaPath = $schemaPath + '[' + $i + ']'; + $it.errSchemaPath = $errSchemaPath + '/' + $i; + out += ' ' + (it.validate($it)) + ' '; + $it.baseId = $currentBaseId; + out += ' ' + ($valid) + ' = ' + ($valid) + ' || ' + ($nextValid) + '; if (!' + ($valid) + ') { '; + $closingBraces += '}'; + } + } + it.compositeRule = $it.compositeRule = $wasComposite; + out += ' ' + ($closingBraces) + ' if (!' + ($valid) + ') { var err = '; /* istanbul ignore else */ + if (it.createErrors !== false) { + out += ' { keyword: \'' + ('anyOf') + '\' , dataPath: (dataPath || \'\') + ' + (it.errorPath) + ' , schemaPath: ' + (it.util.toQuotedString($errSchemaPath)) + ' , params: {} '; + if (it.opts.messages !== false) { + out += ' , message: \'should match some schema in anyOf\' '; + } + if (it.opts.verbose) { + out += ' , schema: validate.schema' + ($schemaPath) + ' , parentSchema: validate.schema' + (it.schemaPath) + ' , data: ' + ($data) + ' '; + } + out += ' } '; + } else { + out += ' {} '; + } + out += '; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; '; + if (!it.compositeRule && $breakOnError) { + /* istanbul ignore if */ + if (it.async) { + out += ' throw new ValidationError(vErrors); '; + } else { + out += ' validate.errors = vErrors; return false; '; + } + } + out += ' } else { errors = ' + ($errs) + '; if (vErrors !== null) { if (' + ($errs) + ') vErrors.length = ' + ($errs) + '; else vErrors = null; } '; + if (it.opts.allErrors) { + out += ' } '; + } + } else { + if ($breakOnError) { + out += ' if (true) { '; + } + } + return out; +} + +},{}],19:[function(require,module,exports){ +'use strict'; +module.exports = function generate_comment(it, $keyword, $ruleType) { + var out = ' '; + var $schema = it.schema[$keyword]; + var $errSchemaPath = it.errSchemaPath + '/' + $keyword; + var $breakOnError = !it.opts.allErrors; + var $comment = it.util.toQuotedString($schema); + if (it.opts.$comment === true) { + out += ' console.log(' + ($comment) + ');'; + } else if (typeof it.opts.$comment == 'function') { + out += ' self._opts.$comment(' + ($comment) + ', ' + (it.util.toQuotedString($errSchemaPath)) + ', validate.root.schema);'; + } + return out; +} + +},{}],20:[function(require,module,exports){ +'use strict'; +module.exports = function generate_const(it, $keyword, $ruleType) { + var out = ' '; + var $lvl = it.level; + var $dataLvl = it.dataLevel; + var $schema = it.schema[$keyword]; + var $schemaPath = it.schemaPath + it.util.getProperty($keyword); + var $errSchemaPath = it.errSchemaPath + '/' + $keyword; + var $breakOnError = !it.opts.allErrors; + var $data = 'data' + ($dataLvl || ''); + var $valid = 'valid' + $lvl; + var $isData = it.opts.$data && $schema && $schema.$data, + $schemaValue; + if ($isData) { + out += ' var schema' + ($lvl) + ' = ' + (it.util.getData($schema.$data, $dataLvl, it.dataPathArr)) + '; '; + $schemaValue = 'schema' + $lvl; + } else { + $schemaValue = $schema; + } + if (!$isData) { + out += ' var schema' + ($lvl) + ' = validate.schema' + ($schemaPath) + ';'; + } + out += 'var ' + ($valid) + ' = equal(' + ($data) + ', schema' + ($lvl) + '); if (!' + ($valid) + ') { '; + var $$outStack = $$outStack || []; + $$outStack.push(out); + out = ''; /* istanbul ignore else */ + if (it.createErrors !== false) { + out += ' { keyword: \'' + ('const') + '\' , dataPath: (dataPath || \'\') + ' + (it.errorPath) + ' , schemaPath: ' + (it.util.toQuotedString($errSchemaPath)) + ' , params: { allowedValue: schema' + ($lvl) + ' } '; + if (it.opts.messages !== false) { + out += ' , message: \'should be equal to constant\' '; + } + if (it.opts.verbose) { + out += ' , schema: validate.schema' + ($schemaPath) + ' , parentSchema: validate.schema' + (it.schemaPath) + ' , data: ' + ($data) + ' '; + } + out += ' } '; + } else { + out += ' {} '; + } + var __err = out; + out = $$outStack.pop(); + if (!it.compositeRule && $breakOnError) { + /* istanbul ignore if */ + if (it.async) { + out += ' throw new ValidationError([' + (__err) + ']); '; + } else { + out += ' validate.errors = [' + (__err) + ']; return false; '; + } + } else { + out += ' var err = ' + (__err) + '; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; '; + } + out += ' }'; + if ($breakOnError) { + out += ' else { '; + } + return out; +} + +},{}],21:[function(require,module,exports){ +'use strict'; +module.exports = function generate_contains(it, $keyword, $ruleType) { + var out = ' '; + var $lvl = it.level; + var $dataLvl = it.dataLevel; + var $schema = it.schema[$keyword]; + var $schemaPath = it.schemaPath + it.util.getProperty($keyword); + var $errSchemaPath = it.errSchemaPath + '/' + $keyword; + var $breakOnError = !it.opts.allErrors; + var $data = 'data' + ($dataLvl || ''); + var $valid = 'valid' + $lvl; + var $errs = 'errs__' + $lvl; + var $it = it.util.copy(it); + var $closingBraces = ''; + $it.level++; + var $nextValid = 'valid' + $it.level; + var $idx = 'i' + $lvl, + $dataNxt = $it.dataLevel = it.dataLevel + 1, + $nextData = 'data' + $dataNxt, + $currentBaseId = it.baseId, + $nonEmptySchema = (it.opts.strictKeywords ? (typeof $schema == 'object' && Object.keys($schema).length > 0) || $schema === false : it.util.schemaHasRules($schema, it.RULES.all)); + out += 'var ' + ($errs) + ' = errors;var ' + ($valid) + ';'; + if ($nonEmptySchema) { + var $wasComposite = it.compositeRule; + it.compositeRule = $it.compositeRule = true; + $it.schema = $schema; + $it.schemaPath = $schemaPath; + $it.errSchemaPath = $errSchemaPath; + out += ' var ' + ($nextValid) + ' = false; for (var ' + ($idx) + ' = 0; ' + ($idx) + ' < ' + ($data) + '.length; ' + ($idx) + '++) { '; + $it.errorPath = it.util.getPathExpr(it.errorPath, $idx, it.opts.jsonPointers, true); + var $passData = $data + '[' + $idx + ']'; + $it.dataPathArr[$dataNxt] = $idx; + var $code = it.validate($it); + $it.baseId = $currentBaseId; + if (it.util.varOccurences($code, $nextData) < 2) { + out += ' ' + (it.util.varReplace($code, $nextData, $passData)) + ' '; + } else { + out += ' var ' + ($nextData) + ' = ' + ($passData) + '; ' + ($code) + ' '; + } + out += ' if (' + ($nextValid) + ') break; } '; + it.compositeRule = $it.compositeRule = $wasComposite; + out += ' ' + ($closingBraces) + ' if (!' + ($nextValid) + ') {'; + } else { + out += ' if (' + ($data) + '.length == 0) {'; + } + var $$outStack = $$outStack || []; + $$outStack.push(out); + out = ''; /* istanbul ignore else */ + if (it.createErrors !== false) { + out += ' { keyword: \'' + ('contains') + '\' , dataPath: (dataPath || \'\') + ' + (it.errorPath) + ' , schemaPath: ' + (it.util.toQuotedString($errSchemaPath)) + ' , params: {} '; + if (it.opts.messages !== false) { + out += ' , message: \'should contain a valid item\' '; + } + if (it.opts.verbose) { + out += ' , schema: validate.schema' + ($schemaPath) + ' , parentSchema: validate.schema' + (it.schemaPath) + ' , data: ' + ($data) + ' '; + } + out += ' } '; + } else { + out += ' {} '; + } + var __err = out; + out = $$outStack.pop(); + if (!it.compositeRule && $breakOnError) { + /* istanbul ignore if */ + if (it.async) { + out += ' throw new ValidationError([' + (__err) + ']); '; + } else { + out += ' validate.errors = [' + (__err) + ']; return false; '; + } + } else { + out += ' var err = ' + (__err) + '; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; '; + } + out += ' } else { '; + if ($nonEmptySchema) { + out += ' errors = ' + ($errs) + '; if (vErrors !== null) { if (' + ($errs) + ') vErrors.length = ' + ($errs) + '; else vErrors = null; } '; + } + if (it.opts.allErrors) { + out += ' } '; + } + return out; +} + +},{}],22:[function(require,module,exports){ +'use strict'; +module.exports = function generate_custom(it, $keyword, $ruleType) { + var out = ' '; + var $lvl = it.level; + var $dataLvl = it.dataLevel; + var $schema = it.schema[$keyword]; + var $schemaPath = it.schemaPath + it.util.getProperty($keyword); + var $errSchemaPath = it.errSchemaPath + '/' + $keyword; + var $breakOnError = !it.opts.allErrors; + var $errorKeyword; + var $data = 'data' + ($dataLvl || ''); + var $valid = 'valid' + $lvl; + var $errs = 'errs__' + $lvl; + var $isData = it.opts.$data && $schema && $schema.$data, + $schemaValue; + if ($isData) { + out += ' var schema' + ($lvl) + ' = ' + (it.util.getData($schema.$data, $dataLvl, it.dataPathArr)) + '; '; + $schemaValue = 'schema' + $lvl; + } else { + $schemaValue = $schema; + } + var $rule = this, + $definition = 'definition' + $lvl, + $rDef = $rule.definition, + $closingBraces = ''; + var $compile, $inline, $macro, $ruleValidate, $validateCode; + if ($isData && $rDef.$data) { + $validateCode = 'keywordValidate' + $lvl; + var $validateSchema = $rDef.validateSchema; + out += ' var ' + ($definition) + ' = RULES.custom[\'' + ($keyword) + '\'].definition; var ' + ($validateCode) + ' = ' + ($definition) + '.validate;'; + } else { + $ruleValidate = it.useCustomRule($rule, $schema, it.schema, it); + if (!$ruleValidate) return; + $schemaValue = 'validate.schema' + $schemaPath; + $validateCode = $ruleValidate.code; + $compile = $rDef.compile; + $inline = $rDef.inline; + $macro = $rDef.macro; + } + var $ruleErrs = $validateCode + '.errors', + $i = 'i' + $lvl, + $ruleErr = 'ruleErr' + $lvl, + $asyncKeyword = $rDef.async; + if ($asyncKeyword && !it.async) throw new Error('async keyword in sync schema'); + if (!($inline || $macro)) { + out += '' + ($ruleErrs) + ' = null;'; + } + out += 'var ' + ($errs) + ' = errors;var ' + ($valid) + ';'; + if ($isData && $rDef.$data) { + $closingBraces += '}'; + out += ' if (' + ($schemaValue) + ' === undefined) { ' + ($valid) + ' = true; } else { '; + if ($validateSchema) { + $closingBraces += '}'; + out += ' ' + ($valid) + ' = ' + ($definition) + '.validateSchema(' + ($schemaValue) + '); if (' + ($valid) + ') { '; + } + } + if ($inline) { + if ($rDef.statements) { + out += ' ' + ($ruleValidate.validate) + ' '; + } else { + out += ' ' + ($valid) + ' = ' + ($ruleValidate.validate) + '; '; + } + } else if ($macro) { + var $it = it.util.copy(it); + var $closingBraces = ''; + $it.level++; + var $nextValid = 'valid' + $it.level; + $it.schema = $ruleValidate.validate; + $it.schemaPath = ''; + var $wasComposite = it.compositeRule; + it.compositeRule = $it.compositeRule = true; + var $code = it.validate($it).replace(/validate\.schema/g, $validateCode); + it.compositeRule = $it.compositeRule = $wasComposite; + out += ' ' + ($code); + } else { + var $$outStack = $$outStack || []; + $$outStack.push(out); + out = ''; + out += ' ' + ($validateCode) + '.call( '; + if (it.opts.passContext) { + out += 'this'; + } else { + out += 'self'; + } + if ($compile || $rDef.schema === false) { + out += ' , ' + ($data) + ' '; + } else { + out += ' , ' + ($schemaValue) + ' , ' + ($data) + ' , validate.schema' + (it.schemaPath) + ' '; + } + out += ' , (dataPath || \'\')'; + if (it.errorPath != '""') { + out += ' + ' + (it.errorPath); + } + var $parentData = $dataLvl ? 'data' + (($dataLvl - 1) || '') : 'parentData', + $parentDataProperty = $dataLvl ? it.dataPathArr[$dataLvl] : 'parentDataProperty'; + out += ' , ' + ($parentData) + ' , ' + ($parentDataProperty) + ' , rootData ) '; + var def_callRuleValidate = out; + out = $$outStack.pop(); + if ($rDef.errors === false) { + out += ' ' + ($valid) + ' = '; + if ($asyncKeyword) { + out += 'await '; + } + out += '' + (def_callRuleValidate) + '; '; + } else { + if ($asyncKeyword) { + $ruleErrs = 'customErrors' + $lvl; + out += ' var ' + ($ruleErrs) + ' = null; try { ' + ($valid) + ' = await ' + (def_callRuleValidate) + '; } catch (e) { ' + ($valid) + ' = false; if (e instanceof ValidationError) ' + ($ruleErrs) + ' = e.errors; else throw e; } '; + } else { + out += ' ' + ($ruleErrs) + ' = null; ' + ($valid) + ' = ' + (def_callRuleValidate) + '; '; + } + } + } + if ($rDef.modifying) { + out += ' if (' + ($parentData) + ') ' + ($data) + ' = ' + ($parentData) + '[' + ($parentDataProperty) + '];'; + } + out += '' + ($closingBraces); + if ($rDef.valid) { + if ($breakOnError) { + out += ' if (true) { '; + } + } else { + out += ' if ( '; + if ($rDef.valid === undefined) { + out += ' !'; + if ($macro) { + out += '' + ($nextValid); + } else { + out += '' + ($valid); + } + } else { + out += ' ' + (!$rDef.valid) + ' '; + } + out += ') { '; + $errorKeyword = $rule.keyword; + var $$outStack = $$outStack || []; + $$outStack.push(out); + out = ''; + var $$outStack = $$outStack || []; + $$outStack.push(out); + out = ''; /* istanbul ignore else */ + if (it.createErrors !== false) { + out += ' { keyword: \'' + ($errorKeyword || 'custom') + '\' , dataPath: (dataPath || \'\') + ' + (it.errorPath) + ' , schemaPath: ' + (it.util.toQuotedString($errSchemaPath)) + ' , params: { keyword: \'' + ($rule.keyword) + '\' } '; + if (it.opts.messages !== false) { + out += ' , message: \'should pass "' + ($rule.keyword) + '" keyword validation\' '; + } + if (it.opts.verbose) { + out += ' , schema: validate.schema' + ($schemaPath) + ' , parentSchema: validate.schema' + (it.schemaPath) + ' , data: ' + ($data) + ' '; + } + out += ' } '; + } else { + out += ' {} '; + } + var __err = out; + out = $$outStack.pop(); + if (!it.compositeRule && $breakOnError) { + /* istanbul ignore if */ + if (it.async) { + out += ' throw new ValidationError([' + (__err) + ']); '; + } else { + out += ' validate.errors = [' + (__err) + ']; return false; '; + } + } else { + out += ' var err = ' + (__err) + '; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; '; + } + var def_customError = out; + out = $$outStack.pop(); + if ($inline) { + if ($rDef.errors) { + if ($rDef.errors != 'full') { + out += ' for (var ' + ($i) + '=' + ($errs) + '; ' + ($i) + ' 0) || $sch === false : it.util.schemaHasRules($sch, it.RULES.all))) { + out += ' ' + ($nextValid) + ' = true; if ( ' + ($data) + (it.util.getProperty($property)) + ' !== undefined '; + if ($ownProperties) { + out += ' && Object.prototype.hasOwnProperty.call(' + ($data) + ', \'' + (it.util.escapeQuotes($property)) + '\') '; + } + out += ') { '; + $it.schema = $sch; + $it.schemaPath = $schemaPath + it.util.getProperty($property); + $it.errSchemaPath = $errSchemaPath + '/' + it.util.escapeFragment($property); + out += ' ' + (it.validate($it)) + ' '; + $it.baseId = $currentBaseId; + out += ' } '; + if ($breakOnError) { + out += ' if (' + ($nextValid) + ') { '; + $closingBraces += '}'; + } + } + } + if ($breakOnError) { + out += ' ' + ($closingBraces) + ' if (' + ($errs) + ' == errors) {'; + } + return out; +} + +},{}],24:[function(require,module,exports){ +'use strict'; +module.exports = function generate_enum(it, $keyword, $ruleType) { + var out = ' '; + var $lvl = it.level; + var $dataLvl = it.dataLevel; + var $schema = it.schema[$keyword]; + var $schemaPath = it.schemaPath + it.util.getProperty($keyword); + var $errSchemaPath = it.errSchemaPath + '/' + $keyword; + var $breakOnError = !it.opts.allErrors; + var $data = 'data' + ($dataLvl || ''); + var $valid = 'valid' + $lvl; + var $isData = it.opts.$data && $schema && $schema.$data, + $schemaValue; + if ($isData) { + out += ' var schema' + ($lvl) + ' = ' + (it.util.getData($schema.$data, $dataLvl, it.dataPathArr)) + '; '; + $schemaValue = 'schema' + $lvl; + } else { + $schemaValue = $schema; + } + var $i = 'i' + $lvl, + $vSchema = 'schema' + $lvl; + if (!$isData) { + out += ' var ' + ($vSchema) + ' = validate.schema' + ($schemaPath) + ';'; + } + out += 'var ' + ($valid) + ';'; + if ($isData) { + out += ' if (schema' + ($lvl) + ' === undefined) ' + ($valid) + ' = true; else if (!Array.isArray(schema' + ($lvl) + ')) ' + ($valid) + ' = false; else {'; + } + out += '' + ($valid) + ' = false;for (var ' + ($i) + '=0; ' + ($i) + '<' + ($vSchema) + '.length; ' + ($i) + '++) if (equal(' + ($data) + ', ' + ($vSchema) + '[' + ($i) + '])) { ' + ($valid) + ' = true; break; }'; + if ($isData) { + out += ' } '; + } + out += ' if (!' + ($valid) + ') { '; + var $$outStack = $$outStack || []; + $$outStack.push(out); + out = ''; /* istanbul ignore else */ + if (it.createErrors !== false) { + out += ' { keyword: \'' + ('enum') + '\' , dataPath: (dataPath || \'\') + ' + (it.errorPath) + ' , schemaPath: ' + (it.util.toQuotedString($errSchemaPath)) + ' , params: { allowedValues: schema' + ($lvl) + ' } '; + if (it.opts.messages !== false) { + out += ' , message: \'should be equal to one of the allowed values\' '; + } + if (it.opts.verbose) { + out += ' , schema: validate.schema' + ($schemaPath) + ' , parentSchema: validate.schema' + (it.schemaPath) + ' , data: ' + ($data) + ' '; + } + out += ' } '; + } else { + out += ' {} '; + } + var __err = out; + out = $$outStack.pop(); + if (!it.compositeRule && $breakOnError) { + /* istanbul ignore if */ + if (it.async) { + out += ' throw new ValidationError([' + (__err) + ']); '; + } else { + out += ' validate.errors = [' + (__err) + ']; return false; '; + } + } else { + out += ' var err = ' + (__err) + '; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; '; + } + out += ' }'; + if ($breakOnError) { + out += ' else { '; + } + return out; +} + +},{}],25:[function(require,module,exports){ +'use strict'; +module.exports = function generate_format(it, $keyword, $ruleType) { + var out = ' '; + var $lvl = it.level; + var $dataLvl = it.dataLevel; + var $schema = it.schema[$keyword]; + var $schemaPath = it.schemaPath + it.util.getProperty($keyword); + var $errSchemaPath = it.errSchemaPath + '/' + $keyword; + var $breakOnError = !it.opts.allErrors; + var $data = 'data' + ($dataLvl || ''); + if (it.opts.format === false) { + if ($breakOnError) { + out += ' if (true) { '; + } + return out; + } + var $isData = it.opts.$data && $schema && $schema.$data, + $schemaValue; + if ($isData) { + out += ' var schema' + ($lvl) + ' = ' + (it.util.getData($schema.$data, $dataLvl, it.dataPathArr)) + '; '; + $schemaValue = 'schema' + $lvl; + } else { + $schemaValue = $schema; + } + var $unknownFormats = it.opts.unknownFormats, + $allowUnknown = Array.isArray($unknownFormats); + if ($isData) { + var $format = 'format' + $lvl, + $isObject = 'isObject' + $lvl, + $formatType = 'formatType' + $lvl; + out += ' var ' + ($format) + ' = formats[' + ($schemaValue) + ']; var ' + ($isObject) + ' = typeof ' + ($format) + ' == \'object\' && !(' + ($format) + ' instanceof RegExp) && ' + ($format) + '.validate; var ' + ($formatType) + ' = ' + ($isObject) + ' && ' + ($format) + '.type || \'string\'; if (' + ($isObject) + ') { '; + if (it.async) { + out += ' var async' + ($lvl) + ' = ' + ($format) + '.async; '; + } + out += ' ' + ($format) + ' = ' + ($format) + '.validate; } if ( '; + if ($isData) { + out += ' (' + ($schemaValue) + ' !== undefined && typeof ' + ($schemaValue) + ' != \'string\') || '; + } + out += ' ('; + if ($unknownFormats != 'ignore') { + out += ' (' + ($schemaValue) + ' && !' + ($format) + ' '; + if ($allowUnknown) { + out += ' && self._opts.unknownFormats.indexOf(' + ($schemaValue) + ') == -1 '; + } + out += ') || '; + } + out += ' (' + ($format) + ' && ' + ($formatType) + ' == \'' + ($ruleType) + '\' && !(typeof ' + ($format) + ' == \'function\' ? '; + if (it.async) { + out += ' (async' + ($lvl) + ' ? await ' + ($format) + '(' + ($data) + ') : ' + ($format) + '(' + ($data) + ')) '; + } else { + out += ' ' + ($format) + '(' + ($data) + ') '; + } + out += ' : ' + ($format) + '.test(' + ($data) + '))))) {'; + } else { + var $format = it.formats[$schema]; + if (!$format) { + if ($unknownFormats == 'ignore') { + it.logger.warn('unknown format "' + $schema + '" ignored in schema at path "' + it.errSchemaPath + '"'); + if ($breakOnError) { + out += ' if (true) { '; + } + return out; + } else if ($allowUnknown && $unknownFormats.indexOf($schema) >= 0) { + if ($breakOnError) { + out += ' if (true) { '; + } + return out; + } else { + throw new Error('unknown format "' + $schema + '" is used in schema at path "' + it.errSchemaPath + '"'); + } + } + var $isObject = typeof $format == 'object' && !($format instanceof RegExp) && $format.validate; + var $formatType = $isObject && $format.type || 'string'; + if ($isObject) { + var $async = $format.async === true; + $format = $format.validate; + } + if ($formatType != $ruleType) { + if ($breakOnError) { + out += ' if (true) { '; + } + return out; + } + if ($async) { + if (!it.async) throw new Error('async format in sync schema'); + var $formatRef = 'formats' + it.util.getProperty($schema) + '.validate'; + out += ' if (!(await ' + ($formatRef) + '(' + ($data) + '))) { '; + } else { + out += ' if (! '; + var $formatRef = 'formats' + it.util.getProperty($schema); + if ($isObject) $formatRef += '.validate'; + if (typeof $format == 'function') { + out += ' ' + ($formatRef) + '(' + ($data) + ') '; + } else { + out += ' ' + ($formatRef) + '.test(' + ($data) + ') '; + } + out += ') { '; + } + } + var $$outStack = $$outStack || []; + $$outStack.push(out); + out = ''; /* istanbul ignore else */ + if (it.createErrors !== false) { + out += ' { keyword: \'' + ('format') + '\' , dataPath: (dataPath || \'\') + ' + (it.errorPath) + ' , schemaPath: ' + (it.util.toQuotedString($errSchemaPath)) + ' , params: { format: '; + if ($isData) { + out += '' + ($schemaValue); + } else { + out += '' + (it.util.toQuotedString($schema)); + } + out += ' } '; + if (it.opts.messages !== false) { + out += ' , message: \'should match format "'; + if ($isData) { + out += '\' + ' + ($schemaValue) + ' + \''; + } else { + out += '' + (it.util.escapeQuotes($schema)); + } + out += '"\' '; + } + if (it.opts.verbose) { + out += ' , schema: '; + if ($isData) { + out += 'validate.schema' + ($schemaPath); + } else { + out += '' + (it.util.toQuotedString($schema)); + } + out += ' , parentSchema: validate.schema' + (it.schemaPath) + ' , data: ' + ($data) + ' '; + } + out += ' } '; + } else { + out += ' {} '; + } + var __err = out; + out = $$outStack.pop(); + if (!it.compositeRule && $breakOnError) { + /* istanbul ignore if */ + if (it.async) { + out += ' throw new ValidationError([' + (__err) + ']); '; + } else { + out += ' validate.errors = [' + (__err) + ']; return false; '; + } + } else { + out += ' var err = ' + (__err) + '; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; '; + } + out += ' } '; + if ($breakOnError) { + out += ' else { '; + } + return out; +} + +},{}],26:[function(require,module,exports){ +'use strict'; +module.exports = function generate_if(it, $keyword, $ruleType) { + var out = ' '; + var $lvl = it.level; + var $dataLvl = it.dataLevel; + var $schema = it.schema[$keyword]; + var $schemaPath = it.schemaPath + it.util.getProperty($keyword); + var $errSchemaPath = it.errSchemaPath + '/' + $keyword; + var $breakOnError = !it.opts.allErrors; + var $data = 'data' + ($dataLvl || ''); + var $valid = 'valid' + $lvl; + var $errs = 'errs__' + $lvl; + var $it = it.util.copy(it); + $it.level++; + var $nextValid = 'valid' + $it.level; + var $thenSch = it.schema['then'], + $elseSch = it.schema['else'], + $thenPresent = $thenSch !== undefined && (it.opts.strictKeywords ? (typeof $thenSch == 'object' && Object.keys($thenSch).length > 0) || $thenSch === false : it.util.schemaHasRules($thenSch, it.RULES.all)), + $elsePresent = $elseSch !== undefined && (it.opts.strictKeywords ? (typeof $elseSch == 'object' && Object.keys($elseSch).length > 0) || $elseSch === false : it.util.schemaHasRules($elseSch, it.RULES.all)), + $currentBaseId = $it.baseId; + if ($thenPresent || $elsePresent) { + var $ifClause; + $it.createErrors = false; + $it.schema = $schema; + $it.schemaPath = $schemaPath; + $it.errSchemaPath = $errSchemaPath; + out += ' var ' + ($errs) + ' = errors; var ' + ($valid) + ' = true; '; + var $wasComposite = it.compositeRule; + it.compositeRule = $it.compositeRule = true; + out += ' ' + (it.validate($it)) + ' '; + $it.baseId = $currentBaseId; + $it.createErrors = true; + out += ' errors = ' + ($errs) + '; if (vErrors !== null) { if (' + ($errs) + ') vErrors.length = ' + ($errs) + '; else vErrors = null; } '; + it.compositeRule = $it.compositeRule = $wasComposite; + if ($thenPresent) { + out += ' if (' + ($nextValid) + ') { '; + $it.schema = it.schema['then']; + $it.schemaPath = it.schemaPath + '.then'; + $it.errSchemaPath = it.errSchemaPath + '/then'; + out += ' ' + (it.validate($it)) + ' '; + $it.baseId = $currentBaseId; + out += ' ' + ($valid) + ' = ' + ($nextValid) + '; '; + if ($thenPresent && $elsePresent) { + $ifClause = 'ifClause' + $lvl; + out += ' var ' + ($ifClause) + ' = \'then\'; '; + } else { + $ifClause = '\'then\''; + } + out += ' } '; + if ($elsePresent) { + out += ' else { '; + } + } else { + out += ' if (!' + ($nextValid) + ') { '; + } + if ($elsePresent) { + $it.schema = it.schema['else']; + $it.schemaPath = it.schemaPath + '.else'; + $it.errSchemaPath = it.errSchemaPath + '/else'; + out += ' ' + (it.validate($it)) + ' '; + $it.baseId = $currentBaseId; + out += ' ' + ($valid) + ' = ' + ($nextValid) + '; '; + if ($thenPresent && $elsePresent) { + $ifClause = 'ifClause' + $lvl; + out += ' var ' + ($ifClause) + ' = \'else\'; '; + } else { + $ifClause = '\'else\''; + } + out += ' } '; + } + out += ' if (!' + ($valid) + ') { var err = '; /* istanbul ignore else */ + if (it.createErrors !== false) { + out += ' { keyword: \'' + ('if') + '\' , dataPath: (dataPath || \'\') + ' + (it.errorPath) + ' , schemaPath: ' + (it.util.toQuotedString($errSchemaPath)) + ' , params: { failingKeyword: ' + ($ifClause) + ' } '; + if (it.opts.messages !== false) { + out += ' , message: \'should match "\' + ' + ($ifClause) + ' + \'" schema\' '; + } + if (it.opts.verbose) { + out += ' , schema: validate.schema' + ($schemaPath) + ' , parentSchema: validate.schema' + (it.schemaPath) + ' , data: ' + ($data) + ' '; + } + out += ' } '; + } else { + out += ' {} '; + } + out += '; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; '; + if (!it.compositeRule && $breakOnError) { + /* istanbul ignore if */ + if (it.async) { + out += ' throw new ValidationError(vErrors); '; + } else { + out += ' validate.errors = vErrors; return false; '; + } + } + out += ' } '; + if ($breakOnError) { + out += ' else { '; + } + } else { + if ($breakOnError) { + out += ' if (true) { '; + } + } + return out; +} + +},{}],27:[function(require,module,exports){ +'use strict'; + +//all requires must be explicit because browserify won't work with dynamic requires +module.exports = { + '$ref': require('./ref'), + allOf: require('./allOf'), + anyOf: require('./anyOf'), + '$comment': require('./comment'), + const: require('./const'), + contains: require('./contains'), + dependencies: require('./dependencies'), + 'enum': require('./enum'), + format: require('./format'), + 'if': require('./if'), + items: require('./items'), + maximum: require('./_limit'), + minimum: require('./_limit'), + maxItems: require('./_limitItems'), + minItems: require('./_limitItems'), + maxLength: require('./_limitLength'), + minLength: require('./_limitLength'), + maxProperties: require('./_limitProperties'), + minProperties: require('./_limitProperties'), + multipleOf: require('./multipleOf'), + not: require('./not'), + oneOf: require('./oneOf'), + pattern: require('./pattern'), + properties: require('./properties'), + propertyNames: require('./propertyNames'), + required: require('./required'), + uniqueItems: require('./uniqueItems'), + validate: require('./validate') +}; + +},{"./_limit":13,"./_limitItems":14,"./_limitLength":15,"./_limitProperties":16,"./allOf":17,"./anyOf":18,"./comment":19,"./const":20,"./contains":21,"./dependencies":23,"./enum":24,"./format":25,"./if":26,"./items":28,"./multipleOf":29,"./not":30,"./oneOf":31,"./pattern":32,"./properties":33,"./propertyNames":34,"./ref":35,"./required":36,"./uniqueItems":37,"./validate":38}],28:[function(require,module,exports){ +'use strict'; +module.exports = function generate_items(it, $keyword, $ruleType) { + var out = ' '; + var $lvl = it.level; + var $dataLvl = it.dataLevel; + var $schema = it.schema[$keyword]; + var $schemaPath = it.schemaPath + it.util.getProperty($keyword); + var $errSchemaPath = it.errSchemaPath + '/' + $keyword; + var $breakOnError = !it.opts.allErrors; + var $data = 'data' + ($dataLvl || ''); + var $valid = 'valid' + $lvl; + var $errs = 'errs__' + $lvl; + var $it = it.util.copy(it); + var $closingBraces = ''; + $it.level++; + var $nextValid = 'valid' + $it.level; + var $idx = 'i' + $lvl, + $dataNxt = $it.dataLevel = it.dataLevel + 1, + $nextData = 'data' + $dataNxt, + $currentBaseId = it.baseId; + out += 'var ' + ($errs) + ' = errors;var ' + ($valid) + ';'; + if (Array.isArray($schema)) { + var $additionalItems = it.schema.additionalItems; + if ($additionalItems === false) { + out += ' ' + ($valid) + ' = ' + ($data) + '.length <= ' + ($schema.length) + '; '; + var $currErrSchemaPath = $errSchemaPath; + $errSchemaPath = it.errSchemaPath + '/additionalItems'; + out += ' if (!' + ($valid) + ') { '; + var $$outStack = $$outStack || []; + $$outStack.push(out); + out = ''; /* istanbul ignore else */ + if (it.createErrors !== false) { + out += ' { keyword: \'' + ('additionalItems') + '\' , dataPath: (dataPath || \'\') + ' + (it.errorPath) + ' , schemaPath: ' + (it.util.toQuotedString($errSchemaPath)) + ' , params: { limit: ' + ($schema.length) + ' } '; + if (it.opts.messages !== false) { + out += ' , message: \'should NOT have more than ' + ($schema.length) + ' items\' '; + } + if (it.opts.verbose) { + out += ' , schema: false , parentSchema: validate.schema' + (it.schemaPath) + ' , data: ' + ($data) + ' '; + } + out += ' } '; + } else { + out += ' {} '; + } + var __err = out; + out = $$outStack.pop(); + if (!it.compositeRule && $breakOnError) { + /* istanbul ignore if */ + if (it.async) { + out += ' throw new ValidationError([' + (__err) + ']); '; + } else { + out += ' validate.errors = [' + (__err) + ']; return false; '; + } + } else { + out += ' var err = ' + (__err) + '; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; '; + } + out += ' } '; + $errSchemaPath = $currErrSchemaPath; + if ($breakOnError) { + $closingBraces += '}'; + out += ' else { '; + } + } + var arr1 = $schema; + if (arr1) { + var $sch, $i = -1, + l1 = arr1.length - 1; + while ($i < l1) { + $sch = arr1[$i += 1]; + if ((it.opts.strictKeywords ? (typeof $sch == 'object' && Object.keys($sch).length > 0) || $sch === false : it.util.schemaHasRules($sch, it.RULES.all))) { + out += ' ' + ($nextValid) + ' = true; if (' + ($data) + '.length > ' + ($i) + ') { '; + var $passData = $data + '[' + $i + ']'; + $it.schema = $sch; + $it.schemaPath = $schemaPath + '[' + $i + ']'; + $it.errSchemaPath = $errSchemaPath + '/' + $i; + $it.errorPath = it.util.getPathExpr(it.errorPath, $i, it.opts.jsonPointers, true); + $it.dataPathArr[$dataNxt] = $i; + var $code = it.validate($it); + $it.baseId = $currentBaseId; + if (it.util.varOccurences($code, $nextData) < 2) { + out += ' ' + (it.util.varReplace($code, $nextData, $passData)) + ' '; + } else { + out += ' var ' + ($nextData) + ' = ' + ($passData) + '; ' + ($code) + ' '; + } + out += ' } '; + if ($breakOnError) { + out += ' if (' + ($nextValid) + ') { '; + $closingBraces += '}'; + } + } + } + } + if (typeof $additionalItems == 'object' && (it.opts.strictKeywords ? (typeof $additionalItems == 'object' && Object.keys($additionalItems).length > 0) || $additionalItems === false : it.util.schemaHasRules($additionalItems, it.RULES.all))) { + $it.schema = $additionalItems; + $it.schemaPath = it.schemaPath + '.additionalItems'; + $it.errSchemaPath = it.errSchemaPath + '/additionalItems'; + out += ' ' + ($nextValid) + ' = true; if (' + ($data) + '.length > ' + ($schema.length) + ') { for (var ' + ($idx) + ' = ' + ($schema.length) + '; ' + ($idx) + ' < ' + ($data) + '.length; ' + ($idx) + '++) { '; + $it.errorPath = it.util.getPathExpr(it.errorPath, $idx, it.opts.jsonPointers, true); + var $passData = $data + '[' + $idx + ']'; + $it.dataPathArr[$dataNxt] = $idx; + var $code = it.validate($it); + $it.baseId = $currentBaseId; + if (it.util.varOccurences($code, $nextData) < 2) { + out += ' ' + (it.util.varReplace($code, $nextData, $passData)) + ' '; + } else { + out += ' var ' + ($nextData) + ' = ' + ($passData) + '; ' + ($code) + ' '; + } + if ($breakOnError) { + out += ' if (!' + ($nextValid) + ') break; '; + } + out += ' } } '; + if ($breakOnError) { + out += ' if (' + ($nextValid) + ') { '; + $closingBraces += '}'; + } + } + } else if ((it.opts.strictKeywords ? (typeof $schema == 'object' && Object.keys($schema).length > 0) || $schema === false : it.util.schemaHasRules($schema, it.RULES.all))) { + $it.schema = $schema; + $it.schemaPath = $schemaPath; + $it.errSchemaPath = $errSchemaPath; + out += ' for (var ' + ($idx) + ' = ' + (0) + '; ' + ($idx) + ' < ' + ($data) + '.length; ' + ($idx) + '++) { '; + $it.errorPath = it.util.getPathExpr(it.errorPath, $idx, it.opts.jsonPointers, true); + var $passData = $data + '[' + $idx + ']'; + $it.dataPathArr[$dataNxt] = $idx; + var $code = it.validate($it); + $it.baseId = $currentBaseId; + if (it.util.varOccurences($code, $nextData) < 2) { + out += ' ' + (it.util.varReplace($code, $nextData, $passData)) + ' '; + } else { + out += ' var ' + ($nextData) + ' = ' + ($passData) + '; ' + ($code) + ' '; + } + if ($breakOnError) { + out += ' if (!' + ($nextValid) + ') break; '; + } + out += ' }'; + } + if ($breakOnError) { + out += ' ' + ($closingBraces) + ' if (' + ($errs) + ' == errors) {'; + } + return out; +} + +},{}],29:[function(require,module,exports){ +'use strict'; +module.exports = function generate_multipleOf(it, $keyword, $ruleType) { + var out = ' '; + var $lvl = it.level; + var $dataLvl = it.dataLevel; + var $schema = it.schema[$keyword]; + var $schemaPath = it.schemaPath + it.util.getProperty($keyword); + var $errSchemaPath = it.errSchemaPath + '/' + $keyword; + var $breakOnError = !it.opts.allErrors; + var $data = 'data' + ($dataLvl || ''); + var $isData = it.opts.$data && $schema && $schema.$data, + $schemaValue; + if ($isData) { + out += ' var schema' + ($lvl) + ' = ' + (it.util.getData($schema.$data, $dataLvl, it.dataPathArr)) + '; '; + $schemaValue = 'schema' + $lvl; + } else { + $schemaValue = $schema; + } + if (!($isData || typeof $schema == 'number')) { + throw new Error($keyword + ' must be number'); + } + out += 'var division' + ($lvl) + ';if ('; + if ($isData) { + out += ' ' + ($schemaValue) + ' !== undefined && ( typeof ' + ($schemaValue) + ' != \'number\' || '; + } + out += ' (division' + ($lvl) + ' = ' + ($data) + ' / ' + ($schemaValue) + ', '; + if (it.opts.multipleOfPrecision) { + out += ' Math.abs(Math.round(division' + ($lvl) + ') - division' + ($lvl) + ') > 1e-' + (it.opts.multipleOfPrecision) + ' '; + } else { + out += ' division' + ($lvl) + ' !== parseInt(division' + ($lvl) + ') '; + } + out += ' ) '; + if ($isData) { + out += ' ) '; + } + out += ' ) { '; + var $$outStack = $$outStack || []; + $$outStack.push(out); + out = ''; /* istanbul ignore else */ + if (it.createErrors !== false) { + out += ' { keyword: \'' + ('multipleOf') + '\' , dataPath: (dataPath || \'\') + ' + (it.errorPath) + ' , schemaPath: ' + (it.util.toQuotedString($errSchemaPath)) + ' , params: { multipleOf: ' + ($schemaValue) + ' } '; + if (it.opts.messages !== false) { + out += ' , message: \'should be multiple of '; + if ($isData) { + out += '\' + ' + ($schemaValue); + } else { + out += '' + ($schemaValue) + '\''; + } + } + if (it.opts.verbose) { + out += ' , schema: '; + if ($isData) { + out += 'validate.schema' + ($schemaPath); + } else { + out += '' + ($schema); + } + out += ' , parentSchema: validate.schema' + (it.schemaPath) + ' , data: ' + ($data) + ' '; + } + out += ' } '; + } else { + out += ' {} '; + } + var __err = out; + out = $$outStack.pop(); + if (!it.compositeRule && $breakOnError) { + /* istanbul ignore if */ + if (it.async) { + out += ' throw new ValidationError([' + (__err) + ']); '; + } else { + out += ' validate.errors = [' + (__err) + ']; return false; '; + } + } else { + out += ' var err = ' + (__err) + '; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; '; + } + out += '} '; + if ($breakOnError) { + out += ' else { '; + } + return out; +} + +},{}],30:[function(require,module,exports){ +'use strict'; +module.exports = function generate_not(it, $keyword, $ruleType) { + var out = ' '; + var $lvl = it.level; + var $dataLvl = it.dataLevel; + var $schema = it.schema[$keyword]; + var $schemaPath = it.schemaPath + it.util.getProperty($keyword); + var $errSchemaPath = it.errSchemaPath + '/' + $keyword; + var $breakOnError = !it.opts.allErrors; + var $data = 'data' + ($dataLvl || ''); + var $errs = 'errs__' + $lvl; + var $it = it.util.copy(it); + $it.level++; + var $nextValid = 'valid' + $it.level; + if ((it.opts.strictKeywords ? (typeof $schema == 'object' && Object.keys($schema).length > 0) || $schema === false : it.util.schemaHasRules($schema, it.RULES.all))) { + $it.schema = $schema; + $it.schemaPath = $schemaPath; + $it.errSchemaPath = $errSchemaPath; + out += ' var ' + ($errs) + ' = errors; '; + var $wasComposite = it.compositeRule; + it.compositeRule = $it.compositeRule = true; + $it.createErrors = false; + var $allErrorsOption; + if ($it.opts.allErrors) { + $allErrorsOption = $it.opts.allErrors; + $it.opts.allErrors = false; + } + out += ' ' + (it.validate($it)) + ' '; + $it.createErrors = true; + if ($allErrorsOption) $it.opts.allErrors = $allErrorsOption; + it.compositeRule = $it.compositeRule = $wasComposite; + out += ' if (' + ($nextValid) + ') { '; + var $$outStack = $$outStack || []; + $$outStack.push(out); + out = ''; /* istanbul ignore else */ + if (it.createErrors !== false) { + out += ' { keyword: \'' + ('not') + '\' , dataPath: (dataPath || \'\') + ' + (it.errorPath) + ' , schemaPath: ' + (it.util.toQuotedString($errSchemaPath)) + ' , params: {} '; + if (it.opts.messages !== false) { + out += ' , message: \'should NOT be valid\' '; + } + if (it.opts.verbose) { + out += ' , schema: validate.schema' + ($schemaPath) + ' , parentSchema: validate.schema' + (it.schemaPath) + ' , data: ' + ($data) + ' '; + } + out += ' } '; + } else { + out += ' {} '; + } + var __err = out; + out = $$outStack.pop(); + if (!it.compositeRule && $breakOnError) { + /* istanbul ignore if */ + if (it.async) { + out += ' throw new ValidationError([' + (__err) + ']); '; + } else { + out += ' validate.errors = [' + (__err) + ']; return false; '; + } + } else { + out += ' var err = ' + (__err) + '; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; '; + } + out += ' } else { errors = ' + ($errs) + '; if (vErrors !== null) { if (' + ($errs) + ') vErrors.length = ' + ($errs) + '; else vErrors = null; } '; + if (it.opts.allErrors) { + out += ' } '; + } + } else { + out += ' var err = '; /* istanbul ignore else */ + if (it.createErrors !== false) { + out += ' { keyword: \'' + ('not') + '\' , dataPath: (dataPath || \'\') + ' + (it.errorPath) + ' , schemaPath: ' + (it.util.toQuotedString($errSchemaPath)) + ' , params: {} '; + if (it.opts.messages !== false) { + out += ' , message: \'should NOT be valid\' '; + } + if (it.opts.verbose) { + out += ' , schema: validate.schema' + ($schemaPath) + ' , parentSchema: validate.schema' + (it.schemaPath) + ' , data: ' + ($data) + ' '; + } + out += ' } '; + } else { + out += ' {} '; + } + out += '; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; '; + if ($breakOnError) { + out += ' if (false) { '; + } + } + return out; +} + +},{}],31:[function(require,module,exports){ +'use strict'; +module.exports = function generate_oneOf(it, $keyword, $ruleType) { + var out = ' '; + var $lvl = it.level; + var $dataLvl = it.dataLevel; + var $schema = it.schema[$keyword]; + var $schemaPath = it.schemaPath + it.util.getProperty($keyword); + var $errSchemaPath = it.errSchemaPath + '/' + $keyword; + var $breakOnError = !it.opts.allErrors; + var $data = 'data' + ($dataLvl || ''); + var $valid = 'valid' + $lvl; + var $errs = 'errs__' + $lvl; + var $it = it.util.copy(it); + var $closingBraces = ''; + $it.level++; + var $nextValid = 'valid' + $it.level; + var $currentBaseId = $it.baseId, + $prevValid = 'prevValid' + $lvl, + $passingSchemas = 'passingSchemas' + $lvl; + out += 'var ' + ($errs) + ' = errors , ' + ($prevValid) + ' = false , ' + ($valid) + ' = false , ' + ($passingSchemas) + ' = null; '; + var $wasComposite = it.compositeRule; + it.compositeRule = $it.compositeRule = true; + var arr1 = $schema; + if (arr1) { + var $sch, $i = -1, + l1 = arr1.length - 1; + while ($i < l1) { + $sch = arr1[$i += 1]; + if ((it.opts.strictKeywords ? (typeof $sch == 'object' && Object.keys($sch).length > 0) || $sch === false : it.util.schemaHasRules($sch, it.RULES.all))) { + $it.schema = $sch; + $it.schemaPath = $schemaPath + '[' + $i + ']'; + $it.errSchemaPath = $errSchemaPath + '/' + $i; + out += ' ' + (it.validate($it)) + ' '; + $it.baseId = $currentBaseId; + } else { + out += ' var ' + ($nextValid) + ' = true; '; + } + if ($i) { + out += ' if (' + ($nextValid) + ' && ' + ($prevValid) + ') { ' + ($valid) + ' = false; ' + ($passingSchemas) + ' = [' + ($passingSchemas) + ', ' + ($i) + ']; } else { '; + $closingBraces += '}'; + } + out += ' if (' + ($nextValid) + ') { ' + ($valid) + ' = ' + ($prevValid) + ' = true; ' + ($passingSchemas) + ' = ' + ($i) + '; }'; + } + } + it.compositeRule = $it.compositeRule = $wasComposite; + out += '' + ($closingBraces) + 'if (!' + ($valid) + ') { var err = '; /* istanbul ignore else */ + if (it.createErrors !== false) { + out += ' { keyword: \'' + ('oneOf') + '\' , dataPath: (dataPath || \'\') + ' + (it.errorPath) + ' , schemaPath: ' + (it.util.toQuotedString($errSchemaPath)) + ' , params: { passingSchemas: ' + ($passingSchemas) + ' } '; + if (it.opts.messages !== false) { + out += ' , message: \'should match exactly one schema in oneOf\' '; + } + if (it.opts.verbose) { + out += ' , schema: validate.schema' + ($schemaPath) + ' , parentSchema: validate.schema' + (it.schemaPath) + ' , data: ' + ($data) + ' '; + } + out += ' } '; + } else { + out += ' {} '; + } + out += '; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; '; + if (!it.compositeRule && $breakOnError) { + /* istanbul ignore if */ + if (it.async) { + out += ' throw new ValidationError(vErrors); '; + } else { + out += ' validate.errors = vErrors; return false; '; + } + } + out += '} else { errors = ' + ($errs) + '; if (vErrors !== null) { if (' + ($errs) + ') vErrors.length = ' + ($errs) + '; else vErrors = null; }'; + if (it.opts.allErrors) { + out += ' } '; + } + return out; +} + +},{}],32:[function(require,module,exports){ +'use strict'; +module.exports = function generate_pattern(it, $keyword, $ruleType) { + var out = ' '; + var $lvl = it.level; + var $dataLvl = it.dataLevel; + var $schema = it.schema[$keyword]; + var $schemaPath = it.schemaPath + it.util.getProperty($keyword); + var $errSchemaPath = it.errSchemaPath + '/' + $keyword; + var $breakOnError = !it.opts.allErrors; + var $data = 'data' + ($dataLvl || ''); + var $isData = it.opts.$data && $schema && $schema.$data, + $schemaValue; + if ($isData) { + out += ' var schema' + ($lvl) + ' = ' + (it.util.getData($schema.$data, $dataLvl, it.dataPathArr)) + '; '; + $schemaValue = 'schema' + $lvl; + } else { + $schemaValue = $schema; + } + var $regexp = $isData ? '(new RegExp(' + $schemaValue + '))' : it.usePattern($schema); + out += 'if ( '; + if ($isData) { + out += ' (' + ($schemaValue) + ' !== undefined && typeof ' + ($schemaValue) + ' != \'string\') || '; + } + out += ' !' + ($regexp) + '.test(' + ($data) + ') ) { '; + var $$outStack = $$outStack || []; + $$outStack.push(out); + out = ''; /* istanbul ignore else */ + if (it.createErrors !== false) { + out += ' { keyword: \'' + ('pattern') + '\' , dataPath: (dataPath || \'\') + ' + (it.errorPath) + ' , schemaPath: ' + (it.util.toQuotedString($errSchemaPath)) + ' , params: { pattern: '; + if ($isData) { + out += '' + ($schemaValue); + } else { + out += '' + (it.util.toQuotedString($schema)); + } + out += ' } '; + if (it.opts.messages !== false) { + out += ' , message: \'should match pattern "'; + if ($isData) { + out += '\' + ' + ($schemaValue) + ' + \''; + } else { + out += '' + (it.util.escapeQuotes($schema)); + } + out += '"\' '; + } + if (it.opts.verbose) { + out += ' , schema: '; + if ($isData) { + out += 'validate.schema' + ($schemaPath); + } else { + out += '' + (it.util.toQuotedString($schema)); + } + out += ' , parentSchema: validate.schema' + (it.schemaPath) + ' , data: ' + ($data) + ' '; + } + out += ' } '; + } else { + out += ' {} '; + } + var __err = out; + out = $$outStack.pop(); + if (!it.compositeRule && $breakOnError) { + /* istanbul ignore if */ + if (it.async) { + out += ' throw new ValidationError([' + (__err) + ']); '; + } else { + out += ' validate.errors = [' + (__err) + ']; return false; '; + } + } else { + out += ' var err = ' + (__err) + '; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; '; + } + out += '} '; + if ($breakOnError) { + out += ' else { '; + } + return out; +} + +},{}],33:[function(require,module,exports){ +'use strict'; +module.exports = function generate_properties(it, $keyword, $ruleType) { + var out = ' '; + var $lvl = it.level; + var $dataLvl = it.dataLevel; + var $schema = it.schema[$keyword]; + var $schemaPath = it.schemaPath + it.util.getProperty($keyword); + var $errSchemaPath = it.errSchemaPath + '/' + $keyword; + var $breakOnError = !it.opts.allErrors; + var $data = 'data' + ($dataLvl || ''); + var $errs = 'errs__' + $lvl; + var $it = it.util.copy(it); + var $closingBraces = ''; + $it.level++; + var $nextValid = 'valid' + $it.level; + var $key = 'key' + $lvl, + $idx = 'idx' + $lvl, + $dataNxt = $it.dataLevel = it.dataLevel + 1, + $nextData = 'data' + $dataNxt, + $dataProperties = 'dataProperties' + $lvl; + var $schemaKeys = Object.keys($schema || {}).filter(notProto), + $pProperties = it.schema.patternProperties || {}, + $pPropertyKeys = Object.keys($pProperties).filter(notProto), + $aProperties = it.schema.additionalProperties, + $someProperties = $schemaKeys.length || $pPropertyKeys.length, + $noAdditional = $aProperties === false, + $additionalIsSchema = typeof $aProperties == 'object' && Object.keys($aProperties).length, + $removeAdditional = it.opts.removeAdditional, + $checkAdditional = $noAdditional || $additionalIsSchema || $removeAdditional, + $ownProperties = it.opts.ownProperties, + $currentBaseId = it.baseId; + var $required = it.schema.required; + if ($required && !(it.opts.$data && $required.$data) && $required.length < it.opts.loopRequired) { + var $requiredHash = it.util.toHash($required); + } + + function notProto(p) { + return p !== '__proto__'; + } + out += 'var ' + ($errs) + ' = errors;var ' + ($nextValid) + ' = true;'; + if ($ownProperties) { + out += ' var ' + ($dataProperties) + ' = undefined;'; + } + if ($checkAdditional) { + if ($ownProperties) { + out += ' ' + ($dataProperties) + ' = ' + ($dataProperties) + ' || Object.keys(' + ($data) + '); for (var ' + ($idx) + '=0; ' + ($idx) + '<' + ($dataProperties) + '.length; ' + ($idx) + '++) { var ' + ($key) + ' = ' + ($dataProperties) + '[' + ($idx) + ']; '; + } else { + out += ' for (var ' + ($key) + ' in ' + ($data) + ') { '; + } + if ($someProperties) { + out += ' var isAdditional' + ($lvl) + ' = !(false '; + if ($schemaKeys.length) { + if ($schemaKeys.length > 8) { + out += ' || validate.schema' + ($schemaPath) + '.hasOwnProperty(' + ($key) + ') '; + } else { + var arr1 = $schemaKeys; + if (arr1) { + var $propertyKey, i1 = -1, + l1 = arr1.length - 1; + while (i1 < l1) { + $propertyKey = arr1[i1 += 1]; + out += ' || ' + ($key) + ' == ' + (it.util.toQuotedString($propertyKey)) + ' '; + } + } + } + } + if ($pPropertyKeys.length) { + var arr2 = $pPropertyKeys; + if (arr2) { + var $pProperty, $i = -1, + l2 = arr2.length - 1; + while ($i < l2) { + $pProperty = arr2[$i += 1]; + out += ' || ' + (it.usePattern($pProperty)) + '.test(' + ($key) + ') '; + } + } + } + out += ' ); if (isAdditional' + ($lvl) + ') { '; + } + if ($removeAdditional == 'all') { + out += ' delete ' + ($data) + '[' + ($key) + ']; '; + } else { + var $currentErrorPath = it.errorPath; + var $additionalProperty = '\' + ' + $key + ' + \''; + if (it.opts._errorDataPathProperty) { + it.errorPath = it.util.getPathExpr(it.errorPath, $key, it.opts.jsonPointers); + } + if ($noAdditional) { + if ($removeAdditional) { + out += ' delete ' + ($data) + '[' + ($key) + ']; '; + } else { + out += ' ' + ($nextValid) + ' = false; '; + var $currErrSchemaPath = $errSchemaPath; + $errSchemaPath = it.errSchemaPath + '/additionalProperties'; + var $$outStack = $$outStack || []; + $$outStack.push(out); + out = ''; /* istanbul ignore else */ + if (it.createErrors !== false) { + out += ' { keyword: \'' + ('additionalProperties') + '\' , dataPath: (dataPath || \'\') + ' + (it.errorPath) + ' , schemaPath: ' + (it.util.toQuotedString($errSchemaPath)) + ' , params: { additionalProperty: \'' + ($additionalProperty) + '\' } '; + if (it.opts.messages !== false) { + out += ' , message: \''; + if (it.opts._errorDataPathProperty) { + out += 'is an invalid additional property'; + } else { + out += 'should NOT have additional properties'; + } + out += '\' '; + } + if (it.opts.verbose) { + out += ' , schema: false , parentSchema: validate.schema' + (it.schemaPath) + ' , data: ' + ($data) + ' '; + } + out += ' } '; + } else { + out += ' {} '; + } + var __err = out; + out = $$outStack.pop(); + if (!it.compositeRule && $breakOnError) { + /* istanbul ignore if */ + if (it.async) { + out += ' throw new ValidationError([' + (__err) + ']); '; + } else { + out += ' validate.errors = [' + (__err) + ']; return false; '; + } + } else { + out += ' var err = ' + (__err) + '; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; '; + } + $errSchemaPath = $currErrSchemaPath; + if ($breakOnError) { + out += ' break; '; + } + } + } else if ($additionalIsSchema) { + if ($removeAdditional == 'failing') { + out += ' var ' + ($errs) + ' = errors; '; + var $wasComposite = it.compositeRule; + it.compositeRule = $it.compositeRule = true; + $it.schema = $aProperties; + $it.schemaPath = it.schemaPath + '.additionalProperties'; + $it.errSchemaPath = it.errSchemaPath + '/additionalProperties'; + $it.errorPath = it.opts._errorDataPathProperty ? it.errorPath : it.util.getPathExpr(it.errorPath, $key, it.opts.jsonPointers); + var $passData = $data + '[' + $key + ']'; + $it.dataPathArr[$dataNxt] = $key; + var $code = it.validate($it); + $it.baseId = $currentBaseId; + if (it.util.varOccurences($code, $nextData) < 2) { + out += ' ' + (it.util.varReplace($code, $nextData, $passData)) + ' '; + } else { + out += ' var ' + ($nextData) + ' = ' + ($passData) + '; ' + ($code) + ' '; + } + out += ' if (!' + ($nextValid) + ') { errors = ' + ($errs) + '; if (validate.errors !== null) { if (errors) validate.errors.length = errors; else validate.errors = null; } delete ' + ($data) + '[' + ($key) + ']; } '; + it.compositeRule = $it.compositeRule = $wasComposite; + } else { + $it.schema = $aProperties; + $it.schemaPath = it.schemaPath + '.additionalProperties'; + $it.errSchemaPath = it.errSchemaPath + '/additionalProperties'; + $it.errorPath = it.opts._errorDataPathProperty ? it.errorPath : it.util.getPathExpr(it.errorPath, $key, it.opts.jsonPointers); + var $passData = $data + '[' + $key + ']'; + $it.dataPathArr[$dataNxt] = $key; + var $code = it.validate($it); + $it.baseId = $currentBaseId; + if (it.util.varOccurences($code, $nextData) < 2) { + out += ' ' + (it.util.varReplace($code, $nextData, $passData)) + ' '; + } else { + out += ' var ' + ($nextData) + ' = ' + ($passData) + '; ' + ($code) + ' '; + } + if ($breakOnError) { + out += ' if (!' + ($nextValid) + ') break; '; + } + } + } + it.errorPath = $currentErrorPath; + } + if ($someProperties) { + out += ' } '; + } + out += ' } '; + if ($breakOnError) { + out += ' if (' + ($nextValid) + ') { '; + $closingBraces += '}'; + } + } + var $useDefaults = it.opts.useDefaults && !it.compositeRule; + if ($schemaKeys.length) { + var arr3 = $schemaKeys; + if (arr3) { + var $propertyKey, i3 = -1, + l3 = arr3.length - 1; + while (i3 < l3) { + $propertyKey = arr3[i3 += 1]; + var $sch = $schema[$propertyKey]; + if ((it.opts.strictKeywords ? (typeof $sch == 'object' && Object.keys($sch).length > 0) || $sch === false : it.util.schemaHasRules($sch, it.RULES.all))) { + var $prop = it.util.getProperty($propertyKey), + $passData = $data + $prop, + $hasDefault = $useDefaults && $sch.default !== undefined; + $it.schema = $sch; + $it.schemaPath = $schemaPath + $prop; + $it.errSchemaPath = $errSchemaPath + '/' + it.util.escapeFragment($propertyKey); + $it.errorPath = it.util.getPath(it.errorPath, $propertyKey, it.opts.jsonPointers); + $it.dataPathArr[$dataNxt] = it.util.toQuotedString($propertyKey); + var $code = it.validate($it); + $it.baseId = $currentBaseId; + if (it.util.varOccurences($code, $nextData) < 2) { + $code = it.util.varReplace($code, $nextData, $passData); + var $useData = $passData; + } else { + var $useData = $nextData; + out += ' var ' + ($nextData) + ' = ' + ($passData) + '; '; + } + if ($hasDefault) { + out += ' ' + ($code) + ' '; + } else { + if ($requiredHash && $requiredHash[$propertyKey]) { + out += ' if ( ' + ($useData) + ' === undefined '; + if ($ownProperties) { + out += ' || ! Object.prototype.hasOwnProperty.call(' + ($data) + ', \'' + (it.util.escapeQuotes($propertyKey)) + '\') '; + } + out += ') { ' + ($nextValid) + ' = false; '; + var $currentErrorPath = it.errorPath, + $currErrSchemaPath = $errSchemaPath, + $missingProperty = it.util.escapeQuotes($propertyKey); + if (it.opts._errorDataPathProperty) { + it.errorPath = it.util.getPath($currentErrorPath, $propertyKey, it.opts.jsonPointers); + } + $errSchemaPath = it.errSchemaPath + '/required'; + var $$outStack = $$outStack || []; + $$outStack.push(out); + out = ''; /* istanbul ignore else */ + if (it.createErrors !== false) { + out += ' { keyword: \'' + ('required') + '\' , dataPath: (dataPath || \'\') + ' + (it.errorPath) + ' , schemaPath: ' + (it.util.toQuotedString($errSchemaPath)) + ' , params: { missingProperty: \'' + ($missingProperty) + '\' } '; + if (it.opts.messages !== false) { + out += ' , message: \''; + if (it.opts._errorDataPathProperty) { + out += 'is a required property'; + } else { + out += 'should have required property \\\'' + ($missingProperty) + '\\\''; + } + out += '\' '; + } + if (it.opts.verbose) { + out += ' , schema: validate.schema' + ($schemaPath) + ' , parentSchema: validate.schema' + (it.schemaPath) + ' , data: ' + ($data) + ' '; + } + out += ' } '; + } else { + out += ' {} '; + } + var __err = out; + out = $$outStack.pop(); + if (!it.compositeRule && $breakOnError) { + /* istanbul ignore if */ + if (it.async) { + out += ' throw new ValidationError([' + (__err) + ']); '; + } else { + out += ' validate.errors = [' + (__err) + ']; return false; '; + } + } else { + out += ' var err = ' + (__err) + '; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; '; + } + $errSchemaPath = $currErrSchemaPath; + it.errorPath = $currentErrorPath; + out += ' } else { '; + } else { + if ($breakOnError) { + out += ' if ( ' + ($useData) + ' === undefined '; + if ($ownProperties) { + out += ' || ! Object.prototype.hasOwnProperty.call(' + ($data) + ', \'' + (it.util.escapeQuotes($propertyKey)) + '\') '; + } + out += ') { ' + ($nextValid) + ' = true; } else { '; + } else { + out += ' if (' + ($useData) + ' !== undefined '; + if ($ownProperties) { + out += ' && Object.prototype.hasOwnProperty.call(' + ($data) + ', \'' + (it.util.escapeQuotes($propertyKey)) + '\') '; + } + out += ' ) { '; + } + } + out += ' ' + ($code) + ' } '; + } + } + if ($breakOnError) { + out += ' if (' + ($nextValid) + ') { '; + $closingBraces += '}'; + } + } + } + } + if ($pPropertyKeys.length) { + var arr4 = $pPropertyKeys; + if (arr4) { + var $pProperty, i4 = -1, + l4 = arr4.length - 1; + while (i4 < l4) { + $pProperty = arr4[i4 += 1]; + var $sch = $pProperties[$pProperty]; + if ((it.opts.strictKeywords ? (typeof $sch == 'object' && Object.keys($sch).length > 0) || $sch === false : it.util.schemaHasRules($sch, it.RULES.all))) { + $it.schema = $sch; + $it.schemaPath = it.schemaPath + '.patternProperties' + it.util.getProperty($pProperty); + $it.errSchemaPath = it.errSchemaPath + '/patternProperties/' + it.util.escapeFragment($pProperty); + if ($ownProperties) { + out += ' ' + ($dataProperties) + ' = ' + ($dataProperties) + ' || Object.keys(' + ($data) + '); for (var ' + ($idx) + '=0; ' + ($idx) + '<' + ($dataProperties) + '.length; ' + ($idx) + '++) { var ' + ($key) + ' = ' + ($dataProperties) + '[' + ($idx) + ']; '; + } else { + out += ' for (var ' + ($key) + ' in ' + ($data) + ') { '; + } + out += ' if (' + (it.usePattern($pProperty)) + '.test(' + ($key) + ')) { '; + $it.errorPath = it.util.getPathExpr(it.errorPath, $key, it.opts.jsonPointers); + var $passData = $data + '[' + $key + ']'; + $it.dataPathArr[$dataNxt] = $key; + var $code = it.validate($it); + $it.baseId = $currentBaseId; + if (it.util.varOccurences($code, $nextData) < 2) { + out += ' ' + (it.util.varReplace($code, $nextData, $passData)) + ' '; + } else { + out += ' var ' + ($nextData) + ' = ' + ($passData) + '; ' + ($code) + ' '; + } + if ($breakOnError) { + out += ' if (!' + ($nextValid) + ') break; '; + } + out += ' } '; + if ($breakOnError) { + out += ' else ' + ($nextValid) + ' = true; '; + } + out += ' } '; + if ($breakOnError) { + out += ' if (' + ($nextValid) + ') { '; + $closingBraces += '}'; + } + } + } + } + } + if ($breakOnError) { + out += ' ' + ($closingBraces) + ' if (' + ($errs) + ' == errors) {'; + } + return out; +} + +},{}],34:[function(require,module,exports){ +'use strict'; +module.exports = function generate_propertyNames(it, $keyword, $ruleType) { + var out = ' '; + var $lvl = it.level; + var $dataLvl = it.dataLevel; + var $schema = it.schema[$keyword]; + var $schemaPath = it.schemaPath + it.util.getProperty($keyword); + var $errSchemaPath = it.errSchemaPath + '/' + $keyword; + var $breakOnError = !it.opts.allErrors; + var $data = 'data' + ($dataLvl || ''); + var $errs = 'errs__' + $lvl; + var $it = it.util.copy(it); + var $closingBraces = ''; + $it.level++; + var $nextValid = 'valid' + $it.level; + out += 'var ' + ($errs) + ' = errors;'; + if ((it.opts.strictKeywords ? (typeof $schema == 'object' && Object.keys($schema).length > 0) || $schema === false : it.util.schemaHasRules($schema, it.RULES.all))) { + $it.schema = $schema; + $it.schemaPath = $schemaPath; + $it.errSchemaPath = $errSchemaPath; + var $key = 'key' + $lvl, + $idx = 'idx' + $lvl, + $i = 'i' + $lvl, + $invalidName = '\' + ' + $key + ' + \'', + $dataNxt = $it.dataLevel = it.dataLevel + 1, + $nextData = 'data' + $dataNxt, + $dataProperties = 'dataProperties' + $lvl, + $ownProperties = it.opts.ownProperties, + $currentBaseId = it.baseId; + if ($ownProperties) { + out += ' var ' + ($dataProperties) + ' = undefined; '; + } + if ($ownProperties) { + out += ' ' + ($dataProperties) + ' = ' + ($dataProperties) + ' || Object.keys(' + ($data) + '); for (var ' + ($idx) + '=0; ' + ($idx) + '<' + ($dataProperties) + '.length; ' + ($idx) + '++) { var ' + ($key) + ' = ' + ($dataProperties) + '[' + ($idx) + ']; '; + } else { + out += ' for (var ' + ($key) + ' in ' + ($data) + ') { '; + } + out += ' var startErrs' + ($lvl) + ' = errors; '; + var $passData = $key; + var $wasComposite = it.compositeRule; + it.compositeRule = $it.compositeRule = true; + var $code = it.validate($it); + $it.baseId = $currentBaseId; + if (it.util.varOccurences($code, $nextData) < 2) { + out += ' ' + (it.util.varReplace($code, $nextData, $passData)) + ' '; + } else { + out += ' var ' + ($nextData) + ' = ' + ($passData) + '; ' + ($code) + ' '; + } + it.compositeRule = $it.compositeRule = $wasComposite; + out += ' if (!' + ($nextValid) + ') { for (var ' + ($i) + '=startErrs' + ($lvl) + '; ' + ($i) + ' 0) || $propertySch === false : it.util.schemaHasRules($propertySch, it.RULES.all)))) { + $required[$required.length] = $property; + } + } + } + } else { + var $required = $schema; + } + } + if ($isData || $required.length) { + var $currentErrorPath = it.errorPath, + $loopRequired = $isData || $required.length >= it.opts.loopRequired, + $ownProperties = it.opts.ownProperties; + if ($breakOnError) { + out += ' var missing' + ($lvl) + '; '; + if ($loopRequired) { + if (!$isData) { + out += ' var ' + ($vSchema) + ' = validate.schema' + ($schemaPath) + '; '; + } + var $i = 'i' + $lvl, + $propertyPath = 'schema' + $lvl + '[' + $i + ']', + $missingProperty = '\' + ' + $propertyPath + ' + \''; + if (it.opts._errorDataPathProperty) { + it.errorPath = it.util.getPathExpr($currentErrorPath, $propertyPath, it.opts.jsonPointers); + } + out += ' var ' + ($valid) + ' = true; '; + if ($isData) { + out += ' if (schema' + ($lvl) + ' === undefined) ' + ($valid) + ' = true; else if (!Array.isArray(schema' + ($lvl) + ')) ' + ($valid) + ' = false; else {'; + } + out += ' for (var ' + ($i) + ' = 0; ' + ($i) + ' < ' + ($vSchema) + '.length; ' + ($i) + '++) { ' + ($valid) + ' = ' + ($data) + '[' + ($vSchema) + '[' + ($i) + ']] !== undefined '; + if ($ownProperties) { + out += ' && Object.prototype.hasOwnProperty.call(' + ($data) + ', ' + ($vSchema) + '[' + ($i) + ']) '; + } + out += '; if (!' + ($valid) + ') break; } '; + if ($isData) { + out += ' } '; + } + out += ' if (!' + ($valid) + ') { '; + var $$outStack = $$outStack || []; + $$outStack.push(out); + out = ''; /* istanbul ignore else */ + if (it.createErrors !== false) { + out += ' { keyword: \'' + ('required') + '\' , dataPath: (dataPath || \'\') + ' + (it.errorPath) + ' , schemaPath: ' + (it.util.toQuotedString($errSchemaPath)) + ' , params: { missingProperty: \'' + ($missingProperty) + '\' } '; + if (it.opts.messages !== false) { + out += ' , message: \''; + if (it.opts._errorDataPathProperty) { + out += 'is a required property'; + } else { + out += 'should have required property \\\'' + ($missingProperty) + '\\\''; + } + out += '\' '; + } + if (it.opts.verbose) { + out += ' , schema: validate.schema' + ($schemaPath) + ' , parentSchema: validate.schema' + (it.schemaPath) + ' , data: ' + ($data) + ' '; + } + out += ' } '; + } else { + out += ' {} '; + } + var __err = out; + out = $$outStack.pop(); + if (!it.compositeRule && $breakOnError) { + /* istanbul ignore if */ + if (it.async) { + out += ' throw new ValidationError([' + (__err) + ']); '; + } else { + out += ' validate.errors = [' + (__err) + ']; return false; '; + } + } else { + out += ' var err = ' + (__err) + '; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; '; + } + out += ' } else { '; + } else { + out += ' if ( '; + var arr2 = $required; + if (arr2) { + var $propertyKey, $i = -1, + l2 = arr2.length - 1; + while ($i < l2) { + $propertyKey = arr2[$i += 1]; + if ($i) { + out += ' || '; + } + var $prop = it.util.getProperty($propertyKey), + $useData = $data + $prop; + out += ' ( ( ' + ($useData) + ' === undefined '; + if ($ownProperties) { + out += ' || ! Object.prototype.hasOwnProperty.call(' + ($data) + ', \'' + (it.util.escapeQuotes($propertyKey)) + '\') '; + } + out += ') && (missing' + ($lvl) + ' = ' + (it.util.toQuotedString(it.opts.jsonPointers ? $propertyKey : $prop)) + ') ) '; + } + } + out += ') { '; + var $propertyPath = 'missing' + $lvl, + $missingProperty = '\' + ' + $propertyPath + ' + \''; + if (it.opts._errorDataPathProperty) { + it.errorPath = it.opts.jsonPointers ? it.util.getPathExpr($currentErrorPath, $propertyPath, true) : $currentErrorPath + ' + ' + $propertyPath; + } + var $$outStack = $$outStack || []; + $$outStack.push(out); + out = ''; /* istanbul ignore else */ + if (it.createErrors !== false) { + out += ' { keyword: \'' + ('required') + '\' , dataPath: (dataPath || \'\') + ' + (it.errorPath) + ' , schemaPath: ' + (it.util.toQuotedString($errSchemaPath)) + ' , params: { missingProperty: \'' + ($missingProperty) + '\' } '; + if (it.opts.messages !== false) { + out += ' , message: \''; + if (it.opts._errorDataPathProperty) { + out += 'is a required property'; + } else { + out += 'should have required property \\\'' + ($missingProperty) + '\\\''; + } + out += '\' '; + } + if (it.opts.verbose) { + out += ' , schema: validate.schema' + ($schemaPath) + ' , parentSchema: validate.schema' + (it.schemaPath) + ' , data: ' + ($data) + ' '; + } + out += ' } '; + } else { + out += ' {} '; + } + var __err = out; + out = $$outStack.pop(); + if (!it.compositeRule && $breakOnError) { + /* istanbul ignore if */ + if (it.async) { + out += ' throw new ValidationError([' + (__err) + ']); '; + } else { + out += ' validate.errors = [' + (__err) + ']; return false; '; + } + } else { + out += ' var err = ' + (__err) + '; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; '; + } + out += ' } else { '; + } + } else { + if ($loopRequired) { + if (!$isData) { + out += ' var ' + ($vSchema) + ' = validate.schema' + ($schemaPath) + '; '; + } + var $i = 'i' + $lvl, + $propertyPath = 'schema' + $lvl + '[' + $i + ']', + $missingProperty = '\' + ' + $propertyPath + ' + \''; + if (it.opts._errorDataPathProperty) { + it.errorPath = it.util.getPathExpr($currentErrorPath, $propertyPath, it.opts.jsonPointers); + } + if ($isData) { + out += ' if (' + ($vSchema) + ' && !Array.isArray(' + ($vSchema) + ')) { var err = '; /* istanbul ignore else */ + if (it.createErrors !== false) { + out += ' { keyword: \'' + ('required') + '\' , dataPath: (dataPath || \'\') + ' + (it.errorPath) + ' , schemaPath: ' + (it.util.toQuotedString($errSchemaPath)) + ' , params: { missingProperty: \'' + ($missingProperty) + '\' } '; + if (it.opts.messages !== false) { + out += ' , message: \''; + if (it.opts._errorDataPathProperty) { + out += 'is a required property'; + } else { + out += 'should have required property \\\'' + ($missingProperty) + '\\\''; + } + out += '\' '; + } + if (it.opts.verbose) { + out += ' , schema: validate.schema' + ($schemaPath) + ' , parentSchema: validate.schema' + (it.schemaPath) + ' , data: ' + ($data) + ' '; + } + out += ' } '; + } else { + out += ' {} '; + } + out += '; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; } else if (' + ($vSchema) + ' !== undefined) { '; + } + out += ' for (var ' + ($i) + ' = 0; ' + ($i) + ' < ' + ($vSchema) + '.length; ' + ($i) + '++) { if (' + ($data) + '[' + ($vSchema) + '[' + ($i) + ']] === undefined '; + if ($ownProperties) { + out += ' || ! Object.prototype.hasOwnProperty.call(' + ($data) + ', ' + ($vSchema) + '[' + ($i) + ']) '; + } + out += ') { var err = '; /* istanbul ignore else */ + if (it.createErrors !== false) { + out += ' { keyword: \'' + ('required') + '\' , dataPath: (dataPath || \'\') + ' + (it.errorPath) + ' , schemaPath: ' + (it.util.toQuotedString($errSchemaPath)) + ' , params: { missingProperty: \'' + ($missingProperty) + '\' } '; + if (it.opts.messages !== false) { + out += ' , message: \''; + if (it.opts._errorDataPathProperty) { + out += 'is a required property'; + } else { + out += 'should have required property \\\'' + ($missingProperty) + '\\\''; + } + out += '\' '; + } + if (it.opts.verbose) { + out += ' , schema: validate.schema' + ($schemaPath) + ' , parentSchema: validate.schema' + (it.schemaPath) + ' , data: ' + ($data) + ' '; + } + out += ' } '; + } else { + out += ' {} '; + } + out += '; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; } } '; + if ($isData) { + out += ' } '; + } + } else { + var arr3 = $required; + if (arr3) { + var $propertyKey, i3 = -1, + l3 = arr3.length - 1; + while (i3 < l3) { + $propertyKey = arr3[i3 += 1]; + var $prop = it.util.getProperty($propertyKey), + $missingProperty = it.util.escapeQuotes($propertyKey), + $useData = $data + $prop; + if (it.opts._errorDataPathProperty) { + it.errorPath = it.util.getPath($currentErrorPath, $propertyKey, it.opts.jsonPointers); + } + out += ' if ( ' + ($useData) + ' === undefined '; + if ($ownProperties) { + out += ' || ! Object.prototype.hasOwnProperty.call(' + ($data) + ', \'' + (it.util.escapeQuotes($propertyKey)) + '\') '; + } + out += ') { var err = '; /* istanbul ignore else */ + if (it.createErrors !== false) { + out += ' { keyword: \'' + ('required') + '\' , dataPath: (dataPath || \'\') + ' + (it.errorPath) + ' , schemaPath: ' + (it.util.toQuotedString($errSchemaPath)) + ' , params: { missingProperty: \'' + ($missingProperty) + '\' } '; + if (it.opts.messages !== false) { + out += ' , message: \''; + if (it.opts._errorDataPathProperty) { + out += 'is a required property'; + } else { + out += 'should have required property \\\'' + ($missingProperty) + '\\\''; + } + out += '\' '; + } + if (it.opts.verbose) { + out += ' , schema: validate.schema' + ($schemaPath) + ' , parentSchema: validate.schema' + (it.schemaPath) + ' , data: ' + ($data) + ' '; + } + out += ' } '; + } else { + out += ' {} '; + } + out += '; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; } '; + } + } + } + } + it.errorPath = $currentErrorPath; + } else if ($breakOnError) { + out += ' if (true) {'; + } + return out; +} + +},{}],37:[function(require,module,exports){ +'use strict'; +module.exports = function generate_uniqueItems(it, $keyword, $ruleType) { + var out = ' '; + var $lvl = it.level; + var $dataLvl = it.dataLevel; + var $schema = it.schema[$keyword]; + var $schemaPath = it.schemaPath + it.util.getProperty($keyword); + var $errSchemaPath = it.errSchemaPath + '/' + $keyword; + var $breakOnError = !it.opts.allErrors; + var $data = 'data' + ($dataLvl || ''); + var $valid = 'valid' + $lvl; + var $isData = it.opts.$data && $schema && $schema.$data, + $schemaValue; + if ($isData) { + out += ' var schema' + ($lvl) + ' = ' + (it.util.getData($schema.$data, $dataLvl, it.dataPathArr)) + '; '; + $schemaValue = 'schema' + $lvl; + } else { + $schemaValue = $schema; + } + if (($schema || $isData) && it.opts.uniqueItems !== false) { + if ($isData) { + out += ' var ' + ($valid) + '; if (' + ($schemaValue) + ' === false || ' + ($schemaValue) + ' === undefined) ' + ($valid) + ' = true; else if (typeof ' + ($schemaValue) + ' != \'boolean\') ' + ($valid) + ' = false; else { '; + } + out += ' var i = ' + ($data) + '.length , ' + ($valid) + ' = true , j; if (i > 1) { '; + var $itemType = it.schema.items && it.schema.items.type, + $typeIsArray = Array.isArray($itemType); + if (!$itemType || $itemType == 'object' || $itemType == 'array' || ($typeIsArray && ($itemType.indexOf('object') >= 0 || $itemType.indexOf('array') >= 0))) { + out += ' outer: for (;i--;) { for (j = i; j--;) { if (equal(' + ($data) + '[i], ' + ($data) + '[j])) { ' + ($valid) + ' = false; break outer; } } } '; + } else { + out += ' var itemIndices = {}, item; for (;i--;) { var item = ' + ($data) + '[i]; '; + var $method = 'checkDataType' + ($typeIsArray ? 's' : ''); + out += ' if (' + (it.util[$method]($itemType, 'item', it.opts.strictNumbers, true)) + ') continue; '; + if ($typeIsArray) { + out += ' if (typeof item == \'string\') item = \'"\' + item; '; + } + out += ' if (typeof itemIndices[item] == \'number\') { ' + ($valid) + ' = false; j = itemIndices[item]; break; } itemIndices[item] = i; } '; + } + out += ' } '; + if ($isData) { + out += ' } '; + } + out += ' if (!' + ($valid) + ') { '; + var $$outStack = $$outStack || []; + $$outStack.push(out); + out = ''; /* istanbul ignore else */ + if (it.createErrors !== false) { + out += ' { keyword: \'' + ('uniqueItems') + '\' , dataPath: (dataPath || \'\') + ' + (it.errorPath) + ' , schemaPath: ' + (it.util.toQuotedString($errSchemaPath)) + ' , params: { i: i, j: j } '; + if (it.opts.messages !== false) { + out += ' , message: \'should NOT have duplicate items (items ## \' + j + \' and \' + i + \' are identical)\' '; + } + if (it.opts.verbose) { + out += ' , schema: '; + if ($isData) { + out += 'validate.schema' + ($schemaPath); + } else { + out += '' + ($schema); + } + out += ' , parentSchema: validate.schema' + (it.schemaPath) + ' , data: ' + ($data) + ' '; + } + out += ' } '; + } else { + out += ' {} '; + } + var __err = out; + out = $$outStack.pop(); + if (!it.compositeRule && $breakOnError) { + /* istanbul ignore if */ + if (it.async) { + out += ' throw new ValidationError([' + (__err) + ']); '; + } else { + out += ' validate.errors = [' + (__err) + ']; return false; '; + } + } else { + out += ' var err = ' + (__err) + '; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; '; + } + out += ' } '; + if ($breakOnError) { + out += ' else { '; + } + } else { + if ($breakOnError) { + out += ' if (true) { '; + } + } + return out; +} + +},{}],38:[function(require,module,exports){ +'use strict'; +module.exports = function generate_validate(it, $keyword, $ruleType) { + var out = ''; + var $async = it.schema.$async === true, + $refKeywords = it.util.schemaHasRulesExcept(it.schema, it.RULES.all, '$ref'), + $id = it.self._getId(it.schema); + if (it.opts.strictKeywords) { + var $unknownKwd = it.util.schemaUnknownRules(it.schema, it.RULES.keywords); + if ($unknownKwd) { + var $keywordsMsg = 'unknown keyword: ' + $unknownKwd; + if (it.opts.strictKeywords === 'log') it.logger.warn($keywordsMsg); + else throw new Error($keywordsMsg); + } + } + if (it.isTop) { + out += ' var validate = '; + if ($async) { + it.async = true; + out += 'async '; + } + out += 'function(data, dataPath, parentData, parentDataProperty, rootData) { \'use strict\'; '; + if ($id && (it.opts.sourceCode || it.opts.processCode)) { + out += ' ' + ('/\*# sourceURL=' + $id + ' */') + ' '; + } + } + if (typeof it.schema == 'boolean' || !($refKeywords || it.schema.$ref)) { + var $keyword = 'false schema'; + var $lvl = it.level; + var $dataLvl = it.dataLevel; + var $schema = it.schema[$keyword]; + var $schemaPath = it.schemaPath + it.util.getProperty($keyword); + var $errSchemaPath = it.errSchemaPath + '/' + $keyword; + var $breakOnError = !it.opts.allErrors; + var $errorKeyword; + var $data = 'data' + ($dataLvl || ''); + var $valid = 'valid' + $lvl; + if (it.schema === false) { + if (it.isTop) { + $breakOnError = true; + } else { + out += ' var ' + ($valid) + ' = false; '; + } + var $$outStack = $$outStack || []; + $$outStack.push(out); + out = ''; /* istanbul ignore else */ + if (it.createErrors !== false) { + out += ' { keyword: \'' + ($errorKeyword || 'false schema') + '\' , dataPath: (dataPath || \'\') + ' + (it.errorPath) + ' , schemaPath: ' + (it.util.toQuotedString($errSchemaPath)) + ' , params: {} '; + if (it.opts.messages !== false) { + out += ' , message: \'boolean schema is false\' '; + } + if (it.opts.verbose) { + out += ' , schema: false , parentSchema: validate.schema' + (it.schemaPath) + ' , data: ' + ($data) + ' '; + } + out += ' } '; + } else { + out += ' {} '; + } + var __err = out; + out = $$outStack.pop(); + if (!it.compositeRule && $breakOnError) { + /* istanbul ignore if */ + if (it.async) { + out += ' throw new ValidationError([' + (__err) + ']); '; + } else { + out += ' validate.errors = [' + (__err) + ']; return false; '; + } + } else { + out += ' var err = ' + (__err) + '; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; '; + } + } else { + if (it.isTop) { + if ($async) { + out += ' return data; '; + } else { + out += ' validate.errors = null; return true; '; + } + } else { + out += ' var ' + ($valid) + ' = true; '; + } + } + if (it.isTop) { + out += ' }; return validate; '; + } + return out; + } + if (it.isTop) { + var $top = it.isTop, + $lvl = it.level = 0, + $dataLvl = it.dataLevel = 0, + $data = 'data'; + it.rootId = it.resolve.fullPath(it.self._getId(it.root.schema)); + it.baseId = it.baseId || it.rootId; + delete it.isTop; + it.dataPathArr = [""]; + if (it.schema.default !== undefined && it.opts.useDefaults && it.opts.strictDefaults) { + var $defaultMsg = 'default is ignored in the schema root'; + if (it.opts.strictDefaults === 'log') it.logger.warn($defaultMsg); + else throw new Error($defaultMsg); + } + out += ' var vErrors = null; '; + out += ' var errors = 0; '; + out += ' if (rootData === undefined) rootData = data; '; + } else { + var $lvl = it.level, + $dataLvl = it.dataLevel, + $data = 'data' + ($dataLvl || ''); + if ($id) it.baseId = it.resolve.url(it.baseId, $id); + if ($async && !it.async) throw new Error('async schema in sync schema'); + out += ' var errs_' + ($lvl) + ' = errors;'; + } + var $valid = 'valid' + $lvl, + $breakOnError = !it.opts.allErrors, + $closingBraces1 = '', + $closingBraces2 = ''; + var $errorKeyword; + var $typeSchema = it.schema.type, + $typeIsArray = Array.isArray($typeSchema); + if ($typeSchema && it.opts.nullable && it.schema.nullable === true) { + if ($typeIsArray) { + if ($typeSchema.indexOf('null') == -1) $typeSchema = $typeSchema.concat('null'); + } else if ($typeSchema != 'null') { + $typeSchema = [$typeSchema, 'null']; + $typeIsArray = true; + } + } + if ($typeIsArray && $typeSchema.length == 1) { + $typeSchema = $typeSchema[0]; + $typeIsArray = false; + } + if (it.schema.$ref && $refKeywords) { + if (it.opts.extendRefs == 'fail') { + throw new Error('$ref: validation keywords used in schema at path "' + it.errSchemaPath + '" (see option extendRefs)'); + } else if (it.opts.extendRefs !== true) { + $refKeywords = false; + it.logger.warn('$ref: keywords ignored in schema at path "' + it.errSchemaPath + '"'); + } + } + if (it.schema.$comment && it.opts.$comment) { + out += ' ' + (it.RULES.all.$comment.code(it, '$comment')); + } + if ($typeSchema) { + if (it.opts.coerceTypes) { + var $coerceToTypes = it.util.coerceToTypes(it.opts.coerceTypes, $typeSchema); + } + var $rulesGroup = it.RULES.types[$typeSchema]; + if ($coerceToTypes || $typeIsArray || $rulesGroup === true || ($rulesGroup && !$shouldUseGroup($rulesGroup))) { + var $schemaPath = it.schemaPath + '.type', + $errSchemaPath = it.errSchemaPath + '/type'; + var $schemaPath = it.schemaPath + '.type', + $errSchemaPath = it.errSchemaPath + '/type', + $method = $typeIsArray ? 'checkDataTypes' : 'checkDataType'; + out += ' if (' + (it.util[$method]($typeSchema, $data, it.opts.strictNumbers, true)) + ') { '; + if ($coerceToTypes) { + var $dataType = 'dataType' + $lvl, + $coerced = 'coerced' + $lvl; + out += ' var ' + ($dataType) + ' = typeof ' + ($data) + '; var ' + ($coerced) + ' = undefined; '; + if (it.opts.coerceTypes == 'array') { + out += ' if (' + ($dataType) + ' == \'object\' && Array.isArray(' + ($data) + ') && ' + ($data) + '.length == 1) { ' + ($data) + ' = ' + ($data) + '[0]; ' + ($dataType) + ' = typeof ' + ($data) + '; if (' + (it.util.checkDataType(it.schema.type, $data, it.opts.strictNumbers)) + ') ' + ($coerced) + ' = ' + ($data) + '; } '; + } + out += ' if (' + ($coerced) + ' !== undefined) ; '; + var arr1 = $coerceToTypes; + if (arr1) { + var $type, $i = -1, + l1 = arr1.length - 1; + while ($i < l1) { + $type = arr1[$i += 1]; + if ($type == 'string') { + out += ' else if (' + ($dataType) + ' == \'number\' || ' + ($dataType) + ' == \'boolean\') ' + ($coerced) + ' = \'\' + ' + ($data) + '; else if (' + ($data) + ' === null) ' + ($coerced) + ' = \'\'; '; + } else if ($type == 'number' || $type == 'integer') { + out += ' else if (' + ($dataType) + ' == \'boolean\' || ' + ($data) + ' === null || (' + ($dataType) + ' == \'string\' && ' + ($data) + ' && ' + ($data) + ' == +' + ($data) + ' '; + if ($type == 'integer') { + out += ' && !(' + ($data) + ' % 1)'; + } + out += ')) ' + ($coerced) + ' = +' + ($data) + '; '; + } else if ($type == 'boolean') { + out += ' else if (' + ($data) + ' === \'false\' || ' + ($data) + ' === 0 || ' + ($data) + ' === null) ' + ($coerced) + ' = false; else if (' + ($data) + ' === \'true\' || ' + ($data) + ' === 1) ' + ($coerced) + ' = true; '; + } else if ($type == 'null') { + out += ' else if (' + ($data) + ' === \'\' || ' + ($data) + ' === 0 || ' + ($data) + ' === false) ' + ($coerced) + ' = null; '; + } else if (it.opts.coerceTypes == 'array' && $type == 'array') { + out += ' else if (' + ($dataType) + ' == \'string\' || ' + ($dataType) + ' == \'number\' || ' + ($dataType) + ' == \'boolean\' || ' + ($data) + ' == null) ' + ($coerced) + ' = [' + ($data) + ']; '; + } + } + } + out += ' else { '; + var $$outStack = $$outStack || []; + $$outStack.push(out); + out = ''; /* istanbul ignore else */ + if (it.createErrors !== false) { + out += ' { keyword: \'' + ($errorKeyword || 'type') + '\' , dataPath: (dataPath || \'\') + ' + (it.errorPath) + ' , schemaPath: ' + (it.util.toQuotedString($errSchemaPath)) + ' , params: { type: \''; + if ($typeIsArray) { + out += '' + ($typeSchema.join(",")); + } else { + out += '' + ($typeSchema); + } + out += '\' } '; + if (it.opts.messages !== false) { + out += ' , message: \'should be '; + if ($typeIsArray) { + out += '' + ($typeSchema.join(",")); + } else { + out += '' + ($typeSchema); + } + out += '\' '; + } + if (it.opts.verbose) { + out += ' , schema: validate.schema' + ($schemaPath) + ' , parentSchema: validate.schema' + (it.schemaPath) + ' , data: ' + ($data) + ' '; + } + out += ' } '; + } else { + out += ' {} '; + } + var __err = out; + out = $$outStack.pop(); + if (!it.compositeRule && $breakOnError) { + /* istanbul ignore if */ + if (it.async) { + out += ' throw new ValidationError([' + (__err) + ']); '; + } else { + out += ' validate.errors = [' + (__err) + ']; return false; '; + } + } else { + out += ' var err = ' + (__err) + '; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; '; + } + out += ' } if (' + ($coerced) + ' !== undefined) { '; + var $parentData = $dataLvl ? 'data' + (($dataLvl - 1) || '') : 'parentData', + $parentDataProperty = $dataLvl ? it.dataPathArr[$dataLvl] : 'parentDataProperty'; + out += ' ' + ($data) + ' = ' + ($coerced) + '; '; + if (!$dataLvl) { + out += 'if (' + ($parentData) + ' !== undefined)'; + } + out += ' ' + ($parentData) + '[' + ($parentDataProperty) + '] = ' + ($coerced) + '; } '; + } else { + var $$outStack = $$outStack || []; + $$outStack.push(out); + out = ''; /* istanbul ignore else */ + if (it.createErrors !== false) { + out += ' { keyword: \'' + ($errorKeyword || 'type') + '\' , dataPath: (dataPath || \'\') + ' + (it.errorPath) + ' , schemaPath: ' + (it.util.toQuotedString($errSchemaPath)) + ' , params: { type: \''; + if ($typeIsArray) { + out += '' + ($typeSchema.join(",")); + } else { + out += '' + ($typeSchema); + } + out += '\' } '; + if (it.opts.messages !== false) { + out += ' , message: \'should be '; + if ($typeIsArray) { + out += '' + ($typeSchema.join(",")); + } else { + out += '' + ($typeSchema); + } + out += '\' '; + } + if (it.opts.verbose) { + out += ' , schema: validate.schema' + ($schemaPath) + ' , parentSchema: validate.schema' + (it.schemaPath) + ' , data: ' + ($data) + ' '; + } + out += ' } '; + } else { + out += ' {} '; + } + var __err = out; + out = $$outStack.pop(); + if (!it.compositeRule && $breakOnError) { + /* istanbul ignore if */ + if (it.async) { + out += ' throw new ValidationError([' + (__err) + ']); '; + } else { + out += ' validate.errors = [' + (__err) + ']; return false; '; + } + } else { + out += ' var err = ' + (__err) + '; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; '; + } + } + out += ' } '; + } + } + if (it.schema.$ref && !$refKeywords) { + out += ' ' + (it.RULES.all.$ref.code(it, '$ref')) + ' '; + if ($breakOnError) { + out += ' } if (errors === '; + if ($top) { + out += '0'; + } else { + out += 'errs_' + ($lvl); + } + out += ') { '; + $closingBraces2 += '}'; + } + } else { + var arr2 = it.RULES; + if (arr2) { + var $rulesGroup, i2 = -1, + l2 = arr2.length - 1; + while (i2 < l2) { + $rulesGroup = arr2[i2 += 1]; + if ($shouldUseGroup($rulesGroup)) { + if ($rulesGroup.type) { + out += ' if (' + (it.util.checkDataType($rulesGroup.type, $data, it.opts.strictNumbers)) + ') { '; + } + if (it.opts.useDefaults) { + if ($rulesGroup.type == 'object' && it.schema.properties) { + var $schema = it.schema.properties, + $schemaKeys = Object.keys($schema); + var arr3 = $schemaKeys; + if (arr3) { + var $propertyKey, i3 = -1, + l3 = arr3.length - 1; + while (i3 < l3) { + $propertyKey = arr3[i3 += 1]; + var $sch = $schema[$propertyKey]; + if ($sch.default !== undefined) { + var $passData = $data + it.util.getProperty($propertyKey); + if (it.compositeRule) { + if (it.opts.strictDefaults) { + var $defaultMsg = 'default is ignored for: ' + $passData; + if (it.opts.strictDefaults === 'log') it.logger.warn($defaultMsg); + else throw new Error($defaultMsg); + } + } else { + out += ' if (' + ($passData) + ' === undefined '; + if (it.opts.useDefaults == 'empty') { + out += ' || ' + ($passData) + ' === null || ' + ($passData) + ' === \'\' '; + } + out += ' ) ' + ($passData) + ' = '; + if (it.opts.useDefaults == 'shared') { + out += ' ' + (it.useDefault($sch.default)) + ' '; + } else { + out += ' ' + (JSON.stringify($sch.default)) + ' '; + } + out += '; '; + } + } + } + } + } else if ($rulesGroup.type == 'array' && Array.isArray(it.schema.items)) { + var arr4 = it.schema.items; + if (arr4) { + var $sch, $i = -1, + l4 = arr4.length - 1; + while ($i < l4) { + $sch = arr4[$i += 1]; + if ($sch.default !== undefined) { + var $passData = $data + '[' + $i + ']'; + if (it.compositeRule) { + if (it.opts.strictDefaults) { + var $defaultMsg = 'default is ignored for: ' + $passData; + if (it.opts.strictDefaults === 'log') it.logger.warn($defaultMsg); + else throw new Error($defaultMsg); + } + } else { + out += ' if (' + ($passData) + ' === undefined '; + if (it.opts.useDefaults == 'empty') { + out += ' || ' + ($passData) + ' === null || ' + ($passData) + ' === \'\' '; + } + out += ' ) ' + ($passData) + ' = '; + if (it.opts.useDefaults == 'shared') { + out += ' ' + (it.useDefault($sch.default)) + ' '; + } else { + out += ' ' + (JSON.stringify($sch.default)) + ' '; + } + out += '; '; + } + } + } + } + } + } + var arr5 = $rulesGroup.rules; + if (arr5) { + var $rule, i5 = -1, + l5 = arr5.length - 1; + while (i5 < l5) { + $rule = arr5[i5 += 1]; + if ($shouldUseRule($rule)) { + var $code = $rule.code(it, $rule.keyword, $rulesGroup.type); + if ($code) { + out += ' ' + ($code) + ' '; + if ($breakOnError) { + $closingBraces1 += '}'; + } + } + } + } + } + if ($breakOnError) { + out += ' ' + ($closingBraces1) + ' '; + $closingBraces1 = ''; + } + if ($rulesGroup.type) { + out += ' } '; + if ($typeSchema && $typeSchema === $rulesGroup.type && !$coerceToTypes) { + out += ' else { '; + var $schemaPath = it.schemaPath + '.type', + $errSchemaPath = it.errSchemaPath + '/type'; + var $$outStack = $$outStack || []; + $$outStack.push(out); + out = ''; /* istanbul ignore else */ + if (it.createErrors !== false) { + out += ' { keyword: \'' + ($errorKeyword || 'type') + '\' , dataPath: (dataPath || \'\') + ' + (it.errorPath) + ' , schemaPath: ' + (it.util.toQuotedString($errSchemaPath)) + ' , params: { type: \''; + if ($typeIsArray) { + out += '' + ($typeSchema.join(",")); + } else { + out += '' + ($typeSchema); + } + out += '\' } '; + if (it.opts.messages !== false) { + out += ' , message: \'should be '; + if ($typeIsArray) { + out += '' + ($typeSchema.join(",")); + } else { + out += '' + ($typeSchema); + } + out += '\' '; + } + if (it.opts.verbose) { + out += ' , schema: validate.schema' + ($schemaPath) + ' , parentSchema: validate.schema' + (it.schemaPath) + ' , data: ' + ($data) + ' '; + } + out += ' } '; + } else { + out += ' {} '; + } + var __err = out; + out = $$outStack.pop(); + if (!it.compositeRule && $breakOnError) { + /* istanbul ignore if */ + if (it.async) { + out += ' throw new ValidationError([' + (__err) + ']); '; + } else { + out += ' validate.errors = [' + (__err) + ']; return false; '; + } + } else { + out += ' var err = ' + (__err) + '; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; '; + } + out += ' } '; + } + } + if ($breakOnError) { + out += ' if (errors === '; + if ($top) { + out += '0'; + } else { + out += 'errs_' + ($lvl); + } + out += ') { '; + $closingBraces2 += '}'; + } + } + } + } + } + if ($breakOnError) { + out += ' ' + ($closingBraces2) + ' '; + } + if ($top) { + if ($async) { + out += ' if (errors === 0) return data; '; + out += ' else throw new ValidationError(vErrors); '; + } else { + out += ' validate.errors = vErrors; '; + out += ' return errors === 0; '; + } + out += ' }; return validate;'; + } else { + out += ' var ' + ($valid) + ' = errors === errs_' + ($lvl) + ';'; + } + + function $shouldUseGroup($rulesGroup) { + var rules = $rulesGroup.rules; + for (var i = 0; i < rules.length; i++) + if ($shouldUseRule(rules[i])) return true; + } + + function $shouldUseRule($rule) { + return it.schema[$rule.keyword] !== undefined || ($rule.implements && $ruleImplementsSomeKeyword($rule)); + } + + function $ruleImplementsSomeKeyword($rule) { + var impl = $rule.implements; + for (var i = 0; i < impl.length; i++) + if (it.schema[impl[i]] !== undefined) return true; + } + return out; +} + +},{}],39:[function(require,module,exports){ +'use strict'; + +var IDENTIFIER = /^[a-z_$][a-z0-9_$-]*$/i; +var customRuleCode = require('./dotjs/custom'); +var definitionSchema = require('./definition_schema'); + +module.exports = { + add: addKeyword, + get: getKeyword, + remove: removeKeyword, + validate: validateKeyword +}; + + +/** + * Define custom keyword + * @this Ajv + * @param {String} keyword custom keyword, should be unique (including different from all standard, custom and macro keywords). + * @param {Object} definition keyword definition object with properties `type` (type(s) which the keyword applies to), `validate` or `compile`. + * @return {Ajv} this for method chaining + */ +function addKeyword(keyword, definition) { + /* jshint validthis: true */ + /* eslint no-shadow: 0 */ + var RULES = this.RULES; + if (RULES.keywords[keyword]) + throw new Error('Keyword ' + keyword + ' is already defined'); + + if (!IDENTIFIER.test(keyword)) + throw new Error('Keyword ' + keyword + ' is not a valid identifier'); + + if (definition) { + this.validateKeyword(definition, true); + + var dataType = definition.type; + if (Array.isArray(dataType)) { + for (var i=0; i 1) { + sets[0] = sets[0].slice(0, -1); + var xl = sets.length - 1; + for (var x = 1; x < xl; ++x) { + sets[x] = sets[x].slice(1, -1); + } + sets[xl] = sets[xl].slice(1); + return sets.join(''); + } else { + return sets[0]; + } +} +function subexp(str) { + return "(?:" + str + ")"; +} +function typeOf(o) { + return o === undefined ? "undefined" : o === null ? "null" : Object.prototype.toString.call(o).split(" ").pop().split("]").shift().toLowerCase(); +} +function toUpperCase(str) { + return str.toUpperCase(); +} +function toArray(obj) { + return obj !== undefined && obj !== null ? obj instanceof Array ? obj : typeof obj.length !== "number" || obj.split || obj.setInterval || obj.call ? [obj] : Array.prototype.slice.call(obj) : []; +} +function assign(target, source) { + var obj = target; + if (source) { + for (var key in source) { + obj[key] = source[key]; + } + } + return obj; +} + +function buildExps(isIRI) { + var ALPHA$$ = "[A-Za-z]", + CR$ = "[\\x0D]", + DIGIT$$ = "[0-9]", + DQUOTE$$ = "[\\x22]", + HEXDIG$$ = merge(DIGIT$$, "[A-Fa-f]"), + //case-insensitive + LF$$ = "[\\x0A]", + SP$$ = "[\\x20]", + PCT_ENCODED$ = subexp(subexp("%[EFef]" + HEXDIG$$ + "%" + HEXDIG$$ + HEXDIG$$ + "%" + HEXDIG$$ + HEXDIG$$) + "|" + subexp("%[89A-Fa-f]" + HEXDIG$$ + "%" + HEXDIG$$ + HEXDIG$$) + "|" + subexp("%" + HEXDIG$$ + HEXDIG$$)), + //expanded + GEN_DELIMS$$ = "[\\:\\/\\?\\#\\[\\]\\@]", + SUB_DELIMS$$ = "[\\!\\$\\&\\'\\(\\)\\*\\+\\,\\;\\=]", + RESERVED$$ = merge(GEN_DELIMS$$, SUB_DELIMS$$), + UCSCHAR$$ = isIRI ? "[\\xA0-\\u200D\\u2010-\\u2029\\u202F-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF]" : "[]", + //subset, excludes bidi control characters + IPRIVATE$$ = isIRI ? "[\\uE000-\\uF8FF]" : "[]", + //subset + UNRESERVED$$ = merge(ALPHA$$, DIGIT$$, "[\\-\\.\\_\\~]", UCSCHAR$$), + SCHEME$ = subexp(ALPHA$$ + merge(ALPHA$$, DIGIT$$, "[\\+\\-\\.]") + "*"), + USERINFO$ = subexp(subexp(PCT_ENCODED$ + "|" + merge(UNRESERVED$$, SUB_DELIMS$$, "[\\:]")) + "*"), + DEC_OCTET$ = subexp(subexp("25[0-5]") + "|" + subexp("2[0-4]" + DIGIT$$) + "|" + subexp("1" + DIGIT$$ + DIGIT$$) + "|" + subexp("[1-9]" + DIGIT$$) + "|" + DIGIT$$), + DEC_OCTET_RELAXED$ = subexp(subexp("25[0-5]") + "|" + subexp("2[0-4]" + DIGIT$$) + "|" + subexp("1" + DIGIT$$ + DIGIT$$) + "|" + subexp("0?[1-9]" + DIGIT$$) + "|0?0?" + DIGIT$$), + //relaxed parsing rules + IPV4ADDRESS$ = subexp(DEC_OCTET_RELAXED$ + "\\." + DEC_OCTET_RELAXED$ + "\\." + DEC_OCTET_RELAXED$ + "\\." + DEC_OCTET_RELAXED$), + H16$ = subexp(HEXDIG$$ + "{1,4}"), + LS32$ = subexp(subexp(H16$ + "\\:" + H16$) + "|" + IPV4ADDRESS$), + IPV6ADDRESS1$ = subexp(subexp(H16$ + "\\:") + "{6}" + LS32$), + // 6( h16 ":" ) ls32 + IPV6ADDRESS2$ = subexp("\\:\\:" + subexp(H16$ + "\\:") + "{5}" + LS32$), + // "::" 5( h16 ":" ) ls32 + IPV6ADDRESS3$ = subexp(subexp(H16$) + "?\\:\\:" + subexp(H16$ + "\\:") + "{4}" + LS32$), + //[ h16 ] "::" 4( h16 ":" ) ls32 + IPV6ADDRESS4$ = subexp(subexp(subexp(H16$ + "\\:") + "{0,1}" + H16$) + "?\\:\\:" + subexp(H16$ + "\\:") + "{3}" + LS32$), + //[ *1( h16 ":" ) h16 ] "::" 3( h16 ":" ) ls32 + IPV6ADDRESS5$ = subexp(subexp(subexp(H16$ + "\\:") + "{0,2}" + H16$) + "?\\:\\:" + subexp(H16$ + "\\:") + "{2}" + LS32$), + //[ *2( h16 ":" ) h16 ] "::" 2( h16 ":" ) ls32 + IPV6ADDRESS6$ = subexp(subexp(subexp(H16$ + "\\:") + "{0,3}" + H16$) + "?\\:\\:" + H16$ + "\\:" + LS32$), + //[ *3( h16 ":" ) h16 ] "::" h16 ":" ls32 + IPV6ADDRESS7$ = subexp(subexp(subexp(H16$ + "\\:") + "{0,4}" + H16$) + "?\\:\\:" + LS32$), + //[ *4( h16 ":" ) h16 ] "::" ls32 + IPV6ADDRESS8$ = subexp(subexp(subexp(H16$ + "\\:") + "{0,5}" + H16$) + "?\\:\\:" + H16$), + //[ *5( h16 ":" ) h16 ] "::" h16 + IPV6ADDRESS9$ = subexp(subexp(subexp(H16$ + "\\:") + "{0,6}" + H16$) + "?\\:\\:"), + //[ *6( h16 ":" ) h16 ] "::" + IPV6ADDRESS$ = subexp([IPV6ADDRESS1$, IPV6ADDRESS2$, IPV6ADDRESS3$, IPV6ADDRESS4$, IPV6ADDRESS5$, IPV6ADDRESS6$, IPV6ADDRESS7$, IPV6ADDRESS8$, IPV6ADDRESS9$].join("|")), + ZONEID$ = subexp(subexp(UNRESERVED$$ + "|" + PCT_ENCODED$) + "+"), + //RFC 6874 + IPV6ADDRZ$ = subexp(IPV6ADDRESS$ + "\\%25" + ZONEID$), + //RFC 6874 + IPV6ADDRZ_RELAXED$ = subexp(IPV6ADDRESS$ + subexp("\\%25|\\%(?!" + HEXDIG$$ + "{2})") + ZONEID$), + //RFC 6874, with relaxed parsing rules + IPVFUTURE$ = subexp("[vV]" + HEXDIG$$ + "+\\." + merge(UNRESERVED$$, SUB_DELIMS$$, "[\\:]") + "+"), + IP_LITERAL$ = subexp("\\[" + subexp(IPV6ADDRZ_RELAXED$ + "|" + IPV6ADDRESS$ + "|" + IPVFUTURE$) + "\\]"), + //RFC 6874 + REG_NAME$ = subexp(subexp(PCT_ENCODED$ + "|" + merge(UNRESERVED$$, SUB_DELIMS$$)) + "*"), + HOST$ = subexp(IP_LITERAL$ + "|" + IPV4ADDRESS$ + "(?!" + REG_NAME$ + ")" + "|" + REG_NAME$), + PORT$ = subexp(DIGIT$$ + "*"), + AUTHORITY$ = subexp(subexp(USERINFO$ + "@") + "?" + HOST$ + subexp("\\:" + PORT$) + "?"), + PCHAR$ = subexp(PCT_ENCODED$ + "|" + merge(UNRESERVED$$, SUB_DELIMS$$, "[\\:\\@]")), + SEGMENT$ = subexp(PCHAR$ + "*"), + SEGMENT_NZ$ = subexp(PCHAR$ + "+"), + SEGMENT_NZ_NC$ = subexp(subexp(PCT_ENCODED$ + "|" + merge(UNRESERVED$$, SUB_DELIMS$$, "[\\@]")) + "+"), + PATH_ABEMPTY$ = subexp(subexp("\\/" + SEGMENT$) + "*"), + PATH_ABSOLUTE$ = subexp("\\/" + subexp(SEGMENT_NZ$ + PATH_ABEMPTY$) + "?"), + //simplified + PATH_NOSCHEME$ = subexp(SEGMENT_NZ_NC$ + PATH_ABEMPTY$), + //simplified + PATH_ROOTLESS$ = subexp(SEGMENT_NZ$ + PATH_ABEMPTY$), + //simplified + PATH_EMPTY$ = "(?!" + PCHAR$ + ")", + PATH$ = subexp(PATH_ABEMPTY$ + "|" + PATH_ABSOLUTE$ + "|" + PATH_NOSCHEME$ + "|" + PATH_ROOTLESS$ + "|" + PATH_EMPTY$), + QUERY$ = subexp(subexp(PCHAR$ + "|" + merge("[\\/\\?]", IPRIVATE$$)) + "*"), + FRAGMENT$ = subexp(subexp(PCHAR$ + "|[\\/\\?]") + "*"), + HIER_PART$ = subexp(subexp("\\/\\/" + AUTHORITY$ + PATH_ABEMPTY$) + "|" + PATH_ABSOLUTE$ + "|" + PATH_ROOTLESS$ + "|" + PATH_EMPTY$), + URI$ = subexp(SCHEME$ + "\\:" + HIER_PART$ + subexp("\\?" + QUERY$) + "?" + subexp("\\#" + FRAGMENT$) + "?"), + RELATIVE_PART$ = subexp(subexp("\\/\\/" + AUTHORITY$ + PATH_ABEMPTY$) + "|" + PATH_ABSOLUTE$ + "|" + PATH_NOSCHEME$ + "|" + PATH_EMPTY$), + RELATIVE$ = subexp(RELATIVE_PART$ + subexp("\\?" + QUERY$) + "?" + subexp("\\#" + FRAGMENT$) + "?"), + URI_REFERENCE$ = subexp(URI$ + "|" + RELATIVE$), + ABSOLUTE_URI$ = subexp(SCHEME$ + "\\:" + HIER_PART$ + subexp("\\?" + QUERY$) + "?"), + GENERIC_REF$ = "^(" + SCHEME$ + ")\\:" + subexp(subexp("\\/\\/(" + subexp("(" + USERINFO$ + ")@") + "?(" + HOST$ + ")" + subexp("\\:(" + PORT$ + ")") + "?)") + "?(" + PATH_ABEMPTY$ + "|" + PATH_ABSOLUTE$ + "|" + PATH_ROOTLESS$ + "|" + PATH_EMPTY$ + ")") + subexp("\\?(" + QUERY$ + ")") + "?" + subexp("\\#(" + FRAGMENT$ + ")") + "?$", + RELATIVE_REF$ = "^(){0}" + subexp(subexp("\\/\\/(" + subexp("(" + USERINFO$ + ")@") + "?(" + HOST$ + ")" + subexp("\\:(" + PORT$ + ")") + "?)") + "?(" + PATH_ABEMPTY$ + "|" + PATH_ABSOLUTE$ + "|" + PATH_NOSCHEME$ + "|" + PATH_EMPTY$ + ")") + subexp("\\?(" + QUERY$ + ")") + "?" + subexp("\\#(" + FRAGMENT$ + ")") + "?$", + ABSOLUTE_REF$ = "^(" + SCHEME$ + ")\\:" + subexp(subexp("\\/\\/(" + subexp("(" + USERINFO$ + ")@") + "?(" + HOST$ + ")" + subexp("\\:(" + PORT$ + ")") + "?)") + "?(" + PATH_ABEMPTY$ + "|" + PATH_ABSOLUTE$ + "|" + PATH_ROOTLESS$ + "|" + PATH_EMPTY$ + ")") + subexp("\\?(" + QUERY$ + ")") + "?$", + SAMEDOC_REF$ = "^" + subexp("\\#(" + FRAGMENT$ + ")") + "?$", + AUTHORITY_REF$ = "^" + subexp("(" + USERINFO$ + ")@") + "?(" + HOST$ + ")" + subexp("\\:(" + PORT$ + ")") + "?$"; + return { + NOT_SCHEME: new RegExp(merge("[^]", ALPHA$$, DIGIT$$, "[\\+\\-\\.]"), "g"), + NOT_USERINFO: new RegExp(merge("[^\\%\\:]", UNRESERVED$$, SUB_DELIMS$$), "g"), + NOT_HOST: new RegExp(merge("[^\\%\\[\\]\\:]", UNRESERVED$$, SUB_DELIMS$$), "g"), + NOT_PATH: new RegExp(merge("[^\\%\\/\\:\\@]", UNRESERVED$$, SUB_DELIMS$$), "g"), + NOT_PATH_NOSCHEME: new RegExp(merge("[^\\%\\/\\@]", UNRESERVED$$, SUB_DELIMS$$), "g"), + NOT_QUERY: new RegExp(merge("[^\\%]", UNRESERVED$$, SUB_DELIMS$$, "[\\:\\@\\/\\?]", IPRIVATE$$), "g"), + NOT_FRAGMENT: new RegExp(merge("[^\\%]", UNRESERVED$$, SUB_DELIMS$$, "[\\:\\@\\/\\?]"), "g"), + ESCAPE: new RegExp(merge("[^]", UNRESERVED$$, SUB_DELIMS$$), "g"), + UNRESERVED: new RegExp(UNRESERVED$$, "g"), + OTHER_CHARS: new RegExp(merge("[^\\%]", UNRESERVED$$, RESERVED$$), "g"), + PCT_ENCODED: new RegExp(PCT_ENCODED$, "g"), + IPV4ADDRESS: new RegExp("^(" + IPV4ADDRESS$ + ")$"), + IPV6ADDRESS: new RegExp("^\\[?(" + IPV6ADDRESS$ + ")" + subexp(subexp("\\%25|\\%(?!" + HEXDIG$$ + "{2})") + "(" + ZONEID$ + ")") + "?\\]?$") //RFC 6874, with relaxed parsing rules + }; +} +var URI_PROTOCOL = buildExps(false); + +var IRI_PROTOCOL = buildExps(true); + +var slicedToArray = function () { + function sliceIterator(arr, i) { + var _arr = []; + var _n = true; + var _d = false; + var _e = undefined; + + try { + for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { + _arr.push(_s.value); + + if (i && _arr.length === i) break; + } + } catch (err) { + _d = true; + _e = err; + } finally { + try { + if (!_n && _i["return"]) _i["return"](); + } finally { + if (_d) throw _e; + } + } + + return _arr; + } + + return function (arr, i) { + if (Array.isArray(arr)) { + return arr; + } else if (Symbol.iterator in Object(arr)) { + return sliceIterator(arr, i); + } else { + throw new TypeError("Invalid attempt to destructure non-iterable instance"); + } + }; +}(); + + + + + + + + + + + + + +var toConsumableArray = function (arr) { + if (Array.isArray(arr)) { + for (var i = 0, arr2 = Array(arr.length); i < arr.length; i++) arr2[i] = arr[i]; + + return arr2; + } else { + return Array.from(arr); + } +}; + +/** Highest positive signed 32-bit float value */ + +var maxInt = 2147483647; // aka. 0x7FFFFFFF or 2^31-1 + +/** Bootstring parameters */ +var base = 36; +var tMin = 1; +var tMax = 26; +var skew = 38; +var damp = 700; +var initialBias = 72; +var initialN = 128; // 0x80 +var delimiter = '-'; // '\x2D' + +/** Regular expressions */ +var regexPunycode = /^xn--/; +var regexNonASCII = /[^\0-\x7E]/; // non-ASCII chars +var regexSeparators = /[\x2E\u3002\uFF0E\uFF61]/g; // RFC 3490 separators + +/** Error messages */ +var errors = { + 'overflow': 'Overflow: input needs wider integers to process', + 'not-basic': 'Illegal input >= 0x80 (not a basic code point)', + 'invalid-input': 'Invalid input' +}; + +/** Convenience shortcuts */ +var baseMinusTMin = base - tMin; +var floor = Math.floor; +var stringFromCharCode = String.fromCharCode; + +/*--------------------------------------------------------------------------*/ + +/** + * A generic error utility function. + * @private + * @param {String} type The error type. + * @returns {Error} Throws a `RangeError` with the applicable error message. + */ +function error$1(type) { + throw new RangeError(errors[type]); +} + +/** + * A generic `Array#map` utility function. + * @private + * @param {Array} array The array to iterate over. + * @param {Function} callback The function that gets called for every array + * item. + * @returns {Array} A new array of values returned by the callback function. + */ +function map(array, fn) { + var result = []; + var length = array.length; + while (length--) { + result[length] = fn(array[length]); + } + return result; +} + +/** + * A simple `Array#map`-like wrapper to work with domain name strings or email + * addresses. + * @private + * @param {String} domain The domain name or email address. + * @param {Function} callback The function that gets called for every + * character. + * @returns {Array} A new string of characters returned by the callback + * function. + */ +function mapDomain(string, fn) { + var parts = string.split('@'); + var result = ''; + if (parts.length > 1) { + // In email addresses, only the domain name should be punycoded. Leave + // the local part (i.e. everything up to `@`) intact. + result = parts[0] + '@'; + string = parts[1]; + } + // Avoid `split(regex)` for IE8 compatibility. See #17. + string = string.replace(regexSeparators, '\x2E'); + var labels = string.split('.'); + var encoded = map(labels, fn).join('.'); + return result + encoded; +} + +/** + * Creates an array containing the numeric code points of each Unicode + * character in the string. While JavaScript uses UCS-2 internally, + * this function will convert a pair of surrogate halves (each of which + * UCS-2 exposes as separate characters) into a single code point, + * matching UTF-16. + * @see `punycode.ucs2.encode` + * @see + * @memberOf punycode.ucs2 + * @name decode + * @param {String} string The Unicode input string (UCS-2). + * @returns {Array} The new array of code points. + */ +function ucs2decode(string) { + var output = []; + var counter = 0; + var length = string.length; + while (counter < length) { + var value = string.charCodeAt(counter++); + if (value >= 0xD800 && value <= 0xDBFF && counter < length) { + // It's a high surrogate, and there is a next character. + var extra = string.charCodeAt(counter++); + if ((extra & 0xFC00) == 0xDC00) { + // Low surrogate. + output.push(((value & 0x3FF) << 10) + (extra & 0x3FF) + 0x10000); + } else { + // It's an unmatched surrogate; only append this code unit, in case the + // next code unit is the high surrogate of a surrogate pair. + output.push(value); + counter--; + } + } else { + output.push(value); + } + } + return output; +} + +/** + * Creates a string based on an array of numeric code points. + * @see `punycode.ucs2.decode` + * @memberOf punycode.ucs2 + * @name encode + * @param {Array} codePoints The array of numeric code points. + * @returns {String} The new Unicode string (UCS-2). + */ +var ucs2encode = function ucs2encode(array) { + return String.fromCodePoint.apply(String, toConsumableArray(array)); +}; + +/** + * Converts a basic code point into a digit/integer. + * @see `digitToBasic()` + * @private + * @param {Number} codePoint The basic numeric code point value. + * @returns {Number} The numeric value of a basic code point (for use in + * representing integers) in the range `0` to `base - 1`, or `base` if + * the code point does not represent a value. + */ +var basicToDigit = function basicToDigit(codePoint) { + if (codePoint - 0x30 < 0x0A) { + return codePoint - 0x16; + } + if (codePoint - 0x41 < 0x1A) { + return codePoint - 0x41; + } + if (codePoint - 0x61 < 0x1A) { + return codePoint - 0x61; + } + return base; +}; + +/** + * Converts a digit/integer into a basic code point. + * @see `basicToDigit()` + * @private + * @param {Number} digit The numeric value of a basic code point. + * @returns {Number} The basic code point whose value (when used for + * representing integers) is `digit`, which needs to be in the range + * `0` to `base - 1`. If `flag` is non-zero, the uppercase form is + * used; else, the lowercase form is used. The behavior is undefined + * if `flag` is non-zero and `digit` has no uppercase form. + */ +var digitToBasic = function digitToBasic(digit, flag) { + // 0..25 map to ASCII a..z or A..Z + // 26..35 map to ASCII 0..9 + return digit + 22 + 75 * (digit < 26) - ((flag != 0) << 5); +}; + +/** + * Bias adaptation function as per section 3.4 of RFC 3492. + * https://tools.ietf.org/html/rfc3492#section-3.4 + * @private + */ +var adapt = function adapt(delta, numPoints, firstTime) { + var k = 0; + delta = firstTime ? floor(delta / damp) : delta >> 1; + delta += floor(delta / numPoints); + for (; /* no initialization */delta > baseMinusTMin * tMax >> 1; k += base) { + delta = floor(delta / baseMinusTMin); + } + return floor(k + (baseMinusTMin + 1) * delta / (delta + skew)); +}; + +/** + * Converts a Punycode string of ASCII-only symbols to a string of Unicode + * symbols. + * @memberOf punycode + * @param {String} input The Punycode string of ASCII-only symbols. + * @returns {String} The resulting string of Unicode symbols. + */ +var decode = function decode(input) { + // Don't use UCS-2. + var output = []; + var inputLength = input.length; + var i = 0; + var n = initialN; + var bias = initialBias; + + // Handle the basic code points: let `basic` be the number of input code + // points before the last delimiter, or `0` if there is none, then copy + // the first basic code points to the output. + + var basic = input.lastIndexOf(delimiter); + if (basic < 0) { + basic = 0; + } + + for (var j = 0; j < basic; ++j) { + // if it's not a basic code point + if (input.charCodeAt(j) >= 0x80) { + error$1('not-basic'); + } + output.push(input.charCodeAt(j)); + } + + // Main decoding loop: start just after the last delimiter if any basic code + // points were copied; start at the beginning otherwise. + + for (var index = basic > 0 ? basic + 1 : 0; index < inputLength;) /* no final expression */{ + + // `index` is the index of the next character to be consumed. + // Decode a generalized variable-length integer into `delta`, + // which gets added to `i`. The overflow checking is easier + // if we increase `i` as we go, then subtract off its starting + // value at the end to obtain `delta`. + var oldi = i; + for (var w = 1, k = base;; /* no condition */k += base) { + + if (index >= inputLength) { + error$1('invalid-input'); + } + + var digit = basicToDigit(input.charCodeAt(index++)); + + if (digit >= base || digit > floor((maxInt - i) / w)) { + error$1('overflow'); + } + + i += digit * w; + var t = k <= bias ? tMin : k >= bias + tMax ? tMax : k - bias; + + if (digit < t) { + break; + } + + var baseMinusT = base - t; + if (w > floor(maxInt / baseMinusT)) { + error$1('overflow'); + } + + w *= baseMinusT; + } + + var out = output.length + 1; + bias = adapt(i - oldi, out, oldi == 0); + + // `i` was supposed to wrap around from `out` to `0`, + // incrementing `n` each time, so we'll fix that now: + if (floor(i / out) > maxInt - n) { + error$1('overflow'); + } + + n += floor(i / out); + i %= out; + + // Insert `n` at position `i` of the output. + output.splice(i++, 0, n); + } + + return String.fromCodePoint.apply(String, output); +}; + +/** + * Converts a string of Unicode symbols (e.g. a domain name label) to a + * Punycode string of ASCII-only symbols. + * @memberOf punycode + * @param {String} input The string of Unicode symbols. + * @returns {String} The resulting Punycode string of ASCII-only symbols. + */ +var encode = function encode(input) { + var output = []; + + // Convert the input in UCS-2 to an array of Unicode code points. + input = ucs2decode(input); + + // Cache the length. + var inputLength = input.length; + + // Initialize the state. + var n = initialN; + var delta = 0; + var bias = initialBias; + + // Handle the basic code points. + var _iteratorNormalCompletion = true; + var _didIteratorError = false; + var _iteratorError = undefined; + + try { + for (var _iterator = input[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) { + var _currentValue2 = _step.value; + + if (_currentValue2 < 0x80) { + output.push(stringFromCharCode(_currentValue2)); + } + } + } catch (err) { + _didIteratorError = true; + _iteratorError = err; + } finally { + try { + if (!_iteratorNormalCompletion && _iterator.return) { + _iterator.return(); + } + } finally { + if (_didIteratorError) { + throw _iteratorError; + } + } + } + + var basicLength = output.length; + var handledCPCount = basicLength; + + // `handledCPCount` is the number of code points that have been handled; + // `basicLength` is the number of basic code points. + + // Finish the basic string with a delimiter unless it's empty. + if (basicLength) { + output.push(delimiter); + } + + // Main encoding loop: + while (handledCPCount < inputLength) { + + // All non-basic code points < n have been handled already. Find the next + // larger one: + var m = maxInt; + var _iteratorNormalCompletion2 = true; + var _didIteratorError2 = false; + var _iteratorError2 = undefined; + + try { + for (var _iterator2 = input[Symbol.iterator](), _step2; !(_iteratorNormalCompletion2 = (_step2 = _iterator2.next()).done); _iteratorNormalCompletion2 = true) { + var currentValue = _step2.value; + + if (currentValue >= n && currentValue < m) { + m = currentValue; + } + } + + // Increase `delta` enough to advance the decoder's state to , + // but guard against overflow. + } catch (err) { + _didIteratorError2 = true; + _iteratorError2 = err; + } finally { + try { + if (!_iteratorNormalCompletion2 && _iterator2.return) { + _iterator2.return(); + } + } finally { + if (_didIteratorError2) { + throw _iteratorError2; + } + } + } + + var handledCPCountPlusOne = handledCPCount + 1; + if (m - n > floor((maxInt - delta) / handledCPCountPlusOne)) { + error$1('overflow'); + } + + delta += (m - n) * handledCPCountPlusOne; + n = m; + + var _iteratorNormalCompletion3 = true; + var _didIteratorError3 = false; + var _iteratorError3 = undefined; + + try { + for (var _iterator3 = input[Symbol.iterator](), _step3; !(_iteratorNormalCompletion3 = (_step3 = _iterator3.next()).done); _iteratorNormalCompletion3 = true) { + var _currentValue = _step3.value; + + if (_currentValue < n && ++delta > maxInt) { + error$1('overflow'); + } + if (_currentValue == n) { + // Represent delta as a generalized variable-length integer. + var q = delta; + for (var k = base;; /* no condition */k += base) { + var t = k <= bias ? tMin : k >= bias + tMax ? tMax : k - bias; + if (q < t) { + break; + } + var qMinusT = q - t; + var baseMinusT = base - t; + output.push(stringFromCharCode(digitToBasic(t + qMinusT % baseMinusT, 0))); + q = floor(qMinusT / baseMinusT); + } + + output.push(stringFromCharCode(digitToBasic(q, 0))); + bias = adapt(delta, handledCPCountPlusOne, handledCPCount == basicLength); + delta = 0; + ++handledCPCount; + } + } + } catch (err) { + _didIteratorError3 = true; + _iteratorError3 = err; + } finally { + try { + if (!_iteratorNormalCompletion3 && _iterator3.return) { + _iterator3.return(); + } + } finally { + if (_didIteratorError3) { + throw _iteratorError3; + } + } + } + + ++delta; + ++n; + } + return output.join(''); +}; + +/** + * Converts a Punycode string representing a domain name or an email address + * to Unicode. Only the Punycoded parts of the input will be converted, i.e. + * it doesn't matter if you call it on a string that has already been + * converted to Unicode. + * @memberOf punycode + * @param {String} input The Punycoded domain name or email address to + * convert to Unicode. + * @returns {String} The Unicode representation of the given Punycode + * string. + */ +var toUnicode = function toUnicode(input) { + return mapDomain(input, function (string) { + return regexPunycode.test(string) ? decode(string.slice(4).toLowerCase()) : string; + }); +}; + +/** + * Converts a Unicode string representing a domain name or an email address to + * Punycode. Only the non-ASCII parts of the domain name will be converted, + * i.e. it doesn't matter if you call it with a domain that's already in + * ASCII. + * @memberOf punycode + * @param {String} input The domain name or email address to convert, as a + * Unicode string. + * @returns {String} The Punycode representation of the given domain name or + * email address. + */ +var toASCII = function toASCII(input) { + return mapDomain(input, function (string) { + return regexNonASCII.test(string) ? 'xn--' + encode(string) : string; + }); +}; + +/*--------------------------------------------------------------------------*/ + +/** Define the public API */ +var punycode = { + /** + * A string representing the current Punycode.js version number. + * @memberOf punycode + * @type String + */ + 'version': '2.1.0', + /** + * An object of methods to convert from JavaScript's internal character + * representation (UCS-2) to Unicode code points, and back. + * @see + * @memberOf punycode + * @type Object + */ + 'ucs2': { + 'decode': ucs2decode, + 'encode': ucs2encode + }, + 'decode': decode, + 'encode': encode, + 'toASCII': toASCII, + 'toUnicode': toUnicode +}; + +/** + * URI.js + * + * @fileoverview An RFC 3986 compliant, scheme extendable URI parsing/validating/resolving library for JavaScript. + * @author Gary Court + * @see http://github.com/garycourt/uri-js + */ +/** + * Copyright 2011 Gary Court. All rights reserved. + * + * 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 GARY COURT ``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 GARY COURT 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. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of Gary Court. + */ +var SCHEMES = {}; +function pctEncChar(chr) { + var c = chr.charCodeAt(0); + var e = void 0; + if (c < 16) e = "%0" + c.toString(16).toUpperCase();else if (c < 128) e = "%" + c.toString(16).toUpperCase();else if (c < 2048) e = "%" + (c >> 6 | 192).toString(16).toUpperCase() + "%" + (c & 63 | 128).toString(16).toUpperCase();else e = "%" + (c >> 12 | 224).toString(16).toUpperCase() + "%" + (c >> 6 & 63 | 128).toString(16).toUpperCase() + "%" + (c & 63 | 128).toString(16).toUpperCase(); + return e; +} +function pctDecChars(str) { + var newStr = ""; + var i = 0; + var il = str.length; + while (i < il) { + var c = parseInt(str.substr(i + 1, 2), 16); + if (c < 128) { + newStr += String.fromCharCode(c); + i += 3; + } else if (c >= 194 && c < 224) { + if (il - i >= 6) { + var c2 = parseInt(str.substr(i + 4, 2), 16); + newStr += String.fromCharCode((c & 31) << 6 | c2 & 63); + } else { + newStr += str.substr(i, 6); + } + i += 6; + } else if (c >= 224) { + if (il - i >= 9) { + var _c = parseInt(str.substr(i + 4, 2), 16); + var c3 = parseInt(str.substr(i + 7, 2), 16); + newStr += String.fromCharCode((c & 15) << 12 | (_c & 63) << 6 | c3 & 63); + } else { + newStr += str.substr(i, 9); + } + i += 9; + } else { + newStr += str.substr(i, 3); + i += 3; + } + } + return newStr; +} +function _normalizeComponentEncoding(components, protocol) { + function decodeUnreserved(str) { + var decStr = pctDecChars(str); + return !decStr.match(protocol.UNRESERVED) ? str : decStr; + } + if (components.scheme) components.scheme = String(components.scheme).replace(protocol.PCT_ENCODED, decodeUnreserved).toLowerCase().replace(protocol.NOT_SCHEME, ""); + if (components.userinfo !== undefined) components.userinfo = String(components.userinfo).replace(protocol.PCT_ENCODED, decodeUnreserved).replace(protocol.NOT_USERINFO, pctEncChar).replace(protocol.PCT_ENCODED, toUpperCase); + if (components.host !== undefined) components.host = String(components.host).replace(protocol.PCT_ENCODED, decodeUnreserved).toLowerCase().replace(protocol.NOT_HOST, pctEncChar).replace(protocol.PCT_ENCODED, toUpperCase); + if (components.path !== undefined) components.path = String(components.path).replace(protocol.PCT_ENCODED, decodeUnreserved).replace(components.scheme ? protocol.NOT_PATH : protocol.NOT_PATH_NOSCHEME, pctEncChar).replace(protocol.PCT_ENCODED, toUpperCase); + if (components.query !== undefined) components.query = String(components.query).replace(protocol.PCT_ENCODED, decodeUnreserved).replace(protocol.NOT_QUERY, pctEncChar).replace(protocol.PCT_ENCODED, toUpperCase); + if (components.fragment !== undefined) components.fragment = String(components.fragment).replace(protocol.PCT_ENCODED, decodeUnreserved).replace(protocol.NOT_FRAGMENT, pctEncChar).replace(protocol.PCT_ENCODED, toUpperCase); + return components; +} + +function _stripLeadingZeros(str) { + return str.replace(/^0*(.*)/, "$1") || "0"; +} +function _normalizeIPv4(host, protocol) { + var matches = host.match(protocol.IPV4ADDRESS) || []; + + var _matches = slicedToArray(matches, 2), + address = _matches[1]; + + if (address) { + return address.split(".").map(_stripLeadingZeros).join("."); + } else { + return host; + } +} +function _normalizeIPv6(host, protocol) { + var matches = host.match(protocol.IPV6ADDRESS) || []; + + var _matches2 = slicedToArray(matches, 3), + address = _matches2[1], + zone = _matches2[2]; + + if (address) { + var _address$toLowerCase$ = address.toLowerCase().split('::').reverse(), + _address$toLowerCase$2 = slicedToArray(_address$toLowerCase$, 2), + last = _address$toLowerCase$2[0], + first = _address$toLowerCase$2[1]; + + var firstFields = first ? first.split(":").map(_stripLeadingZeros) : []; + var lastFields = last.split(":").map(_stripLeadingZeros); + var isLastFieldIPv4Address = protocol.IPV4ADDRESS.test(lastFields[lastFields.length - 1]); + var fieldCount = isLastFieldIPv4Address ? 7 : 8; + var lastFieldsStart = lastFields.length - fieldCount; + var fields = Array(fieldCount); + for (var x = 0; x < fieldCount; ++x) { + fields[x] = firstFields[x] || lastFields[lastFieldsStart + x] || ''; + } + if (isLastFieldIPv4Address) { + fields[fieldCount - 1] = _normalizeIPv4(fields[fieldCount - 1], protocol); + } + var allZeroFields = fields.reduce(function (acc, field, index) { + if (!field || field === "0") { + var lastLongest = acc[acc.length - 1]; + if (lastLongest && lastLongest.index + lastLongest.length === index) { + lastLongest.length++; + } else { + acc.push({ index: index, length: 1 }); + } + } + return acc; + }, []); + var longestZeroFields = allZeroFields.sort(function (a, b) { + return b.length - a.length; + })[0]; + var newHost = void 0; + if (longestZeroFields && longestZeroFields.length > 1) { + var newFirst = fields.slice(0, longestZeroFields.index); + var newLast = fields.slice(longestZeroFields.index + longestZeroFields.length); + newHost = newFirst.join(":") + "::" + newLast.join(":"); + } else { + newHost = fields.join(":"); + } + if (zone) { + newHost += "%" + zone; + } + return newHost; + } else { + return host; + } +} +var URI_PARSE = /^(?:([^:\/?#]+):)?(?:\/\/((?:([^\/?#@]*)@)?(\[[^\/?#\]]+\]|[^\/?#:]*)(?:\:(\d*))?))?([^?#]*)(?:\?([^#]*))?(?:#((?:.|\n|\r)*))?/i; +var NO_MATCH_IS_UNDEFINED = "".match(/(){0}/)[1] === undefined; +function parse(uriString) { + var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}; + + var components = {}; + var protocol = options.iri !== false ? IRI_PROTOCOL : URI_PROTOCOL; + if (options.reference === "suffix") uriString = (options.scheme ? options.scheme + ":" : "") + "//" + uriString; + var matches = uriString.match(URI_PARSE); + if (matches) { + if (NO_MATCH_IS_UNDEFINED) { + //store each component + components.scheme = matches[1]; + components.userinfo = matches[3]; + components.host = matches[4]; + components.port = parseInt(matches[5], 10); + components.path = matches[6] || ""; + components.query = matches[7]; + components.fragment = matches[8]; + //fix port number + if (isNaN(components.port)) { + components.port = matches[5]; + } + } else { + //IE FIX for improper RegExp matching + //store each component + components.scheme = matches[1] || undefined; + components.userinfo = uriString.indexOf("@") !== -1 ? matches[3] : undefined; + components.host = uriString.indexOf("//") !== -1 ? matches[4] : undefined; + components.port = parseInt(matches[5], 10); + components.path = matches[6] || ""; + components.query = uriString.indexOf("?") !== -1 ? matches[7] : undefined; + components.fragment = uriString.indexOf("#") !== -1 ? matches[8] : undefined; + //fix port number + if (isNaN(components.port)) { + components.port = uriString.match(/\/\/(?:.|\n)*\:(?:\/|\?|\#|$)/) ? matches[4] : undefined; + } + } + if (components.host) { + //normalize IP hosts + components.host = _normalizeIPv6(_normalizeIPv4(components.host, protocol), protocol); + } + //determine reference type + if (components.scheme === undefined && components.userinfo === undefined && components.host === undefined && components.port === undefined && !components.path && components.query === undefined) { + components.reference = "same-document"; + } else if (components.scheme === undefined) { + components.reference = "relative"; + } else if (components.fragment === undefined) { + components.reference = "absolute"; + } else { + components.reference = "uri"; + } + //check for reference errors + if (options.reference && options.reference !== "suffix" && options.reference !== components.reference) { + components.error = components.error || "URI is not a " + options.reference + " reference."; + } + //find scheme handler + var schemeHandler = SCHEMES[(options.scheme || components.scheme || "").toLowerCase()]; + //check if scheme can't handle IRIs + if (!options.unicodeSupport && (!schemeHandler || !schemeHandler.unicodeSupport)) { + //if host component is a domain name + if (components.host && (options.domainHost || schemeHandler && schemeHandler.domainHost)) { + //convert Unicode IDN -> ASCII IDN + try { + components.host = punycode.toASCII(components.host.replace(protocol.PCT_ENCODED, pctDecChars).toLowerCase()); + } catch (e) { + components.error = components.error || "Host's domain name can not be converted to ASCII via punycode: " + e; + } + } + //convert IRI -> URI + _normalizeComponentEncoding(components, URI_PROTOCOL); + } else { + //normalize encodings + _normalizeComponentEncoding(components, protocol); + } + //perform scheme specific parsing + if (schemeHandler && schemeHandler.parse) { + schemeHandler.parse(components, options); + } + } else { + components.error = components.error || "URI can not be parsed."; + } + return components; +} + +function _recomposeAuthority(components, options) { + var protocol = options.iri !== false ? IRI_PROTOCOL : URI_PROTOCOL; + var uriTokens = []; + if (components.userinfo !== undefined) { + uriTokens.push(components.userinfo); + uriTokens.push("@"); + } + if (components.host !== undefined) { + //normalize IP hosts, add brackets and escape zone separator for IPv6 + uriTokens.push(_normalizeIPv6(_normalizeIPv4(String(components.host), protocol), protocol).replace(protocol.IPV6ADDRESS, function (_, $1, $2) { + return "[" + $1 + ($2 ? "%25" + $2 : "") + "]"; + })); + } + if (typeof components.port === "number" || typeof components.port === "string") { + uriTokens.push(":"); + uriTokens.push(String(components.port)); + } + return uriTokens.length ? uriTokens.join("") : undefined; +} + +var RDS1 = /^\.\.?\//; +var RDS2 = /^\/\.(\/|$)/; +var RDS3 = /^\/\.\.(\/|$)/; +var RDS5 = /^\/?(?:.|\n)*?(?=\/|$)/; +function removeDotSegments(input) { + var output = []; + while (input.length) { + if (input.match(RDS1)) { + input = input.replace(RDS1, ""); + } else if (input.match(RDS2)) { + input = input.replace(RDS2, "/"); + } else if (input.match(RDS3)) { + input = input.replace(RDS3, "/"); + output.pop(); + } else if (input === "." || input === "..") { + input = ""; + } else { + var im = input.match(RDS5); + if (im) { + var s = im[0]; + input = input.slice(s.length); + output.push(s); + } else { + throw new Error("Unexpected dot segment condition"); + } + } + } + return output.join(""); +} + +function serialize(components) { + var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}; + + var protocol = options.iri ? IRI_PROTOCOL : URI_PROTOCOL; + var uriTokens = []; + //find scheme handler + var schemeHandler = SCHEMES[(options.scheme || components.scheme || "").toLowerCase()]; + //perform scheme specific serialization + if (schemeHandler && schemeHandler.serialize) schemeHandler.serialize(components, options); + if (components.host) { + //if host component is an IPv6 address + if (protocol.IPV6ADDRESS.test(components.host)) {} + //TODO: normalize IPv6 address as per RFC 5952 + + //if host component is a domain name + else if (options.domainHost || schemeHandler && schemeHandler.domainHost) { + //convert IDN via punycode + try { + components.host = !options.iri ? punycode.toASCII(components.host.replace(protocol.PCT_ENCODED, pctDecChars).toLowerCase()) : punycode.toUnicode(components.host); + } catch (e) { + components.error = components.error || "Host's domain name can not be converted to " + (!options.iri ? "ASCII" : "Unicode") + " via punycode: " + e; + } + } + } + //normalize encoding + _normalizeComponentEncoding(components, protocol); + if (options.reference !== "suffix" && components.scheme) { + uriTokens.push(components.scheme); + uriTokens.push(":"); + } + var authority = _recomposeAuthority(components, options); + if (authority !== undefined) { + if (options.reference !== "suffix") { + uriTokens.push("//"); + } + uriTokens.push(authority); + if (components.path && components.path.charAt(0) !== "/") { + uriTokens.push("/"); + } + } + if (components.path !== undefined) { + var s = components.path; + if (!options.absolutePath && (!schemeHandler || !schemeHandler.absolutePath)) { + s = removeDotSegments(s); + } + if (authority === undefined) { + s = s.replace(/^\/\//, "/%2F"); //don't allow the path to start with "//" + } + uriTokens.push(s); + } + if (components.query !== undefined) { + uriTokens.push("?"); + uriTokens.push(components.query); + } + if (components.fragment !== undefined) { + uriTokens.push("#"); + uriTokens.push(components.fragment); + } + return uriTokens.join(""); //merge tokens into a string +} + +function resolveComponents(base, relative) { + var options = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {}; + var skipNormalization = arguments[3]; + + var target = {}; + if (!skipNormalization) { + base = parse(serialize(base, options), options); //normalize base components + relative = parse(serialize(relative, options), options); //normalize relative components + } + options = options || {}; + if (!options.tolerant && relative.scheme) { + target.scheme = relative.scheme; + //target.authority = relative.authority; + target.userinfo = relative.userinfo; + target.host = relative.host; + target.port = relative.port; + target.path = removeDotSegments(relative.path || ""); + target.query = relative.query; + } else { + if (relative.userinfo !== undefined || relative.host !== undefined || relative.port !== undefined) { + //target.authority = relative.authority; + target.userinfo = relative.userinfo; + target.host = relative.host; + target.port = relative.port; + target.path = removeDotSegments(relative.path || ""); + target.query = relative.query; + } else { + if (!relative.path) { + target.path = base.path; + if (relative.query !== undefined) { + target.query = relative.query; + } else { + target.query = base.query; + } + } else { + if (relative.path.charAt(0) === "/") { + target.path = removeDotSegments(relative.path); + } else { + if ((base.userinfo !== undefined || base.host !== undefined || base.port !== undefined) && !base.path) { + target.path = "/" + relative.path; + } else if (!base.path) { + target.path = relative.path; + } else { + target.path = base.path.slice(0, base.path.lastIndexOf("/") + 1) + relative.path; + } + target.path = removeDotSegments(target.path); + } + target.query = relative.query; + } + //target.authority = base.authority; + target.userinfo = base.userinfo; + target.host = base.host; + target.port = base.port; + } + target.scheme = base.scheme; + } + target.fragment = relative.fragment; + return target; +} + +function resolve(baseURI, relativeURI, options) { + var schemelessOptions = assign({ scheme: 'null' }, options); + return serialize(resolveComponents(parse(baseURI, schemelessOptions), parse(relativeURI, schemelessOptions), schemelessOptions, true), schemelessOptions); +} + +function normalize(uri, options) { + if (typeof uri === "string") { + uri = serialize(parse(uri, options), options); + } else if (typeOf(uri) === "object") { + uri = parse(serialize(uri, options), options); + } + return uri; +} + +function equal(uriA, uriB, options) { + if (typeof uriA === "string") { + uriA = serialize(parse(uriA, options), options); + } else if (typeOf(uriA) === "object") { + uriA = serialize(uriA, options); + } + if (typeof uriB === "string") { + uriB = serialize(parse(uriB, options), options); + } else if (typeOf(uriB) === "object") { + uriB = serialize(uriB, options); + } + return uriA === uriB; +} + +function escapeComponent(str, options) { + return str && str.toString().replace(!options || !options.iri ? URI_PROTOCOL.ESCAPE : IRI_PROTOCOL.ESCAPE, pctEncChar); +} + +function unescapeComponent(str, options) { + return str && str.toString().replace(!options || !options.iri ? URI_PROTOCOL.PCT_ENCODED : IRI_PROTOCOL.PCT_ENCODED, pctDecChars); +} + +var handler = { + scheme: "http", + domainHost: true, + parse: function parse(components, options) { + //report missing host + if (!components.host) { + components.error = components.error || "HTTP URIs must have a host."; + } + return components; + }, + serialize: function serialize(components, options) { + var secure = String(components.scheme).toLowerCase() === "https"; + //normalize the default port + if (components.port === (secure ? 443 : 80) || components.port === "") { + components.port = undefined; + } + //normalize the empty path + if (!components.path) { + components.path = "/"; + } + //NOTE: We do not parse query strings for HTTP URIs + //as WWW Form Url Encoded query strings are part of the HTML4+ spec, + //and not the HTTP spec. + return components; + } +}; + +var handler$1 = { + scheme: "https", + domainHost: handler.domainHost, + parse: handler.parse, + serialize: handler.serialize +}; + +function isSecure(wsComponents) { + return typeof wsComponents.secure === 'boolean' ? wsComponents.secure : String(wsComponents.scheme).toLowerCase() === "wss"; +} +//RFC 6455 +var handler$2 = { + scheme: "ws", + domainHost: true, + parse: function parse(components, options) { + var wsComponents = components; + //indicate if the secure flag is set + wsComponents.secure = isSecure(wsComponents); + //construct resouce name + wsComponents.resourceName = (wsComponents.path || '/') + (wsComponents.query ? '?' + wsComponents.query : ''); + wsComponents.path = undefined; + wsComponents.query = undefined; + return wsComponents; + }, + serialize: function serialize(wsComponents, options) { + //normalize the default port + if (wsComponents.port === (isSecure(wsComponents) ? 443 : 80) || wsComponents.port === "") { + wsComponents.port = undefined; + } + //ensure scheme matches secure flag + if (typeof wsComponents.secure === 'boolean') { + wsComponents.scheme = wsComponents.secure ? 'wss' : 'ws'; + wsComponents.secure = undefined; + } + //reconstruct path from resource name + if (wsComponents.resourceName) { + var _wsComponents$resourc = wsComponents.resourceName.split('?'), + _wsComponents$resourc2 = slicedToArray(_wsComponents$resourc, 2), + path = _wsComponents$resourc2[0], + query = _wsComponents$resourc2[1]; + + wsComponents.path = path && path !== '/' ? path : undefined; + wsComponents.query = query; + wsComponents.resourceName = undefined; + } + //forbid fragment component + wsComponents.fragment = undefined; + return wsComponents; + } +}; + +var handler$3 = { + scheme: "wss", + domainHost: handler$2.domainHost, + parse: handler$2.parse, + serialize: handler$2.serialize +}; + +var O = {}; +var isIRI = true; +//RFC 3986 +var UNRESERVED$$ = "[A-Za-z0-9\\-\\.\\_\\~" + (isIRI ? "\\xA0-\\u200D\\u2010-\\u2029\\u202F-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF" : "") + "]"; +var HEXDIG$$ = "[0-9A-Fa-f]"; //case-insensitive +var PCT_ENCODED$ = subexp(subexp("%[EFef]" + HEXDIG$$ + "%" + HEXDIG$$ + HEXDIG$$ + "%" + HEXDIG$$ + HEXDIG$$) + "|" + subexp("%[89A-Fa-f]" + HEXDIG$$ + "%" + HEXDIG$$ + HEXDIG$$) + "|" + subexp("%" + HEXDIG$$ + HEXDIG$$)); //expanded +//RFC 5322, except these symbols as per RFC 6068: @ : / ? # [ ] & ; = +//const ATEXT$$ = "[A-Za-z0-9\\!\\#\\$\\%\\&\\'\\*\\+\\-\\/\\=\\?\\^\\_\\`\\{\\|\\}\\~]"; +//const WSP$$ = "[\\x20\\x09]"; +//const OBS_QTEXT$$ = "[\\x01-\\x08\\x0B\\x0C\\x0E-\\x1F\\x7F]"; //(%d1-8 / %d11-12 / %d14-31 / %d127) +//const QTEXT$$ = merge("[\\x21\\x23-\\x5B\\x5D-\\x7E]", OBS_QTEXT$$); //%d33 / %d35-91 / %d93-126 / obs-qtext +//const VCHAR$$ = "[\\x21-\\x7E]"; +//const WSP$$ = "[\\x20\\x09]"; +//const OBS_QP$ = subexp("\\\\" + merge("[\\x00\\x0D\\x0A]", OBS_QTEXT$$)); //%d0 / CR / LF / obs-qtext +//const FWS$ = subexp(subexp(WSP$$ + "*" + "\\x0D\\x0A") + "?" + WSP$$ + "+"); +//const QUOTED_PAIR$ = subexp(subexp("\\\\" + subexp(VCHAR$$ + "|" + WSP$$)) + "|" + OBS_QP$); +//const QUOTED_STRING$ = subexp('\\"' + subexp(FWS$ + "?" + QCONTENT$) + "*" + FWS$ + "?" + '\\"'); +var ATEXT$$ = "[A-Za-z0-9\\!\\$\\%\\'\\*\\+\\-\\^\\_\\`\\{\\|\\}\\~]"; +var QTEXT$$ = "[\\!\\$\\%\\'\\(\\)\\*\\+\\,\\-\\.0-9\\<\\>A-Z\\x5E-\\x7E]"; +var VCHAR$$ = merge(QTEXT$$, "[\\\"\\\\]"); +var SOME_DELIMS$$ = "[\\!\\$\\'\\(\\)\\*\\+\\,\\;\\:\\@]"; +var UNRESERVED = new RegExp(UNRESERVED$$, "g"); +var PCT_ENCODED = new RegExp(PCT_ENCODED$, "g"); +var NOT_LOCAL_PART = new RegExp(merge("[^]", ATEXT$$, "[\\.]", '[\\"]', VCHAR$$), "g"); +var NOT_HFNAME = new RegExp(merge("[^]", UNRESERVED$$, SOME_DELIMS$$), "g"); +var NOT_HFVALUE = NOT_HFNAME; +function decodeUnreserved(str) { + var decStr = pctDecChars(str); + return !decStr.match(UNRESERVED) ? str : decStr; +} +var handler$4 = { + scheme: "mailto", + parse: function parse$$1(components, options) { + var mailtoComponents = components; + var to = mailtoComponents.to = mailtoComponents.path ? mailtoComponents.path.split(",") : []; + mailtoComponents.path = undefined; + if (mailtoComponents.query) { + var unknownHeaders = false; + var headers = {}; + var hfields = mailtoComponents.query.split("&"); + for (var x = 0, xl = hfields.length; x < xl; ++x) { + var hfield = hfields[x].split("="); + switch (hfield[0]) { + case "to": + var toAddrs = hfield[1].split(","); + for (var _x = 0, _xl = toAddrs.length; _x < _xl; ++_x) { + to.push(toAddrs[_x]); + } + break; + case "subject": + mailtoComponents.subject = unescapeComponent(hfield[1], options); + break; + case "body": + mailtoComponents.body = unescapeComponent(hfield[1], options); + break; + default: + unknownHeaders = true; + headers[unescapeComponent(hfield[0], options)] = unescapeComponent(hfield[1], options); + break; + } + } + if (unknownHeaders) mailtoComponents.headers = headers; + } + mailtoComponents.query = undefined; + for (var _x2 = 0, _xl2 = to.length; _x2 < _xl2; ++_x2) { + var addr = to[_x2].split("@"); + addr[0] = unescapeComponent(addr[0]); + if (!options.unicodeSupport) { + //convert Unicode IDN -> ASCII IDN + try { + addr[1] = punycode.toASCII(unescapeComponent(addr[1], options).toLowerCase()); + } catch (e) { + mailtoComponents.error = mailtoComponents.error || "Email address's domain name can not be converted to ASCII via punycode: " + e; + } + } else { + addr[1] = unescapeComponent(addr[1], options).toLowerCase(); + } + to[_x2] = addr.join("@"); + } + return mailtoComponents; + }, + serialize: function serialize$$1(mailtoComponents, options) { + var components = mailtoComponents; + var to = toArray(mailtoComponents.to); + if (to) { + for (var x = 0, xl = to.length; x < xl; ++x) { + var toAddr = String(to[x]); + var atIdx = toAddr.lastIndexOf("@"); + var localPart = toAddr.slice(0, atIdx).replace(PCT_ENCODED, decodeUnreserved).replace(PCT_ENCODED, toUpperCase).replace(NOT_LOCAL_PART, pctEncChar); + var domain = toAddr.slice(atIdx + 1); + //convert IDN via punycode + try { + domain = !options.iri ? punycode.toASCII(unescapeComponent(domain, options).toLowerCase()) : punycode.toUnicode(domain); + } catch (e) { + components.error = components.error || "Email address's domain name can not be converted to " + (!options.iri ? "ASCII" : "Unicode") + " via punycode: " + e; + } + to[x] = localPart + "@" + domain; + } + components.path = to.join(","); + } + var headers = mailtoComponents.headers = mailtoComponents.headers || {}; + if (mailtoComponents.subject) headers["subject"] = mailtoComponents.subject; + if (mailtoComponents.body) headers["body"] = mailtoComponents.body; + var fields = []; + for (var name in headers) { + if (headers[name] !== O[name]) { + fields.push(name.replace(PCT_ENCODED, decodeUnreserved).replace(PCT_ENCODED, toUpperCase).replace(NOT_HFNAME, pctEncChar) + "=" + headers[name].replace(PCT_ENCODED, decodeUnreserved).replace(PCT_ENCODED, toUpperCase).replace(NOT_HFVALUE, pctEncChar)); + } + } + if (fields.length) { + components.query = fields.join("&"); + } + return components; + } +}; + +var URN_PARSE = /^([^\:]+)\:(.*)/; +//RFC 2141 +var handler$5 = { + scheme: "urn", + parse: function parse$$1(components, options) { + var matches = components.path && components.path.match(URN_PARSE); + var urnComponents = components; + if (matches) { + var scheme = options.scheme || urnComponents.scheme || "urn"; + var nid = matches[1].toLowerCase(); + var nss = matches[2]; + var urnScheme = scheme + ":" + (options.nid || nid); + var schemeHandler = SCHEMES[urnScheme]; + urnComponents.nid = nid; + urnComponents.nss = nss; + urnComponents.path = undefined; + if (schemeHandler) { + urnComponents = schemeHandler.parse(urnComponents, options); + } + } else { + urnComponents.error = urnComponents.error || "URN can not be parsed."; + } + return urnComponents; + }, + serialize: function serialize$$1(urnComponents, options) { + var scheme = options.scheme || urnComponents.scheme || "urn"; + var nid = urnComponents.nid; + var urnScheme = scheme + ":" + (options.nid || nid); + var schemeHandler = SCHEMES[urnScheme]; + if (schemeHandler) { + urnComponents = schemeHandler.serialize(urnComponents, options); + } + var uriComponents = urnComponents; + var nss = urnComponents.nss; + uriComponents.path = (nid || options.nid) + ":" + nss; + return uriComponents; + } +}; + +var UUID = /^[0-9A-Fa-f]{8}(?:\-[0-9A-Fa-f]{4}){3}\-[0-9A-Fa-f]{12}$/; +//RFC 4122 +var handler$6 = { + scheme: "urn:uuid", + parse: function parse(urnComponents, options) { + var uuidComponents = urnComponents; + uuidComponents.uuid = uuidComponents.nss; + uuidComponents.nss = undefined; + if (!options.tolerant && (!uuidComponents.uuid || !uuidComponents.uuid.match(UUID))) { + uuidComponents.error = uuidComponents.error || "UUID is not valid."; + } + return uuidComponents; + }, + serialize: function serialize(uuidComponents, options) { + var urnComponents = uuidComponents; + //normalize UUID + urnComponents.nss = (uuidComponents.uuid || "").toLowerCase(); + return urnComponents; + } +}; + +SCHEMES[handler.scheme] = handler; +SCHEMES[handler$1.scheme] = handler$1; +SCHEMES[handler$2.scheme] = handler$2; +SCHEMES[handler$3.scheme] = handler$3; +SCHEMES[handler$4.scheme] = handler$4; +SCHEMES[handler$5.scheme] = handler$5; +SCHEMES[handler$6.scheme] = handler$6; + +exports.SCHEMES = SCHEMES; +exports.pctEncChar = pctEncChar; +exports.pctDecChars = pctDecChars; +exports.parse = parse; +exports.removeDotSegments = removeDotSegments; +exports.serialize = serialize; +exports.resolveComponents = resolveComponents; +exports.resolve = resolve; +exports.normalize = normalize; +exports.equal = equal; +exports.escapeComponent = escapeComponent; +exports.unescapeComponent = unescapeComponent; + +Object.defineProperty(exports, '__esModule', { value: true }); + +}))); + + +},{}],"ajv":[function(require,module,exports){ +'use strict'; + +var compileSchema = require('./compile') + , resolve = require('./compile/resolve') + , Cache = require('./cache') + , SchemaObject = require('./compile/schema_obj') + , stableStringify = require('fast-json-stable-stringify') + , formats = require('./compile/formats') + , rules = require('./compile/rules') + , $dataMetaSchema = require('./data') + , util = require('./compile/util'); + +module.exports = Ajv; + +Ajv.prototype.validate = validate; +Ajv.prototype.compile = compile; +Ajv.prototype.addSchema = addSchema; +Ajv.prototype.addMetaSchema = addMetaSchema; +Ajv.prototype.validateSchema = validateSchema; +Ajv.prototype.getSchema = getSchema; +Ajv.prototype.removeSchema = removeSchema; +Ajv.prototype.addFormat = addFormat; +Ajv.prototype.errorsText = errorsText; + +Ajv.prototype._addSchema = _addSchema; +Ajv.prototype._compile = _compile; + +Ajv.prototype.compileAsync = require('./compile/async'); +var customKeyword = require('./keyword'); +Ajv.prototype.addKeyword = customKeyword.add; +Ajv.prototype.getKeyword = customKeyword.get; +Ajv.prototype.removeKeyword = customKeyword.remove; +Ajv.prototype.validateKeyword = customKeyword.validate; + +var errorClasses = require('./compile/error_classes'); +Ajv.ValidationError = errorClasses.Validation; +Ajv.MissingRefError = errorClasses.MissingRef; +Ajv.$dataMetaSchema = $dataMetaSchema; + +var META_SCHEMA_ID = 'http://json-schema.org/draft-07/schema'; + +var META_IGNORE_OPTIONS = [ 'removeAdditional', 'useDefaults', 'coerceTypes', 'strictDefaults' ]; +var META_SUPPORT_DATA = ['/properties']; + +/** + * Creates validator instance. + * Usage: `Ajv(opts)` + * @param {Object} opts optional options + * @return {Object} ajv instance + */ +function Ajv(opts) { + if (!(this instanceof Ajv)) return new Ajv(opts); + opts = this._opts = util.copy(opts) || {}; + setLogger(this); + this._schemas = {}; + this._refs = {}; + this._fragments = {}; + this._formats = formats(opts.format); + + this._cache = opts.cache || new Cache; + this._loadingSchemas = {}; + this._compilations = []; + this.RULES = rules(); + this._getId = chooseGetId(opts); + + opts.loopRequired = opts.loopRequired || Infinity; + if (opts.errorDataPath == 'property') opts._errorDataPathProperty = true; + if (opts.serialize === undefined) opts.serialize = stableStringify; + this._metaOpts = getMetaSchemaOptions(this); + + if (opts.formats) addInitialFormats(this); + if (opts.keywords) addInitialKeywords(this); + addDefaultMetaSchema(this); + if (typeof opts.meta == 'object') this.addMetaSchema(opts.meta); + if (opts.nullable) this.addKeyword('nullable', {metaSchema: {type: 'boolean'}}); + addInitialSchemas(this); +} + + + +/** + * Validate data using schema + * Schema will be compiled and cached (using serialized JSON as key. [fast-json-stable-stringify](https://github.com/epoberezkin/fast-json-stable-stringify) is used to serialize. + * @this Ajv + * @param {String|Object} schemaKeyRef key, ref or schema object + * @param {Any} data to be validated + * @return {Boolean} validation result. Errors from the last validation will be available in `ajv.errors` (and also in compiled schema: `schema.errors`). + */ +function validate(schemaKeyRef, data) { + var v; + if (typeof schemaKeyRef == 'string') { + v = this.getSchema(schemaKeyRef); + if (!v) throw new Error('no schema with key or ref "' + schemaKeyRef + '"'); + } else { + var schemaObj = this._addSchema(schemaKeyRef); + v = schemaObj.validate || this._compile(schemaObj); + } + + var valid = v(data); + if (v.$async !== true) this.errors = v.errors; + return valid; +} + + +/** + * Create validating function for passed schema. + * @this Ajv + * @param {Object} schema schema object + * @param {Boolean} _meta true if schema is a meta-schema. Used internally to compile meta schemas of custom keywords. + * @return {Function} validating function + */ +function compile(schema, _meta) { + var schemaObj = this._addSchema(schema, undefined, _meta); + return schemaObj.validate || this._compile(schemaObj); +} + + +/** + * Adds schema to the instance. + * @this Ajv + * @param {Object|Array} schema schema or array of schemas. If array is passed, `key` and other parameters will be ignored. + * @param {String} key Optional schema key. Can be passed to `validate` method instead of schema object or id/ref. One schema per instance can have empty `id` and `key`. + * @param {Boolean} _skipValidation true to skip schema validation. Used internally, option validateSchema should be used instead. + * @param {Boolean} _meta true if schema is a meta-schema. Used internally, addMetaSchema should be used instead. + * @return {Ajv} this for method chaining + */ +function addSchema(schema, key, _skipValidation, _meta) { + if (Array.isArray(schema)){ + for (var i=0; i} errors optional array of validation errors, if not passed errors from the instance are used. + * @param {Object} options optional options with properties `separator` and `dataVar`. + * @return {String} human readable string with all errors descriptions + */ +function errorsText(errors, options) { + errors = errors || this.errors; + if (!errors) return 'No errors'; + options = options || {}; + var separator = options.separator === undefined ? ', ' : options.separator; + var dataVar = options.dataVar === undefined ? 'data' : options.dataVar; + + var text = ''; + for (var i=0; i%\\^`{|}]|%[0-9a-f]{2})|\{[+#./;?&=,!@|]?(?:[a-z0-9_]|%[0-9a-f]{2})+(?::[1-9][0-9]{0,3}|\*)?(?:,(?:[a-z0-9_]|%[0-9a-f]{2})+(?::[1-9][0-9]{0,3}|\*)?)*\})*$/i,u=/^(?:(?:http[s\u017F]?|ftp):\/\/)(?:(?:[\0-\x08\x0E-\x1F!-\x9F\xA1-\u167F\u1681-\u1FFF\u200B-\u2027\u202A-\u202E\u2030-\u205E\u2060-\u2FFF\u3001-\uD7FF\uE000-\uFEFE\uFF00-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])+(?::(?:[\0-\x08\x0E-\x1F!-\x9F\xA1-\u167F\u1681-\u1FFF\u200B-\u2027\u202A-\u202E\u2030-\u205E\u2060-\u2FFF\u3001-\uD7FF\uE000-\uFEFE\uFF00-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])*)?@)?(?:(?!10(?:\.[0-9]{1,3}){3})(?!127(?:\.[0-9]{1,3}){3})(?!169\.254(?:\.[0-9]{1,3}){2})(?!192\.168(?:\.[0-9]{1,3}){2})(?!172\.(?:1[6-9]|2[0-9]|3[01])(?:\.[0-9]{1,3}){2})(?:[1-9][0-9]?|1[0-9][0-9]|2[01][0-9]|22[0-3])(?:\.(?:1?[0-9]{1,2}|2[0-4][0-9]|25[0-5])){2}(?:\.(?:[1-9][0-9]?|1[0-9][0-9]|2[0-4][0-9]|25[0-4]))|(?:(?:(?:[0-9a-z\xA1-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])+-)*(?:[0-9a-z\xA1-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])+)(?:\.(?:(?:[0-9a-z\xA1-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])+-)*(?:[0-9a-z\xA1-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])+)*(?:\.(?:(?:[a-z\xA1-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]){2,})))(?::[0-9]{2,5})?(?:\/(?:[\0-\x08\x0E-\x1F!-\x9F\xA1-\u167F\u1681-\u1FFF\u200B-\u2027\u202A-\u202E\u2030-\u205E\u2060-\u2FFF\u3001-\uD7FF\uE000-\uFEFE\uFF00-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])*)?$/i,h=/^(?:urn:uuid:)?[0-9a-f]{8}-(?:[0-9a-f]{4}-){3}[0-9a-f]{12}$/i,d=/^(?:\/(?:[^~/]|~0|~1)*)*$/,p=/^#(?:\/(?:[a-z0-9_\-.!$&'()*+,;:=@]|%[0-9a-f]{2}|~0|~1)*)*$/i,f=/^(?:0|[1-9][0-9]*)(?:#|(?:\/(?:[^~/]|~0|~1)*)*)$/;function m(e){return a.copy(m[e="full"==e?"full":"fast"])}function v(e){var r=e.match(o);if(!r)return!1;var t,a=+r[2],s=+r[3];return 1<=a&&a<=12&&1<=s&&s<=(2!=a||((t=+r[1])%4!=0||t%100==0&&t%400!=0)?i[a]:29)}function y(e,r){var t=e.match(n);if(!t)return!1;var a=t[1],s=t[2],o=t[3];return(a<=23&&s<=59&&o<=59||23==a&&59==s&&60==o)&&(!r||t[5])}(r.exports=m).fast={date:/^\d\d\d\d-[0-1]\d-[0-3]\d$/,time:/^(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)?$/i,"date-time":/^\d\d\d\d-[0-1]\d-[0-3]\d[t\s](?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)$/i,uri:/^(?:[a-z][a-z0-9+\-.]*:)(?:\/?\/)?[^\s]*$/i,"uri-reference":/^(?:(?:[a-z][a-z0-9+\-.]*:)?\/?\/)?(?:[^\\\s#][^\s#]*)?(?:#[^\\\s]*)?$/i,"uri-template":c,url:u,email:/^[a-z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?(?:\.[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?)*$/i,hostname:s,ipv4:/^(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?)$/,ipv6:/^\s*(?:(?:(?:[0-9a-f]{1,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-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:)))(?:%.+)?\s*$/i,regex:w,uuid:h,"json-pointer":d,"json-pointer-uri-fragment":p,"relative-json-pointer":f},m.full={date:v,time:y,"date-time":function(e){var r=e.split(g);return 2==r.length&&v(r[0])&&y(r[1],!0)},uri:function(e){return P.test(e)&&l.test(e)},"uri-reference":/^(?:[a-z][a-z0-9+\-.]*:)?(?:\/?\/(?:(?:[a-z0-9\-._~!$&'()*+,;=:]|%[0-9a-f]{2})*@)?(?:\[(?:(?:(?:(?:[0-9a-f]{1,4}:){6}|::(?:[0-9a-f]{1,4}:){5}|(?:[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){4}|(?:(?:[0-9a-f]{1,4}:){0,1}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){3}|(?:(?:[0-9a-f]{1,4}:){0,2}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){2}|(?:(?:[0-9a-f]{1,4}:){0,3}[0-9a-f]{1,4})?::[0-9a-f]{1,4}:|(?:(?:[0-9a-f]{1,4}:){0,4}[0-9a-f]{1,4})?::)(?:[0-9a-f]{1,4}:[0-9a-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?))|(?:(?:[0-9a-f]{1,4}:){0,5}[0-9a-f]{1,4})?::[0-9a-f]{1,4}|(?:(?:[0-9a-f]{1,4}:){0,6}[0-9a-f]{1,4})?::)|[Vv][0-9a-f]+\.[a-z0-9\-._~!$&'()*+,;=:]+)\]|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?)|(?:[a-z0-9\-._~!$&'"()*+,;=]|%[0-9a-f]{2})*)(?::\d*)?(?:\/(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})*)*|\/(?:(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f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4}){0,2}:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(?:(?:[0-9a-f]{1,4}:){2}(?:(?:(?::[0-9a-f]{1,4}){1,5})|(?:(?::[0-9a-f]{1,4}){0,3}:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(?:(?:[0-9a-f]{1,4}:){1}(?:(?:(?::[0-9a-f]{1,4}){1,6})|(?:(?::[0-9a-f]{1,4}){0,4}:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(?::(?:(?:(?::[0-9a-f]{1,4}){1,7})|(?:(?::[0-9a-f]{1,4}){0,5}:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:)))(?:%.+)?\s*$/i,regex:w,uuid:h,"json-pointer":d,"json-pointer-uri-fragment":p,"relative-json-pointer":f};var g=/t|\s/i;var P=/\/|:/;var E=/[^\\]\\Z/;function w(e){if(E.test(e))return!1;try{return new RegExp(e),!0}catch(e){return!1}}},{"./util":10}],5:[function(e,r,t){"use strict";var R=e("./resolve"),$=e("./util"),j=e("./error_classes"),D=e("fast-json-stable-stringify"),O=e("../dotjs/validate"),I=$.ucs2length,A=e("fast-deep-equal"),k=j.Validation;function C(e,c,u,r){var d=this,p=this._opts,h=[void 0],f={},l=[],t={},m=[],a={},v=[],s=function(e,r,t){var a=L.call(this,e,r,t);return 0<=a?{index:a,compiling:!0}:{index:a=this._compilations.length,compiling:!(this._compilations[a]={schema:e,root:r,baseId:t})}}.call(this,e,c=c||{schema:e,refVal:h,refs:f},r),o=this._compilations[s.index];if(s.compiling)return o.callValidate=P;var y=this._formats,g=this.RULES;try{var i=E(e,c,u,r);o.validate=i;var n=o.callValidate;return n&&(n.schema=i.schema,n.errors=null,n.refs=i.refs,n.refVal=i.refVal,n.root=i.root,n.$async=i.$async,p.sourceCode&&(n.source=i.source)),i}finally{(function(e,r,t){var a=L.call(this,e,r,t);0<=a&&this._compilations.splice(a,1)}).call(this,e,c,r)}function P(){var e=o.validate,r=e.apply(this,arguments);return P.errors=e.errors,r}function E(e,r,t,a){var s=!r||r&&r.schema==e;if(r.schema!=c.schema)return C.call(d,e,r,t,a);var o=!0===e.$async,i=O({isTop:!0,schema:e,isRoot:s,baseId:a,root:r,schemaPath:"",errSchemaPath:"#",errorPath:'""',MissingRefError:j.MissingRef,RULES:g,validate:O,util:$,resolve:R,resolveRef:w,usePattern:_,useDefault:F,useCustomRule:x,opts:p,formats:y,logger:d.logger,self:d}),i=Q(h,z)+Q(l,N)+Q(m,q)+Q(v,T)+i;p.processCode&&(i=p.processCode(i,e));try{var n=new Function("self","RULES","formats","root","refVal","defaults","customRules","equal","ucs2length","ValidationError",i)(d,g,y,c,h,m,v,A,I,k);h[0]=n}catch(e){throw d.logger.error("Error compiling schema, function code:",i),e}return n.schema=e,n.errors=null,n.refs=f,n.refVal=h,n.root=s?n:r,o&&(n.$async=!0),!0===p.sourceCode&&(n.source={code:i,patterns:l,defaults:m}),n}function w(e,r,t){r=R.url(e,r);var a,s,o=f[r];if(void 0!==o)return S(a=h[o],s="refVal["+o+"]");if(!t&&c.refs){var i=c.refs[r];if(void 0!==i)return S(a=c.refVal[i],s=b(r,a))}s=b(r);var n,l=R.call(d,E,c,r);if(void 0!==l||(n=u&&u[r])&&(l=R.inlineRef(n,p.inlineRefs)?n:C.call(d,n,c,u,e)),void 0!==l)return S(h[f[r]]=l,s);delete f[r]}function b(e,r){var t=h.length;return h[t]=r,"refVal"+(f[e]=t)}function S(e,r){return"object"==typeof e||"boolean"==typeof e?{code:r,schema:e,inline:!0}:{code:r,$async:e&&!!e.$async}}function _(e){var r=t[e];return void 0===r&&(r=t[e]=l.length,l[r]=e),"pattern"+r}function F(e){switch(typeof e){case"boolean":case"number":return""+e;case"string":return $.toQuotedString(e);case"object":if(null===e)return"null";var r=D(e),t=a[r];return void 0===t&&(t=a[r]=m.length,m[t]=e),"default"+t}}function x(e,r,t,a){if(!1!==d._opts.validateSchema){var s=e.definition.dependencies;if(s&&!s.every(function(e){return Object.prototype.hasOwnProperty.call(t,e)}))throw new Error("parent schema must have all required keywords: "+s.join(","));var o=e.definition.validateSchema;if(o)if(!o(r)){var i="keyword schema is invalid: "+d.errorsText(o.errors);if("log"!=d._opts.validateSchema)throw new Error(i);d.logger.error(i)}}var n,l=e.definition.compile,c=e.definition.inline,u=e.definition.macro;if(l)n=l.call(d,r,t,a);else if(u)n=u.call(d,r,t,a),!1!==p.validateSchema&&d.validateSchema(n,!0);else if(c)n=c.call(d,a,e.keyword,r,t);else if(!(n=e.definition.validate))return;if(void 0===n)throw new Error('custom keyword "'+e.keyword+'"failed to compile');var h=v.length;return{code:"customRule"+h,validate:v[h]=n}}}function L(e,r,t){for(var a=0;a",_=P?">":"<",F=void 0;if(!y&&"number"!=typeof d&&void 0!==d)throw new Error(r+" must be number");if(!b&&void 0!==w&&"number"!=typeof w&&"boolean"!=typeof w)throw new Error(E+" must be number or boolean");b?(o="exclIsNumber"+u,i="' + "+(n="op"+u)+" + '",c+=" var schemaExcl"+u+" = "+(t=e.util.getData(w.$data,h,e.dataPathArr))+"; ",F=E,(l=l||[]).push(c+=" var "+(a="exclusive"+u)+"; var "+(s="exclType"+u)+" = typeof "+(t="schemaExcl"+u)+"; if ("+s+" != 'boolean' && "+s+" != 'undefined' && "+s+" != 'number') { "),c="",!1!==e.createErrors?(c+=" { keyword: '"+(F||"_exclusiveLimit")+"' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(f)+" , params: {} ",!1!==e.opts.messages&&(c+=" , message: '"+E+" should be boolean' "),e.opts.verbose&&(c+=" , schema: validate.schema"+p+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+v+" "),c+=" } "):c+=" {} ",x=c,c=l.pop(),c+=!e.compositeRule&&m?e.async?" throw new ValidationError(["+x+"]); ":" validate.errors = ["+x+"]; return false; ":" var err = "+x+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",c+=" } else if ( ",y&&(c+=" ("+g+" !== undefined && typeof "+g+" != 'number') || "),c+=" "+s+" == 'number' ? ( ("+a+" = "+g+" === undefined || "+t+" "+S+"= "+g+") ? "+v+" "+_+"= "+t+" : "+v+" "+_+" "+g+" ) : ( ("+a+" = "+t+" === true) ? "+v+" "+_+"= "+g+" : "+v+" "+_+" "+g+" ) || "+v+" !== "+v+") { var op"+u+" = "+a+" ? '"+S+"' : '"+S+"='; ",void 0===d&&(f=e.errSchemaPath+"/"+(F=E),g=t,y=b)):(i=S,(o="number"==typeof w)&&y?(n="'"+i+"'",c+=" if ( ",y&&(c+=" ("+g+" !== undefined && typeof "+g+" != 'number') || "),c+=" ( "+g+" === undefined || "+w+" "+S+"= "+g+" ? "+v+" "+_+"= "+w+" : "+v+" "+_+" "+g+" ) || "+v+" !== "+v+") { "):(o&&void 0===d?(a=!0,f=e.errSchemaPath+"/"+(F=E),g=w,_+="="):(o&&(g=Math[P?"min":"max"](w,d)),w===(!o||g)?(a=!0,f=e.errSchemaPath+"/"+(F=E),_+="="):(a=!1,i+="=")),n="'"+i+"'",c+=" if ( ",y&&(c+=" ("+g+" !== undefined && typeof "+g+" != 'number') || "),c+=" "+v+" "+_+" "+g+" || "+v+" !== "+v+") { ")),F=F||r,(l=l||[]).push(c),c="",!1!==e.createErrors?(c+=" { keyword: '"+(F||"_limit")+"' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(f)+" , params: { comparison: "+n+", limit: "+g+", exclusive: "+a+" } ",!1!==e.opts.messages&&(c+=" , message: 'should be "+i+" ",c+=y?"' + "+g:g+"'"),e.opts.verbose&&(c+=" , schema: ",c+=y?"validate.schema"+p:""+d,c+=" , parentSchema: validate.schema"+e.schemaPath+" , data: "+v+" "),c+=" } "):c+=" {} ";var x=c;return c=l.pop(),c+=!e.compositeRule&&m?e.async?" throw new ValidationError(["+x+"]); ":" validate.errors = ["+x+"]; return false; ":" var err = "+x+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",c+=" } ",m&&(c+=" else { "),c}},{}],14:[function(e,r,t){"use strict";r.exports=function(e,r){var t=" ",a=e.level,s=e.dataLevel,o=e.schema[r],i=e.schemaPath+e.util.getProperty(r),n=e.errSchemaPath+"/"+r,l=!e.opts.allErrors,c="data"+(s||""),u=e.opts.$data&&o&&o.$data,h=u?(t+=" var schema"+a+" = "+e.util.getData(o.$data,s,e.dataPathArr)+"; ","schema"+a):o;if(!u&&"number"!=typeof o)throw new Error(r+" must be number");t+="if ( ",u&&(t+=" ("+h+" !== undefined && typeof "+h+" != 'number') || ");var d=r,p=p||[];p.push(t+=" "+c+".length "+("maxItems"==r?">":"<")+" "+h+") { "),t="",!1!==e.createErrors?(t+=" { keyword: '"+(d||"_limitItems")+"' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(n)+" , params: { limit: "+h+" } ",!1!==e.opts.messages&&(t+=" , message: 'should NOT have ",t+="maxItems"==r?"more":"fewer",t+=" than ",t+=u?"' + "+h+" + '":""+o,t+=" items' "),e.opts.verbose&&(t+=" , schema: ",t+=u?"validate.schema"+i:""+o,t+=" , parentSchema: validate.schema"+e.schemaPath+" , data: "+c+" "),t+=" } "):t+=" {} ";var f=t,t=p.pop();return t+=!e.compositeRule&&l?e.async?" throw new ValidationError(["+f+"]); ":" validate.errors = ["+f+"]; return false; ":" var err = "+f+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",t+="} ",l&&(t+=" else { "),t}},{}],15:[function(e,r,t){"use strict";r.exports=function(e,r){var t=" ",a=e.level,s=e.dataLevel,o=e.schema[r],i=e.schemaPath+e.util.getProperty(r),n=e.errSchemaPath+"/"+r,l=!e.opts.allErrors,c="data"+(s||""),u=e.opts.$data&&o&&o.$data,h=u?(t+=" var schema"+a+" = "+e.util.getData(o.$data,s,e.dataPathArr)+"; ","schema"+a):o;if(!u&&"number"!=typeof o)throw new Error(r+" must be number");t+="if ( ",u&&(t+=" ("+h+" !== undefined && typeof "+h+" != 'number') || "),t+=!1===e.opts.unicode?" "+c+".length ":" ucs2length("+c+") ";var d=r,p=p||[];p.push(t+=" "+("maxLength"==r?">":"<")+" "+h+") { "),t="",!1!==e.createErrors?(t+=" { keyword: '"+(d||"_limitLength")+"' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(n)+" , params: { limit: "+h+" } ",!1!==e.opts.messages&&(t+=" , message: 'should NOT be ",t+="maxLength"==r?"longer":"shorter",t+=" than ",t+=u?"' + "+h+" + '":""+o,t+=" characters' "),e.opts.verbose&&(t+=" , schema: ",t+=u?"validate.schema"+i:""+o,t+=" , parentSchema: validate.schema"+e.schemaPath+" , data: "+c+" "),t+=" } "):t+=" {} ";var f=t,t=p.pop();return t+=!e.compositeRule&&l?e.async?" throw new ValidationError(["+f+"]); ":" validate.errors = ["+f+"]; return false; ":" var err = "+f+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",t+="} ",l&&(t+=" else { "),t}},{}],16:[function(e,r,t){"use strict";r.exports=function(e,r){var t=" ",a=e.level,s=e.dataLevel,o=e.schema[r],i=e.schemaPath+e.util.getProperty(r),n=e.errSchemaPath+"/"+r,l=!e.opts.allErrors,c="data"+(s||""),u=e.opts.$data&&o&&o.$data,h=u?(t+=" var schema"+a+" = "+e.util.getData(o.$data,s,e.dataPathArr)+"; ","schema"+a):o;if(!u&&"number"!=typeof o)throw new Error(r+" must be number");t+="if ( ",u&&(t+=" ("+h+" !== undefined && typeof "+h+" != 'number') || ");var d=r,p=p||[];p.push(t+=" Object.keys("+c+").length "+("maxProperties"==r?">":"<")+" "+h+") { "),t="",!1!==e.createErrors?(t+=" { keyword: '"+(d||"_limitProperties")+"' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(n)+" , params: { limit: "+h+" } ",!1!==e.opts.messages&&(t+=" , message: 'should NOT have ",t+="maxProperties"==r?"more":"fewer",t+=" than ",t+=u?"' + "+h+" + '":""+o,t+=" properties' "),e.opts.verbose&&(t+=" , schema: ",t+=u?"validate.schema"+i:""+o,t+=" , parentSchema: validate.schema"+e.schemaPath+" , data: "+c+" "),t+=" } "):t+=" {} ";var f=t,t=p.pop();return t+=!e.compositeRule&&l?e.async?" throw new ValidationError(["+f+"]); ":" validate.errors = ["+f+"]; return false; ":" var err = "+f+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",t+="} ",l&&(t+=" else { "),t}},{}],17:[function(e,r,t){"use strict";r.exports=function(e,r){var t=" ",a=e.schema[r],s=e.schemaPath+e.util.getProperty(r),o=e.errSchemaPath+"/"+r,i=!e.opts.allErrors,n=e.util.copy(e),l="";n.level++;var c="valid"+n.level,u=n.baseId,h=!0,d=a;if(d)for(var p,f=-1,m=d.length-1;f "+_+") { ",x=c+"["+_+"]",d.schema=$,d.schemaPath=i+"["+_+"]",d.errSchemaPath=n+"/"+_,d.errorPath=e.util.getPathExpr(e.errorPath,_,e.opts.jsonPointers,!0),d.dataPathArr[v]=_,R=e.validate(d),d.baseId=g,e.util.varOccurences(R,y)<2?t+=" "+e.util.varReplace(R,y,x)+" ":t+=" var "+y+" = "+x+"; "+R+" ",t+=" } ",l&&(t+=" if ("+f+") { ",p+="}"))}"object"==typeof b&&(e.opts.strictKeywords?"object"==typeof b&&0 "+o.length+") { for (var "+m+" = "+o.length+"; "+m+" < "+c+".length; "+m+"++) { ",d.errorPath=e.util.getPathExpr(e.errorPath,m,e.opts.jsonPointers,!0),x=c+"["+m+"]",d.dataPathArr[v]=m,R=e.validate(d),d.baseId=g,e.util.varOccurences(R,y)<2?t+=" "+e.util.varReplace(R,y,x)+" ":t+=" var "+y+" = "+x+"; "+R+" ",l&&(t+=" if (!"+f+") break; "),t+=" } } ",l&&(t+=" if ("+f+") { ",p+="}"))}else{(e.opts.strictKeywords?"object"==typeof o&&0 1e-"+e.opts.multipleOfPrecision+" ":" division"+a+" !== parseInt(division"+a+") ",t+=" ) ",u&&(t+=" ) ");var d=d||[];d.push(t+=" ) { "),t="",!1!==e.createErrors?(t+=" { keyword: 'multipleOf' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(n)+" , params: { multipleOf: "+h+" } ",!1!==e.opts.messages&&(t+=" , message: 'should be multiple of ",t+=u?"' + "+h:h+"'"),e.opts.verbose&&(t+=" , schema: ",t+=u?"validate.schema"+i:""+o,t+=" , parentSchema: validate.schema"+e.schemaPath+" , data: "+c+" "),t+=" } "):t+=" {} ";var p=t,t=d.pop();return t+=!e.compositeRule&&l?e.async?" throw new ValidationError(["+p+"]); ":" validate.errors = ["+p+"]; return false; ":" var err = "+p+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",t+="} ",l&&(t+=" else { "),t}},{}],30:[function(e,r,t){"use strict";r.exports=function(e,r){var t=" ",a=e.level,s=e.dataLevel,o=e.schema[r],i=e.schemaPath+e.util.getProperty(r),n=e.errSchemaPath+"/"+r,l=!e.opts.allErrors,c="data"+(s||""),u="errs__"+a,h=e.util.copy(e);h.level++;var d,p,f,m,v="valid"+h.level;return(e.opts.strictKeywords?"object"==typeof o&&0 1) { ",t=e.schema.items&&e.schema.items.type,a=Array.isArray(t),!t||"object"==t||"array"==t||a&&(0<=t.indexOf("object")||0<=t.indexOf("array"))?i+=" outer: for (;i--;) { for (j = i; j--;) { if (equal("+p+"[i], "+p+"[j])) { "+f+" = false; break outer; } } } ":(i+=" var itemIndices = {}, item; for (;i--;) { var item = "+p+"[i]; ",i+=" if ("+e.util["checkDataType"+(a?"s":"")](t,"item",e.opts.strictNumbers,!0)+") continue; ",a&&(i+=" if (typeof item == 'string') item = '\"' + item; "),i+=" if (typeof itemIndices[item] == 'number') { "+f+" = false; j = itemIndices[item]; break; } itemIndices[item] = i; } "),i+=" } ",m&&(i+=" } "),(s=s||[]).push(i+=" if (!"+f+") { "),i="",!1!==e.createErrors?(i+=" { keyword: 'uniqueItems' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(h)+" , params: { i: i, j: j } ",!1!==e.opts.messages&&(i+=" , message: 'should NOT have duplicate items (items ## ' + j + ' and ' + i + ' are identical)' "),e.opts.verbose&&(i+=" , schema: ",i+=m?"validate.schema"+u:""+c,i+=" , parentSchema: validate.schema"+e.schemaPath+" , data: "+p+" "),i+=" } "):i+=" {} ",o=i,i=s.pop(),i+=!e.compositeRule&&d?e.async?" throw new ValidationError(["+o+"]); ":" validate.errors = ["+o+"]; return false; ":" var err = "+o+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",i+=" } ",d&&(i+=" else { ")):d&&(i+=" if (true) { "),i}},{}],38:[function(e,r,t){"use strict";r.exports=function(a,e){var r="",t=!0===a.schema.$async,s=a.util.schemaHasRulesExcept(a.schema,a.RULES.all,"$ref"),o=a.self._getId(a.schema);if(a.opts.strictKeywords){var i=a.util.schemaUnknownRules(a.schema,a.RULES.keywords);if(i){var n="unknown keyword: "+i;if("log"!==a.opts.strictKeywords)throw new Error(n);a.logger.warn(n)}}if(a.isTop&&(r+=" var validate = ",t&&(a.async=!0,r+="async "),r+="function(data, dataPath, parentData, parentDataProperty, rootData) { 'use strict'; ",o&&(a.opts.sourceCode||a.opts.processCode)&&(r+=" /*# sourceURL="+o+" */ ")),"boolean"==typeof a.schema||!s&&!a.schema.$ref){var l=a.level,c=a.dataLevel,u=a.schema[e="false schema"],h=a.schemaPath+a.util.getProperty(e),d=a.errSchemaPath+"/"+e,p=!a.opts.allErrors,f="data"+(c||""),m="valid"+l;return!1===a.schema?(a.isTop?p=!0:r+=" var "+m+" = false; ",(U=U||[]).push(r),r="",!1!==a.createErrors?(r+=" { keyword: 'false schema' , dataPath: (dataPath || '') + "+a.errorPath+" , schemaPath: "+a.util.toQuotedString(d)+" , params: {} ",!1!==a.opts.messages&&(r+=" , message: 'boolean schema is false' "),a.opts.verbose&&(r+=" , schema: false , parentSchema: validate.schema"+a.schemaPath+" , data: "+f+" "),r+=" } "):r+=" {} ",D=r,r=U.pop(),r+=!a.compositeRule&&p?a.async?" throw new ValidationError(["+D+"]); ":" validate.errors = ["+D+"]; return false; ":" var err = "+D+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; "):r+=a.isTop?t?" return data; ":" validate.errors = null; return true; ":" var "+m+" = true; ",a.isTop&&(r+=" }; return validate; "),r}if(a.isTop){var v=a.isTop,l=a.level=0,c=a.dataLevel=0,f="data";if(a.rootId=a.resolve.fullPath(a.self._getId(a.root.schema)),a.baseId=a.baseId||a.rootId,delete a.isTop,a.dataPathArr=[""],void 0!==a.schema.default&&a.opts.useDefaults&&a.opts.strictDefaults){var y="default is ignored in the schema root";if("log"!==a.opts.strictDefaults)throw new Error(y);a.logger.warn(y)}r+=" var vErrors = null; ",r+=" var errors = 0; ",r+=" if (rootData === undefined) rootData = data; "}else{l=a.level,f="data"+((c=a.dataLevel)||"");if(o&&(a.baseId=a.resolve.url(a.baseId,o)),t&&!a.async)throw new Error("async schema in sync schema");r+=" var errs_"+l+" = errors;"}var g,m="valid"+l,p=!a.opts.allErrors,P="",E="",w=a.schema.type,b=Array.isArray(w);if(w&&a.opts.nullable&&!0===a.schema.nullable&&(b?-1==w.indexOf("null")&&(w=w.concat("null")):"null"!=w&&(w=[w,"null"],b=!0)),b&&1==w.length&&(w=w[0],b=!1),a.schema.$ref&&s){if("fail"==a.opts.extendRefs)throw new Error('$ref: validation keywords used in schema at path "'+a.errSchemaPath+'" (see option extendRefs)');!0!==a.opts.extendRefs&&(s=!1,a.logger.warn('$ref: keywords ignored in schema at path "'+a.errSchemaPath+'"'))}if(a.schema.$comment&&a.opts.$comment&&(r+=" "+a.RULES.all.$comment.code(a,"$comment")),w){a.opts.coerceTypes&&(g=a.util.coerceToTypes(a.opts.coerceTypes,w));var S=a.RULES.types[w];if(g||b||!0===S||S&&!Z(S)){h=a.schemaPath+".type",d=a.errSchemaPath+"/type",h=a.schemaPath+".type",d=a.errSchemaPath+"/type";if(r+=" if ("+a.util[b?"checkDataTypes":"checkDataType"](w,f,a.opts.strictNumbers,!0)+") { ",g){var _="dataType"+l,F="coerced"+l;r+=" var "+_+" = typeof "+f+"; var "+F+" = undefined; ","array"==a.opts.coerceTypes&&(r+=" if ("+_+" == 'object' && Array.isArray("+f+") && "+f+".length == 1) { "+f+" = "+f+"[0]; "+_+" = typeof "+f+"; if ("+a.util.checkDataType(a.schema.type,f,a.opts.strictNumbers)+") "+F+" = "+f+"; } "),r+=" if ("+F+" !== undefined) ; ";var x=g;if(x)for(var R,$=-1,j=x.length-1;$= 0x80 (not a basic code point)","invalid-input":"Invalid input"},k=Math.floor,C=String.fromCharCode;function L(e){throw new RangeError(i[e])}function n(e,r){var t=e.split("@"),a="";return 1>1,e+=k(e/r);455k((A-a)/h))&&L("overflow"),a+=p*h;var f=d<=o?1:o+26<=d?26:d-o;if(pk(A/m)&&L("overflow"),h*=m}var v=r.length+1,o=z(a-u,v,0==u);k(a/v)>A-s&&L("overflow"),s+=k(a/v),a%=v,r.splice(a++,0,s)}return String.fromCodePoint.apply(String,r)}function c(e){var r=[],t=(e=N(e)).length,a=128,s=0,o=72,i=!0,n=!1,l=void 0;try{for(var c,u=e[Symbol.iterator]();!(i=(c=u.next()).done);i=!0){var h=c.value;h<128&&r.push(C(h))}}catch(e){n=!0,l=e}finally{try{!i&&u.return&&u.return()}finally{if(n)throw l}}var d=r.length,p=d;for(d&&r.push("-");pk((A-s)/w)&&L("overflow"),s+=(f-a)*w,a=f;var b=!0,S=!1,_=void 0;try{for(var F,x=e[Symbol.iterator]();!(b=(F=x.next()).done);b=!0){var R=F.value;if(RA&&L("overflow"),R==a){for(var $=s,j=36;;j+=36){var D=j<=o?1:o+26<=j?26:j-o;if($>6|192).toString(16).toUpperCase()+"%"+(63&r|128).toString(16).toUpperCase():"%"+(r>>12|224).toString(16).toUpperCase()+"%"+(r>>6&63|128).toString(16).toUpperCase()+"%"+(63&r|128).toString(16).toUpperCase()}function p(e){for(var r="",t=0,a=e.length;tA-Z\\x5E-\\x7E]",'[\\"\\\\]')),Y=new RegExp(K,"g"),W=new RegExp("(?:(?:%[EFef][0-9A-Fa-f]%[0-9A-Fa-f][0-9A-Fa-f]%[0-9A-Fa-f][0-9A-Fa-f])|(?:%[89A-Fa-f][0-9A-Fa-f]%[0-9A-Fa-f][0-9A-Fa-f])|(?:%[0-9A-Fa-f][0-9A-Fa-f]))","g"),X=new RegExp(J("[^]","[A-Za-z0-9\\!\\$\\%\\'\\*\\+\\-\\^\\_\\`\\{\\|\\}\\~]","[\\.]",'[\\"]',G),"g"),ee=new RegExp(J("[^]",K,"[\\!\\$\\'\\(\\)\\*\\+\\,\\;\\:\\@]"),"g"),re=ee;function te(e){var r=p(e);return r.match(Y)?r:e}var ae={scheme:"mailto",parse:function(e,r){var t=e,a=t.to=t.path?t.path.split(","):[];if(t.path=void 0,t.query){for(var s=!1,o={},i=t.query.split("&"),n=0,l=i.length;n); + + message: string; + errors: Array; + ajv: true; + validation: true; + } + + class MissingRefError extends Error { + constructor(baseId: string, ref: string, message?: string); + static message: (baseId: string, ref: string) => string; + + message: string; + missingRef: string; + missingSchema: string; + } +} + +declare namespace ajv { + type ValidationError = AjvErrors.ValidationError; + + type MissingRefError = AjvErrors.MissingRefError; + + interface Ajv { + /** + * Validate data using schema + * Schema will be compiled and cached (using serialized JSON as key, [fast-json-stable-stringify](https://github.com/epoberezkin/fast-json-stable-stringify) is used to serialize by default). + * @param {string|object|Boolean} schemaKeyRef key, ref or schema object + * @param {Any} data to be validated + * @return {Boolean} validation result. Errors from the last validation will be available in `ajv.errors` (and also in compiled schema: `schema.errors`). + */ + validate(schemaKeyRef: object | string | boolean, data: any): boolean | PromiseLike; + /** + * Create validating function for passed schema. + * @param {object|Boolean} schema schema object + * @return {Function} validating function + */ + compile(schema: object | boolean): ValidateFunction; + /** + * Creates validating function for passed schema with asynchronous loading of missing schemas. + * `loadSchema` option should be a function that accepts schema uri and node-style callback. + * @this Ajv + * @param {object|Boolean} schema schema object + * @param {Boolean} meta optional true to compile meta-schema; this parameter can be skipped + * @param {Function} callback optional node-style callback, it is always called with 2 parameters: error (or null) and validating function. + * @return {PromiseLike} validating function + */ + compileAsync(schema: object | boolean, meta?: Boolean, callback?: (err: Error, validate: ValidateFunction) => any): PromiseLike; + /** + * Adds schema to the instance. + * @param {object|Array} schema schema or array of schemas. If array is passed, `key` and other parameters will be ignored. + * @param {string} key Optional schema key. Can be passed to `validate` method instead of schema object or id/ref. One schema per instance can have empty `id` and `key`. + * @return {Ajv} this for method chaining + */ + addSchema(schema: Array | object, key?: string): Ajv; + /** + * Add schema that will be used to validate other schemas + * options in META_IGNORE_OPTIONS are alway set to false + * @param {object} schema schema object + * @param {string} key optional schema key + * @return {Ajv} this for method chaining + */ + addMetaSchema(schema: object, key?: string): Ajv; + /** + * Validate schema + * @param {object|Boolean} schema schema to validate + * @return {Boolean} true if schema is valid + */ + validateSchema(schema: object | boolean): boolean; + /** + * Get compiled schema from the instance by `key` or `ref`. + * @param {string} keyRef `key` that was passed to `addSchema` or full schema reference (`schema.id` or resolved id). + * @return {Function} schema validating function (with property `schema`). Returns undefined if keyRef can't be resolved to an existing schema. + */ + getSchema(keyRef: string): ValidateFunction | undefined; + /** + * Remove cached schema(s). + * If no parameter is passed all schemas but meta-schemas are removed. + * If RegExp is passed all schemas with key/id matching pattern but meta-schemas are removed. + * Even if schema is referenced by other schemas it still can be removed as other schemas have local references. + * @param {string|object|RegExp|Boolean} schemaKeyRef key, ref, pattern to match key/ref or schema object + * @return {Ajv} this for method chaining + */ + removeSchema(schemaKeyRef?: object | string | RegExp | boolean): Ajv; + /** + * Add custom format + * @param {string} name format name + * @param {string|RegExp|Function} format string is converted to RegExp; function should return boolean (true when valid) + * @return {Ajv} this for method chaining + */ + addFormat(name: string, format: FormatValidator | FormatDefinition): Ajv; + /** + * Define custom keyword + * @this Ajv + * @param {string} keyword custom keyword, should be a valid identifier, should be different from all standard, custom and macro keywords. + * @param {object} definition keyword definition object with properties `type` (type(s) which the keyword applies to), `validate` or `compile`. + * @return {Ajv} this for method chaining + */ + addKeyword(keyword: string, definition: KeywordDefinition): Ajv; + /** + * Get keyword definition + * @this Ajv + * @param {string} keyword pre-defined or custom keyword. + * @return {object|Boolean} custom keyword definition, `true` if it is a predefined keyword, `false` otherwise. + */ + getKeyword(keyword: string): object | boolean; + /** + * Remove keyword + * @this Ajv + * @param {string} keyword pre-defined or custom keyword. + * @return {Ajv} this for method chaining + */ + removeKeyword(keyword: string): Ajv; + /** + * Validate keyword + * @this Ajv + * @param {object} definition keyword definition object + * @param {boolean} throwError true to throw exception if definition is invalid + * @return {boolean} validation result + */ + validateKeyword(definition: KeywordDefinition, throwError: boolean): boolean; + /** + * Convert array of error message objects to string + * @param {Array} errors optional array of validation errors, if not passed errors from the instance are used. + * @param {object} options optional options with properties `separator` and `dataVar`. + * @return {string} human readable string with all errors descriptions + */ + errorsText(errors?: Array | null, options?: ErrorsTextOptions): string; + errors?: Array | null; + _opts: Options; + } + + interface CustomLogger { + log(...args: any[]): any; + warn(...args: any[]): any; + error(...args: any[]): any; + } + + interface ValidateFunction { + ( + data: any, + dataPath?: string, + parentData?: object | Array, + parentDataProperty?: string | number, + rootData?: object | Array + ): boolean | PromiseLike; + schema?: object | boolean; + errors?: null | Array; + refs?: object; + refVal?: Array; + root?: ValidateFunction | object; + $async?: true; + source?: object; + } + + interface Options { + $data?: boolean; + allErrors?: boolean; + verbose?: boolean; + jsonPointers?: boolean; + uniqueItems?: boolean; + unicode?: boolean; + format?: false | string; + formats?: object; + keywords?: object; + unknownFormats?: true | string[] | 'ignore'; + schemas?: Array | object; + schemaId?: '$id' | 'id' | 'auto'; + missingRefs?: true | 'ignore' | 'fail'; + extendRefs?: true | 'ignore' | 'fail'; + loadSchema?: (uri: string, cb?: (err: Error, schema: object) => void) => PromiseLike; + removeAdditional?: boolean | 'all' | 'failing'; + useDefaults?: boolean | 'empty' | 'shared'; + coerceTypes?: boolean | 'array'; + strictDefaults?: boolean | 'log'; + strictKeywords?: boolean | 'log'; + strictNumbers?: boolean; + async?: boolean | string; + transpile?: string | ((code: string) => string); + meta?: boolean | object; + validateSchema?: boolean | 'log'; + addUsedSchema?: boolean; + inlineRefs?: boolean | number; + passContext?: boolean; + loopRequired?: number; + ownProperties?: boolean; + multipleOfPrecision?: boolean | number; + errorDataPath?: string, + messages?: boolean; + sourceCode?: boolean; + processCode?: (code: string, schema: object) => string; + cache?: object; + logger?: CustomLogger | false; + nullable?: boolean; + serialize?: ((schema: object | boolean) => any) | false; + } + + type FormatValidator = string | RegExp | ((data: string) => boolean | PromiseLike); + type NumberFormatValidator = ((data: number) => boolean | PromiseLike); + + interface NumberFormatDefinition { + type: "number", + validate: NumberFormatValidator; + compare?: (data1: number, data2: number) => number; + async?: boolean; + } + + interface StringFormatDefinition { + type?: "string", + validate: FormatValidator; + compare?: (data1: string, data2: string) => number; + async?: boolean; + } + + type FormatDefinition = NumberFormatDefinition | StringFormatDefinition; + + interface KeywordDefinition { + type?: string | Array; + async?: boolean; + $data?: boolean; + errors?: boolean | string; + metaSchema?: object; + // schema: false makes validate not to expect schema (ValidateFunction) + schema?: boolean; + statements?: boolean; + dependencies?: Array; + modifying?: boolean; + valid?: boolean; + // one and only one of the following properties should be present + validate?: SchemaValidateFunction | ValidateFunction; + compile?: (schema: any, parentSchema: object, it: CompilationContext) => ValidateFunction; + macro?: (schema: any, parentSchema: object, it: CompilationContext) => object | boolean; + inline?: (it: CompilationContext, keyword: string, schema: any, parentSchema: object) => string; + } + + interface CompilationContext { + level: number; + dataLevel: number; + dataPathArr: string[]; + schema: any; + schemaPath: string; + baseId: string; + async: boolean; + opts: Options; + formats: { + [index: string]: FormatDefinition | undefined; + }; + keywords: { + [index: string]: KeywordDefinition | undefined; + }; + compositeRule: boolean; + validate: (schema: object) => boolean; + util: { + copy(obj: any, target?: any): any; + toHash(source: string[]): { [index: string]: true | undefined }; + equal(obj: any, target: any): boolean; + getProperty(str: string): string; + schemaHasRules(schema: object, rules: any): string; + escapeQuotes(str: string): string; + toQuotedString(str: string): string; + getData(jsonPointer: string, dataLevel: number, paths: string[]): string; + escapeJsonPointer(str: string): string; + unescapeJsonPointer(str: string): string; + escapeFragment(str: string): string; + unescapeFragment(str: string): string; + }; + self: Ajv; + } + + interface SchemaValidateFunction { + ( + schema: any, + data: any, + parentSchema?: object, + dataPath?: string, + parentData?: object | Array, + parentDataProperty?: string | number, + rootData?: object | Array + ): boolean | PromiseLike; + errors?: Array; + } + + interface ErrorsTextOptions { + separator?: string; + dataVar?: string; + } + + interface ErrorObject { + keyword: string; + dataPath: string; + schemaPath: string; + params: ErrorParameters; + // Added to validation errors of propertyNames keyword schema + propertyName?: string; + // Excluded if messages set to false. + message?: string; + // These are added with the `verbose` option. + schema?: any; + parentSchema?: object; + data?: any; + } + + type ErrorParameters = RefParams | LimitParams | AdditionalPropertiesParams | + DependenciesParams | FormatParams | ComparisonParams | + MultipleOfParams | PatternParams | RequiredParams | + TypeParams | UniqueItemsParams | CustomParams | + PatternRequiredParams | PropertyNamesParams | + IfParams | SwitchParams | NoParams | EnumParams; + + interface RefParams { + ref: string; + } + + interface LimitParams { + limit: number; + } + + interface AdditionalPropertiesParams { + additionalProperty: string; + } + + interface DependenciesParams { + property: string; + missingProperty: string; + depsCount: number; + deps: string; + } + + interface FormatParams { + format: string + } + + interface ComparisonParams { + comparison: string; + limit: number | string; + exclusive: boolean; + } + + interface MultipleOfParams { + multipleOf: number; + } + + interface PatternParams { + pattern: string; + } + + interface RequiredParams { + missingProperty: string; + } + + interface TypeParams { + type: string; + } + + interface UniqueItemsParams { + i: number; + j: number; + } + + interface CustomParams { + keyword: string; + } + + interface PatternRequiredParams { + missingPattern: string; + } + + interface PropertyNamesParams { + propertyName: string; + } + + interface IfParams { + failingKeyword: string; + } + + interface SwitchParams { + caseIndex: number; + } + + interface NoParams { } + + interface EnumParams { + allowedValues: Array; + } +} + +export = ajv; diff --git a/packages/字体精简工具/node_modules/ajv/lib/ajv.js b/packages/字体精简工具/node_modules/ajv/lib/ajv.js new file mode 100644 index 0000000..06a45b6 --- /dev/null +++ b/packages/字体精简工具/node_modules/ajv/lib/ajv.js @@ -0,0 +1,506 @@ +'use strict'; + +var compileSchema = require('./compile') + , resolve = require('./compile/resolve') + , Cache = require('./cache') + , SchemaObject = require('./compile/schema_obj') + , stableStringify = require('fast-json-stable-stringify') + , formats = require('./compile/formats') + , rules = require('./compile/rules') + , $dataMetaSchema = require('./data') + , util = require('./compile/util'); + +module.exports = Ajv; + +Ajv.prototype.validate = validate; +Ajv.prototype.compile = compile; +Ajv.prototype.addSchema = addSchema; +Ajv.prototype.addMetaSchema = addMetaSchema; +Ajv.prototype.validateSchema = validateSchema; +Ajv.prototype.getSchema = getSchema; +Ajv.prototype.removeSchema = removeSchema; +Ajv.prototype.addFormat = addFormat; +Ajv.prototype.errorsText = errorsText; + +Ajv.prototype._addSchema = _addSchema; +Ajv.prototype._compile = _compile; + +Ajv.prototype.compileAsync = require('./compile/async'); +var customKeyword = require('./keyword'); +Ajv.prototype.addKeyword = customKeyword.add; +Ajv.prototype.getKeyword = customKeyword.get; +Ajv.prototype.removeKeyword = customKeyword.remove; +Ajv.prototype.validateKeyword = customKeyword.validate; + +var errorClasses = require('./compile/error_classes'); +Ajv.ValidationError = errorClasses.Validation; +Ajv.MissingRefError = errorClasses.MissingRef; +Ajv.$dataMetaSchema = $dataMetaSchema; + +var META_SCHEMA_ID = 'http://json-schema.org/draft-07/schema'; + +var META_IGNORE_OPTIONS = [ 'removeAdditional', 'useDefaults', 'coerceTypes', 'strictDefaults' ]; +var META_SUPPORT_DATA = ['/properties']; + +/** + * Creates validator instance. + * Usage: `Ajv(opts)` + * @param {Object} opts optional options + * @return {Object} ajv instance + */ +function Ajv(opts) { + if (!(this instanceof Ajv)) return new Ajv(opts); + opts = this._opts = util.copy(opts) || {}; + setLogger(this); + this._schemas = {}; + this._refs = {}; + this._fragments = {}; + this._formats = formats(opts.format); + + this._cache = opts.cache || new Cache; + this._loadingSchemas = {}; + this._compilations = []; + this.RULES = rules(); + this._getId = chooseGetId(opts); + + opts.loopRequired = opts.loopRequired || Infinity; + if (opts.errorDataPath == 'property') opts._errorDataPathProperty = true; + if (opts.serialize === undefined) opts.serialize = stableStringify; + this._metaOpts = getMetaSchemaOptions(this); + + if (opts.formats) addInitialFormats(this); + if (opts.keywords) addInitialKeywords(this); + addDefaultMetaSchema(this); + if (typeof opts.meta == 'object') this.addMetaSchema(opts.meta); + if (opts.nullable) this.addKeyword('nullable', {metaSchema: {type: 'boolean'}}); + addInitialSchemas(this); +} + + + +/** + * Validate data using schema + * Schema will be compiled and cached (using serialized JSON as key. [fast-json-stable-stringify](https://github.com/epoberezkin/fast-json-stable-stringify) is used to serialize. + * @this Ajv + * @param {String|Object} schemaKeyRef key, ref or schema object + * @param {Any} data to be validated + * @return {Boolean} validation result. Errors from the last validation will be available in `ajv.errors` (and also in compiled schema: `schema.errors`). + */ +function validate(schemaKeyRef, data) { + var v; + if (typeof schemaKeyRef == 'string') { + v = this.getSchema(schemaKeyRef); + if (!v) throw new Error('no schema with key or ref "' + schemaKeyRef + '"'); + } else { + var schemaObj = this._addSchema(schemaKeyRef); + v = schemaObj.validate || this._compile(schemaObj); + } + + var valid = v(data); + if (v.$async !== true) this.errors = v.errors; + return valid; +} + + +/** + * Create validating function for passed schema. + * @this Ajv + * @param {Object} schema schema object + * @param {Boolean} _meta true if schema is a meta-schema. Used internally to compile meta schemas of custom keywords. + * @return {Function} validating function + */ +function compile(schema, _meta) { + var schemaObj = this._addSchema(schema, undefined, _meta); + return schemaObj.validate || this._compile(schemaObj); +} + + +/** + * Adds schema to the instance. + * @this Ajv + * @param {Object|Array} schema schema or array of schemas. If array is passed, `key` and other parameters will be ignored. + * @param {String} key Optional schema key. Can be passed to `validate` method instead of schema object or id/ref. One schema per instance can have empty `id` and `key`. + * @param {Boolean} _skipValidation true to skip schema validation. Used internally, option validateSchema should be used instead. + * @param {Boolean} _meta true if schema is a meta-schema. Used internally, addMetaSchema should be used instead. + * @return {Ajv} this for method chaining + */ +function addSchema(schema, key, _skipValidation, _meta) { + if (Array.isArray(schema)){ + for (var i=0; i} errors optional array of validation errors, if not passed errors from the instance are used. + * @param {Object} options optional options with properties `separator` and `dataVar`. + * @return {String} human readable string with all errors descriptions + */ +function errorsText(errors, options) { + errors = errors || this.errors; + if (!errors) return 'No errors'; + options = options || {}; + var separator = options.separator === undefined ? ', ' : options.separator; + var dataVar = options.dataVar === undefined ? 'data' : options.dataVar; + + var text = ''; + for (var i=0; i%\\^`{|}]|%[0-9a-f]{2})|\{[+#./;?&=,!@|]?(?:[a-z0-9_]|%[0-9a-f]{2})+(?::[1-9][0-9]{0,3}|\*)?(?:,(?:[a-z0-9_]|%[0-9a-f]{2})+(?::[1-9][0-9]{0,3}|\*)?)*\})*$/i; +// For the source: https://gist.github.com/dperini/729294 +// For test cases: https://mathiasbynens.be/demo/url-regex +// @todo Delete current URL in favour of the commented out URL rule when this issue is fixed https://github.com/eslint/eslint/issues/7983. +// var URL = /^(?:(?:https?|ftp):\/\/)(?:\S+(?::\S*)?@)?(?:(?!10(?:\.\d{1,3}){3})(?!127(?:\.\d{1,3}){3})(?!169\.254(?:\.\d{1,3}){2})(?!192\.168(?:\.\d{1,3}){2})(?!172\.(?:1[6-9]|2\d|3[0-1])(?:\.\d{1,3}){2})(?:[1-9]\d?|1\d\d|2[01]\d|22[0-3])(?:\.(?:1?\d{1,2}|2[0-4]\d|25[0-5])){2}(?:\.(?:[1-9]\d?|1\d\d|2[0-4]\d|25[0-4]))|(?:(?:[a-z\u{00a1}-\u{ffff}0-9]+-)*[a-z\u{00a1}-\u{ffff}0-9]+)(?:\.(?:[a-z\u{00a1}-\u{ffff}0-9]+-)*[a-z\u{00a1}-\u{ffff}0-9]+)*(?:\.(?:[a-z\u{00a1}-\u{ffff}]{2,})))(?::\d{2,5})?(?:\/[^\s]*)?$/iu; +var URL = /^(?:(?:http[s\u017F]?|ftp):\/\/)(?:(?:[\0-\x08\x0E-\x1F!-\x9F\xA1-\u167F\u1681-\u1FFF\u200B-\u2027\u202A-\u202E\u2030-\u205E\u2060-\u2FFF\u3001-\uD7FF\uE000-\uFEFE\uFF00-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])+(?::(?:[\0-\x08\x0E-\x1F!-\x9F\xA1-\u167F\u1681-\u1FFF\u200B-\u2027\u202A-\u202E\u2030-\u205E\u2060-\u2FFF\u3001-\uD7FF\uE000-\uFEFE\uFF00-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])*)?@)?(?:(?!10(?:\.[0-9]{1,3}){3})(?!127(?:\.[0-9]{1,3}){3})(?!169\.254(?:\.[0-9]{1,3}){2})(?!192\.168(?:\.[0-9]{1,3}){2})(?!172\.(?:1[6-9]|2[0-9]|3[01])(?:\.[0-9]{1,3}){2})(?:[1-9][0-9]?|1[0-9][0-9]|2[01][0-9]|22[0-3])(?:\.(?:1?[0-9]{1,2}|2[0-4][0-9]|25[0-5])){2}(?:\.(?:[1-9][0-9]?|1[0-9][0-9]|2[0-4][0-9]|25[0-4]))|(?:(?:(?:[0-9a-z\xA1-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])+-)*(?:[0-9a-z\xA1-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])+)(?:\.(?:(?:[0-9a-z\xA1-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])+-)*(?:[0-9a-z\xA1-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])+)*(?:\.(?:(?:[a-z\xA1-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]){2,})))(?::[0-9]{2,5})?(?:\/(?:[\0-\x08\x0E-\x1F!-\x9F\xA1-\u167F\u1681-\u1FFF\u200B-\u2027\u202A-\u202E\u2030-\u205E\u2060-\u2FFF\u3001-\uD7FF\uE000-\uFEFE\uFF00-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])*)?$/i; +var UUID = /^(?:urn:uuid:)?[0-9a-f]{8}-(?:[0-9a-f]{4}-){3}[0-9a-f]{12}$/i; +var JSON_POINTER = /^(?:\/(?:[^~/]|~0|~1)*)*$/; +var JSON_POINTER_URI_FRAGMENT = /^#(?:\/(?:[a-z0-9_\-.!$&'()*+,;:=@]|%[0-9a-f]{2}|~0|~1)*)*$/i; +var RELATIVE_JSON_POINTER = /^(?:0|[1-9][0-9]*)(?:#|(?:\/(?:[^~/]|~0|~1)*)*)$/; + + +module.exports = formats; + +function formats(mode) { + mode = mode == 'full' ? 'full' : 'fast'; + return util.copy(formats[mode]); +} + + +formats.fast = { + // date: http://tools.ietf.org/html/rfc3339#section-5.6 + date: /^\d\d\d\d-[0-1]\d-[0-3]\d$/, + // date-time: http://tools.ietf.org/html/rfc3339#section-5.6 + time: /^(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)?$/i, + 'date-time': /^\d\d\d\d-[0-1]\d-[0-3]\d[t\s](?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)$/i, + // uri: https://github.com/mafintosh/is-my-json-valid/blob/master/formats.js + uri: /^(?:[a-z][a-z0-9+\-.]*:)(?:\/?\/)?[^\s]*$/i, + 'uri-reference': /^(?:(?:[a-z][a-z0-9+\-.]*:)?\/?\/)?(?:[^\\\s#][^\s#]*)?(?:#[^\\\s]*)?$/i, + 'uri-template': URITEMPLATE, + url: URL, + // email (sources from jsen validator): + // http://stackoverflow.com/questions/201323/using-a-regular-expression-to-validate-an-email-address#answer-8829363 + // http://www.w3.org/TR/html5/forms.html#valid-e-mail-address (search for 'willful violation') + email: /^[a-z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?(?:\.[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?)*$/i, + hostname: HOSTNAME, + // optimized https://www.safaribooksonline.com/library/view/regular-expressions-cookbook/9780596802837/ch07s16.html + ipv4: /^(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?)$/, + // optimized http://stackoverflow.com/questions/53497/regular-expression-that-matches-valid-ipv6-addresses + ipv6: /^\s*(?:(?:(?:[0-9a-f]{1,4}:){7}(?:[0-9a-f]{1,4}|:))|(?:(?:[0-9a-f]{1,4}:){6}(?::[0-9a-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(?:(?:[0-9a-f]{1,4}:){5}(?:(?:(?::[0-9a-f]{1,4}){1,2})|:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(?:(?:[0-9a-f]{1,4}:){4}(?:(?:(?::[0-9a-f]{1,4}){1,3})|(?:(?::[0-9a-f]{1,4})?:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(?:(?:[0-9a-f]{1,4}:){3}(?:(?:(?::[0-9a-f]{1,4}){1,4})|(?:(?::[0-9a-f]{1,4}){0,2}:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(?:(?:[0-9a-f]{1,4}:){2}(?:(?:(?::[0-9a-f]{1,4}){1,5})|(?:(?::[0-9a-f]{1,4}){0,3}:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(?:(?:[0-9a-f]{1,4}:){1}(?:(?:(?::[0-9a-f]{1,4}){1,6})|(?:(?::[0-9a-f]{1,4}){0,4}:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(?::(?:(?:(?::[0-9a-f]{1,4}){1,7})|(?:(?::[0-9a-f]{1,4}){0,5}:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:)))(?:%.+)?\s*$/i, + regex: regex, + // uuid: http://tools.ietf.org/html/rfc4122 + uuid: UUID, + // JSON-pointer: https://tools.ietf.org/html/rfc6901 + // uri fragment: https://tools.ietf.org/html/rfc3986#appendix-A + 'json-pointer': JSON_POINTER, + 'json-pointer-uri-fragment': JSON_POINTER_URI_FRAGMENT, + // relative JSON-pointer: http://tools.ietf.org/html/draft-luff-relative-json-pointer-00 + 'relative-json-pointer': RELATIVE_JSON_POINTER +}; + + +formats.full = { + date: date, + time: time, + 'date-time': date_time, + uri: uri, + 'uri-reference': URIREF, + 'uri-template': URITEMPLATE, + url: URL, + email: /^[a-z0-9!#$%&'*+/=?^_`{|}~-]+(?:\.[a-z0-9!#$%&'*+/=?^_`{|}~-]+)*@(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\.)+[a-z0-9](?:[a-z0-9-]*[a-z0-9])?$/i, + hostname: HOSTNAME, + ipv4: /^(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?)$/, + ipv6: /^\s*(?:(?:(?:[0-9a-f]{1,4}:){7}(?:[0-9a-f]{1,4}|:))|(?:(?:[0-9a-f]{1,4}:){6}(?::[0-9a-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(?:(?:[0-9a-f]{1,4}:){5}(?:(?:(?::[0-9a-f]{1,4}){1,2})|:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(?:(?:[0-9a-f]{1,4}:){4}(?:(?:(?::[0-9a-f]{1,4}){1,3})|(?:(?::[0-9a-f]{1,4})?:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(?:(?:[0-9a-f]{1,4}:){3}(?:(?:(?::[0-9a-f]{1,4}){1,4})|(?:(?::[0-9a-f]{1,4}){0,2}:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(?:(?:[0-9a-f]{1,4}:){2}(?:(?:(?::[0-9a-f]{1,4}){1,5})|(?:(?::[0-9a-f]{1,4}){0,3}:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(?:(?:[0-9a-f]{1,4}:){1}(?:(?:(?::[0-9a-f]{1,4}){1,6})|(?:(?::[0-9a-f]{1,4}){0,4}:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(?::(?:(?:(?::[0-9a-f]{1,4}){1,7})|(?:(?::[0-9a-f]{1,4}){0,5}:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:)))(?:%.+)?\s*$/i, + regex: regex, + uuid: UUID, + 'json-pointer': JSON_POINTER, + 'json-pointer-uri-fragment': JSON_POINTER_URI_FRAGMENT, + 'relative-json-pointer': RELATIVE_JSON_POINTER +}; + + +function isLeapYear(year) { + // https://tools.ietf.org/html/rfc3339#appendix-C + return year % 4 === 0 && (year % 100 !== 0 || year % 400 === 0); +} + + +function date(str) { + // full-date from http://tools.ietf.org/html/rfc3339#section-5.6 + var matches = str.match(DATE); + if (!matches) return false; + + var year = +matches[1]; + var month = +matches[2]; + var day = +matches[3]; + + return month >= 1 && month <= 12 && day >= 1 && + day <= (month == 2 && isLeapYear(year) ? 29 : DAYS[month]); +} + + +function time(str, full) { + var matches = str.match(TIME); + if (!matches) return false; + + var hour = matches[1]; + var minute = matches[2]; + var second = matches[3]; + var timeZone = matches[5]; + return ((hour <= 23 && minute <= 59 && second <= 59) || + (hour == 23 && minute == 59 && second == 60)) && + (!full || timeZone); +} + + +var DATE_TIME_SEPARATOR = /t|\s/i; +function date_time(str) { + // http://tools.ietf.org/html/rfc3339#section-5.6 + var dateTime = str.split(DATE_TIME_SEPARATOR); + return dateTime.length == 2 && date(dateTime[0]) && time(dateTime[1], true); +} + + +var NOT_URI_FRAGMENT = /\/|:/; +function uri(str) { + // http://jmrware.com/articles/2009/uri_regexp/URI_regex.html + optional protocol + required "." + return NOT_URI_FRAGMENT.test(str) && URI.test(str); +} + + +var Z_ANCHOR = /[^\\]\\Z/; +function regex(str) { + if (Z_ANCHOR.test(str)) return false; + try { + new RegExp(str); + return true; + } catch(e) { + return false; + } +} diff --git a/packages/字体精简工具/node_modules/ajv/lib/compile/index.js b/packages/字体精简工具/node_modules/ajv/lib/compile/index.js new file mode 100644 index 0000000..97518c4 --- /dev/null +++ b/packages/字体精简工具/node_modules/ajv/lib/compile/index.js @@ -0,0 +1,387 @@ +'use strict'; + +var resolve = require('./resolve') + , util = require('./util') + , errorClasses = require('./error_classes') + , stableStringify = require('fast-json-stable-stringify'); + +var validateGenerator = require('../dotjs/validate'); + +/** + * Functions below are used inside compiled validations function + */ + +var ucs2length = util.ucs2length; +var equal = require('fast-deep-equal'); + +// this error is thrown by async schemas to return validation errors via exception +var ValidationError = errorClasses.Validation; + +module.exports = compile; + + +/** + * Compiles schema to validation function + * @this Ajv + * @param {Object} schema schema object + * @param {Object} root object with information about the root schema for this schema + * @param {Object} localRefs the hash of local references inside the schema (created by resolve.id), used for inline resolution + * @param {String} baseId base ID for IDs in the schema + * @return {Function} validation function + */ +function compile(schema, root, localRefs, baseId) { + /* jshint validthis: true, evil: true */ + /* eslint no-shadow: 0 */ + var self = this + , opts = this._opts + , refVal = [ undefined ] + , refs = {} + , patterns = [] + , patternsHash = {} + , defaults = [] + , defaultsHash = {} + , customRules = []; + + root = root || { schema: schema, refVal: refVal, refs: refs }; + + var c = checkCompiling.call(this, schema, root, baseId); + var compilation = this._compilations[c.index]; + if (c.compiling) return (compilation.callValidate = callValidate); + + var formats = this._formats; + var RULES = this.RULES; + + try { + var v = localCompile(schema, root, localRefs, baseId); + compilation.validate = v; + var cv = compilation.callValidate; + if (cv) { + cv.schema = v.schema; + cv.errors = null; + cv.refs = v.refs; + cv.refVal = v.refVal; + cv.root = v.root; + cv.$async = v.$async; + if (opts.sourceCode) cv.source = v.source; + } + return v; + } finally { + endCompiling.call(this, schema, root, baseId); + } + + /* @this {*} - custom context, see passContext option */ + function callValidate() { + /* jshint validthis: true */ + var validate = compilation.validate; + var result = validate.apply(this, arguments); + callValidate.errors = validate.errors; + return result; + } + + function localCompile(_schema, _root, localRefs, baseId) { + var isRoot = !_root || (_root && _root.schema == _schema); + if (_root.schema != root.schema) + return compile.call(self, _schema, _root, localRefs, baseId); + + var $async = _schema.$async === true; + + var sourceCode = validateGenerator({ + isTop: true, + schema: _schema, + isRoot: isRoot, + baseId: baseId, + root: _root, + schemaPath: '', + errSchemaPath: '#', + errorPath: '""', + MissingRefError: errorClasses.MissingRef, + RULES: RULES, + validate: validateGenerator, + util: util, + resolve: resolve, + resolveRef: resolveRef, + usePattern: usePattern, + useDefault: useDefault, + useCustomRule: useCustomRule, + opts: opts, + formats: formats, + logger: self.logger, + self: self + }); + + sourceCode = vars(refVal, refValCode) + vars(patterns, patternCode) + + vars(defaults, defaultCode) + vars(customRules, customRuleCode) + + sourceCode; + + if (opts.processCode) sourceCode = opts.processCode(sourceCode, _schema); + // console.log('\n\n\n *** \n', JSON.stringify(sourceCode)); + var validate; + try { + var makeValidate = new Function( + 'self', + 'RULES', + 'formats', + 'root', + 'refVal', + 'defaults', + 'customRules', + 'equal', + 'ucs2length', + 'ValidationError', + sourceCode + ); + + validate = makeValidate( + self, + RULES, + formats, + root, + refVal, + defaults, + customRules, + equal, + ucs2length, + ValidationError + ); + + refVal[0] = validate; + } catch(e) { + self.logger.error('Error compiling schema, function code:', sourceCode); + throw e; + } + + validate.schema = _schema; + validate.errors = null; + validate.refs = refs; + validate.refVal = refVal; + validate.root = isRoot ? validate : _root; + if ($async) validate.$async = true; + if (opts.sourceCode === true) { + validate.source = { + code: sourceCode, + patterns: patterns, + defaults: defaults + }; + } + + return validate; + } + + function resolveRef(baseId, ref, isRoot) { + ref = resolve.url(baseId, ref); + var refIndex = refs[ref]; + var _refVal, refCode; + if (refIndex !== undefined) { + _refVal = refVal[refIndex]; + refCode = 'refVal[' + refIndex + ']'; + return resolvedRef(_refVal, refCode); + } + if (!isRoot && root.refs) { + var rootRefId = root.refs[ref]; + if (rootRefId !== undefined) { + _refVal = root.refVal[rootRefId]; + refCode = addLocalRef(ref, _refVal); + return resolvedRef(_refVal, refCode); + } + } + + refCode = addLocalRef(ref); + var v = resolve.call(self, localCompile, root, ref); + if (v === undefined) { + var localSchema = localRefs && localRefs[ref]; + if (localSchema) { + v = resolve.inlineRef(localSchema, opts.inlineRefs) + ? localSchema + : compile.call(self, localSchema, root, localRefs, baseId); + } + } + + if (v === undefined) { + removeLocalRef(ref); + } else { + replaceLocalRef(ref, v); + return resolvedRef(v, refCode); + } + } + + function addLocalRef(ref, v) { + var refId = refVal.length; + refVal[refId] = v; + refs[ref] = refId; + return 'refVal' + refId; + } + + function removeLocalRef(ref) { + delete refs[ref]; + } + + function replaceLocalRef(ref, v) { + var refId = refs[ref]; + refVal[refId] = v; + } + + function resolvedRef(refVal, code) { + return typeof refVal == 'object' || typeof refVal == 'boolean' + ? { code: code, schema: refVal, inline: true } + : { code: code, $async: refVal && !!refVal.$async }; + } + + function usePattern(regexStr) { + var index = patternsHash[regexStr]; + if (index === undefined) { + index = patternsHash[regexStr] = patterns.length; + patterns[index] = regexStr; + } + return 'pattern' + index; + } + + function useDefault(value) { + switch (typeof value) { + case 'boolean': + case 'number': + return '' + value; + case 'string': + return util.toQuotedString(value); + case 'object': + if (value === null) return 'null'; + var valueStr = stableStringify(value); + var index = defaultsHash[valueStr]; + if (index === undefined) { + index = defaultsHash[valueStr] = defaults.length; + defaults[index] = value; + } + return 'default' + index; + } + } + + function useCustomRule(rule, schema, parentSchema, it) { + if (self._opts.validateSchema !== false) { + var deps = rule.definition.dependencies; + if (deps && !deps.every(function(keyword) { + return Object.prototype.hasOwnProperty.call(parentSchema, keyword); + })) + throw new Error('parent schema must have all required keywords: ' + deps.join(',')); + + var validateSchema = rule.definition.validateSchema; + if (validateSchema) { + var valid = validateSchema(schema); + if (!valid) { + var message = 'keyword schema is invalid: ' + self.errorsText(validateSchema.errors); + if (self._opts.validateSchema == 'log') self.logger.error(message); + else throw new Error(message); + } + } + } + + var compile = rule.definition.compile + , inline = rule.definition.inline + , macro = rule.definition.macro; + + var validate; + if (compile) { + validate = compile.call(self, schema, parentSchema, it); + } else if (macro) { + validate = macro.call(self, schema, parentSchema, it); + if (opts.validateSchema !== false) self.validateSchema(validate, true); + } else if (inline) { + validate = inline.call(self, it, rule.keyword, schema, parentSchema); + } else { + validate = rule.definition.validate; + if (!validate) return; + } + + if (validate === undefined) + throw new Error('custom keyword "' + rule.keyword + '"failed to compile'); + + var index = customRules.length; + customRules[index] = validate; + + return { + code: 'customRule' + index, + validate: validate + }; + } +} + + +/** + * Checks if the schema is currently compiled + * @this Ajv + * @param {Object} schema schema to compile + * @param {Object} root root object + * @param {String} baseId base schema ID + * @return {Object} object with properties "index" (compilation index) and "compiling" (boolean) + */ +function checkCompiling(schema, root, baseId) { + /* jshint validthis: true */ + var index = compIndex.call(this, schema, root, baseId); + if (index >= 0) return { index: index, compiling: true }; + index = this._compilations.length; + this._compilations[index] = { + schema: schema, + root: root, + baseId: baseId + }; + return { index: index, compiling: false }; +} + + +/** + * Removes the schema from the currently compiled list + * @this Ajv + * @param {Object} schema schema to compile + * @param {Object} root root object + * @param {String} baseId base schema ID + */ +function endCompiling(schema, root, baseId) { + /* jshint validthis: true */ + var i = compIndex.call(this, schema, root, baseId); + if (i >= 0) this._compilations.splice(i, 1); +} + + +/** + * Index of schema compilation in the currently compiled list + * @this Ajv + * @param {Object} schema schema to compile + * @param {Object} root root object + * @param {String} baseId base schema ID + * @return {Integer} compilation index + */ +function compIndex(schema, root, baseId) { + /* jshint validthis: true */ + for (var i=0; i= 0xD800 && value <= 0xDBFF && pos < len) { + // high surrogate, and there is a next character + value = str.charCodeAt(pos); + if ((value & 0xFC00) == 0xDC00) pos++; // low surrogate + } + } + return length; +}; diff --git a/packages/字体精简工具/node_modules/ajv/lib/compile/util.js b/packages/字体精简工具/node_modules/ajv/lib/compile/util.js new file mode 100644 index 0000000..ef07b8c --- /dev/null +++ b/packages/字体精简工具/node_modules/ajv/lib/compile/util.js @@ -0,0 +1,239 @@ +'use strict'; + + +module.exports = { + copy: copy, + checkDataType: checkDataType, + checkDataTypes: checkDataTypes, + coerceToTypes: coerceToTypes, + toHash: toHash, + getProperty: getProperty, + escapeQuotes: escapeQuotes, + equal: require('fast-deep-equal'), + ucs2length: require('./ucs2length'), + varOccurences: varOccurences, + varReplace: varReplace, + schemaHasRules: schemaHasRules, + schemaHasRulesExcept: schemaHasRulesExcept, + schemaUnknownRules: schemaUnknownRules, + toQuotedString: toQuotedString, + getPathExpr: getPathExpr, + getPath: getPath, + getData: getData, + unescapeFragment: unescapeFragment, + unescapeJsonPointer: unescapeJsonPointer, + escapeFragment: escapeFragment, + escapeJsonPointer: escapeJsonPointer +}; + + +function copy(o, to) { + to = to || {}; + for (var key in o) to[key] = o[key]; + return to; +} + + +function checkDataType(dataType, data, strictNumbers, negate) { + var EQUAL = negate ? ' !== ' : ' === ' + , AND = negate ? ' || ' : ' && ' + , OK = negate ? '!' : '' + , NOT = negate ? '' : '!'; + switch (dataType) { + case 'null': return data + EQUAL + 'null'; + case 'array': return OK + 'Array.isArray(' + data + ')'; + case 'object': return '(' + OK + data + AND + + 'typeof ' + data + EQUAL + '"object"' + AND + + NOT + 'Array.isArray(' + data + '))'; + case 'integer': return '(typeof ' + data + EQUAL + '"number"' + AND + + NOT + '(' + data + ' % 1)' + + AND + data + EQUAL + data + + (strictNumbers ? (AND + OK + 'isFinite(' + data + ')') : '') + ')'; + case 'number': return '(typeof ' + data + EQUAL + '"' + dataType + '"' + + (strictNumbers ? (AND + OK + 'isFinite(' + data + ')') : '') + ')'; + default: return 'typeof ' + data + EQUAL + '"' + dataType + '"'; + } +} + + +function checkDataTypes(dataTypes, data, strictNumbers) { + switch (dataTypes.length) { + case 1: return checkDataType(dataTypes[0], data, strictNumbers, true); + default: + var code = ''; + var types = toHash(dataTypes); + if (types.array && types.object) { + code = types.null ? '(': '(!' + data + ' || '; + code += 'typeof ' + data + ' !== "object")'; + delete types.null; + delete types.array; + delete types.object; + } + if (types.number) delete types.integer; + for (var t in types) + code += (code ? ' && ' : '' ) + checkDataType(t, data, strictNumbers, true); + + return code; + } +} + + +var COERCE_TO_TYPES = toHash([ 'string', 'number', 'integer', 'boolean', 'null' ]); +function coerceToTypes(optionCoerceTypes, dataTypes) { + if (Array.isArray(dataTypes)) { + var types = []; + for (var i=0; i= lvl) throw new Error('Cannot access property/index ' + up + ' levels up, current level is ' + lvl); + return paths[lvl - up]; + } + + if (up > lvl) throw new Error('Cannot access data ' + up + ' levels up, current level is ' + lvl); + data = 'data' + ((lvl - up) || ''); + if (!jsonPointer) return data; + } + + var expr = data; + var segments = jsonPointer.split('/'); + for (var i=0; i' + , $notOp = $isMax ? '>' : '<' + , $errorKeyword = undefined; + + if (!($isData || typeof $schema == 'number' || $schema === undefined)) { + throw new Error($keyword + ' must be number'); + } + if (!($isDataExcl || $schemaExcl === undefined + || typeof $schemaExcl == 'number' + || typeof $schemaExcl == 'boolean')) { + throw new Error($exclusiveKeyword + ' must be number or boolean'); + } +}} + +{{? $isDataExcl }} + {{ + var $schemaValueExcl = it.util.getData($schemaExcl.$data, $dataLvl, it.dataPathArr) + , $exclusive = 'exclusive' + $lvl + , $exclType = 'exclType' + $lvl + , $exclIsNumber = 'exclIsNumber' + $lvl + , $opExpr = 'op' + $lvl + , $opStr = '\' + ' + $opExpr + ' + \''; + }} + var schemaExcl{{=$lvl}} = {{=$schemaValueExcl}}; + {{ $schemaValueExcl = 'schemaExcl' + $lvl; }} + + var {{=$exclusive}}; + var {{=$exclType}} = typeof {{=$schemaValueExcl}}; + if ({{=$exclType}} != 'boolean' && {{=$exclType}} != 'undefined' && {{=$exclType}} != 'number') { + {{ var $errorKeyword = $exclusiveKeyword; }} + {{# def.error:'_exclusiveLimit' }} + } else if ({{# def.$dataNotType:'number' }} + {{=$exclType}} == 'number' + ? ( + ({{=$exclusive}} = {{=$schemaValue}} === undefined || {{=$schemaValueExcl}} {{=$op}}= {{=$schemaValue}}) + ? {{=$data}} {{=$notOp}}= {{=$schemaValueExcl}} + : {{=$data}} {{=$notOp}} {{=$schemaValue}} + ) + : ( + ({{=$exclusive}} = {{=$schemaValueExcl}} === true) + ? {{=$data}} {{=$notOp}}= {{=$schemaValue}} + : {{=$data}} {{=$notOp}} {{=$schemaValue}} + ) + || {{=$data}} !== {{=$data}}) { + var op{{=$lvl}} = {{=$exclusive}} ? '{{=$op}}' : '{{=$op}}='; + {{ + if ($schema === undefined) { + $errorKeyword = $exclusiveKeyword; + $errSchemaPath = it.errSchemaPath + '/' + $exclusiveKeyword; + $schemaValue = $schemaValueExcl; + $isData = $isDataExcl; + } + }} +{{??}} + {{ + var $exclIsNumber = typeof $schemaExcl == 'number' + , $opStr = $op; /*used in error*/ + }} + + {{? $exclIsNumber && $isData }} + {{ var $opExpr = '\'' + $opStr + '\''; /*used in error*/ }} + if ({{# def.$dataNotType:'number' }} + ( {{=$schemaValue}} === undefined + || {{=$schemaExcl}} {{=$op}}= {{=$schemaValue}} + ? {{=$data}} {{=$notOp}}= {{=$schemaExcl}} + : {{=$data}} {{=$notOp}} {{=$schemaValue}} ) + || {{=$data}} !== {{=$data}}) { + {{??}} + {{ + if ($exclIsNumber && $schema === undefined) { + {{# def.setExclusiveLimit }} + $schemaValue = $schemaExcl; + $notOp += '='; + } else { + if ($exclIsNumber) + $schemaValue = Math[$isMax ? 'min' : 'max']($schemaExcl, $schema); + + if ($schemaExcl === ($exclIsNumber ? $schemaValue : true)) { + {{# def.setExclusiveLimit }} + $notOp += '='; + } else { + $exclusive = false; + $opStr += '='; + } + } + + var $opExpr = '\'' + $opStr + '\''; /*used in error*/ + }} + + if ({{# def.$dataNotType:'number' }} + {{=$data}} {{=$notOp}} {{=$schemaValue}} + || {{=$data}} !== {{=$data}}) { + {{?}} +{{?}} + {{ $errorKeyword = $errorKeyword || $keyword; }} + {{# def.error:'_limit' }} + } {{? $breakOnError }} else { {{?}} diff --git a/packages/字体精简工具/node_modules/ajv/lib/dot/_limitItems.jst b/packages/字体精简工具/node_modules/ajv/lib/dot/_limitItems.jst new file mode 100644 index 0000000..741329e --- /dev/null +++ b/packages/字体精简工具/node_modules/ajv/lib/dot/_limitItems.jst @@ -0,0 +1,12 @@ +{{# def.definitions }} +{{# def.errors }} +{{# def.setupKeyword }} +{{# def.$data }} + +{{# def.numberKeyword }} + +{{ var $op = $keyword == 'maxItems' ? '>' : '<'; }} +if ({{# def.$dataNotType:'number' }} {{=$data}}.length {{=$op}} {{=$schemaValue}}) { + {{ var $errorKeyword = $keyword; }} + {{# def.error:'_limitItems' }} +} {{? $breakOnError }} else { {{?}} diff --git a/packages/字体精简工具/node_modules/ajv/lib/dot/_limitLength.jst b/packages/字体精简工具/node_modules/ajv/lib/dot/_limitLength.jst new file mode 100644 index 0000000..285c66b --- /dev/null +++ b/packages/字体精简工具/node_modules/ajv/lib/dot/_limitLength.jst @@ -0,0 +1,12 @@ +{{# def.definitions }} +{{# def.errors }} +{{# def.setupKeyword }} +{{# def.$data }} + +{{# def.numberKeyword }} + +{{ var $op = $keyword == 'maxLength' ? '>' : '<'; }} +if ({{# def.$dataNotType:'number' }} {{# def.strLength }} {{=$op}} {{=$schemaValue}}) { + {{ var $errorKeyword = $keyword; }} + {{# def.error:'_limitLength' }} +} {{? $breakOnError }} else { {{?}} diff --git a/packages/字体精简工具/node_modules/ajv/lib/dot/_limitProperties.jst b/packages/字体精简工具/node_modules/ajv/lib/dot/_limitProperties.jst new file mode 100644 index 0000000..c4c2155 --- /dev/null +++ b/packages/字体精简工具/node_modules/ajv/lib/dot/_limitProperties.jst @@ -0,0 +1,12 @@ +{{# def.definitions }} +{{# def.errors }} +{{# def.setupKeyword }} +{{# def.$data }} + +{{# def.numberKeyword }} + +{{ var $op = $keyword == 'maxProperties' ? '>' : '<'; }} +if ({{# def.$dataNotType:'number' }} Object.keys({{=$data}}).length {{=$op}} {{=$schemaValue}}) { + {{ var $errorKeyword = $keyword; }} + {{# def.error:'_limitProperties' }} +} {{? $breakOnError }} else { {{?}} diff --git a/packages/字体精简工具/node_modules/ajv/lib/dot/allOf.jst b/packages/字体精简工具/node_modules/ajv/lib/dot/allOf.jst new file mode 100644 index 0000000..0e782fe --- /dev/null +++ b/packages/字体精简工具/node_modules/ajv/lib/dot/allOf.jst @@ -0,0 +1,32 @@ +{{# def.definitions }} +{{# def.errors }} +{{# def.setupKeyword }} +{{# def.setupNextLevel }} + +{{ + var $currentBaseId = $it.baseId + , $allSchemasEmpty = true; +}} + +{{~ $schema:$sch:$i }} + {{? {{# def.nonEmptySchema:$sch }} }} + {{ + $allSchemasEmpty = false; + $it.schema = $sch; + $it.schemaPath = $schemaPath + '[' + $i + ']'; + $it.errSchemaPath = $errSchemaPath + '/' + $i; + }} + + {{# def.insertSubschemaCode }} + + {{# def.ifResultValid }} + {{?}} +{{~}} + +{{? $breakOnError }} + {{? $allSchemasEmpty }} + if (true) { + {{??}} + {{= $closingBraces.slice(0,-1) }} + {{?}} +{{?}} diff --git a/packages/字体精简工具/node_modules/ajv/lib/dot/anyOf.jst b/packages/字体精简工具/node_modules/ajv/lib/dot/anyOf.jst new file mode 100644 index 0000000..ea909ee --- /dev/null +++ b/packages/字体精简工具/node_modules/ajv/lib/dot/anyOf.jst @@ -0,0 +1,46 @@ +{{# def.definitions }} +{{# def.errors }} +{{# def.setupKeyword }} +{{# def.setupNextLevel }} + +{{ + var $noEmptySchema = $schema.every(function($sch) { + return {{# def.nonEmptySchema:$sch }}; + }); +}} +{{? $noEmptySchema }} + {{ var $currentBaseId = $it.baseId; }} + var {{=$errs}} = errors; + var {{=$valid}} = false; + + {{# def.setCompositeRule }} + + {{~ $schema:$sch:$i }} + {{ + $it.schema = $sch; + $it.schemaPath = $schemaPath + '[' + $i + ']'; + $it.errSchemaPath = $errSchemaPath + '/' + $i; + }} + + {{# def.insertSubschemaCode }} + + {{=$valid}} = {{=$valid}} || {{=$nextValid}}; + + if (!{{=$valid}}) { + {{ $closingBraces += '}'; }} + {{~}} + + {{# def.resetCompositeRule }} + + {{= $closingBraces }} + + if (!{{=$valid}}) { + {{# def.extraError:'anyOf' }} + } else { + {{# def.resetErrors }} + {{? it.opts.allErrors }} } {{?}} +{{??}} + {{? $breakOnError }} + if (true) { + {{?}} +{{?}} diff --git a/packages/字体精简工具/node_modules/ajv/lib/dot/coerce.def b/packages/字体精简工具/node_modules/ajv/lib/dot/coerce.def new file mode 100644 index 0000000..c947ed6 --- /dev/null +++ b/packages/字体精简工具/node_modules/ajv/lib/dot/coerce.def @@ -0,0 +1,51 @@ +{{## def.coerceType: + {{ + var $dataType = 'dataType' + $lvl + , $coerced = 'coerced' + $lvl; + }} + var {{=$dataType}} = typeof {{=$data}}; + var {{=$coerced}} = undefined; + + {{? it.opts.coerceTypes == 'array' }} + if ({{=$dataType}} == 'object' && Array.isArray({{=$data}}) && {{=$data}}.length == 1) { + {{=$data}} = {{=$data}}[0]; + {{=$dataType}} = typeof {{=$data}}; + if ({{=it.util.checkDataType(it.schema.type, $data, it.opts.strictNumbers)}}) {{=$coerced}} = {{=$data}}; + } + {{?}} + + if ({{=$coerced}} !== undefined) ; + {{~ $coerceToTypes:$type:$i }} + {{? $type == 'string' }} + else if ({{=$dataType}} == 'number' || {{=$dataType}} == 'boolean') + {{=$coerced}} = '' + {{=$data}}; + else if ({{=$data}} === null) {{=$coerced}} = ''; + {{?? $type == 'number' || $type == 'integer' }} + else if ({{=$dataType}} == 'boolean' || {{=$data}} === null + || ({{=$dataType}} == 'string' && {{=$data}} && {{=$data}} == +{{=$data}} + {{? $type == 'integer' }} && !({{=$data}} % 1){{?}})) + {{=$coerced}} = +{{=$data}}; + {{?? $type == 'boolean' }} + else if ({{=$data}} === 'false' || {{=$data}} === 0 || {{=$data}} === null) + {{=$coerced}} = false; + else if ({{=$data}} === 'true' || {{=$data}} === 1) + {{=$coerced}} = true; + {{?? $type == 'null' }} + else if ({{=$data}} === '' || {{=$data}} === 0 || {{=$data}} === false) + {{=$coerced}} = null; + {{?? it.opts.coerceTypes == 'array' && $type == 'array' }} + else if ({{=$dataType}} == 'string' || {{=$dataType}} == 'number' || {{=$dataType}} == 'boolean' || {{=$data}} == null) + {{=$coerced}} = [{{=$data}}]; + {{?}} + {{~}} + else { + {{# def.error:'type' }} + } + + if ({{=$coerced}} !== undefined) { + {{# def.setParentData }} + {{=$data}} = {{=$coerced}}; + {{? !$dataLvl }}if ({{=$parentData}} !== undefined){{?}} + {{=$parentData}}[{{=$parentDataProperty}}] = {{=$coerced}}; + } +#}} diff --git a/packages/字体精简工具/node_modules/ajv/lib/dot/comment.jst b/packages/字体精简工具/node_modules/ajv/lib/dot/comment.jst new file mode 100644 index 0000000..f959150 --- /dev/null +++ b/packages/字体精简工具/node_modules/ajv/lib/dot/comment.jst @@ -0,0 +1,9 @@ +{{# def.definitions }} +{{# def.setupKeyword }} + +{{ var $comment = it.util.toQuotedString($schema); }} +{{? it.opts.$comment === true }} + console.log({{=$comment}}); +{{?? typeof it.opts.$comment == 'function' }} + self._opts.$comment({{=$comment}}, {{=it.util.toQuotedString($errSchemaPath)}}, validate.root.schema); +{{?}} diff --git a/packages/字体精简工具/node_modules/ajv/lib/dot/const.jst b/packages/字体精简工具/node_modules/ajv/lib/dot/const.jst new file mode 100644 index 0000000..2aa2298 --- /dev/null +++ b/packages/字体精简工具/node_modules/ajv/lib/dot/const.jst @@ -0,0 +1,11 @@ +{{# def.definitions }} +{{# def.errors }} +{{# def.setupKeyword }} +{{# def.$data }} + +{{? !$isData }} + var schema{{=$lvl}} = validate.schema{{=$schemaPath}}; +{{?}} +var {{=$valid}} = equal({{=$data}}, schema{{=$lvl}}); +{{# def.checkError:'const' }} +{{? $breakOnError }} else { {{?}} diff --git a/packages/字体精简工具/node_modules/ajv/lib/dot/contains.jst b/packages/字体精简工具/node_modules/ajv/lib/dot/contains.jst new file mode 100644 index 0000000..4dc9967 --- /dev/null +++ b/packages/字体精简工具/node_modules/ajv/lib/dot/contains.jst @@ -0,0 +1,55 @@ +{{# def.definitions }} +{{# def.errors }} +{{# def.setupKeyword }} +{{# def.setupNextLevel }} + + +{{ + var $idx = 'i' + $lvl + , $dataNxt = $it.dataLevel = it.dataLevel + 1 + , $nextData = 'data' + $dataNxt + , $currentBaseId = it.baseId + , $nonEmptySchema = {{# def.nonEmptySchema:$schema }}; +}} + +var {{=$errs}} = errors; +var {{=$valid}}; + +{{? $nonEmptySchema }} + {{# def.setCompositeRule }} + + {{ + $it.schema = $schema; + $it.schemaPath = $schemaPath; + $it.errSchemaPath = $errSchemaPath; + }} + + var {{=$nextValid}} = false; + + for (var {{=$idx}} = 0; {{=$idx}} < {{=$data}}.length; {{=$idx}}++) { + {{ + $it.errorPath = it.util.getPathExpr(it.errorPath, $idx, it.opts.jsonPointers, true); + var $passData = $data + '[' + $idx + ']'; + $it.dataPathArr[$dataNxt] = $idx; + }} + + {{# def.generateSubschemaCode }} + {{# def.optimizeValidate }} + + if ({{=$nextValid}}) break; + } + + {{# def.resetCompositeRule }} + {{= $closingBraces }} + + if (!{{=$nextValid}}) { +{{??}} + if ({{=$data}}.length == 0) { +{{?}} + + {{# def.error:'contains' }} + } else { + {{? $nonEmptySchema }} + {{# def.resetErrors }} + {{?}} + {{? it.opts.allErrors }} } {{?}} diff --git a/packages/字体精简工具/node_modules/ajv/lib/dot/custom.jst b/packages/字体精简工具/node_modules/ajv/lib/dot/custom.jst new file mode 100644 index 0000000..d30588f --- /dev/null +++ b/packages/字体精简工具/node_modules/ajv/lib/dot/custom.jst @@ -0,0 +1,191 @@ +{{# def.definitions }} +{{# def.errors }} +{{# def.setupKeyword }} +{{# def.$data }} + +{{ + var $rule = this + , $definition = 'definition' + $lvl + , $rDef = $rule.definition + , $closingBraces = ''; + var $validate = $rDef.validate; + var $compile, $inline, $macro, $ruleValidate, $validateCode; +}} + +{{? $isData && $rDef.$data }} + {{ + $validateCode = 'keywordValidate' + $lvl; + var $validateSchema = $rDef.validateSchema; + }} + var {{=$definition}} = RULES.custom['{{=$keyword}}'].definition; + var {{=$validateCode}} = {{=$definition}}.validate; +{{??}} + {{ + $ruleValidate = it.useCustomRule($rule, $schema, it.schema, it); + if (!$ruleValidate) return; + $schemaValue = 'validate.schema' + $schemaPath; + $validateCode = $ruleValidate.code; + $compile = $rDef.compile; + $inline = $rDef.inline; + $macro = $rDef.macro; + }} +{{?}} + +{{ + var $ruleErrs = $validateCode + '.errors' + , $i = 'i' + $lvl + , $ruleErr = 'ruleErr' + $lvl + , $asyncKeyword = $rDef.async; + + if ($asyncKeyword && !it.async) + throw new Error('async keyword in sync schema'); +}} + + +{{? !($inline || $macro) }}{{=$ruleErrs}} = null;{{?}} +var {{=$errs}} = errors; +var {{=$valid}}; + +{{## def.callRuleValidate: + {{=$validateCode}}.call( + {{? it.opts.passContext }}this{{??}}self{{?}} + {{? $compile || $rDef.schema === false }} + , {{=$data}} + {{??}} + , {{=$schemaValue}} + , {{=$data}} + , validate.schema{{=it.schemaPath}} + {{?}} + , {{# def.dataPath }} + {{# def.passParentData }} + , rootData + ) +#}} + +{{## def.extendErrors:_inline: + for (var {{=$i}}={{=$errs}}; {{=$i}} 0) + || _schema === false + : it.util.schemaHasRules(_schema, it.RULES.all)) +#}} + + +{{## def.strLength: + {{? it.opts.unicode === false }} + {{=$data}}.length + {{??}} + ucs2length({{=$data}}) + {{?}} +#}} + + +{{## def.willOptimize: + it.util.varOccurences($code, $nextData) < 2 +#}} + + +{{## def.generateSubschemaCode: + {{ + var $code = it.validate($it); + $it.baseId = $currentBaseId; + }} +#}} + + +{{## def.insertSubschemaCode: + {{= it.validate($it) }} + {{ $it.baseId = $currentBaseId; }} +#}} + + +{{## def._optimizeValidate: + it.util.varReplace($code, $nextData, $passData) +#}} + + +{{## def.optimizeValidate: + {{? {{# def.willOptimize}} }} + {{= {{# def._optimizeValidate }} }} + {{??}} + var {{=$nextData}} = {{=$passData}}; + {{= $code }} + {{?}} +#}} + + +{{## def.$data: + {{ + var $isData = it.opts.$data && $schema && $schema.$data + , $schemaValue; + }} + {{? $isData }} + var schema{{=$lvl}} = {{= it.util.getData($schema.$data, $dataLvl, it.dataPathArr) }}; + {{ $schemaValue = 'schema' + $lvl; }} + {{??}} + {{ $schemaValue = $schema; }} + {{?}} +#}} + + +{{## def.$dataNotType:_type: + {{?$isData}} ({{=$schemaValue}} !== undefined && typeof {{=$schemaValue}} != _type) || {{?}} +#}} + + +{{## def.check$dataIsArray: + if (schema{{=$lvl}} === undefined) {{=$valid}} = true; + else if (!Array.isArray(schema{{=$lvl}})) {{=$valid}} = false; + else { +#}} + + +{{## def.numberKeyword: + {{? !($isData || typeof $schema == 'number') }} + {{ throw new Error($keyword + ' must be number'); }} + {{?}} +#}} + + +{{## def.beginDefOut: + {{ + var $$outStack = $$outStack || []; + $$outStack.push(out); + out = ''; + }} +#}} + + +{{## def.storeDefOut:_variable: + {{ + var _variable = out; + out = $$outStack.pop(); + }} +#}} + + +{{## def.dataPath:(dataPath || ''){{? it.errorPath != '""'}} + {{= it.errorPath }}{{?}}#}} + +{{## def.setParentData: + {{ + var $parentData = $dataLvl ? 'data' + (($dataLvl-1)||'') : 'parentData' + , $parentDataProperty = $dataLvl ? it.dataPathArr[$dataLvl] : 'parentDataProperty'; + }} +#}} + +{{## def.passParentData: + {{# def.setParentData }} + , {{= $parentData }} + , {{= $parentDataProperty }} +#}} + + +{{## def.iterateProperties: + {{? $ownProperties }} + {{=$dataProperties}} = {{=$dataProperties}} || Object.keys({{=$data}}); + for (var {{=$idx}}=0; {{=$idx}}<{{=$dataProperties}}.length; {{=$idx}}++) { + var {{=$key}} = {{=$dataProperties}}[{{=$idx}}]; + {{??}} + for (var {{=$key}} in {{=$data}}) { + {{?}} +#}} + + +{{## def.noPropertyInData: + {{=$useData}} === undefined + {{? $ownProperties }} + || !{{# def.isOwnProperty }} + {{?}} +#}} + + +{{## def.isOwnProperty: + Object.prototype.hasOwnProperty.call({{=$data}}, '{{=it.util.escapeQuotes($propertyKey)}}') +#}} diff --git a/packages/字体精简工具/node_modules/ajv/lib/dot/dependencies.jst b/packages/字体精简工具/node_modules/ajv/lib/dot/dependencies.jst new file mode 100644 index 0000000..e4bddde --- /dev/null +++ b/packages/字体精简工具/node_modules/ajv/lib/dot/dependencies.jst @@ -0,0 +1,79 @@ +{{# def.definitions }} +{{# def.errors }} +{{# def.missing }} +{{# def.setupKeyword }} +{{# def.setupNextLevel }} + + +{{## def.propertyInData: + {{=$data}}{{= it.util.getProperty($property) }} !== undefined + {{? $ownProperties }} + && Object.prototype.hasOwnProperty.call({{=$data}}, '{{=it.util.escapeQuotes($property)}}') + {{?}} +#}} + + +{{ + var $schemaDeps = {} + , $propertyDeps = {} + , $ownProperties = it.opts.ownProperties; + + for ($property in $schema) { + if ($property == '__proto__') continue; + var $sch = $schema[$property]; + var $deps = Array.isArray($sch) ? $propertyDeps : $schemaDeps; + $deps[$property] = $sch; + } +}} + +var {{=$errs}} = errors; + +{{ var $currentErrorPath = it.errorPath; }} + +var missing{{=$lvl}}; +{{ for (var $property in $propertyDeps) { }} + {{ $deps = $propertyDeps[$property]; }} + {{? $deps.length }} + if ({{# def.propertyInData }} + {{? $breakOnError }} + && ({{# def.checkMissingProperty:$deps }})) { + {{# def.errorMissingProperty:'dependencies' }} + {{??}} + ) { + {{~ $deps:$propertyKey }} + {{# def.allErrorsMissingProperty:'dependencies' }} + {{~}} + {{?}} + } {{# def.elseIfValid }} + {{?}} +{{ } }} + +{{ + it.errorPath = $currentErrorPath; + var $currentBaseId = $it.baseId; +}} + + +{{ for (var $property in $schemaDeps) { }} + {{ var $sch = $schemaDeps[$property]; }} + {{? {{# def.nonEmptySchema:$sch }} }} + {{=$nextValid}} = true; + + if ({{# def.propertyInData }}) { + {{ + $it.schema = $sch; + $it.schemaPath = $schemaPath + it.util.getProperty($property); + $it.errSchemaPath = $errSchemaPath + '/' + it.util.escapeFragment($property); + }} + + {{# def.insertSubschemaCode }} + } + + {{# def.ifResultValid }} + {{?}} +{{ } }} + +{{? $breakOnError }} + {{= $closingBraces }} + if ({{=$errs}} == errors) { +{{?}} diff --git a/packages/字体精简工具/node_modules/ajv/lib/dot/enum.jst b/packages/字体精简工具/node_modules/ajv/lib/dot/enum.jst new file mode 100644 index 0000000..357c2e8 --- /dev/null +++ b/packages/字体精简工具/node_modules/ajv/lib/dot/enum.jst @@ -0,0 +1,30 @@ +{{# def.definitions }} +{{# def.errors }} +{{# def.setupKeyword }} +{{# def.$data }} + +{{ + var $i = 'i' + $lvl + , $vSchema = 'schema' + $lvl; +}} + +{{? !$isData }} + var {{=$vSchema}} = validate.schema{{=$schemaPath}}; +{{?}} +var {{=$valid}}; + +{{?$isData}}{{# def.check$dataIsArray }}{{?}} + +{{=$valid}} = false; + +for (var {{=$i}}=0; {{=$i}}<{{=$vSchema}}.length; {{=$i}}++) + if (equal({{=$data}}, {{=$vSchema}}[{{=$i}}])) { + {{=$valid}} = true; + break; + } + +{{? $isData }} } {{?}} + +{{# def.checkError:'enum' }} + +{{? $breakOnError }} else { {{?}} diff --git a/packages/字体精简工具/node_modules/ajv/lib/dot/errors.def b/packages/字体精简工具/node_modules/ajv/lib/dot/errors.def new file mode 100644 index 0000000..5c5752c --- /dev/null +++ b/packages/字体精简工具/node_modules/ajv/lib/dot/errors.def @@ -0,0 +1,194 @@ +{{# def.definitions }} + +{{## def._error:_rule: + {{ 'istanbul ignore else'; }} + {{? it.createErrors !== false }} + { + keyword: '{{= $errorKeyword || _rule }}' + , dataPath: (dataPath || '') + {{= it.errorPath }} + , schemaPath: {{=it.util.toQuotedString($errSchemaPath)}} + , params: {{# def._errorParams[_rule] }} + {{? it.opts.messages !== false }} + , message: {{# def._errorMessages[_rule] }} + {{?}} + {{? it.opts.verbose }} + , schema: {{# def._errorSchemas[_rule] }} + , parentSchema: validate.schema{{=it.schemaPath}} + , data: {{=$data}} + {{?}} + } + {{??}} + {} + {{?}} +#}} + + +{{## def._addError:_rule: + if (vErrors === null) vErrors = [err]; + else vErrors.push(err); + errors++; +#}} + + +{{## def.addError:_rule: + var err = {{# def._error:_rule }}; + {{# def._addError:_rule }} +#}} + + +{{## def.error:_rule: + {{# def.beginDefOut}} + {{# def._error:_rule }} + {{# def.storeDefOut:__err }} + + {{? !it.compositeRule && $breakOnError }} + {{ 'istanbul ignore if'; }} + {{? it.async }} + throw new ValidationError([{{=__err}}]); + {{??}} + validate.errors = [{{=__err}}]; + return false; + {{?}} + {{??}} + var err = {{=__err}}; + {{# def._addError:_rule }} + {{?}} +#}} + + +{{## def.extraError:_rule: + {{# def.addError:_rule}} + {{? !it.compositeRule && $breakOnError }} + {{ 'istanbul ignore if'; }} + {{? it.async }} + throw new ValidationError(vErrors); + {{??}} + validate.errors = vErrors; + return false; + {{?}} + {{?}} +#}} + + +{{## def.checkError:_rule: + if (!{{=$valid}}) { + {{# def.error:_rule }} + } +#}} + + +{{## def.resetErrors: + errors = {{=$errs}}; + if (vErrors !== null) { + if ({{=$errs}}) vErrors.length = {{=$errs}}; + else vErrors = null; + } +#}} + + +{{## def.concatSchema:{{?$isData}}' + {{=$schemaValue}} + '{{??}}{{=$schema}}{{?}}#}} +{{## def.appendSchema:{{?$isData}}' + {{=$schemaValue}}{{??}}{{=$schemaValue}}'{{?}}#}} +{{## def.concatSchemaEQ:{{?$isData}}' + {{=$schemaValue}} + '{{??}}{{=it.util.escapeQuotes($schema)}}{{?}}#}} + +{{## def._errorMessages = { + 'false schema': "'boolean schema is false'", + $ref: "'can\\\'t resolve reference {{=it.util.escapeQuotes($schema)}}'", + additionalItems: "'should NOT have more than {{=$schema.length}} items'", + additionalProperties: "'{{? it.opts._errorDataPathProperty }}is an invalid additional property{{??}}should NOT have additional properties{{?}}'", + anyOf: "'should match some schema in anyOf'", + const: "'should be equal to constant'", + contains: "'should contain a valid item'", + dependencies: "'should have {{? $deps.length == 1 }}property {{= it.util.escapeQuotes($deps[0]) }}{{??}}properties {{= it.util.escapeQuotes($deps.join(\", \")) }}{{?}} when property {{= it.util.escapeQuotes($property) }} is present'", + 'enum': "'should be equal to one of the allowed values'", + format: "'should match format \"{{#def.concatSchemaEQ}}\"'", + 'if': "'should match \"' + {{=$ifClause}} + '\" schema'", + _limit: "'should be {{=$opStr}} {{#def.appendSchema}}", + _exclusiveLimit: "'{{=$exclusiveKeyword}} should be boolean'", + _limitItems: "'should NOT have {{?$keyword=='maxItems'}}more{{??}}fewer{{?}} than {{#def.concatSchema}} items'", + _limitLength: "'should NOT be {{?$keyword=='maxLength'}}longer{{??}}shorter{{?}} than {{#def.concatSchema}} characters'", + _limitProperties:"'should NOT have {{?$keyword=='maxProperties'}}more{{??}}fewer{{?}} than {{#def.concatSchema}} properties'", + multipleOf: "'should be multiple of {{#def.appendSchema}}", + not: "'should NOT be valid'", + oneOf: "'should match exactly one schema in oneOf'", + pattern: "'should match pattern \"{{#def.concatSchemaEQ}}\"'", + propertyNames: "'property name \\'{{=$invalidName}}\\' is invalid'", + required: "'{{? it.opts._errorDataPathProperty }}is a required property{{??}}should have required property \\'{{=$missingProperty}}\\'{{?}}'", + type: "'should be {{? $typeIsArray }}{{= $typeSchema.join(\",\") }}{{??}}{{=$typeSchema}}{{?}}'", + uniqueItems: "'should NOT have duplicate items (items ## ' + j + ' and ' + i + ' are identical)'", + custom: "'should pass \"{{=$rule.keyword}}\" keyword validation'", + patternRequired: "'should have property matching pattern \\'{{=$missingPattern}}\\''", + switch: "'should pass \"switch\" keyword validation'", + _formatLimit: "'should be {{=$opStr}} \"{{#def.concatSchemaEQ}}\"'", + _formatExclusiveLimit: "'{{=$exclusiveKeyword}} should be boolean'" +} #}} + + +{{## def.schemaRefOrVal: {{?$isData}}validate.schema{{=$schemaPath}}{{??}}{{=$schema}}{{?}} #}} +{{## def.schemaRefOrQS: {{?$isData}}validate.schema{{=$schemaPath}}{{??}}{{=it.util.toQuotedString($schema)}}{{?}} #}} + +{{## def._errorSchemas = { + 'false schema': "false", + $ref: "{{=it.util.toQuotedString($schema)}}", + additionalItems: "false", + additionalProperties: "false", + anyOf: "validate.schema{{=$schemaPath}}", + const: "validate.schema{{=$schemaPath}}", + contains: "validate.schema{{=$schemaPath}}", + dependencies: "validate.schema{{=$schemaPath}}", + 'enum': "validate.schema{{=$schemaPath}}", + format: "{{#def.schemaRefOrQS}}", + 'if': "validate.schema{{=$schemaPath}}", + _limit: "{{#def.schemaRefOrVal}}", + _exclusiveLimit: "validate.schema{{=$schemaPath}}", + _limitItems: "{{#def.schemaRefOrVal}}", + _limitLength: "{{#def.schemaRefOrVal}}", + _limitProperties:"{{#def.schemaRefOrVal}}", + multipleOf: "{{#def.schemaRefOrVal}}", + not: "validate.schema{{=$schemaPath}}", + oneOf: "validate.schema{{=$schemaPath}}", + pattern: "{{#def.schemaRefOrQS}}", + propertyNames: "validate.schema{{=$schemaPath}}", + required: "validate.schema{{=$schemaPath}}", + type: "validate.schema{{=$schemaPath}}", + uniqueItems: "{{#def.schemaRefOrVal}}", + custom: "validate.schema{{=$schemaPath}}", + patternRequired: "validate.schema{{=$schemaPath}}", + switch: "validate.schema{{=$schemaPath}}", + _formatLimit: "{{#def.schemaRefOrQS}}", + _formatExclusiveLimit: "validate.schema{{=$schemaPath}}" +} #}} + + +{{## def.schemaValueQS: {{?$isData}}{{=$schemaValue}}{{??}}{{=it.util.toQuotedString($schema)}}{{?}} #}} + +{{## def._errorParams = { + 'false schema': "{}", + $ref: "{ ref: '{{=it.util.escapeQuotes($schema)}}' }", + additionalItems: "{ limit: {{=$schema.length}} }", + additionalProperties: "{ additionalProperty: '{{=$additionalProperty}}' }", + anyOf: "{}", + const: "{ allowedValue: schema{{=$lvl}} }", + contains: "{}", + dependencies: "{ property: '{{= it.util.escapeQuotes($property) }}', missingProperty: '{{=$missingProperty}}', depsCount: {{=$deps.length}}, deps: '{{= it.util.escapeQuotes($deps.length==1 ? $deps[0] : $deps.join(\", \")) }}' }", + 'enum': "{ allowedValues: schema{{=$lvl}} }", + format: "{ format: {{#def.schemaValueQS}} }", + 'if': "{ failingKeyword: {{=$ifClause}} }", + _limit: "{ comparison: {{=$opExpr}}, limit: {{=$schemaValue}}, exclusive: {{=$exclusive}} }", + _exclusiveLimit: "{}", + _limitItems: "{ limit: {{=$schemaValue}} }", + _limitLength: "{ limit: {{=$schemaValue}} }", + _limitProperties:"{ limit: {{=$schemaValue}} }", + multipleOf: "{ multipleOf: {{=$schemaValue}} }", + not: "{}", + oneOf: "{ passingSchemas: {{=$passingSchemas}} }", + pattern: "{ pattern: {{#def.schemaValueQS}} }", + propertyNames: "{ propertyName: '{{=$invalidName}}' }", + required: "{ missingProperty: '{{=$missingProperty}}' }", + type: "{ type: '{{? $typeIsArray }}{{= $typeSchema.join(\",\") }}{{??}}{{=$typeSchema}}{{?}}' }", + uniqueItems: "{ i: i, j: j }", + custom: "{ keyword: '{{=$rule.keyword}}' }", + patternRequired: "{ missingPattern: '{{=$missingPattern}}' }", + switch: "{ caseIndex: {{=$caseIndex}} }", + _formatLimit: "{ comparison: {{=$opExpr}}, limit: {{#def.schemaValueQS}}, exclusive: {{=$exclusive}} }", + _formatExclusiveLimit: "{}" +} #}} diff --git a/packages/字体精简工具/node_modules/ajv/lib/dot/format.jst b/packages/字体精简工具/node_modules/ajv/lib/dot/format.jst new file mode 100644 index 0000000..37f14da --- /dev/null +++ b/packages/字体精简工具/node_modules/ajv/lib/dot/format.jst @@ -0,0 +1,106 @@ +{{# def.definitions }} +{{# def.errors }} +{{# def.setupKeyword }} + +{{## def.skipFormat: + {{? $breakOnError }} if (true) { {{?}} + {{ return out; }} +#}} + +{{? it.opts.format === false }}{{# def.skipFormat }}{{?}} + + +{{# def.$data }} + + +{{## def.$dataCheckFormat: + {{# def.$dataNotType:'string' }} + ({{? $unknownFormats != 'ignore' }} + ({{=$schemaValue}} && !{{=$format}} + {{? $allowUnknown }} + && self._opts.unknownFormats.indexOf({{=$schemaValue}}) == -1 + {{?}}) || + {{?}} + ({{=$format}} && {{=$formatType}} == '{{=$ruleType}}' + && !(typeof {{=$format}} == 'function' + ? {{? it.async}} + (async{{=$lvl}} ? await {{=$format}}({{=$data}}) : {{=$format}}({{=$data}})) + {{??}} + {{=$format}}({{=$data}}) + {{?}} + : {{=$format}}.test({{=$data}})))) +#}} + +{{## def.checkFormat: + {{ + var $formatRef = 'formats' + it.util.getProperty($schema); + if ($isObject) $formatRef += '.validate'; + }} + {{? typeof $format == 'function' }} + {{=$formatRef}}({{=$data}}) + {{??}} + {{=$formatRef}}.test({{=$data}}) + {{?}} +#}} + + +{{ + var $unknownFormats = it.opts.unknownFormats + , $allowUnknown = Array.isArray($unknownFormats); +}} + +{{? $isData }} + {{ + var $format = 'format' + $lvl + , $isObject = 'isObject' + $lvl + , $formatType = 'formatType' + $lvl; + }} + var {{=$format}} = formats[{{=$schemaValue}}]; + var {{=$isObject}} = typeof {{=$format}} == 'object' + && !({{=$format}} instanceof RegExp) + && {{=$format}}.validate; + var {{=$formatType}} = {{=$isObject}} && {{=$format}}.type || 'string'; + if ({{=$isObject}}) { + {{? it.async}} + var async{{=$lvl}} = {{=$format}}.async; + {{?}} + {{=$format}} = {{=$format}}.validate; + } + if ({{# def.$dataCheckFormat }}) { +{{??}} + {{ var $format = it.formats[$schema]; }} + {{? !$format }} + {{? $unknownFormats == 'ignore' }} + {{ it.logger.warn('unknown format "' + $schema + '" ignored in schema at path "' + it.errSchemaPath + '"'); }} + {{# def.skipFormat }} + {{?? $allowUnknown && $unknownFormats.indexOf($schema) >= 0 }} + {{# def.skipFormat }} + {{??}} + {{ throw new Error('unknown format "' + $schema + '" is used in schema at path "' + it.errSchemaPath + '"'); }} + {{?}} + {{?}} + {{ + var $isObject = typeof $format == 'object' + && !($format instanceof RegExp) + && $format.validate; + var $formatType = $isObject && $format.type || 'string'; + if ($isObject) { + var $async = $format.async === true; + $format = $format.validate; + } + }} + {{? $formatType != $ruleType }} + {{# def.skipFormat }} + {{?}} + {{? $async }} + {{ + if (!it.async) throw new Error('async format in sync schema'); + var $formatRef = 'formats' + it.util.getProperty($schema) + '.validate'; + }} + if (!(await {{=$formatRef}}({{=$data}}))) { + {{??}} + if (!{{# def.checkFormat }}) { + {{?}} +{{?}} + {{# def.error:'format' }} + } {{? $breakOnError }} else { {{?}} diff --git a/packages/字体精简工具/node_modules/ajv/lib/dot/if.jst b/packages/字体精简工具/node_modules/ajv/lib/dot/if.jst new file mode 100644 index 0000000..adb5036 --- /dev/null +++ b/packages/字体精简工具/node_modules/ajv/lib/dot/if.jst @@ -0,0 +1,73 @@ +{{# def.definitions }} +{{# def.errors }} +{{# def.setupKeyword }} +{{# def.setupNextLevel }} + + +{{## def.validateIfClause:_clause: + {{ + $it.schema = it.schema['_clause']; + $it.schemaPath = it.schemaPath + '._clause'; + $it.errSchemaPath = it.errSchemaPath + '/_clause'; + }} + {{# def.insertSubschemaCode }} + {{=$valid}} = {{=$nextValid}}; + {{? $thenPresent && $elsePresent }} + {{ $ifClause = 'ifClause' + $lvl; }} + var {{=$ifClause}} = '_clause'; + {{??}} + {{ $ifClause = '\'_clause\''; }} + {{?}} +#}} + +{{ + var $thenSch = it.schema['then'] + , $elseSch = it.schema['else'] + , $thenPresent = $thenSch !== undefined && {{# def.nonEmptySchema:$thenSch }} + , $elsePresent = $elseSch !== undefined && {{# def.nonEmptySchema:$elseSch }} + , $currentBaseId = $it.baseId; +}} + +{{? $thenPresent || $elsePresent }} + {{ + var $ifClause; + $it.createErrors = false; + $it.schema = $schema; + $it.schemaPath = $schemaPath; + $it.errSchemaPath = $errSchemaPath; + }} + var {{=$errs}} = errors; + var {{=$valid}} = true; + + {{# def.setCompositeRule }} + {{# def.insertSubschemaCode }} + {{ $it.createErrors = true; }} + {{# def.resetErrors }} + {{# def.resetCompositeRule }} + + {{? $thenPresent }} + if ({{=$nextValid}}) { + {{# def.validateIfClause:then }} + } + {{? $elsePresent }} + else { + {{?}} + {{??}} + if (!{{=$nextValid}}) { + {{?}} + + {{? $elsePresent }} + {{# def.validateIfClause:else }} + } + {{?}} + + if (!{{=$valid}}) { + {{# def.extraError:'if' }} + } + {{? $breakOnError }} else { {{?}} +{{??}} + {{? $breakOnError }} + if (true) { + {{?}} +{{?}} + diff --git a/packages/字体精简工具/node_modules/ajv/lib/dot/items.jst b/packages/字体精简工具/node_modules/ajv/lib/dot/items.jst new file mode 100644 index 0000000..acc932a --- /dev/null +++ b/packages/字体精简工具/node_modules/ajv/lib/dot/items.jst @@ -0,0 +1,98 @@ +{{# def.definitions }} +{{# def.errors }} +{{# def.setupKeyword }} +{{# def.setupNextLevel }} + + +{{## def.validateItems:startFrom: + for (var {{=$idx}} = {{=startFrom}}; {{=$idx}} < {{=$data}}.length; {{=$idx}}++) { + {{ + $it.errorPath = it.util.getPathExpr(it.errorPath, $idx, it.opts.jsonPointers, true); + var $passData = $data + '[' + $idx + ']'; + $it.dataPathArr[$dataNxt] = $idx; + }} + + {{# def.generateSubschemaCode }} + {{# def.optimizeValidate }} + + {{? $breakOnError }} + if (!{{=$nextValid}}) break; + {{?}} + } +#}} + +{{ + var $idx = 'i' + $lvl + , $dataNxt = $it.dataLevel = it.dataLevel + 1 + , $nextData = 'data' + $dataNxt + , $currentBaseId = it.baseId; +}} + +var {{=$errs}} = errors; +var {{=$valid}}; + +{{? Array.isArray($schema) }} + {{ /* 'items' is an array of schemas */}} + {{ var $additionalItems = it.schema.additionalItems; }} + {{? $additionalItems === false }} + {{=$valid}} = {{=$data}}.length <= {{= $schema.length }}; + {{ + var $currErrSchemaPath = $errSchemaPath; + $errSchemaPath = it.errSchemaPath + '/additionalItems'; + }} + {{# def.checkError:'additionalItems' }} + {{ $errSchemaPath = $currErrSchemaPath; }} + {{# def.elseIfValid}} + {{?}} + + {{~ $schema:$sch:$i }} + {{? {{# def.nonEmptySchema:$sch }} }} + {{=$nextValid}} = true; + + if ({{=$data}}.length > {{=$i}}) { + {{ + var $passData = $data + '[' + $i + ']'; + $it.schema = $sch; + $it.schemaPath = $schemaPath + '[' + $i + ']'; + $it.errSchemaPath = $errSchemaPath + '/' + $i; + $it.errorPath = it.util.getPathExpr(it.errorPath, $i, it.opts.jsonPointers, true); + $it.dataPathArr[$dataNxt] = $i; + }} + + {{# def.generateSubschemaCode }} + {{# def.optimizeValidate }} + } + + {{# def.ifResultValid }} + {{?}} + {{~}} + + {{? typeof $additionalItems == 'object' && {{# def.nonEmptySchema:$additionalItems }} }} + {{ + $it.schema = $additionalItems; + $it.schemaPath = it.schemaPath + '.additionalItems'; + $it.errSchemaPath = it.errSchemaPath + '/additionalItems'; + }} + {{=$nextValid}} = true; + + if ({{=$data}}.length > {{= $schema.length }}) { + {{# def.validateItems: $schema.length }} + } + + {{# def.ifResultValid }} + {{?}} + +{{?? {{# def.nonEmptySchema:$schema }} }} + {{ /* 'items' is a single schema */}} + {{ + $it.schema = $schema; + $it.schemaPath = $schemaPath; + $it.errSchemaPath = $errSchemaPath; + }} + {{# def.validateItems: 0 }} +{{?}} + +{{? $breakOnError }} + {{= $closingBraces }} + if ({{=$errs}} == errors) { +{{?}} diff --git a/packages/字体精简工具/node_modules/ajv/lib/dot/missing.def b/packages/字体精简工具/node_modules/ajv/lib/dot/missing.def new file mode 100644 index 0000000..a73b9f9 --- /dev/null +++ b/packages/字体精简工具/node_modules/ajv/lib/dot/missing.def @@ -0,0 +1,39 @@ +{{## def.checkMissingProperty:_properties: + {{~ _properties:$propertyKey:$i }} + {{?$i}} || {{?}} + {{ + var $prop = it.util.getProperty($propertyKey) + , $useData = $data + $prop; + }} + ( ({{# def.noPropertyInData }}) && (missing{{=$lvl}} = {{= it.util.toQuotedString(it.opts.jsonPointers ? $propertyKey : $prop) }}) ) + {{~}} +#}} + + +{{## def.errorMissingProperty:_error: + {{ + var $propertyPath = 'missing' + $lvl + , $missingProperty = '\' + ' + $propertyPath + ' + \''; + if (it.opts._errorDataPathProperty) { + it.errorPath = it.opts.jsonPointers + ? it.util.getPathExpr($currentErrorPath, $propertyPath, true) + : $currentErrorPath + ' + ' + $propertyPath; + } + }} + {{# def.error:_error }} +#}} + + +{{## def.allErrorsMissingProperty:_error: + {{ + var $prop = it.util.getProperty($propertyKey) + , $missingProperty = it.util.escapeQuotes($propertyKey) + , $useData = $data + $prop; + if (it.opts._errorDataPathProperty) { + it.errorPath = it.util.getPath($currentErrorPath, $propertyKey, it.opts.jsonPointers); + } + }} + if ({{# def.noPropertyInData }}) { + {{# def.addError:_error }} + } +#}} diff --git a/packages/字体精简工具/node_modules/ajv/lib/dot/multipleOf.jst b/packages/字体精简工具/node_modules/ajv/lib/dot/multipleOf.jst new file mode 100644 index 0000000..6d88a45 --- /dev/null +++ b/packages/字体精简工具/node_modules/ajv/lib/dot/multipleOf.jst @@ -0,0 +1,22 @@ +{{# def.definitions }} +{{# def.errors }} +{{# def.setupKeyword }} +{{# def.$data }} + +{{# def.numberKeyword }} + +var division{{=$lvl}}; +if ({{?$isData}} + {{=$schemaValue}} !== undefined && ( + typeof {{=$schemaValue}} != 'number' || + {{?}} + (division{{=$lvl}} = {{=$data}} / {{=$schemaValue}}, + {{? it.opts.multipleOfPrecision }} + Math.abs(Math.round(division{{=$lvl}}) - division{{=$lvl}}) > 1e-{{=it.opts.multipleOfPrecision}} + {{??}} + division{{=$lvl}} !== parseInt(division{{=$lvl}}) + {{?}} + ) + {{?$isData}} ) {{?}} ) { + {{# def.error:'multipleOf' }} +} {{? $breakOnError }} else { {{?}} diff --git a/packages/字体精简工具/node_modules/ajv/lib/dot/not.jst b/packages/字体精简工具/node_modules/ajv/lib/dot/not.jst new file mode 100644 index 0000000..e03185a --- /dev/null +++ b/packages/字体精简工具/node_modules/ajv/lib/dot/not.jst @@ -0,0 +1,43 @@ +{{# def.definitions }} +{{# def.errors }} +{{# def.setupKeyword }} +{{# def.setupNextLevel }} + +{{? {{# def.nonEmptySchema:$schema }} }} + {{ + $it.schema = $schema; + $it.schemaPath = $schemaPath; + $it.errSchemaPath = $errSchemaPath; + }} + + var {{=$errs}} = errors; + + {{# def.setCompositeRule }} + + {{ + $it.createErrors = false; + var $allErrorsOption; + if ($it.opts.allErrors) { + $allErrorsOption = $it.opts.allErrors; + $it.opts.allErrors = false; + } + }} + {{= it.validate($it) }} + {{ + $it.createErrors = true; + if ($allErrorsOption) $it.opts.allErrors = $allErrorsOption; + }} + + {{# def.resetCompositeRule }} + + if ({{=$nextValid}}) { + {{# def.error:'not' }} + } else { + {{# def.resetErrors }} + {{? it.opts.allErrors }} } {{?}} +{{??}} + {{# def.addError:'not' }} + {{? $breakOnError}} + if (false) { + {{?}} +{{?}} diff --git a/packages/字体精简工具/node_modules/ajv/lib/dot/oneOf.jst b/packages/字体精简工具/node_modules/ajv/lib/dot/oneOf.jst new file mode 100644 index 0000000..bcce2c6 --- /dev/null +++ b/packages/字体精简工具/node_modules/ajv/lib/dot/oneOf.jst @@ -0,0 +1,54 @@ +{{# def.definitions }} +{{# def.errors }} +{{# def.setupKeyword }} +{{# def.setupNextLevel }} + +{{ + var $currentBaseId = $it.baseId + , $prevValid = 'prevValid' + $lvl + , $passingSchemas = 'passingSchemas' + $lvl; +}} + +var {{=$errs}} = errors + , {{=$prevValid}} = false + , {{=$valid}} = false + , {{=$passingSchemas}} = null; + +{{# def.setCompositeRule }} + +{{~ $schema:$sch:$i }} + {{? {{# def.nonEmptySchema:$sch }} }} + {{ + $it.schema = $sch; + $it.schemaPath = $schemaPath + '[' + $i + ']'; + $it.errSchemaPath = $errSchemaPath + '/' + $i; + }} + + {{# def.insertSubschemaCode }} + {{??}} + var {{=$nextValid}} = true; + {{?}} + + {{? $i }} + if ({{=$nextValid}} && {{=$prevValid}}) { + {{=$valid}} = false; + {{=$passingSchemas}} = [{{=$passingSchemas}}, {{=$i}}]; + } else { + {{ $closingBraces += '}'; }} + {{?}} + + if ({{=$nextValid}}) { + {{=$valid}} = {{=$prevValid}} = true; + {{=$passingSchemas}} = {{=$i}}; + } +{{~}} + +{{# def.resetCompositeRule }} + +{{= $closingBraces }} + +if (!{{=$valid}}) { + {{# def.extraError:'oneOf' }} +} else { + {{# def.resetErrors }} +{{? it.opts.allErrors }} } {{?}} diff --git a/packages/字体精简工具/node_modules/ajv/lib/dot/pattern.jst b/packages/字体精简工具/node_modules/ajv/lib/dot/pattern.jst new file mode 100644 index 0000000..3a37ef6 --- /dev/null +++ b/packages/字体精简工具/node_modules/ajv/lib/dot/pattern.jst @@ -0,0 +1,14 @@ +{{# def.definitions }} +{{# def.errors }} +{{# def.setupKeyword }} +{{# def.$data }} + +{{ + var $regexp = $isData + ? '(new RegExp(' + $schemaValue + '))' + : it.usePattern($schema); +}} + +if ({{# def.$dataNotType:'string' }} !{{=$regexp}}.test({{=$data}}) ) { + {{# def.error:'pattern' }} +} {{? $breakOnError }} else { {{?}} diff --git a/packages/字体精简工具/node_modules/ajv/lib/dot/properties.jst b/packages/字体精简工具/node_modules/ajv/lib/dot/properties.jst new file mode 100644 index 0000000..5cebb9b --- /dev/null +++ b/packages/字体精简工具/node_modules/ajv/lib/dot/properties.jst @@ -0,0 +1,245 @@ +{{# def.definitions }} +{{# def.errors }} +{{# def.setupKeyword }} +{{# def.setupNextLevel }} + + +{{## def.validateAdditional: + {{ /* additionalProperties is schema */ + $it.schema = $aProperties; + $it.schemaPath = it.schemaPath + '.additionalProperties'; + $it.errSchemaPath = it.errSchemaPath + '/additionalProperties'; + $it.errorPath = it.opts._errorDataPathProperty + ? it.errorPath + : it.util.getPathExpr(it.errorPath, $key, it.opts.jsonPointers); + var $passData = $data + '[' + $key + ']'; + $it.dataPathArr[$dataNxt] = $key; + }} + + {{# def.generateSubschemaCode }} + {{# def.optimizeValidate }} +#}} + + +{{ + var $key = 'key' + $lvl + , $idx = 'idx' + $lvl + , $dataNxt = $it.dataLevel = it.dataLevel + 1 + , $nextData = 'data' + $dataNxt + , $dataProperties = 'dataProperties' + $lvl; + + var $schemaKeys = Object.keys($schema || {}).filter(notProto) + , $pProperties = it.schema.patternProperties || {} + , $pPropertyKeys = Object.keys($pProperties).filter(notProto) + , $aProperties = it.schema.additionalProperties + , $someProperties = $schemaKeys.length || $pPropertyKeys.length + , $noAdditional = $aProperties === false + , $additionalIsSchema = typeof $aProperties == 'object' + && Object.keys($aProperties).length + , $removeAdditional = it.opts.removeAdditional + , $checkAdditional = $noAdditional || $additionalIsSchema || $removeAdditional + , $ownProperties = it.opts.ownProperties + , $currentBaseId = it.baseId; + + var $required = it.schema.required; + if ($required && !(it.opts.$data && $required.$data) && $required.length < it.opts.loopRequired) { + var $requiredHash = it.util.toHash($required); + } + + function notProto(p) { return p !== '__proto__'; } +}} + + +var {{=$errs}} = errors; +var {{=$nextValid}} = true; +{{? $ownProperties }} + var {{=$dataProperties}} = undefined; +{{?}} + +{{? $checkAdditional }} + {{# def.iterateProperties }} + {{? $someProperties }} + var isAdditional{{=$lvl}} = !(false + {{? $schemaKeys.length }} + {{? $schemaKeys.length > 8 }} + || validate.schema{{=$schemaPath}}.hasOwnProperty({{=$key}}) + {{??}} + {{~ $schemaKeys:$propertyKey }} + || {{=$key}} == {{= it.util.toQuotedString($propertyKey) }} + {{~}} + {{?}} + {{?}} + {{? $pPropertyKeys.length }} + {{~ $pPropertyKeys:$pProperty:$i }} + || {{= it.usePattern($pProperty) }}.test({{=$key}}) + {{~}} + {{?}} + ); + + if (isAdditional{{=$lvl}}) { + {{?}} + {{? $removeAdditional == 'all' }} + delete {{=$data}}[{{=$key}}]; + {{??}} + {{ + var $currentErrorPath = it.errorPath; + var $additionalProperty = '\' + ' + $key + ' + \''; + if (it.opts._errorDataPathProperty) { + it.errorPath = it.util.getPathExpr(it.errorPath, $key, it.opts.jsonPointers); + } + }} + {{? $noAdditional }} + {{? $removeAdditional }} + delete {{=$data}}[{{=$key}}]; + {{??}} + {{=$nextValid}} = false; + {{ + var $currErrSchemaPath = $errSchemaPath; + $errSchemaPath = it.errSchemaPath + '/additionalProperties'; + }} + {{# def.error:'additionalProperties' }} + {{ $errSchemaPath = $currErrSchemaPath; }} + {{? $breakOnError }} break; {{?}} + {{?}} + {{?? $additionalIsSchema }} + {{? $removeAdditional == 'failing' }} + var {{=$errs}} = errors; + {{# def.setCompositeRule }} + + {{# def.validateAdditional }} + + if (!{{=$nextValid}}) { + errors = {{=$errs}}; + if (validate.errors !== null) { + if (errors) validate.errors.length = errors; + else validate.errors = null; + } + delete {{=$data}}[{{=$key}}]; + } + + {{# def.resetCompositeRule }} + {{??}} + {{# def.validateAdditional }} + {{? $breakOnError }} if (!{{=$nextValid}}) break; {{?}} + {{?}} + {{?}} + {{ it.errorPath = $currentErrorPath; }} + {{?}} + {{? $someProperties }} + } + {{?}} + } + + {{# def.ifResultValid }} +{{?}} + +{{ var $useDefaults = it.opts.useDefaults && !it.compositeRule; }} + +{{? $schemaKeys.length }} + {{~ $schemaKeys:$propertyKey }} + {{ var $sch = $schema[$propertyKey]; }} + + {{? {{# def.nonEmptySchema:$sch}} }} + {{ + var $prop = it.util.getProperty($propertyKey) + , $passData = $data + $prop + , $hasDefault = $useDefaults && $sch.default !== undefined; + $it.schema = $sch; + $it.schemaPath = $schemaPath + $prop; + $it.errSchemaPath = $errSchemaPath + '/' + it.util.escapeFragment($propertyKey); + $it.errorPath = it.util.getPath(it.errorPath, $propertyKey, it.opts.jsonPointers); + $it.dataPathArr[$dataNxt] = it.util.toQuotedString($propertyKey); + }} + + {{# def.generateSubschemaCode }} + + {{? {{# def.willOptimize }} }} + {{ + $code = {{# def._optimizeValidate }}; + var $useData = $passData; + }} + {{??}} + {{ var $useData = $nextData; }} + var {{=$nextData}} = {{=$passData}}; + {{?}} + + {{? $hasDefault }} + {{= $code }} + {{??}} + {{? $requiredHash && $requiredHash[$propertyKey] }} + if ({{# def.noPropertyInData }}) { + {{=$nextValid}} = false; + {{ + var $currentErrorPath = it.errorPath + , $currErrSchemaPath = $errSchemaPath + , $missingProperty = it.util.escapeQuotes($propertyKey); + if (it.opts._errorDataPathProperty) { + it.errorPath = it.util.getPath($currentErrorPath, $propertyKey, it.opts.jsonPointers); + } + $errSchemaPath = it.errSchemaPath + '/required'; + }} + {{# def.error:'required' }} + {{ $errSchemaPath = $currErrSchemaPath; }} + {{ it.errorPath = $currentErrorPath; }} + } else { + {{??}} + {{? $breakOnError }} + if ({{# def.noPropertyInData }}) { + {{=$nextValid}} = true; + } else { + {{??}} + if ({{=$useData}} !== undefined + {{? $ownProperties }} + && {{# def.isOwnProperty }} + {{?}} + ) { + {{?}} + {{?}} + + {{= $code }} + } + {{?}} {{ /* $hasDefault */ }} + {{?}} {{ /* def.nonEmptySchema */ }} + + {{# def.ifResultValid }} + {{~}} +{{?}} + +{{? $pPropertyKeys.length }} + {{~ $pPropertyKeys:$pProperty }} + {{ var $sch = $pProperties[$pProperty]; }} + + {{? {{# def.nonEmptySchema:$sch}} }} + {{ + $it.schema = $sch; + $it.schemaPath = it.schemaPath + '.patternProperties' + it.util.getProperty($pProperty); + $it.errSchemaPath = it.errSchemaPath + '/patternProperties/' + + it.util.escapeFragment($pProperty); + }} + + {{# def.iterateProperties }} + if ({{= it.usePattern($pProperty) }}.test({{=$key}})) { + {{ + $it.errorPath = it.util.getPathExpr(it.errorPath, $key, it.opts.jsonPointers); + var $passData = $data + '[' + $key + ']'; + $it.dataPathArr[$dataNxt] = $key; + }} + + {{# def.generateSubschemaCode }} + {{# def.optimizeValidate }} + + {{? $breakOnError }} if (!{{=$nextValid}}) break; {{?}} + } + {{? $breakOnError }} else {{=$nextValid}} = true; {{?}} + } + + {{# def.ifResultValid }} + {{?}} {{ /* def.nonEmptySchema */ }} + {{~}} +{{?}} + + +{{? $breakOnError }} + {{= $closingBraces }} + if ({{=$errs}} == errors) { +{{?}} diff --git a/packages/字体精简工具/node_modules/ajv/lib/dot/propertyNames.jst b/packages/字体精简工具/node_modules/ajv/lib/dot/propertyNames.jst new file mode 100644 index 0000000..d456cca --- /dev/null +++ b/packages/字体精简工具/node_modules/ajv/lib/dot/propertyNames.jst @@ -0,0 +1,52 @@ +{{# def.definitions }} +{{# def.errors }} +{{# def.setupKeyword }} +{{# def.setupNextLevel }} + +var {{=$errs}} = errors; + +{{? {{# def.nonEmptySchema:$schema }} }} + {{ + $it.schema = $schema; + $it.schemaPath = $schemaPath; + $it.errSchemaPath = $errSchemaPath; + }} + + {{ + var $key = 'key' + $lvl + , $idx = 'idx' + $lvl + , $i = 'i' + $lvl + , $invalidName = '\' + ' + $key + ' + \'' + , $dataNxt = $it.dataLevel = it.dataLevel + 1 + , $nextData = 'data' + $dataNxt + , $dataProperties = 'dataProperties' + $lvl + , $ownProperties = it.opts.ownProperties + , $currentBaseId = it.baseId; + }} + + {{? $ownProperties }} + var {{=$dataProperties}} = undefined; + {{?}} + {{# def.iterateProperties }} + var startErrs{{=$lvl}} = errors; + + {{ var $passData = $key; }} + {{# def.setCompositeRule }} + {{# def.generateSubschemaCode }} + {{# def.optimizeValidate }} + {{# def.resetCompositeRule }} + + if (!{{=$nextValid}}) { + for (var {{=$i}}=startErrs{{=$lvl}}; {{=$i}}= it.opts.loopRequired + , $ownProperties = it.opts.ownProperties; + }} + + {{? $breakOnError }} + var missing{{=$lvl}}; + {{? $loopRequired }} + {{# def.setupLoop }} + var {{=$valid}} = true; + + {{?$isData}}{{# def.check$dataIsArray }}{{?}} + + for (var {{=$i}} = 0; {{=$i}} < {{=$vSchema}}.length; {{=$i}}++) { + {{=$valid}} = {{=$data}}[{{=$vSchema}}[{{=$i}}]] !== undefined + {{? $ownProperties }} + && {{# def.isRequiredOwnProperty }} + {{?}}; + if (!{{=$valid}}) break; + } + + {{? $isData }} } {{?}} + + {{# def.checkError:'required' }} + else { + {{??}} + if ({{# def.checkMissingProperty:$required }}) { + {{# def.errorMissingProperty:'required' }} + } else { + {{?}} + {{??}} + {{? $loopRequired }} + {{# def.setupLoop }} + {{? $isData }} + if ({{=$vSchema}} && !Array.isArray({{=$vSchema}})) { + {{# def.addError:'required' }} + } else if ({{=$vSchema}} !== undefined) { + {{?}} + + for (var {{=$i}} = 0; {{=$i}} < {{=$vSchema}}.length; {{=$i}}++) { + if ({{=$data}}[{{=$vSchema}}[{{=$i}}]] === undefined + {{? $ownProperties }} + || !{{# def.isRequiredOwnProperty }} + {{?}}) { + {{# def.addError:'required' }} + } + } + + {{? $isData }} } {{?}} + {{??}} + {{~ $required:$propertyKey }} + {{# def.allErrorsMissingProperty:'required' }} + {{~}} + {{?}} + {{?}} + + {{ it.errorPath = $currentErrorPath; }} + +{{?? $breakOnError }} + if (true) { +{{?}} diff --git a/packages/字体精简工具/node_modules/ajv/lib/dot/uniqueItems.jst b/packages/字体精简工具/node_modules/ajv/lib/dot/uniqueItems.jst new file mode 100644 index 0000000..e69b830 --- /dev/null +++ b/packages/字体精简工具/node_modules/ajv/lib/dot/uniqueItems.jst @@ -0,0 +1,62 @@ +{{# def.definitions }} +{{# def.errors }} +{{# def.setupKeyword }} +{{# def.$data }} + + +{{? ($schema || $isData) && it.opts.uniqueItems !== false }} + {{? $isData }} + var {{=$valid}}; + if ({{=$schemaValue}} === false || {{=$schemaValue}} === undefined) + {{=$valid}} = true; + else if (typeof {{=$schemaValue}} != 'boolean') + {{=$valid}} = false; + else { + {{?}} + + var i = {{=$data}}.length + , {{=$valid}} = true + , j; + if (i > 1) { + {{ + var $itemType = it.schema.items && it.schema.items.type + , $typeIsArray = Array.isArray($itemType); + }} + {{? !$itemType || $itemType == 'object' || $itemType == 'array' || + ($typeIsArray && ($itemType.indexOf('object') >= 0 || $itemType.indexOf('array') >= 0)) }} + outer: + for (;i--;) { + for (j = i; j--;) { + if (equal({{=$data}}[i], {{=$data}}[j])) { + {{=$valid}} = false; + break outer; + } + } + } + {{??}} + var itemIndices = {}, item; + for (;i--;) { + var item = {{=$data}}[i]; + {{ var $method = 'checkDataType' + ($typeIsArray ? 's' : ''); }} + if ({{= it.util[$method]($itemType, 'item', it.opts.strictNumbers, true) }}) continue; + {{? $typeIsArray}} + if (typeof item == 'string') item = '"' + item; + {{?}} + if (typeof itemIndices[item] == 'number') { + {{=$valid}} = false; + j = itemIndices[item]; + break; + } + itemIndices[item] = i; + } + {{?}} + } + + {{? $isData }} } {{?}} + + if (!{{=$valid}}) { + {{# def.error:'uniqueItems' }} + } {{? $breakOnError }} else { {{?}} +{{??}} + {{? $breakOnError }} if (true) { {{?}} +{{?}} diff --git a/packages/字体精简工具/node_modules/ajv/lib/dot/validate.jst b/packages/字体精简工具/node_modules/ajv/lib/dot/validate.jst new file mode 100644 index 0000000..32087e7 --- /dev/null +++ b/packages/字体精简工具/node_modules/ajv/lib/dot/validate.jst @@ -0,0 +1,276 @@ +{{# def.definitions }} +{{# def.errors }} +{{# def.defaults }} +{{# def.coerce }} + +{{ /** + * schema compilation (render) time: + * it = { schema, RULES, _validate, opts } + * it.validate - this template function, + * it is used recursively to generate code for subschemas + * + * runtime: + * "validate" is a variable name to which this function will be assigned + * validateRef etc. are defined in the parent scope in index.js + */ }} + +{{ + var $async = it.schema.$async === true + , $refKeywords = it.util.schemaHasRulesExcept(it.schema, it.RULES.all, '$ref') + , $id = it.self._getId(it.schema); +}} + +{{ + if (it.opts.strictKeywords) { + var $unknownKwd = it.util.schemaUnknownRules(it.schema, it.RULES.keywords); + if ($unknownKwd) { + var $keywordsMsg = 'unknown keyword: ' + $unknownKwd; + if (it.opts.strictKeywords === 'log') it.logger.warn($keywordsMsg); + else throw new Error($keywordsMsg); + } + } +}} + +{{? it.isTop }} + var validate = {{?$async}}{{it.async = true;}}async {{?}}function(data, dataPath, parentData, parentDataProperty, rootData) { + 'use strict'; + {{? $id && (it.opts.sourceCode || it.opts.processCode) }} + {{= '/\*# sourceURL=' + $id + ' */' }} + {{?}} +{{?}} + +{{? typeof it.schema == 'boolean' || !($refKeywords || it.schema.$ref) }} + {{ var $keyword = 'false schema'; }} + {{# def.setupKeyword }} + {{? it.schema === false}} + {{? it.isTop}} + {{ $breakOnError = true; }} + {{??}} + var {{=$valid}} = false; + {{?}} + {{# def.error:'false schema' }} + {{??}} + {{? it.isTop}} + {{? $async }} + return data; + {{??}} + validate.errors = null; + return true; + {{?}} + {{??}} + var {{=$valid}} = true; + {{?}} + {{?}} + + {{? it.isTop}} + }; + return validate; + {{?}} + + {{ return out; }} +{{?}} + + +{{? it.isTop }} + {{ + var $top = it.isTop + , $lvl = it.level = 0 + , $dataLvl = it.dataLevel = 0 + , $data = 'data'; + it.rootId = it.resolve.fullPath(it.self._getId(it.root.schema)); + it.baseId = it.baseId || it.rootId; + delete it.isTop; + + it.dataPathArr = [""]; + + if (it.schema.default !== undefined && it.opts.useDefaults && it.opts.strictDefaults) { + var $defaultMsg = 'default is ignored in the schema root'; + if (it.opts.strictDefaults === 'log') it.logger.warn($defaultMsg); + else throw new Error($defaultMsg); + } + }} + + var vErrors = null; {{ /* don't edit, used in replace */ }} + var errors = 0; {{ /* don't edit, used in replace */ }} + if (rootData === undefined) rootData = data; {{ /* don't edit, used in replace */ }} +{{??}} + {{ + var $lvl = it.level + , $dataLvl = it.dataLevel + , $data = 'data' + ($dataLvl || ''); + + if ($id) it.baseId = it.resolve.url(it.baseId, $id); + + if ($async && !it.async) throw new Error('async schema in sync schema'); + }} + + var errs_{{=$lvl}} = errors; +{{?}} + +{{ + var $valid = 'valid' + $lvl + , $breakOnError = !it.opts.allErrors + , $closingBraces1 = '' + , $closingBraces2 = ''; + + var $errorKeyword; + var $typeSchema = it.schema.type + , $typeIsArray = Array.isArray($typeSchema); + + if ($typeSchema && it.opts.nullable && it.schema.nullable === true) { + if ($typeIsArray) { + if ($typeSchema.indexOf('null') == -1) + $typeSchema = $typeSchema.concat('null'); + } else if ($typeSchema != 'null') { + $typeSchema = [$typeSchema, 'null']; + $typeIsArray = true; + } + } + + if ($typeIsArray && $typeSchema.length == 1) { + $typeSchema = $typeSchema[0]; + $typeIsArray = false; + } +}} + +{{## def.checkType: + {{ + var $schemaPath = it.schemaPath + '.type' + , $errSchemaPath = it.errSchemaPath + '/type' + , $method = $typeIsArray ? 'checkDataTypes' : 'checkDataType'; + }} + + if ({{= it.util[$method]($typeSchema, $data, it.opts.strictNumbers, true) }}) { +#}} + +{{? it.schema.$ref && $refKeywords }} + {{? it.opts.extendRefs == 'fail' }} + {{ throw new Error('$ref: validation keywords used in schema at path "' + it.errSchemaPath + '" (see option extendRefs)'); }} + {{?? it.opts.extendRefs !== true }} + {{ + $refKeywords = false; + it.logger.warn('$ref: keywords ignored in schema at path "' + it.errSchemaPath + '"'); + }} + {{?}} +{{?}} + +{{? it.schema.$comment && it.opts.$comment }} + {{= it.RULES.all.$comment.code(it, '$comment') }} +{{?}} + +{{? $typeSchema }} + {{? it.opts.coerceTypes }} + {{ var $coerceToTypes = it.util.coerceToTypes(it.opts.coerceTypes, $typeSchema); }} + {{?}} + + {{ var $rulesGroup = it.RULES.types[$typeSchema]; }} + {{? $coerceToTypes || $typeIsArray || $rulesGroup === true || + ($rulesGroup && !$shouldUseGroup($rulesGroup)) }} + {{ + var $schemaPath = it.schemaPath + '.type' + , $errSchemaPath = it.errSchemaPath + '/type'; + }} + {{# def.checkType }} + {{? $coerceToTypes }} + {{# def.coerceType }} + {{??}} + {{# def.error:'type' }} + {{?}} + } + {{?}} +{{?}} + + +{{? it.schema.$ref && !$refKeywords }} + {{= it.RULES.all.$ref.code(it, '$ref') }} + {{? $breakOnError }} + } + if (errors === {{?$top}}0{{??}}errs_{{=$lvl}}{{?}}) { + {{ $closingBraces2 += '}'; }} + {{?}} +{{??}} + {{~ it.RULES:$rulesGroup }} + {{? $shouldUseGroup($rulesGroup) }} + {{? $rulesGroup.type }} + if ({{= it.util.checkDataType($rulesGroup.type, $data, it.opts.strictNumbers) }}) { + {{?}} + {{? it.opts.useDefaults }} + {{? $rulesGroup.type == 'object' && it.schema.properties }} + {{# def.defaultProperties }} + {{?? $rulesGroup.type == 'array' && Array.isArray(it.schema.items) }} + {{# def.defaultItems }} + {{?}} + {{?}} + {{~ $rulesGroup.rules:$rule }} + {{? $shouldUseRule($rule) }} + {{ var $code = $rule.code(it, $rule.keyword, $rulesGroup.type); }} + {{? $code }} + {{= $code }} + {{? $breakOnError }} + {{ $closingBraces1 += '}'; }} + {{?}} + {{?}} + {{?}} + {{~}} + {{? $breakOnError }} + {{= $closingBraces1 }} + {{ $closingBraces1 = ''; }} + {{?}} + {{? $rulesGroup.type }} + } + {{? $typeSchema && $typeSchema === $rulesGroup.type && !$coerceToTypes }} + else { + {{ + var $schemaPath = it.schemaPath + '.type' + , $errSchemaPath = it.errSchemaPath + '/type'; + }} + {{# def.error:'type' }} + } + {{?}} + {{?}} + + {{? $breakOnError }} + if (errors === {{?$top}}0{{??}}errs_{{=$lvl}}{{?}}) { + {{ $closingBraces2 += '}'; }} + {{?}} + {{?}} + {{~}} +{{?}} + +{{? $breakOnError }} {{= $closingBraces2 }} {{?}} + +{{? $top }} + {{? $async }} + if (errors === 0) return data; {{ /* don't edit, used in replace */ }} + else throw new ValidationError(vErrors); {{ /* don't edit, used in replace */ }} + {{??}} + validate.errors = vErrors; {{ /* don't edit, used in replace */ }} + return errors === 0; {{ /* don't edit, used in replace */ }} + {{?}} + }; + + return validate; +{{??}} + var {{=$valid}} = errors === errs_{{=$lvl}}; +{{?}} + +{{ + function $shouldUseGroup($rulesGroup) { + var rules = $rulesGroup.rules; + for (var i=0; i < rules.length; i++) + if ($shouldUseRule(rules[i])) + return true; + } + + function $shouldUseRule($rule) { + return it.schema[$rule.keyword] !== undefined || + ($rule.implements && $ruleImplementsSomeKeyword($rule)); + } + + function $ruleImplementsSomeKeyword($rule) { + var impl = $rule.implements; + for (var i=0; i < impl.length; i++) + if (it.schema[impl[i]] !== undefined) + return true; + } +}} diff --git a/packages/字体精简工具/node_modules/ajv/lib/dotjs/README.md b/packages/字体精简工具/node_modules/ajv/lib/dotjs/README.md new file mode 100644 index 0000000..4d99484 --- /dev/null +++ b/packages/字体精简工具/node_modules/ajv/lib/dotjs/README.md @@ -0,0 +1,3 @@ +These files are compiled dot templates from dot folder. + +Do NOT edit them directly, edit the templates and run `npm run build` from main ajv folder. diff --git a/packages/字体精简工具/node_modules/ajv/lib/dotjs/_limit.js b/packages/字体精简工具/node_modules/ajv/lib/dotjs/_limit.js new file mode 100644 index 0000000..05a1979 --- /dev/null +++ b/packages/字体精简工具/node_modules/ajv/lib/dotjs/_limit.js @@ -0,0 +1,163 @@ +'use strict'; +module.exports = function generate__limit(it, $keyword, $ruleType) { + var out = ' '; + var $lvl = it.level; + var $dataLvl = it.dataLevel; + var $schema = it.schema[$keyword]; + var $schemaPath = it.schemaPath + it.util.getProperty($keyword); + var $errSchemaPath = it.errSchemaPath + '/' + $keyword; + var $breakOnError = !it.opts.allErrors; + var $errorKeyword; + var $data = 'data' + ($dataLvl || ''); + var $isData = it.opts.$data && $schema && $schema.$data, + $schemaValue; + if ($isData) { + out += ' var schema' + ($lvl) + ' = ' + (it.util.getData($schema.$data, $dataLvl, it.dataPathArr)) + '; '; + $schemaValue = 'schema' + $lvl; + } else { + $schemaValue = $schema; + } + var $isMax = $keyword == 'maximum', + $exclusiveKeyword = $isMax ? 'exclusiveMaximum' : 'exclusiveMinimum', + $schemaExcl = it.schema[$exclusiveKeyword], + $isDataExcl = it.opts.$data && $schemaExcl && $schemaExcl.$data, + $op = $isMax ? '<' : '>', + $notOp = $isMax ? '>' : '<', + $errorKeyword = undefined; + if (!($isData || typeof $schema == 'number' || $schema === undefined)) { + throw new Error($keyword + ' must be number'); + } + if (!($isDataExcl || $schemaExcl === undefined || typeof $schemaExcl == 'number' || typeof $schemaExcl == 'boolean')) { + throw new Error($exclusiveKeyword + ' must be number or boolean'); + } + if ($isDataExcl) { + var $schemaValueExcl = it.util.getData($schemaExcl.$data, $dataLvl, it.dataPathArr), + $exclusive = 'exclusive' + $lvl, + $exclType = 'exclType' + $lvl, + $exclIsNumber = 'exclIsNumber' + $lvl, + $opExpr = 'op' + $lvl, + $opStr = '\' + ' + $opExpr + ' + \''; + out += ' var schemaExcl' + ($lvl) + ' = ' + ($schemaValueExcl) + '; '; + $schemaValueExcl = 'schemaExcl' + $lvl; + out += ' var ' + ($exclusive) + '; var ' + ($exclType) + ' = typeof ' + ($schemaValueExcl) + '; if (' + ($exclType) + ' != \'boolean\' && ' + ($exclType) + ' != \'undefined\' && ' + ($exclType) + ' != \'number\') { '; + var $errorKeyword = $exclusiveKeyword; + var $$outStack = $$outStack || []; + $$outStack.push(out); + out = ''; /* istanbul ignore else */ + if (it.createErrors !== false) { + out += ' { keyword: \'' + ($errorKeyword || '_exclusiveLimit') + '\' , dataPath: (dataPath || \'\') + ' + (it.errorPath) + ' , schemaPath: ' + (it.util.toQuotedString($errSchemaPath)) + ' , params: {} '; + if (it.opts.messages !== false) { + out += ' , message: \'' + ($exclusiveKeyword) + ' should be boolean\' '; + } + if (it.opts.verbose) { + out += ' , schema: validate.schema' + ($schemaPath) + ' , parentSchema: validate.schema' + (it.schemaPath) + ' , data: ' + ($data) + ' '; + } + out += ' } '; + } else { + out += ' {} '; + } + var __err = out; + out = $$outStack.pop(); + if (!it.compositeRule && $breakOnError) { + /* istanbul ignore if */ + if (it.async) { + out += ' throw new ValidationError([' + (__err) + ']); '; + } else { + out += ' validate.errors = [' + (__err) + ']; return false; '; + } + } else { + out += ' var err = ' + (__err) + '; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; '; + } + out += ' } else if ( '; + if ($isData) { + out += ' (' + ($schemaValue) + ' !== undefined && typeof ' + ($schemaValue) + ' != \'number\') || '; + } + out += ' ' + ($exclType) + ' == \'number\' ? ( (' + ($exclusive) + ' = ' + ($schemaValue) + ' === undefined || ' + ($schemaValueExcl) + ' ' + ($op) + '= ' + ($schemaValue) + ') ? ' + ($data) + ' ' + ($notOp) + '= ' + ($schemaValueExcl) + ' : ' + ($data) + ' ' + ($notOp) + ' ' + ($schemaValue) + ' ) : ( (' + ($exclusive) + ' = ' + ($schemaValueExcl) + ' === true) ? ' + ($data) + ' ' + ($notOp) + '= ' + ($schemaValue) + ' : ' + ($data) + ' ' + ($notOp) + ' ' + ($schemaValue) + ' ) || ' + ($data) + ' !== ' + ($data) + ') { var op' + ($lvl) + ' = ' + ($exclusive) + ' ? \'' + ($op) + '\' : \'' + ($op) + '=\'; '; + if ($schema === undefined) { + $errorKeyword = $exclusiveKeyword; + $errSchemaPath = it.errSchemaPath + '/' + $exclusiveKeyword; + $schemaValue = $schemaValueExcl; + $isData = $isDataExcl; + } + } else { + var $exclIsNumber = typeof $schemaExcl == 'number', + $opStr = $op; + if ($exclIsNumber && $isData) { + var $opExpr = '\'' + $opStr + '\''; + out += ' if ( '; + if ($isData) { + out += ' (' + ($schemaValue) + ' !== undefined && typeof ' + ($schemaValue) + ' != \'number\') || '; + } + out += ' ( ' + ($schemaValue) + ' === undefined || ' + ($schemaExcl) + ' ' + ($op) + '= ' + ($schemaValue) + ' ? ' + ($data) + ' ' + ($notOp) + '= ' + ($schemaExcl) + ' : ' + ($data) + ' ' + ($notOp) + ' ' + ($schemaValue) + ' ) || ' + ($data) + ' !== ' + ($data) + ') { '; + } else { + if ($exclIsNumber && $schema === undefined) { + $exclusive = true; + $errorKeyword = $exclusiveKeyword; + $errSchemaPath = it.errSchemaPath + '/' + $exclusiveKeyword; + $schemaValue = $schemaExcl; + $notOp += '='; + } else { + if ($exclIsNumber) $schemaValue = Math[$isMax ? 'min' : 'max']($schemaExcl, $schema); + if ($schemaExcl === ($exclIsNumber ? $schemaValue : true)) { + $exclusive = true; + $errorKeyword = $exclusiveKeyword; + $errSchemaPath = it.errSchemaPath + '/' + $exclusiveKeyword; + $notOp += '='; + } else { + $exclusive = false; + $opStr += '='; + } + } + var $opExpr = '\'' + $opStr + '\''; + out += ' if ( '; + if ($isData) { + out += ' (' + ($schemaValue) + ' !== undefined && typeof ' + ($schemaValue) + ' != \'number\') || '; + } + out += ' ' + ($data) + ' ' + ($notOp) + ' ' + ($schemaValue) + ' || ' + ($data) + ' !== ' + ($data) + ') { '; + } + } + $errorKeyword = $errorKeyword || $keyword; + var $$outStack = $$outStack || []; + $$outStack.push(out); + out = ''; /* istanbul ignore else */ + if (it.createErrors !== false) { + out += ' { keyword: \'' + ($errorKeyword || '_limit') + '\' , dataPath: (dataPath || \'\') + ' + (it.errorPath) + ' , schemaPath: ' + (it.util.toQuotedString($errSchemaPath)) + ' , params: { comparison: ' + ($opExpr) + ', limit: ' + ($schemaValue) + ', exclusive: ' + ($exclusive) + ' } '; + if (it.opts.messages !== false) { + out += ' , message: \'should be ' + ($opStr) + ' '; + if ($isData) { + out += '\' + ' + ($schemaValue); + } else { + out += '' + ($schemaValue) + '\''; + } + } + if (it.opts.verbose) { + out += ' , schema: '; + if ($isData) { + out += 'validate.schema' + ($schemaPath); + } else { + out += '' + ($schema); + } + out += ' , parentSchema: validate.schema' + (it.schemaPath) + ' , data: ' + ($data) + ' '; + } + out += ' } '; + } else { + out += ' {} '; + } + var __err = out; + out = $$outStack.pop(); + if (!it.compositeRule && $breakOnError) { + /* istanbul ignore if */ + if (it.async) { + out += ' throw new ValidationError([' + (__err) + ']); '; + } else { + out += ' validate.errors = [' + (__err) + ']; return false; '; + } + } else { + out += ' var err = ' + (__err) + '; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; '; + } + out += ' } '; + if ($breakOnError) { + out += ' else { '; + } + return out; +} diff --git a/packages/字体精简工具/node_modules/ajv/lib/dotjs/_limitItems.js b/packages/字体精简工具/node_modules/ajv/lib/dotjs/_limitItems.js new file mode 100644 index 0000000..e092a55 --- /dev/null +++ b/packages/字体精简工具/node_modules/ajv/lib/dotjs/_limitItems.js @@ -0,0 +1,80 @@ +'use strict'; +module.exports = function generate__limitItems(it, $keyword, $ruleType) { + var out = ' '; + var $lvl = it.level; + var $dataLvl = it.dataLevel; + var $schema = it.schema[$keyword]; + var $schemaPath = it.schemaPath + it.util.getProperty($keyword); + var $errSchemaPath = it.errSchemaPath + '/' + $keyword; + var $breakOnError = !it.opts.allErrors; + var $errorKeyword; + var $data = 'data' + ($dataLvl || ''); + var $isData = it.opts.$data && $schema && $schema.$data, + $schemaValue; + if ($isData) { + out += ' var schema' + ($lvl) + ' = ' + (it.util.getData($schema.$data, $dataLvl, it.dataPathArr)) + '; '; + $schemaValue = 'schema' + $lvl; + } else { + $schemaValue = $schema; + } + if (!($isData || typeof $schema == 'number')) { + throw new Error($keyword + ' must be number'); + } + var $op = $keyword == 'maxItems' ? '>' : '<'; + out += 'if ( '; + if ($isData) { + out += ' (' + ($schemaValue) + ' !== undefined && typeof ' + ($schemaValue) + ' != \'number\') || '; + } + out += ' ' + ($data) + '.length ' + ($op) + ' ' + ($schemaValue) + ') { '; + var $errorKeyword = $keyword; + var $$outStack = $$outStack || []; + $$outStack.push(out); + out = ''; /* istanbul ignore else */ + if (it.createErrors !== false) { + out += ' { keyword: \'' + ($errorKeyword || '_limitItems') + '\' , dataPath: (dataPath || \'\') + ' + (it.errorPath) + ' , schemaPath: ' + (it.util.toQuotedString($errSchemaPath)) + ' , params: { limit: ' + ($schemaValue) + ' } '; + if (it.opts.messages !== false) { + out += ' , message: \'should NOT have '; + if ($keyword == 'maxItems') { + out += 'more'; + } else { + out += 'fewer'; + } + out += ' than '; + if ($isData) { + out += '\' + ' + ($schemaValue) + ' + \''; + } else { + out += '' + ($schema); + } + out += ' items\' '; + } + if (it.opts.verbose) { + out += ' , schema: '; + if ($isData) { + out += 'validate.schema' + ($schemaPath); + } else { + out += '' + ($schema); + } + out += ' , parentSchema: validate.schema' + (it.schemaPath) + ' , data: ' + ($data) + ' '; + } + out += ' } '; + } else { + out += ' {} '; + } + var __err = out; + out = $$outStack.pop(); + if (!it.compositeRule && $breakOnError) { + /* istanbul ignore if */ + if (it.async) { + out += ' throw new ValidationError([' + (__err) + ']); '; + } else { + out += ' validate.errors = [' + (__err) + ']; return false; '; + } + } else { + out += ' var err = ' + (__err) + '; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; '; + } + out += '} '; + if ($breakOnError) { + out += ' else { '; + } + return out; +} diff --git a/packages/字体精简工具/node_modules/ajv/lib/dotjs/_limitLength.js b/packages/字体精简工具/node_modules/ajv/lib/dotjs/_limitLength.js new file mode 100644 index 0000000..ecbd3fe --- /dev/null +++ b/packages/字体精简工具/node_modules/ajv/lib/dotjs/_limitLength.js @@ -0,0 +1,85 @@ +'use strict'; +module.exports = function generate__limitLength(it, $keyword, $ruleType) { + var out = ' '; + var $lvl = it.level; + var $dataLvl = it.dataLevel; + var $schema = it.schema[$keyword]; + var $schemaPath = it.schemaPath + it.util.getProperty($keyword); + var $errSchemaPath = it.errSchemaPath + '/' + $keyword; + var $breakOnError = !it.opts.allErrors; + var $errorKeyword; + var $data = 'data' + ($dataLvl || ''); + var $isData = it.opts.$data && $schema && $schema.$data, + $schemaValue; + if ($isData) { + out += ' var schema' + ($lvl) + ' = ' + (it.util.getData($schema.$data, $dataLvl, it.dataPathArr)) + '; '; + $schemaValue = 'schema' + $lvl; + } else { + $schemaValue = $schema; + } + if (!($isData || typeof $schema == 'number')) { + throw new Error($keyword + ' must be number'); + } + var $op = $keyword == 'maxLength' ? '>' : '<'; + out += 'if ( '; + if ($isData) { + out += ' (' + ($schemaValue) + ' !== undefined && typeof ' + ($schemaValue) + ' != \'number\') || '; + } + if (it.opts.unicode === false) { + out += ' ' + ($data) + '.length '; + } else { + out += ' ucs2length(' + ($data) + ') '; + } + out += ' ' + ($op) + ' ' + ($schemaValue) + ') { '; + var $errorKeyword = $keyword; + var $$outStack = $$outStack || []; + $$outStack.push(out); + out = ''; /* istanbul ignore else */ + if (it.createErrors !== false) { + out += ' { keyword: \'' + ($errorKeyword || '_limitLength') + '\' , dataPath: (dataPath || \'\') + ' + (it.errorPath) + ' , schemaPath: ' + (it.util.toQuotedString($errSchemaPath)) + ' , params: { limit: ' + ($schemaValue) + ' } '; + if (it.opts.messages !== false) { + out += ' , message: \'should NOT be '; + if ($keyword == 'maxLength') { + out += 'longer'; + } else { + out += 'shorter'; + } + out += ' than '; + if ($isData) { + out += '\' + ' + ($schemaValue) + ' + \''; + } else { + out += '' + ($schema); + } + out += ' characters\' '; + } + if (it.opts.verbose) { + out += ' , schema: '; + if ($isData) { + out += 'validate.schema' + ($schemaPath); + } else { + out += '' + ($schema); + } + out += ' , parentSchema: validate.schema' + (it.schemaPath) + ' , data: ' + ($data) + ' '; + } + out += ' } '; + } else { + out += ' {} '; + } + var __err = out; + out = $$outStack.pop(); + if (!it.compositeRule && $breakOnError) { + /* istanbul ignore if */ + if (it.async) { + out += ' throw new ValidationError([' + (__err) + ']); '; + } else { + out += ' validate.errors = [' + (__err) + ']; return false; '; + } + } else { + out += ' var err = ' + (__err) + '; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; '; + } + out += '} '; + if ($breakOnError) { + out += ' else { '; + } + return out; +} diff --git a/packages/字体精简工具/node_modules/ajv/lib/dotjs/_limitProperties.js b/packages/字体精简工具/node_modules/ajv/lib/dotjs/_limitProperties.js new file mode 100644 index 0000000..d232755 --- /dev/null +++ b/packages/字体精简工具/node_modules/ajv/lib/dotjs/_limitProperties.js @@ -0,0 +1,80 @@ +'use strict'; +module.exports = function generate__limitProperties(it, $keyword, $ruleType) { + var out = ' '; + var $lvl = it.level; + var $dataLvl = it.dataLevel; + var $schema = it.schema[$keyword]; + var $schemaPath = it.schemaPath + it.util.getProperty($keyword); + var $errSchemaPath = it.errSchemaPath + '/' + $keyword; + var $breakOnError = !it.opts.allErrors; + var $errorKeyword; + var $data = 'data' + ($dataLvl || ''); + var $isData = it.opts.$data && $schema && $schema.$data, + $schemaValue; + if ($isData) { + out += ' var schema' + ($lvl) + ' = ' + (it.util.getData($schema.$data, $dataLvl, it.dataPathArr)) + '; '; + $schemaValue = 'schema' + $lvl; + } else { + $schemaValue = $schema; + } + if (!($isData || typeof $schema == 'number')) { + throw new Error($keyword + ' must be number'); + } + var $op = $keyword == 'maxProperties' ? '>' : '<'; + out += 'if ( '; + if ($isData) { + out += ' (' + ($schemaValue) + ' !== undefined && typeof ' + ($schemaValue) + ' != \'number\') || '; + } + out += ' Object.keys(' + ($data) + ').length ' + ($op) + ' ' + ($schemaValue) + ') { '; + var $errorKeyword = $keyword; + var $$outStack = $$outStack || []; + $$outStack.push(out); + out = ''; /* istanbul ignore else */ + if (it.createErrors !== false) { + out += ' { keyword: \'' + ($errorKeyword || '_limitProperties') + '\' , dataPath: (dataPath || \'\') + ' + (it.errorPath) + ' , schemaPath: ' + (it.util.toQuotedString($errSchemaPath)) + ' , params: { limit: ' + ($schemaValue) + ' } '; + if (it.opts.messages !== false) { + out += ' , message: \'should NOT have '; + if ($keyword == 'maxProperties') { + out += 'more'; + } else { + out += 'fewer'; + } + out += ' than '; + if ($isData) { + out += '\' + ' + ($schemaValue) + ' + \''; + } else { + out += '' + ($schema); + } + out += ' properties\' '; + } + if (it.opts.verbose) { + out += ' , schema: '; + if ($isData) { + out += 'validate.schema' + ($schemaPath); + } else { + out += '' + ($schema); + } + out += ' , parentSchema: validate.schema' + (it.schemaPath) + ' , data: ' + ($data) + ' '; + } + out += ' } '; + } else { + out += ' {} '; + } + var __err = out; + out = $$outStack.pop(); + if (!it.compositeRule && $breakOnError) { + /* istanbul ignore if */ + if (it.async) { + out += ' throw new ValidationError([' + (__err) + ']); '; + } else { + out += ' validate.errors = [' + (__err) + ']; return false; '; + } + } else { + out += ' var err = ' + (__err) + '; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; '; + } + out += '} '; + if ($breakOnError) { + out += ' else { '; + } + return out; +} diff --git a/packages/字体精简工具/node_modules/ajv/lib/dotjs/allOf.js b/packages/字体精简工具/node_modules/ajv/lib/dotjs/allOf.js new file mode 100644 index 0000000..fb8c2e4 --- /dev/null +++ b/packages/字体精简工具/node_modules/ajv/lib/dotjs/allOf.js @@ -0,0 +1,42 @@ +'use strict'; +module.exports = function generate_allOf(it, $keyword, $ruleType) { + var out = ' '; + var $schema = it.schema[$keyword]; + var $schemaPath = it.schemaPath + it.util.getProperty($keyword); + var $errSchemaPath = it.errSchemaPath + '/' + $keyword; + var $breakOnError = !it.opts.allErrors; + var $it = it.util.copy(it); + var $closingBraces = ''; + $it.level++; + var $nextValid = 'valid' + $it.level; + var $currentBaseId = $it.baseId, + $allSchemasEmpty = true; + var arr1 = $schema; + if (arr1) { + var $sch, $i = -1, + l1 = arr1.length - 1; + while ($i < l1) { + $sch = arr1[$i += 1]; + if ((it.opts.strictKeywords ? (typeof $sch == 'object' && Object.keys($sch).length > 0) || $sch === false : it.util.schemaHasRules($sch, it.RULES.all))) { + $allSchemasEmpty = false; + $it.schema = $sch; + $it.schemaPath = $schemaPath + '[' + $i + ']'; + $it.errSchemaPath = $errSchemaPath + '/' + $i; + out += ' ' + (it.validate($it)) + ' '; + $it.baseId = $currentBaseId; + if ($breakOnError) { + out += ' if (' + ($nextValid) + ') { '; + $closingBraces += '}'; + } + } + } + } + if ($breakOnError) { + if ($allSchemasEmpty) { + out += ' if (true) { '; + } else { + out += ' ' + ($closingBraces.slice(0, -1)) + ' '; + } + } + return out; +} diff --git a/packages/字体精简工具/node_modules/ajv/lib/dotjs/anyOf.js b/packages/字体精简工具/node_modules/ajv/lib/dotjs/anyOf.js new file mode 100644 index 0000000..0600a9d --- /dev/null +++ b/packages/字体精简工具/node_modules/ajv/lib/dotjs/anyOf.js @@ -0,0 +1,73 @@ +'use strict'; +module.exports = function generate_anyOf(it, $keyword, $ruleType) { + var out = ' '; + var $lvl = it.level; + var $dataLvl = it.dataLevel; + var $schema = it.schema[$keyword]; + var $schemaPath = it.schemaPath + it.util.getProperty($keyword); + var $errSchemaPath = it.errSchemaPath + '/' + $keyword; + var $breakOnError = !it.opts.allErrors; + var $data = 'data' + ($dataLvl || ''); + var $valid = 'valid' + $lvl; + var $errs = 'errs__' + $lvl; + var $it = it.util.copy(it); + var $closingBraces = ''; + $it.level++; + var $nextValid = 'valid' + $it.level; + var $noEmptySchema = $schema.every(function($sch) { + return (it.opts.strictKeywords ? (typeof $sch == 'object' && Object.keys($sch).length > 0) || $sch === false : it.util.schemaHasRules($sch, it.RULES.all)); + }); + if ($noEmptySchema) { + var $currentBaseId = $it.baseId; + out += ' var ' + ($errs) + ' = errors; var ' + ($valid) + ' = false; '; + var $wasComposite = it.compositeRule; + it.compositeRule = $it.compositeRule = true; + var arr1 = $schema; + if (arr1) { + var $sch, $i = -1, + l1 = arr1.length - 1; + while ($i < l1) { + $sch = arr1[$i += 1]; + $it.schema = $sch; + $it.schemaPath = $schemaPath + '[' + $i + ']'; + $it.errSchemaPath = $errSchemaPath + '/' + $i; + out += ' ' + (it.validate($it)) + ' '; + $it.baseId = $currentBaseId; + out += ' ' + ($valid) + ' = ' + ($valid) + ' || ' + ($nextValid) + '; if (!' + ($valid) + ') { '; + $closingBraces += '}'; + } + } + it.compositeRule = $it.compositeRule = $wasComposite; + out += ' ' + ($closingBraces) + ' if (!' + ($valid) + ') { var err = '; /* istanbul ignore else */ + if (it.createErrors !== false) { + out += ' { keyword: \'' + ('anyOf') + '\' , dataPath: (dataPath || \'\') + ' + (it.errorPath) + ' , schemaPath: ' + (it.util.toQuotedString($errSchemaPath)) + ' , params: {} '; + if (it.opts.messages !== false) { + out += ' , message: \'should match some schema in anyOf\' '; + } + if (it.opts.verbose) { + out += ' , schema: validate.schema' + ($schemaPath) + ' , parentSchema: validate.schema' + (it.schemaPath) + ' , data: ' + ($data) + ' '; + } + out += ' } '; + } else { + out += ' {} '; + } + out += '; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; '; + if (!it.compositeRule && $breakOnError) { + /* istanbul ignore if */ + if (it.async) { + out += ' throw new ValidationError(vErrors); '; + } else { + out += ' validate.errors = vErrors; return false; '; + } + } + out += ' } else { errors = ' + ($errs) + '; if (vErrors !== null) { if (' + ($errs) + ') vErrors.length = ' + ($errs) + '; else vErrors = null; } '; + if (it.opts.allErrors) { + out += ' } '; + } + } else { + if ($breakOnError) { + out += ' if (true) { '; + } + } + return out; +} diff --git a/packages/字体精简工具/node_modules/ajv/lib/dotjs/comment.js b/packages/字体精简工具/node_modules/ajv/lib/dotjs/comment.js new file mode 100644 index 0000000..dd66bb8 --- /dev/null +++ b/packages/字体精简工具/node_modules/ajv/lib/dotjs/comment.js @@ -0,0 +1,14 @@ +'use strict'; +module.exports = function generate_comment(it, $keyword, $ruleType) { + var out = ' '; + var $schema = it.schema[$keyword]; + var $errSchemaPath = it.errSchemaPath + '/' + $keyword; + var $breakOnError = !it.opts.allErrors; + var $comment = it.util.toQuotedString($schema); + if (it.opts.$comment === true) { + out += ' console.log(' + ($comment) + ');'; + } else if (typeof it.opts.$comment == 'function') { + out += ' self._opts.$comment(' + ($comment) + ', ' + (it.util.toQuotedString($errSchemaPath)) + ', validate.root.schema);'; + } + return out; +} diff --git a/packages/字体精简工具/node_modules/ajv/lib/dotjs/const.js b/packages/字体精简工具/node_modules/ajv/lib/dotjs/const.js new file mode 100644 index 0000000..15b7c61 --- /dev/null +++ b/packages/字体精简工具/node_modules/ajv/lib/dotjs/const.js @@ -0,0 +1,56 @@ +'use strict'; +module.exports = function generate_const(it, $keyword, $ruleType) { + var out = ' '; + var $lvl = it.level; + var $dataLvl = it.dataLevel; + var $schema = it.schema[$keyword]; + var $schemaPath = it.schemaPath + it.util.getProperty($keyword); + var $errSchemaPath = it.errSchemaPath + '/' + $keyword; + var $breakOnError = !it.opts.allErrors; + var $data = 'data' + ($dataLvl || ''); + var $valid = 'valid' + $lvl; + var $isData = it.opts.$data && $schema && $schema.$data, + $schemaValue; + if ($isData) { + out += ' var schema' + ($lvl) + ' = ' + (it.util.getData($schema.$data, $dataLvl, it.dataPathArr)) + '; '; + $schemaValue = 'schema' + $lvl; + } else { + $schemaValue = $schema; + } + if (!$isData) { + out += ' var schema' + ($lvl) + ' = validate.schema' + ($schemaPath) + ';'; + } + out += 'var ' + ($valid) + ' = equal(' + ($data) + ', schema' + ($lvl) + '); if (!' + ($valid) + ') { '; + var $$outStack = $$outStack || []; + $$outStack.push(out); + out = ''; /* istanbul ignore else */ + if (it.createErrors !== false) { + out += ' { keyword: \'' + ('const') + '\' , dataPath: (dataPath || \'\') + ' + (it.errorPath) + ' , schemaPath: ' + (it.util.toQuotedString($errSchemaPath)) + ' , params: { allowedValue: schema' + ($lvl) + ' } '; + if (it.opts.messages !== false) { + out += ' , message: \'should be equal to constant\' '; + } + if (it.opts.verbose) { + out += ' , schema: validate.schema' + ($schemaPath) + ' , parentSchema: validate.schema' + (it.schemaPath) + ' , data: ' + ($data) + ' '; + } + out += ' } '; + } else { + out += ' {} '; + } + var __err = out; + out = $$outStack.pop(); + if (!it.compositeRule && $breakOnError) { + /* istanbul ignore if */ + if (it.async) { + out += ' throw new ValidationError([' + (__err) + ']); '; + } else { + out += ' validate.errors = [' + (__err) + ']; return false; '; + } + } else { + out += ' var err = ' + (__err) + '; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; '; + } + out += ' }'; + if ($breakOnError) { + out += ' else { '; + } + return out; +} diff --git a/packages/字体精简工具/node_modules/ajv/lib/dotjs/contains.js b/packages/字体精简工具/node_modules/ajv/lib/dotjs/contains.js new file mode 100644 index 0000000..7d76300 --- /dev/null +++ b/packages/字体精简工具/node_modules/ajv/lib/dotjs/contains.js @@ -0,0 +1,81 @@ +'use strict'; +module.exports = function generate_contains(it, $keyword, $ruleType) { + var out = ' '; + var $lvl = it.level; + var $dataLvl = it.dataLevel; + var $schema = it.schema[$keyword]; + var $schemaPath = it.schemaPath + it.util.getProperty($keyword); + var $errSchemaPath = it.errSchemaPath + '/' + $keyword; + var $breakOnError = !it.opts.allErrors; + var $data = 'data' + ($dataLvl || ''); + var $valid = 'valid' + $lvl; + var $errs = 'errs__' + $lvl; + var $it = it.util.copy(it); + var $closingBraces = ''; + $it.level++; + var $nextValid = 'valid' + $it.level; + var $idx = 'i' + $lvl, + $dataNxt = $it.dataLevel = it.dataLevel + 1, + $nextData = 'data' + $dataNxt, + $currentBaseId = it.baseId, + $nonEmptySchema = (it.opts.strictKeywords ? (typeof $schema == 'object' && Object.keys($schema).length > 0) || $schema === false : it.util.schemaHasRules($schema, it.RULES.all)); + out += 'var ' + ($errs) + ' = errors;var ' + ($valid) + ';'; + if ($nonEmptySchema) { + var $wasComposite = it.compositeRule; + it.compositeRule = $it.compositeRule = true; + $it.schema = $schema; + $it.schemaPath = $schemaPath; + $it.errSchemaPath = $errSchemaPath; + out += ' var ' + ($nextValid) + ' = false; for (var ' + ($idx) + ' = 0; ' + ($idx) + ' < ' + ($data) + '.length; ' + ($idx) + '++) { '; + $it.errorPath = it.util.getPathExpr(it.errorPath, $idx, it.opts.jsonPointers, true); + var $passData = $data + '[' + $idx + ']'; + $it.dataPathArr[$dataNxt] = $idx; + var $code = it.validate($it); + $it.baseId = $currentBaseId; + if (it.util.varOccurences($code, $nextData) < 2) { + out += ' ' + (it.util.varReplace($code, $nextData, $passData)) + ' '; + } else { + out += ' var ' + ($nextData) + ' = ' + ($passData) + '; ' + ($code) + ' '; + } + out += ' if (' + ($nextValid) + ') break; } '; + it.compositeRule = $it.compositeRule = $wasComposite; + out += ' ' + ($closingBraces) + ' if (!' + ($nextValid) + ') {'; + } else { + out += ' if (' + ($data) + '.length == 0) {'; + } + var $$outStack = $$outStack || []; + $$outStack.push(out); + out = ''; /* istanbul ignore else */ + if (it.createErrors !== false) { + out += ' { keyword: \'' + ('contains') + '\' , dataPath: (dataPath || \'\') + ' + (it.errorPath) + ' , schemaPath: ' + (it.util.toQuotedString($errSchemaPath)) + ' , params: {} '; + if (it.opts.messages !== false) { + out += ' , message: \'should contain a valid item\' '; + } + if (it.opts.verbose) { + out += ' , schema: validate.schema' + ($schemaPath) + ' , parentSchema: validate.schema' + (it.schemaPath) + ' , data: ' + ($data) + ' '; + } + out += ' } '; + } else { + out += ' {} '; + } + var __err = out; + out = $$outStack.pop(); + if (!it.compositeRule && $breakOnError) { + /* istanbul ignore if */ + if (it.async) { + out += ' throw new ValidationError([' + (__err) + ']); '; + } else { + out += ' validate.errors = [' + (__err) + ']; return false; '; + } + } else { + out += ' var err = ' + (__err) + '; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; '; + } + out += ' } else { '; + if ($nonEmptySchema) { + out += ' errors = ' + ($errs) + '; if (vErrors !== null) { if (' + ($errs) + ') vErrors.length = ' + ($errs) + '; else vErrors = null; } '; + } + if (it.opts.allErrors) { + out += ' } '; + } + return out; +} diff --git a/packages/字体精简工具/node_modules/ajv/lib/dotjs/custom.js b/packages/字体精简工具/node_modules/ajv/lib/dotjs/custom.js new file mode 100644 index 0000000..f3e641e --- /dev/null +++ b/packages/字体精简工具/node_modules/ajv/lib/dotjs/custom.js @@ -0,0 +1,228 @@ +'use strict'; +module.exports = function generate_custom(it, $keyword, $ruleType) { + var out = ' '; + var $lvl = it.level; + var $dataLvl = it.dataLevel; + var $schema = it.schema[$keyword]; + var $schemaPath = it.schemaPath + it.util.getProperty($keyword); + var $errSchemaPath = it.errSchemaPath + '/' + $keyword; + var $breakOnError = !it.opts.allErrors; + var $errorKeyword; + var $data = 'data' + ($dataLvl || ''); + var $valid = 'valid' + $lvl; + var $errs = 'errs__' + $lvl; + var $isData = it.opts.$data && $schema && $schema.$data, + $schemaValue; + if ($isData) { + out += ' var schema' + ($lvl) + ' = ' + (it.util.getData($schema.$data, $dataLvl, it.dataPathArr)) + '; '; + $schemaValue = 'schema' + $lvl; + } else { + $schemaValue = $schema; + } + var $rule = this, + $definition = 'definition' + $lvl, + $rDef = $rule.definition, + $closingBraces = ''; + var $compile, $inline, $macro, $ruleValidate, $validateCode; + if ($isData && $rDef.$data) { + $validateCode = 'keywordValidate' + $lvl; + var $validateSchema = $rDef.validateSchema; + out += ' var ' + ($definition) + ' = RULES.custom[\'' + ($keyword) + '\'].definition; var ' + ($validateCode) + ' = ' + ($definition) + '.validate;'; + } else { + $ruleValidate = it.useCustomRule($rule, $schema, it.schema, it); + if (!$ruleValidate) return; + $schemaValue = 'validate.schema' + $schemaPath; + $validateCode = $ruleValidate.code; + $compile = $rDef.compile; + $inline = $rDef.inline; + $macro = $rDef.macro; + } + var $ruleErrs = $validateCode + '.errors', + $i = 'i' + $lvl, + $ruleErr = 'ruleErr' + $lvl, + $asyncKeyword = $rDef.async; + if ($asyncKeyword && !it.async) throw new Error('async keyword in sync schema'); + if (!($inline || $macro)) { + out += '' + ($ruleErrs) + ' = null;'; + } + out += 'var ' + ($errs) + ' = errors;var ' + ($valid) + ';'; + if ($isData && $rDef.$data) { + $closingBraces += '}'; + out += ' if (' + ($schemaValue) + ' === undefined) { ' + ($valid) + ' = true; } else { '; + if ($validateSchema) { + $closingBraces += '}'; + out += ' ' + ($valid) + ' = ' + ($definition) + '.validateSchema(' + ($schemaValue) + '); if (' + ($valid) + ') { '; + } + } + if ($inline) { + if ($rDef.statements) { + out += ' ' + ($ruleValidate.validate) + ' '; + } else { + out += ' ' + ($valid) + ' = ' + ($ruleValidate.validate) + '; '; + } + } else if ($macro) { + var $it = it.util.copy(it); + var $closingBraces = ''; + $it.level++; + var $nextValid = 'valid' + $it.level; + $it.schema = $ruleValidate.validate; + $it.schemaPath = ''; + var $wasComposite = it.compositeRule; + it.compositeRule = $it.compositeRule = true; + var $code = it.validate($it).replace(/validate\.schema/g, $validateCode); + it.compositeRule = $it.compositeRule = $wasComposite; + out += ' ' + ($code); + } else { + var $$outStack = $$outStack || []; + $$outStack.push(out); + out = ''; + out += ' ' + ($validateCode) + '.call( '; + if (it.opts.passContext) { + out += 'this'; + } else { + out += 'self'; + } + if ($compile || $rDef.schema === false) { + out += ' , ' + ($data) + ' '; + } else { + out += ' , ' + ($schemaValue) + ' , ' + ($data) + ' , validate.schema' + (it.schemaPath) + ' '; + } + out += ' , (dataPath || \'\')'; + if (it.errorPath != '""') { + out += ' + ' + (it.errorPath); + } + var $parentData = $dataLvl ? 'data' + (($dataLvl - 1) || '') : 'parentData', + $parentDataProperty = $dataLvl ? it.dataPathArr[$dataLvl] : 'parentDataProperty'; + out += ' , ' + ($parentData) + ' , ' + ($parentDataProperty) + ' , rootData ) '; + var def_callRuleValidate = out; + out = $$outStack.pop(); + if ($rDef.errors === false) { + out += ' ' + ($valid) + ' = '; + if ($asyncKeyword) { + out += 'await '; + } + out += '' + (def_callRuleValidate) + '; '; + } else { + if ($asyncKeyword) { + $ruleErrs = 'customErrors' + $lvl; + out += ' var ' + ($ruleErrs) + ' = null; try { ' + ($valid) + ' = await ' + (def_callRuleValidate) + '; } catch (e) { ' + ($valid) + ' = false; if (e instanceof ValidationError) ' + ($ruleErrs) + ' = e.errors; else throw e; } '; + } else { + out += ' ' + ($ruleErrs) + ' = null; ' + ($valid) + ' = ' + (def_callRuleValidate) + '; '; + } + } + } + if ($rDef.modifying) { + out += ' if (' + ($parentData) + ') ' + ($data) + ' = ' + ($parentData) + '[' + ($parentDataProperty) + '];'; + } + out += '' + ($closingBraces); + if ($rDef.valid) { + if ($breakOnError) { + out += ' if (true) { '; + } + } else { + out += ' if ( '; + if ($rDef.valid === undefined) { + out += ' !'; + if ($macro) { + out += '' + ($nextValid); + } else { + out += '' + ($valid); + } + } else { + out += ' ' + (!$rDef.valid) + ' '; + } + out += ') { '; + $errorKeyword = $rule.keyword; + var $$outStack = $$outStack || []; + $$outStack.push(out); + out = ''; + var $$outStack = $$outStack || []; + $$outStack.push(out); + out = ''; /* istanbul ignore else */ + if (it.createErrors !== false) { + out += ' { keyword: \'' + ($errorKeyword || 'custom') + '\' , dataPath: (dataPath || \'\') + ' + (it.errorPath) + ' , schemaPath: ' + (it.util.toQuotedString($errSchemaPath)) + ' , params: { keyword: \'' + ($rule.keyword) + '\' } '; + if (it.opts.messages !== false) { + out += ' , message: \'should pass "' + ($rule.keyword) + '" keyword validation\' '; + } + if (it.opts.verbose) { + out += ' , schema: validate.schema' + ($schemaPath) + ' , parentSchema: validate.schema' + (it.schemaPath) + ' , data: ' + ($data) + ' '; + } + out += ' } '; + } else { + out += ' {} '; + } + var __err = out; + out = $$outStack.pop(); + if (!it.compositeRule && $breakOnError) { + /* istanbul ignore if */ + if (it.async) { + out += ' throw new ValidationError([' + (__err) + ']); '; + } else { + out += ' validate.errors = [' + (__err) + ']; return false; '; + } + } else { + out += ' var err = ' + (__err) + '; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; '; + } + var def_customError = out; + out = $$outStack.pop(); + if ($inline) { + if ($rDef.errors) { + if ($rDef.errors != 'full') { + out += ' for (var ' + ($i) + '=' + ($errs) + '; ' + ($i) + ' 0) || $sch === false : it.util.schemaHasRules($sch, it.RULES.all))) { + out += ' ' + ($nextValid) + ' = true; if ( ' + ($data) + (it.util.getProperty($property)) + ' !== undefined '; + if ($ownProperties) { + out += ' && Object.prototype.hasOwnProperty.call(' + ($data) + ', \'' + (it.util.escapeQuotes($property)) + '\') '; + } + out += ') { '; + $it.schema = $sch; + $it.schemaPath = $schemaPath + it.util.getProperty($property); + $it.errSchemaPath = $errSchemaPath + '/' + it.util.escapeFragment($property); + out += ' ' + (it.validate($it)) + ' '; + $it.baseId = $currentBaseId; + out += ' } '; + if ($breakOnError) { + out += ' if (' + ($nextValid) + ') { '; + $closingBraces += '}'; + } + } + } + if ($breakOnError) { + out += ' ' + ($closingBraces) + ' if (' + ($errs) + ' == errors) {'; + } + return out; +} diff --git a/packages/字体精简工具/node_modules/ajv/lib/dotjs/enum.js b/packages/字体精简工具/node_modules/ajv/lib/dotjs/enum.js new file mode 100644 index 0000000..90580b9 --- /dev/null +++ b/packages/字体精简工具/node_modules/ajv/lib/dotjs/enum.js @@ -0,0 +1,66 @@ +'use strict'; +module.exports = function generate_enum(it, $keyword, $ruleType) { + var out = ' '; + var $lvl = it.level; + var $dataLvl = it.dataLevel; + var $schema = it.schema[$keyword]; + var $schemaPath = it.schemaPath + it.util.getProperty($keyword); + var $errSchemaPath = it.errSchemaPath + '/' + $keyword; + var $breakOnError = !it.opts.allErrors; + var $data = 'data' + ($dataLvl || ''); + var $valid = 'valid' + $lvl; + var $isData = it.opts.$data && $schema && $schema.$data, + $schemaValue; + if ($isData) { + out += ' var schema' + ($lvl) + ' = ' + (it.util.getData($schema.$data, $dataLvl, it.dataPathArr)) + '; '; + $schemaValue = 'schema' + $lvl; + } else { + $schemaValue = $schema; + } + var $i = 'i' + $lvl, + $vSchema = 'schema' + $lvl; + if (!$isData) { + out += ' var ' + ($vSchema) + ' = validate.schema' + ($schemaPath) + ';'; + } + out += 'var ' + ($valid) + ';'; + if ($isData) { + out += ' if (schema' + ($lvl) + ' === undefined) ' + ($valid) + ' = true; else if (!Array.isArray(schema' + ($lvl) + ')) ' + ($valid) + ' = false; else {'; + } + out += '' + ($valid) + ' = false;for (var ' + ($i) + '=0; ' + ($i) + '<' + ($vSchema) + '.length; ' + ($i) + '++) if (equal(' + ($data) + ', ' + ($vSchema) + '[' + ($i) + '])) { ' + ($valid) + ' = true; break; }'; + if ($isData) { + out += ' } '; + } + out += ' if (!' + ($valid) + ') { '; + var $$outStack = $$outStack || []; + $$outStack.push(out); + out = ''; /* istanbul ignore else */ + if (it.createErrors !== false) { + out += ' { keyword: \'' + ('enum') + '\' , dataPath: (dataPath || \'\') + ' + (it.errorPath) + ' , schemaPath: ' + (it.util.toQuotedString($errSchemaPath)) + ' , params: { allowedValues: schema' + ($lvl) + ' } '; + if (it.opts.messages !== false) { + out += ' , message: \'should be equal to one of the allowed values\' '; + } + if (it.opts.verbose) { + out += ' , schema: validate.schema' + ($schemaPath) + ' , parentSchema: validate.schema' + (it.schemaPath) + ' , data: ' + ($data) + ' '; + } + out += ' } '; + } else { + out += ' {} '; + } + var __err = out; + out = $$outStack.pop(); + if (!it.compositeRule && $breakOnError) { + /* istanbul ignore if */ + if (it.async) { + out += ' throw new ValidationError([' + (__err) + ']); '; + } else { + out += ' validate.errors = [' + (__err) + ']; return false; '; + } + } else { + out += ' var err = ' + (__err) + '; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; '; + } + out += ' }'; + if ($breakOnError) { + out += ' else { '; + } + return out; +} diff --git a/packages/字体精简工具/node_modules/ajv/lib/dotjs/format.js b/packages/字体精简工具/node_modules/ajv/lib/dotjs/format.js new file mode 100644 index 0000000..cd9a569 --- /dev/null +++ b/packages/字体精简工具/node_modules/ajv/lib/dotjs/format.js @@ -0,0 +1,150 @@ +'use strict'; +module.exports = function generate_format(it, $keyword, $ruleType) { + var out = ' '; + var $lvl = it.level; + var $dataLvl = it.dataLevel; + var $schema = it.schema[$keyword]; + var $schemaPath = it.schemaPath + it.util.getProperty($keyword); + var $errSchemaPath = it.errSchemaPath + '/' + $keyword; + var $breakOnError = !it.opts.allErrors; + var $data = 'data' + ($dataLvl || ''); + if (it.opts.format === false) { + if ($breakOnError) { + out += ' if (true) { '; + } + return out; + } + var $isData = it.opts.$data && $schema && $schema.$data, + $schemaValue; + if ($isData) { + out += ' var schema' + ($lvl) + ' = ' + (it.util.getData($schema.$data, $dataLvl, it.dataPathArr)) + '; '; + $schemaValue = 'schema' + $lvl; + } else { + $schemaValue = $schema; + } + var $unknownFormats = it.opts.unknownFormats, + $allowUnknown = Array.isArray($unknownFormats); + if ($isData) { + var $format = 'format' + $lvl, + $isObject = 'isObject' + $lvl, + $formatType = 'formatType' + $lvl; + out += ' var ' + ($format) + ' = formats[' + ($schemaValue) + ']; var ' + ($isObject) + ' = typeof ' + ($format) + ' == \'object\' && !(' + ($format) + ' instanceof RegExp) && ' + ($format) + '.validate; var ' + ($formatType) + ' = ' + ($isObject) + ' && ' + ($format) + '.type || \'string\'; if (' + ($isObject) + ') { '; + if (it.async) { + out += ' var async' + ($lvl) + ' = ' + ($format) + '.async; '; + } + out += ' ' + ($format) + ' = ' + ($format) + '.validate; } if ( '; + if ($isData) { + out += ' (' + ($schemaValue) + ' !== undefined && typeof ' + ($schemaValue) + ' != \'string\') || '; + } + out += ' ('; + if ($unknownFormats != 'ignore') { + out += ' (' + ($schemaValue) + ' && !' + ($format) + ' '; + if ($allowUnknown) { + out += ' && self._opts.unknownFormats.indexOf(' + ($schemaValue) + ') == -1 '; + } + out += ') || '; + } + out += ' (' + ($format) + ' && ' + ($formatType) + ' == \'' + ($ruleType) + '\' && !(typeof ' + ($format) + ' == \'function\' ? '; + if (it.async) { + out += ' (async' + ($lvl) + ' ? await ' + ($format) + '(' + ($data) + ') : ' + ($format) + '(' + ($data) + ')) '; + } else { + out += ' ' + ($format) + '(' + ($data) + ') '; + } + out += ' : ' + ($format) + '.test(' + ($data) + '))))) {'; + } else { + var $format = it.formats[$schema]; + if (!$format) { + if ($unknownFormats == 'ignore') { + it.logger.warn('unknown format "' + $schema + '" ignored in schema at path "' + it.errSchemaPath + '"'); + if ($breakOnError) { + out += ' if (true) { '; + } + return out; + } else if ($allowUnknown && $unknownFormats.indexOf($schema) >= 0) { + if ($breakOnError) { + out += ' if (true) { '; + } + return out; + } else { + throw new Error('unknown format "' + $schema + '" is used in schema at path "' + it.errSchemaPath + '"'); + } + } + var $isObject = typeof $format == 'object' && !($format instanceof RegExp) && $format.validate; + var $formatType = $isObject && $format.type || 'string'; + if ($isObject) { + var $async = $format.async === true; + $format = $format.validate; + } + if ($formatType != $ruleType) { + if ($breakOnError) { + out += ' if (true) { '; + } + return out; + } + if ($async) { + if (!it.async) throw new Error('async format in sync schema'); + var $formatRef = 'formats' + it.util.getProperty($schema) + '.validate'; + out += ' if (!(await ' + ($formatRef) + '(' + ($data) + '))) { '; + } else { + out += ' if (! '; + var $formatRef = 'formats' + it.util.getProperty($schema); + if ($isObject) $formatRef += '.validate'; + if (typeof $format == 'function') { + out += ' ' + ($formatRef) + '(' + ($data) + ') '; + } else { + out += ' ' + ($formatRef) + '.test(' + ($data) + ') '; + } + out += ') { '; + } + } + var $$outStack = $$outStack || []; + $$outStack.push(out); + out = ''; /* istanbul ignore else */ + if (it.createErrors !== false) { + out += ' { keyword: \'' + ('format') + '\' , dataPath: (dataPath || \'\') + ' + (it.errorPath) + ' , schemaPath: ' + (it.util.toQuotedString($errSchemaPath)) + ' , params: { format: '; + if ($isData) { + out += '' + ($schemaValue); + } else { + out += '' + (it.util.toQuotedString($schema)); + } + out += ' } '; + if (it.opts.messages !== false) { + out += ' , message: \'should match format "'; + if ($isData) { + out += '\' + ' + ($schemaValue) + ' + \''; + } else { + out += '' + (it.util.escapeQuotes($schema)); + } + out += '"\' '; + } + if (it.opts.verbose) { + out += ' , schema: '; + if ($isData) { + out += 'validate.schema' + ($schemaPath); + } else { + out += '' + (it.util.toQuotedString($schema)); + } + out += ' , parentSchema: validate.schema' + (it.schemaPath) + ' , data: ' + ($data) + ' '; + } + out += ' } '; + } else { + out += ' {} '; + } + var __err = out; + out = $$outStack.pop(); + if (!it.compositeRule && $breakOnError) { + /* istanbul ignore if */ + if (it.async) { + out += ' throw new ValidationError([' + (__err) + ']); '; + } else { + out += ' validate.errors = [' + (__err) + ']; return false; '; + } + } else { + out += ' var err = ' + (__err) + '; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; '; + } + out += ' } '; + if ($breakOnError) { + out += ' else { '; + } + return out; +} diff --git a/packages/字体精简工具/node_modules/ajv/lib/dotjs/if.js b/packages/字体精简工具/node_modules/ajv/lib/dotjs/if.js new file mode 100644 index 0000000..94d27ad --- /dev/null +++ b/packages/字体精简工具/node_modules/ajv/lib/dotjs/if.js @@ -0,0 +1,103 @@ +'use strict'; +module.exports = function generate_if(it, $keyword, $ruleType) { + var out = ' '; + var $lvl = it.level; + var $dataLvl = it.dataLevel; + var $schema = it.schema[$keyword]; + var $schemaPath = it.schemaPath + it.util.getProperty($keyword); + var $errSchemaPath = it.errSchemaPath + '/' + $keyword; + var $breakOnError = !it.opts.allErrors; + var $data = 'data' + ($dataLvl || ''); + var $valid = 'valid' + $lvl; + var $errs = 'errs__' + $lvl; + var $it = it.util.copy(it); + $it.level++; + var $nextValid = 'valid' + $it.level; + var $thenSch = it.schema['then'], + $elseSch = it.schema['else'], + $thenPresent = $thenSch !== undefined && (it.opts.strictKeywords ? (typeof $thenSch == 'object' && Object.keys($thenSch).length > 0) || $thenSch === false : it.util.schemaHasRules($thenSch, it.RULES.all)), + $elsePresent = $elseSch !== undefined && (it.opts.strictKeywords ? (typeof $elseSch == 'object' && Object.keys($elseSch).length > 0) || $elseSch === false : it.util.schemaHasRules($elseSch, it.RULES.all)), + $currentBaseId = $it.baseId; + if ($thenPresent || $elsePresent) { + var $ifClause; + $it.createErrors = false; + $it.schema = $schema; + $it.schemaPath = $schemaPath; + $it.errSchemaPath = $errSchemaPath; + out += ' var ' + ($errs) + ' = errors; var ' + ($valid) + ' = true; '; + var $wasComposite = it.compositeRule; + it.compositeRule = $it.compositeRule = true; + out += ' ' + (it.validate($it)) + ' '; + $it.baseId = $currentBaseId; + $it.createErrors = true; + out += ' errors = ' + ($errs) + '; if (vErrors !== null) { if (' + ($errs) + ') vErrors.length = ' + ($errs) + '; else vErrors = null; } '; + it.compositeRule = $it.compositeRule = $wasComposite; + if ($thenPresent) { + out += ' if (' + ($nextValid) + ') { '; + $it.schema = it.schema['then']; + $it.schemaPath = it.schemaPath + '.then'; + $it.errSchemaPath = it.errSchemaPath + '/then'; + out += ' ' + (it.validate($it)) + ' '; + $it.baseId = $currentBaseId; + out += ' ' + ($valid) + ' = ' + ($nextValid) + '; '; + if ($thenPresent && $elsePresent) { + $ifClause = 'ifClause' + $lvl; + out += ' var ' + ($ifClause) + ' = \'then\'; '; + } else { + $ifClause = '\'then\''; + } + out += ' } '; + if ($elsePresent) { + out += ' else { '; + } + } else { + out += ' if (!' + ($nextValid) + ') { '; + } + if ($elsePresent) { + $it.schema = it.schema['else']; + $it.schemaPath = it.schemaPath + '.else'; + $it.errSchemaPath = it.errSchemaPath + '/else'; + out += ' ' + (it.validate($it)) + ' '; + $it.baseId = $currentBaseId; + out += ' ' + ($valid) + ' = ' + ($nextValid) + '; '; + if ($thenPresent && $elsePresent) { + $ifClause = 'ifClause' + $lvl; + out += ' var ' + ($ifClause) + ' = \'else\'; '; + } else { + $ifClause = '\'else\''; + } + out += ' } '; + } + out += ' if (!' + ($valid) + ') { var err = '; /* istanbul ignore else */ + if (it.createErrors !== false) { + out += ' { keyword: \'' + ('if') + '\' , dataPath: (dataPath || \'\') + ' + (it.errorPath) + ' , schemaPath: ' + (it.util.toQuotedString($errSchemaPath)) + ' , params: { failingKeyword: ' + ($ifClause) + ' } '; + if (it.opts.messages !== false) { + out += ' , message: \'should match "\' + ' + ($ifClause) + ' + \'" schema\' '; + } + if (it.opts.verbose) { + out += ' , schema: validate.schema' + ($schemaPath) + ' , parentSchema: validate.schema' + (it.schemaPath) + ' , data: ' + ($data) + ' '; + } + out += ' } '; + } else { + out += ' {} '; + } + out += '; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; '; + if (!it.compositeRule && $breakOnError) { + /* istanbul ignore if */ + if (it.async) { + out += ' throw new ValidationError(vErrors); '; + } else { + out += ' validate.errors = vErrors; return false; '; + } + } + out += ' } '; + if ($breakOnError) { + out += ' else { '; + } + } else { + if ($breakOnError) { + out += ' if (true) { '; + } + } + return out; +} diff --git a/packages/字体精简工具/node_modules/ajv/lib/dotjs/index.js b/packages/字体精简工具/node_modules/ajv/lib/dotjs/index.js new file mode 100644 index 0000000..2fb1b00 --- /dev/null +++ b/packages/字体精简工具/node_modules/ajv/lib/dotjs/index.js @@ -0,0 +1,33 @@ +'use strict'; + +//all requires must be explicit because browserify won't work with dynamic requires +module.exports = { + '$ref': require('./ref'), + allOf: require('./allOf'), + anyOf: require('./anyOf'), + '$comment': require('./comment'), + const: require('./const'), + contains: require('./contains'), + dependencies: require('./dependencies'), + 'enum': require('./enum'), + format: require('./format'), + 'if': require('./if'), + items: require('./items'), + maximum: require('./_limit'), + minimum: require('./_limit'), + maxItems: require('./_limitItems'), + minItems: require('./_limitItems'), + maxLength: require('./_limitLength'), + minLength: require('./_limitLength'), + maxProperties: require('./_limitProperties'), + minProperties: require('./_limitProperties'), + multipleOf: require('./multipleOf'), + not: require('./not'), + oneOf: require('./oneOf'), + pattern: require('./pattern'), + properties: require('./properties'), + propertyNames: require('./propertyNames'), + required: require('./required'), + uniqueItems: require('./uniqueItems'), + validate: require('./validate') +}; diff --git a/packages/字体精简工具/node_modules/ajv/lib/dotjs/items.js b/packages/字体精简工具/node_modules/ajv/lib/dotjs/items.js new file mode 100644 index 0000000..bee5d67 --- /dev/null +++ b/packages/字体精简工具/node_modules/ajv/lib/dotjs/items.js @@ -0,0 +1,140 @@ +'use strict'; +module.exports = function generate_items(it, $keyword, $ruleType) { + var out = ' '; + var $lvl = it.level; + var $dataLvl = it.dataLevel; + var $schema = it.schema[$keyword]; + var $schemaPath = it.schemaPath + it.util.getProperty($keyword); + var $errSchemaPath = it.errSchemaPath + '/' + $keyword; + var $breakOnError = !it.opts.allErrors; + var $data = 'data' + ($dataLvl || ''); + var $valid = 'valid' + $lvl; + var $errs = 'errs__' + $lvl; + var $it = it.util.copy(it); + var $closingBraces = ''; + $it.level++; + var $nextValid = 'valid' + $it.level; + var $idx = 'i' + $lvl, + $dataNxt = $it.dataLevel = it.dataLevel + 1, + $nextData = 'data' + $dataNxt, + $currentBaseId = it.baseId; + out += 'var ' + ($errs) + ' = errors;var ' + ($valid) + ';'; + if (Array.isArray($schema)) { + var $additionalItems = it.schema.additionalItems; + if ($additionalItems === false) { + out += ' ' + ($valid) + ' = ' + ($data) + '.length <= ' + ($schema.length) + '; '; + var $currErrSchemaPath = $errSchemaPath; + $errSchemaPath = it.errSchemaPath + '/additionalItems'; + out += ' if (!' + ($valid) + ') { '; + var $$outStack = $$outStack || []; + $$outStack.push(out); + out = ''; /* istanbul ignore else */ + if (it.createErrors !== false) { + out += ' { keyword: \'' + ('additionalItems') + '\' , dataPath: (dataPath || \'\') + ' + (it.errorPath) + ' , schemaPath: ' + (it.util.toQuotedString($errSchemaPath)) + ' , params: { limit: ' + ($schema.length) + ' } '; + if (it.opts.messages !== false) { + out += ' , message: \'should NOT have more than ' + ($schema.length) + ' items\' '; + } + if (it.opts.verbose) { + out += ' , schema: false , parentSchema: validate.schema' + (it.schemaPath) + ' , data: ' + ($data) + ' '; + } + out += ' } '; + } else { + out += ' {} '; + } + var __err = out; + out = $$outStack.pop(); + if (!it.compositeRule && $breakOnError) { + /* istanbul ignore if */ + if (it.async) { + out += ' throw new ValidationError([' + (__err) + ']); '; + } else { + out += ' validate.errors = [' + (__err) + ']; return false; '; + } + } else { + out += ' var err = ' + (__err) + '; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; '; + } + out += ' } '; + $errSchemaPath = $currErrSchemaPath; + if ($breakOnError) { + $closingBraces += '}'; + out += ' else { '; + } + } + var arr1 = $schema; + if (arr1) { + var $sch, $i = -1, + l1 = arr1.length - 1; + while ($i < l1) { + $sch = arr1[$i += 1]; + if ((it.opts.strictKeywords ? (typeof $sch == 'object' && Object.keys($sch).length > 0) || $sch === false : it.util.schemaHasRules($sch, it.RULES.all))) { + out += ' ' + ($nextValid) + ' = true; if (' + ($data) + '.length > ' + ($i) + ') { '; + var $passData = $data + '[' + $i + ']'; + $it.schema = $sch; + $it.schemaPath = $schemaPath + '[' + $i + ']'; + $it.errSchemaPath = $errSchemaPath + '/' + $i; + $it.errorPath = it.util.getPathExpr(it.errorPath, $i, it.opts.jsonPointers, true); + $it.dataPathArr[$dataNxt] = $i; + var $code = it.validate($it); + $it.baseId = $currentBaseId; + if (it.util.varOccurences($code, $nextData) < 2) { + out += ' ' + (it.util.varReplace($code, $nextData, $passData)) + ' '; + } else { + out += ' var ' + ($nextData) + ' = ' + ($passData) + '; ' + ($code) + ' '; + } + out += ' } '; + if ($breakOnError) { + out += ' if (' + ($nextValid) + ') { '; + $closingBraces += '}'; + } + } + } + } + if (typeof $additionalItems == 'object' && (it.opts.strictKeywords ? (typeof $additionalItems == 'object' && Object.keys($additionalItems).length > 0) || $additionalItems === false : it.util.schemaHasRules($additionalItems, it.RULES.all))) { + $it.schema = $additionalItems; + $it.schemaPath = it.schemaPath + '.additionalItems'; + $it.errSchemaPath = it.errSchemaPath + '/additionalItems'; + out += ' ' + ($nextValid) + ' = true; if (' + ($data) + '.length > ' + ($schema.length) + ') { for (var ' + ($idx) + ' = ' + ($schema.length) + '; ' + ($idx) + ' < ' + ($data) + '.length; ' + ($idx) + '++) { '; + $it.errorPath = it.util.getPathExpr(it.errorPath, $idx, it.opts.jsonPointers, true); + var $passData = $data + '[' + $idx + ']'; + $it.dataPathArr[$dataNxt] = $idx; + var $code = it.validate($it); + $it.baseId = $currentBaseId; + if (it.util.varOccurences($code, $nextData) < 2) { + out += ' ' + (it.util.varReplace($code, $nextData, $passData)) + ' '; + } else { + out += ' var ' + ($nextData) + ' = ' + ($passData) + '; ' + ($code) + ' '; + } + if ($breakOnError) { + out += ' if (!' + ($nextValid) + ') break; '; + } + out += ' } } '; + if ($breakOnError) { + out += ' if (' + ($nextValid) + ') { '; + $closingBraces += '}'; + } + } + } else if ((it.opts.strictKeywords ? (typeof $schema == 'object' && Object.keys($schema).length > 0) || $schema === false : it.util.schemaHasRules($schema, it.RULES.all))) { + $it.schema = $schema; + $it.schemaPath = $schemaPath; + $it.errSchemaPath = $errSchemaPath; + out += ' for (var ' + ($idx) + ' = ' + (0) + '; ' + ($idx) + ' < ' + ($data) + '.length; ' + ($idx) + '++) { '; + $it.errorPath = it.util.getPathExpr(it.errorPath, $idx, it.opts.jsonPointers, true); + var $passData = $data + '[' + $idx + ']'; + $it.dataPathArr[$dataNxt] = $idx; + var $code = it.validate($it); + $it.baseId = $currentBaseId; + if (it.util.varOccurences($code, $nextData) < 2) { + out += ' ' + (it.util.varReplace($code, $nextData, $passData)) + ' '; + } else { + out += ' var ' + ($nextData) + ' = ' + ($passData) + '; ' + ($code) + ' '; + } + if ($breakOnError) { + out += ' if (!' + ($nextValid) + ') break; '; + } + out += ' }'; + } + if ($breakOnError) { + out += ' ' + ($closingBraces) + ' if (' + ($errs) + ' == errors) {'; + } + return out; +} diff --git a/packages/字体精简工具/node_modules/ajv/lib/dotjs/multipleOf.js b/packages/字体精简工具/node_modules/ajv/lib/dotjs/multipleOf.js new file mode 100644 index 0000000..9d6401b --- /dev/null +++ b/packages/字体精简工具/node_modules/ajv/lib/dotjs/multipleOf.js @@ -0,0 +1,80 @@ +'use strict'; +module.exports = function generate_multipleOf(it, $keyword, $ruleType) { + var out = ' '; + var $lvl = it.level; + var $dataLvl = it.dataLevel; + var $schema = it.schema[$keyword]; + var $schemaPath = it.schemaPath + it.util.getProperty($keyword); + var $errSchemaPath = it.errSchemaPath + '/' + $keyword; + var $breakOnError = !it.opts.allErrors; + var $data = 'data' + ($dataLvl || ''); + var $isData = it.opts.$data && $schema && $schema.$data, + $schemaValue; + if ($isData) { + out += ' var schema' + ($lvl) + ' = ' + (it.util.getData($schema.$data, $dataLvl, it.dataPathArr)) + '; '; + $schemaValue = 'schema' + $lvl; + } else { + $schemaValue = $schema; + } + if (!($isData || typeof $schema == 'number')) { + throw new Error($keyword + ' must be number'); + } + out += 'var division' + ($lvl) + ';if ('; + if ($isData) { + out += ' ' + ($schemaValue) + ' !== undefined && ( typeof ' + ($schemaValue) + ' != \'number\' || '; + } + out += ' (division' + ($lvl) + ' = ' + ($data) + ' / ' + ($schemaValue) + ', '; + if (it.opts.multipleOfPrecision) { + out += ' Math.abs(Math.round(division' + ($lvl) + ') - division' + ($lvl) + ') > 1e-' + (it.opts.multipleOfPrecision) + ' '; + } else { + out += ' division' + ($lvl) + ' !== parseInt(division' + ($lvl) + ') '; + } + out += ' ) '; + if ($isData) { + out += ' ) '; + } + out += ' ) { '; + var $$outStack = $$outStack || []; + $$outStack.push(out); + out = ''; /* istanbul ignore else */ + if (it.createErrors !== false) { + out += ' { keyword: \'' + ('multipleOf') + '\' , dataPath: (dataPath || \'\') + ' + (it.errorPath) + ' , schemaPath: ' + (it.util.toQuotedString($errSchemaPath)) + ' , params: { multipleOf: ' + ($schemaValue) + ' } '; + if (it.opts.messages !== false) { + out += ' , message: \'should be multiple of '; + if ($isData) { + out += '\' + ' + ($schemaValue); + } else { + out += '' + ($schemaValue) + '\''; + } + } + if (it.opts.verbose) { + out += ' , schema: '; + if ($isData) { + out += 'validate.schema' + ($schemaPath); + } else { + out += '' + ($schema); + } + out += ' , parentSchema: validate.schema' + (it.schemaPath) + ' , data: ' + ($data) + ' '; + } + out += ' } '; + } else { + out += ' {} '; + } + var __err = out; + out = $$outStack.pop(); + if (!it.compositeRule && $breakOnError) { + /* istanbul ignore if */ + if (it.async) { + out += ' throw new ValidationError([' + (__err) + ']); '; + } else { + out += ' validate.errors = [' + (__err) + ']; return false; '; + } + } else { + out += ' var err = ' + (__err) + '; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; '; + } + out += '} '; + if ($breakOnError) { + out += ' else { '; + } + return out; +} diff --git a/packages/字体精简工具/node_modules/ajv/lib/dotjs/not.js b/packages/字体精简工具/node_modules/ajv/lib/dotjs/not.js new file mode 100644 index 0000000..f50c937 --- /dev/null +++ b/packages/字体精简工具/node_modules/ajv/lib/dotjs/not.js @@ -0,0 +1,84 @@ +'use strict'; +module.exports = function generate_not(it, $keyword, $ruleType) { + var out = ' '; + var $lvl = it.level; + var $dataLvl = it.dataLevel; + var $schema = it.schema[$keyword]; + var $schemaPath = it.schemaPath + it.util.getProperty($keyword); + var $errSchemaPath = it.errSchemaPath + '/' + $keyword; + var $breakOnError = !it.opts.allErrors; + var $data = 'data' + ($dataLvl || ''); + var $errs = 'errs__' + $lvl; + var $it = it.util.copy(it); + $it.level++; + var $nextValid = 'valid' + $it.level; + if ((it.opts.strictKeywords ? (typeof $schema == 'object' && Object.keys($schema).length > 0) || $schema === false : it.util.schemaHasRules($schema, it.RULES.all))) { + $it.schema = $schema; + $it.schemaPath = $schemaPath; + $it.errSchemaPath = $errSchemaPath; + out += ' var ' + ($errs) + ' = errors; '; + var $wasComposite = it.compositeRule; + it.compositeRule = $it.compositeRule = true; + $it.createErrors = false; + var $allErrorsOption; + if ($it.opts.allErrors) { + $allErrorsOption = $it.opts.allErrors; + $it.opts.allErrors = false; + } + out += ' ' + (it.validate($it)) + ' '; + $it.createErrors = true; + if ($allErrorsOption) $it.opts.allErrors = $allErrorsOption; + it.compositeRule = $it.compositeRule = $wasComposite; + out += ' if (' + ($nextValid) + ') { '; + var $$outStack = $$outStack || []; + $$outStack.push(out); + out = ''; /* istanbul ignore else */ + if (it.createErrors !== false) { + out += ' { keyword: \'' + ('not') + '\' , dataPath: (dataPath || \'\') + ' + (it.errorPath) + ' , schemaPath: ' + (it.util.toQuotedString($errSchemaPath)) + ' , params: {} '; + if (it.opts.messages !== false) { + out += ' , message: \'should NOT be valid\' '; + } + if (it.opts.verbose) { + out += ' , schema: validate.schema' + ($schemaPath) + ' , parentSchema: validate.schema' + (it.schemaPath) + ' , data: ' + ($data) + ' '; + } + out += ' } '; + } else { + out += ' {} '; + } + var __err = out; + out = $$outStack.pop(); + if (!it.compositeRule && $breakOnError) { + /* istanbul ignore if */ + if (it.async) { + out += ' throw new ValidationError([' + (__err) + ']); '; + } else { + out += ' validate.errors = [' + (__err) + ']; return false; '; + } + } else { + out += ' var err = ' + (__err) + '; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; '; + } + out += ' } else { errors = ' + ($errs) + '; if (vErrors !== null) { if (' + ($errs) + ') vErrors.length = ' + ($errs) + '; else vErrors = null; } '; + if (it.opts.allErrors) { + out += ' } '; + } + } else { + out += ' var err = '; /* istanbul ignore else */ + if (it.createErrors !== false) { + out += ' { keyword: \'' + ('not') + '\' , dataPath: (dataPath || \'\') + ' + (it.errorPath) + ' , schemaPath: ' + (it.util.toQuotedString($errSchemaPath)) + ' , params: {} '; + if (it.opts.messages !== false) { + out += ' , message: \'should NOT be valid\' '; + } + if (it.opts.verbose) { + out += ' , schema: validate.schema' + ($schemaPath) + ' , parentSchema: validate.schema' + (it.schemaPath) + ' , data: ' + ($data) + ' '; + } + out += ' } '; + } else { + out += ' {} '; + } + out += '; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; '; + if ($breakOnError) { + out += ' if (false) { '; + } + } + return out; +} diff --git a/packages/字体精简工具/node_modules/ajv/lib/dotjs/oneOf.js b/packages/字体精简工具/node_modules/ajv/lib/dotjs/oneOf.js new file mode 100644 index 0000000..dfe2fd5 --- /dev/null +++ b/packages/字体精简工具/node_modules/ajv/lib/dotjs/oneOf.js @@ -0,0 +1,73 @@ +'use strict'; +module.exports = function generate_oneOf(it, $keyword, $ruleType) { + var out = ' '; + var $lvl = it.level; + var $dataLvl = it.dataLevel; + var $schema = it.schema[$keyword]; + var $schemaPath = it.schemaPath + it.util.getProperty($keyword); + var $errSchemaPath = it.errSchemaPath + '/' + $keyword; + var $breakOnError = !it.opts.allErrors; + var $data = 'data' + ($dataLvl || ''); + var $valid = 'valid' + $lvl; + var $errs = 'errs__' + $lvl; + var $it = it.util.copy(it); + var $closingBraces = ''; + $it.level++; + var $nextValid = 'valid' + $it.level; + var $currentBaseId = $it.baseId, + $prevValid = 'prevValid' + $lvl, + $passingSchemas = 'passingSchemas' + $lvl; + out += 'var ' + ($errs) + ' = errors , ' + ($prevValid) + ' = false , ' + ($valid) + ' = false , ' + ($passingSchemas) + ' = null; '; + var $wasComposite = it.compositeRule; + it.compositeRule = $it.compositeRule = true; + var arr1 = $schema; + if (arr1) { + var $sch, $i = -1, + l1 = arr1.length - 1; + while ($i < l1) { + $sch = arr1[$i += 1]; + if ((it.opts.strictKeywords ? (typeof $sch == 'object' && Object.keys($sch).length > 0) || $sch === false : it.util.schemaHasRules($sch, it.RULES.all))) { + $it.schema = $sch; + $it.schemaPath = $schemaPath + '[' + $i + ']'; + $it.errSchemaPath = $errSchemaPath + '/' + $i; + out += ' ' + (it.validate($it)) + ' '; + $it.baseId = $currentBaseId; + } else { + out += ' var ' + ($nextValid) + ' = true; '; + } + if ($i) { + out += ' if (' + ($nextValid) + ' && ' + ($prevValid) + ') { ' + ($valid) + ' = false; ' + ($passingSchemas) + ' = [' + ($passingSchemas) + ', ' + ($i) + ']; } else { '; + $closingBraces += '}'; + } + out += ' if (' + ($nextValid) + ') { ' + ($valid) + ' = ' + ($prevValid) + ' = true; ' + ($passingSchemas) + ' = ' + ($i) + '; }'; + } + } + it.compositeRule = $it.compositeRule = $wasComposite; + out += '' + ($closingBraces) + 'if (!' + ($valid) + ') { var err = '; /* istanbul ignore else */ + if (it.createErrors !== false) { + out += ' { keyword: \'' + ('oneOf') + '\' , dataPath: (dataPath || \'\') + ' + (it.errorPath) + ' , schemaPath: ' + (it.util.toQuotedString($errSchemaPath)) + ' , params: { passingSchemas: ' + ($passingSchemas) + ' } '; + if (it.opts.messages !== false) { + out += ' , message: \'should match exactly one schema in oneOf\' '; + } + if (it.opts.verbose) { + out += ' , schema: validate.schema' + ($schemaPath) + ' , parentSchema: validate.schema' + (it.schemaPath) + ' , data: ' + ($data) + ' '; + } + out += ' } '; + } else { + out += ' {} '; + } + out += '; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; '; + if (!it.compositeRule && $breakOnError) { + /* istanbul ignore if */ + if (it.async) { + out += ' throw new ValidationError(vErrors); '; + } else { + out += ' validate.errors = vErrors; return false; '; + } + } + out += '} else { errors = ' + ($errs) + '; if (vErrors !== null) { if (' + ($errs) + ') vErrors.length = ' + ($errs) + '; else vErrors = null; }'; + if (it.opts.allErrors) { + out += ' } '; + } + return out; +} diff --git a/packages/字体精简工具/node_modules/ajv/lib/dotjs/pattern.js b/packages/字体精简工具/node_modules/ajv/lib/dotjs/pattern.js new file mode 100644 index 0000000..1d74d6b --- /dev/null +++ b/packages/字体精简工具/node_modules/ajv/lib/dotjs/pattern.js @@ -0,0 +1,75 @@ +'use strict'; +module.exports = function generate_pattern(it, $keyword, $ruleType) { + var out = ' '; + var $lvl = it.level; + var $dataLvl = it.dataLevel; + var $schema = it.schema[$keyword]; + var $schemaPath = it.schemaPath + it.util.getProperty($keyword); + var $errSchemaPath = it.errSchemaPath + '/' + $keyword; + var $breakOnError = !it.opts.allErrors; + var $data = 'data' + ($dataLvl || ''); + var $isData = it.opts.$data && $schema && $schema.$data, + $schemaValue; + if ($isData) { + out += ' var schema' + ($lvl) + ' = ' + (it.util.getData($schema.$data, $dataLvl, it.dataPathArr)) + '; '; + $schemaValue = 'schema' + $lvl; + } else { + $schemaValue = $schema; + } + var $regexp = $isData ? '(new RegExp(' + $schemaValue + '))' : it.usePattern($schema); + out += 'if ( '; + if ($isData) { + out += ' (' + ($schemaValue) + ' !== undefined && typeof ' + ($schemaValue) + ' != \'string\') || '; + } + out += ' !' + ($regexp) + '.test(' + ($data) + ') ) { '; + var $$outStack = $$outStack || []; + $$outStack.push(out); + out = ''; /* istanbul ignore else */ + if (it.createErrors !== false) { + out += ' { keyword: \'' + ('pattern') + '\' , dataPath: (dataPath || \'\') + ' + (it.errorPath) + ' , schemaPath: ' + (it.util.toQuotedString($errSchemaPath)) + ' , params: { pattern: '; + if ($isData) { + out += '' + ($schemaValue); + } else { + out += '' + (it.util.toQuotedString($schema)); + } + out += ' } '; + if (it.opts.messages !== false) { + out += ' , message: \'should match pattern "'; + if ($isData) { + out += '\' + ' + ($schemaValue) + ' + \''; + } else { + out += '' + (it.util.escapeQuotes($schema)); + } + out += '"\' '; + } + if (it.opts.verbose) { + out += ' , schema: '; + if ($isData) { + out += 'validate.schema' + ($schemaPath); + } else { + out += '' + (it.util.toQuotedString($schema)); + } + out += ' , parentSchema: validate.schema' + (it.schemaPath) + ' , data: ' + ($data) + ' '; + } + out += ' } '; + } else { + out += ' {} '; + } + var __err = out; + out = $$outStack.pop(); + if (!it.compositeRule && $breakOnError) { + /* istanbul ignore if */ + if (it.async) { + out += ' throw new ValidationError([' + (__err) + ']); '; + } else { + out += ' validate.errors = [' + (__err) + ']; return false; '; + } + } else { + out += ' var err = ' + (__err) + '; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; '; + } + out += '} '; + if ($breakOnError) { + out += ' else { '; + } + return out; +} diff --git a/packages/字体精简工具/node_modules/ajv/lib/dotjs/properties.js b/packages/字体精简工具/node_modules/ajv/lib/dotjs/properties.js new file mode 100644 index 0000000..bc5ee55 --- /dev/null +++ b/packages/字体精简工具/node_modules/ajv/lib/dotjs/properties.js @@ -0,0 +1,335 @@ +'use strict'; +module.exports = function generate_properties(it, $keyword, $ruleType) { + var out = ' '; + var $lvl = it.level; + var $dataLvl = it.dataLevel; + var $schema = it.schema[$keyword]; + var $schemaPath = it.schemaPath + it.util.getProperty($keyword); + var $errSchemaPath = it.errSchemaPath + '/' + $keyword; + var $breakOnError = !it.opts.allErrors; + var $data = 'data' + ($dataLvl || ''); + var $errs = 'errs__' + $lvl; + var $it = it.util.copy(it); + var $closingBraces = ''; + $it.level++; + var $nextValid = 'valid' + $it.level; + var $key = 'key' + $lvl, + $idx = 'idx' + $lvl, + $dataNxt = $it.dataLevel = it.dataLevel + 1, + $nextData = 'data' + $dataNxt, + $dataProperties = 'dataProperties' + $lvl; + var $schemaKeys = Object.keys($schema || {}).filter(notProto), + $pProperties = it.schema.patternProperties || {}, + $pPropertyKeys = Object.keys($pProperties).filter(notProto), + $aProperties = it.schema.additionalProperties, + $someProperties = $schemaKeys.length || $pPropertyKeys.length, + $noAdditional = $aProperties === false, + $additionalIsSchema = typeof $aProperties == 'object' && Object.keys($aProperties).length, + $removeAdditional = it.opts.removeAdditional, + $checkAdditional = $noAdditional || $additionalIsSchema || $removeAdditional, + $ownProperties = it.opts.ownProperties, + $currentBaseId = it.baseId; + var $required = it.schema.required; + if ($required && !(it.opts.$data && $required.$data) && $required.length < it.opts.loopRequired) { + var $requiredHash = it.util.toHash($required); + } + + function notProto(p) { + return p !== '__proto__'; + } + out += 'var ' + ($errs) + ' = errors;var ' + ($nextValid) + ' = true;'; + if ($ownProperties) { + out += ' var ' + ($dataProperties) + ' = undefined;'; + } + if ($checkAdditional) { + if ($ownProperties) { + out += ' ' + ($dataProperties) + ' = ' + ($dataProperties) + ' || Object.keys(' + ($data) + '); for (var ' + ($idx) + '=0; ' + ($idx) + '<' + ($dataProperties) + '.length; ' + ($idx) + '++) { var ' + ($key) + ' = ' + ($dataProperties) + '[' + ($idx) + ']; '; + } else { + out += ' for (var ' + ($key) + ' in ' + ($data) + ') { '; + } + if ($someProperties) { + out += ' var isAdditional' + ($lvl) + ' = !(false '; + if ($schemaKeys.length) { + if ($schemaKeys.length > 8) { + out += ' || validate.schema' + ($schemaPath) + '.hasOwnProperty(' + ($key) + ') '; + } else { + var arr1 = $schemaKeys; + if (arr1) { + var $propertyKey, i1 = -1, + l1 = arr1.length - 1; + while (i1 < l1) { + $propertyKey = arr1[i1 += 1]; + out += ' || ' + ($key) + ' == ' + (it.util.toQuotedString($propertyKey)) + ' '; + } + } + } + } + if ($pPropertyKeys.length) { + var arr2 = $pPropertyKeys; + if (arr2) { + var $pProperty, $i = -1, + l2 = arr2.length - 1; + while ($i < l2) { + $pProperty = arr2[$i += 1]; + out += ' || ' + (it.usePattern($pProperty)) + '.test(' + ($key) + ') '; + } + } + } + out += ' ); if (isAdditional' + ($lvl) + ') { '; + } + if ($removeAdditional == 'all') { + out += ' delete ' + ($data) + '[' + ($key) + ']; '; + } else { + var $currentErrorPath = it.errorPath; + var $additionalProperty = '\' + ' + $key + ' + \''; + if (it.opts._errorDataPathProperty) { + it.errorPath = it.util.getPathExpr(it.errorPath, $key, it.opts.jsonPointers); + } + if ($noAdditional) { + if ($removeAdditional) { + out += ' delete ' + ($data) + '[' + ($key) + ']; '; + } else { + out += ' ' + ($nextValid) + ' = false; '; + var $currErrSchemaPath = $errSchemaPath; + $errSchemaPath = it.errSchemaPath + '/additionalProperties'; + var $$outStack = $$outStack || []; + $$outStack.push(out); + out = ''; /* istanbul ignore else */ + if (it.createErrors !== false) { + out += ' { keyword: \'' + ('additionalProperties') + '\' , dataPath: (dataPath || \'\') + ' + (it.errorPath) + ' , schemaPath: ' + (it.util.toQuotedString($errSchemaPath)) + ' , params: { additionalProperty: \'' + ($additionalProperty) + '\' } '; + if (it.opts.messages !== false) { + out += ' , message: \''; + if (it.opts._errorDataPathProperty) { + out += 'is an invalid additional property'; + } else { + out += 'should NOT have additional properties'; + } + out += '\' '; + } + if (it.opts.verbose) { + out += ' , schema: false , parentSchema: validate.schema' + (it.schemaPath) + ' , data: ' + ($data) + ' '; + } + out += ' } '; + } else { + out += ' {} '; + } + var __err = out; + out = $$outStack.pop(); + if (!it.compositeRule && $breakOnError) { + /* istanbul ignore if */ + if (it.async) { + out += ' throw new ValidationError([' + (__err) + ']); '; + } else { + out += ' validate.errors = [' + (__err) + ']; return false; '; + } + } else { + out += ' var err = ' + (__err) + '; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; '; + } + $errSchemaPath = $currErrSchemaPath; + if ($breakOnError) { + out += ' break; '; + } + } + } else if ($additionalIsSchema) { + if ($removeAdditional == 'failing') { + out += ' var ' + ($errs) + ' = errors; '; + var $wasComposite = it.compositeRule; + it.compositeRule = $it.compositeRule = true; + $it.schema = $aProperties; + $it.schemaPath = it.schemaPath + '.additionalProperties'; + $it.errSchemaPath = it.errSchemaPath + '/additionalProperties'; + $it.errorPath = it.opts._errorDataPathProperty ? it.errorPath : it.util.getPathExpr(it.errorPath, $key, it.opts.jsonPointers); + var $passData = $data + '[' + $key + ']'; + $it.dataPathArr[$dataNxt] = $key; + var $code = it.validate($it); + $it.baseId = $currentBaseId; + if (it.util.varOccurences($code, $nextData) < 2) { + out += ' ' + (it.util.varReplace($code, $nextData, $passData)) + ' '; + } else { + out += ' var ' + ($nextData) + ' = ' + ($passData) + '; ' + ($code) + ' '; + } + out += ' if (!' + ($nextValid) + ') { errors = ' + ($errs) + '; if (validate.errors !== null) { if (errors) validate.errors.length = errors; else validate.errors = null; } delete ' + ($data) + '[' + ($key) + ']; } '; + it.compositeRule = $it.compositeRule = $wasComposite; + } else { + $it.schema = $aProperties; + $it.schemaPath = it.schemaPath + '.additionalProperties'; + $it.errSchemaPath = it.errSchemaPath + '/additionalProperties'; + $it.errorPath = it.opts._errorDataPathProperty ? it.errorPath : it.util.getPathExpr(it.errorPath, $key, it.opts.jsonPointers); + var $passData = $data + '[' + $key + ']'; + $it.dataPathArr[$dataNxt] = $key; + var $code = it.validate($it); + $it.baseId = $currentBaseId; + if (it.util.varOccurences($code, $nextData) < 2) { + out += ' ' + (it.util.varReplace($code, $nextData, $passData)) + ' '; + } else { + out += ' var ' + ($nextData) + ' = ' + ($passData) + '; ' + ($code) + ' '; + } + if ($breakOnError) { + out += ' if (!' + ($nextValid) + ') break; '; + } + } + } + it.errorPath = $currentErrorPath; + } + if ($someProperties) { + out += ' } '; + } + out += ' } '; + if ($breakOnError) { + out += ' if (' + ($nextValid) + ') { '; + $closingBraces += '}'; + } + } + var $useDefaults = it.opts.useDefaults && !it.compositeRule; + if ($schemaKeys.length) { + var arr3 = $schemaKeys; + if (arr3) { + var $propertyKey, i3 = -1, + l3 = arr3.length - 1; + while (i3 < l3) { + $propertyKey = arr3[i3 += 1]; + var $sch = $schema[$propertyKey]; + if ((it.opts.strictKeywords ? (typeof $sch == 'object' && Object.keys($sch).length > 0) || $sch === false : it.util.schemaHasRules($sch, it.RULES.all))) { + var $prop = it.util.getProperty($propertyKey), + $passData = $data + $prop, + $hasDefault = $useDefaults && $sch.default !== undefined; + $it.schema = $sch; + $it.schemaPath = $schemaPath + $prop; + $it.errSchemaPath = $errSchemaPath + '/' + it.util.escapeFragment($propertyKey); + $it.errorPath = it.util.getPath(it.errorPath, $propertyKey, it.opts.jsonPointers); + $it.dataPathArr[$dataNxt] = it.util.toQuotedString($propertyKey); + var $code = it.validate($it); + $it.baseId = $currentBaseId; + if (it.util.varOccurences($code, $nextData) < 2) { + $code = it.util.varReplace($code, $nextData, $passData); + var $useData = $passData; + } else { + var $useData = $nextData; + out += ' var ' + ($nextData) + ' = ' + ($passData) + '; '; + } + if ($hasDefault) { + out += ' ' + ($code) + ' '; + } else { + if ($requiredHash && $requiredHash[$propertyKey]) { + out += ' if ( ' + ($useData) + ' === undefined '; + if ($ownProperties) { + out += ' || ! Object.prototype.hasOwnProperty.call(' + ($data) + ', \'' + (it.util.escapeQuotes($propertyKey)) + '\') '; + } + out += ') { ' + ($nextValid) + ' = false; '; + var $currentErrorPath = it.errorPath, + $currErrSchemaPath = $errSchemaPath, + $missingProperty = it.util.escapeQuotes($propertyKey); + if (it.opts._errorDataPathProperty) { + it.errorPath = it.util.getPath($currentErrorPath, $propertyKey, it.opts.jsonPointers); + } + $errSchemaPath = it.errSchemaPath + '/required'; + var $$outStack = $$outStack || []; + $$outStack.push(out); + out = ''; /* istanbul ignore else */ + if (it.createErrors !== false) { + out += ' { keyword: \'' + ('required') + '\' , dataPath: (dataPath || \'\') + ' + (it.errorPath) + ' , schemaPath: ' + (it.util.toQuotedString($errSchemaPath)) + ' , params: { missingProperty: \'' + ($missingProperty) + '\' } '; + if (it.opts.messages !== false) { + out += ' , message: \''; + if (it.opts._errorDataPathProperty) { + out += 'is a required property'; + } else { + out += 'should have required property \\\'' + ($missingProperty) + '\\\''; + } + out += '\' '; + } + if (it.opts.verbose) { + out += ' , schema: validate.schema' + ($schemaPath) + ' , parentSchema: validate.schema' + (it.schemaPath) + ' , data: ' + ($data) + ' '; + } + out += ' } '; + } else { + out += ' {} '; + } + var __err = out; + out = $$outStack.pop(); + if (!it.compositeRule && $breakOnError) { + /* istanbul ignore if */ + if (it.async) { + out += ' throw new ValidationError([' + (__err) + ']); '; + } else { + out += ' validate.errors = [' + (__err) + ']; return false; '; + } + } else { + out += ' var err = ' + (__err) + '; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; '; + } + $errSchemaPath = $currErrSchemaPath; + it.errorPath = $currentErrorPath; + out += ' } else { '; + } else { + if ($breakOnError) { + out += ' if ( ' + ($useData) + ' === undefined '; + if ($ownProperties) { + out += ' || ! Object.prototype.hasOwnProperty.call(' + ($data) + ', \'' + (it.util.escapeQuotes($propertyKey)) + '\') '; + } + out += ') { ' + ($nextValid) + ' = true; } else { '; + } else { + out += ' if (' + ($useData) + ' !== undefined '; + if ($ownProperties) { + out += ' && Object.prototype.hasOwnProperty.call(' + ($data) + ', \'' + (it.util.escapeQuotes($propertyKey)) + '\') '; + } + out += ' ) { '; + } + } + out += ' ' + ($code) + ' } '; + } + } + if ($breakOnError) { + out += ' if (' + ($nextValid) + ') { '; + $closingBraces += '}'; + } + } + } + } + if ($pPropertyKeys.length) { + var arr4 = $pPropertyKeys; + if (arr4) { + var $pProperty, i4 = -1, + l4 = arr4.length - 1; + while (i4 < l4) { + $pProperty = arr4[i4 += 1]; + var $sch = $pProperties[$pProperty]; + if ((it.opts.strictKeywords ? (typeof $sch == 'object' && Object.keys($sch).length > 0) || $sch === false : it.util.schemaHasRules($sch, it.RULES.all))) { + $it.schema = $sch; + $it.schemaPath = it.schemaPath + '.patternProperties' + it.util.getProperty($pProperty); + $it.errSchemaPath = it.errSchemaPath + '/patternProperties/' + it.util.escapeFragment($pProperty); + if ($ownProperties) { + out += ' ' + ($dataProperties) + ' = ' + ($dataProperties) + ' || Object.keys(' + ($data) + '); for (var ' + ($idx) + '=0; ' + ($idx) + '<' + ($dataProperties) + '.length; ' + ($idx) + '++) { var ' + ($key) + ' = ' + ($dataProperties) + '[' + ($idx) + ']; '; + } else { + out += ' for (var ' + ($key) + ' in ' + ($data) + ') { '; + } + out += ' if (' + (it.usePattern($pProperty)) + '.test(' + ($key) + ')) { '; + $it.errorPath = it.util.getPathExpr(it.errorPath, $key, it.opts.jsonPointers); + var $passData = $data + '[' + $key + ']'; + $it.dataPathArr[$dataNxt] = $key; + var $code = it.validate($it); + $it.baseId = $currentBaseId; + if (it.util.varOccurences($code, $nextData) < 2) { + out += ' ' + (it.util.varReplace($code, $nextData, $passData)) + ' '; + } else { + out += ' var ' + ($nextData) + ' = ' + ($passData) + '; ' + ($code) + ' '; + } + if ($breakOnError) { + out += ' if (!' + ($nextValid) + ') break; '; + } + out += ' } '; + if ($breakOnError) { + out += ' else ' + ($nextValid) + ' = true; '; + } + out += ' } '; + if ($breakOnError) { + out += ' if (' + ($nextValid) + ') { '; + $closingBraces += '}'; + } + } + } + } + } + if ($breakOnError) { + out += ' ' + ($closingBraces) + ' if (' + ($errs) + ' == errors) {'; + } + return out; +} diff --git a/packages/字体精简工具/node_modules/ajv/lib/dotjs/propertyNames.js b/packages/字体精简工具/node_modules/ajv/lib/dotjs/propertyNames.js new file mode 100644 index 0000000..2a54a08 --- /dev/null +++ b/packages/字体精简工具/node_modules/ajv/lib/dotjs/propertyNames.js @@ -0,0 +1,81 @@ +'use strict'; +module.exports = function generate_propertyNames(it, $keyword, $ruleType) { + var out = ' '; + var $lvl = it.level; + var $dataLvl = it.dataLevel; + var $schema = it.schema[$keyword]; + var $schemaPath = it.schemaPath + it.util.getProperty($keyword); + var $errSchemaPath = it.errSchemaPath + '/' + $keyword; + var $breakOnError = !it.opts.allErrors; + var $data = 'data' + ($dataLvl || ''); + var $errs = 'errs__' + $lvl; + var $it = it.util.copy(it); + var $closingBraces = ''; + $it.level++; + var $nextValid = 'valid' + $it.level; + out += 'var ' + ($errs) + ' = errors;'; + if ((it.opts.strictKeywords ? (typeof $schema == 'object' && Object.keys($schema).length > 0) || $schema === false : it.util.schemaHasRules($schema, it.RULES.all))) { + $it.schema = $schema; + $it.schemaPath = $schemaPath; + $it.errSchemaPath = $errSchemaPath; + var $key = 'key' + $lvl, + $idx = 'idx' + $lvl, + $i = 'i' + $lvl, + $invalidName = '\' + ' + $key + ' + \'', + $dataNxt = $it.dataLevel = it.dataLevel + 1, + $nextData = 'data' + $dataNxt, + $dataProperties = 'dataProperties' + $lvl, + $ownProperties = it.opts.ownProperties, + $currentBaseId = it.baseId; + if ($ownProperties) { + out += ' var ' + ($dataProperties) + ' = undefined; '; + } + if ($ownProperties) { + out += ' ' + ($dataProperties) + ' = ' + ($dataProperties) + ' || Object.keys(' + ($data) + '); for (var ' + ($idx) + '=0; ' + ($idx) + '<' + ($dataProperties) + '.length; ' + ($idx) + '++) { var ' + ($key) + ' = ' + ($dataProperties) + '[' + ($idx) + ']; '; + } else { + out += ' for (var ' + ($key) + ' in ' + ($data) + ') { '; + } + out += ' var startErrs' + ($lvl) + ' = errors; '; + var $passData = $key; + var $wasComposite = it.compositeRule; + it.compositeRule = $it.compositeRule = true; + var $code = it.validate($it); + $it.baseId = $currentBaseId; + if (it.util.varOccurences($code, $nextData) < 2) { + out += ' ' + (it.util.varReplace($code, $nextData, $passData)) + ' '; + } else { + out += ' var ' + ($nextData) + ' = ' + ($passData) + '; ' + ($code) + ' '; + } + it.compositeRule = $it.compositeRule = $wasComposite; + out += ' if (!' + ($nextValid) + ') { for (var ' + ($i) + '=startErrs' + ($lvl) + '; ' + ($i) + ' 0) || $propertySch === false : it.util.schemaHasRules($propertySch, it.RULES.all)))) { + $required[$required.length] = $property; + } + } + } + } else { + var $required = $schema; + } + } + if ($isData || $required.length) { + var $currentErrorPath = it.errorPath, + $loopRequired = $isData || $required.length >= it.opts.loopRequired, + $ownProperties = it.opts.ownProperties; + if ($breakOnError) { + out += ' var missing' + ($lvl) + '; '; + if ($loopRequired) { + if (!$isData) { + out += ' var ' + ($vSchema) + ' = validate.schema' + ($schemaPath) + '; '; + } + var $i = 'i' + $lvl, + $propertyPath = 'schema' + $lvl + '[' + $i + ']', + $missingProperty = '\' + ' + $propertyPath + ' + \''; + if (it.opts._errorDataPathProperty) { + it.errorPath = it.util.getPathExpr($currentErrorPath, $propertyPath, it.opts.jsonPointers); + } + out += ' var ' + ($valid) + ' = true; '; + if ($isData) { + out += ' if (schema' + ($lvl) + ' === undefined) ' + ($valid) + ' = true; else if (!Array.isArray(schema' + ($lvl) + ')) ' + ($valid) + ' = false; else {'; + } + out += ' for (var ' + ($i) + ' = 0; ' + ($i) + ' < ' + ($vSchema) + '.length; ' + ($i) + '++) { ' + ($valid) + ' = ' + ($data) + '[' + ($vSchema) + '[' + ($i) + ']] !== undefined '; + if ($ownProperties) { + out += ' && Object.prototype.hasOwnProperty.call(' + ($data) + ', ' + ($vSchema) + '[' + ($i) + ']) '; + } + out += '; if (!' + ($valid) + ') break; } '; + if ($isData) { + out += ' } '; + } + out += ' if (!' + ($valid) + ') { '; + var $$outStack = $$outStack || []; + $$outStack.push(out); + out = ''; /* istanbul ignore else */ + if (it.createErrors !== false) { + out += ' { keyword: \'' + ('required') + '\' , dataPath: (dataPath || \'\') + ' + (it.errorPath) + ' , schemaPath: ' + (it.util.toQuotedString($errSchemaPath)) + ' , params: { missingProperty: \'' + ($missingProperty) + '\' } '; + if (it.opts.messages !== false) { + out += ' , message: \''; + if (it.opts._errorDataPathProperty) { + out += 'is a required property'; + } else { + out += 'should have required property \\\'' + ($missingProperty) + '\\\''; + } + out += '\' '; + } + if (it.opts.verbose) { + out += ' , schema: validate.schema' + ($schemaPath) + ' , parentSchema: validate.schema' + (it.schemaPath) + ' , data: ' + ($data) + ' '; + } + out += ' } '; + } else { + out += ' {} '; + } + var __err = out; + out = $$outStack.pop(); + if (!it.compositeRule && $breakOnError) { + /* istanbul ignore if */ + if (it.async) { + out += ' throw new ValidationError([' + (__err) + ']); '; + } else { + out += ' validate.errors = [' + (__err) + ']; return false; '; + } + } else { + out += ' var err = ' + (__err) + '; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; '; + } + out += ' } else { '; + } else { + out += ' if ( '; + var arr2 = $required; + if (arr2) { + var $propertyKey, $i = -1, + l2 = arr2.length - 1; + while ($i < l2) { + $propertyKey = arr2[$i += 1]; + if ($i) { + out += ' || '; + } + var $prop = it.util.getProperty($propertyKey), + $useData = $data + $prop; + out += ' ( ( ' + ($useData) + ' === undefined '; + if ($ownProperties) { + out += ' || ! Object.prototype.hasOwnProperty.call(' + ($data) + ', \'' + (it.util.escapeQuotes($propertyKey)) + '\') '; + } + out += ') && (missing' + ($lvl) + ' = ' + (it.util.toQuotedString(it.opts.jsonPointers ? $propertyKey : $prop)) + ') ) '; + } + } + out += ') { '; + var $propertyPath = 'missing' + $lvl, + $missingProperty = '\' + ' + $propertyPath + ' + \''; + if (it.opts._errorDataPathProperty) { + it.errorPath = it.opts.jsonPointers ? it.util.getPathExpr($currentErrorPath, $propertyPath, true) : $currentErrorPath + ' + ' + $propertyPath; + } + var $$outStack = $$outStack || []; + $$outStack.push(out); + out = ''; /* istanbul ignore else */ + if (it.createErrors !== false) { + out += ' { keyword: \'' + ('required') + '\' , dataPath: (dataPath || \'\') + ' + (it.errorPath) + ' , schemaPath: ' + (it.util.toQuotedString($errSchemaPath)) + ' , params: { missingProperty: \'' + ($missingProperty) + '\' } '; + if (it.opts.messages !== false) { + out += ' , message: \''; + if (it.opts._errorDataPathProperty) { + out += 'is a required property'; + } else { + out += 'should have required property \\\'' + ($missingProperty) + '\\\''; + } + out += '\' '; + } + if (it.opts.verbose) { + out += ' , schema: validate.schema' + ($schemaPath) + ' , parentSchema: validate.schema' + (it.schemaPath) + ' , data: ' + ($data) + ' '; + } + out += ' } '; + } else { + out += ' {} '; + } + var __err = out; + out = $$outStack.pop(); + if (!it.compositeRule && $breakOnError) { + /* istanbul ignore if */ + if (it.async) { + out += ' throw new ValidationError([' + (__err) + ']); '; + } else { + out += ' validate.errors = [' + (__err) + ']; return false; '; + } + } else { + out += ' var err = ' + (__err) + '; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; '; + } + out += ' } else { '; + } + } else { + if ($loopRequired) { + if (!$isData) { + out += ' var ' + ($vSchema) + ' = validate.schema' + ($schemaPath) + '; '; + } + var $i = 'i' + $lvl, + $propertyPath = 'schema' + $lvl + '[' + $i + ']', + $missingProperty = '\' + ' + $propertyPath + ' + \''; + if (it.opts._errorDataPathProperty) { + it.errorPath = it.util.getPathExpr($currentErrorPath, $propertyPath, it.opts.jsonPointers); + } + if ($isData) { + out += ' if (' + ($vSchema) + ' && !Array.isArray(' + ($vSchema) + ')) { var err = '; /* istanbul ignore else */ + if (it.createErrors !== false) { + out += ' { keyword: \'' + ('required') + '\' , dataPath: (dataPath || \'\') + ' + (it.errorPath) + ' , schemaPath: ' + (it.util.toQuotedString($errSchemaPath)) + ' , params: { missingProperty: \'' + ($missingProperty) + '\' } '; + if (it.opts.messages !== false) { + out += ' , message: \''; + if (it.opts._errorDataPathProperty) { + out += 'is a required property'; + } else { + out += 'should have required property \\\'' + ($missingProperty) + '\\\''; + } + out += '\' '; + } + if (it.opts.verbose) { + out += ' , schema: validate.schema' + ($schemaPath) + ' , parentSchema: validate.schema' + (it.schemaPath) + ' , data: ' + ($data) + ' '; + } + out += ' } '; + } else { + out += ' {} '; + } + out += '; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; } else if (' + ($vSchema) + ' !== undefined) { '; + } + out += ' for (var ' + ($i) + ' = 0; ' + ($i) + ' < ' + ($vSchema) + '.length; ' + ($i) + '++) { if (' + ($data) + '[' + ($vSchema) + '[' + ($i) + ']] === undefined '; + if ($ownProperties) { + out += ' || ! Object.prototype.hasOwnProperty.call(' + ($data) + ', ' + ($vSchema) + '[' + ($i) + ']) '; + } + out += ') { var err = '; /* istanbul ignore else */ + if (it.createErrors !== false) { + out += ' { keyword: \'' + ('required') + '\' , dataPath: (dataPath || \'\') + ' + (it.errorPath) + ' , schemaPath: ' + (it.util.toQuotedString($errSchemaPath)) + ' , params: { missingProperty: \'' + ($missingProperty) + '\' } '; + if (it.opts.messages !== false) { + out += ' , message: \''; + if (it.opts._errorDataPathProperty) { + out += 'is a required property'; + } else { + out += 'should have required property \\\'' + ($missingProperty) + '\\\''; + } + out += '\' '; + } + if (it.opts.verbose) { + out += ' , schema: validate.schema' + ($schemaPath) + ' , parentSchema: validate.schema' + (it.schemaPath) + ' , data: ' + ($data) + ' '; + } + out += ' } '; + } else { + out += ' {} '; + } + out += '; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; } } '; + if ($isData) { + out += ' } '; + } + } else { + var arr3 = $required; + if (arr3) { + var $propertyKey, i3 = -1, + l3 = arr3.length - 1; + while (i3 < l3) { + $propertyKey = arr3[i3 += 1]; + var $prop = it.util.getProperty($propertyKey), + $missingProperty = it.util.escapeQuotes($propertyKey), + $useData = $data + $prop; + if (it.opts._errorDataPathProperty) { + it.errorPath = it.util.getPath($currentErrorPath, $propertyKey, it.opts.jsonPointers); + } + out += ' if ( ' + ($useData) + ' === undefined '; + if ($ownProperties) { + out += ' || ! Object.prototype.hasOwnProperty.call(' + ($data) + ', \'' + (it.util.escapeQuotes($propertyKey)) + '\') '; + } + out += ') { var err = '; /* istanbul ignore else */ + if (it.createErrors !== false) { + out += ' { keyword: \'' + ('required') + '\' , dataPath: (dataPath || \'\') + ' + (it.errorPath) + ' , schemaPath: ' + (it.util.toQuotedString($errSchemaPath)) + ' , params: { missingProperty: \'' + ($missingProperty) + '\' } '; + if (it.opts.messages !== false) { + out += ' , message: \''; + if (it.opts._errorDataPathProperty) { + out += 'is a required property'; + } else { + out += 'should have required property \\\'' + ($missingProperty) + '\\\''; + } + out += '\' '; + } + if (it.opts.verbose) { + out += ' , schema: validate.schema' + ($schemaPath) + ' , parentSchema: validate.schema' + (it.schemaPath) + ' , data: ' + ($data) + ' '; + } + out += ' } '; + } else { + out += ' {} '; + } + out += '; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; } '; + } + } + } + } + it.errorPath = $currentErrorPath; + } else if ($breakOnError) { + out += ' if (true) {'; + } + return out; +} diff --git a/packages/字体精简工具/node_modules/ajv/lib/dotjs/uniqueItems.js b/packages/字体精简工具/node_modules/ajv/lib/dotjs/uniqueItems.js new file mode 100644 index 0000000..0736a0e --- /dev/null +++ b/packages/字体精简工具/node_modules/ajv/lib/dotjs/uniqueItems.js @@ -0,0 +1,86 @@ +'use strict'; +module.exports = function generate_uniqueItems(it, $keyword, $ruleType) { + var out = ' '; + var $lvl = it.level; + var $dataLvl = it.dataLevel; + var $schema = it.schema[$keyword]; + var $schemaPath = it.schemaPath + it.util.getProperty($keyword); + var $errSchemaPath = it.errSchemaPath + '/' + $keyword; + var $breakOnError = !it.opts.allErrors; + var $data = 'data' + ($dataLvl || ''); + var $valid = 'valid' + $lvl; + var $isData = it.opts.$data && $schema && $schema.$data, + $schemaValue; + if ($isData) { + out += ' var schema' + ($lvl) + ' = ' + (it.util.getData($schema.$data, $dataLvl, it.dataPathArr)) + '; '; + $schemaValue = 'schema' + $lvl; + } else { + $schemaValue = $schema; + } + if (($schema || $isData) && it.opts.uniqueItems !== false) { + if ($isData) { + out += ' var ' + ($valid) + '; if (' + ($schemaValue) + ' === false || ' + ($schemaValue) + ' === undefined) ' + ($valid) + ' = true; else if (typeof ' + ($schemaValue) + ' != \'boolean\') ' + ($valid) + ' = false; else { '; + } + out += ' var i = ' + ($data) + '.length , ' + ($valid) + ' = true , j; if (i > 1) { '; + var $itemType = it.schema.items && it.schema.items.type, + $typeIsArray = Array.isArray($itemType); + if (!$itemType || $itemType == 'object' || $itemType == 'array' || ($typeIsArray && ($itemType.indexOf('object') >= 0 || $itemType.indexOf('array') >= 0))) { + out += ' outer: for (;i--;) { for (j = i; j--;) { if (equal(' + ($data) + '[i], ' + ($data) + '[j])) { ' + ($valid) + ' = false; break outer; } } } '; + } else { + out += ' var itemIndices = {}, item; for (;i--;) { var item = ' + ($data) + '[i]; '; + var $method = 'checkDataType' + ($typeIsArray ? 's' : ''); + out += ' if (' + (it.util[$method]($itemType, 'item', it.opts.strictNumbers, true)) + ') continue; '; + if ($typeIsArray) { + out += ' if (typeof item == \'string\') item = \'"\' + item; '; + } + out += ' if (typeof itemIndices[item] == \'number\') { ' + ($valid) + ' = false; j = itemIndices[item]; break; } itemIndices[item] = i; } '; + } + out += ' } '; + if ($isData) { + out += ' } '; + } + out += ' if (!' + ($valid) + ') { '; + var $$outStack = $$outStack || []; + $$outStack.push(out); + out = ''; /* istanbul ignore else */ + if (it.createErrors !== false) { + out += ' { keyword: \'' + ('uniqueItems') + '\' , dataPath: (dataPath || \'\') + ' + (it.errorPath) + ' , schemaPath: ' + (it.util.toQuotedString($errSchemaPath)) + ' , params: { i: i, j: j } '; + if (it.opts.messages !== false) { + out += ' , message: \'should NOT have duplicate items (items ## \' + j + \' and \' + i + \' are identical)\' '; + } + if (it.opts.verbose) { + out += ' , schema: '; + if ($isData) { + out += 'validate.schema' + ($schemaPath); + } else { + out += '' + ($schema); + } + out += ' , parentSchema: validate.schema' + (it.schemaPath) + ' , data: ' + ($data) + ' '; + } + out += ' } '; + } else { + out += ' {} '; + } + var __err = out; + out = $$outStack.pop(); + if (!it.compositeRule && $breakOnError) { + /* istanbul ignore if */ + if (it.async) { + out += ' throw new ValidationError([' + (__err) + ']); '; + } else { + out += ' validate.errors = [' + (__err) + ']; return false; '; + } + } else { + out += ' var err = ' + (__err) + '; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; '; + } + out += ' } '; + if ($breakOnError) { + out += ' else { '; + } + } else { + if ($breakOnError) { + out += ' if (true) { '; + } + } + return out; +} diff --git a/packages/字体精简工具/node_modules/ajv/lib/dotjs/validate.js b/packages/字体精简工具/node_modules/ajv/lib/dotjs/validate.js new file mode 100644 index 0000000..f295824 --- /dev/null +++ b/packages/字体精简工具/node_modules/ajv/lib/dotjs/validate.js @@ -0,0 +1,482 @@ +'use strict'; +module.exports = function generate_validate(it, $keyword, $ruleType) { + var out = ''; + var $async = it.schema.$async === true, + $refKeywords = it.util.schemaHasRulesExcept(it.schema, it.RULES.all, '$ref'), + $id = it.self._getId(it.schema); + if (it.opts.strictKeywords) { + var $unknownKwd = it.util.schemaUnknownRules(it.schema, it.RULES.keywords); + if ($unknownKwd) { + var $keywordsMsg = 'unknown keyword: ' + $unknownKwd; + if (it.opts.strictKeywords === 'log') it.logger.warn($keywordsMsg); + else throw new Error($keywordsMsg); + } + } + if (it.isTop) { + out += ' var validate = '; + if ($async) { + it.async = true; + out += 'async '; + } + out += 'function(data, dataPath, parentData, parentDataProperty, rootData) { \'use strict\'; '; + if ($id && (it.opts.sourceCode || it.opts.processCode)) { + out += ' ' + ('/\*# sourceURL=' + $id + ' */') + ' '; + } + } + if (typeof it.schema == 'boolean' || !($refKeywords || it.schema.$ref)) { + var $keyword = 'false schema'; + var $lvl = it.level; + var $dataLvl = it.dataLevel; + var $schema = it.schema[$keyword]; + var $schemaPath = it.schemaPath + it.util.getProperty($keyword); + var $errSchemaPath = it.errSchemaPath + '/' + $keyword; + var $breakOnError = !it.opts.allErrors; + var $errorKeyword; + var $data = 'data' + ($dataLvl || ''); + var $valid = 'valid' + $lvl; + if (it.schema === false) { + if (it.isTop) { + $breakOnError = true; + } else { + out += ' var ' + ($valid) + ' = false; '; + } + var $$outStack = $$outStack || []; + $$outStack.push(out); + out = ''; /* istanbul ignore else */ + if (it.createErrors !== false) { + out += ' { keyword: \'' + ($errorKeyword || 'false schema') + '\' , dataPath: (dataPath || \'\') + ' + (it.errorPath) + ' , schemaPath: ' + (it.util.toQuotedString($errSchemaPath)) + ' , params: {} '; + if (it.opts.messages !== false) { + out += ' , message: \'boolean schema is false\' '; + } + if (it.opts.verbose) { + out += ' , schema: false , parentSchema: validate.schema' + (it.schemaPath) + ' , data: ' + ($data) + ' '; + } + out += ' } '; + } else { + out += ' {} '; + } + var __err = out; + out = $$outStack.pop(); + if (!it.compositeRule && $breakOnError) { + /* istanbul ignore if */ + if (it.async) { + out += ' throw new ValidationError([' + (__err) + ']); '; + } else { + out += ' validate.errors = [' + (__err) + ']; return false; '; + } + } else { + out += ' var err = ' + (__err) + '; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; '; + } + } else { + if (it.isTop) { + if ($async) { + out += ' return data; '; + } else { + out += ' validate.errors = null; return true; '; + } + } else { + out += ' var ' + ($valid) + ' = true; '; + } + } + if (it.isTop) { + out += ' }; return validate; '; + } + return out; + } + if (it.isTop) { + var $top = it.isTop, + $lvl = it.level = 0, + $dataLvl = it.dataLevel = 0, + $data = 'data'; + it.rootId = it.resolve.fullPath(it.self._getId(it.root.schema)); + it.baseId = it.baseId || it.rootId; + delete it.isTop; + it.dataPathArr = [""]; + if (it.schema.default !== undefined && it.opts.useDefaults && it.opts.strictDefaults) { + var $defaultMsg = 'default is ignored in the schema root'; + if (it.opts.strictDefaults === 'log') it.logger.warn($defaultMsg); + else throw new Error($defaultMsg); + } + out += ' var vErrors = null; '; + out += ' var errors = 0; '; + out += ' if (rootData === undefined) rootData = data; '; + } else { + var $lvl = it.level, + $dataLvl = it.dataLevel, + $data = 'data' + ($dataLvl || ''); + if ($id) it.baseId = it.resolve.url(it.baseId, $id); + if ($async && !it.async) throw new Error('async schema in sync schema'); + out += ' var errs_' + ($lvl) + ' = errors;'; + } + var $valid = 'valid' + $lvl, + $breakOnError = !it.opts.allErrors, + $closingBraces1 = '', + $closingBraces2 = ''; + var $errorKeyword; + var $typeSchema = it.schema.type, + $typeIsArray = Array.isArray($typeSchema); + if ($typeSchema && it.opts.nullable && it.schema.nullable === true) { + if ($typeIsArray) { + if ($typeSchema.indexOf('null') == -1) $typeSchema = $typeSchema.concat('null'); + } else if ($typeSchema != 'null') { + $typeSchema = [$typeSchema, 'null']; + $typeIsArray = true; + } + } + if ($typeIsArray && $typeSchema.length == 1) { + $typeSchema = $typeSchema[0]; + $typeIsArray = false; + } + if (it.schema.$ref && $refKeywords) { + if (it.opts.extendRefs == 'fail') { + throw new Error('$ref: validation keywords used in schema at path "' + it.errSchemaPath + '" (see option extendRefs)'); + } else if (it.opts.extendRefs !== true) { + $refKeywords = false; + it.logger.warn('$ref: keywords ignored in schema at path "' + it.errSchemaPath + '"'); + } + } + if (it.schema.$comment && it.opts.$comment) { + out += ' ' + (it.RULES.all.$comment.code(it, '$comment')); + } + if ($typeSchema) { + if (it.opts.coerceTypes) { + var $coerceToTypes = it.util.coerceToTypes(it.opts.coerceTypes, $typeSchema); + } + var $rulesGroup = it.RULES.types[$typeSchema]; + if ($coerceToTypes || $typeIsArray || $rulesGroup === true || ($rulesGroup && !$shouldUseGroup($rulesGroup))) { + var $schemaPath = it.schemaPath + '.type', + $errSchemaPath = it.errSchemaPath + '/type'; + var $schemaPath = it.schemaPath + '.type', + $errSchemaPath = it.errSchemaPath + '/type', + $method = $typeIsArray ? 'checkDataTypes' : 'checkDataType'; + out += ' if (' + (it.util[$method]($typeSchema, $data, it.opts.strictNumbers, true)) + ') { '; + if ($coerceToTypes) { + var $dataType = 'dataType' + $lvl, + $coerced = 'coerced' + $lvl; + out += ' var ' + ($dataType) + ' = typeof ' + ($data) + '; var ' + ($coerced) + ' = undefined; '; + if (it.opts.coerceTypes == 'array') { + out += ' if (' + ($dataType) + ' == \'object\' && Array.isArray(' + ($data) + ') && ' + ($data) + '.length == 1) { ' + ($data) + ' = ' + ($data) + '[0]; ' + ($dataType) + ' = typeof ' + ($data) + '; if (' + (it.util.checkDataType(it.schema.type, $data, it.opts.strictNumbers)) + ') ' + ($coerced) + ' = ' + ($data) + '; } '; + } + out += ' if (' + ($coerced) + ' !== undefined) ; '; + var arr1 = $coerceToTypes; + if (arr1) { + var $type, $i = -1, + l1 = arr1.length - 1; + while ($i < l1) { + $type = arr1[$i += 1]; + if ($type == 'string') { + out += ' else if (' + ($dataType) + ' == \'number\' || ' + ($dataType) + ' == \'boolean\') ' + ($coerced) + ' = \'\' + ' + ($data) + '; else if (' + ($data) + ' === null) ' + ($coerced) + ' = \'\'; '; + } else if ($type == 'number' || $type == 'integer') { + out += ' else if (' + ($dataType) + ' == \'boolean\' || ' + ($data) + ' === null || (' + ($dataType) + ' == \'string\' && ' + ($data) + ' && ' + ($data) + ' == +' + ($data) + ' '; + if ($type == 'integer') { + out += ' && !(' + ($data) + ' % 1)'; + } + out += ')) ' + ($coerced) + ' = +' + ($data) + '; '; + } else if ($type == 'boolean') { + out += ' else if (' + ($data) + ' === \'false\' || ' + ($data) + ' === 0 || ' + ($data) + ' === null) ' + ($coerced) + ' = false; else if (' + ($data) + ' === \'true\' || ' + ($data) + ' === 1) ' + ($coerced) + ' = true; '; + } else if ($type == 'null') { + out += ' else if (' + ($data) + ' === \'\' || ' + ($data) + ' === 0 || ' + ($data) + ' === false) ' + ($coerced) + ' = null; '; + } else if (it.opts.coerceTypes == 'array' && $type == 'array') { + out += ' else if (' + ($dataType) + ' == \'string\' || ' + ($dataType) + ' == \'number\' || ' + ($dataType) + ' == \'boolean\' || ' + ($data) + ' == null) ' + ($coerced) + ' = [' + ($data) + ']; '; + } + } + } + out += ' else { '; + var $$outStack = $$outStack || []; + $$outStack.push(out); + out = ''; /* istanbul ignore else */ + if (it.createErrors !== false) { + out += ' { keyword: \'' + ($errorKeyword || 'type') + '\' , dataPath: (dataPath || \'\') + ' + (it.errorPath) + ' , schemaPath: ' + (it.util.toQuotedString($errSchemaPath)) + ' , params: { type: \''; + if ($typeIsArray) { + out += '' + ($typeSchema.join(",")); + } else { + out += '' + ($typeSchema); + } + out += '\' } '; + if (it.opts.messages !== false) { + out += ' , message: \'should be '; + if ($typeIsArray) { + out += '' + ($typeSchema.join(",")); + } else { + out += '' + ($typeSchema); + } + out += '\' '; + } + if (it.opts.verbose) { + out += ' , schema: validate.schema' + ($schemaPath) + ' , parentSchema: validate.schema' + (it.schemaPath) + ' , data: ' + ($data) + ' '; + } + out += ' } '; + } else { + out += ' {} '; + } + var __err = out; + out = $$outStack.pop(); + if (!it.compositeRule && $breakOnError) { + /* istanbul ignore if */ + if (it.async) { + out += ' throw new ValidationError([' + (__err) + ']); '; + } else { + out += ' validate.errors = [' + (__err) + ']; return false; '; + } + } else { + out += ' var err = ' + (__err) + '; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; '; + } + out += ' } if (' + ($coerced) + ' !== undefined) { '; + var $parentData = $dataLvl ? 'data' + (($dataLvl - 1) || '') : 'parentData', + $parentDataProperty = $dataLvl ? it.dataPathArr[$dataLvl] : 'parentDataProperty'; + out += ' ' + ($data) + ' = ' + ($coerced) + '; '; + if (!$dataLvl) { + out += 'if (' + ($parentData) + ' !== undefined)'; + } + out += ' ' + ($parentData) + '[' + ($parentDataProperty) + '] = ' + ($coerced) + '; } '; + } else { + var $$outStack = $$outStack || []; + $$outStack.push(out); + out = ''; /* istanbul ignore else */ + if (it.createErrors !== false) { + out += ' { keyword: \'' + ($errorKeyword || 'type') + '\' , dataPath: (dataPath || \'\') + ' + (it.errorPath) + ' , schemaPath: ' + (it.util.toQuotedString($errSchemaPath)) + ' , params: { type: \''; + if ($typeIsArray) { + out += '' + ($typeSchema.join(",")); + } else { + out += '' + ($typeSchema); + } + out += '\' } '; + if (it.opts.messages !== false) { + out += ' , message: \'should be '; + if ($typeIsArray) { + out += '' + ($typeSchema.join(",")); + } else { + out += '' + ($typeSchema); + } + out += '\' '; + } + if (it.opts.verbose) { + out += ' , schema: validate.schema' + ($schemaPath) + ' , parentSchema: validate.schema' + (it.schemaPath) + ' , data: ' + ($data) + ' '; + } + out += ' } '; + } else { + out += ' {} '; + } + var __err = out; + out = $$outStack.pop(); + if (!it.compositeRule && $breakOnError) { + /* istanbul ignore if */ + if (it.async) { + out += ' throw new ValidationError([' + (__err) + ']); '; + } else { + out += ' validate.errors = [' + (__err) + ']; return false; '; + } + } else { + out += ' var err = ' + (__err) + '; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; '; + } + } + out += ' } '; + } + } + if (it.schema.$ref && !$refKeywords) { + out += ' ' + (it.RULES.all.$ref.code(it, '$ref')) + ' '; + if ($breakOnError) { + out += ' } if (errors === '; + if ($top) { + out += '0'; + } else { + out += 'errs_' + ($lvl); + } + out += ') { '; + $closingBraces2 += '}'; + } + } else { + var arr2 = it.RULES; + if (arr2) { + var $rulesGroup, i2 = -1, + l2 = arr2.length - 1; + while (i2 < l2) { + $rulesGroup = arr2[i2 += 1]; + if ($shouldUseGroup($rulesGroup)) { + if ($rulesGroup.type) { + out += ' if (' + (it.util.checkDataType($rulesGroup.type, $data, it.opts.strictNumbers)) + ') { '; + } + if (it.opts.useDefaults) { + if ($rulesGroup.type == 'object' && it.schema.properties) { + var $schema = it.schema.properties, + $schemaKeys = Object.keys($schema); + var arr3 = $schemaKeys; + if (arr3) { + var $propertyKey, i3 = -1, + l3 = arr3.length - 1; + while (i3 < l3) { + $propertyKey = arr3[i3 += 1]; + var $sch = $schema[$propertyKey]; + if ($sch.default !== undefined) { + var $passData = $data + it.util.getProperty($propertyKey); + if (it.compositeRule) { + if (it.opts.strictDefaults) { + var $defaultMsg = 'default is ignored for: ' + $passData; + if (it.opts.strictDefaults === 'log') it.logger.warn($defaultMsg); + else throw new Error($defaultMsg); + } + } else { + out += ' if (' + ($passData) + ' === undefined '; + if (it.opts.useDefaults == 'empty') { + out += ' || ' + ($passData) + ' === null || ' + ($passData) + ' === \'\' '; + } + out += ' ) ' + ($passData) + ' = '; + if (it.opts.useDefaults == 'shared') { + out += ' ' + (it.useDefault($sch.default)) + ' '; + } else { + out += ' ' + (JSON.stringify($sch.default)) + ' '; + } + out += '; '; + } + } + } + } + } else if ($rulesGroup.type == 'array' && Array.isArray(it.schema.items)) { + var arr4 = it.schema.items; + if (arr4) { + var $sch, $i = -1, + l4 = arr4.length - 1; + while ($i < l4) { + $sch = arr4[$i += 1]; + if ($sch.default !== undefined) { + var $passData = $data + '[' + $i + ']'; + if (it.compositeRule) { + if (it.opts.strictDefaults) { + var $defaultMsg = 'default is ignored for: ' + $passData; + if (it.opts.strictDefaults === 'log') it.logger.warn($defaultMsg); + else throw new Error($defaultMsg); + } + } else { + out += ' if (' + ($passData) + ' === undefined '; + if (it.opts.useDefaults == 'empty') { + out += ' || ' + ($passData) + ' === null || ' + ($passData) + ' === \'\' '; + } + out += ' ) ' + ($passData) + ' = '; + if (it.opts.useDefaults == 'shared') { + out += ' ' + (it.useDefault($sch.default)) + ' '; + } else { + out += ' ' + (JSON.stringify($sch.default)) + ' '; + } + out += '; '; + } + } + } + } + } + } + var arr5 = $rulesGroup.rules; + if (arr5) { + var $rule, i5 = -1, + l5 = arr5.length - 1; + while (i5 < l5) { + $rule = arr5[i5 += 1]; + if ($shouldUseRule($rule)) { + var $code = $rule.code(it, $rule.keyword, $rulesGroup.type); + if ($code) { + out += ' ' + ($code) + ' '; + if ($breakOnError) { + $closingBraces1 += '}'; + } + } + } + } + } + if ($breakOnError) { + out += ' ' + ($closingBraces1) + ' '; + $closingBraces1 = ''; + } + if ($rulesGroup.type) { + out += ' } '; + if ($typeSchema && $typeSchema === $rulesGroup.type && !$coerceToTypes) { + out += ' else { '; + var $schemaPath = it.schemaPath + '.type', + $errSchemaPath = it.errSchemaPath + '/type'; + var $$outStack = $$outStack || []; + $$outStack.push(out); + out = ''; /* istanbul ignore else */ + if (it.createErrors !== false) { + out += ' { keyword: \'' + ($errorKeyword || 'type') + '\' , dataPath: (dataPath || \'\') + ' + (it.errorPath) + ' , schemaPath: ' + (it.util.toQuotedString($errSchemaPath)) + ' , params: { type: \''; + if ($typeIsArray) { + out += '' + ($typeSchema.join(",")); + } else { + out += '' + ($typeSchema); + } + out += '\' } '; + if (it.opts.messages !== false) { + out += ' , message: \'should be '; + if ($typeIsArray) { + out += '' + ($typeSchema.join(",")); + } else { + out += '' + ($typeSchema); + } + out += '\' '; + } + if (it.opts.verbose) { + out += ' , schema: validate.schema' + ($schemaPath) + ' , parentSchema: validate.schema' + (it.schemaPath) + ' , data: ' + ($data) + ' '; + } + out += ' } '; + } else { + out += ' {} '; + } + var __err = out; + out = $$outStack.pop(); + if (!it.compositeRule && $breakOnError) { + /* istanbul ignore if */ + if (it.async) { + out += ' throw new ValidationError([' + (__err) + ']); '; + } else { + out += ' validate.errors = [' + (__err) + ']; return false; '; + } + } else { + out += ' var err = ' + (__err) + '; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; '; + } + out += ' } '; + } + } + if ($breakOnError) { + out += ' if (errors === '; + if ($top) { + out += '0'; + } else { + out += 'errs_' + ($lvl); + } + out += ') { '; + $closingBraces2 += '}'; + } + } + } + } + } + if ($breakOnError) { + out += ' ' + ($closingBraces2) + ' '; + } + if ($top) { + if ($async) { + out += ' if (errors === 0) return data; '; + out += ' else throw new ValidationError(vErrors); '; + } else { + out += ' validate.errors = vErrors; '; + out += ' return errors === 0; '; + } + out += ' }; return validate;'; + } else { + out += ' var ' + ($valid) + ' = errors === errs_' + ($lvl) + ';'; + } + + function $shouldUseGroup($rulesGroup) { + var rules = $rulesGroup.rules; + for (var i = 0; i < rules.length; i++) + if ($shouldUseRule(rules[i])) return true; + } + + function $shouldUseRule($rule) { + return it.schema[$rule.keyword] !== undefined || ($rule.implements && $ruleImplementsSomeKeyword($rule)); + } + + function $ruleImplementsSomeKeyword($rule) { + var impl = $rule.implements; + for (var i = 0; i < impl.length; i++) + if (it.schema[impl[i]] !== undefined) return true; + } + return out; +} diff --git a/packages/字体精简工具/node_modules/ajv/lib/keyword.js b/packages/字体精简工具/node_modules/ajv/lib/keyword.js new file mode 100644 index 0000000..06da9a2 --- /dev/null +++ b/packages/字体精简工具/node_modules/ajv/lib/keyword.js @@ -0,0 +1,146 @@ +'use strict'; + +var IDENTIFIER = /^[a-z_$][a-z0-9_$-]*$/i; +var customRuleCode = require('./dotjs/custom'); +var definitionSchema = require('./definition_schema'); + +module.exports = { + add: addKeyword, + get: getKeyword, + remove: removeKeyword, + validate: validateKeyword +}; + + +/** + * Define custom keyword + * @this Ajv + * @param {String} keyword custom keyword, should be unique (including different from all standard, custom and macro keywords). + * @param {Object} definition keyword definition object with properties `type` (type(s) which the keyword applies to), `validate` or `compile`. + * @return {Ajv} this for method chaining + */ +function addKeyword(keyword, definition) { + /* jshint validthis: true */ + /* eslint no-shadow: 0 */ + var RULES = this.RULES; + if (RULES.keywords[keyword]) + throw new Error('Keyword ' + keyword + ' is already defined'); + + if (!IDENTIFIER.test(keyword)) + throw new Error('Keyword ' + keyword + ' is not a valid identifier'); + + if (definition) { + this.validateKeyword(definition, true); + + var dataType = definition.type; + if (Array.isArray(dataType)) { + for (var i=0; i ../ajv-dist/bower.json + cd ../ajv-dist + + if [[ `git status --porcelain` ]]; then + echo "Changes detected. Updating master branch..." + git add -A + git commit -m "updated by travis build #$TRAVIS_BUILD_NUMBER" + git push --quiet origin master > /dev/null 2>&1 + fi + + echo "Publishing tag..." + + git tag $TRAVIS_TAG + git push --tags > /dev/null 2>&1 + + echo "Done" +fi diff --git a/packages/字体精简工具/node_modules/ajv/scripts/travis-gh-pages b/packages/字体精简工具/node_modules/ajv/scripts/travis-gh-pages new file mode 100644 index 0000000..b3d4f3d --- /dev/null +++ b/packages/字体精简工具/node_modules/ajv/scripts/travis-gh-pages @@ -0,0 +1,23 @@ +#!/usr/bin/env bash + +set -e + +if [[ "$TRAVIS_BRANCH" == "master" && "$TRAVIS_PULL_REQUEST" == "false" && $TRAVIS_JOB_NUMBER =~ ".3" ]]; then + git diff --name-only $TRAVIS_COMMIT_RANGE | grep -qE '\.md$|^LICENSE$|travis-gh-pages$' && { + rm -rf ../gh-pages + git clone -b gh-pages --single-branch https://${GITHUB_TOKEN}@github.com/ajv-validator/ajv.git ../gh-pages + mkdir -p ../gh-pages/_source + cp *.md ../gh-pages/_source + cp LICENSE ../gh-pages/_source + currentDir=$(pwd) + cd ../gh-pages + $currentDir/node_modules/.bin/gh-pages-generator + # remove logo from README + sed -i -E "s/]+ajv_logo[^>]+>//" index.md + git config user.email "$GIT_USER_EMAIL" + git config user.name "$GIT_USER_NAME" + git add . + git commit -am "updated by travis build #$TRAVIS_BUILD_NUMBER" + git push --quiet origin gh-pages > /dev/null 2>&1 + } +fi diff --git a/packages/字体精简工具/node_modules/ansi-regex/index.js b/packages/字体精简工具/node_modules/ansi-regex/index.js new file mode 100644 index 0000000..b9574ed --- /dev/null +++ b/packages/字体精简工具/node_modules/ansi-regex/index.js @@ -0,0 +1,4 @@ +'use strict'; +module.exports = function () { + return /[\u001b\u009b][[()#;?]*(?:[0-9]{1,4}(?:;[0-9]{0,4})*)?[0-9A-PRZcf-nqry=><]/g; +}; diff --git a/packages/字体精简工具/node_modules/ansi-regex/license b/packages/字体精简工具/node_modules/ansi-regex/license new file mode 100644 index 0000000..654d0bf --- /dev/null +++ b/packages/字体精简工具/node_modules/ansi-regex/license @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (c) Sindre Sorhus (sindresorhus.com) + +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/packages/字体精简工具/node_modules/ansi-regex/package.json b/packages/字体精简工具/node_modules/ansi-regex/package.json new file mode 100644 index 0000000..bdd5bc8 --- /dev/null +++ b/packages/字体精简工具/node_modules/ansi-regex/package.json @@ -0,0 +1,108 @@ +{ + "_from": "ansi-regex@^2.0.0", + "_id": "ansi-regex@2.1.1", + "_inBundle": false, + "_integrity": "sha1-w7M6te42DYbg5ijwRorn7yfWVN8=", + "_location": "/ansi-regex", + "_phantomChildren": {}, + "_requested": { + "type": "range", + "registry": true, + "raw": "ansi-regex@^2.0.0", + "name": "ansi-regex", + "escapedName": "ansi-regex", + "rawSpec": "^2.0.0", + "saveSpec": null, + "fetchSpec": "^2.0.0" + }, + "_requiredBy": [ + "/strip-ansi" + ], + "_resolved": "https://registry.nlark.com/ansi-regex/download/ansi-regex-2.1.1.tgz", + "_shasum": "c3b33ab5ee360d86e0e628f0468ae7ef27d654df", + "_spec": "ansi-regex@^2.0.0", + "_where": "D:\\workspace\\plugin\\mini_font\\packages\\mini_font\\publish\\mini_font\\node_modules\\strip-ansi", + "author": { + "name": "Sindre Sorhus", + "email": "sindresorhus@gmail.com", + "url": "sindresorhus.com" + }, + "bugs": { + "url": "https://github.com/chalk/ansi-regex/issues" + }, + "bundleDependencies": false, + "deprecated": false, + "description": "Regular expression for matching ANSI escape codes", + "devDependencies": { + "ava": "0.17.0", + "xo": "0.16.0" + }, + "engines": { + "node": ">=0.10.0" + }, + "files": [ + "index.js" + ], + "homepage": "https://github.com/chalk/ansi-regex#readme", + "keywords": [ + "ansi", + "styles", + "color", + "colour", + "colors", + "terminal", + "console", + "cli", + "string", + "tty", + "escape", + "formatting", + "rgb", + "256", + "shell", + "xterm", + "command-line", + "text", + "regex", + "regexp", + "re", + "match", + "test", + "find", + "pattern" + ], + "license": "MIT", + "maintainers": [ + { + "name": "Sindre Sorhus", + "email": "sindresorhus@gmail.com", + "url": "sindresorhus.com" + }, + { + "name": "Joshua Appelman", + "email": "jappelman@xebia.com", + "url": "jbnicolai.com" + }, + { + "name": "JD Ballard", + "email": "i.am.qix@gmail.com", + "url": "github.com/qix-" + } + ], + "name": "ansi-regex", + "repository": { + "type": "git", + "url": "git+https://github.com/chalk/ansi-regex.git" + }, + "scripts": { + "test": "xo && ava --verbose", + "view-supported": "node fixtures/view-codes.js" + }, + "version": "2.1.1", + "xo": { + "rules": { + "guard-for-in": 0, + "no-loop-func": 0 + } + } +} diff --git a/packages/字体精简工具/node_modules/ansi-regex/readme.md b/packages/字体精简工具/node_modules/ansi-regex/readme.md new file mode 100644 index 0000000..6a928ed --- /dev/null +++ b/packages/字体精简工具/node_modules/ansi-regex/readme.md @@ -0,0 +1,39 @@ +# ansi-regex [![Build Status](https://travis-ci.org/chalk/ansi-regex.svg?branch=master)](https://travis-ci.org/chalk/ansi-regex) + +> Regular expression for matching [ANSI escape codes](http://en.wikipedia.org/wiki/ANSI_escape_code) + + +## Install + +``` +$ npm install --save ansi-regex +``` + + +## Usage + +```js +const ansiRegex = require('ansi-regex'); + +ansiRegex().test('\u001b[4mcake\u001b[0m'); +//=> true + +ansiRegex().test('cake'); +//=> false + +'\u001b[4mcake\u001b[0m'.match(ansiRegex()); +//=> ['\u001b[4m', '\u001b[0m'] +``` + +## FAQ + +### Why do you test for codes not in the ECMA 48 standard? + +Some of the codes we run as a test are codes that we acquired finding various lists of non-standard or manufacturer specific codes. If I recall correctly, we test for both standard and non-standard codes, as most of them follow the same or similar format and can be safely matched in strings without the risk of removing actual string content. There are a few non-standard control codes that do not follow the traditional format (i.e. they end in numbers) thus forcing us to exclude them from the test because we cannot reliably match them. + +On the historical side, those ECMA standards were established in the early 90's whereas the VT100, for example, was designed in the mid/late 70's. At that point in time, control codes were still pretty ungoverned and engineers used them for a multitude of things, namely to activate hardware ports that may have been proprietary. Somewhere else you see a similar 'anarchy' of codes is in the x86 architecture for processors; there are a ton of "interrupts" that can mean different things on certain brands of processors, most of which have been phased out. + + +## License + +MIT © [Sindre Sorhus](http://sindresorhus.com) diff --git a/packages/字体精简工具/node_modules/append-buffer/LICENSE b/packages/字体精简工具/node_modules/append-buffer/LICENSE new file mode 100644 index 0000000..ffb7ec5 --- /dev/null +++ b/packages/字体精简工具/node_modules/append-buffer/LICENSE @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (c) 2017, Brian Woodward. + +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/packages/字体精简工具/node_modules/append-buffer/README.md b/packages/字体精简工具/node_modules/append-buffer/README.md new file mode 100644 index 0000000..681a3c3 --- /dev/null +++ b/packages/字体精简工具/node_modules/append-buffer/README.md @@ -0,0 +1,95 @@ +# append-buffer [![NPM version](https://img.shields.io/npm/v/append-buffer.svg?style=flat)](https://www.npmjs.com/package/append-buffer) [![NPM monthly downloads](https://img.shields.io/npm/dm/append-buffer.svg?style=flat)](https://npmjs.org/package/append-buffer) [![NPM total downloads](https://img.shields.io/npm/dt/append-buffer.svg?style=flat)](https://npmjs.org/package/append-buffer) [![Linux Build Status](https://img.shields.io/travis/doowb/append-buffer.svg?style=flat&label=Travis)](https://travis-ci.org/doowb/append-buffer) [![Windows Build Status](https://img.shields.io/appveyor/ci/doowb/append-buffer.svg?style=flat&label=AppVeyor)](https://ci.appveyor.com/project/doowb/append-buffer) + +> Append a buffer to another buffer ensuring to preserve line ending characters. + +## Install + +Install with [npm](https://www.npmjs.com/): + +```sh +$ npm install --save append-buffer +``` + +Install with [yarn](https://yarnpkg.com): + +```sh +$ yarn add append-buffer +``` + +## Usage + +```js +var appendBuffer = require('append-buffer'); +``` + +## API + +### [appendBuffer](index.js#L28) + +Append a buffer to another buffer ensuring to preserve line ending characters. + +**Params** + +* `buf` **{Buffer}**: Buffer that will be used to check for an existing line ending. The suffix is appended to this. +* `suffix` **{Buffer}**: Buffer that will be appended to the buf. +* `returns` **{Buffer}**: Final Buffer + +**Example** + +```js +console.log([appendBuffer(new Buffer('abc\r\n'), new Buffer('def')).toString()]); +//=> [ 'abc\r\ndef\r\n' ] + +console.log([appendBuffer(new Buffer('abc\n'), new Buffer('def')).toString()]); +//=> [ 'abc\ndef\n' ] + +// uses os.EOL when a line ending is not found +console.log([appendBuffer(new Buffer('abc'), new Buffer('def')).toString()]); +//=> [ 'abc\ndef' ] +``` + +## Attribution + +The code in this module was originally added in a [PR](https://github.com/jonschlinkert/file-normalize/pull/3) to [file-normalize](https://github.com/jonschlinkert/file-normalize). It has been split out to allow for standalone use cases. + +## About + +### Contributing + +Pull requests and stars are always welcome. For bugs and feature requests, [please create an issue](../../issues/new). + +Please read the [contributing guide](.github/contributing.md) for advice on opening issues, pull requests, and coding standards. + +### Building docs + +_(This project's readme.md is generated by [verb](https://github.com/verbose/verb-generate-readme), please don't edit the readme directly. Any changes to the readme must be made in the [.verb.md](.verb.md) readme template.)_ + +To generate the readme, run the following command: + +```sh +$ npm install -g verbose/verb#dev verb-generate-readme && verb +``` + +### Running tests + +Running and reviewing unit tests is a great way to get familiarized with a library and its API. You can install dependencies and run tests with the following command: + +```sh +$ npm install && npm test +``` + +### Author + +**Brian Woodward** + +* [github/doowb](https://github.com/doowb) +* [twitter/doowb](https://twitter.com/doowb) + +### License + +Copyright © 2017, [Brian Woodward](https://doowb.com). +Released under the [MIT License](LICENSE). + +*** + +_This file was generated by [verb-generate-readme](https://github.com/verbose/verb-generate-readme), v0.6.0, on August 01, 2017._ \ No newline at end of file diff --git a/packages/字体精简工具/node_modules/append-buffer/index.js b/packages/字体精简工具/node_modules/append-buffer/index.js new file mode 100644 index 0000000..a385570 --- /dev/null +++ b/packages/字体精简工具/node_modules/append-buffer/index.js @@ -0,0 +1,41 @@ +'use strict'; + +var os = require('os'); +var equals = require('buffer-equal'); +var cr = new Buffer('\r\n'); +var nl = new Buffer('\n'); + +/** + * Append a buffer to another buffer ensuring to preserve line ending characters. + * + * ```js + * console.log([appendBuffer(new Buffer('abc\r\n'), new Buffer('def')).toString()]); + * //=> [ 'abc\r\ndef\r\n' ] + * + * console.log([appendBuffer(new Buffer('abc\n'), new Buffer('def')).toString()]); + * //=> [ 'abc\ndef\n' ] + * + * // uses os.EOL when a line ending is not found + * console.log([appendBuffer(new Buffer('abc'), new Buffer('def')).toString()]); + * //=> [ 'abc\ndef' ] + * * ``` + * @param {Buffer} `buf` Buffer that will be used to check for an existing line ending. The suffix is appended to this. + * @param {Buffer} `suffix` Buffer that will be appended to the buf. + * @return {Buffer} Final Buffer + * @api public + */ + +module.exports = function appendBuffer(buf, suffix) { + if (!suffix || !suffix.length) { + return buf; + } + var eol; + if (equals(buf.slice(-2), cr)) { + eol = cr; + } else if (equals(buf.slice(-1), nl)) { + eol = nl; + } else { + return Buffer.concat([buf, new Buffer(os.EOL), new Buffer(suffix)]); + } + return Buffer.concat([buf, new Buffer(suffix), eol]); +}; diff --git a/packages/字体精简工具/node_modules/append-buffer/package.json b/packages/字体精简工具/node_modules/append-buffer/package.json new file mode 100644 index 0000000..0374267 --- /dev/null +++ b/packages/字体精简工具/node_modules/append-buffer/package.json @@ -0,0 +1,84 @@ +{ + "_from": "append-buffer@^1.0.2", + "_id": "append-buffer@1.0.2", + "_inBundle": false, + "_integrity": "sha1-2CIM9GYIFSXv6lBhTz3mUU36WPE=", + "_location": "/append-buffer", + "_phantomChildren": {}, + "_requested": { + "type": "range", + "registry": true, + "raw": "append-buffer@^1.0.2", + "name": "append-buffer", + "escapedName": "append-buffer", + "rawSpec": "^1.0.2", + "saveSpec": null, + "fetchSpec": "^1.0.2" + }, + "_requiredBy": [ + "/vinyl-sourcemap" + ], + "_resolved": "https://registry.nlark.com/append-buffer/download/append-buffer-1.0.2.tgz", + "_shasum": "d8220cf466081525efea50614f3de6514dfa58f1", + "_spec": "append-buffer@^1.0.2", + "_where": "D:\\workspace\\plugin\\mini_font\\packages\\mini_font\\publish\\mini_font\\node_modules\\vinyl-sourcemap", + "author": { + "name": "Brian Woodward", + "url": "https://doowb.com" + }, + "bugs": { + "url": "https://github.com/doowb/append-buffer/issues" + }, + "bundleDependencies": false, + "dependencies": { + "buffer-equal": "^1.0.0" + }, + "deprecated": false, + "description": "Append a buffer to another buffer ensuring to preserve line ending characters.", + "devDependencies": { + "gulp-format-md": "^1.0.0", + "mocha": "^3.5.0" + }, + "engines": { + "node": ">=0.10.0" + }, + "files": [ + "index.js" + ], + "homepage": "https://github.com/doowb/append-buffer", + "keywords": [ + "append", + "append-buffer", + "concat", + "concat-buffer", + "eol", + "join", + "join-buffer", + "normalize", + "buffer" + ], + "license": "MIT", + "main": "index.js", + "name": "append-buffer", + "repository": { + "type": "git", + "url": "git+https://github.com/doowb/append-buffer.git" + }, + "scripts": { + "test": "mocha" + }, + "verb": { + "toc": false, + "layout": "default", + "tasks": [ + "readme" + ], + "plugins": [ + "gulp-format-md" + ], + "lint": { + "reflinks": true + } + }, + "version": "1.0.2" +} diff --git a/packages/字体精简工具/node_modules/aproba/LICENSE b/packages/字体精简工具/node_modules/aproba/LICENSE new file mode 100644 index 0000000..f4be44d --- /dev/null +++ b/packages/字体精简工具/node_modules/aproba/LICENSE @@ -0,0 +1,14 @@ +Copyright (c) 2015, Rebecca Turner + +Permission to use, copy, modify, and/or distribute this software for any +purpose with or without fee is hereby granted, provided that the above +copyright notice and this permission notice appear in all copies. + +THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES +WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF +MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR +ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES +WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN +ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF +OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + diff --git a/packages/字体精简工具/node_modules/aproba/README.md b/packages/字体精简工具/node_modules/aproba/README.md new file mode 100644 index 0000000..0bfc594 --- /dev/null +++ b/packages/字体精简工具/node_modules/aproba/README.md @@ -0,0 +1,94 @@ +aproba +====== + +A ridiculously light-weight function argument validator + +``` +var validate = require("aproba") + +function myfunc(a, b, c) { + // `a` must be a string, `b` a number, `c` a function + validate('SNF', arguments) // [a,b,c] is also valid +} + +myfunc('test', 23, function () {}) // ok +myfunc(123, 23, function () {}) // type error +myfunc('test', 23) // missing arg error +myfunc('test', 23, function () {}, true) // too many args error + +``` + +Valid types are: + +| type | description +| :--: | :---------- +| * | matches any type +| A | `Array.isArray` OR an `arguments` object +| S | typeof == string +| N | typeof == number +| F | typeof == function +| O | typeof == object and not type A and not type E +| B | typeof == boolean +| E | `instanceof Error` OR `null` **(special: see below)** +| Z | == `null` + +Validation failures throw one of three exception types, distinguished by a +`code` property of `EMISSINGARG`, `EINVALIDTYPE` or `ETOOMANYARGS`. + +If you pass in an invalid type then it will throw with a code of +`EUNKNOWNTYPE`. + +If an **error** argument is found and is not null then the remaining +arguments are optional. That is, if you say `ESO` then that's like using a +non-magical `E` in: `E|ESO|ZSO`. + +### But I have optional arguments?! + +You can provide more than one signature by separating them with pipes `|`. +If any signature matches the arguments then they'll be considered valid. + +So for example, say you wanted to write a signature for +`fs.createWriteStream`. The docs for it describe it thusly: + +``` +fs.createWriteStream(path[, options]) +``` + +This would be a signature of `SO|S`. That is, a string and and object, or +just a string. + +Now, if you read the full `fs` docs, you'll see that actually path can ALSO +be a buffer. And options can be a string, that is: +``` +path | +options | +``` + +To reproduce this you have to fully enumerate all of the possible +combinations and that implies a signature of `SO|SS|OO|OS|S|O`. The +awkwardness is a feature: It reminds you of the complexity you're adding to +your API when you do this sort of thing. + + +### Browser support + +This has no dependencies and should work in browsers, though you'll have +noisier stack traces. + +### Why this exists + +I wanted a very simple argument validator. It needed to do two things: + +1. Be more concise and easier to use than assertions + +2. Not encourage an infinite bikeshed of DSLs + +This is why types are specified by a single character and there's no such +thing as an optional argument. + +This is not intended to validate user data. This is specifically about +asserting the interface of your functions. + +If you need greater validation, I encourage you to write them by hand or +look elsewhere. + diff --git a/packages/字体精简工具/node_modules/aproba/index.js b/packages/字体精简工具/node_modules/aproba/index.js new file mode 100644 index 0000000..6f3f797 --- /dev/null +++ b/packages/字体精简工具/node_modules/aproba/index.js @@ -0,0 +1,105 @@ +'use strict' + +function isArguments (thingy) { + return thingy != null && typeof thingy === 'object' && thingy.hasOwnProperty('callee') +} + +var types = { + '*': {label: 'any', check: function () { return true }}, + A: {label: 'array', check: function (thingy) { return Array.isArray(thingy) || isArguments(thingy) }}, + S: {label: 'string', check: function (thingy) { return typeof thingy === 'string' }}, + N: {label: 'number', check: function (thingy) { return typeof thingy === 'number' }}, + F: {label: 'function', check: function (thingy) { return typeof thingy === 'function' }}, + O: {label: 'object', check: function (thingy) { return typeof thingy === 'object' && thingy != null && !types.A.check(thingy) && !types.E.check(thingy) }}, + B: {label: 'boolean', check: function (thingy) { return typeof thingy === 'boolean' }}, + E: {label: 'error', check: function (thingy) { return thingy instanceof Error }}, + Z: {label: 'null', check: function (thingy) { return thingy == null }} +} + +function addSchema (schema, arity) { + var group = arity[schema.length] = arity[schema.length] || [] + if (group.indexOf(schema) === -1) group.push(schema) +} + +var validate = module.exports = function (rawSchemas, args) { + if (arguments.length !== 2) throw wrongNumberOfArgs(['SA'], arguments.length) + if (!rawSchemas) throw missingRequiredArg(0, 'rawSchemas') + if (!args) throw missingRequiredArg(1, 'args') + if (!types.S.check(rawSchemas)) throw invalidType(0, ['string'], rawSchemas) + if (!types.A.check(args)) throw invalidType(1, ['array'], args) + var schemas = rawSchemas.split('|') + var arity = {} + + schemas.forEach(function (schema) { + for (var ii = 0; ii < schema.length; ++ii) { + var type = schema[ii] + if (!types[type]) throw unknownType(ii, type) + } + if (/E.*E/.test(schema)) throw moreThanOneError(schema) + addSchema(schema, arity) + if (/E/.test(schema)) { + addSchema(schema.replace(/E.*$/, 'E'), arity) + addSchema(schema.replace(/E/, 'Z'), arity) + if (schema.length === 1) addSchema('', arity) + } + }) + var matching = arity[args.length] + if (!matching) { + throw wrongNumberOfArgs(Object.keys(arity), args.length) + } + for (var ii = 0; ii < args.length; ++ii) { + var newMatching = matching.filter(function (schema) { + var type = schema[ii] + var typeCheck = types[type].check + return typeCheck(args[ii]) + }) + if (!newMatching.length) { + var labels = matching.map(function (schema) { + return types[schema[ii]].label + }).filter(function (schema) { return schema != null }) + throw invalidType(ii, labels, args[ii]) + } + matching = newMatching + } +} + +function missingRequiredArg (num) { + return newException('EMISSINGARG', 'Missing required argument #' + (num + 1)) +} + +function unknownType (num, type) { + return newException('EUNKNOWNTYPE', 'Unknown type ' + type + ' in argument #' + (num + 1)) +} + +function invalidType (num, expectedTypes, value) { + var valueType + Object.keys(types).forEach(function (typeCode) { + if (types[typeCode].check(value)) valueType = types[typeCode].label + }) + return newException('EINVALIDTYPE', 'Argument #' + (num + 1) + ': Expected ' + + englishList(expectedTypes) + ' but got ' + valueType) +} + +function englishList (list) { + return list.join(', ').replace(/, ([^,]+)$/, ' or $1') +} + +function wrongNumberOfArgs (expected, got) { + var english = englishList(expected) + var args = expected.every(function (ex) { return ex.length === 1 }) + ? 'argument' + : 'arguments' + return newException('EWRONGARGCOUNT', 'Expected ' + english + ' ' + args + ' but got ' + got) +} + +function moreThanOneError (schema) { + return newException('ETOOMANYERRORTYPES', + 'Only one error type per argument signature is allowed, more than one found in "' + schema + '"') +} + +function newException (code, msg) { + var e = new Error(msg) + e.code = code + if (Error.captureStackTrace) Error.captureStackTrace(e, validate) + return e +} diff --git a/packages/字体精简工具/node_modules/aproba/package.json b/packages/字体精简工具/node_modules/aproba/package.json new file mode 100644 index 0000000..79a1c23 --- /dev/null +++ b/packages/字体精简工具/node_modules/aproba/package.json @@ -0,0 +1,62 @@ +{ + "_from": "aproba@^1.0.3", + "_id": "aproba@1.2.0", + "_inBundle": false, + "_integrity": "sha1-aALmJk79GMeQobDVF/DyYnvyyUo=", + "_location": "/aproba", + "_phantomChildren": {}, + "_requested": { + "type": "range", + "registry": true, + "raw": "aproba@^1.0.3", + "name": "aproba", + "escapedName": "aproba", + "rawSpec": "^1.0.3", + "saveSpec": null, + "fetchSpec": "^1.0.3" + }, + "_requiredBy": [ + "/gauge" + ], + "_resolved": "https://registry.nlark.com/aproba/download/aproba-1.2.0.tgz", + "_shasum": "6802e6264efd18c790a1b0d517f0f2627bf2c94a", + "_spec": "aproba@^1.0.3", + "_where": "D:\\workspace\\plugin\\mini_font\\packages\\mini_font\\publish\\mini_font\\node_modules\\gauge", + "author": { + "name": "Rebecca Turner", + "email": "me@re-becca.org" + }, + "bugs": { + "url": "https://github.com/iarna/aproba/issues" + }, + "bundleDependencies": false, + "dependencies": {}, + "deprecated": false, + "description": "A ridiculously light-weight argument validator (now browser friendly)", + "devDependencies": { + "standard": "^10.0.3", + "tap": "^10.0.2" + }, + "directories": { + "test": "test" + }, + "files": [ + "index.js" + ], + "homepage": "https://github.com/iarna/aproba", + "keywords": [ + "argument", + "validate" + ], + "license": "ISC", + "main": "index.js", + "name": "aproba", + "repository": { + "type": "git", + "url": "git+https://github.com/iarna/aproba.git" + }, + "scripts": { + "test": "standard && tap -j3 test/*.js" + }, + "version": "1.2.0" +} diff --git a/packages/字体精简工具/node_modules/are-we-there-yet/CHANGES.md b/packages/字体精简工具/node_modules/are-we-there-yet/CHANGES.md new file mode 100644 index 0000000..21f3b1c --- /dev/null +++ b/packages/字体精简工具/node_modules/are-we-there-yet/CHANGES.md @@ -0,0 +1,37 @@ +Hi, figured we could actually use a changelog now: + +## 1.1.5 2018-05-24 + +* [#92](https://github.com/iarna/are-we-there-yet/pull/92) Fix bug where + `finish` would throw errors when including `TrackerStream` objects in + `TrackerGroup` collections. (@brianloveswords) + +## 1.1.4 2017-04-21 + +* Fix typo in package.json + +## 1.1.3 2017-04-21 + +* Improve documentation and limit files included in the distribution. + +## 1.1.2 2016-03-15 + +* Add tracker group cycle detection and tests for it + +## 1.1.1 2016-01-29 + +* Fix a typo in stream completion tracker + +## 1.1.0 2016-01-29 + +* Rewrote completion percent computation to be low impact– no more walking a + tree of completion groups every time we need this info. Previously, with + medium sized tree of completion groups, even a relatively modest number of + calls to the top level `completed()` method would result in absurd numbers + of calls overall as it walked down the tree. We now, instead, keep track as + we bubble up changes, so the computation is limited to when data changes and + to the depth of that one branch, instead of _every_ node. (Plus, we were already + incurring _this_ cost, since we already bubbled out changes.) +* Moved different tracker types out to their own files. +* Made tests test for TOO MANY events too. +* Standarized the source code formatting diff --git a/packages/字体精简工具/node_modules/are-we-there-yet/LICENSE b/packages/字体精简工具/node_modules/are-we-there-yet/LICENSE new file mode 100644 index 0000000..af45880 --- /dev/null +++ b/packages/字体精简工具/node_modules/are-we-there-yet/LICENSE @@ -0,0 +1,5 @@ +Copyright (c) 2015, Rebecca Turner + +Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies. + +THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. diff --git a/packages/字体精简工具/node_modules/are-we-there-yet/README.md b/packages/字体精简工具/node_modules/are-we-there-yet/README.md new file mode 100644 index 0000000..7e2b42d --- /dev/null +++ b/packages/字体精简工具/node_modules/are-we-there-yet/README.md @@ -0,0 +1,195 @@ +are-we-there-yet +---------------- + +Track complex hiearchies of asynchronous task completion statuses. This is +intended to give you a way of recording and reporting the progress of the big +recursive fan-out and gather type workflows that are so common in async. + +What you do with this completion data is up to you, but the most common use case is to +feed it to one of the many progress bar modules. + +Most progress bar modules include a rudamentary version of this, but my +needs were more complex. + +Usage +===== + +```javascript +var TrackerGroup = require("are-we-there-yet").TrackerGroup + +var top = new TrackerGroup("program") + +var single = top.newItem("one thing", 100) +single.completeWork(20) + +console.log(top.completed()) // 0.2 + +fs.stat("file", function(er, stat) { + if (er) throw er + var stream = top.newStream("file", stat.size) + console.log(top.completed()) // now 0.1 as single is 50% of the job and is 20% complete + // and 50% * 20% == 10% + fs.createReadStream("file").pipe(stream).on("data", function (chunk) { + // do stuff with chunk + }) + top.on("change", function (name) { + // called each time a chunk is read from "file" + // top.completed() will start at 0.1 and fill up to 0.6 as the file is read + }) +}) +``` + +Shared Methods +============== + +* var completed = tracker.completed() + +Implemented in: `Tracker`, `TrackerGroup`, `TrackerStream` + +Returns the ratio of completed work to work to be done. Range of 0 to 1. + +* tracker.finish() + +Implemented in: `Tracker`, `TrackerGroup` + +Marks the tracker as completed. With a TrackerGroup this marks all of its +components as completed. + +Marks all of the components of this tracker as finished, which in turn means +that `tracker.completed()` for this will now be 1. + +This will result in one or more `change` events being emitted. + +Events +====== + +All tracker objects emit `change` events with the following arguments: + +``` +function (name, completed, tracker) +``` + +`name` is the name of the tracker that originally emitted the event, +or if it didn't have one, the first containing tracker group that had one. + +`completed` is the percent complete (as returned by `tracker.completed()` method). + +`tracker` is the tracker object that you are listening for events on. + +TrackerGroup +============ + +* var tracker = new TrackerGroup(**name**) + + * **name** *(optional)* - The name of this tracker group, used in change + notifications if the component updating didn't have a name. Defaults to undefined. + +Creates a new empty tracker aggregation group. These are trackers whose +completion status is determined by the completion status of other trackers. + +* tracker.addUnit(**otherTracker**, **weight**) + + * **otherTracker** - Any of the other are-we-there-yet tracker objects + * **weight** *(optional)* - The weight to give the tracker, defaults to 1. + +Adds the **otherTracker** to this aggregation group. The weight determines +how long you expect this tracker to take to complete in proportion to other +units. So for instance, if you add one tracker with a weight of 1 and +another with a weight of 2, you're saying the second will take twice as long +to complete as the first. As such, the first will account for 33% of the +completion of this tracker and the second will account for the other 67%. + +Returns **otherTracker**. + +* var subGroup = tracker.newGroup(**name**, **weight**) + +The above is exactly equivalent to: + +```javascript + var subGroup = tracker.addUnit(new TrackerGroup(name), weight) +``` + +* var subItem = tracker.newItem(**name**, **todo**, **weight**) + +The above is exactly equivalent to: + +```javascript + var subItem = tracker.addUnit(new Tracker(name, todo), weight) +``` + +* var subStream = tracker.newStream(**name**, **todo**, **weight**) + +The above is exactly equivalent to: + +```javascript + var subStream = tracker.addUnit(new TrackerStream(name, todo), weight) +``` + +* console.log( tracker.debug() ) + +Returns a tree showing the completion of this tracker group and all of its +children, including recursively entering all of the children. + +Tracker +======= + +* var tracker = new Tracker(**name**, **todo**) + + * **name** *(optional)* The name of this counter to report in change + events. Defaults to undefined. + * **todo** *(optional)* The amount of work todo (a number). Defaults to 0. + +Ordinarily these are constructed as a part of a tracker group (via +`newItem`). + +* var completed = tracker.completed() + +Returns the ratio of completed work to work to be done. Range of 0 to 1. If +total work to be done is 0 then it will return 0. + +* tracker.addWork(**todo**) + + * **todo** A number to add to the amount of work to be done. + +Increases the amount of work to be done, thus decreasing the completion +percentage. Triggers a `change` event. + +* tracker.completeWork(**completed**) + + * **completed** A number to add to the work complete + +Increase the amount of work complete, thus increasing the completion percentage. +Will never increase the work completed past the amount of work todo. That is, +percentages > 100% are not allowed. Triggers a `change` event. + +* tracker.finish() + +Marks this tracker as finished, tracker.completed() will now be 1. Triggers +a `change` event. + +TrackerStream +============= + +* var tracker = new TrackerStream(**name**, **size**, **options**) + + * **name** *(optional)* The name of this counter to report in change + events. Defaults to undefined. + * **size** *(optional)* The number of bytes being sent through this stream. + * **options** *(optional)* A hash of stream options + +The tracker stream object is a pass through stream that updates an internal +tracker object each time a block passes through. It's intended to track +downloads, file extraction and other related activities. You use it by piping +your data source into it and then using it as your data source. + +If your data has a length attribute then that's used as the amount of work +completed when the chunk is passed through. If it does not (eg, object +streams) then each chunk counts as completing 1 unit of work, so your size +should be the total number of objects being streamed. + +* tracker.addWork(**todo**) + + * **todo** Increase the expected overall size by **todo** bytes. + +Increases the amount of work to be done, thus decreasing the completion +percentage. Triggers a `change` event. diff --git a/packages/字体精简工具/node_modules/are-we-there-yet/index.js b/packages/字体精简工具/node_modules/are-we-there-yet/index.js new file mode 100644 index 0000000..57d8743 --- /dev/null +++ b/packages/字体精简工具/node_modules/are-we-there-yet/index.js @@ -0,0 +1,4 @@ +'use strict' +exports.TrackerGroup = require('./tracker-group.js') +exports.Tracker = require('./tracker.js') +exports.TrackerStream = require('./tracker-stream.js') diff --git a/packages/字体精简工具/node_modules/are-we-there-yet/package.json b/packages/字体精简工具/node_modules/are-we-there-yet/package.json new file mode 100644 index 0000000..2042706 --- /dev/null +++ b/packages/字体精简工具/node_modules/are-we-there-yet/package.json @@ -0,0 +1,63 @@ +{ + "_from": "are-we-there-yet@~1.1.2", + "_id": "are-we-there-yet@1.1.5", + "_inBundle": false, + "_integrity": "sha1-SzXClE8GKov82mZBB2A1D+nd/CE=", + "_location": "/are-we-there-yet", + "_phantomChildren": {}, + "_requested": { + "type": "range", + "registry": true, + "raw": "are-we-there-yet@~1.1.2", + "name": "are-we-there-yet", + "escapedName": "are-we-there-yet", + "rawSpec": "~1.1.2", + "saveSpec": null, + "fetchSpec": "~1.1.2" + }, + "_requiredBy": [ + "/npmlog" + ], + "_resolved": "https://registry.nlark.com/are-we-there-yet/download/are-we-there-yet-1.1.5.tgz", + "_shasum": "4b35c2944f062a8bfcda66410760350fe9ddfc21", + "_spec": "are-we-there-yet@~1.1.2", + "_where": "D:\\workspace\\plugin\\mini_font\\packages\\mini_font\\publish\\mini_font\\node_modules\\npmlog", + "author": { + "name": "Rebecca Turner", + "url": "http://re-becca.org" + }, + "bugs": { + "url": "https://github.com/iarna/are-we-there-yet/issues" + }, + "bundleDependencies": false, + "dependencies": { + "delegates": "^1.0.0", + "readable-stream": "^2.0.6" + }, + "deprecated": false, + "description": "Keep track of the overall completion of many disparate processes", + "devDependencies": { + "standard": "^11.0.1", + "tap": "^12.0.1" + }, + "files": [ + "index.js", + "tracker-base.js", + "tracker-group.js", + "tracker-stream.js", + "tracker.js", + "CHANGES.md" + ], + "homepage": "https://github.com/iarna/are-we-there-yet", + "license": "ISC", + "main": "index.js", + "name": "are-we-there-yet", + "repository": { + "type": "git", + "url": "git+https://github.com/iarna/are-we-there-yet.git" + }, + "scripts": { + "test": "standard && tap test/*.js" + }, + "version": "1.1.5" +} diff --git a/packages/字体精简工具/node_modules/are-we-there-yet/tracker-base.js b/packages/字体精简工具/node_modules/are-we-there-yet/tracker-base.js new file mode 100644 index 0000000..6f43687 --- /dev/null +++ b/packages/字体精简工具/node_modules/are-we-there-yet/tracker-base.js @@ -0,0 +1,11 @@ +'use strict' +var EventEmitter = require('events').EventEmitter +var util = require('util') + +var trackerId = 0 +var TrackerBase = module.exports = function (name) { + EventEmitter.call(this) + this.id = ++trackerId + this.name = name +} +util.inherits(TrackerBase, EventEmitter) diff --git a/packages/字体精简工具/node_modules/are-we-there-yet/tracker-group.js b/packages/字体精简工具/node_modules/are-we-there-yet/tracker-group.js new file mode 100644 index 0000000..9759e12 --- /dev/null +++ b/packages/字体精简工具/node_modules/are-we-there-yet/tracker-group.js @@ -0,0 +1,107 @@ +'use strict' +var util = require('util') +var TrackerBase = require('./tracker-base.js') +var Tracker = require('./tracker.js') +var TrackerStream = require('./tracker-stream.js') + +var TrackerGroup = module.exports = function (name) { + TrackerBase.call(this, name) + this.parentGroup = null + this.trackers = [] + this.completion = {} + this.weight = {} + this.totalWeight = 0 + this.finished = false + this.bubbleChange = bubbleChange(this) +} +util.inherits(TrackerGroup, TrackerBase) + +function bubbleChange (trackerGroup) { + return function (name, completed, tracker) { + trackerGroup.completion[tracker.id] = completed + if (trackerGroup.finished) return + trackerGroup.emit('change', name || trackerGroup.name, trackerGroup.completed(), trackerGroup) + } +} + +TrackerGroup.prototype.nameInTree = function () { + var names = [] + var from = this + while (from) { + names.unshift(from.name) + from = from.parentGroup + } + return names.join('/') +} + +TrackerGroup.prototype.addUnit = function (unit, weight) { + if (unit.addUnit) { + var toTest = this + while (toTest) { + if (unit === toTest) { + throw new Error( + 'Attempted to add tracker group ' + + unit.name + ' to tree that already includes it ' + + this.nameInTree(this)) + } + toTest = toTest.parentGroup + } + unit.parentGroup = this + } + this.weight[unit.id] = weight || 1 + this.totalWeight += this.weight[unit.id] + this.trackers.push(unit) + this.completion[unit.id] = unit.completed() + unit.on('change', this.bubbleChange) + if (!this.finished) this.emit('change', unit.name, this.completion[unit.id], unit) + return unit +} + +TrackerGroup.prototype.completed = function () { + if (this.trackers.length === 0) return 0 + var valPerWeight = 1 / this.totalWeight + var completed = 0 + for (var ii = 0; ii < this.trackers.length; ii++) { + var trackerId = this.trackers[ii].id + completed += valPerWeight * this.weight[trackerId] * this.completion[trackerId] + } + return completed +} + +TrackerGroup.prototype.newGroup = function (name, weight) { + return this.addUnit(new TrackerGroup(name), weight) +} + +TrackerGroup.prototype.newItem = function (name, todo, weight) { + return this.addUnit(new Tracker(name, todo), weight) +} + +TrackerGroup.prototype.newStream = function (name, todo, weight) { + return this.addUnit(new TrackerStream(name, todo), weight) +} + +TrackerGroup.prototype.finish = function () { + this.finished = true + if (!this.trackers.length) this.addUnit(new Tracker(), 1, true) + for (var ii = 0; ii < this.trackers.length; ii++) { + var tracker = this.trackers[ii] + tracker.finish() + tracker.removeListener('change', this.bubbleChange) + } + this.emit('change', this.name, 1, this) +} + +var buffer = ' ' +TrackerGroup.prototype.debug = function (depth) { + depth = depth || 0 + var indent = depth ? buffer.substr(0, depth) : '' + var output = indent + (this.name || 'top') + ': ' + this.completed() + '\n' + this.trackers.forEach(function (tracker) { + if (tracker instanceof TrackerGroup) { + output += tracker.debug(depth + 1) + } else { + output += indent + ' ' + tracker.name + ': ' + tracker.completed() + '\n' + } + }) + return output +} diff --git a/packages/字体精简工具/node_modules/are-we-there-yet/tracker-stream.js b/packages/字体精简工具/node_modules/are-we-there-yet/tracker-stream.js new file mode 100644 index 0000000..e1cf850 --- /dev/null +++ b/packages/字体精简工具/node_modules/are-we-there-yet/tracker-stream.js @@ -0,0 +1,36 @@ +'use strict' +var util = require('util') +var stream = require('readable-stream') +var delegate = require('delegates') +var Tracker = require('./tracker.js') + +var TrackerStream = module.exports = function (name, size, options) { + stream.Transform.call(this, options) + this.tracker = new Tracker(name, size) + this.name = name + this.id = this.tracker.id + this.tracker.on('change', delegateChange(this)) +} +util.inherits(TrackerStream, stream.Transform) + +function delegateChange (trackerStream) { + return function (name, completion, tracker) { + trackerStream.emit('change', name, completion, trackerStream) + } +} + +TrackerStream.prototype._transform = function (data, encoding, cb) { + this.tracker.completeWork(data.length ? data.length : 1) + this.push(data) + cb() +} + +TrackerStream.prototype._flush = function (cb) { + this.tracker.finish() + cb() +} + +delegate(TrackerStream.prototype, 'tracker') + .method('completed') + .method('addWork') + .method('finish') diff --git a/packages/字体精简工具/node_modules/are-we-there-yet/tracker.js b/packages/字体精简工具/node_modules/are-we-there-yet/tracker.js new file mode 100644 index 0000000..68c2339 --- /dev/null +++ b/packages/字体精简工具/node_modules/are-we-there-yet/tracker.js @@ -0,0 +1,30 @@ +'use strict' +var util = require('util') +var TrackerBase = require('./tracker-base.js') + +var Tracker = module.exports = function (name, todo) { + TrackerBase.call(this, name) + this.workDone = 0 + this.workTodo = todo || 0 +} +util.inherits(Tracker, TrackerBase) + +Tracker.prototype.completed = function () { + return this.workTodo === 0 ? 0 : this.workDone / this.workTodo +} + +Tracker.prototype.addWork = function (work) { + this.workTodo += work + this.emit('change', this.name, this.completed(), this) +} + +Tracker.prototype.completeWork = function (work) { + this.workDone += work + if (this.workDone > this.workTodo) this.workDone = this.workTodo + this.emit('change', this.name, this.completed(), this) +} + +Tracker.prototype.finish = function () { + this.workTodo = this.workDone = 1 + this.emit('change', this.name, 1, this) +} diff --git a/packages/字体精简工具/node_modules/array-find-index/index.js b/packages/字体精简工具/node_modules/array-find-index/index.js new file mode 100644 index 0000000..e2dcd9a --- /dev/null +++ b/packages/字体精简工具/node_modules/array-find-index/index.js @@ -0,0 +1,25 @@ +'use strict'; +module.exports = function (arr, predicate, ctx) { + if (typeof Array.prototype.findIndex === 'function') { + return arr.findIndex(predicate, ctx); + } + + if (typeof predicate !== 'function') { + throw new TypeError('predicate must be a function'); + } + + var list = Object(arr); + var len = list.length; + + if (len === 0) { + return -1; + } + + for (var i = 0; i < len; i++) { + if (predicate.call(ctx, list[i], i, list)) { + return i; + } + } + + return -1; +}; diff --git a/packages/字体精简工具/node_modules/array-find-index/license b/packages/字体精简工具/node_modules/array-find-index/license new file mode 100644 index 0000000..654d0bf --- /dev/null +++ b/packages/字体精简工具/node_modules/array-find-index/license @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (c) Sindre Sorhus (sindresorhus.com) + +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/packages/字体精简工具/node_modules/array-find-index/package.json b/packages/字体精简工具/node_modules/array-find-index/package.json new file mode 100644 index 0000000..d17d1ab --- /dev/null +++ b/packages/字体精简工具/node_modules/array-find-index/package.json @@ -0,0 +1,67 @@ +{ + "_from": "array-find-index@^1.0.1", + "_id": "array-find-index@1.0.2", + "_inBundle": false, + "_integrity": "sha1-3wEKoSh+Fku9pvlyOwqWoexBh6E=", + "_location": "/array-find-index", + "_phantomChildren": {}, + "_requested": { + "type": "range", + "registry": true, + "raw": "array-find-index@^1.0.1", + "name": "array-find-index", + "escapedName": "array-find-index", + "rawSpec": "^1.0.1", + "saveSpec": null, + "fetchSpec": "^1.0.1" + }, + "_requiredBy": [ + "/currently-unhandled" + ], + "_resolved": "https://registry.nlark.com/array-find-index/download/array-find-index-1.0.2.tgz", + "_shasum": "df010aa1287e164bbda6f9723b0a96a1ec4187a1", + "_spec": "array-find-index@^1.0.1", + "_where": "D:\\workspace\\plugin\\mini_font\\packages\\mini_font\\publish\\mini_font\\node_modules\\currently-unhandled", + "author": { + "name": "Sindre Sorhus", + "email": "sindresorhus@gmail.com", + "url": "sindresorhus.com" + }, + "bugs": { + "url": "https://github.com/sindresorhus/array-find-index/issues" + }, + "bundleDependencies": false, + "deprecated": false, + "description": "ES2015 `Array#findIndex()` ponyfill", + "devDependencies": { + "ava": "*", + "xo": "*" + }, + "engines": { + "node": ">=0.10.0" + }, + "files": [ + "index.js" + ], + "homepage": "https://github.com/sindresorhus/array-find-index#readme", + "keywords": [ + "es2015", + "ponyfill", + "polyfill", + "shim", + "find", + "index", + "findindex", + "array" + ], + "license": "MIT", + "name": "array-find-index", + "repository": { + "type": "git", + "url": "git+https://github.com/sindresorhus/array-find-index.git" + }, + "scripts": { + "test": "xo && ava" + }, + "version": "1.0.2" +} diff --git a/packages/字体精简工具/node_modules/array-find-index/readme.md b/packages/字体精简工具/node_modules/array-find-index/readme.md new file mode 100644 index 0000000..3166341 --- /dev/null +++ b/packages/字体精简工具/node_modules/array-find-index/readme.md @@ -0,0 +1,30 @@ +# array-find-index [![Build Status](https://travis-ci.org/sindresorhus/array-find-index.svg?branch=master)](https://travis-ci.org/sindresorhus/array-find-index) + +> ES2015 [`Array#findIndex()`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/findIndex) [ponyfill](https://ponyfill.com) + + +## Install + +``` +$ npm install --save array-find-index +``` + + +## Usage + +```js +const arrayFindIndex = require('array-find-index'); + +arrayFindIndex(['rainbow', 'unicorn', 'pony'], x => x === 'unicorn'); +//=> 1 +``` + + +## API + +Same as `Array#findIndex()`, but with the input array as the first argument. + + +## License + +MIT © [Sindre Sorhus](https://sindresorhus.com) diff --git a/packages/字体精简工具/node_modules/asn1/LICENSE b/packages/字体精简工具/node_modules/asn1/LICENSE new file mode 100644 index 0000000..9b5dcdb --- /dev/null +++ b/packages/字体精简工具/node_modules/asn1/LICENSE @@ -0,0 +1,19 @@ +Copyright (c) 2011 Mark Cavage, 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/packages/字体精简工具/node_modules/asn1/README.md b/packages/字体精简工具/node_modules/asn1/README.md new file mode 100644 index 0000000..2208210 --- /dev/null +++ b/packages/字体精简工具/node_modules/asn1/README.md @@ -0,0 +1,50 @@ +node-asn1 is a library for encoding and decoding ASN.1 datatypes in pure JS. +Currently BER encoding is supported; at some point I'll likely have to do DER. + +## Usage + +Mostly, if you're *actually* needing to read and write ASN.1, you probably don't +need this readme to explain what and why. If you have no idea what ASN.1 is, +see this: ftp://ftp.rsa.com/pub/pkcs/ascii/layman.asc + +The source is pretty much self-explanatory, and has read/write methods for the +common types out there. + +### Decoding + +The following reads an ASN.1 sequence with a boolean. + + var Ber = require('asn1').Ber; + + var reader = new Ber.Reader(Buffer.from([0x30, 0x03, 0x01, 0x01, 0xff])); + + reader.readSequence(); + console.log('Sequence len: ' + reader.length); + if (reader.peek() === Ber.Boolean) + console.log(reader.readBoolean()); + +### Encoding + +The following generates the same payload as above. + + var Ber = require('asn1').Ber; + + var writer = new Ber.Writer(); + + writer.startSequence(); + writer.writeBoolean(true); + writer.endSequence(); + + console.log(writer.buffer); + +## Installation + + npm install asn1 + +## License + +MIT. + +## Bugs + +See . diff --git a/packages/字体精简工具/node_modules/asn1/lib/ber/errors.js b/packages/字体精简工具/node_modules/asn1/lib/ber/errors.js new file mode 100644 index 0000000..4557b8a --- /dev/null +++ b/packages/字体精简工具/node_modules/asn1/lib/ber/errors.js @@ -0,0 +1,13 @@ +// Copyright 2011 Mark Cavage All rights reserved. + + +module.exports = { + + newInvalidAsn1Error: function (msg) { + var e = new Error(); + e.name = 'InvalidAsn1Error'; + e.message = msg || ''; + return e; + } + +}; diff --git a/packages/字体精简工具/node_modules/asn1/lib/ber/index.js b/packages/字体精简工具/node_modules/asn1/lib/ber/index.js new file mode 100644 index 0000000..387d132 --- /dev/null +++ b/packages/字体精简工具/node_modules/asn1/lib/ber/index.js @@ -0,0 +1,27 @@ +// Copyright 2011 Mark Cavage All rights reserved. + +var errors = require('./errors'); +var types = require('./types'); + +var Reader = require('./reader'); +var Writer = require('./writer'); + + +// --- Exports + +module.exports = { + + Reader: Reader, + + Writer: Writer + +}; + +for (var t in types) { + if (types.hasOwnProperty(t)) + module.exports[t] = types[t]; +} +for (var e in errors) { + if (errors.hasOwnProperty(e)) + module.exports[e] = errors[e]; +} diff --git a/packages/字体精简工具/node_modules/asn1/lib/ber/reader.js b/packages/字体精简工具/node_modules/asn1/lib/ber/reader.js new file mode 100644 index 0000000..8a7e4ca --- /dev/null +++ b/packages/字体精简工具/node_modules/asn1/lib/ber/reader.js @@ -0,0 +1,262 @@ +// Copyright 2011 Mark Cavage All rights reserved. + +var assert = require('assert'); +var Buffer = require('safer-buffer').Buffer; + +var ASN1 = require('./types'); +var errors = require('./errors'); + + +// --- Globals + +var newInvalidAsn1Error = errors.newInvalidAsn1Error; + + + +// --- API + +function Reader(data) { + if (!data || !Buffer.isBuffer(data)) + throw new TypeError('data must be a node Buffer'); + + this._buf = data; + this._size = data.length; + + // These hold the "current" state + this._len = 0; + this._offset = 0; +} + +Object.defineProperty(Reader.prototype, 'length', { + enumerable: true, + get: function () { return (this._len); } +}); + +Object.defineProperty(Reader.prototype, 'offset', { + enumerable: true, + get: function () { return (this._offset); } +}); + +Object.defineProperty(Reader.prototype, 'remain', { + get: function () { return (this._size - this._offset); } +}); + +Object.defineProperty(Reader.prototype, 'buffer', { + get: function () { return (this._buf.slice(this._offset)); } +}); + + +/** + * Reads a single byte and advances offset; you can pass in `true` to make this + * a "peek" operation (i.e., get the byte, but don't advance the offset). + * + * @param {Boolean} peek true means don't move offset. + * @return {Number} the next byte, null if not enough data. + */ +Reader.prototype.readByte = function (peek) { + if (this._size - this._offset < 1) + return null; + + var b = this._buf[this._offset] & 0xff; + + if (!peek) + this._offset += 1; + + return b; +}; + + +Reader.prototype.peek = function () { + return this.readByte(true); +}; + + +/** + * Reads a (potentially) variable length off the BER buffer. This call is + * not really meant to be called directly, as callers have to manipulate + * the internal buffer afterwards. + * + * As a result of this call, you can call `Reader.length`, until the + * next thing called that does a readLength. + * + * @return {Number} the amount of offset to advance the buffer. + * @throws {InvalidAsn1Error} on bad ASN.1 + */ +Reader.prototype.readLength = function (offset) { + if (offset === undefined) + offset = this._offset; + + if (offset >= this._size) + return null; + + var lenB = this._buf[offset++] & 0xff; + if (lenB === null) + return null; + + if ((lenB & 0x80) === 0x80) { + lenB &= 0x7f; + + if (lenB === 0) + throw newInvalidAsn1Error('Indefinite length not supported'); + + if (lenB > 4) + throw newInvalidAsn1Error('encoding too long'); + + if (this._size - offset < lenB) + return null; + + this._len = 0; + for (var i = 0; i < lenB; i++) + this._len = (this._len << 8) + (this._buf[offset++] & 0xff); + + } else { + // Wasn't a variable length + this._len = lenB; + } + + return offset; +}; + + +/** + * Parses the next sequence in this BER buffer. + * + * To get the length of the sequence, call `Reader.length`. + * + * @return {Number} the sequence's tag. + */ +Reader.prototype.readSequence = function (tag) { + var seq = this.peek(); + if (seq === null) + return null; + if (tag !== undefined && tag !== seq) + throw newInvalidAsn1Error('Expected 0x' + tag.toString(16) + + ': got 0x' + seq.toString(16)); + + var o = this.readLength(this._offset + 1); // stored in `length` + if (o === null) + return null; + + this._offset = o; + return seq; +}; + + +Reader.prototype.readInt = function () { + return this._readTag(ASN1.Integer); +}; + + +Reader.prototype.readBoolean = function () { + return (this._readTag(ASN1.Boolean) === 0 ? false : true); +}; + + +Reader.prototype.readEnumeration = function () { + return this._readTag(ASN1.Enumeration); +}; + + +Reader.prototype.readString = function (tag, retbuf) { + if (!tag) + tag = ASN1.OctetString; + + var b = this.peek(); + if (b === null) + return null; + + if (b !== tag) + throw newInvalidAsn1Error('Expected 0x' + tag.toString(16) + + ': got 0x' + b.toString(16)); + + var o = this.readLength(this._offset + 1); // stored in `length` + + if (o === null) + return null; + + if (this.length > this._size - o) + return null; + + this._offset = o; + + if (this.length === 0) + return retbuf ? Buffer.alloc(0) : ''; + + var str = this._buf.slice(this._offset, this._offset + this.length); + this._offset += this.length; + + return retbuf ? str : str.toString('utf8'); +}; + +Reader.prototype.readOID = function (tag) { + if (!tag) + tag = ASN1.OID; + + var b = this.readString(tag, true); + if (b === null) + return null; + + var values = []; + var value = 0; + + for (var i = 0; i < b.length; i++) { + var byte = b[i] & 0xff; + + value <<= 7; + value += byte & 0x7f; + if ((byte & 0x80) === 0) { + values.push(value); + value = 0; + } + } + + value = values.shift(); + values.unshift(value % 40); + values.unshift((value / 40) >> 0); + + return values.join('.'); +}; + + +Reader.prototype._readTag = function (tag) { + assert.ok(tag !== undefined); + + var b = this.peek(); + + if (b === null) + return null; + + if (b !== tag) + throw newInvalidAsn1Error('Expected 0x' + tag.toString(16) + + ': got 0x' + b.toString(16)); + + var o = this.readLength(this._offset + 1); // stored in `length` + if (o === null) + return null; + + if (this.length > 4) + throw newInvalidAsn1Error('Integer too long: ' + this.length); + + if (this.length > this._size - o) + return null; + this._offset = o; + + var fb = this._buf[this._offset]; + var value = 0; + + for (var i = 0; i < this.length; i++) { + value <<= 8; + value |= (this._buf[this._offset++] & 0xff); + } + + if ((fb & 0x80) === 0x80 && i !== 4) + value -= (1 << (i * 8)); + + return value >> 0; +}; + + + +// --- Exported API + +module.exports = Reader; diff --git a/packages/字体精简工具/node_modules/asn1/lib/ber/types.js b/packages/字体精简工具/node_modules/asn1/lib/ber/types.js new file mode 100644 index 0000000..8aea000 --- /dev/null +++ b/packages/字体精简工具/node_modules/asn1/lib/ber/types.js @@ -0,0 +1,36 @@ +// Copyright 2011 Mark Cavage All rights reserved. + + +module.exports = { + EOC: 0, + Boolean: 1, + Integer: 2, + BitString: 3, + OctetString: 4, + Null: 5, + OID: 6, + ObjectDescriptor: 7, + External: 8, + Real: 9, // float + Enumeration: 10, + PDV: 11, + Utf8String: 12, + RelativeOID: 13, + Sequence: 16, + Set: 17, + NumericString: 18, + PrintableString: 19, + T61String: 20, + VideotexString: 21, + IA5String: 22, + UTCTime: 23, + GeneralizedTime: 24, + GraphicString: 25, + VisibleString: 26, + GeneralString: 28, + UniversalString: 29, + CharacterString: 30, + BMPString: 31, + Constructor: 32, + Context: 128 +}; diff --git a/packages/字体精简工具/node_modules/asn1/lib/ber/writer.js b/packages/字体精简工具/node_modules/asn1/lib/ber/writer.js new file mode 100644 index 0000000..3515acf --- /dev/null +++ b/packages/字体精简工具/node_modules/asn1/lib/ber/writer.js @@ -0,0 +1,317 @@ +// Copyright 2011 Mark Cavage All rights reserved. + +var assert = require('assert'); +var Buffer = require('safer-buffer').Buffer; +var ASN1 = require('./types'); +var errors = require('./errors'); + + +// --- Globals + +var newInvalidAsn1Error = errors.newInvalidAsn1Error; + +var DEFAULT_OPTS = { + size: 1024, + growthFactor: 8 +}; + + +// --- Helpers + +function merge(from, to) { + assert.ok(from); + assert.equal(typeof (from), 'object'); + assert.ok(to); + assert.equal(typeof (to), 'object'); + + var keys = Object.getOwnPropertyNames(from); + keys.forEach(function (key) { + if (to[key]) + return; + + var value = Object.getOwnPropertyDescriptor(from, key); + Object.defineProperty(to, key, value); + }); + + return to; +} + + + +// --- API + +function Writer(options) { + options = merge(DEFAULT_OPTS, options || {}); + + this._buf = Buffer.alloc(options.size || 1024); + this._size = this._buf.length; + this._offset = 0; + this._options = options; + + // A list of offsets in the buffer where we need to insert + // sequence tag/len pairs. + this._seq = []; +} + +Object.defineProperty(Writer.prototype, 'buffer', { + get: function () { + if (this._seq.length) + throw newInvalidAsn1Error(this._seq.length + ' unended sequence(s)'); + + return (this._buf.slice(0, this._offset)); + } +}); + +Writer.prototype.writeByte = function (b) { + if (typeof (b) !== 'number') + throw new TypeError('argument must be a Number'); + + this._ensure(1); + this._buf[this._offset++] = b; +}; + + +Writer.prototype.writeInt = function (i, tag) { + if (typeof (i) !== 'number') + throw new TypeError('argument must be a Number'); + if (typeof (tag) !== 'number') + tag = ASN1.Integer; + + var sz = 4; + + while ((((i & 0xff800000) === 0) || ((i & 0xff800000) === 0xff800000 >> 0)) && + (sz > 1)) { + sz--; + i <<= 8; + } + + if (sz > 4) + throw newInvalidAsn1Error('BER ints cannot be > 0xffffffff'); + + this._ensure(2 + sz); + this._buf[this._offset++] = tag; + this._buf[this._offset++] = sz; + + while (sz-- > 0) { + this._buf[this._offset++] = ((i & 0xff000000) >>> 24); + i <<= 8; + } + +}; + + +Writer.prototype.writeNull = function () { + this.writeByte(ASN1.Null); + this.writeByte(0x00); +}; + + +Writer.prototype.writeEnumeration = function (i, tag) { + if (typeof (i) !== 'number') + throw new TypeError('argument must be a Number'); + if (typeof (tag) !== 'number') + tag = ASN1.Enumeration; + + return this.writeInt(i, tag); +}; + + +Writer.prototype.writeBoolean = function (b, tag) { + if (typeof (b) !== 'boolean') + throw new TypeError('argument must be a Boolean'); + if (typeof (tag) !== 'number') + tag = ASN1.Boolean; + + this._ensure(3); + this._buf[this._offset++] = tag; + this._buf[this._offset++] = 0x01; + this._buf[this._offset++] = b ? 0xff : 0x00; +}; + + +Writer.prototype.writeString = function (s, tag) { + if (typeof (s) !== 'string') + throw new TypeError('argument must be a string (was: ' + typeof (s) + ')'); + if (typeof (tag) !== 'number') + tag = ASN1.OctetString; + + var len = Buffer.byteLength(s); + this.writeByte(tag); + this.writeLength(len); + if (len) { + this._ensure(len); + this._buf.write(s, this._offset); + this._offset += len; + } +}; + + +Writer.prototype.writeBuffer = function (buf, tag) { + if (typeof (tag) !== 'number') + throw new TypeError('tag must be a number'); + if (!Buffer.isBuffer(buf)) + throw new TypeError('argument must be a buffer'); + + this.writeByte(tag); + this.writeLength(buf.length); + this._ensure(buf.length); + buf.copy(this._buf, this._offset, 0, buf.length); + this._offset += buf.length; +}; + + +Writer.prototype.writeStringArray = function (strings) { + if ((!strings instanceof Array)) + throw new TypeError('argument must be an Array[String]'); + + var self = this; + strings.forEach(function (s) { + self.writeString(s); + }); +}; + +// This is really to solve DER cases, but whatever for now +Writer.prototype.writeOID = function (s, tag) { + if (typeof (s) !== 'string') + throw new TypeError('argument must be a string'); + if (typeof (tag) !== 'number') + tag = ASN1.OID; + + if (!/^([0-9]+\.){3,}[0-9]+$/.test(s)) + throw new Error('argument is not a valid OID string'); + + function encodeOctet(bytes, octet) { + if (octet < 128) { + bytes.push(octet); + } else if (octet < 16384) { + bytes.push((octet >>> 7) | 0x80); + bytes.push(octet & 0x7F); + } else if (octet < 2097152) { + bytes.push((octet >>> 14) | 0x80); + bytes.push(((octet >>> 7) | 0x80) & 0xFF); + bytes.push(octet & 0x7F); + } else if (octet < 268435456) { + bytes.push((octet >>> 21) | 0x80); + bytes.push(((octet >>> 14) | 0x80) & 0xFF); + bytes.push(((octet >>> 7) | 0x80) & 0xFF); + bytes.push(octet & 0x7F); + } else { + bytes.push(((octet >>> 28) | 0x80) & 0xFF); + bytes.push(((octet >>> 21) | 0x80) & 0xFF); + bytes.push(((octet >>> 14) | 0x80) & 0xFF); + bytes.push(((octet >>> 7) | 0x80) & 0xFF); + bytes.push(octet & 0x7F); + } + } + + var tmp = s.split('.'); + var bytes = []; + bytes.push(parseInt(tmp[0], 10) * 40 + parseInt(tmp[1], 10)); + tmp.slice(2).forEach(function (b) { + encodeOctet(bytes, parseInt(b, 10)); + }); + + var self = this; + this._ensure(2 + bytes.length); + this.writeByte(tag); + this.writeLength(bytes.length); + bytes.forEach(function (b) { + self.writeByte(b); + }); +}; + + +Writer.prototype.writeLength = function (len) { + if (typeof (len) !== 'number') + throw new TypeError('argument must be a Number'); + + this._ensure(4); + + if (len <= 0x7f) { + this._buf[this._offset++] = len; + } else if (len <= 0xff) { + this._buf[this._offset++] = 0x81; + this._buf[this._offset++] = len; + } else if (len <= 0xffff) { + this._buf[this._offset++] = 0x82; + this._buf[this._offset++] = len >> 8; + this._buf[this._offset++] = len; + } else if (len <= 0xffffff) { + this._buf[this._offset++] = 0x83; + this._buf[this._offset++] = len >> 16; + this._buf[this._offset++] = len >> 8; + this._buf[this._offset++] = len; + } else { + throw newInvalidAsn1Error('Length too long (> 4 bytes)'); + } +}; + +Writer.prototype.startSequence = function (tag) { + if (typeof (tag) !== 'number') + tag = ASN1.Sequence | ASN1.Constructor; + + this.writeByte(tag); + this._seq.push(this._offset); + this._ensure(3); + this._offset += 3; +}; + + +Writer.prototype.endSequence = function () { + var seq = this._seq.pop(); + var start = seq + 3; + var len = this._offset - start; + + if (len <= 0x7f) { + this._shift(start, len, -2); + this._buf[seq] = len; + } else if (len <= 0xff) { + this._shift(start, len, -1); + this._buf[seq] = 0x81; + this._buf[seq + 1] = len; + } else if (len <= 0xffff) { + this._buf[seq] = 0x82; + this._buf[seq + 1] = len >> 8; + this._buf[seq + 2] = len; + } else if (len <= 0xffffff) { + this._shift(start, len, 1); + this._buf[seq] = 0x83; + this._buf[seq + 1] = len >> 16; + this._buf[seq + 2] = len >> 8; + this._buf[seq + 3] = len; + } else { + throw newInvalidAsn1Error('Sequence too long'); + } +}; + + +Writer.prototype._shift = function (start, len, shift) { + assert.ok(start !== undefined); + assert.ok(len !== undefined); + assert.ok(shift); + + this._buf.copy(this._buf, start + shift, start, start + len); + this._offset += shift; +}; + +Writer.prototype._ensure = function (len) { + assert.ok(len); + + if (this._size - this._offset < len) { + var sz = this._size * this._options.growthFactor; + if (sz - this._offset < len) + sz += len; + + var buf = Buffer.alloc(sz); + + this._buf.copy(buf, 0, 0, this._offset); + this._buf = buf; + this._size = sz; + } +}; + + + +// --- Exported API + +module.exports = Writer; diff --git a/packages/字体精简工具/node_modules/asn1/lib/index.js b/packages/字体精简工具/node_modules/asn1/lib/index.js new file mode 100644 index 0000000..ede3ab2 --- /dev/null +++ b/packages/字体精简工具/node_modules/asn1/lib/index.js @@ -0,0 +1,20 @@ +// Copyright 2011 Mark Cavage All rights reserved. + +// If you have no idea what ASN.1 or BER is, see this: +// ftp://ftp.rsa.com/pub/pkcs/ascii/layman.asc + +var Ber = require('./ber/index'); + + + +// --- Exported API + +module.exports = { + + Ber: Ber, + + BerReader: Ber.Reader, + + BerWriter: Ber.Writer + +}; diff --git a/packages/字体精简工具/node_modules/asn1/package.json b/packages/字体精简工具/node_modules/asn1/package.json new file mode 100644 index 0000000..261ce7f --- /dev/null +++ b/packages/字体精简工具/node_modules/asn1/package.json @@ -0,0 +1,75 @@ +{ + "_from": "asn1@~0.2.3", + "_id": "asn1@0.2.4", + "_inBundle": false, + "_integrity": "sha1-jSR136tVO7M+d7VOWeiAu4ziMTY=", + "_location": "/asn1", + "_phantomChildren": {}, + "_requested": { + "type": "range", + "registry": true, + "raw": "asn1@~0.2.3", + "name": "asn1", + "escapedName": "asn1", + "rawSpec": "~0.2.3", + "saveSpec": null, + "fetchSpec": "~0.2.3" + }, + "_requiredBy": [ + "/sshpk" + ], + "_resolved": "https://registry.npm.taobao.org/asn1/download/asn1-0.2.4.tgz", + "_shasum": "8d2475dfab553bb33e77b54e59e880bb8ce23136", + "_spec": "asn1@~0.2.3", + "_where": "D:\\workspace\\plugin\\mini_font\\packages\\mini_font\\publish\\mini_font\\node_modules\\sshpk", + "author": { + "name": "Joyent", + "url": "joyent.com" + }, + "bugs": { + "url": "https://github.com/joyent/node-asn1/issues" + }, + "bundleDependencies": false, + "contributors": [ + { + "name": "Mark Cavage", + "email": "mcavage@gmail.com" + }, + { + "name": "David Gwynne", + "email": "loki@animata.net" + }, + { + "name": "Yunong Xiao", + "email": "yunong@joyent.com" + }, + { + "name": "Alex Wilson", + "email": "alex.wilson@joyent.com" + } + ], + "dependencies": { + "safer-buffer": "~2.1.0" + }, + "deprecated": false, + "description": "Contains parsers and serializers for ASN.1 (currently BER only)", + "devDependencies": { + "eslint": "2.13.1", + "eslint-plugin-joyent": "~1.3.0", + "faucet": "0.0.1", + "istanbul": "^0.3.6", + "tape": "^3.5.0" + }, + "homepage": "https://github.com/joyent/node-asn1#readme", + "license": "MIT", + "main": "lib/index.js", + "name": "asn1", + "repository": { + "type": "git", + "url": "git://github.com/joyent/node-asn1.git" + }, + "scripts": { + "test": "tape ./test/ber/*.test.js" + }, + "version": "0.2.4" +} diff --git a/packages/字体精简工具/node_modules/assert-plus/AUTHORS b/packages/字体精简工具/node_modules/assert-plus/AUTHORS new file mode 100644 index 0000000..1923524 --- /dev/null +++ b/packages/字体精简工具/node_modules/assert-plus/AUTHORS @@ -0,0 +1,6 @@ +Dave Eddy +Fred Kuo +Lars-Magnus Skog +Mark Cavage +Patrick Mooney +Rob Gulewich diff --git a/packages/字体精简工具/node_modules/assert-plus/CHANGES.md b/packages/字体精简工具/node_modules/assert-plus/CHANGES.md new file mode 100644 index 0000000..57d92bf --- /dev/null +++ b/packages/字体精简工具/node_modules/assert-plus/CHANGES.md @@ -0,0 +1,14 @@ +# assert-plus Changelog + +## 1.0.0 + +- *BREAKING* assert.number (and derivatives) now accept Infinity as valid input +- Add assert.finite check. Previous assert.number callers should use this if + they expect Infinity inputs to throw. + +## 0.2.0 + +- Fix `assert.object(null)` so it throws +- Fix optional/arrayOf exports for non-type-of asserts +- Add optiona/arrayOf exports for Stream/Date/Regex/uuid +- Add basic unit test coverage diff --git a/packages/字体精简工具/node_modules/assert-plus/README.md b/packages/字体精简工具/node_modules/assert-plus/README.md new file mode 100644 index 0000000..ec200d1 --- /dev/null +++ b/packages/字体精简工具/node_modules/assert-plus/README.md @@ -0,0 +1,162 @@ +# assert-plus + +This library is a super small wrapper over node's assert module that has two +things: (1) the ability to disable assertions with the environment variable +NODE\_NDEBUG, and (2) some API wrappers for argument testing. Like +`assert.string(myArg, 'myArg')`. As a simple example, most of my code looks +like this: + +```javascript + var assert = require('assert-plus'); + + function fooAccount(options, callback) { + assert.object(options, 'options'); + assert.number(options.id, 'options.id'); + assert.bool(options.isManager, 'options.isManager'); + assert.string(options.name, 'options.name'); + assert.arrayOfString(options.email, 'options.email'); + assert.func(callback, 'callback'); + + // Do stuff + callback(null, {}); + } +``` + +# API + +All methods that *aren't* part of node's core assert API are simply assumed to +take an argument, and then a string 'name' that's not a message; `AssertionError` +will be thrown if the assertion fails with a message like: + + AssertionError: foo (string) is required + at test (/home/mark/work/foo/foo.js:3:9) + at Object. (/home/mark/work/foo/foo.js:15:1) + at Module._compile (module.js:446:26) + at Object..js (module.js:464:10) + at Module.load (module.js:353:31) + at Function._load (module.js:311:12) + at Array.0 (module.js:484:10) + at EventEmitter._tickCallback (node.js:190:38) + +from: + +```javascript + function test(foo) { + assert.string(foo, 'foo'); + } +``` + +There you go. You can check that arrays are of a homogeneous type with `Arrayof$Type`: + +```javascript + function test(foo) { + assert.arrayOfString(foo, 'foo'); + } +``` + +You can assert IFF an argument is not `undefined` (i.e., an optional arg): + +```javascript + assert.optionalString(foo, 'foo'); +``` + +Lastly, you can opt-out of assertion checking altogether by setting the +environment variable `NODE_NDEBUG=1`. This is pseudo-useful if you have +lots of assertions, and don't want to pay `typeof ()` taxes to v8 in +production. Be advised: The standard functions re-exported from `assert` are +also disabled in assert-plus if NDEBUG is specified. Using them directly from +the `assert` module avoids this behavior. + +The complete list of APIs is: + +* assert.array +* assert.bool +* assert.buffer +* assert.func +* assert.number +* assert.finite +* assert.object +* assert.string +* assert.stream +* assert.date +* assert.regexp +* assert.uuid +* assert.arrayOfArray +* assert.arrayOfBool +* assert.arrayOfBuffer +* assert.arrayOfFunc +* assert.arrayOfNumber +* assert.arrayOfFinite +* assert.arrayOfObject +* assert.arrayOfString +* assert.arrayOfStream +* assert.arrayOfDate +* assert.arrayOfRegexp +* assert.arrayOfUuid +* assert.optionalArray +* assert.optionalBool +* assert.optionalBuffer +* assert.optionalFunc +* assert.optionalNumber +* assert.optionalFinite +* assert.optionalObject +* assert.optionalString +* assert.optionalStream +* assert.optionalDate +* assert.optionalRegexp +* assert.optionalUuid +* assert.optionalArrayOfArray +* assert.optionalArrayOfBool +* assert.optionalArrayOfBuffer +* assert.optionalArrayOfFunc +* assert.optionalArrayOfNumber +* assert.optionalArrayOfFinite +* assert.optionalArrayOfObject +* assert.optionalArrayOfString +* assert.optionalArrayOfStream +* assert.optionalArrayOfDate +* assert.optionalArrayOfRegexp +* assert.optionalArrayOfUuid +* assert.AssertionError +* assert.fail +* assert.ok +* assert.equal +* assert.notEqual +* assert.deepEqual +* assert.notDeepEqual +* assert.strictEqual +* assert.notStrictEqual +* assert.throws +* assert.doesNotThrow +* assert.ifError + +# Installation + + npm install assert-plus + +## License + +The MIT License (MIT) +Copyright (c) 2012 Mark Cavage + +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. + +## Bugs + +See . diff --git a/packages/字体精简工具/node_modules/assert-plus/assert.js b/packages/字体精简工具/node_modules/assert-plus/assert.js new file mode 100644 index 0000000..26f944e --- /dev/null +++ b/packages/字体精简工具/node_modules/assert-plus/assert.js @@ -0,0 +1,211 @@ +// Copyright (c) 2012, Mark Cavage. All rights reserved. +// Copyright 2015 Joyent, Inc. + +var assert = require('assert'); +var Stream = require('stream').Stream; +var util = require('util'); + + +///--- Globals + +/* JSSTYLED */ +var UUID_REGEXP = /^[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}$/; + + +///--- Internal + +function _capitalize(str) { + return (str.charAt(0).toUpperCase() + str.slice(1)); +} + +function _toss(name, expected, oper, arg, actual) { + throw new assert.AssertionError({ + message: util.format('%s (%s) is required', name, expected), + actual: (actual === undefined) ? typeof (arg) : actual(arg), + expected: expected, + operator: oper || '===', + stackStartFunction: _toss.caller + }); +} + +function _getClass(arg) { + return (Object.prototype.toString.call(arg).slice(8, -1)); +} + +function noop() { + // Why even bother with asserts? +} + + +///--- Exports + +var types = { + bool: { + check: function (arg) { return typeof (arg) === 'boolean'; } + }, + func: { + check: function (arg) { return typeof (arg) === 'function'; } + }, + string: { + check: function (arg) { return typeof (arg) === 'string'; } + }, + object: { + check: function (arg) { + return typeof (arg) === 'object' && arg !== null; + } + }, + number: { + check: function (arg) { + return typeof (arg) === 'number' && !isNaN(arg); + } + }, + finite: { + check: function (arg) { + return typeof (arg) === 'number' && !isNaN(arg) && isFinite(arg); + } + }, + buffer: { + check: function (arg) { return Buffer.isBuffer(arg); }, + operator: 'Buffer.isBuffer' + }, + array: { + check: function (arg) { return Array.isArray(arg); }, + operator: 'Array.isArray' + }, + stream: { + check: function (arg) { return arg instanceof Stream; }, + operator: 'instanceof', + actual: _getClass + }, + date: { + check: function (arg) { return arg instanceof Date; }, + operator: 'instanceof', + actual: _getClass + }, + regexp: { + check: function (arg) { return arg instanceof RegExp; }, + operator: 'instanceof', + actual: _getClass + }, + uuid: { + check: function (arg) { + return typeof (arg) === 'string' && UUID_REGEXP.test(arg); + }, + operator: 'isUUID' + } +}; + +function _setExports(ndebug) { + var keys = Object.keys(types); + var out; + + /* re-export standard assert */ + if (process.env.NODE_NDEBUG) { + out = noop; + } else { + out = function (arg, msg) { + if (!arg) { + _toss(msg, 'true', arg); + } + }; + } + + /* standard checks */ + keys.forEach(function (k) { + if (ndebug) { + out[k] = noop; + return; + } + var type = types[k]; + out[k] = function (arg, msg) { + if (!type.check(arg)) { + _toss(msg, k, type.operator, arg, type.actual); + } + }; + }); + + /* optional checks */ + keys.forEach(function (k) { + var name = 'optional' + _capitalize(k); + if (ndebug) { + out[name] = noop; + return; + } + var type = types[k]; + out[name] = function (arg, msg) { + if (arg === undefined || arg === null) { + return; + } + if (!type.check(arg)) { + _toss(msg, k, type.operator, arg, type.actual); + } + }; + }); + + /* arrayOf checks */ + keys.forEach(function (k) { + var name = 'arrayOf' + _capitalize(k); + if (ndebug) { + out[name] = noop; + return; + } + var type = types[k]; + var expected = '[' + k + ']'; + out[name] = function (arg, msg) { + if (!Array.isArray(arg)) { + _toss(msg, expected, type.operator, arg, type.actual); + } + var i; + for (i = 0; i < arg.length; i++) { + if (!type.check(arg[i])) { + _toss(msg, expected, type.operator, arg, type.actual); + } + } + }; + }); + + /* optionalArrayOf checks */ + keys.forEach(function (k) { + var name = 'optionalArrayOf' + _capitalize(k); + if (ndebug) { + out[name] = noop; + return; + } + var type = types[k]; + var expected = '[' + k + ']'; + out[name] = function (arg, msg) { + if (arg === undefined || arg === null) { + return; + } + if (!Array.isArray(arg)) { + _toss(msg, expected, type.operator, arg, type.actual); + } + var i; + for (i = 0; i < arg.length; i++) { + if (!type.check(arg[i])) { + _toss(msg, expected, type.operator, arg, type.actual); + } + } + }; + }); + + /* re-export built-in assertions */ + Object.keys(assert).forEach(function (k) { + if (k === 'AssertionError') { + out[k] = assert[k]; + return; + } + if (ndebug) { + out[k] = noop; + return; + } + out[k] = assert[k]; + }); + + /* export ourselves (for unit tests _only_) */ + out._setExports = _setExports; + + return out; +} + +module.exports = _setExports(process.env.NODE_NDEBUG); diff --git a/packages/字体精简工具/node_modules/assert-plus/package.json b/packages/字体精简工具/node_modules/assert-plus/package.json new file mode 100644 index 0000000..406bf03 --- /dev/null +++ b/packages/字体精简工具/node_modules/assert-plus/package.json @@ -0,0 +1,87 @@ +{ + "_from": "assert-plus@^1.0.0", + "_id": "assert-plus@1.0.0", + "_inBundle": false, + "_integrity": "sha1-8S4PPF13sLHN2RRpQuTpbB5N1SU=", + "_location": "/assert-plus", + "_phantomChildren": {}, + "_requested": { + "type": "range", + "registry": true, + "raw": "assert-plus@^1.0.0", + "name": "assert-plus", + "escapedName": "assert-plus", + "rawSpec": "^1.0.0", + "saveSpec": null, + "fetchSpec": "^1.0.0" + }, + "_requiredBy": [ + "/dashdash", + "/getpass", + "/http-signature", + "/jsprim", + "/sshpk", + "/verror" + ], + "_resolved": "https://registry.nlark.com/assert-plus/download/assert-plus-1.0.0.tgz", + "_shasum": "f12e0f3c5d77b0b1cdd9146942e4e96c1e4dd525", + "_spec": "assert-plus@^1.0.0", + "_where": "D:\\workspace\\plugin\\mini_font\\packages\\mini_font\\publish\\mini_font\\node_modules\\http-signature", + "author": { + "name": "Mark Cavage", + "email": "mcavage@gmail.com" + }, + "bugs": { + "url": "https://github.com/mcavage/node-assert-plus/issues" + }, + "bundleDependencies": false, + "contributors": [ + { + "name": "Dave Eddy", + "email": "dave@daveeddy.com" + }, + { + "name": "Fred Kuo", + "email": "fred.kuo@joyent.com" + }, + { + "name": "Lars-Magnus Skog", + "email": "ralphtheninja@riseup.net" + }, + { + "name": "Mark Cavage", + "email": "mcavage@gmail.com" + }, + { + "name": "Patrick Mooney", + "email": "pmooney@pfmooney.com" + }, + { + "name": "Rob Gulewich", + "email": "robert.gulewich@joyent.com" + } + ], + "dependencies": {}, + "deprecated": false, + "description": "Extra assertions on top of node's assert module", + "devDependencies": { + "faucet": "0.0.1", + "tape": "4.2.2" + }, + "engines": { + "node": ">=0.8" + }, + "homepage": "https://github.com/mcavage/node-assert-plus#readme", + "license": "MIT", + "main": "./assert.js", + "name": "assert-plus", + "optionalDependencies": {}, + "repository": { + "type": "git", + "url": "git+https://github.com/mcavage/node-assert-plus.git" + }, + "scripts": { + "test": "tape tests/*.js | ./node_modules/.bin/faucet" + }, + "version": "1.0.0" +} diff --git a/packages/字体精简工具/node_modules/asynckit/LICENSE b/packages/字体精简工具/node_modules/asynckit/LICENSE new file mode 100644 index 0000000..c9eca5d --- /dev/null +++ b/packages/字体精简工具/node_modules/asynckit/LICENSE @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (c) 2016 Alex Indigo + +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/packages/字体精简工具/node_modules/asynckit/README.md b/packages/字体精简工具/node_modules/asynckit/README.md new file mode 100644 index 0000000..ddcc7e6 --- /dev/null +++ b/packages/字体精简工具/node_modules/asynckit/README.md @@ -0,0 +1,233 @@ +# asynckit [![NPM Module](https://img.shields.io/npm/v/asynckit.svg?style=flat)](https://www.npmjs.com/package/asynckit) + +Minimal async jobs utility library, with streams support. + +[![PhantomJS Build](https://img.shields.io/travis/alexindigo/asynckit/v0.4.0.svg?label=browser&style=flat)](https://travis-ci.org/alexindigo/asynckit) +[![Linux Build](https://img.shields.io/travis/alexindigo/asynckit/v0.4.0.svg?label=linux:0.12-6.x&style=flat)](https://travis-ci.org/alexindigo/asynckit) +[![Windows Build](https://img.shields.io/appveyor/ci/alexindigo/asynckit/v0.4.0.svg?label=windows:0.12-6.x&style=flat)](https://ci.appveyor.com/project/alexindigo/asynckit) + +[![Coverage Status](https://img.shields.io/coveralls/alexindigo/asynckit/v0.4.0.svg?label=code+coverage&style=flat)](https://coveralls.io/github/alexindigo/asynckit?branch=master) +[![Dependency Status](https://img.shields.io/david/alexindigo/asynckit/v0.4.0.svg?style=flat)](https://david-dm.org/alexindigo/asynckit) +[![bitHound Overall Score](https://www.bithound.io/github/alexindigo/asynckit/badges/score.svg)](https://www.bithound.io/github/alexindigo/asynckit) + + + +AsyncKit provides harness for `parallel` and `serial` iterators over list of items represented by arrays or objects. +Optionally it accepts abort function (should be synchronously return by iterator for each item), and terminates left over jobs upon an error event. For specific iteration order built-in (`ascending` and `descending`) and custom sort helpers also supported, via `asynckit.serialOrdered` method. + +It ensures async operations to keep behavior more stable and prevent `Maximum call stack size exceeded` errors, from sync iterators. + +| compression | size | +| :----------------- | -------: | +| asynckit.js | 12.34 kB | +| asynckit.min.js | 4.11 kB | +| asynckit.min.js.gz | 1.47 kB | + + +## Install + +```sh +$ npm install --save asynckit +``` + +## Examples + +### Parallel Jobs + +Runs iterator over provided array in parallel. Stores output in the `result` array, +on the matching positions. In unlikely event of an error from one of the jobs, +will terminate rest of the active jobs (if abort function is provided) +and return error along with salvaged data to the main callback function. + +#### Input Array + +```javascript +var parallel = require('asynckit').parallel + , assert = require('assert') + ; + +var source = [ 1, 1, 4, 16, 64, 32, 8, 2 ] + , expectedResult = [ 2, 2, 8, 32, 128, 64, 16, 4 ] + , expectedTarget = [ 1, 1, 2, 4, 8, 16, 32, 64 ] + , target = [] + ; + +parallel(source, asyncJob, function(err, result) +{ + assert.deepEqual(result, expectedResult); + assert.deepEqual(target, expectedTarget); +}); + +// async job accepts one element from the array +// and a callback function +function asyncJob(item, cb) +{ + // different delays (in ms) per item + var delay = item * 25; + + // pretend different jobs take different time to finish + // and not in consequential order + var timeoutId = setTimeout(function() { + target.push(item); + cb(null, item * 2); + }, delay); + + // allow to cancel "leftover" jobs upon error + // return function, invoking of which will abort this job + return clearTimeout.bind(null, timeoutId); +} +``` + +More examples could be found in [test/test-parallel-array.js](test/test-parallel-array.js). + +#### Input Object + +Also it supports named jobs, listed via object. + +```javascript +var parallel = require('asynckit/parallel') + , assert = require('assert') + ; + +var source = { first: 1, one: 1, four: 4, sixteen: 16, sixtyFour: 64, thirtyTwo: 32, eight: 8, two: 2 } + , expectedResult = { first: 2, one: 2, four: 8, sixteen: 32, sixtyFour: 128, thirtyTwo: 64, eight: 16, two: 4 } + , expectedTarget = [ 1, 1, 2, 4, 8, 16, 32, 64 ] + , expectedKeys = [ 'first', 'one', 'two', 'four', 'eight', 'sixteen', 'thirtyTwo', 'sixtyFour' ] + , target = [] + , keys = [] + ; + +parallel(source, asyncJob, function(err, result) +{ + assert.deepEqual(result, expectedResult); + assert.deepEqual(target, expectedTarget); + assert.deepEqual(keys, expectedKeys); +}); + +// supports full value, key, callback (shortcut) interface +function asyncJob(item, key, cb) +{ + // different delays (in ms) per item + var delay = item * 25; + + // pretend different jobs take different time to finish + // and not in consequential order + var timeoutId = setTimeout(function() { + keys.push(key); + target.push(item); + cb(null, item * 2); + }, delay); + + // allow to cancel "leftover" jobs upon error + // return function, invoking of which will abort this job + return clearTimeout.bind(null, timeoutId); +} +``` + +More examples could be found in [test/test-parallel-object.js](test/test-parallel-object.js). + +### Serial Jobs + +Runs iterator over provided array sequentially. Stores output in the `result` array, +on the matching positions. In unlikely event of an error from one of the jobs, +will not proceed to the rest of the items in the list +and return error along with salvaged data to the main callback function. + +#### Input Array + +```javascript +var serial = require('asynckit/serial') + , assert = require('assert') + ; + +var source = [ 1, 1, 4, 16, 64, 32, 8, 2 ] + , expectedResult = [ 2, 2, 8, 32, 128, 64, 16, 4 ] + , expectedTarget = [ 0, 1, 2, 3, 4, 5, 6, 7 ] + , target = [] + ; + +serial(source, asyncJob, function(err, result) +{ + assert.deepEqual(result, expectedResult); + assert.deepEqual(target, expectedTarget); +}); + +// extended interface (item, key, callback) +// also supported for arrays +function asyncJob(item, key, cb) +{ + target.push(key); + + // it will be automatically made async + // even it iterator "returns" in the same event loop + cb(null, item * 2); +} +``` + +More examples could be found in [test/test-serial-array.js](test/test-serial-array.js). + +#### Input Object + +Also it supports named jobs, listed via object. + +```javascript +var serial = require('asynckit').serial + , assert = require('assert') + ; + +var source = [ 1, 1, 4, 16, 64, 32, 8, 2 ] + , expectedResult = [ 2, 2, 8, 32, 128, 64, 16, 4 ] + , expectedTarget = [ 0, 1, 2, 3, 4, 5, 6, 7 ] + , target = [] + ; + +var source = { first: 1, one: 1, four: 4, sixteen: 16, sixtyFour: 64, thirtyTwo: 32, eight: 8, two: 2 } + , expectedResult = { first: 2, one: 2, four: 8, sixteen: 32, sixtyFour: 128, thirtyTwo: 64, eight: 16, two: 4 } + , expectedTarget = [ 1, 1, 4, 16, 64, 32, 8, 2 ] + , target = [] + ; + + +serial(source, asyncJob, function(err, result) +{ + assert.deepEqual(result, expectedResult); + assert.deepEqual(target, expectedTarget); +}); + +// shortcut interface (item, callback) +// works for object as well as for the arrays +function asyncJob(item, cb) +{ + target.push(item); + + // it will be automatically made async + // even it iterator "returns" in the same event loop + cb(null, item * 2); +} +``` + +More examples could be found in [test/test-serial-object.js](test/test-serial-object.js). + +_Note: Since _object_ is an _unordered_ collection of properties, +it may produce unexpected results with sequential iterations. +Whenever order of the jobs' execution is important please use `serialOrdered` method._ + +### Ordered Serial Iterations + +TBD + +For example [compare-property](compare-property) package. + +### Streaming interface + +TBD + +## Want to Know More? + +More examples can be found in [test folder](test/). + +Or open an [issue](https://github.com/alexindigo/asynckit/issues) with questions and/or suggestions. + +## License + +AsyncKit is licensed under the MIT license. diff --git a/packages/字体精简工具/node_modules/asynckit/bench.js b/packages/字体精简工具/node_modules/asynckit/bench.js new file mode 100644 index 0000000..c612f1a --- /dev/null +++ b/packages/字体精简工具/node_modules/asynckit/bench.js @@ -0,0 +1,76 @@ +/* eslint no-console: "off" */ + +var asynckit = require('./') + , async = require('async') + , assert = require('assert') + , expected = 0 + ; + +var Benchmark = require('benchmark'); +var suite = new Benchmark.Suite; + +var source = []; +for (var z = 1; z < 100; z++) +{ + source.push(z); + expected += z; +} + +suite +// add tests + +.add('async.map', function(deferred) +{ + var total = 0; + + async.map(source, + function(i, cb) + { + setImmediate(function() + { + total += i; + cb(null, total); + }); + }, + function(err, result) + { + assert.ifError(err); + assert.equal(result[result.length - 1], expected); + deferred.resolve(); + }); +}, {'defer': true}) + + +.add('asynckit.parallel', function(deferred) +{ + var total = 0; + + asynckit.parallel(source, + function(i, cb) + { + setImmediate(function() + { + total += i; + cb(null, total); + }); + }, + function(err, result) + { + assert.ifError(err); + assert.equal(result[result.length - 1], expected); + deferred.resolve(); + }); +}, {'defer': true}) + + +// add listeners +.on('cycle', function(ev) +{ + console.log(String(ev.target)); +}) +.on('complete', function() +{ + console.log('Fastest is ' + this.filter('fastest').map('name')); +}) +// run async +.run({ 'async': true }); diff --git a/packages/字体精简工具/node_modules/asynckit/index.js b/packages/字体精简工具/node_modules/asynckit/index.js new file mode 100644 index 0000000..455f945 --- /dev/null +++ b/packages/字体精简工具/node_modules/asynckit/index.js @@ -0,0 +1,6 @@ +module.exports = +{ + parallel : require('./parallel.js'), + serial : require('./serial.js'), + serialOrdered : require('./serialOrdered.js') +}; diff --git a/packages/字体精简工具/node_modules/asynckit/lib/abort.js b/packages/字体精简工具/node_modules/asynckit/lib/abort.js new file mode 100644 index 0000000..114367e --- /dev/null +++ b/packages/字体精简工具/node_modules/asynckit/lib/abort.js @@ -0,0 +1,29 @@ +// API +module.exports = abort; + +/** + * Aborts leftover active jobs + * + * @param {object} state - current state object + */ +function abort(state) +{ + Object.keys(state.jobs).forEach(clean.bind(state)); + + // reset leftover jobs + state.jobs = {}; +} + +/** + * Cleans up leftover job by invoking abort function for the provided job id + * + * @this state + * @param {string|number} key - job id to abort + */ +function clean(key) +{ + if (typeof this.jobs[key] == 'function') + { + this.jobs[key](); + } +} diff --git a/packages/字体精简工具/node_modules/asynckit/lib/async.js b/packages/字体精简工具/node_modules/asynckit/lib/async.js new file mode 100644 index 0000000..7f1288a --- /dev/null +++ b/packages/字体精简工具/node_modules/asynckit/lib/async.js @@ -0,0 +1,34 @@ +var defer = require('./defer.js'); + +// API +module.exports = async; + +/** + * Runs provided callback asynchronously + * even if callback itself is not + * + * @param {function} callback - callback to invoke + * @returns {function} - augmented callback + */ +function async(callback) +{ + var isAsync = false; + + // check if async happened + defer(function() { isAsync = true; }); + + return function async_callback(err, result) + { + if (isAsync) + { + callback(err, result); + } + else + { + defer(function nextTick_callback() + { + callback(err, result); + }); + } + }; +} diff --git a/packages/字体精简工具/node_modules/asynckit/lib/defer.js b/packages/字体精简工具/node_modules/asynckit/lib/defer.js new file mode 100644 index 0000000..b67110c --- /dev/null +++ b/packages/字体精简工具/node_modules/asynckit/lib/defer.js @@ -0,0 +1,26 @@ +module.exports = defer; + +/** + * Runs provided function on next iteration of the event loop + * + * @param {function} fn - function to run + */ +function defer(fn) +{ + var nextTick = typeof setImmediate == 'function' + ? setImmediate + : ( + typeof process == 'object' && typeof process.nextTick == 'function' + ? process.nextTick + : null + ); + + if (nextTick) + { + nextTick(fn); + } + else + { + setTimeout(fn, 0); + } +} diff --git a/packages/字体精简工具/node_modules/asynckit/lib/iterate.js b/packages/字体精简工具/node_modules/asynckit/lib/iterate.js new file mode 100644 index 0000000..5d2839a --- /dev/null +++ b/packages/字体精简工具/node_modules/asynckit/lib/iterate.js @@ -0,0 +1,75 @@ +var async = require('./async.js') + , abort = require('./abort.js') + ; + +// API +module.exports = iterate; + +/** + * Iterates over each job object + * + * @param {array|object} list - array or object (named list) to iterate over + * @param {function} iterator - iterator to run + * @param {object} state - current job status + * @param {function} callback - invoked when all elements processed + */ +function iterate(list, iterator, state, callback) +{ + // store current index + var key = state['keyedList'] ? state['keyedList'][state.index] : state.index; + + state.jobs[key] = runJob(iterator, key, list[key], function(error, output) + { + // don't repeat yourself + // skip secondary callbacks + if (!(key in state.jobs)) + { + return; + } + + // clean up jobs + delete state.jobs[key]; + + if (error) + { + // don't process rest of the results + // stop still active jobs + // and reset the list + abort(state); + } + else + { + state.results[key] = output; + } + + // return salvaged results + callback(error, state.results); + }); +} + +/** + * Runs iterator over provided job element + * + * @param {function} iterator - iterator to invoke + * @param {string|number} key - key/index of the element in the list of jobs + * @param {mixed} item - job description + * @param {function} callback - invoked after iterator is done with the job + * @returns {function|mixed} - job abort function or something else + */ +function runJob(iterator, key, item, callback) +{ + var aborter; + + // allow shortcut if iterator expects only two arguments + if (iterator.length == 2) + { + aborter = iterator(item, async(callback)); + } + // otherwise go with full three arguments + else + { + aborter = iterator(item, key, async(callback)); + } + + return aborter; +} diff --git a/packages/字体精简工具/node_modules/asynckit/lib/readable_asynckit.js b/packages/字体精简工具/node_modules/asynckit/lib/readable_asynckit.js new file mode 100644 index 0000000..78ad240 --- /dev/null +++ b/packages/字体精简工具/node_modules/asynckit/lib/readable_asynckit.js @@ -0,0 +1,91 @@ +var streamify = require('./streamify.js') + , defer = require('./defer.js') + ; + +// API +module.exports = ReadableAsyncKit; + +/** + * Base constructor for all streams + * used to hold properties/methods + */ +function ReadableAsyncKit() +{ + ReadableAsyncKit.super_.apply(this, arguments); + + // list of active jobs + this.jobs = {}; + + // add stream methods + this.destroy = destroy; + this._start = _start; + this._read = _read; +} + +/** + * Destroys readable stream, + * by aborting outstanding jobs + * + * @returns {void} + */ +function destroy() +{ + if (this.destroyed) + { + return; + } + + this.destroyed = true; + + if (typeof this.terminator == 'function') + { + this.terminator(); + } +} + +/** + * Starts provided jobs in async manner + * + * @private + */ +function _start() +{ + // first argument – runner function + var runner = arguments[0] + // take away first argument + , args = Array.prototype.slice.call(arguments, 1) + // second argument - input data + , input = args[0] + // last argument - result callback + , endCb = streamify.callback.call(this, args[args.length - 1]) + ; + + args[args.length - 1] = endCb; + // third argument - iterator + args[1] = streamify.iterator.call(this, args[1]); + + // allow time for proper setup + defer(function() + { + if (!this.destroyed) + { + this.terminator = runner.apply(null, args); + } + else + { + endCb(null, Array.isArray(input) ? [] : {}); + } + }.bind(this)); +} + + +/** + * Implement _read to comply with Readable streams + * Doesn't really make sense for flowing object mode + * + * @private + */ +function _read() +{ + +} diff --git a/packages/字体精简工具/node_modules/asynckit/lib/readable_parallel.js b/packages/字体精简工具/node_modules/asynckit/lib/readable_parallel.js new file mode 100644 index 0000000..5d2929f --- /dev/null +++ b/packages/字体精简工具/node_modules/asynckit/lib/readable_parallel.js @@ -0,0 +1,25 @@ +var parallel = require('../parallel.js'); + +// API +module.exports = ReadableParallel; + +/** + * Streaming wrapper to `asynckit.parallel` + * + * @param {array|object} list - array or object (named list) to iterate over + * @param {function} iterator - iterator to run + * @param {function} callback - invoked when all elements processed + * @returns {stream.Readable#} + */ +function ReadableParallel(list, iterator, callback) +{ + if (!(this instanceof ReadableParallel)) + { + return new ReadableParallel(list, iterator, callback); + } + + // turn on object mode + ReadableParallel.super_.call(this, {objectMode: true}); + + this._start(parallel, list, iterator, callback); +} diff --git a/packages/字体精简工具/node_modules/asynckit/lib/readable_serial.js b/packages/字体精简工具/node_modules/asynckit/lib/readable_serial.js new file mode 100644 index 0000000..7822698 --- /dev/null +++ b/packages/字体精简工具/node_modules/asynckit/lib/readable_serial.js @@ -0,0 +1,25 @@ +var serial = require('../serial.js'); + +// API +module.exports = ReadableSerial; + +/** + * Streaming wrapper to `asynckit.serial` + * + * @param {array|object} list - array or object (named list) to iterate over + * @param {function} iterator - iterator to run + * @param {function} callback - invoked when all elements processed + * @returns {stream.Readable#} + */ +function ReadableSerial(list, iterator, callback) +{ + if (!(this instanceof ReadableSerial)) + { + return new ReadableSerial(list, iterator, callback); + } + + // turn on object mode + ReadableSerial.super_.call(this, {objectMode: true}); + + this._start(serial, list, iterator, callback); +} diff --git a/packages/字体精简工具/node_modules/asynckit/lib/readable_serial_ordered.js b/packages/字体精简工具/node_modules/asynckit/lib/readable_serial_ordered.js new file mode 100644 index 0000000..3de89c4 --- /dev/null +++ b/packages/字体精简工具/node_modules/asynckit/lib/readable_serial_ordered.js @@ -0,0 +1,29 @@ +var serialOrdered = require('../serialOrdered.js'); + +// API +module.exports = ReadableSerialOrdered; +// expose sort helpers +module.exports.ascending = serialOrdered.ascending; +module.exports.descending = serialOrdered.descending; + +/** + * Streaming wrapper to `asynckit.serialOrdered` + * + * @param {array|object} list - array or object (named list) to iterate over + * @param {function} iterator - iterator to run + * @param {function} sortMethod - custom sort function + * @param {function} callback - invoked when all elements processed + * @returns {stream.Readable#} + */ +function ReadableSerialOrdered(list, iterator, sortMethod, callback) +{ + if (!(this instanceof ReadableSerialOrdered)) + { + return new ReadableSerialOrdered(list, iterator, sortMethod, callback); + } + + // turn on object mode + ReadableSerialOrdered.super_.call(this, {objectMode: true}); + + this._start(serialOrdered, list, iterator, sortMethod, callback); +} diff --git a/packages/字体精简工具/node_modules/asynckit/lib/state.js b/packages/字体精简工具/node_modules/asynckit/lib/state.js new file mode 100644 index 0000000..cbea7ad --- /dev/null +++ b/packages/字体精简工具/node_modules/asynckit/lib/state.js @@ -0,0 +1,37 @@ +// API +module.exports = state; + +/** + * Creates initial state object + * for iteration over list + * + * @param {array|object} list - list to iterate over + * @param {function|null} sortMethod - function to use for keys sort, + * or `null` to keep them as is + * @returns {object} - initial state object + */ +function state(list, sortMethod) +{ + var isNamedList = !Array.isArray(list) + , initState = + { + index : 0, + keyedList: isNamedList || sortMethod ? Object.keys(list) : null, + jobs : {}, + results : isNamedList ? {} : [], + size : isNamedList ? Object.keys(list).length : list.length + } + ; + + if (sortMethod) + { + // sort array keys based on it's values + // sort object's keys just on own merit + initState.keyedList.sort(isNamedList ? sortMethod : function(a, b) + { + return sortMethod(list[a], list[b]); + }); + } + + return initState; +} diff --git a/packages/字体精简工具/node_modules/asynckit/lib/streamify.js b/packages/字体精简工具/node_modules/asynckit/lib/streamify.js new file mode 100644 index 0000000..f56a1c9 --- /dev/null +++ b/packages/字体精简工具/node_modules/asynckit/lib/streamify.js @@ -0,0 +1,141 @@ +var async = require('./async.js'); + +// API +module.exports = { + iterator: wrapIterator, + callback: wrapCallback +}; + +/** + * Wraps iterators with long signature + * + * @this ReadableAsyncKit# + * @param {function} iterator - function to wrap + * @returns {function} - wrapped function + */ +function wrapIterator(iterator) +{ + var stream = this; + + return function(item, key, cb) + { + var aborter + , wrappedCb = async(wrapIteratorCallback.call(stream, cb, key)) + ; + + stream.jobs[key] = wrappedCb; + + // it's either shortcut (item, cb) + if (iterator.length == 2) + { + aborter = iterator(item, wrappedCb); + } + // or long format (item, key, cb) + else + { + aborter = iterator(item, key, wrappedCb); + } + + return aborter; + }; +} + +/** + * Wraps provided callback function + * allowing to execute snitch function before + * real callback + * + * @this ReadableAsyncKit# + * @param {function} callback - function to wrap + * @returns {function} - wrapped function + */ +function wrapCallback(callback) +{ + var stream = this; + + var wrapped = function(error, result) + { + return finisher.call(stream, error, result, callback); + }; + + return wrapped; +} + +/** + * Wraps provided iterator callback function + * makes sure snitch only called once, + * but passes secondary calls to the original callback + * + * @this ReadableAsyncKit# + * @param {function} callback - callback to wrap + * @param {number|string} key - iteration key + * @returns {function} wrapped callback + */ +function wrapIteratorCallback(callback, key) +{ + var stream = this; + + return function(error, output) + { + // don't repeat yourself + if (!(key in stream.jobs)) + { + callback(error, output); + return; + } + + // clean up jobs + delete stream.jobs[key]; + + return streamer.call(stream, error, {key: key, value: output}, callback); + }; +} + +/** + * Stream wrapper for iterator callback + * + * @this ReadableAsyncKit# + * @param {mixed} error - error response + * @param {mixed} output - iterator output + * @param {function} callback - callback that expects iterator results + */ +function streamer(error, output, callback) +{ + if (error && !this.error) + { + this.error = error; + this.pause(); + this.emit('error', error); + // send back value only, as expected + callback(error, output && output.value); + return; + } + + // stream stuff + this.push(output); + + // back to original track + // send back value only, as expected + callback(error, output && output.value); +} + +/** + * Stream wrapper for finishing callback + * + * @this ReadableAsyncKit# + * @param {mixed} error - error response + * @param {mixed} output - iterator output + * @param {function} callback - callback that expects final results + */ +function finisher(error, output, callback) +{ + // signal end of the stream + // only for successfully finished streams + if (!error) + { + this.push(null); + } + + // back to original track + callback(error, output); +} diff --git a/packages/字体精简工具/node_modules/asynckit/lib/terminator.js b/packages/字体精简工具/node_modules/asynckit/lib/terminator.js new file mode 100644 index 0000000..d6eb992 --- /dev/null +++ b/packages/字体精简工具/node_modules/asynckit/lib/terminator.js @@ -0,0 +1,29 @@ +var abort = require('./abort.js') + , async = require('./async.js') + ; + +// API +module.exports = terminator; + +/** + * Terminates jobs in the attached state context + * + * @this AsyncKitState# + * @param {function} callback - final callback to invoke after termination + */ +function terminator(callback) +{ + if (!Object.keys(this.jobs).length) + { + return; + } + + // fast forward iteration index + this.index = this.size; + + // abort jobs + abort(this); + + // send back results we have so far + async(callback)(null, this.results); +} diff --git a/packages/字体精简工具/node_modules/asynckit/package.json b/packages/字体精简工具/node_modules/asynckit/package.json new file mode 100644 index 0000000..6730e68 --- /dev/null +++ b/packages/字体精简工具/node_modules/asynckit/package.json @@ -0,0 +1,91 @@ +{ + "_from": "asynckit@^0.4.0", + "_id": "asynckit@0.4.0", + "_inBundle": false, + "_integrity": "sha1-x57Zf380y48robyXkLzDZkdLS3k=", + "_location": "/asynckit", + "_phantomChildren": {}, + "_requested": { + "type": "range", + "registry": true, + "raw": "asynckit@^0.4.0", + "name": "asynckit", + "escapedName": "asynckit", + "rawSpec": "^0.4.0", + "saveSpec": null, + "fetchSpec": "^0.4.0" + }, + "_requiredBy": [ + "/form-data" + ], + "_resolved": "https://registry.npm.taobao.org/asynckit/download/asynckit-0.4.0.tgz", + "_shasum": "c79ed97f7f34cb8f2ba1bc9790bcc366474b4b79", + "_spec": "asynckit@^0.4.0", + "_where": "D:\\workspace\\plugin\\mini_font\\packages\\mini_font\\publish\\mini_font\\node_modules\\form-data", + "author": { + "name": "Alex Indigo", + "email": "iam@alexindigo.com" + }, + "bugs": { + "url": "https://github.com/alexindigo/asynckit/issues" + }, + "bundleDependencies": false, + "dependencies": {}, + "deprecated": false, + "description": "Minimal async jobs utility library, with streams support", + "devDependencies": { + "browserify": "^13.0.0", + "browserify-istanbul": "^2.0.0", + "coveralls": "^2.11.9", + "eslint": "^2.9.0", + "istanbul": "^0.4.3", + "obake": "^0.1.2", + "phantomjs-prebuilt": "^2.1.7", + "pre-commit": "^1.1.3", + "reamde": "^1.1.0", + "rimraf": "^2.5.2", + "size-table": "^0.2.0", + "tap-spec": "^4.1.1", + "tape": "^4.5.1" + }, + "homepage": "https://github.com/alexindigo/asynckit#readme", + "keywords": [ + "async", + "jobs", + "parallel", + "serial", + "iterator", + "array", + "object", + "stream", + "destroy", + "terminate", + "abort" + ], + "license": "MIT", + "main": "index.js", + "name": "asynckit", + "pre-commit": [ + "clean", + "lint", + "test", + "browser", + "report", + "size" + ], + "repository": { + "type": "git", + "url": "git+https://github.com/alexindigo/asynckit.git" + }, + "scripts": { + "browser": "browserify -t browserify-istanbul test/lib/browserify_adjustment.js test/test-*.js | obake --coverage | tap-spec", + "clean": "rimraf coverage", + "debug": "tape test/test-*.js", + "lint": "eslint *.js lib/*.js test/*.js", + "report": "istanbul report", + "size": "browserify index.js | size-table asynckit", + "test": "istanbul cover --reporter=json tape -- 'test/test-*.js' | tap-spec", + "win-test": "tape test/test-*.js" + }, + "version": "0.4.0" +} diff --git a/packages/字体精简工具/node_modules/asynckit/parallel.js b/packages/字体精简工具/node_modules/asynckit/parallel.js new file mode 100644 index 0000000..3c50344 --- /dev/null +++ b/packages/字体精简工具/node_modules/asynckit/parallel.js @@ -0,0 +1,43 @@ +var iterate = require('./lib/iterate.js') + , initState = require('./lib/state.js') + , terminator = require('./lib/terminator.js') + ; + +// Public API +module.exports = parallel; + +/** + * Runs iterator over provided array elements in parallel + * + * @param {array|object} list - array or object (named list) to iterate over + * @param {function} iterator - iterator to run + * @param {function} callback - invoked when all elements processed + * @returns {function} - jobs terminator + */ +function parallel(list, iterator, callback) +{ + var state = initState(list); + + while (state.index < (state['keyedList'] || list).length) + { + iterate(list, iterator, state, function(error, result) + { + if (error) + { + callback(error, result); + return; + } + + // looks like it's the last one + if (Object.keys(state.jobs).length === 0) + { + callback(null, state.results); + return; + } + }); + + state.index++; + } + + return terminator.bind(state, callback); +} diff --git a/packages/字体精简工具/node_modules/asynckit/serial.js b/packages/字体精简工具/node_modules/asynckit/serial.js new file mode 100644 index 0000000..6cd949a --- /dev/null +++ b/packages/字体精简工具/node_modules/asynckit/serial.js @@ -0,0 +1,17 @@ +var serialOrdered = require('./serialOrdered.js'); + +// Public API +module.exports = serial; + +/** + * Runs iterator over provided array elements in series + * + * @param {array|object} list - array or object (named list) to iterate over + * @param {function} iterator - iterator to run + * @param {function} callback - invoked when all elements processed + * @returns {function} - jobs terminator + */ +function serial(list, iterator, callback) +{ + return serialOrdered(list, iterator, null, callback); +} diff --git a/packages/字体精简工具/node_modules/asynckit/serialOrdered.js b/packages/字体精简工具/node_modules/asynckit/serialOrdered.js new file mode 100644 index 0000000..607eafe --- /dev/null +++ b/packages/字体精简工具/node_modules/asynckit/serialOrdered.js @@ -0,0 +1,75 @@ +var iterate = require('./lib/iterate.js') + , initState = require('./lib/state.js') + , terminator = require('./lib/terminator.js') + ; + +// Public API +module.exports = serialOrdered; +// sorting helpers +module.exports.ascending = ascending; +module.exports.descending = descending; + +/** + * Runs iterator over provided sorted array elements in series + * + * @param {array|object} list - array or object (named list) to iterate over + * @param {function} iterator - iterator to run + * @param {function} sortMethod - custom sort function + * @param {function} callback - invoked when all elements processed + * @returns {function} - jobs terminator + */ +function serialOrdered(list, iterator, sortMethod, callback) +{ + var state = initState(list, sortMethod); + + iterate(list, iterator, state, function iteratorHandler(error, result) + { + if (error) + { + callback(error, result); + return; + } + + state.index++; + + // are we there yet? + if (state.index < (state['keyedList'] || list).length) + { + iterate(list, iterator, state, iteratorHandler); + return; + } + + // done here + callback(null, state.results); + }); + + return terminator.bind(state, callback); +} + +/* + * -- Sort methods + */ + +/** + * sort helper to sort array elements in ascending order + * + * @param {mixed} a - an item to compare + * @param {mixed} b - an item to compare + * @returns {number} - comparison result + */ +function ascending(a, b) +{ + return a < b ? -1 : a > b ? 1 : 0; +} + +/** + * sort helper to sort array elements in descending order + * + * @param {mixed} a - an item to compare + * @param {mixed} b - an item to compare + * @returns {number} - comparison result + */ +function descending(a, b) +{ + return -1 * ascending(a, b); +} diff --git a/packages/字体精简工具/node_modules/asynckit/stream.js b/packages/字体精简工具/node_modules/asynckit/stream.js new file mode 100644 index 0000000..d43465f --- /dev/null +++ b/packages/字体精简工具/node_modules/asynckit/stream.js @@ -0,0 +1,21 @@ +var inherits = require('util').inherits + , Readable = require('stream').Readable + , ReadableAsyncKit = require('./lib/readable_asynckit.js') + , ReadableParallel = require('./lib/readable_parallel.js') + , ReadableSerial = require('./lib/readable_serial.js') + , ReadableSerialOrdered = require('./lib/readable_serial_ordered.js') + ; + +// API +module.exports = +{ + parallel : ReadableParallel, + serial : ReadableSerial, + serialOrdered : ReadableSerialOrdered, +}; + +inherits(ReadableAsyncKit, Readable); + +inherits(ReadableParallel, ReadableAsyncKit); +inherits(ReadableSerial, ReadableAsyncKit); +inherits(ReadableSerialOrdered, ReadableAsyncKit); diff --git a/packages/字体精简工具/node_modules/aws-sign2/LICENSE b/packages/字体精简工具/node_modules/aws-sign2/LICENSE new file mode 100644 index 0000000..a4a9aee --- /dev/null +++ b/packages/字体精简工具/node_modules/aws-sign2/LICENSE @@ -0,0 +1,55 @@ +Apache License + +Version 2.0, January 2004 + +http://www.apache.org/licenses/ + +TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + +1. Definitions. + +"License" shall mean the terms and conditions for use, reproduction, and distribution as defined by Sections 1 through 9 of this document. + +"Licensor" shall mean the copyright owner or entity authorized by the copyright owner that is granting the License. + +"Legal Entity" shall mean the union of the acting entity and all other entities that control, are controlled by, or are under common control with that entity. For the purposes of this definition, "control" means (i) the power, direct or indirect, to cause the direction or management of such entity, whether by contract or otherwise, or (ii) ownership of fifty percent (50%) or more of the outstanding shares, or (iii) beneficial ownership of such entity. + +"You" (or "Your") shall mean an individual or Legal Entity exercising permissions granted by this License. + +"Source" form shall mean the preferred form for making modifications, including but not limited to software source code, documentation source, and configuration files. + +"Object" form shall mean any form resulting from mechanical transformation or translation of a Source form, including but not limited to compiled object code, generated documentation, and conversions to other media types. + +"Work" shall mean the work of authorship, whether in Source or Object form, made available under the License, as indicated by a copyright notice that is included in or attached to the work (an example is provided in the Appendix below). + +"Derivative Works" shall mean any work, whether in Source or Object form, that is based on (or derived from) the Work and for which the editorial revisions, annotations, elaborations, or other modifications represent, as a whole, an original work of authorship. For the purposes of this License, Derivative Works shall not include works that remain separable from, or merely link (or bind by name) to the interfaces of, the Work and Derivative Works thereof. + +"Contribution" shall mean any work of authorship, including the original version of the Work and any modifications or additions to that Work or Derivative Works thereof, that is intentionally submitted to Licensor for inclusion in the Work by the copyright owner or by an individual or Legal Entity authorized to submit on behalf of the copyright owner. For the purposes of this definition, "submitted" means any form of electronic, verbal, or written communication sent to the Licensor or its representatives, including but not limited to communication on electronic mailing lists, source code control systems, and issue tracking systems that are managed by, or on behalf of, the Licensor for the purpose of discussing and improving the Work, but excluding communication that is conspicuously marked or otherwise designated in writing by the copyright owner as "Not a Contribution." + +"Contributor" shall mean Licensor and any individual or Legal Entity on behalf of whom a Contribution has been received by Licensor and subsequently incorporated within the Work. + +2. Grant of Copyright License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable copyright license to reproduce, prepare Derivative Works of, publicly display, publicly perform, sublicense, and distribute the Work and such Derivative Works in Source or Object form. + +3. Grant of Patent License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable (except as stated in this section) patent license to make, have made, use, offer to sell, sell, import, and otherwise transfer the Work, where such license applies only to those patent claims licensable by such Contributor that are necessarily infringed by their Contribution(s) alone or by combination of their Contribution(s) with the Work to which such Contribution(s) was submitted. If You institute patent litigation against any entity (including a cross-claim or counterclaim in a lawsuit) alleging that the Work or a Contribution incorporated within the Work constitutes direct or contributory patent infringement, then any patent licenses granted to You under this License for that Work shall terminate as of the date such litigation is filed. + +4. Redistribution. You may reproduce and distribute copies of the Work or Derivative Works thereof in any medium, with or without modifications, and in Source or Object form, provided that You meet the following conditions: + +You must give any other recipients of the Work or Derivative Works a copy of this License; and + +You must cause any modified files to carry prominent notices stating that You changed the files; and + +You must retain, in the Source form of any Derivative Works that You distribute, all copyright, patent, trademark, and attribution notices from the Source form of the Work, excluding those notices that do not pertain to any part of the Derivative Works; and + +If the Work includes a "NOTICE" text file as part of its distribution, then any Derivative Works that You distribute must include a readable copy of the attribution notices contained within such NOTICE file, excluding those notices that do not pertain to any part of the Derivative Works, in at least one of the following places: within a NOTICE text file distributed as part of the Derivative Works; within the Source form or documentation, if provided along with the Derivative Works; or, within a display generated by the Derivative Works, if and wherever such third-party notices normally appear. The contents of the NOTICE file are for informational purposes only and do not modify the License. You may add Your own attribution notices within Derivative Works that You distribute, alongside or as an addendum to the NOTICE text from the Work, provided that such additional attribution notices cannot be construed as modifying the License. You may add Your own copyright statement to Your modifications and may provide additional or different license terms and conditions for use, reproduction, or distribution of Your modifications, or for any such Derivative Works as a whole, provided Your use, reproduction, and distribution of the Work otherwise complies with the conditions stated in this License. + +5. Submission of Contributions. Unless You explicitly state otherwise, any Contribution intentionally submitted for inclusion in the Work by You to the Licensor shall be under the terms and conditions of this License, without any additional terms or conditions. Notwithstanding the above, nothing herein shall supersede or modify the terms of any separate license agreement you may have executed with Licensor regarding such Contributions. + +6. Trademarks. This License does not grant permission to use the trade names, trademarks, service marks, or product names of the Licensor, except as required for reasonable and customary use in describing the origin of the Work and reproducing the content of the NOTICE file. + +7. Disclaimer of Warranty. Unless required by applicable law or agreed to in writing, Licensor provides the Work (and each Contributor provides its Contributions) on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied, including, without limitation, any warranties or conditions of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A PARTICULAR PURPOSE. You are solely responsible for determining the appropriateness of using or redistributing the Work and assume any risks associated with Your exercise of permissions under this License. + +8. Limitation of Liability. In no event and under no legal theory, whether in tort (including negligence), contract, or otherwise, unless required by applicable law (such as deliberate and grossly negligent acts) or agreed to in writing, shall any Contributor be liable to You for damages, including any direct, indirect, special, incidental, or consequential damages of any character arising as a result of this License or out of the use or inability to use the Work (including but not limited to damages for loss of goodwill, work stoppage, computer failure or malfunction, or any and all other commercial damages or losses), even if such Contributor has been advised of the possibility of such damages. + +9. Accepting Warranty or Additional Liability. While redistributing the Work or Derivative Works thereof, You may choose to offer, and charge a fee for, acceptance of support, warranty, indemnity, or other liability obligations and/or rights consistent with this License. However, in accepting such obligations, You may act only on Your own behalf and on Your sole responsibility, not on behalf of any other Contributor, and only if You agree to indemnify, defend, and hold each Contributor harmless for any liability incurred by, or claims asserted against, such Contributor by reason of your accepting any such warranty or additional liability. + +END OF TERMS AND CONDITIONS \ No newline at end of file diff --git a/packages/字体精简工具/node_modules/aws-sign2/README.md b/packages/字体精简工具/node_modules/aws-sign2/README.md new file mode 100644 index 0000000..763564e --- /dev/null +++ b/packages/字体精简工具/node_modules/aws-sign2/README.md @@ -0,0 +1,4 @@ +aws-sign +======== + +AWS signing. Originally pulled from LearnBoost/knox, maintained as vendor in request, now a standalone module. diff --git a/packages/字体精简工具/node_modules/aws-sign2/index.js b/packages/字体精简工具/node_modules/aws-sign2/index.js new file mode 100644 index 0000000..fb35f6d --- /dev/null +++ b/packages/字体精简工具/node_modules/aws-sign2/index.js @@ -0,0 +1,212 @@ + +/*! + * Copyright 2010 LearnBoost + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/** + * Module dependencies. + */ + +var crypto = require('crypto') + , parse = require('url').parse + ; + +/** + * Valid keys. + */ + +var keys = + [ 'acl' + , 'location' + , 'logging' + , 'notification' + , 'partNumber' + , 'policy' + , 'requestPayment' + , 'torrent' + , 'uploadId' + , 'uploads' + , 'versionId' + , 'versioning' + , 'versions' + , 'website' + ] + +/** + * Return an "Authorization" header value with the given `options` + * in the form of "AWS :" + * + * @param {Object} options + * @return {String} + * @api private + */ + +function authorization (options) { + return 'AWS ' + options.key + ':' + sign(options) +} + +module.exports = authorization +module.exports.authorization = authorization + +/** + * Simple HMAC-SHA1 Wrapper + * + * @param {Object} options + * @return {String} + * @api private + */ + +function hmacSha1 (options) { + return crypto.createHmac('sha1', options.secret).update(options.message).digest('base64') +} + +module.exports.hmacSha1 = hmacSha1 + +/** + * Create a base64 sha1 HMAC for `options`. + * + * @param {Object} options + * @return {String} + * @api private + */ + +function sign (options) { + options.message = stringToSign(options) + return hmacSha1(options) +} +module.exports.sign = sign + +/** + * Create a base64 sha1 HMAC for `options`. + * + * Specifically to be used with S3 presigned URLs + * + * @param {Object} options + * @return {String} + * @api private + */ + +function signQuery (options) { + options.message = queryStringToSign(options) + return hmacSha1(options) +} +module.exports.signQuery= signQuery + +/** + * Return a string for sign() with the given `options`. + * + * Spec: + * + * \n + * \n + * \n + * \n + * [headers\n] + * + * + * @param {Object} options + * @return {String} + * @api private + */ + +function stringToSign (options) { + var headers = options.amazonHeaders || '' + if (headers) headers += '\n' + var r = + [ options.verb + , options.md5 + , options.contentType + , options.date ? options.date.toUTCString() : '' + , headers + options.resource + ] + return r.join('\n') +} +module.exports.stringToSign = stringToSign + +/** + * Return a string for sign() with the given `options`, but is meant exclusively + * for S3 presigned URLs + * + * Spec: + * + * \n + * + * + * @param {Object} options + * @return {String} + * @api private + */ + +function queryStringToSign (options){ + return 'GET\n\n\n' + options.date + '\n' + options.resource +} +module.exports.queryStringToSign = queryStringToSign + +/** + * Perform the following: + * + * - ignore non-amazon headers + * - lowercase fields + * - sort lexicographically + * - trim whitespace between ":" + * - join with newline + * + * @param {Object} headers + * @return {String} + * @api private + */ + +function canonicalizeHeaders (headers) { + var buf = [] + , fields = Object.keys(headers) + ; + for (var i = 0, len = fields.length; i < len; ++i) { + var field = fields[i] + , val = headers[field] + , field = field.toLowerCase() + ; + if (0 !== field.indexOf('x-amz')) continue + buf.push(field + ':' + val) + } + return buf.sort().join('\n') +} +module.exports.canonicalizeHeaders = canonicalizeHeaders + +/** + * Perform the following: + * + * - ignore non sub-resources + * - sort lexicographically + * + * @param {String} resource + * @return {String} + * @api private + */ + +function canonicalizeResource (resource) { + var url = parse(resource, true) + , path = url.pathname + , buf = [] + ; + + Object.keys(url.query).forEach(function(key){ + if (!~keys.indexOf(key)) return + var val = '' == url.query[key] ? '' : '=' + encodeURIComponent(url.query[key]) + buf.push(key + val) + }) + + return path + (buf.length ? '?' + buf.sort().join('&') : '') +} +module.exports.canonicalizeResource = canonicalizeResource diff --git a/packages/字体精简工具/node_modules/aws-sign2/package.json b/packages/字体精简工具/node_modules/aws-sign2/package.json new file mode 100644 index 0000000..62675ef --- /dev/null +++ b/packages/字体精简工具/node_modules/aws-sign2/package.json @@ -0,0 +1,50 @@ +{ + "_from": "aws-sign2@~0.7.0", + "_id": "aws-sign2@0.7.0", + "_inBundle": false, + "_integrity": "sha1-tG6JCTSpWR8tL2+G1+ap8bP+dqg=", + "_location": "/aws-sign2", + "_phantomChildren": {}, + "_requested": { + "type": "range", + "registry": true, + "raw": "aws-sign2@~0.7.0", + "name": "aws-sign2", + "escapedName": "aws-sign2", + "rawSpec": "~0.7.0", + "saveSpec": null, + "fetchSpec": "~0.7.0" + }, + "_requiredBy": [ + "/request" + ], + "_resolved": "https://registry.nlark.com/aws-sign2/download/aws-sign2-0.7.0.tgz", + "_shasum": "b46e890934a9591f2d2f6f86d7e6a9f1b3fe76a8", + "_spec": "aws-sign2@~0.7.0", + "_where": "D:\\workspace\\plugin\\mini_font\\packages\\mini_font\\publish\\mini_font\\node_modules\\request", + "author": { + "name": "Mikeal Rogers", + "email": "mikeal.rogers@gmail.com", + "url": "http://www.futurealoof.com" + }, + "bugs": { + "url": "https://github.com/mikeal/aws-sign/issues" + }, + "bundleDependencies": false, + "dependencies": {}, + "deprecated": false, + "description": "AWS signing. Originally pulled from LearnBoost/knox, maintained as vendor in request, now a standalone module.", + "devDependencies": {}, + "engines": { + "node": "*" + }, + "homepage": "https://github.com/mikeal/aws-sign#readme", + "license": "Apache-2.0", + "main": "index.js", + "name": "aws-sign2", + "optionalDependencies": {}, + "repository": { + "url": "git+https://github.com/mikeal/aws-sign.git" + }, + "version": "0.7.0" +} diff --git a/packages/字体精简工具/node_modules/aws4/.github/FUNDING.yml b/packages/字体精简工具/node_modules/aws4/.github/FUNDING.yml new file mode 100644 index 0000000..b7fdd97 --- /dev/null +++ b/packages/字体精简工具/node_modules/aws4/.github/FUNDING.yml @@ -0,0 +1,3 @@ +# These are supported funding model platforms + +github: mhart diff --git a/packages/字体精简工具/node_modules/aws4/.travis.yml b/packages/字体精简工具/node_modules/aws4/.travis.yml new file mode 100644 index 0000000..178bf31 --- /dev/null +++ b/packages/字体精简工具/node_modules/aws4/.travis.yml @@ -0,0 +1,9 @@ +language: node_js +node_js: + - "0.10" + - "0.12" + - "4" + - "6" + - "8" + - "10" + - "12" diff --git a/packages/字体精简工具/node_modules/aws4/LICENSE b/packages/字体精简工具/node_modules/aws4/LICENSE new file mode 100644 index 0000000..4f321e5 --- /dev/null +++ b/packages/字体精简工具/node_modules/aws4/LICENSE @@ -0,0 +1,19 @@ +Copyright 2013 Michael Hart (michael.hart.au@gmail.com) + +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/packages/字体精简工具/node_modules/aws4/README.md b/packages/字体精简工具/node_modules/aws4/README.md new file mode 100644 index 0000000..7202e45 --- /dev/null +++ b/packages/字体精简工具/node_modules/aws4/README.md @@ -0,0 +1,183 @@ +aws4 +---- + +[![Build Status](https://api.travis-ci.org/mhart/aws4.png?branch=master)](https://travis-ci.org/github/mhart/aws4) + +A small utility to sign vanilla Node.js http(s) request options using Amazon's +[AWS Signature Version 4](https://docs.aws.amazon.com/general/latest/gr/signature-version-4.html). + +If you want to sign and send AWS requests in a modern browser, or an environment like [Cloudflare Workers](https://developers.cloudflare.com/workers/), then check out [aws4fetch](https://github.com/mhart/aws4fetch) – otherwise you can also bundle this library for use [in older browsers](./browser). + +The only AWS service that *doesn't* support v4 as of 2020-05-22 is +[SimpleDB](https://docs.aws.amazon.com/AmazonSimpleDB/latest/DeveloperGuide/SDB_API.html) +(it only supports [AWS Signature Version 2](https://github.com/mhart/aws2)). + +It also provides defaults for a number of core AWS headers and +request parameters, making it very easy to query AWS services, or +build out a fully-featured AWS library. + +Example +------- + +```javascript +var https = require('https') +var aws4 = require('aws4') + +// to illustrate usage, we'll create a utility function to request and pipe to stdout +function request(opts) { https.request(opts, function(res) { res.pipe(process.stdout) }).end(opts.body || '') } + +// aws4 will sign an options object as you'd pass to http.request, with an AWS service and region +var opts = { host: 'my-bucket.s3.us-west-1.amazonaws.com', path: '/my-object', service: 's3', region: 'us-west-1' } + +// aws4.sign() will sign and modify these options, ready to pass to http.request +aws4.sign(opts, { accessKeyId: '', secretAccessKey: '' }) + +// or it can get credentials from process.env.AWS_ACCESS_KEY_ID, etc +aws4.sign(opts) + +// for most AWS services, aws4 can figure out the service and region if you pass a host +opts = { host: 'my-bucket.s3.us-west-1.amazonaws.com', path: '/my-object' } + +// usually it will add/modify request headers, but you can also sign the query: +opts = { host: 'my-bucket.s3.amazonaws.com', path: '/?X-Amz-Expires=12345', signQuery: true } + +// and for services with simple hosts, aws4 can infer the host from service and region: +opts = { service: 'sqs', region: 'us-east-1', path: '/?Action=ListQueues' } + +// and if you're using us-east-1, it's the default: +opts = { service: 'sqs', path: '/?Action=ListQueues' } + +aws4.sign(opts) +console.log(opts) +/* +{ + host: 'sqs.us-east-1.amazonaws.com', + path: '/?Action=ListQueues', + headers: { + Host: 'sqs.us-east-1.amazonaws.com', + 'X-Amz-Date': '20121226T061030Z', + Authorization: 'AWS4-HMAC-SHA256 Credential=ABCDEF/20121226/us-east-1/sqs/aws4_request, ...' + } +} +*/ + +// we can now use this to query AWS +request(opts) +/* + + +... +*/ + +// aws4 can infer the HTTP method if a body is passed in +// method will be POST and Content-Type: 'application/x-www-form-urlencoded; charset=utf-8' +request(aws4.sign({ service: 'iam', body: 'Action=ListGroups&Version=2010-05-08' })) +/* + +... +*/ + +// you can specify any custom option or header as per usual +request(aws4.sign({ + service: 'dynamodb', + region: 'ap-southeast-2', + method: 'POST', + path: '/', + headers: { + 'Content-Type': 'application/x-amz-json-1.0', + 'X-Amz-Target': 'DynamoDB_20120810.ListTables' + }, + body: '{}' +})) +/* +{"TableNames":[]} +... +*/ + +// The raw RequestSigner can be used to generate CodeCommit Git passwords +var signer = new aws4.RequestSigner({ + service: 'codecommit', + host: 'git-codecommit.us-east-1.amazonaws.com', + method: 'GIT', + path: '/v1/repos/MyAwesomeRepo', +}) +var password = signer.getDateTime() + 'Z' + signer.signature() + +// see example.js for examples with other services +``` + +API +--- + +### aws4.sign(requestOptions, [credentials]) + +Calculates and populates any necessary AWS headers and/or request +options on `requestOptions`. Returns `requestOptions` as a convenience for chaining. + +`requestOptions` is an object holding the same options that the Node.js +[http.request](https://nodejs.org/docs/latest/api/http.html#http_http_request_options_callback) +function takes. + +The following properties of `requestOptions` are used in the signing or +populated if they don't already exist: + +- `hostname` or `host` (will try to be determined from `service` and `region` if not given) +- `method` (will use `'GET'` if not given or `'POST'` if there is a `body`) +- `path` (will use `'/'` if not given) +- `body` (will use `''` if not given) +- `service` (will try to be calculated from `hostname` or `host` if not given) +- `region` (will try to be calculated from `hostname` or `host` or use `'us-east-1'` if not given) +- `signQuery` (to sign the query instead of adding an `Authorization` header, defaults to false) +- `headers['Host']` (will use `hostname` or `host` or be calculated if not given) +- `headers['Content-Type']` (will use `'application/x-www-form-urlencoded; charset=utf-8'` + if not given and there is a `body`) +- `headers['Date']` (used to calculate the signature date if given, otherwise `new Date` is used) + +Your AWS credentials (which can be found in your +[AWS console](https://portal.aws.amazon.com/gp/aws/securityCredentials)) +can be specified in one of two ways: + +- As the second argument, like this: + +```javascript +aws4.sign(requestOptions, { + secretAccessKey: "", + accessKeyId: "", + sessionToken: "" +}) +``` + +- From `process.env`, such as this: + +``` +export AWS_ACCESS_KEY_ID="" +export AWS_SECRET_ACCESS_KEY="" +export AWS_SESSION_TOKEN="" +``` + +(will also use `AWS_ACCESS_KEY` and `AWS_SECRET_KEY` if available) + +The `sessionToken` property and `AWS_SESSION_TOKEN` environment variable are optional for signing +with [IAM STS temporary credentials](https://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_temp_use-resources.html). + +Installation +------------ + +With [npm](https://www.npmjs.com/) do: + +``` +npm install aws4 +``` + +Can also be used [in the browser](./browser). + +Thanks +------ + +Thanks to [@jed](https://github.com/jed) for his +[dynamo-client](https://github.com/jed/dynamo-client) lib where I first +committed and subsequently extracted this code. + +Also thanks to the +[official Node.js AWS SDK](https://github.com/aws/aws-sdk-js) for giving +me a start on implementing the v4 signature. diff --git a/packages/字体精简工具/node_modules/aws4/aws4.js b/packages/字体精简工具/node_modules/aws4/aws4.js new file mode 100644 index 0000000..b99b319 --- /dev/null +++ b/packages/字体精简工具/node_modules/aws4/aws4.js @@ -0,0 +1,373 @@ +var aws4 = exports, + url = require('url'), + querystring = require('querystring'), + crypto = require('crypto'), + lru = require('./lru'), + credentialsCache = lru(1000) + +// http://docs.amazonwebservices.com/general/latest/gr/signature-version-4.html + +function hmac(key, string, encoding) { + return crypto.createHmac('sha256', key).update(string, 'utf8').digest(encoding) +} + +function hash(string, encoding) { + return crypto.createHash('sha256').update(string, 'utf8').digest(encoding) +} + +// This function assumes the string has already been percent encoded +function encodeRfc3986(urlEncodedString) { + return urlEncodedString.replace(/[!'()*]/g, function(c) { + return '%' + c.charCodeAt(0).toString(16).toUpperCase() + }) +} + +function encodeRfc3986Full(str) { + return encodeRfc3986(encodeURIComponent(str)) +} + +// A bit of a combination of: +// https://github.com/aws/aws-sdk-java-v2/blob/dc695de6ab49ad03934e1b02e7263abbd2354be0/core/auth/src/main/java/software/amazon/awssdk/auth/signer/internal/AbstractAws4Signer.java#L59 +// https://github.com/aws/aws-sdk-js/blob/18cb7e5b463b46239f9fdd4a65e2ff8c81831e8f/lib/signers/v4.js#L191-L199 +// https://github.com/mhart/aws4fetch/blob/b3aed16b6f17384cf36ea33bcba3c1e9f3bdfefd/src/main.js#L25-L34 +var HEADERS_TO_IGNORE = { + 'authorization': true, + 'connection': true, + 'x-amzn-trace-id': true, + 'user-agent': true, + 'expect': true, + 'presigned-expires': true, + 'range': true, +} + +// request: { path | body, [host], [method], [headers], [service], [region] } +// credentials: { accessKeyId, secretAccessKey, [sessionToken] } +function RequestSigner(request, credentials) { + + if (typeof request === 'string') request = url.parse(request) + + var headers = request.headers = (request.headers || {}), + hostParts = (!this.service || !this.region) && this.matchHost(request.hostname || request.host || headers.Host || headers.host) + + this.request = request + this.credentials = credentials || this.defaultCredentials() + + this.service = request.service || hostParts[0] || '' + this.region = request.region || hostParts[1] || 'us-east-1' + + // SES uses a different domain from the service name + if (this.service === 'email') this.service = 'ses' + + if (!request.method && request.body) + request.method = 'POST' + + if (!headers.Host && !headers.host) { + headers.Host = request.hostname || request.host || this.createHost() + + // If a port is specified explicitly, use it as is + if (request.port) + headers.Host += ':' + request.port + } + if (!request.hostname && !request.host) + request.hostname = headers.Host || headers.host + + this.isCodeCommitGit = this.service === 'codecommit' && request.method === 'GIT' +} + +RequestSigner.prototype.matchHost = function(host) { + var match = (host || '').match(/([^\.]+)\.(?:([^\.]*)\.)?amazonaws\.com(\.cn)?$/) + var hostParts = (match || []).slice(1, 3) + + // ES's hostParts are sometimes the other way round, if the value that is expected + // to be region equals ‘es’ switch them back + // e.g. search-cluster-name-aaaa00aaaa0aaa0aaaaaaa0aaa.us-east-1.es.amazonaws.com + if (hostParts[1] === 'es') + hostParts = hostParts.reverse() + + if (hostParts[1] == 's3') { + hostParts[0] = 's3' + hostParts[1] = 'us-east-1' + } else { + for (var i = 0; i < 2; i++) { + if (/^s3-/.test(hostParts[i])) { + hostParts[1] = hostParts[i].slice(3) + hostParts[0] = 's3' + break + } + } + } + + return hostParts +} + +// http://docs.aws.amazon.com/general/latest/gr/rande.html +RequestSigner.prototype.isSingleRegion = function() { + // Special case for S3 and SimpleDB in us-east-1 + if (['s3', 'sdb'].indexOf(this.service) >= 0 && this.region === 'us-east-1') return true + + return ['cloudfront', 'ls', 'route53', 'iam', 'importexport', 'sts'] + .indexOf(this.service) >= 0 +} + +RequestSigner.prototype.createHost = function() { + var region = this.isSingleRegion() ? '' : '.' + this.region, + subdomain = this.service === 'ses' ? 'email' : this.service + return subdomain + region + '.amazonaws.com' +} + +RequestSigner.prototype.prepareRequest = function() { + this.parsePath() + + var request = this.request, headers = request.headers, query + + if (request.signQuery) { + + this.parsedPath.query = query = this.parsedPath.query || {} + + if (this.credentials.sessionToken) + query['X-Amz-Security-Token'] = this.credentials.sessionToken + + if (this.service === 's3' && !query['X-Amz-Expires']) + query['X-Amz-Expires'] = 86400 + + if (query['X-Amz-Date']) + this.datetime = query['X-Amz-Date'] + else + query['X-Amz-Date'] = this.getDateTime() + + query['X-Amz-Algorithm'] = 'AWS4-HMAC-SHA256' + query['X-Amz-Credential'] = this.credentials.accessKeyId + '/' + this.credentialString() + query['X-Amz-SignedHeaders'] = this.signedHeaders() + + } else { + + if (!request.doNotModifyHeaders && !this.isCodeCommitGit) { + if (request.body && !headers['Content-Type'] && !headers['content-type']) + headers['Content-Type'] = 'application/x-www-form-urlencoded; charset=utf-8' + + if (request.body && !headers['Content-Length'] && !headers['content-length']) + headers['Content-Length'] = Buffer.byteLength(request.body) + + if (this.credentials.sessionToken && !headers['X-Amz-Security-Token'] && !headers['x-amz-security-token']) + headers['X-Amz-Security-Token'] = this.credentials.sessionToken + + if (this.service === 's3' && !headers['X-Amz-Content-Sha256'] && !headers['x-amz-content-sha256']) + headers['X-Amz-Content-Sha256'] = hash(this.request.body || '', 'hex') + + if (headers['X-Amz-Date'] || headers['x-amz-date']) + this.datetime = headers['X-Amz-Date'] || headers['x-amz-date'] + else + headers['X-Amz-Date'] = this.getDateTime() + } + + delete headers.Authorization + delete headers.authorization + } +} + +RequestSigner.prototype.sign = function() { + if (!this.parsedPath) this.prepareRequest() + + if (this.request.signQuery) { + this.parsedPath.query['X-Amz-Signature'] = this.signature() + } else { + this.request.headers.Authorization = this.authHeader() + } + + this.request.path = this.formatPath() + + return this.request +} + +RequestSigner.prototype.getDateTime = function() { + if (!this.datetime) { + var headers = this.request.headers, + date = new Date(headers.Date || headers.date || new Date) + + this.datetime = date.toISOString().replace(/[:\-]|\.\d{3}/g, '') + + // Remove the trailing 'Z' on the timestamp string for CodeCommit git access + if (this.isCodeCommitGit) this.datetime = this.datetime.slice(0, -1) + } + return this.datetime +} + +RequestSigner.prototype.getDate = function() { + return this.getDateTime().substr(0, 8) +} + +RequestSigner.prototype.authHeader = function() { + return [ + 'AWS4-HMAC-SHA256 Credential=' + this.credentials.accessKeyId + '/' + this.credentialString(), + 'SignedHeaders=' + this.signedHeaders(), + 'Signature=' + this.signature(), + ].join(', ') +} + +RequestSigner.prototype.signature = function() { + var date = this.getDate(), + cacheKey = [this.credentials.secretAccessKey, date, this.region, this.service].join(), + kDate, kRegion, kService, kCredentials = credentialsCache.get(cacheKey) + if (!kCredentials) { + kDate = hmac('AWS4' + this.credentials.secretAccessKey, date) + kRegion = hmac(kDate, this.region) + kService = hmac(kRegion, this.service) + kCredentials = hmac(kService, 'aws4_request') + credentialsCache.set(cacheKey, kCredentials) + } + return hmac(kCredentials, this.stringToSign(), 'hex') +} + +RequestSigner.prototype.stringToSign = function() { + return [ + 'AWS4-HMAC-SHA256', + this.getDateTime(), + this.credentialString(), + hash(this.canonicalString(), 'hex'), + ].join('\n') +} + +RequestSigner.prototype.canonicalString = function() { + if (!this.parsedPath) this.prepareRequest() + + var pathStr = this.parsedPath.path, + query = this.parsedPath.query, + headers = this.request.headers, + queryStr = '', + normalizePath = this.service !== 's3', + decodePath = this.service === 's3' || this.request.doNotEncodePath, + decodeSlashesInPath = this.service === 's3', + firstValOnly = this.service === 's3', + bodyHash + + if (this.service === 's3' && this.request.signQuery) { + bodyHash = 'UNSIGNED-PAYLOAD' + } else if (this.isCodeCommitGit) { + bodyHash = '' + } else { + bodyHash = headers['X-Amz-Content-Sha256'] || headers['x-amz-content-sha256'] || + hash(this.request.body || '', 'hex') + } + + if (query) { + var reducedQuery = Object.keys(query).reduce(function(obj, key) { + if (!key) return obj + obj[encodeRfc3986Full(key)] = !Array.isArray(query[key]) ? query[key] : + (firstValOnly ? query[key][0] : query[key]) + return obj + }, {}) + var encodedQueryPieces = [] + Object.keys(reducedQuery).sort().forEach(function(key) { + if (!Array.isArray(reducedQuery[key])) { + encodedQueryPieces.push(key + '=' + encodeRfc3986Full(reducedQuery[key])) + } else { + reducedQuery[key].map(encodeRfc3986Full).sort() + .forEach(function(val) { encodedQueryPieces.push(key + '=' + val) }) + } + }) + queryStr = encodedQueryPieces.join('&') + } + if (pathStr !== '/') { + if (normalizePath) pathStr = pathStr.replace(/\/{2,}/g, '/') + pathStr = pathStr.split('/').reduce(function(path, piece) { + if (normalizePath && piece === '..') { + path.pop() + } else if (!normalizePath || piece !== '.') { + if (decodePath) piece = decodeURIComponent(piece.replace(/\+/g, ' ')) + path.push(encodeRfc3986Full(piece)) + } + return path + }, []).join('/') + if (pathStr[0] !== '/') pathStr = '/' + pathStr + if (decodeSlashesInPath) pathStr = pathStr.replace(/%2F/g, '/') + } + + return [ + this.request.method || 'GET', + pathStr, + queryStr, + this.canonicalHeaders() + '\n', + this.signedHeaders(), + bodyHash, + ].join('\n') +} + +RequestSigner.prototype.canonicalHeaders = function() { + var headers = this.request.headers + function trimAll(header) { + return header.toString().trim().replace(/\s+/g, ' ') + } + return Object.keys(headers) + .filter(function(key) { return HEADERS_TO_IGNORE[key.toLowerCase()] == null }) + .sort(function(a, b) { return a.toLowerCase() < b.toLowerCase() ? -1 : 1 }) + .map(function(key) { return key.toLowerCase() + ':' + trimAll(headers[key]) }) + .join('\n') +} + +RequestSigner.prototype.signedHeaders = function() { + return Object.keys(this.request.headers) + .map(function(key) { return key.toLowerCase() }) + .filter(function(key) { return HEADERS_TO_IGNORE[key] == null }) + .sort() + .join(';') +} + +RequestSigner.prototype.credentialString = function() { + return [ + this.getDate(), + this.region, + this.service, + 'aws4_request', + ].join('/') +} + +RequestSigner.prototype.defaultCredentials = function() { + var env = process.env + return { + accessKeyId: env.AWS_ACCESS_KEY_ID || env.AWS_ACCESS_KEY, + secretAccessKey: env.AWS_SECRET_ACCESS_KEY || env.AWS_SECRET_KEY, + sessionToken: env.AWS_SESSION_TOKEN, + } +} + +RequestSigner.prototype.parsePath = function() { + var path = this.request.path || '/' + + // S3 doesn't always encode characters > 127 correctly and + // all services don't encode characters > 255 correctly + // So if there are non-reserved chars (and it's not already all % encoded), just encode them all + if (/[^0-9A-Za-z;,/?:@&=+$\-_.!~*'()#%]/.test(path)) { + path = encodeURI(decodeURI(path)) + } + + var queryIx = path.indexOf('?'), + query = null + + if (queryIx >= 0) { + query = querystring.parse(path.slice(queryIx + 1)) + path = path.slice(0, queryIx) + } + + this.parsedPath = { + path: path, + query: query, + } +} + +RequestSigner.prototype.formatPath = function() { + var path = this.parsedPath.path, + query = this.parsedPath.query + + if (!query) return path + + // Services don't support empty query string keys + if (query[''] != null) delete query[''] + + return path + '?' + encodeRfc3986(querystring.stringify(query)) +} + +aws4.RequestSigner = RequestSigner + +aws4.sign = function(request, credentials) { + return new RequestSigner(request, credentials).sign() +} diff --git a/packages/字体精简工具/node_modules/aws4/lru.js b/packages/字体精简工具/node_modules/aws4/lru.js new file mode 100644 index 0000000..333f66a --- /dev/null +++ b/packages/字体精简工具/node_modules/aws4/lru.js @@ -0,0 +1,96 @@ +module.exports = function(size) { + return new LruCache(size) +} + +function LruCache(size) { + this.capacity = size | 0 + this.map = Object.create(null) + this.list = new DoublyLinkedList() +} + +LruCache.prototype.get = function(key) { + var node = this.map[key] + if (node == null) return undefined + this.used(node) + return node.val +} + +LruCache.prototype.set = function(key, val) { + var node = this.map[key] + if (node != null) { + node.val = val + } else { + if (!this.capacity) this.prune() + if (!this.capacity) return false + node = new DoublyLinkedNode(key, val) + this.map[key] = node + this.capacity-- + } + this.used(node) + return true +} + +LruCache.prototype.used = function(node) { + this.list.moveToFront(node) +} + +LruCache.prototype.prune = function() { + var node = this.list.pop() + if (node != null) { + delete this.map[node.key] + this.capacity++ + } +} + + +function DoublyLinkedList() { + this.firstNode = null + this.lastNode = null +} + +DoublyLinkedList.prototype.moveToFront = function(node) { + if (this.firstNode == node) return + + this.remove(node) + + if (this.firstNode == null) { + this.firstNode = node + this.lastNode = node + node.prev = null + node.next = null + } else { + node.prev = null + node.next = this.firstNode + node.next.prev = node + this.firstNode = node + } +} + +DoublyLinkedList.prototype.pop = function() { + var lastNode = this.lastNode + if (lastNode != null) { + this.remove(lastNode) + } + return lastNode +} + +DoublyLinkedList.prototype.remove = function(node) { + if (this.firstNode == node) { + this.firstNode = node.next + } else if (node.prev != null) { + node.prev.next = node.next + } + if (this.lastNode == node) { + this.lastNode = node.prev + } else if (node.next != null) { + node.next.prev = node.prev + } +} + + +function DoublyLinkedNode(key, val) { + this.key = key + this.val = val + this.prev = null + this.next = null +} diff --git a/packages/字体精简工具/node_modules/aws4/package.json b/packages/字体精简工具/node_modules/aws4/package.json new file mode 100644 index 0000000..001b554 --- /dev/null +++ b/packages/字体精简工具/node_modules/aws4/package.json @@ -0,0 +1,53 @@ +{ + "_from": "aws4@^1.8.0", + "_id": "aws4@1.11.0", + "_inBundle": false, + "_integrity": "sha1-1h9G2DslGSUOJ4Ta9bCUeai0HFk=", + "_location": "/aws4", + "_phantomChildren": {}, + "_requested": { + "type": "range", + "registry": true, + "raw": "aws4@^1.8.0", + "name": "aws4", + "escapedName": "aws4", + "rawSpec": "^1.8.0", + "saveSpec": null, + "fetchSpec": "^1.8.0" + }, + "_requiredBy": [ + "/request" + ], + "_resolved": "https://registry.nlark.com/aws4/download/aws4-1.11.0.tgz", + "_shasum": "d61f46d83b2519250e2784daf5b09479a8b41c59", + "_spec": "aws4@^1.8.0", + "_where": "D:\\workspace\\plugin\\mini_font\\packages\\mini_font\\publish\\mini_font\\node_modules\\request", + "author": { + "name": "Michael Hart", + "email": "michael.hart.au@gmail.com", + "url": "https://github.com/mhart" + }, + "bugs": { + "url": "https://github.com/mhart/aws4/issues" + }, + "bundleDependencies": false, + "deprecated": false, + "description": "Signs and prepares requests using AWS Signature Version 4", + "devDependencies": { + "mocha": "^2.5.3", + "should": "^8.4.0" + }, + "homepage": "https://github.com/mhart/aws4#readme", + "license": "MIT", + "main": "aws4.js", + "name": "aws4", + "repository": { + "type": "git", + "url": "git+https://github.com/mhart/aws4.git" + }, + "scripts": { + "integration": "node ./test/slow.js", + "test": "mocha ./test/fast.js -R list" + }, + "version": "1.11.0" +} diff --git a/packages/字体精简工具/node_modules/b3b/.npmignore b/packages/字体精简工具/node_modules/b3b/.npmignore new file mode 100644 index 0000000..57ec6c9 --- /dev/null +++ b/packages/字体精简工具/node_modules/b3b/.npmignore @@ -0,0 +1,5 @@ +.DS_Store +npm-debug.log +node_modules/ +build.js +_README.md diff --git a/packages/字体精简工具/node_modules/b3b/README.md b/packages/字体精简工具/node_modules/b3b/README.md new file mode 100644 index 0000000..9cfe746 --- /dev/null +++ b/packages/字体精简工具/node_modules/b3b/README.md @@ -0,0 +1,84 @@ +# b3b + +buffer convert util + +### convert map + +``` +ArrayBuffer -------- Buffer +\ / + \ / + ---- base64 ----- +``` + +### api + +- #### 0 + + - **file**: + + buffer convert util + + - **author**: + + junmer + + - **description**: + + ArrayBuffer / Buffer / base64 convert util + +- #### ab2b (alias: arrayBufferToBuffer ) + convert arrayBuffer to buffer + + - **param**: `ab` { _ArrayBuffer_ } + + arrayBuffer + + - **return**: { _buffer_ } + + buffer + +- #### b2ab (alias: bufferToArrayBuffer ) + convert buffer to arrayBuffer + + - **param**: `buffer` { _buffer_ } + + buffer + + - **return**: { _ArrayBuffer_ } + + arrayBuffer + +- #### a2b (alias: base64ToBuffer ) + convert base64 string to buffer + + - **param**: `str` { _string_ } + + base64 string + + - **return**: { _Buffer_ } + + buffer + +- #### b2a (alias: bufferToBase64 ) + convert buffer to base64 string + + - **param**: `str` { _string|Buffer_ } + + string or buffer + + - **return**: { _string_ } + + base64 string + +- #### b2b (alias: bytesToBase64 ) + convert arraybuffer to base64 string + + - **param**: `ab` { _ArrayBuffer|Array_ } + + ArrayBuffer or Array + + - **return**: { _string_ } + + base64 string + diff --git a/packages/字体精简工具/node_modules/b3b/index.js b/packages/字体精简工具/node_modules/b3b/index.js new file mode 100644 index 0000000..975efca --- /dev/null +++ b/packages/字体精简工具/node_modules/b3b/index.js @@ -0,0 +1,115 @@ +/* * + * @file buffer convert util + * @author junmer + * @description ArrayBuffer / Buffer / base64 convert util + */ + +void 0; // only for doc + +/** + * convert arrayBuffer to buffer + * + * @alias arrayBufferToBuffer + * @param {ArrayBuffer} ab arrayBuffer + * @return {buffer} buffer + */ +function ab2b(ab) { + + var buffer = new Buffer(ab.byteLength); + var view = new Uint8Array(ab); + + for (var i = 0, l = buffer.length; i < l; i++) { + buffer[i] = view[i]; + } + + return buffer; + +} + +/** + * convert buffer to arrayBuffer + * + * @alias bufferToArrayBuffer + * @param {buffer} buffer buffer + * @return {ArrayBuffer} arrayBuffer + */ +function b2ab(buffer) { + + var ab = new ArrayBuffer(buffer.length); + var view = new Uint8Array(ab); + + for (var i = 0, l = buffer.length; i < l; ++i) { + view[i] = buffer[i]; + } + + return ab; + +} + +/** + * convert base64 string to buffer + * + * @alias base64ToBuffer + * @param {string} str base64 string + * @return {Buffer} buffer + */ +function a2b(str) { + return new Buffer(str, 'base64').toString('binary'); +} + +/** + * convert buffer to base64 string + * + * @alias bufferToBase64 + * @param {string|Buffer} str string or buffer + * @return {string} base64 string + */ +function b2a(str) { + var buffer; + + if (str instanceof Buffer) { + buffer = str; + } + else { + buffer = new Buffer(str.toString(), 'binary'); + } + + return buffer.toString('base64'); +} + +/** + * convert arraybuffer to base64 string + * + * @alias bytesToBase64 + * @param {ArrayBuffer|Array} ab ArrayBuffer or Array + * @return {string} base64 string + */ +function b2b(ab) { + + var str = ''; + + if (ab instanceof ArrayBuffer) { + var length = ab.byteLength; + var view = new DataView(ab, 0, length); + for (var i = 0; i < length; i++) { + str += String.fromCharCode(view.getUint8(i, false)); + } + } + else if (ab instanceof Array) { + for (var i = 0, length = ab.length; i < length; i++) { + str += String.fromCharCode(ab[i]); + } + } + + return btoa(str); + +} + +// exports + +exports.b2ab = exports.bufferToArrayBuffer = b2ab; +exports.ab2b = exports.arrayBufferToBuffer = ab2b; +exports.b2a = exports.btoa = exports.bufferToBase64 = b2a; +exports.a2b = exports.atob = exports.base64ToBuffer = a2b; +exports.b2b = exports.bytesToBase64 = b2b; + diff --git a/packages/字体精简工具/node_modules/b3b/package.json b/packages/字体精简工具/node_modules/b3b/package.json new file mode 100644 index 0000000..821df61 --- /dev/null +++ b/packages/字体精简工具/node_modules/b3b/package.json @@ -0,0 +1,56 @@ +{ + "_from": "b3b@0.0.1", + "_id": "b3b@0.0.1", + "_inBundle": false, + "_integrity": "sha1-/2n4pY2JGscysgF15HVGeZdU75s=", + "_location": "/b3b", + "_phantomChildren": {}, + "_requested": { + "type": "version", + "registry": true, + "raw": "b3b@0.0.1", + "name": "b3b", + "escapedName": "b3b", + "rawSpec": "0.0.1", + "saveSpec": null, + "fetchSpec": "0.0.1" + }, + "_requiredBy": [ + "/fontmin", + "/is-otf", + "/is-ttf" + ], + "_resolved": "https://registry.npm.taobao.org/b3b/download/b3b-0.0.1.tgz", + "_shasum": "ff69f8a58d891ac732b20175e47546799754ef9b", + "_spec": "b3b@0.0.1", + "_where": "D:\\workspace\\plugin\\mini_font\\packages\\mini_font\\publish\\mini_font\\node_modules\\fontmin", + "author": { + "name": "junmer" + }, + "bugs": { + "url": "https://github.com/junmer/b3b/issues" + }, + "bundleDependencies": false, + "deprecated": false, + "description": "ArrayBuffer / Buffer / base64 convert util", + "devDependencies": { + "nodoc": "^0.1.1" + }, + "homepage": "https://github.com/junmer/b3b", + "keywords": [ + "ArrayBuffer", + "Buffer", + "base64" + ], + "license": "ISC", + "main": "index.js", + "name": "b3b", + "repository": { + "type": "git", + "url": "git+https://github.com/junmer/b3b.git" + }, + "scripts": { + "build": "node build.js" + }, + "version": "0.0.1" +} diff --git a/packages/字体精简工具/node_modules/balanced-match/.github/FUNDING.yml b/packages/字体精简工具/node_modules/balanced-match/.github/FUNDING.yml new file mode 100644 index 0000000..cea8b16 --- /dev/null +++ b/packages/字体精简工具/node_modules/balanced-match/.github/FUNDING.yml @@ -0,0 +1,2 @@ +tidelift: "npm/balanced-match" +patreon: juliangruber diff --git a/packages/字体精简工具/node_modules/balanced-match/LICENSE.md b/packages/字体精简工具/node_modules/balanced-match/LICENSE.md new file mode 100644 index 0000000..2cdc8e4 --- /dev/null +++ b/packages/字体精简工具/node_modules/balanced-match/LICENSE.md @@ -0,0 +1,21 @@ +(MIT) + +Copyright (c) 2013 Julian Gruber <julian@juliangruber.com> + +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/packages/字体精简工具/node_modules/balanced-match/README.md b/packages/字体精简工具/node_modules/balanced-match/README.md new file mode 100644 index 0000000..d2a48b6 --- /dev/null +++ b/packages/字体精简工具/node_modules/balanced-match/README.md @@ -0,0 +1,97 @@ +# balanced-match + +Match balanced string pairs, like `{` and `}` or `` and ``. Supports regular expressions as well! + +[![build status](https://secure.travis-ci.org/juliangruber/balanced-match.svg)](http://travis-ci.org/juliangruber/balanced-match) +[![downloads](https://img.shields.io/npm/dm/balanced-match.svg)](https://www.npmjs.org/package/balanced-match) + +[![testling badge](https://ci.testling.com/juliangruber/balanced-match.png)](https://ci.testling.com/juliangruber/balanced-match) + +## Example + +Get the first matching pair of braces: + +```js +var balanced = require('balanced-match'); + +console.log(balanced('{', '}', 'pre{in{nested}}post')); +console.log(balanced('{', '}', 'pre{first}between{second}post')); +console.log(balanced(/\s+\{\s+/, /\s+\}\s+/, 'pre { in{nest} } post')); +``` + +The matches are: + +```bash +$ node example.js +{ start: 3, end: 14, pre: 'pre', body: 'in{nested}', post: 'post' } +{ start: 3, + end: 9, + pre: 'pre', + body: 'first', + post: 'between{second}post' } +{ start: 3, end: 17, pre: 'pre', body: 'in{nest}', post: 'post' } +``` + +## API + +### var m = balanced(a, b, str) + +For the first non-nested matching pair of `a` and `b` in `str`, return an +object with those keys: + +* **start** the index of the first match of `a` +* **end** the index of the matching `b` +* **pre** the preamble, `a` and `b` not included +* **body** the match, `a` and `b` not included +* **post** the postscript, `a` and `b` not included + +If there's no match, `undefined` will be returned. + +If the `str` contains more `a` than `b` / there are unmatched pairs, the first match that was closed will be used. For example, `{{a}` will match `['{', 'a', '']` and `{a}}` will match `['', 'a', '}']`. + +### var r = balanced.range(a, b, str) + +For the first non-nested matching pair of `a` and `b` in `str`, return an +array with indexes: `[ , ]`. + +If there's no match, `undefined` will be returned. + +If the `str` contains more `a` than `b` / there are unmatched pairs, the first match that was closed will be used. For example, `{{a}` will match `[ 1, 3 ]` and `{a}}` will match `[0, 2]`. + +## Installation + +With [npm](https://npmjs.org) do: + +```bash +npm install balanced-match +``` + +## Security contact information + +To report a security vulnerability, please use the +[Tidelift security contact](https://tidelift.com/security). +Tidelift will coordinate the fix and disclosure. + +## License + +(MIT) + +Copyright (c) 2013 Julian Gruber <julian@juliangruber.com> + +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/packages/字体精简工具/node_modules/balanced-match/index.js b/packages/字体精简工具/node_modules/balanced-match/index.js new file mode 100644 index 0000000..c67a646 --- /dev/null +++ b/packages/字体精简工具/node_modules/balanced-match/index.js @@ -0,0 +1,62 @@ +'use strict'; +module.exports = balanced; +function balanced(a, b, str) { + if (a instanceof RegExp) a = maybeMatch(a, str); + if (b instanceof RegExp) b = maybeMatch(b, str); + + var r = range(a, b, str); + + return r && { + start: r[0], + end: r[1], + pre: str.slice(0, r[0]), + body: str.slice(r[0] + a.length, r[1]), + post: str.slice(r[1] + b.length) + }; +} + +function maybeMatch(reg, str) { + var m = str.match(reg); + return m ? m[0] : null; +} + +balanced.range = range; +function range(a, b, str) { + var begs, beg, left, right, result; + var ai = str.indexOf(a); + var bi = str.indexOf(b, ai + 1); + var i = ai; + + if (ai >= 0 && bi > 0) { + if(a===b) { + return [ai, bi]; + } + begs = []; + left = str.length; + + while (i >= 0 && !result) { + if (i == ai) { + begs.push(i); + ai = str.indexOf(a, i + 1); + } else if (begs.length == 1) { + result = [ begs.pop(), bi ]; + } else { + beg = begs.pop(); + if (beg < left) { + left = beg; + right = bi; + } + + bi = str.indexOf(b, i + 1); + } + + i = ai < bi && ai >= 0 ? ai : bi; + } + + if (begs.length) { + result = [ left, right ]; + } + } + + return result; +} diff --git a/packages/字体精简工具/node_modules/balanced-match/package.json b/packages/字体精简工具/node_modules/balanced-match/package.json new file mode 100644 index 0000000..ee9ee59 --- /dev/null +++ b/packages/字体精简工具/node_modules/balanced-match/package.json @@ -0,0 +1,76 @@ +{ + "_from": "balanced-match@^1.0.0", + "_id": "balanced-match@1.0.2", + "_inBundle": false, + "_integrity": "sha1-6D46fj8wCzTLnYf2FfoMvzV2kO4=", + "_location": "/balanced-match", + "_phantomChildren": {}, + "_requested": { + "type": "range", + "registry": true, + "raw": "balanced-match@^1.0.0", + "name": "balanced-match", + "escapedName": "balanced-match", + "rawSpec": "^1.0.0", + "saveSpec": null, + "fetchSpec": "^1.0.0" + }, + "_requiredBy": [ + "/brace-expansion" + ], + "_resolved": "https://registry.nlark.com/balanced-match/download/balanced-match-1.0.2.tgz", + "_shasum": "e83e3a7e3f300b34cb9d87f615fa0cbf357690ee", + "_spec": "balanced-match@^1.0.0", + "_where": "D:\\workspace\\plugin\\mini_font\\packages\\mini_font\\publish\\mini_font\\node_modules\\brace-expansion", + "author": { + "name": "Julian Gruber", + "email": "mail@juliangruber.com", + "url": "http://juliangruber.com" + }, + "bugs": { + "url": "https://github.com/juliangruber/balanced-match/issues" + }, + "bundleDependencies": false, + "deprecated": false, + "description": "Match balanced character pairs, like \"{\" and \"}\"", + "devDependencies": { + "matcha": "^0.7.0", + "tape": "^4.6.0" + }, + "homepage": "https://github.com/juliangruber/balanced-match", + "keywords": [ + "match", + "regexp", + "test", + "balanced", + "parse" + ], + "license": "MIT", + "main": "index.js", + "name": "balanced-match", + "repository": { + "type": "git", + "url": "git://github.com/juliangruber/balanced-match.git" + }, + "scripts": { + "bench": "matcha test/bench.js", + "test": "tape test/test.js" + }, + "testling": { + "files": "test/*.js", + "browsers": [ + "ie/8..latest", + "firefox/20..latest", + "firefox/nightly", + "chrome/25..latest", + "chrome/canary", + "opera/12..latest", + "opera/next", + "safari/5.1..latest", + "ipad/6.0..latest", + "iphone/6.0..latest", + "android-browser/4.2..latest" + ] + }, + "version": "1.0.2" +} diff --git a/packages/字体精简工具/node_modules/bcrypt-pbkdf/CONTRIBUTING.md b/packages/字体精简工具/node_modules/bcrypt-pbkdf/CONTRIBUTING.md new file mode 100644 index 0000000..401d34e --- /dev/null +++ b/packages/字体精简工具/node_modules/bcrypt-pbkdf/CONTRIBUTING.md @@ -0,0 +1,13 @@ +# Contributing + +This repository uses [cr.joyent.us](https://cr.joyent.us) (Gerrit) for new +changes. Anyone can submit changes. To get started, see the [cr.joyent.us user +guide](https://github.com/joyent/joyent-gerrit/blob/master/docs/user/README.md). +This repo does not use GitHub pull requests. + +See the [Joyent Engineering +Guidelines](https://github.com/joyent/eng/blob/master/docs/index.md) for general +best practices expected in this repository. + +If you're changing something non-trivial or user-facing, you may want to submit +an issue first. diff --git a/packages/字体精简工具/node_modules/bcrypt-pbkdf/LICENSE b/packages/字体精简工具/node_modules/bcrypt-pbkdf/LICENSE new file mode 100644 index 0000000..fc58d2a --- /dev/null +++ b/packages/字体精简工具/node_modules/bcrypt-pbkdf/LICENSE @@ -0,0 +1,66 @@ +The Blowfish portions are under the following license: + +Blowfish block cipher for OpenBSD +Copyright 1997 Niels Provos +All rights reserved. + +Implementation advice by David Mazieres . + +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. +3. The name of the author may not be used to endorse or promote products + derived from this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``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 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. + + + +The bcrypt_pbkdf portions are under the following license: + +Copyright (c) 2013 Ted Unangst + +Permission to use, copy, modify, and distribute this software for any +purpose with or without fee is hereby granted, provided that the above +copyright notice and this permission notice appear in all copies. + +THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES +WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF +MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR +ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES +WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN +ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF +OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + + + +Performance improvements (Javascript-specific): + +Copyright 2016, Joyent Inc +Author: Alex Wilson + +Permission to use, copy, modify, and distribute this software for any +purpose with or without fee is hereby granted, provided that the above +copyright notice and this permission notice appear in all copies. + +THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES +WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF +MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR +ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES +WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN +ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF +OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. diff --git a/packages/字体精简工具/node_modules/bcrypt-pbkdf/README.md b/packages/字体精简工具/node_modules/bcrypt-pbkdf/README.md new file mode 100644 index 0000000..7551f33 --- /dev/null +++ b/packages/字体精简工具/node_modules/bcrypt-pbkdf/README.md @@ -0,0 +1,45 @@ +Port of the OpenBSD `bcrypt_pbkdf` function to pure Javascript. `npm`-ified +version of [Devi Mandiri's port](https://github.com/devi/tmp/blob/master/js/bcrypt_pbkdf.js), +with some minor performance improvements. The code is copied verbatim (and +un-styled) from Devi's work. + +This product includes software developed by Niels Provos. + +## API + +### `bcrypt_pbkdf.pbkdf(pass, passlen, salt, saltlen, key, keylen, rounds)` + +Derive a cryptographic key of arbitrary length from a given password and salt, +using the OpenBSD `bcrypt_pbkdf` function. This is a combination of Blowfish and +SHA-512. + +See [this article](http://www.tedunangst.com/flak/post/bcrypt-pbkdf) for +further information. + +Parameters: + + * `pass`, a Uint8Array of length `passlen` + * `passlen`, an integer Number + * `salt`, a Uint8Array of length `saltlen` + * `saltlen`, an integer Number + * `key`, a Uint8Array of length `keylen`, will be filled with output + * `keylen`, an integer Number + * `rounds`, an integer Number, number of rounds of the PBKDF to run + +### `bcrypt_pbkdf.hash(sha2pass, sha2salt, out)` + +Calculate a Blowfish hash, given SHA2-512 output of a password and salt. Used as +part of the inner round function in the PBKDF. + +Parameters: + + * `sha2pass`, a Uint8Array of length 64 + * `sha2salt`, a Uint8Array of length 64 + * `out`, a Uint8Array of length 32, will be filled with output + +## License + +This source form is a 1:1 port from the OpenBSD `blowfish.c` and `bcrypt_pbkdf.c`. +As a result, it retains the original copyright and license. The two files are +under slightly different (but compatible) licenses, and are here combined in +one file. For each of the full license texts see `LICENSE`. diff --git a/packages/字体精简工具/node_modules/bcrypt-pbkdf/index.js b/packages/字体精简工具/node_modules/bcrypt-pbkdf/index.js new file mode 100644 index 0000000..b1b5ad4 --- /dev/null +++ b/packages/字体精简工具/node_modules/bcrypt-pbkdf/index.js @@ -0,0 +1,556 @@ +'use strict'; + +var crypto_hash_sha512 = require('tweetnacl').lowlevel.crypto_hash; + +/* + * This file is a 1:1 port from the OpenBSD blowfish.c and bcrypt_pbkdf.c. As a + * result, it retains the original copyright and license. The two files are + * under slightly different (but compatible) licenses, and are here combined in + * one file. + * + * Credit for the actual porting work goes to: + * Devi Mandiri + */ + +/* + * The Blowfish portions are under the following license: + * + * Blowfish block cipher for OpenBSD + * Copyright 1997 Niels Provos + * All rights reserved. + * + * Implementation advice by David Mazieres . + * + * 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. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``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 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. + */ + +/* + * The bcrypt_pbkdf portions are under the following license: + * + * Copyright (c) 2013 Ted Unangst + * + * Permission to use, copy, modify, and distribute this software for any + * purpose with or without fee is hereby granted, provided that the above + * copyright notice and this permission notice appear in all copies. + * + * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES + * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR + * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES + * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN + * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF + * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + */ + +/* + * Performance improvements (Javascript-specific): + * + * Copyright 2016, Joyent Inc + * Author: Alex Wilson + * + * Permission to use, copy, modify, and distribute this software for any + * purpose with or without fee is hereby granted, provided that the above + * copyright notice and this permission notice appear in all copies. + * + * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES + * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR + * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES + * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN + * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF + * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + */ + +// Ported from OpenBSD bcrypt_pbkdf.c v1.9 + +var BLF_J = 0; + +var Blowfish = function() { + this.S = [ + new Uint32Array([ + 0xd1310ba6, 0x98dfb5ac, 0x2ffd72db, 0xd01adfb7, + 0xb8e1afed, 0x6a267e96, 0xba7c9045, 0xf12c7f99, + 0x24a19947, 0xb3916cf7, 0x0801f2e2, 0x858efc16, + 0x636920d8, 0x71574e69, 0xa458fea3, 0xf4933d7e, + 0x0d95748f, 0x728eb658, 0x718bcd58, 0x82154aee, + 0x7b54a41d, 0xc25a59b5, 0x9c30d539, 0x2af26013, + 0xc5d1b023, 0x286085f0, 0xca417918, 0xb8db38ef, + 0x8e79dcb0, 0x603a180e, 0x6c9e0e8b, 0xb01e8a3e, + 0xd71577c1, 0xbd314b27, 0x78af2fda, 0x55605c60, + 0xe65525f3, 0xaa55ab94, 0x57489862, 0x63e81440, + 0x55ca396a, 0x2aab10b6, 0xb4cc5c34, 0x1141e8ce, + 0xa15486af, 0x7c72e993, 0xb3ee1411, 0x636fbc2a, + 0x2ba9c55d, 0x741831f6, 0xce5c3e16, 0x9b87931e, + 0xafd6ba33, 0x6c24cf5c, 0x7a325381, 0x28958677, + 0x3b8f4898, 0x6b4bb9af, 0xc4bfe81b, 0x66282193, + 0x61d809cc, 0xfb21a991, 0x487cac60, 0x5dec8032, + 0xef845d5d, 0xe98575b1, 0xdc262302, 0xeb651b88, + 0x23893e81, 0xd396acc5, 0x0f6d6ff3, 0x83f44239, + 0x2e0b4482, 0xa4842004, 0x69c8f04a, 0x9e1f9b5e, + 0x21c66842, 0xf6e96c9a, 0x670c9c61, 0xabd388f0, + 0x6a51a0d2, 0xd8542f68, 0x960fa728, 0xab5133a3, + 0x6eef0b6c, 0x137a3be4, 0xba3bf050, 0x7efb2a98, + 0xa1f1651d, 0x39af0176, 0x66ca593e, 0x82430e88, + 0x8cee8619, 0x456f9fb4, 0x7d84a5c3, 0x3b8b5ebe, + 0xe06f75d8, 0x85c12073, 0x401a449f, 0x56c16aa6, + 0x4ed3aa62, 0x363f7706, 0x1bfedf72, 0x429b023d, + 0x37d0d724, 0xd00a1248, 0xdb0fead3, 0x49f1c09b, + 0x075372c9, 0x80991b7b, 0x25d479d8, 0xf6e8def7, + 0xe3fe501a, 0xb6794c3b, 0x976ce0bd, 0x04c006ba, + 0xc1a94fb6, 0x409f60c4, 0x5e5c9ec2, 0x196a2463, + 0x68fb6faf, 0x3e6c53b5, 0x1339b2eb, 0x3b52ec6f, + 0x6dfc511f, 0x9b30952c, 0xcc814544, 0xaf5ebd09, + 0xbee3d004, 0xde334afd, 0x660f2807, 0x192e4bb3, + 0xc0cba857, 0x45c8740f, 0xd20b5f39, 0xb9d3fbdb, + 0x5579c0bd, 0x1a60320a, 0xd6a100c6, 0x402c7279, + 0x679f25fe, 0xfb1fa3cc, 0x8ea5e9f8, 0xdb3222f8, + 0x3c7516df, 0xfd616b15, 0x2f501ec8, 0xad0552ab, + 0x323db5fa, 0xfd238760, 0x53317b48, 0x3e00df82, + 0x9e5c57bb, 0xca6f8ca0, 0x1a87562e, 0xdf1769db, + 0xd542a8f6, 0x287effc3, 0xac6732c6, 0x8c4f5573, + 0x695b27b0, 0xbbca58c8, 0xe1ffa35d, 0xb8f011a0, + 0x10fa3d98, 0xfd2183b8, 0x4afcb56c, 0x2dd1d35b, + 0x9a53e479, 0xb6f84565, 0xd28e49bc, 0x4bfb9790, + 0xe1ddf2da, 0xa4cb7e33, 0x62fb1341, 0xcee4c6e8, + 0xef20cada, 0x36774c01, 0xd07e9efe, 0x2bf11fb4, + 0x95dbda4d, 0xae909198, 0xeaad8e71, 0x6b93d5a0, + 0xd08ed1d0, 0xafc725e0, 0x8e3c5b2f, 0x8e7594b7, + 0x8ff6e2fb, 0xf2122b64, 0x8888b812, 0x900df01c, + 0x4fad5ea0, 0x688fc31c, 0xd1cff191, 0xb3a8c1ad, + 0x2f2f2218, 0xbe0e1777, 0xea752dfe, 0x8b021fa1, + 0xe5a0cc0f, 0xb56f74e8, 0x18acf3d6, 0xce89e299, + 0xb4a84fe0, 0xfd13e0b7, 0x7cc43b81, 0xd2ada8d9, + 0x165fa266, 0x80957705, 0x93cc7314, 0x211a1477, + 0xe6ad2065, 0x77b5fa86, 0xc75442f5, 0xfb9d35cf, + 0xebcdaf0c, 0x7b3e89a0, 0xd6411bd3, 0xae1e7e49, + 0x00250e2d, 0x2071b35e, 0x226800bb, 0x57b8e0af, + 0x2464369b, 0xf009b91e, 0x5563911d, 0x59dfa6aa, + 0x78c14389, 0xd95a537f, 0x207d5ba2, 0x02e5b9c5, + 0x83260376, 0x6295cfa9, 0x11c81968, 0x4e734a41, + 0xb3472dca, 0x7b14a94a, 0x1b510052, 0x9a532915, + 0xd60f573f, 0xbc9bc6e4, 0x2b60a476, 0x81e67400, + 0x08ba6fb5, 0x571be91f, 0xf296ec6b, 0x2a0dd915, + 0xb6636521, 0xe7b9f9b6, 0xff34052e, 0xc5855664, + 0x53b02d5d, 0xa99f8fa1, 0x08ba4799, 0x6e85076a]), + new Uint32Array([ + 0x4b7a70e9, 0xb5b32944, 0xdb75092e, 0xc4192623, + 0xad6ea6b0, 0x49a7df7d, 0x9cee60b8, 0x8fedb266, + 0xecaa8c71, 0x699a17ff, 0x5664526c, 0xc2b19ee1, + 0x193602a5, 0x75094c29, 0xa0591340, 0xe4183a3e, + 0x3f54989a, 0x5b429d65, 0x6b8fe4d6, 0x99f73fd6, + 0xa1d29c07, 0xefe830f5, 0x4d2d38e6, 0xf0255dc1, + 0x4cdd2086, 0x8470eb26, 0x6382e9c6, 0x021ecc5e, + 0x09686b3f, 0x3ebaefc9, 0x3c971814, 0x6b6a70a1, + 0x687f3584, 0x52a0e286, 0xb79c5305, 0xaa500737, + 0x3e07841c, 0x7fdeae5c, 0x8e7d44ec, 0x5716f2b8, + 0xb03ada37, 0xf0500c0d, 0xf01c1f04, 0x0200b3ff, + 0xae0cf51a, 0x3cb574b2, 0x25837a58, 0xdc0921bd, + 0xd19113f9, 0x7ca92ff6, 0x94324773, 0x22f54701, + 0x3ae5e581, 0x37c2dadc, 0xc8b57634, 0x9af3dda7, + 0xa9446146, 0x0fd0030e, 0xecc8c73e, 0xa4751e41, + 0xe238cd99, 0x3bea0e2f, 0x3280bba1, 0x183eb331, + 0x4e548b38, 0x4f6db908, 0x6f420d03, 0xf60a04bf, + 0x2cb81290, 0x24977c79, 0x5679b072, 0xbcaf89af, + 0xde9a771f, 0xd9930810, 0xb38bae12, 0xdccf3f2e, + 0x5512721f, 0x2e6b7124, 0x501adde6, 0x9f84cd87, + 0x7a584718, 0x7408da17, 0xbc9f9abc, 0xe94b7d8c, + 0xec7aec3a, 0xdb851dfa, 0x63094366, 0xc464c3d2, + 0xef1c1847, 0x3215d908, 0xdd433b37, 0x24c2ba16, + 0x12a14d43, 0x2a65c451, 0x50940002, 0x133ae4dd, + 0x71dff89e, 0x10314e55, 0x81ac77d6, 0x5f11199b, + 0x043556f1, 0xd7a3c76b, 0x3c11183b, 0x5924a509, + 0xf28fe6ed, 0x97f1fbfa, 0x9ebabf2c, 0x1e153c6e, + 0x86e34570, 0xeae96fb1, 0x860e5e0a, 0x5a3e2ab3, + 0x771fe71c, 0x4e3d06fa, 0x2965dcb9, 0x99e71d0f, + 0x803e89d6, 0x5266c825, 0x2e4cc978, 0x9c10b36a, + 0xc6150eba, 0x94e2ea78, 0xa5fc3c53, 0x1e0a2df4, + 0xf2f74ea7, 0x361d2b3d, 0x1939260f, 0x19c27960, + 0x5223a708, 0xf71312b6, 0xebadfe6e, 0xeac31f66, + 0xe3bc4595, 0xa67bc883, 0xb17f37d1, 0x018cff28, + 0xc332ddef, 0xbe6c5aa5, 0x65582185, 0x68ab9802, + 0xeecea50f, 0xdb2f953b, 0x2aef7dad, 0x5b6e2f84, + 0x1521b628, 0x29076170, 0xecdd4775, 0x619f1510, + 0x13cca830, 0xeb61bd96, 0x0334fe1e, 0xaa0363cf, + 0xb5735c90, 0x4c70a239, 0xd59e9e0b, 0xcbaade14, + 0xeecc86bc, 0x60622ca7, 0x9cab5cab, 0xb2f3846e, + 0x648b1eaf, 0x19bdf0ca, 0xa02369b9, 0x655abb50, + 0x40685a32, 0x3c2ab4b3, 0x319ee9d5, 0xc021b8f7, + 0x9b540b19, 0x875fa099, 0x95f7997e, 0x623d7da8, + 0xf837889a, 0x97e32d77, 0x11ed935f, 0x16681281, + 0x0e358829, 0xc7e61fd6, 0x96dedfa1, 0x7858ba99, + 0x57f584a5, 0x1b227263, 0x9b83c3ff, 0x1ac24696, + 0xcdb30aeb, 0x532e3054, 0x8fd948e4, 0x6dbc3128, + 0x58ebf2ef, 0x34c6ffea, 0xfe28ed61, 0xee7c3c73, + 0x5d4a14d9, 0xe864b7e3, 0x42105d14, 0x203e13e0, + 0x45eee2b6, 0xa3aaabea, 0xdb6c4f15, 0xfacb4fd0, + 0xc742f442, 0xef6abbb5, 0x654f3b1d, 0x41cd2105, + 0xd81e799e, 0x86854dc7, 0xe44b476a, 0x3d816250, + 0xcf62a1f2, 0x5b8d2646, 0xfc8883a0, 0xc1c7b6a3, + 0x7f1524c3, 0x69cb7492, 0x47848a0b, 0x5692b285, + 0x095bbf00, 0xad19489d, 0x1462b174, 0x23820e00, + 0x58428d2a, 0x0c55f5ea, 0x1dadf43e, 0x233f7061, + 0x3372f092, 0x8d937e41, 0xd65fecf1, 0x6c223bdb, + 0x7cde3759, 0xcbee7460, 0x4085f2a7, 0xce77326e, + 0xa6078084, 0x19f8509e, 0xe8efd855, 0x61d99735, + 0xa969a7aa, 0xc50c06c2, 0x5a04abfc, 0x800bcadc, + 0x9e447a2e, 0xc3453484, 0xfdd56705, 0x0e1e9ec9, + 0xdb73dbd3, 0x105588cd, 0x675fda79, 0xe3674340, + 0xc5c43465, 0x713e38d8, 0x3d28f89e, 0xf16dff20, + 0x153e21e7, 0x8fb03d4a, 0xe6e39f2b, 0xdb83adf7]), + new Uint32Array([ + 0xe93d5a68, 0x948140f7, 0xf64c261c, 0x94692934, + 0x411520f7, 0x7602d4f7, 0xbcf46b2e, 0xd4a20068, + 0xd4082471, 0x3320f46a, 0x43b7d4b7, 0x500061af, + 0x1e39f62e, 0x97244546, 0x14214f74, 0xbf8b8840, + 0x4d95fc1d, 0x96b591af, 0x70f4ddd3, 0x66a02f45, + 0xbfbc09ec, 0x03bd9785, 0x7fac6dd0, 0x31cb8504, + 0x96eb27b3, 0x55fd3941, 0xda2547e6, 0xabca0a9a, + 0x28507825, 0x530429f4, 0x0a2c86da, 0xe9b66dfb, + 0x68dc1462, 0xd7486900, 0x680ec0a4, 0x27a18dee, + 0x4f3ffea2, 0xe887ad8c, 0xb58ce006, 0x7af4d6b6, + 0xaace1e7c, 0xd3375fec, 0xce78a399, 0x406b2a42, + 0x20fe9e35, 0xd9f385b9, 0xee39d7ab, 0x3b124e8b, + 0x1dc9faf7, 0x4b6d1856, 0x26a36631, 0xeae397b2, + 0x3a6efa74, 0xdd5b4332, 0x6841e7f7, 0xca7820fb, + 0xfb0af54e, 0xd8feb397, 0x454056ac, 0xba489527, + 0x55533a3a, 0x20838d87, 0xfe6ba9b7, 0xd096954b, + 0x55a867bc, 0xa1159a58, 0xcca92963, 0x99e1db33, + 0xa62a4a56, 0x3f3125f9, 0x5ef47e1c, 0x9029317c, + 0xfdf8e802, 0x04272f70, 0x80bb155c, 0x05282ce3, + 0x95c11548, 0xe4c66d22, 0x48c1133f, 0xc70f86dc, + 0x07f9c9ee, 0x41041f0f, 0x404779a4, 0x5d886e17, + 0x325f51eb, 0xd59bc0d1, 0xf2bcc18f, 0x41113564, + 0x257b7834, 0x602a9c60, 0xdff8e8a3, 0x1f636c1b, + 0x0e12b4c2, 0x02e1329e, 0xaf664fd1, 0xcad18115, + 0x6b2395e0, 0x333e92e1, 0x3b240b62, 0xeebeb922, + 0x85b2a20e, 0xe6ba0d99, 0xde720c8c, 0x2da2f728, + 0xd0127845, 0x95b794fd, 0x647d0862, 0xe7ccf5f0, + 0x5449a36f, 0x877d48fa, 0xc39dfd27, 0xf33e8d1e, + 0x0a476341, 0x992eff74, 0x3a6f6eab, 0xf4f8fd37, + 0xa812dc60, 0xa1ebddf8, 0x991be14c, 0xdb6e6b0d, + 0xc67b5510, 0x6d672c37, 0x2765d43b, 0xdcd0e804, + 0xf1290dc7, 0xcc00ffa3, 0xb5390f92, 0x690fed0b, + 0x667b9ffb, 0xcedb7d9c, 0xa091cf0b, 0xd9155ea3, + 0xbb132f88, 0x515bad24, 0x7b9479bf, 0x763bd6eb, + 0x37392eb3, 0xcc115979, 0x8026e297, 0xf42e312d, + 0x6842ada7, 0xc66a2b3b, 0x12754ccc, 0x782ef11c, + 0x6a124237, 0xb79251e7, 0x06a1bbe6, 0x4bfb6350, + 0x1a6b1018, 0x11caedfa, 0x3d25bdd8, 0xe2e1c3c9, + 0x44421659, 0x0a121386, 0xd90cec6e, 0xd5abea2a, + 0x64af674e, 0xda86a85f, 0xbebfe988, 0x64e4c3fe, + 0x9dbc8057, 0xf0f7c086, 0x60787bf8, 0x6003604d, + 0xd1fd8346, 0xf6381fb0, 0x7745ae04, 0xd736fccc, + 0x83426b33, 0xf01eab71, 0xb0804187, 0x3c005e5f, + 0x77a057be, 0xbde8ae24, 0x55464299, 0xbf582e61, + 0x4e58f48f, 0xf2ddfda2, 0xf474ef38, 0x8789bdc2, + 0x5366f9c3, 0xc8b38e74, 0xb475f255, 0x46fcd9b9, + 0x7aeb2661, 0x8b1ddf84, 0x846a0e79, 0x915f95e2, + 0x466e598e, 0x20b45770, 0x8cd55591, 0xc902de4c, + 0xb90bace1, 0xbb8205d0, 0x11a86248, 0x7574a99e, + 0xb77f19b6, 0xe0a9dc09, 0x662d09a1, 0xc4324633, + 0xe85a1f02, 0x09f0be8c, 0x4a99a025, 0x1d6efe10, + 0x1ab93d1d, 0x0ba5a4df, 0xa186f20f, 0x2868f169, + 0xdcb7da83, 0x573906fe, 0xa1e2ce9b, 0x4fcd7f52, + 0x50115e01, 0xa70683fa, 0xa002b5c4, 0x0de6d027, + 0x9af88c27, 0x773f8641, 0xc3604c06, 0x61a806b5, + 0xf0177a28, 0xc0f586e0, 0x006058aa, 0x30dc7d62, + 0x11e69ed7, 0x2338ea63, 0x53c2dd94, 0xc2c21634, + 0xbbcbee56, 0x90bcb6de, 0xebfc7da1, 0xce591d76, + 0x6f05e409, 0x4b7c0188, 0x39720a3d, 0x7c927c24, + 0x86e3725f, 0x724d9db9, 0x1ac15bb4, 0xd39eb8fc, + 0xed545578, 0x08fca5b5, 0xd83d7cd3, 0x4dad0fc4, + 0x1e50ef5e, 0xb161e6f8, 0xa28514d9, 0x6c51133c, + 0x6fd5c7e7, 0x56e14ec4, 0x362abfce, 0xddc6c837, + 0xd79a3234, 0x92638212, 0x670efa8e, 0x406000e0]), + new Uint32Array([ + 0x3a39ce37, 0xd3faf5cf, 0xabc27737, 0x5ac52d1b, + 0x5cb0679e, 0x4fa33742, 0xd3822740, 0x99bc9bbe, + 0xd5118e9d, 0xbf0f7315, 0xd62d1c7e, 0xc700c47b, + 0xb78c1b6b, 0x21a19045, 0xb26eb1be, 0x6a366eb4, + 0x5748ab2f, 0xbc946e79, 0xc6a376d2, 0x6549c2c8, + 0x530ff8ee, 0x468dde7d, 0xd5730a1d, 0x4cd04dc6, + 0x2939bbdb, 0xa9ba4650, 0xac9526e8, 0xbe5ee304, + 0xa1fad5f0, 0x6a2d519a, 0x63ef8ce2, 0x9a86ee22, + 0xc089c2b8, 0x43242ef6, 0xa51e03aa, 0x9cf2d0a4, + 0x83c061ba, 0x9be96a4d, 0x8fe51550, 0xba645bd6, + 0x2826a2f9, 0xa73a3ae1, 0x4ba99586, 0xef5562e9, + 0xc72fefd3, 0xf752f7da, 0x3f046f69, 0x77fa0a59, + 0x80e4a915, 0x87b08601, 0x9b09e6ad, 0x3b3ee593, + 0xe990fd5a, 0x9e34d797, 0x2cf0b7d9, 0x022b8b51, + 0x96d5ac3a, 0x017da67d, 0xd1cf3ed6, 0x7c7d2d28, + 0x1f9f25cf, 0xadf2b89b, 0x5ad6b472, 0x5a88f54c, + 0xe029ac71, 0xe019a5e6, 0x47b0acfd, 0xed93fa9b, + 0xe8d3c48d, 0x283b57cc, 0xf8d56629, 0x79132e28, + 0x785f0191, 0xed756055, 0xf7960e44, 0xe3d35e8c, + 0x15056dd4, 0x88f46dba, 0x03a16125, 0x0564f0bd, + 0xc3eb9e15, 0x3c9057a2, 0x97271aec, 0xa93a072a, + 0x1b3f6d9b, 0x1e6321f5, 0xf59c66fb, 0x26dcf319, + 0x7533d928, 0xb155fdf5, 0x03563482, 0x8aba3cbb, + 0x28517711, 0xc20ad9f8, 0xabcc5167, 0xccad925f, + 0x4de81751, 0x3830dc8e, 0x379d5862, 0x9320f991, + 0xea7a90c2, 0xfb3e7bce, 0x5121ce64, 0x774fbe32, + 0xa8b6e37e, 0xc3293d46, 0x48de5369, 0x6413e680, + 0xa2ae0810, 0xdd6db224, 0x69852dfd, 0x09072166, + 0xb39a460a, 0x6445c0dd, 0x586cdecf, 0x1c20c8ae, + 0x5bbef7dd, 0x1b588d40, 0xccd2017f, 0x6bb4e3bb, + 0xdda26a7e, 0x3a59ff45, 0x3e350a44, 0xbcb4cdd5, + 0x72eacea8, 0xfa6484bb, 0x8d6612ae, 0xbf3c6f47, + 0xd29be463, 0x542f5d9e, 0xaec2771b, 0xf64e6370, + 0x740e0d8d, 0xe75b1357, 0xf8721671, 0xaf537d5d, + 0x4040cb08, 0x4eb4e2cc, 0x34d2466a, 0x0115af84, + 0xe1b00428, 0x95983a1d, 0x06b89fb4, 0xce6ea048, + 0x6f3f3b82, 0x3520ab82, 0x011a1d4b, 0x277227f8, + 0x611560b1, 0xe7933fdc, 0xbb3a792b, 0x344525bd, + 0xa08839e1, 0x51ce794b, 0x2f32c9b7, 0xa01fbac9, + 0xe01cc87e, 0xbcc7d1f6, 0xcf0111c3, 0xa1e8aac7, + 0x1a908749, 0xd44fbd9a, 0xd0dadecb, 0xd50ada38, + 0x0339c32a, 0xc6913667, 0x8df9317c, 0xe0b12b4f, + 0xf79e59b7, 0x43f5bb3a, 0xf2d519ff, 0x27d9459c, + 0xbf97222c, 0x15e6fc2a, 0x0f91fc71, 0x9b941525, + 0xfae59361, 0xceb69ceb, 0xc2a86459, 0x12baa8d1, + 0xb6c1075e, 0xe3056a0c, 0x10d25065, 0xcb03a442, + 0xe0ec6e0e, 0x1698db3b, 0x4c98a0be, 0x3278e964, + 0x9f1f9532, 0xe0d392df, 0xd3a0342b, 0x8971f21e, + 0x1b0a7441, 0x4ba3348c, 0xc5be7120, 0xc37632d8, + 0xdf359f8d, 0x9b992f2e, 0xe60b6f47, 0x0fe3f11d, + 0xe54cda54, 0x1edad891, 0xce6279cf, 0xcd3e7e6f, + 0x1618b166, 0xfd2c1d05, 0x848fd2c5, 0xf6fb2299, + 0xf523f357, 0xa6327623, 0x93a83531, 0x56cccd02, + 0xacf08162, 0x5a75ebb5, 0x6e163697, 0x88d273cc, + 0xde966292, 0x81b949d0, 0x4c50901b, 0x71c65614, + 0xe6c6c7bd, 0x327a140a, 0x45e1d006, 0xc3f27b9a, + 0xc9aa53fd, 0x62a80f00, 0xbb25bfe2, 0x35bdd2f6, + 0x71126905, 0xb2040222, 0xb6cbcf7c, 0xcd769c2b, + 0x53113ec0, 0x1640e3d3, 0x38abbd60, 0x2547adf0, + 0xba38209c, 0xf746ce76, 0x77afa1c5, 0x20756060, + 0x85cbfe4e, 0x8ae88dd8, 0x7aaaf9b0, 0x4cf9aa7e, + 0x1948c25c, 0x02fb8a8c, 0x01c36ae4, 0xd6ebe1f9, + 0x90d4f869, 0xa65cdea0, 0x3f09252d, 0xc208e69f, + 0xb74e6132, 0xce77e25b, 0x578fdfe3, 0x3ac372e6]) + ]; + this.P = new Uint32Array([ + 0x243f6a88, 0x85a308d3, 0x13198a2e, 0x03707344, + 0xa4093822, 0x299f31d0, 0x082efa98, 0xec4e6c89, + 0x452821e6, 0x38d01377, 0xbe5466cf, 0x34e90c6c, + 0xc0ac29b7, 0xc97c50dd, 0x3f84d5b5, 0xb5470917, + 0x9216d5d9, 0x8979fb1b]); +}; + +function F(S, x8, i) { + return (((S[0][x8[i+3]] + + S[1][x8[i+2]]) ^ + S[2][x8[i+1]]) + + S[3][x8[i]]); +}; + +Blowfish.prototype.encipher = function(x, x8) { + if (x8 === undefined) { + x8 = new Uint8Array(x.buffer); + if (x.byteOffset !== 0) + x8 = x8.subarray(x.byteOffset); + } + x[0] ^= this.P[0]; + for (var i = 1; i < 16; i += 2) { + x[1] ^= F(this.S, x8, 0) ^ this.P[i]; + x[0] ^= F(this.S, x8, 4) ^ this.P[i+1]; + } + var t = x[0]; + x[0] = x[1] ^ this.P[17]; + x[1] = t; +}; + +Blowfish.prototype.decipher = function(x) { + var x8 = new Uint8Array(x.buffer); + if (x.byteOffset !== 0) + x8 = x8.subarray(x.byteOffset); + x[0] ^= this.P[17]; + for (var i = 16; i > 0; i -= 2) { + x[1] ^= F(this.S, x8, 0) ^ this.P[i]; + x[0] ^= F(this.S, x8, 4) ^ this.P[i-1]; + } + var t = x[0]; + x[0] = x[1] ^ this.P[0]; + x[1] = t; +}; + +function stream2word(data, databytes){ + var i, temp = 0; + for (i = 0; i < 4; i++, BLF_J++) { + if (BLF_J >= databytes) BLF_J = 0; + temp = (temp << 8) | data[BLF_J]; + } + return temp; +}; + +Blowfish.prototype.expand0state = function(key, keybytes) { + var d = new Uint32Array(2), i, k; + var d8 = new Uint8Array(d.buffer); + + for (i = 0, BLF_J = 0; i < 18; i++) { + this.P[i] ^= stream2word(key, keybytes); + } + BLF_J = 0; + + for (i = 0; i < 18; i += 2) { + this.encipher(d, d8); + this.P[i] = d[0]; + this.P[i+1] = d[1]; + } + + for (i = 0; i < 4; i++) { + for (k = 0; k < 256; k += 2) { + this.encipher(d, d8); + this.S[i][k] = d[0]; + this.S[i][k+1] = d[1]; + } + } +}; + +Blowfish.prototype.expandstate = function(data, databytes, key, keybytes) { + var d = new Uint32Array(2), i, k; + + for (i = 0, BLF_J = 0; i < 18; i++) { + this.P[i] ^= stream2word(key, keybytes); + } + + for (i = 0, BLF_J = 0; i < 18; i += 2) { + d[0] ^= stream2word(data, databytes); + d[1] ^= stream2word(data, databytes); + this.encipher(d); + this.P[i] = d[0]; + this.P[i+1] = d[1]; + } + + for (i = 0; i < 4; i++) { + for (k = 0; k < 256; k += 2) { + d[0] ^= stream2word(data, databytes); + d[1] ^= stream2word(data, databytes); + this.encipher(d); + this.S[i][k] = d[0]; + this.S[i][k+1] = d[1]; + } + } + BLF_J = 0; +}; + +Blowfish.prototype.enc = function(data, blocks) { + for (var i = 0; i < blocks; i++) { + this.encipher(data.subarray(i*2)); + } +}; + +Blowfish.prototype.dec = function(data, blocks) { + for (var i = 0; i < blocks; i++) { + this.decipher(data.subarray(i*2)); + } +}; + +var BCRYPT_BLOCKS = 8, + BCRYPT_HASHSIZE = 32; + +function bcrypt_hash(sha2pass, sha2salt, out) { + var state = new Blowfish(), + cdata = new Uint32Array(BCRYPT_BLOCKS), i, + ciphertext = new Uint8Array([79,120,121,99,104,114,111,109,97,116,105, + 99,66,108,111,119,102,105,115,104,83,119,97,116,68,121,110,97,109, + 105,116,101]); //"OxychromaticBlowfishSwatDynamite" + + state.expandstate(sha2salt, 64, sha2pass, 64); + for (i = 0; i < 64; i++) { + state.expand0state(sha2salt, 64); + state.expand0state(sha2pass, 64); + } + + for (i = 0; i < BCRYPT_BLOCKS; i++) + cdata[i] = stream2word(ciphertext, ciphertext.byteLength); + for (i = 0; i < 64; i++) + state.enc(cdata, cdata.byteLength / 8); + + for (i = 0; i < BCRYPT_BLOCKS; i++) { + out[4*i+3] = cdata[i] >>> 24; + out[4*i+2] = cdata[i] >>> 16; + out[4*i+1] = cdata[i] >>> 8; + out[4*i+0] = cdata[i]; + } +}; + +function bcrypt_pbkdf(pass, passlen, salt, saltlen, key, keylen, rounds) { + var sha2pass = new Uint8Array(64), + sha2salt = new Uint8Array(64), + out = new Uint8Array(BCRYPT_HASHSIZE), + tmpout = new Uint8Array(BCRYPT_HASHSIZE), + countsalt = new Uint8Array(saltlen+4), + i, j, amt, stride, dest, count, + origkeylen = keylen; + + if (rounds < 1) + return -1; + if (passlen === 0 || saltlen === 0 || keylen === 0 || + keylen > (out.byteLength * out.byteLength) || saltlen > (1<<20)) + return -1; + + stride = Math.floor((keylen + out.byteLength - 1) / out.byteLength); + amt = Math.floor((keylen + stride - 1) / stride); + + for (i = 0; i < saltlen; i++) + countsalt[i] = salt[i]; + + crypto_hash_sha512(sha2pass, pass, passlen); + + for (count = 1; keylen > 0; count++) { + countsalt[saltlen+0] = count >>> 24; + countsalt[saltlen+1] = count >>> 16; + countsalt[saltlen+2] = count >>> 8; + countsalt[saltlen+3] = count; + + crypto_hash_sha512(sha2salt, countsalt, saltlen + 4); + bcrypt_hash(sha2pass, sha2salt, tmpout); + for (i = out.byteLength; i--;) + out[i] = tmpout[i]; + + for (i = 1; i < rounds; i++) { + crypto_hash_sha512(sha2salt, tmpout, tmpout.byteLength); + bcrypt_hash(sha2pass, sha2salt, tmpout); + for (j = 0; j < out.byteLength; j++) + out[j] ^= tmpout[j]; + } + + amt = Math.min(amt, keylen); + for (i = 0; i < amt; i++) { + dest = i * stride + (count - 1); + if (dest >= origkeylen) + break; + key[dest] = out[i]; + } + keylen -= i; + } + + return 0; +}; + +module.exports = { + BLOCKS: BCRYPT_BLOCKS, + HASHSIZE: BCRYPT_HASHSIZE, + hash: bcrypt_hash, + pbkdf: bcrypt_pbkdf +}; diff --git a/packages/字体精简工具/node_modules/bcrypt-pbkdf/package.json b/packages/字体精简工具/node_modules/bcrypt-pbkdf/package.json new file mode 100644 index 0000000..c601b20 --- /dev/null +++ b/packages/字体精简工具/node_modules/bcrypt-pbkdf/package.json @@ -0,0 +1,44 @@ +{ + "_from": "bcrypt-pbkdf@^1.0.0", + "_id": "bcrypt-pbkdf@1.0.2", + "_inBundle": false, + "_integrity": "sha1-pDAdOJtqQ/m2f/PKEaP2Y342Dp4=", + "_location": "/bcrypt-pbkdf", + "_phantomChildren": {}, + "_requested": { + "type": "range", + "registry": true, + "raw": "bcrypt-pbkdf@^1.0.0", + "name": "bcrypt-pbkdf", + "escapedName": "bcrypt-pbkdf", + "rawSpec": "^1.0.0", + "saveSpec": null, + "fetchSpec": "^1.0.0" + }, + "_requiredBy": [ + "/sshpk" + ], + "_resolved": "https://registry.nlark.com/bcrypt-pbkdf/download/bcrypt-pbkdf-1.0.2.tgz", + "_shasum": "a4301d389b6a43f9b67ff3ca11a3f6637e360e9e", + "_spec": "bcrypt-pbkdf@^1.0.0", + "_where": "D:\\workspace\\plugin\\mini_font\\packages\\mini_font\\publish\\mini_font\\node_modules\\sshpk", + "bugs": { + "url": "https://github.com/joyent/node-bcrypt-pbkdf/issues" + }, + "bundleDependencies": false, + "dependencies": { + "tweetnacl": "^0.14.3" + }, + "deprecated": false, + "description": "Port of the OpenBSD bcrypt_pbkdf function to pure JS", + "devDependencies": {}, + "homepage": "https://github.com/joyent/node-bcrypt-pbkdf#readme", + "license": "BSD-3-Clause", + "main": "index.js", + "name": "bcrypt-pbkdf", + "repository": { + "type": "git", + "url": "git://github.com/joyent/node-bcrypt-pbkdf.git" + }, + "version": "1.0.2" +} diff --git a/packages/字体精简工具/node_modules/bindings/LICENSE.md b/packages/字体精简工具/node_modules/bindings/LICENSE.md new file mode 100644 index 0000000..5a92289 --- /dev/null +++ b/packages/字体精简工具/node_modules/bindings/LICENSE.md @@ -0,0 +1,22 @@ +(The MIT License) + +Copyright (c) 2012 Nathan Rajlich <nathan@tootallnate.net> + +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/packages/字体精简工具/node_modules/bindings/README.md b/packages/字体精简工具/node_modules/bindings/README.md new file mode 100644 index 0000000..5b3e7a8 --- /dev/null +++ b/packages/字体精简工具/node_modules/bindings/README.md @@ -0,0 +1,98 @@ +node-bindings +============= +### Helper module for loading your native module's `.node` file + +This is a helper module for authors of Node.js native addon modules. +It is basically the "swiss army knife" of `require()`ing your native module's +`.node` file. + +Throughout the course of Node's native addon history, addons have ended up being +compiled in a variety of different places, depending on which build tool and which +version of node was used. To make matters worse, now the `gyp` build tool can +produce either a __Release__ or __Debug__ build, each being built into different +locations. + +This module checks _all_ the possible locations that a native addon would be built +at, and returns the first one that loads successfully. + + +Installation +------------ + +Install with `npm`: + +``` bash +$ npm install --save bindings +``` + +Or add it to the `"dependencies"` section of your `package.json` file. + + +Example +------- + +`require()`ing the proper bindings file for the current node version, platform +and architecture is as simple as: + +``` js +var bindings = require('bindings')('binding.node') + +// Use your bindings defined in your C files +bindings.your_c_function() +``` + + +Nice Error Output +----------------- + +When the `.node` file could not be loaded, `node-bindings` throws an Error with +a nice error message telling you exactly what was tried. You can also check the +`err.tries` Array property. + +``` +Error: Could not load the bindings file. Tried: + → /Users/nrajlich/ref/build/binding.node + → /Users/nrajlich/ref/build/Debug/binding.node + → /Users/nrajlich/ref/build/Release/binding.node + → /Users/nrajlich/ref/out/Debug/binding.node + → /Users/nrajlich/ref/Debug/binding.node + → /Users/nrajlich/ref/out/Release/binding.node + → /Users/nrajlich/ref/Release/binding.node + → /Users/nrajlich/ref/build/default/binding.node + → /Users/nrajlich/ref/compiled/0.8.2/darwin/x64/binding.node + at bindings (/Users/nrajlich/ref/node_modules/bindings/bindings.js:84:13) + at Object. (/Users/nrajlich/ref/lib/ref.js:5:47) + at Module._compile (module.js:449:26) + at Object.Module._extensions..js (module.js:467:10) + at Module.load (module.js:356:32) + at Function.Module._load (module.js:312:12) + ... +``` + +The searching for the `.node` file will originate from the first directory in which has a `package.json` file is found. + +License +------- + +(The MIT License) + +Copyright (c) 2012 Nathan Rajlich <nathan@tootallnate.net> + +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/packages/字体精简工具/node_modules/bindings/bindings.js b/packages/字体精简工具/node_modules/bindings/bindings.js new file mode 100644 index 0000000..727413a --- /dev/null +++ b/packages/字体精简工具/node_modules/bindings/bindings.js @@ -0,0 +1,221 @@ +/** + * Module dependencies. + */ + +var fs = require('fs'), + path = require('path'), + fileURLToPath = require('file-uri-to-path'), + join = path.join, + dirname = path.dirname, + exists = + (fs.accessSync && + function(path) { + try { + fs.accessSync(path); + } catch (e) { + return false; + } + return true; + }) || + fs.existsSync || + path.existsSync, + defaults = { + arrow: process.env.NODE_BINDINGS_ARROW || ' → ', + compiled: process.env.NODE_BINDINGS_COMPILED_DIR || 'compiled', + platform: process.platform, + arch: process.arch, + nodePreGyp: + 'node-v' + + process.versions.modules + + '-' + + process.platform + + '-' + + process.arch, + version: process.versions.node, + bindings: 'bindings.node', + try: [ + // node-gyp's linked version in the "build" dir + ['module_root', 'build', 'bindings'], + // node-waf and gyp_addon (a.k.a node-gyp) + ['module_root', 'build', 'Debug', 'bindings'], + ['module_root', 'build', 'Release', 'bindings'], + // Debug files, for development (legacy behavior, remove for node v0.9) + ['module_root', 'out', 'Debug', 'bindings'], + ['module_root', 'Debug', 'bindings'], + // Release files, but manually compiled (legacy behavior, remove for node v0.9) + ['module_root', 'out', 'Release', 'bindings'], + ['module_root', 'Release', 'bindings'], + // Legacy from node-waf, node <= 0.4.x + ['module_root', 'build', 'default', 'bindings'], + // Production "Release" buildtype binary (meh...) + ['module_root', 'compiled', 'version', 'platform', 'arch', 'bindings'], + // node-qbs builds + ['module_root', 'addon-build', 'release', 'install-root', 'bindings'], + ['module_root', 'addon-build', 'debug', 'install-root', 'bindings'], + ['module_root', 'addon-build', 'default', 'install-root', 'bindings'], + // node-pre-gyp path ./lib/binding/{node_abi}-{platform}-{arch} + ['module_root', 'lib', 'binding', 'nodePreGyp', 'bindings'] + ] + }; + +/** + * The main `bindings()` function loads the compiled bindings for a given module. + * It uses V8's Error API to determine the parent filename that this function is + * being invoked from, which is then used to find the root directory. + */ + +function bindings(opts) { + // Argument surgery + if (typeof opts == 'string') { + opts = { bindings: opts }; + } else if (!opts) { + opts = {}; + } + + // maps `defaults` onto `opts` object + Object.keys(defaults).map(function(i) { + if (!(i in opts)) opts[i] = defaults[i]; + }); + + // Get the module root + if (!opts.module_root) { + opts.module_root = exports.getRoot(exports.getFileName()); + } + + // Ensure the given bindings name ends with .node + if (path.extname(opts.bindings) != '.node') { + opts.bindings += '.node'; + } + + // https://github.com/webpack/webpack/issues/4175#issuecomment-342931035 + var requireFunc = + typeof __webpack_require__ === 'function' + ? __non_webpack_require__ + : require; + + var tries = [], + i = 0, + l = opts.try.length, + n, + b, + err; + + for (; i < l; i++) { + n = join.apply( + null, + opts.try[i].map(function(p) { + return opts[p] || p; + }) + ); + tries.push(n); + try { + b = opts.path ? requireFunc.resolve(n) : requireFunc(n); + if (!opts.path) { + b.path = n; + } + return b; + } catch (e) { + if (e.code !== 'MODULE_NOT_FOUND' && + e.code !== 'QUALIFIED_PATH_RESOLUTION_FAILED' && + !/not find/i.test(e.message)) { + throw e; + } + } + } + + err = new Error( + 'Could not locate the bindings file. Tried:\n' + + tries + .map(function(a) { + return opts.arrow + a; + }) + .join('\n') + ); + err.tries = tries; + throw err; +} +module.exports = exports = bindings; + +/** + * Gets the filename of the JavaScript file that invokes this function. + * Used to help find the root directory of a module. + * Optionally accepts an filename argument to skip when searching for the invoking filename + */ + +exports.getFileName = function getFileName(calling_file) { + var origPST = Error.prepareStackTrace, + origSTL = Error.stackTraceLimit, + dummy = {}, + fileName; + + Error.stackTraceLimit = 10; + + Error.prepareStackTrace = function(e, st) { + for (var i = 0, l = st.length; i < l; i++) { + fileName = st[i].getFileName(); + if (fileName !== __filename) { + if (calling_file) { + if (fileName !== calling_file) { + return; + } + } else { + return; + } + } + } + }; + + // run the 'prepareStackTrace' function above + Error.captureStackTrace(dummy); + dummy.stack; + + // cleanup + Error.prepareStackTrace = origPST; + Error.stackTraceLimit = origSTL; + + // handle filename that starts with "file://" + var fileSchema = 'file://'; + if (fileName.indexOf(fileSchema) === 0) { + fileName = fileURLToPath(fileName); + } + + return fileName; +}; + +/** + * Gets the root directory of a module, given an arbitrary filename + * somewhere in the module tree. The "root directory" is the directory + * containing the `package.json` file. + * + * In: /home/nate/node-native-module/lib/index.js + * Out: /home/nate/node-native-module + */ + +exports.getRoot = function getRoot(file) { + var dir = dirname(file), + prev; + while (true) { + if (dir === '.') { + // Avoids an infinite loop in rare cases, like the REPL + dir = process.cwd(); + } + if ( + exists(join(dir, 'package.json')) || + exists(join(dir, 'node_modules')) + ) { + // Found the 'package.json' file or 'node_modules' dir; we're done + return dir; + } + if (prev === dir) { + // Got to the top + throw new Error( + 'Could not find module root given file: "' + + file + + '". Do you have a `package.json` file? ' + ); + } + // Try the parent dir next + prev = dir; + dir = join(dir, '..'); + } +}; diff --git a/packages/字体精简工具/node_modules/bindings/package.json b/packages/字体精简工具/node_modules/bindings/package.json new file mode 100644 index 0000000..928e331 --- /dev/null +++ b/packages/字体精简工具/node_modules/bindings/package.json @@ -0,0 +1,58 @@ +{ + "_from": "bindings@^1.3.0", + "_id": "bindings@1.5.0", + "_inBundle": false, + "_integrity": "sha1-EDU8npRTNLwFEabZCzj7x8nFBN8=", + "_location": "/bindings", + "_phantomChildren": {}, + "_requested": { + "type": "range", + "registry": true, + "raw": "bindings@^1.3.0", + "name": "bindings", + "escapedName": "bindings", + "rawSpec": "^1.3.0", + "saveSpec": null, + "fetchSpec": "^1.3.0" + }, + "_requiredBy": [ + "/chokidar/fsevents", + "/ttf2woff2" + ], + "_resolved": "https://registry.nlark.com/bindings/download/bindings-1.5.0.tgz", + "_shasum": "10353c9e945334bc0511a6d90b38fbc7c9c504df", + "_spec": "bindings@^1.3.0", + "_where": "D:\\workspace\\plugin\\mini_font\\packages\\mini_font\\publish\\mini_font\\node_modules\\ttf2woff2", + "author": { + "name": "Nathan Rajlich", + "email": "nathan@tootallnate.net", + "url": "http://tootallnate.net" + }, + "bugs": { + "url": "https://github.com/TooTallNate/node-bindings/issues" + }, + "bundleDependencies": false, + "dependencies": { + "file-uri-to-path": "1.0.0" + }, + "deprecated": false, + "description": "Helper module for loading your native module's .node file", + "homepage": "https://github.com/TooTallNate/node-bindings", + "keywords": [ + "native", + "addon", + "bindings", + "gyp", + "waf", + "c", + "c++" + ], + "license": "MIT", + "main": "./bindings.js", + "name": "bindings", + "repository": { + "type": "git", + "url": "git://github.com/TooTallNate/node-bindings.git" + }, + "version": "1.5.0" +} diff --git a/packages/字体精简工具/node_modules/brace-expansion/LICENSE b/packages/字体精简工具/node_modules/brace-expansion/LICENSE new file mode 100644 index 0000000..de32266 --- /dev/null +++ b/packages/字体精简工具/node_modules/brace-expansion/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2013 Julian Gruber + +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/packages/字体精简工具/node_modules/brace-expansion/README.md b/packages/字体精简工具/node_modules/brace-expansion/README.md new file mode 100644 index 0000000..6b4e0e1 --- /dev/null +++ b/packages/字体精简工具/node_modules/brace-expansion/README.md @@ -0,0 +1,129 @@ +# brace-expansion + +[Brace expansion](https://www.gnu.org/software/bash/manual/html_node/Brace-Expansion.html), +as known from sh/bash, in JavaScript. + +[![build status](https://secure.travis-ci.org/juliangruber/brace-expansion.svg)](http://travis-ci.org/juliangruber/brace-expansion) +[![downloads](https://img.shields.io/npm/dm/brace-expansion.svg)](https://www.npmjs.org/package/brace-expansion) +[![Greenkeeper badge](https://badges.greenkeeper.io/juliangruber/brace-expansion.svg)](https://greenkeeper.io/) + +[![testling badge](https://ci.testling.com/juliangruber/brace-expansion.png)](https://ci.testling.com/juliangruber/brace-expansion) + +## Example + +```js +var expand = require('brace-expansion'); + +expand('file-{a,b,c}.jpg') +// => ['file-a.jpg', 'file-b.jpg', 'file-c.jpg'] + +expand('-v{,,}') +// => ['-v', '-v', '-v'] + +expand('file{0..2}.jpg') +// => ['file0.jpg', 'file1.jpg', 'file2.jpg'] + +expand('file-{a..c}.jpg') +// => ['file-a.jpg', 'file-b.jpg', 'file-c.jpg'] + +expand('file{2..0}.jpg') +// => ['file2.jpg', 'file1.jpg', 'file0.jpg'] + +expand('file{0..4..2}.jpg') +// => ['file0.jpg', 'file2.jpg', 'file4.jpg'] + +expand('file-{a..e..2}.jpg') +// => ['file-a.jpg', 'file-c.jpg', 'file-e.jpg'] + +expand('file{00..10..5}.jpg') +// => ['file00.jpg', 'file05.jpg', 'file10.jpg'] + +expand('{{A..C},{a..c}}') +// => ['A', 'B', 'C', 'a', 'b', 'c'] + +expand('ppp{,config,oe{,conf}}') +// => ['ppp', 'pppconfig', 'pppoe', 'pppoeconf'] +``` + +## API + +```js +var expand = require('brace-expansion'); +``` + +### var expanded = expand(str) + +Return an array of all possible and valid expansions of `str`. If none are +found, `[str]` is returned. + +Valid expansions are: + +```js +/^(.*,)+(.+)?$/ +// {a,b,...} +``` + +A comma separated list of options, like `{a,b}` or `{a,{b,c}}` or `{,a,}`. + +```js +/^-?\d+\.\.-?\d+(\.\.-?\d+)?$/ +// {x..y[..incr]} +``` + +A numeric sequence from `x` to `y` inclusive, with optional increment. +If `x` or `y` start with a leading `0`, all the numbers will be padded +to have equal length. Negative numbers and backwards iteration work too. + +```js +/^-?\d+\.\.-?\d+(\.\.-?\d+)?$/ +// {x..y[..incr]} +``` + +An alphabetic sequence from `x` to `y` inclusive, with optional increment. +`x` and `y` must be exactly one character, and if given, `incr` must be a +number. + +For compatibility reasons, the string `${` is not eligible for brace expansion. + +## Installation + +With [npm](https://npmjs.org) do: + +```bash +npm install brace-expansion +``` + +## Contributors + +- [Julian Gruber](https://github.com/juliangruber) +- [Isaac Z. Schlueter](https://github.com/isaacs) + +## Sponsors + +This module is proudly supported by my [Sponsors](https://github.com/juliangruber/sponsors)! + +Do you want to support modules like this to improve their quality, stability and weigh in on new features? Then please consider donating to my [Patreon](https://www.patreon.com/juliangruber). Not sure how much of my modules you're using? Try [feross/thanks](https://github.com/feross/thanks)! + +## License + +(MIT) + +Copyright (c) 2013 Julian Gruber <julian@juliangruber.com> + +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/packages/字体精简工具/node_modules/brace-expansion/index.js b/packages/字体精简工具/node_modules/brace-expansion/index.js new file mode 100644 index 0000000..0478be8 --- /dev/null +++ b/packages/字体精简工具/node_modules/brace-expansion/index.js @@ -0,0 +1,201 @@ +var concatMap = require('concat-map'); +var balanced = require('balanced-match'); + +module.exports = expandTop; + +var escSlash = '\0SLASH'+Math.random()+'\0'; +var escOpen = '\0OPEN'+Math.random()+'\0'; +var escClose = '\0CLOSE'+Math.random()+'\0'; +var escComma = '\0COMMA'+Math.random()+'\0'; +var escPeriod = '\0PERIOD'+Math.random()+'\0'; + +function numeric(str) { + return parseInt(str, 10) == str + ? parseInt(str, 10) + : str.charCodeAt(0); +} + +function escapeBraces(str) { + return str.split('\\\\').join(escSlash) + .split('\\{').join(escOpen) + .split('\\}').join(escClose) + .split('\\,').join(escComma) + .split('\\.').join(escPeriod); +} + +function unescapeBraces(str) { + return str.split(escSlash).join('\\') + .split(escOpen).join('{') + .split(escClose).join('}') + .split(escComma).join(',') + .split(escPeriod).join('.'); +} + + +// Basically just str.split(","), but handling cases +// where we have nested braced sections, which should be +// treated as individual members, like {a,{b,c},d} +function parseCommaParts(str) { + if (!str) + return ['']; + + var parts = []; + var m = balanced('{', '}', str); + + if (!m) + return str.split(','); + + var pre = m.pre; + var body = m.body; + var post = m.post; + var p = pre.split(','); + + p[p.length-1] += '{' + body + '}'; + var postParts = parseCommaParts(post); + if (post.length) { + p[p.length-1] += postParts.shift(); + p.push.apply(p, postParts); + } + + parts.push.apply(parts, p); + + return parts; +} + +function expandTop(str) { + if (!str) + return []; + + // I don't know why Bash 4.3 does this, but it does. + // Anything starting with {} will have the first two bytes preserved + // but *only* at the top level, so {},a}b will not expand to anything, + // but a{},b}c will be expanded to [a}c,abc]. + // One could argue that this is a bug in Bash, but since the goal of + // this module is to match Bash's rules, we escape a leading {} + if (str.substr(0, 2) === '{}') { + str = '\\{\\}' + str.substr(2); + } + + return expand(escapeBraces(str), true).map(unescapeBraces); +} + +function identity(e) { + return e; +} + +function embrace(str) { + return '{' + str + '}'; +} +function isPadded(el) { + return /^-?0\d/.test(el); +} + +function lte(i, y) { + return i <= y; +} +function gte(i, y) { + return i >= y; +} + +function expand(str, isTop) { + var expansions = []; + + var m = balanced('{', '}', str); + if (!m || /\$$/.test(m.pre)) return [str]; + + var isNumericSequence = /^-?\d+\.\.-?\d+(?:\.\.-?\d+)?$/.test(m.body); + var isAlphaSequence = /^[a-zA-Z]\.\.[a-zA-Z](?:\.\.-?\d+)?$/.test(m.body); + var isSequence = isNumericSequence || isAlphaSequence; + var isOptions = m.body.indexOf(',') >= 0; + if (!isSequence && !isOptions) { + // {a},b} + if (m.post.match(/,.*\}/)) { + str = m.pre + '{' + m.body + escClose + m.post; + return expand(str); + } + return [str]; + } + + var n; + if (isSequence) { + n = m.body.split(/\.\./); + } else { + n = parseCommaParts(m.body); + if (n.length === 1) { + // x{{a,b}}y ==> x{a}y x{b}y + n = expand(n[0], false).map(embrace); + if (n.length === 1) { + var post = m.post.length + ? expand(m.post, false) + : ['']; + return post.map(function(p) { + return m.pre + n[0] + p; + }); + } + } + } + + // at this point, n is the parts, and we know it's not a comma set + // with a single entry. + + // no need to expand pre, since it is guaranteed to be free of brace-sets + var pre = m.pre; + var post = m.post.length + ? expand(m.post, false) + : ['']; + + var N; + + if (isSequence) { + var x = numeric(n[0]); + var y = numeric(n[1]); + var width = Math.max(n[0].length, n[1].length) + var incr = n.length == 3 + ? Math.abs(numeric(n[2])) + : 1; + var test = lte; + var reverse = y < x; + if (reverse) { + incr *= -1; + test = gte; + } + var pad = n.some(isPadded); + + N = []; + + for (var i = x; test(i, y); i += incr) { + var c; + if (isAlphaSequence) { + c = String.fromCharCode(i); + if (c === '\\') + c = ''; + } else { + c = String(i); + if (pad) { + var need = width - c.length; + if (need > 0) { + var z = new Array(need + 1).join('0'); + if (i < 0) + c = '-' + z + c.slice(1); + else + c = z + c; + } + } + } + N.push(c); + } + } else { + N = concatMap(n, function(el) { return expand(el, false) }); + } + + for (var j = 0; j < N.length; j++) { + for (var k = 0; k < post.length; k++) { + var expansion = pre + N[j] + post[k]; + if (!isTop || isSequence || expansion) + expansions.push(expansion); + } + } + + return expansions; +} + diff --git a/packages/字体精简工具/node_modules/brace-expansion/package.json b/packages/字体精简工具/node_modules/brace-expansion/package.json new file mode 100644 index 0000000..fce5172 --- /dev/null +++ b/packages/字体精简工具/node_modules/brace-expansion/package.json @@ -0,0 +1,75 @@ +{ + "_from": "brace-expansion@^1.1.7", + "_id": "brace-expansion@1.1.11", + "_inBundle": false, + "_integrity": "sha1-PH/L9SnYcibz0vUrlm/1Jx60Qd0=", + "_location": "/brace-expansion", + "_phantomChildren": {}, + "_requested": { + "type": "range", + "registry": true, + "raw": "brace-expansion@^1.1.7", + "name": "brace-expansion", + "escapedName": "brace-expansion", + "rawSpec": "^1.1.7", + "saveSpec": null, + "fetchSpec": "^1.1.7" + }, + "_requiredBy": [ + "/minimatch" + ], + "_resolved": "https://registry.npm.taobao.org/brace-expansion/download/brace-expansion-1.1.11.tgz", + "_shasum": "3c7fcbf529d87226f3d2f52b966ff5271eb441dd", + "_spec": "brace-expansion@^1.1.7", + "_where": "D:\\workspace\\plugin\\mini_font\\packages\\mini_font\\publish\\mini_font\\node_modules\\minimatch", + "author": { + "name": "Julian Gruber", + "email": "mail@juliangruber.com", + "url": "http://juliangruber.com" + }, + "bugs": { + "url": "https://github.com/juliangruber/brace-expansion/issues" + }, + "bundleDependencies": false, + "dependencies": { + "balanced-match": "^1.0.0", + "concat-map": "0.0.1" + }, + "deprecated": false, + "description": "Brace expansion as known from sh/bash", + "devDependencies": { + "matcha": "^0.7.0", + "tape": "^4.6.0" + }, + "homepage": "https://github.com/juliangruber/brace-expansion", + "keywords": [], + "license": "MIT", + "main": "index.js", + "name": "brace-expansion", + "repository": { + "type": "git", + "url": "git://github.com/juliangruber/brace-expansion.git" + }, + "scripts": { + "bench": "matcha test/perf/bench.js", + "gentest": "bash test/generate.sh", + "test": "tape test/*.js" + }, + "testling": { + "files": "test/*.js", + "browsers": [ + "ie/8..latest", + "firefox/20..latest", + "firefox/nightly", + "chrome/25..latest", + "chrome/canary", + "opera/12..latest", + "opera/next", + "safari/5.1..latest", + "ipad/6.0..latest", + "iphone/6.0..latest", + "android-browser/4.2..latest" + ] + }, + "version": "1.1.11" +} diff --git a/packages/字体精简工具/node_modules/buffer-equal/.travis.yml b/packages/字体精简工具/node_modules/buffer-equal/.travis.yml new file mode 100644 index 0000000..dad2273 --- /dev/null +++ b/packages/字体精简工具/node_modules/buffer-equal/.travis.yml @@ -0,0 +1,4 @@ +language: node_js +node_js: + - 0.8 + - "0.10" diff --git a/packages/字体精简工具/node_modules/buffer-equal/LICENSE b/packages/字体精简工具/node_modules/buffer-equal/LICENSE new file mode 100644 index 0000000..ee27ba4 --- /dev/null +++ b/packages/字体精简工具/node_modules/buffer-equal/LICENSE @@ -0,0 +1,18 @@ +This software is released under the MIT 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/packages/字体精简工具/node_modules/buffer-equal/README.markdown b/packages/字体精简工具/node_modules/buffer-equal/README.markdown new file mode 100644 index 0000000..8c062fd --- /dev/null +++ b/packages/字体精简工具/node_modules/buffer-equal/README.markdown @@ -0,0 +1,62 @@ +buffer-equal +============ + +Return whether two buffers are equal. + +[![build status](https://secure.travis-ci.org/substack/node-buffer-equal.png)](http://travis-ci.org/substack/node-buffer-equal) + +example +======= + +``` js +var bufferEqual = require('buffer-equal'); + +console.dir(bufferEqual( + new Buffer([253,254,255]), + new Buffer([253,254,255]) +)); +console.dir(bufferEqual( + new Buffer('abc'), + new Buffer('abcd') +)); +console.dir(bufferEqual( + new Buffer('abc'), + 'abc' +)); +``` + +output: + +``` +true +false +undefined +``` + +methods +======= + +``` js +var bufferEqual = require('buffer-equal') +``` + +bufferEqual(a, b) +----------------- + +Return whether the two buffers `a` and `b` are equal. + +If `a` or `b` is not a buffer, return `undefined`. + +install +======= + +With [npm](http://npmjs.org) do: + +``` +npm install buffer-equal +``` + +license +======= + +MIT diff --git a/packages/字体精简工具/node_modules/buffer-equal/example/eq.js b/packages/字体精简工具/node_modules/buffer-equal/example/eq.js new file mode 100644 index 0000000..1eb0509 --- /dev/null +++ b/packages/字体精简工具/node_modules/buffer-equal/example/eq.js @@ -0,0 +1,14 @@ +var bufferEqual = require('../'); + +console.dir(bufferEqual( + new Buffer([253,254,255]), + new Buffer([253,254,255]) +)); +console.dir(bufferEqual( + new Buffer('abc'), + new Buffer('abcd') +)); +console.dir(bufferEqual( + new Buffer('abc'), + 'abc' +)); diff --git a/packages/字体精简工具/node_modules/buffer-equal/index.js b/packages/字体精简工具/node_modules/buffer-equal/index.js new file mode 100644 index 0000000..e640d4e --- /dev/null +++ b/packages/字体精简工具/node_modules/buffer-equal/index.js @@ -0,0 +1,14 @@ +var Buffer = require('buffer').Buffer; // for use with browserify + +module.exports = function (a, b) { + if (!Buffer.isBuffer(a)) return undefined; + if (!Buffer.isBuffer(b)) return undefined; + if (typeof a.equals === 'function') return a.equals(b); + if (a.length !== b.length) return false; + + for (var i = 0; i < a.length; i++) { + if (a[i] !== b[i]) return false; + } + + return true; +}; diff --git a/packages/字体精简工具/node_modules/buffer-equal/package.json b/packages/字体精简工具/node_modules/buffer-equal/package.json new file mode 100644 index 0000000..3a81931 --- /dev/null +++ b/packages/字体精简工具/node_modules/buffer-equal/package.json @@ -0,0 +1,62 @@ +{ + "_from": "buffer-equal@^1.0.0", + "_id": "buffer-equal@1.0.0", + "_inBundle": false, + "_integrity": "sha1-WWFrSYME1Var1GaWayLu2j7KX74=", + "_location": "/buffer-equal", + "_phantomChildren": {}, + "_requested": { + "type": "range", + "registry": true, + "raw": "buffer-equal@^1.0.0", + "name": "buffer-equal", + "escapedName": "buffer-equal", + "rawSpec": "^1.0.0", + "saveSpec": null, + "fetchSpec": "^1.0.0" + }, + "_requiredBy": [ + "/append-buffer" + ], + "_resolved": "https://registry.npm.taobao.org/buffer-equal/download/buffer-equal-1.0.0.tgz", + "_shasum": "59616b498304d556abd466966b22eeda3eca5fbe", + "_spec": "buffer-equal@^1.0.0", + "_where": "D:\\workspace\\plugin\\mini_font\\packages\\mini_font\\publish\\mini_font\\node_modules\\append-buffer", + "author": { + "name": "James Halliday", + "email": "mail@substack.net", + "url": "http://substack.net" + }, + "bugs": { + "url": "https://github.com/substack/node-buffer-equal/issues" + }, + "bundleDependencies": false, + "deprecated": false, + "description": "return whether two buffers are equal", + "devDependencies": { + "tap": "0.2.4" + }, + "directories": { + "example": "example", + "test": "test" + }, + "engines": { + "node": ">=0.4.0" + }, + "homepage": "https://github.com/substack/node-buffer-equal#readme", + "keywords": [ + "buffer", + "equal" + ], + "license": "MIT", + "main": "index.js", + "name": "buffer-equal", + "repository": { + "type": "git", + "url": "git://github.com/substack/node-buffer-equal.git" + }, + "scripts": { + "test": "tap test/*.js" + }, + "version": "1.0.0" +} diff --git a/packages/字体精简工具/node_modules/buffer-equal/test/eq.js b/packages/字体精简工具/node_modules/buffer-equal/test/eq.js new file mode 100644 index 0000000..3d34006 --- /dev/null +++ b/packages/字体精简工具/node_modules/buffer-equal/test/eq.js @@ -0,0 +1,35 @@ +var bufferEqual = require('../'); +var test = require('tap').test; + +test('equal', function (t) { + var eq = bufferEqual( + new Buffer([253,254,255]), + new Buffer([253,254,255]) + ); + t.strictEqual(eq, true); + t.end(); +}); + +test('not equal', function (t) { + var eq = bufferEqual( + new Buffer('abc'), + new Buffer('abcd') + ); + t.strictEqual(eq, false); + t.end(); +}); + +test('not equal not buffer', function (t) { + var eq = bufferEqual( + new Buffer('abc'), + 'abc' + ); + t.strictEqual(eq, undefined); + t.end(); +}); + +test('equal not buffer', function (t) { + var eq = bufferEqual('abc', 'abc'); + t.strictEqual(eq, undefined); + t.end(); +}); diff --git a/packages/字体精简工具/node_modules/buffer-from/LICENSE b/packages/字体精简工具/node_modules/buffer-from/LICENSE new file mode 100644 index 0000000..e4bf1d6 --- /dev/null +++ b/packages/字体精简工具/node_modules/buffer-from/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2016, 2018 Linus Unnebäck + +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/packages/字体精简工具/node_modules/buffer-from/index.js b/packages/字体精简工具/node_modules/buffer-from/index.js new file mode 100644 index 0000000..d92a83d --- /dev/null +++ b/packages/字体精简工具/node_modules/buffer-from/index.js @@ -0,0 +1,69 @@ +var toString = Object.prototype.toString + +var isModern = ( + typeof Buffer.alloc === 'function' && + typeof Buffer.allocUnsafe === 'function' && + typeof Buffer.from === 'function' +) + +function isArrayBuffer (input) { + return toString.call(input).slice(8, -1) === 'ArrayBuffer' +} + +function fromArrayBuffer (obj, byteOffset, length) { + byteOffset >>>= 0 + + var maxLength = obj.byteLength - byteOffset + + if (maxLength < 0) { + throw new RangeError("'offset' is out of bounds") + } + + if (length === undefined) { + length = maxLength + } else { + length >>>= 0 + + if (length > maxLength) { + throw new RangeError("'length' is out of bounds") + } + } + + return isModern + ? Buffer.from(obj.slice(byteOffset, byteOffset + length)) + : new Buffer(new Uint8Array(obj.slice(byteOffset, byteOffset + length))) +} + +function fromString (string, encoding) { + if (typeof encoding !== 'string' || encoding === '') { + encoding = 'utf8' + } + + if (!Buffer.isEncoding(encoding)) { + throw new TypeError('"encoding" must be a valid string encoding') + } + + return isModern + ? Buffer.from(string, encoding) + : new Buffer(string, encoding) +} + +function bufferFrom (value, encodingOrOffset, length) { + if (typeof value === 'number') { + throw new TypeError('"value" argument must not be a number') + } + + if (isArrayBuffer(value)) { + return fromArrayBuffer(value, encodingOrOffset, length) + } + + if (typeof value === 'string') { + return fromString(value, encodingOrOffset) + } + + return isModern + ? Buffer.from(value) + : new Buffer(value) +} + +module.exports = bufferFrom diff --git a/packages/字体精简工具/node_modules/buffer-from/package.json b/packages/字体精简工具/node_modules/buffer-from/package.json new file mode 100644 index 0000000..b108ee9 --- /dev/null +++ b/packages/字体精简工具/node_modules/buffer-from/package.json @@ -0,0 +1,53 @@ +{ + "_from": "buffer-from@^1.0.0", + "_id": "buffer-from@1.1.1", + "_inBundle": false, + "_integrity": "sha1-MnE7wCj3XAL9txDXx7zsHyxgcO8=", + "_location": "/buffer-from", + "_phantomChildren": {}, + "_requested": { + "type": "range", + "registry": true, + "raw": "buffer-from@^1.0.0", + "name": "buffer-from", + "escapedName": "buffer-from", + "rawSpec": "^1.0.0", + "saveSpec": null, + "fetchSpec": "^1.0.0" + }, + "_requiredBy": [ + "/concat-stream", + "/source-map-support" + ], + "_resolved": "https://registry.nlark.com/buffer-from/download/buffer-from-1.1.1.tgz", + "_shasum": "32713bc028f75c02fdb710d7c7bcec1f2c6070ef", + "_spec": "buffer-from@^1.0.0", + "_where": "D:\\workspace\\plugin\\mini_font\\packages\\mini_font\\publish\\mini_font\\node_modules\\concat-stream", + "bugs": { + "url": "https://github.com/LinusU/buffer-from/issues" + }, + "bundleDependencies": false, + "deprecated": false, + "description": "A [ponyfill](https://ponyfill.com) for `Buffer.from`, uses native implementation if available.", + "devDependencies": { + "standard": "^7.1.2" + }, + "files": [ + "index.js" + ], + "homepage": "https://github.com/LinusU/buffer-from#readme", + "keywords": [ + "buffer", + "buffer from" + ], + "license": "MIT", + "name": "buffer-from", + "repository": { + "type": "git", + "url": "git+https://github.com/LinusU/buffer-from.git" + }, + "scripts": { + "test": "standard && node test" + }, + "version": "1.1.1" +} diff --git a/packages/字体精简工具/node_modules/buffer-from/readme.md b/packages/字体精简工具/node_modules/buffer-from/readme.md new file mode 100644 index 0000000..9880a55 --- /dev/null +++ b/packages/字体精简工具/node_modules/buffer-from/readme.md @@ -0,0 +1,69 @@ +# Buffer From + +A [ponyfill](https://ponyfill.com) for `Buffer.from`, uses native implementation if available. + +## Installation + +```sh +npm install --save buffer-from +``` + +## Usage + +```js +const bufferFrom = require('buffer-from') + +console.log(bufferFrom([1, 2, 3, 4])) +//=> + +const arr = new Uint8Array([1, 2, 3, 4]) +console.log(bufferFrom(arr.buffer, 1, 2)) +//=> + +console.log(bufferFrom('test', 'utf8')) +//=> + +const buf = bufferFrom('test') +console.log(bufferFrom(buf)) +//=> +``` + +## API + +### bufferFrom(array) + +- `array` <Array> + +Allocates a new `Buffer` using an `array` of octets. + +### bufferFrom(arrayBuffer[, byteOffset[, length]]) + +- `arrayBuffer` <ArrayBuffer> The `.buffer` property of a TypedArray or ArrayBuffer +- `byteOffset` <Integer> Where to start copying from `arrayBuffer`. **Default:** `0` +- `length` <Integer> How many bytes to copy from `arrayBuffer`. **Default:** `arrayBuffer.length - byteOffset` + +When passed a reference to the `.buffer` property of a TypedArray instance, the +newly created `Buffer` will share the same allocated memory as the TypedArray. + +The optional `byteOffset` and `length` arguments specify a memory range within +the `arrayBuffer` that will be shared by the `Buffer`. + +### bufferFrom(buffer) + +- `buffer` <Buffer> An existing `Buffer` to copy data from + +Copies the passed `buffer` data onto a new `Buffer` instance. + +### bufferFrom(string[, encoding]) + +- `string` <String> A string to encode. +- `encoding` <String> The encoding of `string`. **Default:** `'utf8'` + +Creates a new `Buffer` containing the given JavaScript string `string`. If +provided, the `encoding` parameter identifies the character encoding of +`string`. + +## See also + +- [buffer-alloc](https://github.com/LinusU/buffer-alloc) A ponyfill for `Buffer.alloc` +- [buffer-alloc-unsafe](https://github.com/LinusU/buffer-alloc-unsafe) A ponyfill for `Buffer.allocUnsafe` diff --git a/packages/字体精简工具/node_modules/buffer-to-vinyl/index.js b/packages/字体精简工具/node_modules/buffer-to-vinyl/index.js new file mode 100644 index 0000000..2549ce7 --- /dev/null +++ b/packages/字体精简工具/node_modules/buffer-to-vinyl/index.js @@ -0,0 +1,20 @@ +'use strict'; +var fileType = require('file-type'); +var PassThrough = require('readable-stream/passthrough'); +var uuid = require('uuid'); +var Vinyl = require('vinyl'); + +module.exports.file = function (buf, name) { + var ext = fileType(buf) ? '.' + fileType(buf).ext : null; + + return new Vinyl({ + contents: buf, + path: (name || uuid.v4()) + (ext || '') + }); +}; + +module.exports.stream = function (buf, name) { + var stream = new PassThrough({objectMode: true}); + stream.end(module.exports.file(buf, name)); + return stream; +}; diff --git a/packages/字体精简工具/node_modules/buffer-to-vinyl/license b/packages/字体精简工具/node_modules/buffer-to-vinyl/license new file mode 100644 index 0000000..a8ecbbe --- /dev/null +++ b/packages/字体精简工具/node_modules/buffer-to-vinyl/license @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (c) Kevin Mårtensson + +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/packages/字体精简工具/node_modules/buffer-to-vinyl/package.json b/packages/字体精简工具/node_modules/buffer-to-vinyl/package.json new file mode 100644 index 0000000..734d232 --- /dev/null +++ b/packages/字体精简工具/node_modules/buffer-to-vinyl/package.json @@ -0,0 +1,65 @@ +{ + "_from": "buffer-to-vinyl@^1.0.0", + "_id": "buffer-to-vinyl@1.1.0", + "_inBundle": false, + "_integrity": "sha1-APFfruOreh3aLN5tkSG//dB7ImI=", + "_location": "/buffer-to-vinyl", + "_phantomChildren": {}, + "_requested": { + "type": "range", + "registry": true, + "raw": "buffer-to-vinyl@^1.0.0", + "name": "buffer-to-vinyl", + "escapedName": "buffer-to-vinyl", + "rawSpec": "^1.0.0", + "saveSpec": null, + "fetchSpec": "^1.0.0" + }, + "_requiredBy": [ + "/fontmin" + ], + "_resolved": "https://registry.npm.taobao.org/buffer-to-vinyl/download/buffer-to-vinyl-1.1.0.tgz", + "_shasum": "00f15faee3ab7a1dda2cde6d9121bffdd07b2262", + "_spec": "buffer-to-vinyl@^1.0.0", + "_where": "D:\\workspace\\plugin\\mini_font\\packages\\mini_font\\publish\\mini_font\\node_modules\\fontmin", + "author": { + "name": "Kevin Mårtensson", + "email": "kevinmartensson@gmail.com", + "url": "https://github.com/kevva" + }, + "bugs": { + "url": "https://github.com/kevva/buffer-to-vinyl/issues" + }, + "bundleDependencies": false, + "dependencies": { + "file-type": "^3.1.0", + "readable-stream": "^2.0.2", + "uuid": "^2.0.1", + "vinyl": "^1.0.0" + }, + "deprecated": false, + "description": "Create a vinyl file or stream from a buffer", + "devDependencies": { + "ava": "^0.0.4", + "concat-stream": "^1.4.7", + "xo": "*" + }, + "engines": { + "node": ">=0.10.0" + }, + "files": [ + "index.js" + ], + "homepage": "https://github.com/kevva/buffer-to-vinyl#readme", + "keywords": [], + "license": "MIT", + "name": "buffer-to-vinyl", + "repository": { + "type": "git", + "url": "git+https://github.com/kevva/buffer-to-vinyl.git" + }, + "scripts": { + "test": "xo && node test.js" + }, + "version": "1.1.0" +} diff --git a/packages/字体精简工具/node_modules/buffer-to-vinyl/readme.md b/packages/字体精简工具/node_modules/buffer-to-vinyl/readme.md new file mode 100644 index 0000000..585db14 --- /dev/null +++ b/packages/字体精简工具/node_modules/buffer-to-vinyl/readme.md @@ -0,0 +1,37 @@ +# buffer-to-vinyl [![Build Status](http://img.shields.io/travis/kevva/buffer-to-vinyl.svg?style=flat)](https://travis-ci.org/kevva/buffer-to-vinyl) + +> Create a vinyl file or stream from a buffer + + +## Install + +``` +$ npm install --save buffer-to-vinyl +``` + + +## Usage + +```js +var bufferToVinyl = require('buffer-to-vinyl'); +var fs = require('fs'); + +bufferToVinyl.file(fs.readFileSync('foo.jpg', null)); +bufferToVinyl.stream(fs.readFileSync('foo.jpg', null)); +``` + + +## API + +### .file(buf, [name]) + +Creates a vinyl file. + +### .stream(buf, [name]) + +Creates a object stream. + + +## License + +MIT © [Kevin Mårtensson](https://github.com/kevva) diff --git a/packages/字体精简工具/node_modules/bufferstreams/CHANGELOG.md b/packages/字体精简工具/node_modules/bufferstreams/CHANGELOG.md new file mode 100644 index 0000000..279e31a --- /dev/null +++ b/packages/字体精简工具/node_modules/bufferstreams/CHANGELOG.md @@ -0,0 +1,82 @@ + +## [2.0.1](https://github.com/nfroidure/BufferStreams/compare/v2.0.0...v2.0.1) (2018-04-23) + + +### Bug Fixes + +* Remove debug dependency ([2719573](https://github.com/nfroidure/BufferStreams/commit/2719573)) + + + + +# [2.0.0](https://github.com/nfroidure/BufferStreams/compare/v1.1.1...v2.0.0) (2017-12-06) + + +### build + +* **metapak-nfroidure:** Add metapak-nfroidure ([ed104f6](https://github.com/nfroidure/BufferStreams/commit/ed104f6)) + + +### BREAKING CHANGES + +* **metapak-nfroidure:** Removing support for versions minors to the last LTS + + + +## Change Log + +### upcoming (2017/03/05 07:36 +00:00) +- [f1bea6b](https://github.com/nfroidure/bufferstreams/commit/f1bea6bc9ad1c013457b9b9137f6dae70e9cab6b) Add Node 4-6-7 (@nfroidure) + +### v1.1.1 (2016/06/28 11:20 +00:00) +- [acd1875](https://github.com/nfroidure/bufferstreams/commit/acd18756a3066c72b4cff8aa79aa44a3dcb4f85f) 1.1.1 (@shinnn) +- [4fc64b9](https://github.com/nfroidure/bufferstreams/commit/4fc64b9be16693e59920b976d4822adf52ec6f3d) Use wider badges to fit modern Github design (@shinnn) +- [2b28391](https://github.com/nfroidure/bufferstreams/commit/2b2839191eec654af9361fc654d430f69bc6d622) Fix invalid license statement in package.json (@shinnn) +- [e330151](https://github.com/nfroidure/bufferstreams/commit/e330151fd994b90d4383e2e189f18f628c3c1157) Fix file mode (@shinnn) +- [#4](https://github.com/nfroidure/bufferstreams/pull/4) Use files field instead of .npmignore (@shinnn) +- [d7435e5](https://github.com/nfroidure/bufferstreams/commit/d7435e5729b4684492e746d015bbfee39ac564dc) Use files field instead of .npmignore (@shinnn) + +### v1.1.0 (2015/08/04 09:48 +00:00) +- [8b3f905](https://github.com/nfroidure/bufferstreams/commit/8b3f9058764b4ff8095df90eea55ea7683d3ee33) 1.1.0 (@nfroidure) +- [e7a4854](https://github.com/nfroidure/bufferstreams/commit/e7a4854d032682593851e20c20ac0b63587594d7) Better doc (@nfroidure) +- [0567b10](https://github.com/nfroidure/bufferstreams/commit/0567b10f2a8cc6ddb1eada72a9178533b1fa1dd2) Also build on Node 0.12 (@nfroidure) +- [92cd9de](https://github.com/nfroidure/bufferstreams/commit/92cd9de1752cbb70d403c4fbbee0532e762bf3e1) Dependencies update (@nfroidure) +- [5bc3649](https://github.com/nfroidure/bufferstreams/commit/5bc3649e1c8f58505cad3393cbf67c47581dac13) Better handling of errors (@nfroidure) +- [1ca6222](https://github.com/nfroidure/bufferstreams/commit/1ca6222b488072004305156c94a388c100df6fc7) Code cleanup and backward compatibility (@nfroidure) +- [999b805](https://github.com/nfroidure/bufferstreams/commit/999b805be2007b5a1100f9cdbf0f911aa667afab) Using Duplex stream instead of Transform one (@nfroidure) +- [77051e3](https://github.com/nfroidure/bufferstreams/commit/77051e330e82931acf3fb4c4b0b4f24aa4ae13de) Add tests for callback error emitting (@nfroidure) +- [6475b82](https://github.com/nfroidure/bufferstreams/commit/6475b820cbc5a80f4e98bea86cdda3acc6ec7743) Adding linter and suppress warnings (@nfroidure) +- [8d24a90](https://github.com/nfroidure/bufferstreams/commit/8d24a90bf5b91c1185f5c5f00cc32a4b65fc9fc5) Improving the README file (@nfroidure) +- [d5ab44e](https://github.com/nfroidure/bufferstreams/commit/d5ab44e5ddeaddd73744158d046eb71b2fb29fb6) Add stats (@nfroidure) + +### v1.0.2 (2015/06/21 07:11 +00:00) +- [8aaf7a5](https://github.com/nfroidure/bufferstreams/commit/8aaf7a576177d3c2c1e626d8bfba091d47d7cea3) 1.0.2 (@nfroidure) +- [fe52a06](https://github.com/nfroidure/bufferstreams/commit/fe52a06f252b161676f722624e74e9290b845320) Fix trinity script (@nfroidure) +- [d512161](https://github.com/nfroidure/bufferstreams/commit/d5121614d055a63fca0072ebfc360fc17f8e04aa) Dependencies update (@nfroidure) +- [48687ed](https://github.com/nfroidure/bufferstreams/commit/48687ed86eea5262693bb9b11097003bc0985b19) Merge branch 'master' of github.com:nfroidure/bufferstreams (@nfroidure) +- [#3](https://github.com/nfroidure/bufferstreams/pull/3) Use SVG-based badges (@shinnn) +- [88eccc5](https://github.com/nfroidure/bufferstreams/commit/88eccc50275e9317cba820a72f69f611c69cf3ab) Use SVG-based badges (@shinnn) +- [a2875b3](https://github.com/nfroidure/bufferstreams/commit/a2875b323ec90b0d4d7afb60186a07c9f60f9350) Simplify test scripts (@shinnn) + +### v1.0.1 (2015/02/09 17:57 +00:00) +- [7d4c975](https://github.com/nfroidure/bufferstreams/commit/7d4c975accd17ea382845d93e11761ad8c364534) 1.0.1 (@nfroidure) +- [6027553](https://github.com/nfroidure/bufferstreams/commit/602755373fd77d9ca34248b2ba106bcd57e49dce) Update deps (@nfroidure) + +### v1.0.0 (2015/02/09 17:49 +00:00) +- [438812d](https://github.com/nfroidure/bufferstreams/commit/438812dc9e6ecfbc7bd184503a341b0627aa9bf6) 1.0.0 (@nfroidure) +- [01859b0](https://github.com/nfroidure/bufferstreams/commit/01859b0b32a8bb630d97aec3e01dac9148fd7b17) Documenting objectMode (@nfroidure) +- [d3cac8d](https://github.com/nfroidure/bufferstreams/commit/d3cac8dab9a8d6f8275e82eedfafe929b156c258) Fixing tests (@nfroidure) +- [d7ae39a](https://github.com/nfroidure/bufferstreams/commit/d7ae39a4bab7f77a93cde5993f8da703e21db0f0) Adding code climate metrics badge (@nfroidure) +- [677f394](https://github.com/nfroidure/bufferstreams/commit/677f394d68a49afd6a24865a111c061985f8739f) Allowing objectMode, adding a better test lib and 100% coveraging (@nfroidure) +- [1bf9b40](https://github.com/nfroidure/bufferstreams/commit/1bf9b404b47c801387867b9a3614041c5285cfe2) New version 0.0.2 (@nfroidure) +- [17723e2](https://github.com/nfroidure/bufferstreams/commit/17723e212599d3a6dd582980b98331c0651a93ea) Added readable-stream closes#1 (@nfroidure) +- [51545c3](https://github.com/nfroidure/bufferstreams/commit/51545c3e26b26315c17b17bb9a09986b39a538bf) Accept forgiving new (@nfroidure) +- [8d87f57](https://github.com/nfroidure/bufferstreams/commit/8d87f576047d65b2a86680df4d4a6469202d96e1) Dependencies update (@nfroidure) +- [3a1408f](https://github.com/nfroidure/bufferstreams/commit/3a1408fd7886a0dd5f1edf357d4c2373521ae032) Added deps (@nfroidure) +- [38f0690](https://github.com/nfroidure/bufferstreams/commit/38f06902efe745a9cbf648fe6634a2c78c18a544) Added coverage tests (@nfroidure) +- [2a631d6](https://github.com/nfroidure/bufferstreams/commit/2a631d66a41547e32f79dcba2ffe164d3f890bf9) Typo fix (@nfroidure) +- [7ce57c9](https://github.com/nfroidure/bufferstreams/commit/7ce57c96aa95a24038442026b318f98ee5e9318e) Fixing npm badge (@nfroidure) +- [c6d7b48](https://github.com/nfroidure/bufferstreams/commit/c6d7b486bc537b57997dd329966d53a216f30bff) Adding npm badge (@nfroidure) +- [bfbca40](https://github.com/nfroidure/bufferstreams/commit/bfbca40112d3341989961a7ddbed838d2620b8e2) Adding instructions, fixing naming (@nfroidure) +- [1a531c7](https://github.com/nfroidure/bufferstreams/commit/1a531c78b79642c76bcdd09aa0262342833e6203) Readme updated (@nfroidure) +- [b0e1be8](https://github.com/nfroidure/bufferstreams/commit/b0e1be875aa9583ed44b2f1e9c74d050ef777ebb) First commit (@nfroidure) \ No newline at end of file diff --git a/packages/字体精简工具/node_modules/bufferstreams/LICENSE b/packages/字体精简工具/node_modules/bufferstreams/LICENSE new file mode 100644 index 0000000..df9966e --- /dev/null +++ b/packages/字体精简工具/node_modules/bufferstreams/LICENSE @@ -0,0 +1,20 @@ +The MIT License (MIT) +Copyright © 2017 Nicolas Froidure + +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/packages/字体精简工具/node_modules/bufferstreams/README.md b/packages/字体精简工具/node_modules/bufferstreams/README.md new file mode 100644 index 0000000..6d624ca --- /dev/null +++ b/packages/字体精简工具/node_modules/bufferstreams/README.md @@ -0,0 +1,102 @@ +[//]: # ( ) +[//]: # (This file is automatically generated by a `metapak`) +[//]: # (module. Do not change it except between the) +[//]: # (`content:start/end` flags, your changes would) +[//]: # (be overridden.) +[//]: # ( ) +# bufferstreams +> Abstract streams to deal with the whole buffered contents. + +[![NPM version](https://badge.fury.io/js/bufferstreams.svg)](https://npmjs.org/package/bufferstreams) +[![Build status](https://secure.travis-ci.org/nfroidure/bufferstreams.svg)](https://travis-ci.org/nfroidure/bufferstreams) +[![Dependency Status](https://david-dm.org/nfroidure/bufferstreams.svg)](https://david-dm.org/nfroidure/bufferstreams) +[![devDependency Status](https://david-dm.org/nfroidure/bufferstreams/dev-status.svg)](https://david-dm.org/nfroidure/bufferstreams#info=devDependencies) +[![Coverage Status](https://coveralls.io/repos/nfroidure/bufferstreams/badge.svg?branch=master)](https://coveralls.io/r/nfroidure/bufferstreams?branch=master) +[![Code Climate](https://codeclimate.com/github/nfroidure/bufferstreams.svg)](https://codeclimate.com/github/nfroidure/bufferstreams) +[![Dependency Status](https://dependencyci.com/github/nfroidure/bufferstreams/badge)](https://dependencyci.com/github/nfroidure/bufferstreams) + + +[//]: # (::contents:start) + +`bufferstreams` abstracts streams to allow you to deal with their whole content + in a single buffer when it becomes necessary (by example: a legacy library that + do not support streams). + +It is not a good practice, just some glue. Using `bufferstreams` means: +* there is no library dealing with streams for your needs +* you filled an issue to the wrapped library to support streams + +`bufferstreams` can also be used to control the whole stream content in a single + point of a streaming pipeline for testing purposes. + +## Usage +Install the [npm module](https://npmjs.org/package/bufferstreams): +```sh +npm install bufferstreams --save +``` +Then, in your scripts: +```js +var fs = require('fs'); +var bufferstreams = require('bufferstreams'); + +fs.createReadStream('input.txt') + .pipe(new bufferstreams(function(err, buf, cb) { + + // err will be filled with an error if the piped in stream emits one. + if(err) { + throw err; + } + + // buf will contain the whole piped in stream contents + buf = Buffer(buf.toString('utf-8').replace('foo', 'bar')); + + // cb is a callback to pass the result back to the piped out stream + // first argument is an error that will be emitted if any + // the second argument is the modified buffer + cb(null, buf); + + })) + .pipe(fs.createWriteStream('output.txt')); +``` + +Note that you can use `bufferstreams` with the objectMode option. In this case, + the given buffer will be an array containing the streamed objects: +```js +new BufferStreams({objectMode: true}, myCallback); +``` + +## API + +### Stream : BufferStreams([options], callback) + +#### options + +##### options.objectMode +Type: `Boolean` +Default value: `false` + +Use if piped in streams are in object mode. In this case, an array of the + buffered will be transmitted to the `callback` function. + +##### options.* + +`bufferstreams` inherits of Stream.Duplex, the options are passed to the + parent constructor so you can use it's options too. + +##### callback(err, buf, cb) +Type: `Function`, required. + +A function to handle the buffered content. + +## Stats + +[![NPM](https://nodei.co/npm/bufferstreams.png?downloads=true&stars=true)](https://nodei.co/npm/bufferstreams/) +[![NPM](https://nodei.co/npm-dl/bufferstreams.png)](https://nodei.co/npm/bufferstreams/) + +## Contributing +Feel free to pull your code if you agree with publishing it under the MIT license. + +[//]: # (::contents:end) + +# License +[MIT](https://github.com/nfroidure/bufferstreams/blob/master/LICENSE) diff --git a/packages/字体精简工具/node_modules/bufferstreams/package.json b/packages/字体精简工具/node_modules/bufferstreams/package.json new file mode 100644 index 0000000..d667f4e --- /dev/null +++ b/packages/字体精简工具/node_modules/bufferstreams/package.json @@ -0,0 +1,121 @@ +{ + "_from": "bufferstreams@^2.0.1", + "_id": "bufferstreams@2.0.1", + "_inBundle": false, + "_integrity": "sha1-RBsmfC/D/uArsdkpKJ2hE5A71e8=", + "_location": "/bufferstreams", + "_phantomChildren": {}, + "_requested": { + "type": "range", + "registry": true, + "raw": "bufferstreams@^2.0.1", + "name": "bufferstreams", + "escapedName": "bufferstreams", + "rawSpec": "^2.0.1", + "saveSpec": null, + "fetchSpec": "^2.0.1" + }, + "_requiredBy": [ + "/ttf2woff2" + ], + "_resolved": "https://registry.npm.taobao.org/bufferstreams/download/bufferstreams-2.0.1.tgz", + "_shasum": "441b267c2fc3fee02bb1d929289da113903bd5ef", + "_spec": "bufferstreams@^2.0.1", + "_where": "D:\\workspace\\plugin\\mini_font\\packages\\mini_font\\publish\\mini_font\\node_modules\\ttf2woff2", + "author": { + "name": "Nicolas Froidure" + }, + "bugs": { + "url": "https://github.com/nfroidure/BufferStreams/issues" + }, + "bundleDependencies": false, + "config": { + "commitizen": { + "path": "./node_modules/cz-conventional-changelog" + } + }, + "dependencies": { + "readable-stream": "^2.3.6" + }, + "deprecated": false, + "description": "Abstract streams to deal with the whole buffered contents.", + "devDependencies": { + "commitizen": "^2.9.6", + "conventional-changelog-cli": "^1.3.8", + "coveralls": "^3.0.0", + "cz-conventional-changelog": "^2.1.0", + "eslint": "^4.19.0", + "eslint-plugin-prettier": "^2.6.0", + "istanbul": "^0.4.5", + "istanbul-coveralls": "^1.0.3", + "metapak": "^1.0.3", + "metapak-nfroidure": "^6.0.0", + "mocha": "^5.0.0", + "mocha-lcov-reporter": "^1.3.0", + "prettier": "^1.11.1", + "streamtest": "^1.2.1" + }, + "engines": { + "node": ">=6.9.5" + }, + "files": [ + "src" + ], + "greenkeeper": { + "ignore": [ + "commitizen", + "cz-conventional-changelog", + "conventional-changelog-cli", + "eslint", + "eslint-config-prettier", + "prettier", + "mocha", + "mocha-lcov-reporter", + "coveralls", + "istanbul" + ] + }, + "homepage": "https://github.com/nfroidure/BufferStreams", + "keywords": [ + "buffer", + "streaming", + "stream", + "async", + "abstract" + ], + "license": "MIT", + "main": "src/index.js", + "metapak": { + "configs": [ + "readme", + "eslint", + "mocha", + "codeclimate", + "travis" + ], + "data": { + "files": "src/*.js tests/*.mocha.js", + "testsFiles": "tests/*.mocha.js" + } + }, + "name": "bufferstreams", + "repository": { + "type": "git", + "url": "git://github.com/nfroidure/BufferStreams.git" + }, + "scripts": { + "changelog": "conventional-changelog -p angular -i CHANGELOG.md -s", + "cli": "env NODE_ENV=${NODE_ENV:-cli}", + "cover": "istanbul cover _mocha --report html -- tests/*.mocha.js -R spec -t 5000", + "coveralls": "istanbul cover _mocha --report lcovonly -- tests/*.mocha.js -R spec -t 5000 && cat ./coverage/lcov.info | coveralls && rm -rf ./coverage", + "cz": "env NODE_ENV=${NODE_ENV:-cli} git cz", + "lint": "eslint src/*.js tests/*.mocha.js", + "metapak": "metapak", + "mocha": "mocha tests/*.mocha.js", + "prettier": "prettier --write src/*.js tests/*.mocha.js", + "preversion": "npm t && npm run lint && npm run metapak -s", + "test": "npm run mocha", + "version": "npm run changelog && git add CHANGELOG.md" + }, + "version": "2.0.1" +} diff --git a/packages/字体精简工具/node_modules/bufferstreams/src/index.js b/packages/字体精简工具/node_modules/bufferstreams/src/index.js new file mode 100644 index 0000000..35492f2 --- /dev/null +++ b/packages/字体精简工具/node_modules/bufferstreams/src/index.js @@ -0,0 +1,97 @@ +'use strict'; + +const Duplex = require('readable-stream').Duplex; +const util = require('util'); + +// Inherit of Duplex stream +util.inherits(BufferStream, Duplex); + +// Constructor +function BufferStream(options, cb) { + const _this = this; + + // Ensure new were used + if (!(_this instanceof BufferStream)) { + return new BufferStream(options, cb); + } + + // Cast args + if (options instanceof Function) { + cb = options; + options = {}; + } + options = options || {}; + if (!(cb instanceof Function)) { + throw new Error('The given callback must be a function.'); + } + _this.__objectMode = options.objectMode; + + // Parent constructor + Duplex.call(_this, options); + + // Keep a reference to the callback + _this._cb = cb; + + // Add a finished flag + _this._bufferStreamFinished = false; + + // Internal buffer + _this._bufferStreamBuffer = []; + + // Internal logic + function _bufferStreamCallbackWrapper(err) { + const buffer = options.objectMode + ? _this._bufferStreamBuffer + : Buffer.concat(_this._bufferStreamBuffer); + + err = err || null; + _this._cb(err, buffer, (err2, buf) => { + setImmediate(() => { + _this.removeListener('error', _bufferStreamError); + if (err2) { + _this.emit('error', err2); + } + _this._bufferStreamBuffer = options.objectMode ? buf || [] : [buf]; + _this._bufferStreamFinished = true; + _this._read(); + }); + }); + } + + function _bufferStreamError(err) { + if (_this._bufferStreamFinished) { + return; + } + _bufferStreamCallbackWrapper(err); + } + + _this.once('finish', _bufferStreamCallbackWrapper); + + _this.on('error', _bufferStreamError); +} + +BufferStream.prototype._write = function _bufferStreamWrite( + chunk, + encoding, + done +) { + this._bufferStreamBuffer.push(chunk); + done(); +}; + +BufferStream.prototype._read = function _bufferStreamRead() { + const _this = this; + + if (_this._bufferStreamFinished) { + while (_this._bufferStreamBuffer.length) { + if (!_this.push(_this._bufferStreamBuffer.shift())) { + break; + } + } + if (0 === _this._bufferStreamBuffer.length) { + _this.push(null); + } + } +}; + +module.exports = BufferStream; diff --git a/packages/字体精简工具/node_modules/call-bind/.eslintignore b/packages/字体精简工具/node_modules/call-bind/.eslintignore new file mode 100644 index 0000000..404abb2 --- /dev/null +++ b/packages/字体精简工具/node_modules/call-bind/.eslintignore @@ -0,0 +1 @@ +coverage/ diff --git a/packages/字体精简工具/node_modules/call-bind/.eslintrc b/packages/字体精简工具/node_modules/call-bind/.eslintrc new file mode 100644 index 0000000..e5d3c9a --- /dev/null +++ b/packages/字体精简工具/node_modules/call-bind/.eslintrc @@ -0,0 +1,17 @@ +{ + "root": true, + + "extends": "@ljharb", + + "rules": { + "func-name-matching": 0, + "id-length": 0, + "new-cap": [2, { + "capIsNewExceptions": [ + "GetIntrinsic", + ], + }], + "no-magic-numbers": 0, + "operator-linebreak": [2, "before"], + }, +} diff --git a/packages/字体精简工具/node_modules/call-bind/.github/FUNDING.yml b/packages/字体精简工具/node_modules/call-bind/.github/FUNDING.yml new file mode 100644 index 0000000..c70c2ec --- /dev/null +++ b/packages/字体精简工具/node_modules/call-bind/.github/FUNDING.yml @@ -0,0 +1,12 @@ +# These are supported funding model platforms + +github: [ljharb] +patreon: # Replace with a single Patreon username +open_collective: # Replace with a single Open Collective username +ko_fi: # Replace with a single Ko-fi username +tidelift: npm/call-bind +community_bridge: # Replace with a single Community Bridge project-name e.g., cloud-foundry +liberapay: # Replace with a single Liberapay username +issuehunt: # Replace with a single IssueHunt username +otechie: # Replace with a single Otechie username +custom: # Replace with up to 4 custom sponsorship URLs e.g., ['link1', 'link2'] diff --git a/packages/字体精简工具/node_modules/call-bind/.nycrc b/packages/字体精简工具/node_modules/call-bind/.nycrc new file mode 100644 index 0000000..1826526 --- /dev/null +++ b/packages/字体精简工具/node_modules/call-bind/.nycrc @@ -0,0 +1,13 @@ +{ + "all": true, + "check-coverage": false, + "reporter": ["text-summary", "text", "html", "json"], + "lines": 86, + "statements": 85.93, + "functions": 82.43, + "branches": 76.06, + "exclude": [ + "coverage", + "test" + ] +} diff --git a/packages/字体精简工具/node_modules/call-bind/CHANGELOG.md b/packages/字体精简工具/node_modules/call-bind/CHANGELOG.md new file mode 100644 index 0000000..62a3727 --- /dev/null +++ b/packages/字体精简工具/node_modules/call-bind/CHANGELOG.md @@ -0,0 +1,42 @@ +# Changelog + +All notable changes to this project will be documented in this file. + +The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/) +and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). + +## [v1.0.2](https://github.com/ljharb/call-bind/compare/v1.0.1...v1.0.2) - 2021-01-11 + +### Commits + +- [Fix] properly include the receiver in the bound length [`dbae7bc`](https://github.com/ljharb/call-bind/commit/dbae7bc676c079a0d33c0a43e9ef92cb7b01345d) + +## [v1.0.1](https://github.com/ljharb/call-bind/compare/v1.0.0...v1.0.1) - 2021-01-08 + +### Commits + +- [Tests] migrate tests to Github Actions [`b6db284`](https://github.com/ljharb/call-bind/commit/b6db284c36f8ccd195b88a6764fe84b7223a0da1) +- [meta] do not publish github action workflow files [`ec7fe46`](https://github.com/ljharb/call-bind/commit/ec7fe46e60cfa4764ee943d2755f5e5a366e578e) +- [Fix] preserve original function’s length when possible [`adbceaa`](https://github.com/ljharb/call-bind/commit/adbceaa3cac4b41ea78bb19d7ccdbaaf7e0bdadb) +- [Tests] gather coverage data on every job [`d69e23c`](https://github.com/ljharb/call-bind/commit/d69e23cc65f101ba1d4c19bb07fa8eb0ec624be8) +- [Dev Deps] update `eslint`, `@ljharb/eslint-config`, `aud`, `tape` [`2fd3586`](https://github.com/ljharb/call-bind/commit/2fd3586c5d47b335364c14293114c6b625ae1f71) +- [Deps] update `get-intrinsic` [`f23e931`](https://github.com/ljharb/call-bind/commit/f23e9318cc271c2add8bb38cfded85ee7baf8eee) +- [Deps] update `get-intrinsic` [`72d9f44`](https://github.com/ljharb/call-bind/commit/72d9f44e184465ba8dd3fb48260bbcff234985f2) +- [meta] fix FUNDING.yml [`e723573`](https://github.com/ljharb/call-bind/commit/e723573438c5a68dcec31fb5d96ea6b7e4a93be8) +- [eslint] ignore coverage output [`15e76d2`](https://github.com/ljharb/call-bind/commit/15e76d28a5f43e504696401e5b31ebb78ee1b532) +- [meta] add Automatic Rebase and Require Allow Edits workflows [`8fa4dab`](https://github.com/ljharb/call-bind/commit/8fa4dabb23ba3dd7bb92c9571c1241c08b56e4b6) + +## v1.0.0 - 2020-10-30 + +### Commits + +- Initial commit [`306cf98`](https://github.com/ljharb/call-bind/commit/306cf98c7ec9e7ef66b653ec152277ac1381eb50) +- Tests [`e10d0bb`](https://github.com/ljharb/call-bind/commit/e10d0bbdadc7a10ecedc9a1c035112d3e368b8df) +- Implementation [`43852ed`](https://github.com/ljharb/call-bind/commit/43852eda0f187327b7fad2423ca972149a52bd65) +- npm init [`408f860`](https://github.com/ljharb/call-bind/commit/408f860b773a2f610805fd3613d0d71bac1b6249) +- [meta] add Automatic Rebase and Require Allow Edits workflows [`fb349b2`](https://github.com/ljharb/call-bind/commit/fb349b2e48defbec8b5ec8a8395cc8f69f220b13) +- [meta] add `auto-changelog` [`c4001fc`](https://github.com/ljharb/call-bind/commit/c4001fc43031799ef908211c98d3b0fb2b60fde4) +- [meta] add "funding"; create `FUNDING.yml` [`d4d6d29`](https://github.com/ljharb/call-bind/commit/d4d6d2974a14bc2e98830468eda7fe6d6a776717) +- [Tests] add `npm run lint` [`dedfb98`](https://github.com/ljharb/call-bind/commit/dedfb98bd0ecefb08ddb9a94061bd10cde4332af) +- Only apps should have lockfiles [`54ac776`](https://github.com/ljharb/call-bind/commit/54ac77653db45a7361dc153d2f478e743f110650) +- [meta] add `safe-publish-latest` [`9ea8e43`](https://github.com/ljharb/call-bind/commit/9ea8e435b950ce9b705559cd651039f9bf40140f) diff --git a/packages/字体精简工具/node_modules/call-bind/LICENSE b/packages/字体精简工具/node_modules/call-bind/LICENSE new file mode 100644 index 0000000..48f05d0 --- /dev/null +++ b/packages/字体精简工具/node_modules/call-bind/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2020 Jordan Harband + +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/packages/字体精简工具/node_modules/call-bind/README.md b/packages/字体精简工具/node_modules/call-bind/README.md new file mode 100644 index 0000000..53649eb --- /dev/null +++ b/packages/字体精简工具/node_modules/call-bind/README.md @@ -0,0 +1,2 @@ +# call-bind +Robustly `.call.bind()` a function. diff --git a/packages/字体精简工具/node_modules/call-bind/callBound.js b/packages/字体精简工具/node_modules/call-bind/callBound.js new file mode 100644 index 0000000..8374adf --- /dev/null +++ b/packages/字体精简工具/node_modules/call-bind/callBound.js @@ -0,0 +1,15 @@ +'use strict'; + +var GetIntrinsic = require('get-intrinsic'); + +var callBind = require('./'); + +var $indexOf = callBind(GetIntrinsic('String.prototype.indexOf')); + +module.exports = function callBoundIntrinsic(name, allowMissing) { + var intrinsic = GetIntrinsic(name, !!allowMissing); + if (typeof intrinsic === 'function' && $indexOf(name, '.prototype.') > -1) { + return callBind(intrinsic); + } + return intrinsic; +}; diff --git a/packages/字体精简工具/node_modules/call-bind/index.js b/packages/字体精简工具/node_modules/call-bind/index.js new file mode 100644 index 0000000..6fa3e4a --- /dev/null +++ b/packages/字体精简工具/node_modules/call-bind/index.js @@ -0,0 +1,47 @@ +'use strict'; + +var bind = require('function-bind'); +var GetIntrinsic = require('get-intrinsic'); + +var $apply = GetIntrinsic('%Function.prototype.apply%'); +var $call = GetIntrinsic('%Function.prototype.call%'); +var $reflectApply = GetIntrinsic('%Reflect.apply%', true) || bind.call($call, $apply); + +var $gOPD = GetIntrinsic('%Object.getOwnPropertyDescriptor%', true); +var $defineProperty = GetIntrinsic('%Object.defineProperty%', true); +var $max = GetIntrinsic('%Math.max%'); + +if ($defineProperty) { + try { + $defineProperty({}, 'a', { value: 1 }); + } catch (e) { + // IE 8 has a broken defineProperty + $defineProperty = null; + } +} + +module.exports = function callBind(originalFunction) { + var func = $reflectApply(bind, $call, arguments); + if ($gOPD && $defineProperty) { + var desc = $gOPD(func, 'length'); + if (desc.configurable) { + // original length, plus the receiver, minus any additional arguments (after the receiver) + $defineProperty( + func, + 'length', + { value: 1 + $max(0, originalFunction.length - (arguments.length - 1)) } + ); + } + } + return func; +}; + +var applyBind = function applyBind() { + return $reflectApply(bind, $apply, arguments); +}; + +if ($defineProperty) { + $defineProperty(module.exports, 'apply', { value: applyBind }); +} else { + module.exports.apply = applyBind; +} diff --git a/packages/字体精简工具/node_modules/call-bind/package.json b/packages/字体精简工具/node_modules/call-bind/package.json new file mode 100644 index 0000000..e8d2e38 --- /dev/null +++ b/packages/字体精简工具/node_modules/call-bind/package.json @@ -0,0 +1,108 @@ +{ + "_from": "call-bind@^1.0.0", + "_id": "call-bind@1.0.2", + "_inBundle": false, + "_integrity": "sha1-sdTonmiBGcPJqQOtMKuy9qkZvjw=", + "_location": "/call-bind", + "_phantomChildren": {}, + "_requested": { + "type": "range", + "registry": true, + "raw": "call-bind@^1.0.0", + "name": "call-bind", + "escapedName": "call-bind", + "rawSpec": "^1.0.0", + "saveSpec": null, + "fetchSpec": "^1.0.0" + }, + "_requiredBy": [ + "/object.assign" + ], + "_resolved": "https://registry.nlark.com/call-bind/download/call-bind-1.0.2.tgz", + "_shasum": "b1d4e89e688119c3c9a903ad30abb2f6a919be3c", + "_spec": "call-bind@^1.0.0", + "_where": "D:\\workspace\\plugin\\mini_font\\packages\\mini_font\\publish\\mini_font\\node_modules\\object.assign", + "author": { + "name": "Jordan Harband", + "email": "ljharb@gmail.com" + }, + "auto-changelog": { + "output": "CHANGELOG.md", + "template": "keepachangelog", + "unreleased": false, + "commitLimit": false, + "backfillLimit": false, + "hideCredit": true + }, + "bugs": { + "url": "https://github.com/ljharb/call-bind/issues" + }, + "bundleDependencies": false, + "dependencies": { + "function-bind": "^1.1.1", + "get-intrinsic": "^1.0.2" + }, + "deprecated": false, + "description": "Robustly `.call.bind()` a function", + "devDependencies": { + "@ljharb/eslint-config": "^17.3.0", + "aud": "^1.1.3", + "auto-changelog": "^2.2.1", + "eslint": "^7.17.0", + "nyc": "^10.3.2", + "safe-publish-latest": "^1.1.4", + "tape": "^5.1.1" + }, + "exports": { + ".": [ + { + "default": "./index.js" + }, + "./index.js" + ], + "./callBound": [ + { + "default": "./callBound.js" + }, + "./callBound.js" + ], + "./package.json": "./package.json" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + }, + "homepage": "https://github.com/ljharb/call-bind#readme", + "keywords": [ + "javascript", + "ecmascript", + "es", + "js", + "callbind", + "callbound", + "call", + "bind", + "bound", + "call-bind", + "call-bound", + "function", + "es-abstract" + ], + "license": "MIT", + "main": "index.js", + "name": "call-bind", + "repository": { + "type": "git", + "url": "git+https://github.com/ljharb/call-bind.git" + }, + "scripts": { + "lint": "eslint --ext=.js,.mjs .", + "posttest": "aud --production", + "postversion": "auto-changelog && git add CHANGELOG.md && git commit --no-edit --amend && git tag -f \"v$(node -e \"console.log(require('./package.json').version)\")\"", + "prepublish": "safe-publish-latest", + "pretest": "npm run lint", + "test": "npm run tests-only", + "tests-only": "nyc tape 'test/*'", + "version": "auto-changelog && git add CHANGELOG.md" + }, + "version": "1.0.2" +} diff --git a/packages/字体精简工具/node_modules/call-bind/test/callBound.js b/packages/字体精简工具/node_modules/call-bind/test/callBound.js new file mode 100644 index 0000000..209ce3c --- /dev/null +++ b/packages/字体精简工具/node_modules/call-bind/test/callBound.js @@ -0,0 +1,55 @@ +'use strict'; + +var test = require('tape'); + +var callBound = require('../callBound'); + +test('callBound', function (t) { + // static primitive + t.equal(callBound('Array.length'), Array.length, 'Array.length yields itself'); + t.equal(callBound('%Array.length%'), Array.length, '%Array.length% yields itself'); + + // static non-function object + t.equal(callBound('Array.prototype'), Array.prototype, 'Array.prototype yields itself'); + t.equal(callBound('%Array.prototype%'), Array.prototype, '%Array.prototype% yields itself'); + t.equal(callBound('Array.constructor'), Array.constructor, 'Array.constructor yields itself'); + t.equal(callBound('%Array.constructor%'), Array.constructor, '%Array.constructor% yields itself'); + + // static function + t.equal(callBound('Date.parse'), Date.parse, 'Date.parse yields itself'); + t.equal(callBound('%Date.parse%'), Date.parse, '%Date.parse% yields itself'); + + // prototype primitive + t.equal(callBound('Error.prototype.message'), Error.prototype.message, 'Error.prototype.message yields itself'); + t.equal(callBound('%Error.prototype.message%'), Error.prototype.message, '%Error.prototype.message% yields itself'); + + // prototype function + t.notEqual(callBound('Object.prototype.toString'), Object.prototype.toString, 'Object.prototype.toString does not yield itself'); + t.notEqual(callBound('%Object.prototype.toString%'), Object.prototype.toString, '%Object.prototype.toString% does not yield itself'); + t.equal(callBound('Object.prototype.toString')(true), Object.prototype.toString.call(true), 'call-bound Object.prototype.toString calls into the original'); + t.equal(callBound('%Object.prototype.toString%')(true), Object.prototype.toString.call(true), 'call-bound %Object.prototype.toString% calls into the original'); + + t['throws']( + function () { callBound('does not exist'); }, + SyntaxError, + 'nonexistent intrinsic throws' + ); + t['throws']( + function () { callBound('does not exist', true); }, + SyntaxError, + 'allowMissing arg still throws for unknown intrinsic' + ); + + /* globals WeakRef: false */ + t.test('real but absent intrinsic', { skip: typeof WeakRef !== 'undefined' }, function (st) { + st['throws']( + function () { callBound('WeakRef'); }, + TypeError, + 'real but absent intrinsic throws' + ); + st.equal(callBound('WeakRef', true), undefined, 'allowMissing arg avoids exception'); + st.end(); + }); + + t.end(); +}); diff --git a/packages/字体精简工具/node_modules/call-bind/test/index.js b/packages/字体精简工具/node_modules/call-bind/test/index.js new file mode 100644 index 0000000..bf6769c --- /dev/null +++ b/packages/字体精简工具/node_modules/call-bind/test/index.js @@ -0,0 +1,66 @@ +'use strict'; + +var callBind = require('../'); +var bind = require('function-bind'); + +var test = require('tape'); + +/* + * older engines have length nonconfigurable + * in io.js v3, it is configurable except on bound functions, hence the .bind() + */ +var functionsHaveConfigurableLengths = !!( + Object.getOwnPropertyDescriptor + && Object.getOwnPropertyDescriptor(bind.call(function () {}), 'length').configurable +); + +test('callBind', function (t) { + var sentinel = { sentinel: true }; + var func = function (a, b) { + // eslint-disable-next-line no-invalid-this + return [this, a, b]; + }; + t.equal(func.length, 2, 'original function length is 2'); + t.deepEqual(func(), [undefined, undefined, undefined], 'unbound func with too few args'); + t.deepEqual(func(1, 2), [undefined, 1, 2], 'unbound func with right args'); + t.deepEqual(func(1, 2, 3), [undefined, 1, 2], 'unbound func with too many args'); + + var bound = callBind(func); + t.equal(bound.length, func.length + 1, 'function length is preserved', { skip: !functionsHaveConfigurableLengths }); + t.deepEqual(bound(), [undefined, undefined, undefined], 'bound func with too few args'); + t.deepEqual(bound(1, 2), [1, 2, undefined], 'bound func with right args'); + t.deepEqual(bound(1, 2, 3), [1, 2, 3], 'bound func with too many args'); + + var boundR = callBind(func, sentinel); + t.equal(boundR.length, func.length, 'function length is preserved', { skip: !functionsHaveConfigurableLengths }); + t.deepEqual(boundR(), [sentinel, undefined, undefined], 'bound func with receiver, with too few args'); + t.deepEqual(boundR(1, 2), [sentinel, 1, 2], 'bound func with receiver, with right args'); + t.deepEqual(boundR(1, 2, 3), [sentinel, 1, 2], 'bound func with receiver, with too many args'); + + var boundArg = callBind(func, sentinel, 1); + t.equal(boundArg.length, func.length - 1, 'function length is preserved', { skip: !functionsHaveConfigurableLengths }); + t.deepEqual(boundArg(), [sentinel, 1, undefined], 'bound func with receiver and arg, with too few args'); + t.deepEqual(boundArg(2), [sentinel, 1, 2], 'bound func with receiver and arg, with right arg'); + t.deepEqual(boundArg(2, 3), [sentinel, 1, 2], 'bound func with receiver and arg, with too many args'); + + t.test('callBind.apply', function (st) { + var aBound = callBind.apply(func); + st.deepEqual(aBound(sentinel), [sentinel, undefined, undefined], 'apply-bound func with no args'); + st.deepEqual(aBound(sentinel, [1], 4), [sentinel, 1, undefined], 'apply-bound func with too few args'); + st.deepEqual(aBound(sentinel, [1, 2], 4), [sentinel, 1, 2], 'apply-bound func with right args'); + + var aBoundArg = callBind.apply(func); + st.deepEqual(aBoundArg(sentinel, [1, 2, 3], 4), [sentinel, 1, 2], 'apply-bound func with too many args'); + st.deepEqual(aBoundArg(sentinel, [1, 2], 4), [sentinel, 1, 2], 'apply-bound func with right args'); + st.deepEqual(aBoundArg(sentinel, [1], 4), [sentinel, 1, undefined], 'apply-bound func with too few args'); + + var aBoundR = callBind.apply(func, sentinel); + st.deepEqual(aBoundR([1, 2, 3], 4), [sentinel, 1, 2], 'apply-bound func with receiver and too many args'); + st.deepEqual(aBoundR([1, 2], 4), [sentinel, 1, 2], 'apply-bound func with receiver and right args'); + st.deepEqual(aBoundR([1], 4), [sentinel, 1, undefined], 'apply-bound func with receiver and too few args'); + + st.end(); + }); + + t.end(); +}); diff --git a/packages/字体精简工具/node_modules/camelcase-keys/index.js b/packages/字体精简工具/node_modules/camelcase-keys/index.js new file mode 100644 index 0000000..0eca08c --- /dev/null +++ b/packages/字体精简工具/node_modules/camelcase-keys/index.js @@ -0,0 +1,12 @@ +'use strict'; +var mapObj = require('map-obj'); +var camelCase = require('camelcase'); + +module.exports = function (input, options) { + options = options || {}; + var exclude = options.exclude || []; + return mapObj(input, function (key, val) { + key = exclude.indexOf(key) === -1 ? camelCase(key) : key; + return [key, val]; + }); +}; diff --git a/packages/字体精简工具/node_modules/camelcase-keys/license b/packages/字体精简工具/node_modules/camelcase-keys/license new file mode 100644 index 0000000..654d0bf --- /dev/null +++ b/packages/字体精简工具/node_modules/camelcase-keys/license @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (c) Sindre Sorhus (sindresorhus.com) + +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/packages/字体精简工具/node_modules/camelcase-keys/package.json b/packages/字体精简工具/node_modules/camelcase-keys/package.json new file mode 100644 index 0000000..80a673a --- /dev/null +++ b/packages/字体精简工具/node_modules/camelcase-keys/package.json @@ -0,0 +1,84 @@ +{ + "_from": "camelcase-keys@^2.0.0", + "_id": "camelcase-keys@2.1.0", + "_inBundle": false, + "_integrity": "sha1-MIvur/3ygRkFHvodkyITyRuPkuc=", + "_location": "/camelcase-keys", + "_phantomChildren": {}, + "_requested": { + "type": "range", + "registry": true, + "raw": "camelcase-keys@^2.0.0", + "name": "camelcase-keys", + "escapedName": "camelcase-keys", + "rawSpec": "^2.0.0", + "saveSpec": null, + "fetchSpec": "^2.0.0" + }, + "_requiredBy": [ + "/meow" + ], + "_resolved": "https://registry.nlark.com/camelcase-keys/download/camelcase-keys-2.1.0.tgz", + "_shasum": "308beeaffdf28119051efa1d932213c91b8f92e7", + "_spec": "camelcase-keys@^2.0.0", + "_where": "D:\\workspace\\plugin\\mini_font\\packages\\mini_font\\publish\\mini_font\\node_modules\\meow", + "author": { + "name": "Sindre Sorhus", + "email": "sindresorhus@gmail.com", + "url": "http://sindresorhus.com" + }, + "bugs": { + "url": "https://github.com/sindresorhus/camelcase-keys/issues" + }, + "bundleDependencies": false, + "dependencies": { + "camelcase": "^2.0.0", + "map-obj": "^1.0.0" + }, + "deprecated": false, + "description": "Convert object keys to camelCase", + "devDependencies": { + "ava": "*", + "xo": "*" + }, + "engines": { + "node": ">=0.10.0" + }, + "files": [ + "index.js" + ], + "homepage": "https://github.com/sindresorhus/camelcase-keys#readme", + "keywords": [ + "map", + "obj", + "object", + "key", + "keys", + "value", + "values", + "val", + "iterate", + "camelcase", + "camel-case", + "camel", + "case", + "dash", + "hyphen", + "dot", + "underscore", + "separator", + "string", + "text", + "convert" + ], + "license": "MIT", + "name": "camelcase-keys", + "repository": { + "type": "git", + "url": "git+https://github.com/sindresorhus/camelcase-keys.git" + }, + "scripts": { + "test": "xo && ava" + }, + "version": "2.1.0" +} diff --git a/packages/字体精简工具/node_modules/camelcase-keys/readme.md b/packages/字体精简工具/node_modules/camelcase-keys/readme.md new file mode 100644 index 0000000..ca37328 --- /dev/null +++ b/packages/字体精简工具/node_modules/camelcase-keys/readme.md @@ -0,0 +1,54 @@ +# camelcase-keys [![Build Status](https://travis-ci.org/sindresorhus/camelcase-keys.svg?branch=master)](https://travis-ci.org/sindresorhus/camelcase-keys) + +> Convert object keys to camelCase using [`camelcase`](https://github.com/sindresorhus/camelcase) + + +## Install + +``` +$ npm install --save camelcase-keys +``` + + +## Usage + +```js +const camelcaseKeys = require('camelcase-keys'); + +camelcaseKeys({'foo-bar': true}); +//=> {fooBar: true} + + +const argv = require('minimist')(process.argv.slice(2)); +//=> {_: [], 'foo-bar': true} + +camelcaseKeys(argv); +//=> {_: [], fooBar: true} +``` + + +## API + +### camelcaseKeys(input, [options]) + +#### input + +Type: `object` + +Object to camelCase. + +#### options + +Type: `object` + +##### exclude + +Type: `array` +Default: `[]` + +Exclude keys from being camelCased. + + +## License + +MIT © [Sindre Sorhus](http://sindresorhus.com) diff --git a/packages/字体精简工具/node_modules/camelcase/index.js b/packages/字体精简工具/node_modules/camelcase/index.js new file mode 100644 index 0000000..929facb --- /dev/null +++ b/packages/字体精简工具/node_modules/camelcase/index.js @@ -0,0 +1,56 @@ +'use strict'; + +function preserveCamelCase(str) { + var isLastCharLower = false; + + for (var i = 0; i < str.length; i++) { + var c = str.charAt(i); + + if (isLastCharLower && (/[a-zA-Z]/).test(c) && c.toUpperCase() === c) { + str = str.substr(0, i) + '-' + str.substr(i); + isLastCharLower = false; + i++; + } else { + isLastCharLower = (c.toLowerCase() === c); + } + } + + return str; +} + +module.exports = function () { + var str = [].map.call(arguments, function (str) { + return str.trim(); + }).filter(function (str) { + return str.length; + }).join('-'); + + if (!str.length) { + return ''; + } + + if (str.length === 1) { + return str; + } + + if (!(/[_.\- ]+/).test(str)) { + if (str === str.toUpperCase()) { + return str.toLowerCase(); + } + + if (str[0] !== str[0].toLowerCase()) { + return str[0].toLowerCase() + str.slice(1); + } + + return str; + } + + str = preserveCamelCase(str); + + return str + .replace(/^[_.\- ]+/, '') + .toLowerCase() + .replace(/[_.\- ]+(\w|$)/g, function (m, p1) { + return p1.toUpperCase(); + }); +}; diff --git a/packages/字体精简工具/node_modules/camelcase/license b/packages/字体精简工具/node_modules/camelcase/license new file mode 100644 index 0000000..654d0bf --- /dev/null +++ b/packages/字体精简工具/node_modules/camelcase/license @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (c) Sindre Sorhus (sindresorhus.com) + +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/packages/字体精简工具/node_modules/camelcase/package.json b/packages/字体精简工具/node_modules/camelcase/package.json new file mode 100644 index 0000000..b677eda --- /dev/null +++ b/packages/字体精简工具/node_modules/camelcase/package.json @@ -0,0 +1,71 @@ +{ + "_from": "camelcase@^2.0.0", + "_id": "camelcase@2.1.1", + "_inBundle": false, + "_integrity": "sha1-fB0W1nmhu+WcoCys7PsBHiAfWh8=", + "_location": "/camelcase", + "_phantomChildren": {}, + "_requested": { + "type": "range", + "registry": true, + "raw": "camelcase@^2.0.0", + "name": "camelcase", + "escapedName": "camelcase", + "rawSpec": "^2.0.0", + "saveSpec": null, + "fetchSpec": "^2.0.0" + }, + "_requiredBy": [ + "/camelcase-keys" + ], + "_resolved": "https://registry.nlark.com/camelcase/download/camelcase-2.1.1.tgz", + "_shasum": "7c1d16d679a1bbe59ca02cacecfb011e201f5a1f", + "_spec": "camelcase@^2.0.0", + "_where": "D:\\workspace\\plugin\\mini_font\\packages\\mini_font\\publish\\mini_font\\node_modules\\camelcase-keys", + "author": { + "name": "Sindre Sorhus", + "email": "sindresorhus@gmail.com", + "url": "http://sindresorhus.com" + }, + "bugs": { + "url": "https://github.com/sindresorhus/camelcase/issues" + }, + "bundleDependencies": false, + "deprecated": false, + "description": "Convert a dash/dot/underscore/space separated string to camelCase: foo-bar → fooBar", + "devDependencies": { + "ava": "*", + "xo": "*" + }, + "engines": { + "node": ">=0.10.0" + }, + "files": [ + "index.js" + ], + "homepage": "https://github.com/sindresorhus/camelcase#readme", + "keywords": [ + "camelcase", + "camel-case", + "camel", + "case", + "dash", + "hyphen", + "dot", + "underscore", + "separator", + "string", + "text", + "convert" + ], + "license": "MIT", + "name": "camelcase", + "repository": { + "type": "git", + "url": "git+https://github.com/sindresorhus/camelcase.git" + }, + "scripts": { + "test": "xo && ava" + }, + "version": "2.1.1" +} diff --git a/packages/字体精简工具/node_modules/camelcase/readme.md b/packages/字体精简工具/node_modules/camelcase/readme.md new file mode 100644 index 0000000..080b2a1 --- /dev/null +++ b/packages/字体精简工具/node_modules/camelcase/readme.md @@ -0,0 +1,57 @@ +# camelcase [![Build Status](https://travis-ci.org/sindresorhus/camelcase.svg?branch=master)](https://travis-ci.org/sindresorhus/camelcase) + +> Convert a dash/dot/underscore/space separated string to camelCase: `foo-bar` → `fooBar` + + +## Install + +``` +$ npm install --save camelcase +``` + + +## Usage + +```js +const camelCase = require('camelcase'); + +camelCase('foo-bar'); +//=> 'fooBar' + +camelCase('foo_bar'); +//=> 'fooBar' + +camelCase('Foo-Bar'); +//=> 'fooBar' + +camelCase('--foo.bar'); +//=> 'fooBar' + +camelCase('__foo__bar__'); +//=> 'fooBar' + +camelCase('foo bar'); +//=> 'fooBar' + +console.log(process.argv[3]); +//=> '--foo-bar' +camelCase(process.argv[3]); +//=> 'fooBar' + +camelCase('foo', 'bar'); +//=> 'fooBar' + +camelCase('__foo__', '--bar'); +//=> 'fooBar' +``` + + +## Related + +- [decamelize](https://github.com/sindresorhus/decamelize) - The inverse of this module +- [uppercamelcase](https://github.com/SamVerschueren/uppercamelcase) - Like this module, but to PascalCase instead of camelCase + + +## License + +MIT © [Sindre Sorhus](http://sindresorhus.com) diff --git a/packages/字体精简工具/node_modules/caseless/LICENSE b/packages/字体精简工具/node_modules/caseless/LICENSE new file mode 100644 index 0000000..61789f4 --- /dev/null +++ b/packages/字体精简工具/node_modules/caseless/LICENSE @@ -0,0 +1,28 @@ +Apache License +Version 2.0, January 2004 +http://www.apache.org/licenses/ +TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION +1. Definitions. +"License" shall mean the terms and conditions for use, reproduction, and distribution as defined by Sections 1 through 9 of this document. +"Licensor" shall mean the copyright owner or entity authorized by the copyright owner that is granting the License. +"Legal Entity" shall mean the union of the acting entity and all other entities that control, are controlled by, or are under common control with that entity. For the purposes of this definition, "control" means (i) the power, direct or indirect, to cause the direction or management of such entity, whether by contract or otherwise, or (ii) ownership of fifty percent (50%) or more of the outstanding shares, or (iii) beneficial ownership of such entity. +"You" (or "Your") shall mean an individual or Legal Entity exercising permissions granted by this License. +"Source" form shall mean the preferred form for making modifications, including but not limited to software source code, documentation source, and configuration files. +"Object" form shall mean any form resulting from mechanical transformation or translation of a Source form, including but not limited to compiled object code, generated documentation, and conversions to other media types. +"Work" shall mean the work of authorship, whether in Source or Object form, made available under the License, as indicated by a copyright notice that is included in or attached to the work (an example is provided in the Appendix below). +"Derivative Works" shall mean any work, whether in Source or Object form, that is based on (or derived from) the Work and for which the editorial revisions, annotations, elaborations, or other modifications represent, as a whole, an original work of authorship. For the purposes of this License, Derivative Works shall not include works that remain separable from, or merely link (or bind by name) to the interfaces of, the Work and Derivative Works thereof. +"Contribution" shall mean any work of authorship, including the original version of the Work and any modifications or additions to that Work or Derivative Works thereof, that is intentionally submitted to Licensor for inclusion in the Work by the copyright owner or by an individual or Legal Entity authorized to submit on behalf of the copyright owner. For the purposes of this definition, "submitted" means any form of electronic, verbal, or written communication sent to the Licensor or its representatives, including but not limited to communication on electronic mailing lists, source code control systems, and issue tracking systems that are managed by, or on behalf of, the Licensor for the purpose of discussing and improving the Work, but excluding communication that is conspicuously marked or otherwise designated in writing by the copyright owner as "Not a Contribution." +"Contributor" shall mean Licensor and any individual or Legal Entity on behalf of whom a Contribution has been received by Licensor and subsequently incorporated within the Work. +2. Grant of Copyright License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable copyright license to reproduce, prepare Derivative Works of, publicly display, publicly perform, sublicense, and distribute the Work and such Derivative Works in Source or Object form. +3. Grant of Patent License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable (except as stated in this section) patent license to make, have made, use, offer to sell, sell, import, and otherwise transfer the Work, where such license applies only to those patent claims licensable by such Contributor that are necessarily infringed by their Contribution(s) alone or by combination of their Contribution(s) with the Work to which such Contribution(s) was submitted. If You institute patent litigation against any entity (including a cross-claim or counterclaim in a lawsuit) alleging that the Work or a Contribution incorporated within the Work constitutes direct or contributory patent infringement, then any patent licenses granted to You under this License for that Work shall terminate as of the date such litigation is filed. +4. Redistribution. You may reproduce and distribute copies of the Work or Derivative Works thereof in any medium, with or without modifications, and in Source or Object form, provided that You meet the following conditions: +You must give any other recipients of the Work or Derivative Works a copy of this License; and +You must cause any modified files to carry prominent notices stating that You changed the files; and +You must retain, in the Source form of any Derivative Works that You distribute, all copyright, patent, trademark, and attribution notices from the Source form of the Work, excluding those notices that do not pertain to any part of the Derivative Works; and +If the Work includes a "NOTICE" text file as part of its distribution, then any Derivative Works that You distribute must include a readable copy of the attribution notices contained within such NOTICE file, excluding those notices that do not pertain to any part of the Derivative Works, in at least one of the following places: within a NOTICE text file distributed as part of the Derivative Works; within the Source form or documentation, if provided along with the Derivative Works; or, within a display generated by the Derivative Works, if and wherever such third-party notices normally appear. The contents of the NOTICE file are for informational purposes only and do not modify the License. You may add Your own attribution notices within Derivative Works that You distribute, alongside or as an addendum to the NOTICE text from the Work, provided that such additional attribution notices cannot be construed as modifying the License. You may add Your own copyright statement to Your modifications and may provide additional or different license terms and conditions for use, reproduction, or distribution of Your modifications, or for any such Derivative Works as a whole, provided Your use, reproduction, and distribution of the Work otherwise complies with the conditions stated in this License. +5. Submission of Contributions. Unless You explicitly state otherwise, any Contribution intentionally submitted for inclusion in the Work by You to the Licensor shall be under the terms and conditions of this License, without any additional terms or conditions. Notwithstanding the above, nothing herein shall supersede or modify the terms of any separate license agreement you may have executed with Licensor regarding such Contributions. +6. Trademarks. This License does not grant permission to use the trade names, trademarks, service marks, or product names of the Licensor, except as required for reasonable and customary use in describing the origin of the Work and reproducing the content of the NOTICE file. +7. Disclaimer of Warranty. Unless required by applicable law or agreed to in writing, Licensor provides the Work (and each Contributor provides its Contributions) on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied, including, without limitation, any warranties or conditions of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A PARTICULAR PURPOSE. You are solely responsible for determining the appropriateness of using or redistributing the Work and assume any risks associated with Your exercise of permissions under this License. +8. Limitation of Liability. In no event and under no legal theory, whether in tort (including negligence), contract, or otherwise, unless required by applicable law (such as deliberate and grossly negligent acts) or agreed to in writing, shall any Contributor be liable to You for damages, including any direct, indirect, special, incidental, or consequential damages of any character arising as a result of this License or out of the use or inability to use the Work (including but not limited to damages for loss of goodwill, work stoppage, computer failure or malfunction, or any and all other commercial damages or losses), even if such Contributor has been advised of the possibility of such damages. +9. Accepting Warranty or Additional Liability. While redistributing the Work or Derivative Works thereof, You may choose to offer, and charge a fee for, acceptance of support, warranty, indemnity, or other liability obligations and/or rights consistent with this License. However, in accepting such obligations, You may act only on Your own behalf and on Your sole responsibility, not on behalf of any other Contributor, and only if You agree to indemnify, defend, and hold each Contributor harmless for any liability incurred by, or claims asserted against, such Contributor by reason of your accepting any such warranty or additional liability. +END OF TERMS AND CONDITIONS \ No newline at end of file diff --git a/packages/字体精简工具/node_modules/caseless/README.md b/packages/字体精简工具/node_modules/caseless/README.md new file mode 100644 index 0000000..e5077a2 --- /dev/null +++ b/packages/字体精简工具/node_modules/caseless/README.md @@ -0,0 +1,45 @@ +## Caseless -- wrap an object to set and get property with caseless semantics but also preserve caseing. + +This library is incredibly useful when working with HTTP headers. It allows you to get/set/check for headers in a caseless manner while also preserving the caseing of headers the first time they are set. + +## Usage + +```javascript +var headers = {} + , c = caseless(headers) + ; +c.set('a-Header', 'asdf') +c.get('a-header') === 'asdf' +``` + +## has(key) + +Has takes a name and if it finds a matching header will return that header name with the preserved caseing it was set with. + +```javascript +c.has('a-header') === 'a-Header' +``` + +## set(key, value[, clobber=true]) + +Set is fairly straight forward except that if the header exists and clobber is disabled it will add `','+value` to the existing header. + +```javascript +c.set('a-Header', 'fdas') +c.set('a-HEADER', 'more', false) +c.get('a-header') === 'fdsa,more' +``` + +## swap(key) + +Swaps the casing of a header with the new one that is passed in. + +```javascript +var headers = {} + , c = caseless(headers) + ; +c.set('a-Header', 'fdas') +c.swap('a-HEADER') +c.has('a-header') === 'a-HEADER' +headers === {'a-HEADER': 'fdas'} +``` diff --git a/packages/字体精简工具/node_modules/caseless/index.js b/packages/字体精简工具/node_modules/caseless/index.js new file mode 100644 index 0000000..b194734 --- /dev/null +++ b/packages/字体精简工具/node_modules/caseless/index.js @@ -0,0 +1,67 @@ +function Caseless (dict) { + this.dict = dict || {} +} +Caseless.prototype.set = function (name, value, clobber) { + if (typeof name === 'object') { + for (var i in name) { + this.set(i, name[i], value) + } + } else { + if (typeof clobber === 'undefined') clobber = true + var has = this.has(name) + + if (!clobber && has) this.dict[has] = this.dict[has] + ',' + value + else this.dict[has || name] = value + return has + } +} +Caseless.prototype.has = function (name) { + var keys = Object.keys(this.dict) + , name = name.toLowerCase() + ; + for (var i=0;i { + try { + return fs[LCHOWNSYNC](path, uid, gid) + } catch (er) { + if (er.code !== 'ENOENT') + throw er + } +} + +/* istanbul ignore next */ +const chownSync = (path, uid, gid) => { + try { + return fs.chownSync(path, uid, gid) + } catch (er) { + if (er.code !== 'ENOENT') + throw er + } +} + +/* istanbul ignore next */ +const handleEISDIR = + needEISDIRHandled ? (path, uid, gid, cb) => er => { + // Node prior to v10 had a very questionable implementation of + // fs.lchown, which would always try to call fs.open on a directory + // Fall back to fs.chown in those cases. + if (!er || er.code !== 'EISDIR') + cb(er) + else + fs.chown(path, uid, gid, cb) + } + : (_, __, ___, cb) => cb + +/* istanbul ignore next */ +const handleEISDirSync = + needEISDIRHandled ? (path, uid, gid) => { + try { + return lchownSync(path, uid, gid) + } catch (er) { + if (er.code !== 'EISDIR') + throw er + chownSync(path, uid, gid) + } + } + : (path, uid, gid) => lchownSync(path, uid, gid) + +// fs.readdir could only accept an options object as of node v6 +const nodeVersion = process.version +let readdir = (path, options, cb) => fs.readdir(path, options, cb) +let readdirSync = (path, options) => fs.readdirSync(path, options) +/* istanbul ignore next */ +if (/^v4\./.test(nodeVersion)) + readdir = (path, options, cb) => fs.readdir(path, cb) + +const chown = (cpath, uid, gid, cb) => { + fs[LCHOWN](cpath, uid, gid, handleEISDIR(cpath, uid, gid, er => { + // Skip ENOENT error + cb(er && er.code !== 'ENOENT' ? er : null) + })) +} + +const chownrKid = (p, child, uid, gid, cb) => { + if (typeof child === 'string') + return fs.lstat(path.resolve(p, child), (er, stats) => { + // Skip ENOENT error + if (er) + return cb(er.code !== 'ENOENT' ? er : null) + stats.name = child + chownrKid(p, stats, uid, gid, cb) + }) + + if (child.isDirectory()) { + chownr(path.resolve(p, child.name), uid, gid, er => { + if (er) + return cb(er) + const cpath = path.resolve(p, child.name) + chown(cpath, uid, gid, cb) + }) + } else { + const cpath = path.resolve(p, child.name) + chown(cpath, uid, gid, cb) + } +} + + +const chownr = (p, uid, gid, cb) => { + readdir(p, { withFileTypes: true }, (er, children) => { + // any error other than ENOTDIR or ENOTSUP means it's not readable, + // or doesn't exist. give up. + if (er) { + if (er.code === 'ENOENT') + return cb() + else if (er.code !== 'ENOTDIR' && er.code !== 'ENOTSUP') + return cb(er) + } + if (er || !children.length) + return chown(p, uid, gid, cb) + + let len = children.length + let errState = null + const then = er => { + if (errState) + return + if (er) + return cb(errState = er) + if (-- len === 0) + return chown(p, uid, gid, cb) + } + + children.forEach(child => chownrKid(p, child, uid, gid, then)) + }) +} + +const chownrKidSync = (p, child, uid, gid) => { + if (typeof child === 'string') { + try { + const stats = fs.lstatSync(path.resolve(p, child)) + stats.name = child + child = stats + } catch (er) { + if (er.code === 'ENOENT') + return + else + throw er + } + } + + if (child.isDirectory()) + chownrSync(path.resolve(p, child.name), uid, gid) + + handleEISDirSync(path.resolve(p, child.name), uid, gid) +} + +const chownrSync = (p, uid, gid) => { + let children + try { + children = readdirSync(p, { withFileTypes: true }) + } catch (er) { + if (er.code === 'ENOENT') + return + else if (er.code === 'ENOTDIR' || er.code === 'ENOTSUP') + return handleEISDirSync(p, uid, gid) + else + throw er + } + + if (children && children.length) + children.forEach(child => chownrKidSync(p, child, uid, gid)) + + return handleEISDirSync(p, uid, gid) +} + +module.exports = chownr +chownr.sync = chownrSync diff --git a/packages/字体精简工具/node_modules/chownr/package.json b/packages/字体精简工具/node_modules/chownr/package.json new file mode 100644 index 0000000..bc5e847 --- /dev/null +++ b/packages/字体精简工具/node_modules/chownr/package.json @@ -0,0 +1,62 @@ +{ + "_from": "chownr@^1.1.1", + "_id": "chownr@1.1.4", + "_inBundle": false, + "_integrity": "sha1-b8nXtC0ypYNZYzdmbn0ICE2izGs=", + "_location": "/chownr", + "_phantomChildren": {}, + "_requested": { + "type": "range", + "registry": true, + "raw": "chownr@^1.1.1", + "name": "chownr", + "escapedName": "chownr", + "rawSpec": "^1.1.1", + "saveSpec": null, + "fetchSpec": "^1.1.1" + }, + "_requiredBy": [ + "/tar" + ], + "_resolved": "https://registry.npm.taobao.org/chownr/download/chownr-1.1.4.tgz", + "_shasum": "6fc9d7b42d32a583596337666e7d08084da2cc6b", + "_spec": "chownr@^1.1.1", + "_where": "D:\\workspace\\plugin\\mini_font\\packages\\mini_font\\publish\\mini_font\\node_modules\\tar", + "author": { + "name": "Isaac Z. Schlueter", + "email": "i@izs.me", + "url": "http://blog.izs.me/" + }, + "bugs": { + "url": "https://github.com/isaacs/chownr/issues" + }, + "bundleDependencies": false, + "deprecated": false, + "description": "like `chown -R`", + "devDependencies": { + "mkdirp": "0.3", + "rimraf": "^2.7.1", + "tap": "^14.10.6" + }, + "files": [ + "chownr.js" + ], + "homepage": "https://github.com/isaacs/chownr#readme", + "license": "ISC", + "main": "chownr.js", + "name": "chownr", + "repository": { + "type": "git", + "url": "git://github.com/isaacs/chownr.git" + }, + "scripts": { + "postversion": "npm publish", + "prepublishOnly": "git push origin --follow-tags", + "preversion": "npm test", + "test": "tap" + }, + "tap": { + "check-coverage": true + }, + "version": "1.1.4" +} diff --git a/packages/字体精简工具/node_modules/clone-buffer/LICENSE b/packages/字体精简工具/node_modules/clone-buffer/LICENSE new file mode 100644 index 0000000..fa16a89 --- /dev/null +++ b/packages/字体精简工具/node_modules/clone-buffer/LICENSE @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (c) 2016 Blaine Bublitz , Eric Schoffstall and other contributors + +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/packages/字体精简工具/node_modules/clone-buffer/README.md b/packages/字体精简工具/node_modules/clone-buffer/README.md new file mode 100644 index 0000000..51c8a8d --- /dev/null +++ b/packages/字体精简工具/node_modules/clone-buffer/README.md @@ -0,0 +1,47 @@ +

+ + + +

+ +# clone-buffer + +[![NPM version][npm-image]][npm-url] [![Downloads][downloads-image]][npm-url] [![Build Status][travis-image]][travis-url] [![AppVeyor Build Status][appveyor-image]][appveyor-url] [![Coveralls Status][coveralls-image]][coveralls-url] [![Gitter chat][gitter-image]][gitter-url] + +Easier Buffer cloning in node. + +## Example + +```js +var cloneBuffer = require('clone-buffer'); + +var buffer = new Buffer('test'); +var cloned = cloneBuffer(buffer); +// buffer !== cloned +``` + +## API + +### `cloneBuffer(buffer)` + +Takes a `Buffer` object and returns a clone. Throws if a non-`Buffer` is passed. + +## License + +MIT + +[downloads-image]: http://img.shields.io/npm/dm/clone-buffer.svg +[npm-url]: https://npmjs.org/package/clone-buffer +[npm-image]: http://img.shields.io/npm/v/clone-buffer.svg + +[travis-url]: https://travis-ci.org/gulpjs/clone-buffer +[travis-image]: http://img.shields.io/travis/gulpjs/clone-buffer.svg?label=travis-ci + +[appveyor-url]: https://ci.appveyor.com/project/gulpjs/clone-buffer +[appveyor-image]: https://img.shields.io/appveyor/ci/gulpjs/clone-buffer.svg?label=appveyor + +[coveralls-url]: https://coveralls.io/r/gulpjs/clone-buffer +[coveralls-image]: http://img.shields.io/coveralls/gulpjs/clone-buffer/master.svg + +[gitter-url]: https://gitter.im/gulpjs/gulp +[gitter-image]: https://badges.gitter.im/gulpjs/gulp.png diff --git a/packages/字体精简工具/node_modules/clone-buffer/index.js b/packages/字体精简工具/node_modules/clone-buffer/index.js new file mode 100644 index 0000000..eb3837e --- /dev/null +++ b/packages/字体精简工具/node_modules/clone-buffer/index.js @@ -0,0 +1,28 @@ +'use strict'; + +var Buffer = require('buffer').Buffer; + +function hasFrom() { + // Node versions 5.x below 5.10 seem to have a `from` method + // However, it doesn't clone Buffers + // Luckily, it reports as `false` to hasOwnProperty + return (Buffer.hasOwnProperty('from') && typeof Buffer.from === 'function'); +} + +function cloneBuffer(buf) { + if (!Buffer.isBuffer(buf)) { + throw new Error('Can only clone Buffer.'); + } + + if (hasFrom()) { + return Buffer.from(buf); + } + + var copy = new Buffer(buf.length); + buf.copy(copy); + return copy; +} + +cloneBuffer.hasFrom = hasFrom; + +module.exports = cloneBuffer; diff --git a/packages/字体精简工具/node_modules/clone-buffer/package.json b/packages/字体精简工具/node_modules/clone-buffer/package.json new file mode 100644 index 0000000..bae1b4b --- /dev/null +++ b/packages/字体精简工具/node_modules/clone-buffer/package.json @@ -0,0 +1,84 @@ +{ + "_from": "clone-buffer@^1.0.0", + "_id": "clone-buffer@1.0.0", + "_inBundle": false, + "_integrity": "sha1-4+JbIHrE5wGvch4staFnksrD3Fg=", + "_location": "/clone-buffer", + "_phantomChildren": {}, + "_requested": { + "type": "range", + "registry": true, + "raw": "clone-buffer@^1.0.0", + "name": "clone-buffer", + "escapedName": "clone-buffer", + "rawSpec": "^1.0.0", + "saveSpec": null, + "fetchSpec": "^1.0.0" + }, + "_requiredBy": [ + "/gulp-clean/vinyl", + "/vinyl-fs/vinyl", + "/vinyl-sourcemap/vinyl" + ], + "_resolved": "https://registry.npm.taobao.org/clone-buffer/download/clone-buffer-1.0.0.tgz", + "_shasum": "e3e25b207ac4e701af721e2cb5a16792cac3dc58", + "_spec": "clone-buffer@^1.0.0", + "_where": "D:\\workspace\\plugin\\mini_font\\packages\\mini_font\\publish\\mini_font\\node_modules\\vinyl-fs\\node_modules\\vinyl", + "author": { + "name": "Gulp Team", + "email": "team@gulpjs.com", + "url": "http://gulpjs.com/" + }, + "bugs": { + "url": "https://github.com/gulpjs/clone-buffer/issues" + }, + "bundleDependencies": false, + "contributors": [ + { + "name": "Blaine Bublitz", + "email": "blaine.bublitz@gmail.com" + } + ], + "dependencies": {}, + "deprecated": false, + "description": "Easier Buffer cloning in node.", + "devDependencies": { + "eslint": "^1.7.3", + "eslint-config-gulp": "^2.0.0", + "expect": "^1.19.0", + "istanbul": "^0.4.3", + "istanbul-coveralls": "^1.0.3", + "jscs": "^2.3.5", + "jscs-preset-gulp": "^1.0.0", + "mocha": "^2.4.5" + }, + "engines": { + "node": ">= 0.10" + }, + "files": [ + "LICENSE", + "index.js" + ], + "homepage": "https://github.com/gulpjs/clone-buffer#readme", + "keywords": [ + "buffer", + "clone", + "from", + "copy" + ], + "license": "MIT", + "main": "index.js", + "name": "clone-buffer", + "repository": { + "type": "git", + "url": "git+https://github.com/gulpjs/clone-buffer.git" + }, + "scripts": { + "cover": "istanbul cover _mocha --report lcovonly", + "coveralls": "npm run cover && istanbul-coveralls", + "lint": "eslint . && jscs index.js test/", + "pretest": "npm run lint", + "test": "mocha --async-only" + }, + "version": "1.0.0" +} diff --git a/packages/字体精简工具/node_modules/clone-stats/LICENSE.md b/packages/字体精简工具/node_modules/clone-stats/LICENSE.md new file mode 100644 index 0000000..146cb32 --- /dev/null +++ b/packages/字体精简工具/node_modules/clone-stats/LICENSE.md @@ -0,0 +1,21 @@ +## The MIT License (MIT) ## + +Copyright (c) 2014 Hugh Kennedy + +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/packages/字体精简工具/node_modules/clone-stats/README.md b/packages/字体精简工具/node_modules/clone-stats/README.md new file mode 100644 index 0000000..8b12b6f --- /dev/null +++ b/packages/字体精简工具/node_modules/clone-stats/README.md @@ -0,0 +1,17 @@ +# clone-stats [![Flattr this!](https://api.flattr.com/button/flattr-badge-large.png)](https://flattr.com/submit/auto?user_id=hughskennedy&url=http://github.com/hughsk/clone-stats&title=clone-stats&description=hughsk/clone-stats%20on%20GitHub&language=en_GB&tags=flattr,github,javascript&category=software)[![experimental](http://hughsk.github.io/stability-badges/dist/experimental.svg)](http://github.com/hughsk/stability-badges) # + +Safely clone node's +[`fs.Stats`](http://nodejs.org/api/fs.html#fs_class_fs_stats) instances without +losing their class methods, i.e. `stat.isDirectory()` and co. + +## Usage ## + +[![clone-stats](https://nodei.co/npm/clone-stats.png?mini=true)](https://nodei.co/npm/clone-stats) + +### `copy = require('clone-stats')(stat)` ### + +Returns a clone of the original `fs.Stats` instance (`stat`). + +## License ## + +MIT. See [LICENSE.md](http://github.com/hughsk/clone-stats/blob/master/LICENSE.md) for details. diff --git a/packages/字体精简工具/node_modules/clone-stats/index.js b/packages/字体精简工具/node_modules/clone-stats/index.js new file mode 100644 index 0000000..e797cfe --- /dev/null +++ b/packages/字体精简工具/node_modules/clone-stats/index.js @@ -0,0 +1,13 @@ +var Stat = require('fs').Stats + +module.exports = cloneStats + +function cloneStats(stats) { + var replacement = new Stat + + Object.keys(stats).forEach(function(key) { + replacement[key] = stats[key] + }) + + return replacement +} diff --git a/packages/字体精简工具/node_modules/clone-stats/package.json b/packages/字体精简工具/node_modules/clone-stats/package.json new file mode 100644 index 0000000..c5f5b93 --- /dev/null +++ b/packages/字体精简工具/node_modules/clone-stats/package.json @@ -0,0 +1,60 @@ +{ + "_from": "clone-stats@^0.0.1", + "_id": "clone-stats@0.0.1", + "_inBundle": false, + "_integrity": "sha1-uI+UqCzzi4eR1YBG6kAprYjKmdE=", + "_location": "/clone-stats", + "_phantomChildren": {}, + "_requested": { + "type": "range", + "registry": true, + "raw": "clone-stats@^0.0.1", + "name": "clone-stats", + "escapedName": "clone-stats", + "rawSpec": "^0.0.1", + "saveSpec": null, + "fetchSpec": "^0.0.1" + }, + "_requiredBy": [ + "/vinyl" + ], + "_resolved": "https://registry.nlark.com/clone-stats/download/clone-stats-0.0.1.tgz", + "_shasum": "b88f94a82cf38b8791d58046ea4029ad88ca99d1", + "_spec": "clone-stats@^0.0.1", + "_where": "D:\\workspace\\plugin\\mini_font\\packages\\mini_font\\publish\\mini_font\\node_modules\\vinyl", + "author": { + "name": "Hugh Kennedy", + "email": "hughskennedy@gmail.com", + "url": "http://hughsk.io/" + }, + "browser": "index.js", + "bugs": { + "url": "https://github.com/hughsk/clone-stats/issues" + }, + "bundleDependencies": false, + "dependencies": {}, + "deprecated": false, + "description": "Safely clone node's fs.Stats instances without losing their class methods", + "devDependencies": { + "tape": "~2.3.2" + }, + "homepage": "https://github.com/hughsk/clone-stats", + "keywords": [ + "stats", + "fs", + "clone", + "copy", + "prototype" + ], + "license": "MIT", + "main": "index.js", + "name": "clone-stats", + "repository": { + "type": "git", + "url": "git://github.com/hughsk/clone-stats.git" + }, + "scripts": { + "test": "node test" + }, + "version": "0.0.1" +} diff --git a/packages/字体精简工具/node_modules/clone-stats/test.js b/packages/字体精简工具/node_modules/clone-stats/test.js new file mode 100644 index 0000000..e4bb281 --- /dev/null +++ b/packages/字体精简工具/node_modules/clone-stats/test.js @@ -0,0 +1,36 @@ +var test = require('tape') +var clone = require('./') +var fs = require('fs') + +test('file', function(t) { + compare(t, fs.statSync(__filename)) + t.end() +}) + +test('directory', function(t) { + compare(t, fs.statSync(__dirname)) + t.end() +}) + +function compare(t, stat) { + var copy = clone(stat) + + t.deepEqual(stat, copy, 'clone has equal properties') + t.ok(stat instanceof fs.Stats, 'original is an fs.Stat') + t.ok(copy instanceof fs.Stats, 'copy is an fs.Stat') + + ;['isDirectory' + , 'isFile' + , 'isBlockDevice' + , 'isCharacterDevice' + , 'isSymbolicLink' + , 'isFIFO' + , 'isSocket' + ].forEach(function(method) { + t.equal( + stat[method].call(stat) + , copy[method].call(copy) + , 'equal value for stat.' + method + '()' + ) + }) +} diff --git a/packages/字体精简工具/node_modules/clone/.npmignore b/packages/字体精简工具/node_modules/clone/.npmignore new file mode 100644 index 0000000..c797cbf --- /dev/null +++ b/packages/字体精简工具/node_modules/clone/.npmignore @@ -0,0 +1,4 @@ +/node_modules/ +/test.js +/*.html +/.travis.yml diff --git a/packages/字体精简工具/node_modules/clone/LICENSE b/packages/字体精简工具/node_modules/clone/LICENSE new file mode 100644 index 0000000..cc3c87b --- /dev/null +++ b/packages/字体精简工具/node_modules/clone/LICENSE @@ -0,0 +1,18 @@ +Copyright © 2011-2015 Paul Vorbach + +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, OUT OF OR IN CONNECTION WITH THE +SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/packages/字体精简工具/node_modules/clone/README.md b/packages/字体精简工具/node_modules/clone/README.md new file mode 100644 index 0000000..0b6ceca --- /dev/null +++ b/packages/字体精简工具/node_modules/clone/README.md @@ -0,0 +1,126 @@ +# clone + +[![build status](https://secure.travis-ci.org/pvorb/node-clone.png)](http://travis-ci.org/pvorb/node-clone) + +[![info badge](https://nodei.co/npm/clone.png?downloads=true&downloadRank=true&stars=true)](http://npm-stat.com/charts.html?package=clone) + +offers foolproof _deep cloning_ of objects, arrays, numbers, strings etc. in JavaScript. + + +## Installation + + npm install clone + +(It also works with browserify, ender or standalone.) + + +## Example + +~~~ javascript +var clone = require('clone'); + +var a, b; + +a = { foo: { bar: 'baz' } }; // initial value of a + +b = clone(a); // clone a -> b +a.foo.bar = 'foo'; // change a + +console.log(a); // show a +console.log(b); // show b +~~~ + +This will print: + +~~~ javascript +{ foo: { bar: 'foo' } } +{ foo: { bar: 'baz' } } +~~~ + +**clone** masters cloning simple objects (even with custom prototype), arrays, +Date objects, and RegExp objects. Everything is cloned recursively, so that you +can clone dates in arrays in objects, for example. + + +## API + +`clone(val, circular, depth)` + + * `val` -- the value that you want to clone, any type allowed + * `circular` -- boolean + + Call `clone` with `circular` set to `false` if you are certain that `obj` + contains no circular references. This will give better performance if needed. + There is no error if `undefined` or `null` is passed as `obj`. + * `depth` -- depth to which the object is to be cloned (optional, + defaults to infinity) + +`clone.clonePrototype(obj)` + + * `obj` -- the object that you want to clone + +Does a prototype clone as +[described by Oran Looney](http://oranlooney.com/functional-javascript/). + + +## Circular References + +~~~ javascript +var a, b; + +a = { hello: 'world' }; + +a.myself = a; +b = clone(a); + +console.log(b); +~~~ + +This will print: + +~~~ javascript +{ hello: "world", myself: [Circular] } +~~~ + +So, `b.myself` points to `b`, not `a`. Neat! + + +## Test + + npm test + + +## Caveat + +Some special objects like a socket or `process.stdout`/`stderr` are known to not +be cloneable. If you find other objects that cannot be cloned, please [open an +issue](https://github.com/pvorb/node-clone/issues/new). + + +## Bugs and Issues + +If you encounter any bugs or issues, feel free to [open an issue at +github](https://github.com/pvorb/node-clone/issues) or send me an email to +. I also always like to hear from you, if you’re using my code. + +## License + +Copyright © 2011-2015 [Paul Vorbach](http://paul.vorba.ch/) and +[contributors](https://github.com/pvorb/node-clone/graphs/contributors). + +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, OUT OF OR IN CONNECTION WITH THE +SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/packages/字体精简工具/node_modules/clone/clone.iml b/packages/字体精简工具/node_modules/clone/clone.iml new file mode 100644 index 0000000..30de8ae --- /dev/null +++ b/packages/字体精简工具/node_modules/clone/clone.iml @@ -0,0 +1,10 @@ + + + + + + + + + + \ No newline at end of file diff --git a/packages/字体精简工具/node_modules/clone/clone.js b/packages/字体精简工具/node_modules/clone/clone.js new file mode 100644 index 0000000..ba200c2 --- /dev/null +++ b/packages/字体精简工具/node_modules/clone/clone.js @@ -0,0 +1,166 @@ +var clone = (function() { +'use strict'; + +/** + * Clones (copies) an Object using deep copying. + * + * This function supports circular references by default, but if you are certain + * there are no circular references in your object, you can save some CPU time + * by calling clone(obj, false). + * + * Caution: if `circular` is false and `parent` contains circular references, + * your program may enter an infinite loop and crash. + * + * @param `parent` - the object to be cloned + * @param `circular` - set to true if the object to be cloned may contain + * circular references. (optional - true by default) + * @param `depth` - set to a number if the object is only to be cloned to + * a particular depth. (optional - defaults to Infinity) + * @param `prototype` - sets the prototype to be used when cloning an object. + * (optional - defaults to parent prototype). +*/ +function clone(parent, circular, depth, prototype) { + var filter; + if (typeof circular === 'object') { + depth = circular.depth; + prototype = circular.prototype; + filter = circular.filter; + circular = circular.circular + } + // maintain two arrays for circular references, where corresponding parents + // and children have the same index + var allParents = []; + var allChildren = []; + + var useBuffer = typeof Buffer != 'undefined'; + + if (typeof circular == 'undefined') + circular = true; + + if (typeof depth == 'undefined') + depth = Infinity; + + // recurse this function so we don't reset allParents and allChildren + function _clone(parent, depth) { + // cloning null always returns null + if (parent === null) + return null; + + if (depth == 0) + return parent; + + var child; + var proto; + if (typeof parent != 'object') { + return parent; + } + + if (clone.__isArray(parent)) { + child = []; + } else if (clone.__isRegExp(parent)) { + child = new RegExp(parent.source, __getRegExpFlags(parent)); + if (parent.lastIndex) child.lastIndex = parent.lastIndex; + } else if (clone.__isDate(parent)) { + child = new Date(parent.getTime()); + } else if (useBuffer && Buffer.isBuffer(parent)) { + if (Buffer.allocUnsafe) { + // Node.js >= 4.5.0 + child = Buffer.allocUnsafe(parent.length); + } else { + // Older Node.js versions + child = new Buffer(parent.length); + } + parent.copy(child); + return child; + } else { + if (typeof prototype == 'undefined') { + proto = Object.getPrototypeOf(parent); + child = Object.create(proto); + } + else { + child = Object.create(prototype); + proto = prototype; + } + } + + if (circular) { + var index = allParents.indexOf(parent); + + if (index != -1) { + return allChildren[index]; + } + allParents.push(parent); + allChildren.push(child); + } + + for (var i in parent) { + var attrs; + if (proto) { + attrs = Object.getOwnPropertyDescriptor(proto, i); + } + + if (attrs && attrs.set == null) { + continue; + } + child[i] = _clone(parent[i], depth - 1); + } + + return child; + } + + return _clone(parent, depth); +} + +/** + * Simple flat clone using prototype, accepts only objects, usefull for property + * override on FLAT configuration object (no nested props). + * + * USE WITH CAUTION! This may not behave as you wish if you do not know how this + * works. + */ +clone.clonePrototype = function clonePrototype(parent) { + if (parent === null) + return null; + + var c = function () {}; + c.prototype = parent; + return new c(); +}; + +// private utility functions + +function __objToStr(o) { + return Object.prototype.toString.call(o); +}; +clone.__objToStr = __objToStr; + +function __isDate(o) { + return typeof o === 'object' && __objToStr(o) === '[object Date]'; +}; +clone.__isDate = __isDate; + +function __isArray(o) { + return typeof o === 'object' && __objToStr(o) === '[object Array]'; +}; +clone.__isArray = __isArray; + +function __isRegExp(o) { + return typeof o === 'object' && __objToStr(o) === '[object RegExp]'; +}; +clone.__isRegExp = __isRegExp; + +function __getRegExpFlags(re) { + var flags = ''; + if (re.global) flags += 'g'; + if (re.ignoreCase) flags += 'i'; + if (re.multiline) flags += 'm'; + return flags; +}; +clone.__getRegExpFlags = __getRegExpFlags; + +return clone; +})(); + +if (typeof module === 'object' && module.exports) { + module.exports = clone; +} diff --git a/packages/字体精简工具/node_modules/clone/package.json b/packages/字体精简工具/node_modules/clone/package.json new file mode 100644 index 0000000..f3f1543 --- /dev/null +++ b/packages/字体精简工具/node_modules/clone/package.json @@ -0,0 +1,137 @@ +{ + "_from": "clone@^1.0.0", + "_id": "clone@1.0.4", + "_inBundle": false, + "_integrity": "sha1-2jCcwmPfFZlMaIypAheco8fNfH4=", + "_location": "/clone", + "_phantomChildren": {}, + "_requested": { + "type": "range", + "registry": true, + "raw": "clone@^1.0.0", + "name": "clone", + "escapedName": "clone", + "rawSpec": "^1.0.0", + "saveSpec": null, + "fetchSpec": "^1.0.0" + }, + "_requiredBy": [ + "/vinyl" + ], + "_resolved": "https://registry.nlark.com/clone/download/clone-1.0.4.tgz", + "_shasum": "da309cc263df15994c688ca902179ca3c7cd7c7e", + "_spec": "clone@^1.0.0", + "_where": "D:\\workspace\\plugin\\mini_font\\packages\\mini_font\\publish\\mini_font\\node_modules\\vinyl", + "author": { + "name": "Paul Vorbach", + "email": "paul@vorba.ch", + "url": "http://paul.vorba.ch/" + }, + "bugs": { + "url": "https://github.com/pvorb/node-clone/issues" + }, + "bundleDependencies": false, + "contributors": [ + { + "name": "Blake Miner", + "email": "miner.blake@gmail.com", + "url": "http://www.blakeminer.com/" + }, + { + "name": "Tian You", + "email": "axqd001@gmail.com", + "url": "http://blog.axqd.net/" + }, + { + "name": "George Stagas", + "email": "gstagas@gmail.com", + "url": "http://stagas.com/" + }, + { + "name": "Tobiasz Cudnik", + "email": "tobiasz.cudnik@gmail.com", + "url": "https://github.com/TobiaszCudnik" + }, + { + "name": "Pavel Lang", + "email": "langpavel@phpskelet.org", + "url": "https://github.com/langpavel" + }, + { + "name": "Dan MacTough", + "url": "http://yabfog.com/" + }, + { + "name": "w1nk", + "url": "https://github.com/w1nk" + }, + { + "name": "Hugh Kennedy", + "url": "http://twitter.com/hughskennedy" + }, + { + "name": "Dustin Diaz", + "url": "http://dustindiaz.com" + }, + { + "name": "Ilya Shaisultanov", + "url": "https://github.com/diversario" + }, + { + "name": "Nathan MacInnes", + "email": "nathan@macinn.es", + "url": "http://macinn.es/" + }, + { + "name": "Benjamin E. Coe", + "email": "ben@npmjs.com", + "url": "https://twitter.com/benjamincoe" + }, + { + "name": "Nathan Zadoks", + "url": "https://github.com/nathan7" + }, + { + "name": "Róbert Oroszi", + "email": "robert+gh@oroszi.net", + "url": "https://github.com/oroce" + }, + { + "name": "Aurélio A. Heckert", + "url": "http://softwarelivre.org/aurium" + }, + { + "name": "Guy Ellis", + "url": "http://www.guyellisrocks.com/" + } + ], + "dependencies": {}, + "deprecated": false, + "description": "deep cloning of objects and arrays", + "devDependencies": { + "nodeunit": "~0.9.0" + }, + "engines": { + "node": ">=0.8" + }, + "homepage": "https://github.com/pvorb/node-clone#readme", + "license": "MIT", + "main": "clone.js", + "name": "clone", + "optionalDependencies": {}, + "repository": { + "type": "git", + "url": "git://github.com/pvorb/node-clone.git" + }, + "scripts": { + "test": "nodeunit test.js" + }, + "tags": [ + "clone", + "object", + "array", + "function", + "date" + ], + "version": "1.0.4" +} diff --git a/packages/字体精简工具/node_modules/cloneable-readable/.travis.yml b/packages/字体精简工具/node_modules/cloneable-readable/.travis.yml new file mode 100644 index 0000000..c352b0e --- /dev/null +++ b/packages/字体精简工具/node_modules/cloneable-readable/.travis.yml @@ -0,0 +1,13 @@ +language: node_js +sudo: false +node_js: + - "0.10" + - "0.12" + - "4" + - "5" + - "6" + - "7" + - "8" + - "9" + - "10" + - "12" diff --git a/packages/字体精简工具/node_modules/cloneable-readable/LICENSE b/packages/字体精简工具/node_modules/cloneable-readable/LICENSE new file mode 100644 index 0000000..ecf6245 --- /dev/null +++ b/packages/字体精简工具/node_modules/cloneable-readable/LICENSE @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (c) 2016 Matteo Collina + +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/packages/字体精简工具/node_modules/cloneable-readable/README.md b/packages/字体精简工具/node_modules/cloneable-readable/README.md new file mode 100644 index 0000000..17b25a2 --- /dev/null +++ b/packages/字体精简工具/node_modules/cloneable-readable/README.md @@ -0,0 +1,54 @@ +# cloneable-readable + +[![Greenkeeper badge](https://badges.greenkeeper.io/mcollina/cloneable-readable.svg)](https://greenkeeper.io/) + +[![Build Status](https://travis-ci.org/mcollina/cloneable-readable.svg?branch=master)](https://travis-ci.org/mcollina/cloneable-readable) + +Clone a Readable stream, safely. + +```js +'use strict' + +var cloneable = require('cloneable-readable') +var fs = require('fs') +var pump = require('pump') + +var stream = cloneable(fs.createReadStream('./package.json')) + +pump(stream.clone(), fs.createWriteStream('./out1')) + +// simulate some asynchronicity +setImmediate(function () { + pump(stream, fs.createWriteStream('./out2')) +}) +``` + +**cloneable-readable** automatically handles `objectMode: true`. + +This module comes out of an healthy discussion on the 'right' way to +clone a Readable in https://github.com/gulpjs/vinyl/issues/85 +and https://github.com/nodejs/readable-stream/issues/202. This is my take. + +**YOU MUST PIPE ALL CLONES TO START THE FLOW** + +You can also attach `'data'` and `'readable'` events to them. + +## API + +### cloneable(stream) + +Create a `Cloneable` stream. +A Cloneable has a `clone()` method to create more clones. +All clones must be resumed/piped to start the flow. + +### cloneable.isCloneable(stream) + +Check if `stream` needs to be wrapped in a `Cloneable` or not. + +## Acknowledgements + +This project was kindly sponsored by [nearForm](http://nearform.com). + +## License + +MIT diff --git a/packages/字体精简工具/node_modules/cloneable-readable/example.js b/packages/字体精简工具/node_modules/cloneable-readable/example.js new file mode 100644 index 0000000..e980b97 --- /dev/null +++ b/packages/字体精简工具/node_modules/cloneable-readable/example.js @@ -0,0 +1,14 @@ +'use strict' + +var cloneable = require('./') +var fs = require('fs') +var pump = require('pump') + +var stream = cloneable(fs.createReadStream('./package.json')) + +pump(stream.clone(), fs.createWriteStream('./out1')) + +// simulate some asynchronicity +setImmediate(function () { + pump(stream, fs.createWriteStream('./out2')) +}) diff --git a/packages/字体精简工具/node_modules/cloneable-readable/index.js b/packages/字体精简工具/node_modules/cloneable-readable/index.js new file mode 100644 index 0000000..a68765b --- /dev/null +++ b/packages/字体精简工具/node_modules/cloneable-readable/index.js @@ -0,0 +1,153 @@ +'use strict' + +var PassThrough = require('readable-stream').PassThrough +var inherits = require('inherits') +var p = require('process-nextick-args') + +function Cloneable (stream, opts) { + if (!(this instanceof Cloneable)) { + return new Cloneable(stream, opts) + } + + var objectMode = stream._readableState.objectMode + this._original = stream + this._clonesCount = 1 + + opts = opts || {} + opts.objectMode = objectMode + + PassThrough.call(this, opts) + + forwardDestroy(stream, this) + + this.on('newListener', onData) + this.once('resume', onResume) + + this._hasListener = true +} + +inherits(Cloneable, PassThrough) + +function onData (event, listener) { + if (event === 'data' || event === 'readable') { + this._hasListener = false + this.removeListener('newListener', onData) + this.removeListener('resume', onResume) + p.nextTick(clonePiped, this) + } +} + +function onResume () { + this._hasListener = false + this.removeListener('newListener', onData) + p.nextTick(clonePiped, this) +} + +Cloneable.prototype.clone = function () { + if (!this._original) { + throw new Error('already started') + } + + this._clonesCount++ + + // the events added by the clone should not count + // for starting the flow + this.removeListener('newListener', onData) + var clone = new Clone(this) + if (this._hasListener) { + this.on('newListener', onData) + } + + return clone +} + +Cloneable.prototype._destroy = function (err, cb) { + if (!err) { + this.push(null) + this.end() + this.emit('close') + } + + p.nextTick(cb, err) +} + +function forwardDestroy (src, dest) { + src.on('error', destroy) + src.on('close', onClose) + + function destroy (err) { + src.removeListener('close', onClose) + dest.destroy(err) + } + + function onClose () { + dest.end() + } +} + +function clonePiped (that) { + if (--that._clonesCount === 0 && !that._readableState.destroyed) { + that._original.pipe(that) + that._original = undefined + } +} + +function Clone (parent, opts) { + if (!(this instanceof Clone)) { + return new Clone(parent, opts) + } + + var objectMode = parent._readableState.objectMode + + opts = opts || {} + opts.objectMode = objectMode + + this.parent = parent + + PassThrough.call(this, opts) + + forwardDestroy(parent, this) + + parent.pipe(this) + + // the events added by the clone should not count + // for starting the flow + // so we add the newListener handle after we are done + this.on('newListener', onDataClone) + this.on('resume', onResumeClone) +} + +function onDataClone (event, listener) { + // We start the flow once all clones are piped or destroyed + if (event === 'data' || event === 'readable' || event === 'close') { + p.nextTick(clonePiped, this.parent) + this.removeListener('newListener', onDataClone) + } +} + +function onResumeClone () { + this.removeListener('newListener', onDataClone) + p.nextTick(clonePiped, this.parent) +} + +inherits(Clone, PassThrough) + +Clone.prototype.clone = function () { + return this.parent.clone() +} + +Cloneable.isCloneable = function (stream) { + return stream instanceof Cloneable || stream instanceof Clone +} + +Clone.prototype._destroy = function (err, cb) { + if (!err) { + this.push(null) + this.end() + this.emit('close') + } + + p.nextTick(cb, err) +} + +module.exports = Cloneable diff --git a/packages/字体精简工具/node_modules/cloneable-readable/package.json b/packages/字体精简工具/node_modules/cloneable-readable/package.json new file mode 100644 index 0000000..80e2ce3 --- /dev/null +++ b/packages/字体精简工具/node_modules/cloneable-readable/package.json @@ -0,0 +1,69 @@ +{ + "_from": "cloneable-readable@^1.0.0", + "_id": "cloneable-readable@1.1.3", + "_inBundle": false, + "_integrity": "sha1-EgoAywU7+2OiIucJ+Wg+ouEdjOw=", + "_location": "/cloneable-readable", + "_phantomChildren": {}, + "_requested": { + "type": "range", + "registry": true, + "raw": "cloneable-readable@^1.0.0", + "name": "cloneable-readable", + "escapedName": "cloneable-readable", + "rawSpec": "^1.0.0", + "saveSpec": null, + "fetchSpec": "^1.0.0" + }, + "_requiredBy": [ + "/gulp-clean/vinyl", + "/vinyl-fs/vinyl", + "/vinyl-sourcemap/vinyl" + ], + "_resolved": "https://registry.npm.taobao.org/cloneable-readable/download/cloneable-readable-1.1.3.tgz", + "_shasum": "120a00cb053bfb63a222e709f9683ea2e11d8cec", + "_spec": "cloneable-readable@^1.0.0", + "_where": "D:\\workspace\\plugin\\mini_font\\packages\\mini_font\\publish\\mini_font\\node_modules\\vinyl-fs\\node_modules\\vinyl", + "author": { + "name": "Matteo Collina", + "email": "hello@matteocollina.com" + }, + "bugs": { + "url": "https://github.com/mcollina/cloneable-readable/issues" + }, + "bundleDependencies": false, + "dependencies": { + "inherits": "^2.0.1", + "process-nextick-args": "^2.0.0", + "readable-stream": "^2.3.5" + }, + "deprecated": false, + "description": "Clone a Readable stream, safely", + "devDependencies": { + "flush-write-stream": "^1.0.0", + "from2": "^2.1.1", + "pre-commit": "^1.1.2", + "pump": "^3.0.0", + "standard": "^11.0.0", + "tap-spec": "^4.1.1", + "tape": "^4.9.0" + }, + "homepage": "https://github.com/mcollina/cloneable-readable#readme", + "keywords": [ + "readable", + "stream", + "clone" + ], + "license": "MIT", + "main": "index.js", + "name": "cloneable-readable", + "precommit": "test", + "repository": { + "type": "git", + "url": "git+https://github.com/mcollina/cloneable-readable.git" + }, + "scripts": { + "test": "standard && tape test.js | tap-spec" + }, + "version": "1.1.3" +} diff --git a/packages/字体精简工具/node_modules/cloneable-readable/test.js b/packages/字体精简工具/node_modules/cloneable-readable/test.js new file mode 100644 index 0000000..35bb78b --- /dev/null +++ b/packages/字体精简工具/node_modules/cloneable-readable/test.js @@ -0,0 +1,702 @@ +'use strict' + +var fs = require('fs') +var path = require('path') +var test = require('tape').test +var from = require('from2') +var crypto = require('crypto') +var sink = require('flush-write-stream') +var pump = require('pump') +var cloneable = require('./') + +test('basic passthrough', function (t) { + t.plan(2) + + var read = false + var source = from(function (size, next) { + if (read) { + this.push(null) + } else { + read = true + this.push('hello world') + } + next() + }) + + var instance = cloneable(source) + t.notOk(read, 'stream not started') + + instance.pipe(sink(function (chunk, enc, cb) { + t.equal(chunk.toString(), 'hello world', 'chunk matches') + cb() + })) +}) + +test('clone sync', function (t) { + t.plan(4) + + var read = false + var source = from(function (size, next) { + if (read) { + this.push(null) + } else { + read = true + this.push('hello world') + } + next() + }) + + var instance = cloneable(source) + t.notOk(read, 'stream not started') + + var cloned = instance.clone() + t.notOk(read, 'stream not started') + + instance.pipe(sink(function (chunk, enc, cb) { + t.equal(chunk.toString(), 'hello world', 'chunk matches') + cb() + })) + + cloned.pipe(sink(function (chunk, enc, cb) { + t.equal(chunk.toString(), 'hello world', 'chunk matches') + cb() + })) +}) + +test('clone async', function (t) { + t.plan(4) + + var read = false + var source = from(function (size, next) { + if (read) { + this.push(null) + } else { + read = true + this.push('hello world') + } + next() + }) + + var instance = cloneable(source) + t.notOk(read, 'stream not started') + + var cloned = instance.clone() + t.notOk(read, 'stream not started') + + instance.pipe(sink(function (chunk, enc, cb) { + t.equal(chunk.toString(), 'hello world', 'chunk matches') + cb() + })) + + setImmediate(function () { + cloned.pipe(sink(function (chunk, enc, cb) { + t.equal(chunk.toString(), 'hello world', 'chunk matches') + cb() + })) + }) +}) + +test('basic passthrough in obj mode', function (t) { + t.plan(2) + + var read = false + var source = from.obj(function (size, next) { + if (read) { + return this.push(null) + } else { + read = true + this.push({ hello: 'world' }) + } + next() + }) + + var instance = cloneable(source) + t.notOk(read, 'stream not started') + + instance.pipe(sink.obj(function (chunk, enc, cb) { + t.deepEqual(chunk, { hello: 'world' }, 'chunk matches') + cb() + })) +}) + +test('multiple clone in object mode', function (t) { + t.plan(4) + + var read = false + var source = from.obj(function (size, next) { + if (read) { + return this.push(null) + } else { + read = true + this.push({ hello: 'world' }) + } + next() + }) + + var instance = cloneable(source) + t.notOk(read, 'stream not started') + + var cloned = instance.clone() + t.notOk(read, 'stream not started') + + instance.pipe(sink.obj(function (chunk, enc, cb) { + t.deepEqual(chunk, { hello: 'world' }, 'chunk matches') + cb() + })) + + setImmediate(function () { + cloned.pipe(sink.obj(function (chunk, enc, cb) { + t.deepEqual(chunk, { hello: 'world' }, 'chunk matches') + cb() + })) + }) +}) + +test('basic passthrough with data event', function (t) { + t.plan(2) + + var read = false + var source = from(function (size, next) { + if (read) { + this.push(null) + } else { + read = true + this.push('hello world') + } + next() + }) + + var instance = cloneable(source) + t.notOk(read, 'stream not started') + + var data = '' + instance.on('data', function (chunk) { + data += chunk.toString() + }) + + instance.on('end', function () { + t.equal(data, 'hello world', 'chunk matches') + }) +}) + +test('basic passthrough with data event on clone', function (t) { + t.plan(3) + + var read = false + var source = from(function (size, next) { + if (read) { + this.push(null) + } else { + read = true + this.push('hello world') + } + next() + }) + + var instance = cloneable(source) + var cloned = instance.clone() + + t.notOk(read, 'stream not started') + + var data = '' + cloned.on('data', function (chunk) { + data += chunk.toString() + }) + + cloned.on('end', function () { + t.equal(data, 'hello world', 'chunk matches in clone') + }) + + instance.pipe(sink(function (chunk, enc, cb) { + t.equal(chunk.toString(), 'hello world', 'chunk matches in instance') + cb() + })) +}) + +test('errors if cloned after start', function (t) { + t.plan(2) + + var source = from(function (size, next) { + this.push('hello world') + this.push(null) + next() + }) + + var instance = cloneable(source) + + instance.pipe(sink(function (chunk, enc, cb) { + t.equal(chunk.toString(), 'hello world', 'chunk matches') + t.throws(function () { + instance.clone() + }, 'throws if cloned after start') + cb() + })) +}) + +test('basic passthrough with readable event', function (t) { + t.plan(2) + + var read = false + var source = from(function (size, next) { + if (read) { + this.push(null) + } else { + read = true + this.push('hello world') + } + next() + }) + + var instance = cloneable(source) + t.notOk(read, 'stream not started') + + var data = '' + instance.on('readable', function () { + var chunk + while ((chunk = this.read()) !== null) { + data += chunk.toString() + } + }) + + instance.on('end', function () { + t.equal(data, 'hello world', 'chunk matches') + }) +}) + +test('basic passthrough with readable event on clone', function (t) { + t.plan(3) + + var read = false + var source = from(function (size, next) { + if (read) { + this.push(null) + } else { + read = true + this.push('hello world') + } + next() + }) + + var instance = cloneable(source) + var cloned = instance.clone() + + t.notOk(read, 'stream not started') + + var data = '' + cloned.on('readable', function () { + var chunk + while ((chunk = this.read()) !== null) { + data += chunk.toString() + } + }) + + cloned.on('end', function () { + t.equal(data, 'hello world', 'chunk matches in clone') + }) + + instance.pipe(sink(function (chunk, enc, cb) { + t.equal(chunk.toString(), 'hello world', 'chunk matches in instance') + cb() + })) +}) + +test('source error destroys all', function (t) { + t.plan(3) + + var source = from() + var instance = cloneable(source) + var clone = instance.clone() + + source.on('error', function (err) { + t.ok(err, 'source errors') + + instance.on('error', function (err2) { + t.ok(err === err2, 'instance receives same error') + }) + + clone.on('error', function (err3) { + t.ok(err === err3, 'clone receives same error') + }) + }) + + source.emit('error', new Error()) +}) + +test('source destroy destroys all', function (t) { + t.plan(2) + + var source = from() + var instance = cloneable(source) + var clone = instance.clone() + + instance.on('end', function () { + t.pass('instance has ended') + }) + + clone.on('end', function () { + t.pass('clone has ended') + }) + + clone.resume() + instance.resume() + + source.destroy() +}) + +test('instance error destroys all but the source', function (t) { + t.plan(2) + + var source = from() + var instance = cloneable(source) + var clone = instance.clone() + + source.on('close', function () { + t.fail('source should not be closed') + }) + + instance.on('error', function (err) { + t.is(err.message, 'beep', 'instance errors') + }) + + instance.on('close', function () { + t.fail('close should not be emitted') + }) + + clone.on('error', function (err) { + t.is(err.message, 'beep', 'instance errors') + }) + + clone.on('close', function () { + t.fail('close should not be emitted') + }) + + instance.destroy(new Error('beep')) +}) + +test('instance destroy destroys all but the source', function (t) { + t.plan(2) + + var source = from() + var instance = cloneable(source) + var clone = instance.clone() + + source.on('close', function () { + t.fail('source should not be closed') + }) + + instance.on('end', function () { + t.pass('instance has ended') + }) + + clone.on('end', function () { + t.pass('clone has ended') + }) + + instance.resume() + clone.resume() + + instance.destroy() +}) + +test('clone destroy does not affect other clones, cloneable or source', function (t) { + t.plan(1) + + var source = from() + var instance = cloneable(source) + var clone = instance.clone() + var other = instance.clone() + + source.on('close', function () { + t.fail('source should not be closed') + }) + + instance.on('close', function () { + t.fail('instance should not be closed') + }) + + other.on('close', function () { + t.fail('other clone should not be closed') + }) + + clone.on('close', function () { + t.pass('clone is closed') + }) + + clone.destroy() +}) + +test('clone remains readable if other is destroyed', function (t) { + t.plan(3) + + var read = false + var source = from(function (size, next) { + if (read) { + this.push(null) + } else { + read = true + this.push('hello') + } + next() + }) + + var instance = cloneable(source) + var clone = instance.clone() + var other = instance.clone() + + instance.pipe(sink.obj(function (chunk, enc, cb) { + t.deepEqual(chunk.toString(), 'hello', 'instance chunk matches') + cb() + })) + + clone.pipe(sink.obj(function (chunk, enc, cb) { + t.deepEqual(chunk.toString(), 'hello', 'clone chunk matches') + cb() + })) + + clone.on('close', function () { + t.fail('clone should not be closed') + }) + + instance.on('close', function () { + t.fail('instance should not be closed') + }) + + other.on('close', function () { + t.pass('other is closed') + }) + + other.destroy() +}) + +test('clone of clone', function (t) { + t.plan(6) + + var read = false + var source = from(function (size, next) { + if (read) { + this.push(null) + } else { + read = true + this.push('hello world') + } + next() + }) + + var instance = cloneable(source) + t.notOk(read, 'stream not started') + + var cloned = instance.clone() + t.notOk(read, 'stream not started') + + var replica = cloned.clone() + t.notOk(read, 'stream not started') + + instance.pipe(sink(function (chunk, enc, cb) { + t.equal(chunk.toString(), 'hello world', 'chunk matches') + cb() + })) + + cloned.pipe(sink(function (chunk, enc, cb) { + t.equal(chunk.toString(), 'hello world', 'chunk matches') + cb() + })) + + replica.pipe(sink(function (chunk, enc, cb) { + t.equal(chunk.toString(), 'hello world', 'chunk matches') + cb() + })) +}) + +test('from vinyl', function (t) { + t.plan(3) + + var source = from(['wa', 'dup']) + + var instance = cloneable(source) + var clone = instance.clone() + + var data = '' + var data2 = '' + var ends = 2 + + function latch () { + if (--ends === 0) { + t.equal(data, data2) + } + } + + instance.on('data', function (chunk) { + data += chunk.toString() + }) + + process.nextTick(function () { + t.equal('', data, 'nothing was written yet') + t.equal('', data2, 'nothing was written yet') + + clone.on('data', function (chunk) { + data2 += chunk.toString() + }) + }) + + instance.on('end', latch) + clone.on('end', latch) +}) + +test('waits till all are flowing', function (t) { + t.plan(1) + + var source = from(['wa', 'dup']) + + var instance = cloneable(source) + + // we create a clone + instance.clone() + + instance.on('data', function (chunk) { + t.fail('this should never happen') + }) + + process.nextTick(function () { + t.pass('wait till nextTick') + }) +}) + +test('isCloneable', function (t) { + t.plan(4) + + var source = from(['hello', ' ', 'world']) + t.notOk(cloneable.isCloneable(source), 'a generic readable is not cloneable') + + var instance = cloneable(source) + t.ok(cloneable.isCloneable(instance), 'a cloneable is cloneable') + + var clone = instance.clone() + t.ok(cloneable.isCloneable(clone), 'a clone is cloneable') + + var cloneClone = clone.clone() + t.ok(cloneable.isCloneable(cloneClone), 'a clone of a clone is cloneable') +}) + +test('emits finish', function (t) { + var chunks = ['a', 'b', 'c', 'd', null] + var e1 = ['a', 'b', 'c', 'd'] + var e2 = ['a', 'b', 'c', 'd'] + + t.plan(2 + e1.length + e2.length) + + var source = from(function (size, next) { + setImmediate(next, null, chunks.shift()) + }) + + var instance = cloneable(source) + + var clone = instance.clone() + + clone.on('finish', t.pass.bind(null, 'clone emits finish')) + instance.on('finish', t.pass.bind(null, 'main emits finish')) + + instance.pipe(sink(function (chunk, enc, cb) { + t.equal(chunk.toString(), e1.shift(), 'chunk matches') + cb() + })) + + clone.on('data', function (chunk) { + t.equal(chunk.toString(), e2.shift(), 'chunk matches') + }) +}) + +test('clone async w resume', function (t) { + t.plan(4) + + var read = false + var source = from(function (size, next) { + if (read) { + this.push(null) + } else { + read = true + this.push('hello world') + } + next() + }) + + var instance = cloneable(source) + t.notOk(read, 'stream not started') + + var cloned = instance.clone() + t.notOk(read, 'stream not started') + + instance.on('end', t.pass.bind(null, 'end emitted')) + instance.resume() + + setImmediate(function () { + cloned.on('end', t.pass.bind(null, 'end emitted')) + cloned.resume() + }) +}) + +test('big file', function (t) { + t.plan(13) + + var stream = cloneable(fs.createReadStream(path.join(__dirname, 'big'))) + var hash = crypto.createHash('sha1') + hash.setEncoding('hex') + + var toCheck + + fs.createReadStream(path.join(__dirname, 'big')) + .pipe(hash) + .once('readable', function () { + toCheck = hash.read() + t.ok(toCheck) + }) + + function pipe (s, num) { + s.on('end', function () { + t.pass('end for ' + num) + }) + + var dest = path.join(__dirname, 'out') + + s.pipe(fs.createWriteStream(dest)) + .on('finish', function () { + t.pass('finish for ' + num) + + var destHash = crypto.createHash('sha1') + destHash.setEncoding('hex') + + fs.createReadStream(dest) + .pipe(destHash) + .once('readable', function () { + var hash = destHash.read() + t.ok(hash) + t.equal(hash, toCheck) + }) + }) + } + + // Pipe in another event loop tick <-- this one finished only, it's the original cloneable. + setImmediate(pipe.bind(null, stream, 1)) + + // Pipe in the same event loop tick + pipe(stream.clone(), 0) + + // Pipe a long time after + setTimeout(pipe.bind(null, stream.clone(), 2), 1000) +}) + +test('pump error', function (t) { + t.plan(1) + + var err = new Error('kaboom') + + pump([ + cloneable(from(function () { + this.destroy(err) + })), + sink(function (chunk, enc, cb) { + t.fail('this should not be called') + }) + ], function (_err) { + t.equal(_err, err) + }) +}) diff --git a/packages/字体精简工具/node_modules/code-point-at/index.js b/packages/字体精简工具/node_modules/code-point-at/index.js new file mode 100644 index 0000000..0432fe6 --- /dev/null +++ b/packages/字体精简工具/node_modules/code-point-at/index.js @@ -0,0 +1,32 @@ +/* eslint-disable babel/new-cap, xo/throw-new-error */ +'use strict'; +module.exports = function (str, pos) { + if (str === null || str === undefined) { + throw TypeError(); + } + + str = String(str); + + var size = str.length; + var i = pos ? Number(pos) : 0; + + if (Number.isNaN(i)) { + i = 0; + } + + if (i < 0 || i >= size) { + return undefined; + } + + var first = str.charCodeAt(i); + + if (first >= 0xD800 && first <= 0xDBFF && size > i + 1) { + var second = str.charCodeAt(i + 1); + + if (second >= 0xDC00 && second <= 0xDFFF) { + return ((first - 0xD800) * 0x400) + second - 0xDC00 + 0x10000; + } + } + + return first; +}; diff --git a/packages/字体精简工具/node_modules/code-point-at/license b/packages/字体精简工具/node_modules/code-point-at/license new file mode 100644 index 0000000..654d0bf --- /dev/null +++ b/packages/字体精简工具/node_modules/code-point-at/license @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (c) Sindre Sorhus (sindresorhus.com) + +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/packages/字体精简工具/node_modules/code-point-at/package.json b/packages/字体精简工具/node_modules/code-point-at/package.json new file mode 100644 index 0000000..43fe4bc --- /dev/null +++ b/packages/字体精简工具/node_modules/code-point-at/package.json @@ -0,0 +1,70 @@ +{ + "_from": "code-point-at@^1.0.0", + "_id": "code-point-at@1.1.0", + "_inBundle": false, + "_integrity": "sha1-DQcLTQQ6W+ozovGkDi7bPZpMz3c=", + "_location": "/code-point-at", + "_phantomChildren": {}, + "_requested": { + "type": "range", + "registry": true, + "raw": "code-point-at@^1.0.0", + "name": "code-point-at", + "escapedName": "code-point-at", + "rawSpec": "^1.0.0", + "saveSpec": null, + "fetchSpec": "^1.0.0" + }, + "_requiredBy": [ + "/string-width" + ], + "_resolved": "https://registry.nlark.com/code-point-at/download/code-point-at-1.1.0.tgz", + "_shasum": "0d070b4d043a5bea33a2f1a40e2edb3d9a4ccf77", + "_spec": "code-point-at@^1.0.0", + "_where": "D:\\workspace\\plugin\\mini_font\\packages\\mini_font\\publish\\mini_font\\node_modules\\string-width", + "author": { + "name": "Sindre Sorhus", + "email": "sindresorhus@gmail.com", + "url": "sindresorhus.com" + }, + "bugs": { + "url": "https://github.com/sindresorhus/code-point-at/issues" + }, + "bundleDependencies": false, + "deprecated": false, + "description": "ES2015 `String#codePointAt()` ponyfill", + "devDependencies": { + "ava": "*", + "xo": "^0.16.0" + }, + "engines": { + "node": ">=0.10.0" + }, + "files": [ + "index.js" + ], + "homepage": "https://github.com/sindresorhus/code-point-at#readme", + "keywords": [ + "es2015", + "ponyfill", + "polyfill", + "shim", + "string", + "str", + "code", + "point", + "at", + "codepoint", + "unicode" + ], + "license": "MIT", + "name": "code-point-at", + "repository": { + "type": "git", + "url": "git+https://github.com/sindresorhus/code-point-at.git" + }, + "scripts": { + "test": "xo && ava" + }, + "version": "1.1.0" +} diff --git a/packages/字体精简工具/node_modules/code-point-at/readme.md b/packages/字体精简工具/node_modules/code-point-at/readme.md new file mode 100644 index 0000000..4c97730 --- /dev/null +++ b/packages/字体精简工具/node_modules/code-point-at/readme.md @@ -0,0 +1,32 @@ +# code-point-at [![Build Status](https://travis-ci.org/sindresorhus/code-point-at.svg?branch=master)](https://travis-ci.org/sindresorhus/code-point-at) + +> ES2015 [`String#codePointAt()`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/codePointAt) [ponyfill](https://ponyfill.com) + + +## Install + +``` +$ npm install --save code-point-at +``` + + +## Usage + +```js +var codePointAt = require('code-point-at'); + +codePointAt('🐴'); +//=> 128052 + +codePointAt('abc', 2); +//=> 99 +``` + +## API + +### codePointAt(input, [position]) + + +## License + +MIT © [Sindre Sorhus](https://sindresorhus.com) diff --git a/packages/字体精简工具/node_modules/code-point/LICENSES.md b/packages/字体精简工具/node_modules/code-point/LICENSES.md new file mode 100644 index 0000000..fc89ff0 --- /dev/null +++ b/packages/字体精简工具/node_modules/code-point/LICENSES.md @@ -0,0 +1,56 @@ +# Licenses + +### String.prototype.codePointAt + + + +(The MIT License) + +Copyright Mathias Bynens + +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. + +### code-point.js + + + +(The MIT License) + +Copyright (c) 2014 - 2016 Shinnosuke Watanabe + + +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/packages/字体精简工具/node_modules/code-point/README.md b/packages/字体精简工具/node_modules/code-point/README.md new file mode 100644 index 0000000..86c7d53 --- /dev/null +++ b/packages/字体精简工具/node_modules/code-point/README.md @@ -0,0 +1,75 @@ +# code-point.js + +[![NPM version](https://img.shields.io/npm/v/code-point.svg)](https://www.npmjs.com/package/code-point) +[![Bower version](https://img.shields.io/bower/v/code-point.svg)](https://github.com/shinnn/code-point.js/releases) +[![Build Status](https://travis-ci.org/shinnn/code-point.js.svg?branch=master)](https://travis-ci.org/shinnn/code-point.js) +[![Coverage Status](https://img.shields.io/coveralls/shinnn/code-point.js.svg)](https://coveralls.io/r/shinnn/code-point.js) +[![devDependency Status](https://david-dm.org/shinnn/code-point.js/dev-status.svg)](https://david-dm.org/shinnn/code-point.js#info=devDependencies) + +Get a [UTF-16](https://wikipedia.org/wiki/UTF-16)-encoded code point number of a character + +```javascript +'A'.charCodeAt(0); //=> 65 +codePoint('A'); //=> 65 + +'嶲'.charCodeAt(0); //=> 55422 +codePoint('嶲'); //=> 195060 +``` + +## Installation + +### Package managers + +#### [npm](https://www.npmjs.com/) + +``` +npm install code-point +``` + +#### [Bower](http://bower.io/) + +``` +bower install code-point +``` + +### Standalone + +[Download the script file directly.](https://raw.githubusercontent.com/shinnn/code-point.js/master/browser.js) + +## API + +### codePoint(*character*) + +*character*: `String` +Return: `Number` + +If it takes a string as an argument, it returns the same result of `character.codePointAt(0)`. + +It throws an error if the argument is not a string or the string is empty. + +```javascript +codePoint('\udada'); //=> 56026 +codePoint('\udada\udfdf'); //=> 814047 +``` + +It works correctly even in ECMAScript <= 5 environments that don't support [`String.prototype.codePointAt`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String/codePointAt). + +## Credit + +This module includes the code of [mathiasbynens](https://github.com/mathiasbynens) / [String.prototype.codePointAt](https://github.com/mathiasbynens/String.prototype.codePointAt). Thanks, [Mathias Bynens][mathias]. + +## Licenses + +### [String.prototype.codePointAt](https://github.com/mathiasbynens/String.prototype.codePointAt#license) + +Author: [Mathias Bynens][mathias] + +> This polyfill is available under the [MIT](https://opensource.org/licenses/mit-license) license. + +### code-point.js + +Copyright (c) 2014 - 2016 [Shinnosuke Watanabe](https://github.com/shinnn) + +Licensed under [the MIT License](https://github.com/shinnn/code-point/blob/master/LICENSES.md#code-pointjs). + +[mathias]: https://mathiasbynens.be/ diff --git a/packages/字体精简工具/node_modules/code-point/index.js b/packages/字体精简工具/node_modules/code-point/index.js new file mode 100644 index 0000000..24a1bfa --- /dev/null +++ b/packages/字体精简工具/node_modules/code-point/index.js @@ -0,0 +1,36 @@ +/*! + * String.prototype.codePointAt v0.2.0 | MIT (c) Mathias Bynens (@mathias) + * http://mths.be/codepointat + * + * code-point | MIT (c) Shinnosuke Watanabe + * https://github.com/shinnn/code-point.js +*/ +'use strict'; + +var getCodePoint = typeof String.prototype.codePointAt === 'function' ? function getCodePoint(str) { + return str.codePointAt(0); +} : function getCodePoint(str) { + var first = str.charCodeAt(0); + + if (first >= 0xD800 && first <= 0xDBFF && str.length > 1) { + var second = str.charCodeAt(1); + + if (second >= 0xDC00 && second <= 0xDFFF) { + return (first - 0xD800) * 0x400 + second - 0xDC00 + 0x10000; + } + } + + return first; +}; + +module.exports = function codePoint(str) { + if (typeof str !== 'string') { + throw new TypeError(String(str) + ' is not a string. Argument must be a string.'); + } + + if (str.length === 0) { + throw new Error('Argument must be a non-empty string.'); + } + + return getCodePoint(str); +}; diff --git a/packages/字体精简工具/node_modules/code-point/index.jsnext.js b/packages/字体精简工具/node_modules/code-point/index.jsnext.js new file mode 100644 index 0000000..c6b180e --- /dev/null +++ b/packages/字体精简工具/node_modules/code-point/index.jsnext.js @@ -0,0 +1,34 @@ +/*! + * String.prototype.codePointAt v0.2.0 | MIT (c) Mathias Bynens (@mathias) + * http://mths.be/codepointat + * + * code-point | MIT (c) Shinnosuke Watanabe + * https://github.com/shinnn/code-point.js +*/ +var getCodePoint = typeof String.prototype.codePointAt === 'function' ? function getCodePoint(str) { + return str.codePointAt(0); +} : function getCodePoint(str) { + var first = str.charCodeAt(0); + + if (first >= 0xD800 && first <= 0xDBFF && str.length > 1) { + var second = str.charCodeAt(1); + + if (second >= 0xDC00 && second <= 0xDFFF) { + return (first - 0xD800) * 0x400 + second - 0xDC00 + 0x10000; + } + } + + return first; +}; + +export default function codePoint(str) { + if (typeof str !== 'string') { + throw new TypeError(String(str) + ' is not a string. Argument must be a string.'); + } + + if (str.length === 0) { + throw new Error('Argument must be a non-empty string.'); + } + + return getCodePoint(str); +} diff --git a/packages/字体精简工具/node_modules/code-point/package.json b/packages/字体精简工具/node_modules/code-point/package.json new file mode 100644 index 0000000..074769a --- /dev/null +++ b/packages/字体精简工具/node_modules/code-point/package.json @@ -0,0 +1,76 @@ +{ + "_from": "code-point@^1.0.1", + "_id": "code-point@1.1.0", + "_inBundle": false, + "_integrity": "sha1-mZhB9R9UzK5KDau8hpBjI0YD/s0=", + "_location": "/code-point", + "_phantomChildren": {}, + "_requested": { + "type": "range", + "registry": true, + "raw": "code-point@^1.0.1", + "name": "code-point", + "escapedName": "code-point", + "rawSpec": "^1.0.1", + "saveSpec": null, + "fetchSpec": "^1.0.1" + }, + "_requiredBy": [ + "/code-points" + ], + "_resolved": "https://registry.npm.taobao.org/code-point/download/code-point-1.1.0.tgz", + "_shasum": "999841f51f54ccae4a0dabbc869063234603fecd", + "_spec": "code-point@^1.0.1", + "_where": "D:\\workspace\\plugin\\mini_font\\packages\\mini_font\\publish\\mini_font\\node_modules\\code-points", + "author": { + "name": "Shinnosuke Watanabe", + "url": "https://github.com/shinnn" + }, + "bugs": { + "url": "https://github.com/shinnn/code-point.js/issues" + }, + "bundleDependencies": false, + "deprecated": false, + "description": "Get a UTF-16-encoded code point number of a character", + "devDependencies": { + "@shinnn/eslint-config": "^2.3.0", + "eslint": "^2.11.1", + "require-from-string": "^1.2.0", + "rollup": "^0.26.3", + "tap": "^5.7.2" + }, + "files": [ + "index.js", + "index.jsnext.js", + "LICENSES.md" + ], + "homepage": "https://github.com/shinnn/code-point.js#readme", + "jsnext:main": "index.jsnext.js", + "keywords": [ + "code", + "point", + "code-point", + "string", + "char", + "character", + "unicode", + "utf16", + "utf-16", + "codepointat", + "surrogate", + "plane", + "browser", + "client-side" + ], + "license": "MIT", + "name": "code-point", + "repository": { + "type": "git", + "url": "git+https://github.com/shinnn/code-point.js.git" + }, + "scripts": { + "pretest": "eslint --fix --config @shinnn --ignore-path .gitignore .", + "test": "tap --node-arg=--strong_mode --coverage test.js test-es5.js" + }, + "version": "1.1.0" +} diff --git a/packages/字体精简工具/node_modules/code-points/LICENSE b/packages/字体精简工具/node_modules/code-points/LICENSE new file mode 100644 index 0000000..5882f81 --- /dev/null +++ b/packages/字体精简工具/node_modules/code-points/LICENSE @@ -0,0 +1,20 @@ +The MIT License (MIT) + +Copyright (c) 2014 - 2019 Shinnosuke Watanabe + +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/packages/字体精简工具/node_modules/code-points/README.md b/packages/字体精简工具/node_modules/code-points/README.md new file mode 100644 index 0000000..2f1366c --- /dev/null +++ b/packages/字体精简工具/node_modules/code-points/README.md @@ -0,0 +1,53 @@ +# code-points + +[![npm version](https://img.shields.io/npm/v/code-points.svg)](https://www.npmjs.com/package/code-points) +[![Build Status](https://travis-ci.com/shinnn/code-points.js.svg?branch=master)](https://travis-ci.com/shinnn/code-points.js) +[![Coverage Status](https://img.shields.io/coveralls/shinnn/code-points.js.svg)](https://coveralls.io/github/shinnn/code-points.js) + +Get the [UTF-16](https://wikipedia.org/wiki/UTF-16)-encoded code points of each character in the string + +```javascript +codePoints('Hello, 世界\n'); //=> [72, 101, 108, 108, 111, 44, 32, 19990, 30028] +``` + +## Installation + +[Use](https://docs.npmjs.com/cli/install) [npm](https://docs.npmjs.com/about-npm/). + +``` +npm install code-points +``` + +## API + +### codePoints(*str*, *option*) + +*str*: `string` +*option*: `Object` +Return: `Array` + +It returns the [code point](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String/codePointAt)s of each character in the string as an array. + +```javascript +codePoints('\udada'); //=> [56026] +codePoints('\udfdf\udada\udada'); //=> [57311, 56026, 56026] +codePoints('\udada\udfdf\udada'); //=> [814047, 56026] +``` + +#### option.unique + +Type: `boolean` +Default: `false` + +Removes duplicates from result. + +```javascript +codePoints('banana'); //=> [98, 97, 110, 97, 110, 97] +codePoints('banana', {unique: true}); //=> [98,97,110] +``` + +## License + +Copyright (c) 2014 - 2019 [Shinnosuke Watanabe](https://github.com/shinnn) + +Licensed under [the MIT License](https://github.com/shinnn/code-points/blob/master/LICENSE). diff --git a/packages/字体精简工具/node_modules/code-points/dist/code-points-cjs.js b/packages/字体精简工具/node_modules/code-points/dist/code-points-cjs.js new file mode 100644 index 0000000..c671e24 --- /dev/null +++ b/packages/字体精简工具/node_modules/code-points/dist/code-points-cjs.js @@ -0,0 +1,40 @@ +/*! + * code-points | MIT (c) Shinnosuke Watanabe + * https://github.com/shinnn/code-points.js +*/ +function codePoints(str, option) { + 'use strict'; + + option = option || {unique: false}; + + if (typeof str !== 'string') { + throw new TypeError( + str + + ' is not a string. First argument to code-points must be a string.' + ); + } + + var result = []; + + var index = 0; + while (index < str.length) { + var point = codePoint(str.charAt(index) + str.charAt(index + 1)); + + if (point > 0xffff) { + index += 2; + } else { + index += 1; + } + + if (option.unique && result.indexOf(point) !== -1) { + continue; + } + + result.push(point); + } + + return result; +} + +var codePoint = require('code-point'); +module.exports = codePoints; diff --git a/packages/字体精简工具/node_modules/code-points/package.json b/packages/字体精简工具/node_modules/code-points/package.json new file mode 100644 index 0000000..7842fb0 --- /dev/null +++ b/packages/字体精简工具/node_modules/code-points/package.json @@ -0,0 +1,94 @@ +{ + "_from": "code-points@^2.0.0-1", + "_id": "code-points@2.0.0-1", + "_inBundle": false, + "_integrity": "sha1-AcI72nDPRe9XclkMOri6T4d09Yo=", + "_location": "/code-points", + "_phantomChildren": {}, + "_requested": { + "type": "range", + "registry": true, + "raw": "code-points@^2.0.0-1", + "name": "code-points", + "escapedName": "code-points", + "rawSpec": "^2.0.0-1", + "saveSpec": null, + "fetchSpec": "^2.0.0-1" + }, + "_requiredBy": [ + "/fontmin" + ], + "_resolved": "https://registry.npm.taobao.org/code-points/download/code-points-2.0.0-1.tgz", + "_shasum": "01c23bda70cf45ef5772590c3ab8ba4f8774f58a", + "_spec": "code-points@^2.0.0-1", + "_where": "D:\\workspace\\plugin\\mini_font\\packages\\mini_font\\publish\\mini_font\\node_modules\\fontmin", + "author": { + "name": "Shinnosuke Watanabe", + "url": "https://github.com/shinnn" + }, + "bugs": { + "url": "https://github.com/shinnn/code-points.js/issues" + }, + "bundleDependencies": false, + "dependencies": { + "code-point": "^1.0.1" + }, + "deprecated": false, + "description": "Get the code points of each character in the string", + "devDependencies": { + "gulp": "^3.8.11", + "gulp-footer": "^1.0.5", + "gulp-header": "^1.2.2", + "gulp-jscs": "^1.6.0", + "gulp-jshint": "^1.11.0", + "gulp-jsonlint": "^1.0.1", + "gulp-load-plugins": "^0.10.0", + "gulp-rename": "^1.2.2", + "gulp-replace": "^0.5.3", + "istanbul": "^0.3.14", + "istanbul-coveralls": "^1.0.2", + "jshint-stylish": "^2.0.0", + "merge-stream": "^0.1.7", + "rimraf": "^2.3.4", + "tape": "^4.0.0", + "tiny-npm-license": "^1.0.0", + "to-camel-case": "^0.2.1" + }, + "files": [ + "dist/code-points-cjs.js" + ], + "homepage": "https://github.com/shinnn/code-points.js#readme", + "jscsConfig": { + "preset": "google", + "maximumLineLength": 98, + "requireBlocksOnNewline": true, + "validateLineBreaks": "LF" + }, + "keywords": [ + "code", + "point", + "code-point", + "string", + "char", + "character", + "unicode", + "utf16", + "utf-16", + "codepointat", + "surrogate", + "plane" + ], + "license": "MIT", + "main": "dist/code-points-cjs.js", + "name": "code-points", + "repository": { + "type": "git", + "url": "git+https://github.com/shinnn/code-points.js.git" + }, + "scripts": { + "coverage": "istanbul cover test.js", + "coveralls": "${npm_package_scripts_coverage} && istanbul-coveralls", + "test": "gulp test" + }, + "version": "2.0.0-1" +} diff --git a/packages/字体精简工具/node_modules/combined-stream/License b/packages/字体精简工具/node_modules/combined-stream/License new file mode 100644 index 0000000..4804b7a --- /dev/null +++ b/packages/字体精简工具/node_modules/combined-stream/License @@ -0,0 +1,19 @@ +Copyright (c) 2011 Debuggable Limited + +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/packages/字体精简工具/node_modules/combined-stream/Readme.md b/packages/字体精简工具/node_modules/combined-stream/Readme.md new file mode 100644 index 0000000..9e367b5 --- /dev/null +++ b/packages/字体精简工具/node_modules/combined-stream/Readme.md @@ -0,0 +1,138 @@ +# combined-stream + +A stream that emits multiple other streams one after another. + +**NB** Currently `combined-stream` works with streams version 1 only. There is ongoing effort to switch this library to streams version 2. Any help is welcome. :) Meanwhile you can explore other libraries that provide streams2 support with more or less compatibility with `combined-stream`. + +- [combined-stream2](https://www.npmjs.com/package/combined-stream2): A drop-in streams2-compatible replacement for the combined-stream module. + +- [multistream](https://www.npmjs.com/package/multistream): A stream that emits multiple other streams one after another. + +## Installation + +``` bash +npm install combined-stream +``` + +## Usage + +Here is a simple example that shows how you can use combined-stream to combine +two files into one: + +``` javascript +var CombinedStream = require('combined-stream'); +var fs = require('fs'); + +var combinedStream = CombinedStream.create(); +combinedStream.append(fs.createReadStream('file1.txt')); +combinedStream.append(fs.createReadStream('file2.txt')); + +combinedStream.pipe(fs.createWriteStream('combined.txt')); +``` + +While the example above works great, it will pause all source streams until +they are needed. If you don't want that to happen, you can set `pauseStreams` +to `false`: + +``` javascript +var CombinedStream = require('combined-stream'); +var fs = require('fs'); + +var combinedStream = CombinedStream.create({pauseStreams: false}); +combinedStream.append(fs.createReadStream('file1.txt')); +combinedStream.append(fs.createReadStream('file2.txt')); + +combinedStream.pipe(fs.createWriteStream('combined.txt')); +``` + +However, what if you don't have all the source streams yet, or you don't want +to allocate the resources (file descriptors, memory, etc.) for them right away? +Well, in that case you can simply provide a callback that supplies the stream +by calling a `next()` function: + +``` javascript +var CombinedStream = require('combined-stream'); +var fs = require('fs'); + +var combinedStream = CombinedStream.create(); +combinedStream.append(function(next) { + next(fs.createReadStream('file1.txt')); +}); +combinedStream.append(function(next) { + next(fs.createReadStream('file2.txt')); +}); + +combinedStream.pipe(fs.createWriteStream('combined.txt')); +``` + +## API + +### CombinedStream.create([options]) + +Returns a new combined stream object. Available options are: + +* `maxDataSize` +* `pauseStreams` + +The effect of those options is described below. + +### combinedStream.pauseStreams = `true` + +Whether to apply back pressure to the underlaying streams. If set to `false`, +the underlaying streams will never be paused. If set to `true`, the +underlaying streams will be paused right after being appended, as well as when +`delayedStream.pipe()` wants to throttle. + +### combinedStream.maxDataSize = `2 * 1024 * 1024` + +The maximum amount of bytes (or characters) to buffer for all source streams. +If this value is exceeded, `combinedStream` emits an `'error'` event. + +### combinedStream.dataSize = `0` + +The amount of bytes (or characters) currently buffered by `combinedStream`. + +### combinedStream.append(stream) + +Appends the given `stream` to the combinedStream object. If `pauseStreams` is +set to `true, this stream will also be paused right away. + +`streams` can also be a function that takes one parameter called `next`. `next` +is a function that must be invoked in order to provide the `next` stream, see +example above. + +Regardless of how the `stream` is appended, combined-stream always attaches an +`'error'` listener to it, so you don't have to do that manually. + +Special case: `stream` can also be a String or Buffer. + +### combinedStream.write(data) + +You should not call this, `combinedStream` takes care of piping the appended +streams into itself for you. + +### combinedStream.resume() + +Causes `combinedStream` to start drain the streams it manages. The function is +idempotent, and also emits a `'resume'` event each time which usually goes to +the stream that is currently being drained. + +### combinedStream.pause(); + +If `combinedStream.pauseStreams` is set to `false`, this does nothing. +Otherwise a `'pause'` event is emitted, this goes to the stream that is +currently being drained, so you can use it to apply back pressure. + +### combinedStream.end(); + +Sets `combinedStream.writable` to false, emits an `'end'` event, and removes +all streams from the queue. + +### combinedStream.destroy(); + +Same as `combinedStream.end()`, except it emits a `'close'` event instead of +`'end'`. + +## License + +combined-stream is licensed under the MIT license. diff --git a/packages/字体精简工具/node_modules/combined-stream/lib/combined_stream.js b/packages/字体精简工具/node_modules/combined-stream/lib/combined_stream.js new file mode 100644 index 0000000..125f097 --- /dev/null +++ b/packages/字体精简工具/node_modules/combined-stream/lib/combined_stream.js @@ -0,0 +1,208 @@ +var util = require('util'); +var Stream = require('stream').Stream; +var DelayedStream = require('delayed-stream'); + +module.exports = CombinedStream; +function CombinedStream() { + this.writable = false; + this.readable = true; + this.dataSize = 0; + this.maxDataSize = 2 * 1024 * 1024; + this.pauseStreams = true; + + this._released = false; + this._streams = []; + this._currentStream = null; + this._insideLoop = false; + this._pendingNext = false; +} +util.inherits(CombinedStream, Stream); + +CombinedStream.create = function(options) { + var combinedStream = new this(); + + options = options || {}; + for (var option in options) { + combinedStream[option] = options[option]; + } + + return combinedStream; +}; + +CombinedStream.isStreamLike = function(stream) { + return (typeof stream !== 'function') + && (typeof stream !== 'string') + && (typeof stream !== 'boolean') + && (typeof stream !== 'number') + && (!Buffer.isBuffer(stream)); +}; + +CombinedStream.prototype.append = function(stream) { + var isStreamLike = CombinedStream.isStreamLike(stream); + + if (isStreamLike) { + if (!(stream instanceof DelayedStream)) { + var newStream = DelayedStream.create(stream, { + maxDataSize: Infinity, + pauseStream: this.pauseStreams, + }); + stream.on('data', this._checkDataSize.bind(this)); + stream = newStream; + } + + this._handleErrors(stream); + + if (this.pauseStreams) { + stream.pause(); + } + } + + this._streams.push(stream); + return this; +}; + +CombinedStream.prototype.pipe = function(dest, options) { + Stream.prototype.pipe.call(this, dest, options); + this.resume(); + return dest; +}; + +CombinedStream.prototype._getNext = function() { + this._currentStream = null; + + if (this._insideLoop) { + this._pendingNext = true; + return; // defer call + } + + this._insideLoop = true; + try { + do { + this._pendingNext = false; + this._realGetNext(); + } while (this._pendingNext); + } finally { + this._insideLoop = false; + } +}; + +CombinedStream.prototype._realGetNext = function() { + var stream = this._streams.shift(); + + + if (typeof stream == 'undefined') { + this.end(); + return; + } + + if (typeof stream !== 'function') { + this._pipeNext(stream); + return; + } + + var getStream = stream; + getStream(function(stream) { + var isStreamLike = CombinedStream.isStreamLike(stream); + if (isStreamLike) { + stream.on('data', this._checkDataSize.bind(this)); + this._handleErrors(stream); + } + + this._pipeNext(stream); + }.bind(this)); +}; + +CombinedStream.prototype._pipeNext = function(stream) { + this._currentStream = stream; + + var isStreamLike = CombinedStream.isStreamLike(stream); + if (isStreamLike) { + stream.on('end', this._getNext.bind(this)); + stream.pipe(this, {end: false}); + return; + } + + var value = stream; + this.write(value); + this._getNext(); +}; + +CombinedStream.prototype._handleErrors = function(stream) { + var self = this; + stream.on('error', function(err) { + self._emitError(err); + }); +}; + +CombinedStream.prototype.write = function(data) { + this.emit('data', data); +}; + +CombinedStream.prototype.pause = function() { + if (!this.pauseStreams) { + return; + } + + if(this.pauseStreams && this._currentStream && typeof(this._currentStream.pause) == 'function') this._currentStream.pause(); + this.emit('pause'); +}; + +CombinedStream.prototype.resume = function() { + if (!this._released) { + this._released = true; + this.writable = true; + this._getNext(); + } + + if(this.pauseStreams && this._currentStream && typeof(this._currentStream.resume) == 'function') this._currentStream.resume(); + this.emit('resume'); +}; + +CombinedStream.prototype.end = function() { + this._reset(); + this.emit('end'); +}; + +CombinedStream.prototype.destroy = function() { + this._reset(); + this.emit('close'); +}; + +CombinedStream.prototype._reset = function() { + this.writable = false; + this._streams = []; + this._currentStream = null; +}; + +CombinedStream.prototype._checkDataSize = function() { + this._updateDataSize(); + if (this.dataSize <= this.maxDataSize) { + return; + } + + var message = + 'DelayedStream#maxDataSize of ' + this.maxDataSize + ' bytes exceeded.'; + this._emitError(new Error(message)); +}; + +CombinedStream.prototype._updateDataSize = function() { + this.dataSize = 0; + + var self = this; + this._streams.forEach(function(stream) { + if (!stream.dataSize) { + return; + } + + self.dataSize += stream.dataSize; + }); + + if (this._currentStream && this._currentStream.dataSize) { + this.dataSize += this._currentStream.dataSize; + } +}; + +CombinedStream.prototype._emitError = function(err) { + this._reset(); + this.emit('error', err); +}; diff --git a/packages/字体精简工具/node_modules/combined-stream/package.json b/packages/字体精简工具/node_modules/combined-stream/package.json new file mode 100644 index 0000000..4335357 --- /dev/null +++ b/packages/字体精简工具/node_modules/combined-stream/package.json @@ -0,0 +1,58 @@ +{ + "_from": "combined-stream@~1.0.6", + "_id": "combined-stream@1.0.8", + "_inBundle": false, + "_integrity": "sha1-w9RaizT9cwYxoRCoolIGgrMdWn8=", + "_location": "/combined-stream", + "_phantomChildren": {}, + "_requested": { + "type": "range", + "registry": true, + "raw": "combined-stream@~1.0.6", + "name": "combined-stream", + "escapedName": "combined-stream", + "rawSpec": "~1.0.6", + "saveSpec": null, + "fetchSpec": "~1.0.6" + }, + "_requiredBy": [ + "/form-data", + "/request" + ], + "_resolved": "https://registry.npm.taobao.org/combined-stream/download/combined-stream-1.0.8.tgz", + "_shasum": "c3d45a8b34fd730631a110a8a2520682b31d5a7f", + "_spec": "combined-stream@~1.0.6", + "_where": "D:\\workspace\\plugin\\mini_font\\packages\\mini_font\\publish\\mini_font\\node_modules\\request", + "author": { + "name": "Felix Geisendörfer", + "email": "felix@debuggable.com", + "url": "http://debuggable.com/" + }, + "bugs": { + "url": "https://github.com/felixge/node-combined-stream/issues" + }, + "bundleDependencies": false, + "dependencies": { + "delayed-stream": "~1.0.0" + }, + "deprecated": false, + "description": "A stream that emits multiple other streams one after another.", + "devDependencies": { + "far": "~0.0.7" + }, + "engines": { + "node": ">= 0.8" + }, + "homepage": "https://github.com/felixge/node-combined-stream", + "license": "MIT", + "main": "./lib/combined_stream", + "name": "combined-stream", + "repository": { + "type": "git", + "url": "git://github.com/felixge/node-combined-stream.git" + }, + "scripts": { + "test": "node test/run.js" + }, + "version": "1.0.8" +} diff --git a/packages/字体精简工具/node_modules/combined-stream/yarn.lock b/packages/字体精简工具/node_modules/combined-stream/yarn.lock new file mode 100644 index 0000000..7edf418 --- /dev/null +++ b/packages/字体精简工具/node_modules/combined-stream/yarn.lock @@ -0,0 +1,17 @@ +# THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY. +# yarn lockfile v1 + + +delayed-stream@~1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/delayed-stream/-/delayed-stream-1.0.0.tgz#df3ae199acadfb7d440aaae0b29e2272b24ec619" + +far@~0.0.7: + version "0.0.7" + resolved "https://registry.yarnpkg.com/far/-/far-0.0.7.tgz#01c1fd362bcd26ce9cf161af3938aa34619f79a7" + dependencies: + oop "0.0.3" + +oop@0.0.3: + version "0.0.3" + resolved "https://registry.yarnpkg.com/oop/-/oop-0.0.3.tgz#70fa405a5650891a194fdc82ca68dad6dabf4401" diff --git a/packages/字体精简工具/node_modules/concat-map/.travis.yml b/packages/字体精简工具/node_modules/concat-map/.travis.yml new file mode 100644 index 0000000..f1d0f13 --- /dev/null +++ b/packages/字体精简工具/node_modules/concat-map/.travis.yml @@ -0,0 +1,4 @@ +language: node_js +node_js: + - 0.4 + - 0.6 diff --git a/packages/字体精简工具/node_modules/concat-map/LICENSE b/packages/字体精简工具/node_modules/concat-map/LICENSE new file mode 100644 index 0000000..ee27ba4 --- /dev/null +++ b/packages/字体精简工具/node_modules/concat-map/LICENSE @@ -0,0 +1,18 @@ +This software is released under the MIT 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/packages/字体精简工具/node_modules/concat-map/README.markdown b/packages/字体精简工具/node_modules/concat-map/README.markdown new file mode 100644 index 0000000..408f70a --- /dev/null +++ b/packages/字体精简工具/node_modules/concat-map/README.markdown @@ -0,0 +1,62 @@ +concat-map +========== + +Concatenative mapdashery. + +[![browser support](http://ci.testling.com/substack/node-concat-map.png)](http://ci.testling.com/substack/node-concat-map) + +[![build status](https://secure.travis-ci.org/substack/node-concat-map.png)](http://travis-ci.org/substack/node-concat-map) + +example +======= + +``` js +var concatMap = require('concat-map'); +var xs = [ 1, 2, 3, 4, 5, 6 ]; +var ys = concatMap(xs, function (x) { + return x % 2 ? [ x - 0.1, x, x + 0.1 ] : []; +}); +console.dir(ys); +``` + +*** + +``` +[ 0.9, 1, 1.1, 2.9, 3, 3.1, 4.9, 5, 5.1 ] +``` + +methods +======= + +``` js +var concatMap = require('concat-map') +``` + +concatMap(xs, fn) +----------------- + +Return an array of concatenated elements by calling `fn(x, i)` for each element +`x` and each index `i` in the array `xs`. + +When `fn(x, i)` returns an array, its result will be concatenated with the +result array. If `fn(x, i)` returns anything else, that value will be pushed +onto the end of the result array. + +install +======= + +With [npm](http://npmjs.org) do: + +``` +npm install concat-map +``` + +license +======= + +MIT + +notes +===== + +This module was written while sitting high above the ground in a tree. diff --git a/packages/字体精简工具/node_modules/concat-map/example/map.js b/packages/字体精简工具/node_modules/concat-map/example/map.js new file mode 100644 index 0000000..3365621 --- /dev/null +++ b/packages/字体精简工具/node_modules/concat-map/example/map.js @@ -0,0 +1,6 @@ +var concatMap = require('../'); +var xs = [ 1, 2, 3, 4, 5, 6 ]; +var ys = concatMap(xs, function (x) { + return x % 2 ? [ x - 0.1, x, x + 0.1 ] : []; +}); +console.dir(ys); diff --git a/packages/字体精简工具/node_modules/concat-map/index.js b/packages/字体精简工具/node_modules/concat-map/index.js new file mode 100644 index 0000000..b29a781 --- /dev/null +++ b/packages/字体精简工具/node_modules/concat-map/index.js @@ -0,0 +1,13 @@ +module.exports = function (xs, fn) { + var res = []; + for (var i = 0; i < xs.length; i++) { + var x = fn(xs[i], i); + if (isArray(x)) res.push.apply(res, x); + else res.push(x); + } + return res; +}; + +var isArray = Array.isArray || function (xs) { + return Object.prototype.toString.call(xs) === '[object Array]'; +}; diff --git a/packages/字体精简工具/node_modules/concat-map/package.json b/packages/字体精简工具/node_modules/concat-map/package.json new file mode 100644 index 0000000..f2d9c58 --- /dev/null +++ b/packages/字体精简工具/node_modules/concat-map/package.json @@ -0,0 +1,88 @@ +{ + "_from": "concat-map@0.0.1", + "_id": "concat-map@0.0.1", + "_inBundle": false, + "_integrity": "sha1-2Klr13/Wjfd5OnMDajug1UBdR3s=", + "_location": "/concat-map", + "_phantomChildren": {}, + "_requested": { + "type": "version", + "registry": true, + "raw": "concat-map@0.0.1", + "name": "concat-map", + "escapedName": "concat-map", + "rawSpec": "0.0.1", + "saveSpec": null, + "fetchSpec": "0.0.1" + }, + "_requiredBy": [ + "/brace-expansion" + ], + "_resolved": "https://registry.npm.taobao.org/concat-map/download/concat-map-0.0.1.tgz", + "_shasum": "d8a96bd77fd68df7793a73036a3ba0d5405d477b", + "_spec": "concat-map@0.0.1", + "_where": "D:\\workspace\\plugin\\mini_font\\packages\\mini_font\\publish\\mini_font\\node_modules\\brace-expansion", + "author": { + "name": "James Halliday", + "email": "mail@substack.net", + "url": "http://substack.net" + }, + "bugs": { + "url": "https://github.com/substack/node-concat-map/issues" + }, + "bundleDependencies": false, + "deprecated": false, + "description": "concatenative mapdashery", + "devDependencies": { + "tape": "~2.4.0" + }, + "directories": { + "example": "example", + "test": "test" + }, + "homepage": "https://github.com/substack/node-concat-map#readme", + "keywords": [ + "concat", + "concatMap", + "map", + "functional", + "higher-order" + ], + "license": "MIT", + "main": "index.js", + "name": "concat-map", + "repository": { + "type": "git", + "url": "git://github.com/substack/node-concat-map.git" + }, + "scripts": { + "test": "tape test/*.js" + }, + "testling": { + "files": "test/*.js", + "browsers": { + "ie": [ + 6, + 7, + 8, + 9 + ], + "ff": [ + 3.5, + 10, + 15 + ], + "chrome": [ + 10, + 22 + ], + "safari": [ + 5.1 + ], + "opera": [ + 12 + ] + } + }, + "version": "0.0.1" +} diff --git a/packages/字体精简工具/node_modules/concat-map/test/map.js b/packages/字体精简工具/node_modules/concat-map/test/map.js new file mode 100644 index 0000000..fdbd702 --- /dev/null +++ b/packages/字体精简工具/node_modules/concat-map/test/map.js @@ -0,0 +1,39 @@ +var concatMap = require('../'); +var test = require('tape'); + +test('empty or not', function (t) { + var xs = [ 1, 2, 3, 4, 5, 6 ]; + var ixes = []; + var ys = concatMap(xs, function (x, ix) { + ixes.push(ix); + return x % 2 ? [ x - 0.1, x, x + 0.1 ] : []; + }); + t.same(ys, [ 0.9, 1, 1.1, 2.9, 3, 3.1, 4.9, 5, 5.1 ]); + t.same(ixes, [ 0, 1, 2, 3, 4, 5 ]); + t.end(); +}); + +test('always something', function (t) { + var xs = [ 'a', 'b', 'c', 'd' ]; + var ys = concatMap(xs, function (x) { + return x === 'b' ? [ 'B', 'B', 'B' ] : [ x ]; + }); + t.same(ys, [ 'a', 'B', 'B', 'B', 'c', 'd' ]); + t.end(); +}); + +test('scalars', function (t) { + var xs = [ 'a', 'b', 'c', 'd' ]; + var ys = concatMap(xs, function (x) { + return x === 'b' ? [ 'B', 'B', 'B' ] : x; + }); + t.same(ys, [ 'a', 'B', 'B', 'B', 'c', 'd' ]); + t.end(); +}); + +test('undefs', function (t) { + var xs = [ 'a', 'b', 'c', 'd' ]; + var ys = concatMap(xs, function () {}); + t.same(ys, [ undefined, undefined, undefined, undefined ]); + t.end(); +}); diff --git a/packages/字体精简工具/node_modules/concat-stream/LICENSE b/packages/字体精简工具/node_modules/concat-stream/LICENSE new file mode 100644 index 0000000..99c130e --- /dev/null +++ b/packages/字体精简工具/node_modules/concat-stream/LICENSE @@ -0,0 +1,24 @@ +The MIT License + +Copyright (c) 2013 Max Ogden + +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/packages/字体精简工具/node_modules/concat-stream/index.js b/packages/字体精简工具/node_modules/concat-stream/index.js new file mode 100644 index 0000000..dd672a7 --- /dev/null +++ b/packages/字体精简工具/node_modules/concat-stream/index.js @@ -0,0 +1,144 @@ +var Writable = require('readable-stream').Writable +var inherits = require('inherits') +var bufferFrom = require('buffer-from') + +if (typeof Uint8Array === 'undefined') { + var U8 = require('typedarray').Uint8Array +} else { + var U8 = Uint8Array +} + +function ConcatStream(opts, cb) { + if (!(this instanceof ConcatStream)) return new ConcatStream(opts, cb) + + if (typeof opts === 'function') { + cb = opts + opts = {} + } + if (!opts) opts = {} + + var encoding = opts.encoding + var shouldInferEncoding = false + + if (!encoding) { + shouldInferEncoding = true + } else { + encoding = String(encoding).toLowerCase() + if (encoding === 'u8' || encoding === 'uint8') { + encoding = 'uint8array' + } + } + + Writable.call(this, { objectMode: true }) + + this.encoding = encoding + this.shouldInferEncoding = shouldInferEncoding + + if (cb) this.on('finish', function () { cb(this.getBody()) }) + this.body = [] +} + +module.exports = ConcatStream +inherits(ConcatStream, Writable) + +ConcatStream.prototype._write = function(chunk, enc, next) { + this.body.push(chunk) + next() +} + +ConcatStream.prototype.inferEncoding = function (buff) { + var firstBuffer = buff === undefined ? this.body[0] : buff; + if (Buffer.isBuffer(firstBuffer)) return 'buffer' + if (typeof Uint8Array !== 'undefined' && firstBuffer instanceof Uint8Array) return 'uint8array' + if (Array.isArray(firstBuffer)) return 'array' + if (typeof firstBuffer === 'string') return 'string' + if (Object.prototype.toString.call(firstBuffer) === "[object Object]") return 'object' + return 'buffer' +} + +ConcatStream.prototype.getBody = function () { + if (!this.encoding && this.body.length === 0) return [] + if (this.shouldInferEncoding) this.encoding = this.inferEncoding() + if (this.encoding === 'array') return arrayConcat(this.body) + if (this.encoding === 'string') return stringConcat(this.body) + if (this.encoding === 'buffer') return bufferConcat(this.body) + if (this.encoding === 'uint8array') return u8Concat(this.body) + return this.body +} + +var isArray = Array.isArray || function (arr) { + return Object.prototype.toString.call(arr) == '[object Array]' +} + +function isArrayish (arr) { + return /Array\]$/.test(Object.prototype.toString.call(arr)) +} + +function isBufferish (p) { + return typeof p === 'string' || isArrayish(p) || (p && typeof p.subarray === 'function') +} + +function stringConcat (parts) { + var strings = [] + var needsToString = false + for (var i = 0; i < parts.length; i++) { + var p = parts[i] + if (typeof p === 'string') { + strings.push(p) + } else if (Buffer.isBuffer(p)) { + strings.push(p) + } else if (isBufferish(p)) { + strings.push(bufferFrom(p)) + } else { + strings.push(bufferFrom(String(p))) + } + } + if (Buffer.isBuffer(parts[0])) { + strings = Buffer.concat(strings) + strings = strings.toString('utf8') + } else { + strings = strings.join('') + } + return strings +} + +function bufferConcat (parts) { + var bufs = [] + for (var i = 0; i < parts.length; i++) { + var p = parts[i] + if (Buffer.isBuffer(p)) { + bufs.push(p) + } else if (isBufferish(p)) { + bufs.push(bufferFrom(p)) + } else { + bufs.push(bufferFrom(String(p))) + } + } + return Buffer.concat(bufs) +} + +function arrayConcat (parts) { + var res = [] + for (var i = 0; i < parts.length; i++) { + res.push.apply(res, parts[i]) + } + return res +} + +function u8Concat (parts) { + var len = 0 + for (var i = 0; i < parts.length; i++) { + if (typeof parts[i] === 'string') { + parts[i] = bufferFrom(parts[i]) + } + len += parts[i].length + } + var u8 = new U8(len) + for (var i = 0, offset = 0; i < parts.length; i++) { + var part = parts[i] + for (var j = 0; j < part.length; j++) { + u8[offset++] = part[j] + } + } + return u8 +} diff --git a/packages/字体精简工具/node_modules/concat-stream/package.json b/packages/字体精简工具/node_modules/concat-stream/package.json new file mode 100644 index 0000000..a434f60 --- /dev/null +++ b/packages/字体精简工具/node_modules/concat-stream/package.json @@ -0,0 +1,85 @@ +{ + "_from": "concat-stream@^1.6.2", + "_id": "concat-stream@1.6.2", + "_inBundle": false, + "_integrity": "sha1-kEvfGUzTEi/Gdcd/xKw9T/D9GjQ=", + "_location": "/concat-stream", + "_phantomChildren": {}, + "_requested": { + "type": "range", + "registry": true, + "raw": "concat-stream@^1.6.2", + "name": "concat-stream", + "escapedName": "concat-stream", + "rawSpec": "^1.6.2", + "saveSpec": null, + "fetchSpec": "^1.6.2" + }, + "_requiredBy": [ + "/fontmin", + "/gulp/gulp-cli" + ], + "_resolved": "https://registry.npm.taobao.org/concat-stream/download/concat-stream-1.6.2.tgz", + "_shasum": "904bdf194cd3122fc675c77fc4ac3d4ff0fd1a34", + "_spec": "concat-stream@^1.6.2", + "_where": "D:\\workspace\\plugin\\mini_font\\packages\\mini_font\\publish\\mini_font\\node_modules\\fontmin", + "author": { + "name": "Max Ogden", + "email": "max@maxogden.com" + }, + "bugs": { + "url": "http://github.com/maxogden/concat-stream/issues" + }, + "bundleDependencies": false, + "dependencies": { + "buffer-from": "^1.0.0", + "inherits": "^2.0.3", + "readable-stream": "^2.2.2", + "typedarray": "^0.0.6" + }, + "deprecated": false, + "description": "writable stream that concatenates strings or binary data and calls a callback with the result", + "devDependencies": { + "tape": "^4.6.3" + }, + "engines": [ + "node >= 0.8" + ], + "files": [ + "index.js" + ], + "homepage": "https://github.com/maxogden/concat-stream#readme", + "license": "MIT", + "main": "index.js", + "name": "concat-stream", + "repository": { + "type": "git", + "url": "git+ssh://git@github.com/maxogden/concat-stream.git" + }, + "scripts": { + "test": "tape test/*.js test/server/*.js" + }, + "tags": [ + "stream", + "simple", + "util", + "utility" + ], + "testling": { + "files": "test/*.js", + "browsers": [ + "ie/8..latest", + "firefox/17..latest", + "firefox/nightly", + "chrome/22..latest", + "chrome/canary", + "opera/12..latest", + "opera/next", + "safari/5.1..latest", + "ipad/6.0..latest", + "iphone/6.0..latest", + "android-browser/4.2..latest" + ] + }, + "version": "1.6.2" +} diff --git a/packages/字体精简工具/node_modules/concat-stream/readme.md b/packages/字体精简工具/node_modules/concat-stream/readme.md new file mode 100644 index 0000000..7aa19c4 --- /dev/null +++ b/packages/字体精简工具/node_modules/concat-stream/readme.md @@ -0,0 +1,102 @@ +# concat-stream + +Writable stream that concatenates all the data from a stream and calls a callback with the result. Use this when you want to collect all the data from a stream into a single buffer. + +[![Build Status](https://travis-ci.org/maxogden/concat-stream.svg?branch=master)](https://travis-ci.org/maxogden/concat-stream) + +[![NPM](https://nodei.co/npm/concat-stream.png)](https://nodei.co/npm/concat-stream/) + +### description + +Streams emit many buffers. If you want to collect all of the buffers, and when the stream ends concatenate all of the buffers together and receive a single buffer then this is the module for you. + +Only use this if you know you can fit all of the output of your stream into a single Buffer (e.g. in RAM). + +There are also `objectMode` streams that emit things other than Buffers, and you can concatenate these too. See below for details. + +## Related + +`concat-stream` is part of the [mississippi stream utility collection](https://github.com/maxogden/mississippi) which includes more useful stream modules similar to this one. + +### examples + +#### Buffers + +```js +var fs = require('fs') +var concat = require('concat-stream') + +var readStream = fs.createReadStream('cat.png') +var concatStream = concat(gotPicture) + +readStream.on('error', handleError) +readStream.pipe(concatStream) + +function gotPicture(imageBuffer) { + // imageBuffer is all of `cat.png` as a node.js Buffer +} + +function handleError(err) { + // handle your error appropriately here, e.g.: + console.error(err) // print the error to STDERR + process.exit(1) // exit program with non-zero exit code +} + +``` + +#### Arrays + +```js +var write = concat(function(data) {}) +write.write([1,2,3]) +write.write([4,5,6]) +write.end() +// data will be [1,2,3,4,5,6] in the above callback +``` + +#### Uint8Arrays + +```js +var write = concat(function(data) {}) +var a = new Uint8Array(3) +a[0] = 97; a[1] = 98; a[2] = 99 +write.write(a) +write.write('!') +write.end(Buffer.from('!!1')) +``` + +See `test/` for more examples + +# methods + +```js +var concat = require('concat-stream') +``` + +## var writable = concat(opts={}, cb) + +Return a `writable` stream that will fire `cb(data)` with all of the data that +was written to the stream. Data can be written to `writable` as strings, +Buffers, arrays of byte integers, and Uint8Arrays. + +By default `concat-stream` will give you back the same data type as the type of the first buffer written to the stream. Use `opts.encoding` to set what format `data` should be returned as, e.g. if you if you don't want to rely on the built-in type checking or for some other reason. + +* `string` - get a string +* `buffer` - get back a Buffer +* `array` - get an array of byte integers +* `uint8array`, `u8`, `uint8` - get back a Uint8Array +* `object`, get back an array of Objects + +If you don't specify an encoding, and the types can't be inferred (e.g. you write things that aren't in the list above), it will try to convert concat them into a `Buffer`. + +If nothing is written to `writable` then `data` will be an empty array `[]`. + +# error handling + +`concat-stream` does not handle errors for you, so you must handle errors on whatever streams you pipe into `concat-stream`. This is a general rule when programming with node.js streams: always handle errors on each and every stream. Since `concat-stream` is not itself a stream it does not emit errors. + +We recommend using [`end-of-stream`](https://npmjs.org/end-of-stream) or [`pump`](https://npmjs.org/pump) for writing error tolerant stream code. + +# license + +MIT LICENSE diff --git a/packages/字体精简工具/node_modules/console-control-strings/LICENSE b/packages/字体精简工具/node_modules/console-control-strings/LICENSE new file mode 100644 index 0000000..e756052 --- /dev/null +++ b/packages/字体精简工具/node_modules/console-control-strings/LICENSE @@ -0,0 +1,13 @@ +Copyright (c) 2014, Rebecca Turner + +Permission to use, copy, modify, and/or distribute this software for any +purpose with or without fee is hereby granted, provided that the above +copyright notice and this permission notice appear in all copies. + +THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES +WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF +MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR +ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES +WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN +ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF +OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. diff --git a/packages/字体精简工具/node_modules/console-control-strings/README.md b/packages/字体精简工具/node_modules/console-control-strings/README.md new file mode 100644 index 0000000..f58cc8d --- /dev/null +++ b/packages/字体精简工具/node_modules/console-control-strings/README.md @@ -0,0 +1,145 @@ +# Console Control Strings + +A library of cross-platform tested terminal/console command strings for +doing things like color and cursor positioning. This is a subset of both +ansi and vt100. All control codes included work on both Windows & Unix-like +OSes, except where noted. + +## Usage + +```js +var consoleControl = require('console-control-strings') + +console.log(consoleControl.color('blue','bgRed', 'bold') + 'hi there' + consoleControl.color('reset')) +process.stdout.write(consoleControl.goto(75, 10)) +``` + +## Why Another? + +There are tons of libraries similar to this one. I wanted one that was: + +1. Very clear about compatibility goals. +2. Could emit, for instance, a start color code without an end one. +3. Returned strings w/o writing to streams. +4. Was not weighed down with other unrelated baggage. + +## Functions + +### var code = consoleControl.up(_num = 1_) + +Returns the escape sequence to move _num_ lines up. + +### var code = consoleControl.down(_num = 1_) + +Returns the escape sequence to move _num_ lines down. + +### var code = consoleControl.forward(_num = 1_) + +Returns the escape sequence to move _num_ lines righ. + +### var code = consoleControl.back(_num = 1_) + +Returns the escape sequence to move _num_ lines left. + +### var code = consoleControl.nextLine(_num = 1_) + +Returns the escape sequence to move _num_ lines down and to the beginning of +the line. + +### var code = consoleControl.previousLine(_num = 1_) + +Returns the escape sequence to move _num_ lines up and to the beginning of +the line. + +### var code = consoleControl.eraseData() + +Returns the escape sequence to erase everything from the current cursor +position to the bottom right of the screen. This is line based, so it +erases the remainder of the current line and all following lines. + +### var code = consoleControl.eraseLine() + +Returns the escape sequence to erase to the end of the current line. + +### var code = consoleControl.goto(_x_, _y_) + +Returns the escape sequence to move the cursor to the designated position. +Note that the origin is _1, 1_ not _0, 0_. + +### var code = consoleControl.gotoSOL() + +Returns the escape sequence to move the cursor to the beginning of the +current line. (That is, it returns a carriage return, `\r`.) + +### var code = consoleControl.beep() + +Returns the escape sequence to cause the termianl to beep. (That is, it +returns unicode character `\x0007`, a Control-G.) + +### var code = consoleControl.hideCursor() + +Returns the escape sequence to hide the cursor. + +### var code = consoleControl.showCursor() + +Returns the escape sequence to show the cursor. + +### var code = consoleControl.color(_colors = []_) + +### var code = consoleControl.color(_color1_, _color2_, _…_, _colorn_) + +Returns the escape sequence to set the current terminal display attributes +(mostly colors). Arguments can either be a list of attributes or an array +of attributes. The difference between passing in an array or list of colors +and calling `.color` separately for each one, is that in the former case a +single escape sequence will be produced where as in the latter each change +will have its own distinct escape sequence. Each attribute can be one of: + +* Reset: + * **reset** – Reset all attributes to the terminal default. +* Styles: + * **bold** – Display text as bold. In some terminals this means using a + bold font, in others this means changing the color. In some it means + both. + * **italic** – Display text as italic. This is not available in most Windows terminals. + * **underline** – Underline text. This is not available in most Windows Terminals. + * **inverse** – Invert the foreground and background colors. + * **stopBold** – Do not display text as bold. + * **stopItalic** – Do not display text as italic. + * **stopUnderline** – Do not underline text. + * **stopInverse** – Do not invert foreground and background. +* Colors: + * **white** + * **black** + * **blue** + * **cyan** + * **green** + * **magenta** + * **red** + * **yellow** + * **grey** / **brightBlack** + * **brightRed** + * **brightGreen** + * **brightYellow** + * **brightBlue** + * **brightMagenta** + * **brightCyan** + * **brightWhite** +* Background Colors: + * **bgWhite** + * **bgBlack** + * **bgBlue** + * **bgCyan** + * **bgGreen** + * **bgMagenta** + * **bgRed** + * **bgYellow** + * **bgGrey** / **bgBrightBlack** + * **bgBrightRed** + * **bgBrightGreen** + * **bgBrightYellow** + * **bgBrightBlue** + * **bgBrightMagenta** + * **bgBrightCyan** + * **bgBrightWhite** + diff --git a/packages/字体精简工具/node_modules/console-control-strings/README.md~ b/packages/字体精简工具/node_modules/console-control-strings/README.md~ new file mode 100644 index 0000000..6eb34e8 --- /dev/null +++ b/packages/字体精简工具/node_modules/console-control-strings/README.md~ @@ -0,0 +1,140 @@ +# Console Control Strings + +A library of cross-platform tested terminal/console command strings for +doing things like color and cursor positioning. This is a subset of both +ansi and vt100. All control codes included work on both Windows & Unix-like +OSes, except where noted. + +## Usage + +```js +var consoleControl = require('console-control-strings') + +console.log(consoleControl.color('blue','bgRed', 'bold') + 'hi there' + consoleControl.color('reset')) +process.stdout.write(consoleControl.goto(75, 10)) +``` + +## Why Another? + +There are tons of libraries similar to this one. I wanted one that was: + +1. Very clear about compatibility goals. +2. Could emit, for instance, a start color code without an end one. +3. Returned strings w/o writing to streams. +4. Was not weighed down with other unrelated baggage. + +## Functions + +### var code = consoleControl.up(_num = 1_) + +Returns the escape sequence to move _num_ lines up. + +### var code = consoleControl.down(_num = 1_) + +Returns the escape sequence to move _num_ lines down. + +### var code = consoleControl.forward(_num = 1_) + +Returns the escape sequence to move _num_ lines righ. + +### var code = consoleControl.back(_num = 1_) + +Returns the escape sequence to move _num_ lines left. + +### var code = consoleControl.nextLine(_num = 1_) + +Returns the escape sequence to move _num_ lines down and to the beginning of +the line. + +### var code = consoleControl.previousLine(_num = 1_) + +Returns the escape sequence to move _num_ lines up and to the beginning of +the line. + +### var code = consoleControl.eraseData() + +Returns the escape sequence to erase everything from the current cursor +position to the bottom right of the screen. This is line based, so it +erases the remainder of the current line and all following lines. + +### var code = consoleControl.eraseLine() + +Returns the escape sequence to erase to the end of the current line. + +### var code = consoleControl.goto(_x_, _y_) + +Returns the escape sequence to move the cursor to the designated position. +Note that the origin is _1, 1_ not _0, 0_. + +### var code = consoleControl.gotoSOL() + +Returns the escape sequence to move the cursor to the beginning of the +current line. (That is, it returns a carriage return, `\r`.) + +### var code = consoleControl.hideCursor() + +Returns the escape sequence to hide the cursor. + +### var code = consoleControl.showCursor() + +Returns the escape sequence to show the cursor. + +### var code = consoleControl.color(_colors = []_) + +### var code = consoleControl.color(_color1_, _color2_, _…_, _colorn_) + +Returns the escape sequence to set the current terminal display attributes +(mostly colors). Arguments can either be a list of attributes or an array +of attributes. The difference between passing in an array or list of colors +and calling `.color` separately for each one, is that in the former case a +single escape sequence will be produced where as in the latter each change +will have its own distinct escape sequence. Each attribute can be one of: + +* Reset: + * **reset** – Reset all attributes to the terminal default. +* Styles: + * **bold** – Display text as bold. In some terminals this means using a + bold font, in others this means changing the color. In some it means + both. + * **italic** – Display text as italic. This is not available in most Windows terminals. + * **underline** – Underline text. This is not available in most Windows Terminals. + * **inverse** – Invert the foreground and background colors. + * **stopBold** – Do not display text as bold. + * **stopItalic** – Do not display text as italic. + * **stopUnderline** – Do not underline text. + * **stopInverse** – Do not invert foreground and background. +* Colors: + * **white** + * **black** + * **blue** + * **cyan** + * **green** + * **magenta** + * **red** + * **yellow** + * **grey** / **brightBlack** + * **brightRed** + * **brightGreen** + * **brightYellow** + * **brightBlue** + * **brightMagenta** + * **brightCyan** + * **brightWhite** +* Background Colors: + * **bgWhite** + * **bgBlack** + * **bgBlue** + * **bgCyan** + * **bgGreen** + * **bgMagenta** + * **bgRed** + * **bgYellow** + * **bgGrey** / **bgBrightBlack** + * **bgBrightRed** + * **bgBrightGreen** + * **bgBrightYellow** + * **bgBrightBlue** + * **bgBrightMagenta** + * **bgBrightCyan** + * **bgBrightWhite** + diff --git a/packages/字体精简工具/node_modules/console-control-strings/index.js b/packages/字体精简工具/node_modules/console-control-strings/index.js new file mode 100644 index 0000000..bf89034 --- /dev/null +++ b/packages/字体精简工具/node_modules/console-control-strings/index.js @@ -0,0 +1,125 @@ +'use strict' + +// These tables borrowed from `ansi` + +var prefix = '\x1b[' + +exports.up = function up (num) { + return prefix + (num || '') + 'A' +} + +exports.down = function down (num) { + return prefix + (num || '') + 'B' +} + +exports.forward = function forward (num) { + return prefix + (num || '') + 'C' +} + +exports.back = function back (num) { + return prefix + (num || '') + 'D' +} + +exports.nextLine = function nextLine (num) { + return prefix + (num || '') + 'E' +} + +exports.previousLine = function previousLine (num) { + return prefix + (num || '') + 'F' +} + +exports.horizontalAbsolute = function horizontalAbsolute (num) { + if (num == null) throw new Error('horizontalAboslute requires a column to position to') + return prefix + num + 'G' +} + +exports.eraseData = function eraseData () { + return prefix + 'J' +} + +exports.eraseLine = function eraseLine () { + return prefix + 'K' +} + +exports.goto = function (x, y) { + return prefix + y + ';' + x + 'H' +} + +exports.gotoSOL = function () { + return '\r' +} + +exports.beep = function () { + return '\x07' +} + +exports.hideCursor = function hideCursor () { + return prefix + '?25l' +} + +exports.showCursor = function showCursor () { + return prefix + '?25h' +} + +var colors = { + reset: 0, +// styles + bold: 1, + italic: 3, + underline: 4, + inverse: 7, +// resets + stopBold: 22, + stopItalic: 23, + stopUnderline: 24, + stopInverse: 27, +// colors + white: 37, + black: 30, + blue: 34, + cyan: 36, + green: 32, + magenta: 35, + red: 31, + yellow: 33, + bgWhite: 47, + bgBlack: 40, + bgBlue: 44, + bgCyan: 46, + bgGreen: 42, + bgMagenta: 45, + bgRed: 41, + bgYellow: 43, + + grey: 90, + brightBlack: 90, + brightRed: 91, + brightGreen: 92, + brightYellow: 93, + brightBlue: 94, + brightMagenta: 95, + brightCyan: 96, + brightWhite: 97, + + bgGrey: 100, + bgBrightBlack: 100, + bgBrightRed: 101, + bgBrightGreen: 102, + bgBrightYellow: 103, + bgBrightBlue: 104, + bgBrightMagenta: 105, + bgBrightCyan: 106, + bgBrightWhite: 107 +} + +exports.color = function color (colorWith) { + if (arguments.length !== 1 || !Array.isArray(colorWith)) { + colorWith = Array.prototype.slice.call(arguments) + } + return prefix + colorWith.map(colorNameToCode).join(';') + 'm' +} + +function colorNameToCode (color) { + if (colors[color] != null) return colors[color] + throw new Error('Unknown color or style name: ' + color) +} diff --git a/packages/字体精简工具/node_modules/console-control-strings/package.json b/packages/字体精简工具/node_modules/console-control-strings/package.json new file mode 100644 index 0000000..d9f47c0 --- /dev/null +++ b/packages/字体精简工具/node_modules/console-control-strings/package.json @@ -0,0 +1,61 @@ +{ + "_from": "console-control-strings@~1.1.0", + "_id": "console-control-strings@1.1.0", + "_inBundle": false, + "_integrity": "sha1-PXz0Rk22RG6mRL9LOVB/mFEAjo4=", + "_location": "/console-control-strings", + "_phantomChildren": {}, + "_requested": { + "type": "range", + "registry": true, + "raw": "console-control-strings@~1.1.0", + "name": "console-control-strings", + "escapedName": "console-control-strings", + "rawSpec": "~1.1.0", + "saveSpec": null, + "fetchSpec": "~1.1.0" + }, + "_requiredBy": [ + "/gauge", + "/npmlog" + ], + "_resolved": "https://registry.nlark.com/console-control-strings/download/console-control-strings-1.1.0.tgz", + "_shasum": "3d7cf4464db6446ea644bf4b39507f9851008e8e", + "_spec": "console-control-strings@~1.1.0", + "_where": "D:\\workspace\\plugin\\mini_font\\packages\\mini_font\\publish\\mini_font\\node_modules\\npmlog", + "author": { + "name": "Rebecca Turner", + "email": "me@re-becca.org", + "url": "http://re-becca.org/" + }, + "bugs": { + "url": "https://github.com/iarna/console-control-strings/issues" + }, + "bundleDependencies": false, + "deprecated": false, + "description": "A library of cross-platform tested terminal/console command strings for doing things like color and cursor positioning. This is a subset of both ansi and vt100. All control codes included work on both Windows & Unix-like OSes, except where noted.", + "devDependencies": { + "standard": "^7.1.2", + "tap": "^5.7.2" + }, + "directories": { + "test": "test" + }, + "files": [ + "LICENSE", + "index.js" + ], + "homepage": "https://github.com/iarna/console-control-strings#readme", + "keywords": [], + "license": "ISC", + "main": "index.js", + "name": "console-control-strings", + "repository": { + "type": "git", + "url": "git+https://github.com/iarna/console-control-strings.git" + }, + "scripts": { + "test": "standard && tap test/*.js" + }, + "version": "1.1.0" +} diff --git a/packages/字体精简工具/node_modules/convert-source-map/LICENSE b/packages/字体精简工具/node_modules/convert-source-map/LICENSE new file mode 100644 index 0000000..41702c5 --- /dev/null +++ b/packages/字体精简工具/node_modules/convert-source-map/LICENSE @@ -0,0 +1,23 @@ +Copyright 2013 Thorsten Lorenz. +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/packages/字体精简工具/node_modules/convert-source-map/README.md b/packages/字体精简工具/node_modules/convert-source-map/README.md new file mode 100644 index 0000000..86b218e --- /dev/null +++ b/packages/字体精简工具/node_modules/convert-source-map/README.md @@ -0,0 +1,125 @@ +# convert-source-map [![build status](https://secure.travis-ci.org/thlorenz/convert-source-map.svg?branch=master)](http://travis-ci.org/thlorenz/convert-source-map) + +become a patron + +Converts a source-map from/to different formats and allows adding/changing properties. + +```js +var convert = require('convert-source-map'); + +var json = convert + .fromComment('//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiYnVpbGQvZm9vLm1pbi5qcyIsInNvdXJjZXMiOlsic3JjL2Zvby5qcyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQSIsInNvdXJjZVJvb3QiOiIvIn0=') + .toJSON(); + +var modified = convert + .fromComment('//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiYnVpbGQvZm9vLm1pbi5qcyIsInNvdXJjZXMiOlsic3JjL2Zvby5qcyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQSIsInNvdXJjZVJvb3QiOiIvIn0=') + .setProperty('sources', [ 'SRC/FOO.JS' ]) + .toJSON(); + +console.log(json); +console.log(modified); +``` + +```json +{"version":3,"file":"build/foo.min.js","sources":["src/foo.js"],"names":[],"mappings":"AAAA","sourceRoot":"/"} +{"version":3,"file":"build/foo.min.js","sources":["SRC/FOO.JS"],"names":[],"mappings":"AAAA","sourceRoot":"/"} +``` + +## API + +### fromObject(obj) + +Returns source map converter from given object. + +### fromJSON(json) + +Returns source map converter from given json string. + +### fromBase64(base64) + +Returns source map converter from given base64 encoded json string. + +### fromComment(comment) + +Returns source map converter from given base64 encoded json string prefixed with `//# sourceMappingURL=...`. + +### fromMapFileComment(comment, mapFileDir) + +Returns source map converter from given `filename` by parsing `//# sourceMappingURL=filename`. + +`filename` must point to a file that is found inside the `mapFileDir`. Most tools store this file right next to the +generated file, i.e. the one containing the source map. + +### fromSource(source) + +Finds last sourcemap comment in file and returns source map converter or returns null if no source map comment was found. + +### fromMapFileSource(source, mapFileDir) + +Finds last sourcemap comment in file and returns source map converter or returns null if no source map comment was +found. + +The sourcemap will be read from the map file found by parsing `# sourceMappingURL=file` comment. For more info see +fromMapFileComment. + +### toObject() + +Returns a copy of the underlying source map. + +### toJSON([space]) + +Converts source map to json string. If `space` is given (optional), this will be passed to +[JSON.stringify](https://developer.mozilla.org/en-US/docs/JavaScript/Reference/Global_Objects/JSON/stringify) when the +JSON string is generated. + +### toBase64() + +Converts source map to base64 encoded json string. + +### toComment([options]) + +Converts source map to an inline comment that can be appended to the source-file. + +By default, the comment is formatted like: `//# sourceMappingURL=...`, which you would +normally see in a JS source file. + +When `options.multiline == true`, the comment is formatted like: `/*# sourceMappingURL=... */`, which you would find in a CSS source file. + +### addProperty(key, value) + +Adds given property to the source map. Throws an error if property already exists. + +### setProperty(key, value) + +Sets given property to the source map. If property doesn't exist it is added, otherwise its value is updated. + +### getProperty(key) + +Gets given property of the source map. + +### removeComments(src) + +Returns `src` with all source map comments removed + +### removeMapFileComments(src) + +Returns `src` with all source map comments pointing to map files removed. + +### commentRegex + +Provides __a fresh__ RegExp each time it is accessed. Can be used to find source map comments. + +### mapFileCommentRegex + +Provides __a fresh__ RegExp each time it is accessed. Can be used to find source map comments pointing to map files. + +### generateMapFileComment(file, [options]) + +Returns a comment that links to an external source map via `file`. + +By default, the comment is formatted like: `//# sourceMappingURL=...`, which you would normally see in a JS source file. + +When `options.multiline == true`, the comment is formatted like: `/*# sourceMappingURL=... */`, which you would find in a CSS source file. + + +[![Bitdeli Badge](https://d2weczhvl823v0.cloudfront.net/thlorenz/convert-source-map/trend.png)](https://bitdeli.com/free "Bitdeli Badge") diff --git a/packages/字体精简工具/node_modules/convert-source-map/index.js b/packages/字体精简工具/node_modules/convert-source-map/index.js new file mode 100644 index 0000000..3aeae10 --- /dev/null +++ b/packages/字体精简工具/node_modules/convert-source-map/index.js @@ -0,0 +1,136 @@ +'use strict'; +var fs = require('fs'); +var path = require('path'); +var SafeBuffer = require('safe-buffer'); + +Object.defineProperty(exports, 'commentRegex', { + get: function getCommentRegex () { + return /^\s*\/(?:\/|\*)[@#]\s+sourceMappingURL=data:(?:application|text)\/json;(?:charset[:=]\S+?;)?base64,(?:.*)$/mg; + } +}); + +Object.defineProperty(exports, 'mapFileCommentRegex', { + get: function getMapFileCommentRegex () { + // Matches sourceMappingURL in either // or /* comment styles. + return /(?:\/\/[@#][ \t]+sourceMappingURL=([^\s'"`]+?)[ \t]*$)|(?:\/\*[@#][ \t]+sourceMappingURL=([^\*]+?)[ \t]*(?:\*\/){1}[ \t]*$)/mg; + } +}); + + +function decodeBase64(base64) { + return SafeBuffer.Buffer.from(base64, 'base64').toString(); +} + +function stripComment(sm) { + return sm.split(',').pop(); +} + +function readFromFileMap(sm, dir) { + // NOTE: this will only work on the server since it attempts to read the map file + + var r = exports.mapFileCommentRegex.exec(sm); + + // for some odd reason //# .. captures in 1 and /* .. */ in 2 + var filename = r[1] || r[2]; + var filepath = path.resolve(dir, filename); + + try { + return fs.readFileSync(filepath, 'utf8'); + } catch (e) { + throw new Error('An error occurred while trying to read the map file at ' + filepath + '\n' + e); + } +} + +function Converter (sm, opts) { + opts = opts || {}; + + if (opts.isFileComment) sm = readFromFileMap(sm, opts.commentFileDir); + if (opts.hasComment) sm = stripComment(sm); + if (opts.isEncoded) sm = decodeBase64(sm); + if (opts.isJSON || opts.isEncoded) sm = JSON.parse(sm); + + this.sourcemap = sm; +} + +Converter.prototype.toJSON = function (space) { + return JSON.stringify(this.sourcemap, null, space); +}; + +Converter.prototype.toBase64 = function () { + var json = this.toJSON(); + return SafeBuffer.Buffer.from(json, 'utf8').toString('base64'); +}; + +Converter.prototype.toComment = function (options) { + var base64 = this.toBase64(); + var data = 'sourceMappingURL=data:application/json;charset=utf-8;base64,' + base64; + return options && options.multiline ? '/*# ' + data + ' */' : '//# ' + data; +}; + +// returns copy instead of original +Converter.prototype.toObject = function () { + return JSON.parse(this.toJSON()); +}; + +Converter.prototype.addProperty = function (key, value) { + if (this.sourcemap.hasOwnProperty(key)) throw new Error('property "' + key + '" already exists on the sourcemap, use set property instead'); + return this.setProperty(key, value); +}; + +Converter.prototype.setProperty = function (key, value) { + this.sourcemap[key] = value; + return this; +}; + +Converter.prototype.getProperty = function (key) { + return this.sourcemap[key]; +}; + +exports.fromObject = function (obj) { + return new Converter(obj); +}; + +exports.fromJSON = function (json) { + return new Converter(json, { isJSON: true }); +}; + +exports.fromBase64 = function (base64) { + return new Converter(base64, { isEncoded: true }); +}; + +exports.fromComment = function (comment) { + comment = comment + .replace(/^\/\*/g, '//') + .replace(/\*\/$/g, ''); + + return new Converter(comment, { isEncoded: true, hasComment: true }); +}; + +exports.fromMapFileComment = function (comment, dir) { + return new Converter(comment, { commentFileDir: dir, isFileComment: true, isJSON: true }); +}; + +// Finds last sourcemap comment in file or returns null if none was found +exports.fromSource = function (content) { + var m = content.match(exports.commentRegex); + return m ? exports.fromComment(m.pop()) : null; +}; + +// Finds last sourcemap comment in file or returns null if none was found +exports.fromMapFileSource = function (content, dir) { + var m = content.match(exports.mapFileCommentRegex); + return m ? exports.fromMapFileComment(m.pop(), dir) : null; +}; + +exports.removeComments = function (src) { + return src.replace(exports.commentRegex, ''); +}; + +exports.removeMapFileComments = function (src) { + return src.replace(exports.mapFileCommentRegex, ''); +}; + +exports.generateMapFileComment = function (file, options) { + var data = 'sourceMappingURL=' + file; + return options && options.multiline ? '/*# ' + data + ' */' : '//# ' + data; +}; diff --git a/packages/字体精简工具/node_modules/convert-source-map/package.json b/packages/字体精简工具/node_modules/convert-source-map/package.json new file mode 100644 index 0000000..2f04a2f --- /dev/null +++ b/packages/字体精简工具/node_modules/convert-source-map/package.json @@ -0,0 +1,72 @@ +{ + "_from": "convert-source-map@^1.5.0", + "_id": "convert-source-map@1.7.0", + "_inBundle": false, + "_integrity": "sha1-F6LLiC1/d9NJBYXizmxSRCSjpEI=", + "_location": "/convert-source-map", + "_phantomChildren": {}, + "_requested": { + "type": "range", + "registry": true, + "raw": "convert-source-map@^1.5.0", + "name": "convert-source-map", + "escapedName": "convert-source-map", + "rawSpec": "^1.5.0", + "saveSpec": null, + "fetchSpec": "^1.5.0" + }, + "_requiredBy": [ + "/vinyl-sourcemap" + ], + "_resolved": "https://registry.nlark.com/convert-source-map/download/convert-source-map-1.7.0.tgz?cache=0&sync_timestamp=1618847182423&other_urls=https%3A%2F%2Fregistry.nlark.com%2Fconvert-source-map%2Fdownload%2Fconvert-source-map-1.7.0.tgz", + "_shasum": "17a2cb882d7f77d3490585e2ce6c524424a3a442", + "_spec": "convert-source-map@^1.5.0", + "_where": "D:\\workspace\\plugin\\mini_font\\packages\\mini_font\\publish\\mini_font\\node_modules\\vinyl-sourcemap", + "author": { + "name": "Thorsten Lorenz", + "email": "thlorenz@gmx.de", + "url": "http://thlorenz.com" + }, + "browser": { + "fs": false + }, + "bugs": { + "url": "https://github.com/thlorenz/convert-source-map/issues" + }, + "bundleDependencies": false, + "dependencies": { + "safe-buffer": "~5.1.1" + }, + "deprecated": false, + "description": "Converts a source-map from/to different formats and allows adding/changing properties.", + "devDependencies": { + "inline-source-map": "~0.6.2", + "tap": "~9.0.0" + }, + "engine": { + "node": ">=0.6" + }, + "files": [ + "index.js" + ], + "homepage": "https://github.com/thlorenz/convert-source-map", + "keywords": [ + "convert", + "sourcemap", + "source", + "map", + "browser", + "debug" + ], + "license": "MIT", + "main": "index.js", + "name": "convert-source-map", + "repository": { + "type": "git", + "url": "git://github.com/thlorenz/convert-source-map.git" + }, + "scripts": { + "test": "tap test/*.js --color" + }, + "version": "1.7.0" +} diff --git a/packages/字体精简工具/node_modules/core-util-is/LICENSE b/packages/字体精简工具/node_modules/core-util-is/LICENSE new file mode 100644 index 0000000..d8d7f94 --- /dev/null +++ b/packages/字体精简工具/node_modules/core-util-is/LICENSE @@ -0,0 +1,19 @@ +Copyright Node.js contributors. 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/packages/字体精简工具/node_modules/core-util-is/README.md b/packages/字体精简工具/node_modules/core-util-is/README.md new file mode 100644 index 0000000..5a76b41 --- /dev/null +++ b/packages/字体精简工具/node_modules/core-util-is/README.md @@ -0,0 +1,3 @@ +# core-util-is + +The `util.is*` functions introduced in Node v0.12. diff --git a/packages/字体精简工具/node_modules/core-util-is/float.patch b/packages/字体精简工具/node_modules/core-util-is/float.patch new file mode 100644 index 0000000..a06d5c0 --- /dev/null +++ b/packages/字体精简工具/node_modules/core-util-is/float.patch @@ -0,0 +1,604 @@ +diff --git a/lib/util.js b/lib/util.js +index a03e874..9074e8e 100644 +--- a/lib/util.js ++++ b/lib/util.js +@@ -19,430 +19,6 @@ + // OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE + // USE OR OTHER DEALINGS IN THE SOFTWARE. + +-var formatRegExp = /%[sdj%]/g; +-exports.format = function(f) { +- if (!isString(f)) { +- var objects = []; +- for (var i = 0; i < arguments.length; i++) { +- objects.push(inspect(arguments[i])); +- } +- return objects.join(' '); +- } +- +- var i = 1; +- var args = arguments; +- var len = args.length; +- var str = String(f).replace(formatRegExp, function(x) { +- if (x === '%%') return '%'; +- if (i >= len) return x; +- switch (x) { +- case '%s': return String(args[i++]); +- case '%d': return Number(args[i++]); +- case '%j': +- try { +- return JSON.stringify(args[i++]); +- } catch (_) { +- return '[Circular]'; +- } +- default: +- return x; +- } +- }); +- for (var x = args[i]; i < len; x = args[++i]) { +- if (isNull(x) || !isObject(x)) { +- str += ' ' + x; +- } else { +- str += ' ' + inspect(x); +- } +- } +- return str; +-}; +- +- +-// Mark that a method should not be used. +-// Returns a modified function which warns once by default. +-// If --no-deprecation is set, then it is a no-op. +-exports.deprecate = function(fn, msg) { +- // Allow for deprecating things in the process of starting up. +- if (isUndefined(global.process)) { +- return function() { +- return exports.deprecate(fn, msg).apply(this, arguments); +- }; +- } +- +- if (process.noDeprecation === true) { +- return fn; +- } +- +- var warned = false; +- function deprecated() { +- if (!warned) { +- if (process.throwDeprecation) { +- throw new Error(msg); +- } else if (process.traceDeprecation) { +- console.trace(msg); +- } else { +- console.error(msg); +- } +- warned = true; +- } +- return fn.apply(this, arguments); +- } +- +- return deprecated; +-}; +- +- +-var debugs = {}; +-var debugEnviron; +-exports.debuglog = function(set) { +- if (isUndefined(debugEnviron)) +- debugEnviron = process.env.NODE_DEBUG || ''; +- set = set.toUpperCase(); +- if (!debugs[set]) { +- if (new RegExp('\\b' + set + '\\b', 'i').test(debugEnviron)) { +- var pid = process.pid; +- debugs[set] = function() { +- var msg = exports.format.apply(exports, arguments); +- console.error('%s %d: %s', set, pid, msg); +- }; +- } else { +- debugs[set] = function() {}; +- } +- } +- return debugs[set]; +-}; +- +- +-/** +- * Echos the value of a value. Trys to print the value out +- * in the best way possible given the different types. +- * +- * @param {Object} obj The object to print out. +- * @param {Object} opts Optional options object that alters the output. +- */ +-/* legacy: obj, showHidden, depth, colors*/ +-function inspect(obj, opts) { +- // default options +- var ctx = { +- seen: [], +- stylize: stylizeNoColor +- }; +- // legacy... +- if (arguments.length >= 3) ctx.depth = arguments[2]; +- if (arguments.length >= 4) ctx.colors = arguments[3]; +- if (isBoolean(opts)) { +- // legacy... +- ctx.showHidden = opts; +- } else if (opts) { +- // got an "options" object +- exports._extend(ctx, opts); +- } +- // set default options +- if (isUndefined(ctx.showHidden)) ctx.showHidden = false; +- if (isUndefined(ctx.depth)) ctx.depth = 2; +- if (isUndefined(ctx.colors)) ctx.colors = false; +- if (isUndefined(ctx.customInspect)) ctx.customInspect = true; +- if (ctx.colors) ctx.stylize = stylizeWithColor; +- return formatValue(ctx, obj, ctx.depth); +-} +-exports.inspect = inspect; +- +- +-// http://en.wikipedia.org/wiki/ANSI_escape_code#graphics +-inspect.colors = { +- 'bold' : [1, 22], +- 'italic' : [3, 23], +- 'underline' : [4, 24], +- 'inverse' : [7, 27], +- 'white' : [37, 39], +- 'grey' : [90, 39], +- 'black' : [30, 39], +- 'blue' : [34, 39], +- 'cyan' : [36, 39], +- 'green' : [32, 39], +- 'magenta' : [35, 39], +- 'red' : [31, 39], +- 'yellow' : [33, 39] +-}; +- +-// Don't use 'blue' not visible on cmd.exe +-inspect.styles = { +- 'special': 'cyan', +- 'number': 'yellow', +- 'boolean': 'yellow', +- 'undefined': 'grey', +- 'null': 'bold', +- 'string': 'green', +- 'date': 'magenta', +- // "name": intentionally not styling +- 'regexp': 'red' +-}; +- +- +-function stylizeWithColor(str, styleType) { +- var style = inspect.styles[styleType]; +- +- if (style) { +- return '\u001b[' + inspect.colors[style][0] + 'm' + str + +- '\u001b[' + inspect.colors[style][1] + 'm'; +- } else { +- return str; +- } +-} +- +- +-function stylizeNoColor(str, styleType) { +- return str; +-} +- +- +-function arrayToHash(array) { +- var hash = {}; +- +- array.forEach(function(val, idx) { +- hash[val] = true; +- }); +- +- return hash; +-} +- +- +-function formatValue(ctx, value, recurseTimes) { +- // Provide a hook for user-specified inspect functions. +- // Check that value is an object with an inspect function on it +- if (ctx.customInspect && +- value && +- isFunction(value.inspect) && +- // Filter out the util module, it's inspect function is special +- value.inspect !== exports.inspect && +- // Also filter out any prototype objects using the circular check. +- !(value.constructor && value.constructor.prototype === value)) { +- var ret = value.inspect(recurseTimes, ctx); +- if (!isString(ret)) { +- ret = formatValue(ctx, ret, recurseTimes); +- } +- return ret; +- } +- +- // Primitive types cannot have properties +- var primitive = formatPrimitive(ctx, value); +- if (primitive) { +- return primitive; +- } +- +- // Look up the keys of the object. +- var keys = Object.keys(value); +- var visibleKeys = arrayToHash(keys); +- +- if (ctx.showHidden) { +- keys = Object.getOwnPropertyNames(value); +- } +- +- // Some type of object without properties can be shortcutted. +- if (keys.length === 0) { +- if (isFunction(value)) { +- var name = value.name ? ': ' + value.name : ''; +- return ctx.stylize('[Function' + name + ']', 'special'); +- } +- if (isRegExp(value)) { +- return ctx.stylize(RegExp.prototype.toString.call(value), 'regexp'); +- } +- if (isDate(value)) { +- return ctx.stylize(Date.prototype.toString.call(value), 'date'); +- } +- if (isError(value)) { +- return formatError(value); +- } +- } +- +- var base = '', array = false, braces = ['{', '}']; +- +- // Make Array say that they are Array +- if (isArray(value)) { +- array = true; +- braces = ['[', ']']; +- } +- +- // Make functions say that they are functions +- if (isFunction(value)) { +- var n = value.name ? ': ' + value.name : ''; +- base = ' [Function' + n + ']'; +- } +- +- // Make RegExps say that they are RegExps +- if (isRegExp(value)) { +- base = ' ' + RegExp.prototype.toString.call(value); +- } +- +- // Make dates with properties first say the date +- if (isDate(value)) { +- base = ' ' + Date.prototype.toUTCString.call(value); +- } +- +- // Make error with message first say the error +- if (isError(value)) { +- base = ' ' + formatError(value); +- } +- +- if (keys.length === 0 && (!array || value.length == 0)) { +- return braces[0] + base + braces[1]; +- } +- +- if (recurseTimes < 0) { +- if (isRegExp(value)) { +- return ctx.stylize(RegExp.prototype.toString.call(value), 'regexp'); +- } else { +- return ctx.stylize('[Object]', 'special'); +- } +- } +- +- ctx.seen.push(value); +- +- var output; +- if (array) { +- output = formatArray(ctx, value, recurseTimes, visibleKeys, keys); +- } else { +- output = keys.map(function(key) { +- return formatProperty(ctx, value, recurseTimes, visibleKeys, key, array); +- }); +- } +- +- ctx.seen.pop(); +- +- return reduceToSingleString(output, base, braces); +-} +- +- +-function formatPrimitive(ctx, value) { +- if (isUndefined(value)) +- return ctx.stylize('undefined', 'undefined'); +- if (isString(value)) { +- var simple = '\'' + JSON.stringify(value).replace(/^"|"$/g, '') +- .replace(/'/g, "\\'") +- .replace(/\\"/g, '"') + '\''; +- return ctx.stylize(simple, 'string'); +- } +- if (isNumber(value)) { +- // Format -0 as '-0'. Strict equality won't distinguish 0 from -0, +- // so instead we use the fact that 1 / -0 < 0 whereas 1 / 0 > 0 . +- if (value === 0 && 1 / value < 0) +- return ctx.stylize('-0', 'number'); +- return ctx.stylize('' + value, 'number'); +- } +- if (isBoolean(value)) +- return ctx.stylize('' + value, 'boolean'); +- // For some reason typeof null is "object", so special case here. +- if (isNull(value)) +- return ctx.stylize('null', 'null'); +-} +- +- +-function formatError(value) { +- return '[' + Error.prototype.toString.call(value) + ']'; +-} +- +- +-function formatArray(ctx, value, recurseTimes, visibleKeys, keys) { +- var output = []; +- for (var i = 0, l = value.length; i < l; ++i) { +- if (hasOwnProperty(value, String(i))) { +- output.push(formatProperty(ctx, value, recurseTimes, visibleKeys, +- String(i), true)); +- } else { +- output.push(''); +- } +- } +- keys.forEach(function(key) { +- if (!key.match(/^\d+$/)) { +- output.push(formatProperty(ctx, value, recurseTimes, visibleKeys, +- key, true)); +- } +- }); +- return output; +-} +- +- +-function formatProperty(ctx, value, recurseTimes, visibleKeys, key, array) { +- var name, str, desc; +- desc = Object.getOwnPropertyDescriptor(value, key) || { value: value[key] }; +- if (desc.get) { +- if (desc.set) { +- str = ctx.stylize('[Getter/Setter]', 'special'); +- } else { +- str = ctx.stylize('[Getter]', 'special'); +- } +- } else { +- if (desc.set) { +- str = ctx.stylize('[Setter]', 'special'); +- } +- } +- if (!hasOwnProperty(visibleKeys, key)) { +- name = '[' + key + ']'; +- } +- if (!str) { +- if (ctx.seen.indexOf(desc.value) < 0) { +- if (isNull(recurseTimes)) { +- str = formatValue(ctx, desc.value, null); +- } else { +- str = formatValue(ctx, desc.value, recurseTimes - 1); +- } +- if (str.indexOf('\n') > -1) { +- if (array) { +- str = str.split('\n').map(function(line) { +- return ' ' + line; +- }).join('\n').substr(2); +- } else { +- str = '\n' + str.split('\n').map(function(line) { +- return ' ' + line; +- }).join('\n'); +- } +- } +- } else { +- str = ctx.stylize('[Circular]', 'special'); +- } +- } +- if (isUndefined(name)) { +- if (array && key.match(/^\d+$/)) { +- return str; +- } +- name = JSON.stringify('' + key); +- if (name.match(/^"([a-zA-Z_][a-zA-Z_0-9]*)"$/)) { +- name = name.substr(1, name.length - 2); +- name = ctx.stylize(name, 'name'); +- } else { +- name = name.replace(/'/g, "\\'") +- .replace(/\\"/g, '"') +- .replace(/(^"|"$)/g, "'"); +- name = ctx.stylize(name, 'string'); +- } +- } +- +- return name + ': ' + str; +-} +- +- +-function reduceToSingleString(output, base, braces) { +- var numLinesEst = 0; +- var length = output.reduce(function(prev, cur) { +- numLinesEst++; +- if (cur.indexOf('\n') >= 0) numLinesEst++; +- return prev + cur.replace(/\u001b\[\d\d?m/g, '').length + 1; +- }, 0); +- +- if (length > 60) { +- return braces[0] + +- (base === '' ? '' : base + '\n ') + +- ' ' + +- output.join(',\n ') + +- ' ' + +- braces[1]; +- } +- +- return braces[0] + base + ' ' + output.join(', ') + ' ' + braces[1]; +-} +- +- + // NOTE: These type checking functions intentionally don't use `instanceof` + // because it is fragile and can be easily faked with `Object.create()`. + function isArray(ar) { +@@ -522,166 +98,10 @@ function isPrimitive(arg) { + exports.isPrimitive = isPrimitive; + + function isBuffer(arg) { +- return arg instanceof Buffer; ++ return Buffer.isBuffer(arg); + } + exports.isBuffer = isBuffer; + + function objectToString(o) { + return Object.prototype.toString.call(o); +-} +- +- +-function pad(n) { +- return n < 10 ? '0' + n.toString(10) : n.toString(10); +-} +- +- +-var months = ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', +- 'Oct', 'Nov', 'Dec']; +- +-// 26 Feb 16:19:34 +-function timestamp() { +- var d = new Date(); +- var time = [pad(d.getHours()), +- pad(d.getMinutes()), +- pad(d.getSeconds())].join(':'); +- return [d.getDate(), months[d.getMonth()], time].join(' '); +-} +- +- +-// log is just a thin wrapper to console.log that prepends a timestamp +-exports.log = function() { +- console.log('%s - %s', timestamp(), exports.format.apply(exports, arguments)); +-}; +- +- +-/** +- * Inherit the prototype methods from one constructor into another. +- * +- * The Function.prototype.inherits from lang.js rewritten as a standalone +- * function (not on Function.prototype). NOTE: If this file is to be loaded +- * during bootstrapping this function needs to be rewritten using some native +- * functions as prototype setup using normal JavaScript does not work as +- * expected during bootstrapping (see mirror.js in r114903). +- * +- * @param {function} ctor Constructor function which needs to inherit the +- * prototype. +- * @param {function} superCtor Constructor function to inherit prototype from. +- */ +-exports.inherits = function(ctor, superCtor) { +- ctor.super_ = superCtor; +- ctor.prototype = Object.create(superCtor.prototype, { +- constructor: { +- value: ctor, +- enumerable: false, +- writable: true, +- configurable: true +- } +- }); +-}; +- +-exports._extend = function(origin, add) { +- // Don't do anything if add isn't an object +- if (!add || !isObject(add)) return origin; +- +- var keys = Object.keys(add); +- var i = keys.length; +- while (i--) { +- origin[keys[i]] = add[keys[i]]; +- } +- return origin; +-}; +- +-function hasOwnProperty(obj, prop) { +- return Object.prototype.hasOwnProperty.call(obj, prop); +-} +- +- +-// Deprecated old stuff. +- +-exports.p = exports.deprecate(function() { +- for (var i = 0, len = arguments.length; i < len; ++i) { +- console.error(exports.inspect(arguments[i])); +- } +-}, 'util.p: Use console.error() instead'); +- +- +-exports.exec = exports.deprecate(function() { +- return require('child_process').exec.apply(this, arguments); +-}, 'util.exec is now called `child_process.exec`.'); +- +- +-exports.print = exports.deprecate(function() { +- for (var i = 0, len = arguments.length; i < len; ++i) { +- process.stdout.write(String(arguments[i])); +- } +-}, 'util.print: Use console.log instead'); +- +- +-exports.puts = exports.deprecate(function() { +- for (var i = 0, len = arguments.length; i < len; ++i) { +- process.stdout.write(arguments[i] + '\n'); +- } +-}, 'util.puts: Use console.log instead'); +- +- +-exports.debug = exports.deprecate(function(x) { +- process.stderr.write('DEBUG: ' + x + '\n'); +-}, 'util.debug: Use console.error instead'); +- +- +-exports.error = exports.deprecate(function(x) { +- for (var i = 0, len = arguments.length; i < len; ++i) { +- process.stderr.write(arguments[i] + '\n'); +- } +-}, 'util.error: Use console.error instead'); +- +- +-exports.pump = exports.deprecate(function(readStream, writeStream, callback) { +- var callbackCalled = false; +- +- function call(a, b, c) { +- if (callback && !callbackCalled) { +- callback(a, b, c); +- callbackCalled = true; +- } +- } +- +- readStream.addListener('data', function(chunk) { +- if (writeStream.write(chunk) === false) readStream.pause(); +- }); +- +- writeStream.addListener('drain', function() { +- readStream.resume(); +- }); +- +- readStream.addListener('end', function() { +- writeStream.end(); +- }); +- +- readStream.addListener('close', function() { +- call(); +- }); +- +- readStream.addListener('error', function(err) { +- writeStream.end(); +- call(err); +- }); +- +- writeStream.addListener('error', function(err) { +- readStream.destroy(); +- call(err); +- }); +-}, 'util.pump(): Use readableStream.pipe() instead'); +- +- +-var uv; +-exports._errnoException = function(err, syscall) { +- if (isUndefined(uv)) uv = process.binding('uv'); +- var errname = uv.errname(err); +- var e = new Error(syscall + ' ' + errname); +- e.code = errname; +- e.errno = errname; +- e.syscall = syscall; +- return e; +-}; ++} \ No newline at end of file diff --git a/packages/字体精简工具/node_modules/core-util-is/lib/util.js b/packages/字体精简工具/node_modules/core-util-is/lib/util.js new file mode 100644 index 0000000..ff4c851 --- /dev/null +++ b/packages/字体精简工具/node_modules/core-util-is/lib/util.js @@ -0,0 +1,107 @@ +// Copyright Joyent, Inc. and other Node contributors. +// +// 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. + +// NOTE: These type checking functions intentionally don't use `instanceof` +// because it is fragile and can be easily faked with `Object.create()`. + +function isArray(arg) { + if (Array.isArray) { + return Array.isArray(arg); + } + return objectToString(arg) === '[object Array]'; +} +exports.isArray = isArray; + +function isBoolean(arg) { + return typeof arg === 'boolean'; +} +exports.isBoolean = isBoolean; + +function isNull(arg) { + return arg === null; +} +exports.isNull = isNull; + +function isNullOrUndefined(arg) { + return arg == null; +} +exports.isNullOrUndefined = isNullOrUndefined; + +function isNumber(arg) { + return typeof arg === 'number'; +} +exports.isNumber = isNumber; + +function isString(arg) { + return typeof arg === 'string'; +} +exports.isString = isString; + +function isSymbol(arg) { + return typeof arg === 'symbol'; +} +exports.isSymbol = isSymbol; + +function isUndefined(arg) { + return arg === void 0; +} +exports.isUndefined = isUndefined; + +function isRegExp(re) { + return objectToString(re) === '[object RegExp]'; +} +exports.isRegExp = isRegExp; + +function isObject(arg) { + return typeof arg === 'object' && arg !== null; +} +exports.isObject = isObject; + +function isDate(d) { + return objectToString(d) === '[object Date]'; +} +exports.isDate = isDate; + +function isError(e) { + return (objectToString(e) === '[object Error]' || e instanceof Error); +} +exports.isError = isError; + +function isFunction(arg) { + return typeof arg === 'function'; +} +exports.isFunction = isFunction; + +function isPrimitive(arg) { + return arg === null || + typeof arg === 'boolean' || + typeof arg === 'number' || + typeof arg === 'string' || + typeof arg === 'symbol' || // ES6 symbol + typeof arg === 'undefined'; +} +exports.isPrimitive = isPrimitive; + +exports.isBuffer = Buffer.isBuffer; + +function objectToString(o) { + return Object.prototype.toString.call(o); +} diff --git a/packages/字体精简工具/node_modules/core-util-is/package.json b/packages/字体精简工具/node_modules/core-util-is/package.json new file mode 100644 index 0000000..b74eaa5 --- /dev/null +++ b/packages/字体精简工具/node_modules/core-util-is/package.json @@ -0,0 +1,64 @@ +{ + "_from": "core-util-is@~1.0.0", + "_id": "core-util-is@1.0.2", + "_inBundle": false, + "_integrity": "sha1-tf1UIgqivFq1eqtxQMlAdUUDwac=", + "_location": "/core-util-is", + "_phantomChildren": {}, + "_requested": { + "type": "range", + "registry": true, + "raw": "core-util-is@~1.0.0", + "name": "core-util-is", + "escapedName": "core-util-is", + "rawSpec": "~1.0.0", + "saveSpec": null, + "fetchSpec": "~1.0.0" + }, + "_requiredBy": [ + "/readable-stream", + "/through2/readable-stream", + "/verror" + ], + "_resolved": "https://registry.nlark.com/core-util-is/download/core-util-is-1.0.2.tgz", + "_shasum": "b5fd54220aa2bc5ab57aab7140c940754503c1a7", + "_spec": "core-util-is@~1.0.0", + "_where": "D:\\workspace\\plugin\\mini_font\\packages\\mini_font\\publish\\mini_font\\node_modules\\readable-stream", + "author": { + "name": "Isaac Z. Schlueter", + "email": "i@izs.me", + "url": "http://blog.izs.me/" + }, + "bugs": { + "url": "https://github.com/isaacs/core-util-is/issues" + }, + "bundleDependencies": false, + "deprecated": false, + "description": "The `util.is*` functions introduced in Node v0.12.", + "devDependencies": { + "tap": "^2.3.0" + }, + "homepage": "https://github.com/isaacs/core-util-is#readme", + "keywords": [ + "util", + "isBuffer", + "isArray", + "isNumber", + "isString", + "isRegExp", + "isThis", + "isThat", + "polyfill" + ], + "license": "MIT", + "main": "lib/util.js", + "name": "core-util-is", + "repository": { + "type": "git", + "url": "git://github.com/isaacs/core-util-is.git" + }, + "scripts": { + "test": "tap test.js" + }, + "version": "1.0.2" +} diff --git a/packages/字体精简工具/node_modules/core-util-is/test.js b/packages/字体精简工具/node_modules/core-util-is/test.js new file mode 100644 index 0000000..1a490c6 --- /dev/null +++ b/packages/字体精简工具/node_modules/core-util-is/test.js @@ -0,0 +1,68 @@ +var assert = require('tap'); + +var t = require('./lib/util'); + +assert.equal(t.isArray([]), true); +assert.equal(t.isArray({}), false); + +assert.equal(t.isBoolean(null), false); +assert.equal(t.isBoolean(true), true); +assert.equal(t.isBoolean(false), true); + +assert.equal(t.isNull(null), true); +assert.equal(t.isNull(undefined), false); +assert.equal(t.isNull(false), false); +assert.equal(t.isNull(), false); + +assert.equal(t.isNullOrUndefined(null), true); +assert.equal(t.isNullOrUndefined(undefined), true); +assert.equal(t.isNullOrUndefined(false), false); +assert.equal(t.isNullOrUndefined(), true); + +assert.equal(t.isNumber(null), false); +assert.equal(t.isNumber('1'), false); +assert.equal(t.isNumber(1), true); + +assert.equal(t.isString(null), false); +assert.equal(t.isString('1'), true); +assert.equal(t.isString(1), false); + +assert.equal(t.isSymbol(null), false); +assert.equal(t.isSymbol('1'), false); +assert.equal(t.isSymbol(1), false); +assert.equal(t.isSymbol(Symbol()), true); + +assert.equal(t.isUndefined(null), false); +assert.equal(t.isUndefined(undefined), true); +assert.equal(t.isUndefined(false), false); +assert.equal(t.isUndefined(), true); + +assert.equal(t.isRegExp(null), false); +assert.equal(t.isRegExp('1'), false); +assert.equal(t.isRegExp(new RegExp()), true); + +assert.equal(t.isObject({}), true); +assert.equal(t.isObject([]), true); +assert.equal(t.isObject(new RegExp()), true); +assert.equal(t.isObject(new Date()), true); + +assert.equal(t.isDate(null), false); +assert.equal(t.isDate('1'), false); +assert.equal(t.isDate(new Date()), true); + +assert.equal(t.isError(null), false); +assert.equal(t.isError({ err: true }), false); +assert.equal(t.isError(new Error()), true); + +assert.equal(t.isFunction(null), false); +assert.equal(t.isFunction({ }), false); +assert.equal(t.isFunction(function() {}), true); + +assert.equal(t.isPrimitive(null), true); +assert.equal(t.isPrimitive(''), true); +assert.equal(t.isPrimitive(0), true); +assert.equal(t.isPrimitive(new Date()), false); + +assert.equal(t.isBuffer(null), false); +assert.equal(t.isBuffer({}), false); +assert.equal(t.isBuffer(new Buffer(0)), true); diff --git a/packages/字体精简工具/node_modules/currently-unhandled/browser.js b/packages/字体精简工具/node_modules/currently-unhandled/browser.js new file mode 100644 index 0000000..aa9e56f --- /dev/null +++ b/packages/字体精简工具/node_modules/currently-unhandled/browser.js @@ -0,0 +1,27 @@ +'use strict'; +var core = require('./core'); + +function unwrapEvent(event) { + if (event && event.detail && event.detail.promise) { + return event.detail; + } + + return event; +} + +module.exports = function (w) { + w = w || window; + var c = core(); + + w.addEventListener('unhandledrejection', function (event) { + event = unwrapEvent(event); + c.onUnhandledRejection(event.reason, event.promise); + }); + + w.addEventListener('rejectionhandled', function (event) { + event = unwrapEvent(event); + c.onRejectionHandled(event.promise); + }); + + return c.currentlyUnhandled; +}; diff --git a/packages/字体精简工具/node_modules/currently-unhandled/core.js b/packages/字体精简工具/node_modules/currently-unhandled/core.js new file mode 100644 index 0000000..73db22e --- /dev/null +++ b/packages/字体精简工具/node_modules/currently-unhandled/core.js @@ -0,0 +1,33 @@ +'use strict'; +var arrayFindIndex = require('array-find-index'); + +module.exports = function () { + var unhandledRejections = []; + + function onUnhandledRejection(reason, promise) { + unhandledRejections.push({reason: reason, promise: promise}); + } + + function onRejectionHandled(promise) { + var index = arrayFindIndex(unhandledRejections, function (x) { + return x.promise === promise; + }); + + unhandledRejections.splice(index, 1); + } + + function currentlyUnhandled() { + return unhandledRejections.map(function (entry) { + return { + reason: entry.reason, + promise: entry.promise + }; + }); + } + + return { + onUnhandledRejection: onUnhandledRejection, + onRejectionHandled: onRejectionHandled, + currentlyUnhandled: currentlyUnhandled + }; +}; diff --git a/packages/字体精简工具/node_modules/currently-unhandled/index.js b/packages/字体精简工具/node_modules/currently-unhandled/index.js new file mode 100644 index 0000000..238b9d9 --- /dev/null +++ b/packages/字体精简工具/node_modules/currently-unhandled/index.js @@ -0,0 +1,12 @@ +'use strict'; +var core = require('./core'); + +module.exports = function (p) { + p = p || process; + var c = core(); + + p.on('unhandledRejection', c.onUnhandledRejection); + p.on('rejectionHandled', c.onRejectionHandled); + + return c.currentlyUnhandled; +}; diff --git a/packages/字体精简工具/node_modules/currently-unhandled/license b/packages/字体精简工具/node_modules/currently-unhandled/license new file mode 100644 index 0000000..ad5d021 --- /dev/null +++ b/packages/字体精简工具/node_modules/currently-unhandled/license @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (c) James Talmage (github.com/jamestalmage) + +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/packages/字体精简工具/node_modules/currently-unhandled/package.json b/packages/字体精简工具/node_modules/currently-unhandled/package.json new file mode 100644 index 0000000..caf8184 --- /dev/null +++ b/packages/字体精简工具/node_modules/currently-unhandled/package.json @@ -0,0 +1,103 @@ +{ + "_from": "currently-unhandled@^0.4.1", + "_id": "currently-unhandled@0.4.1", + "_inBundle": false, + "_integrity": "sha1-mI3zP+qxke95mmE2nddsF635V+o=", + "_location": "/currently-unhandled", + "_phantomChildren": {}, + "_requested": { + "type": "range", + "registry": true, + "raw": "currently-unhandled@^0.4.1", + "name": "currently-unhandled", + "escapedName": "currently-unhandled", + "rawSpec": "^0.4.1", + "saveSpec": null, + "fetchSpec": "^0.4.1" + }, + "_requiredBy": [ + "/loud-rejection" + ], + "_resolved": "https://registry.npm.taobao.org/currently-unhandled/download/currently-unhandled-0.4.1.tgz", + "_shasum": "988df33feab191ef799a61369dd76c17adf957ea", + "_spec": "currently-unhandled@^0.4.1", + "_where": "D:\\workspace\\plugin\\mini_font\\packages\\mini_font\\publish\\mini_font\\node_modules\\loud-rejection", + "author": { + "name": "James Talmage", + "email": "james@talmage.io", + "url": "github.com/jamestalmage" + }, + "ava": { + "files": "test.js" + }, + "browser": { + "./index.js": "./browser.js" + }, + "bugs": { + "url": "https://github.com/jamestalmage/currently-unhandled/issues" + }, + "bundleDependencies": false, + "dependencies": { + "array-find-index": "^1.0.1" + }, + "deprecated": false, + "description": "Track the list of currently unhandled promise rejections.", + "devDependencies": { + "ava": "^0.15.1", + "bluebird": "^3.4.0", + "browserify": "^13.0.1", + "coveralls": "^2.11.9", + "delay": "^1.3.1", + "is-ci": "^1.0.8", + "karma": "^0.13.22", + "karma-browserify": "^5.0.5", + "karma-chrome-launcher": "^1.0.1", + "karma-firefox-launcher": "^1.0.0", + "karma-mocha": "^1.0.1", + "mocha": "^2.5.3", + "nyc": "^6.4.0", + "watchify": "^3.7.0", + "xo": "^0.15.0" + }, + "engines": { + "node": ">=0.10.0" + }, + "files": [ + "index.js", + "core.js", + "browser.js" + ], + "homepage": "https://github.com/jamestalmage/currently-unhandled#readme", + "keywords": [ + "unhandled", + "unhandledRejection", + "rejected", + "promises" + ], + "license": "MIT", + "name": "currently-unhandled", + "nyc": { + "reporter": [ + "lcov", + "text" + ] + }, + "repository": { + "type": "git", + "url": "git+https://github.com/jamestalmage/currently-unhandled.git" + }, + "scripts": { + "test": "xo && nyc ava" + }, + "version": "0.4.1", + "xo": { + "ignores": [ + "browser-bluebird-test.js" + ], + "envs": [ + "browser", + "mocha", + "node" + ] + } +} diff --git a/packages/字体精简工具/node_modules/currently-unhandled/readme.md b/packages/字体精简工具/node_modules/currently-unhandled/readme.md new file mode 100644 index 0000000..b73c568 --- /dev/null +++ b/packages/字体精简工具/node_modules/currently-unhandled/readme.md @@ -0,0 +1,44 @@ +# currently-unhandled [![Build Status](https://travis-ci.org/jamestalmage/currently-unhandled.svg?branch=master)](https://travis-ci.org/jamestalmage/currently-unhandled) [![Coverage Status](https://coveralls.io/repos/github/jamestalmage/currently-unhandled/badge.svg?branch=master)](https://coveralls.io/github/jamestalmage/currently-unhandled?branch=master) + +> Track the list of currently unhandled promise rejections. + + +## Install + +``` +$ npm install --save currently-unhandled +``` + + +## Usage + +```js +const currentlyUnhandled = require('currently-unhandled')(); // <- note the invocation + +var fooError = new Error('foo'); +var p = Promise.reject(new Error('foo')); + +// on the next tick - unhandled rejected promise is added to the list: +currentlyUnhandled(); +//=> [{promise: p, reason: fooError}]' + +p.catch(() => {}); + +// on the next tick - handled promise is now removed from the list: +currentlyUnhandled(); +//=> []; +``` + +## API + +### currentlyUnhandled() + +Returns an array of objects with `promise` and `reason` properties representing the rejected promises that currently do not have a rejection handler. The list grows and shrinks as unhandledRejections are published, and later handled. + +## Browser Support + +This module can be bundled with `browserify`. At time of writing, it will work with native Promises in the Chrome browser only. For best cross-browser support, use `bluebird` instead of native Promise support in browsers. + +## License + +MIT © [James Talmage](http://github.com/jamestalmage) diff --git a/packages/字体精简工具/node_modules/dashdash/CHANGES.md b/packages/字体精简工具/node_modules/dashdash/CHANGES.md new file mode 100644 index 0000000..d7c8f4e --- /dev/null +++ b/packages/字体精简工具/node_modules/dashdash/CHANGES.md @@ -0,0 +1,364 @@ +# node-dashdash changelog + +## not yet released + +(nothing yet) + +## 1.14.1 + +- [issue #30] Change the output used by dashdash's Bash completion support to + indicate "there are no completions for this argument" to cope with different + sorting rules on different Bash/platforms. For example: + + $ triton -v -p test2 package get # before + ##-no -tritonpackage- completions-## + + $ triton -v -p test2 package get # after + ##-no-completion- -results-## + +## 1.14.0 + +- New `synopsisFromOpt(