vue-cryptojs 2.2.1 → 2.3.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -1
- package/dist/vue-cryptojs.es5.js +7 -8
- package/dist/vue-cryptojs.min.js +1 -1
- package/package.json +5 -7
package/README.md
CHANGED
|
@@ -26,7 +26,7 @@ This wrapper bind `CryptoJS` to `Vue` or `this` if you're using single file comp
|
|
|
26
26
|
Simple AES text encrypt/decrypt example:
|
|
27
27
|
```js
|
|
28
28
|
const encryptedText = this.$CryptoJS.AES.encrypt("Hi There!", "Secret Passphrase").toString()
|
|
29
|
-
const decryptedText = this.$CryptoJS.AES.decrypt(encryptedText, "Secret Passphrase").toString(this
|
|
29
|
+
const decryptedText = this.$CryptoJS.AES.decrypt(encryptedText, "Secret Passphrase").toString(this.$CryptoJS.enc.Utf8)
|
|
30
30
|
```
|
|
31
31
|
|
|
32
32
|
Directly on a template:
|
package/dist/vue-cryptojs.es5.js
CHANGED
|
@@ -4,15 +4,15 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports["default"] = void 0;
|
|
7
|
-
|
|
8
7
|
var _cryptoJs = _interopRequireDefault(require("crypto-js"));
|
|
9
|
-
|
|
10
8
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
|
11
|
-
|
|
12
9
|
/* eslint-disable */
|
|
10
|
+
|
|
13
11
|
var VueCryptojs = {
|
|
14
12
|
install: function install(Vue, options) {
|
|
15
|
-
Vue.CryptoJS = _cryptoJs["default"];
|
|
13
|
+
Vue.CryptoJS = _cryptoJs["default"];
|
|
14
|
+
|
|
15
|
+
// VueJS 2
|
|
16
16
|
|
|
17
17
|
if (Vue.prototype) {
|
|
18
18
|
Object.defineProperties(Vue.prototype, {
|
|
@@ -27,21 +27,20 @@ var VueCryptojs = {
|
|
|
27
27
|
}
|
|
28
28
|
}
|
|
29
29
|
});
|
|
30
|
-
}
|
|
30
|
+
}
|
|
31
31
|
|
|
32
|
+
// VueJS 3
|
|
32
33
|
|
|
33
34
|
if (Vue.config && Vue.config.globalProperties) {
|
|
34
35
|
Vue.config.globalProperties.$CryptoJS = _cryptoJs["default"];
|
|
35
36
|
}
|
|
36
|
-
|
|
37
37
|
if (Vue.provide && typeof Vue.provide === 'function') {
|
|
38
38
|
Vue.provide('cryptojs', _cryptoJs["default"]);
|
|
39
39
|
}
|
|
40
|
-
|
|
41
40
|
if (typeof window !== 'undefined' && window.Vue) {
|
|
42
41
|
window.Vue.use(VueCryptojs);
|
|
43
42
|
}
|
|
44
43
|
}
|
|
45
44
|
};
|
|
46
45
|
var _default = VueCryptojs;
|
|
47
|
-
exports["default"] = _default;
|
|
46
|
+
exports["default"] = _default;
|
package/dist/vue-cryptojs.min.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports
|
|
1
|
+
"use strict";var _cryptoJs=_interopRequireDefault(require("crypto-js"));Object.defineProperty(exports,"__esModule",{value:!0}),exports["default"]=void 0;function _interopRequireDefault(a){return a&&a.__esModule?a:{default:a}}/* eslint-disable */var VueCryptojs={install:function install(a){a.CryptoJS=_cryptoJs["default"],a.prototype&&Object.defineProperties(a.prototype,{$CryptoJS:{get:function get(){return _cryptoJs["default"]}},CryptoJS:{get:function get(){return _cryptoJs["default"]}}}),a.config&&a.config.globalProperties&&(a.config.globalProperties.$CryptoJS=_cryptoJs["default"]),a.provide&&"function"==typeof a.provide&&a.provide("cryptojs",_cryptoJs["default"]),"undefined"!=typeof window&&window.Vue&&window.Vue.use(VueCryptojs)}},_default=VueCryptojs;exports["default"]=_default;
|
package/package.json
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "vue-cryptojs",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.3.1",
|
|
4
4
|
"description": "A small wrapper for integrating crypto-js into VueJS",
|
|
5
5
|
"main": "dist/vue-cryptojs.min.js",
|
|
6
6
|
"scripts": {
|
|
7
7
|
"test": "node --experimental-modules test/index.mjs",
|
|
8
|
-
"build": "
|
|
8
|
+
"build": "npx babel ./src/index.mjs --out-file ./dist/vue-cryptojs.es5.js --presets=@babel/env && npx babel ./src/index.mjs --out-file ./dist/vue-cryptojs.min.js --presets=@babel/env,minify"
|
|
9
9
|
},
|
|
10
10
|
"keywords": [
|
|
11
11
|
"crypto",
|
|
@@ -25,12 +25,10 @@
|
|
|
25
25
|
"vue": ">= 2.0.0"
|
|
26
26
|
},
|
|
27
27
|
"devDependencies": {
|
|
28
|
-
"@babel/
|
|
28
|
+
"@babel/cli": "^7.17.10",
|
|
29
|
+
"@babel/core": "^7.18.2",
|
|
29
30
|
"@babel/preset-env": "^7.10.4",
|
|
30
|
-
"
|
|
31
|
-
"gulp-babel": "^8.0.0",
|
|
32
|
-
"gulp-rename": "^1.2.2",
|
|
33
|
-
"gulp-uglify": "^3.0.2",
|
|
31
|
+
"babel-preset-minify": "^0.5.2",
|
|
34
32
|
"vue": "^2.6.11"
|
|
35
33
|
},
|
|
36
34
|
"dependencies": {
|