@polkadot/x-textdecoder
Advanced tools
Comparing version 10.1.11 to 10.1.12
// Copyright 2017-2022 @polkadot/x-textencoder authors & contributors | ||
// SPDX-License-Identifier: Apache-2.0 | ||
import { extractGlobal } from '@polkadot/x-global'; | ||
@@ -4,0 +5,0 @@ import { TextDecoder as Fallback } from "./fallback.js"; |
@@ -13,12 +13,9 @@ "use strict"; | ||
}); | ||
var _xGlobal = require("@polkadot/x-global"); | ||
var _fallback = require("./fallback"); | ||
var _packageInfo = require("./packageInfo"); | ||
// Copyright 2017-2022 @polkadot/x-textencoder authors & contributors | ||
// SPDX-License-Identifier: Apache-2.0 | ||
const TextDecoder = (0, _xGlobal.extractGlobal)('TextDecoder', _fallback.TextDecoder); | ||
exports.TextDecoder = TextDecoder; |
@@ -7,23 +7,19 @@ "use strict"; | ||
exports.TextDecoder = void 0; | ||
// Copyright 2017-2022 @polkadot/x-textencoder authors & contributors | ||
// SPDX-License-Identifier: Apache-2.0 | ||
// This is very limited, only handling Ascii values | ||
class TextDecoder { | ||
// eslint-disable-next-line @typescript-eslint/no-unused-vars,no-useless-constructor | ||
constructor(_) {// nothing | ||
constructor(_) { | ||
// nothing | ||
} | ||
decode(value) { | ||
let result = ''; | ||
for (let i = 0; i < value.length; i++) { | ||
result += String.fromCharCode(value[i]); | ||
} | ||
return result; | ||
} | ||
} | ||
exports.TextDecoder = TextDecoder; |
"use strict"; | ||
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault"); | ||
Object.defineProperty(exports, "__esModule", { | ||
@@ -15,12 +14,9 @@ value: true | ||
}); | ||
var _util = _interopRequireDefault(require("util")); | ||
var _xGlobal = require("@polkadot/x-global"); | ||
var _packageInfo = require("./packageInfo"); | ||
// Copyright 2017-2022 @polkadot/x-textencoder authors & contributors | ||
// SPDX-License-Identifier: Apache-2.0 | ||
const TextDecoder = (0, _xGlobal.extractGlobal)('TextDecoder', _util.default.TextDecoder); | ||
exports.TextDecoder = TextDecoder; |
@@ -9,3 +9,5 @@ "use strict"; | ||
// SPDX-License-Identifier: Apache-2.0 | ||
// Do not edit, auto-generated by @polkadot/dev | ||
const packageInfo = { | ||
@@ -15,4 +17,4 @@ name: '@polkadot/x-textdecoder', | ||
type: 'cjs', | ||
version: '10.1.11' | ||
version: '10.1.12' | ||
}; | ||
exports.packageInfo = packageInfo; |
@@ -18,3 +18,2 @@ "use strict"; | ||
}); | ||
var _browser = require("./browser"); |
"use strict"; | ||
var _xGlobal = require("@polkadot/x-global"); | ||
var _xTextdecoder = require("@polkadot/x-textdecoder"); | ||
// Copyright 2017-2022 @polkadot/x-textdecoder authors & contributors | ||
// SPDX-License-Identifier: Apache-2.0 | ||
(0, _xGlobal.exposeGlobal)('TextDecoder', _xTextdecoder.TextDecoder); |
"use strict"; | ||
var _browser = require("./browser"); | ||
var _node = require("./node"); | ||
// Copyright 2017-2022 @polkadot/x-textdecoder authors & contributors | ||
// SPDX-License-Identifier: Apache-2.0 | ||
console.log(new _browser.TextDecoder('utf-8').decode(new Uint8Array([1, 2, 3]))); | ||
console.log(new _node.TextDecoder('utf-8').decode(new Uint8Array([1, 2, 3]))); |
// Copyright 2017-2022 @polkadot/x-textencoder authors & contributors | ||
// SPDX-License-Identifier: Apache-2.0 | ||
// This is very limited, only handling Ascii values | ||
export class TextDecoder { | ||
// eslint-disable-next-line @typescript-eslint/no-unused-vars,no-useless-constructor | ||
constructor(_) {// nothing | ||
constructor(_) { | ||
// nothing | ||
} | ||
decode(value) { | ||
let result = ''; | ||
for (let i = 0; i < value.length; i++) { | ||
result += String.fromCharCode(value[i]); | ||
} | ||
return result; | ||
} | ||
} |
// Copyright 2017-2022 @polkadot/x-textencoder authors & contributors | ||
// SPDX-License-Identifier: Apache-2.0 | ||
import util from 'util'; | ||
@@ -4,0 +5,0 @@ import { extractGlobal } from '@polkadot/x-global'; |
@@ -20,3 +20,3 @@ { | ||
"type": "module", | ||
"version": "10.1.11", | ||
"version": "10.1.12", | ||
"main": "./cjs/node.js", | ||
@@ -93,8 +93,8 @@ "module": "./node.js", | ||
"dependencies": { | ||
"@babel/runtime": "^7.19.4", | ||
"@polkadot/x-global": "10.1.11" | ||
"@babel/runtime": "^7.20.1", | ||
"@polkadot/x-global": "10.1.12" | ||
}, | ||
"denoDependencies": { | ||
"util": "std@0.148.0/node/util.ts" | ||
"util": "std@0.161.0/node/util.ts" | ||
} | ||
} |
// Copyright 2017-2022 @polkadot/x-textdecoder authors & contributors | ||
// SPDX-License-Identifier: Apache-2.0 | ||
// Do not edit, auto-generated by @polkadot/dev | ||
export const packageInfo = { | ||
@@ -8,3 +10,3 @@ name: '@polkadot/x-textdecoder', | ||
type: 'esm', | ||
version: '10.1.11' | ||
version: '10.1.12' | ||
}; |
// Copyright 2017-2022 @polkadot/x-textencoder authors & contributors | ||
// SPDX-License-Identifier: Apache-2.0 | ||
export { TextDecoder, packageInfo } from "./browser.js"; |
// Copyright 2017-2022 @polkadot/x-textdecoder authors & contributors | ||
// SPDX-License-Identifier: Apache-2.0 | ||
import { exposeGlobal } from '@polkadot/x-global'; | ||
import { TextDecoder } from '@polkadot/x-textdecoder'; | ||
exposeGlobal('TextDecoder', TextDecoder); |
// Copyright 2017-2022 @polkadot/x-textdecoder authors & contributors | ||
// SPDX-License-Identifier: Apache-2.0 | ||
import { TextDecoder as BrowserTD } from "./browser.js"; | ||
@@ -4,0 +5,0 @@ import { TextDecoder as NodeTD } from "./node.js"; |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
9290
164
+ Added@polkadot/x-global@10.1.12(transitive)
- Removed@polkadot/x-global@10.1.11(transitive)
Updated@babel/runtime@^7.20.1
Updated@polkadot/x-global@10.1.12