@psdk/frame-father
Advanced tools
Comparing version 0.5.6 to 0.5.7
"use strict"; | ||
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { | ||
if (k2 === undefined) k2 = k; | ||
var desc = Object.getOwnPropertyDescriptor(m, k); | ||
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { | ||
desc = { enumerable: true, get: function() { return m[k]; } }; | ||
} | ||
Object.defineProperty(o, k2, desc); | ||
}) : (function(o, m, k, k2) { | ||
if (k2 === undefined) k2 = k; | ||
o[k2] = m[k]; | ||
})); | ||
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { | ||
Object.defineProperty(o, "default", { enumerable: true, value: v }); | ||
}) : function(o, v) { | ||
o["default"] = v; | ||
}); | ||
var __importStar = (this && this.__importStar) || function (mod) { | ||
if (mod && mod.__esModule) return mod; | ||
var result = {}; | ||
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); | ||
__setModuleDefault(result, mod); | ||
return result; | ||
}; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
@@ -11,2 +34,3 @@ exports.DefaultCommand = exports.BasicCommand = void 0; | ||
const toolkit_1 = require("../../../toolkit"); | ||
const iconv = __importStar(require("iconv-lite")); | ||
class BasicCommand { | ||
@@ -28,4 +52,4 @@ base64() { | ||
//# use gbk encoding | ||
// const t_buffer = iconv.encode(t, clause.charset ?? PsdkConst.DEF_CHARSET); | ||
const t_buffer = toolkit_1.FastGBK.encode(t); | ||
const t_buffer = iconv.encode(t, clause.charset ?? types_1.PsdkConst.DEF_CHARSET); | ||
// const t_buffer = FastGBK.encode(t); | ||
const t_binary = Array.prototype.slice.call(t_buffer, 0); | ||
@@ -32,0 +56,0 @@ bytes = bytes.concat(t_binary); |
@@ -0,1 +1,4 @@ | ||
/** | ||
* Binary command | ||
*/ | ||
import { CommandClause } from "../print/command_clause"; | ||
@@ -2,0 +5,0 @@ export declare class BinaryCommand { |
"use strict"; | ||
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { | ||
if (k2 === undefined) k2 = k; | ||
var desc = Object.getOwnPropertyDescriptor(m, k); | ||
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { | ||
desc = { enumerable: true, get: function() { return m[k]; } }; | ||
} | ||
Object.defineProperty(o, k2, desc); | ||
}) : (function(o, m, k, k2) { | ||
if (k2 === undefined) k2 = k; | ||
o[k2] = m[k]; | ||
})); | ||
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { | ||
Object.defineProperty(o, "default", { enumerable: true, value: v }); | ||
}) : function(o, v) { | ||
o["default"] = v; | ||
}); | ||
var __importStar = (this && this.__importStar) || function (mod) { | ||
if (mod && mod.__esModule) return mod; | ||
var result = {}; | ||
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); | ||
__setModuleDefault(result, mod); | ||
return result; | ||
}; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.BinaryCommand = void 0; | ||
/** | ||
* Binary command | ||
*/ | ||
const command_clause_1 = require("../print/command_clause"); | ||
// import * as iconv from 'iconv-lite'; | ||
const toolkit_1 = require("../../../toolkit"); | ||
const types_1 = require("../../types"); | ||
const iconv = __importStar(require("iconv-lite")); | ||
// import {FastGBK} from "../../../toolkit"; | ||
class BinaryCommand { | ||
@@ -24,5 +51,5 @@ binary; | ||
appendText(text, charset) { | ||
// const encoding = (charset ?? PsdkConst.DEF_CHARSET).toLowerCase(); | ||
// const binary = iconv.encode(text, encoding); | ||
const binary = toolkit_1.FastGBK.encode(text); | ||
const encoding = (charset ?? types_1.PsdkConst.DEF_CHARSET).toLowerCase(); | ||
const binary = iconv.encode(text, encoding); | ||
// const binary = FastGBK.encode(text); | ||
this.binary.push(...binary); | ||
@@ -29,0 +56,0 @@ return this; |
@@ -5,2 +5,3 @@ 'use strict'; | ||
// https://github.com/EtherDream/str2gbk/blob/main/index.js | ||
//# Only support TextDecoder can use this class | ||
let table; | ||
@@ -7,0 +8,0 @@ function initGbkTable() { |
{ | ||
"name": "@psdk/frame-father", | ||
"version": "0.5.6", | ||
"version": "0.5.7", | ||
"description": "psdk", | ||
"main": "build/index.js", | ||
"main": "dist/index.js", | ||
"types": "build/index.d.ts", | ||
@@ -20,2 +20,3 @@ "scripts": { | ||
"@vercel/ncc": "^0.38.1", | ||
"iconv-lite": "^0.6.3", | ||
"jest": "^29.7.0", | ||
@@ -31,3 +32,3 @@ "ts-jest": "^29.1.5", | ||
], | ||
"gitHead": "0cd3db525a6083a8a1b6c9124599aea41e86196d" | ||
"gitHead": "dfce96c5ea869cafacb6e007e3f33832156a77ec" | ||
} |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
High entropy strings
Supply chain riskContains high entropy strings. This could be a sign of encrypted data, leaked secrets or obfuscated code.
Found 1 instance in 1 package
Long strings
Supply chain riskContains long string literals, which may be a sign of obfuscated or packed code.
Found 1 instance in 1 package
718149
4019
8
18