@polkadot/x-textdecoder
Advanced tools
Comparing version 10.4.2 to 11.0.1
@@ -1,7 +0,4 @@ | ||
// Copyright 2017-2023 @polkadot/x-textencoder authors & contributors | ||
// SPDX-License-Identifier: Apache-2.0 | ||
import { extractGlobal } from '@polkadot/x-global'; | ||
import { TextDecoder as Fallback } from "./fallback.js"; | ||
export { packageInfo } from "./packageInfo.js"; | ||
export const TextDecoder = extractGlobal('TextDecoder', Fallback); | ||
import { TextDecoder as Fallback } from './fallback.js'; | ||
export { packageInfo } from './packageInfo.js'; | ||
export const TextDecoder = /*#__PURE__*/ extractGlobal('TextDecoder', Fallback); |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { | ||
value: true | ||
}); | ||
exports.TextDecoder = void 0; | ||
Object.defineProperty(exports, "packageInfo", { | ||
enumerable: true, | ||
get: function () { | ||
return _packageInfo.packageInfo; | ||
} | ||
}); | ||
var _xGlobal = require("@polkadot/x-global"); | ||
var _fallback = require("./fallback"); | ||
var _packageInfo = require("./packageInfo"); | ||
// Copyright 2017-2023 @polkadot/x-textencoder authors & contributors | ||
// SPDX-License-Identifier: Apache-2.0 | ||
const TextDecoder = (0, _xGlobal.extractGlobal)('TextDecoder', _fallback.TextDecoder); | ||
exports.TextDecoder = TextDecoder; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.TextDecoder = exports.packageInfo = void 0; | ||
const x_global_1 = require("@polkadot/x-global"); | ||
const fallback_1 = require("./fallback"); | ||
var packageInfo_1 = require("./packageInfo"); | ||
Object.defineProperty(exports, "packageInfo", { enumerable: true, get: function () { return packageInfo_1.packageInfo; } }); | ||
exports.TextDecoder = (0, x_global_1.extractGlobal)('TextDecoder', fallback_1.TextDecoder); |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { | ||
value: true | ||
}); | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.TextDecoder = void 0; | ||
// Copyright 2017-2023 @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 | ||
} | ||
decode(value) { | ||
let result = ''; | ||
for (let i = 0; i < value.length; i++) { | ||
result += String.fromCharCode(value[i]); | ||
// eslint-disable-next-line @typescript-eslint/no-unused-vars,no-useless-constructor | ||
constructor(_) { | ||
// nothing | ||
} | ||
return result; | ||
} | ||
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", { | ||
value: true | ||
}); | ||
exports.TextDecoder = void 0; | ||
Object.defineProperty(exports, "packageInfo", { | ||
enumerable: true, | ||
get: function () { | ||
return _packageInfo.packageInfo; | ||
} | ||
}); | ||
var _util = _interopRequireDefault(require("util")); | ||
var _xGlobal = require("@polkadot/x-global"); | ||
var _packageInfo = require("./packageInfo"); | ||
// Copyright 2017-2023 @polkadot/x-textencoder authors & contributors | ||
// SPDX-License-Identifier: Apache-2.0 | ||
const TextDecoder = (0, _xGlobal.extractGlobal)('TextDecoder', _util.default.TextDecoder); | ||
exports.TextDecoder = TextDecoder; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.TextDecoder = exports.packageInfo = void 0; | ||
const tslib_1 = require("tslib"); | ||
const util_1 = tslib_1.__importDefault(require("util")); | ||
const x_global_1 = require("@polkadot/x-global"); | ||
var packageInfo_1 = require("./packageInfo"); | ||
Object.defineProperty(exports, "packageInfo", { enumerable: true, get: function () { return packageInfo_1.packageInfo; } }); | ||
exports.TextDecoder = (0, x_global_1.extractGlobal)('TextDecoder', util_1.default.TextDecoder); |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { | ||
value: true | ||
}); | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.packageInfo = void 0; | ||
// Copyright 2017-2023 @polkadot/x-textdecoder authors & contributors | ||
// SPDX-License-Identifier: Apache-2.0 | ||
// Do not edit, auto-generated by @polkadot/dev | ||
const packageInfo = { | ||
name: '@polkadot/x-textdecoder', | ||
path: typeof __dirname === 'string' ? __dirname : 'auto', | ||
type: 'cjs', | ||
version: '10.4.2' | ||
}; | ||
exports.packageInfo = packageInfo; | ||
exports.packageInfo = { name: '@polkadot/x-textdecoder', path: typeof __dirname === 'string' ? __dirname : 'auto', type: 'cjs', version: '11.0.1' }; |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { | ||
value: true | ||
}); | ||
Object.defineProperty(exports, "TextDecoder", { | ||
enumerable: true, | ||
get: function () { | ||
return _browser.TextDecoder; | ||
} | ||
}); | ||
Object.defineProperty(exports, "packageInfo", { | ||
enumerable: true, | ||
get: function () { | ||
return _browser.packageInfo; | ||
} | ||
}); | ||
var _browser = require("./browser"); | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.packageInfo = exports.TextDecoder = void 0; | ||
var browser_1 = require("./browser"); | ||
Object.defineProperty(exports, "TextDecoder", { enumerable: true, get: function () { return browser_1.TextDecoder; } }); | ||
Object.defineProperty(exports, "packageInfo", { enumerable: true, get: function () { return browser_1.packageInfo; } }); |
"use strict"; | ||
var _xGlobal = require("@polkadot/x-global"); | ||
var _xTextdecoder = require("@polkadot/x-textdecoder"); | ||
// Copyright 2017-2023 @polkadot/x-textdecoder authors & contributors | ||
// SPDX-License-Identifier: Apache-2.0 | ||
(0, _xGlobal.exposeGlobal)('TextDecoder', _xTextdecoder.TextDecoder); | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
const x_global_1 = require("@polkadot/x-global"); | ||
const x_textdecoder_1 = require("@polkadot/x-textdecoder"); | ||
(0, x_global_1.exposeGlobal)('TextDecoder', x_textdecoder_1.TextDecoder); |
"use strict"; | ||
var _browser = require("./browser"); | ||
var _node = require("./node"); | ||
// Copyright 2017-2023 @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]))); | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
const browser_1 = require("./browser"); | ||
const node_1 = require("./node"); | ||
console.log(new browser_1.TextDecoder('utf-8').decode(new Uint8Array([1, 2, 3]))); | ||
console.log(new node_1.TextDecoder('utf-8').decode(new Uint8Array([1, 2, 3]))); |
@@ -1,17 +0,13 @@ | ||
// Copyright 2017-2023 @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 | ||
} | ||
decode(value) { | ||
let result = ''; | ||
for (let i = 0; i < value.length; i++) { | ||
result += String.fromCharCode(value[i]); | ||
// eslint-disable-next-line @typescript-eslint/no-unused-vars,no-useless-constructor | ||
constructor(_) { | ||
// nothing | ||
} | ||
return result; | ||
} | ||
decode(value) { | ||
let result = ''; | ||
for (let i = 0; i < value.length; i++) { | ||
result += String.fromCharCode(value[i]); | ||
} | ||
return result; | ||
} | ||
} |
@@ -1,7 +0,4 @@ | ||
// Copyright 2017-2023 @polkadot/x-textencoder authors & contributors | ||
// SPDX-License-Identifier: Apache-2.0 | ||
import util from 'util'; | ||
import { extractGlobal } from '@polkadot/x-global'; | ||
export { packageInfo } from "./packageInfo.js"; | ||
export const TextDecoder = extractGlobal('TextDecoder', util.TextDecoder); | ||
export { packageInfo } from './packageInfo.js'; | ||
export const TextDecoder = /*#__PURE__*/ extractGlobal('TextDecoder', util.TextDecoder); |
@@ -20,3 +20,3 @@ { | ||
"type": "module", | ||
"version": "10.4.2", | ||
"version": "11.0.1", | ||
"main": "./cjs/node.js", | ||
@@ -60,3 +60,6 @@ "module": "./node.js", | ||
}, | ||
"./package.json": "./package.json", | ||
"./package.json": { | ||
"require": "./cjs/package.json", | ||
"default": "./package.json" | ||
}, | ||
"./packageInfo.js": { | ||
@@ -94,4 +97,4 @@ "types": "./packageInfo.d.ts", | ||
"dependencies": { | ||
"@babel/runtime": "^7.20.13", | ||
"@polkadot/x-global": "10.4.2" | ||
"@polkadot/x-global": "11.0.1", | ||
"tslib": "^2.5.0" | ||
}, | ||
@@ -98,0 +101,0 @@ "denoDependencies": { |
@@ -1,11 +0,1 @@ | ||
// Copyright 2017-2023 @polkadot/x-textdecoder authors & contributors | ||
// SPDX-License-Identifier: Apache-2.0 | ||
// Do not edit, auto-generated by @polkadot/dev | ||
export const packageInfo = { | ||
name: '@polkadot/x-textdecoder', | ||
path: (import.meta && import.meta.url) ? new URL(import.meta.url).pathname.substring(0, new URL(import.meta.url).pathname.lastIndexOf('/') + 1) : 'auto', | ||
type: 'esm', | ||
version: '10.4.2' | ||
}; | ||
export const packageInfo = { name: '@polkadot/x-textdecoder', path: (import.meta && import.meta.url) ? new URL(import.meta.url).pathname.substring(0, new URL(import.meta.url).pathname.lastIndexOf('/') + 1) : 'auto', type: 'esm', version: '11.0.1' }; |
@@ -1,4 +0,1 @@ | ||
// Copyright 2017-2023 @polkadot/x-textencoder authors & contributors | ||
// SPDX-License-Identifier: Apache-2.0 | ||
export { TextDecoder, packageInfo } from "./browser.js"; | ||
export { TextDecoder, packageInfo } from './browser.js'; |
@@ -1,6 +0,3 @@ | ||
// Copyright 2017-2023 @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); |
@@ -1,7 +0,4 @@ | ||
// Copyright 2017-2023 @polkadot/x-textdecoder authors & contributors | ||
// SPDX-License-Identifier: Apache-2.0 | ||
import { TextDecoder as BrowserTD } from "./browser.js"; | ||
import { TextDecoder as NodeTD } from "./node.js"; | ||
import { TextDecoder as BrowserTD } from './browser.js'; | ||
import { TextDecoder as NodeTD } from './node.js'; | ||
console.log(new BrowserTD('utf-8').decode(new Uint8Array([1, 2, 3]))); | ||
console.log(new NodeTD('utf-8').decode(new Uint8Array([1, 2, 3]))); |
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
18559
94
+ Addedtslib@^2.5.0
+ Added@polkadot/x-global@11.0.1(transitive)
+ Addedtslib@2.8.1(transitive)
- Removed@babel/runtime@^7.20.13
- Removed@babel/runtime@7.26.0(transitive)
- Removed@polkadot/x-global@10.4.2(transitive)
- Removedregenerator-runtime@0.14.1(transitive)
Updated@polkadot/x-global@11.0.1