@webex/common-evented 3.0.0-bnr.5 → 3.0.0-next.2
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/.eslintrc.js +6 -0
- package/babel.config.js +3 -0
- package/dist/index.js.map +1 -1
- package/jest.config.js +3 -0
- package/package.json +23 -6
- package/process +1 -0
- package/dist/common-evented.d.ts +0 -12
- package/dist/tsdoc-metadata.json +0 -11
- package/dist/types/index.d.ts +0 -9
package/.eslintrc.js
ADDED
package/babel.config.js
ADDED
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["data","make","evented","target","prop","descriptor","defaultValue","initializer","get","value","set","previous","trigger"],"sources":["index.js"],"sourcesContent":["import {make} from '@webex/common';\n\nconst data = new (make(WeakMap, Map))();\n\n/**\n * Given a class property, this decorator changes it into a setter/getter pair;\n * the setter will trigger `change:${prop}` when invoked\n * @param {Object} target\n * @param {string} prop\n * @param {Object} descriptor\n * @returns {undefined}\n */\nexport default function evented(target, prop, descriptor) {\n const defaultValue = descriptor.initializer && descriptor.initializer();\n\n Reflect.deleteProperty(descriptor, 'value');\n Reflect.deleteProperty(descriptor, 'initializer');\n Reflect.deleteProperty(descriptor, 'writable');\n\n descriptor.get = function get() {\n const value = data.get(this, prop);\n\n if (typeof value !== 'undefined') {\n return value;\n }\n\n return defaultValue;\n };\n\n descriptor.set = function set(value) {\n const previous = this[prop];\n\n if (previous !== value) {\n data.set(this, prop, value);\n this.trigger(`change:${prop}`, value, previous);\n this.trigger('change');\n }\n };\n}\n"],"mappings":";;;;;;;;;;;AAAA;AAEA,
|
|
1
|
+
{"version":3,"names":["_common","require","data","make","_weakMap","default","_map","evented","target","prop","descriptor","defaultValue","initializer","_deleteProperty","get","value","set","previous","trigger","concat"],"sources":["index.js"],"sourcesContent":["import {make} from '@webex/common';\n\nconst data = new (make(WeakMap, Map))();\n\n/**\n * Given a class property, this decorator changes it into a setter/getter pair;\n * the setter will trigger `change:${prop}` when invoked\n * @param {Object} target\n * @param {string} prop\n * @param {Object} descriptor\n * @returns {undefined}\n */\nexport default function evented(target, prop, descriptor) {\n const defaultValue = descriptor.initializer && descriptor.initializer();\n\n Reflect.deleteProperty(descriptor, 'value');\n Reflect.deleteProperty(descriptor, 'initializer');\n Reflect.deleteProperty(descriptor, 'writable');\n\n descriptor.get = function get() {\n const value = data.get(this, prop);\n\n if (typeof value !== 'undefined') {\n return value;\n }\n\n return defaultValue;\n };\n\n descriptor.set = function set(value) {\n const previous = this[prop];\n\n if (previous !== value) {\n data.set(this, prop, value);\n this.trigger(`change:${prop}`, value, previous);\n this.trigger('change');\n }\n };\n}\n"],"mappings":";;;;;;;;;;;AAAA,IAAAA,OAAA,GAAAC,OAAA;AAEA,IAAMC,IAAI,GAAG,KAAK,IAAAC,YAAI,EAAAC,QAAA,CAAAC,OAAA,EAAAC,IAAA,CAAAD,OAAa,CAAC,EAAE,CAAC;;AAEvC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACe,SAASE,OAAOA,CAACC,MAAM,EAAEC,IAAI,EAAEC,UAAU,EAAE;EACxD,IAAMC,YAAY,GAAGD,UAAU,CAACE,WAAW,IAAIF,UAAU,CAACE,WAAW,CAAC,CAAC;EAEvE,IAAAC,eAAA,CAAAR,OAAA,EAAuBK,UAAU,EAAE,OAAO,CAAC;EAC3C,IAAAG,eAAA,CAAAR,OAAA,EAAuBK,UAAU,EAAE,aAAa,CAAC;EACjD,IAAAG,eAAA,CAAAR,OAAA,EAAuBK,UAAU,EAAE,UAAU,CAAC;EAE9CA,UAAU,CAACI,GAAG,GAAG,SAASA,GAAGA,CAAA,EAAG;IAC9B,IAAMC,KAAK,GAAGb,IAAI,CAACY,GAAG,CAAC,IAAI,EAAEL,IAAI,CAAC;IAElC,IAAI,OAAOM,KAAK,KAAK,WAAW,EAAE;MAChC,OAAOA,KAAK;IACd;IAEA,OAAOJ,YAAY;EACrB,CAAC;EAEDD,UAAU,CAACM,GAAG,GAAG,SAASA,GAAGA,CAACD,KAAK,EAAE;IACnC,IAAME,QAAQ,GAAG,IAAI,CAACR,IAAI,CAAC;IAE3B,IAAIQ,QAAQ,KAAKF,KAAK,EAAE;MACtBb,IAAI,CAACc,GAAG,CAAC,IAAI,EAAEP,IAAI,EAAEM,KAAK,CAAC;MAC3B,IAAI,CAACG,OAAO,WAAAC,MAAA,CAAWV,IAAI,GAAIM,KAAK,EAAEE,QAAQ,CAAC;MAC/C,IAAI,CAACC,OAAO,CAAC,QAAQ,CAAC;IACxB;EACF,CAAC;AACH"}
|
package/jest.config.js
ADDED
package/package.json
CHANGED
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@webex/common-evented",
|
|
3
|
-
"version": "3.0.0-bnr.5",
|
|
4
3
|
"description": "Class property decorator the adds change events to properties",
|
|
5
4
|
"license": "MIT",
|
|
6
5
|
"main": "dist/index.js",
|
|
@@ -20,12 +19,30 @@
|
|
|
20
19
|
]
|
|
21
20
|
},
|
|
22
21
|
"dependencies": {
|
|
23
|
-
"@webex/common": "3.0.0-
|
|
22
|
+
"@webex/common": "3.0.0-next.2"
|
|
24
23
|
},
|
|
25
24
|
"devDependencies": {
|
|
26
|
-
"@
|
|
27
|
-
"@webex/
|
|
25
|
+
"@babel/core": "^7.17.10",
|
|
26
|
+
"@webex/babel-config-legacy": "0.0.0",
|
|
27
|
+
"@webex/eslint-config-legacy": "0.0.0",
|
|
28
|
+
"@webex/jest-config-legacy": "0.0.0",
|
|
29
|
+
"@webex/legacy-tools": "0.0.0",
|
|
30
|
+
"@webex/test-helper-chai": "3.0.0-next.2",
|
|
31
|
+
"@webex/test-helper-mocha": "3.0.0-next.2",
|
|
32
|
+
"@webex/test-helper-mock-webex": "3.0.0-next.2",
|
|
33
|
+
"@webex/test-helper-test-users": "3.0.0-next.2",
|
|
28
34
|
"ampersand-events": "^2.0.2",
|
|
35
|
+
"eslint": "^8.24.0",
|
|
36
|
+
"prettier": "^2.7.1",
|
|
29
37
|
"sinon": "^9.2.4"
|
|
30
|
-
}
|
|
31
|
-
|
|
38
|
+
},
|
|
39
|
+
"scripts": {
|
|
40
|
+
"build": "yarn build:src",
|
|
41
|
+
"build:src": "webex-legacy-tools build -dest \"./dist\" -src \"./src\" -js -ts -maps",
|
|
42
|
+
"deploy:npm": "yarn npm publish",
|
|
43
|
+
"test": "yarn test:style && yarn test:unit && yarn test:integration && yarn test:browser",
|
|
44
|
+
"test:style": "eslint ./src/**/*.*",
|
|
45
|
+
"test:unit": "webex-legacy-tools test --unit --runner jest"
|
|
46
|
+
},
|
|
47
|
+
"version": "3.0.0-next.2"
|
|
48
|
+
}
|
package/process
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
module.exports = {browser: true};
|
package/dist/common-evented.d.ts
DELETED
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Given a class property, this decorator changes it into a setter/getter pair;
|
|
3
|
-
* the setter will trigger `change:${prop}` when invoked
|
|
4
|
-
* @param {Object} target
|
|
5
|
-
* @param {string} prop
|
|
6
|
-
* @param {Object} descriptor
|
|
7
|
-
* @returns {undefined}
|
|
8
|
-
*/
|
|
9
|
-
declare function evented(target: any, prop: string, descriptor: any): undefined;
|
|
10
|
-
export default evented;
|
|
11
|
-
|
|
12
|
-
export { }
|
package/dist/tsdoc-metadata.json
DELETED
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
// This file is read by tools that parse documentation comments conforming to the TSDoc standard.
|
|
2
|
-
// It should be published with your NPM package. It should not be tracked by Git.
|
|
3
|
-
{
|
|
4
|
-
"tsdocVersion": "0.12",
|
|
5
|
-
"toolPackages": [
|
|
6
|
-
{
|
|
7
|
-
"packageName": "@microsoft/api-extractor",
|
|
8
|
-
"packageVersion": "7.34.4"
|
|
9
|
-
}
|
|
10
|
-
]
|
|
11
|
-
}
|
package/dist/types/index.d.ts
DELETED
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Given a class property, this decorator changes it into a setter/getter pair;
|
|
3
|
-
* the setter will trigger `change:${prop}` when invoked
|
|
4
|
-
* @param {Object} target
|
|
5
|
-
* @param {string} prop
|
|
6
|
-
* @param {Object} descriptor
|
|
7
|
-
* @returns {undefined}
|
|
8
|
-
*/
|
|
9
|
-
export default function evented(target: any, prop: string, descriptor: any): undefined;
|